キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/12
7,737件の閲覧回数

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 件の賞賛
メッセージ2/12
7,733件の閲覧回数

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 件の賞賛
メッセージ3/12
7,701件の閲覧回数

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 件の賞賛
メッセージ4/12
7,681件の閲覧回数

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

0 件の賞賛
メッセージ5/12
7,675件の閲覧回数
Yes, use shift registers.
0 件の賞賛
メッセージ6/12
7,666件の閲覧回数

@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 件の賞賛
メッセージ7/12
7,663件の閲覧回数

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 件の賞賛
メッセージ8/12
7,649件の閲覧回数

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

0 件の賞賛
メッセージ9/12
7,630件の閲覧回数

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 件の賞賛
メッセージ10/12
7,622件の閲覧回数