LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LED not turning off

Hi, could someone help me to check why does some of my LEDs not turn off when i set it to false. Would appreciate the assistance rendered. Thanks

 

When I fully charge up the indicator and press on discharge button, some of the LEDs in Z4 and Z5 are not turning off and when the indicator reaches 0, some of the LEDs in Z3 does not turn off as well.

0 Kudos
Message 1 of 5
(3,412 Views)

You should really learn about control and indicator references... You can create arrays of them and iterate through the arrays to change the states of your indicators dynamically, instead of creating millions of local variables and explicitly wiring each one to a boolean constant.

 

Anyway, I think the problem you're having is related to the default cases in your case statements. I don't understand what purpose they're meant to serve, but I think that's where you should look.

0 Kudos
Message 2 of 5
(3,392 Views)

What is "it" that you set to false? Please be specific how to operate. What do you expect to observe and what do you observe instead.

 

You have 99% too much code. The entire code could fit on a postcard. Way too many local variables, representation mismatch, and highly inefficient code. Why is the front panel so gigantic?? None of you local variables are needed.

 

Most of your terminals are only written in one of the cases.

 

Also, you program seems to be just a one-shot run. Are you using "continuous run mode"? That's not the right way!

 

In any case, if you want all indicators at the default whenever the program starts over, go to "VI properties...execution" and set "clear indicators when called".

 

Still, I recommend to rewrite the entire things from scratch as a simple state machine. No need for sequence structures, local variables, or formula nodes.

Message 3 of 5
(3,382 Views)

@altenbach wrote:

None of you local variables are needed.

 


Just to give you some ideas, here's all you need to animate one arrow (make a cluster of LEDS for each arrow!).

 

PVArrow.png

 

Note that you probably can add all other arrows to the same FOR loop in the same way.

Message 4 of 5
(3,360 Views)
Spoiler
 

Thanks for the feedbacks and inputs. I will try using state machine 🙂

0 Kudos
Message 5 of 5
(3,309 Views)