APPENDIX
Appendix 9.5 When sending data using nonprocedural or bidirectional protocol
The following program example sends data under the nonprocedural protocol (or bidirectional protocol) using the REMFR/REMTO instruction and I/O signals. Refer to Chapter 6 for the communication using the nonprocedural protocol, and to Chapter 7 for the communication using the bidirectional protocol.
(1) Program conditions
| The following program sends data from the CH1 side when the transmission | |||||||||
| signal (X1024) turns ON. |
|
|
|
|
|
| |||
| (a) | Devices used: |
|
|
|
|
|
|
| |
|
| • Transmission command | ......................................................... |
|
| X1024 | ||||
|
| • Transmission command pulse signal..................................... | M10 |
| ||||||
|
| • Transmission result acquisition command............................. | M11 |
| ||||||
|
| • Completion device for REMFR/REMTO instruction .............. | M100 to 103 | |||||||
|
| • Normal/abnormal completion flag for REMFR/REMTO |
|
|
| |||||
|
| instruction................................................................................ |
|
|
|
| M200 to 202 | |||
|
| • Normal/abnormal completion of transmission........................ | M300, M301 | |||||||
|
| • Transmission data count ........................................................ | D10 |
| ||||||
|
| • Transmission data (5 words) .................................................. | D11 to D15 | |||||||
|
| • Data transmission result | ......................................................... |
|
| D20 |
| |||
| (b) Intelligent function module switch settings (Refer to Section 4.5.2) |
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
Switch No. |
| Bit |
| Description |
|
|
| Setting | ||
Position | Designated value |
|
|
|
| value | ||||
|
|
|
|
|
|
| ||||
| b0 |
| OFF |
| Operation setting |
| Independent |
|
|
|
| b1 |
| OFF |
| Data bit |
| 7 bits |
|
|
|
| b2 |
| OFF |
| Parity bit |
| No |
|
|
|
| b3 |
| OFF | Transmission | Even/odd parity |
| Odd |
|
|
|
Switch 1 | b4 |
| OFF | setting | Stop bit |
| 1 bit |
|
| 07C0H |
| b5 |
| OFF |
| Sum check code |
| No |
|
|
|
| b6 |
| ON |
| Write during RUN |
| Enabled |
|
|
|
| b7 |
| ON |
| Setting modifications |
| Enabled |
|
|
|
| b8 to b15 |
| — | Communication rate setting |
| 19200bps |
|
|
| |
|
|
|
|
|
|
| 0006H | |||
Switch 2 |
| — | Communication protocol setting |
| or |
|
| or | ||
|
|
|
|
|
| bidirectional protocol |
| 0007H | ||
Switch 5 |
| — | Station number setting |
| Station 0 |
|
| 0000H | ||
| (c) Buffer memory settings used in this example |
|
|
|
| |||||
|
|
|
|
|
|
|
|
| ||
Address Decimal (Hexadecimal) |
|
| Name |
|
|
| Setting | |||
| CH1 |
|
|
|
|
|
| value | ||
|
|
|
|
|
|
|
|
| ||
| 150 (96H) |
| Word/byte units designation |
|
| Word units | ||||
| 162 (A2H) |
| Transmission buffer memory head address designation |
|
|
| 0400H | |||
| 163 (A3H) |
| Transmission buffer memory length designation |
|
|
| 0200H | |||
| 599 (257H) |
| Data transmission result |
|
|
|
|
| — |
App. - 39 | App. - 39 |