UDP_Send block

Short summary

Name

UDP_Send

→POU type

→function

Category

more system blocks, network blocks, block with internal error diagnostic

Graphical interface

images/download/thumbnails/414780534/UDP_Send-version-1-modificationdate-1534502006499-api-v2.png

Available since

  • version 1.105.0 (for logi.CAD 3) and version 3.15.0 of logi.RTS
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This block is supported for these →target systems or platforms:

  • version 1.109.0 (for logi.CAD 3) and version 3.19.0 of logi.RTS
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg This block is supported for these target systems or platforms:

    • Raspberry Pi, Revolution Pi

    • platform WindowsX86 (incl. the built-in PLC under Windows)

    • platform LinuxX86

  • version 2.0.5 (for library Standard) – graphical interface with in-out variable

Functionality

The block sends a →UDP packet.

Inputs, outputs


Identifier

→Data type

Description

Inputs:

handle

DINT

UDP handle

destinationAddress

DWORD

destination IP address (in network byte order)
Example: The IP address 127.0.0.1 must be specified as value 16#0100007F.

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Use the INET_ATON block in order to convert the IP address.

destinationPort

UINT

destination IP port (in host byte order)
Example: The port 1125 must be specified as value 1125.

lengthOfDataToSend

UDINT

length of data to send

flags

UDINT

additional flags for sending

In-outs
(VAR_IN_OUT):

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
Restriction: In case of →array data types, only one-dimensional arrays are allowed.

content of the sent UDP packet

Outputs:

rc

UDINT

status of the UDP operation:

  • 16#00000000: The operation is successful

  • 16#81000001: The flag is invalid.

  • 16#81000002: The handle is invalid.

  • 16#81000005: Data cannot be sent.

  • 16#81000007: The length of data is invalid.

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 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.