LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use a "filter" to not show a certain value

I am using a RS-232 to collect data from a device.  In my VI I collect data from this device at a couple of different points.  Each time I do this, I collect data for 10 sec. and then take the mean of these values.  The problem I am having is that the first value that is collected during each of the 10 sec. "collection periods" is always zero.  Is there some type of filter or something that I can use that will not let a zero value pass through?  I want the program to act like it never collected a zero.  Any suggestions?  Thanks so much!
0 Kudos
Message 1 of 8
(2,844 Views)

Hi JoshRMPS,

you could check if the value zero and change it if you want. What is the aim behind this?

Mike

0 Kudos
Message 2 of 8
(2,843 Views)
The purpose is to collect values (which are particle concentrations in the range of 5000 to 50,000) from the device for 10 sec. and then take the mean of those values.  Now, if I get a value of zero, it throws off the average quite a bit.  If a value of zero is read - than I would prefer to just ignore it and "filter it out" and just keep collecting the other points.


0 Kudos
Message 3 of 8
(2,841 Views)

Hi JoshRMPS,

do you use a shift register with an array to store your data. If yes ignore the value if this is zero and don´t add it to your array.

Mike

0 Kudos
Message 4 of 8
(2,839 Views)
Hmmm...how would I ignore this value?  Do you have an example?  Thanks.
0 Kudos
Message 5 of 8
(2,837 Views)

Hi JoshRMPS,

i think something like this could help.

Mike

0 Kudos
Message 6 of 8
(2,833 Views)
Thanks. I will give this a shot.


Josh
0 Kudos
Message 7 of 8
(2,831 Views)
    The attached code finds the number of elements in your array equal to zero and subtracts this total from the total number of elements before averaging.


Randall Pursley
0 Kudos
Message 8 of 8
(2,791 Views)