PDA

View Full Version : Parallx rfid reader module interface with PC



jonil22
- 30th January 2008, 16:09
Hi,

I am doing an interface with the PC and the parallax RFID reader module through PIC 16F877A. The program interface in the PC is Visual Basic 6(VB6) . I think there is something wrong with my Visual Basic codings. When i scan the RFID tag , the VB6 will capture the data from the PIC. Then it will search the database for the matching ID. IF found , the label box will put Found It. The porblem is that when i scanned the matching RFID ID tag , the VB6 program will put Not Found in the label box and the program will hang. When the MSComm1.output = Chr$(255) & Chr$(modenumber) command line is deleted, when the RFID tag is scanned , the program can find the matching data in the database. Is there any problem with my codings ? Below is the vb6 program code.

Private Sub Form_Load()

MSComm1.CommPort = 1
MSComm1.Settings = "2400,N,8,1"
MSComm1.RThreshold = 10
MSComm1.SThreshold = 1
MSComm1.InputLen = 0
MSComm1.PortOpen = True
MSComm1.DTREnable = False
MSComm1.RTSEnable = False

End Sub


Private Sub MSComm1_OnComm()
Dim buffer As String, Criteria As String
Dim IDFound As Boolean
Dim modenumber As Integer

If (MSComm1.CommEvent = comEvReceive) Then
buffer = MSComm1.Input
picBox.Print buffer & " " & Time() & " " & Date
End If

IDFound = False
modenumber = 0
Criteria = "ID =" & "'" & buffer & "'"
datIDTAG.Recordset.FindFirst Criteria
MSComm1.OutBufferCount = 0

Do While datIDTAG.Recordset.NoMatch = False
modenumber = 1
lblNum.Caption = "Found It. " & modenumber
IDFound = True
datIDTAG.Recordset.FindNext Criteria
Loop
If IDFound = False Then
lblNum.Caption = "Not Found. " & modenumber
End If

MSComm1.Output = Chr$(255) & Chr$(modenumber)

End Sub

Plz help me to solve this problem.Thanks.

skimask
- 30th January 2008, 17:27
The program interface in the PC is Visual Basic 6(VB6)
PicBasicPro this is not...
May be better suited in the Off-Topic section ya think?

jonil22
- 31st January 2008, 08:50
ooo..Opps sorry.This is my first time using this forum.Thanks