jamod at SF

net.wimpi.modbus.msg
Class ExceptionResponse

java.lang.Object
  extended bynet.wimpi.modbus.msg.ModbusMessageImpl
      extended bynet.wimpi.modbus.msg.ModbusResponse
          extended bynet.wimpi.modbus.msg.ExceptionResponse
All Implemented Interfaces:
ModbusMessage, Transportable

public class ExceptionResponse
extends ModbusResponse

Class implementing aModbusResponse that represents an exception.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger

Constructor Summary
ExceptionResponse()
          Constructs a new ExceptionResponse instance.
ExceptionResponse(int fc)
          Constructs a new ExceptionResponse instance with a given function code.
ExceptionResponse(int fc, int exc)
          Constructs a new ExceptionResponse instance with a given function code and an exception code.
 
Method Summary
 int getExceptionCode()
          Returns the Modbus exception code of this ExceptionResponse.
 void readData(java.io.DataInput din)
          Reads the subclass specific data from the given DataInput instance.
 void writeData(java.io.DataOutput dout)
          Writes the subclass specific data to the given DataOutput.
 
Methods inherited from class net.wimpi.modbus.msg.ModbusResponse
createModbusResponse, setMessage
 
Methods inherited from class net.wimpi.modbus.msg.ModbusMessageImpl
getDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionResponse

public ExceptionResponse()
Constructs a new ExceptionResponse instance.


ExceptionResponse

public ExceptionResponse(int fc)
Constructs a new ExceptionResponse instance with a given function code. Adds the exception offset automatically.

Parameters:
fc - the function code as int.

ExceptionResponse

public ExceptionResponse(int fc,
                         int exc)
Constructs a new ExceptionResponse instance with a given function code and an exception code. The function code will be automatically increased with the exception offset.

Parameters:
fc - the function code as int.
exc - the exception code as int.
Method Detail

getExceptionCode

public int getExceptionCode()
Returns the Modbus exception code of this ExceptionResponse.

Returns:
the exception code as int.

writeData

public void writeData(java.io.DataOutput dout)
               throws java.io.IOException
Description copied from class: ModbusMessageImpl
Writes the subclass specific data to the given DataOutput.

Specified by:
writeData in class ModbusMessageImpl
Parameters:
dout - the DataOutput to be written to.
Throws:
java.io.IOException - if an I/O related error occurs.

readData

public void readData(java.io.DataInput din)
              throws java.io.IOException
Description copied from class: ModbusMessageImpl
Reads the subclass specific data from the given DataInput instance.

Specified by:
readData in class ModbusMessageImpl
Parameters:
din - the DataInput to read from.
Throws:
java.io.IOException - if an I/O related error occurs.

jamod at SF

Copyright © 2002-2004 jamod development team.