09-13-2011 09:14 AM
Hi
I am trying to develop an application that has to read RFID cards and log the data to a file along with the data and time(just like an attendance log sheet).It has to log the data to a file and it should have one base file to store the card details.It should also has an option to add a new card in future.I am using GP20 rfid reader and connected to com1 port.In the programming i used visa serial palette to write and read the rfid data.But am getting a code like "0B0070CAC1"(in which the starting two are some special chars) while writing it to a file.Now i need to read the data in a unique format and to manipulate it for getting the matched details of the swiped card.And for this i am trying to use arrays for reading data and to compare.So can u please mention me what are the type conversions i required to get the card id as same as on the card(eg:0007391937). and how to get the individual id from a stored file using arrays(or mention if there are any simple method to get individual ids from a file).
Thank u...
09-13-2011 01:16 PM
The documentation for your reader would tell you how to interpret the code you are getting over the serial port. You will be reading a sequence of bytes that you'd need to convert/parse. Do you have the documentation for the reader? What does it say?
As for the file saving business, a very simple solution is to use delimited text files, and you can use the Write to Spreadsheet File VI to create these and add your log entries.
09-13-2011 11:18 PM
thank u for your reply,
In the documentation it is mentioned to store empid number and time of swipe along with card id.So i am trying to map them to the recieved id by storing the data to a file.I need to change the state of the application with the cardswipe.How can i detect the data presence on the visa serial modules to detect the card swipe..can u please mention the solution quite elaborately..and if possible can u give some related links..
Regards
Appazi
09-14-2011 08:18 AM
I cannot tell you how to convert the information you read over the serial port to the ID on the card. Is there even a correlation, or is the ID something else entirely. As I said, you have to look at the documentation. I don't have the reader.
As for having an application that merely sits there waiting for a swipe you can do this a variety of ways. You could simply sit in a loop checking to see if there are any bytes on the serial port. When there are, you read the required number of bytes and process the data. Or, you could use VISA events. You did not indicate what programming language you are using. For LabVIEW, examples on serial communication ship with LabVIEW. Help -> Find Examples. In your particular case I think the checking for available bytes will probably be the better route. As for overall application design I'd suggest a simple state machine. Application Design Patterns: State Machines
09-15-2011 10:40 AM
Thank you for your suggestions and now i am able to run the application with different states like idle,check in (when there is a swipe),enrol(for new id registration),stop..for the chek in state i need to compare the recieved rfid with the existing data.currently iam writing the data to a spreadsheet.So how can i compare the data with the existing file to implement further operations.Are there any express vis?and can u mention any other ways if any??
Regards
10-13-2011 03:36 AM - edited 10-13-2011 03:39 AM
Hi
I have almost completed the above mentioned project and i met all the funcionalities..but while stopping the system i am getting an error as
Error -1073807339 occurred at VISA Read in Untitled 1
Possible reason(s):
VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
How can i fix this error and why it is arising..
Moreover i have diesigned this using state machine programming..so while running the program it is taking so much time to change from one state to another state and for displaying related messages..
can you suggest any ideas to fix above mentioned error and to increasing the execution speed of the project..
Thank u
Appazi
10-13-2011 08:14 AM
Can't tell you how to fix it unless you provide some code.
10-14-2011 12:28 AM
Hello sir iam explaining my project code below
The front panel of my project consists of 3 text boxes one for displaying message and two for registration purpose. I have provided two buttons one for registration and other button to stop the system.
In the block diagram I have taken two states one is default and other is check in.
Initially I am checking whether any data is present (using visa serial modules like serial configure port, visa read, visa write and visa close) or not on the serial port data line (using case structure).
[False condition]
If the data is not present it will sits on default state and waits for card swipe.
[True condition]
If yes it will change its state to check in State by flushing the received buffer and checks whether the register button is pressed or not (using a case structure inside the check in state).
Register button pressed:
[True condition]
In the true case block I have written the code to get the details of the card,text entered in the 2 textboxes and to write all the fields to database file.
[False condition]
In the false case it will check whether the data on the serial port matches with the data in the database file (for matching I used for loop and arrays).
Received data matches with db file data:
[True condition]
In the true case I am picking the related data of the particular matched item and writing to a log file along with date and time (text file to log attendance)
[False condition]
In the false case I am suggesting the user to register the card by displaying a message on the text box.
And it will change its state to default.
At any moment if we want to stop the project I have given a stop button that directly connects to stop condition of the outer while loop.
now can you suggest me any solution to fix the previously mentioned error and to increase the execution speed..
Thank u
Appazi
10-14-2011 05:30 PM
Instead of using 1000 words, it would be a whole lot easier if you simply uploaded your VI. LabVIEW coders think better with pictures than words. ![]()
10-16-2011 08:54 AM
Hello sir,
I am attaching the vi to this mail..
thank u
appazi