C# Class Opc.Ua.Server.MonitoredItem

A handle that describes how to access a node/attribute via an i/o manager.
Inheritance: IEventMonitoredItem, ISampledDataChangeMonitoredItem, ITriggeredMonitoredItem
ファイルを表示 Open project: OPCFoundation/UA-.NET Class Usage Examples

Private Properties

Property Type Description
AddValueToQueue void
ExceedsDeadband bool
GetEventFields EventFieldList
IncrementSampleTime void
Initialize void
SetOverflowBit ServiceResult

Public Methods

Method Description
GetCreateResult ( MonitoredItemCreateResult &result ) : ServiceResult

Returns the result after creating the monitor item.

GetModifyResult ( MonitoredItemModifyResult &result ) : ServiceResult

Returns the result after modifying the monitor item.

GetReadValueId ( ) : ReadValueId

Returns a description of the item being monitored.

IEventMonitoredItem ( MonitoringMode monitoringMode ) : void

Changes the monitoring mode for the item.

ISampledDataChangeMonitoredItem ( MonitoringMode monitoringMode ) : void

Changes the monitoring mode for the item.

ModifyAttributes ( DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, uint clientHandle, MonitoringFilter originalFilter, MonitoringFilter filterToUse, Range range, double samplingInterval, uint queueSize, bool discardOldest ) : ServiceResult

Modifies the attributes for monitored item.

MonitoredItem ( IServerInternal server, INodeManager nodeManager, object mangerHandle, uint subscriptionId, uint id, Session session, ReadValueId itemToMonitor, DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, MonitoringMode monitoringMode, uint clientHandle, MonitoringFilter originalFilter, MonitoringFilter filterToUse, Range range, double samplingInterval, uint queueSize, bool discardOldest, double sourceSamplingInterval ) : System

Initializes the object with its node type.

Publish ( OperationContext context, Queue notifications ) : bool

Publishes all available event notifications.

Publish ( OperationContext context, Queue notifications, Queue diagnostics ) : bool

Publishes all available data change notifications.

QueueEvent ( EventFieldList fields ) : void

Adds an event to the queue.

QueueEvent ( IFilterTarget instance ) : void

Adds an event to the queue.

QueueEvent ( IFilterTarget instance, bool bypassFilter ) : void

Adds an event to the queue.

QueueValue ( DataValue value, ServiceResult error ) : void

Adds an event to the queue.

QueueValue ( DataValue value, ServiceResult error, bool bypassFilter ) : void

Updates the queue with a data value or an error.

SamplingIntervalExpired ( ) : bool

Used to check whether the item is ready to sample.

SetMonitoringMode ( MonitoringMode monitoringMode ) : MonitoringMode

Changes the monitoring mode for the item.

SetSamplingError ( ServiceResult error ) : void

Sets an error that occured in the sampling group.

The sampling group or node manager that owns the item may call this to indicate that a fatal error occurred which means the item will no longer receive any data updates. This error state can be cleared by calling this method and passing in ServiceResult.Good.

SetSamplingInterval ( double samplingInterval ) : void

Updates the sampling interval for an item.

SetSemanticsChanged ( ) : void

Sets a flag indicating that the semantics for the monitored node have changed.

The StatusCode for next value reported by the monitored item will have the SemanticsChanged bit set.

SetStructureChanged ( ) : void

Sets a flag indicating that the structure of the monitored node has changed.

The StatusCode for next value reported by the monitored item will have the StructureChanged bit set.

SetTriggered ( ) : bool

Sets a flag indicating that the item has been triggered and should publish.

ValueChanged ( DataValue value, ServiceResult error, DataValue lastValue, ServiceResult lastError, DataChangeFilter filter, double range ) : bool

Applies the filter to value to determine if the new value should be kept.

Protected Methods

Method Description
ApplyFilter ( DataValue value, ServiceResult error ) : bool

Applies the filter to value to determine if the new value should be kept.

