net.sourceforge.jmodbus
Class ModbusMessage

java.lang.Object
  |
  +--net.sourceforge.jmodbus.ModbusMessage

public class ModbusMessage
extends java.lang.Object

Class to represent a Modbus message. This will encapsulate all the elements of a message that should be considered common to all implementations of Modbus, even if some elements are not used.

WARNING: This class is currently very weak and does not offer protection that incorrect message lengths etc... will not be set. It shoudl also use get/set methods eventually but we first need to examine how much overhead that will create for the system.


Field Summary
 byte[] buff
          The byte array containing the message.
 int length
          Length field to indicate how much of the byte buffer contains valid data.
 int transID
          The transaction ID of this message, this is only really used by the TCP implementations.
 
Constructor Summary
ModbusMessage()
          Class constructor that will allocate memory for the byte buffer and initilize the message object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buff

public byte[] buff
The byte array containing the message. This is fixed in length to the maximum length, use the length field to check it's length.

length

public int length
Length field to indicate how much of the byte buffer contains valid data.

transID

public int transID
The transaction ID of this message, this is only really used by the TCP implementations.
Constructor Detail

ModbusMessage

public ModbusMessage()
Class constructor that will allocate memory for the byte buffer and initilize the message object.