‎04-02-2020 02:58 AM
Hi all,
I am trying to run some code that is working on an older system, but I'm facing a rather strange behaviour when it comes to loading VIs.
This is standard VI, but added to a project. When I open the LV project, it shows the correct path.
LabVIEW development system loads VI from LabVIEW directory as referenced by the LV project fie.
LabVIEW run-time engine fails to load the VI, because it searches for it in TestStand folder instead:
What could cause this and how could I solve it? Preferably without touching code modules.
Solved! Go to Solution.
‎04-02-2020 03:36 AM - edited ‎04-02-2020 03:40 AM
Hi,
I guess the answer lies within the question itself 🙂
The difference is in the default configuration of the search directories for each environment you use.
For example, this is a screenshot from TestStand (Configure -> Search Directories)
But you can add your own, as you've already figured out,
by clicking the Add button and browsing to the desired base directory,
such as C:\Program Files (x86)\National Instruments\LabVIEW 2016\
Just make sure to move it up above the TestStand directories:
‎04-02-2020 03:52 AM
Hi, thanks for your reply. The only setting I am changing is LabVIEW adapter Server fom Development system to run-time engine.
I am not changing search directories. I did try to add LabVIEW path (with and without "search subdirectories" enabled) to search directories, but that does not change the observed behaviour.
‎04-02-2020 04:24 AM
Maybe this would help (from TS help file):
‎04-02-2020 04:56 AM
Hi, I am aware of this, but maybe I am missing a point here. I am specifying a VI in a LabVIEW project. It works with Development System and doesn't with run-time engine. Why?
‎05-14-2020 07:14 AM
Hi Paulius,
This happens because of the way TestStand and LabVIEW resolves file paths using their respective search directories.
When you specify a VI in TestStand, outside the context of a project, the TestStand search directories are used to resolve any relative paths.
When you specify a VI in project context, the project path is resolved using the TestStand search directories.
However, the path of the VI specified in the project context is resolved by LabVIEW using its search directories and information stored in the project. TestStand obtains the absolute path of the VI from LabVIEW.
Given this, when you load a VI from vi.lib in project context, when the adapter is set to use the LabVIEW Development System, the LabVIEW Dev System resolves the VI's absolute path to <LabVIEW app directory> + <relative path to VI>.
However, when you load the same step with the adapter set to LabVIEW Runtime Engine, the path of the file gets resolved to <TestStand app directory> + <relative path to VI>. This happens because the LabVIEW Runtime Engine is essentially a dll that is loaded in-process by TestStand. So the current application path points to TestStand's directory rather than LabVIEW's.
Some possible solutions are:
Hope this helps.
Regards,
Tinu
‎06-02-2020 07:55 AM
Hi TRJ,
thank you for explaining what is going on. It makes more sense now. I will see how I can fix my system when I will get to it. Marking your post as the answer for now.
Btw, is this documented somewhere in the official documentation? Is this TestStand or LabVIEW version-specific behavior?
‎06-02-2020 08:23 AM
Hey Paulius,
Glad that helped.
The general conventions on how files are resolved in both TestStand and LabVIEW is there in official documentation. I am not sure if this particular case of calling a vi.lib VI in project context in the LabVIEW RTE from TestStand is documented, it is a sort of special case.
This behavior is not version-specific and you should see the same behavior across TestStand and LabVIEW versions.
Regards,
Tinu