03-12-2012 06:26 AM
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......
03-12-2012 07:08 AM
Is this what you're after?
03-12-2012 07:09 AM - edited 03-12-2012 07:16 AM
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! ]
03-12-2012 07:37 AM
03-12-2012 08:02 AM
Check This Logic; You can replace the build array with replace array.
Regard,
Yogesh Redemptor
03-12-2012 08:34 AM - edited 03-12-2012 08:34 AM
03-12-2012 09:20 AM
@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
03-12-2012 09:38 AM
@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."
😄