RFID for time keeping.

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

RFID for time keeping.

Post by achillis1 »

Hello,

I wanted to know if the RFID solution pack can be used to keep track of the working hours of employees(Time Attendance Monitoring Clocking-In System).
Is it possible to have a switch board attached to it and program it from the switches? Example like: a new employee comes and we have to assign an employee number to the card; so with the help of switches(use as navigation buttons) we "put" the mainboard(rfid bundle) in a programming mode(we can navigate through an LCD screen) assign a value to a variable(employee) and so on we transfer the value to the specific RFID Tag; in order for the employee when he "swipes" the Tag, the mainboard will understand that now that specific employee has attended to work.
Also, is the PIC that I am going to programm to keep track of time, be able to provide flawlessly the correct time? Or it will count on its own rate, providing false time?
Will the PIC(16f877a) have enough memory in order to keep track of employee working-time and therefore to view it on a later time?
Many thanks in advance,

Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello

Yes the system you are proposing should be acheivable using Flowcode and a RFID E-Block. Each member of staff could have their own RFID tag and as you say switches could be used to assign new tags etc.

Time can be based on an interrupt on the chip and will be highly accurate (eg prob loose or gain a few seconds a year) or you can use an external real time clock IC which will provide you with a slightly higher accuracy. I think you can even get RTC ICs that use the wireless synchronisation method if you need the time to be spot on.

My advice would be to use a MMC/SD card reader board to log the activities and then you can remove the memory card for example at the end of the month and dump the data straight into excel etc.

16F877A should be powerful enough to handle all of this.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello,

Many thanks Ben.
So to resolute; I need an SD/MMC dard reader for the extra memory, the 16f8877a can handle the accurate time-keeping issue.
I have a couple more questions:
>Can I assign the values to the RFID Tags via a PS2 keyboard attached to the PS2/VGA board?
>If I have an ECIO to be the "brains" of the whole system; can I use the USB port on it, to have a communication with a PC or it is just for programming purposes?
>Is there a software that through a graphical user interface can send bytes to a USB or RS232 port of the PC in order to communicate with a PIC?
I know that Visual Basic can do this but it involves a high programming language!
Thank you in advance,

Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello

Yes the SD/MMC card would just allow you to locally store data in a fashion compatible with excel etc. Eg timesheets could be logged and then at the end of each month the card is removed from the system and inserted into a PC where the data is copied across for working out wages etc. Obviously this method would be open to people removing and hacking/altering the MMC/SD card.

If you use an ECIO then yes you can link it to a PC for data communications purposes. This means you should be able to do away with the SD/MMC portion and write the excel or alternative files directly from the PC software.

I use VB or Labview to communicate with the ECIO devices. This works quite well and I think there is a free version of VB5 that can be downloaded and used.

There are VB and Labview examples included in the USBpack available from here.

http://www.matrixmultimedia.com/FlowcodeUSBPack.php

Before I started writing the USBpack I knew absolutley no VB but it soon started to click once I got using it. After going through my examples you should be able to do pretty much everything you will want to do and for everything else there is always good old google.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello Ben,

Appreciate your reply!
Is there any Macros about saving data to the ECIO in order to be able to be exported in Excel format afterwards? My guess up to now was that I would use the write EEPROM command in the appropriate macro to store the data. But later how I will "transform" the data in Excel on a PC?

From the things you said above, I could use the USBserial and USBslave components with ECIO, without needing the USB232 bundle? I could use that in order to "drag" my data stored in the ECIO?
Also if I use the USBHID componet will I be able to attach a keyboard and assign name to RFID Tags, with the help only of an LCD attached to the RFID board?

One final question :) the time keeping part, is there a special way to create a 24/7 clock or just I make some counter with one second delays in it?
Thank you in advance,

Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Achillis

To save data to Excel format there is two options.

1) Send data via the USB to a software application eg VB which will append the incoming data to a file in an excel format eg comma seperated variables.

