2. MODBUS/TCP PROTOCOL
2 - 9
(2) Usage example
The following shows a setting example for writing "0100h" in the Modbus register 2102h ([Pr. PC02]).
Index Name Data
type
Read/write
No. of
Registers
(Number of
registers to
write)
Continuous
read/write
Setting value
2102h PC02
4
bytes
Read/write
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
(Transaction identifier)
Set any value.
Protocol Identifier
(Protocol identifier)
Set "0000h".
Length Field (Message length)
Set the byte length from Unit Identifier to Data.
Unit Identifier (Unit identifier)
Set "FFh".
Function (Function field)
Set "10h".
Starting Address (Start address)
Set "2102h", the start address of the registers to which data is written.
No. of Registers
(Number of registers to write)
Set "02h", because the total number of write points of the Modbus register 2102h is 2.
Byte Count (Byte count)
Set "04h". This means that data of 4 frames is sent.
Data (Writing 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
(Transaction identifier)
16 bits
Transaction Identifier received from the client (controller) is copied and returned.
Protocol Identifier
(Protocol identifier)
16 bits
The value "0000h" is returned.
Length Field (Message length)
16 bits
The byte length from Unit Identifier to Data is returned.
Unit Identifier (Unit identifier)
8 bits
Unit Identifier received from the client (controller) is copied and returned.
Function (Function field)
8 bits
When the message was received without errors, "10h" is returned.
Starting Address (Start 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
(Number of registers to write)
16 bits
The number of registers to write "02h" is returned.
Summary of Contents for MELSERVO-JE MR-JE-C
Page 9: ...A 8 MEMO ...
Page 83: ...MEMO ...