Skip to content

Reference

OpcMonitoredItem Members

Represents a node and one of its attributes (= node data) to subscribe to monitor data changes or events on the node.

Reference

OpcMonitoredItem Members ​

Type
OpcMonitoredItem
Namespace
Opc.UaFx.Client
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Constructors ​

OpcMonitoredItem ​

2 overloads

OverloadDescription
OpcMonitoredItem(OpcNodeId, OpcAttribute)Initializes a new instance of the OpcMonitoredItem class using the nodeId and attribute specified.
OpcMonitoredItem(OpcNodeId, OpcAttribute, OpcMonitoringFilter)Initializes a new instance of the OpcMonitoredItem class using the nodeId, attribute and filter specified.

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe nodeId is a null reference (Nothing in Visual Basic).

OpcMonitoredItem(OpcNodeId, OpcAttribute) ​

Initializes a new instance of the OpcMonitoredItem class using the nodeId and attribute specified.

csharp
public OpcMonitoredItem(OpcNodeId nodeId, OpcAttribute attribute)
vbnet
Public Sub New(nodeId As OpcNodeId, attribute As OpcAttribute)

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId of the node to monitor.
attributeOpcAttributeThe OpcAttribute of the node to monitor.

OpcMonitoredItem(OpcNodeId, OpcAttribute, OpcMonitoringFilter) ​

Initializes a new instance of the OpcMonitoredItem class using the nodeId, attribute and filter specified.

csharp
public OpcMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcMonitoringFilter filter)
vbnet
Public Sub New(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    filter As OpcMonitoringFilter)

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId of the node to monitor.
attributeOpcAttributeThe OpcAttribute of the node to monitor.
filterOpcMonitoringFilterThe OpcMonitoringFilter which can be either a OpcDataChangeFilter or a OpcEventFilter instance. This filter is used by the server to pre-filter the notification data passed to the client. This can be also a null reference (Nothing in Visual Basic).

Properties ​

Attribute ​

Gets or sets the OpcAttribute to monitor.

csharp
public OpcAttribute Attribute { get; set; }
vbnet
Public Property Attribute As OpcAttribute

Property value

OpcAttribute

One of the members defined by the OpcAttribute enumeration.

CacheQueueSize ​

Gets or sets the total number of notifications which can be queued in the OpcMonitoredItem related notification cache.

csharp
public int CacheQueueSize { get; set; }
vbnet
Public Property CacheQueueSize As Integer

Property value

Int32

The total number of notifications which can be queued.

Remarks

Using a value less than the current value of this property results into a shrink of the used queue. The queue will then delete all entries exceeding the new size.

ClientID ​

Gets the client-assigned unique identifier for this OpcMonitoredItem.

csharp
public long ClientID { get; }
vbnet
Public ReadOnly Property ClientID As Long

Property value

Int64

The client-assigned unique identifier for this OpcMonitoredItem.

Remarks

The identifier shall be unique for the entire session in order to allow received OpcNotification instances to be associated with and delegated to this OpcMonitoredItem.

DisplayName ​

Gets or sets the name of the OpcMonitoredItem used just for display purpose in the client application.

csharp
public string DisplayName { get; set; }
vbnet
Public Property DisplayName As String

Property value

String

The name of the OpcMonitoredItem used just for display purpose in the client application.

Encoding ​

Gets or sets the name of the data encoding to use.

csharp
public OpcName Encoding { get; set; }
vbnet
Public Property Encoding As OpcName

Property value

OpcName

The OpcName which refers to the type of data encoding to use or a null reference (Nothing in Visual Basic) if the default encoding of the client is to be used.

Remarks

The name of the encodings supported depends on the server.

Filter ​

Gets or sets the filter to evaluate while generating notifications for this OpcMonitoredItem.

csharp
public OpcMonitoringFilter Filter { get; set; }
vbnet
Public Property Filter As OpcMonitoringFilter

Property value

OpcMonitoringFilter

An instance of the OpcDataChangeFilter class to filter data change related notifications, an instance of the OpcEventFilter class to filter events related notifications or a null reference (Nothing in Visual Basic) if no filtering is to be applied to the notifications generated for this OpcMonitoredItem.

IndexRange ​

Gets or sets the range of array indeces to monitor.

csharp
public string IndexRange { get; set; }
vbnet
Public Property IndexRange As String

