Lookdown command the result not consistent


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Lookdown command the result not consistent

    Sorry, yes I did have a type. It looks for STATUS2? in the second line. My apologies.
    Charles Linquist

  2. #2
    Join Date
    Feb 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: Lookdown command the result not consistent

    Dear Charles,
    Today i try to debug the command code u suggest,

    1) serin2,PORTC.4,16390,1000,NotFound,[WAIT ("CB2E")] --- Result OK.....can detect the string.

    2) my code,

    GET_DATA:
    ' SERIN2 PORTC.4,16390,5000,NotFound,[wait ("C82F")]
    serin2 PORTC.4,16390,5000,notfound,[DATA_array]
    ARRAYREAD data_array,256,NOTFOUND,[wait ("C82F"),serstring1,serstring2]
    debug serstring1
    debug serstring2
    goto REV_DATA
    NotFound:
    debug "Not Found",10,13
    pause 1000
    goto RESET_

    Data stream:
    A5 5A C0C05E
    A5 5A 0E2E 21 00 00 00 00
    A5 5A 0E70 26 FE 00 00 00 00 FF
    A5 5A C870 26 FE 00 00 00 00
    A5 5A C82F
    A5 5A 0E2E 20 00 00 00 00
    A5 5B 0CC2 00
    A5 5A C2D2
    A5 5A 060F 00

    Result: i get "Not Found" but not the serstring1,serstring2 that i debug. I wonder why this happen to the command "Arrayread"?

    TQVM

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Lookdown command the result not consistent

    I don't know exactly what you are trying to do, but the code below works.

    Code:
     
            CR CON 13
            LF CON 10
     
             Data_Array VAR BYTE [30]
             AfterString1 var byte [10]
             AfterString2 var byte[10]
             ArrayWrite AfterString1,[REP 0\10]  ; Zero out the strings
             ArrayWrite AfterString2,[REP 0\10]
     
     
     
     
     
          ArrayWrite  Data_Array,"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S",0]
     
     
     
     
     
          Arrayread Data_Array,20,NotFound,[Wait ("CDE"),STR AfterString1 \6,STR AfterString2 \6]
     
          hserout [CR,LF,"AfterString1 ",STR AfterSTring1,CR,LF]
         hserout [CR,LF,"AfterString2 ",STR AfterSTring2,CR,LF]
          goto home
     
    notfound:
     
         hserout["Not Found"]      
     
    home:
     
       goto home
    Charles Linquist

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