|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.msg.ModbusMessageImpl
net.wimpi.modbus.msg.ModbusResponse
net.wimpi.modbus.msg.WriteSingleRegisterResponse
public final class WriteSingleRegisterResponse
Class implementing a WriteSingleRegisterResponse. The implementation directly correlates with the class 0 function write single register (FC 6). It encapsulates the corresponding response message.
| Field Summary | |
|---|---|
private int |
m_Reference
|
private int |
m_RegisterValue
|
| Constructor Summary | |
|---|---|
WriteSingleRegisterResponse()
Constructs a new WriteSingleRegisterResponse instance. |
|
WriteSingleRegisterResponse(int reference,
int value)
Constructs a new WriteSingleRegisterResponse instance. |
|
| Method Summary | |
|---|---|
int |
getReference()
Returns the reference of the register that has been written to. |
int |
getRegisterValue()
Returns the value that has been returned in this WriteSingleRegisterResponse. |
void |
readData(DataInput din)
Reads the subclass specific data from the given DataInput instance. |
private void |
setReference(int ref)
Sets the reference of the register that has been written to. |
private void |
setRegisterValue(int value)
Sets the value that has been returned in the response message. |
void |
writeData(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 |
| Field Detail |
|---|
private int m_Reference
private int m_RegisterValue
| Constructor Detail |
|---|
public WriteSingleRegisterResponse()
public WriteSingleRegisterResponse(int reference,
int value)
reference - the offset of the register written.value - the value of the register.| Method Detail |
|---|
public int getRegisterValue()
private void setRegisterValue(int value)
value - the returned register value.public int getReference()
private void setReference(int ref)
ref - the reference of the written register.
public void writeData(DataOutput dout)
throws IOException
ModbusMessageImpl
writeData in class ModbusMessageImpldout - the DataOutput to be written to.
IOException - if an I/O related error occurs.
public void readData(DataInput din)
throws IOException
ModbusMessageImpl
readData in class ModbusMessageImpldin - the DataInput to read from.
IOException - if an I/O related error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||