C# Class Opc.Ua.Com.Client.ComDaClientNodeManager

A node manager for a server that exposes several variables.
Inheritance: ComClientNodeManager
Mostrar archivo Open project: OPCFoundation/UA-.NET Class Usage Examples

Public Methods

Method Description
ComDaClientNodeManager ( IServerInternal server, string namespaceUri, ComDaClientConfiguration configuration, bool ownsTypeModel ) : System

Initializes the node manager.

CreateAddressSpace ( IDictionary externalReferences ) : void

Does any initialization required before the address space can be used.

The externalReferences is an out parameter that allows the node manager to link to nodes in other node managers. For example, the 'Objects' node is managed by the CoreNodeManager and should have a reference to the root folder node(s) exposed by this node manager.

DeleteAddressSpace ( ) : void

Frees any resources allocated for the address space.

LocalToRemoteValue ( Variant srcValue, object &dstValue ) : int

Converts a value to something the DA server can accept.

New ( ISystemContext context, NodeState node ) : Opc.Ua.NodeId

Creates the NodeId for the specified node.

This method is called by the NodeState.Create() method which initializes a Node from the type model. During initialization a number of child nodes are created and need to have NodeIds assigned to them. This implementation constructs NodeIds by constructing strings. Other implementations could assign unique integers or Guids and save the new Node in a dictionary for later lookup.

OnServerReconnected ( object state ) : void

Called when client manager has reconnected to the COM server.

RemoteToLocalValue ( object srcValue, Variant &dstValue ) : int

Converts a DA value to a UA compatible type.

Protected Methods

Method Description
AddAdditionalElementReferences ( ServerSystemContext context, NodeState node ) : void

Allows sub-class to add additional references to a element node after validation.

CreateMonitoredItem ( ServerSystemContext context, NodeHandle handle, uint subscriptionId, double publishingInterval, DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, MonitoredItemCreateRequest itemToCreate, long &globalIdCounter, MonitoringFilterResult &filterResult, IMonitoredItem &monitoredItem ) : ServiceResult

Creates a new set of monitored items for a set of variables.

This method only handles data change subscriptions. Event subscriptions are created by the SDK.

Dispose ( bool disposing ) : void

An overrideable version of the Dispose.

GetManagerHandle ( ServerSystemContext context, Opc.Ua.NodeId nodeId, NodeState>.IDictionary cache ) : NodeHandle

Returns a unique handle for the node.

LoadPredefinedNodes ( ISystemContext context ) : NodeStateCollection

Loads a node set from a file or resource and addes them to the set of predefined nodes.

OnCreateMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void

Called when a batch of monitored items has been created.

OnDeleteMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void

Called when a batch of monitored items has been deleted.

OnModifyMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void

Called when a batch of monitored items has been modified.

OnSetMonitoringModeComplete ( ServerSystemContext context, IList monitoredItems ) : void

Called when a batch of monitored items has their monitoring mode changed.

Read ( ServerSystemContext context, IList nodesToRead, IList values, IList errors, List nodesToValidate, NodeState>.IDictionary cache ) : void

Validates the nodes and reads the values from the underlying source.

ValidateNode ( ServerSystemContext context, NodeHandle handle, NodeState>.IDictionary cache ) : NodeState

Verifies that the specified node exists.

Write ( ServerSystemContext context, IList nodesToWrite, IList errors, List nodesToValidate, NodeState>.IDictionary cache ) : void

Validates the nodes and writes the value to the underlying system.

Private Methods

Method Description
LocalToRemoteValue ( object srcValue, BuiltInType srcType, BuiltInType dstType ) : object

Converts a UA value to something the DA server will accept.

RemoteToLocalValue ( object srcValue, BuiltInType srcType, BuiltInType dstType ) : object

Converts a value to something the UA client can accept.

Method Details

AddAdditionalElementReferences() protected method

Allows sub-class to add additional references to a element node after validation.
protected AddAdditionalElementReferences ( ServerSystemContext context, NodeState node ) : void
context Opc.Ua.Server.ServerSystemContext
node NodeState
return void

ComDaClientNodeManager() public method

Initializes the node manager.
public ComDaClientNodeManager ( IServerInternal server, string namespaceUri, ComDaClientConfiguration configuration, bool ownsTypeModel ) : System
server IServerInternal
namespaceUri string
configuration ComDaClientConfiguration
ownsTypeModel bool
return System

CreateAddressSpace() public method

Does any initialization required before the address space can be used.
The externalReferences is an out parameter that allows the node manager to link to nodes in other node managers. For example, the 'Objects' node is managed by the CoreNodeManager and should have a reference to the root folder node(s) exposed by this node manager.
public CreateAddressSpace ( IDictionary externalReferences ) : void
externalReferences IDictionary
return void