Property value

String

A string expressing the indeces to monitor.

IsCreated ​

Gets a value indicating whether this OpcMonitoredItem has been created on the server.

csharp
public bool IsCreated { get; }
vbnet
Public ReadOnly Property IsCreated As Boolean

Property value

Boolean

The value true if the OpcMonitoredItem has been created on the server; otherwise the value false.

IsModified ​

Gets a value indicating whether this OpcMonitoredItem has been modified since it has been created on the server or since its previous changes has been committed to the server.

csharp
public bool IsModified { get; }
vbnet
Public ReadOnly Property IsModified As Boolean

Property value

Boolean

The value true if the OpcMonitoredItem has been modified; otherwise the value false.

LastDataChange ​

Gets the last data change-related notification data received from the server.

csharp
public OpcDataChangeDataSetItem LastDataChange { get; }
vbnet
Public ReadOnly Property LastDataChange As OpcDataChangeDataSetItem

Property value

OpcDataChangeDataSetItem

An instance of the OpcDataChangeDataSetItem class which represents the last data change-related notifiction data received from the server or a null reference (Nothing in Visual Basic). For more details see LastNotification.

LastEvent ​

Gets the last event-related notification data received from the server.

csharp
public OpcEventDataSetItem LastEvent { get; }
vbnet
Public ReadOnly Property LastEvent As OpcEventDataSetItem

Property value

OpcEventDataSetItem

An instance of the OpcEventDataSetItem class which represents the last event-related notifiction data received from the server or a null reference (Nothing in Visual Basic). For more details see LastNotification.

LastNotification ​

Gets the last notification received from the server.

csharp
public OpcNotification LastNotification { get; }
vbnet
Public ReadOnly Property LastNotification As OpcNotification

Property value

OpcNotification

An instance of the OpcNotification class which represents the last notification received from the server or a null reference (Nothing in Visual Basic) if the OpcMonitoredItem has not yet received a notification from the server or MaxMessageCount of the Subscription (this monitored item belongs to) is less or equals zero. In addition if UseMonitoredItemDataCache of the Subscription is equals to the value false this property returns a null reference (Nothing in Visual Basic) as well.

MonitoringMode ​

Gets or sets the monitoring mode which applies to the monitored item.

csharp
public OpcMonitoringMode MonitoringMode { get; set; }
vbnet
Public Property MonitoringMode As OpcMonitoringMode

Property value

OpcMonitoringMode

One of the members defined by the OpcMonitoringMode enumeration.

NodeCategory ​

Gets or sets the kind of node to monitor.

csharp
public OpcNodeCategory NodeCategory { get; set; }
vbnet
Public Property NodeCategory As OpcNodeCategory

Property value

OpcNodeCategory

One of the members defined by the OpcNodeCategory enumeration.

NodeId ​

Gets or sets the node identifier of the node to monitor.

csharp
public OpcNodeId NodeId { get; set; }
vbnet
Public Property NodeId As OpcNodeId

Property value

OpcNodeId

An instance of the OpcNodeId class identifying the node on which a node its Attribute is to be monitored.

QueueMode ​

since v2.7

Gets or sets the mode used to enqueue and dequeue notification data items.

csharp
public OpcMonitoredItemQueueMode QueueMode { get; set; }
vbnet
Public Property QueueMode As OpcMonitoredItemQueueMode

Property value

OpcMonitoredItemQueueMode

One of the members defined by the OpcMonitoredItemQueueMode enumeration.

Remarks

This property maps the OpcMonitoredItemQueueMode value specified to the 'DiscardOldest' property in the foundation stack. Regarding the specification this means 'MonitoringParameters.DiscardOldest' which is configured in the foundations stack via 'MonitoredItem.DiscardOldest'.

QueueSize ​

Gets or sets a value which defines the requested total number of notifications the server shall queue for this OpcMonitoredItem.

csharp
public long QueueSize { get; set; }
vbnet
Public Property QueueSize As Long

Property value

Int64

The total number of notifications queued by the server. The default value of this property is 1000.

Remarks

In case of monitoring data changes the value zero or one means the server shall use the default queue size (which is by default one - the queuing is effectively disabled). In case of a queue overflow, the IsOverflow property of the Status in the OpcValue instances reported is set to the value true.

