1MODBUS_RTU_SET_SERIA(3) Libmodbus Manual MODBUS_RTU_SET_SERIA(3)
2
3
4
6 modbus_rtu_set_serial_mode - set the serial mode
7
9 int modbus_rtu_set_serial_mode(modbus_t *ctx);
10
12 The modbus_rtu_set_serial_mode() function shall set the selected serial
13 mode:
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 supported on Linux kernels 2.6.28 onwards.
33
35 The modbus_set_serial_mode() function shall return 0 if successful.
36 Otherwise it shall return -1 and set errno to one of the values defined
37 below.
38
40 EINVAL
41 The current libmodbus backend is not RTU.
42
43 ENOTSUP
44 The function is not supported on your platform.
45
46 If the call to ioctl() fails, the error code of ioctl will be returned.
47
49 The libmodbus documentation was written by Stéphane Raimbault
50 <stephane.raimbault@gmail.com[1]>
51
53 1. stephane.raimbault@gmail.com
54 mailto:stephane.raimbault@gmail.com
55
56
57
58libmodbus 3.0.6 04/02/2014 MODBUS_RTU_SET_SERIA(3)