LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract useful data from comma separated string

Here is my code.

It is working, but not that good.

 

If you can help to improve it, that will be great.

 

Thanks a lot.

 

Bingji

0 Kudos
Message 11 of 13
(1,329 Views)

What is not working well? The parsing or the serial control? If it is serial control you may want to start a new thread for that.  Helps to keep things organized.



-Matt
0 Kudos
Message 12 of 13
(1,322 Views)

Read the Help for Spreadsheet String to Array carefully -- it notes that the data type "between the commas" has to be all the same type, and by default it chooses Strings or Dbls.  You wired in Doubles, so your input string cannot (as in CANNOT) include any text.

 

If your string is a mixture of Text and numerics, but still strictly comma-separated, you need to read it all as strings, and then convert those elements that "really" are numerics in a second step.

 

Do you know how to create a "Constant" VI?  I'd recommend you run your program, copy the Response 2 indicator (which you are trying to parse) to a new VI, right-click and turn it into a Constant (inspect it to make sure it still has the entire string), then name this "My Data.vi" or "Response 2.vi".  If you attach this as well, we can easily check out your parsing logic with your "real" data.

 

Bob Schor

Message 13 of 13
(1,302 Views)