In case of monitoring events the value zero means the server shall use the default queue size. Using the value one means the server shall use the minimum or the value MaxValue the server shall use the maximum queue size the server requires/supports for event notifications.

The value of the underlying property is an uint which is covered using a long to assure CLS compliance. In fact this restricts the value range of this property to MinValue and MaxValue.

RelativePath ​

Gets or sets the relative path to the node to monitor starting at the node identified by the NodeId.

csharp
public string RelativePath { get; set; }
vbnet
Public Property RelativePath As String

Property value

String

A string expressing the relative path to the node to monitor.

ResolvedNodeId ​

Gets the resolved node identifier of the node to monitor.

csharp
public OpcNodeId ResolvedNodeId { get; }
vbnet
Public ReadOnly Property ResolvedNodeId As OpcNodeId

Property value

OpcNodeId

An instance of the OpcNodeId class identifying the resolved node to monitor instead of the one referred to by NodeId. In case there the RelativePath is unspecified the NodeId.

SamplingInterval ​

Gets or sets the requested number of milliseconds of the interval within the server have to access and evaluate this OpcMonitoredItem.

csharp
public int SamplingInterval { get; set; }
vbnet
Public Property SamplingInterval As Integer

Property value

Int32

The interval within the server have to cyclical access and evaluate the Attribute of the monitored node (identified by the NodeId) regarding the Filter condition to determine the need to generate a notification for this OpcMonitoredItem.

Remarks

The value 0 indicates that the server should use the fastest practical rate. The value -1 (or less) indicates that the same interval is to be used as the Subscription uses for the PublishingInterval (this is default sampling interval for the monitored items of the Subscription).

The used sampling interval is not changed if the publishing interval is changed by a subsequent modification of the Subscription.

Status ​

Gets the status information which defines the servers ability to define/provide a monitored item configured like this OpcMonitoredItem.

csharp
public OpcMonitoredItemStatus Status { get; }
vbnet
Public ReadOnly Property Status As OpcMonitoredItemStatus

Property value

OpcMonitoredItemStatus

An instance of the OpcMonitoredItemStatus class representing the status information assoicated with this OpcMonitoredItem.

Subscription ​

Gets the OpcSubscription this OpcMonitoredItem belongs to.

csharp
public OpcSubscription Subscription { get; }
vbnet
Public ReadOnly Property Subscription As OpcSubscription

Property value

OpcSubscription

An instance of the OpcSubscription which owns this OpcMonitoredItem and it is part of its MonitoredItems.

Tag ​

Gets or sets the object that contains additional user data about the monitored item.

csharp
public object Tag { get; set; }
vbnet
Public Property Tag As Object

Property value

Object

An object that contains additional user data about the monitored item. The default is null (Nothing in Visual Basic).

Methods ​

OnDataChangeReceived ​

protected · virtual

Raises the DataChangeReceived event of the OpcMonitoredItem.

csharp
protected virtual void OnDataChangeReceived(OpcDataChangeReceivedEventArgs e)
vbnet
Protected Overridable Sub OnDataChangeReceived(
    e As OpcDataChangeReceivedEventArgs)

Parameters

NameTypeDescription
eOpcDataChangeReceivedEventArgsThe event data.

OnEventReceived ​

protected · virtual

Raises the EventReceived event of the OpcMonitoredItem.

csharp
protected virtual void OnEventReceived(OpcEventReceivedEventArgs e)
vbnet
Protected Overridable Sub OnEventReceived(e As OpcEventReceivedEventArgs)

Parameters

NameTypeDescription
eOpcEventReceivedEventArgsThe event data.

ToString ​

override

Returns a string that represents the current OpcMonitoredItem.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

A string that represents the current OpcMonitoredItem including the used DisplayName, the NodeId, ResolvedNodeId and the Attribute.

Overrides

ToString()

Events ​

DataChangeReceived ​

Occurs when a data change notification has been received.

csharp
public event OpcDataChangeReceivedEventHandler DataChangeReceived
vbnet
Public Event DataChangeReceived As OpcDataChangeReceivedEventHandler

Event type

OpcDataChangeReceivedEventHandler

EventReceived ​

Occurs when an event notification has been received.

csharp
public event OpcEventReceivedEventHandler EventReceived
vbnet
Public Event EventReceived As OpcEventReceivedEventHandler

Event type

OpcEventReceivedEventHandler