Modbus Master and Slave for Arduino
1.2
Arduino library for implementing a Modbus Master or Slave through Serial port
|
Functions | |
Modbus::Modbus () | |
Default Constructor for Master through Serial. More... | |
void | Modbus::begin (long u32speed) |
Initialize class object. More... | |
void | Modbus::setID (uint8_t u8id) |
write new ID for the slave More... | |
uint8_t | Modbus::getID () |
get slave ID between 1 and 247 More... | |
void | Modbus::setTimeOut (uint16_t u16timeout) |
write communication watch-dog timer More... | |
void Modbus::begin | ( | long | u32speed) |
Initialize class object.
Sets up the serial port using specified baud rate. Call once class has been instantiated, typically within setup().
speed | baud rate, in standard increments (300..115200) |
config | data frame settings (data length, parity and stop bits) |
Definition at line 250 of file ModbusRtu.h.
uint8_t Modbus::getID | ( | ) |
get slave ID between 1 and 247
Method to read current slave ID address.
Definition at line 323 of file ModbusRtu.h.
Modbus::Modbus | ( | ) |
Default Constructor for Master through Serial.
Definition at line 204 of file ModbusRtu.h.
void Modbus::setID | ( | uint8_t | u8id) |
write new ID for the slave
Method to write a new slave ID address.
u8id | new slave address between 1 and 247 |
Definition at line 310 of file ModbusRtu.h.
void Modbus::setTimeOut | ( | uint16_t | u16timeOut) |
write communication watch-dog timer
Initialize time-out parameter.
Call once class has been instantiated, typically within setup(). The time-out timer is reset each time that there is a successful communication between Master and Slave. It works for both.
time-out | value (ms) |
Definition at line 338 of file ModbusRtu.h.