Logic Machine Forum
Time control of company personnel - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Time control of company personnel (/showthread.php?tid=2549)



Time control of company personnel - davidchispas - 27.03.2020

Hello, I need to create a time control of the personnel of a company. Check-in / out and rest time.
Is it possible to visualize with the monthly records? For the CCAA I use Ekey. I made a record of the objects, but I don't see how to get that to a graph at the end of the day.


RE: Time control of company personnel - davidchispas - 30.03.2020

I am creating in FB Editor, using the counter module with a pulse per minute. As a result I get the total of the day in minutes, how can I pass it to a 3-byte time format? I tried initially to use the FBeditor hour counters but I was not able to give them a value in the output.


RE: Time control of company personnel - Daniel - 30.03.2020

Hi, can you explain once more what is your final goal?


RE: Time control of company personnel - davidchispas - 30.03.2020

(30.03.2020, 08:17)Daniel. Wrote: Hi, can you explain once more what is your final goal?

Hi Daniel, yes.
I need to visualize and record what a staff workday would be.
Using Ekey's access control, I identify if they enter or exit. Using a pulse per minute counter, the value I get is the total minutes worked. I need to convert that value into a time format. (x minutes = x Hours: x minutes)


RE: Time control of company personnel - Daniel - 30.03.2020

If you just want to display it then you can write it to string object with conversion like this
Code:
minutes = event.getvalue()
grp.update('32/1/1',os.date("%M:%S", minutes))



RE: Time control of company personnel - davidchispas - 30.03.2020

(30.03.2020, 09:54)Daniel. Wrote: If you just want to display it then you can write it to string object with conversion like this
Code:
minutes = event.getvalue()
grp.update('32/1/1',os.date("%M:%S", minutes))
 Thanks Daniel, it works!


RE: Time control of company personnel - davidchispas - 30.03.2020

I want when the event is executed and an x value to send a true. I can do it with 1 bit objects but I need 07.2 Bytes .  what else do i need to get the value?

Code:
Scanner_Rele = event.getvalue()
Scanner_Value = grp.getvalue('50/0/0')
User01 = '50/1/1'
User02 = '50/1/2'



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



RE: Time control of company personnel - Daniel - 31.03.2020

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')


RE: Time control of company personnel - davidchispas - 31.03.2020

(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



RE: Time control of company personnel - Daniel - 31.03.2020

Log both variables before IF to see if they are correct.
You don't need the second if when the conditions are the same.


RE: Time control of company personnel - davidchispas - 31.03.2020

(31.03.2020, 15:48)Daniel. Wrote: Log both variables before IF to see if they are correct. 
You don't need the second if when the conditions are the same.


Fortunately the first three shipments I execute perfectly. But normally, when changing the Value in '50 / 0/0 'the next shipment usually fails.


RE: Time control of company personnel - Daniel - 31.03.2020

Post your latest script.


RE: Time control of company personnel - davidchispas - 01.04.2020

(31.03.2020, 20:39)Daniel. Wrote: Post your script latest script.



RE: Time control of company personnel - admin - 01.04.2020

The problem is that 50/0/0 arrives after 50/0/4 when your script is already executing.
Attach your script to 50/0/0 and modify it like this:
Code:
Scanner_Value = event.getvalue() --07.2bytes, user id
Scanner_Rele = grp.getvalue('50/0/4') --01.1bit, only send true



RE: Time control of company personnel - davidchispas - 01.04.2020

(01.04.2020, 08:20)admin Wrote: The problem is that 50/0/0 arrives after 50/0/4 when your script is already executing.
Attach your script to 50/0/0 and modify it like this:
Code:
Scanner_Value = event.getvalue() --07.2bytes, user id
Scanner_Rele = grp.getvalue('50/0/4') --01.1bit, only send true


Hello Admin, I already did that test. I also have the same problem, the value of 1 bit is always true. Therefore, the condition will also be fulfilled.

Is it possible not to run the script until the two values are updated? That one value depends on the other to be executed.


RE: Time control of company personnel - admin - 01.04.2020

It's always true because that's what you have in your script. Maybe you need to toggle the value like this?
Code:
grp.write(User01, not grp.getvalue(User01))

As for correct execution order just map the script to an object that comes second. For ekey it will always be the finger ID object.