LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

if then statement to see if values are in range?

alright here we go...  BTW I'm using labview 8.0 eval because I'm still waiting on my S/N from my vendor O_o

So basically I'm reading data off a pci-6220 NI card.  I'm reading in an analog input, with a voltage.  What I would like to do is filter the low end data points off.  IE, when a value is read into labview compare that value against known range and report back a 0 if it's in this range.  Basically, 0.0079 to 0.008 is the range.

Keep in mind this file is pretty raw.

FYI, on the project as a whole.  What I'm going to be doing is reading in 2 voltages.  1 voltage refers to a poundage off a pressure transducer, the other will refer to an inch measurement to say how far the cylinder has moved.  I'm going to need to graph in lbs versus inches then record that data to a file to be opened later in excel. 
0 Kudos
Message 1 of 6
(6,685 Views)

You can use the In Range & Coerce VI from the Comparison palette.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(6,676 Views)


@flynhawaiian wrote:
What I would like to do is filter the low end data points off.  IE, when a value is read into labview compare that value against known range and report back a 0 if it's in this range.  Basically, 0.0079 to 0.008 is the range.

An easy way to do this is to use "In range&Coerce", invert the "in range" output, convert the boolean ot 0/1, and multiply with the original data. Works for scalars and arrays.

Attached is a simple demo (LV 8.0).

 


 

0 Kudos
Message 3 of 6
(6,672 Views)
that made sense, for some reason that wasn't registering in my head that I could simply just do it that way.

Here is another question.  Is there a way I can read in 100 values then take the average of that set of 100 values?  Would that be done in a for while loop or...?

0 Kudos
Message 4 of 6
(6,663 Views)

Array palette - Array Size.

Numeric palette - Add Array Elements.

This should help you. If you want specifically 100 values, then you would need to use some of the VIs in the Array palette.


___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(6,646 Views)
There is also a "mean.vi" in the statistics palette. Simply feed it your array of 100 values. 🙂
0 Kudos
Message 6 of 6
(6,643 Views)