Equals ( object value1, object value2, DeadbandType deadbandType, double deadband, double range ) : bool

Checks if the two values are equal.

ExceedsDeadband ( object value1, object value2, DeadbandType deadbandType, double deadband, double range ) : bool

Returns true if the deadband was exceeded.

InitializeQueue ( ) : void

Clears and re-initializes the queue if the monitoring parameters changed.

Publish ( OperationContext context, Queue notifications, Queue diagnostics, DataValue value, ServiceResult error ) : bool

Publishes a single data change notifications.

Private Methods

Method Description
AddValueToQueue ( DataValue value, ServiceResult error ) : void

Adds a value to the queue.

ExceedsDeadband ( double value1, double value2, DeadbandType deadbandType, double deadband, double range ) : bool

Returns true if the deadband was exceeded.

GetEventFields ( FilterContext context, EventFilter filter, IFilterTarget instance ) : EventFieldList

Fetches the event fields from the event.

IncrementSampleTime ( ) : void

Increments the sample time to the next interval.

Initialize ( ) : void

Sets private members to default values.

SetOverflowBit ( object value, ServiceResult error ) : ServiceResult

Sets the overflow bit.

Method Details

ApplyFilter() protected method

Applies the filter to value to determine if the new value should be kept.
protected ApplyFilter ( DataValue value, ServiceResult error ) : bool
value DataValue
error ServiceResult
return bool

Equals() protected static method

Checks if the two values are equal.
protected static Equals ( object value1, object value2, DeadbandType deadbandType, double deadband, double range ) : bool
value1 object
value2 object
deadbandType DeadbandType
deadband double
range double
return bool

ExceedsDeadband() protected static method

Returns true if the deadband was exceeded.
protected static ExceedsDeadband ( object value1, object value2, DeadbandType deadbandType, double deadband, double range ) : bool
value1 object
value2 object
deadbandType DeadbandType
deadband double
range double
return bool

GetCreateResult() public method

Returns the result after creating the monitor item.
public GetCreateResult ( MonitoredItemCreateResult &result ) : ServiceResult
result MonitoredItemCreateResult
return ServiceResult

GetModifyResult() public method

Returns the result after modifying the monitor item.
public GetModifyResult ( MonitoredItemModifyResult &result ) : ServiceResult
result MonitoredItemModifyResult
return ServiceResult

GetReadValueId() public method

Returns a description of the item being monitored.
public GetReadValueId ( ) : ReadValueId
return ReadValueId

IEventMonitoredItem() public method

Changes the monitoring mode for the item.
public IEventMonitoredItem ( MonitoringMode monitoringMode ) : void
monitoringMode MonitoringMode
return void

ISampledDataChangeMonitoredItem() public method

Changes the monitoring mode for the item.
public ISampledDataChangeMonitoredItem ( MonitoringMode monitoringMode ) : void
monitoringMode MonitoringMode
return void

InitializeQueue() protected method

Clears and re-initializes the queue if the monitoring parameters changed.
protected InitializeQueue ( ) : void
return void

ModifyAttributes() public method

Modifies the attributes for monitored item.
public ModifyAttributes ( DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, uint clientHandle, MonitoringFilter originalFilter, MonitoringFilter filterToUse, Range range, double samplingInterval, uint queueSize, bool discardOldest ) : ServiceResult
diagnosticsMasks DiagnosticsMasks
timestampsToReturn TimestampsToReturn
clientHandle uint
originalFilter MonitoringFilter
filterToUse MonitoringFilter
range Range
samplingInterval double
queueSize uint
discardOldest bool
return ServiceResult

MonitoredItem() public method

