23.11.2018, 09:19
Hi,
Same ideas how can I control Modbus bit over script. Reading works for mee so I need write commands over Event script.
Same ideas how can I control Modbus bit over script. Reading works for mee so I need write commands over Event script.
Code:
local adr1001 = mb:readregistervalue(1001, 'uint16')
grp.write('32/5/52', bit.band(bit.rshift(adr1001,8),0x1), dt.bool) -- Baseino filtravimo laikmatis jei abu isjungti
grp.write('32/5/53', bit.band(bit.rshift(adr1001,9),0x1), dt.bool) -- Filtravimas vyksta istisai
grp.write('32/5/54', bit.band(bit.rshift(adr1001,10),0x1), dt.bool) --Vonios filtravimo laikmatis jei abu isjungti
grp.write('32/5/55', bit.band(bit.rshift(adr1001,11),0x1), dt.bool) --Filtravimas vyksta istisai