-
Oct 28th, 2012, 09:01 AM
#1
Thread Starter
Junior Member
Getting Card number of RFID
I have created a simple program that whenever detects a TAG, it will print the tag number..but what I get is └4800EC7D2DF4┐ but the └ and ┐ are displayed like a box...I already figured out after converting this ASCII code to hexa that the two symbols at the start and end are 02 and 03 in hexa which is start of text and end of text, and from what is written in my card that the card number is 0015498541 which I tried to convert back to ASCII and figured out that it is EC7D2D which is included above, my problem now is how can I get only EC7D2D to be displayed in the textbox? what is the 4800 and the F4 there? how can I remove those to detect only the Card number? any help is very appreciated..thank you so much
-
Oct 29th, 2012, 10:35 AM
#2
Re: Getting Card number of RFID
The 48 is probably some sort of vendor code and the F4 some sort of checksum. However since there are no standards (or actually a ton of very different "standards" and some have variations) there isn't much we can tell you.
Different "reader" devices use different protocols. Yours uses STX/ETX while others use a trailing CRLF pair.
Consult the vendor's documentation.
-
Oct 29th, 2012, 01:59 PM
#3
Thread Starter
Junior Member
Re: Getting Card number of RFID
Originally Posted by dilettante
The 48 is probably some sort of vendor code and the F4 some sort of checksum. However since there are no standards (or actually a ton of very different "standards" and some have variations) there isn't much we can tell you.
Different "reader" devices use different protocols. Yours uses STX/ETX while others use a trailing CRLF pair.
Consult the vendor's documentation.
Thanks for the Reply. My problem was only the STX and ETX, because when I write an IF statement there that if a specific card is detected it will display a message box for example, it sometimes find that card, but sometimes not, since the STX and ETX change it's values.
But just to update I did get a good result by using the Mid function in vb 6; where I wrote this code:
Code:
Private Sub MSComm1_OnComm()
Dim InBuffer As String
Dim tagid As String
InBuffer = MSComm1.Input
tagid = Mid((InBuffer), 6, 6)
If MSComm1.CommEvent = comEvReceive Then
Text1.Text = Text1.Text & tagid & vbCrLf ' Put received data in Text1
If tagid = "EC7D2D" Then
MsgBox ("Student number 2!!!")
to get only the EC7D2D from └4800EC7D2DF4┐... my problem now is how to put this in a database
-
Oct 30th, 2012, 01:00 AM
#4
Re: Getting Card number of RFID
Well it isn't safe to just use the number without validating the checksum. That's why you need to check the documentation to see how it is calculated.
Otherwise you just have a Long value there, which is trivial to decode from Hex.
-
Oct 30th, 2012, 01:29 AM
#5
Thread Starter
Junior Member
Re: Getting Card number of RFID
so I need to include the CheckSum there?? what is it for?? Does it make any difference if I don't include it? thanks
-
Oct 30th, 2012, 07:46 AM
#6
Re: Getting Card number of RFID
The checksum is there to help you detect corrupted data. Ignoring it means you risk capturing incorrect values.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|