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 function shall return the length of the response sent if
44       successful. Otherwise it shall return -1 and set errno.
45

ERRORS

47       EINVAL
48           The exception code is invalid
49

SEE ALSO

51       modbus_reply(3) libmodbus(7)
52

AUTHORS

54       The libmodbus documentation was written by Stéphane Raimbault
55       <stephane.raimbault@gmail.com>
56
57
58
59libmodbus v3.1.6                  01/19/2023           MODBUS_REPLY_EXCEPTI(3)
Impressum