| 1 | # modbus_get_float |
| 2 | |
| 3 | ## Name |
| 4 | |
| 5 | modbus_get_float - get a float value from 2 registers |
| 6 | |
| 7 | ## Synopsis |
| 8 | |
| 9 | ```c |
| 10 | float modbus_get_float(const uint16_t *src); |
| 11 | ``` |
| 12 | |
| 13 | Warning, this function is *deprecated* since libmodbus v3.2.0 and has been |
| 14 | replaced by *modbus_get_float_dcba()*. |
| 15 | |
| 16 | ## Description |
| 17 | |
| 18 | The *modbus_get_float()* function shall get a float from 4 bytes in Modbus |
| 19 | format (DCBA byte order). The `src` array must be a pointer on two 16 bits |
| 20 | values, for example, if the first word is set to 0x4465 and the second to |
| 21 | 0x229a, the float value will be 916.540649. |
| 22 | |
| 23 | ## Return value |
| 24 | |
| 25 | The function shall return a float. |
| 26 | |
| 27 | ## See also |
| 28 | |
| 29 | - [modbus_set_float](modbus_set_float.md) |
| 30 | - [modbus_set_float_dcba](modbus_set_float_dcba.md) |
| 31 | - [modbus_get_float_dcba](modbus_get_float_dcba.md) |