LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

menubar

Hi,

I have an application with a menubar and I control what the user selects with an event case. When I detect the user has selected a item of the menubar it enters on a case event that do something for the item the user has selected. In this point, Does it block the other events that can happen while this event case is executing? I want to do several tasks for the item the user has selected but all at the same time in paralel without blocking other events that can occur, for example, the user could select other item of the menubar and do a task for it while the other task previosuly selected is running at the same time. How can I do it?

Thanks,

ToNi.
0 Kudos
Message 1 of 3
(2,308 Views)
A loop with an event structure will not continue until the code in the current event case has finished running, so the only way you could really have this is by running the VIs (tasks) using an invoke node and setting Wait Until Done to F. Another option is to have each task in its own loop and have it wait until the event structure fires it, by I don't like that (a loop for each task). You should keep in mind that events are stacked, so if two events happened, they will both be handled. In general, you should not use the event structure used for user interface to run the code. You can have the event structure place commands into a queue and have a different loop take care of those commands (and there you should do what I suggested in the beginning).
BTW, do you really need the tasks to run parallel? If they are short, the user won't notice any delay.

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,297 Views)
Thanks very much,

I think the same as you. it is better to run the VIs (tasks) using an invoke node and setting Wait Until Done to F.
Yes, I need the tasks to run parallel but they are not short, for this reason, the best option is what you have told to me at the beginning.

ToNi 😉
0 Kudos
Message 3 of 3
(2,292 Views)