fennec-modbus 0.90.3

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::client::AsyncClient;
use fennec_modbus::protocol::function::read_registers::Holding;
use fennec_modbus::tcp::UnitId;
use fennec_modbus::tcp::tokio::Client;

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

Disclaimer

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

Specifications