Using the prereplace method – Echelon LNS User Manual
Page 180
LNS Programmer's Guide
166
You should note that when a Full client application opens a system using the Networks
collection (as opposed to the RemoteNetworks collection), the LNS Object Server
automatically determines the channel that the application’s Network Service Device is
attached to. However, the LNS Object Server cannot determine the correct channel if the
channel is one of several channels connected by routers that are configured as repeaters
or permanent bridges (i.e. the Class property is set to lcaRepeater,
lcaPermanentRepeater or lcaPermanentBridge). This is one of the reasons that
Echelon encourages the use of configured routers. However, in this scenario, you can set
the System object's RemoteChannel property before opening the System to specify the
channel that the Network Service Device is attached to.
It is also possible to move a Network Service Device operating as a remote Full client
using the PreMove() and PostMove() methods, as described in the Moving a Network
Service Device section. However, these methods interrupt the communication between
the LNS Server and remote Full client applications attached to the LNS Server.
Therefore, the use of these methods on a Network Service Device that is being used by
remote Full client applications is discouraged. However, you can move a Network Service
Device that is being used by a remote Full client application from one PC to another, as
described in the next section.
Using the PreReplace Method
Under normal circumstances, when a remote Full client application re-opens a network,
any network variables, connections and monitor sets created previously on the network
by the Full client will still be available, as long as the Network Service Device
configuration for the Full client still exists in the LNS network database. To ensure that
the Network Service Device is never deleted from the LNS database, it must be
configured as a permanent device on the network. You can do so by setting the
LcaNsdType property of the NetworkServiceDevice object to
lcaNsdTypePermanent. However, under some circumstances, the correlation between
the Full client and the configuration of the Network Service Device may be lost. In these
cases, you can use the PreReplace() method to re-associate the client with the correct
Network Service Device.
You will also need to use the PreReplace() method if you open a network remotely
from a new PC, and want that client to use a Network Service Device configuration that
was previously associated with a remote client running on another PC (effectively
moving the remote application and Network Service Device configuration from one PC to
another). An exception to this is if the original remote client used a standard network
interface, and you move the network interface to the new PC. In this case, LNS will
automatically associate the Network Service Device in the database with the client based
on the standard network interface’s Neuron ID.
You will also need to follow the procedure described below to re-attach a Network Service
Device to a network if the network has been removed from the RemoteNetworks
collection for the PC, and you are using a high performance (Layer 2/VNI) network
interface, or if you install a new network interface on the PC.