Struct modbus::tcp::Transport [] [src]

pub struct Transport {
    // some fields omitted
}

Context object which holds state for all modbus operations.

Methods

impl Transport
[src]

fn new(addr: &str) -> Result<Transport>

Create a new context context object and connect it to addr on modbus-tcp default port (502)

fn new_with_port(addr: &str, port: u16) -> Result<Transport>

Create a new context object and connect it to addr on port port

fn close(self: &mut Self) -> Result<()>

Trait Implementations

impl Client for Transport
[src]

fn read_coils(self: &mut Self, addr: u16, count: u16) -> Result<Vec<Coil>>

Read count bits starting at address addr.

fn read_discrete_inputs(self: &mut Self, addr: u16, count: u16) -> Result<Vec<Coil>>

Read count input bits starting at address addr.

fn read_holding_registers(self: &mut Self, addr: u16, count: u16) -> Result<Vec<u16>>

Read count 16bit registers starting at address addr.

fn read_input_registers(self: &mut Self, addr: u16, count: u16) -> Result<Vec<u16>>

Read count 16bit input registers starting at address addr.

fn write_single_coil(self: &mut Self, addr: u16, value: Coil) -> Result<()>

Write a single coil (bit) to address addr.

fn write_single_register(self: &mut Self, addr: u16, value: u16) -> Result<()>

Write a single 16bit register to address addr.

fn write_multiple_coils(self: &mut Self, addr: u16, values: &[Coil]) -> Result<()>

Write a multiple coils (bits) starting at address addr.

fn write_multiple_registers(self: &mut Self, addr: u16, values: &[u16]) -> Result<()>

Write a multiple 16bit registers starting at address addr.