LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fract/exp string to number, only getting zeros

Solved!
Go to solution

I told you that you can't concatenate! Also because of your empty rows, if you can't do anything about making sure the device doesn't send them, then you have to ignore them if they come through.

 

See attached modifications to the heart of the code.

 

You should also get rid of the wait function as the rate the data is read by the VISA Read will control the pacing of the loop.

0 Kudos
Message 21 of 25
(804 Views)

To find out what's going on, first deactivate the usage of termination characters on read operations and then request something like 1000 characters from the VISA Read.  This will give you a dump of whatever the device is sending.

 

If there isn't a clear termination character you can use for this data, then you'll have to implement a parser for the information from several VISA Reads.

 

Knowing the exact form of your data is important in finding out a robust scheme for reading it.  Stupid question, but I presume your response fromt he device isn't constant length?

0 Kudos
Message 22 of 25
(787 Views)

So, this works better. However when I open the excel sheet that all the data is exported to, I mainly get NaN for oxygen concentration. How do I set up the program to have continuous concentration readings in the excel file?

0 Kudos
Message 23 of 25
(764 Views)

@jamiva wrote:

@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


There is an old joke that goes like this:

 

Programmer: I have a problem

SR Programmer: Just use a regex!

Programmer: Now, I have two problems!

 

But, it works! Smiley LOL


"Should be" isn't "Is" -Jay
0 Kudos
Message 24 of 25
(761 Views)

That is exactly what I've been doing and it's not giving me a continuous reading. Out of every 10 cycles I only get one actual number, otherwise it's NaN or 0. 

0 Kudos
Message 25 of 25
(742 Views)