1. I ma using this modbus library to read (EM)6433, meter from scheider.
Lib:
https://github.com/4-20ma/ModbusMasterdoc:
http://4-20ma.io/ModbusMaster/2. (EM)6433 documentation is here:
http://tinyurl.com/z7696ys 3. Page 3 of above doc says that protocol is Modbus RTU, data:8 bits, baud: 9600(default) , parity:even, device address:1, stop bit:1
In uno code, default seting is 9600 & parity zero. Is below setting ok in code:
ModbusMaster node;
Serial.begin(9600, SERIAL_8E1);
node.begin(1, Serial);
4. (EM)6433 doc on page 7 shows, read register "Average current", with address "3913" & reurn type is float 4 bytes in little endian.
However this library has function "readHoldingRegisters" to read holding register. But this function reads only 16 bit registers.
So should I use the function as:
result = node.readHoldingRegisters(3913, 2);
if (result == node.ku8MBSuccess)
{
for (j = 0; j < 2; j++)
{
data[j] = node.getResponseBuffer(j);
}
}
parameter 2, shows that 2 16 bit values are read.
How to convert it back to float?