6-12
6.6 Data Reception F1 61 (MRCV) Instruction
The “reception done” flag X0 (X2) turns on when MCU
receives data. The received data is read from MCU to the PLC
using F161 (MRCV) instruction. MCU supports full duplex
communication.
Even if the data reception is completed, the data for 8 buffer
can be received consecutively. It is not necessary to execute
F159 (MTRN) instruction again to start the reception.
The number of data which MCU can receive is 2048 bytes for
1 buffer (including the terminator).
Data table for reception (receive buffer)
The data table is specified using F161 (MRCV) instruction.
Sample program for receiving data
10-byte data received in MCU through COM. 1 port of the MCU in the slot 1 are copied to DT200.
The program described above is executed in the following sequence.
1) Data is received through COM. 1 port and the completion of the data reception is detected.
2) The “reception done” contact turnes on. The input of X10 turns on.
3) The received data is sent from the receive buffer to the area starting with data register DT200.
Explanation of data table
Data sent from an external device connected to the COM port is received in MCU, and the data
reception is completed, the “reception done” signal X0 (X2) turns on. When F161 (MRCV) instruction is
executed using the “reception done” signal, the data is stored in the receive buffer specified by MRCV
instruction.
• Registers are used as the receive buffer. They are specified
using the second and third operand of F161 (MRCV)
instruction.
• Specify the data registers in system register 416 to 419.
• The number of bytes of data received is stored in the
starting address of the receive buffer. The initial value is not
necessary.
• Received data is stored in the received data storage area in
order from the lower -order byte.
• The receive buffer should be specified to be larger than the supposed data to be received.
• If the number of received data cannot be stored in the specified area, the data is copied within that
range only and an operation error occurs.
(When the received byte numbers are odd number, the higher byte of the last word is always cleared.)