Mar 26th, 2006, 10:08 AM
#1
Thread Starter
New Member
problem with rfid reader
Hello Friends
i am doing a project in RFID
I have purchased an RFID Reader.
They gave me some source code with it.
It has Connect and Read Tag buttons.
I click connect ,Serial connection is started.
i click read tag, the port is opened and the writer turns into active read mode and scans any tag i place nearby.
Now my problem.
After one tag is read ,i have to click the Read Tag again ( 4 times ) really funny to make it come to the active read mode.
I am a student and want to display an automated library .
SO how can i make the reader come back into read mode after reading a tag,
say after 5 seconds.
VB Code:
Private Sub Command1_Click() ' Connect RFID read write unit
Call Connect
End Sub
Private Sub Connect()
Dim Mystring As String
Dim readdata As String
Dim dummy As Integer
'Check if port is open or closed
If (MSComm1.PortOpen = True) Then
MSComm1.PortOpen = False
Command1.Caption = "Connect" ' Change button caption
Else
' Initialize MSCOMM
MSComm1.CommPort = CStr(Right(Combo1.Text, 1))
MSComm1.Settings = "19200,n,8,1"
MSComm1.DTREnable = False
MSComm1.EOFEnable = False
MSComm1.Handshaking = comNone
MSComm1.InBufferSize = 512
MSComm1.InputLen = 24
MSComm1.InputMode = comInputModeText
MSComm1.NullDiscard = False
MSComm1.OutBufferSize = 512
MSComm1.ParityReplace = "?"
MSComm1.RThreshold = 0
MSComm1.RTSEnable = False
MSComm1.SThreshold = 8
MSComm1.PortOpen = True
Mystring = CStr(MSComm1.Input) ' Flush input
Command1.Caption = "Disconnect"
End If
again1:
Do While Checkport() = True ' IF RFID reader is still connected
Do
dummy = DoEvents()
Loop Until MSComm1.InBufferCount >= 8 ' Then loop until a new value is received
Mystring = CStr(MSComm1.Input) ' Store value received in 'MyString'
txtFields(0) = Mystring ' Show ID
txtFields(1) = (Date) ' Show current Date
txtFields(2) = (Time) ' Show current Time
readdata = Mystring & " @ " & Date & "=" & Time
List1.AddItem readdata
Loop
End Sub
Static Function Checkport() As Boolean
If (MSComm1.PortOpen = True) Then
Checkport = True
Else
Checkport = False
End If
End Function
Mar 26th, 2006, 10:22 AM
#2
Thread Starter
New Member
Re: problem with rfid reader
added project files also for ur reference
me a student and stuck with this in final stage of my degree..
please help
Attached Files
Apr 5th, 2006, 05:26 AM
#3
Re: problem with rfid reader
have you tried after waiting for some time and read it in single attempt?
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
Apr 5th, 2006, 05:27 AM
#4
Re: problem with rfid reader
since, we don not have rfid readers here, we can not check it...you can do the step by step debugging by pressing F8 key and see what happens for the 4 attempts and analyse...
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
Apr 5th, 2006, 06:56 AM
#5
Thread Starter
New Member
Re: problem with rfid reader
ya .. i tried stepping through te code by pressin f8.. no luck...
Apr 5th, 2006, 07:01 AM
#6
Re: problem with rfid reader
Don't open and close the port on every "Command1_Click".
Create a separate button for it or open the port in a form load event and close the port in a form close event.
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