31.03.2020, 15:27
(31.03.2020, 07:46)Daniel. Wrote: You need to change it to event script triggered by tag. Both input group has to be tagged and then use this tag to trigger the script. Change the event.getvalue() to grp.getvalue('xxx')
Thanks Daniel, sorry but I can't get it to work the way you tell me.
I get it to run this way, but it fails. The script is executed before receiving the value of 2 bytes. There is a need to run the script again.
Every time a user swipes the card, a 1-bit object with a true value is sent (never returns false) and a 'xxx' value in 2bytes is sent.
I need to write an object, when those two objects send a value and the condition is met.
Code:
Scanner_Rele = event.getvalue() --01.1bit, only send true
Scanner_Value = grp.getvalue('50/0/0') --07.2bytes, user id
User01 = '50/1/1' --01.1bit
User02 = '50/1/2' --01.1bit
if Scanner_Rele == true and Scanner_Value == 26 then
grp.write (User01, true)
end
if Scanner_Rele == true and Scanner_Value == 36 then
grp.write (User02, true)
end