Справочник Пользователя для Mitsubishi Electronics FXCPU
30 Applied Instructions (External Device Communication)
30.7 ADPRW / MODBUS Read/Write
725
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Appl
ied
ied
In
stru
cti
cti
ons
(R
eal
T
T
im
e
C
lock
Contr
Contr
ol)
22
Ap
plied
Instru
ctio
ns
Instru
ctio
ns
(E
xt
er
na
l De
vi
vi
ce
)
23
App
lied Instr
lied Instr
ucti
ons
(Ex
tensi
on
tensi
on
Functi
on)
24
Ap
pl
ied In
struct
struct
ions
(O
thers)
25
Appl
ied
ied
Instru
cti
cti
ons
(B
lock
Dat
a
Dat
a
O
per
at
io
n)
26
App
lie
lie
d Instr
uction
s
s
(Charac
ter
Stri
ng C
ontrol
)
27
Ap
pl
ied Inst
ruct
io
io
ns
(D
ata
Op
eration 3
eration 3
)
28
Appl
ied
ied
In
stru
cti
cti
ons
(D
ata C
om
om
par
ison
)
29
App
lie
lie
d Instr
uction
s
s
(D
ata
T
T
abl
e
O
peration
)
30
Appli
ed In
struc
tions
ed In
struc
tions
(E
xt
ernal Devi
ce
Comm
uni
cat
ion)
Cautions
1) The instruction is provided in the FX
3U
and FX
3UC
PLCs Ver. 2.40 or later.
The instruction is provided in the FX
3G
PLC Ver. 1.30 or later.
2) It is not permitted to use an "ADPRW" instruction and a following instruction for the same port:
- "RS or RS2" instruction
- "IVCK, IVDR, IVRD, IVWR, IVBWR
*1
, IVMC" instruction
- "FLCRT
*1
, FLDEL
*1
, FLWR
*1
, FLRD
*1
, FLCMD
*1
or FLSTRD
*1
" instruction
3) Some restrictions to applicable devices
S1: Excluding special auxiliary relays (M) and Special data register (D).
S2: The FX
S2: The FX
3U
and FX
3UC
PLCs only are applicable.
*1.
The instruction is not provided in the FX
3S
, FX
3G
and FX
3GC
PLCs.
30.7.1 Command Code and Parameters
The following table shows the required command parameters for each command code.
1H
Read Coils
Read Coils
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
Device Count: 1 to 2000
PLC Destination Device (head address)
Applicable Devices D, R, M, Y, S
Applicable Devices D, R, M, Y, S
Block Length
(
+15)
÷16
*2
2H
Read Discrete
Inputs
Read Discrete
Inputs
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
Device Count: 1 to 2000
PLC Destination Device (head address)
Applicable Devices D, R, M, Y, S
Applicable Devices D, R, M, Y, S
Block Length
(
+15)
÷16
*2
3H
Read Holding
Register
Read Holding
Register
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
Device Count: 1 to 125
PLC Destination Device (head address)
Applicable Devices D, R
Applicable Devices D, R
Block Length
4H
Read Input
Register
Read Input
Register
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
Device Count: 1 to 125
PLC Destination Device (head address)
Applicable Devices D, R
Applicable Devices D, R
Block Length
5H
Write Single Coil
Write Single Coil
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
0 (fixed)
PLC Sourse Device (head address)
Applicable Devices
D, R, K, H, X, Y, M, S
(D, R, X, Y, M, S can be
indexed.)
(D, R, X, Y, M, S can be
indexed.)
Block Length
1 Point
6H
Write Single
Register
Write Single
Register
MODBUS Address:
0000H to FFFFH
0000H to FFFFH
0 (fixed)
PLC Source Device (head address)
Applicable Devices
D, R, K, H
(D, R can be indexed.)
(D, R can be indexed.)
Block Length
1 Point
7H
Read Exception
State (Available only in
FX
Read Exception
State (Available only in
FX
3U
and FX
3UC
PLCs)
0 (fixed)
0 (fixed)
PLC Destination Device (head address)
Applicable Devices D, R
Applicable Devices D, R
Block Length
1 Point
8H
Diagnosis
(Available only in FX
Diagnosis
(Available only in FX
3U
and FX
3UC
PLCs)
Sub-function: 0H
Loop-back Test
Loop-back Test
Sub-function Data
(loop-back data): 0 to 65535
(loop-back data): 0 to 65535
Loop-back Test Data
(Slave response: echo of
(Slave response: echo of
)
Applicable Devices D, R
Block Length
Block Length
1 Point
Sub-function: 1H
Restart
Communication
Restart
Communication
Sub-function Data:
0x0000: Do Not Reset
Event Log
0xFF00: Reset Event Log
0x0000: Do Not Reset
Event Log
0xFF00: Reset Event Log
(Slave response: echo of
)
Applicable Devices D, R
Block Length
1 Point
Sub-function: 2H
Return
Diagnostic Register
Return
Diagnostic Register
0 (fixed)
PLC Destination Device (head address)
Applicable Devices D, R
Block Length
Applicable Devices D, R
Block Length
1 Point
*2.
This calculation formula is applicable when the applicable device is D or R.