From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead 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!

Gerthex_0-1670426768488.png

 



0 Kudos
Message 1 of 4
(687 Views)

Suggestion:

TransmuteArrayCompare.png

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(656 Views)

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
0 Kudos
Message 3 of 4
(647 Views)

duplicate

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(639 Views)