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.

grp.checkwrite / grp.checkupdate
#14
Status object must be passed as the 4th argument. You need to pass status group address not value:
Code:
value = not Antizamrz and INtemp > 21.5 and VZT and Outtemp > 20
grp.checkwrite('11/1/13', value, nil, '11/1/113')

Some notes on your script:
1. Passing datatype to grp.getvalue() is not needed in most cases.
2. INtemp is converted to integer via math.ceil but then compared with a floating point value (21.5). You can either remove math.ceil or compare with an integer value (INtemp >= 22)
3. Instead of comparing with true/false you can simply use if Porucha1 and Porucha2 then
4. Generally it is recommended to use all lowercase variable names as mixed case can lead to errors due to typos because variables in Lua are case-sensitive.
Reply


Messages In This Thread
grp.checkwrite / grp.checkupdate - by Dré - 30.12.2022, 09:12
RE: grp.checkwrite / grp.checkupdate - by sx3 - 02.01.2023, 11:39
RE: grp.checkwrite / grp.checkupdate - by admin - 29.07.2024, 06:24

Forum Jump: