09.04.2018, 13:00
Hello,
I have this code for reading modbus values. It is in resident script ~20s.
Now I need to make an alarm if there is no modbus connection and we are not getting new values.
How can I do it?
Thanks.
I have this code for reading modbus values. It is in resident script ~20s.
Now I need to make an alarm if there is no modbus connection and we are not getting new values.
How can I do it?
Code:
mbproxy = require('mbproxy')
mb = mbproxy.new()
mb:setslave(2)
--Actual temp
grp.write('32/3/1', (mb:readinputregistervalue(8203, 'uint16')/10),dt.float16)
os.sleep(0.5)
--Setpoint temp
grp.write('32/3/2', (mb:readinputregistervalue(8202, 'uint16')/10),dt.float16)
os.sleep(0.5)
Thanks.