epsilonrt / libmodbuspp

Much more than a C++ wrapper for libmodbus
https://epsilonrt.fr/modbuspp
GNU Lesser General Public License v3.0
73 stars 44 forks source link

[BUG] Byte order mismatch #13

Open maxlein opened 3 years ago

maxlein commented 3 years ago

When I start a server with this config, and read registers out like that:

Modbus::Data<float, Modbus::EndianBigLittle> values[4];  // is cdab order

if (slave->readRegisters (1, values, 4) > 0)  
... 

Then I get wrong data.
Only if I use EndianLittleBig, I get correct results.