TCP_Receive block
Short summary
Name |
TCP_Receive |
→POU type |
|
Category |
more system blocks, network blocks, block with internal error diagnostic |
logicals.system.network.tcp |
|
Graphical interface |
|
Available since |
version 3.2.2 (for library
Standard
)
|
Functionality
The block receives a →TCP packet.
Inputs, outputs
|
Identifier |
Description |
|
Inputs: |
clientHandle |
TCP_ClientHandle |
TCP h andle |
flags |
UDINT |
additional flags for receiving |
|
In-outs
|
data |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, STRING, CHAR, DATE_AND_TIME, DATE, TIME_OF_DAY or a →user-defined data type |
content of the received TCP packet |
Outputs: |
lengthOfReceivedData |
UDINT |
length of the received TCP packet |
Return value: |
– (= rc ) |
TCP_ErrorCode |
returns the status of the TCP operation:
|
Input EN and output ENO are available when →calling
the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
Internal error diagnostic for block
The block checks the following error cases:
The flags are invalid .
T he handle is invalid .
The data cannot be received.
In such an error case, the output ENO of the block is set to value FALSE (or an equivalent). Moreover, the block returns the appropriate code (see the above table).
Example for usage within ST-editor
See "TCP_Connect block".
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.