Echelon OpenLDV User Manual

Page 148

Advertising
background image

140

LNS Programming with xDriver

Figure 37. Downlink Application Form

This application can open either of the two remote L

ON

W

ORKS

networks by

clicking the Open Network A and Open Network B buttons. After either

network has been opened, the applicable Close Network button becomes

enabled, so that a user can close the network. When both networks are opened at

the same time, each network is assigned its own xDriver network interface.
From this example, you should be able create your own application that uses

xDriver to open multiple remote networks simultaneously. For more information

on any of the LNS commands used in this sample program, see the LNS

Programmer’s Guide.

'Create variables to store the System and Network object for each network to be

'opened with this application. g_NetworkA and g_SystemA serve as the Network

'object and System object variables for Network A. g_NetworkB and g_SystemB

'serve as the Network object and System object variable for Network B.

Dim g_NetworkA As LcaNetwork

Dim g_NetworkB As LcaNetwork

Dim g_SystemA As LcaSystem

Dim g_SystemB As LcaSystem

'Private Sub OpenNetA_Click() is called when the user clicks the Open Network A

'button. This function disables the Open Network A button, so that a user

'cannot try to open Network A while it is already open. It also enables the

'Close Network A button so that the user can close the open network. Following

'this, the function opens the System and Network object for Network A.

Private Sub OpenNetA_Click()

OpenNetA.Enabled = False 'Disable the Open Network A button.

CloseNetA.Enabled = True 'Enable the Close Network A button.

Dim netList As LcaNetworks

Set netList = g_cOS.Networks 'Set netList as the Network objects

'collection.

Set g_NetworkA = netList(1) 'Set g_NetworkA as the Network object for the

'first member of the Network objects

'collection. This value must be hard-coded and

'will vary depending on which network you want

'opened.

g_NetworkA.Open 'Open network A.

Dim NIs As LcaNetworkInterfaces

'Set NIs as the NetworkInterfaces

Set NIs = g_cOS.NetworkInterfaces 'collection object.

Dim curRNI As LcaNetworkInterface

Advertising