一、ModbusRTU, ModbusTCP and ModbusTCP Security

有关图书馆的使用详情,请查阅相关文档部分。

二、功能

  • 支持所有Arduino平台
  • 在多个实例的任意组合中运行
    • Modbus RTU 主站
    • Modbus RTU 从站
    • Modbus TCP 主站 支持 ESP8266/ESP32 和 Ethernet library
    • Modbus TCP 从站 支持 ESP8266/ESP32 和 Ethernet library
    • MODBUS/TCP Security 主站 (ESP8266)
    • MODBUS/TCP Security 从站 (ESP8266/ESP32)
  • 支持的Modbus功能码:
    • 0x01 - Read Coils
    • 0x02 - Read Input Status (Read Discrete Inputs)
    • 0x03 - Read Holding Registers
    • 0x04 - Read Input Registers
    • 0x05 - Write Single Coil
    • 0x06 - Write Single Register
    • 0x0F - Write Multiple Coils
    • 0x10 - Write Multiple Registers
    • 0x14 - Read File Record
    • 0x15 - Write File Record
    • 0x16 - Mask Write Register
    • 0x17 - Read/Write multiple registers
  • 支持的Modbus功能
  • 现实生活复杂例子
    • ESP8266/ESP32 通过 Modbus 更新固件
    • ModbusRTU to ModbusTCP bridge

三、注意

  1. 寄存器的偏移量是基于0的。所以在设置您的监督系统或测试软件时要小心。例如,在ScadaBR中,偏移量是基于0的,那么在库中配置为100的寄存器在ScadaBR中将被设置为100。另一方面,在CAS Modbus Scanner中,偏移量是基于1的,所以库中配置为100的寄存器在这个软件中应该是101。
  2. 基于MAX-485的RS-485收发器工作在至少115200的速率上,而XY-017/XY-485由于某种原因只工作在9600的速率上。

四、最近更新:

// 4.1.1
+ Protocol: Fix wrong error code responce on non-existent register
+ ModbusTCP: Fix potential memory leak
+ API: cbEnable/cbDisable functionality extended
+ ESP-IDF: CMakeList.txt added
+ Examples: TCP-to-RTU fixed

// 4.1.0
+ API: Raw Modbus frame processing functionality
+ ModbusRTU: Precise inter-frame interval control
+ Examples: True ModbusRTU to ModbusTCP Server bridge
+ Examples: ModbusRTU respond to multiple ID from single device
+ ModbusRTU: Add direction control pin for Stream
+ STL: Add Reg count limitation to vector limit of 4000 (for ESP8266 and ESP32)+ Settings: Added MODBUSIP_CONNECTION_TIMEOUT (ESP32 only)
+ Settings: Set MODBUSIP_MAX_CLIENTS = 8 for ESP32
+ ModbusTCP: Make using DNS names optional feature
+ ModbusRTU: Add separate RE/DE pins control optional feature
+ API: Drop support of Ethernet library v1
+ Examples: Teknic ClearCore ArduinoWrapper examples added
+ Examples: ModbusTCP to ModbusRTU example added
+ ModbusRTU: Flush extra delay optional feature

// 4.0.0
+ Support of all Arduino boards
+ ModbusTLS: ESP8266 Client/Server and ESP32 Client
+ ModbusTCP: ModbusEthernet - WizNet W5x00, ENC28J60 Ethernet library support
+ 0x14 - Read File Records function+ 0x15 - Write File Records function
+ Examples: FW update over Modbus fullfunctional example
+ 0x16 - Write Mask Register function+ Test: 0x16
+ 0x17 - Read/Write Registers function
+ ModbusRTU: ESP32 SoftwareSerial support+ Build with no STL dependency (switchable)
+ API: ModbusIP => ModbusTCP
+ API: Access control callback for individual Modbus function
+ API: Master/Slave => Client/Server according to [PRESS RELEASE](https://modbus.org/docs/Client-ServerPR-07-2020-final.docx.pdf)
+ Lot of code refacting and small fixes

五、路线图

// 4.2.0
- API: Alternative CRC calulation (reduced memory footprint)
- ModbusRTU: Static buffer allocation- Test: Frame accuracy to specefication
- Buffer/packet size limitation support
- Slave/Server: slavePDU use early exit by return where possible
- Master/Client: Check frame size against header data where possible
- Master/Client: Additional responce data validation
- Free global registers and callbacks on remove last Modbus instance
- Test: push/pull functions
- ModbusTCP: Refactor connect by dns name (using native implementation for ESP32 etc)

// 4.3.0
- ModbusTLS: ESP32 Server
- Test: TLS ESP32 Server
- Test: TLS ESP32 Client
- Examples: TLS Certificate test Role extension and Alt-Name
- Examples: TLS Add example explanation
- ModbusTCP: ModbusAsyncTCP
- API: Extend API to allow custom Modbus commands
- Examples: Basic file operations
- Examples: Revising

六、代码贡献

GitHub - emelianov/modbus-esp8266: Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.

a.m.emelianov@gmail.com

Original version:

GitHub - andresarmento/modbus-esp8266: A library that allows your ESP8266 to communicate via Modbus protocol, acting as a slave (master in development). Supports IP via wireless network (Modbus IP).

GitHub - andresarmento/modbus-arduino: A library that allows your Arduino to communicate via Modbus protocol, acting as a slave (master in development). Supports serial (RS-232, RS-485) and IP via Ethernet (Modbus IP).

prof (at) andresarmento (dot) com

03-08 19:37