ArrayRead on longer arrays


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default ArrayRead on longer arrays

    Hello,
    I havn't found much info on arrayread, but
    I would like to use arrayread on an array of about 1000. The maxlength max val is 256, and when I tried leaving off the maxlength, if the "wait" is not found, the routine runs-off-the-end and infact crashes out the program.


    Code:
    ParseSUB:        'InDX must be < 256
    b6=0:B7=0  
    arrayread rcvdata, INDX,NONE,  [wait("RUN")]:b6=1 
    NONE:arrayread rcvdata, INDX,NONE1,  [wait("STOP")]:b7=1 
    NONE1: RETURN
    This works well if index < 256. Is there a way to do the same parse for longer arrays ?

    Don
    amgen

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


    Did you find this post helpful? Yes | No

    Default Re: ArrayRead on longer arrays

    I haven't tried anything yet, but perhaps you could break your 'rcvdata' into smaller arrays, like

    hserin [STR rcvdata1 \255]:hserin [STR rcvdata2 \255]:hserin [STR rcvdata3 \255]

    Then you can test all 3 arrays for RUN and STOP.
    Charles Linquist

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: ArrayRead on longer arrays

    Charles,
    You got me thinking about breaking up array, so I tried a few things,
    Arrayread Array[index point in array], limit,goto................................. starts read at a point into array.

    After storing chars with RXint, framing with start and end char to start loading and triggering a finish to rcv and parse, I have an index of char count. So now I can figure indexing points and lengths as follows.

    Code:
     ParseSUB:        'InDX up to 500 dec
    b6=0 
    if indx<250 then             'char count less than 250 for 1 sweep 
    arrayread rcvdata, INDX,NONE,  [wait("RUN")]:b6=1:return
    else 
    INDX1=indx-245                'char count >250 and < 500 about
    arrayread rcvdata, 250,NONE1,  [wait("RUN")]:b6=1:return  'test first 250 char in array
    NONE1;
    arrayread rcvdata[245], INDX1,NONE,  [wait("RUN")]:b6=1:return  'test balance of chars  at >245 indx
    NONE: RETURN                    'back-up a few chars incase "wait" straddles arrayread
    endif
    Same setup for other parses, I'm not sure if some code could be reduced.
    Don

Members who have read this thread : 1

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