06-27-2014 01:26 AM
As an example, I would like to open a VI with LabVIEW through the command line. I want to make this script generic, works on any version.
What is the advised method of determining the LabVIEW executable (labview.exe) path?
or to phrase it differently, each LabVIEW version is istalled in a different folder, depending on release year and x86 or x64 version, how can I get the path of the latest version?
is there a registry key or similar that can be used?
06-27-2014 07:18 AM
I would just use the List Folder of the National Instruments folder and look for the largest LabVIEW 20XX. You can do this on both the x86 Program folder and the normal (assuming 64 bit OS).
06-27-2014 10:21 AM
When you say "script" do you mean a .bat file? Or a small LV program that opens other LV code?
You might have trouble getting one version of LV to open a different version of LV. What is it that you are trying to accomplish?
Mike...
06-27-2014 10:28 AM
I do it using the registry. Here is a post where I have a AutoIt EXE scan for what versions of the runtime engine are installed. And then it runs an EXE that is compatible with the run-time engine or development environment installed.
http://lavag.org/topic/17803-run-exe-based-on-installed-run-time/
But you can also do it from a VI. Attached is a VI that will find the Run-Time versions installed and development with path to the EXE/DLL.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-27-2014 12:23 PM
When you have LabVIEW installed, if you double-click on a VI, it will Open in LabVIEW (in Windows, at least). This is because Windows has associated the Open command with a particular instance of LabVIEW, say LabVIEW 2012. When you have multiple versions of LabVIEW installed on the same computer, whichever one you use to open a VI becomes the "default" LabVIEW.
For example, I have 2010, 2011, 2012, and 2013 on my machine. I'm currently doing most of my work in LabVIEW 2012, so when I click on a Project or VI, it opens in LabVIEW 2012. If, on the other hand, I try to open a LabVIEW 2013 VI, I get a warning "Wrong version of LabVIEW". So I close LabVIEW 2012, open LabVIEW 2013, and now I can open the VI. But by doing this, I've changed my "default" version to LabVIEW 2013! If I were to then double-click a 2012 VI and then save it, it would be saved in LabVIEW 2013 format (which may not be what I want) -- I need to remember to close LabVIEW 2013 and manually open LabVIEW 2012 and a LabVIEW 2012 VI.
If you want to see which versions of LabVIEW are installed, you can look in the Registry at HKLM\Software\National Instruments\LabVIEW, which has a folder for each installed version.
If you want to know which LabVIEW is the current "default", look at HKCR\LabVIEWInstrument\shell\open\command and see the version under (Default).
Bob Schor
06-27-2014 12:30 PM
@Bob_Schor wrote:
When you have LabVIEW installed, if you double-click on a VI, it will Open in LabVIEW (in Windows, at least). This is because Windows has associated the Open command with a particular instance of LabVIEW, say LabVIEW 2012. When you have multiple versions of LabVIEW installed on the same computer, whichever one you use to open a VI becomes the "default" LabVIEW.
The VI I attached also detects this by returning the "Current Version" cluster with path, version, and Server Port.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord