MODBUS_SET_FLOAT(3)

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

πŸ’– MODBUS_SET_FLOAT πŸ’–

okay bestie, welcome to the libmodbus manual page for modbus_set_float β€” she's a lil function that takes a float value and sets it from 2 registers ✨


🌸 NAME 🌸

modbus_set_float β€” set a float value from 2 registers 🫢


πŸŽ€ SYNOPSIS πŸŽ€

void modbus_set_float(float f, uint16_t *dest);
⚠️ bestie, heads up!! This function is deprecated since libmodbus v3.2.0 and has been replaced by modbus_set_float_dcba(). like, she still works, but she's retired πŸ’€ go use the new one, fr fr.

✨ DESCRIPTION ✨

So the modbus_set_float() function shall set a float to 4 bytes in Modbus format (ABCD). iconic byte order, no cap.

And the dest array must be pointer on two 16 bits values to be able to store the full result of the conversion πŸ’… like it literally needs room for two 16-bit slots, because one float is a whole 4 bytes and she does not fit in one lil register, periodt.


πŸ¦‹ RETURN VALUE πŸ¦‹

There is no return values. she gives you nothing back, she just does the thing πŸ™ˆ


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

The libmodbus documentation was written by Stéphane Raimbault <stephane.raimbault@gmail.com> 🫢 thank you for the lore, king.


and that's the whole page, bestie!! this was libmodbus v3.1.6, dated 11/17/2025 β€” mwah πŸ’‹ go set some floats (or better yet, use the dcba one, iykyk) βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from