LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Grayed-out buttons during run-time

Yes, but I want to make them disabled when I run VI, and to enable them when I stop VI. So, I made a select function, where True is Enabled, False is Disabled and grayed out, and condition is wired to Stop button, which is wired to while loop's red button. It sometimes work correctly, and sometimes not. I really don't know what is the problem. Thank you for answering me.

Milos

0 Kudos
Message 11 of 23
(2,741 Views)

@miki90 wrote:

Yes, but I want to make them disabled when I run VI, and to enable them when I stop VI.....


you mean partially disable them when running, otherwise what is the point in having them?

 

please post your vi......so that we can better understand what you mean

 

remember....data flow, data flow, data flow.........

0 Kudos
Message 12 of 23
(2,731 Views)

Yes,partially. 

0 Kudos
Message 13 of 23
(2,729 Views)

Simply loop throught all controls of the front panel and enable them after the main loop stops (make sure to actually stop the VI with a front panel interaction i.e. don't use the abort button).

 

0 Kudos
Message 14 of 23
(2,723 Views)

@miki90 wrote:

Yes,partially. 


There is somwthing seriously wrong with you code, because the main loop cannot spin at all, because it stalls at the event striucture. The only event is for the stop button, at which time the VI stops. Can you explain what you had in mind?

0 Kudos
Message 15 of 23
(2,718 Views)

I've got the task to implement some event structure, so I decided to put a stop button there. Then I saw that the program is stoping for some reason, and I deleted event structure temporarily, but same again. This program worked correctly. It gains signal from microphone, and then passes its frequency further to compare it with 3 ranges of user-defined frequencies. In dependence in what of 3 ranges acquisited frequency belongs to, one of three alarms are activated. I can send you working code without event structure. I've implemented error handling too, but it doesn't seem to make some troubles in the code.

0 Kudos
Message 16 of 23
(2,703 Views)

Can you send me the code from the picture above?

0 Kudos
Message 17 of 23
(2,698 Views)

@miki90 wrote:

Can you send me the code from the picture above?


try this.

0 Kudos
Message 18 of 23
(2,696 Views)

Thank you. Today I realized that I haven't needed this part of code. Problem was in event I've made. Can you help me with event? I should make that, when I click the stop button, a message appears on the screen: "Are you sure you want to stop the program?", and Yes and No options.

0 Kudos
Message 19 of 23
(2,668 Views)

So, place a two button dialog inside the stop event, customize the message to your text, and wire a true or false to the stop terminal depending on the outcome of the dialog.

 

Similarly, you could also add a "panel close?" event that gives that dialog if the user presses the [X] in the upper right corner.. If "no", discard the event so the window does not close.

 

Let me know if you have difficulties with that.

0 Kudos
Message 20 of 23
(2,660 Views)