From 8471eb62791399c7ee9a703e1696baf05de72d4a Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 1 May 2013 16:47:23 +0200 Subject: [PATCH] Documentation of new modbus_[get|set]_float_swapped functions --- doc/Makefile.am | 2 ++ doc/libmodbus.txt | 2 ++ doc/modbus_get_float.txt | 11 ++++++----- doc/modbus_get_float_swapped.txt | 38 ++++++++++++++++++++++++++++++++++++++ doc/modbus_set_float.txt | 9 +++++---- doc/modbus_set_float_swapped.txt | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 doc/modbus_get_float_swapped.txt create mode 100644 doc/modbus_set_float_swapped.txt diff --git a/doc/Makefile.am b/doc/Makefile.am index e75af9f..632b5cb 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -9,6 +9,7 @@ MAN3 = \ modbus_get_byte_from_bits.3 \ modbus_get_byte_timeout.3 \ modbus_get_float.3 \ + modbus_get_float_swapped.3 \ modbus_get_header_length.3 \ modbus_get_response_timeout.3 \ modbus_get_socket.3 \ @@ -39,6 +40,7 @@ MAN3 = \ modbus_set_debug.3 \ modbus_set_error_recovery.3 \ modbus_set_float.3 \ + modbus_set_float_swapped.3 \ modbus_set_response_timeout.3 \ modbus_set_slave.3 \ modbus_set_socket.3 \ diff --git a/doc/libmodbus.txt b/doc/libmodbus.txt index 38eb6e0..0271049 100644 --- a/doc/libmodbus.txt +++ b/doc/libmodbus.txt @@ -139,6 +139,8 @@ Functions for data manipulation:: linkmb:modbus_get_byte_from_bits[3] linkmb:modbus_get_float[3] linkmb:modbus_set_float[3] + linkmb:modbus_get_float_swapped[3] + linkmb:modbus_set_float_swapped[3] Connection diff --git a/doc/modbus_get_float.txt b/doc/modbus_get_float.txt index 15e30ab..3e0bb99 100644 --- a/doc/modbus_get_float.txt +++ b/doc/modbus_get_float.txt @@ -4,7 +4,7 @@ modbus_get_float(3) NAME ---- -modbus_get_float - get a float value +modbus_get_float - get a float value from 2 registers SYNOPSIS @@ -15,9 +15,9 @@ SYNOPSIS DESCRIPTION ----------- The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus -format. The 'src' array must be pointer on two 16 bits values, for example, -if the first word is set to 0x4465 and the second to 0x229a, the float value -read will be 916.540649. +format (ABCD order). The 'src' array must be pointer on two 16 bits values, for +example, if the first word is set to 0x4465 and the second to 0x229a, the float +value will be 916.540649. RETURN VALUE @@ -28,7 +28,8 @@ The _modbus_get_float()_ function shall return a float. SEE ALSO -------- linkmb:modbus_set_float[3] - +linkmb:modbus_set_float_swapped[3] +linkmb:modbus_get_float_swapped[3] AUTHORS ------- diff --git a/doc/modbus_get_float_swapped.txt b/doc/modbus_get_float_swapped.txt new file mode 100644 index 0000000..b794091 --- /dev/null +++ b/doc/modbus_get_float_swapped.txt @@ -0,0 +1,38 @@ +modbus_get_float_swapped(3) +=========================== + + +NAME +---- +modbus_get_float_swapped - get a float value from 2 byte swapped registers + + +SYNOPSIS +-------- +*float modbus_get_float_swapped(const uint16_t *'src');* + + +DESCRIPTION +----------- +The _modbus_get_float_swapped()_ function shall get a float from 4 bytes in +swapped Modbus format (DCBA order). The 'src' array must be pointer on two 16 +bits values, for example, if the first word is set to 0x9a22 and the second to +0x6544, the float value read will be 916.540649. + + +RETURN VALUE +------------ +The _modbus_get_float_swapped()_ function shall return a float. + + +SEE ALSO +-------- +linkmb:modbus_set_float_swapped[3] +linkmb:modbus_set_float[3] +linkmb:modbus_get_float[3] + + +AUTHORS +------- +The libmodbus documentation was written by Stéphane Raimbault + diff --git a/doc/modbus_set_float.txt b/doc/modbus_set_float.txt index 9ca6f52..c9bcfa3 100644 --- a/doc/modbus_set_float.txt +++ b/doc/modbus_set_float.txt @@ -4,7 +4,7 @@ modbus_set_float(3) NAME ---- -modbus_set_float - set a float value +modbus_set_float - set a float value from 2 registers SYNOPSIS @@ -14,8 +14,8 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_float()_ function shall set a float to 4 bytes in Modbus -format. The 'dest' array must be pointer on two 16 bits values to be able to +The _modbus_set_float()_ function shall set a float to 4 bytes in Modbus format +(ABCD). The 'dest' array must be pointer on two 16 bits values to be able to store the full result of the conversion. @@ -27,7 +27,8 @@ The is no return values. SEE ALSO -------- linkmb:modbus_set_float[3] - +linkmb:modbus_set_float_swapped[3] +linkmb:modbus_get_float_swapped[3] AUTHORS ------- diff --git a/doc/modbus_set_float_swapped.txt b/doc/modbus_set_float_swapped.txt new file mode 100644 index 0000000..a616c50 --- /dev/null +++ b/doc/modbus_set_float_swapped.txt @@ -0,0 +1,37 @@ +modbus_set_float_swapped(3) +=========================== + + +NAME +---- +modbus_set_float_swapped - set a float value in 2 registers using a byte order swapped integer + + +SYNOPSIS +-------- +*void modbus_set_float_swapped(float 'f', uint16_t *'dest');* + + +DESCRIPTION +----------- +The _modbus_set_float_swapped()_ function shall set a float to 4 bytes in +swapped Modbus format (DCBA order). The 'dest' array must be pointer on two 16 +bits values to be able to store the full result of the conversion. + + +RETURN VALUE +------------ +The is no return values. + + +SEE ALSO +-------- +linkmb:modbus_get_float_swapped[3] +linkmb:modbus_set_float[3] +linkmb:modbus_get_float[3] + + +AUTHORS +------- +The libmodbus documentation was written by Stéphane Raimbault + -- libgit2 0.21.4