public class WriteMultipleCoilsResponse extends ModbusResponse
Coils are understood as bits that can be manipulated (i.e. set or cleared).
ModbusResponse.AuxiliaryMessageTypes| Constructor and Description |
|---|
WriteMultipleCoilsResponse()
Constructs a new WriteMultipleCoilsResponse instance.
|
WriteMultipleCoilsResponse(int ref,
int count)
Constructs a new WriteMultipleCoilsResponse instance with a
given count of coils and starting reference.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getBitCount()
getBitCount - Returns the quantity of coils written with the request.
|
byte[] |
getMessage()
Returns the raw message as an array of bytes.
|
int |
getReference()
getReference - Returns the reference of the coil to start reading from
with this WriteMultipleCoilsResponse.
|
void |
readData(DataInput din)
readData - Initialize the attribute values for this message from the
input buffer.
|
void |
setBitCount(int count)
setBitCount - Sets the number of coils that will be in a response.
|
void |
setReference(int ref)
setReference - Sets the reference to the coil that is the first coil in
this response.
|
void |
writeData(DataOutput dout)
writeData - Copy the attribute values for this message to the output
buffer.
|
createModbusResponse, getAuxiliaryType, setAuxiliaryTypegetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic WriteMultipleCoilsResponse(int ref,
int count)
ref - the offset to begin writing from.count - the number of coils to be written.public WriteMultipleCoilsResponse()
public int getReference()
public void setReference(int ref)
ref - Rgister address of coilpublic int getBitCount()
public void setBitCount(int count)
count - the number of coils in the response.public void writeData(DataOutput dout) throws IOException
writeData in class ModbusMessageImpldout - the DataOutput to be written to.IOException - If the data cannot be writtenpublic void readData(DataInput din) throws IOException
readData in class ModbusMessageImpldin - the DataInput to read from.IOException - If the data cannot be readpublic byte[] getMessage()
ModbusMessageCopyright © 2025. All Rights Reserved.