● In the case of a direct address and an index modification address, specify the same device
for D1 and D2. At the same time, specify the addresses so that D1 is less than D2.
■
Sample program (in the case of CPU with built-in ET-LAN)
● When the received flag (X70) of Connection 1 turns ON, the reception program is started up
by the GPRECV instruction.
● The UNITSEL instruction is used to specify a slot number (LAN port: U100) and the
connection number (U1).
● In the GPRECV instruction, specify and execute the start of the data table that stores the
received message (DT200) and the final address (DT209).
GPRECV .US
DT209DT200
R100
UNITSEL U1U100
GPRECV instruction execution
D1: Header for received data (DT200)
D2 : End for received data (DT209)
GPRECV execution condition
Received flag: ON
S1 S2
D1 D2
Communication port settings
S1: CPU LAN port (U100)
S2: Connection 1 (U1)
■
Time chart (in the case of CPU with built-in ET-LAN)
● Data received from an external device are stored in the receive buffer for each connection.
● When data are received, the received flag (X70 to X7F) turns ON.
● When the GPRECV instruction is executed, data are copied to the specified area, and the
received flags (X70 to X7F) are turned OFF. The received flags (X70 to X7F) are turned OFF
when I/O refresh is executed at the start of the following scans.
Execute GPRECV
Reception done
flag (X70 - X7F)
Reception done flag (X70 - X7F):
Reception done: ON,
Received data copy done using
GPRECV instruction: OFF
Receive buffer
Received data
■
I/O allocation (in the case of CPU with built-in ET-LAN)
I/O allocations Name Description
X70 to X7F
General-purpose
communication received
flag
Turns ON when receiving is completed in the general-
purpose communication mode.
■
Precautions during programming (in the case of CPU with built-in ET-LAN)
● Use the UNITSEL instruction immediately before the GPRECV instruction to specify a target
connection for communication.
● When the general-purpose communication received flag is ON for the targeted connection,
execute GPRECV.
● The maximum volume of data that can be received in one session using the GPRECV
instruction, from the LAN port of the FP7 CPU unit, is 16,384 bytes.
15.3 GPRECV (General-Purpose Communication Receive Instruction)
WUME-FP7CPUPGR-12 15-19