Modbus Master and Slave for Arduino
1.2
Arduino library for implementing a Modbus Master or Slave through Serial port
|
Functions | |
boolean | Modbus::getTimeOutState () |
get communication watch-dog timer state More... | |
int8_t | Modbus::query (modbus_t telegram) |
only for master More... | |
int8_t | Modbus::poll () |
cyclic poll for master More... | |
int8_t | Modbus::poll (uint16_t *regs, uint8_t u8size) |
cyclic poll for slave More... | |
boolean Modbus::getTimeOutState | ( | ) |
get communication watch-dog timer state
Return communication Watchdog state. It could be usefull to reset outputs if the watchdog is fired.
Definition at line 350 of file ModbusRtu.h.
int8_t Modbus::poll | ( | ) |
cyclic poll for master
*** Only for Modbus Master *** This method checks if there is any incoming answer if pending. If there is no answer, it would change Master state to COM_IDLE. This method must be called only at loop section. Avoid any delay() function.
Any incoming data would be redirected to au16regs pointer, as defined in its modbus_t query telegram.
nothing
Definition at line 513 of file ModbusRtu.h.
int8_t Modbus::poll | ( | uint16_t * | regs, |
uint8_t | u8size | ||
) |
cyclic poll for slave
*** Only for Modbus Slave *** This method checks if there is any incoming query Afterwards, it would shoot a validation routine plus a register query Avoid any delay() function !!!! After a successful frame between the Master and the Slave, the time-out timer is reset.
*regs | register table for communication exchange |
u8size | size of the register table |
Definition at line 588 of file ModbusRtu.h.
int8_t Modbus::query | ( | modbus_t | telegram) |
only for master
*** Only Modbus Master *** Generate a query to an slave with a modbus_t telegram structure The Master must be in COM_IDLE mode. After it, its state would be COM_WAITING. This method has to be called only in loop() section.
modbus_t | modbus telegram structure (id, fct, ...) |
Definition at line 425 of file ModbusRtu.h.