06-08-2010 09:58 AM
When I aquire my data I get a 1D array with anywhere from 10 - 30 data points. There are always ten good data points the rest are noise or false triggeres. a good data point is in the range of .1-.2 a bad point is .001-.01 how can I filter out thse bad points? Im using labview 8.6. also I think this program will work if it could be backconverted from 9 to 8.6.
06-08-2010 10:14 AM - edited 06-08-2010 10:16 AM
This should do it I think
Edit: My first attemp had broken wire. Sorry!
06-08-2010 10:36 AM
hi -
here is how i would do it.
from L to R -
1 - get "array size" and connect that to the N of the for loop.
2 - "index array" so you can compare values one at a time.
3 - "in range and coerce" - (note: you need to wire values above and below the orange line shown for the range you'd like)
4 - case structure: if "in range" is true, then take the value and put it into a new array (this new array only has the good values you want) (false case is blank)
good luck!
06-09-2010 07:34 AM
Dan K wrote:hi -
here is how i would do it.
That is not very good coding practice at all, it is Labview NO-NO coding practice. But is is very typical coding practice for someone who has moved from C to Labview. In Labview a local variable is a copy of the data in the control/indicator. Not a pointer. So then data is changed, every locale (data copy) has to be updated. For large data set. This can slow down your program considerable, or make it unstable. Then using global or local variables. You can also experience something named race conditions. This can be very hard to debug in some cases. So in other words you should be very careful then using this kind of variable. In most cases it is not needed at all. And it should certainly NOT be used as a tool for cleaning up diagrams.
06-09-2010 10:54 AM
jbaack wrote:When I aquire my data I get a 1D array with anywhere from 10 - 30 data points. There are always ten good data points the rest are noise or false triggeres. a good data point is in the range of .1-.2 a bad point is .001-.01 how can I filter out thse bad points? Im using labview 8.6. also I think this program will work if it could be backconverted from 9 to 8.6.
06-09-2010 11:08 AM
Dan K wrote:1 - get "array size" and connect that to the N of the for loop.
2 - "index array" so you can compare values one at a time.
3 - "in range and coerce" - (note: you need to wire values above and below the orange line shown for the range you'd like)
4 - case structure: if "in range" is true, then take the value and put it into a new array (this new array only has the good values you want) (false case is blank)
10-28-2016 11:00 AM
Quick question, how come the processed data does include the low range but not the high range?
Thank you for this by the way it was very helpful.
10-28-2016 12:20 PM - edited 10-28-2016 12:20 PM
@Pacarranza9727 wrote:Quick question, how come the processed data does include the low range but not the high range?
Thank you for this by the way it was very helpful.
Because this is a super-common mistake. The top diamond should be filled in. (Right-click, select "Include upper limit.")
10-28-2016 12:22 PM
I guess using FP numbers adds another layer of complexity to the issue...
10-28-2016 12:51 PM
Also note that this is an old thread and many things have improved. For example we now have conditional tunnels, eliminating the need for a case structure and explicit array operations.