public final class ReadMultipleRegistersResponse extends ModbusResponse
| Constructor and Description |
|---|
ReadMultipleRegistersResponse()
Constructs a new ReadMultipleRegistersResponse instance.
|
ReadMultipleRegistersResponse(Register[] registers)
Constructs a new ReadInputRegistersResponse instance.
|
| Modifier and Type | Method and Description |
|---|---|
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(DataInput din)
Reads the subclass specific data from the given DataInput instance.
|
void |
writeData(DataOutput dout)
Writes the subclass specific data to the given DataOutput.
|
createModbusResponse, setMessagegetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic ReadMultipleRegistersResponse()
public ReadMultipleRegistersResponse(Register[] registers)
registers - the Register[] holding response registers.public int getByteCount()
public int getWordCount()
public int getRegisterValue(int index)
throws IndexOutOfBoundsException
index - the relative index of the register for which the value should be retrieved.IndexOutOfBoundsException - if the index is out of bounds.public Register getRegister(int index) throws IndexOutOfBoundsException
index - the relative index of the Register.IndexOutOfBoundsException - if the index is out of bounds.public Register[] getRegisters()
public void writeData(DataOutput dout) throws IOException
ModbusMessageImplwriteData in class ModbusMessageImpldout - the DataOutput to be written to.IOException - if an I/O related error occurs.public void readData(DataInput din) throws IOException
ModbusMessageImplreadData in class ModbusMessageImpldin - the DataInput to read from.IOException - if an I/O related error occurs.Copyright © 2017. All rights reserved.