User`s manual

187
CHAPTER 4 RECEIVING DATA WITH AN INTERRUPT PROGRAM
4
4.3 Reception Control Method Using an Interrupt Program
4.3 Reception Control Method Using an Interrupt Program
The following explains the reception control method when receiving data with an interrupt program during
communication using the non procedure protocol or bidirectional protocol.
1) When data is received from the external device, the receive data is stored in the buffer memory and the reception
data read request signal turns ON.
2) The main program stops executing and the interrupt program starts.
3) The data reception dedicated instruction, BUFRCVS, for the interrupt program is executed and data is received.*1
4) When execution of the BUFRCVS instruction is complete, the reception data read request signal turns OFF.
5) When execution of the interrupt program is finished, execution of the main program restarts.
*1 When the reading of receive data using the BUFRCVS instruction is finished, the following processes are performed.
At normal completion: Programmable controller CPU error flag (SM0) turns OFF.
At abnormal completion: Programmable controller CPU error flag (SM0) turns ON.
The error code is stored in the programmable controller CPU error code (SD0).
For more details on the programmable controller CPU error flag (SM0) and error codes (SD0), see the programmable
controller CPU Manual.
Z.BUFRCVS "U0" D200K1
FEND
IRET
I50
X3
X4
SM400
1)
2)
3)
4)
5)
<Data reception using the dedicated instruction,
BUFRCVS instruction (interrupt program)>
Main program execution
Interrupt program execution
BUFRCVS instruction
Reception data read
request signal
Reception abnormal
detection signal
Buffer memory
reception area
Data reception Response
transmission
Reception using bidirectional
protocol
Control data
[D200]: Word count for stored receive data
[D201]: Receive data