The energy values are stored across two 16-bit integer registers on an energy meter.
Reading and converting Modbus register values
The Energy Meter stores energy across two 16-bit integer registers.
Register #1 and Register #2 (Modbus address 257/258 for Register #1 and 259/260 for Register #2). Register #2 is the High WORD and Register #1 is the Low WORD.
The Multiplier/Divisor table states that both of these registers must be divided by 32 to obtain the real value from the raw data.
The Multiplier/Divisor should NOT be applied to both registers. It is applied to the final value of both registers.
To calculate the Energy the registers must first be arranged as the register list states  is the High word and  is the Low word.
To make  the High word it needs to be shifted to the left 16 bits.
To accomplish this multiply the value in  by 65,356.
You will then add this value to the value in .
The final value will be divided or multiplied by the correct scaling value. Please see the example listed below.
For this example we will assume an Energy Meter with 300 amp CTs. According to the Integer Multiplier/ Divisor table, 300 amp CTs will give a divisor value, (d), of 32 and a multiplier value, (m), of 0.03125.
We will assume the following register values.
Register #1 = 29,586
Register #2 = 31
Using Divisor Table
kWh = ([R2]*65,536+[R1])/d
kWh = (31*65,536+29,586) / 32
kWh = 64412.56
Using Multiplier Table
kWh = ([R2]*65,536+[R1]) * m
kWh = (31*65,536+29,586) * 0.03125
kWh = 64412.56
*Note the divisor will not always be 32 and the multiplier will not always be 0.03125. For the correct values please see the Integer Multiplier Table.