01-29-2009 04:49 PM
Is there a simple command that will reset a string (that is appending streaming data) to blank/zero/nothing/empty?
I want to read GPS data that I get every 500 seconds, but I don't want the hex munge that comes after the GPS string. When I use Search/Split String, all the munge after the first GPS sentence is considered valid. Code attached. My GPS transmission looks like this.
$GPRMC,224437,A,4434.0958,N,12316.6368,W,000.0,000.0,290109,017.2,E*68
$GPGGA,224437,4434.0958,N,12316.6368,W,1,04,3.1,109.4,M,-21.5,M,,*7
ÌÌÌÌÌÌÌ (repeat this char for 500 secs)
Thanks for the help!
01-29-2009 06:35 PM
What is a "munge"?
If you want to clear the feedback node, you should use a select statement or a case structure that sends an empty string constant to the feedback node once you condition is met.
You don't have any while loop on this. Is this running continuously or called from another VI? Please don't use the Run Continuous button.
01-29-2009 06:54 PM
Infinitive |
Third person singular |
Simple past |
Past participle |
Present participle |
to munge (third-person singular simple present munges, present participle munging, simple past and past participle munged)
in this case, the incoherent ASCII character representation of hexadecimal data (denoted by, but not limited to, the weird "i" in the line after the GPS transmission above).
~~~~~~~~~~~~~~~~~~~
Yes, the segment of code I sent (for simplicity) is enclosed in a while loop. I am unclear about the select statement suggestion, please explain? I would like to avoid a case structure if possible. Thanks.
01-29-2009 09:00 PM - edited 01-29-2009 09:00 PM
Look on the Comparison Palette for the "Select" function.
I think a Select function would be the cleanest, simplest thing to use in this case. But there is no reason to "avoid a case structure".
01-30-2009 12:38 PM
That select function worked great. You are right, there is no reason to avoid a case structure. I just didn't want to have two, so I decided I was being lazy and then incorporated the 'Select' function with my previous Case structure. There is just one more thing I don't know how to do...
This code reads in 140 chars of GPS ASCII and substrings them out into the appropriate displays on the Front Panel (not shown in attached code). When the Select function sends the empty string, it erases the string from memory and thus the substrings are lost until the next GPS connection. How can I save these substrings (lat, lon, etc) in memory (displayed on the Front Panel) until the next GPS lock? Something like a Build Text and rewrite from the first index?
Thanks.
01-30-2009 12:46 PM - edited 01-30-2009 12:47 PM
You just need to put the indicator in before the select statement. See below.
(Also please put in some constants that simulate the source of data like shown, rather than posting a VI with numerous broken wires.)
01-30-2009 01:00 PM
Roger that on the broken wires.
I either don't understand the solution with the indicator or perhaps I wasn't clear about my situation - how will placing the indicator prior to the Select statement allow me to keep the GPS string in memory?
what happens now is... hex garbage is spit out at 1 byte a second, GPS turns on, GPS sentence streamed at 1 ASCII char a second (string substringed into various elements, displayed to Front Panel), GPS turns off, hex garbage returns, empty string is sent, substrings disappear for 512 seconds, GPS turns on, repeat.
here's what happens after the Select statement....
01-30-2009 03:16 PM