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.

Time control of company personnel
#9
(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
Reply


Messages In This Thread
RE: Time control of company personnel - by davidchispas - 31.03.2020, 15:27

Forum Jump: