From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-09-2009 10:58 AM
Hi!
I have a VI (refered as "T_FANUC.vi" in the example) which is part of "TETRA.lvproj". This VI is called by a main VI and runs until this Main.vi close.
I made another project named Supervision.lvproj and created a VI named "Simulation Robot.vi" (VI attached to this post). I'm trying to use VI server to get/set control values of "T_FANUC.vi". But VI server property node "Exec. State" always sees "T_FANUC.vi" as Idle even if it runs...
However if "T_FANUC" is placed in the same project as "Simulation Robot.vi", it works fine...
But project are built w/LV 8.5.1 and running on the same computer.
Isn't it possible to use VI server between two VIs placed in two different projects ?
Solved! Go to Solution.
06-10-2009 03:29 PM
zyl7,
It is possible to communicate between two different projects with VI Server. Each LabVIEW project exists as it's own application instance, so you would need to open an application reference before opening a reference to a VI in the other project. This is done through TCP, so you need to make sure that each project has TCP access enabled, and that each is using a unique TCP port, just as if they were communicating across a network. You didn't attach anything in your post, so it is unclear if you have done this. Let me know if this helps.
Chris M
06-11-2009 08:17 AM
CMal,
thanks for your post !
VI Server TCP feature is enabled on both projects.
But both are listening on port 3363... Should one listen on an other port ?
Could you post a screenshot showing how i should use "open application reference" and "open VI reference" ?
Thanks !
06-11-2009 02:23 PM
zyl7,
I am attaching a simple mockup of how to call one VI from a VI in a different project. The VI server settings of the calling project (Supervision) don't matter in this case, but the called project (TETRA) must setup VI server access on a port that is not already in use.
Chris M
06-15-2009 03:32 AM
CMal,
thank you for your zip.
Indeed, it works fine under LV8.6.1. However, I'm using LV 8.5.1 and it still doesn't work w/my VIs... Is there any issue with LV8.5.1 ?
06-15-2009 03:49 AM
Here is a Zip which illustrate the problem I'm facing.
06-15-2009 10:32 AM
zyl7,
The error you are getting from the "All VIs in Memory" property is because this property is not meant to be used with remote references. The help for this property explains this:
Returns a list of VIs in memory for the specified application instance. This property returns an error if you wire a remote application reference to the reference input. For a remote application, use the Exported VIs in Memory property to return a list of exported VIs
You need to setup VI server access on the "Slave" project. To do this, right click "My Computer" in the project explorer, then enable port 3364 (in this case) on the "VI Server: Configuration" page, and add 'localhost' to the list in the "VI Server: Machine Access" page.
I would suggest using relative paths with the "build path" and "strip path" functions, instead of the absolute path that you have on the "Simulation.vi" diagram. This will make it easier for others to run these VIs on other computers.
Chris M
06-16-2009 03:23 AM
CMal,
thank you for your help. One thing was missing in your last post : I had to fill "VI Server : Exported VIs" list with Add.vi (see attached zip). Filling it with "*" is much easier to allow all exported VIs currently running on the computer to communicate with teh VI Server.
Thank you again !