HD52.3D
- 31 -
V1.11
The instrument sends the requested data after elaboration of the received command. The reply
structure is identical to the message sent by the “Master” unit:
<Address><Function><Data><CRC>
with <Address> = address of the answering instrument (1 byte)
<Function> =
type of operation the instrument has performed (1 byte)
<Data> = data communicated by the instrument to the PC (0 to 252 bytes)
<CRC> = cyclic redundancy check for data correctness (2 bytes)
When the address field takes the value “0”, it means that the command is sent to all the de-
vices on the network. In this case the devices perform the command, if this is compatible with
their functionalities, but don’t send any reply to the PC, to prevent transmission conflicts.
In order to prevent transmission conflicts among the instruments, the PC should wait for the
reply from the questioned instrument before sending a new command.
If the instrument doesn’t receive correctly the command (time intervals between characters or
check codes were not respected), it doesn’t send any reply to the PC. If the PC doesn’t receive
a reply within a given time interval (time-out), it will consider the command reception from the
recipient as not successful and can try again to transmit or generate an error signal.
The functions that can be requested from the PC to the instrument, together with the corre-
sponding codes to be entered in the command field
Function
, are indicated in the table below:
TAB. 10.A – Modbus functions
Function code
Function
04h Measurement
reading
07h
Error condition reading
2Bh
Instrument general information reading
M
EASUREMENT READING
(function
04h
)
Function code 04h allows to read the values measured by the instrument.
The data field of the request shows the address of the input register containing the first quan-
tity to be read and the number of consecutive quantities to be read.
Since registers are numbered starting from 1 in the protocol, but data is addressed starting
from 0, the register address is equal to the register number decreased by 1.
The instrument answers with the value of the measured quantities. It is not allowed to read
quantities that are not measured by that particular model.
The fields
Function
and
Data
of command and reply take consequently the following form:
Command
Value
Length
Description
Function
:
04h
1 byte
Command of measurement reading
Data
:
0000h to FFFFh
2 byte
Address of first quantity
0001h to 007Dh
2 byte
Number of quantities to be read (
N
)
Reply
Value
Length
Description
Function
:
04h
1 byte
Measurement reading command
Data
: 2
x
N
1 byte
Number of values bytes
2
x
N
byte
Values of measurements
Summary of Contents for HD52.3D... series
Page 43: ......