|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wimpi.modbus.io.ModbusSerialTransport net.wimpi.modbus.io.ModbusBINTransport
Class that implements the Modbus/BIN transport flavor.
Field Summary | |
static int |
FRAME_END
Defines a virtual number for the FRAME_END token (CR LF). |
static int |
FRAME_END_TOKEN
Defines the frame end token }. |
static int |
FRAME_START
Defines a virtual number for the FRAME START token (COLON). |
static int |
FRAME_START_TOKEN
Defines the frame start token {. |
Fields inherited from class net.wimpi.modbus.io.ModbusSerialTransport |
m_CommPort, m_Echo |
Constructor Summary | |
ModbusBINTransport()
Constructs a new MobusBINTransport instance. |
Method Summary | |
void |
close()
The close method closes the serial input/output streams. |
void |
prepareStreams(java.io.InputStream in,
java.io.OutputStream out)
Prepares the input and output streams of this ModbusASCIITransport instance. |
ModbusRequest |
readRequest()
The readRequest method listens continuously on the serial
input stream for master request messages and replies if the request slave
ID matches its own set in ModbusCoupler.getUnitID(). |
ModbusResponse |
readResponse()
readResponse reads a response message from the slave
responding to a master writeMessage request. |
void |
writeMessage(ModbusMessage msg)
The writeMessage method writes a modbus serial message to
its serial output stream to a specified slave unit ID. |
Methods inherited from class net.wimpi.modbus.io.ModbusSerialTransport |
isEcho, readEcho, setCommPort, setEcho, setReceiveThreshold, setReceiveTimeout |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FRAME_START
public static final int FRAME_END
public static final int FRAME_START_TOKEN
public static final int FRAME_END_TOKEN
Constructor Detail |
public ModbusBINTransport()
Method Detail |
public void close() throws java.io.IOException
ModbusSerialTransport
close
method closes the serial input/output streams.
close
in interface ModbusTransport
close
in class ModbusSerialTransport
java.io.IOException
- if an error occurspublic void writeMessage(ModbusMessage msg) throws ModbusIOException
ModbusSerialTransport
writeMessage
method writes a modbus serial message to
its serial output stream to a specified slave unit ID.
writeMessage
in interface ModbusTransport
writeMessage
in class ModbusSerialTransport
msg
- a ModbusMessage
value
ModbusIOException
- if an error occurspublic ModbusRequest readRequest() throws ModbusIOException
ModbusSerialTransport
readRequest
method listens continuously on the serial
input stream for master request messages and replies if the request slave
ID matches its own set in ModbusCoupler.getUnitID().
readRequest
in interface ModbusTransport
readRequest
in class ModbusSerialTransport
ModbusRequest
value
ModbusIOException
- if an error occurspublic ModbusResponse readResponse() throws ModbusIOException
ModbusSerialTransport
readResponse
reads a response message from the slave
responding to a master writeMessage request.
readResponse
in interface ModbusTransport
readResponse
in class ModbusSerialTransport
ModbusResponse
value
ModbusIOException
- if an error occurspublic void prepareStreams(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
prepareStreams
in class ModbusSerialTransport
in
- the input stream to be used for reading.out
- the output stream to be used for writing.
java.io.IOException
- if an I\O related error occurs.
|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |