Polled network variable monitoring – Echelon LNS User Manual
Page 231
LNS Programmer's Guide
217
2. Acquire
a
DataPoint
object to use to write the value of the network
variable monitor point. Then, set the value of the DataPoint object and
call the
Write()
method. LNS will update the value of the network
variable being monitored with the new value.
Set MyDataPoint = MyNvMonitorPoint.DataPoint
MyDataPoint.FormattedValue = “75.0 1”
MyDataPoint.Write()
NOTE: If the
AutoWrite
property is set to
True
, you do not need to call
the
Write()
method in this step.
Polled Network Variable Monitoring
In the polled monitoring scenario, LNS periodically polls the values of the monitor points
and reports the values using the
OnNvMonitorPointUpdateEvent
event. This method
is most efficient when the value of a network variable must be checked regularly, but the
application does not need to know immediately when the value changes (for example,
outside air temperature).
To use polled monitoring, you must first create a monitor set and add monitor points for
the network variables you want to monitor. For more information on these tasks, see
Creating Monitor Sets on page 194, and Managing Monitor Sets on page 195. Note that
when you set the monitoring options, the
PollInterval
property determines the rate at
which LNS will poll the value of each network variable being monitored.
Once you have created a monitor set and established a poll interval, you can open and
enable the monitor set, or a group of monitor points within the set. When you open and
enable the monitor set, make sure that the
doPoll
parameter is set to
True
. This will
enable polled monitoring for all monitor points on the monitor set. For more information
on how to open and enable monitor sets, see Opening and Enabling Monitor Sets on page
You can stop polled monitoring for an entire monitor set by calling the
Disable()
method on the monitor set (this will stop all monitoring). Or, you can stop polled
monitoring by calling the
Enable()
method with the
doPoll
parameter set to
False
(this will leave monitoring enabled). In this case, polling will not be enabled for that
monitor point, even if it is enabled for the monitor set, until you call Enable() method
on the
NvMonitorPoint
object with the
doPoll
parameter set to
True
.
Once polling for a network variable monitor point has been enabled, your application will
be informed of the result of each poll via the
OnNvMonitorPointUpdateEvent
event. If
you only want your application to be informed when the value of a network variable
monitor point changes, set the
ReportByException
property to True when you set the
monitoring options for the set or point.
The
OnNvMonitorPointUpdateEvent
event includes three parameters: the
NvMonitorPoint
object whose value is being reported, a
DataPoint
object containing
the value of the
NvMonitorPoint
, and a
SourceAddress
object that you can use to
identify the device containing the network variable.
Echelon does not recommend using the SourceAddress object to identify the network
variable, since source addresses may change, and translating from a source address to an
application device may be time consuming. A more efficient alternative is to set the
NvMonitorPoint object’s Tag property to a value you can use to identify the network
variable and source device associated with the monitor point when you create it.