Sie sind auf Seite 1von 5

RFID Programming

i am suppose to use a RFID (radio frequency identification device) to activate(open) a gate. i am to use visual basic 6 for my programming part but didn't noe how to use it. i believe i'll be using microsoft access for the database (so that when someone scans the RFID tag on the device, it'll compare the informations on the tag to thoae in the database, before allowing access to activate the gate) thanx

Extracting RFID Tag's CRC Hex Value


Hello. I'm new to this forum. Hope that I don't make mistakes in here but if I do, please correct me if there is. Thanks. I also wanted to ask you guys regarding about the following following source codes I'm going to post it here as I did a search here and did not find any question related to mine. I'm doing an automatic inventory control system using RFID project and I'm instructed to extract the RFID transponder's ID and CRC and display it onto the form I've created using Visual Basic 6.0 before I touch up on the database portion which I need not need to worry much about. I managed to get the program to extract the transponder's ID and display it onto the textbox but I'm having problems extracting the CRC Hex value I'm not sure which part of the code I'm suppose to addon (See below). Code: Public Sub Display_Msg(sMsg As String) frmMain.txtDisplay.Text = frmMain.txtDisplay.Text + sMsg End Sub Public Function Hex2Str(Hex_String As String) As String Dim iPos As Integer Dim iTemp As Integer Dim sMsg As String Dim b As String Dim gPos As Integer Dim g As String For iPos = 8 To Len(Hex_String) - 2 iTemp = Asc(Mid$(Hex_String, iPos, 2)) If iTemp < 17 Then sMsg = sMsg + "0" g = iTemp b = b & Chr$(g) sMsg = sMsg + Hex(iTemp) + " " Next iPos frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _ "PC -> Reader: 07 FF B0 01 00 1C 56" & vbCrLf frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _ "PC <- Reader: " & sMsg & vbCrLf taginput_crc = frmMain.txtDisplay.Text

frmMain.txtDisplay.Text = taginput_crc & _ "PC <- Reader: 11 FF B0 23 01 " & sMsg & "00 01 " & vbCrLf & vbCrLf frmMain.MSComm1.Output = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) & _ Chr$(&H23) + Chr$(&H1) + sMsg + Chr$(&H0) + Chr$(&H1) & _ frmMain.Text2.Text frmMain.txtDisplay.Text = taginput_crc & _ "PC -> Reader: 11 FF B0 23 01 " & sMsg & "00 01 " & frmMain.Text2.Text & vbCrLf & vbCrLf frmShoes.txtShoeTag.Text = "11 FF B0 23 01" & sMsg + "00 01" frmShirt.txtShirtTag.Text = "11 FF B0 23 01" & sMsg + "00 01" sbuffer = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H23) + Chr$(&H1) + b + Chr$(&H0) + Chr$(&H1) crc_output = CalcCRC16CheckSum(sbuffer, Len(sbuffer)) buflen = Len(sbuffer) frmMain.Text1.Text = Len(sbuffer) End Function

And also for example, if my CRC value is "D1B8" which isn't correct as the program calculates D1 as MSB and B8 as LSB, what must be edited to obtain the CRC value "B8D1" as this is actually the correct value (see below)? Code: Public Function CalcCRC16CheckSum(sbuffer As String, buflen As Byte) As Integer Dim i, j As Byte Dim wCrc As Integer Initialise_mPower wCrc = CRC16_PRESET For i = 1 To buflen wCrc = wCrc Xor Asc(Mid$(sbuffer, i, 1)) For j = 1 To 8 If (wCrc And &H1) Then wCrc = LShift(wCrc, 1) Xor POLYNOM Else wCrc = LShift(wCrc, 1) End If Next j Next i crc_output = wCrc

frmMain.crcdisplay.Text = crc_output a = Hex(crc_output) frmMain.Text2.Text = a End Function Public Function LShift(ivalue As Integer, iBits As Integer) As Integer If (ivalue And mPower2(15)) = mPower2(15) Then LShift = (ivalue And &H7FFF) mPower2(iBits) Or mPower2(15 - iBits) Else LShift = ivalue mPower2(iBits) End If End Function Public Function RShift(ivalue As Integer, iBits As Integer) As Integer If (ivalue And mPower2(15 - iBits)) = mPower2(15 - iBits) Then RShift = (ivalue And (mPower2(15 - iBits) - 1)) * mPower2(iBits) Or mPower2(15) Else RShift = (ivalue And (mPower2(15 - iBits) - 1)) * mPower2(iBits) End If End Function

Sorry if I posted a big chunk of code in here as I'm unsure of which portion of the code I'm suppose to look into. Thanks for the help.

