Results 1 to 6 of 6

Thread: problem with rfid reader

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    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:
    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

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    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 Attached Files

  3. #3
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    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.


  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Re: problem with rfid reader

    ya .. i tried stepping through te code by pressin f8.. no luck...

  6. #6
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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
  •  



Click Here to Expand Forum to Full Width