Agile Modbus  1.1.4
Lightweight modbus protocol stack.
Collaboration diagram for Modbus Constants:

Macros

#define AGILE_MODBUS_VERSION_STRING   "AMB_1.1.4"
 Agile Modbus version number. More...
 
#define AGILE_MODBUS_BROADCAST_ADDRESS   0
 Modbus broadcast address. More...
 
#define AGILE_MODBUS_MAX_PDU_LENGTH   253
 
#define AGILE_MODBUS_MAX_ADU_LENGTH   260
 

Quantity limit of Coils

   Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 1 page 12)
   Quantity of Coils to read (2 bytes): 1 to 2000 (0x7D0)
   (chapter 6 section 11 page 29)
   Quantity of Coils to write (2 bytes): 1 to 1968 (0x7B0)
#define AGILE_MODBUS_MAX_READ_BITS   2000
 
#define AGILE_MODBUS_MAX_WRITE_BITS   1968
 

Quantity limit of Registers

   Modbus_Application_Protocol_V1_1b.pdf (chapter 6 section 3 page 15)
   Quantity of Registers to read (2 bytes): 1 to 125 (0x7D)
   (chapter 6 section 12 page 31)
   Quantity of Registers to write (2 bytes) 1 to 123 (0x7B)
   (chapter 6 section 17 page 38)
   Quantity of Registers to write in R/W registers (2 bytes) 1 to 121 (0x79)
#define AGILE_MODBUS_MAX_READ_REGISTERS   125
 
#define AGILE_MODBUS_MAX_WRITE_REGISTERS   123
 
#define AGILE_MODBUS_MAX_WR_WRITE_REGISTERS   121
 
#define AGILE_MODBUS_MAX_WR_READ_REGISTERS   125
 

Detailed Description

Macro Definition Documentation

◆ AGILE_MODBUS_VERSION_STRING

#define AGILE_MODBUS_VERSION_STRING   "AMB_1.1.4"

Agile Modbus version number.

Definition at line 67 of file agile_modbus.h.

◆ AGILE_MODBUS_BROADCAST_ADDRESS

#define AGILE_MODBUS_BROADCAST_ADDRESS   0

Modbus broadcast address.

Definition at line 69 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_READ_BITS

#define AGILE_MODBUS_MAX_READ_BITS   2000

Definition at line 81 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_WRITE_BITS

#define AGILE_MODBUS_MAX_WRITE_BITS   1968

Definition at line 82 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_READ_REGISTERS

#define AGILE_MODBUS_MAX_READ_REGISTERS   125

Definition at line 99 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_WRITE_REGISTERS

#define AGILE_MODBUS_MAX_WRITE_REGISTERS   123

Definition at line 100 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_WR_WRITE_REGISTERS

#define AGILE_MODBUS_MAX_WR_WRITE_REGISTERS   121

Definition at line 101 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_WR_READ_REGISTERS

#define AGILE_MODBUS_MAX_WR_READ_REGISTERS   125

Definition at line 102 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_PDU_LENGTH

#define AGILE_MODBUS_MAX_PDU_LENGTH   253
   The size of the MODBUS PDU is limited by the size constraint inherited from
   the first MODBUS implementation on Serial Line network (max. RS485 ADU = 256
   bytes). Therefore, MODBUS PDU for serial line communication = 256 - Server
   address (1 byte) - CRC (2 bytes) = 253 bytes.

Definition at line 116 of file agile_modbus.h.

◆ AGILE_MODBUS_MAX_ADU_LENGTH

#define AGILE_MODBUS_MAX_ADU_LENGTH   260
   Consequently:
   - RTU MODBUS ADU = 253 bytes + Server address (1 byte) + CRC (2 bytes) = 256
   bytes.
   - TCP MODBUS ADU = 253 bytes + MBAP (7 bytes) = 260 bytes.
   so the maximum of both backend in 260 bytes. This size can used to allocate
   an array of bytes to store responses and it will be compatible with the two
   backends.

Definition at line 130 of file agile_modbus.h.