For my project I am using modbus in slave mode. And to replay mater I want to transmit floating point no like 123.456 or 9958.32. So what is correct way to transmit float values on modbus.
I having function to break float value in char. but I don't know weather it is correct or not for MODBUS.
unsigned char outbox;
unsigned long d = *(unsigned long *)&member;
outbox = d & 0x00FF;
outbox = (d & 0xFF00) >> 8;
outbox = (d & 0xFF0000) >> 16;
outbox = (d & 0xFF000000) >> 24;