Commit 11e099651c0b08ae5535b1b7f87d5d4970f97dc5

Authored by Stéphane Raimbault
1 parent 9bf83095

Documentation of modbus_rtu_set/get_serial_mode functions

doc/Makefile.am
... ... @@ -3,10 +3,10 @@ MAN3 = \
3 3 modbus_connect.3 \
4 4 modbus_flush.3 \
5 5 modbus_free.3 \
  6 + modbus_get_byte_timeout.3 \
6 7 modbus_get_header_length.3 \
7 8 modbus_get_socket.3 \
8 9 modbus_get_response_timeout.3 \
9   - modbus_get_byte_timeout.3 \
10 10 modbus_new_rtu.3 \
11 11 modbus_new_tcp_pi.3 \
12 12 modbus_new_tcp.3 \
... ... @@ -16,13 +16,15 @@ MAN3 = \
16 16 modbus_read_registers.3 \
17 17 modbus_receive.3 \
18 18 modbus_receive_confirmation.3 \
  19 + modbus_rtu_get_serial_mode.3 \
  20 + modbus_rtu_set_serial_mode.3 \
19 21 modbus_send_raw_request.3 \
  22 + modbus_set_byte_timeout.3 \
20 23 modbus_set_debug.3 \
21 24 modbus_set_error_recovery.3 \
22 25 modbus_set_slave.3 \
23 26 modbus_set_socket.3 \
24 27 modbus_set_response_timeout.3 \
25   - modbus_set_byte_timeout.3 \
26 28 modbus_strerror.3 \
27 29 modbus_write_bits.3 \
28 30 modbus_write_bit.3 \
... ...
doc/libmodbus.txt
... ... @@ -66,6 +66,12 @@ is used to filter messages.
66 66 Create a Modbus RTU context::
67 67 linkmb:modbus_new_rtu[3]
68 68  
  69 +
  70 +Set the serial mode::
  71 + linkmb:modbus_rtu_get_serial_mode[3]
  72 + linkmb:modbus_rtu_set_serial_mode[3]
  73 +
  74 +
69 75 TCP (IPv4) Context
70 76 ^^^^^^^^^^^^^^^^^^
71 77 The TCP backend implements a Modbus variant used for communications over
... ...
doc/modbus_rtu_get_serial_mode.txt 0 → 100644
  1 +modbus_rtu_get_serial_mode(3)
  2 +=============================
  3 +
  4 +
  5 +NAME
  6 +----
  7 +modbus_rtu_get_serial_mode - get the current serial mode
  8 +
  9 +
  10 +SYNOPSIS
  11 +--------
  12 +*int modbus_rtu_get_serial_mode(*modbus_t 'ctx');*
  13 +
  14 +
  15 +DESCRIPTION
  16 +-----------
  17 +The _modbus_rtu_get_serial_mode()_ function shall return the serial mode
  18 +currently used by the libmodbus context:
  19 +
  20 +*MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232
  21 + (Recommended Standard 232) is the traditional name for a series of standards
  22 + for serial binary single-ended data and control signals connecting between a
  23 + DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating
  24 + Equipment). It is commonly used in computer serial ports
  25 +
  26 +*MODBUS_RTU_RS485*:: the serial line is set for RS485 communication. EIA-485,
  27 + also known as TIA/EIA-485 or RS-485, is a standard defining the electrical
  28 + characteristics of drivers and receivers for use in balanced digital multipoint
  29 + systems. This standard is widely used for communications in industrial
  30 + automation because it can be used effectively over long distances and in
  31 + electrically noisy environments.
  32 +
  33 +This function is only available on recent Linux kernels.
  34 +
  35 +
  36 +RETURN VALUE
  37 +------------
  38 +The _modbus_rtu_get_serial_mode()_ function shall return 'MODBUS_RTU_RS232' or
  39 +'MODBUS_RTU_RS485' if successful. Otherwise it shall return -1 and set errno to
  40 +one of the values defined below.
  41 +
  42 +
  43 +ERRORS
  44 +------
  45 +*EINVAL*::
  46 +The current libmodbus backend is not RTU.
  47 +
  48 +
  49 +AUTHORS
  50 +-------
  51 +The libmodbus documentation was written by Stéphane Raimbault
  52 +<stephane.raimbault@gmail.com>
... ...
doc/modbus_rtu_set_serial_mode.txt 0 → 100644
  1 +modbus_rtu_set_serial_mode(3)
  2 +=============================
  3 +
  4 +
  5 +NAME
  6 +----
  7 +modbus_rtu_set_serial_mode - set the serial mode
  8 +
  9 +
  10 +SYNOPSIS
  11 +--------
  12 +*int modbus_rtu_set_serial_mode(*modbus_t 'ctx');*
  13 +
  14 +
  15 +DESCRIPTION
  16 +-----------
  17 +The _modbus_rtu_set_serial_mode()_ function shall set the selected serial
  18 +mode:
  19 +
  20 +*MODBUS_RTU_RS232*:: the serial line is set for RS232 communication. RS-232
  21 + (Recommended Standard 232) is the traditional name for a series of standards
  22 + for serial binary single-ended data and control signals connecting between a
  23 + DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating
  24 + Equipment). It is commonly used in computer serial ports
  25 +
  26 +*MODBUS_RTU_RS485*:: the serial line is set for RS485 communication. EIA-485,
  27 + also known as TIA/EIA-485 or RS-485, is a standard defining the electrical
  28 + characteristics of drivers and receivers for use in balanced digital multipoint
  29 + systems. This standard is widely used for communications in industrial
  30 + automation because it can be used effectively over long distances and in
  31 + electrically noisy environments.
  32 +
  33 +This function is only available on recent Linux kernels.
  34 +
  35 +
  36 +RETURN VALUE
  37 +------------
  38 +The _modbus_set_serial_mode()_ function shall return 0 if successful. Otherwise
  39 +it shall return -1 and set errno to one of the values defined below.
  40 +
  41 +
  42 +ERRORS
  43 +------
  44 +*EINVAL*::
  45 +The current libmodbus backend is not RTU.
  46 +
  47 +If the call to ioctl() fails, the error code of ioctl will be returned.
  48 +
  49 +
  50 +AUTHORS
  51 +-------
  52 +The libmodbus documentation was written by Stéphane Raimbault
  53 +<stephane.raimbault@gmail.com>
... ...