Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66779

if a text string changes from number to "error" or similar text, how do i output as NaN

$
0
0

I have a problem with a text string that I am parsing 

 

I have a controller with 3 pressure sensors hooked up to labview. (Vac1, vac2 and vac3). pressure data is output via a text string that I have to parse.

 

Often during the experiments one sensor will go out of its detectable range during measurement, and instead of outputting a number it will say "RANGE"  (or sometimes error).

For example the text string may read:

     ERR0\r\nVAC1=RANGE\sVAC2=RANGE\sVAC3=1.03e-05\sSP1U=2.66e+00\sSP1L=1.33e+00\sSP2U=1

here Vac 3 is measuring 1E-5 mbar   but vac1 and 2 are out of their detectable range. 

 

I want to be able to plot and write the data if there is a number, but plot/write NaN (or some other equivalent) if it goes out range or reads an error.

i.e. something like:

 VAC =     %f, if ="RANGE" then ="NaN"

 

currently the whole programme just stops running if any of the sensors go out of "range" and hits the error 85. I've attached an image of my block diagram for help

 

I'm new to labview so any help would be great

 

Jkodak28_2-1737385946194.png

 

 


Viewing all articles
Browse latest Browse all 66779

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>