Using the onnodeconnchange event, Connection descriptions – Echelon LNS User Manual
Page 159
LNS Programmer's Guide
145
collection objects, they may be searched by name or by index. The use of
these collections is discouraged for large systems, as it may take a long
time to access these collections.
Using the OnNodeConnChange Event
You may want your application to be notified when devices are added to or removed from
connections on your system. You can accomplish this with the OnNodeConnChange
event. To use the OnNodeConnChange event, call the BeginNodeConnChangeEvent()
method on the System object.
The OnNodeConnChange event will then be fired each time a connection on your system
is created or modified, or each time a connection description template being used by a
connection on your system is modified.
If you want, you can filter incoming OnNodeConnChange events for a specific device
using the ObjectHandle parameter or a specific type of connection change (i.e. target
added, target removed, or connection description template changed) using the
ObjectChangeType parameter.
Note the System object’s MgmtMode property and the network attachment status
determine whether or not connection changes will be propagated to devices on the
network. Use the OnChangeEvent event or monitor the value of an AppDevice object’s
CommissionStatus property to determine when a connection has been committed to the
network.
For more information on the OnNodeConnChange event, see the LNS Object Server
Reference help file.
Connection Descriptions
To make it easy to specify the behavior of a connection, the LNS Object Server provides
connection descriptions in the form of ConnectDescTemplate objects. Each network
variable and message tag has a ConnectDescTemplate property that returns a
ConnectDescTemplate object. When a network variable or message tag acts as a
connection hub, its current ConnectDescTemplate is applied to that connection.
Each connection description template defines basic connection attributes, such as the
LonTalk messaging service and authentication setting used by the connection. The
default connection description applied to all network variables and message tags has the
following settings:
Service type
For network variables, use whatever service the output
network variables specify. For message tags, the LNS
Object Server assumes acknowledged service.
Priority
For network variables, use priority if the transmitting
network variable specifies priority. Do not use for
message tags.
Authentication
For network variables, use authentication if a receiving
network variable has authentication enabled. Do not use
for message tags.
Retry count
Calculated based on topology and service type.