- 16 -
This function enables the master (host computer) to obtain the real-time measurement value of
the slave (instrument). The value is specified as a single-precision floating-point type (that is,
occupying two consecutive register addresses), and the corresponding parameters are marked
with different register addresses;
The host can send a command frame to read a single or all data results. The data frame format
is as follows (the data is all in Hex format):
2. Function code details (function code 0×04):
The instrument acts as a slave on the network and supports Modbus RTU communication
protocol.
Data communication is initiated by the host, and the first byte of the transmitted message is
the target slave address. When the first byte is received by all the slaves on the network, each
slave will decode it to determine whether the message is sent to itself.
The transmission of the RTU message frame must start with a pause interval of at least 3.5
characters. After the last character is transmitted, a pause of at least 3.5 characters marks the
end of the message frame. A new message can start after this pause. In the transmission
process, the entire message frame must be transmitted in a continuous stream. If there is a
pause interval of more than 1.5 characters before the completion of the message frame
transmission, the receiving device will refresh the incomplete message and assume that the
next byte is the beginning of a new message. Similarly, if a new message starts after the
previous frame in less than 3.5 characters, the receiving device will consider it a continuation
of the previous frame, and this will cause an error because of the final CRC The value cannot
be correct.
The meter uses the function code 0x04 to complete the output of the measurement results
and the output of two current values.
Host send:
Slave response:
Appendix
1. Modbus RTU Overview:
☞
Note :
1. Addr is the slave address, with an optional range of 0
x
01 to 0
x
FE.
2. Len is the number of bytes of returned data.
A Modbus register information
1
2
3
4
5
5+n
5+n+1
5+n+2
5+n+3
Device
Address
Function
code
Length
Data 1
high 8 bit
Data 1
low 8 bit
Data n
high 8 bit
Data n
low 8 bit
CRC
low 8 bit
CRC high
8 bit
Addr
04
Len
xx
xx
xx
xx
CRC
CRC
1
2
3
4
5
6
7
8
Slave
address
Function
code
Register start
Address
high 8 bit
Register start
address
low 8 bit
Register
number
high 8 bit
Register
number
low 8 bit
CRC
low 8 bit
CRC
high 8 bit
Addr
04
xx
xx
xx
xx
CRC
CRC