2-761
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Communications Instructions
2
SktUDPRcv
SktUDPRcv
The SktUDPRcv instruction reads the data from the receive buffer for a UDP socket for the built-in Eth-
erNet/IP.
The SktUDPRcv instruction stores the data in the receive buffer for the socket that is specified with
Socket in receive data RcvDat[]. The number of bytes to store is specified with Size. The number of
bytes that is actually stored is assigned to RcvSize. The node address of the node that sent the data is
stored in SendNodeAdr.
If there is no data in the receive buffer, the instruction waits for data for the time that is set with timeout
time TimeOut. Storage of the data to RcvDat[] is completed when the instruction is completed normally
(i.e., when the value of Done changes to TRUE).
Instruction Name
FB/
FUN
Graphic expression ST expression
SktUDPRcv UDP Socket
Receive
FB None SktUDPRcv_instance(Execute,
Socket, TimeOut, Size, RcvDat,
Done, Busy, Error, ErrorID,
RcvSize, SendNodeAdr);
Variables
Name Meaning I/O Description Valid range Unit Default
Socket Socket
Input
Socket
--- --- ---
TimeOut Timeout time 0: No timeouts
1 to 65535: 0.1 to 6553.5s
Depends on data
type.
0.1 s 0
Size Stored size The number of bytes to read
from the receive buffer
0 to 2000 Bytes 1
RcvDat[]
(array)
Receive data In-out Receive data Depends on data
type.
--- ---
RcvSize Receive data
size
Output
The number of bytes actually
stored in RcvDat[]
0 to 2000 Bytes
---
SendN-
odeAdr
Source node
address
Source node address --- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
Socket Refer to Function for details on the structure _sSOCKET.
TimeOut OK
Size OK
RcvDat[]
(array)
OK
RcvSize OK
SendN-
odeAdr
Refer to Function for details on the structure _sSOCKET_ADDRESS.
Function