Echelon LNS User Manual
Page 108
LNS Programmer's Guide
94
another subsystem before installing the device. Iterate through the AppDevices
collection to find the device you want to move, and then call the AddReference()
method on the destination Subsystem to move the device to the destination
subsystem.
If your application discovered a newly attached device via the OnSystemServicePin
event, the new device’s handle would typically have been returned with the event.
You can use that to locate the AppDevice in the
Discovered.Uninstalled
subsystem by calling the ItemByHandle() method. Then, call the AddReference()
method on the destination Subsystem for that device to move it to its desired
location. However, if the device has not yet been added to the
Discovered.Uninstalled
subsystem’s
AppDevices
collection, the device handle
returned in the OnSystemServicePin event will be 0. In this case, your application
could set the System object’s RegisterServicePin property to True and evaluate
the OnChangeEvent event instead of the OnSystemServicePin event, as the
OnChangeEvent event notifies the application on the completion of a database
change. Thus, by the time the application receives the OnChangeEvent event, the
related
AppDevice
object will be ready for use and could be acquired using any
appropriate means.
NOTE: The DeviceTemplate object assigned to each AppDevice specifies that
device’s external interface definition. You should check to make sure that the
AppDevice is using the correct DeviceTemplate object before proceeding. For more
information on DeviceTemplate objects and external interfaces, see Device
2. Associate the new
AppDevice
object with the appropriate physical device on the
network by setting its
NeuronId
property. LNS will have already set the
NeuronId
property for any devices added to the Discovered.Uninstalled subsystem. There
are several ways to use LNS to determine a device’s Neuron ID. For more
information, see Neuron ID Assignment on page 115.
MyAppDevice.NeuronId = AcquiredNeuronId
3. If you need to update the device’s application image, you should do so now. For more
information on loading device applications, see Loading Device Application Images on
page 119.