Testing the Application
You are now ready to test the application. Press F5 to debug the application. Take a tag and scan it using the RFID reader. The application should register your tag ID and shows that no employee is found (see Figure 16
|Figure 16: Scanning a tag that does not belong to any employee.|
You can associate the tag ID with an employee by searching for an employee (enter the employee ID in the Textbox and click the Find button or leave it empty and it will return all records). Once you have located the employee you want, click the "Assign Tag to Employee" button to assign the tag ID to the employee.
The next time you scan the same tag, the application will show the employee.
RFID Reader #2: PhidgetRFID
The second RFID reader I will show you how to use is the PhidgetRFID reader ($59.95); (see Figure 17) from Phidgets Inc. The PhidgetRFID is also a read-only RFID reader that can read tags within a four-inch proximity.
Unlike the Parallax's RFID Reader Module, the PhidgetRFID uses a USB connection, which is actually easier because almost all computers today support USB devices. And because it draws power from the USB connection, you don't need to provide an external power source. Simply connect the PhidgetRFID to your computer and start scanning.
Instead of purchasing the standalone PhidgetRFID reader, I suggest you purchase the PhidgetRFID kit
($79.25), which comes with the following:
- 6 30mm disc RFID tags
- 2 credit card-sized RFID tags
- 2 Keyfob RFID tags
- USB cable
The PhidgetRFID reads RFID tags that use the EM Marrin protocol, EM4102 (this is a 125kHz read-only protocol).
|Author's Note: The PhidgetRFID also reads the tag I used for the Parallax RFID Reader Module. In fact, the tags described here also works with Parallax's reader.
Building the Sample Application
|Figure 18: Populating the form with the controls.|
Rather than modify the application built in the previous section to work with the PhidgetRFID reader (and have a lot of repeating code snippets), I have opted to build a simpler application so that you can learn the fundamentals without being bogged down with the details of the application.
Using Visual Studio 2005, create a new Windows application and populate the default form with the controls as shown in Figure 18.
Using this application, you can view the tag ID that is being scanned and you can also programmatically turn on/off the LED on the reader itself and enable/disable the reader.