21 releases (5 stable)

Uses old Rust 2015

1.0.5 Nov 10, 2022
1.0.4 Oct 18, 2021
1.0.3 Jul 11, 2019
1.0.0 Sep 27, 2018
0.2.0 Nov 27, 2015

#65 in Hardware support

Download history 1235/week @ 2023-06-12 299/week @ 2023-06-19 1170/week @ 2023-06-26 355/week @ 2023-07-03 684/week @ 2023-07-10 889/week @ 2023-07-17 711/week @ 2023-07-24 827/week @ 2023-07-31 754/week @ 2023-08-07 1071/week @ 2023-08-14 587/week @ 2023-08-21 333/week @ 2023-08-28 450/week @ 2023-09-04 3586/week @ 2023-09-11 4337/week @ 2023-09-18 4272/week @ 2023-09-25

12,663 downloads per month

MIT license

38KB
799 lines

Rust Modbus

Build Status Coverage Status License

Modbus implementation in pure Rust.

Usage

Add modbus to your Cargo.toml dependencies:

[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("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.

License

Copyright © 2015-2021 Falco Hirschenberger

Distributed under the MIT License.

Dependencies

~365KB