Echelon LNS User Manual

Page 70

Advertising
background image

LNS Programmer's Guide

56

4. Optionally repeat steps 2 and 3 to open more networks. Note that a

remote Full client application can access multiple networks
simultaneously, but must use the same network interface to open each

one.

Once you have opened a network, you should follow the tasks described in

the Opening a System section later in this chapter to configure and open
the system.

If a remote Full client application using your Network Service Device has accessed the
network before, and the LcaNsdType property of the Network Service Device is set to
lcaNsdTypePermanent, you can use the RemoteNetworks collection to access the

network. This allows you to skip the time consuming process of querying the network for
available servers. The RemoteNetworks collection contains all the networks that have

previously been opened by Full client applications running on your PC.

When using the RemoteNetworks collection, the Flags property should not be set to
lcaFlagsUseNSI

,

and your application should not specify a network interface, as

described earlier in this section. When a network is opened via the RemoteNetworks

collection, LNS will use the last network interface used to open the network. If you want
to use a different network interface to open a network with a remote Full client
application, you need to access the network through the Networks collection, as

described previously.

To open a network via the RemoteNetworks collection, follow these steps:

1. Before opening the Object Server, make sure that the Flags property is

not set to lcaFlagsUseNSI, and that your application has not specified
a remote network interface. In addition, set the RemoteFlag property to
False.

ObjectServer.ActiveRemoteNI = nothing

ObjectServer.RemoteFlag = False

ObjectServer.Flags = ObjectServer.Flags And Not _

(lcaFlagsUseNSI Or lcaFlagsUseTCP)

2. Access

the

RemoteNetworks collection.

Dim MyNetworks as LcaNetworks

Set MyNetworks = ObjectServer.RemoteNetworks

You should be aware that changes made on the LNS Server PC can result
in inconsistencies between the LNS Server and the RemoteNetworks

collection. This includes changing the local network interface (if this

results in a new Neuron ID on the LNS Server PC), or removing the
Network Service Device for a Full client. These changes may prevent

your remote Full client application from successfully using an entry in
the RemoteNetworks collection. In addition, if the LcaNsdType of the

client application’s Network Service Device is set to
lcaNsdTypeTransient or (in some cases) lcaNsdTypeStandard, the

Network Service Device will be removed when the client application
closes, and will not exist in the RemoteNetworks collection. Finally, if

your application’s Network Service Device, or if the Network Service
Device used by the LNS Server has changed channels, it may not be
possible to successfully use an entry in the RemoteNetworks collection.

Advertising