Crates.io | tokio-modbus |
lib.rs | tokio-modbus |
version | |
source | src |
created_at | 2017-08-21 11:13:36.56698 |
updated_at | 2024-12-04 13:19:54.150843 |
description | Tokio-based Modbus library |
homepage | https://github.com/slowtec/tokio-modbus |
repository | https://github.com/slowtec/tokio-modbus |
max_upload_size | |
id | 28431 |
Cargo.toml error: | TOML parse error at line 28, column 1 | 28 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.
async
(non-blocking, default) and sync
(blocking, optional)Add this to your Cargo.toml
:
[dependencies]
tokio-modbus = "*"
"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 serverIf 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"] }
Various examples for Modbus RTU and TCP using either the asynchronous or synchronous API can be found in the examples folder.
The workspace contains documentation, tests, and examples for all available features.
cargo test --workspace
cargo test --workspace --all-features
Copyright (c) 2017-2024 slowtec GmbH