08-19-2009 10:43 PM
Greetings All
I have a case structure that doesn't seem to be working it stays on in the on state.
I created the 1st circuit in 1st red block and it works each led blinks then turns off in sequence but when I try that logic in a case statement ( in the 2nd red block) they all stay on. Is this the way the case statement suppose to work? Is their a workaround?
thanks
Solved! Go to Solution.
08-19-2009 10:51 PM
First, you have a block diagram there. A "circuit" is what you create in hardware with electrical wires and electronic components.
All of your case structures are all working as expected. What you did at the top is different than the bottom. In the bottom, each LED is located inside a particular case. That particular case only executes when something is true. You have no way of writing a False to the LED because if the LED is going to be false, that particular case won't execute. Up top, the LED's are always in the execution path, so they get a True or False written to them as the case may be.
08-19-2009 11:00 PM - edited 08-19-2009 11:00 PM
It's not clear what exactly you're expecting, but let's look at your logic:
BOOL1 = ON switch -OR- (i > 6)
If SOME NUMBER = 1, or not otherwise declared (we can't see the other CASE)
THEN
NUM2 = BOOL1? SOME NUMBER : 0
BOOL2 = NUM2 == 1
RED LED 2 = BOOL1 -AND- BOOL2
ELSE
RED LED 2 = Unchanged
That is some convoluted logic, BTW.
You do know that you're only changing the RED LED2 in the "1,Default" case. If the number is something else, the LED is left as it is.
There's no way to judge what's wrong without knowing what it is you're trying to do.
Be aware that only ONE of the cases executes when a case structure executes.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-14-2015 05:04 AM
This is one of the best explanations i have seen to any problem here. Hats of to you sir, you have cleared up a different problem i have :).
Much appreciated