diff --git a/doc/libmodbus.txt b/doc/libmodbus.txt index 393097e..95ce210 100644 --- a/doc/libmodbus.txt +++ b/doc/libmodbus.txt @@ -235,7 +235,7 @@ shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the 'errno' variable. -The _modbus_strerror()_ function is provided to translate libmodbus-specific +The *modbus_strerror()* function is provided to translate libmodbus-specific error codes into error message strings; for details refer to linkmb:modbus_strerror[3]. diff --git a/doc/modbus_close.txt b/doc/modbus_close.txt index f8f5703..5a0afc0 100644 --- a/doc/modbus_close.txt +++ b/doc/modbus_close.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_close()_ function shall close the connection established with the +The *modbus_close()* function shall close the connection established with the backend set in the context. diff --git a/doc/modbus_connect.txt b/doc/modbus_connect.txt index 4c8ac96..fd510ca 100644 --- a/doc/modbus_connect.txt +++ b/doc/modbus_connect.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_connect()_ function shall etablish a connection to a Modbus server, +The *modbus_connect()* function shall etablish a connection to a Modbus server, a network or a bus using the context information of libmodbus context given in argument. RETURN VALUE ------------ -The modbus_connect() function shall return 0 if successful. Otherwise it shall -return -1 and set errno to one of the values defined by the system calls of the -underlying platform. +The function shall return 0 if successful. Otherwise it shall return -1 and set +errno to one of the values defined by the system calls of the underlying +platform. EXAMPLE diff --git a/doc/modbus_flush.txt b/doc/modbus_flush.txt index 5ccc2f5..f4f9b16 100644 --- a/doc/modbus_flush.txt +++ b/doc/modbus_flush.txt @@ -14,13 +14,13 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_flush()_ function shall discard data received but not read to the +The *modbus_flush()* function shall discard data received but not read to the socket or file descriptor associated to the context 'ctx'. RETURN VALUE ------------ -The _modbus_flush()_ function shall return 0 or the number of flushed bytes if +The function shall return 0 or the number of flushed bytes if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_free.txt b/doc/modbus_free.txt index af1845d..f7b12f0 100644 --- a/doc/modbus_free.txt +++ b/doc/modbus_free.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_free()_ function shall free an allocated modbus_t structure. +The *modbus_free()* function shall free an allocated modbus_t structure. RETURN VALUE diff --git a/doc/modbus_get_byte_from_bits.txt b/doc/modbus_get_byte_from_bits.txt index d4b79eb..e0828f1 100644 --- a/doc/modbus_get_byte_from_bits.txt +++ b/doc/modbus_get_byte_from_bits.txt @@ -13,15 +13,14 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_byte_from_bits()_ function shall extract a value from many -bits. All 'nb_bits' bits from 'src' at position 'index' will be read as a +The *modbus_get_byte_from_bits()* function shall extract a value from many +bits. All _nb_bits_ bits from _src_ at position _index_ will be read as a single value. To obtain a full byte, set nb_bits to 8. RETURN VALUE ------------ -The _modbus_get_byte_from_bits()_ function shall return a byte containing the -bits read. +The function shall return a byte containing the bits read. SEE ALSO diff --git a/doc/modbus_get_byte_timeout.txt b/doc/modbus_get_byte_timeout.txt index 8361dd4..b959a0a 100644 --- a/doc/modbus_get_byte_timeout.txt +++ b/doc/modbus_get_byte_timeout.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_byte_timeout()_ function shall store the timeout interval +The *modbus_get_byte_timeout()* function shall store the timeout interval between two consecutive bytes of the same message in the _to_sec_ and _to_usec_ arguments. diff --git a/doc/modbus_get_float.txt b/doc/modbus_get_float.txt index ec7d9dc..8f1149b 100644 --- a/doc/modbus_get_float.txt +++ b/doc/modbus_get_float.txt @@ -14,15 +14,15 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_float()_ function shall get a float from 4 bytes in Modbus -format (ABCD order). The 'src' array must be pointer on two 16 bits values, for +The *modbus_get_float()* function shall get a float from 4 bytes in Modbus +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 ------------ -The _modbus_get_float()_ function shall return a float. +The function shall return a float. SEE ALSO diff --git a/doc/modbus_get_float_dcba.txt b/doc/modbus_get_float_dcba.txt index ff79ed8..d35083d 100644 --- a/doc/modbus_get_float_dcba.txt +++ b/doc/modbus_get_float_dcba.txt @@ -14,15 +14,15 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_float_dcba()_ function shall get a float from 4 bytes in -inversed Modbus format (DCBA order). The 'src' array must be pointer on two 16 +The *modbus_get_float_dcba()* function shall get a float from 4 bytes in +inversed 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_dcba()_ function shall return a float. +The function shall return a float. SEE ALSO diff --git a/doc/modbus_get_header_length.txt b/doc/modbus_get_header_length.txt index 77232f0..79f7cd9 100644 --- a/doc/modbus_get_header_length.txt +++ b/doc/modbus_get_header_length.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_header_length()_ function shall retrieve the current header +The *modbus_get_header_length()* function shall retrieve the current header length from the backend. This function is convenient to manipulate a message and so its limited to low-level operations. diff --git a/doc/modbus_get_response_timeout.txt b/doc/modbus_get_response_timeout.txt index b5c74d7..3355802 100644 --- a/doc/modbus_get_response_timeout.txt +++ b/doc/modbus_get_response_timeout.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_response_timeout()_ function shall return the timeout interval +The *modbus_get_response_timeout()* function shall return the timeout interval used to wait for a response in the _to_sec_ and _to_usec_ arguments. diff --git a/doc/modbus_get_socket.txt b/doc/modbus_get_socket.txt index 8ceeb9c..8645fa4 100644 --- a/doc/modbus_get_socket.txt +++ b/doc/modbus_get_socket.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_get_socket()_ function shall return the current socket or file +The *modbus_get_socket()* function shall return the current socket or file descriptor of the libmodbus context. diff --git a/doc/modbus_mapping_free.txt b/doc/modbus_mapping_free.txt index 188ed7b..0a99f62 100644 --- a/doc/modbus_mapping_free.txt +++ b/doc/modbus_mapping_free.txt @@ -14,8 +14,8 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_mapping_free()_ function shall free the four arrays of mb_mapping_t -structure and finally the mb_mapping_t referenced by 'mb_mapping'. +The function shall free the four arrays of mb_mapping_t structure and finally +the mb_mapping_t referenced by _mb_mapping_. RETURN VALUE diff --git a/doc/modbus_mapping_new.txt b/doc/modbus_mapping_new.txt index c9a31aa..49ac0eb 100644 --- a/doc/modbus_mapping_new.txt +++ b/doc/modbus_mapping_new.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_mapping_new()_ function shall allocate four arrays to store bits, +The *modbus_mapping_new()* function shall allocate four arrays to store bits, input bits, registers and inputs registers. The pointers are stored in modbus_mapping_t structure. All values of the arrays are initialized to zero. @@ -26,8 +26,8 @@ This function is convenient to handle requests in a Modbus server/slave. RETURN VALUE ------------ -The _modbus_mapping_new()_ function shall return the new allocated structure if -successful. Otherwise it shall return NULL and set errno. +The function shall return the new allocated structure if successful. Otherwise +it shall return NULL and set errno. ERRORS diff --git a/doc/modbus_mask_write_register.txt b/doc/modbus_mask_write_register.txt index 97ebb8c..7365503 100644 --- a/doc/modbus_mask_write_register.txt +++ b/doc/modbus_mask_write_register.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_mask_write_register()_ function shall modify the value of the +The *modbus_mask_write_register()* function shall modify the value of the holding register at the address 'addr' of the remote device using the algorithm: new value = (current value AND 'and') OR ('or' AND (NOT 'and')) @@ -24,8 +24,8 @@ The function uses the Modbus function code 0x16 (mask single register). RETURN VALUE ------------ -The _modbus_mask_write_register()_ function shall return 1 if successful. Otherwise -it shall return -1 and set errno. +The function shall return 1 if successful. Otherwise it shall return -1 and set +errno. SEE ALSO diff --git a/doc/modbus_new_rtu.txt b/doc/modbus_new_rtu.txt index c4e791c..8cc9cc0 100644 --- a/doc/modbus_new_rtu.txt +++ b/doc/modbus_new_rtu.txt @@ -15,13 +15,12 @@ SYNOPSIS DESCRIPTION ----------- - -The _modbus_new_rtu()_ function shall allocate and initialize a modbus_t +The *modbus_new_rtu()* function shall allocate and initialize a modbus_t structure to communicate in RTU mode on a serial line. The _device_ argument specifies the name of the serial port handled by the OS, -eg. '/dev/ttyS0' or '/dev/ttyUSB0'. On Windows, it's necessary to prepend COM -name with '\\.\' for COM number greater than 9, eg. '\\\\.\\COM10'. See +eg. "/dev/ttyS0" or "/dev/ttyUSB0". On Windows, it's necessary to prepend COM +name with "\\.\" for COM number greater than 9, eg. "\\\\.\\COM10". See http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx for details The _baud_ argument specifies the baud rate of the communication, eg. 9600, @@ -41,8 +40,8 @@ and 2. RETURN VALUE ------------ -The _modbus_new_rtu()_ function shall return a pointer to a *modbus_t* structure -if successful. Otherwise it shall return NULL and set errno to one of the values +The function shall return a pointer to a _modbus_t_ structure if +successful. Otherwise it shall return NULL and set errno to one of the values defined below. diff --git a/doc/modbus_new_tcp.txt b/doc/modbus_new_tcp.txt index b834b53..c7e54d4 100644 --- a/doc/modbus_new_tcp.txt +++ b/doc/modbus_new_tcp.txt @@ -22,15 +22,15 @@ wants etablish a connection. A NULL value can be used to listen any addresses in server mode. The _port_ argument is the TCP port to use. Set the port to -*MODBUS_TCP_DEFAULT_PORT* to use the default one (502). It’s convenient to use a +`MODBUS_TCP_DEFAULT_PORT` to use the default one (502). It’s convenient to use a port number greater than or equal to 1024 because it’s not necessary to have administrator privileges. RETURN VALUE ------------ -The *modbus_new_tcp()* function shall return a pointer to a *modbus_t* structure -if successful. Otherwise it shall return NULL and set errno to one of the values +The function shall return a pointer to a *modbus_t* structure if +successful. Otherwise it shall return NULL and set errno to one of the values defined below. diff --git a/doc/modbus_new_tcp_pi.txt b/doc/modbus_new_tcp_pi.txt index 99ed7ee..cb92ec1 100644 --- a/doc/modbus_new_tcp_pi.txt +++ b/doc/modbus_new_tcp_pi.txt @@ -29,8 +29,8 @@ necessary to have administrator privileges. RETURN VALUE ------------ -The *modbus_new_tcp_pi()* function shall return a pointer to a *modbus_t* structure -if successful. Otherwise it shall return NULL and set errno to one of the values +The function shall return a pointer to a *modbus_t* structure if +successful. Otherwise it shall return NULL and set errno to one of the values defined below. diff --git a/doc/modbus_read_bits.txt b/doc/modbus_read_bits.txt index a9ecead..1e7fd1e 100644 --- a/doc/modbus_read_bits.txt +++ b/doc/modbus_read_bits.txt @@ -14,20 +14,20 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_read_bits()_ function shall read the status of the 'nb' bits (coils) -to the address 'addr' of the remote device. The result of reading is stored in -'dest' array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_. +The *modbus_read_bits()* function shall read the status of the _nb_ bits (coils) +to the address _addr_ of the remote device. The result of reading is stored in +_dest_ array as unsigned bytes (8 bits) set to `TRUE` or `FALSE`. -You must take care to allocate enough memory to store the results in 'dest' -(at least 'nb' * sizeof(uint8_t)). +You must take care to allocate enough memory to store the results in _dest_ +(at least _nb_ * sizeof(uint8_t)). The function uses the Modbus function code 0x01 (read coil status). RETURN VALUE ------------ -The _modbus_read_bits()_ function shall return the number of read bits if -successful. Otherwise it shall return -1 and set errno. +The function shall return the number of read bits if successful. Otherwise it +shall return -1 and set errno. ERRORS diff --git a/doc/modbus_read_input_bits.txt b/doc/modbus_read_input_bits.txt index 51f53fa..d7fd3e0 100644 --- a/doc/modbus_read_input_bits.txt +++ b/doc/modbus_read_input_bits.txt @@ -14,20 +14,20 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_read_input_bits()_ function shall read the content of the 'nb' input -bits to the address 'addr' of the remote device. The result of reading is stored -in 'dest' array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_. +The *modbus_read_input_bits()* function shall read the content of the _nb_ input +bits to the address _addr_ of the remote device. The result of reading is stored +in _dest_ array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_. -You must take care to allocate enough memory to store the results in 'dest' -(at least 'nb' * sizeof(uint8_t)). +You must take care to allocate enough memory to store the results in _dest_ +(at least _nb_ * sizeof(uint8_t)). The function uses the Modbus function code 0x02 (read input status). RETURN VALUE ------------ -The _modbus_read_input_status()_ function shall return the number of read -input status if successful. Otherwise it shall return -1 and set errno. +The function shall return the number of read input status if +successful. Otherwise it shall return -1 and set errno. ERRORS diff --git a/doc/modbus_read_input_registers.txt b/doc/modbus_read_input_registers.txt index 253b767..20a5376 100644 --- a/doc/modbus_read_input_registers.txt +++ b/doc/modbus_read_input_registers.txt @@ -14,12 +14,12 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_read_input_registers()_ function shall read the content of the 'nb' -input registers to address 'addr' of the remote device. The result of the -reading is stored in 'dest' array as word values (16 bits). +The *modbus_read_input_registers()* function shall read the content of the _nb_ +input registers to address _addr_ of the remote device. The result of the +reading is stored in _dest_ array as word values (16 bits). -You must take care to allocate enough memory to store the results in 'dest' (at -least 'nb' * sizeof(uint16_t)). +You must take care to allocate enough memory to store the results in _dest_ (at +least _nb_ * sizeof(uint16_t)). The function uses the Modbus function code 0x04 (read input registers). The holding registers and input registers have different historical meaning, but @@ -28,8 +28,8 @@ nowadays it's more common to use holding registers only. RETURN VALUE ------------ -The _modbus_read_input_registers()_ function shall return the number of read -input registers if successful. Otherwise it shall return -1 and set errno. +The function shall return the number of read input registers if +successful. Otherwise it shall return -1 and set errno. ERRORS diff --git a/doc/modbus_read_registers.txt b/doc/modbus_read_registers.txt index 2f6378d..dd29fdc 100644 --- a/doc/modbus_read_registers.txt +++ b/doc/modbus_read_registers.txt @@ -14,19 +14,19 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_read_registers()_ function shall read the content of the 'nb' -holding registers to the address 'addr' of the remote device. The result of -reading is stored in 'dest' array as word values (16 bits). +The *modbus_read_registers()* function shall read the content of the _nb_ +holding registers to the address _addr_ of the remote device. The result of +reading is stored in _dest_ array as word values (16 bits). -You must take care to allocate enough memory to store the results in 'dest' -(at least 'nb' * sizeof(uint16_t)). +You must take care to allocate enough memory to store the results in _dest_ +(at least _nb_ * sizeof(uint16_t)). The function uses the Modbus function code 0x03 (read holding registers). RETURN VALUE ------------ -The _modbus_read_registers()_ function shall return the number of read registers +The function shall return the number of read registers if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_receive.txt b/doc/modbus_receive.txt index a9a1a7f..f6f1995 100644 --- a/doc/modbus_receive.txt +++ b/doc/modbus_receive.txt @@ -14,20 +14,20 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_receive()_ function shall receive an indication request from the -socket of the context 'ctx'. This function is used by Modbus slave/server to +The *modbus_receive()* function shall receive an indication request from the +socket of the context _ctx_. This function is used by Modbus slave/server to receive and analyze indication request sent by the masters/clients. If you need to use another socket or file descriptor than the one defined in the -context 'ctx', see the function linkmb:modbus_set_socket[3]. +context _ctx_, see the function linkmb:modbus_set_socket[3]. RETURN VALUE ------------ -The _modbus_receive()_ function shall store the indication request in 'req' and -return the request length if sucessful. The returned request length can be zero -if the indication request is ignored (eg. a query for another slave in RTU -mode). Otherwise it shall return -1 and set errno. +The function shall store the indication request in _req_ and return the request +length if sucessful. The returned request length can be zero if the indication +request is ignored (eg. a query for another slave in RTU mode). Otherwise it +shall return -1 and set errno. SEE ALSO diff --git a/doc/modbus_receive_confirmation.txt b/doc/modbus_receive_confirmation.txt index 578b54f..2e7ee60 100644 --- a/doc/modbus_receive_confirmation.txt +++ b/doc/modbus_receive_confirmation.txt @@ -14,18 +14,18 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_receive_confirmation()_ function shall receive a request via the -socket of the context 'ctx'. This function must be used for debugging purposes +The *modbus_receive_confirmation(*_ function shall receive a request via the +socket of the context _ctx_. This function must be used for debugging purposes because the received response isn't checked against the initial request. This function can be used to receive request not handled by the library. RETURN VALUE ------------ -The _modbus_receive_confirmation()_ function shall store the confirmation -request in 'rsp' and return the response length if sucessful. The returned -request length can be zero if the indication request is ignored (eg. a query for -another slave in RTU mode). Otherwise it shall return -1 and set errno. +The function shall store the confirmation request in _rsp_ and return the +response length if sucessful. The returned request length can be zero if the +indication request is ignored (eg. a query for another slave in RTU +mode). Otherwise it shall return -1 and set errno. SEE ALSO diff --git a/doc/modbus_receive_from.txt b/doc/modbus_receive_from.txt index 4f5ffab..eb0aecf 100644 --- a/doc/modbus_receive_from.txt +++ b/doc/modbus_receive_from.txt @@ -14,15 +14,15 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_receive_from()_ function shall receive an indication request from -the socket/file descriptor given in argument 'sockfd. This function is used by +The *modbus_receive_from()* function shall receive an indication request from +the socket/file descriptor given in argument _sockfd_. This function is used by Modbus slave/server to receive and analyze indication request sent by the masters/clients. RETURN VALUE ------------ -The _modbus_receive_from()_ function shall store the indication request in 'req' +The function shall store the indication request in _req_ and return the request length if sucessful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_reply.txt b/doc/modbus_reply.txt index 93503e4..0b29d6f 100644 --- a/doc/modbus_reply.txt +++ b/doc/modbus_reply.txt @@ -13,12 +13,12 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_reply()_ function shall send a response to received request. The -request 'req' given in argument is analyzed, a response is then built and sent -by using the information of the modbus context 'ctx'. +The *modbus_reply()* function shall send a response to received request. The +request _req_ given in argument is analyzed, a response is then built and sent +by using the information of the modbus context _ctx_. If the request indicates to read or write a value the operation will done in the -modbus mapping 'mb_mapping' according to the type of the manipulated data. +modbus mapping _mb_mapping_ according to the type of the manipulated data. If an error occurs, an exception response will be sent. @@ -27,7 +27,7 @@ This function is designed for Modbus server. RETURN VALUE ------------ -The _modbus_reply()_ function shall return the length of the response sent if +The function shall return the length of the response sent if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_reply_exception.txt b/doc/modbus_reply_exception.txt index 9f9f261..7e6324f 100644 --- a/doc/modbus_reply_exception.txt +++ b/doc/modbus_reply_exception.txt @@ -13,7 +13,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_reply_exception()_ function shall send an exception response based +The *modbus_reply_exception()* function shall send an exception response based on the 'exception_code' in argument. The libmodbus provides the following exception codes: @@ -30,12 +30,12 @@ The libmodbus provides the following exception codes: * MODBUS_EXCEPTION_GATEWAY_PATH (10) * MODBUS_EXCEPTION_GATEWAY_TARGET (11) -The initial request 'req' is required to build a valid response. +The initial request _req_ is required to build a valid response. RETURN VALUE ------------ -The _modbus_reply_exception()_ function shall return the length of the response sent if +The function shall return the length of the response sent if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_report_slave_id.txt b/doc/modbus_report_slave_id.txt index f2a9d62..e727177 100644 --- a/doc/modbus_report_slave_id.txt +++ b/doc/modbus_report_slave_id.txt @@ -14,10 +14,10 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_report_slave_id()_ function shall send a request to the controller +The *modbus_report_slave_id()* function shall send a request to the controller to obtain a description of the controller. -The response stored in 'dest' contains: +The response stored in _dest_ contains: * the slave ID, this unique ID is in reality not unique at all so it's not possible to depend on it to know how the information are packed in the @@ -26,16 +26,15 @@ The response stored in 'dest' contains: * additional data specific to each controller. For example, libmodbus returns the version of the library as a string. -The function write at most 'max_dest' bytes from the response to 'dest'. +The function write at most _max_dest_ bytes from the response to _dest_. RETURN VALUE ------------ -The _modbus_report_slave_id()_ function shall return the number of read data if -successful. +The function shall return the number of read data if successful. -If the output was truncated due to the 'max_dest' limit then the return value is -the number of bytes which would have been written to 'dest' if enough space had -been available. Thus, a return value greater than 'max_dest' means that the +If the output was truncated due to the _max_dest_ limit then the return value is +the number of bytes which would have been written to _dest_ if enough space had +been available. Thus, a return value greater than _max_dest_ means that the response data was truncated. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_rtu_get_rts.txt b/doc/modbus_rtu_get_rts.txt index cb87050..559c80b 100644 --- a/doc/modbus_rtu_get_rts.txt +++ b/doc/modbus_rtu_get_rts.txt @@ -14,9 +14,8 @@ SYNOPSIS DESCRIPTION ----------- - -The _modbus_rtu_get_rts()_ function shall get the current Request To Send mode -of the libmodbus context 'ctx'. The possible returned values are: +The *modbus_rtu_get_rts()* function shall get the current Request To Send mode +of the libmodbus context _ctx_. The possible returned values are: * MODBUS_RTU_RTS_NONE * MODBUS_RTU_RTS_UP @@ -27,8 +26,8 @@ This function can only be used with a context using a RTU backend. RETURN VALUE ------------ -The _modbus_rtu_get_rts()_ function shall return the current RTS mode if -successful. Otherwise it shall return -1 and set errno. +The function shall return the current RTS mode if successful. Otherwise it shall +return -1 and set errno. ERRORS diff --git a/doc/modbus_rtu_get_serial_mode.txt b/doc/modbus_rtu_get_serial_mode.txt index 5ee3bb0..b580728 100644 --- a/doc/modbus_rtu_get_serial_mode.txt +++ b/doc/modbus_rtu_get_serial_mode.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_rtu_get_serial_mode()_ function shall return the serial mode +The *modbus_rtu_get_serial_mode()* function shall return the serial mode currently used by the libmodbus context: *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232 @@ -36,9 +36,9 @@ used with a context using a RTU backend. RETURN VALUE ------------ -The _modbus_rtu_get_serial_mode()_ function shall return 'MODBUS_RTU_RS232' or -'MODBUS_RTU_RS485' if successful. Otherwise it shall return -1 and set errno to -one of the values defined below. +The function shall return `MODBUS_RTU_RS232` or `MODBUS_RTU_RS485` if +successful. Otherwise it shall return -1 and set errno to one of the values +defined below. ERRORS diff --git a/doc/modbus_rtu_set_rts.txt b/doc/modbus_rtu_set_rts.txt index 51da488..eabb25b 100644 --- a/doc/modbus_rtu_set_rts.txt +++ b/doc/modbus_rtu_set_rts.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_rtu_set_rts()_ function shall set the Request To Send mode to +The *modbus_rtu_set_rts()* function shall set the Request To Send mode to communicate on a RS485 serial bus. By default, the mode is set to -MODBUS_RTU_RTS_NONE and no signal is issued before writing data on the wire. +`MODBUS_RTU_RTS_NONE` and no signal is issued before writing data on the wire. -To enable the RTS mode, the values MODBUS_RTU_RTS_UP or MODBUS_RTU_RTS_DOWN must +To enable the RTS mode, the values `MODBUS_RTU_RTS_UP` or `MODBUS_RTU_RTS_DOWN` must be used, these modes enable the RTS mode and set the polarity at the same -time. When MODBUS_RTU_RTS_UP is used, an ioctl call is made with RTS flag +time. When `MODBUS_RTU_RTS_UP` is used, an ioctl call is made with RTS flag enabled then data is written on the bus after a delay of 1ms, then another ioctl call is made with the RTS flag disabled and again a delay of 1ms occurs. -The MODBUS_RTU_RTS_DOWN mode applies the same procedure but with an inversed +The `MODBUS_RTU_RTS_DOWN` mode applies the same procedure but with an inversed RTS flag. This function can only be used with a context using a RTU backend. @@ -31,8 +31,8 @@ This function can only be used with a context using a RTU backend. RETURN VALUE ------------ -The _modbus_rtu_set_rts()_ function shall return 0 if successful. Otherwise it -shall return -1 and set errno to one of the values defined below. +The function shall return 0 if successful. Otherwise it shall return -1 and set +errno to one of the values defined below. ERRORS diff --git a/doc/modbus_rtu_set_serial_mode.txt b/doc/modbus_rtu_set_serial_mode.txt index b1f8aab..7086dc4 100644 --- a/doc/modbus_rtu_set_serial_mode.txt +++ b/doc/modbus_rtu_set_serial_mode.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_rtu_set_serial_mode()_ function shall set the selected serial +The *modbus_rtu_set_serial_mode()* function shall set the selected serial mode: *MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232 @@ -35,8 +35,8 @@ This function is only supported on Linux kernels 2.6.28 onwards. RETURN VALUE ------------ -The _modbus_set_serial_mode()_ function shall return 0 if successful. Otherwise -it shall return -1 and set errno to one of the values defined below. +The function shall return 0 if successful. Otherwise it shall return -1 and set +errno to one of the values defined below. ERRORS diff --git a/doc/modbus_send_raw_request.txt b/doc/modbus_send_raw_request.txt index 0485533..344ff1d 100644 --- a/doc/modbus_send_raw_request.txt +++ b/doc/modbus_send_raw_request.txt @@ -9,28 +9,28 @@ modbus_send_raw_request - send a raw request SYNOPSIS -------- -*int modbus_send_raw_request(modbus_t *'ctx', uint8_t *'raw_req, int 'raw_req_length');* +*int modbus_send_raw_request(modbus_t *'ctx', uint8_t *'raw_req', int 'raw_req_length');* DESCRIPTION ----------- -The _modbus_send_raw_request()_ function shall send a request via the socket of -the context 'ctx'. This function must be used for debugging purposes because you +The *modbus_send_raw_request()* function shall send a request via the socket of +the context _ctx_. This function must be used for debugging purposes because you have to take care to make a valid request by hand. The function only adds to the -message, the header or CRC of the selected backend, so 'raw_req' must start and +message, the header or CRC of the selected backend, so _raw_req_ must start and contain at least a slave/unit identifier and a function code. This function can be used to send request not handled by the library. The public header of libmodbus provides a list of supported Modbus functions -codes, prefixed by `MODBUS_FC_` (eg. MODBUS_FC_READ_HOLDING_REGISTERS), to help +codes, prefixed by `MODBUS_FC_` (eg. `MODBUS_FC_READ_HOLDING_REGISTERS`), to help build of raw requests. RETURN VALUE ------------ -The _modbus_send_raw_request()_ function shall return the full message length, -counting the extra data relating to the backend, if successful. Otherwise it -shall return -1 and set errno. +The function shall return the full message length, counting the extra data +relating to the backend, if successful. Otherwise it shall return -1 and set +errno. EXAMPLE diff --git a/doc/modbus_set_bits_from_byte.txt b/doc/modbus_set_bits_from_byte.txt index f77b9ee..72b2949 100644 --- a/doc/modbus_set_bits_from_byte.txt +++ b/doc/modbus_set_bits_from_byte.txt @@ -14,9 +14,9 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_bits_from_byte_ function shall set many bits from a single byte. -All 8 bits from the byte 'value' will be written to 'dest' array starting at -'index' position. +The *modbus_set_bits_from_byte()* function shall set many bits from a single byte. +All 8 bits from the byte _value_ will be written to _dest_ array starting at +_index_ position. RETURN VALUE diff --git a/doc/modbus_set_bits_from_bytes.txt b/doc/modbus_set_bits_from_bytes.txt index f2a1416..cfbb8ed 100644 --- a/doc/modbus_set_bits_from_bytes.txt +++ b/doc/modbus_set_bits_from_bytes.txt @@ -14,9 +14,9 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_bits_from_bytes_ function shall set bits by reading an array of +The *modbus_set_bits_from_bytes* function shall set bits by reading an array of bytes. All the bits of the bytes read from the first position of the array -'tab_byte' are written as bits in the 'dest' array starting at position 'index'. +_tab_byte_ are written as bits in the _dest_ array starting at position _index_. RETURN VALUE diff --git a/doc/modbus_set_byte_timeout.txt b/doc/modbus_set_byte_timeout.txt index 9df3588..84e73ae 100644 --- a/doc/modbus_set_byte_timeout.txt +++ b/doc/modbus_set_byte_timeout.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_byte_timeout()_ function shall set the timeout interval between +The *modbus_set_byte_timeout()* function shall set the timeout interval between two consecutive bytes of the same message. The timeout is an upper bound on the -amount of time elapsed before _select()_ returns, if the time elapsed is longer -than the defined timeout, an 'ETIMEDOUT' error will be raised by the +amount of time elapsed before *select()* returns, if the time elapsed is longer +than the defined timeout, an `ETIMEDOUT` error will be raised by the function waiting for a response. The value of _to_usec_ argument must be in the range 0 to 999999. If both _to_sec_ and _to_usec_ are zero, this timeout will not be used at all. -In this case, _modbus_set_response_timeout()_ governs the entire handling of the +In this case, *modbus_set_response_timeout()* governs the entire handling of the response, the full confirmation response must be received before expiration of the response timeout. When a byte timeout is set, the response timeout is only used to wait for until the first byte of the response. diff --git a/doc/modbus_set_debug.txt b/doc/modbus_set_debug.txt index 7621e03..3154c21 100644 --- a/doc/modbus_set_debug.txt +++ b/doc/modbus_set_debug.txt @@ -13,9 +13,9 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_debug()_ function shall set the debug flag of the *modbus_t* -context by using the argument 'flag'. By default, the boolean flag is set to -'FALSE'. When the 'flag' value is set to 'TRUE', many verbose messages are +The *modbus_set_debug()* function shall set the debug flag of the *modbus_t* +context by using the argument _flag_. By default, the boolean flag is set to +`FALSE`. When the _flag_ value is set to `TRUE`, many verbose messages are displayed on stdout and stderr. For example, this flag is useful to display the bytes of the Modbus messages. diff --git a/doc/modbus_set_error_recovery.txt b/doc/modbus_set_error_recovery.txt index f157442..38b69dd 100644 --- a/doc/modbus_set_error_recovery.txt +++ b/doc/modbus_set_error_recovery.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_error_recovery()_ function shall set the error recovery mode to +The *modbus_set_error_recovery()* function shall set the error recovery mode to apply when the connection fails or the byte received is not expected. The -argument 'error_recovery' may be bitwise-or'ed with zero or more of the +argument _error_recovery_ may be bitwise-or'ed with zero or more of the following constants. -By default there is no error recovery ('MODBUS_ERROR_RECOVERY_NONE') so the +By default there is no error recovery (`MODBUS_ERROR_RECOVERY_NONE`) so the application is responsible for controlling the error values returned by libmodbus functions and for handling them if necessary. -When 'MODBUS_ERROR_RECOVERY_LINK' is set, the library will attempt an +When `MODBUS_ERROR_RECOVERY_LINK` is set, the library will attempt an reconnection after a delay defined by response timeout of the libmodbus context. This mode will try a infinite close/connect loop until success on send call and will just try one time to retablish the connection on select/read calls (if the @@ -33,7 +33,7 @@ after a delay based on the current response timeout in some situations (eg. timeout of select call). The reconnection attempt can hang for several seconds if the network to the remote target unit is down. -When 'MODBUS_ERROR_RECOVERY_PROTOCOL' is set, a sleep and flush sequence will be +When `MODBUS_ERROR_RECOVERY_PROTOCOL` is set, a sleep and flush sequence will be used to cleanup the ongoing communication, this can occurs when the message length is invalid, the TID is wrong or the received function code is not the expected one. The response timeout delay will be used to sleep. @@ -45,15 +45,14 @@ It's not recommended to enable error recovery for slave/server. RETURN VALUE ------------ -The _modbus_set_error_recovery()_ function shall return 0 if -successful. Otherwise it shall return -1 and set errno to one of the values -defined below. +The function shall return 0 if successful. Otherwise it shall return -1 and set +errno to one of the values defined below. ERRORS ------ *EINVAL*:: -The value of the argument 'error_recovery' is not positive. +The value of the argument _error_recovery_ is not positive. EXAMPLE diff --git a/doc/modbus_set_float.txt b/doc/modbus_set_float.txt index 339cb95..073470b 100644 --- a/doc/modbus_set_float.txt +++ b/doc/modbus_set_float.txt @@ -14,14 +14,14 @@ SYNOPSIS DESCRIPTION ----------- -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 +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. RETURN VALUE ------------ -The is no return values. +There is no return values. SEE ALSO diff --git a/doc/modbus_set_float_dcba.txt b/doc/modbus_set_float_dcba.txt index c12664a..69ad589 100644 --- a/doc/modbus_set_float_dcba.txt +++ b/doc/modbus_set_float_dcba.txt @@ -14,14 +14,14 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_float_dcba()_ function shall set a float to 4 bytes in inversed -Modbus format (DCBA order). The 'dest' array must be pointer on two 16 bits +The *modbus_set_float_dcba()* function shall set a float to 4 bytes in inversed +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. +There is no return values. SEE ALSO diff --git a/doc/modbus_set_response_timeout.txt b/doc/modbus_set_response_timeout.txt index a4e3424..47caf61 100644 --- a/doc/modbus_set_response_timeout.txt +++ b/doc/modbus_set_response_timeout.txt @@ -14,15 +14,14 @@ SYNOPSIS DESCRIPTION ----------- - -The _modbus_set_response_timeout()_ function shall set the timeout interval used +The *modbus_set_response_timeout()* function shall set the timeout interval used to wait for a response. When a byte timeout is set, if elapsed time for the -first byte of response is longer than the given timeout, an 'ETIMEDOUT' error +first byte of response is longer than the given timeout, an `ETIMEDOUT` error will be raised by the function waiting for a response. When byte timeout is disabled, the full confirmation response must be received before expiration of the response timeout. -The value of to_usec argument must be in the range 0 to 999999. +The value of _to_usec_ argument must be in the range 0 to 999999. RETURN VALUE diff --git a/doc/modbus_set_slave.txt b/doc/modbus_set_slave.txt index 707c34f..7a7ff49 100644 --- a/doc/modbus_set_slave.txt +++ b/doc/modbus_set_slave.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_slave()_ function shall set the slave number in the libmodbus +The *modbus_set_slave()* function shall set the slave number in the libmodbus context. The behavior depends of network and the role of the device: @@ -26,17 +26,17 @@ only accept message holing its slave number or the special broadcast number. *TCP*:: The slave number is only required in TCP if the message must reach a device -on a serial network. The special value 'MODBUS_TCP_SLAVE' (0xFF) can be used in TCP mode to restore +on a serial network. The special value `MODBUS_TCP_SLAVE` (0xFF) can be used in TCP mode to restore the default value. -The broadcast address is 'MODBUS_BROADCAST_ADDRESS'. This special value must be +The broadcast address is `MODBUS_BROADCAST_ADDRESS`. This special value must be use when you want all Modbus devices of the network receive the request. RETURN VALUE ------------ -The _modbus_set_slave()_ function shall return 0 if successful. Otherwise it -shall return -1 and set errno to one of the values defined below. +The function shall return 0 if successful. Otherwise it shall return -1 and set +errno to one of the values defined below. ERRORS diff --git a/doc/modbus_set_socket.txt b/doc/modbus_set_socket.txt index 60316bf..49e5d1f 100644 --- a/doc/modbus_set_socket.txt +++ b/doc/modbus_set_socket.txt @@ -14,7 +14,7 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_set_socket()_ function shall set the socket or file descriptor in +The *modbus_set_socket()* function shall set the socket or file descriptor in the libmodbus context. This function is useful for managing multiple client connections to the same server. diff --git a/doc/modbus_strerror.txt b/doc/modbus_strerror.txt index b691acf..9cc355f 100644 --- a/doc/modbus_strerror.txt +++ b/doc/modbus_strerror.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_strerror()_ function shall return a pointer to an error message -string corresponding to the error number specified by the 'errnum' argument. As +The *modbus_strerror()* function shall return a pointer to an error message +string corresponding to the error number specified by the _errnum_ argument. As libmodbus defines additional error numbers over and above those defined by the -operating system, applications should use _modbus_strerror()_ in preference to -the standard _strerror()_ function. +operating system, applications should use *modbus_strerror()* in preference to +the standard *strerror()* function. RETURN VALUE ------------ -The _modbus_strerror()_ function shall return a pointer to an error message +The *modbus_strerror()* function shall return a pointer to an error message string. diff --git a/doc/modbus_tcp_accept.txt b/doc/modbus_tcp_accept.txt index e8acf89..4c46d90 100644 --- a/doc/modbus_tcp_accept.txt +++ b/doc/modbus_tcp_accept.txt @@ -14,15 +14,15 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_tcp_accept()_ function shall extract the first connection on the +The *modbus_tcp_accept()* function shall extract the first connection on the queue of pending connections, create a new socket and store it in libmodbus -context given in argument. If available, _accept4()_ with *SOCK_CLOEXEC* will be -called instead of _accept()_. +context given in argument. If available, _accept4()_ with `SOCK_CLOEXEC` will be +called instead of *accept()*. RETURN VALUE ------------ -The _modbus_tcp_accept()_ function shall return a new socket if successful. +The function shall return a new socket if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_tcp_listen.txt b/doc/modbus_tcp_listen.txt index df6496d..a3dc404 100644 --- a/doc/modbus_tcp_listen.txt +++ b/doc/modbus_tcp_listen.txt @@ -17,14 +17,14 @@ DESCRIPTION The *modbus_tcp_listen()* function shall create a socket and listen to maximum _nb_connection_ incoming connections on the specified IP address. The context _ctx _must be allocated and initialized with linkmb:modbus_new_tcp[3] before to -set the IP address to listen, if IP address is o NULL, any addresses will be +set the IP address to listen, if IP address is set to NULL, any addresses will be listen. RETURN VALUE ------------ -The *modbus_tcp_listen()* function shall return a new socket if -successful. Otherwise it shall return -1 and set errno. +The function shall return a new socket if successful. Otherwise it shall return +-1 and set errno. EXAMPLE diff --git a/doc/modbus_tcp_pi_accept.txt b/doc/modbus_tcp_pi_accept.txt index 7ec7602..a84dc43 100644 --- a/doc/modbus_tcp_pi_accept.txt +++ b/doc/modbus_tcp_pi_accept.txt @@ -14,16 +14,15 @@ SYNOPSIS DESCRIPTION ----------- - -The _modbus_tcp_pi_accept()_ function shall extract the first connection on the +The *modbus_tcp_pi_accept()* function shall extract the first connection on the queue of pending connections, create a new socket and store it in libmodbus -context given in argument. If available, _accept4()_ with *SOCK_CLOEXEC* will be -called instead of _accept()_. +context given in argument. If available, _accept4()_ with `SOCK_CLOEXEC` will be +called instead of *accept()*. RETURN VALUE ------------ -The _modbus_tcp_pi_accept()_ function shall return a new socket if successful. +The function shall return a new socket if successful. Otherwise it shall return -1 and set errno. diff --git a/doc/modbus_tcp_pi_listen.txt b/doc/modbus_tcp_pi_listen.txt index 07dab67..2c29c9d 100644 --- a/doc/modbus_tcp_pi_listen.txt +++ b/doc/modbus_tcp_pi_listen.txt @@ -23,8 +23,8 @@ listen. RETURN VALUE ------------ -The *modbus_tcp_listen()* function shall return a new socket if -successful. Otherwise it shall return -1 and set errno. +The function shall return a new socket if successful. Otherwise it shall return +-1 and set errno. EXAMPLE diff --git a/doc/modbus_write_and_read_registers.txt b/doc/modbus_write_and_read_registers.txt index 91fd14c..e9b14bd 100644 --- a/doc/modbus_write_and_read_registers.txt +++ b/doc/modbus_write_and_read_registers.txt @@ -14,22 +14,22 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_write_and_read_registers()_ function shall write the content of the -'write_nb' holding registers from the array 'src' to the address 'write_addr' of -the remote device then shall read the content of the 'read_nb' holding registers -to the address 'read_addr' of the remote device. The result of reading is stored -in 'dest' array as word values (16 bits). +The *modbus_write_and_read_registers()* function shall write the content of the +_write_nb_ holding registers from the array 'src' to the address _write_addr_ of +the remote device then shall read the content of the _read_nb_ holding registers +to the address _read_addr_ of the remote device. The result of reading is stored +in _dest_ array as word values (16 bits). -You must take care to allocate enough memory to store the results in 'dest' -(at least 'nb' * sizeof(uint16_t)). +You must take care to allocate enough memory to store the results in _dest_ +(at least _nb_ * sizeof(uint16_t)). The function uses the Modbus function code 0x17 (write/read registers). RETURN VALUE ------------ -The _modbus_write_and_read_registers()_ function shall return the number of read -registers if successful. Otherwise it shall return -1 and set errno. +The function shall return the number of read registers if successful. Otherwise +it shall return -1 and set errno. ERRORS diff --git a/doc/modbus_write_bit.txt b/doc/modbus_write_bit.txt index b435fca..3b4df9e 100644 --- a/doc/modbus_write_bit.txt +++ b/doc/modbus_write_bit.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_write_bit()_ function shall write the status of 'status' at the -address 'addr' of the remote device. The value must be set to _TRUE_ or _FALSE_. +The *modbus_write_bit()* function shall write the status of _status_ at the +address _addr_ of the remote device. The value must be set to `TRUE` or `FALSE`. The function uses the Modbus function code 0x05 (force single coil). RETURN VALUE ------------ -The _modbus_write_bit()_ function shall return 1 if successful. Otherwise it -shall return -1 and set errno. +The function shall return 1 if successful. Otherwise it shall return -1 and set +errno. SEE ALSO diff --git a/doc/modbus_write_bits.txt b/doc/modbus_write_bits.txt index 071a0b0..7f1af84 100644 --- a/doc/modbus_write_bits.txt +++ b/doc/modbus_write_bits.txt @@ -14,17 +14,17 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_write_bits()_ function shall write the status of the 'nb' bits -(coils) from 'src' at the address 'addr' of the remote device. The -'src' array must contains bytes set to _TRUE_ or _FALSE_. +The *modbus_write_bits()* function shall write the status of the _nb_ bits +(coils) from _src_ at the address _addr_ of the remote device. The +_src_ array must contains bytes set to `TRUE` or `FALSE`. The function uses the Modbus function code 0x0F (force multiple coils). RETURN VALUE ------------ -The _modbus_write_bits()_ function shall return the number of written bits if -successful. Otherwise it shall return -1 and set errno. +The function shall return the number of written bits if successful. Otherwise it +shall return -1 and set errno. ERRORS diff --git a/doc/modbus_write_register.txt b/doc/modbus_write_register.txt index 6b334b1..d2fab0f 100644 --- a/doc/modbus_write_register.txt +++ b/doc/modbus_write_register.txt @@ -14,16 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_write_register()_ function shall write the value of 'value' -holding registers at the address 'addr' of the remote device. +The *modbus_write_register()* function shall write the value of _value_ +holding registers at the address _addr_ of the remote device. The function uses the Modbus function code 0x06 (preset single register). RETURN VALUE ------------ -The _modbus_write_register()_ function shall return 1 if successful. Otherwise -it shall return -1 and set errno. +The function shall return 1 if successful. Otherwise it shall return -1 and set +errno. SEE ALSO diff --git a/doc/modbus_write_registers.txt b/doc/modbus_write_registers.txt index fb46bca..a5654fb 100644 --- a/doc/modbus_write_registers.txt +++ b/doc/modbus_write_registers.txt @@ -14,17 +14,16 @@ SYNOPSIS DESCRIPTION ----------- -The _modbus_write_registers()_ function shall write the content of the 'nb' -holding registers from the array 'src' at address 'addr' of the -remote device. +The *modbus_write_registers()* function shall write the content of the _nb_ +holding registers from the array _src_ at address _addr_ of the remote device. The function uses the Modbus function code 0x10 (preset multiple registers). RETURN VALUE ------------ -The _modbus_write_registers()_ function shall return the number of written -registers if successful. Otherwise it shall return -1 and set errno. +The function shall return the number of written registers if +successful. Otherwise it shall return -1 and set errno. SEE ALSO