Echelon LNS User Manual

Page 212

Advertising
background image

LNS Programmer's Guide

198

6. Get the monitor set you will use to monitor the messages. You should

have first created a monitor set for this purpose, as described in Creating
Monitor Sets.
Remember that when adding monitor points to a monitor
set, you should access the set through the MyVni property.

Set MyMonSets = MonVNI.MonitorSets

Set MyMonSet = MyMonSets.Item(“Monitor Set 1”)

7. Access the monitor set’s

MsgMonitorPoints

collection, and call the

Add()

method to add a message monitor point to the monitor set, passing

in the AppDevice selected in step 3 as the

targetDevice

element.

Dim MyMsgPoints As LcaMsgMonitorPoints

Dim MyMP As LcaMsgMonitorPoint

Set MyMsgPoints = MyMonSet.MsgMonitorPoints

Set MyMP =MyMsgMonitorPoints.Add("msgp1",MonVni,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 are 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.

To create a permanent message monitor point to send explicit messages to multiple

devices simultaneously, follow these steps. Note that you cannot use a temporary
message monitor points to send explicit messages to multiple devices simultaneously:

1. Open

the

ObjectServer

,

Network

, and

System

you plan to monitor and

control, as described in Chapter 4, Programming an LNS Application.

2. Echelon recommends that you use transactions when creating permanent

message monitor points, as this considerably reduces the time required to

create the monitor points. Transactions should not generally be used

when creating temporary monitor points since they are not stored in the
LNS database, and so starting a transaction would unnecessarily slow

down the process. For more information on using transactions with LNS,
see Using Transactions and Sessions on page 65.

MySystem.StartTransaction()

3. Create a dynamic message tag on your application’s Network Service

Device. You will use this message tag to connect the Network Service

Device to the application devices you want to send messages to. For
instructions on creating dynamic message tags, see Adding Message Tags

To a Custom Interface on page 183.

Advertising