cnsGetOPCAccessRight

Returns the OPC AccessLevel (value of the key OA:OPC) as UINT for the given node.

Synopsis

bool cnsGetOPCAccessRight(string cnsPath, uint &accessRight, string &inheritedNode);

Parameters

Parameter Description
cnsPath ID path of the node
accessRight OPC AccessLevel as UINT
inheritedNode Node from which the AccessLevel is inherited

Return value

Returns the TRUE if successful and FALSE in case of an error

Errors

Possible errors:

  • Wrong or missing parameters

  • The defined node could not be found

  • No AccessLevel is defined for the given node and no AccessLevel is inherited from another node

Description

Returns the OPC AccessLevel (value of the key OA:OPC) as UINT for the given node. If the AccessLevel is not defined at the node itself but inherited from a parent node instead, the node ID of the parent node is returned at inheritedNode. If the AccessLevel is defined at the node itself, an empty string is defined for inheritedNode.

If the AccessLevel is neither defined at the node nor a parent node, there is no OPC AccessLevel for this node and the function returns FALSE.

main()
{
  uint accRight;
  string parent;
  cnsGetOPCAccessRight("System1:View1.Node1", accRight, parent);
}

Availability

UI, CTRL