Chapter 6 Applied Instructions 7. D200=17 (number of the data received), and the content of the received data: D201=16#303A, D202=16#3031, D203=16#3136, D204=16#3630, D205=16#3134, D206=16#3332, D207=16#3334, D208=16#0D46, D209=16#000A. 8. SM100=ON: reception of data is complete. 9. To send more data, set the flag SM100 to OFF to start the operation again. NOTE: When sending of data is complete, the receiving flag SM98 is ON and then the PLC starts receiving data until it receives the ending character (16#0D0A). When the reception of data is complete, SM100 is ON.
If the communication timeout occurs but the ending character (16#0D0A) is still not received, the communication timeout flag SM104 is ON. Example 5 The mode in D 2 is 4 (the data received starts with a specific character and you set the timeout value to 5–255 ms.) and you set the mode of sending and receiving data to 8-bit mode (SM106=ON). 6_ 1. The length for the data to be sent: D20=4. 2. The contents for the data to be sent: D100=16#0031, D101=16#0032, D102=16#0033, D103=16#0034. 3. Set D10=16#0004 (mode: 4), D11=16#3A0F (the starting character is 16#3A and set the time value to 16#0F, meaning 15ms). 4. Enable the contact M0. 5. The PLC sends 4 pieces of data. Sending data:
PLC→external equipment 31 32 33 34 6. The external equipment receives data from the PLC and then sends 7 consecutive words to the PLC with an interval of 1 ms between each sending. External equipment → PLC 30 3A 35 36 37 38 39 7. D200=6 (number of the data received), and the content of the received data: D201=16#003A, D202=16#0035, D203=16#0036, D204=16#0037, D205=16#0038, D206=16#0039. 6-557