Commit 8471eb62791399c7ee9a703e1696baf05de72d4a
1 parent
997231b7
Documentation of new modbus_[get|set]_float_swapped functions
Showing
6 changed files
with
90 additions
and
9 deletions
doc/Makefile.am
| @@ -9,6 +9,7 @@ MAN3 = \ | @@ -9,6 +9,7 @@ MAN3 = \ | ||
| 9 | modbus_get_byte_from_bits.3 \ | 9 | modbus_get_byte_from_bits.3 \ |
| 10 | modbus_get_byte_timeout.3 \ | 10 | modbus_get_byte_timeout.3 \ |
| 11 | modbus_get_float.3 \ | 11 | modbus_get_float.3 \ |
| 12 | + modbus_get_float_swapped.3 \ | ||
| 12 | modbus_get_header_length.3 \ | 13 | modbus_get_header_length.3 \ |
| 13 | modbus_get_response_timeout.3 \ | 14 | modbus_get_response_timeout.3 \ |
| 14 | modbus_get_socket.3 \ | 15 | modbus_get_socket.3 \ |
| @@ -39,6 +40,7 @@ MAN3 = \ | @@ -39,6 +40,7 @@ MAN3 = \ | ||
| 39 | modbus_set_debug.3 \ | 40 | modbus_set_debug.3 \ |
| 40 | modbus_set_error_recovery.3 \ | 41 | modbus_set_error_recovery.3 \ |
| 41 | modbus_set_float.3 \ | 42 | modbus_set_float.3 \ |
| 43 | + modbus_set_float_swapped.3 \ | ||
| 42 | modbus_set_response_timeout.3 \ | 44 | modbus_set_response_timeout.3 \ |
| 43 | modbus_set_slave.3 \ | 45 | modbus_set_slave.3 \ |
| 44 | modbus_set_socket.3 \ | 46 | modbus_set_socket.3 \ |
doc/libmodbus.txt
| @@ -139,6 +139,8 @@ Functions for data manipulation:: | @@ -139,6 +139,8 @@ Functions for data manipulation:: | ||
| 139 | linkmb:modbus_get_byte_from_bits[3] | 139 | linkmb:modbus_get_byte_from_bits[3] |
| 140 | linkmb:modbus_get_float[3] | 140 | linkmb:modbus_get_float[3] |
| 141 | linkmb:modbus_set_float[3] | 141 | linkmb:modbus_set_float[3] |
| 142 | + linkmb:modbus_get_float_swapped[3] | ||
| 143 | + linkmb:modbus_set_float_swapped[3] | ||
| 142 | 144 | ||
| 143 | 145 | ||
| 144 | Connection | 146 | Connection |
doc/modbus_get_float.txt
| @@ -4,7 +4,7 @@ modbus_get_float(3) | @@ -4,7 +4,7 @@ modbus_get_float(3) | ||
| 4 | 4 | ||
| 5 | NAME | 5 | NAME |
| 6 | ---- | 6 | ---- |
| 7 | -modbus_get_float - get a float value | 7 | +modbus_get_float - get a float value from 2 registers |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | SYNOPSIS | 10 | SYNOPSIS |
| @@ -15,9 +15,9 @@ SYNOPSIS | @@ -15,9 +15,9 @@ SYNOPSIS | ||
| 15 | DESCRIPTION | 15 | DESCRIPTION |
| 16 | ----------- | 16 | ----------- |
| 17 | The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus | 17 | The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus |
| 18 | -format. The 'src' array must be pointer on two 16 bits values, for example, | ||
| 19 | -if the first word is set to 0x4465 and the second to 0x229a, the float value | ||
| 20 | -read will be 916.540649. | 18 | +format (ABCD order). The 'src' array must be pointer on two 16 bits values, for |
| 19 | +example, if the first word is set to 0x4465 and the second to 0x229a, the float | ||
| 20 | +value will be 916.540649. | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | RETURN VALUE | 23 | RETURN VALUE |
| @@ -28,7 +28,8 @@ The _modbus_get_float()_ function shall return a float. | @@ -28,7 +28,8 @@ The _modbus_get_float()_ function shall return a float. | ||
| 28 | SEE ALSO | 28 | SEE ALSO |
| 29 | -------- | 29 | -------- |
| 30 | linkmb:modbus_set_float[3] | 30 | linkmb:modbus_set_float[3] |
| 31 | - | 31 | +linkmb:modbus_set_float_swapped[3] |
| 32 | +linkmb:modbus_get_float_swapped[3] | ||
| 32 | 33 | ||
| 33 | AUTHORS | 34 | AUTHORS |
| 34 | ------- | 35 | ------- |
doc/modbus_get_float_swapped.txt
0 → 100644
| 1 | +modbus_get_float_swapped(3) | ||
| 2 | +=========================== | ||
| 3 | + | ||
| 4 | + | ||
| 5 | +NAME | ||
| 6 | +---- | ||
| 7 | +modbus_get_float_swapped - get a float value from 2 byte swapped registers | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +SYNOPSIS | ||
| 11 | +-------- | ||
| 12 | +*float modbus_get_float_swapped(const uint16_t *'src');* | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +DESCRIPTION | ||
| 16 | +----------- | ||
| 17 | +The _modbus_get_float_swapped()_ function shall get a float from 4 bytes in | ||
| 18 | +swapped Modbus format (DCBA order). The 'src' array must be pointer on two 16 | ||
| 19 | +bits values, for example, if the first word is set to 0x9a22 and the second to | ||
| 20 | +0x6544, the float value read will be 916.540649. | ||
| 21 | + | ||
| 22 | + | ||
| 23 | +RETURN VALUE | ||
| 24 | +------------ | ||
| 25 | +The _modbus_get_float_swapped()_ function shall return a float. | ||
| 26 | + | ||
| 27 | + | ||
| 28 | +SEE ALSO | ||
| 29 | +-------- | ||
| 30 | +linkmb:modbus_set_float_swapped[3] | ||
| 31 | +linkmb:modbus_set_float[3] | ||
| 32 | +linkmb:modbus_get_float[3] | ||
| 33 | + | ||
| 34 | + | ||
| 35 | +AUTHORS | ||
| 36 | +------- | ||
| 37 | +The libmodbus documentation was written by Stéphane Raimbault | ||
| 38 | +<stephane.raimbault@gmail.com> |
doc/modbus_set_float.txt
| @@ -4,7 +4,7 @@ modbus_set_float(3) | @@ -4,7 +4,7 @@ modbus_set_float(3) | ||
| 4 | 4 | ||
| 5 | NAME | 5 | NAME |
| 6 | ---- | 6 | ---- |
| 7 | -modbus_set_float - set a float value | 7 | +modbus_set_float - set a float value from 2 registers |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | SYNOPSIS | 10 | SYNOPSIS |
| @@ -14,8 +14,8 @@ SYNOPSIS | @@ -14,8 +14,8 @@ SYNOPSIS | ||
| 14 | 14 | ||
| 15 | DESCRIPTION | 15 | DESCRIPTION |
| 16 | ----------- | 16 | ----------- |
| 17 | -The _modbus_set_float()_ function shall set a float to 4 bytes in Modbus | ||
| 18 | -format. The 'dest' array must be pointer on two 16 bits values to be able to | 17 | +The _modbus_set_float()_ function shall set a float to 4 bytes in Modbus format |
| 18 | +(ABCD). The 'dest' array must be pointer on two 16 bits values to be able to | ||
| 19 | store the full result of the conversion. | 19 | store the full result of the conversion. |
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -27,7 +27,8 @@ The is no return values. | @@ -27,7 +27,8 @@ The is no return values. | ||
| 27 | SEE ALSO | 27 | SEE ALSO |
| 28 | -------- | 28 | -------- |
| 29 | linkmb:modbus_set_float[3] | 29 | linkmb:modbus_set_float[3] |
| 30 | - | 30 | +linkmb:modbus_set_float_swapped[3] |
| 31 | +linkmb:modbus_get_float_swapped[3] | ||
| 31 | 32 | ||
| 32 | AUTHORS | 33 | AUTHORS |
| 33 | ------- | 34 | ------- |
doc/modbus_set_float_swapped.txt
0 → 100644
| 1 | +modbus_set_float_swapped(3) | ||
| 2 | +=========================== | ||
| 3 | + | ||
| 4 | + | ||
| 5 | +NAME | ||
| 6 | +---- | ||
| 7 | +modbus_set_float_swapped - set a float value in 2 registers using a byte order swapped integer | ||
| 8 | + | ||
| 9 | + | ||
| 10 | +SYNOPSIS | ||
| 11 | +-------- | ||
| 12 | +*void modbus_set_float_swapped(float 'f', uint16_t *'dest');* | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +DESCRIPTION | ||
| 16 | +----------- | ||
| 17 | +The _modbus_set_float_swapped()_ function shall set a float to 4 bytes in | ||
| 18 | +swapped Modbus format (DCBA order). The 'dest' array must be pointer on two 16 | ||
| 19 | +bits values to be able to store the full result of the conversion. | ||
| 20 | + | ||
| 21 | + | ||
| 22 | +RETURN VALUE | ||
| 23 | +------------ | ||
| 24 | +The is no return values. | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +SEE ALSO | ||
| 28 | +-------- | ||
| 29 | +linkmb:modbus_get_float_swapped[3] | ||
| 30 | +linkmb:modbus_set_float[3] | ||
| 31 | +linkmb:modbus_get_float[3] | ||
| 32 | + | ||
| 33 | + | ||
| 34 | +AUTHORS | ||
| 35 | +------- | ||
| 36 | +The libmodbus documentation was written by Stéphane Raimbault | ||
| 37 | +<stephane.raimbault@gmail.com> |