The function block is used to establish a connection to the TCP server of a Lexium Cobot controller using TLS encryption.
The method establishes a connection to the TCP server of a Lexium Cobot controller using TLS encryption.
The TCP server of the Lexium Cobot controller is specified by its IP address.
Port 10001 (refer to Gc_uiPortCobotController) is used to establish a connection to a Lexium Cobot controller.
For further information, refer to Using the Library - Using TLS Certificate on TCP Connection with TLS.
Input |
Data type |
Description |
---|---|---|
i_sIpAddress |
STRING[15] |
IP address of the Lexium Cobot controller to connect to. The IP address must be provided in a IPv4 format. |
Output | Data type | Description |
---|---|---|
q_xError |
BOOL |
Value is TRUE if an error was detected. For details, refer to q_etResult and q_sResultMsg. |
q_etResult |
ET_Result |
Provides diagnostic and status information as a numeric value. If q_xError = FALSE, q_etResult provides status information. If q_xError = TRUE, q_etResult provides diagnostic/error information. |
q_sResultMsg |
STRING[80] |
Provides additional diagnostic and status information as a text value. |
q_xError |
q_etResult |
Enumeration value |
Description |
---|---|---|---|
FALSE |
Ok |
0 |
The method was called successfully. |
TRUE |
IpAddressInvalid |
10 |
The IP address is invalid. |
TRUE |
StateInvalid |
11 |
The state is invalid. |
FALSE or TRUE |
AlreadyConnected |
6 |
A connection to a Lexium Cobot controller is already established. |
TRUE |
Disabled |
1 |
The function block is disabled. |
TRUE |
NotReady |
4 |
The function block is not ready to perform commands. |
Enumeration name: |
AlreadyConnected |
Enumeration value: |
6 |
Description: |
A connection to a Lexium Cobot controller is already established. |
Issue |
Cause |
Solution |
---|---|---|
The output q_xError is FALSE: The method was called successfully. |
The function block is already connected to the corresponding Lexium Cobot controller IP address provided at the input i_sIpAddress. |
– |
The output q_xError is TRUE: The method was not called successfully. |
The function block is already connected to a Lexium Cobot controller with a different IP address as provided at the input i_sIpAddress. |
Ensure that the function block is connected to a Lexium Cobot controller. |
Enumeration name: |
Disabled |
Enumeration value: |
1 |
Description: |
The function block is disabled. |
Issue |
Cause |
Solution |
---|---|---|
The method was not called successfully. |
The function block is disabled. A disabled function block does not execute any actions and all outputs are set to the default value. |
Ensure that the function block is enabled. Enable the function block by setting the input i_xEnable to TRUE. The function block will report TRUE at its outputs q_xActive and q_xReady after the enable routine is successfully finished. |
Enumeration name: |
IpAddressInvalid |
Enumeration value: |
10 |
Description: |
The IP address is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The method was not called successfully. |
The given string at the input i_sIpAddress is not a valid IP address in IPv4 format. |
Ensure that a valid IP address in IPv4 format is provided at the input i_sIpAddress. |
Enumeration name: |
NotReady |
Enumeration value: |
4 |
Description: |
The function block is not ready to perform commands. |
Issue |
Cause |
Solution |
---|---|---|
The method was not called successfully. |
The function block reports FALSE at the output q_xReady because a detected error is reported. In case a sent command was acknowledged by the Lexium Cobot controller with a detected error, the property xCommandFailed reports the value TRUE in addition. |
Verify the diagnostic outputs of the function block and solve the root cause of the detected error. A rising edge at the input i_xErrorQuit will reset the detected error. |
Enumeration name: |
StateInvalid |
Enumeration value: |
11 |
Description: |
The state is invalid. |
Issue |
Cause |
Solution |
---|---|---|
The method was not called successfully. |
The function block is already connecting to a Lexium Cobot controller. The property etConnectionState reports the value ET_ConnectionState.Connecting. |
Ensure to not call the method twice to establish a connection to a Lexium Cobot controller. |
The function block is disconnecting from a Lexium Cobot controller. The property etConnectionState reports the value ET_ConnectionState.Disconnecting. |
Ensure that the property etConnectionState reports the value ET_ConnectionState.Idle before calling the method Connect to establish a connection to a Lexium Cobot controller. |