Siemens SIMATIC S7 System Manual page 520

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Libraries
9.4 Open user communication library
After the CPU receives a message on the specified connection, the next execution of the
UDP_RECV instruction performs the following tasks:
● Copies the message data to your program's data area (DataPtr)
● Sets the returned Length to the number of bytes received
● Sets the IP address to the remote device that sent the message
● Set the remote port number (RemPort) to the remote device's port
● Sets the Done output, clears the Busy and Error outputs, and sets the Status output byte
value to zero (no error)
You should assign the receive area/buffer (DataPtr) and the maximum length of the receive
buffer (MaxLen) so there is no possibility of a buffer overrun. If the CPU receives more bytes
than can fit into your program's buffer (as specified by MaxLen), the UDP_RECV instruction
copies MaxLen bytes to your program's data area and discards the rest of the received
bytes. In this situation, the instruction sets the Error output and the Status output byte
displays error code 25, which means the receive buffer is too small.
The maximum amount of data that you can receive in one message is 1024 bytes. The
UDP_RECV instruction always operates in a mode that allows receipt of messages of
varying lengths. Each message from a remote device is delineated as a separate message
in the S7-200 SMART CPU. The UDP_RECV instruction only returns one received message
for each call of the instruction.
520
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents