MODBUS_GET_FLOAT_CDA(3)
π MODBUS_GET_FLOAT_CDA(3) π
okay bestie, welcome to the libmodbus Manual β yes this is a real section 3 page and yes we're gonna make it cute. sit down, grab a strawberry π, we're decoding floats.
β¨ NAME β¨
modbus_get_float_cdab β get a float value from 2 registers in CDAB byte order π¦
πΈ SYNOPSIS πΈ
float modbus_get_float_cdab(const uint16_t *src);
π DESCRIPTION π
so modbus_get_float_cdab() shall get a float from 4 bytes with swapped words β that's CDAB order instead of the usual ABCD. it's giving "word order said sike". π
the src array must be a pointer on two 16 bits values. no cap, that's the requirement.
like, for example, if the first word is set to F147 and the second to 0x0020, the float value will be read as 123456.0. iconic behavior honestly β¨
fr fr though: src has to point at two 16-bit values. that's not a suggestion, that's the whole deal.
π«Ά RETURN VALUE π«Ά
the function shall return a float. that's it. that's the tea. β
π₯ SEE ALSO π₯
the whole float squad, go say hi π
π AUTHORS π
the libmodbus documentation was written by StΓ©phane Raimbault <stephane.raimbault@gmail.com> β main character energy, we love to see it π
and that's the page bestie!! this was libmodbus v3.1.6, dated 11/17/2025 π go read your floats, you absolute icon, periodt π
β¨
π¦ where this page comes from
- debian bookworm: libmodbus-dev 3.1.6-2.1+deb12u1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms