Reloading a device's application, Commissioning devices – Echelon LNS User Manual

Page 135

Advertising
background image

LNS Programmer's Guide

121

the device’s configuration as possible. These features are described in more detail

later in the chapter.

• If the device had been previously commissioned, and the device's old application

image and its new application image have the same program ID but a different

external interface, the LNS Object Server will leave the device in the
unconfigured state, and the NS:#59 lcaErrNsProgramIntfMismatch

exception will be thrown. Per LonMark guidelines, LNS requires that each

program ID be associated with only one external interface. This means that all

components and properties of each external interface using a given program ID
must be identical. However, LNS may not detect all violations of this rule, as it

would be very time consuming to validate this on every commission or after every
application download.

• An application loading session may be canceled by calling the system’s

CancelTransaction() method from within an OnSystemNssIdle event

handler, as described in Using the OnSystemNssIdleEvent on page 316. If the
load is canceled, the device will be left in the applicationless state. In this case,

the previous device application must be reloaded to restore the device.

Reloading a Device's Application

You should be aware that in some cases, reloading a device’s application may cause the

configuration properties on the device to be set to their original, default values. When

reloading a device’s application, Echelon recommends that you follow this procedure to
ensure that the configuration properties in the device are restored to match those in the

database in the most efficient manner:

1. Call

DownloadConfigProperties() on the AppDevice. Use the

lcaConfigPropOptClearUpdatePending value as the
downloadOptions element.

MyDevice.DownloadConfigProperties(lcaConfigPropOptClearUpdatePending)

2. Call

Load() or LoadEx() to reload the device application, as described

previously.

MyDevice.LoadEx(0)

3. Call

DownloadConfigProperties() again. This time, specify the

lcaConfigPropOptLoadValues option as the downloadOptions

element. This will load the configuration properties stored in the LNS
database for the device back into the device.

MyDevice.DownloadConfigProperties(lcaConfigPropOptLoadValues)

Commissioning Devices

After you have assigned a device its Neuron ID (and loaded its application image if

necessary), you can enable it for communication with other devices on the network and
load its network image by invoking the Commission() or CommissionEx() methods.

This does the following:

• Gives the device a network (subnet/node) address in the system’s domain

if no DeviceTemplate or Channel were specified when the AppDevice

Advertising