Example, Receiving ongoing network variable updates – Echelon LNS DDE Server User Manual

Page 78

Advertising
background image

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 = WWRequest(Application, Topic, Item, Value)

Following is a description of the parameters:

StatusTag

A tag containing the return value from the WWRequest
function. The value is 1 for a successful request, 0 if the
application is busy, and –1 for an error.

Application

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

Topic

A DDE topic as a string or an InTouch tag. 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.

Item

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

Value

A string or an InTouch tag that is going to hold the returned
value from the one-time update request.

8. Click OK for the two open dialogs to return to the application window.

9. To exit design mode and enable the button, click Runtime! in the menu bar.

If a point no longer exists and you try to update it, you will receive a message in

InTouch asking you if you want to start the server. Use the Trace option to
determine whether or not the point exists.

Example

StatusTag = WWRequest("LNSDDE", "LNS DDE Test.HVAC.LMNV", _

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

Receiving Ongoing Network Variable Updates

To receive ongoing updates for a network variable value, your client application
sends a DDE Advise message to the LNS DDE Server. When you ask the LNS DDE

Server to monitor a network variable, it looks in the LNS database to see if it is
bound to the variable. If it is not bound to the variable, the LNS DDE Server begins

to poll the variable at the specified frequency. The LNS DDE notifies your client

whenever the variable's value changes. That is, the LNS DDE Server uses a report

5-8

Reading and Writing Network Variables

Advertising