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

NAME

6       modbus_reply_exception - send an exception reponse
7

SYNOPSIS

9       *int modbus_reply_exception(modbus_t *ctx, const uint8_t *req, unsigned
10       int exception_code);
11

DESCRIPTION

13       The modbus_reply_exception() function shall send an exception response
14       based on the exception_code in argument.
15
16       The libmodbus provides the following exception codes:
17
18       ·   MODBUS_EXCEPTION_ILLEGAL_FUNCTION (1)
19
20       ·   MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS (2)
21
22       ·   MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE (3)
23
24       ·   MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE (4)
25
26       ·   MODBUS_EXCEPTION_ACKNOWLEDGE (5)
27
28       ·   MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY (6)
29
30       ·   MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE (7)
31
32       ·   MODBUS_EXCEPTION_MEMORY_PARITY (8)
33
34       ·   MODBUS_EXCEPTION_NOT_DEFINED (9)
35
36       ·   MODBUS_EXCEPTION_GATEWAY_PATH (10)
37
38       ·   MODBUS_EXCEPTION_GATEWAY_TARGET (11)
39
40       The initial request req is required to build a valid response.
41

RETURN VALUE

43       The modbus_reply_exception() function shall return the length of the
44       response sent if successful. Otherwise it shall return -1 and set
45       errno.
46

ERRORS

48       EINVAL
49           The exception code is invalid
50

SEE ALSO

52       modbus_reply(3) libmodbus(7)
53

AUTHORS

55       The libmodbus documentation was written by Stéphane Raimbault
56       <stephane.raimbault@gmail.com[1]>
57

NOTES

59        1. stephane.raimbault@gmail.com
60           mailto:stephane.raimbault@gmail.com
61
62
63
64libmodbus 3.0.8                   07/31/2019           MODBUS_REPLY_EXCEPTI(3)
Impressum