|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wimpi.modbus.msg.ModbusMessageImpl net.wimpi.modbus.msg.ModbusResponse net.wimpi.modbus.msg.ReadMultipleRegistersResponse
Class implementing a ReadMultipleRegistersResponse. The implementation directly correlates with the class 0 function read multiple registers (FC 3). It encapsulates the corresponding response message.
Constructor Summary | |
ReadMultipleRegistersResponse()
Constructs a new ReadMultipleRegistersResponse instance. |
|
ReadMultipleRegistersResponse(Register[] registers)
Constructs a new ReadInputRegistersResponse instance. |
Method Summary | |
int |
getByteCount()
Returns the number of bytes that have been read. |
Register |
getRegister(int index)
Returns the Register at the given position (relative to the reference used in the request). |
Register[] |
getRegisters()
Returns a reference to the array of registers read. |
int |
getRegisterValue(int index)
Returns the value of the register at the given position (relative to the reference used in the request) interpreted as unsigned short. |
int |
getWordCount()
Returns the number of words that have been read. |
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 |
public ReadMultipleRegistersResponse()
public ReadMultipleRegistersResponse(Register[] registers)
registers
- the Register[] holding response registers.Method Detail |
public int getByteCount()
public int getWordCount()
public int getRegisterValue(int index) throws java.lang.IndexOutOfBoundsException
index
- the relative index of the register
for which the value should be retrieved.
java.lang.IndexOutOfBoundsException
- if
the index is out of bounds.public Register getRegister(int index) throws java.lang.IndexOutOfBoundsException
index
- the relative index of the Register.
java.lang.IndexOutOfBoundsException
- if
the index is out of bounds.public Register[] getRegisters()
public void writeData(java.io.DataOutput dout) throws java.io.IOException
ModbusMessageImpl
writeData
in class ModbusMessageImpl
dout
- the DataOutput to be written to.
java.io.IOException
- if an I/O related error occurs.public void readData(java.io.DataInput din) throws java.io.IOException
ModbusMessageImpl
readData
in class ModbusMessageImpl
din
- the DataInput to read from.
java.io.IOException
- if an I/O related error occurs.
|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |