Hi Pradeep,
We can use Serial port for Reading the Tag values from the RF-ID Reader.For this we need to connect the RF-ID Reader using the Serial cable to the port and use the relevant COM Port No# to the Serial port Object of C# to Connect.
- Normally the System.Net Contains the Serial Port Class and also available in the Toolbox as Serial port component for your Win Forms App.
-You can add a Win Forms App. and Use the Bellow part of code to read.
private void btnReadTag_Click(object sender, EventArgs e)
{
serialPort = new SerialPort();
serialPort.PortName = "COM1";
serialPort.BaudRate = 9600;
serialPort.DataBits = 8;
serialPort.Parity = Parity.None;
serialPort.StopBits = StopBits.One;
serialPort.Open();
serialPort1.ReadTimeout = 2000;
serialPort.DataReceived += new SerialDataReceivedEventHandler(Fun_DataReceived);
serialPort.Close();
}
string data = string.Empty;
private delegate void SetTextDeleg(string text);
void Fun_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
Thread.Sleep(500);
data = serialPort.ReadLine();
this.BeginInvoke(new SetTextDeleg(Fun_IsDataReceived), new object[] { data });
}
private void Fun_IsDataReceived(string data)
{
txtAccessCardNo.Text = data.Trim();
}
Have great learning :)