Skip to content

Reference

OpcClient.AddReference Method

Adds a new reference to existing nodes in the address space hierarchy using the command specified.

Reference

OpcClient.AddReference Method ​

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

5 overloads · since v2.7

OverloadDescription
AddReference(OpcAddReference)since v2.7Adds a new reference to existing nodes in the address space hierarchy using the command specified.
AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory)since v2.7Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other.
AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection)since v2.7Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified.
AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection, OpcReferenceType)since v2.7Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified.
AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection, OpcNodeId)since v2.7Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified.

Exceptions (all overloads)

ExceptionCondition
ObjectDisposedExceptionThe object has been disposed of.
OpcExceptionThe service execution failed upon different circumstances; for more details see exception details. The following issues can lead to that exception: BadNothingToDo and BadTooManyOperations.

AddReference(OpcAddReference) ​

since v2.7

Adds a new reference to existing nodes in the address space hierarchy using the command specified.

csharp
public OpcStatus AddReference(OpcAddReference command)
vbnet
Public Function AddReference(command As OpcAddReference) As OpcStatus

Parameters

NameTypeDescription
commandOpcAddReferenceThe OpcAddReference instance to process.

Returns

OpcStatus

An instance of the OpcStatus class which contains the information about the outcome of the processed command.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe command is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionThe add node service is currently not supported, especially using the command specified.

Remarks

Known results for the command specified are:

StatusDescription
BadSourceNodeIdInvalidFor more details see BadSourceNodeIdInvalid.
BadReferenceTypeIdInvalidFor more details see BadReferenceTypeIdInvalid.
BadServerUriInvalidFor more details see BadServerUriInvalid.
BadTargetNodeIdInvalidFor more details see BadTargetNodeIdInvalid.
BadNodeClassInvalidFor more details see BadNodeClassInvalid.
BadReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model on this server.
BadReferenceLocalOnlyThe reference type is not valid for a reference to a remote server.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadDuplicateReferenceNotAllowedThe reference type between the nodes is already defined.
BadInvalidSelfReferenceThe server does not allow this type of self reference on this node.

AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory) ​

since v2.7

Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other. The new reference will be a ParentToChild relation using Organizes as the type of reference.

csharp
public OpcStatus AddReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcNodeCategory targetNodeCategory)
vbnet
Public Function AddReference(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    targetNodeCategory As OpcNodeCategory) As OpcStatus

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId through that the source node can be identified and accessed. This identifier refers to the 'child' node.
targetNodeIdOpcNodeIdThe OpcNodeId through that the target node can be identified and accessed. This identifier referes to the 'parent' node.
targetNodeCategoryOpcNodeCategoryOne of the members defined by the OpcNodeCategory enumeration which is used by the server to validate that the reference to be added matches the OpcNodeCategory of the target node identified by the targetNodeId.

Returns

OpcStatus

Exceptions

ExceptionCondition
ArgumentExceptionThe nodeId or targetNodeId is equals Null.
ArgumentNullExceptionThe nodeId or targetNodeId is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionThe add node service is currently not supported, especially using the parameters specified.

Remarks

Known results for the service invocation are:

StatusDescription
BadSourceNodeIdInvalidFor more details see BadSourceNodeIdInvalid.
BadReferenceTypeIdInvalidFor more details see BadReferenceTypeIdInvalid.
BadServerUriInvalidFor more details see BadServerUriInvalid.
BadTargetNodeIdInvalidFor more details see BadTargetNodeIdInvalid.
BadNodeClassInvalidFor more details see BadNodeClassInvalid.
BadReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model on this server.
BadReferenceLocalOnlyThe reference type is not valid for a reference to a remote server.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadDuplicateReferenceNotAllowedThe reference type between the nodes is already defined.
BadInvalidSelfReferenceThe server does not allow this type of self reference on this node.

AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection) ​

since v2.7

Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified. The new reference will use the relation defined by direction using the Organizes as the type of reference.

csharp
public OpcStatus AddReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcNodeCategory targetNodeCategory,
    OpcReferenceDirection direction)
vbnet
Public Function AddReference(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    targetNodeCategory As OpcNodeCategory,
    direction As OpcReferenceDirection) As OpcStatus

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId through that the source node can be identified and accessed.
targetNodeIdOpcNodeIdThe OpcNodeId through that the target node can be identified and accessed.
targetNodeCategoryOpcNodeCategoryOne of the members defined by the OpcNodeCategory enumeration which is used by the server to validate that the reference to be added matches the OpcNodeCategory of the target node identified by the targetNodeId.
directionOpcReferenceDirectionOne of the members defined by the OpcReferenceDirection enumeration which defines the kind of relation the reference will construct.

Returns

OpcStatus

Exceptions

ExceptionCondition
ArgumentExceptionThe nodeId or targetNodeId is equals Null.
ArgumentNullExceptionThe nodeId or targetNodeId is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionThe add node service is currently not supported, especially using the parameters specified.

Remarks

Known results for the service invocation are:

