.NET Based OPC UA Client/Server SDK  2.6.1.422
Monitored Items – Set Monitoring Mode

Prerequisites

A session and a subscription with the server must be established.

Description

The following dialog shows an example dialog for setting the monitoring mode for monitored items. Press the button “Show Code” to display the corresponding code, and the button “Help” to show this documentation page.

clienttutorials_set_monitoring_mode.png

All currently monitored items are shown in the list at the bottom of the dialog window. Check the box in front of an item to show the current monitoring mode in the grayed-out box. Select the desired monitoring mode from the drop-down menu and check the boxes in front of the items to modify. Press the button “Modify” to apply the changes. Check the box in front of “Use Asynchronous Pattern” to call “BeginModify” instead of “Modify”.

Sample Code

The following code changes the monitoring mode for a set of monitored items.

You can call SetMonitoringMode for a list of MonitoredItems. The monitored items and the method to call must belong to the same subscription. All selected monitored items will get the same monitoring mode.

// create monitored items.
List<StatusCode> results = m_subscription.SetMonitoringMode(
(MonitoringMode)MonitoringModeCB.SelectedItem,
monitoredItems,
new RequestSettings() { OperationTimeout = 10000 });