4. Modbus RTU
4 - 11
(2) Usage example
The following shows a setting example for writing "0100h" in the Modbus register 2102h ([Pr. PC02]) of
the slave address "02h".
Index
Name
Data type
Access
No. of Registers
Continuous
read/write
Setting value
2102h
PC02
U32
rw
2
00000100h
Query Message
Slave
Address Function
Starting Address No. of Registers
Byte
Count
Data
CRC Check
H
L
H
L
H
L
H
L
L
H
02h
10h
21h
02h
00h
02h
04h
01h
00h
00h
00h
(8 bits)
(8 bits)
Set the following values to each Query Message.
Message
Description
Slave Address
Set the station number "02h".
Function
Set "10h".
Starting Address
Set "2102h", the start address of the registers to which data is written.
No. of Registers
Set "02h", because the total number of write points of the Modbus register 2102h is 2.
Byte Count
Set "04h". This means that data of 4 frames is sent.
Data
Set values in order starting from the start address.
Lower-bit value of the register 2102h: "0100h"
Higher-bit value of the register 2102h: "0000h"
The endian setting of 4-byte data can be selected with "Modbus RTU communication endian
selection" of [Pr. PC72 Function selection C-G]. This example shows the case when the standard
endian (initial value) is set.
CRC Check
Data for CRC error check
This data is calculated automatically by a controller.
Response Message
Slave Address
Function
Starting Address
No. of Registers
CRC Check
H
L
H
L
L
H
02h
10h
21h
02h
00h
02h
(8 bits)
(8 bits)
The following shows the information in each Response Message.
Message
Description
Slave Address
The station number "02h" is returned.
Function
The value "10h" is returned. This means that the message was received without errors.
Starting Address
The value "2102h", the start address of the holding registers to which the data was written is
returned.
H: "21h"
L: "02h"
No. of Registers
The number of registers to write "02h" is returned.
CRC Check
Data for CRC error check
This data is calculated automatically by a servo amplifier, and the result of the calculation is
returned.
Содержание MR-JE-C Series
Страница 9: ...A 8 MEMO ...
Страница 13: ...4 MEMO ...
Страница 33: ...2 CC Link IE Field Network Basic SLMP 2 16 MEMO ...
Страница 73: ...5 PARAMETERS 5 14 MEMO ...
Страница 79: ...6 MANUFACTURER FUNCTIONS 6 6 MEMO ...
Страница 143: ...MEMO ...