05-25-2013 10:13 AM
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
05-25-2013 10:57 AM
@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.........
05-25-2013 11:02 AM
Yes,partially.
05-25-2013 11:29 AM - edited 05-25-2013 11:31 AM
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).
05-25-2013 11:36 AM
@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?
05-25-2013 12:38 PM
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.
05-25-2013 12:47 PM
Can you send me the code from the picture above?
05-25-2013 12:50 PM
05-26-2013 01:04 PM
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.
05-26-2013 02:18 PM
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.