UDP_Send block
Short summary
Name |
UDP_Send |
→POU type |
|
Category |
more system blocks, network blocks, block with internal error diagnostic |
Graphical interface |
|
Available since |
|
Functionality
The block sends a →UDP packet.
Inputs, outputs
|
Identifier |
Description |
|
Inputs: |
handle |
DINT |
UDP handle |
destinationAddress |
DWORD |
destination IP address (in network byte order) Use the INET_ATON block in order to convert the IP address. |
|
destinationPort |
UINT |
destination IP port (in host byte order) |
|
lengthOfDataToSend |
UDINT |
length of data to send |
|
flags |
UDINT |
additional flags for sending |
|
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 sent UDP packet |
Outputs: |
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.
See:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Internal error diagnostic for block
The block checks the following error cases:
The flag is invalid.
The handle is invalid.
Data cannot be sent.
The length of data is invalid.
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.