Modbus Class Reference

Arduino class library for communicating with Modbus devices over USB/RS232/485 (via RTU protocol). More...

`#include <ModbusRtu.h>`

## Public Member Functions

| Modbus ()
| Default Constructor for Master through Serial. More...
| Modbus (uint8_t u8id, uint8_t u8serno)
| Modbus (uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin)
void | begin (long u32speed)
| Initialize class object. More...
void | begin ()
void | setTimeOut (uint16_t u16timeout)
| write communication watch-dog timer More...
uint16_t | getTimeOut ()
| get communication watch-dog timer value More...
boolean | getTimeOutState ()
| get communication watch-dog timer state More...
int8_t | query (modbus_t telegram)
| only for master More...
int8_t | poll ()
| cyclic poll for master More...
int8_t | poll (uint16_t *regs, uint8_t u8size)
| cyclic poll for slave More...
uint16_t | getInCnt ()
| number of incoming messages More...
uint16_t | getOutCnt ()
| number of outcoming messages More...
uint16_t | getErrCnt ()
| error counter More...
uint8_t | getID ()
| get slave ID between 1 and 247 More...
uint8_t | getState ()
uint8_t | getLastError ()
| get last error message More...
void | setID (uint8_t u8id)
| write new ID for the slave More...
void | end ()
| finish any communication and release serial communication port More...

## Detailed Description

Arduino class library for communicating with Modbus devices over USB/RS232/485 (via RTU protocol).

Definition at line 141 of file ModbusRtu.h.

## Constructor & Destructor Documentation

Modbus::Modbus | ( | uint8_t | u8id,
|  | uint8_t | u8serno
| ) |  |

Definition at line 218 of file ModbusRtu.h.

Modbus::Modbus | ( | uint8_t | u8id,
|  | uint8_t | u8serno,
|  | uint8_t | u8txenpin
| ) |  |

Definition at line 234 of file ModbusRtu.h.

## Member Function Documentation

void Modbus::begin | ( | ) |  |

Definition at line 299 of file ModbusRtu.h.

void Modbus::end | ( | ) |  |

finish any communication and release serial communication port

uint16_t Modbus::getTimeOut | ( | ) |  |

get communication watch-dog timer value

The documentation for this class was generated from the following file:

- ModbusRtu.h