LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Led On/Off .control

Hi Folks.

 

I am having trouble keeping certain Led's on at certain times. The power on and off turn eachother on and off as required. However when I press any of the other buttons the Power On/Off Led goes off. I have set up an event structure to handle the different button presses. Is there a way to keep the current value when the other buttons are pressed?

 

Also but not very important now. Is there a way to implement the led's in the actual buttons themselves without having to use extra components?

 

Thanks,

 

Mark.

0 Kudos
Message 1 of 12
(6,479 Views)

You have LEDs connected to output tunnels of your event structure.  The tunnels are set to Use Default if Unwired, and in most of your event cases, the tunnels are unwired; which means they will output False when those cases execute.

 

As with all other controls/indicators, buttons can be customized.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 12
(6,475 Views)

I can't take a look at your attached VI because it is a newer version (using 2013 here).  However, according to paul_cardinale's comment, you have your indicators being written to outside of the Event Structure, meaning they will be written to every time regardless of the event diagram that executed.  If you do not need the indicators to be written on multiple events, then you can place their terminals inside the event structure:

 

Indicators_and_Structures.png

 



0 Kudos
Message 3 of 12
(6,443 Views)

The problem with this is that I need the On button to turn the Off Led off and vica versa. I need off and on to influence on another. 

0 Kudos
Message 4 of 12
(6,423 Views)

Is it possible to set them up to hold previous value if unwired or something like thta?

0 Kudos
Message 5 of 12
(6,417 Views)
Yes, use shift registers.
0 Kudos
Message 6 of 12
(6,408 Views)

@MarkGreally wrote:

The problem with this is that I need the On button to turn the Off Led off and vica versa. I need off and on to influence on another. 


My comment was just to note that there is another solution after what paul_cardinale mentioned if you don't need mutliple event cases to interact with the indicator(s).

 


@MarkGreally wrote:

Is it possible to set them up to hold previous value if unwired or something like thta?


No, but you can store values in memory in places other than indicators.  The While Loop structure supports a shift register for this.

A common solution to your situation is to save state information on a shift register of the loop and update indicators from that.  For example:

 

Indicators_and_Structures__With_Shift_Register.png



0 Kudos
Message 7 of 12
(6,405 Views)

Each event case can handle multiple events.  You could put both the On-button value change and Off-button value change events in the same event case.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 12
(6,391 Views)

Have you the actual VI for that example?? I'm not sure exactly sure what the components are and what they are doing.

0 Kudos
Message 9 of 12
(6,372 Views)

When you're editing events for a case, click on the "+ Add Event" button in the lower left to add a second event.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 12
(6,364 Views)