public class ReadMEIRequest extends ModbusRequest
| Constructor and Description |
|---|
ReadMEIRequest()
Constructs a new Read MEI Data request instance.
|
ReadMEIRequest(int level,
int id)
Constructs a new Read MEI Data request instance with a given
reference and count of coils (i.e.
|
| Modifier and Type | Method and Description |
|---|---|
ModbusResponse |
createResponse(AbstractModbusListener listener)
Returns the ModbusResponse that represents the answer to this
ModbusRequest.
|
int |
getFieldId()
Returns the number of bits (i.e.
|
int |
getLevel()
Returns the reference of the register to to start reading from with this
ReadCoilsRequest.
|
byte[] |
getMessage()
Returns the raw message as an array of bytes.
|
ModbusResponse |
getResponse()
Returns the ModbusResponse that correlates with this
ModbusRequest.
|
int |
getSubCode()
Gets the MEI subcode associated with this request.
|
void |
readData(DataInput din)
Reads the subclass specific data from the given DataInput instance.
|
void |
setFieldId(int id)
Sets the number of bits (i.e.
|
void |
setLevel(int level)
Sets the reference of the register to start reading from with this
ReadCoilsRequest.
|
void |
writeData(DataOutput dout)
Writes the subclass specific data to the given DataOutput.
|
createExceptionResponse, createModbusRequestgetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic ReadMEIRequest()
public ReadMEIRequest(int level,
int id)
level - the reference number of the register to read from.id - the number of bits to be read.public ModbusResponse getResponse()
ModbusRequestThe response must include the unit number, function code, as well as any transport-specific header information.
This method is used to create an empty response which must be populated by the caller. It is commonly used to un-marshal responses from Modbus slaves.
getResponse in class ModbusRequestpublic ModbusResponse createResponse(AbstractModbusListener listener)
ModbusRequestThe implementation should take care about assembling the reply to this ModbusRequest.
This method is used to create responses from the process image associated with the listener. It is commonly used to implement Modbus slave instances.
createResponse in class ModbusRequestlistener - Listener that received the requestpublic int getSubCode()
public int getLevel()
public void setLevel(int level)
level - the reference of the register to start reading from.public int getFieldId()
public void setFieldId(int id)
id - the number of bits to be read.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.public byte[] getMessage()
ModbusMessageCopyright © 2025. All Rights Reserved.