2) Send data directly to a SD/MMC card which will append the incoming data to a file in an excel format eg comma seperated variables.

To see how the comma seperated file type works simply create a sample file in excel and save as CSV format and then open with notepad or similar.

Yes the USB Flowcode components work directly with the ECIO, the USB232 board is not compatible with the Flowcode USBpack.

Using the HID component does not allow you to connect Keyboards to your project, it rather allows you to create keyboards etc for computers. However if you are communicating with VB then you can use VB to input a string and then have a button in VB that will send the string to the board to create a new RFID time key etc. The USBpack examples should help a lot with doing this.

For the 24/7 clock refer to the TUT22 example available from the Flowcode V3/Examples directory. You will have to add in a variable to count days etc but this shouldn't be too tricky.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Thank you a lot Ben!!!
I will get to work as soon as possible and let you know about the progress!
Best Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Great thanks Achillis,

Sounds like a great project and would be interested to know how you get on.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello,
I am giving a lot of time for this project but it seems that I have some drawbacks! I would like some help if you can.
I have design in some pieces of paper how the Program will go but I need to solve some problems before I implement it in flowcode.
First I would like some help with Timer0 interrupt. The other interrupts I understand how they work and I can use them. How I can use the timer0 int. in order when the register overflows to, say for example output 255 on LEDs at port A? I insert the interrupt icon in the program, in properties I choose internal clock, set the prescaler, set the name of the macro that it will be called and when I edit the macro I state thet it should light up the LEDs; but nothing happens!!! Should I assign some local variables or have a return value? I am lost!!! I do not know maybe you can tell me where to find a help file?

