Example of a network variable event handler – Echelon LNS User Manual
Page 233
LNS Programmer's Guide
219
When you design such a monitoring application, you should bear in mind
that the network’s primary focus is on the execution of the control
algorithm, and that any network traffic generated, or any device or
network resources consumed by your monitoring approach, should not
prevent the network from fulfilling its primary task. You should design
network applications to be as unobtrusive as possible.
4. Each individual device on a network responds to a certain number of
network variable poll requests per second. The LNS application has
substantial processing power and a high performance network interface
at hand, and can typically handle more network variable poll requests
per second than most L
ON
W
ORKS
devices. When defining the poll
interval, make sure not to flood a single device with poll requests by
exceeding its individual limit. Not only would the device be unable to
respond to the request at the desired schedule, the polling requests would
also flood the device’s input buffers and might cause transient errors in
the operation of the control algorithm.
5. The poll interval is the interval between the last completion event for a
poll, and the next poll request. So if you were to set the poll interval for a
network variable to be 5 seconds, and it took 0.5 seconds to poll the
network variable, LNS would poll the network variable about every 5.5
seconds. In doing so, LNS avoids queuing poll requests for the same
network variable, and slows down polling for a particular device when its
responses are slow. This also causes less bandwidth to be consumed by
polls, because LNS automatically slows down if there is a large number of
retries for a given network variable.
6. After a network variable poll fails, the LNS Object Server will reduce the
polling interval of the device containing the network variable to once per
minute. If multiple network variables were being polled on the device, the
polling will be restricted to a single network variable regarded as the
"probe network variable." You should note that polling of the probe
network variable is randomized over each minute, so these polls may not
necessarily occur exactly once every 60 seconds. This has the effect of
distributing the probe polling more evenly. The LNS Object Server will
resume normal polling of the device as soon as it successfully polls the
probe network variable. Depending on the interval, it might recover in
less than 60 seconds. Note that normal polling may also resume before
the probe network variable is successfully polled if the LNS Object Server
detects a message from the device - for example if the device sends a
network variable update, or if the LNS Object Server pings the device.
Example of a Network Variable Event Handler
The following shows a sample event handler you could use for the
OnNvMonitorPointUpdateEvent
. In this example, the application checks if the Tag
property of the monitor point returned by the event matches a certain value to determine
whether it should display the monitor point’s value. If the tag matches, then the
application obtains the monitor point’s new value from the
DataPoint
returned by the
event. There are several ways your application can format and display the data stored in
the
DataPoint
object. For more information on this, see Data Formatting in page 241.
Dim roomTemp as String
Private Sub lcaObjectServer_OnNvMonitorPointUpdateEvent( _