04-09-2015 08:01 AM
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.
04-09-2015 08:09 AM
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.
04-09-2015 09:21 AM
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:
04-09-2015 09:53 AM
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.
04-09-2015 09:55 AM
Is it possible to set them up to hold previous value if unwired or something like thta?
04-09-2015 09:59 AM
04-09-2015 10:01 AM
@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:
04-09-2015 10:22 AM
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.
04-09-2015 11:03 AM
Have you the actual VI for that example?? I'm not sure exactly sure what the components are and what they are doing.
04-09-2015 11:10 AM
When you're editing events for a case, click on the "+ Add Event" button in the lower left to add a second event.