LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

comma delimited number to array

Solved!
Go to solution

 I am trying to split the comma delimited  number from read Buffer.Only the first number can be convtered into array.

But if I replaced the read buffer with a input spreadsheet string (1.1 , 2.943, 44) , it works.

So wondering what is problem with the numbers in the Read Buffer.

 

Thanks!

 

0 Kudos
Message 1 of 14
(3,977 Views)

The match pattern VI can sucssesfuly detected the Comma. So it is "real" comma.

0 Kudos
Message 2 of 14
(3,973 Views)

Can you right-click the "read buffer" terminal (after running the VI so it contains typical data as in your image) and select "create constant". Now copy the created constant to a new VI, save it, and attach it here.

0 Kudos
Message 3 of 14
(3,971 Views)

@tian66 wrote:

The match pattern VI can sucssesfuly detected the Comma. So it is "real" comma.


Set the display to \-codes. There might be other garbage in there. Also make the array indicator a little bigger.

Your code seems dangerous. How do you guarantee that the inner while loop ever stops if there is only pathological data?

0 Kudos
Message 4 of 14
(3,963 Views)

It cannot guarantee the while stop. This is coming with DMM driver. What is your recommendation?

 

I also trie using ",\00" to split the string but it failed.

 

Thanks!

0 Kudos
Message 5 of 14
(3,947 Views)

Your delimiter is ",/00". Make sure to switch the diagram constant to 

\-codes before entering it.

0 Kudos
Message 6 of 14
(3,929 Views)

Sorry it is typo. I did try  ",/00".

Any other suggestion?

 

0 Kudos
Message 7 of 14
(3,904 Views)
It works with a delimiter of \00. I am not sure why that character affects the scan with a comma as the delimiter.
0 Kudos
Message 8 of 14
(3,902 Views)
Solution
Accepted by topic author tian66

Sorry, my typo, should read ",\00" of course (was typing on an android keyboard on my phone), but only if the string constant is set to \-codes when you enter it.

 

 

 

 

Observe the display style! Entering \00 into a string set to normal display does not help much.

Message 9 of 14
(3,889 Views)

It is still not working.The display is set to \-.

 

Download All
0 Kudos
Message 10 of 14
(3,835 Views)