7 Functionblocks

Brief description of the used letter’s "B", "E" and "V":

B Basic Mandatory VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT.
E Extended Optional VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT.
V Vendor Specific Vendor specific VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT.

The detailed description can be found in Annex A.

VAR_INPUT is shown on the left side of the Function Blocks.

VAR_OUTPUT is shown on the right side of the Function Blocks.

VAR_IN_OUT is shown on the left and right side of the Function Blocks and has a dashed line below.

7.1 UA_Connect

FB-Name UA_Connect
This Function Block is used to create a (optional secure) transport connection and an OPC UA session. The connection shall be terminated by calling the UA_Disconnect after establishing the connection.
VAR_INPUT
BExecuteBOOLOn rising edge connection is started.
BServerEndpointUrlVendor specificShall be STRING or WSTRING. The recommendation for new implementation is to use WSTRING. URL
BSessionConnectInfoSTRUCTSee UASessionConnectInfo
BTimeoutTIMEMaximum time to establish the connection.
VAR_OUTPUT
BDoneBOOLSignals a connection has been initially established.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BConnectionHdlDWORDConnection handle – is valid until UA_Disconnect is called.
Notes: The connection monitoring and the reconnect handling are to be done by the client vendor implementation. The reconnect sequence is defined in OPC 10000-4.
UA_Connect
BOOLExecuteDoneBOOL
Vendor specificServerEndpointUrlBusyBOOL
STRUCTSessionConnectInfoErrorBOOL
TIMETimeoutErrorIDDWORD
ConnectionHdlDWORD

7.2 UA_Disconnect

FB-Name UA_Disconnect
This Function Block is used to close a transport connection of an OPC UA session.
VAR_INPUT
BExecuteBOOLOn rising edge connection is terminated.
BConnectionHdlDWORDConnection handle of connection to be closed.
BTimeoutTIMEMaximum time to close the connection.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
Notes: Calling UA_Disconnect (even in case of timeout or error) will release the ConnectionHdl, all node-handles and MonitoredItems.
UA_Disconnect
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
TIMETimeoutErrorBOOL
ErrorIDDWORD

7.3 UA_NamespaceGetIndexList

FB-Name UA_NamespaceGetIndexList
This Function Block is used to get the namespace-indexes of numerous namespace-URIs
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BNamespaceUrisCountUINTNumber of NamespaceUris in Array of NamespaceUris.
BNamespaceUrisARRAY OF
Vendor specific
Shall be STRING or WSTRING. The recommendation for new implementation is to use WSTRING. Array of Vendor specific with the NamespaceUris. See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)
BTimeoutTIMEMaximum time to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BErrorIDsARRAY OF
DWORD

Error codes. Array shall be the same number of elements as NamespaceUrisCount.

See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)

BNamespaceIndexesARRAY OF
UINT

Namespace Indexes. Array shall be the same number of elements as NamespaceUris.

See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)

Notes: Reads the Server-Object NamespaceArray (NS:0; Id: 2255) and returns the indexes of the requested elements which can be used in subsequent calls where the Namespace-Array-Index is required - e.g., UA_NodeGetHandleList.

This is a convenient function block – could also be done with ReadList and the returned unknown array length of the NamespaceArray could be evaluated in the user program.

In case the requested NamespaceUri is not found the error PLCopenUA_Bad_NSNotFound will be returned in the corresponding ErrorIDs.

UA_NamespaceGetIndexList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTNamespaceUrisCountErrorBOOL
ARRAY of Vendor specificNamespaceUrisErrorIDDWORD
TIMETimeoutErrorIDsARRAY of DWORD
NamespaceIndexesARRAY of UINT

7.4 UA_ServerGetUriByIndex

FB-Name UA_ServerGetUriByIndex
This Function Block is used to get the server-URI with a given index.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BServerIndexUDINTServerArray Index.
BTimeoutTIMEMaximum time to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BServerUriVendor specific

Shall be STRING or WSTRING. The recommendation for new implementation is to use WSTRING.

The URI from the ServerArray with the given ServerIndex.

Notes: -
UA_ServerGetUriByIndex
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UDINTServerIndexErrorBOOL
TIMETimeoutErrorIDDWORD
ServerUriVendor specific

7.5 UA_ServerGetIndexByUriList

FB-Name UA_ServerGetIndexByUriList
This Function Block is used to get several server-indexes of server-URIs
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BServerUrisCountUINTNumber of ServerUris in Array of ServerUris.
BServerUrisARRAY OF
Vendor specific

Shall be STRING or WSTRING. The recommendation for new implementation is to use WSTRING.

Array of Vendor specific with the ServerUris.

See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)

BTimeoutTIMEMaximum time to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BErrorIDsARRAY OF
DWORD

Error codes. Array shall be the same number of elements as ServerUrisCount.

See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)

BServerIndexesARRAY OF
UDINT

Server Indexes. Array shall be the same number of elements as ServerUris.

See Constants of Array Lengths (MAX_ELEMENTS_NAMESPACES)

Notes: Reads the Server-Object ServerArray (NS:0; Id: 2254) and returns the indexes of the requested elements which can be used in subsequent calls where the Server-Array-Index is required - e.g. UA_Browse.

This is a convenient function call – could also be done with ReadList and the returned unknown array length of the ServerArray could be evaluated in the user program.

In case the requested ServerUri is not found the error PLCopenUA_Bad_NSNotFound will be returned in the corresponding ErrorIDs.

UA_ServerGetIndexByUriList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTServerUrisCountErrorBOOL
ARRAY of Vendor specificServerUrisErrorIDDWORD
TIMETimeoutErrorIDsARRAY of DWORD
ServerIndexesARRAY of UINT

7.6 UA_TranslatePathList

FB-Name UA_TranslatePathList
This Function Block is used to get the node parameters of a node using paths of the node for multiple nodes.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BBrowsePathsCountUINTNumber of UABrowsePath in Array of BrowsePaths.
BBrowsePathsARRAY OF
UABrowsePath

An Array of UABrowsePath with node parameters for starting node and relative path.

See Constants of Array Lengths (MAX_ELEMENTS_RELATIVEPATH)

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BTargetNodeIDsARRAY OF
STRUCT
See UANodeID. Structure UANodeID with node parameters. For target node mentioned by BrowsePath at the input of this FB. Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
BTargetErrorIDsARRAY OF
DWORD

Array of TargetErrorIDs. Contains an error code for each element of the TargetNodeIDs array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths.

Shall be same size like the NoOfElements in BrowsePath array length.

Notes: -
UA_TranslatePathList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTBrowsePathsCountErrorBOOL
ARRAY OF UABrowsePathBrowsePathsErrorIDDWORD
TIMETimeoutTargetNodeIDsARRAY OF STRUCT
TargetErrorIDsARRAY OF DWORD

7.7 UA_NodeGetHandleList

FB-Name UA_NodeGetHandleList
This Function Block is used to get node handles for multiple nodes.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BNodeIDCountUINTNumber of NodeIDs in Array of NodeIDs.
BNodeIDsARRAY OF
UANodeID

See UANodeID.

Length is vendor-specific (MAX_ELEMENTS_NODELIST).
See Constants of Array Lengths
Array length of NodeIDs and NodeHdls must be same.

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB. Set to TRUE if either ErrorID or any of the NodeErrorIDs indicates an error.
BErrorIDDWORDError code.
BNodeErrorIDsARRAY OF
DWORD

Array of NodeErrorIDs. Contains an error code for each valid element of the NodeIds array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST).
See Constants of Array Lengths
Shall be same size like the NodesIDs array length.

BNodeHdlsARRAY OF
DWORD
Array of Node Handles.
Length is vendor-specific (MAX_ELEMENTS_NODELIST).
See Constants of Array Lengths
Array length of NodeIDs and NodeHdls must be same.
Notes: The NodeHdl is a reference to the internal management object for the node in the client. However, the internal client implementation shall also register the node at the server (“RegisterNode”). This enables the OPC UA Server to optimize the communication.
UA_NodeGetHandleList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTNodeIDCountErrorBOOL
ARRAY OF STRUCTNodeIDsErrorIDDWORD
TIMETimeoutNodeErrorIDsARRAY OF DWORD
NodeHdlsARRAY OF DWORD

7.8 UA_NodeReleaseHandleList

FB-Name UA_NodeReleaseHandleList
This Function Block is used to release a set of node handles.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BNodeHdlCountUINTNumber of Nodes in NodeHdls Array.
BNodeHdlsARRAY OF DWORDArray of Node handles to be released.
Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
NULL is not a valid handle.
BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB. Set to TRUE if either ErrorID or any of the NodeErrorIDs indicates an error.
BErrorIDDWORDError code.
BNodeErrorIDsARRAY OF DWORD

Array of DWORD. Contains an error code for each valid element of the NodeHdls array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the NodeHdls array length.

Notes: After calling UA_NodeReleaseHandleList the NodeHdls will be invalid.
UA_NodeReleaseHandleList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTNodeHdlCountErrorBOOL
ARRAY OF DWORDNodeHdlsErrorIDDWORD
TIMETimeoutNodeErrorIDsARRAY OF DWORD

7.9 UA_NodeGetInformation

FB-Name UA_NodeGetInformation
This Function Block is used to get the node information.
VAR_INPUT
BExecuteBOOLOn rising edge node information will be read.
BConnectionHdlDWORDConnection handle.
BNodeIDUANodeIDSee UANodeID
BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BNodeGetInfoErrorIDsARRAY [0 .. 22] OF
DWORD

Array of DWORD. Contains an error code for each valid element of the NodeHdls array.

Shall be same size like number of UANodeInformation elements. This struct has 20 elements.
The NodeGetInfoErrorIDs have the same indices as in OPC 10000-6 specification defined, e.g. (Value = 13). The size of the array is from 0 to 22 where elements 0 and 1 are not being used.

BNodeInfoUANodeInformationSee UANodeInformation

Notes: Depending on the responded NodeClass (see UANodeClassMask) the corresponding NodeGetInfoErrorID shall have the following errors.

Elements, which are not in this NodeClass existing shall have PLCopenUA_Bad_AttributeIdUnknown.

Elements, which should exist but don’t, shall have PLCopenUA_Bad_AttributeIdInvalid.

Valid elements shall have OpcUa_Good.

UA_NodeGetInformation
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
STRUCTNodeIDErrorBOOL
TIMETimeoutErrorIDDWORD
NodeGetInfoErrorIDsARRAY OF DWORD
NodeInfoUANodeInformation

7.10 UA_SubscriptionCreate

FB-Name UA_SubscriptionCreate
This Function Block can be used to create a subscription.
VAR_INPUT
BExecuteBOOLOn rising edge subscription will be created.
BConnectionHdlDWORDConnection handle.
BPublishingEnableBOOLActivate the publishing.
BPriorityBYTEPriority of the Subscription in the server relative to the other Subscriptions created by this client.
See OPC 10000-4.
BTimeoutTIMEMaximum time to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BSubscriptionHdlDWORDSubscription handle.
VAR_IN_OUT
BPublishingIntervalTIMEPublishing interval (can be changed by the Server revised publishing interval).

Notes: The connection monitoring and the reconnect handling are to be done by the client vendor implementation. The reconnect sequence is defined in OPC 10000-4.

SubscriptionHdl must be unique even if the client is connected to multiple servers.

UA_SubscriptionCreate
BOOLExecuteDoneBOOL
DWORDConnectionHdl BusyBOOL
BOOLPublishingEnableErrorBOOL
BYTEPriority ErrorIDBOOL
TIMETimeout SubscriptionHdlDWORD
TIMEPublishingIntervalPublishingIntervalTIME

7.11 UA_SubscriptionDelete

FB-Name UA_SubscriptionDelete
This Function Block can be used to delete a subscription.
VAR_INPUT
BExecuteBOOLOn rising edge, the subscription mentioned by SubscriptionHdl will be deleted.
BSubscriptionHdlDWORDSubscription handle.
BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
Notes: -
UA_SubscriptionDelete
BOOLExecuteDoneBOOL
DWORDSubscriptionHdl BusyBOOL
TIMETimeoutErrorBOOL
ErrorIDDWORD

7.12 UA_SubscriptionModify

FB-Name UA_SubscriptionModify
This Function Block is designed to be optionally called to modify publishing parameters (enable / interval).
VAR_INPUT
BExecuteBOOLFB operates on rising edge.
BSubscriptionHdlDWORDSubscription handle.
BPublishingEnableBOOLActivates the publishing.
BPriorityBYTEPriority of the Subscription in the server relative to the other Subscriptions created by this client.
BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
VAR_IN_OUT
BPublishingIntervalTIMEPublishing interval (can be changed by the Server revised publishing interval).
Notes: -
UA_SubscriptionModify
BOOLExecuteDoneBOOL
DWORDSubscriptionHdl BusyBOOL
BOOLPublishingEnable ErrorBOOL
BYTEPriority ErrorIDDWORD
TIMETimeout
TIMEPublishingIntervalPublishingIntervalTIME

7.13 UA_SubscriptionProcessed

FB-Name UA_SubscriptionProcessed
This Function Block is designed to be optionally called to check if monitored items have been published. The use of the function block depends on the underlying system – see notes.
VAR_INPUT
BExecuteBOOLFB operates on each call.
BSubscriptionHdlDWORDSubscription handle.
BTimeoutTIMETime to response.
VAR_OUTPUT
BDone BOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BPublishedBOOLIndicates, that variables have been published since the last call.
Notes: It is expected to use this call, if the underlying system WILL publish the values automatically. Shall not be used together with the function block UA_MonitoredItemOperateList. This call is expected to return with a valid result after it is called. See also 4.2 Monitored Items.
UA_SubscriptionProcessed
BOOLExecuteDoneBOOL
DWORDSubscriptionHdl BusyBOOL
TIMETimeoutErrorBOOL
ErrorIDBOOL
PublishedDWORD

7.14 UA_MonitoredItemAddList

FB-Name UA_MonitoredItemAddList
This Function Block can be used to add handle of multiple nodes using a list of node handles.
VAR_INPUT
BExecuteBOOLOn rising edge monitored items will be added to a subscription.
BSubscriptionHdlDWORDSubscription handle.
BNodeHdlCountUINTNumber of valid elements in the array to add.
BNodeHdlsARRAY OF
DWORD

Array of Node handles.

Max length of array is to be defined by the vendor and shall be same length thanVariables array length. Shall be the same size as NodeHdlCount.

See Constants of Array Lengths (MAX_ELEMENTS_MONITORLIST)

BSyncModeUAMonitoringSyncMode

See UAMonitoringSyncMode


See chapter 4.2 Monitored Items for general concept of SyncModes

0 = UAMSync_Unknown
Default, this results into an error code – has to be set to one of the following options

1 = UAMS_ControllerSync

2 = UAMS_FwSync

BNodeAddInfosARRAY OF
UANodeAdditionalInfo

See UANodeAdditionalInfo. Specifies the attribute and IndexRange.

See Constants of Array Lengths (MAX_ELEMENTS_MONITORLIST)

This parameter is optional. If not existing, the UAAI_Value (13) will be taken from internal implementation.

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BNodeErrorIDsARRAY OF
DWORD

Array of DWORD. Contains an error code for each element of the Variables array.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same length than NodeHdlCount.

BMonitoredItemHdlsARRAY OF
DWORD

Array of monitored item handles.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same length than NodeHdlCount.

VAR_IN_OUT
BVariablesARRAY OF
UAMonitoredVariables

See UAMonitoredVariables.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same length as NodeHdlCount

BMonitoringParameterARRAY OF
UAMonitoringParameter

See UAMonitoringParameter

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same length as NodeHdlCount.

BValuesChangedARRAY OF
BOOL

Indicates that the values of the monitored item have been changed.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). Shall be the same length as NodeHdlCount.
See Constants of Array Lengths

BMinLostValueCountARRAY OF
UINT
Count the minimum lost values if queue size is > 1 – see also UAMonitoredVariables.

Notes: VAR_IN_OUT: „Variables” as would provide best type save solution for users: The client firmware is able to map the UA memory layout to the controller layout. The firmware client can receive the type definition from the OPC UA Server.
Workaround would be to provide a byte array as “Variables” and the firmware client just provide the blob (UA memory layout – so called “raw data”) into that byte array.

A “Variable” could be the name of the variable so the internal firmware can get address, length, data type of variable.

UA_MonitoredItemAddList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UINTNodeHdlCountErrorBOOL
ARRAY OF DWORDNodeHdlsErrorIDDWORD
UAMonitoringSyncModeSyncModeNodeErrorIDsARRAY OF DWORD
ARRAY OF
UANodeAdditionalInfo

NodeAddInfos

MonitoredItemHdls

ARRAY OF DWORD
TIMETimeout
ARRAY OF
UAMonitoredVariables

Variables

Variables
ARRAY OF
UAMonitoredVariables
ARRAY OF
UAMonitoringParameter
MonitoringParameterMonitoringParameterARRAY OF
UAMonitoringParameter
ARRAY OF BOOLValuesChangedValuesChangedARRAY OF BOOL
ARRAY OF UINTMinLostValueCountMinLostValueCountARRAY OF UINT

7.15 UA_MonitoredItemRemoveList

FB-Name UA_MonitoredItemRemoveList
This Function Block can be used to remove multiple nodes from a subscription using a list of node handles.
VAR_INPUT
BExecuteBOOLOn rising edge monitored items will be removed from the subscription.
BSubscriptionHdlDWORDSubscription handle.
BMonitoredItemHdlCountUINTNumber of valid elements in the array to remove.
BMonitoredItemHdlsARRAY OF
DWORD

Monitored item handles.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same size than MonitoredItemHdlCount

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BNodeErrorIDsARRAY OF
DWORD

Array of DWORD. Contains an error code for each valid element of the Variables array.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths

Shall be the same size than MonitoredItemHdlCount.

Notes: -
UA_MonitoredItemRemoveList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UINTMonitoredItemHdlCountErrorBOOL
ARRAY OF DWORDMonitoredItemHdlsErrorIDDWORD
TIMETimeoutNodeErrorIDsARRAY OF DWORD

7.16 UA_MonitoredItemModifyList

FB-Name UA_MonitoredItemModifyList
This Function Block is designed to be optionally called to modify a list of monitored item parameters.
VAR_INPUT
BExecuteBOOLOn rising edge monitored items will be modified.
BSubscriptionHdlDWORDSubscription handle.
BMonitoredItemHdlCountUINTNumber of valid elements in the array to modify.
BMonitoredItemHdlsARRAY OF
DWORD

Array of monitored item handles.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same size than MonitoredItemHdlCount

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BNodeErrorIdsARRAY OF
DWORD
Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths – including the “Overflow bit” indication
VAR_IN_OUT
BMonitoringParametersARRAY OF
UAMonitoringParameter
See UAMonitoringParameter
Notes: -
UA_MonitoredItemModifyList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UINTMonitoredItemHdlCountErrorBOOL
ARRAY OF DWORDMonitoredItemHdlsErrorIDDWORD
TIMETimeoutNodeErrorIdsARRAY OF DWORD
ARRAY OF
UAMonitoringParameter

MonitoringParameters

MonitoringParameters
ARRAY OF
UAMonitoringParameter

7.17 UA_MonitoredItemOperateList

FB-Name UA_MonitoredItemOperateList
This Function Block is designed to be called to update the values of a list of Variables and the corresponding information in the associated lists like ValuesChanged, TimeStamps and NodeQualityIDs of the control program. The use of the function block depends on the underlying system – see notes.
VAR_INPUT
BExecuteBOOLOn rising edge monitored items will be modified.
BSubscriptionHdlDWORDSubscription handle.
BMonitoredItemHdlCountUINTNumber of valid elements in the array to modify.
BMonitoredItemHdlsARRAY OF
DWORD

Array of monitored item handles.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths. Shall be the same size than MonitoredItemHdlCount.

VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BNodeErrorIDsARRAY OF
DWORD

Array of DWORD. Contains an error code for each element of the MonitoredItemHdls-Array.

Length is vendor-specific (MAX_ELEMENTS_MONITORLIST). See Constants of Array Lengths Shall be the same length than MonitoredItemHdlCount.

BPublishedBOOLIndicates, that variables have been published since the last call. At least one element of the array of ValuesChanged will be TRUE.
Notes: It is expected to use this call, if the underlying system will NOT update the values automatically. Shall not be used together with the function block UA_SubscriptionProcessed. After the successful execution it is expected, that the values of the Variables and the corresponding information in the associated lists like ValuesChanged, TimeStamps and NodeQualityIDs have been updated. See also 4.2 Monitored Items.
UA_MonitoredItemOperateList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UNITMonitoredItemHdlCountErrorBOOL
ARRAY OF DWORDMonitoredItemHdlsErrorIDDWORD
NodeErrorIDsARRAY OF DWORD
PublishedBOOL

7.18 UA_ReadList

FB-Name UA_ReadList
This Function Block is used to read values of multiple nodes using a list of node handles.
VAR_INPUT
BExecuteBOOLOn rising edge node information will be read.
BConnectionHdlDWORDConnection handle.
BNodeHdlCountUINTNumber of valid elements in the array to read.
BNodeHdlsARRAY OF
DWORD

Array of Node Handles.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

BNodeAddInfosARRAY OF
UANodeAdditionalInfo

See UANodeAdditionalInfo. Array of UANodeAdditionalInfo. Specifies the attribute and IndexRange.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

This parameter is optional. If not existing the UAAI_Value (13) will be taken from internal implementation.

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected
BErrorBOOLSignals that an error has occurred within the FB. Set to TRUE if either ErrorID or any of the NodeErrorIDs indicates an error.
BErrorIDDWORDError code for the OPC UA service call.
BNodeErrorIDsARRAY OF
DWORD

Array of DWORD. Contains an error code for each valid element of the Variables array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

BTimeStampsARRAY OF
Vendor specific

Shall be DT or LDT. The recommendation for new implementation is to use LDT. Contains a TimeStamp for each valid element of the Variables array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). Constants of Array Lengths Constants of Array Lengths
Shall be same size like the Variables array length.

This parameter is optional. If not existing the internal client implementation shall not ask for any timestamp from server side.

VAR_IN_OUT
BVariablesARRAY OF
Vendor specific
Vendor specific. Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths

Notes: Vendors can handle “Variables” in a vendor specific way. Independent of the vendor specific solution the mapping of the controller data type and OPC UA data type shall be handled in the function block.

VAR_IN_OUT: “Variables” as would provide best type save solution for users: The client firmware is able to map the UA memory layout to the controller layout. The firmware client can receive the type definition from the OPC UA Server.
Workaround would be to provide a byte array as “Variables” and the firmware client just provide the blob (UA memory layout – so called “raw data”) into that byte array.

A “Variable” could be the name of the variable so the internal firmware can get address, length, data type of variable.

UA_ReadList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTNodeHdlCountErrorBOOL
ARRAY OF DWORDNodeHdlsErrorIDDWORD
ARRAY OF STRUCTNodeAddInfosNodeErrorIDsARRAY OF DWORD
TIMETimeoutTimeStampsARRAY OF Vendor specific
ARRAY OF Vendor specificVariablesVariablesARRAY OF Vendor specific

7.19 UA_WriteList

FB-Name UA_WriteList
This Function Block is used to write values to multiple nodes using a list of node handles.
VAR_INPUT
BExecuteBOOLOn rising edge node values will be written.
BConnectionHdlDWORDConnection handle.
BNodeHdlCountUINTNumber of valid elements in the array to write.
BNodeHdlsARRAY OF
DWORD

Array of Node Handles.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

BNodeAddInfosARRAY OF
UANodeAdditionalInfo

See UANodeAdditionalInfo. Array of UANodeAdditionalInfo. Specifies the attribute and IndexRange.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

This parameter is optional. If not existing, the UAAI_Value (13) will be taken from internal implementation.

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB. Set to TRUE if either ErrorID or any of the NodeErrorIDs indicates an error.
BErrorIDDWORDError code for the OPC UA service call.
BNodeErrorIDsARRAY OF
DWORD

Array of DWORD. Contains an error code for each valid element of the Variables array.

Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths
Shall be same size like the Variables array length.

VAR_IN_OUT
BVariablesARRAY OF
Vendor specific
Vendor specific.
Length is vendor-specific (MAX_ELEMENTS_NODELIST). See Constants of Array Lengths.

Notes: Vendors can handle “Variables” in a vendor specific way. Independent of the vendor specific solution the mapping of the controller data type and OPC UA data type shall be handled in the function block.

VAR_IN_OUT: “Variables” as would provide best type save solution for users: The client firmware is able to map the UA memory layout to the controller layout. The firmware client can receive the type definition from the OPC UA Server.

Workaround would be to provide a byte array as “Variables” and the firmware client just provide the blob (UA memory layout – so called “raw data”) into that byte array.

A “Variable” could be the name of the variable so the internal firmware can get address, length, data type of variable.

UA_WriteList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTNodeHdlCountErrorBOOL
ARRAY OF DWORDNodeHdlsErrorIDDWORD
ARRAY OF STRUCTNodeAddInfosNodeErrorIDsARRAY OF DWORD
TIMETimeout
ARRAY OF Vendor specificVariablesVariablesARRAY OF Vendor specific

7.20 UA_MethodGetHandleList

FB-Name UA_MethodGetHandleList
This Function Block is used to get multible method handles for method calls.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BNodeIDCountUINTNumber of elements the ObjectNodeIDs and MethodNodeIDs shall have.
BObjectNodeIDs

ARRAY OF

UANodeID

See UANodeID. Array shall have the size of NodeIDCount

See Constants of Array Lengths

BMethodNodeIDs

ARRAY OF

UANodeID

See UANodeID. Array shall have the size of NodeIDCount

See Constants of Array Lengths

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BErrorIDsARRAY OF
DWORD
Error codes.
BMethodHdlsARRAY OF
DWORD
Method handles.
Notes: -
UA_MethodGetHandleList
BOOLExecuteDoneBOOL
DWORDConnectionHdl BusyBOOL
UINTNodeIDCountErrorBOOL
ARRAY OF UANodeIDObjectNodeIDs ErrorIDDWORD
ARRAY OF UANodeIDMethodNodeIDs ErrorIDsARRAY OF DWORD
TIMETimeout MethodHdls ARRAY OF DWORD

7.21 UA_MethodReleaseHandleList

FB-Name UA_MethodReleaseHandleList
This Function Block is used to release method handles.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BMethodHdlCountUINTNumber of elements the MethodHdls shall have.
BMethodHdlsARRAY OF
DWORD

Method handles to be released.

See Constants of Array Lengths (MAX_ELEMENTS_METHOD)

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BErrorIDsARRAY OF
DWORD
Error codes. See Constants of Array Lengths (MAX_ELEMENTS_METHOD)
Notes: After calling UA_MethodReleaseHandle or MethodReleaseHandleList the MethodHdl(s) will be invalid.
UA_MethodReleaseHandleList
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
UINTMethodHdlCountErrorBOOL
ARRAY OF DWORDMethodHdlsErrorIDDWORD
TIMETimeoutErrorIDsARRAY OF DWORD

7.22 UA_MethodCall

FB-Name UA_MethodCall
This Function Block is used to call a method routine.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BMethodHdlDWORDMethod handle.
BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
VAR_IN_OUT
EMethodResultDWORD

StatusCode of the Method executed in the Server.

If a vendor do not provide this extended output then the operation result should be returned in the ErrorID.

BInputArgumentsVendor specificVariable containing input parameters. Vendor specific.
BOutputArgumentsVendor specificVariable containing output parameters. Vendor specific.
Notes: -
UA_MethodCall
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
DWORDMethodHdlErrorBOOL
TIMETimeoutErrorIDDWORD
DWORDMethodResultMethodResultDWORD
Vendor specificInputArgumentsInputArgumentsVendor specific
Vendor specificOutputArgumentsOutputArgumentsVendor specific

7.23 UA_Browse

FB-Name UA_Browse
This Function Block is used to navigate through the Address Space. Passing a starting node, the server retuns a list of nodes by references.
The MaxArray size is configured for the controller must be passed as the RequestMaxReferencePerNode in the firmeware service call.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
EViewDescription UAViewDescriptionOptional: Shall be an empty parameter if NOT browsing a View.
BBrowseDescriptionUABrowseDescription

Starting Node and other information for navigation.

See UABrowseDescription

Hint: This parameter is ignored if the ContinuationPointIn is not 0

BContinuationPointInDWORD

If set to 0 the browse starts with starting node.

If set to ContinuationPointOut it can be used for browse next service.

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BBrowseResultCountUINT

The number of entries in the BrowseResult array

BBrowseResultARRAY OF
UAReferenceDescription

List of references and target node information for the node passing the filter criteria in the request

See UAReferenceDescription

Length is vendor-specific (MAX_ELEMENTS_BROWSERESULT). See Constants of Array Lengths
Hint: MaxSize is initialized by a predefined fixed size

BContinuationPointOutDWORDSet when the server was not able to to deliver all results. Can be used to copy it to ContinuationPointIn for browse next service
Notes: -
UA_Browse
BOOLExecuteDoneBOOL
DWORDConnectionHdl BusyBOOL
UAViewDescriptionViewDescription ErrorBOOL
UABrowseDescriptionBrowseDescription ErrorIDDWORD
DWORDContinuationPointIn BrowseResultCountUINT

TIME

Timeout

BrowseResult
ARRAY OF
UAReferenceDescription
ContinuationPointOutDWORD

7.24 UA_EventItemAdd

FB-Name UA_EventItemAdd
This Function Block is used to add handles for events.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BSubscriptionHdlDWORDSubscription handle.
BNodeHdlDWORDHandle of the node to monitor for emitted events. Events are only produced by the node classes Object and View. Whether a node is actually producing events or not may be determined by its EventNotifier attribute.
BEventTypeUANodeIDType of the event to monitor. The EventType will be included as OfType operator in the Where Clause of the event monitored item filter.
BEventFieldSelectionCountUINTNumber of elements in EventFieldSelections
BEventFieldSelectionsARRAY OF
UARelativePath

Array of UARelativePath for the event fields to select. The path starts from the event type node. The FieldSelection is used as Select Clause of the event monitored item filter.

Examples are

0: Message selects the Message event field

0: ActiveState/0: Id selects the Boolean representation of the Alarm ActiveState.

Length is vendor-specific (MAX_EVENT_FIELD_SELECTIONS). See Constants of Array Lengths
Hint: MaxSize is initialized by a predefined fixed size

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code
BEventItemHdlDWORDEvent Item Handle. The handle can be used to process the published events with UA_EventItemOperate and remove them from the subscription with UA_EventItemRemove.
VAR_IN_OUT
BEventFieldsARRAY OF
Vendor specific
Vendor specific list of variables used to receive the events field data for one event occurrence. Vendor specific.
BEventProcessedBOOLIndicates that the values of the event item have been changed.
BRemainingEventCountUINTNumber of remaining events available for processing
BFieldErrorIDs

ARRAY OF

DWORD

Contains an error code for each valid element of the EventFieldSelection array.

Length is vendor-specific (MAX_EVENT_FIELD_SELECTIONS). See Constants of Array Lengths – including the “Overflow bit” indication.

