|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jmodbus.ModbusASCIITransport
Class to implement a ASCII transport mechanisim for Modbus communication. This will allow a decice to communicate a serial link, using ASCII encoding of the data.
Field Summary | |
static byte |
END_FRAME_MARKER_1
The first character of the end of frame marker for Modbus ASCII messages. |
static byte |
END_FRAME_MARKER_2
The first character of the end of frame marker for Modbus ASCII messages. |
static int |
MAX_ASCII_MESSAGE_LENGTH
The maximum length of a Modbus ASCII message that is based on the maximum length of a Modbus message, with 2 characters per byte encoding and start and end delimiters. |
static byte |
START_FRAME_MARKER
The start of frame marker for Modbus ASCII messages. |
Constructor Summary | |
ModbusASCIITransport()
Default constructor that will create it's own serial port connection with the default port settings. |
|
ModbusASCIITransport(javax.comm.SerialPort port)
Constructor that passes a open serial port. |
Method Summary | |
boolean |
receiveFrame(ModbusMessage msg)
Method to receive a Modbus frame via the transport media. |
boolean |
sendFrame(ModbusMessage msg)
Method to send a Modbus frame via the transport media. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte START_FRAME_MARKER
public static final byte END_FRAME_MARKER_1
public static final byte END_FRAME_MARKER_2
public static final int MAX_ASCII_MESSAGE_LENGTH
Constructor Detail |
public ModbusASCIITransport()
public ModbusASCIITransport(javax.comm.SerialPort port)
port
- The serial port to conduct serial communications
over.Method Detail |
public boolean sendFrame(ModbusMessage msg)
sendFrame
in interface ModbusTransport
msg
- The Modbus Message to be sent.public boolean receiveFrame(ModbusMessage msg)
Even if false is return the Modbus Message that is passed may be modified. It's buffer is used to save excessive array copying.
receiveFrame
in interface ModbusTransport
msg
- The Modbus Message object for received data to be written into
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |