LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indicator to show if you are in case structure

Hi,

 

I'm trying to make a make a boolean that shows true if and only if you are in a specific case in a case structure. The problem is the case structure is in a while loop and so the case structure is called multiple times and the boolean will stay true even if the case has switched.

 

Thanks

0 Kudos
Message 1 of 5
(2,407 Views)

Code it so that it goes false in any of the other cases.  A vague question with no code begets a vague answer with no code, too.  GIGO, really.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 5
(2,390 Views)

How fast is the loop running?   Is it a true/false case structure or one with multiple options?

How often is it in the specific case vs. how often it isn't?

 

If it is a fast running while loop, you may not be able to see quick enough when the boolean is true vs. false. 

 

If you attached some specific code, we could see more specifically what you are trying to do.

Why do you want to know it is in a specific case?

Message 3 of 5
(2,389 Views)

Place the LED before the case structure, connected to the same wire that is going to the case selector.

 

(If you place the indicator inside the case, it will not update in the other cases unless you do some convoluted code with local variables. Please don't!)

Message 4 of 5
(2,368 Views)

@kazisl wrote:

I'm trying to make a make a boolean that shows true if and only if you are in a specific case in a case structure.


I assume you mean you want the Boolean on if the code in a specific case is executing? If it's true only when I am in the specific case, always set it to false. I will never be in it 😁.

 

I'd set the Boolean true in the specific case, and false in the specific case. Then put everything that takes time between the two.

 

Another option (mentioned already) is to set the Boolean before the case: true if it will enter the specific case, false if not.

 

Both will work in specific scenarios only. In other words: it depends... It depends on exactly what you want, and how you build it.

Message 5 of 5
(2,301 Views)