Libraries
9.4 Open user communication library
S7-200 SMART
520
System Manual, V2.3, 07/2017, A5E03822230-AF
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.
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...