Remote full clients – Echelon LNS User Manual

Page 179

Advertising
background image

LNS Programmer's Guide

165

3. Call

PreMove() on the AppDevice. When you call PreMove(), you must

specify the destination channel as the newChannelObject element. You
can optionally specify the destination subnet as the newSubnetObject

element. Echelon recommends that you leave the newSubnetObject

element empty, as LNS will then allocate the most suitable subnet for the

destination location:

NSDAppDevice.PreMove(channelObject, NOTHING)

NOTE: You can use the PreMove() method to move a device from one

subnet to another, without switching channels. In this case, specify the
device’s current channel as the newChannelObject element, and the

new subnet as the newSubnetObject element.

4. Physically move the Network Service Device.

5. End the current session, and start a new one. Then, call

PostMove()

on

the AppDevice to complete the operation.

MySystem.EndSession()

MySystem.BeginSession()

NSDAppDevice.PostMove()

MySystem.EndSession()

MySystem.CommitTransaction()

LNS applications that are designed for mobile use, such as a diagnostics tool for a service

technician, may find it difficult to follow the procedure described above. Typically, the
application will be used in location A, terminated, and started up in a different location B

later (the next service case). Since location B may not be known at the time when
location A is left, the tool may not be able to call PreMove() before physically moving the

device.

If the LNS application is a Local or Lightweight client application whose Network
Service Device has been moved, the calls to the PreMove() and PostMove() methods

can be performed after the network interface has been physically moved. If you are
performing this procedure with a remote Full client application, it is not necessary to call
the PreMove() or PostMove() methods in this case, as the move is performed

automatically when the system is opened. However, you must open the network via the
Networks collection (and not the RemoteNetworks collection). See the next section for

more details on this.

Remote Full Clients

There are several other factors to consider if a remote Full client application has been

using the Network Service Device you are moving. When a remote Full client application
opens a database using the Networks collection (as opposed to the RemoteNetworks

collection) and no other application currently using that Network Service Device has the
database open, the Network Service Device connects with the LNS Object Server. As part

of this connection process, the LNS Object Server determines which channel the Network

Service Device is using. If the Network Service Device had been created previously on a
different channel, which would be the case if it has been moved, the LNS Object Server

will move it to a new channel and assign it a new address, updating connections and

timers appropriately. Thus, the LNS Object Server handles the move automatically for
you in this case.

Advertising