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


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


The following dialog shows an example dialog for modifying Event 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 box in front of an item and press the button “Event Filter” to add, edit, or delete BaseEventTypes for each item.


Choose “Add” to open a browse window and choose additional filters.


To modify a variable, choose “Edit” from the context menu, and double click on the value to open a dialog window for editing.


When finished, press the button “Modify” to actually modify the monitoring parameters and event filters of the selected items. Check the box in front of “Use Asynchronous Pattern” to call “BeginModify” instead of “Modify”.

Sample Code

The following code modifies the monitoring parameters and the event filter for existing monitored items.

// 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;