Echelon LNS User Manual
Page 24
LNS Programmer's Guide
10
imported, or from the device’s self-documentation when it uploads the device’s device
template.
In LNS, an application device’s interface is represented by an Interface object. The
Interface objects contained by an application device may be the device’s main, static
interface, or they may be custom interfaces that have been added to the device
dynamically, using the new features described in this section. You can access the main
interface of a device through the AppDevice object’s Interface property. Main
interfaces are static interfaces that cannot be modified.
You can access the collection of custom interfaces that have been added to a device
through the device’s Interfaces property. If supported by the device, you can modify
these custom interfaces by adding or removing objects from their NetworkVariables,
LonMarkObjects, and MessageTags collections.
Or, you can add custom Interface objects to a device by accessing the Interfaces
collection through the device’s Interfaces property, and then calling the Add()
method. Once you have created a custom Interface object, you can modify it to suit
your exact needs.
You can access the collection of LonMark Functional Blocks defined on the custom
Interface. A LonMark Functional Block represents a collection of network variables
and configuration properties on a device that perform a related function. For example, a
digital input device with four switches could contain one functional block for each switch.
In LNS, LonMark Functional Blocks are represented by LonMarkObject objects. Each
Interface object contains a LonMarkObjects property, which you can use to access the
collection of LonMark Functional Blocks defined on that Interface. If the interface
supports dynamic LonMark Functional Blocks, you can add and remove LonMarkObject
objects from the collection using the Add() and Remove() methods. In addition, you can
assign and un-assign existing network variables to and from the LonMarkObject objects
using the AssignNetworkVariable() and UnassignNetworkVariable() methods.
You can check if an Interface object supports the addition of dynamic LonMarkObject
objects by reading the Interface object’s DynamicLonMarkObjectCapacity property.
You can check if an Interface object supports the addition of dynamic network
variables by reading the Interface object’s MaxNvSupported and StaticNvCount
properties.
You can also access the collection of network variables defined on an Interface or on a
LonMarkObject through the object’s NetworkVariables property. This property
contains the entire set of NetworkVariable objects defined on that Interface. You
can use the Add() and Remove() methods to modify this collection on your custom
Interface objects as you desire.
In LNS Turbo Edition, each custom Interface object also contains a
DynamicMessageTags collection. You can use this collection to add dynamic
MessageTag objects to the interface. This allows you to add message tags to any device
that supports monitor sets, and use those message tags to send explicit messages from
that device to a group of devices, as with static message tags. For example, consider the
case of a Network Service Device. Network Service Devices do not contain static message
tags. However, you can now add dynamic message tags to the AppDevice object
associated with a NetworkServiceDevice. Once you have added to a message tag to a
Network Service Device, you can connect the message tag to the devices you want to send
the messages to. Following that, you can create a message monitor point on the Network