org.avineas.modbus
public class WriteMultipleRegistersRequest extends ModbusRequest
| Modifier and Type | Field and Description |
|---|---|
static int |
FUNCTION |
| Constructor and Description |
|---|
WriteMultipleRegistersRequest(int startAddress,
byte[] values)
Constructor to use in master mode to write registers at a specific slave with byte values.
|
WriteMultipleRegistersRequest(int startAddress,
int[] values) |
WriteMultipleRegistersRequest(int startAddress,
int[] values,
int size)
Constructor to use in master mode to write registers at a specific slave.
|
WriteMultipleRegistersRequest(ModbusRequest request)
Constructor used in slave mode after it is determined that the request received is
a write request.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfRegisters()
Get the number of registers written as requested in the message.
|
byte[] |
getPlcRegisterContent()
Get the PLC register values as byte array.
|
int |
getStartAddress()
Get the start address as requested in the message.
|
int[] |
getValues()
Get the values as integer array.
|
decode, encode, getFunction, toBytespublic static final int FUNCTION
public WriteMultipleRegistersRequest(int startAddress,
int[] values,
int size)
startAddress - The start address where to start writingvalues - The values to write as word address valuessize - The number of items in the values bufferpublic WriteMultipleRegistersRequest(int startAddress,
int[] values)
public WriteMultipleRegistersRequest(int startAddress,
byte[] values)
startAddress - The start address where to start writingvalues - The byte values to write as word address valuespublic WriteMultipleRegistersRequest(ModbusRequest request) throws java.lang.IllegalArgumentException
request - The request receivedjava.lang.IllegalArgumentException - In case the request isn't a write requestpublic int getStartAddress()
public int getNumberOfRegisters()
public int[] getValues()
public byte[] getPlcRegisterContent()