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.

Modbus bit control over script
#1
Hi,
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
   
Reply


Messages In This Thread
Modbus bit control over script - by Thinklight - 23.11.2018, 09:19
RE: Modbus bit control over script - by admin - 23.11.2018, 10:35

Forum Jump: