Results 1 to 4 of 4

Thread: RFID Reader serial data into VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    2

    RFID Reader serial data into VB

    Hey all:

    This is my first post in these forums and by the looks of the other posts on the forum, everyone seems to get their problems fixed very quickly.

    Anyways, to the problem I am having. I have a TI S2000 RFID reader and I am taking the data from that reader and transmitting it serially to the computer. My overall goal is to take the data coming in and compare it to another value that would be stored in the VB code itself, which would then do something else.

    First, a description of the data. The data coming into the computer is a 12 byte hexadecimal string (ie. 01 09 0C 96 38 F0 07 00 00 00 00 5C). This string goes into the computer and we use this code to get it into the VB program:
    Code:
    Private Sub cmdRun_Click()
    Do
    dummy = DoEvents()
    Loop Until MSComm1.InBufferCount >= 12
    Value = MSComm1.Input
    Text1.Text = Value
    Timer1.Enabled = True
    End Sub
    
    Private Sub Option2_Click()
    MSComm1.PortOpen = True
    End Sub
    
    Private Sub Timer1_Timer()
    cmdRun_Click
    End Sub
    When we use this code and it outputs to a textbox, we get jibberish characters. Pretty sure it is because a lot of those HEX characters can't be represented with simple ASCII.

    We are using the MSComm component. We are interested in using the OnComm feature, but we really have no idea how to approach the problem.

    Any help would be greatly appreciated.

    Thanks in advance.

    --Colin

  2. #2
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    Re: RFID Reader serial data into VB

    Gibberish could also be due to incorrect baud rate settings

    This code looks familiar, is this your thread or are there two of you working on this?

    http://www.vbforums.com/showthread.php?t=462782
    Last edited by gtilles; Apr 12th, 2007 at 12:00 PM.
    Truly, you have a dizzying intellect.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2007
    Posts
    2

    Re: RFID Reader serial data into VB

    There are 2 of us. We did not know if this would be breaking the rules or not. I wasn't sure if he put it in the wrong sub-forum or not. Forgive me if this was a mistake. I also thought that some of the users from one forum may not visit the others as much, so i am just getting our problem out there a little more.


    The jibberish is due to the hex values not being valid ASCII characters that can be represented as numbers or letters. The baud setting are set correctly. The reader works on 9600,8,N,1.

    Thanks

    -Colin

  4. #4
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394
    Last edited by gtilles; Apr 12th, 2007 at 04:07 PM.
    Truly, you have a dizzying intellect.

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