Now to the crucial part!!!
My first quess is to record the time that an employee has worked in strings or bytes and then push them in EEPROM. E.x for one day, in string "mode" the data should be stored like this:the following parameters: 28-11-08 [date] 11:26[time arrived] 15:30[time left] 1 [employee's number] , should be stored in a string of 8 elements in order to store one day's data> string[0]=28, string[1]=11, string[2]=08.......and so on; but for the next day how to increment the string? I guess I cannot do that? E.x for one day I should store data in String_1, then for the other day increment it and be: string_2?
So if this cannot happen my next guess is to store the data in EEPROM. E.x for the example above I would store in location 1 in EEPROM the value 28 for the specific date, in location 2 the value 11 for the month and so on. But if I have 10 employees then shortly I would be out of memory space!!! So I figured that it would be best to store more than one parameter in on byte with a kind of "merger" and after when I will need that info to use a byte decoder to extract the info from the byte. For example in order to strore the time>15:03 then nstead of using one byte to store the value 15 and another one for the value 03; I will use one, as follows: the high nibbble should be 15(1111) and the low nibble 03(0011) and in decimal should have the value of 243. Now the trick is to have a way that when you will need to get that time to be able to "break" the byte of value 243
and end up with 2 values of 15 and 03. This way I can save up some memory. I do not know if this can be done with masking or some other way. By the way is there any tutorials or info. regarding how the different functions( AND,OR,MOD,XOR,COMPARE$() e.t.c) work?
In some cases it would be good to save in a byte 3 parameters>> 010 110 11 > for this I could store in the first 3 bits the value (2) in the next 3 bits the value (6) and in the 2 last the value(3). When the byte is merged it would have the value of 91. Can I use some sort of masking and "eliminate" the edges of the byte(bits 0,1,2,,6,7) and capture the value of bits 3,4,5 but not as 24>>>000 110 00( the zeros at the edge are masked) but as 6? Maybe you have a differnt idea on how I should store data?

Well Ben it seems that I wrote a lot of stuff and maybe if I read them I will confuse even my self :shock: !!!!!!!!
So sorry if I will confuse you, if so please let me know to try to explain them else how and if you manage to understand what I am saying please do help me :lol: !!!!!!
Many thanks in advance,
Best Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello

Ok to get your timer interrupt working you will have to make sure the clock source is CLKI and not T0CKI. The timer interrupt may also not work correctly in simulation so you will have to download a program to a target device to see it working. Local variables and return values on your interrupt macro are not needed unless you want them. Interrupts should be well covered in the main help file.

EEPROM data is slow and as you say you are going to run out of space very quick. Why not use a different medium eg. SD/MMC, USB to PC, RS232 to PC, Bluetooth to PC etc to get the information out of the chip as quickly as possible so no local storage has to be used.

Doing this you would also have much more room to play with so you wont need to do so much manipulation of the data. Eg outputting strings instead of encoded byte values. I have just written a simple piece of VB code that allows you to write a CSV data file that will open directly in excel. I have attached it to the post for you to have a look at. The VB code uses the USBpack USB Slave method of communication. Note: If you decide to go the SD/MMC route then you can create and write the CSV file directly from the chip. I think there is an example of this in the knowledge exchange section of the forums.
Attachments
Sample VB.zip
(55.4 KiB) Downloaded 514 times

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello Ben,

So as far as it concerns the timer overflow interrupt I need to test it in "real life"? OK then. Also the clock source was indeed set at CLK0>>>regarding that, you wrote in your previous post that it must be set at CLKI>>should I presume that it was spelling error or it is CLK0 only in my program? :shock:

Finally I have found a way to "multiplex" several parameters in one Byte and afterwards to "demultiplex" them. I needed this because the potential client for the time -keeping machine does not want have a PC connected to it. Never the less, finaly I have persuade him and he is going to have a PC. So I am going to store the data on the sd card and after on the PC.

As far as it concerns your VB code regarding the csv data thank you a lot for posting it, I have took a look at it but because I lack in software knowledge I got confused; so I will ask for some help later on from some colleagues.

Also Ben in the RFID documentation file there is a section about how the jumpers should be in relevance to which PIC I am going to use. That means that only those specific PICs I can use with RFID board? If so, then I can not use the ECIO40>>18F4455?????

Another important thing, where can I find some help files regarding the parameters of the RFID component macro? I want to know how to use the specific parameters and know what do they do? For example what is the difference of the "write_RFID_buffer" with the "write_RFID_block" and if I choose to write something, which addresses are available?
And Ben I noticed that the RFID component macro does not have the graphics interface such of theRS232 component so I cannot view bytes sent or received. THis means that I will have to have the actual device in order to test the success of the communication?

Thank you in advance
Best Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Achillis

Sorry For some reason I thought it was CLKI, your right it should be CLKO instead. :P

The PICs listed for use with the RFID E-Block are for example only. You can definatly use the E-Block with a 18F4455 or any PICmicro with a hardware UART.

There should be a help file named RFID.hlp available from your Flowcode V3 directory. You should also be able to open this by clicking on help when inside the RFID component properties.

Yes there is also no simulation for the RFID at present so the hardware must be used to test your programs.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello Ben,
Thank you for the reply.
Sorry to bother you again for the RFID help files but it seems that the RFID.hlp does not exist in my flowcodev3 directory. When I am in the component properties of the macro and I select the question mark button, the help file is refered generaly for the macros. when I go to the component connection and select the question mark button the following message appears: "The topic does not exist.Contact your application vendor for an updated help file.(129)". Maybe you can send me that help file?
Thank you.
Best Regards.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Achillis

I have attached the help file here. You should be able to get it by going into the actual RFID component properties. Eg not a macro icon but the component itself. Seems these help files may have been missed out the latest release though so this could be why you cannot find the file. I have added the other help files incase anyone else needs them.
Attachments
MissingHelp.zip
(236.58 KiB) Downloaded 449 times
RFID_Help.zip
(69.56 KiB) Downloaded 465 times

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello Ben,

I am currently testing the RFID board and I have two issues.

The first is: can an ECIO work with the RFID board?

Second is: when I make a program for RFID, when I place a component macro for the RFID, I am supposed to open the properties of the component RFID and select whether I will be using ICODE card of Mifare card(in order for the rfid board to know what kind of card will be expecting to communicate with). So my problem is that what ever I choose, the hardware set up that I make and after I run the program, it cannot detect the ICODE card, but only the Mifare!!!

Do you have any idea regarding this?

Thank you in advance,
Best Regards,
Achillis

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Achillis

For the RFID E-Block to work with the ECIO you will have to set the jumpers on the RFID board to the following settings.

C and 1.

Then in Flowcode go into the RFID component connections and change the CTS pin to PortC Pin0.

Hopefully doing this will then solve your problem with the ICODE and MIFARE detection.

Let me know how you get on.

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello,

I have installed the ECIO drivers on my PC and after I plugged the ECIO on the PC. The new hardware installer launched and it was asking for the drivers. I set the option to automaticlly detect the driver and at the end the ECIO was successfully installed.

The problem is that as mentioned on the ECIO help files, when the ECIO will be installed, it will be displayed on the device manager below the COM ports as
"matrix multimedia....." cannot remember the rest, I do not have the help files with me right now! Instead no hardware change is detected by the device manager.

Have you got any idea what might happened?

Thank you in advance,
Best Regards
Achillis

User avatar
achillis1
Posts: 347
Joined: Thu Oct 09, 2008 9:19 am
Has thanked: 91 times
Been thanked: 8 times
Contact:

Re: RFID for time keeping.

Post by achillis1 »

Hello Ben,
I am testing the RFID board with the Mifare and Icode cards. I have a problem. In the datasheet it says that the antenna range it would be approximately 10 cm but when I try it the range is no more than 2cm!!! I try to tune it from the sensitivity tunning capacitor but nothing happens. Also the tunning capacitor never stops the rotations(does not have an endpoint to the left neither to the right),is this how it supposed to be?
Have you got any idea how to increase the range, or I am stuck with the 2 cm?
Thank you in advance,
Best Regards,
Achillis.

emmy
Posts: 3
Joined: Mon Jan 25, 2010 3:14 pm
Contact:

RFID PROJECT

Post by emmy »

Hello Ben, what sort of component do I need to use FOR PROGRAMMING for a reader module and my RS232.

Emma

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Emma

I think that the RFID component uses the RS232 UART peripheral. Are you trying to use RFID and RS232 seperatley?

emmy
Posts: 3
Joined: Mon Jan 25, 2010 3:14 pm
Contact:

Re: RFID for time keeping.

Post by emmy »

Thank you Ben.
I am using a reader module from coreRFID ltd and other components(RS232,LCD,LED,PROGRAMMER BOARD) are from Matrixmultimedea ltd. So, my question is: how can I incorporate the reader to RS232 for interfacing. It is really challenging.

Thanks in advance.

EMMY

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RFID for time keeping.

Post by Benj »

Hello Emmy

Ok I take it the RFID module has a RS232 UART that you use to communicate with it. You should first check to see if this requires the RS232 +/-12V or whether it requires a TTL 5V connection. This will dictate which port of the EB015 RS232 E-Block you will output the data from.

Then once you have the communications sorted you should be able to set up the RS232 in Flowcode with a specific baud rate and then use the RFID device manual to work out how to interface to the module.

Let me know how you get on.

emmy
Posts: 3
Joined: Mon Jan 25, 2010 3:14 pm
Contact:

Re: RFID for time keeping.

Post by emmy »

Thank you Ben for your response. I will practice what you said and give you feedback nest week.The reader module is using TTL 5V.Are you talking about the RFID manual in your web site?Please let me know. If you don't mind , I have supplied the reader data sheet address here as you are in a better position to interpret. http://www.corerfid.com/coreDocs/CoreIDSpecs.pdf

I will be glad to hear from you again.

emmy

Dear Ben, Thanks for your advise,I have been able to communicate my RS232 with my PC(terminal program),and also my reader module communicated with my PC, all separately. My next move now is to incorporate the reader and the PICmicrocrocontroller. what do you advise me to do?

emmy

Post Reply