1MODBUS_STRERROR(3)             Libmodbus Manual             MODBUS_STRERROR(3)
2
3
4

NAME

6       modbus_strerror - return the error message
7

SYNOPSIS

9       const char *modbus_strerror(*int errnum);
10

DESCRIPTION

12       The modbus_strerror() function shall return a pointer to an error
13       message string corresponding to the error number specified by the
14       errnum argument. As libmodbus defines additional error numbers over and
15       above those defined by the operating system, applications should use
16       modbus_strerror() in preference to the standard strerror() function.
17

RETURN VALUE

19       The modbus_strerror() function shall return a pointer to an error
20       message string.
21

ERRORS

23       No errors are defined.
24

EXAMPLE

26       Displaying an error message when a Modbus connection cannot be
27       established.
28
29           if (modbus_connect(ctx) == -1) {
30               fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno));
31               abort();
32           }
33
34

SEE ALSO

36       linkmb:libmodbus
37

AUTHORS

39       The libmodbus documentation was written by Stéphane Raimbault
40       <stephane.raimbault@gmail.com[1]>
41

NOTES

43        1. stephane.raimbault@gmail.com
44           mailto:stephane.raimbault@gmail.com
45
46
47
48libmodbus 3.0.6                   04/02/2014                MODBUS_STRERROR(3)
Impressum