LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fract/exp string to number, only getting zeros

Solved!
Go to solution

I'm using the fract/exp string to number converter. Only 0 is given after the conversion. I know my VISA program is communicating with my external instrument because in my response output I get the data I need. I have no idea what I'm doing wrong.

0 Kudos
Message 1 of 25
(3,249 Views)

Can you put a string indicator on the wire leading in to the conversion VI to confirm the incoming text is as expected?

 

If that shows the expected string, right-click the string indicator to change it from "normal display" to "\ codes display" and see if there's any hidden characters in the string before the number.  You can then use something like "Trim whitespace" to get rid of control characters or other VIs to remove other extra text.

0 Kudos
Message 2 of 25
(3,246 Views)

Is it a chance that the decimal point is different between your device and your PC?  A true decimal point in one and a decimal "comma" in the other?

0 Kudos
Message 3 of 25
(3,229 Views)

I get a long string of data (A213 DO/RDO,X41255,3.04,ABCDE,07/28/18 00:13:17,30989,CH-3,DO,6.56,mg/L,78.4, % sat,1423.2, nA, 22.8, C,22.8, C,742.0,mmHg, 0.0,ppt,17.666,nA/%Sat,M300,#1)

 

So, how do I go about justing getting the number I need? This case is't 6.56 mg/L


@Kyle97330 wrote:

Can you put a string indicator on the wire leading in to the conversion VI to confirm the incoming text is as expected?

 

If that shows the expected string, right-click the string indicator to change it from "normal display" to "\ codes display" and see if there's any hidden characters in the string before the number.  You can then use something like "Trim whitespace" to get rid of control characters or other VIs to remove other extra text.


 

0 Kudos
Message 4 of 25
(3,225 Views)

@Augspurger wrote:

I get a long string of data (A213 DO/RDO,X41255,3.04,ABCDE,07/28/18 00:13:17,30989,CH-3,DO,6.56,mg/L,78.4, % sat,1423.2, nA, 22.8, C,22.8, C,742.0,mmHg, 0.0,ppt,17.666,nA/%Sat,M300,#1)

  


This is not a "fract/exp string" no matter how you look at it. What fields are data and what fields are formatting and how variable can they be? You could possibly use "Spreadsheet string to array" with a comma as delimiter and 1D string array as type, then further parse the relevant array element.

Are the units fixed or is this in SI format?

0 Kudos
Message 5 of 25
(3,222 Views)
Solution
Accepted by topic author Augspurger

@Augspurger wrote:

I get a long string of data (A213 DO/RDO,X41255,3.04,ABCDE,07/28/18 00:13:17,30989,CH-3,DO,6.56,mg/L,78.4, % sat,1423.2, nA, 22.8, C,22.8, C,742.0,mmHg, 0.0,ppt,17.666,nA/%Sat,M300,#1)

 

So, how do I go about justing getting the number I need? This case is't 6.56 mg/L

Don't know if it's the best way, but this one way to do it using Match Regular Expression.

 

parse mg_L.png

0 Kudos
Message 6 of 25
(3,211 Views)

The units are fixed. The information before "DO" is info about my external equipment. After than the numbers and units are data, the commas are formatting. I have no idea how to change any of it so I don't know if it's variable.

0 Kudos
Message 7 of 25
(3,209 Views)

Thank you! I will try this. Concerning the first string box, is it OK if the string changes during the run? The "6.56 mg/L" will be changing over time. The external equipment is measuring oxygen concentration in water as oxygen is being stripped via nitrogen.

0 Kudos
Message 8 of 25
(3,204 Views)
Solution
Accepted by topic author Augspurger

Here's what I had in mind (using spreadsheet string to array), assuming that all commas are field delimiters.

 

GetNumber.png

0 Kudos
Message 9 of 25
(3,200 Views)

I tried this solution yesterday and it was working. However today I was running the experiment and noticed that I don't get a "live" reading. Whatever the initial value is on the meter is the output I continually get. What needs to be changed? I've attached a screen shot of what this section of my program looks like and the code I wrote based on yours (in case I wrote it incorrectly).

Download All
0 Kudos
Message 10 of 25
(3,155 Views)