UA_Connect

This function block is used to create a transport connection and an OPC UA session. The connection handle offered is valid for the duration of the connection and is used to determine the session for the subsequent FBs. The connection shall be terminated by calling the UA_Disconnect.

 

 

 

UA_Connect

 

 

 

BOOL

–

 

Execute

Done

 

–

BOOL

STRING

–

 

ServerEndpointUrl

Busy

 

–

BOOL

UASessionConnectInfo

–

 

SessionConnectInfo

Error

 

–

BOOL

TIME

–

 

Timeout

ErrorID

 

–

L_IOCP_ErrorId

 

 

 

 

ConnectionHdl

 

–

DWORD

 

 

 

 

 

 

 

 

Inputs

Name

Data type

Information/possible settings

Execute

BOOL

FALSEäTRUE

On rising edge connection is started.

  • All outputs of the FB are reset to the initial values.

ServerEndpointUrl

STRING

The URL of the Server. For example:

  • "opc.tcp://10.10.10.10".

  • It is also possible to use a hostname instead of an IP address. In that case, an external Ethernet network entity like DNS (domain name service) has to be added for communication.

SessionConnectInfo

UASessionConnectInfo

Optional, further parameters for connection establishment.

See UASessionConnectInfo

Timeout

TIME

Maximum time to establish the connection.

Outputs

Name

Data type

Value/meaning

Done

BOOL

TRUE

Signals a connection has been initially established successful.

Busy

BOOL

TRUE

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

Error

BOOL

TRUE

An error has occurred in the service request. For details see ErrorID.

ErrorID

L_IOCP_ErrorId L_IE1P_Error

If Error = TRUE: Error number for the error that has occurred.

"FAST technology modules" reference manual: Here you can find information on error or warning messages.

ConnectionHdl

DWORD

Connection handle – is valid until UA_Disconnect is called.

ConnectResultInfo

L_IOCP_UASessionConnectResultInfo

ConnectResultInfo provides further information about the established session, e. g. used security mode.

Note:

  • Security / certificate handling is supported by default with Controller FW versions V1.11 and higher. It´s possible to adjust the security settings with the SessionConnectInfo input variable of the function block.

  • It is an automatic re-connect implemented. In case of a session interruption, the client tries to reconnect to the server automatically. If the connection could be re-established, all handles for the session and nodes are still valid. Check the connection state via the UA_ConnectionGetStatus FB.

  • It is possible to establish 1 session for free.

  • It is possible to establish multiple sessions in parallel with appropriate OPC UA licence package. For this purpose, see the documentation of the Lenze Licence Manager in the »PLC Designer«.

    • c4xx Controller supports max. 4 sessions.

    • c5xx Controller supports max. 6 sessions.