Opening a system, Opening a system o – Echelon LNS User Manual
Page 75
LNS Programmer's Guide
61
been previously opened by Local or Full client applications with the
Network Service Device your application is using:
Dim IndependentNetworks as LcaNetworks
Dim MyNetwork as LcaNetwork
Set IndependentNetworks = ObjectServer.VNINetworks
Set MyNetwork= IndependentNetworks.Item("Building 75")
3. Call
the
OpenIndependent() method on the selected network:
MyNetwork.OpenIndependent()
4. Once you have opened a network with an Independent client application,
you can begin performing monitor and control tasks with the application,
as described in Chapter 9, Monitor and Control.
Opening a System
Once you have completed the tasks described in the previous sections and opened a
network or group of networks, you need to open the System object for each of your open
networks, and set the System object’s parameters. If an application is running locally,
this allows your application to attach to the network and make modifications to the
network database. If your application is running remotely, this registers your application
with the LNS Server and attaches it to the network, which allows the application to
make database modifications. Note that you cannot open the system when operating an
Independent client application.
To open the system for Full, Lightweight and Local client applications, follow these steps:
1. Get
the
System object from the active network's Systems collection.
There is only one system per network, so select the first system in the
Systems collection.
Dim MySystems as LcaSystems
Dim MySystem as LcaSystem
Set MySystems = MyNetwork.Systems
Set MySystem = MySystems.Item(1)
2. If you are running a Full or Lightweight client application and
authentication is enabled for this System, set the authentication key.
The authentication key is a 12-character string representing a 12-digit
hexadecimal value.
MySystem.AuthenticationKey = "01FE23DC45BA"
Local client applications do not need to set the authentication key for
client/server communication. However, Full and Lightweight client
applications must, or they will be unable to communicate with the LNS
Server. You can provide additional IP security for Lightweight clients by
setting IP permissions on the LNS Server PC via the System object's
PermissionString property.