public final class ReadInputDiscretesRequest extends ModbusRequest
Input Discretes are understood as bits that cannot be manipulated (i.e. set or unset).
| Constructor and Description |
|---|
ReadInputDiscretesRequest()
Constructs a new ReadInputDiscretesRequest
instance.
|
ReadInputDiscretesRequest(int ref,
int count)
Constructs a new ReadInputDiscretesRequest
instance with a given reference and count of input
discretes (i.e. bits) to be read.
|
| Modifier and Type | Method and Description |
|---|---|
ModbusResponse |
createResponse()
Returns the ModbusResponse that
represents the answer to this ModbusRequest.
|
int |
getBitCount()
Returns the number of bits (i.e. input discretes)
to be read with this
ReadInputDiscretesRequest.
|
int |
getReference()
Returns the reference of the register to to start
reading from with this
ReadInputDiscretesRequest.
|
void |
readData(DataInput din)
Reads the subclass specific data from the given DataInput instance.
|
void |
setBitCount(int count)
Sets the number of bits (i.e. input discretes) to be
read with this ReadInputDiscretesRequest.
|
void |
setReference(int ref)
Sets the reference of the register to start reading
from with this ReadInputDiscretesRequest.
|
void |
writeData(DataOutput dout)
Writes the subclass specific data to the given DataOutput.
|
createExceptionResponse, createModbusRequestgetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic ReadInputDiscretesRequest()
public ReadInputDiscretesRequest(int ref,
int count)
ref - the reference number of the register to read from.count - the number of bits to be read.public ModbusResponse createResponse()
ModbusRequestThe implementation should take care about assembling the reply to this ModbusRequest.
createResponse in class ModbusRequestpublic void setReference(int ref)
ref - the reference of the register to start reading from.public int getReference()
public void setBitCount(int count)
count - the number of bits to be read.public int getBitCount()
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.