Community discussions

MikroTik App
 
sjfp
just joined
Topic Author
Posts: 7
Joined: Fri Mar 04, 2022 2:10 pm

Trap Modbus Error

Sat Apr 16, 2022 6:34 pm

Hi looking for help on trapping a modbus illegal data address error so that the script will continues to work.
Currently using a loop script to run through the meter addresses and send IoT values using MQTT

:for i from=1 to=8 do={
:local modbusread [/iot modbus read-holding-registers slave-id=$i num-regs=1 reg-addr=2816 as-value once];
:local kw [put [($modbusread->"values")]]

But the script stops when a modbus meter between 1 to 8 is missing (say meter 6 is missing) then we dont get a reading for meters 7 & 8.
I need the script to continue and add the missing the meter address (in this case 6) with a substitute reading of say .01

can anyone help with a solution
 
sjfp
just joined
Topic Author
Posts: 7
Joined: Fri Mar 04, 2022 2:10 pm

Re: Trap Modbus Error

Wed Apr 27, 2022 5:06 pm

No suggestions ??

Who is online

Users browsing this forum: No registered users and 13 guests