LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A question about converting ASCII code in my vi to give time signals in numerical form

I have currently done a vi for getting time signals from a GPS receiver, the data to be shown is in ASCII format. I would like to extract the time signal as circled in red in the "time signal" attachment. How could my vi be modified so that the signal can be extracted from the line starting with "$GPGGA, xxxxxx.xxx, ...." ? I have attached my vi in the post. Can anyone help me? Thank you.
Download All
0 Kudos
Message 1 of 11
(3,245 Views)

Hi yukfai88,

your data is "," seperated, so you can use the spreadsheet string to array function. Use index array to get your element.

 

Mike

Message 2 of 11
(3,241 Views)

Thank you, Mike. I can obtain the time signal once I have the first row detected is starting with $GPGGA. However, if the first row is invalid number (during start of the receiver), then the result is also invalid.

 

I would like to ask, whether there is a solution for detecting the heading of the string to be "$GPGGA" as the first row may be invalid, and "$GPGGA, ..." appears continuously in 1 second interval.

 

Sorry for not having clarifying the question.

 

0 Kudos
Message 3 of 11
(3,225 Views)

Hi yukfai88,

you can use the "Match Pattern" function with "^$GPGGA" to check if this is the first part of your string.

 

Mike

0 Kudos
Message 4 of 11
(3,213 Views)
Thank you for your help, my final question is how can I modify the vi to get a continuously updating "element" as specified, because the signals are continuously transmitting to the computer.
0 Kudos
Message 5 of 11
(3,209 Views)

Hi yukfai88,

what do you mean? Which vi do you want to modify?

You can place all the functions into your loop to check your data.

 

Mike

0 Kudos
Message 6 of 11
(3,196 Views)

Hi Mike, I have attached my recent work, and enclosed the parts i am in doubt with red circle.

 

- The left circle only shows change of value once, after pressing the run button of the vi. How can I modify the vi to get Time (String) changes continuously?

 

Thank you very much.

0 Kudos
Message 7 of 11
(3,186 Views)

Hi yukfai88,

you build one string from all your data, so you read everytime the same time value. You can either store an offset in a shift regsiter, or you cut the string after the data you already worked on.

 

Mike

0 Kudos
Message 8 of 11
(3,181 Views)

Hi Mike,

 

I understand what you mean for my concatenating all string into one string, but how can I store offset in shift register? Sorry that I don't know the way to do so.

 

yukfai88

0 Kudos
Message 9 of 11
(3,171 Views)

Hi yukfai88,

no problem. You can do it like this.

 

Mike

0 Kudos
Message 10 of 11
(3,129 Views)