This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

check slave tcp/IP modbus device status
#1
Hello,

big thank for the script in this thread wich work for rtu and gateway check:

https://forum.logicmachine.net/showthrea...6#pid19306



I created another one for all of them:

Code:
function checkAllModbus(resultCheckTemp)
  local retour_modbus = ''
 
  local res = db:getall('SELECT name FROM modbus_devices WHERE active=?', 0)
  if res then
    for _, liste_modbus in ipairs(res) do
       local nomFamille = nomVersFamille(liste_modbus.name)
      retour_modbus=retour_modbus .. '[' ..nomFamille ..']'   
      end
  end
  --log( retour_modbus)
  return retour_modbus
end
-----------------




In order to see the active status !



It works, but my problem is that with tcp modbus (through a smartlink in tcp/ip modbus). When I setup a powertag for exemple, when the powertag is offline, we have error in modbus error table, but the device don't become inactive, it still active (I think because the smartlink still respond). You can easily test by putting a wrong slave adress ! My device still stay active !



So I can only easily have the smartlink defaut but not the slave device (powertag radio), or I need to put a script to check modbus table error (but my problem is that the customer want only one error (not every time the modbus error table display it). So for 150 device it's a little bit Power consumer...



do you have solution ?



Here screenshot:

[Image: attachment.php?aid=1903]   



Here the result:

[Image: attachment.php?aid=1904]   



edit: I don't put the right device on the last screenshot, but it the same for the 24





regards
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
Reply


Messages In This Thread
check slave tcp/IP modbus device status - by domotiqa - 23.11.2020, 07:56

Forum Jump: