62
3 DATA COMMUNICATION USING NONPROCEDURAL PROTOCOL
3.1 Receiving Data from Target Device
Start the programmable controller of the host station. The setting values specified with an Engineering tool are stored to
C24.
When the amount of data specified by the receive end data quantity or data containing the receive end code is received
from the target device, the 'CH1 reception data read request' (X3) turns ON.
After the control data for the INPUT instruction is stored in the device, the program executes the INPUT instruction and
reads the received data.
Before executing the INPUT instruction, check that the INPUT instruction completion device (M0) is OFF.
Once reading of the received data is completed, the INPUT instruction completion device turns ON.
When the completion device + 1 (abnormal completion signal) turns ON, the error code is stored in the control data
completion status (S1 + 1).
■Program example
For information on the module FB to be used, refer to the following manual.
MELSEC iQ-R Serial Communication Module Function Block Reference
Category Label name Description Device
Module label C24_1 Target module
C24_1.stnCH1.bSet_Req_ReceptionRead CH1 Reception data read request X3
C24_1.stnCH1.bSts_ReceptionAbnormalDetection CH1 Reception abnormal detection X4
Label to be defined Define the global label as shown below.
INPUT
m n
INPUT
1
(M0)
(M1)
Ó
Ô
Õ
Ó
Ô
Õ
Ò
(CH1)
Module READY (X1E)
Reception data read request
(X3)
ON during abnormal
reception detection
ON during abnormal
reception detection
Reception abnormal
detection (X4)
INPUT instruction
INPUT instruction completion
device
INPUT instruction completion
device + 1
(Normal completion/abnormal
completion)
1 scan
Receive data count (Un\G1536)
Received data 1 Received data 2
Received data (from Un\G1537)
Data reception
Data reception-1 Data reception-2