public class TestModbus extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
TestModbus.OnOff |
| Modifier and Type | Field and Description |
|---|---|
protected Modbus |
mod |
protected PrintStream |
out |
| Constructor and Description |
|---|
TestModbus() |
TestModbus(Modbus mbus) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
coilRead(int address,
int number,
int count) |
void |
coilWrite(int address,
int number,
int... values) |
void |
discRead(int address,
int number,
int count) |
void |
inpRead(int address,
int number,
int count) |
void |
open(Modbus.ConnType type,
String ident) |
void |
open(Modbus.ConnType type,
String ident,
int param) |
void |
open(Modbus.ConnType type,
String ident,
int baud,
org.lsst.ccs.drivers.ascii.Ascii.DataBits dbits,
org.lsst.ccs.drivers.ascii.Ascii.StopBits sbits,
org.lsst.ccs.drivers.ascii.Ascii.Parity parity,
org.lsst.ccs.drivers.ascii.Ascii.FlowCtrl flow) |
void |
regRead(int address,
int number,
int count) |
void |
regWrite(int address,
int number,
int... values) |
void |
setAddress(TestModbus.OnOff mode) |
void |
setTimeout(double timeout) |
void |
showAddress() |
protected final PrintStream out
protected final Modbus mod
public TestModbus()
public TestModbus(Modbus mbus)
@Command(name="open",
description="Open connection to general device")
public void open(@Argument(name="type",description="Connection type")
Modbus.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="open",
description="Open connection to general device")
public void open(@Argument(name="type",description="Connection type")
Modbus.ConnType type,
@Argument(name="ident",description="Device identifier")
String ident,
@Argument(name="param",description="Device parameter")
int param)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="open",
description="Open connection to serial device")
public void open(@Argument(description="Connection type: net, serial or ftdi")
Modbus.ConnType type,
@Argument(description="Device identifier")
String ident,
@Argument(description="Baud rate")
int baud,
@Argument(description="The number of data bits")
org.lsst.ccs.drivers.ascii.Ascii.DataBits dbits,
@Argument(description="The number of stop bits")
org.lsst.ccs.drivers.ascii.Ascii.StopBits sbits,
@Argument(description="The parity")
org.lsst.ccs.drivers.ascii.Ascii.Parity parity,
@Argument(description="The flow control")
org.lsst.ccs.drivers.ascii.Ascii.FlowCtrl flow)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="close",
description="Close connection to device")
public void close()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="setaddress",
description="Set the address mode")
public void setAddress(@Argument(description="The address mode: off or on")
TestModbus.OnOff mode)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="showaddress",
description="Show the address mode")
public void showAddress()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="settimeout",
description="Set the timeout")
public void setTimeout(@Argument(description="The timeout (sec)")
double timeout)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="coilread",
description="Read a set of coils")
public void coilRead(@Argument(description="The Modbus address")
int address,
@Argument(description="First coil to read")
int number,
@Argument(description="Number of coils to read")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="discread",
description="Read a set of discretes")
public void discRead(@Argument(description="The Modbus address")
int address,
@Argument(description="First discrete to read")
int number,
@Argument(description="Number of discretes to read")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="regread",
description="Read a set of registers")
public void regRead(@Argument(description="The Modbus address")
int address,
@Argument(description="First register to read")
int number,
@Argument(description="Number of registers to read")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="inpread",
description="Read a set of inputs")
public void inpRead(@Argument(description="The Modbus address")
int address,
@Argument(description="First input to read")
int number,
@Argument(description="Number of inputs to read")
int count)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="coilwrite",
description="Write a set of coils")
public void coilWrite(@Argument(description="The Modbus address")
int address,
@Argument(description="First coil to write")
int number,
@Argument(description="Values to write")
int... values)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="regwrite",
description="Write a set of registers")
public void regWrite(@Argument(description="The Modbus address")
int address,
@Argument(description="First register to write")
int number,
@Argument(description="Values to write")
int... values)
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2018 LSST. All rights reserved.