9 application instructions api 150-199 – Delta Electronics Programmable Logic Controller DVP-PLC User Manual
Page 473

9 Application Instructions API 150-199
DVP-PLC Application Manual
9-1
API Mnemonic
Operands
Function
150
MODRW
Read/Write MODBUS Data
Controllers
ES/EX/SS SA/SX/SC EH/SV
Bit Devices
Word Devices
Program Steps
Type
OP
X Y M S K H
KnX KnY KnM KnS T
C
D
E
F
S
1
*
*
*
S
2
*
*
*
S
3
*
*
*
S
*
n
*
*
*
MODRW: 11 steps
PULSE 16-bit 32-bit
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
Operands:
S
1
: Address of communication device S
2
: Function code S
3
: Device address of data to be read/written
S: Register for storing read/written data (source or destination) n: Length of read/written data
Explanations:
1.
The content of S
2
shall only be: K3(H3), K6(H6), K16(H10).
2.
ES/EX/SS V.4.9 (and above) support the continuous execution instruction (MODRW). Other versions do not
support this instruction.
3.
ES/EX/SS series MPU does not support E, F index register modification.
4.
Flags: M1120 ~ M1131, M1140 ~ M1143. See remarks for more details.
5. Range
of
S
1
: K0 ~ K254
6.
S
2
: Funcation code. For example, H03 is for AC motor drive or DVP-PLC to read many data; H06 is for AC
motor drive or DVP-PLC to write a single data; H10 is for AC motor drive or DVP-PLC to write many data. Only
these function codes are available currently; other function codes are still not executable. See program
examples for more information.
7.
S
3
: Device address of data to be read/written. The device address inside the communication device. If the
address is illegal to a designated communication device, the communication device will respond with an error
message and PLC will store the error code in D1130 and M1141 = On. For example, if 8000H is illegal to
VFD-S, M1141 will be On and D1130 = 2. See user manual of VFD-S for error codes.
8.
S: Register for storing read/written data. The user sets up a register and stores the data to be written in the
register in advance. The register can be register for storing the read data.
9.
n: Length of read/written data. For ES/SA, when M1143 = Off (in ASCII mode), the range of length: K1 ~ K8
(word); when M1143 = On (in RTU mode), the range of length: K1 ~ K16 (word). For EH/EH2/SV, the range of
length: K1 ~ K16 (word).
10. There is no limitation on the times of using this instruction. However, only one instruction can be executed at a
time.
Program Example 1:
1.
Function code K3(H3): For reading many data in register
When PLC is connected to VFD-S AC motor drive: M1143 = Off, in ASCII mode
When PLC is connected to VFD-S AC motor drive: M1143 = On, in RTU mode