LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Server from RT PXI

Is it not possible for a VI running on an RT target to call a VI running on the Host PC?
 
To wit: I can run this VI Server example with emb.llb on my RT target's hard drive and "call emb.vi" running on my Host PC.  I want to be able to do this the other way around.
 
Attempting to do so results in a message stating that "Error 66 occurred at Open Application Reference in call emb.vi" approximately ten seconds after call emb.vi starts executing.  I have already enabled machine access in the project (I am using LV8.2) through the properties pages of My Computer and the RT PXI Target, as well as in the Tools->Options dialog.
 
Am I attempting to do the impossible?
0 Kudos
Message 1 of 20
(8,514 Views)


kehander a écrit:
Is it not possible for a VI running on an RT target to call a VI running on the Host PC?


It is possible since I did it between a CompactFieldPoint and a host PC (in both way to transfert data from cFP to host and requests from host to cFP).

Here are snippets I used to test that, maybe this can help. If not, could you post your code ?




We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Download All
Message 2 of 20
(8,493 Views)
Thanks for replying.

There's really not much code to post: I'm using almost exactly the same code as the example I linked to. The only things I changed were the paths to the relevant VIs. I also changed the port used by Open Application Reference to 3364, since LabVIEW wouldn't let me use 3363 for some reason (?).

Once again, the exact same code (with the IP address changed, of course) works perfectly with emb.llb on the RT target and call emb.vi on the Host PC.

Can someone else please check if this specific example works with emb.llb on the Host PC and call emb.vi on the RT target? (By the way, I am running Windows XP SP2 on the Host PC, but the firewall has been disabled completely.)

EDIT: I also can't open your RT example since I don't have FieldPoint installed (and attempting to open it without the FieldPoint VIs makes LabVIEW crash!).

Message Edited by kehander on 10-17-2006 09:49 AM

0 Kudos
Message 3 of 20
(8,481 Views)

I took another look and thought I should try to get something clarified:

It seems to me there are two places to enable VI Server access on the Host PC: there's the Properties page for My Computer in the project, and there's the Tools->Options dialog.

If the TCP/IP is not enabled in the Options dialog, I get Error 63 (Connection Refused) right after call emb.vi starts executing, regardless of the setting in the My Computer properties.

If TCP/IP is enabled in the Options dialog but not My Computer, I get Error 66 (Connection Closed) after ten seconds.

If TCP/IP is enabled in both, I get a message stating that the specified VI server port is already in use and that the project cannot be started.  If I change the port number in the Options dialog back to 3363, then I again get Error 66 after ten seconds.

Does any of this have something to do with my problem?

0 Kudos
Message 4 of 20
(8,466 Views)

You've must have VI Server with TCP enabled otherwise you would get error 63 - connection refused. I think the problem is probably the "VI Server : Machine Access" settings don't have the RT targets IP in the list ("*" will allow all). On an RT target I think the default is VI Server disabled with a "*" in the access list, so all you need to do is enable VI Server which would explain why that worked for you. The default on Windows may be none or just the local IP which would explain why it didn't work. You may also have to enable some of the "Accessible Server Resources" on the VI Server : Configuration Page. I also had to change the path constants to sting constants in "call emb.vi" so that it would look for the VI in memory and not from disk. I was able to get it to work from an RT target to Windows. Another thing you can try is to do it from your Windows machine to itself by either typing in it's own IP or using "localhost".

-JR .A

0 Kudos
Message 5 of 20
(8,462 Views)
You added your clarification while I was replying and I had thought about adding a note about that but decided not to muddy the water, but since you aske about it here it is. When working with a project in LabVIEW, that project is like its one copy of LabVIEW running separate from other projects. That concept is called an "application instance". Each project also has it's own VI Server instance as well. There is also a "Main Application" instance which what a VI would be in if it wasn't opened in a project (like when you don't have a project open and open a VI). You can see the application instance in the lower left corner of the VI where you would also see if a VI is running on an RT target.
 
The "Tools>>Options" VI Server settings are for the Main Application instance and the My Computer properties are for that application instance on Windows for that project. Since they each have their own VI Server instance they can't open the same port which is why you got that error. To use VI server to a specific application instance you would have to wire the "port number" parameter on the "Open Application Reference" function.
 
JR A.
0 Kudos
Message 6 of 20
(8,457 Views)
I see... Like I said, though, I already enabled machine access for 192.186.0.1 (the Host PC) and 192.168.0.2 (the RT target) everywhere I could find, and all of the "Accessible Server Resources" boxes are checked.

Perhaps you could explain what you mean by chaging the path constants to string constants? If emb.llb is on the hard drive of the Host PC, why would the VI find it in memory?

Message Edited by kehander on 10-17-2006 02:24 PM

0 Kudos
Message 7 of 20
(8,443 Views)
Oh, and by the way, it works on both the Host PC and the RT target if I specify an IP of 127.0.0.1, provided I allow machine access for that address first.
0 Kudos
Message 8 of 20
(8,434 Views)
By changing the path constants to string constants I was referring to the green path constants to pink sting constants in "call emb.vi" which had values of fglobal1.vi and fglobal2.vi. The reason is stated in the help here. "If you wire a name string, the string must match the full delimited name of a VI in memory on that target. If you wire a path, LabVIEW searches for a VI in memory that you previously loaded from that path on the same target. If a matching VI is not found in memory, LabVIEW then tries to load the VI from that file on disk." So if a VI is already loaded in memory you can simply access it using the VI name as a string. If you use a path, you must use the full path and it will first check to see if a VI is loaded in memory with that name from that path, and if not then it will load it from disk. The example you were looking at does both.
 
I've thrown together a simple example showing both calling a VI from disk and from memory. I've included the project for it so all of the VI server settings should be carried along with that and it should just work. All you have to do is copy/ftp the "Get Info.vi" to "c:\ni-rt\startup" on both the Host PC and the RT Target and then you can experiment with different combinations.
 
JR A.
 
 
0 Kudos
Message 9 of 20
(8,410 Views)
Further investigation reveals that the error occurs in the Open Application Reference, before any VIs in memory or otherwise get called.

After consulting with an NI engineer on the phone I have become convinced that somehow I have a much bigger problem. (I get a little farther with LabVIEW 7.1.)

I shall post again once I get this worked out...
0 Kudos
Message 10 of 20
(8,347 Views)