LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanel InsertedVI ref always invalid when using VI Server

Solved!
Go to solution

I'm trying to gain access to subpanel controls (in an executable) via VI server but it doesn't seem to be allowing me to get a valid reference to the inserted VI (1026:  VI Reference is Invalid).  If I use the exact same code in the executable itself, it works just fine.

 

Attached is the executable and the VI that I'm using to try and retrieve a reference to the subpanel's VI.

 

Any ideas why this is happening?

Download All
0 Kudos
Message 1 of 11
(4,195 Views)
I'm sorry but I can't look at your code. How are you launching the VIs going in the subpanel? Is the VI reentrant? Some launch methods do not give valid references to the clone that is launched.

Mike...

PS: I just did a series of posts on subpanels in my blog.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 11
(4,170 Views)

I'm currently in the process of reading your blogs about subpanels but in the mean time, here is the code snippet of my executable.  At the bottom, in the conditional disable diagram, is the code that is in the VIServer_TestingSubpanels.vi.

 

I've tried both reentrant and non-reentrant settings for the subpanel.  The subpanel in the attached executable above is reentrant.

0 Kudos
Message 3 of 11
(4,154 Views)

After reading more on subpanels and reading your blog, I'm still unclear as to why I'm having an issue or what might be a method to work around the issue.

 

Maybe a little context will help:

 

The executables that I create will be manipulated by an external program created by another group within the company.  So, what they have done is create a DLL that uses the VI server to access front panel controls and indicators from a LabVIEW-built application.  This currently works just fine for anything that is on the main VI's front panel.  But, what I am trying to do is create hardware specific subpanels for the controls that actually do the interfacing with the hardware.  There are several different pieces of hardware with which we will interact, each having its own subpanel in the same main application.  So, they need to be able to 1) find which VI is running in the subpanel programmatically and 2) interact with that subpanel via VI server within the DLL.

 

Any thoughts are definitely appreciated.

0 Kudos
Message 4 of 11
(4,107 Views)
Ohhhh... That's easy.

There is a subpanel property that will return a reference to the VI that is currently in the subpanel. From that you can get the name of the VI and store it somewhere VI Server can find it -- like a FGV. Once the remote process has the VI's name the rest should be a piece o'cake.

The only thing different with using VI Server from an external source is that you need a reference to the copy of LabVIEW where the VI you want to access is loaded. And all you need to get that is the IP address or network name of the computer its on (use 'localhost' if its on the same computer), and the port the LabVIEW application is listening on.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 11
(4,099 Views)