My model is MF800
This is a discussion on Reading RFID using C within the C Programming forums, part of the General Programming Boards category; Originally Posted by Salem But I bet they have a website right? It 's made by this manufacturer . My ...
Last edited by anthonyung; 03-04-2011 at 12:06 PM.
In C you should include <windows.h> (even if not creating a GUI project) and look at the
CreateFile Function (Windows) , ReadFile Function (Windows) and DeviceIoControl Function (Windows) functions to see how to setup and read the port....
From the page you linked, I'd set the serial port to 9600, no parity, 8 data bits, 1 stop bit, open the port as a file (as I'm sure you did on the other project), capture the input to a string (again something you probably did on the other project), then try swiping a few cards and display the output on your screen...
If you can get that much to work, you're more than half way there...
For the actual content: If it's not obviuos (like my barcode scanners were) look in the supplied code for a struct that you might overlay on the strings to extract the data...
But for now the first step is to see input on your screen.
As for my experience with this : I was the national service manager for a major office machine company for most of my career. (Now retired... or is that just plain tired?)
Last edited by CommonTater; 03-04-2011 at 12:15 PM.
Actually...i started with nothing(about serial port), i am learning the knowledge of microcontroller(A set of kit), but that is another subject, the RFID i used is a project subject, my friend and i thought using RFID maybe easy to achieve...but i guess we are wrong now..
Ok... so is this attaching to a PC or a uC? And... which version of C are you using?
Fear not... any task is daunting before the first step is taken.
One idea might be to get it working on a PC first then modify the code for your uC...
You have C++ ... why not just use the supplied libraries?
Oh, sorry, you meant my uC subject? it 's attaching to a uC, you're right. the software i am using for this is Keil.
but now i am using VC to read the mifare.
This is hard work - where's the souce code (getting bored of asking)?
Anyway, it says RS232, so the first thing to try is just running hyperterminal and seeing what gets displayed. It makes a point of being "easy to integrate", so I guess it's just printable text with a newline at the end.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Hook the thing up to your PC, launch hyperterminal as Salem suggests, and see what comes out of it. (Thanks Salem!)
Thing is, smart cards often incorporate some form of data encryption... as a security measure.
FWIW... a lot of the stuff I worked on ended up being connected to cash registers but almost all code development was done on PCs first.
Last edited by CommonTater; 03-04-2011 at 12:39 PM.
Can you dnowload it?
I am total newbie in C but I often read and write to COM port in windows, dos and linux. So I try to do like in old days and this works:
You can open Com port exactly like file. Be carfeul about CR and LF chars which may vary depends on what you read and what device sends!Code:fout = fopen("COM1,9600,N,8,1", "w"); // for writing to port
If this dont work you should try with other standard setting like 300, 900, 1200, 2400, 3600, 19200 etc...
In windows is important that your port settings on machine (control panel) DO MATCH with your program and your connected device.
Reading of RFID data is same like reading data from any COM connectable device.
In most cases you dont need any software for minimal usage.