Agile Modbus 1.1.1
Lightweight modbus protocol stack.
Modbus Constants 的协作图:

宏定义

#define AGILE_MODBUS_VERSION_STRING   "AMB_1.1.0"
 Agile Modbus 版本号 更多...
 
#define AGILE_MODBUS_BROADCAST_ADDRESS   0
 Modbus 广播地址 更多...
 
#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
 

详细描述

宏定义说明

◆ AGILE_MODBUS_VERSION_STRING

#define AGILE_MODBUS_VERSION_STRING   "AMB_1.1.0"

Agile Modbus 版本号

在文件 agile_modbus.h53 行定义.

◆ AGILE_MODBUS_BROADCAST_ADDRESS

#define AGILE_MODBUS_BROADCAST_ADDRESS   0

Modbus 广播地址

在文件 agile_modbus.h55 行定义.

◆ AGILE_MODBUS_MAX_READ_BITS

#define AGILE_MODBUS_MAX_READ_BITS   2000

在文件 agile_modbus.h67 行定义.

◆ AGILE_MODBUS_MAX_WRITE_BITS

#define AGILE_MODBUS_MAX_WRITE_BITS   1968

在文件 agile_modbus.h68 行定义.

◆ AGILE_MODBUS_MAX_READ_REGISTERS

#define AGILE_MODBUS_MAX_READ_REGISTERS   125

在文件 agile_modbus.h85 行定义.

◆ AGILE_MODBUS_MAX_WRITE_REGISTERS

#define AGILE_MODBUS_MAX_WRITE_REGISTERS   123

在文件 agile_modbus.h86 行定义.

◆ AGILE_MODBUS_MAX_WR_WRITE_REGISTERS

#define AGILE_MODBUS_MAX_WR_WRITE_REGISTERS   121

在文件 agile_modbus.h87 行定义.

◆ AGILE_MODBUS_MAX_WR_READ_REGISTERS

#define AGILE_MODBUS_MAX_WR_READ_REGISTERS   125

在文件 agile_modbus.h88 行定义.

◆ 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.

在文件 agile_modbus.h102 行定义.

◆ 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.

在文件 agile_modbus.h116 行定义.