How to stop RFID Reader Module while processing

Hi,
In my ProgramStarted() method I set the IdReceived event to the rfidReader_IdReceived method using this line of C# code:
rfidReader.IdReceived += rfidReader_IdReceived;
The problem is, when I swipe my RFID card numerous times, in a fast sequence, the swipes seem to get queued and execute the method those many times. I do not want this behavior.

What I would like is that the event is triggered, the reader is disabled until the method completes and then is re-enabled.

I have built a time clock, and it seems that the employees are clocking in and then are immediately getting clocked out, because they have unknowingly swiped more than once. I need to disable the reader while the method is processing the clock in or clock out process.

Any tips on how to do this?

Thanks, Benjamin

@ BenjaminPerkins - you will have to handle with software. if another swipe comes within x milliseconds ignore it.

keep track of the last Id and the time it was read. when an id comes in, compare to last. if it is the same calculate how much time has passed since the last reading. if it is less than a X value, ignore.

1 Like

That was very helpful. Many thanks. :slight_smile: