Function Description

The function block UA_Connect is used to create a transport connection for an OPC-UA session. The connection is terminated by calling UA_Disconnect after establishing the connection.

CONNECTIONHDL DWORD output has to be given in input to other blocks. It identifies the Client connection to the given ServerEndPointUrl.

NOTE: One M580 CPU can support:
  • Up to 64 connections in parallel using UA_Connect.

  • For each connection, to read up to 256 nodes of simple type, and to write up to 128 nodes of simple type.

Each OPC UA client can access the targeted UA server only by the embedded Ethernet ports of CPUs or the external port of the BMENUA0100 module.

Representation in FBD

Parameter Description

Input parameters:

Name

Type

Comment

EXECUTE

BOOL

On rising edge connection is started.

SERVERENDPOINTURL

string[255]

URL

SESSIONCONNECTINFO

DDT UASessionConnectInfo

Specifies the connection information required to create an OPC UA session

TIMEOUT

TIME

Maximum time to establish the connection.

Output parameters:

Name

Type

Comment

DONE

BOOL

Signals a connection has been successfully established.

BUSY

BOOL

The FB is not finished and new output values are to be expected.

ERROR

BOOL

Signals that an error has occurred within the FB.

ERRORID

DWORD

Error code.

CONNECTIONHDL

DWORD

Connection handle is valid until UA_Disconnect is called.

Runtime Error

Refer to the Appendix for a list of OPC UA detected error codes.