MODBUS_GET_FLOAT(3)

πŸ“¦
version 3.1.6 Β· 3 versions
, in debian bookworm

πŸ’– MODBUS_GET_FLOAT(3) πŸ’–

okay bestie, welcome to the libmodbus corner of the manual, we're doing modbus_get_float today and it's giving legacy ✨


πŸŽ€ NAME πŸŽ€

modbus_get_float β€” get a float value from 2 registers 🫢


🌸 SYNOPSIS 🌸

float modbus_get_float(const uint16_t *src);
⚠️ Warning, and I need you to hear me on this one: this function is deprecated since libmodbus v3.2.0 and has been replaced by modbus_get_float_dcba(). Not me being dramatic, that's literally what it says. πŸ’€

✨ DESCRIPTION ✨

So modbus_get_float() shall get a float from 4 bytes in Modbus format (that's DCBA byte order, iykyk).

The src array must be a pointer on two 16 bits values, okay? Two. Not one, not three. Two. πŸ’…

For example, if the first word is set to 0x4465 and the second to 0x229a, the float value will be 916.540649. No cap, that's the vibe. πŸ¦‹


πŸ’œ RETURN VALUE πŸ’œ

The function shall return a float. That's it. That's the whole section. Slay. πŸ‘‘


🌈 SEE ALSO 🌈


πŸ’– AUTHORS πŸ’–

The libmodbus documentation was written by StΓ©phane Raimbault <stephane.raimbault@gmail.com> β€” thank you legend, we are obsessed 🫢✨


libmodbus v3.1.6 🌸 11/17/2025 πŸŽ€ β€” mwah, that's the whole page, go read the non-deprecated one bestie, ily πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from