Opening and enabling monitor sets, Using the enable method, Opening and enabling – Echelon LNS User Manual
Page 227: Monitor sets, Opening and enabling monitor sets on
LNS Programmer's Guide
213
Opening and Enabling Monitor Sets
After you have created a monitor set and defined its monitoring options, you can open it
and enable it for monitor and control operations. Note that you will not be able to use a
permanent monitor set that was created while the system management mode was
lcaMgmtModeDeferConfigUpdates until the system management mode has been
changed back to lcaMgmtModePropagateConfigUpdates. In addition, configuration
changes made to a permanent monitor set made while the system management mode is
set to lcaMgmtModeDeferConfigUpdates will not take effect until the management
mode is set to lcaMgmtModePropagateConfigUpdates.
Remember that you should access permanent monitor sets through the
CurrentMonitorSets property when you plan to open them. To open a monitor set, call
the
Open()
method on the monitor set. The
Open()
method takes two parameters:
doEnable
and
doPoll
. The
doEnable
parameter determines whether or not the
monitor set should be enabled when it is opened. If
True
, monitoring of all points in the
monitor set will be enabled. In this case, the
doPoll
parameter indicates whether or not
polling of the monitor set will also be enabled. Monitor set polling is described in more
detail later in this chapter.
If the
doEnable
parameter is set to
False
, the monitor set will not be enabled, and the
doPoll
parameter will not have an effect. In this case, you will need to enable the
monitor set, or a group of monitor points within the set, later with the
Enable()
method.
NOTE: You do not need to use the Open() method to open temporary monitor sets with
your application, as they are opened automatically by LNS when they are created.
However, LNS does not enable temporary monitor sets at this point. This is so you can
set the
Tag
property and the monitoring options for your temporary monitor sets before
enabling them. As a result, you need to manually enable all temporary monitor sets with
the Enable() method, as described in the next section.
Using the Enable Method
You can enable all the monitor points in a permanent monitor set at once by setting the
doEnable element to True when you open the monitor set. If the doEnable element is
set to False, you can enable the monitor set later by calling the
Enable()
method on the
MonitorSet
object later. You can use the same method to enable a temporary monitor
set.
You can also enable monitoring for an individual network variable or message monitor
point in a permanent or temporary monitor set by calling the Enable() method on the
NvMonitorPoint
or
MsgMonitorPoint
object.
For monitor sets and network variable monitor points, the
Enable()
method takes one
input parameter:
doPoll
. If this is set to
True
, polling will be started on the network
variable monitor points when it is enabled. For message monitor points, the
Enable()
method takes no input parameters, as you cannot poll message monitor points.
You can use the
Disable()
method to stop all polled and bound monitoring and control
for a monitor set or monitor point. If the
Disable()
method is called on a
MonitorSet
object, polled and bound monitoring for all monitor points on the monitor set will be
disabled. After this, none of the monitor points in the set can be enabled for monitoring
until the
Enable()
method has been called on the
MonitorSet
object again.