CreateMonitoredItem() protected method

Creates a new set of monitored items for a set of variables.
This method only handles data change subscriptions. Event subscriptions are created by the SDK.
protected CreateMonitoredItem ( ServerSystemContext context, NodeHandle handle, uint subscriptionId, double publishingInterval, DiagnosticsMasks diagnosticsMasks, TimestampsToReturn timestampsToReturn, MonitoredItemCreateRequest itemToCreate, long &globalIdCounter, MonitoringFilterResult &filterResult, IMonitoredItem &monitoredItem ) : ServiceResult
context Opc.Ua.Server.ServerSystemContext
handle Opc.Ua.Server.NodeHandle
subscriptionId uint
publishingInterval double
diagnosticsMasks DiagnosticsMasks
timestampsToReturn TimestampsToReturn
itemToCreate Opc.Ua.MonitoredItemCreateRequest
globalIdCounter long
filterResult MonitoringFilterResult
monitoredItem IMonitoredItem
return Opc.Ua.ServiceResult

DeleteAddressSpace() public method

Frees any resources allocated for the address space.
public DeleteAddressSpace ( ) : void
return void

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetManagerHandle() protected method

Returns a unique handle for the node.
protected GetManagerHandle ( ServerSystemContext context, Opc.Ua.NodeId nodeId, NodeState>.IDictionary cache ) : NodeHandle
context Opc.Ua.Server.ServerSystemContext
nodeId Opc.Ua.NodeId
cache NodeState>.IDictionary
return Opc.Ua.Server.NodeHandle

LoadPredefinedNodes() protected method

Loads a node set from a file or resource and addes them to the set of predefined nodes.
protected LoadPredefinedNodes ( ISystemContext context ) : NodeStateCollection
context ISystemContext
return NodeStateCollection

LocalToRemoteValue() public static method

Converts a value to something the DA server can accept.
public static LocalToRemoteValue ( Variant srcValue, object &dstValue ) : int
srcValue Variant The source value.
dstValue object The converted value.
return int

New() public method

Creates the NodeId for the specified node.
This method is called by the NodeState.Create() method which initializes a Node from the type model. During initialization a number of child nodes are created and need to have NodeIds assigned to them. This implementation constructs NodeIds by constructing strings. Other implementations could assign unique integers or Guids and save the new Node in a dictionary for later lookup.
public New ( ISystemContext context, NodeState node ) : Opc.Ua.NodeId
context ISystemContext The context.
node NodeState The node.
return Opc.Ua.NodeId

OnCreateMonitoredItemsComplete() protected method

Called when a batch of monitored items has been created.
protected OnCreateMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnDeleteMonitoredItemsComplete() protected method

Called when a batch of monitored items has been deleted.
protected OnDeleteMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnModifyMonitoredItemsComplete() protected method

Called when a batch of monitored items has been modified.
protected OnModifyMonitoredItemsComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

OnServerReconnected() public method

Called when client manager has reconnected to the COM server.
public OnServerReconnected ( object state ) : void
state object
return void

OnSetMonitoringModeComplete() protected method

Called when a batch of monitored items has their monitoring mode changed.
protected OnSetMonitoringModeComplete ( ServerSystemContext context, IList monitoredItems ) : void
context Opc.Ua.Server.ServerSystemContext
monitoredItems IList
return void

Read() protected method

Validates the nodes and reads the values from the underlying source.
protected Read ( ServerSystemContext context, IList nodesToRead, IList values, IList errors, List nodesToValidate, NodeState>.IDictionary cache ) : void
context Opc.Ua.Server.ServerSystemContext The context.
nodesToRead IList The nodes to read.
values IList The values.
errors IList The errors.
nodesToValidate List The nodes to validate.
cache NodeState>.IDictionary The cache.
return void

RemoteToLocalValue() public static method

Converts a DA value to a UA compatible type.
public static RemoteToLocalValue ( object srcValue, Variant &dstValue ) : int
srcValue object The source value.
dstValue Variant The converted value.
return int

ValidateNode() protected method

Verifies that the specified node exists.
protected ValidateNode ( ServerSystemContext context, NodeHandle handle, NodeState>.IDictionary cache ) : NodeState
context Opc.Ua.Server.ServerSystemContext
handle Opc.Ua.Server.NodeHandle
cache NodeState>.IDictionary
return NodeState

Write() protected method

Validates the nodes and writes the value to the underlying system.
protected Write ( ServerSystemContext context, IList nodesToWrite, IList errors, List nodesToValidate, NodeState>.IDictionary cache ) : void
context Opc.Ua.Server.ServerSystemContext The context.
nodesToWrite IList The nodes to write.
errors IList The errors.
nodesToValidate List The nodes to validate.
cache NodeState>.IDictionary The cache.
return void