LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reset an appending string to blank in a while loop?

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!

0 Kudos
Message 1 of 8
(4,743 Views)

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.

0 Kudos
Message 2 of 8
(4,723 Views)

Verb

Infinitive
to munge

 

Third person singular
munges

 

Simple past
munged

 

Past participle
munged

 

Present participle
munging

to munge (third-person singular simple present munges, present participle munging, simple past and past participle munged)

  1. (transitive, computing) To transform data in an undefined or unexplained manner.

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.

0 Kudos
Message 3 of 8
(4,716 Views)

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".

Message Edited by Ravens Fan on 01-29-2009 10:00 PM
Message 4 of 8
(4,701 Views)

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.
0 Kudos
Message 5 of 8
(4,668 Views)

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.)

Message Edited by Ravens Fan on 01-30-2009 01:47 PM
0 Kudos
Message 6 of 8
(4,666 Views)

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....

 

 

 

 

 

 

0 Kudos
Message 7 of 8
(4,661 Views)
It sounds like you can get away with changing the the control boolean on your string selector.  Wire it so that previous data is reported when new data is invalid.  you never miss a beat that way

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 8
(4,647 Views)