Replacing network service devices – Echelon LNS User Manual

Page 147

Advertising
background image

LNS Programmer's Guide

133

application configuration data, it might also be necessary to set the configuration

properties of the new device to match the configuration property values in the old device.

As described earlier, the AppDevice object represents the logical attributes of a physical

device in the LNS database, including its network address, connections, and
configuration properties. When the AppDevice object is commissioned, it becomes

associated with the physical device on the network. When an AppDevice object is
replaced, the AppDevice object is updated to represent a new physical device. To replace

a device, install the new device on the network. Then, follow these steps:

1. Obtain

the

AppDevice object representing the original device in the LNS database.

2. Acquire the new device’s Neuron ID using any of the methods described in the

Neuron ID Assignment section on page 115. Assign the acquired Neuron ID to the
NeuronId property of the AppDevice acquired in step 1.

3. If necessary, load the new device’s application image, as described in Loading Device

Application Images on page 119. Use the AppDevice object acquired in step 1.

4. Start a transaction.

5. Call

Replace() or ReplaceEx() on the AppDevice being replaced. The LNS

Object Server will then perform the following tasks:

• It deconfigures the old device if it can communicate with it.
• It loads the network image of the old device into the new device.
• It leaves the new device offline.

If you use the Replace() method and the system management mode is set to
lcaMgmtModeDeferConfigUpdates, these tasks will not be performed until the
system management mode is set back to lcaMgmtModePropagateConfigUpdates.

If the system management mode is set to lcaMgmtModeDeferConfigUpdates and
you want these tasks performed right away, you should use the ReplaceEx()

method with the lcaReplaceFlagPropagateUpdates option as the flags element

to perform the replacement.

When you use the ReplaceEx() method, you can also use the flags parameter to

determine whether any of the configuration property values from the old device will

be preserved in the LNS database. Otherwise, the configuration properties will be set

to the unknown state. Echelon recommends that you use

ReplaceEx()

and preserve

the old configuration property values whenever possible.

6. Download the configuration property information for the new device into the LNS

database by calling DownloadConfigProperties() with the
lcaConfigPropOptLoadValues option set.

7. Commit the transaction.

8. Set the new device online by setting the State property of the AppDevice object to

lcaStateCnfgOnline.

Replacing Network Service Devices

You should not use the Replace() or

ReplaceEx()

methods on a Network Service

Device. Generally, LNS will perform Network Service Device replacements

Advertising