Struct ur20_modbus::Coupler[][src]

pub struct Coupler { /* fields omitted */ }

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

Example:

 extern crate futures;
 extern crate tokio_core;
 extern crate ur20_modbus;

 use futures::Future;
 use tokio_core::reactor::Core;
 use ur20_modbus::Coupler;

 let mut core = Core::new().unwrap();
 let handle = core.handle();
 let addr = "192.168.178.3:502".parse().unwrap();
 let client = Coupler::connect(addr, handle);
 let task = client.and_then(|client|{
     println!("Connected to {}", client.id());
     Ok(())
 });
 core.run(task).unwrap();

Methods

impl Coupler
[src]

Connect to the coupler.

The actual coupler ID.

Current input state.

Current output state.

Important traits for &'a [u8]

List of modules.

Set the value of an output channel.

Read binary input data.

Run an I/O cycle. This reads all process input registers and writes to process output registers.

This method behaves like Coupler::tick but it consumes the Coupler and returns it as Future::Item.

Auto Trait Implementations

impl !Send for Coupler

impl !Sync for Coupler