Post-load state – Echelon LNS User Manual
Page 134
LNS Programmer's Guide
120
LonWorks\Import\Acme folder on the C: drive of the LNS Server PC. Application image
files can also reside outside the LNS Server PC’s local storage and referred to via mapped
network drives or fully qualified filenames. The device plug-in software that comes with
most L
ON
W
ORKS
devices should install the application image files into the correct
locations.
2. Call
the
Load() method on the AppDevice. If the system image version (the Neuron
Chip firmware) of the target device does not match that of the application image being
loaded, the operation will fail and an exception will be generated. However, some devices
support use of the LoadEx() method, which you can use to automatically upgrade the
system image version if it is incompatible with the application image being loaded. For
more information on the Load() and LoadEx() methods, see the LNS Object Server
Reference help file.
MyAppDevice.LoadEx(lcaLoadOptionsNone)
Note: If the device’s DeviceTemplate has already been associated with a particular
program, loading an application image that uses a different program ID or external
interface into the device will cause inconsistencies. If you attempt to load an
application image with a different program ID, the device will be left in the
unconfigured state after the load, and the
NS#38 lcaErrNsProgramidMismatch
exception will be thrown. In this case, the LNS Object Server will contain a record of
the device’s configuration, including the connections in which the old device was a
member. To resolve the inconsistency, you must upgrade the device and then
recommission it, as described in the Upgrading Devices section on page 134. Then,
follow the steps above.
Echelon recommends that you upgrade a device before loading its new application
image whenever possible. If the loaded application has the same program ID but
implements a different interface, the device will also be left in an unconfigured state.
However, since LNS does not support devices with the same program ID and
different interfaces, this inconsistency cannot be resolved without either loading a
new application or removing the device.
Post-Load State
The state of the device at the end of the application loading process depends on whether
the device had been commissioned before the process began, and on the application
image that was loaded:
• If the device had not been commissioned prior to the application load, the LNS
Object Server will leave the device in the unconfigured state.
• If the device had been previously commissioned, and the device’s old application
and its new application have the same program ID and the same external
interface, the LNS Object Server will restore the device’s network image (address
and connection information) from the database.
• If the device had been previously commissioned, and the device’s old application
and its new application have a different program ID or a different external
interface, the LNS Object Server will leave the device in the unconfigured state.
If the program ID differs, the LNS application can use the Upgrade() method to
upgrade the device to use the device template corresponding to the newly loaded
application image, and then use the Commission() method to restore as much of