LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If statement depending on 3 LED status

Hello,

 

I am trying to execute an IF statement depending on 3 the status of 3 boolean values.

 

I have 3 array's of 10 numbers each being compared against a range of values. If the value falls within the range an boolean indicator is lit.

 

What i want to be able to programme is that if the 1st boolean indicator is lit for all 3 arrays then a true case structure will run. If they are not all lit then the false case will run.

 

I want this to happen for the 1st number in all 3 arrys, then the 2nd, 3rd etc till all 10 numbers of all 3 arrays have been compared.

 

Hope that makes sense and someone can help me?

 

I basically want IF boolean indicator is lit AND boolean indicator lit AND boolean indicator lit THEN......ELSE......

0 Kudos
Message 1 of 8
(2,958 Views)

Is this what you're after?

Message 2 of 8
(2,945 Views)

Hi,

 

You can use the boolean logic operators to do this - the AND operator specifically. The "compound arithmetic" function would be the best bet here - allowing you to wire all three LED status's into one VI.

 

Then simply wire the output of the Vi to your case statement.

 

-CC 

 

 

[edit: Grrr, beat me to it Sebster! Smiley Wink

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 3 of 8
(2,943 Views)
Inrange and coerce can accept arrays of ranges and values and will output an array of booleans. bool array to number and use the number to drive your case select.

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(2,929 Views)

Check This Logic; You can replace the build array with replace array.

 

Regard,

Yogesh Redemptor

Regards,
Yogesh Redemptor
0 Kudos
Message 5 of 8
(2,913 Views)

I would probably do something as follows:

 

 

0 Kudos
Message 6 of 8
(2,886 Views)

@altenbach wrote:

I would probably do something as follows:

 

 



Only if your sure the logic never changes.  bool array to number allows any condition to be added to the case


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(2,871 Views)

@JÞB wrote:
Only if your sure the logic never changes.

I was pretty sure after reading this:

 

"... is lit for all 3 arrays then a true case structure will run. If they are not all lit then the false case will run."

 

😄

 

0 Kudos
Message 8 of 8
(2,862 Views)