LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote subpanel VI reference

Solved!
Go to solution

I having a problem with getting a VI Reference to a subpanel to work correctly when running across the

network on a remote computer.

 

I have a client.vi application running on a remote computer (192.160.0.1 for this example). This client.vi has a subpanel that has several differentl VI's that get loaded in subpanel depending on the user interface being displayed (gui_a.vi for this example but there are more in the project).

 

The server.vi connect to the client.vi already running on a remote machine and then finds the reference value of the Subpanel control. That value passed into a 'varient to data' block to convert it back to a VI reference and then it's fed into 'Property Node' block where I attempt to get the path and name of whatever VI is loaded into the client subpanel.

 

When I run this scheme across a network I get a error

     error 1026 occurred at Invoke Node in server.vi

     Vi Reference is invalid

 

When I put a probe on the refnum going into Path and Name Property Node I get a correct reference number of 8B700009

but it still says its a invalid refnum and the other data like VI name and path are not displayed in the probe.

 

My guess (still newish to labview) is that the while the refnum is valid on the remote computer running the client.vi and gui_a.vi is that when server.vi running on a different computer it attempts to use the refnum that valid on the remote computer on the local one and gets an error.

 

(everything works fine when everything is run on the same PC problem, problem is just when things are run across a network)

 

How do I keep my subpanel reference referring to the remote computer?

or is there a better approach for doing this?

 

Download All
0 Kudos
Message 1 of 5
(5,442 Views)

Hi Wild_Niles,

 

My name is Paul and I'm the applications engineer here at National Instruments who will be helping you out. The reason why you're getting error 1026 while trying to access the client machine over the network is because you haven't allowed access to the server machine via the VI server settings. The way you do this is by opening up the client.vi on the client machine. In the menu bar select Tools and then Options. In the Options window that pops up you should see a VI server tab on the left as shown below (I've blacked out the port number for security reasons).

Vi Server.png

 

You need to check the TCP/IP box and put the correct port number. You also need to scroll down and under the machine access list and add the IP of the server computer to the list. After making these two changes you should be able to run your program error free. Let me know if this works for you!

 

Paul M

National Instruments | Applications Engineer | www.ni.com/support
Message 2 of 5
(5,416 Views)

Thanks for the help Paul.

I have my VI server setting as you suggested and I can connect to client.vi on the remote machine.

I put some probes on server.vi to give a little more insight

 

 

remote_p1.jpg

 

 

 

 

 

 

 

At probe #4 I get the values for the controls on of my client.vi running on a remote machine, and they appear to be good.
In this case the refnum for the client.vi subpanel is A680000E,
probe #6 also suggests that I have a good reference to the remote client.vi

 

 

 

 

remote_p2.jpg

 

 

 

I then use a invoke node operation to programmatically get the refnum of the Subpanel loaded on client.vi and its value. I get on A680000E probe #7 which matches what I got on probe #4 and I get no error (probe #9).

 

 

 

 

remote_p3.jpg

 

remote_p5.jpg

 

 

 

I then cast The variant that holds the subpanel refnum back into a VI server type and again get A680000E shown in probe #8.

 

 

 

remote_p4.jpg

 

 

 

But now you can see I don't have this refnum attached to anything (client.vi or gui_a.vi). I still have the expected number but I get a Refnum No Longer Valid Smiley Sad

Then when I try to get use that refnum to attempt to get the path (should be path to gui_a.vi which is loaded into the subpanel of client.vi running together on a remote computer) I get a Error 1026.

 

 

 

 

remote_p6.jpg

 

 

 

I'm not quite sure where I am going wrong but It appears that I can get remote access to client.vi, but when I try to use the refnum of its subpanel and then attempt to get the path of the VI loaded in it I get an error.

 

 

0 Kudos
Message 3 of 5
(5,406 Views)
Solution
Accepted by topic author Wild_Niles

Hi Wild_Niles,

 

Thanks for clarifying your issue, now I see what you're saying. I've been testing out your VI over here on our end and I've been able to replicate the same behavior. I'm still testing out to see what the possible issue could be. However, another solution would be to simply open an additional reference to the gui_a.vi. Since a subpanel is still just a VI running in memory, an additional Open VI Reference can be used in place of the Variant to Data.VI that you are using. Let me know if this makes sense to you and is a valid option. In the mean time I will continue to investigate why your current code isn't working properly.

 

Paul M

National Instruments | Applications Engineer | www.ni.com/support
Message 4 of 5
(5,380 Views)

Yeah!

 

Looks like using a passing the path of the VI in the subpanel into the varient (instead of the refnum) then using that to

do a remote VI open works great.

 

Thanks so much for your help!

Download All
0 Kudos
Message 5 of 5
(5,362 Views)