
10
4 PROTOCOL IMPLEMENTATION
4.1 Modbus Register Addresses
The PM171 Modbus registers are referred to by using addresses in the range of 0 to 65535. From
within the Modbus applications, the PM171 Modbus registers can be accessed by simulating holding
registers of the Modicon 584, 884 or 984 Programmable Controller, using a 5-digit “4XXXX” or 6-digit
“4XXXXX” addressing scheme. To map the PM171 register address to the range of the Modbus
holding registers, add a value of 40001 to the PM171 register address. When a register address
exceeds 9999, use a 6-digit addressing scheme by adding 400001 to the PM171 register address.
4.2 Data Formats
The PM171 uses three data formats to pass data between a master application and the instrument: a
16-bit integer format, a 32-bit modulo 10000 format, and a 32-bit long integer format.
4.2.1 16-bit Integer Format
A 16-bit data is transmitted in a single 16-bit Modbus register as unsigned or signed integer (whole)
numbers without conversion or using pre-scaling to accommodate large-scale and fractional numbers
to a 16-bit register format. Scaling can be made using either the LIN3 linear conversion, or decimal
pre-scaling to pass fractional numbers in integer format.
Non-scaled data
The data will be presented exactly as retrieved by the communications program from the instrument.
The value range for unsigned data is 0 to 65535; for signed data the range is -32768 to 32767.
LIN3 (Linear) Scaling
This conversion maps the raw data received by the communications program in the range of 0 - 9999
onto the user-defined LO scale/HI scale range. The conversion is carried out according to the formula:
Y = (X / 9999)
×
(HI - LO) + LO
where:
Y
- the true value in engineering units
X
- the raw input data in the range of 0 - 9999
LO, HI - the data low and high scales in engineering units
When data conversion is necessary, the HI and LO scales, and data conversion method are indicated
for the corresponding registers.
EXAMPLE
Suppose you have read a value of 5000 from register 256 that contains a voltage reading (see
Table 5-1
). If your
instrument has the 144V input option, and you use potential transformers with the ratings of
22,000V : 110V = 200, then the voltage high scale is HI = 144
×
200 = 28,800, and in accordance with the above
formula, the voltage reading in engineering units will be as follows:
5000
×
(28800 - 0)/9999 + 0 = 14401V
When a value is written to the instrument, the conversion is carried out in reverse to produce the
written value in the range of 0 - 9999:
X
=
9999
×
(Y - LO) / (HI - LO)
Decimal Scaling
Decimal pre-scaling can be used to accommodate fractional numbers to an integer register format.
Fractional numbers pre-multiplied by 10 in power N, where N is the number of digits in the fractional
part. For example, the frequency reading of 50.01 Hz is transmitted as 5001, having been pre-
multiplied by 100. Whenever a data register contains a fractional number, the register measurement
unit is given with a multiplier
×
0.1,
×
0.01 or
×
0.001, showing an actual register resolution (the weight of