7 DATA COMMUNICATIONS USING BIDIRECTIONAL PROTOCOL
(Program example)
When Q series C24 I/O signals are from X/Y00 to X/Y1F:
|
|
|
|
|
|
|
|
| Designate the receive channel. | ||
|
|
|
|
|
|
|
|
| Clear the receive data count storage device | ||
|
|
|
|
|
|
|
|
| to 0. | ||
|
|
|
|
|
|
|
|
| Designate the allowable receive data count. | ||
|
|
|
|
|
|
|
|
| With the normal completion, the receive | ||
|
|
|
|
|
|
|
|
| data within the allowable receive data count | ||
|
|
|
|
|
|
|
|
| (user designated) is read from the receive | ||
|
|
|
|
|
|
|
|
| data storage area in the buffer memory. | ||
|
|
|
|
|
|
|
|
| • After the BIDIN instruction is executed, | ||
|
|
|
|
|
|
|
|
| the user designated read completion | ||
|
|
|
|
|
|
|
|
| signal (M0) comes on for 1 scan. | ||
|
|
|
|
|
|
|
|
| • The reading of received data is performed | ||
|
|
|
|
|
|
|
|
| by the PLC CPU. | ||
|
|
|
|
|
|
|
|
| Q series C24 | ||
|
|
|
|
|
|
| Address |
| Buffer memory | ||
|
|
|
|
|
|
|
| ||||
| For normal completion |
|
|
|
|
| 258H |
| Data reception result storage area |
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
| |
D 0 |
|
|
|
|
|
|
|
|
|
|
|
Interface number | (1) |
|
|
|
| 600H |
|
|
|
| |
|
|
|
|
|
|
|
| Receive data count storage area |
| ||
D 1 | Reception result | (0) | |||||||||
|
|
|
|
|
|
| 601H |
|
|
|
|
D 2 | Receive data count | (n) |
|
|
|
| |||||
|
|
|
|
|
|
|
|
| |||
D 3 | Allowable receive data count | (10) |
|
|
|
| to |
| Receive data storage area | ||
|
|
|
|
|
|
| 7FFH |
| |||
|
|
|
|
|
|
|
|
|
|
| |
D10 Receive data |
|
|
|
|
| ||||||
|
|
|
|
|
|
|
|
| |||
to | to |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
| ||
D m | Receive data |
|
|
|
|
|
|
|
|
|
|
When the received data count is larger than the allowable received data count, only the data up to the allowable received data count will be stored and the excess data will be discarded.
7 - 11 | 7 - 11 |