07-30-2018 11:03 AM
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.
Solved! Go to Solution.
07-30-2018 11:11 AM
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.
07-30-2018 12:00 PM
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?
07-30-2018 12:10 PM
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.
07-30-2018 12:19 PM - edited 07-30-2018 12:20 PM
@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?
07-30-2018 12:31 PM
@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.
07-30-2018 12:32 PM
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.
07-30-2018 12:35 PM
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.
07-30-2018 12:41 PM
Here's what I had in mind (using spreadsheet string to array), assuming that all commas are field delimiters.
07-31-2018 02:00 PM
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).