Two RFID Readers

Supporting Visual Studio on Windows
liamh

Two RFID Readers

Postby liamh » Fri Feb 05, 2010 10:21 am

Hey guys,

I am new to phidgets and Visual c# and i was just wondering if there are any online resources where i can find code to take information from two different readers simultaneously? (the two readers i am using are the 1023-Phidgets RFID kits).

or if any of you guys have a piece of code that may help?

also, if i am reading a tag and i want to change its value, for example, one tag has the value "1500832423" written to it, can i temporarily change this to somebody's name instead using visual c#?!!

thanks in advance for any help!

User avatar
Patrick
Lead Developer
Posts: 3064
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Two RFID Readers

Postby Patrick » Fri Feb 05, 2010 10:38 am

In oder to open two readers, you just need to create another RFID object and open it - probably a good idea to specify the readers serial numbers so that you know which reader is associated with which object.

The tags are read only, so you can't change their values.

-Patrick

liamh

Re: Two RFID Readers

Postby liamh » Sat Feb 06, 2010 6:25 am

thanks for your reply.

however, i don't actually want to write to the tag, i just want that instead of displaying its number it will display a name which i will input instead.
so i bring the tag within range of the reader, the tags number is shown on the form, i put my name into a text box and now everytime something happens with the tag, my name will be displayed instead of the tags number!

its a little difficult to explain, i am new to visual c# and phidgets!!

liamh

Re: Two RFID Readers

Postby liamh » Sat Feb 06, 2010 7:54 am

i figured out a simple way of changing the name for anyone who is interested here is the code i used:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TagTest
{
public partial class Form1 : Form
{
private string tagIn = "";
private string newName = "";

public Form1()
{
InitializeComponent();
}

private void timer1_Tick(object sender, EventArgs e)
{
newName = txtName.Text;
tagIn = txtTag.Text;

if (newName != tagIn)
{
updateTextbox(newName);
newName = tagIn;
}
else
{
}
}

private void updateTextbox(string newName)
{
if (tagIn == "1500832423")
{
textBox1.Text = txtName.Text;
}
else if (tagIn == "18007dd72f")
{
textBox2.Text = txtName.Text;
}

}

private void button1_Click(object sender, EventArgs e)
{
string names;
string messageText;

messageText = "Participants:";

names = "\r\n\n" + textBox1.Text + " => Tag #1" + "\r\r\n" + textBox2.Text + " => Tag #2";
MessageBox.Show(messageText + names, "Who is Participating? ");

}


}
}



click to enter data in txtTag box, bring tag close to reader (with keyboard output Enabled!!!), and tag no. is placed in that txtbox, then input name in another textbox and name will show in another text box (i want to show the txtBox 1 and 2 on a different form you see!!!)

if anyone thinks this is a good way of doing this, or has a better suggestion please let me know!

i still need to know about two readers too, if anyone knows where there might be a full code to give an example of doing this it would be greatly appreciated!!!!

twainiqolo
Fresh meat
Posts: 1
Joined: Mon Jul 26, 2010 7:21 pm
Contact:

Re: Two RFID Readers

Postby twainiqolo » Fri Aug 27, 2010 11:36 pm

The serial number of the rfid is supposed to be unique. If you want a name displayed instead of the rfid serial number, than you need to create a database table consisting of the serial number as the key and the name as another field. In your program, when the reader reads a rfid serial number, your program should search the table for the rfid serial number and obtain the corresponding name, than display that name. If however the name needs to be changed, you just need to change the name in the database. The rfid serial number remains unique. Hope this works for you as it does for me. I use rfid serial number to display vehicle plate numbers. When a vehicle is made derelict, I use the same rfid on another vehicle and changed the old plate number in the database table to the new vehicle plate number.


Return to “C#.NET”

Who is online

Users browsing this forum: No registered users and 0 guests