From 0a4e70479be7a128a040cc73947d583836de0564 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 14 Aug 2024 00:00:22 +0300 Subject: [PATCH] Modbus attempts counter reset & silence timer fix --- lighthub/modules/out_modbus.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lighthub/modules/out_modbus.cpp b/lighthub/modules/out_modbus.cpp index c465707..eeebb83 100644 --- a/lighthub/modules/out_modbus.cpp +++ b/lighthub/modules/out_modbus.cpp @@ -563,6 +563,7 @@ if (prefetchObj && (prefetchObj->type == aJson_Boolean) && prefetchObj->valueboo node.setResponseBuffer(&localBuffer,1); bool successRead = readModbus(regObj->valueint,modbusRegType,1); + mbusSlenceTimer = millisNZ(); if (successRead) @@ -703,7 +704,8 @@ if (itemParametersObj && itemParametersObj->type ==aJson_Object) switch (sendRes) { case 1: //success - execObj->subtype&=~ MB_NEED_SEND; + //execObj->subtype&=~ MB_NEED_SEND; + execObj->subtype = 0; onceSendOk=true; ///return 1; //relax break; @@ -716,7 +718,8 @@ if (itemParametersObj && itemParametersObj->type ==aJson_Object) case -3: errorSerial<name<valueint= - execObj->subtype&=~ MB_NEED_SEND; + //execObj->subtype&=~ MB_NEED_SEND; + execObj->subtype = 0; break; default: //param not found errorSerial<name<