Notes: -
UA_EventItemAdd
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
ARRAY OF DWORDNodeHdlErrorBOOL
ARRAY OF UANodeIdEventTypeErrorIDDWORD
UINTEventFieldSelectionCountEventItemHdlDWORD
ARRAY OF UARelativePathEventFieldSelection
TIMETimeout
ARRAY OF Vendor specificEventFieldsEventFieldsARRAY OF Vendor specific
BOOLEventProcessedEventProcessedBOOL
UINTRemainingEventCountRemainingEventCountUINT
ARRAY OF DWORDFieldErrorIDsFieldErrorIDsARRAY OF DWORD

7.25 UA_EventItemOperateList

FB-Name UA_EventItemOperateList
This Function Block is used to get a list of event infomation.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BSubscriptionHdlDWORDSubscription handle.
BEventItemHdlCountUINTNumber of elements the EventItemHdls shall have.
BEventItemHdlsARRAY OF
DWORD

Event Item Handles

Length is vendor-specific (MAX_ELEMENTS_EVENTITEMLIST). See Constants of Array Lengths

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
BErrorIDDWORDError code.
BEventProcessedBOOLIndicates if a new event was processed.
BFieldErrorIDsARRAY OF
DWORD

Contains an error code for each valid element of the EventFieldSelection array.

Length is vendor-specific (MAX_ELEMENTS_EVENTITEMOPERATE). See Constants of Array Lengths – including the “Overflow bit” indication.

Note: For compatibility reason “FieldErrorIDs” is not renamed, but “EventErrorIDs” is ment therefore instead.

Notes: The EventFields has to be defined what is the best declaration in IEC language for 25 different event type structures.
UA_EventItemOperateList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UINTEventItemHdlCountErrorBOOL
ARRAY OF DWORDEventItemHdlsErrorIDDWORD
TIMETimeoutEventProcessedBOOL
FieldErrorIDsARRAY OF DWORD

7.26 UA_EventItemRemoveList

FB-Name UA_EventItemRemoveList
This Function Block can be used to remove an event item handle from a subscription.
VAR_INPUT
BExecuteBOOLOn rising edge node information will be read.
BSubscriptionHdlDWORDSubscription handle.
BEventItemHdlCountUINTNumber of elements the EventItemHdls shall have.
BEventItemHdlsARRAY OF
DWORD

Event item handles.

Length is vendor-specific (MAX_ELEMENTS_EVENTITEMLIST). See Constants of Array Lengths

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected.
BErrorBOOLSignals that an error has occurred within the FB.
EErrorIDDWORDError code.
BErrorIDsARRAY OF
DWORD
Error codes
Notes: -
UA_EventItemRemoveList
BOOLExecuteDoneBOOL
DWORDSubscriptionHdlBusyBOOL
UINTEventItemHdlCountErrorBOOL
ARRAY OF DWORDEventItemHdlsErrorIDDWORD
TIMETimeoutErrorIDsARRAY OF DWORD

7.27 UA_HistoryUpdate

FB-NameUA_HistoryUpdate
This Function Block is used to insert or replace or update data in the historical database.
VAR_INPUT
BExecuteBOOLFB performs its task on rising edge on this input.
BConnectionHdlDWORDConnection handle.
BNodeHdlDWORDNode handle.
BPerformInsertBOOL

BPerformReplaceBOOL
BDataValueCountUNITNumber of values to be inserted, replaced or updates
BDataValuesARRAY of UAHADataValue

Array of UAHADataValue

See UAHADataValue

BTimeoutTIMETime to response.
VAR_OUTPUT
BDoneBOOLFB has completed its task.
BBusyBOOLThe FB is not finished and new output values are to be expected
BErrorBOOLSignals that an error has occurred within the Function Block.
BErrorIDDWORDError code. (StatusCode)
BValueErrorIDsARRAY OF
DWORD
Contains an error code for each valid element.
Notes: The idea of this scenario is to have an OPC UA server with HA (Historical Access) functionality available, either local on the same system or remotely in the network. In traditional way the OPC UA Server is responsible to collect data on his own from the underlying process. This FB UA_HistoryUpdate allows the OPC UA-HA Server to stay inactive and wait that an OPC UA client is actively pushing data into OPC UA-HA-Server making use of the Server’s HistoryUpdate interface.
UA_HistoryUpdate
BOOLExecuteDoneBOOL
DWORDConnectionHdlBusyBOOL
DWORDNodeHdlErrorBOOL
BOOLPerformInsertErrorIDDWORD
BOOLPerformReplaceValueErrorIDsARRAY OF DWORD
UINTDataValueCount
ARRAY OF UAHADataValueDataValues
TIMETimeout