# LabVIEW

cancel
Showing results for
Did you mean:

## Array of Boolean for Case Structure Cases, Need Help

Hello,

I am looking for guidance on my VI. This is theoretical currently and am building this slowly from easy to more complex as I am new to LabVIEW.

Suppose you have 4 wheel speed sensors and you want to find the average MPH you are traveling, that I have done. Say one of these sensors is not reading accurately, you would still want to know how fast you are going by excluding the one or more sensors that are not reading accurately. Currently I have a tolerance of +/- 2MPH.

I have many true/false statements checking sensors against each other. Depending on the true false array, this would tell me if they are all working or if one or more are at fault and which ones.

A list of all trues would indicate that all sensors are working.

However, I list with

all trues except

1/3 = False

2/3 = False

4/3 = False

would should sensor three is the faulty sensor and I can exclude that sensor from my average. my next step would to display a message of the faulty 3rd sensor.

I am completely lost on my next steps, nor am I sure if I have the correct VI's in here to do so. I know I need 5 cases at minimum.

1. Average all 4 wheel speeds (Default)

2. Average 1/2/3 and exclude 4

3. Average 2/3/4 and exclude 1

4. Average 3/4/1 and exclude 2

5. Average 4/1/2 and exclude 3
FYI, I am aware I have the rolling average of all 4 on display. once I get this working I will be deleting it. Thanks everyone!

Message 1 of 4
(336 Views)

## Re: Array of Boolean for Case Structure Cases, Need Help

Suggestion:

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Message 2 of 4
(305 Views)

## Re: Array of Boolean for Case Structure Cases, Need Help

Hi Gerthex,

suggestions for your current VI:

use InRangeAndCoerce instead of that pile of comparisons...

use a loop to repeat the same operation multiple times

use RotateArray to get the next three elements...

Suggestion in general: have you considered to use a median filter?

You can also subtract the mean from all sensor values and find the one with greatest difference...

Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(296 Views)

## Re: Array of Boolean for Case Structure Cases, Need Help

duplicate

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Message 4 of 4
(288 Views)