Example, Sending a network variable update using intouch – Echelon LNS DDE Server User Manual

Page 83

Advertising
background image

Value

The value to be written to the network variable, as a
worksheet cell reference.

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.

Note: If your Visual Basic application expects to update other network variables
using the same channel, do not terminate the channel until the updates are received.

Example

Private Sub btnUpdateLamp4_Click()

Dim channel As Long

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

DDEPoke channel, "DO- 1.LED 4.Digital", Sheet1.Range("B17")

DDETerminate (channel)

End Sub

Sending a Network Variable Update Using InTouch

In most InTouch applications, updating a network variable requires the simple
assignment of a statement to a tag that is declared to be an I/O tag.

To send an update from a script, use the WWPoke function. 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 send a network variable
update using an InTouch button, follow these steps:

1

Open an InTouch applciation project in WindowMaker and open the
window that will contain the button.

2

Click the Button tool on the Draw Object toolbar.

3

On the target window, drag the control to the size you want.

4

To set the properties for the button, double-click the button.

5

To add an action script to the button, click the Action button.

6

Select On Key Down as the Condition Type.

7

Enter the following code:

StatusTag = WWPoke(Application, Topic, Item, Value)


Following is a description of the parameters:

LNS DDE Server User's Guide

5-13

Advertising