#modbus-tcp #fieldbus #coupler #ur20-fbc-mod-tcp

ur20-modbus

Modbus TCP fieldbus coupler (UR20-FBC-MOD-TCP) implementation

6 releases (3 breaking)

0.4.0 Mar 13, 2020
0.3.0 May 24, 2019
0.2.0 Sep 11, 2018
0.1.2 Jun 18, 2018
0.1.1 Apr 24, 2018

#977 in Hardware support

MIT/Apache

13KB
254 lines

UR20 Modbus

ur20-modbus is a Rust library for communicating with the Modbus TCP fieldbus coupler Weidmüller UR20-FBC-MOD-TCP.

Crates.io version Docs Build Status

License

Copyright (c) 2018-2020, slowtec GmbH

Licensed under either of

at your option.


lib.rs:

ur20-modbus is a Rust library for communicating with the Modbus TCP fieldbus coupler Weidmüller UR20-FBC-MOD-TCP.

Example:

 use std::error::Error;
 use ur20_modbus::Coupler;

 #[tokio::main]
 async fn main() -> Result<(), Box<dyn Error>> {
     let addr = "192.168.0.222:502".parse()?;
     let mut coupler = Coupler::connect(addr).await?;
     let id = coupler.id().await?;
     println!("Connected to {}", id);
     coupler.set_output(
         &ur20::Address {
             module: 3,
             channel: 2,
         },
         ur20::ChannelValue::Bit(true),
     )?;
     coupler.tick().await?;
     Ok(())
 }

Dependencies

~7MB
~132K SLoC