Removing devices, Removing devices from multiple subsystems – Echelon LNS User Manual
Page 151
LNS Programmer's Guide
137
Moving Devices and Managing Networks With Multiple
Channels
If you are managing a network with multiple channels, there are many special tasks you
will need to perform. This includes the installation and configuration of the routers on
your network. For information on these tasks, see Managing Networks with Multiple
Channels on page 169. This section also discusses how you can move a device from one
channel to another.
Removing Devices
During the lifetime of a network, you may need to remove devices from service. This
could be for a number of reasons. You may not need the device anymore, or you may want
to move the device to another network.
A device in a network should be logically removed from the LNS database before it is
physically removed from the network. The logical removal process clears device’s logical
address and authentication key. It also sets the device to the offline state, so that the
device can be installed in another network, and then rediscovered by another LNS Object
Server, if necessary. If you are moving the device to another network, this also ensures
that attaching the device to a new network will not cause address duplication, which
could lead to improper system behavior. The logical removal process also updates devices
that communicated with the target device, so that they no longer attempt to
communicate with it.
To logically remove a device, invoke the Remove() method on the AppDevices collection
containing the device. You will need to specify the device by its name or collection index
value. If the device only belongs to one subsystem, this disconnects the device’s network
variable and message tags, removes the device’s network address, and places the device
in the unconfigured state. If the AddReference() method has been used to place the
device in multiple subsystems, the device must be removed from the AppDevices
collection for all the subsystems it has been added to. You can determine which
subsystems a device belongs to by reading its Subsystems property. When completely
removed, the device is left in the unconfigured state and its service LED (if present)
flashes slowly.
This example removes an application device named AppDevice1:
Dim MyAppDevices As LcaAppDevices
Set MyAppDevices = MySubsystem.AppDevices
MyAppDevices.Remove("AppDevice1")
Removing Devices From Multiple Subsystems
The preceding example removes a device from a single subsystem. Remember that if an
AppDevice is referenced in multiple subsystems, you will need to remove it from all the
subsystems it belongs to in order to completely remove it from a network database. Once
you have removed the AppDevice from all the subsystems it belongs to, the physical
device on the network will be removed from connections, set to the unconfigured state,
and be ready to be physically removed from the network. The device will indicate that it
has reached the unconfigured state by slowly flashing its service LED. Note that it is not
an error if LNS fails to communicate with the device. Since the device might be logically
removed as a result of a prior physical removal, LNS will update all connections the