jamod at SF

net.wimpi.modbus.msg
Class WriteSingleRegisterResponse

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

public final class WriteSingleRegisterResponse
extends ModbusResponse

Class implementing a WriteSingleRegisterResponse. The implementation directly correlates with the class 0 function write single register (FC 6). It encapsulates the corresponding response message.

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

Constructor Summary
WriteSingleRegisterResponse()
          Constructs a new WriteSingleRegisterResponse instance.
WriteSingleRegisterResponse(int reference, int value)
          Constructs a new WriteSingleRegisterResponse instance.
 
Method Summary
 int getReference()
          Returns the reference of the register that has been written to.
 int getRegisterValue()
          Returns the value that has been returned in this WriteSingleRegisterResponse.
 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

WriteSingleRegisterResponse

public WriteSingleRegisterResponse()
Constructs a new WriteSingleRegisterResponse instance.


WriteSingleRegisterResponse

public WriteSingleRegisterResponse(int reference,
                                   int value)
Constructs a new WriteSingleRegisterResponse instance.

Parameters:
reference - the offset of the register written.
value - the value of the register.
Method Detail

getRegisterValue

public int getRegisterValue()
Returns the value that has been returned in this WriteSingleRegisterResponse.

Returns:
the value of the register.

getReference

public int getReference()
Returns the reference of the register that has been written to.

Returns:
the reference of the written register.

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.