| Crates.io | modbus |
| lib.rs | modbus |
| version | 1.1.1 |
| created_at | 2015-11-15 14:02:28.724213+00 |
| updated_at | 2025-01-24 12:59:37.211829+00 |
| description | Pure Rust modbus implementation |
| homepage | https://github.com/hirschenberger/modbus-rs.git |
| repository | https://github.com/hirschenberger/modbus-rs.git |
| max_upload_size | |
| id | 3428 |
| size | 62,379 |
Modbus implementation in pure Rust.
Add modbus to your Cargo.toml dependencies:
[dependencies]
modbus = "1.1"
Import the modbus crate and use it's functions:
use modbus::{Client, Coil};
use modbus::tcp;
let mut client = tcp::Transport::new("192.168.0.10");
client.write_single_coil(1, Coil::On).unwrap();
client.write_single_coil(3, Coil::On).unwrap();
let res = client.read_coils(0, 5).unwrap();
// res == vec![Coil::Off, Coil::On, Coil::Off, Coil::On, Coil::Off];
See the documentation for usage examples and further reference and the examples directory for a commandline client application.
Copyright © 2015-2025 Falco Hirschenberger
Distributed under the MIT License.