Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controling Program Flow

Status
Not open for further replies.

AFloriani

Industrial
Jun 16, 2005
14
I have a front panel with 5 buttons and one combobox and some graph indicators.
In the block diagram I have the Event structures for 4 of the buttons and the combobox. The 5th button (let's call him the Stop Button) is a while loop stop control inside one of the events (let's call this event of the Start Button Event).
So, for better clearence of data: The Start Button event contain the Stop Button which is a While loop stop control.

I've placed the event structures along with the buttons controls inside a while loop (that involves the hole block diagram) not for the program to exit unless the user says so.

But after I run Start Button Event and then press the Stop Button, the other events stop responding as if the application where still executing the Start Event.

Maybe the problem is in involving events in a while loop. Is there another way I can keep the program from closing so that it will always be waiting for the events?
Or is there something else I'm not seeing here? I've tried to describe the problem as best as I can.
Any suggestions will be appreciated.
 
Replies continue below

Recommended for you

If I understand correctly, your stop button is caught in an event. When pressed, this event executes and terminates the while loop that encloses the program.

Thus if you press the stop button, the program will stop running and no more events will be caught. This is correct operation. Do not press the stop button until you are ready to terminate the program.

Wheels within wheels / In a spiral array
A pattern so grand / And complex
Time after time / We lose sight of the way
Our causes can't see / Their effects.

 
You didn't get it right. The stop button stops a loop that exists inside the event, not the program loop. But don't worry I have already solved this issue by digging a little deeper in the LabView help.
The problem was that I had more than one event structure inside the program loop.

The definition of a loop is to repeat after all the commands are exectued until a certain condition.
Considering instead of commands, events, LabView will not reiterate the loop until all events are executed. That's logic, but was not so clearly visible to me before. So I put all the event handling routines inside different case of the same event structure and placed this one event structure inside a program loop. Now it works fine.

Thanks for all your help, I know I posted a lot a questions, but in the beggining one has lots of doubts, right? Really thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor