beautypg.com

Example – Echelon LNS DDE Server User Manual

Page 77

background image

Channel = DDEInitiate(Application, Topic)

Value = DDERequest(Channel, Item)

DDETerminate (Channel)

Following is a description of the parameters:

Application

The DDE application as a string. By default, this is
“LNSDDE” for the LNS DDE Server.

Channel

A DDE channel number created by the DDEInitiate()
function, as a long.

Item

A DDE item as a string, as described in Specifying a Network
Variable
earlier in this chapter.

Topic

A DDE topic as a string. For network variables, this will be
an LMNV, DevNV, or NV topic as described in Topics in

Chapter 4 and in Specifying a Network Variable earlier in this
chapter.

Value

The returned value from the one-time update request. This
will typically be assigned to a worksheet cell.

8. To return to Excel from the VBA editor, select Close and Return to Microsoft

Excel on the File menu.

9. To exit design mode and enable the ActiveX control, click Exit Design Mode on

the Control Toolbox.

Example

Private Sub btnReadSwitch4_Click()

Dim channel As Long

channel = DDEInitiate("LNSDDE", "LNS DDE Test.HVAC.LMNV")

Sheet1.Range("E21") = DDERequest(channel, _

"DI- 1.SW- 4.Digital.State")

DDETerminate (channel)

End Sub

Requesting a One-Time Network Variable Update Using
InTouch

The WWRequest function is used to request a one-time network variable update

using InTouch. To call this function, you must implement an InTouch action script

for each value to be requested. The action script will typically be called from an
InTouch button. To request a one-time network variable update using an InTouch

button, follow these steps:


1. Open an InTouch application project in WindowMaker and open the window that

will contain the button.

2. Click the Button tool on the Draw Object toolbar.

LNS DDE Server User's Guide

5-7