hi guys.. i need to read tags using rfid reader. the reader is connected to the computer using serial port. can anyone advise me the codes for receving the tags data? i'm using microsoft visual studio 2005.
thanks. your help is appreciated.:(
Ok first, you need to read up on the protocol for reading/writing to and from the read/writer and create code that will assemble protocol-structured statements and pipe them out over the serial port.
Once you've got that done its really simple. In VB2005 or greater you could start with this:
Public Class Form1
Dim sp as new serialport
private sub form1_load(blah blah)
sp.close() 'you always want to close the port when closing the form or opening just incase it was left open
sp.baudrate = 9600
sub write(byval str as string) ' this is where you're going to send
'the string you've assembled, or you could even use a byte or
'char array and really have it work beautifully...
'depends how proficient you are with VB and/or code
dim sw as new stopwatch
do until sp.bytestoread = <whatever> or sw.elapsedmilliseconds > 1000
dim intnumbytes as integer = sp.bytestoread
dim bytchardata(intnumbytes -1) as byte
sp.read(bytchardata, 0, intnumbytes)
catch ex as exception