Modbus base class.
More...
#include <Modbus.h>
|
void | addCoil (word offset, bool value=false) |
| Add a coil. More...
|
|
void | addHreg (word offset, word value=0) |
| Add a holding register to the list. More...
|
|
void | addIreg (word offset, word value=0) |
| Add a input register. More...
|
|
void | addIsts (word offset, bool value=false) |
| Add a discrete input. More...
|
|
bool | Coil (word offset, bool value) |
| Change the value of a coil This value will be returned when bus read, the master can also modify it. More...
|
|
bool | Coil (word offset) |
| Return the value of a coil. More...
|
|
bool | Hreg (word offset, word value) |
| Change the value of a holding register This value will be returned when bus read, the master can also modify it. More...
|
|
word | Hreg (word offset) |
| Return the value of a holding register. More...
|
|
bool | Ireg (word offset, word value) |
| Change the value of an input register This value will be returned when bus read. More...
|
|
word | Ireg (word offset) |
| Return the value of an input register. More...
|
|
bool | Ists (word offset, bool value) |
| Change the value of a discrete input This value will be returned when bus read,. More...
|
|
bool | Ists (word offset) |
| Return the value of a discrete input. More...
|
|
| Modbus () |
| Default constructor. More...
|
|
Modbus base class.
Definition at line 53 of file Modbus.h.
void Modbus::addCoil |
( |
word |
offset, |
|
|
bool |
value = false |
|
) |
| |
Add a coil.
- Parameters
-
offset | coil offset (PDU addressing: 0-9999) |
value | default value |
void Modbus::addHreg |
( |
word |
offset, |
|
|
word |
value = 0 |
|
) |
| |
Add a holding register to the list.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
value | default value |
void Modbus::addIreg |
( |
word |
offset, |
|
|
word |
value = 0 |
|
) |
| |
Add a input register.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
value | default value |
void Modbus::addIsts |
( |
word |
offset, |
|
|
bool |
value = false |
|
) |
| |
Add a discrete input.
- Parameters
-
offset | input offset (PDU addressing: 0-9999) |
value | default value |
bool Modbus::Coil |
( |
word |
offset, |
|
|
bool |
value |
|
) |
| |
Change the value of a coil This value will be returned when bus read, the master can also modify it.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
value | new value |
- Returns
- true, false if coil not found.
bool Modbus::Coil |
( |
word |
offset | ) |
|
Return the value of a coil.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
- Returns
- coil value
bool Modbus::Hreg |
( |
word |
offset, |
|
|
word |
value |
|
) |
| |
Change the value of a holding register This value will be returned when bus read, the master can also modify it.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
value | new value |
- Returns
- true, false if register not found.
word Modbus::Hreg |
( |
word |
offset | ) |
|
Return the value of a holding register.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
- Returns
- register value
bool Modbus::Ireg |
( |
word |
offset, |
|
|
word |
value |
|
) |
| |
Change the value of an input register This value will be returned when bus read.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
value | new value |
- Returns
- true, false if register not found.
word Modbus::Ireg |
( |
word |
offset | ) |
|
Return the value of an input register.
- Parameters
-
offset | register offset (PDU addressing: 0-9999) |
- Returns
- register value
bool Modbus::Ists |
( |
word |
offset, |
|
|
bool |
value |
|
) |
| |
Change the value of a discrete input This value will be returned when bus read,.
- Parameters
-
offset | input offset (PDU addressing: 0-9999) |
value | new value |
- Returns
- true, false if input not found.
bool Modbus::Ists |
( |
word |
offset | ) |
|
Return the value of a discrete input.
- Parameters
-
offset | input offset (PDU addressing: 0-9999) |
- Returns
- input value