FullDuplexSerial Assistance Needed
Brian Carpenter
Posts: 728
Ok, how to start.·
I am currently using the FullSerialDuplex object from the object exchange and i am sending data (strings) out the .tx· i have been doing this successfully for a while now.· But what i want to do is also recieve data back.· I have done this in one program.
but all this gets me is one character.·
What if i want to recieve data like·· #1042,123,1513,1232,1220$
I was thinking that the # would let the rx know that it is the beginning and the $ would signify the end?
how do i get all this stored into a variable. or better yet, parse between comma's and store several variables.
i am stumped and would love to see an example
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
I am currently using the FullSerialDuplex object from the object exchange and i am sending data (strings) out the .tx· i have been doing this successfully for a while now.· But what i want to do is also recieve data back.· I have done this in one program.
repeat until ser.rx == "#" ' wait for start char ch := sock.rxtime(250) ' get response code if ch <> "0"
but all this gets me is one character.·
What if i want to recieve data like·· #1042,123,1513,1232,1220$
I was thinking that the # would let the rx know that it is the beginning and the $ would signify the end?
how do i get all this stored into a variable. or better yet, parse between comma's and store several variables.
i am stumped and would love to see an example
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Comments
Post Edited (Mike Green) : 8/20/2009 5:09:56 AM GMT
edit: you'll probably have to have an OR on those two lines, since there are multiple possibilities for end of number ( "," and "$"). On a side note, if you have control over the serial stream you may want to put the $ first, just to be consistent with NMEA GPS strings. Also, if you do have control and you always know how many numbers are transmitted in a string, you might as well end it with another ','.
Post Edited (SRLM) : 8/20/2009 5:51:54 AM GMT
IIRC!
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Shows you the value of browsing through the index rather than searching. If at first you don't succeed, go browse. It takes less than a minute!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
C:\Program Files\Parallax Inc\Propeller Tool v1.2.6\Examples\PE Kit\6 - Objects Lab
in similar cases do a search for *plus*.spin in directory "Propeller Tool v1.2.6" including all subdirectories.
By the way and somehow OT: the tool Instant File Name Search
scans my entire harddisk with over 360.000 files within 30 seconds if PC is not busy and in 3 minutes if PC is busy
After scanning searching for a filename is done in less than 1 second ! never wanna miss this tool again
best regards
Stefan
Post Edited (StefanL38) : 8/21/2009 9:26:19 AM GMT