StatusDescription
BadSourceNodeIdInvalidFor more details see BadSourceNodeIdInvalid.
BadReferenceTypeIdInvalidFor more details see BadReferenceTypeIdInvalid.
BadServerUriInvalidFor more details see BadServerUriInvalid.
BadTargetNodeIdInvalidFor more details see BadTargetNodeIdInvalid.
BadNodeClassInvalidFor more details see BadNodeClassInvalid.
BadReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model on this server.
BadReferenceLocalOnlyThe reference type is not valid for a reference to a remote server.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadDuplicateReferenceNotAllowedThe reference type between the nodes is already defined.
BadInvalidSelfReferenceThe server does not allow this type of self reference on this node.

AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection, OpcReferenceType) ​

since v2.7

Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified. The new reference will use the relation defined by direction using the referenceType specified as the type of reference.

csharp
public OpcStatus AddReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcNodeCategory targetNodeCategory,
    OpcReferenceDirection direction,
    OpcReferenceType referenceType)
vbnet
Public Function AddReference(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    targetNodeCategory As OpcNodeCategory,
    direction As OpcReferenceDirection,
    referenceType As OpcReferenceType) As OpcStatus

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId through that the source node can be identified and accessed.
targetNodeIdOpcNodeIdThe OpcNodeId through that the target node can be identified and accessed.
targetNodeCategoryOpcNodeCategoryOne of the members defined by the OpcNodeCategory enumeration which is used by the server to validate that the reference to be added matches the OpcNodeCategory of the target node identified by the targetNodeId.
directionOpcReferenceDirectionOne of the members defined by the OpcReferenceDirection enumeration which defines the kind of relation the reference will construct.
referenceTypeOpcReferenceTypeOne of the members defined by the OpcReferenceType enumeration to use to setup the reference between the source and the target node identified by the nodeId and the targetNodeId.

Returns

OpcStatus

Exceptions

ExceptionCondition
ArgumentExceptionThe nodeId or targetNodeId is equals Null.
ArgumentNullExceptionThe nodeId or targetNodeId is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionThe add node service is currently not supported, especially using the parameters specified.

Remarks

Known results for the service invocation are:

StatusDescription
BadSourceNodeIdInvalidFor more details see BadSourceNodeIdInvalid.
BadReferenceTypeIdInvalidFor more details see BadReferenceTypeIdInvalid.
BadServerUriInvalidFor more details see BadServerUriInvalid.
BadTargetNodeIdInvalidFor more details see BadTargetNodeIdInvalid.
BadNodeClassInvalidFor more details see BadNodeClassInvalid.
BadReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model on this server.
BadReferenceLocalOnlyThe reference type is not valid for a reference to a remote server.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadDuplicateReferenceNotAllowedThe reference type between the nodes is already defined.
BadInvalidSelfReferenceThe server does not allow this type of self reference on this node.

AddReference(OpcNodeId, OpcNodeId, OpcNodeCategory, OpcReferenceDirection, OpcNodeId) ​

since v2.7

Adds a new reference to existing nodes in the address space hierarchy using the identifiers of the nodes which shall reference each other using the direction specified. The new reference will use the relation defined by direction using the type of reference identified by the referenceTypeId specified.

csharp
public OpcStatus AddReference(
    OpcNodeId nodeId,
    OpcNodeId targetNodeId,
    OpcNodeCategory targetNodeCategory,
    OpcReferenceDirection direction,
    OpcNodeId referenceTypeId)
vbnet
Public Function AddReference(
    nodeId As OpcNodeId,
    targetNodeId As OpcNodeId,
    targetNodeCategory As OpcNodeCategory,
    direction As OpcReferenceDirection,
    referenceTypeId As OpcNodeId) As OpcStatus

Parameters

NameTypeDescription
nodeIdOpcNodeIdThe OpcNodeId through that the source node can be identified and accessed.
targetNodeIdOpcNodeIdThe OpcNodeId through that the target node can be identified and accessed.
targetNodeCategoryOpcNodeCategoryOne of the members defined by the OpcNodeCategory enumeration which is used by the server to validate that the reference to be added matches the OpcNodeCategory of the target node identified by the targetNodeId.
directionOpcReferenceDirectionOne of the members defined by the OpcReferenceDirection enumeration which defines the kind of relation the reference will construct.
referenceTypeIdOpcNodeIdThe OpcNodeId which identifies the type of reference to use to setup the reference between the source and the target node identified by the nodeId and the targetNodeId.

Returns

OpcStatus

Exceptions

ExceptionCondition
ArgumentExceptionThe nodeId, targetNodeId or referenceTypeId is equals Null.
ArgumentNullExceptionThe nodeId, targetNodeId or referenceTypeId is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionThe add node service is currently not supported, especially using the parameters specified.

Remarks

Known results for the service invocation are:

StatusDescription
BadSourceNodeIdInvalidFor more details see BadSourceNodeIdInvalid.
BadReferenceTypeIdInvalidFor more details see BadReferenceTypeIdInvalid.
BadServerUriInvalidFor more details see BadServerUriInvalid.
BadTargetNodeIdInvalidFor more details see BadTargetNodeIdInvalid.
BadNodeClassInvalidFor more details see BadNodeClassInvalid.
BadReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model on this server.
BadReferenceLocalOnlyThe reference type is not valid for a reference to a remote server.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadDuplicateReferenceNotAllowedThe reference type between the nodes is already defined.
BadInvalidSelfReferenceThe server does not allow this type of self reference on this node.