Libraries 
  9.4 Open user communication library 
S7-200 SMART 
System Manual, V2.3, 07/2017, A5E03822230-AF 
521 
The UDP_RECV instruction also returns the IP address and port number of the remote 
device. This allows your program to respond to the remote device with a UDP_SEND where 
the remote IP address and port are required parameters. 
Table 9- 20  Parameters of the UDP_RECV instruction 
ConnID  IN  WORD  The CPU uses the Connection ID (ConnID) num-
ber for this receive operation (defined during the 
connect process). 
MaxLen  IN  WORD  The MaxLen is the maximum number of bytes to 
accept (for example, the size of the buffer at 
DataPtr  IN  DWORD  The DataPtr is the pointer to where the receive 
data should be stored. This is an S7-200 SMART 
pointer to I, Q, M, or V memory (for example, 
Done  OUT  BOOL  The instruction sets the Done output when the 
receive operation is complete with no errors. 
When the instruction sets the Done output, the 
Busy  OUT  BOOL  The instruction sets the Busy output while the 
receive operation is in progress. 
Error  OUT  BOOL  The instruction sets the Error output when the 
receive operation is complete with an error. Refer 
to "Open user communication library instruction 
error codes" (Page 524) for further information. 
Status  OUT  BYTE  The Status output shows the error code if the 
instruction sets the Error output. Status is zero 
(no error) if the instruction sets the Busy or Done 
Length  OUT  WORD  The Length is the actual number of bytes re-
ceived. Only when the instruction sets the Done 
or Error outputs is the Length valid. If the instruc-
tion sets the Done output, then the instruction 
received the entire message. If the instruction 
sets the Error output, the message was greater 
than the buffer size (MaxLen) and has been trun-
IPaddr1 
 ... 
IPaddr4 
OUT  BYTE  These are the four IP address octets of the re-
mote device that sent the message. IPaddr1 is 
the most significant byte and IPaddr4 is the least 
significant byte of the IP address. 
RemPort  OUT  WORD  The RemPort is the port number of the remote 
device that sent the message.