Echelon LNS User Manual

Page 101

Advertising
background image

LNS Programmer's Guide

87

2. You can now begin defining the devices and connections on your network. Fetch

the Subsystems collection from the System object, and then use the collection’s
Item property to obtain the Subsystem you want to add the devices to.

Alternatively, you can use the Add() method to create a new Subsystem.

The returned Subsystem contains an AppDevices collection. You can add new

devices using the AppDevices collection’s Add() method. When creating an
AppDevice object with the ad hoc installation scenario, you are not required to

specify the device’s DeviceTemplate and channel. When you commission the

device later, the LNS Object Server will automatically detect the device’s
external interface, create a DeviceTemplate object as needed, and query the

device across the network for all relevant details.

However, Echelon recommends that you specify the device template whenever

possible, since doing so is more efficient and provides more complete information

than creating the device template by reading the information from the device.

The LNS Object Server will also automatically detect the channel the device is
connected to, and assign a subnet suitable for that channel.

For more information on creating AppDevice objects, see Creating AppDevice

Objects on page 113.

3. Associate a physical device with the newly created

AppDevice

by assigning its

Neuron ID. You can supply the Neuron ID using any of the three methods

described in the Neuron ID Assignment section on page 115.

4. Load the application images for any devices that require application image

loading. To do so, invoke the Load() or LoadEx() methods on each
AppDevice. For more information on loading device application images, see

Loading Device Application Images on page 119.

5. Start a transaction, and commission each device with the Commission() or

CommissionEx() methods. After you commission each device, you should

synchronize the configuration property values in the physical device with those

stored in the LNS database before committing the transaction.

If the application’s configuration properties definitions are known (meaning that
the ConfigPropertiesAvailable property of the device’s Interface is set to
True), set all values to their defaults by calling the
DownloadConfigProperties() method with the
lcaConfigPropOptLoadValues and lcaConfigPropOptSetDefaults options

set. Then, use data points to update any configuration property values and
commit the transaction.

You can bypass this step if you want to preserve the configuration property

values currently stored in the physical device. If you do so, you will need to

upload the values from the device after you commission it, as described in step 6.

For more information on these tasks, see Application-specific Configuration Data
on page 125.

Note that if the ConfigPropertiesAvailable property is set to False, you

cannot update the configuration property values until after this transaction has

been committed, and the configuration property definitions have been loaded.
This condition occurs if the device’s template was uploaded from the device

(rather than imported from an external interface file), and the configuration

Advertising