Writing configuration property values, Setting devices online – Echelon LNS User Manual

Page 142

Advertising
background image

LNS Programmer's Guide

128

Writing Configuration Property Values

You can also use LNS to read or write to the values of the configuration properties on a
device one at a time. To do so, call the GetDataPoint() method on the
ConfigProperty object to acquire a DataPoint object. If you have not written a

configuration property, or set its default value, you cannot read it if any of the following

conditions are true:

• The device has not been commissioned.

• The LNS Object Server cannot communicate with the device.

• The device template is based on a definition that was uploaded from the device,

and the configuration properties have not yet been uploaded.

For more information on using DataPoint objects with configuration properties, see

Using the GetDataPoint Method on page 235.

Note that there is one case where you may need to read or write to the value of a
ConfigProperty object directly, without using a DataPoint object. Data points are

very useful when reading and writing formatted data, or when accessing an entire raw

data value as a whole. However, if you want to access arbitrary bytes of raw data to read

or write a range of elements in an array configuration property, you should not use a
data point. Instead, you should use the GetRawValuesEx() and SetRawValuesEx()

methods of the ConfigProperty object. See the LNS Object Server Reference help file

for more information on these methods.

Setting Devices Online

The final step in installing a device is to set the device online. To do so, set the
AppDevice object’s State property to lcaStateCnfgOnline as displayed below:

MyAppDevice.State = lcaStateCnfgOnline

You can set a device online or offline at any point by writing to its State property.

However, you should be aware that devices cannot receive or respond to network events
related to monitor and control while they are offline. For example, if a Network Service

Device is offline, then all applications using the Network Service Device will not receive

monitor and control events until the Network Service Device is back online. Or, if an
application device is offline, then that device will not be able to receive incoming network

variable events or respond to network variable polls.

When you consider this, you should note that devices are taken offline while they are

being reconfigured. For example, if you remove a connection between an application
device and the Network Service Device, both the application device and Network Service

Device will be taken offline while the LNS removes the connection. During that time, the

Network Service Device will not process network variable updates, nor will it poll
network variables, since the configuration of the application device and the configuration

of the Network Service Device are in a state of fluctuation.

Although Echelon recommends that you only modify the device’s configuration while it is

offline, some devices may need to be reconfigured while they are operational. Therefore,
you can set the ConnectionUpdateType property of an AppDevice object to
lcaConnectionUpdateTypeOnline to prevent the device from being taken offline

while changes to network variable connections on the device are being made.

Advertising