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.

if condition not working
#3
(02.07.2024, 07:30)admin Wrote: You need to use grp.getvalue() instead of grp.read(). Comparison with 1 won't work correctly because the value for 1-bit objects in true/false.

Assign a common tag to 2/0/6, 2/0/8 and 2/0/10 then map an event script to this tag:
Code:
value = grp.getvalue('2/0/6') or grp.getvalue('2/0/8') or grp.getvalue('2/0/10')
grp.write('2/0/100', value)

If you need multiple OR/AND gates then it's more convenient to use this solution:
https://kb.logicmachine.net/scripting/lo...-statuses/

I have changed it to this way. In the log I do see that the variable takes the correct value, but it does not do the grp.write(), that is, it does not refresh the new value.


AZonasComunesP0 = grp.getvalue('2/0/6') or grp.getvalue('2/0/8') or grp.getvalue('2/0/10')
grp.write('2/0/100', AZonasComunesP0)
log(AZonasComunesP0)
Reply


Messages In This Thread
if condition not working - by mai - 02.07.2024, 07:26
RE: if condition not working - by admin - 02.07.2024, 07:30
RE: if condition not working - by mai - 02.07.2024, 07:48
RE: if condition not working - by Bitver - 02.07.2024, 19:42
RE: if condition not working - by admin - 02.07.2024, 07:53
RE: if condition not working - by mai - 02.07.2024, 07:59
RE: if condition not working - by admin - 03.07.2024, 07:26

Forum Jump: