fennec-modbus 0.88.0

Modular Modbus client implementation
Documentation

fennec-modbus

docs.rs Build status Activity

🦊 Modular Modbus client.

  • The TCP layer is sans-IO. Default implementation for Tokio is provided, and may be used with any TCP client.
  • The Modbus layer is sans-IO. The TCP layer is provided, and the underlying protocol can be used over any transport.
  • Extensible functions. Most used standard Modbus functions are provided, and the client can use any user-implemented function with arbitrary BinWrite arguments and BinRead output.

Sneak peek

use anyhow::Result;

use fennec_modbus::tcp::UnitId;
use fennec_modbus::tcp::tokio::Client;

# #[tokio::main]
# async fn main() -> Result<()> {
let unit_id = UnitId::try_from(1)?;
let client = Client::builder()
    .endpoint("battery.iot.home.arpa:502")
    .build();
let voltage = client
    .read_holding_registers_exact::<1>(unit_id, 39201)
    .await?[0];
# Ok(())
# }

Disclaimer

The package is used in a live application, but at this point, the public interface may change wildly.

Specifications