Updating a network variable – Echelon LonBridg Server User Manual

Page 28

Advertising
background image

22

Using the LonBridge API

The monitoring method can be specified for each specified network variable. The

method can be either passive monitoring (with a layer-5 MIP only) or polled
updates:

• For passive monitoring, the LonBridge Server silently joins connections

for network variables that are enrolled in connections. With passive

monitoring, the LonBridge Server receives event-driven updates to a

network-variable output as it is updated, as long as the network variable
is enrolled in a connection to an input network variable on another

device. This method works only with a layer-5 MIP.

• For polled updates, the LonBridge Server polls network variables at a

default polling period that is specified in the LonBridge configuration file.

The polling period is the interval per poll, that is, if a polling interval of 5
seconds per poll is specified, and there are 20 network variables to be

polled, one network variable will be polled every 5 seconds, and it will

take 100 seconds to poll all 20 network variables.

The network variables to be monitored are specified in a device class file. Each

device class file specifies a program ID for the class definition; the LonBridge

Server uses the program ID to match discovered devices against available device
class files. When a new device is discovered, the LonBridge Server searches the

device class files for file with a matching program ID. If none is found, passive
monitoring is not enabled and the device is not regularly polled. Network

variable values can be reported in raw format or with an optional format.
If a network variable fails to respond to a series of poll requests, the LonBridge
Server marks that device inactive. The device remains inactive until it sends a

DRUM message to the LonBridge Server or responds to a device discovery

request.

Updating a Network Variable

The LonBridge API provides a command to update a network variable or a

network variable field. Use the <attribute> element within a device class file to

define formats for network variable values and network variable field values.

When your application updates a field within a network variable, the application

should update all of the fields for that network variable (all fields for which the

device class file includes an <attribute> element). When the application receives
changes to a network variable or network variable field from a device, the

application should cache the values and merge incoming updates with current

values before presenting the values to a graphical user interface or other
application.



Advertising