3. Modbus/TCP
3 - 9
(2) Usage example
The following shows a setting example for writing "0100h" in the Modbus register 2102h ([Pr. PC02]).
Index
Name
Data type
Access
No. of
Registers
Continuous
read/write
Setting value
2102h
PC02
U32
rw
2
00000100h
Query Message
Transaction
Identifier
Protocol
Identifier
Length Field
Unit
Identifier
Function
Starting
Address
No. of
Registers
Byte
Count
Data
H
L
H
L
H
L
H
L
16 bits
0000h
000Ah
FFh
10h
21h
02h
00h
02h
04h
01h
00h
00h
00h
Set the following values to each Query Message.
Message field
Description
Transaction Identifier
Set any value.
Protocol Identifier
Set "0000h".
Length Field
Set the byte length from Unit Identifier to Data.
Unit Identifier
Set "FFh".
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"
Response Message
Transaction
Identifier
Protocol
Identifier
Length Field
Unit
Identifier
Function
Starting Address
No. of Points
H
L
H
L
2 × 8 bits
0000h
0006h
FFh
10h
21h
02h
00h
02h
The following shows the information in each Response Message.
Message field
Size
Description
Transaction Identifier
16 bits
Transaction Identifier received from the client (controller) is copied and returned.
Protocol Identifier
16 bits
The value "0000h" is returned.
Length Field
16 bits
The byte length from Unit Identifier to Data is returned.
Unit Identifier
8 bits
Unit Identifier received from the client (controller) is copied and returned.
Function
8 bits
When the message was received without errors, "10h" is returned.
Starting Address
16 bits
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
16 bits
The number of registers to write "02h" is returned.
Summary of Contents for MR-JE-C Series
Page 9: ...A 8 MEMO ...
Page 13: ...4 MEMO ...
Page 33: ...2 CC Link IE Field Network Basic SLMP 2 16 MEMO ...
Page 73: ...5 PARAMETERS 5 14 MEMO ...
Page 79: ...6 MANUFACTURER FUNCTIONS 6 6 MEMO ...
Page 143: ...MEMO ...