Echelon LNS User Manual

Page 213

Advertising
background image

LNS Programmer's Guide

199

4. Get the device that you plan to send explicit messages to with the new

message monitor point.

Set MySubsystem =MySubsystems.Item(“Third Floor Room 7”)

Set MyAppDevices = MySubsystem.AppDevices

Set MyAppDevice= MyAppDevices.Item("Vent")

5. Get

the

msg_in message tag on the application device selected in step 4,

and connect it to the dynamic message tag you created on the Network
Service Device.

Set MyInterface = MyAppDevice.Interface

Set MyMessageTags = MyInterface.MessageTags

Set MyTag = MyMessageTags.Item("msg_in”)

NsdDynamicMessageTag.AddTarget(MyTag)

6. Repeat steps 4 and 5 for all the application devices you want to send

explicit messages to. Then, call Connect() to instantiate the connection.

NsdDynamicMessageTag.Connect()

NOTE: You can only add 25 targets to a connection each time you call the
Connect() method. If you need to add more than 25 targets to the

connection, you should add 25 targets and call Connect() to create the
connection. Then, add the remaining targets, and call Connect() again.

See Chapters 6 and 7 for more detailed information on creating
connections.

7. Access the monitor set’s

MsgMonitorPoints

collection, and call the

Add()

method to add a message monitor point to the monitor set. Pass

the message tag created on the Network Service Device
(NsdMessageTag) as the targetDevice element.

Dim MyMsgPoints as LcaMsgMonitorPoints

Dim NewMsgPoint as LcaMsgMonitorPoint

Set MyMsgPoints = MonSet.MsgMonitorPoints

Set NewMsgPoint = MyMsgPoints.Add _

("msgP1",NsdDynamicMessageTag, nothing)

8. Set the properties of the new

MsgMonitorPoint

object. Two properties

you should initially set are the

Tag

property and the

DefaultOptions

properties. You can use the

DefaultOptions

property to set the default

monitoring options that will be applied to the new monitor point each
time it is enabled. See the LNS Object Server Reference help file for more

information on the

Tag

property, and for a complete list of the properties

of the

MsgMonitorPoint

object. For more information on monitoring

options, see Setting Monitoring Options on page 200.

9. If you started a transaction in step 2, commit the transaction to the

database.

MySystem.CommitTransaction()

10. You can now enable the monitor point in monitor and control operations.

For more information on this, see Opening and Enabling Monitor Sets on
page 213.

Advertising