LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening VI in Sub Panel with VI Reference

I have an application that requires that opening and running a VI in the subpanel of another VI running as an executable.  The catch is the VI going into the subpanel will not be in the project structure of the VI that is running it.  I am currently testing this out on just a VI.  When I try to run the code that I have attached I get error 1003 from the Run VI invoke method.

 

The application is for a test system that has two monitors on it and they are being used for display from the test that is running.  While I am running that test I am required to interface to another application that will be controlling a heater.  I don't want to interface the heater code with the test application I am running since it will be for a one time test.

 

I know it may be trivial but I am trying to prevent the user from having to cycle through windows from the start panel.  I just figured it wouldn't be this difficult to figure out.

 

This is being done in LV2014 and unfortunately I am stuck with that version.

 

Thanks for your help!!

 

0 Kudos
Message 1 of 9
(3,457 Views)

Hi there, I'm a little confused on when you are doing what.

Do you get the error when running the VI in development?

 

 

0 Kudos
Message 2 of 9
(3,440 Views)

Error 1003:

 

"LabVIEW:  The VI is not executable.  This error may occur because the VI is either broken or contains a subVI that LabVIEW cannot locate. Select File>>Open to open the VI and verify that you can run it."

 

If you open the VI in the executable (drop it on the exe from explorer while exe is running or not), you see the VI's front panel, and probably a broken arrow. Loading will give some hints about missing VI's, click the broken arrow it to get details.

 

So in the executable, the VI is broken, probably because one of it's subVI is not found by the executable. The executable does not have access to the vilib.

0 Kudos
Message 3 of 9
(3,403 Views)

I wonder if this is even possible.  To run a sub-Panel, you need to reference the Front Panel of the other VI and interact with it, which I think implies that it needs to be, in some sense, "visible" to the Executable's Run Time Engine.

 

If you really need the "other" routine to be independent, I wonder if you could code it as a stand-alone Executable and position it where you currently have the sub-Panel.  You might be able to use System Exec or something similar to simply "run" it and have it close itself when it is done ...

 

Bob Schor

0 Kudos
Message 4 of 9
(3,391 Views)

Your Main.vi works for me.  It must be that your "PC Heater Control_rev2.vi" has dependencies that Main.vi can't get to.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 9
(3,386 Views)

 

0 Kudos
Message 6 of 9
(3,379 Views)

The VI that I am trying to run does have sub VIs that it needs.  But I would have figured if you were opening a reference to the Main VI that it should find the sub VIs that it needs and load them because that VI is in its own file tree.  Unless there is something I am doing wrong to make that happen.

 

Right now I can't get past the stage of running the code in Main VI from the LabVIEW project.  Eventually this code will go into the VI that it is needed in and that VI will be run as an executable.

0 Kudos
Message 7 of 9
(3,377 Views)

I put together a simpler project to test what I am trying to do and to my surprise it worked.  I can run Main.VI in project A with the Test Main VI from project B.  The VI will open in the panel and run like intended.  I was even able to get it to run with project A being an executable.

 

I added a stripped down version of the project I am trying to run in the same folder as the other projects.  I have all the sub VIs and controls in the same type of folder structure as project B.  But for some reason I am still getting error 1003 from the run VI Invoke node. 

 

I was test out relative paths in project A, but I'm not sure if that would help.

 

Any idea on what could be wrong would be appreciated.  These projects are done in LV2014 (ver. 14.0.f1)

 

Thanks.

0 Kudos
Message 8 of 9
(3,308 Views)

I just stumbled upon a possible solution.  I was originally dragging the shared variable from the project explorer to the block diagram and then setting it to read or write.  I tried the option to set it up for programmatic access and it replaced the symbol with a Write Variable VI.  I was able to get the VI to run without error 1003.

 

If I use option I assume that I need to use the open and close variable VIs??

0 Kudos
Message 9 of 9
(3,299 Views)