ch.hevs.isi.field

## Class ModbusAccessor

- java.lang.Object
- - ch.hevs.isi.field.ModbusAccessor

    public class ModbusAccessor
    extends java.lang.Object

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `connect(java.lang.String ipAddress, int port)` this method creates a ModbusFactory and a TCPMaster it also initialize the Master
`static ModbusAccessor` `getMySelf()` static method to create a singleton pattern of the class checks if an instance of the class is already made if not, it creates an instance of the class ModbusAccessor
`boolean` `readBoolean(int register)` method to read a boolean value in the correct modbus register get the coil status of the register.
`float` `readFloat(int register)` method to read a boolean value in the correct modbus register get the value from the holding register
`void` `writeBoolean(int register, boolean value)` method to write a boolean value in the correct modbus register
`void` `writeFloat(int register, float value)` method to write a float value in the correct modbus register

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getMySelf

    public static ModbusAccessor getMySelf()

static method to create a singleton pattern of the class checks if an instance of the class is already made if not, it creates an instance of the class ModbusAccessor

Returns:
  instance of ModbusAccessor

#### connect

    public void connect(java.lang.String ipAddress,
                        int port)

this method creates a ModbusFactory and a TCPMaster it also initialize the Master

Parameters:
  `ipAddress` - IP-address of the server
  `port` - port of the server

#### writeBoolean

    public void writeBoolean(int register,
                             boolean value)

method to write a boolean value in the correct modbus register

Parameters:
  `register` - address of the register
  `value` - the desired boolean value

#### writeFloat

    public void writeFloat(int register,
                           float value)

method to write a float value in the correct modbus register

Parameters:
  `register` - address of the register
  `value` - the desired float value

#### readBoolean

    public boolean readBoolean(int register)

method to read a boolean value in the correct modbus register get the coil status of the register.

Parameters:
  `register` - address of register
Returns:
  boolean value of the desired register

#### readFloat

    public float readFloat(int register)

method to read a boolean value in the correct modbus register get the value from the holding register

Parameters:
  `register` - address of the register
Returns:
  float value of the desired register