public class ExceptionResponse extends ModbusResponse
ModbusResponse.AuxiliaryMessageTypes| Constructor and Description |
|---|
ExceptionResponse()
Constructs a new ExceptionResponse instance with no function
or exception code.
|
ExceptionResponse(int fc)
Constructs a new ExceptionResponse instance with a given
function code.
|
ExceptionResponse(int fc,
int exc)
Constructs a new ExceptionResponse instance with a given
function code and an exception code.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getExceptionCode()
Returns the Modbus exception code of this ExceptionResponse.
|
byte[] |
getMessage()
getMessage()
return the exception type, which is the "message" for this response.
|
void |
readData(DataInput din)
readData()
read the single byte of data, which is the exception code.
|
void |
writeData(DataOutput dout)
Writes the subclass specific data to the given DataOutput.
|
createModbusResponse, getAuxiliaryType, setAuxiliaryTypegetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic ExceptionResponse(int fc,
int exc)
fc - the function code as int.exc - the exception code as int.public ExceptionResponse(int fc)
fc - the function code as int.public ExceptionResponse()
public int getExceptionCode()
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
readData in class ModbusMessageImpldin - the DataInput to read from.IOException - If the data cannot be read from the socket/portpublic byte[] getMessage()
Copyright © 2025. All Rights Reserved.