UDP_Receive block
Short summary
Name |
UDP_Receive |
→POU type |
|
Category |
more system blocks, network blocks, block with internal error diagnostic |
Graphical interface |
|
Available since |
|
Functionality
The block receives a →UDP packet.
Inputs, outputs
|
Identifier |
Description |
|
Inputs: |
handle |
DINT |
UDP handle |
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 received UDP packet |
Ausgänge: |
sourceAddress |
DWORD |
source address of the received UDP packet (in network byte order) Use the INET_NTOA block in order to convert the address. |
sourcePort |
UINT |
source port of the received UDP packet (in host byte order) |
|
lengthOfReceivedData |
UDINT |
length of the received UDP packet |
|
rc |
UDINT |
status of the UDP 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 flag is invalid.
The handle is invalid.
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 output rc returns the appropriate code (see the above table).
Example for usage within ST-editor
See "UDP_Open 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.