#modbus #hardware #test


Libmodbus based server to test the rust modbus package

4 releases

Uses old Rust 2015

0.0.4 Dec 20, 2017
0.0.3 Feb 5, 2016
0.0.2 Nov 18, 2015
0.0.1 Nov 18, 2015

#898 in Hardware support

50 downloads per month
Used in modbus

MIT license

86 lines

Rust Modbus

Build Status Coverage Status License

Modbus implementation in pure Rust.


Add modbus to your Cargo.toml dependencies:

modbus = "1.0"

Import the modbus crate and use it's functions:

use modbus::{Client, Coil};
use modbus::tcp;

let mut client = tcp::Transport::new("");

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-2022 Falco Hirschenberger

Distributed under the MIT License.