.NET Based OPC UA Client/Server SDK  3.3.3.537
UnifiedAutomation.UaServer.ServerInternalClient Class Reference

A class that can be used to access server functionality internally. More...

Public Member Functions

 ServerInternalClient (ServerManager server)
 Initializes a new instance of the ServerInternalClient class. More...
 
NodeMetadata GetNodeMetadata (RequestContext context, NodeId nodeId, NodeMetadataMask fieldsToReturn, NodeClass nodeClassFilter)
 Gets the node metadata. More...
 
NodeMetadata GetNodeMetadata (RequestContext context, NodeAttributeHandle nodeHandle, NodeMetadataMask fieldsToReturn, NodeClass nodeClassFilter)
 Gets the node metadata. More...
 
NodeMetadata GetNodeMetadata (RequestContext context, BrowseHandle browseHandle, NodeMetadataMask fieldsToReturn, NodeClass nodeClassFilter)
 Gets the node metadata. More...
 
ReferenceDescription GetReferenceDescription (RequestContext context, ExpandedNodeId nodeId, NodeId referenceTypeId, bool isForward, uint resultMask, uint nodeClassMask)
 Gets the reference description. More...
 
Node GetNodeAttributes (RequestContext context, NodeId nodeId, NodeClass expectedNodeClass)
 Gets the node attributes. More...
 
ReadAttribute< T > (RequestContext context, NodeId nodeId, uint attributeId, T defaultValue)
 Reads the attribute. More...
 
ReadValue< T > (RequestContext context, NodeId nodeId, QualifiedName componentName, T defaultValue)
 Reads the component value. More...
 
ReadValue< T > (RequestContext context, NodeId nodeId, QualifiedName[] browsePath, T defaultValue)
 Reads the component value. More...
 
StatusCode WriteAttribute (RequestContext context, NodeId nodeId, uint attributeId, Variant valueToWrite)
 Writes the attribute. More...
 
StatusCode WriteValue (RequestContext context, NodeId nodeId, QualifiedName componentName, Variant valueToWrite)
 Writes the component value. More...
 
StatusCode WriteValue (RequestContext context, NodeId nodeId, QualifiedName[] browsePath, Variant valueToWrite)
 Reads the component value. More...
 
List< ReferenceDescriptionBrowse (RequestContext context, ViewHandle viewToBrowse, BrowseDescription nodeToBrowse)
 Returns the ReferenceDescriptions for the nodeToBrowse. More...
 
StatusCode Browse (RequestContext context, ViewHandle viewHandle, uint maxReferencesPerNode, BrowseDescription nodeToBrowse, INodeManager nodeManager, List< ReferenceDescription > references, out ContinuationPoint continuationPoint)
 Browses the specified context. More...
 
StatusCode BrowseNext (RequestContext context, ContinuationPoint continuationPoint, List< ReferenceDescription > references, out ContinuationPoint revisedContinuationPoint)
 Browses the specified context. More...
 
StatusCode ReleaseContinuationPoint (RequestContext context, ContinuationPoint continuationPoint)
 Browses the specified context. More...
 
StatusCode Translate (RequestContext context, NodeId nodeToTranslate, RelativePath relativePath, uint index, BrowsePathResult result)
 Translates the relativePath from the nodeToTranslate. More...
 
List< DataValueRead (RequestContext context, TimestampsToReturn timestampsToReturn, IList< ReadValueId > nodesToRead)
 Reads the values of the specified nodes. More...
 
List< StatusCodeWrite (RequestContext context, IList< WriteValue > nodesToWrite)
 Writes the values of the specified nodes. More...
 
List< CallMethodResultCall (RequestContext context, IList< CallMethodRequest > methodsToCall)
 Calls the values of the specified nodes. More...
 
List< MonitoredItemCreateResultCreateDataMonitoredItems (RequestContext context, IList< InternalClientFastDataMonitoredItem > monitoredItems)
 Creates the data monitored item. More...
 
List< MonitoredItemCreateResultCreateDataMonitoredItems (RequestContext context, IList< InternalClientFullDataMonitoredItem > monitoredItems)
 Creates the data monitored item. More...
 
List< MonitoredItemModifyResultModifyDataMonitoredItems (RequestContext context, IList< MonitoredItemModifyRequest > itemsToModify)
 Modifies the data monitored item. More...
 
List< StatusCodeDeleteDataMonitoredItems (RequestContext context, IList< uint > itemsToDelete)
 Deletes the data monitored item. More...
 
List< MonitoredItemCreateResultCreateEventMonitoredItems (RequestContext context, IList< InternalClientFastEventMonitoredItem > monitoredItems)
 Creates the event monitored item. More...
 
List< MonitoredItemCreateResultCreateEventMonitoredItems (RequestContext context, IList< InternalClientFullEventMonitoredItem > monitoredItems)
 Creates a list of event monitored items. More...
 