Initializes the object with its node type.
public MonitoredItem ( IServerInternal server, INodeManager nodeManager, object mangerHandle, uint subscriptionId, uint id, Session session, ReadValueId itemToMonitor, DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, MonitoringMode monitoringMode, uint clientHandle, MonitoringFilter originalFilter, MonitoringFilter filterToUse, Range range, double samplingInterval, uint queueSize, bool discardOldest, double sourceSamplingInterval ) : System
server IServerInternal
nodeManager INodeManager
mangerHandle object
subscriptionId uint
id uint
session Session
itemToMonitor ReadValueId
diagnosticsMasks DiagnosticsMasks
timestampsToReturn TimestampsToReturn
monitoringMode MonitoringMode
clientHandle uint
originalFilter MonitoringFilter
filterToUse MonitoringFilter
range Range
samplingInterval double
queueSize uint
discardOldest bool
sourceSamplingInterval double
return System

Publish() public method

Publishes all available event notifications.
public Publish ( OperationContext context, Queue notifications ) : bool
context OperationContext
notifications Queue
return bool

Publish() public method

Publishes all available data change notifications.
public Publish ( OperationContext context, Queue notifications, Queue diagnostics ) : bool
context OperationContext
notifications Queue
diagnostics Queue
return bool

Publish() protected method

Publishes a single data change notifications.
protected Publish ( OperationContext context, Queue notifications, Queue diagnostics, DataValue value, ServiceResult error ) : bool
context OperationContext
notifications Queue
diagnostics Queue
value DataValue
error ServiceResult
return bool

QueueEvent() public method

Adds an event to the queue.
public QueueEvent ( EventFieldList fields ) : void
fields EventFieldList
return void

QueueEvent() public method

Adds an event to the queue.
public QueueEvent ( IFilterTarget instance ) : void
instance IFilterTarget
return void

QueueEvent() public method

Adds an event to the queue.
public QueueEvent ( IFilterTarget instance, bool bypassFilter ) : void
instance IFilterTarget
bypassFilter bool
return void

QueueValue() public method

Adds an event to the queue.
public QueueValue ( DataValue value, ServiceResult error ) : void
value DataValue
error ServiceResult
return void

QueueValue() public method

Updates the queue with a data value or an error.
public QueueValue ( DataValue value, ServiceResult error, bool bypassFilter ) : void
value DataValue
error ServiceResult
bypassFilter bool
return void

SamplingIntervalExpired() public method

Used to check whether the item is ready to sample.
public SamplingIntervalExpired ( ) : bool
return bool

SetMonitoringMode() public method

Changes the monitoring mode for the item.
public SetMonitoringMode ( MonitoringMode monitoringMode ) : MonitoringMode
monitoringMode MonitoringMode
return MonitoringMode

SetSamplingError() public method

Sets an error that occured in the sampling group.
The sampling group or node manager that owns the item may call this to indicate that a fatal error occurred which means the item will no longer receive any data updates. This error state can be cleared by calling this method and passing in ServiceResult.Good.
public SetSamplingError ( ServiceResult error ) : void
error ServiceResult
return void

SetSamplingInterval() public method

Updates the sampling interval for an item.
public SetSamplingInterval ( double samplingInterval ) : void
samplingInterval double
return void

SetSemanticsChanged() public method

Sets a flag indicating that the semantics for the monitored node have changed.
The StatusCode for next value reported by the monitored item will have the SemanticsChanged bit set.
public SetSemanticsChanged ( ) : void
return void

SetStructureChanged() public method

Sets a flag indicating that the structure of the monitored node has changed.
The StatusCode for next value reported by the monitored item will have the StructureChanged bit set.
public SetStructureChanged ( ) : void
return void

SetTriggered() public method

Sets a flag indicating that the item has been triggered and should publish.
public SetTriggered ( ) : bool
return bool

ValueChanged() public static method

Applies the filter to value to determine if the new value should be kept.
public static ValueChanged ( DataValue value, ServiceResult error, DataValue lastValue, ServiceResult lastError, DataChangeFilter filter, double range ) : bool
value DataValue
error ServiceResult
lastValue DataValue
lastError ServiceResult
filter DataChangeFilter
range double
return bool