Skip to content

Commit 9c4f214

Browse files
committed
Update doc of float functions (closes #838)
1 parent 9af6c16 commit 9c4f214

5 files changed

Lines changed: 11 additions & 7 deletions

File tree

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# NEWS
22

3+
## libmodbus 3.X (202X-XX-XX)
4+
5+
- Fix documentation examples of `modbus_get_float_*` functions.
6+
37
## libmodbus 3.1.12 (2026-02-13)
48

59
- Fix FD_SET overflow when socket fd >= FD_SETSIZE.

docs/modbus_get_float_abcd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ float modbus_get_float_abcd(const uint16_t *src);
1414
1515
The *modbus_get_float_abcd()* function shall get a float from 4 bytes in usual
1616
Modbus format. The `src` array must be a pointer on two 16 bits values, for
17-
example, if the first word is set to 0x0020 and the second to 0xF147, the float
17+
example, if the first word is set to 0x47F1 and the second to 0x2000, the float
1818
value will be read as 123456.0.
1919
2020
## Return value

docs/modbus_get_float_badc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ float modbus_get_float_badc(const uint16_t *src);
1414
1515
The *modbus_get_float_badc()* function shall get a float from 4 bytes with
1616
swapped bytes (BADC instead of ABCD). The `src` array must be a pointer on two
17-
16 bits values, for example, if the first word is set to 0x2000 and the second
18-
to 0x47F1, the float value will be read as 123456.0.
17+
16 bits values, for example, if the first word is set to 0xF147 and the second
18+
to 0x0020, the float value will be read as 123456.0.
1919
2020
## Return value
2121

docs/modbus_get_float_cdab.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ float modbus_get_float_cdab(const uint16_t *src);
1414
1515
The *modbus_get_float_cdab()* function shall get a float from 4 bytes with
1616
swapped words (CDAB order instead of ABCD). The `src` array must be a pointer on
17-
two 16 bits values, for example, if the first word is set to F147 and the second
18-
to 0x0020, the float value will be read as 123456.0.
17+
two 16 bits values, for example, if the first word is set to 0x2000 and the second
18+
to 0x47F1, the float value will be read as 123456.0.
1919
2020
## Return value
2121

docs/modbus_get_float_dcba.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ float modbus_get_float_dcba(const uint16_t *src);
1414
1515
The *modbus_get_float_dcba()* function shall get a float from 4 bytes in
1616
inverted Modbus format (DCBA order instead of ABCD). The `src` array must be a
17-
pointer on two 16 bits values, for example, if the first word is set to 0x47F1
18-
and the second to 0x2000, the float value will be read as 123456.0.
17+
pointer on two 16 bits values, for example, if the first word is set to 0x0020
18+
and the second to 0xF147, the float value will be read as 123456.0.
1919
2020
## Return value
2121

0 commit comments

Comments
 (0)