19 releases (3 stable)

1.0.3 Jul 11, 2019
1.0.0 Sep 27, 2018
0.5.4 Dec 20, 2017
0.5.3 Aug 12, 2017
0.2.0 Nov 27, 2015

#3 in #hardware

Download history 67/week @ 2019-03-28 39/week @ 2019-04-04 21/week @ 2019-04-11 23/week @ 2019-04-18 6/week @ 2019-04-25 20/week @ 2019-05-02 55/week @ 2019-05-09 53/week @ 2019-05-16 57/week @ 2019-05-23 61/week @ 2019-05-30 83/week @ 2019-06-06 31/week @ 2019-06-13 135/week @ 2019-06-20 229/week @ 2019-06-27 78/week @ 2019-07-04

283 downloads per month

MIT license

31KB
667 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-2019 Falco Hirschenberger

Distributed under the MIT License.

Dependencies

~470KB