Can anyone help me or suggest me how i could read a VARIABLE STRING RESPONSE from a device connected via a RS232 to my PIC. I want to then be able to check each of the character of that read string and then loop into my code.
I tried with putc and getc but cant make it generic when the length of the response changes.
The code need to get whatever length string the response is given by the device at the RS232 PIN and store it in say response[x].
thanks
ujjwal
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
Posted: Sat Mar 01, 2008 4:38 pm
What is the string terminator? Whatever that is, you have to look for that to know the current string is completed.
if there is no terminator you start a timer on the receipt of each character then wait several character times to know when the string is complete.
If the characters in each string don't always come in together and there is no terminator I offhand don't know of any solution to your problem...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum