diff --git a/doc/Makefile.am b/doc/Makefile.am index 82ef6ec..778d9e1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,10 +3,10 @@ MAN3 = \ modbus_connect.3 \ modbus_flush.3 \ modbus_free.3 \ + modbus_get_byte_timeout.3 \ modbus_get_header_length.3 \ modbus_get_socket.3 \ modbus_get_response_timeout.3 \ - modbus_get_byte_timeout.3 \ modbus_new_rtu.3 \ modbus_new_tcp_pi.3 \ modbus_new_tcp.3 \ @@ -16,13 +16,15 @@ MAN3 = \ modbus_read_registers.3 \ modbus_receive.3 \ modbus_receive_confirmation.3 \ + modbus_rtu_get_serial_mode.3 \ + modbus_rtu_set_serial_mode.3 \ modbus_send_raw_request.3 \ + modbus_set_byte_timeout.3 \ modbus_set_debug.3 \ modbus_set_error_recovery.3 \ modbus_set_slave.3 \ modbus_set_socket.3 \ modbus_set_response_timeout.3 \ - modbus_set_byte_timeout.3 \ modbus_strerror.3 \ modbus_write_bits.3 \ modbus_write_bit.3 \ diff --git a/doc/libmodbus.txt b/doc/libmodbus.txt index 1375f38..633deea 100644 --- a/doc/libmodbus.txt +++ b/doc/libmodbus.txt @@ -66,6 +66,12 @@ is used to filter messages. Create a Modbus RTU context:: linkmb:modbus_new_rtu[3] + +Set the serial mode:: + linkmb:modbus_rtu_get_serial_mode[3] + linkmb:modbus_rtu_set_serial_mode[3] + + TCP (IPv4) Context ^^^^^^^^^^^^^^^^^^ The TCP backend implements a Modbus variant used for communications over diff --git a/doc/modbus_rtu_get_serial_mode.txt b/doc/modbus_rtu_get_serial_mode.txt new file mode 100644 index 0000000..58162e4 --- /dev/null +++ b/doc/modbus_rtu_get_serial_mode.txt @@ -0,0 +1,52 @@ +modbus_rtu_get_serial_mode(3) +============================= + + +NAME +---- +modbus_rtu_get_serial_mode - get the current serial mode + + +SYNOPSIS +-------- +*int modbus_rtu_get_serial_mode(*modbus_t 'ctx');* + + +DESCRIPTION +----------- +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 + (Recommended Standard 232) is the traditional name for a series of standards + for serial binary single-ended data and control signals connecting between a + DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating + Equipment). It is commonly used in computer serial ports + +*MODBUS_RTU_RS485*:: the serial line is set for RS485 communication. EIA-485, + also known as TIA/EIA-485 or RS-485, is a standard defining the electrical + characteristics of drivers and receivers for use in balanced digital multipoint + systems. This standard is widely used for communications in industrial + automation because it can be used effectively over long distances and in + electrically noisy environments. + +This function is only available on recent Linux kernels. + + +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. + + +ERRORS +------ +*EINVAL*:: +The current libmodbus backend is not RTU. + + +AUTHORS +------- +The libmodbus documentation was written by Stéphane Raimbault + diff --git a/doc/modbus_rtu_set_serial_mode.txt b/doc/modbus_rtu_set_serial_mode.txt new file mode 100644 index 0000000..077982a --- /dev/null +++ b/doc/modbus_rtu_set_serial_mode.txt @@ -0,0 +1,53 @@ +modbus_rtu_set_serial_mode(3) +============================= + + +NAME +---- +modbus_rtu_set_serial_mode - set the serial mode + + +SYNOPSIS +-------- +*int modbus_rtu_set_serial_mode(*modbus_t 'ctx');* + + +DESCRIPTION +----------- +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 + (Recommended Standard 232) is the traditional name for a series of standards + for serial binary single-ended data and control signals connecting between a + DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating + Equipment). It is commonly used in computer serial ports + +*MODBUS_RTU_RS485*:: the serial line is set for RS485 communication. EIA-485, + also known as TIA/EIA-485 or RS-485, is a standard defining the electrical + characteristics of drivers and receivers for use in balanced digital multipoint + systems. This standard is widely used for communications in industrial + automation because it can be used effectively over long distances and in + electrically noisy environments. + +This function is only available on recent Linux kernels. + + +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. + + +ERRORS +------ +*EINVAL*:: +The current libmodbus backend is not RTU. + +If the call to ioctl() fails, the error code of ioctl will be returned. + + +AUTHORS +------- +The libmodbus documentation was written by Stéphane Raimbault +