LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controle a subvi from its subpanel in the main vi

Solved!
Go to solution

Hello,

 

I'm searching for few hours for my problem and didn't find a solution. Perhaps I didn't search with the goods terms.

 

Context:

I have 2 VIs. 1 main and a subVI

I use a subpanel control to add the subvi front panel in my main panel. That is ok.

My problem is when I click on a control of the subVI (from the main vi subpanel control), the subvi didn't run.

I created an exemple as simple as possible : when I click on the button "boolean" the numeric indicator didn't increase.

 

I want and I need that the subvi run's independantly, with human action on the included front panel or with commands from the main VI (not implemented in my exemple yet)

 

How can I solve that ?

 

Download All
0 Kudos
Message 1 of 3
(1,830 Views)

So, you should run the sub VI!

 

Either

1) put the sub VI in the main VI, so it runs in parallel to the main, or

2) use the reference that you use to put it in the sub panel, and call the run method.

 

1) is simpler for normal VIs, but often overlooked. 2) is more used, but you need to manage the references of cloned VIs.

 

Note that when using 2), stopping the main will not stop the sub VI. 1) does that automatically. That can be good or bad, depending on your needs.

 

For method 1), you might need a reference so you can put it in the sub panel in your main. This can be puzzling. If it's a reentrant VI, you can't use a static VI reference. Easiest is to pass the sub panel reference to the sub VI as a normal input, and let the sub VI put itself in the subpanel.

0 Kudos
Message 2 of 3
(1,807 Views)
Solution
Accepted by topic author Bubbul

I finaly found the solution.

The value of the parameter "option" of the "Open VI ref" function was bad. I had previously found values 0x100 + 0x40 during my researches, without any idee of their role. In fact, it works with 0x80.

 

image.png

 

 

 

 

0 Kudos
Message 3 of 3
(1,710 Views)