Chapter 5 Relay Ladder Logic Programming 120
-
MU mode3: Write Multiple Registers
Set
parameter ③, address, to be constant:
F
unction parameter display:
Set
a constant address, 0003.
Data length is fixed at 1word, means writing single register.
Set data DRE0=1234 (hex: 04D2) as the content which would be
written into other register.
When enable the MU function, the sending out Modbus command
will be
01 10 00 03 00 01 02 04 D2 CRC16;
Received response from slave:
01 10 00 03 00 01
CRC16;
S
et parameter ③, address, refer to data register DR:
F
unction parameter display:
S
et DR03=0001 for address
Set DR04=0002 for data length
(means how many data will be written)
Set data DRE0=1234 (hex: 04D2),
Set data DRE1=5678 (hex: 162E),
Wh
en enable the MU function, the sending out Modbus command will
be:
01 10 00 01 00 02 04 04 D2 16 2E CRC16;
Received response from slave:
01 10 00 01 00 0
2 CRC16
※ the max length of data is 25.
T
he above example shows how to write two data into two different (but continuous) registers/addresses. For
more information, see the SMT Modbus protocol manual.