1MODBUS_RTU_SET_SERIA(3)        libmodbus Manual        MODBUS_RTU_SET_SERIA(3)
2
3
4

NAME

6       modbus_rtu_set_serial_mode - set the serial mode
7

SYNOPSIS

9       int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode);
10

DESCRIPTION

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

RETURN VALUE

35       The function shall return 0 if successful. Otherwise it shall return -1
36       and set errno to one of the values defined below.
37

ERRORS

39       EINVAL
40           The current libmodbus backend is not RTU.
41
42       ENOTSUP
43           The function is not supported on your platform.
44
45       If the call to ioctl() fails, the error code of ioctl will be returned.
46

AUTHORS

48       The libmodbus documentation was written by Stéphane Raimbault
49       <stephane.raimbault@gmail.com>
50
51
52
53libmodbus v3.1.6                  07/21/2022           MODBUS_RTU_SET_SERIA(3)
Impressum