A pure Rust Modbus library based on tokio
open sourceMIT OR Apache-2.0free
tokio-modbus is a pure Rust library for the Modbus industrial protocol, built on Tokio, maintained by slowtec since 2017. It implements Modbus TCP and Modbus RTU over serial lines, with an asynchronous client API by default and an optional blocking one, and server implementations for TCP, RTU and RTU over TCP that work out of the box or as a starting point for a custom device. Cargo features turn each client and server on separately so a project compiles only what it uses. It's licensed MIT or Apache-2.0.
Problems it solves
- read registers from a PLC over Modbus TCP in a Rust service
- talk to an energy meter over RS-485 Modbus RTU from Rust
- poll many Modbus devices concurrently without a thread per device
- simulate a Modbus device in Rust to test our SCADA integration
- expose our Rust application's data to industrial controllers as a Modbus TCP server
- a Modbus library for Rust without C dependencies
- use Modbus from synchronous Rust code without pulling in an async runtime API
Features
- Modbus TCP and RTU
- async client API (default) and optional sync client
- TCP, RTU and RTU-over-TCP servers
- cargo features per client and server
- pure Rust
- examples for RTU and TCP, async and sync
