FB_Connect
This function block enables to establish or terminate a TCP connection.
Syntax
FUNCTION_BLOCK FB_Connect IMPLEMENTS I_Connect
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
eState : E_SocketConnectionState;
ipResultMessage : I_TcMessage;
END_VAR
Outputs
Name | Type | Description |
---|---|---|
bBusy | BOOL | Is TRUE as long as the asynchronous request is still active. Is FALSE if the request was completed or an error occurs. |
bBusy | BOOL | Is set if an error occurs during the execution of the function block. Error details are located in the "Error List" window. |
eState | E_SocketConnectionState | Returns the current connection state.
|
ipResult | I_TcMessage | Enables error handling with the |
Methods
Name | Description |
---|---|
FB_init | Initialization method |
Connect | Establish a TCP connection. |
Disconnect | Terminate a TCP connection. |
Send | Send the QRC frame. |
Receive | Receive the QRC frame. |
FB_exit | Online Change method |
Because all methods are asynchronous and they need more than one cycle to finish working, only one method could be invoked at the same time. Therefore, check the output parameter |
Properties
Properties | Type | Access | Description |
---|---|---|---|
aRxFrame | ARRAY[0..QRC_NUMBER_OF_CONTROL] OF T_MaxString | Get | As soon as the falling edge of |
sTxFrame | STRING(QRC_BUFFER_SIZE) | Set | As soon as the falling edge of |
Interface
Name | Description |
---|---|
I_Connect | The interface that defines communication related methods. |