07-11-2011 02:59 PM
Hi Experts,
I am facing a problem where when event structure is executing some nodes, other events are not captured and not run
Is there any way to make event structure to be responsive to ALL defined events?
Please see attached vi.
Once "RunLongProcess" button is clicked, other events are not processed.....
Look forward to your reply.
Thanks
Warmest regards,
Vincent
07-11-2011 05:37 PM
Hi Vincent,
The code that you provided does respond to the user inputs. It's just that your "Run Long Process" event takes 30 seconds to execute.
Run the program, press Run Long Process, then select Item 4. 30 seconds later, Item 4 will show up.
LabVIEW must complete the event that it is in before responding to a new event.
Events will be "queued" up and will execute when given the chance to run.
You should almost never put code in an Event structure that hangs up the user interface.
Instead use a Producer/Consumer architecture and place the "Run Long Process" operation in a separate parallel loop.
If you really need to keep the user from doing anything for a while, put an indicator on the front panel that tells the user that the program is busy.
(A count down timer or busy cursor.)
steve
07-11-2011 05:54 PM
You are seeing normal behaviour. The event structure can only execute one case at a time just like a normal case structure. You should put any long running process in another loop. Check out the attached which uses a queue to cause another loop to iterate.
Some suggestions:
07-12-2011 12:37 AM
Thanks Steve(s)... 🙂