Jade_Emeperor


Hi. I'm having trouble displaying the RFID tag's infromation. The program display like this:

PC > Reader: 07 FF B0 01 00 1C 56

PC < Reader: E0 05 40 00 00 5C 2B 34

PC > Reader: 11 FF B0 23 01 E0 05 40 00 00 5C 2B 34 00 01 1F 21

PC < Reader: E0 05 40 00 00 4C 2B 34

PC > Reader: 07 FF B0 01 00 1C 56

PC < Reader: 35 64 64 61

PC > Reader: 11 FF B0 23 01 35 64 64 61 00 01 22 61

PC < Reader: 35 64 64 61

This second portion in red is wrong as it 'loop' back with the tag content in blue. While the first portion in orange should not suppose to be appear in there. That was where the tag content was suppose to be in. The display should display like this:

PC > Reader: 07 FF B0 01 00 1C 56

PC < Reader: E0 05 40 00 00 5C 2B 34

PC > Reader: 11 FF B0 23 01 E0 05 40 00 00 5C 2B 34 00 01 1F 21

PC < Reader: 35 64 64 61

This should be the correct arrangement. My program is suppose to loop back these information(tag ID, CRC and content may varies) at a delay of 100mS.

Here's the code that controls the display:

Code Snippet

Option Explicit
Dim sbuffer As String
Public crc_output As String
Public crc_output2 As String
Public InvertCRC As String
Public buflen As Byte

'Temporary Public variables
Public tagIDbuffer As String
Public tagCRCbuffer As String

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 b As String
Dim g As String
Dim sMsg As String 'Tag ID value

Dim temp1 As String 'CRC value appended to the relevant tag

'Temporary variables
Dim tagID As String
Dim tMsg As String

'Convert the tag ID hexadecimal number to string format.
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

sbuffer = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H23) + Chr$(&H1) + b + Chr$(&H0) + Chr$(&H1)

crc_output = CalcCRC16CheckSum(sbuffer, Len(sbuffer))

temp1 = modCRC16.InvertCRC

tagIDbuffer = b
tagCRCbuffer = modCRC16.crcbuffer

frmMain.MSComm1.Output = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H23) & _
Chr$(&H1) + tagIDbuffer + Chr$(&H0) + Chr$(&H1) + tagCRCbuffer

frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _
"PC -> Reader: 11 FF B0 23 01 " & sMsg & "00 01 " & temp1 & vbCrLf

frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _
"PC <- Reader: " & sMsg & vbCrLf & vbCrLf

buflen = Len(sbuffer)
frmMain.Text1.Text = Len(sbuffer)

End Function

So sorry if I throw in a big chunk of code in it. But thanks for helping.




Re: Display information as a whole

Jade_Emeperor


I've identitfy the problem. Initially I send this first:

Code Snippet

MSComm1.Output = Chr$(&H7) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H1) + Chr$(&H0) + Chr$(&H1C) + Chr$(&H56)

Then this code initiates the module as shown in previous post. Then when it executes this code:

Code Snippet

frmMain.MSComm1.Output = Chr$(&H11) + Chr$(&HFF) + Chr$(&HB0) + Chr$(&H23) & _

Chr$(&H1) + tagIDbuffer + Chr$(&H0) + Chr$(&H1) + tagCRCbuffer

But it executes but the code:

Code Snippet

frmMain.txtDisplay.Text = frmMain.txtDisplay.Text & _

"PC <- Reader: " & sMsg & vbCrLf &vbCrLf

It still displays the tag ID. Only when it loops back, they display the tag content accordingly but not what I wanted it to be displayed (See the previous post).

Off topic here: I realise that most forum I looked for help, whenever I say I'm working on RFID, only a few people is willing to help. If there's really nobody that could help me, just let me know.






Re: Display information as a whole

Jade_Emeperor

Please help. It's urgent and I have to submit my work to my project supervisor by today. Not trying to force anyone but I really can't find any solution on my own after trying out a lot of times. That is why I want to seek help from you guys.

Thank you.