How to read a 64-bit integer in the Modbus driver?
In some devices, such as energy meter, a 64-bit value is used to save totalized consumption. However in the Niagara Modbus driver only supports 16-bit and 32-bit integer type.
Divide the 64-bit integer into two 32-bit integers points.
For example, the register is 40001. we read 2 long(32-bit) type points: data40001 and data40003, then combine.
result = data40001 * 4294967296 + data40003.
In some implementations, the high 32-bit and the low 32-bit are swapped. So the result would be :
result = data40003 * 4294967296 + data40001.
Consult the register listing of the product for details of byte/word order.