-
Hserin amount
I've found some threads that confirm the problem I'm having but none that provide a resolution.
Why doesn't this work:
HSERIN 1, [STR DAT\800\"@"]
But this does?
HSERIN 1, [STR DAT\255\"@"]
Is the maximum input for an array 255? The only way I can make it work right now is:
HSERIN 1, [STR DAT1\255\"@", STR DAT2\255\"@", STR DAT3\255\"@", STR DAT4\255\"@"]
-
Re: Hserin amount
I use this code to receive string longer then 255 chars
Code:
FOR i=0 TO 799
HSEERIN 1, TimeOutLabel,[Chr] ' get char
IF Chr="@" THEN
GOTO Done 'End of data
ELSE
DAT[i]=Chr ' put char in array
ENDIF
NEXT i
Done:
DAT[i]=0 'End of string
-
Re: Hserin amount
Make sure you declare variables that will be over 255 as words, also assume you have a typo in the above code "HSEERIN".
-
Re: Hserin amount
Because the serial buffer is one byte. HSERIN looks at the one byte buffer received.
The idea is to cycle the rest of your program between bytes.