|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jmodbus.ModbusRegisterBank
Class to represent the registers (16 bit data items) in a Modbus device. The classes uses int varibales internally to represent registers as the minimum block allocation of memory for a JVM is 4 bytes so using a short etc.. does not make any difference. *
Constructor Summary | |
ModbusRegisterBank(int register_size)
Class constructor that, given the size of the register bank required, will allocate suficient memory for the register bank and initilize all the values to zero |
Method Summary | |
int |
getNumberRegisters()
Get the size of this bank of registers. |
int |
getRegister(int index)
Gets the value of a particular register. |
int[] |
getRegisters(int index,
int length)
Gets the value of a particular block of registers. |
void |
setRegister(int index,
int value)
Sets the value of a particular register. |
void |
setRegister(int index,
int[] regs)
Sets the value of a particular block of registers. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ModbusRegisterBank(int register_size)
coils_size
- The number of registers to be created in
this register bank.Method Detail |
public int getNumberRegisters()
public int getRegister(int index)
NOTE: Attempting to get a register outside the range of this register bank will result in a ArrayIndexOutOfBoundsException being thrown
index
- The address of the desired register (note that
this is a zero based index)public void setRegister(int index, int value)
NOTE: Attempting to set a register outside the range of this register bank will result in a ArrayIndexOutOfBoundsException being thrown
index
- The address of the desired register (note that
this is a zero based index)value
- The value of the register to be set.public int[] getRegisters(int index, int length)
NOTE: Attempting to get a register outside the range of this register bank will result in a ArrayIndexOutOfBoundsException being thrown
index
- The address of the desired starting register (note
that this is a zero based index)length
- The number of registers to be retrievedpublic void setRegister(int index, int[] regs)
NOTE: Attempting to set a register outside the range of this register bank will result in a ArrayIndexOutOfBoundsException being thrown
index
- The address of the desired starting register (note
that this is a zero based index)coil_set
- Array of ints containing the values
of the registers to be set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |