Chapter 6 Applied Instructions 2. It is suggested that you use the pulse instruction. 6_ 3. See the details about the Modbus function codes in S 4 and S 8 below. The command for the AS reads the data from several bit devices (which are not discrete input devices) is 1 (16#01). The command for the AS reads the data from several bit devices (which are only discrete input devices) is 2 (16#02). The command for the AS to read the data from several word devices (which are not input registers) is 3 (16#03). The command for the AS to read the data from several word devices (which are only input registers) is 4 (16#04). The command for the AS to write the state into a bit device is 5 (16#05).
The command for the AS to write the state into a word device is 6 (16#06). The command for the AS to write the state into several bit devices is 15 (16#0F). The command for the AS to write the data into several word devices is 16 (16#10). The command for the AS to synchronously read from and to write the data into several word devices is 23 (16#17). 6-597 Device Name Description Data type Remark S8 Function code for writing data Supports 16#05, 06, 0F, 10. If the value is out of the range, the instruction does not modify the operand. WORD S9 Writing the remote communication address 16#0000–16#FFFF WORD S10 Writing data length Bit function code, 16#0F:
Supports 1–256 bits; Word function code, 16#10: Supports 1–100 words. For function code 16#06, the value can only be 1. If the value is 0 or smaller than 0, it indicates do not read data. If the value is greater than the maximum, the instruction uses the maximum value. WORD S11 The local register into which the remote data are written Bit function code: only M can be selected. Word function code: only D can be selected. BOOL WORD