List< MonitoredItemModifyResultModifyEventMonitoredItems (RequestContext context, IList< MonitoredItemModifyRequest > itemsToModify)
 Modifies the data monitored item. More...
 
List< StatusCodeDeleteEventMonitoredItems (RequestContext context, IList< uint > itemsToDelete)
 Deletes the data monitored item. More...
 
List< StatusCodeSetMonitoringMode (RequestContext context, MonitoringMode monitoringMode, IList< uint > itemsToModify)
 Sets the monitoring mode. More...
 

Detailed Description

A class that can be used to access server functionality internally.

Constructor & Destructor Documentation

UnifiedAutomation.UaServer.ServerInternalClient.ServerInternalClient ( ServerManager  server)

Initializes a new instance of the ServerInternalClient class.

Parameters
serverThe server.

Member Function Documentation

List<ReferenceDescription> UnifiedAutomation.UaServer.ServerInternalClient.Browse ( RequestContext  context,
ViewHandle  viewToBrowse,
BrowseDescription  nodeToBrowse 
)

Returns the ReferenceDescriptions for the nodeToBrowse.

Parameters
contextThe request context of the caller. In most cases Server.DefaultRequestContext should be used.
viewToBrowseThe ViewHandle for the browse call. If the server does not support views, null shall be used for the call.
nodeToBrowseThe information about the stating node and the parameters for the Browse call.
To get the TypeDefinition and the ReferenceType of the targets you have to specify them in the ResultMask.
Returns
The ReferenceDescriptions for the nodeToBrowse.

The following code example code returns all nodes that are referenced with hierarchical references from the Objects folder.

var results = Server.InternalClient.Browse(
Server.DefaultRequestContext,
null,
new BrowseDescription()
{
IncludeSubtypes = true,
BrowseDirection = BrowseDirection.Forward,
ResultMask = (uint)(BrowseResultMask.TypeDefinition|BrowseResultMask.ReferenceTypeId)
});
StatusCode UnifiedAutomation.UaServer.ServerInternalClient.Browse ( RequestContext  context,
ViewHandle  viewHandle,
uint  maxReferencesPerNode,
BrowseDescription  nodeToBrowse,
INodeManager  nodeManager,
List< ReferenceDescription references,
out ContinuationPoint  continuationPoint 
)

Browses the specified context.

StatusCode UnifiedAutomation.UaServer.ServerInternalClient.BrowseNext ( RequestContext  context,
ContinuationPoint  continuationPoint,
List< ReferenceDescription references,
out ContinuationPoint  revisedContinuationPoint 
)

Browses the specified context.

List<CallMethodResult> UnifiedAutomation.UaServer.ServerInternalClient.Call ( RequestContext  context,
IList< CallMethodRequest methodsToCall 
)

Calls the values of the specified nodes.

List<MonitoredItemCreateResult> UnifiedAutomation.UaServer.ServerInternalClient.CreateDataMonitoredItems ( RequestContext  context,
IList< InternalClientFastDataMonitoredItem monitoredItems 
)

Creates the data monitored item.

List<MonitoredItemCreateResult> UnifiedAutomation.UaServer.ServerInternalClient.CreateDataMonitoredItems ( RequestContext  context,
IList< InternalClientFullDataMonitoredItem monitoredItems 
)

Creates the data monitored item.

List<MonitoredItemCreateResult> UnifiedAutomation.UaServer.ServerInternalClient.CreateEventMonitoredItems ( RequestContext  context,
IList< InternalClientFastEventMonitoredItem monitoredItems 
)

Creates the event monitored item.

List<MonitoredItemCreateResult> UnifiedAutomation.UaServer.ServerInternalClient.CreateEventMonitoredItems ( RequestContext  context,
IList< InternalClientFullEventMonitoredItem monitoredItems 
)

Creates a list of event monitored items.

Sample code:

var result = Server.InternalClient.CreateEventMonitoredItems(
Server.DefaultRequestContext,
new List&lt;InternalClientFullEventMonitoredItem>
{
new InternalClientFullEventMonitoredItem()
{
NodeId = ObjectIds.Server,
Filter = new EventFilter()
{
SelectClauses = new SimpleAttributeOperandCollection()
{
new SimpleAttributeOperand()
{
AttributeId = Attributes.Value,
BrowsePath = new QualifiedNameCollection()
{
new QualifiedName(BrowseNames.SourceName)
}
},
new SimpleAttributeOperand()
{
AttributeId = Attributes.Value,
BrowsePath = new QualifiedNameCollection()
{
new QualifiedName(BrowseNames.Message)
}
},
new SimpleAttributeOperand()
{
AttributeId = Attributes.Value,
BrowsePath = new QualifiedNameCollection()
{
new QualifiedName(BrowseNames.Severity)
}
}
},
WhereClause = new ContentFilter()
{
Elements = new ContentFilterElementCollection()
{
new ContentFilterElement()
{
FilterOperator = FilterOperator.And,
FilterOperands = new ExtensionObjectCollection()
{
new ExtensionObject(
new ElementOperand()
{
Index = 1
}),
new ExtensionObject(
new ElementOperand()
{
Index = 2
})
}
},
new ContentFilterElement()
{
FilterOperator = FilterOperator.GreaterThan,
FilterOperands = new ExtensionObjectCollection()
{
new ExtensionObject(
new SimpleAttributeOperand()
{
AttributeId = Attributes.Value,
BrowsePath = new QualifiedNameCollection()
{
new QualifiedName(BrowseNames.Severity)
}
}),
new ExtensionObject(new LiteralOperand()
{
Value = new Variant((ushort) 400)
})
}
},
new ContentFilterElement()
{
FilterOperator = FilterOperator.OfType,
FilterOperands = new ExtensionObjectCollection()
{
new ExtensionObject(new LiteralOperand()
{
Value = new Variant(UnifiedAutomation.UaBase.ObjectTypeIds.BaseModelChangeEventType)
})
}
}
}
}
},
Callback = OnEventReceived
}
);
...
void OnEventReceived(
RequestContext context,
MonitoredItemHandle itemHandle,
EventFieldList e,
object callbackData)
{
}
List<StatusCode> UnifiedAutomation.UaServer.ServerInternalClient.DeleteDataMonitoredItems ( RequestContext  context,
IList< uint >  itemsToDelete 
)

Deletes the data monitored item.

List<StatusCode> UnifiedAutomation.UaServer.ServerInternalClient.DeleteEventMonitoredItems ( RequestContext  context,
IList< uint >  itemsToDelete 
)

Deletes the data monitored item.

Node UnifiedAutomation.UaServer.ServerInternalClient.GetNodeAttributes ( RequestContext  context,
NodeId  nodeId,
NodeClass  expectedNodeClass 
)

Gets the node attributes.

Parameters
contextThe request context.
nodeIdThe node id.
expectedNodeClassThe expected node class.
Returns
NodeMetadata UnifiedAutomation.UaServer.ServerInternalClient.GetNodeMetadata ( RequestContext  context,
NodeId  nodeId,
NodeMetadataMask  fieldsToReturn,
NodeClass  nodeClassFilter 
)

Gets the node metadata.

Parameters
contextThe request context.
nodeIdThe node id.
fieldsToReturnThe fields to return.
nodeClassFilterThe node class filter.
Returns
NodeMetadata UnifiedAutomation.UaServer.ServerInternalClient.GetNodeMetadata ( RequestContext  context,
NodeAttributeHandle  nodeHandle,
NodeMetadataMask  fieldsToReturn,
NodeClass  nodeClassFilter 
)

Gets the node metadata.

Parameters
contextThe request context.
nodeHandleThe node handle.
fieldsToReturnThe fields to return.
nodeClassFilterThe node class filter.
Returns
NodeMetadata UnifiedAutomation.UaServer.ServerInternalClient.GetNodeMetadata ( RequestContext  context,
BrowseHandle  browseHandle,
NodeMetadataMask  fieldsToReturn,
NodeClass  nodeClassFilter 
)

Gets the node metadata.

Parameters
contextThe request context.
browseHandleThe browse handle.
fieldsToReturnThe fields to return.
nodeClassFilterThe node class filter.
Returns
ReferenceDescription UnifiedAutomation.UaServer.ServerInternalClient.GetReferenceDescription ( RequestContext  context,
ExpandedNodeId  nodeId,
NodeId  referenceTypeId,
bool  isForward,
uint  resultMask,
uint  nodeClassMask 
)

Gets the reference description.

Parameters
contextThe request context.
nodeIdThe node id.
referenceTypeIdThe reference type id.
isForwardif set to true [is forward].
resultMaskThe result mask.
nodeClassMaskThe node class mask.
Returns
List<MonitoredItemModifyResult> UnifiedAutomation.UaServer.ServerInternalClient.ModifyDataMonitoredItems ( RequestContext  context,
IList< MonitoredItemModifyRequest itemsToModify 
)

Modifies the data monitored item.

List<MonitoredItemModifyResult> UnifiedAutomation.UaServer.ServerInternalClient.ModifyEventMonitoredItems ( RequestContext  context,
IList< MonitoredItemModifyRequest itemsToModify 
)

Modifies the data monitored item.

List<DataValue> UnifiedAutomation.UaServer.ServerInternalClient.Read ( RequestContext  context,
TimestampsToReturn  timestampsToReturn,
IList< ReadValueId nodesToRead 
)

Reads the values of the specified nodes.

T UnifiedAutomation.UaServer.ServerInternalClient.ReadAttribute< T > ( RequestContext  context,
NodeId  nodeId,
uint  attributeId,
defaultValue 
)

Reads the attribute.

Template Parameters
T
Parameters
contextThe request context.
nodeIdThe node id.
attributeIdThe attribute id.
defaultValueThe default value.
Returns
T UnifiedAutomation.UaServer.ServerInternalClient.ReadValue< T > ( RequestContext  context,
NodeId  nodeId,
QualifiedName  componentName,
defaultValue 
)

Reads the component value.

Template Parameters
T
Parameters
contextThe request context.
nodeIdThe node id.
componentNameName of the component.
defaultValueThe default value.
Returns
T UnifiedAutomation.UaServer.ServerInternalClient.ReadValue< T > ( RequestContext  context,
NodeId  nodeId,
QualifiedName[]  browsePath,
defaultValue 
)

Reads the component value.

Template Parameters
T
Parameters
contextThe request context.
nodeIdThe node id.
browsePathThe browse path.
defaultValueThe default value.
Returns
StatusCode UnifiedAutomation.UaServer.ServerInternalClient.ReleaseContinuationPoint ( RequestContext  context,
ContinuationPoint  continuationPoint 
)

Browses the specified context.

List<StatusCode> UnifiedAutomation.UaServer.ServerInternalClient.SetMonitoringMode ( RequestContext  context,
MonitoringMode  monitoringMode,
IList< uint >  itemsToModify 
)

Sets the monitoring mode.

Parameters
contextThe request context.
monitoringModeThe monitoring mode.
itemsToModifyThe items to modify.
Returns
StatusCode UnifiedAutomation.UaServer.ServerInternalClient.Translate ( RequestContext  context,
NodeId  nodeToTranslate,
RelativePath  relativePath,
uint  index,
BrowsePathResult  result 
)

Translates the relativePath from the nodeToTranslate.

Parameters
contextThe request context of the caller. In most cases Server.DefaultRequestContext should be used.
nodeToTranslateThe node to translate.
relativePathThe relative path to the expected results
indexThe current index in the relativePath. Should be 0 in the most cases.
resultThe result will contain the found nodes.
Returns
StatusCodes.Good if the call succeeds.

The following code example code is used to find a node in the DemoServer.

BrowsePathResult result = new BrowsePathResult();
var statusCode = Server.InternalClient.Translate(
Server.DefaultRequestContext,
new NodeId(UnifiedAutomation.Demo.Model.Objects.Demo_BoilerDemo_Boiler1, DefaultNamespaceIndex),
new RelativePath()
{
Elements = new RelativePathElementCollection()
{
new RelativePathElement()
{
TargetName = new QualifiedName(UnifiedAutomation.Demo.Model.BrowseNames.FillLevelSensor, DefaultNamespaceIndex),
IsInverse = false,
ReferenceTypeId = ReferenceTypeIds.HasComponent,
IncludeSubtypes = true
},
new RelativePathElement()
{
TargetName = new QualifiedName(UnifiedAutomation.Demo.Model.BrowseNames.FillLevel, DefaultNamespaceIndex),
IsInverse = false,
ReferenceTypeId = ReferenceTypeIds.HasComponent,
IncludeSubtypes = true
},
new RelativePathElement()
{
TargetName = new QualifiedName(BrowseNames.EngineeringUnits, 0),
IsInverse = false,
ReferenceTypeId = ReferenceTypeIds.HasProperty,
IncludeSubtypes = true
}
},
},
0,
result);
List<StatusCode> UnifiedAutomation.UaServer.ServerInternalClient.Write ( RequestContext  context,
IList< WriteValue nodesToWrite 
)

Writes the values of the specified nodes.

StatusCode UnifiedAutomation.UaServer.ServerInternalClient.WriteAttribute ( RequestContext  context,
NodeId  nodeId,
uint  attributeId,
Variant  valueToWrite 
)

Writes the attribute.

Parameters
contextThe request context.
nodeIdThe node id.
attributeIdThe attribute id.
valueToWriteThe value to write.
Returns
StatusCode UnifiedAutomation.UaServer.ServerInternalClient.WriteValue ( RequestContext  context,
NodeId  nodeId,
QualifiedName  componentName,
Variant  valueToWrite 
)

Writes the component value.

Parameters
contextThe request context.
nodeIdThe node id.
componentNameName of the component.
valueToWriteThe value to write.
Returns
StatusCode UnifiedAutomation.UaServer.ServerInternalClient.WriteValue ( RequestContext  context,
NodeId  nodeId,
QualifiedName[]  browsePath,
Variant  valueToWrite 
)

Reads the component value.

Parameters
contextThe request context.
nodeIdThe node id.
browsePathThe browse path.
valueToWriteThe value to write.
Returns

The documentation for this class was generated from the following file: