LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parse data from COM port

Hello everyone!

 

I have a problem. I need to parse data from COM port to text file. I tell you my situation with example.

 

The string looks like:

K123T0123D1234GX1234GY8328GZ8231........

 

And I need to write data in text file like:

123 0123 1234 1234 8328 8231 ..........

 

Thank you!

 

 

 

 

0 Kudos
Message 1 of 7
(3,322 Views)

Here is a VI that I made. Basically, it converts each character to a number and back to a character (really just a length 1 string) and checks equality. In this case, any letter will go to zero, giving a false value (K =/= 0). When it comes across a letter, it checks the previous character to check that 2 tabs won't be written. And, just as a note, there will be one tab at the end of this string. (You could probably fix that, or ignore it.)

0 Kudos
Message 2 of 7
(3,298 Views)

Just a quick regex

!0.png


"Should be" isn't "Is" -Jay
Message 3 of 7
(3,288 Views)

@JÞB wrote:

Just a quick regex

!0.png


A much simpler solution! (I've only been working with LabVIEW for a week or so, so I don't know all the tools yet…)

Message 4 of 7
(3,283 Views)
I've only been working with LabVIEW for a decade or so. I don't know it all yet either.

"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(3,268 Views)

In LV2012 we can get rid of the last empty element using the conditional tunnel mode.

 

Ben64

 

using condition.png

Message 6 of 7
(3,240 Views)

NICE !


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(3,219 Views)