slowtec/tokio-modbus
Fork: 122 Star: 413 (更新于 2024-11-15 13:41:44)
license: Apache-2.0
Language: Rust .
A tokio-based modbus library
最后发布版本: v0.7.1 ( 2023-02-28 20:00:17)
tokio-modbus
A pure Rust Modbus library based on tokio.
Modbus is based on a master/slave communication pattern. To avoid confusion with the Tokio terminology the master is called client and the slave is called server in this library.
Features
- Pure Rust library
- Modbus TCP or RTU at your choice
- Both
async
(non-blocking, default) andsync
(blocking, optional) - Client API
- Server implementations
- for out-of-the-box usage or
- as a starting point for a customized implementation
- Open source (MIT/Apache-2.0)
Installation
Add this to your Cargo.toml
:
[dependencies]
tokio-modbus = "*"
Cargo Features
-
"rtu"
: Asynchronous RTU client (default) -
"tcp"
: Asynchronous TCP client (default) -
"rtu-sync
: Synchronous RTU client -
"tcp-sync"
: Synchronous TCP client -
"rtu-server"
: (Asynchronous) RTU server -
"tcp-server"
: (Asynchronous) TCP server -
"rtu-over-tcp-server"
: (Asynchronous) RTU over TCP server
Examples
If you only need an asynchronous TCP client add the following line to your Cargo.toml file:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp"] }
For an asynchronous RTU client:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu"] }
For an RTU server:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu-server"] }
For a TCP server:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp-server"] }
Examples
Various examples for Modbus RTU and TCP using either the asynchronous or synchronous API can be found in the examples folder.
Testing
The workspace contains documentation, tests, and examples for all available features.
cargo test --workspace
cargo test --workspace --all-features
Protocol-Specification
- Modbus Application Protocol Specification v1.1b3 (PDF)
- Modbus over serial line specification and implementation guide v1.02 (PDF)
- Modbus Messaging on TCP/IP Implementation Guide v1.0b (PDF)
License
Copyright (c) 2017-2024 slowtec GmbH
最近版本更新:(数据更新于 2024-10-12 21:55:01)
2023-02-28 20:00:17 v0.7.1
2023-02-14 16:52:31 v0.7.0
2023-01-31 00:48:27 v0.6.0
2021-11-21 21:00:54 v0.5.1
2021-08-20 17:30:14 v0.5.0
2021-08-13 18:47:00 v0.4.1
2021-07-29 03:41:24 v0.4.0
2019-09-17 18:43:01 v0.3.5
2019-05-21 22:09:50 v0.3.4
2019-05-16 16:07:29 v0.3.3
主题(topics):
ascii, async, automation, client, fieldbus, library, modbus, non-blocking, rtu, rust, server, support, tcp, tokio
slowtec/tokio-modbus同语言 Rust最近更新仓库
2024-11-20 07:29:29 lanyeeee/jmcomic-downloader
2024-11-19 23:39:15 gleam-lang/gleam
2024-11-19 08:50:55 lapce/lapce
2024-11-11 22:51:00 tauri-apps/tauri
2024-11-11 07:55:30 dani-garcia/vaultwarden
2024-11-09 16:42:37 rustdesk/rustdesk