Implementation Of RFID
Im doing a project in "Implementing RFID in logistics division"... I dont have any idea how to start with it... This is gonna be by career project... So please help me by giving ome information rearding RFID... Please answer the following question... 1. How to start with it? 2. Do we have any simulation software or simulation toolkit for implementing RFID? 3. Do we need to buy reader and tag directly before implementing software? 4. Can we implement the sotware using visual basic? 5. What are all the details of implementing the software in loistics division? 6. I need basic screen design to start with it... 7. If possible give me some coding for Information server software for implementing RFID? regards karthik

Obtaining RFID Tag Content


Hello once again. I made a post regarding about the RFID thread previously. Now I encounter another problem. I have made my program to display the CRC and all. Here's the steps on how the program should display when the PC reads a particular tag.

Quote: PC -> Reader: 07 FF B0 01 00 1C 56 PC <- Reader: E0 05 40 00 5C 1A 58 6B 5B PC -> Reader: 11 FF B0 23 01 E0 05 40 00 00 5C 1A 58 00 01 B8 D1 (this problem was solved in earlier thread) PC <- Reader: 0D 00 B0 00 01 04 00 34 64 64 61 CE 2C (Reader response to PC with the tag content w/ CRC highlighted in red) This following display was taken from the simulator. As mentioned in my earlier thread, I have written a program that works something like the simulator. What kind of code can I use to generate the tag content as shown as above quote? Thanks

Need To Communicate To An RFID-Scanner


Hi: Need to communicate to a radio frequency tag scanner from Visual Basic. asap. Radhika

Sonmicro RFID Module


hi i am wondering if anyone have used the RFID module (CY8C0104/05) from sonmicro? will you be able to give me some advice on how you get that to work? i have been trying to write a program to read/write to the RFID via serial port in VB6. it's partially working at the moment: i am able to send the command and acknowledge, however i am not able to read the data on the transponder. it would be great if i can get some help with my issue. the following is the code i use for my Read Command, in order to read the information stored on the transponder. Code: '******************************************************************** '* Send Read Command to RFID * '******************************************************************** Private Sub cmdRead_Click() Dim RFID2portRead, RFID2portAck As String Dim read_command(7) As Variant Dim acknowledge_read(7) As Variant '0x72 0x65 0x33 0x36 0x34 0x02 0x07 0x01 (read command) '0x61 0x63 0x6B 0x6E 0x77 0x6C 0x67 0x65 ('acknwlge' request) read_command(0) read_command(1) read_command(2) read_command(3) read_command(4) read_command(5) = = = = = = Chr$(114) 'r Chr$(101) 'e Chr$(48) '0 Chr$(54) '6 Chr$(52) '4 Chr$(50) 'full power mode

read_command(6) = Chr$(55) 'read # times read_command(7) = Chr$(52) 'read # blocks RFID2portRead = read_command(0) & read_command(1) & read_command(2) & _ read_command(3) & read_command(4) & read_command(5) & read_command(6) & read_command(7) acknowledge_read(0) acknowledge_read(1) acknowledge_read(2) acknowledge_read(3) acknowledge_read(4) acknowledge_read(5) acknowledge_read(6) acknowledge_read(7) = = = = = = = = Chr$(97) 'a Chr$(99) 'c Chr$(107) 'k Chr$(110) 'n Chr$(119) 'w Chr$(108) 'l Chr$(103) 'g Chr$(101) 'e

RFID2portAck = acknowledge_read(0) & acknowledge_read(1) & acknowledge_read(2) &_ acknowledge_read(3) & acknowledge_read(4) & acknowledge_read(5) & acknowledge_read(6) & acknowledge_read(7) MSComm1.Output = RFID2portRead MSComm1.Output = RFID2portAck MSComm1_OnComm End Sub Private Sub MSComm1_OnComm() Dim InString As String ' Retrieve all available data. MSComm1.InputLen = 0 ' Check for data. If MSComm1.InBufferCount Then ' Read data. InString = MSComm1.Input If Len(InString) > 0 Then Text1.SelText = InString End If End If End Sub

POS System With Reward System (RFID Card)


HI folks... I'm currently intend to develop a customer/reward system that capture the amount purchase each time. The membership card is a RFID card, i will used a desktop reader to read the card. But the problem is, POS system have been used. So,how am i going to read the amount purchase from the POS system to my reward system. Is not a good pratice to let the cashier to key keyin the amount munaully. Anyone can give me some advice..? like how to reside the vb system into POS..., or others good method to do it so that cashier have the easy way to do the daily task.... Thanks in advance..

Das könnte Ihnen auch gefallen