It would seem to be a lot easier to capture the whole sequence, then later scan the array for any commas and deal with it that way, especially since when you are using SERIN you have very little processing time available between characters.
It would seem to be a lot easier to capture the whole sequence, then later scan the array for any commas and deal with it that way, especially since when you are using SERIN you have very little processing time available between characters.
Charles Linquist
I think that's a great suggestion and I agree. I have been unable to successfully parse it after the fact.
and to make matters worse I am unable to consistantly and correctly receive serial packets.
Well, I got the serial function working reliably by doing this:
hserIN 65535, oops, [STR smallp\12\10]
rather than this:
hserIN 65535, oops, [STR smallp\12\13]
aparently the linefeed was the last command sent, so by terminating with a carraige return, the linefeed that followed was polluting the serial stream for the next packet
So now that I'm just looking at a parsing issue I've changed the serial in code to:
hserIN 65535, oops, [STR smallp\5, WAIT(","), STR largep\5\10]
It doesn't work as expected. When receiving 1480,95...
STR smallp\5 actually captures 5 characters including the comma even though it's the "wait for" character. I can't make smallp\4 because sometimes the data received will be 5 characters. It could also be 3 or 2 or 1 characters.
Why don't you try it this way
hserIN 65535, oops, [STR smallp\5\","]
hserIN 65535, oops, [STR largep\5\13]
then you have the values in 2 streams, each left justified-
David
Wow, second post and you are already helping . . . <B><H2>WELCOME TO THE FORUM DAVID !
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Hi David,
That would almost work. The problem is that neither string is guaranteed to be exactly 5 characters. So if the sent data was 1499,136 I would actually get 1499, likewise if the data is only 3 characters like 210,152 I would actually get 210,1
confusing!!
Bookmarks