 |
Lydia - Printhead
|
Go to the documentation of this file.
5 #include <ArduinoLog.h>
18 #define HAS_DEBUG_MODBUS_BRIDGE_PRINT_QUEUE
21 #define MasterModbusAdd 0
121 millis_t t = millis();
149 millis_t t = millis();
150 Query *oldest = NULL;
175 millis_t t = millis();
176 Query *oldest = NULL;
208 Query *oldest = NULL;
214 if (q->
addr == addr && q->
fn == fn && q->
value == value && q->
slave == slave)
237 if (q->
addr == addr && q->
fn == fn && q->
value == value && q->
slave == slave)
253 if (q->
addr == addr && q->
fn == fn && q->
value == value && q->
slave == slave)
275 #ifdef HAS_DEBUG_MODBUS_BRIDGE_PRINT_QUEUE
276 Serial.print(
"----- Queries : --- ");
277 Serial.print(
"Proccessing : ");
279 Serial.print(
" | QUEUED : ");
281 Serial.print(
" | DONE: ");
283 Serial.print(
" | ADDR: ");
285 Serial.print(
" | FN: ");
287 Serial.print(
" | NOW : ");
288 Serial.print(millis());
289 Serial.print(
"-----\n");
298 Serial.print(
". \t ");
322 ComponentFnPtr _responseFn)
336 #ifdef HAS_DEBUG_MODBUS_BRIDGE_PRINT_QUERY
339 Serial.print(
"\n --------------Modbus QUERY --------- SLAVE : ");
341 Serial.print(
" | FN : ");
343 Serial.print(
" | NB : ");
345 Serial.print(
" | Address : ");
346 Serial.print(
cAddr, HEX);
347 Serial.print(
" | STATE : ");
349 Serial.print(
" | OWNER : ");
350 Serial.println(
rOwner->id);
351 Serial.println(
" \n ");
372 #ifdef HAS_DEBUG_MODBUS_BRIDGE_PRINT_QUERY
375 Serial.print(
"\n --------------Modbus QUERY --------- SLAVE : ");
377 Serial.print(
" | FN : ");
379 Serial.print(
" | NB : ");
381 Serial.print(
" | Address : ");
382 Serial.print(
cAddr, HEX);
383 Serial.print(
" | STATE : ");
385 Serial.print(
" | OWNER : ");
387 Serial.println(
" \n ");
451 long onMessageError = 0;
455 c->onResponse(onMessageError);
517 long onMessageError = 0;
#define MODBUS_RS485_BAUDRATE
bool skipRead(int slave, int fn, int addr, int num, int prio)
void setTimeOut(uint16_t u16timeout)
write communication watch-dog timer
uint16_t getErrCnt()
error counter
Query * nextByPrio(uchar state, int prio)
int numByState(int state=DONE)
#define MODBUS_TCP_MAX_REGISTERS
Master query structure: This includes all the necessary fields to make the Master generate a Modbus q...
short query(int slave, short function, long start, int coils, Component *_owner, ComponentFnPtr _responseFn)
uint16_t ModbusSlaveRegisters[8]
Query queries[MAX_QUERY_BUFFER]
Query * nextSame(uchar state, short slave, int addr, short fn, int value)
Query * nextQueryByState(uchar state=DONE, int owner=-1)
#define MODBUS_MAX_LIFESPAN
void setDebugSend(bool debug)
int8_t query(modbus_t telegram)
only for master
#define MB_QUERY_TYPE_CMD
#define MODBUS_TCP_DEFAULT_REGISTER_VALUE
uint8_t rxBuffer[MAX_BUFFER]
int numSameOwner(uchar state, short slave, int addr, short fn, int value, int owner)
#define MODBUS_RS485_PORT
int numSame(uchar state, short slave, int addr, short fn, int value)
#define MODBUS_RS485_TIMEOUT
Query * nextQueryByState2(uchar state, int owner)
uint16_t ModbusSlaveRegisters[8]
#define MODBUS_QUEUE_MIN_FREE
#define MODBUS_SAME_REQUEST_INTERVAL
Query * nextQueryByOwner(uchar state=DONE, int owner=-1)
uint8_t getLastError()
get last error message
Modbus master(MasterModbusAdd, RS485Serial)
ComponentFnPtr responseFn
void begin(long u32speed)
Initialize class object.
int8_t poll()
cyclic poll for master
Arduino class library for communicating with Modbus devices over USB/RS232/485 (via RTU protocol).