1MODBUS_RTU_GET_SERIA(3) libmodbus Manual MODBUS_RTU_GET_SERIA(3)
2
3
4
6 modbus_rtu_get_serial_mode - get the current serial mode
7
9 int modbus_rtu_get_serial_mode(modbus_t *ctx);
10
12 The modbus_rtu_get_serial_mode() function shall return the serial mode
13 currently used by the libmodbus context:
14
15 MODBUS_RTU_RS232
16 the serial line is set for RS232 communication. RS-232 (Recommended
17 Standard 232) is the traditional name for a series of standards for
18 serial binary single-ended data and control signals connecting
19 between a DTE (Data Terminal Equipment) and a DCE (Data
20 Circuit-terminating Equipment). It is commonly used in computer
21 serial ports
22
23 MODBUS_RTU_RS485
24 the serial line is set for RS485 communication. EIA-485, also known
25 as TIA/EIA-485 or RS-485, is a standard defining the electrical
26 characteristics of drivers and receivers for use in balanced
27 digital multipoint systems. This standard is widely used for
28 communications in industrial automation because it can be used
29 effectively over long distances and in electrically noisy
30 environments.
31
32 This function is only available on Linux kernels 2.6.28 onwards and can
33 only be used with a context using a RTU backend.
34
36 The function shall return MODBUS_RTU_RS232 or MODBUS_RTU_RS485 if
37 successful. Otherwise it shall return -1 and set errno to one of the
38 values defined below.
39
41 EINVAL
42 The current libmodbus backend is not RTU.
43
45 The libmodbus documentation was written by Stéphane Raimbault
46 <stephane.raimbault@gmail.com>
47
48
49
50libmodbus v3.1.6 02/04/2022 MODBUS_RTU_GET_SERIA(3)