Rust Modbus

Build Status Coverage Status License

Modbus implementation in pure Rust.

Usage

Add modbus to your Cargo.toml dependencies:

toml [dependencies] modbus = "0.2.0"

Import the modbus crate and use it's functions:

```rust use modbus::{Client, BitValue}; use modbus::tcp;

let mut client = tcp::Ctx::new("192.168.0.10");

client.writesinglecoil(1, BitValue::On).unwrap(); client.writesinglecoil(3, BitValue::On).unwrap();

let res = client.read_coils(0, 5).unwrap();

// res == vec![BitValue::Off, BitValue::On, BitValue::Off, BitValue::On, BitValue::Off]); ``` See the documentation for usage examples and further reference.

License

Copyright © 2015 Falco Hirschenberger

Distributed under the MIT License.