LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a VI in a subpanel with parameters inside an event structure and using an abort button

Solved!
Go to solution

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

0 Kudos
Message 1 of 16
(3,584 Views)

2011 compatible VI please

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 16
(3,577 Views)

Hope this worked.

0 Kudos
Message 3 of 16
(3,569 Views)

What kind of input you are feeding to VIs which are in the subpanels

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 4 of 16
(3,539 Views)

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

0 Kudos
Message 5 of 16
(3,532 Views)

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.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 6 of 16
(3,523 Views)

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 ?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 16
(3,513 Views)

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

Download All
0 Kudos
Message 8 of 16
(3,479 Views)

Can you post that in 2011 version please?


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 9 of 16
(3,477 Views)

V11

Download All
0 Kudos
Message 10 of 16
(3,474 Views)