How to compare the mscomm data recieved using RFID and Compare it with my Text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OldSchool
    New Member
    • Nov 2006
    • 27

    How to compare the mscomm data recieved using RFID and Compare it with my Text

    Sir its me julius,

    Sir how can i compare the mscomm data recieved using RFID and Compare it with my Text data.

    Sir example.

    Private Sub MSComm1_OnComm( )

    Text1.SetFocus
    ' STX Data ETX + Cr
    Text1.Text = MSComm1.Input
    MSInput = Text1.Text
    End Sub

    How can i compare the recieved Data to TextData ?
    Msinput is memory right?
    How can i compare the Input in MSinput to Text data and i will display Msgbox "ok you're Passed" after comparing the Data


    Hope you will responds
    Thanks.

    Julius
  • albertw
    Contributor
    • Oct 2006
    • 267

    #2
    Originally posted by OldSchool
    Sir its me julius,

    Sir how can i compare the mscomm data recieved using RFID and Compare it with my Text data.

    Sir example.

    Private Sub MSComm1_OnComm( )

    Text1.SetFocus
    ' STX Data ETX + Cr
    Text1.Text = MSComm1.Input
    MSInput = Text1.Text
    End Sub

    How can i compare the recieved Data to TextData ?
    Msinput is memory right?
    How can i compare the Input in MSinput to Text data and i will display Msgbox "ok you're Passed" after comparing the Data


    Hope you will responds
    Thanks.

    Julius
    hi

    you could do it like that i suppose
    however your mscomm input might be only 1 character
    better to create a loop while receiving all data and compare afterwards
    such as

    Code:
        Do
        DoEvents
        RxTxt = MSComm1.Input
        If Len(RxTxt) > 0 Then strBuffer=strBuffer + RxTxt
        Loop Until RxTxt = Chr(10) 'or whatever character is used to end input string
    now you can compare strings

    Code:
    if Text1.text=Buffer then
    msgbox "OK, you're passed",vbokOnly+vbExclamation"
    endif

    Comment

    • OldSchool
      New Member
      • Nov 2006
      • 27

      #3
      Sir i Highly appreciated your kindness, Sir can you out Comment in the code you given to me if you dont mind sir...


      Thanks
      Julius

      Comment

      • albertw
        Contributor
        • Oct 2006
        • 267

        #4
        Originally posted by OldSchool
        Sir i Highly appreciated your kindness, Sir can you out Comment in the code you given to me if you dont mind sir...


        Thanks
        Julius
        first of all julius, there are no sirs here :), thank you.

        Do
        -- start a loop
        DoEvents
        -- look if no other thing (keystrokes or whatever occur)
        RxTxt = MSComm1.Input
        -- name your mscomm input RcTxt
        If Len(RxTxt) > 0 Then strBuffer=strBu ffer + RxTxt
        -- if RxTxt holds data, transfer this to a buffer, called strBuffer
        Loop Until RxTxt = Chr(10)
        -- if the input meets e.g. chr(10) , the input ends

        now you have all your received data in strBuffer and can you start to compare

        if Text1.text=Buff er then
        -- if the contents of Text1 as the same as what you received (strBuffer)
        msgbox "OK, you're passed",vbokOnl y+vbExclamation "
        -- show a messagebox that you're passed.
        endif
        -- otherwise do nothing

        Comment

        • OldSchool
          New Member
          • Nov 2006
          • 27

          #5
          Thanks!

          Big help to me. coz as of now im just a beginner in vb. thanks for the support.

          From where country you are if you dont mind?

          Julius

          Originally posted by albertw
          first of all julius, there are no sirs here :), thank you.

          Do
          -- start a loop
          DoEvents
          -- look if no other thing (keystrokes or whatever occur)
          RxTxt = MSComm1.Input
          -- name your mscomm input RcTxt
          If Len(RxTxt) > 0 Then strBuffer=strBu ffer + RxTxt
          -- if RxTxt holds data, transfer this to a buffer, called strBuffer
          Loop Until RxTxt = Chr(10)
          -- if the input meets e.g. chr(10) , the input ends

          now you have all your received data in strBuffer and can you start to compare

          if Text1.text=Buff er then
          -- if the contents of Text1 as the same as what you received (strBuffer)
          msgbox "OK, you're passed",vbokOnl y+vbExclamation "
          -- show a messagebox that you're passed.
          endif
          -- otherwise do nothing

          Comment

          • albertw
            Contributor
            • Oct 2006
            • 267

            #6
            Originally posted by OldSchool
            Thanks!

            Big help to me. coz as of now im just a beginner in vb. thanks for the support.

            From where country you are if you dont mind?

            Julius
            just click my 'picture' to see the profile
            by the way, learning VB is just open any program, read and try to understand what others have done.
            it takes a while .... :(

            Comment

            • khalilche
              New Member
              • May 2007
              • 1

              #7
              Hi Julius,
              What happened to your project. I am actually working on the same project than you. VB with RFID and reception on a serial port. If you don't mind sending me your project, it would be great.
              My e-mail address is khalilche@hotma il.com and I would appreciate it too much if you help me in my project by sending me your code.
              Thanks

              Comment

              Working...