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:
  1. Private Sub Command1_Click()  ' Connect RFID read write unit
  2.    Call Connect
  3. End Sub
  4.  
  5. Private Sub Connect()
  6. Dim Mystring As String
  7. Dim readdata As String
  8. Dim dummy As Integer
  9.  
  10. 'Check if port is open or closed
  11. If (MSComm1.PortOpen = True) Then
  12.     MSComm1.PortOpen = False
  13.     Command1.Caption = "Connect"        ' Change button caption
  14. Else
  15.                                         ' Initialize MSCOMM
  16.     MSComm1.CommPort = CStr(Right(Combo1.Text, 1))
  17.     MSComm1.Settings = "19200,n,8,1"
  18.     MSComm1.DTREnable = False
  19.     MSComm1.EOFEnable = False
  20.     MSComm1.Handshaking = comNone
  21.     MSComm1.InBufferSize = 512
  22.     MSComm1.InputLen = 24
  23.     MSComm1.InputMode = comInputModeText
  24.     MSComm1.NullDiscard = False
  25.     MSComm1.OutBufferSize = 512
  26.     MSComm1.ParityReplace = "?"
  27.     MSComm1.RThreshold = 0
  28.     MSComm1.RTSEnable = False
  29.     MSComm1.SThreshold = 8
  30.     MSComm1.PortOpen = True
  31.     Mystring = CStr(MSComm1.Input)      ' Flush input
  32.     Command1.Caption = "Disconnect"
  33. End If
  34.  
  35. again1:
  36.     Do While Checkport() = True             ' IF RFID reader is still connected
  37.         Do
  38.             dummy = DoEvents()
  39.         Loop Until MSComm1.InBufferCount >= 8  ' Then loop until  a new value is received
  40.         Mystring = CStr(MSComm1.Input)          ' Store value received in 'MyString'
  41.         txtFields(0) = Mystring                 ' Show ID
  42.         txtFields(1) = (Date)                   ' Show current Date
  43.         txtFields(2) = (Time)                   ' Show current Time
  44.         readdata = Mystring & " @ " & Date & "=" & Time
  45.         List1.AddItem readdata
  46.     Loop
  47. End Sub
  48.  
  49. Static Function Checkport() As Boolean
  50. If (MSComm1.PortOpen = True) Then
  51.     Checkport = True
  52. Else
  53.     Checkport = False
  54. End If
  55. End Function