.NET Based OPC UA Client/Server SDK
Data Monitored Items – Modify Data Monitored Items


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


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


Check the box in front of a specific monitored item from the list to display the current monitoring parameters in the grayed-out fields. Enter the new monitoring parameters into the input fields, check the boxes in front of the items to modify and press the button “Modify”. Check the box in front of “Use Asynchronous Pattern” to call “BeginModify” instead of “Modify”. The revised monitoring parameters are now displayed in the grayed-out fields.

Sample Code

The following code modifies the monitoring parameters for existing items and displays the revised monitoring parameters and the status code in the dialog window.

// get the current session from the parent form.
Session session = m_parent.Session;
// nothing to do if no session.
if (session == null)
// build list of items have been checked.
List<ListViewItem> items = new List<ListViewItem>();
List<MonitoredItem> monitoredItems = new List<MonitoredItem>();
foreach (ListViewItem item in MonitoredItemsLV.Items)
if (item.Checked)
MonitoredItem monitoredItem = (MonitoredItem)item.Tag;
// create monitored items.
List<StatusCode> results = m_subscription.ModifyMonitoredItems(
new RequestSettings() { OperationTimeout = 10000 });
// update results in the list.
for (int ii = 0; ii < results.Count; ii++)
UpdateItem(items[ii], monitoredItems[ii]);
// display current values.
// adjust widths.
foreach (ColumnHeader header in MonitoredItemsLV.Columns)
header.Width = -2;
catch (Exception exception)
ExceptionDlg.ShowInnerException(this.Text, exception);
Cursor = Cursors.Default;