02-14-2013 05:39 AM
Hi all,
I have a control panel with a tab control and two tabs have a sub panel in them. At runtime I load the VIs I want in to the sub panels. In the control panel event structure I want to start each of the VIs and monitor the execution state so I can abort the VI while it is running. One method I use can run the VI and the abort event will work (see example). The second method I use does not and this is what I want to do! I have many inputs to the VI I want to pass so placing the VI in the event blocks everything else and it has to wait until the VI has completed, so I cannot monitor the execution state.
I have attached an example of what I want to do.
Any help appreciated.
Martin
Solved! Go to Solution.
02-14-2013 05:53 AM
2011 compatible VI please
02-14-2013 06:04 AM
Hope this worked.
02-14-2013 11:30 PM
What kind of input you are feeding to VIs which are in the subpanels
02-15-2013 06:26 AM
I am passing arrays and resources to the VI.
I have looked into queues, notifiers, semaphore etc but even unlocking the front panel you cannot abort the running VI.
I would see this as a common thing everyone would want to do in an application. Run a VI from another and enable that control VI to stop it.
Thanks
02-15-2013 07:14 AM
Hello,
You can do this with queues.
The main vi and subpanel vi's should be based on the producer/consumer (events) and you handle the front panel events accordingly in the respective vi's.
Name the queues in obtain queue , for example the Main being MainQ, subpanels SubPanel1Q, SubPanel2Q. When you start the application, initialise the main vi and also run both of the subpanels (just to make sure that the queues are first obtained by themselves). Then you can use obtain queues to do inter vi communication.
For example if you need to send data from main to subpanel1, use obtain queue and use the name SubPanel1Q, pass the required data & command and voila. Subpanel1 vi will receive your message. You can do this anyway you want. Hope this helps.
02-17-2013 10:45 PM
Use on case structure and all the inputs to it. Input to the case structure is tab control. Bases on the tab control value pass the input. This will allow only one output to be selected at a time.
Is it ok ?
02-21-2013 05:08 AM
Thanks for your reply. I did know about the producer/consumer template and I have used it to try and get what I want it to do but! When I use the value change event on my run VI button the VI starts but the main VI front panel locks. I tried unlocking the front panel but the Abort button just stays down and the VI continues.
I find it really hard to abort subVIs while loops are going on. I have long calibrations and test routines that control test equipment so the user must have an abort button to stop at any time.
I have attached my code.
Thanks
Martin
02-21-2013 05:12 AM
Can you post that in 2011 version please?
02-21-2013 05:15 AM
V11