LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IV Called by reference doesn't open when called

I want the a IV I call by reference to be displayed when called and closed afterward. I have selected File\ViProperties\Window Appearence\Custom\Show Front Panel when Called AND Close Front Panel when finished.

But the VI will not display when called.

Open Ref.vi and ref1.vi
Run ref.vi
It will call ref1.vi and dispaly the same data.
This works.

Now close ref1.vi
Rerun ref.vi
It should open ref1.vi and dispaly the data but it doesn't.
If you now open ref1.vi you can see that it's running jus that it isn't displayed.

I don't know what's wrong.
Thank you for your assistance,
Brian Wells
Download All
0 Kudos
Message 1 of 16
(3,983 Views)
When using the VI server to call a VI, it is necessary to set the front panel to be visible through the VI server.

Also, I don't believe that you can display the front panel of a VI called by the "Call by Reference" node. This is used mostly for templates and recursive calls, and I believe does not allow for the front panel to be visible, as the node creates 'instances' of the VI that don't have a front panel.

From looking at your diagram, I see two things: First, you aren't using the call by reference node. Second, I cannot see why you are using the VI server. You can just simply call the VI directly as a subVI, and input data to your subVI directly.
Message 2 of 16
(3,983 Views)
Brian,

The subVIs is not opened because it is not "called". You use the "Run VI" method that is equivalent to clicking the white Run arrow of the VI. To have the VI open its panel when called, first call the VI, either statically (drop its icon on the diagram and wire inputs) or dynamically opening a strict reference to the VI and invoking the "Call VI" method.

Dynamically running and calling VIs with references (as you do in the submitted VIs) is not the common way to invoke subVIs.


LabVIEW, C'est LabVIEW

Message 3 of 16
(3,983 Views)
I have attempted to invoke the CallVI method instead of the RunVI method but it's not listed. Then I tried to change my generic IV Invoke node to a Strict type by connecting a VI refnum to the OpenVI Reference type specifier but this doesn't make the Call VI method available. I'm not sure where to go next.

What I am trying to accomplish is the following. First, I have another larger program which I will add this code once the technique is verfied. In the larger progrm I have a loop structure that continuously runs an AI read. The collected data is filtered and displayed. When a button is selected I would like to popup the parameters for the filters in a box that also has a chart of the current filtered and unfiltered d
ata. I plan to access the charts and parameters by passing their references to the subVI. But I would like the main VI to continue to run while the user is able to adjust the filter parameters on the live data.
If there is an easiler way to get the parentIV to continue to run while the subVI is running I would be very grateful.

This technique I plan to copy to several additional functions of the software so that forms with operating parameters can be called up and modified while the data aquisition continues. Some functions such as the user interface or data storge will be staticaly called in paralell with the daq IV at the begining of the program an be running all the time, but other components such as forms I would like to be directly called by thier parentVI. This will help keep my code modular and easier to maintain.

Currently all the daq, data storge, filter parameters, user interface and several other functions are all on one main VI. The code is divided into vari
ous SubVI's but everything is in one big loop. As the program continues to grow I need some method to break the code apart.

Thank you for your assistance,
Brian Wells
Research Assistant III
Space Research Institute
Auburn University, AL 36830
334-844-5967
0 Kudos
Message 4 of 16
(3,983 Views)
Brian,

From my understanding of the explanation you gave, here is one approach you might take.

1. Create another loop to run in parallel with your main loop.
2. Inside this loop place a case structure. In one case of the case structure place your subVI, in the other case place a reasonable delay (say 1000ms).
3. Place a boolean control on your front panel that you want to invoke the subVI and wire it to the case selector terminal.
4. Configure the subVI so it is set to open its front panel when called and close afterwards.

Since the subVI is in an independant loop to the main program, the main program can continue to execute while the subVI is executing. Also, the subVI will only execute when you press the button since it is insid
e a case structure. The delay in the other case of the case structure keeps the polling of the front panel to a reasonable level.
0 Kudos
Message 5 of 16
(3,862 Views)
Given the rating for my answer, I find it difficult to continue to support this thread.

The question posed was answered accurately, and additional information was sought. If someone doesn't like how I answer, then say so. Do not just simply anonymously give a poor rating because you don't like the answer. Explain yourself. Of course, you don't have to, but...

I am now making it a policy to not post answers on threads where I am giving such unjustified ratings. Additionally, I may not answer questions for the person posting the question in the thread whatsoever in the future. If the person posting the question did not make the rating (which has happened before), then I leave it to the person posting the question to alleviate the situation.
Unfortunately, this is how it must be.

Abuse of the rating system is something I will no longer tolerate.
Message 6 of 16
(3,983 Views)
I apologize for any misunderstanding. I didn't submit the rating, at least not intentionally, but I can see how I may have acidently hit the 2star rating while trying to press the "Comment on this Answer". When I checked the 5star to inspect it's behavior the rating was recorded but no other indication was displayed. I'll drop a note to Webmaster and ask if the rating's buttons could provide and popup confirmation and perhaps be moved a little further from the "Comment on Answer key"

Again I applogize for the misunderstanding and thank you for your assistance,
Brian Wells
Research Assistant III
Space Research Institute
Auburn University, AL 36830
0 Kudos
Message 7 of 16
(3,983 Views)
Although I fear burdening this thread with off topic commentary do not with to offend an experienced programer willing to lead his time and experience.

I attempted to submit another rating. The first one was accepted and the second ignored. Therefore someone else must have submitted the initial two star rating, which I feel was quite unjustified.
0 Kudos
Message 8 of 16
(3,983 Views)
Although I fear burdening this thread with off topic commentary, I do not wish to offend an experienced programer willing to lend his time and experience.

I attempted to submit another rating. The first one was accepted and the second ignored. Therefore someone else must have submitted the initial two star rating, which I feel was quite unjustified.
0 Kudos
Message 9 of 16
(3,983 Views)
> When using the VI server to call a VI, it is
> necessary to set the front panel to be visible
> through the VI server.


When you call a VI by reference, the VI settings "Show front panel when called" and "Close afterwards if originally closed" are in effect and the panel "Open" property doesn't have to be set explicitely with VI Server. That is true for the "Call by Reference" node but not for the "Run VI" method, which is not a VI call.


> Also, I don't believe that you can display
> the front panel of a VI called by the
> "Call by Reference" node. This is used mostly
> for templates and recursive calls, and I believe
> does not allow for the front panel to be visible,
> as the node creates 'instances' of the VI that
>
don't have a front panel.


A VI called by reference behaves like a node call for that matter. You can open the subVI panel and interact with controls. The instance created dynamically do have a front panel. However, if the VI is reentrant, there is only one front panel for all instances and the user can't interact with it. This is not related to the "Call by reference" node. This is true whether the reentrant VI is called by a diagram node or by
reference.

> From looking at your diagram, I see two things:
> First, you aren't using the call by reference node.
> Second, I cannot see why you are using the VI
> server. You can just simply call the VI directly
> as a subVI, and input data to your subVI directly.


I agree.


LabVIEW, C'est LabVIEW

0 Kudos
Message 10 of 16
(3,983 Views)