3. Instruction Set
API
Mnemonic
Operands Function
150 MODRW
MODBUS Read/ Write
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D
E F
MODRW: 11 steps
1
SS2
SX2
SS2
SX2
SS2
SX2
Operands:
S
1
: Device address (K0~K254) S
2
: Function code: K1(H01), K2(H02), K3(H03), K4(H04),
K5(H05), K6(H06), K15(H0F), K16(H10), K23(H17) S
3
: The function varies with the function code
used. S: The function varies with the function code used. n: The function varies with the
function code used.
Explanations:
1. MODRW supports COM1 (RS-232), COM2 (RS-485), COM3 (RS-485). (COM3 is only
applicable to DVP-ES2/EX2/SA2/SE, and is not applicable to DVP-ES2-C.)
2. S
1
: Address of the device to be accessed. Range: K0~K254. The address specified by the
function codes K1, K2, K3, K4, and K23 can not be K0.
3. S
2
: Function code. Only the function codes listed below are available currently; other function
codes are not executable. Please refer to the program examples below for more information.
H01 Reading multiple bit devices
ES2/EX2 V3.28, SS2 V3.24, SA2/SX2
V2.82, and SE V1.64 (and above)
Reading multiple bit devices
H03
Reading multiple word
devices
All series
H04
Reading multiple word
devices
ES2/EX2 V2.6, SS2 V2.4, SA2/SX2 V2.0,
and SE V1.0 (and above)
Writing in a single bit device
H06
Writing in a single word
device
All series
Writing in multiple bit devices
H10
Writing in multiple word
devices
All series
H17
Reading/Writing in multiple
word devices
ES2/EX2 V3.2, SS2 V3.0, SA2 V2.6, and
SX2 V2.4 (and above)