how to hserin compare with known value?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    first of all many thanks for repply dear pedja089
    now my code like this,

    main:
    HSERIN [WAIT($07), str DATAIN\8]
    if datain[1] = $06 then high portc.3
    hserout [str datain\8]
    goto main
    END

    this not working

  2. #2
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default

    Datain[1] is second byte in string.
    If you wait number 7, then that byte isn't in datain array.
    If you sent 7,6,12, then in datain first byte is 6, second is 12, so you need something like this
    Code:
    HSERIN [WAIT($07), str DATAIN\8]
    if datain[0] = $06 then high portc.3
    And now if you send 7,then 6, and 6 more byte portc will go high.

  3. #3
    Join Date
    Oct 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    many many thanks dear pedja089
    now code is working
    what methed in short becuse i have too bytes for compare for example
    hex :07 06 00 82 2D A1 00 D7 D8 , 07 06 00 82 2D CF 35 C4 90 , 07 06 00 82 2E 2F 35 C4 73 , many more ,so
    i want further help?

  4. #4
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default

    Try both ways and see which is faster.

  5. #5
    Join Date
    Oct 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    thanks ,
    now i want write this 9 byte data and read its back .How this posible my mean how to write aray and read it again.
    Regards

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts