net.wimpi.modbus.msg
Interface ModbusMessage

All Superinterfaces:
Transportable
All Known Implementing Classes:
ExceptionResponse, IllegalFunctionRequest, ModbusMessageImpl, ModbusRequest, ModbusResponse, ReadCoilsRequest, ReadCoilsResponse, ReadInputDiscretesRequest, ReadInputDiscretesResponse, ReadInputRegistersRequest, ReadInputRegistersResponse, ReadMultipleRegistersRequest, ReadMultipleRegistersResponse, WriteCoilRequest, WriteCoilResponse, WriteMultipleCoilsRequest, WriteMultipleCoilsResponse, WriteMultipleRegistersRequest, WriteMultipleRegistersResponse, WriteSingleRegisterRequest, WriteSingleRegisterResponse

public interface ModbusMessage
extends Transportable

Interface defining a Modbus Message.

Version:
@version@ (@date@)
Author:
Dieter Wimberger

Method Summary
 int getDataLength()
          Returns the length of the data appended after the protocol header.
 int getFunctionCode()
          Returns the function code of this ModbusMessage as int.
The function code is a 1-byte non negative integer value valid in the range of 0-127.
Function codes are ordered in conformance classes their values are specified in net.wimpi.modbus.Modbus.
 String getHexMessage()
          Returns the raw message as String containing a hexadecimal series of bytes.
 int getProtocolID()
          Returns the protocol identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.
 int getTransactionID()
          Returns the transaction identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.
 int getUnitID()
          Returns the unit identifier of this ModbusMessage as int.
The identifier is a 1-byte non negative integer value valid in the range of 0-255.
 void setHeadless()
          Sets the flag that marks this ModbusMessage as headless (for serial transport).
 
Methods inherited from interface net.wimpi.modbus.io.Transportable
getOutputLength, readFrom, writeTo
 

Method Detail

setHeadless

void setHeadless()
Sets the flag that marks this ModbusMessage as headless (for serial transport).


getTransactionID

int getTransactionID()
Returns the transaction identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.

Returns:
the transaction identifier as int.

getProtocolID

int getProtocolID()
Returns the protocol identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.

Returns:
the protocol identifier as int.

getDataLength

int getDataLength()
Returns the length of the data appended after the protocol header.

Returns:
the data length as int.

getUnitID

int getUnitID()
Returns the unit identifier of this ModbusMessage as int.
The identifier is a 1-byte non negative integer value valid in the range of 0-255.

Returns:
the unit identifier as int.

getFunctionCode

int getFunctionCode()
Returns the function code of this ModbusMessage as int.
The function code is a 1-byte non negative integer value valid in the range of 0-127.
Function codes are ordered in conformance classes their values are specified in net.wimpi.modbus.Modbus.

Returns:
the function code as int.
See Also:
Modbus

getHexMessage

String getHexMessage()
Returns the raw message as String containing a hexadecimal series of bytes.
This method is specially for debugging purposes, allowing to log the communication in a manner used in the specification document.

Returns:
the raw message as String containing a hexadecimal series of bytes.


Copyright © 2010. All Rights Reserved.