LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I have installed both Teststand3.1 and Teststand3.0 on my laptop, I want to know which is active. Which API function can I use to get this information under Labwindows.

 
I have installed both Teststand3.1 and Teststand3.0 on my laptop, I want to know which is active. Which API function can I use to get this information under Labwindows. I know I can use the function "RegReadString" like below, but sometimes, this kind of method is not engough effective, because it just check which versions of Teststand have been installed.

 RegReadString (REGKEY_HKLM,
       "SOFTWARE\\National Instruments\\TestStand\\3.0", "Path",
       NULL, 0, &size);
 if(size!=0)     
 {
  RegReadString (REGKEY_HKLM,
       "SOFTWARE\\National Instruments\\TestStand\\3.0", "Path",
       TetStandPath, size, &size);
  version=0;    
 }
 else
 {
  RegReadString (REGKEY_HKLM,
       "SOFTWARE\\National Instruments\\TestStand\\3.1", "Path",
       NULL, 0, &size);
  RegReadString (REGKEY_HKLM,
       "SOFTWARE\\National Instruments\\TestStand\\3.1", "Path",
       TetStandPath, size, &size);
  version=1; //
 }
 if(!size)
 {
 responce = ConfirmPopup ("Warning",
        "NI Test Stand 3.x is not installed \n  Do you want to continue?");
                  // next, I can determine which is installed according to variable "version"
 
Thanks
Jacky
0 Kudos
Message 1 of 5
(3,332 Views)
Hi Jacky,
 
You can definitely get the version in CVI using the API.  Assuming that you have a variable refering to your instance of the TestStand Engine, you can use the Engine.VersionString property, which returns the full version as a string.  In CVI, the function to look for is EngineGetVersionString where the ObjectHandle input will be your Engine instance.  Let me know if you have any questions about this method. 
0 Kudos
Message 2 of 5
(3,319 Views)
In order to use the API of  TS_EngineGetVersionString, I need to build a new engine(TS_NewEngine) in order to have a handle, which results into somewhat low efficiency of application. Is there any other solutions?
 
 
Thanks
Jacky
 
 
0 Kudos
Message 3 of 5
(3,284 Views)

Jacky,

If you do not want to create a TestStand Engine in order to find the active TestStand version, you can go directly to a registry key.  In the registry, you will find the following registry key:

[HKEY_CLASSES_ROOT\CLSID\{B2794EF6-C0B6-11D0-939C-0020AF68E893}\InprocServer32]
 
This key contains a string with the path to the TestStand API version that is currently.  For example, if TestStand 3.1 was active, the registry key would contain the following string:
 
[C:\Program Files\National Instruments\TestStand 3.1\BIN\teapi.dll]
 
If you parse out the name of the TestStand folder containing the TestStand API you can determine what version is currently active.
 
 
This should be a more efficient solution,
 
Santiago D
Message 4 of 5
(3,248 Views)

Thanks Santiago,

Ray

😄

Message Edited by JoeLabView on 02-28-2006 02:11 PM

Message 5 of 5
(3,213 Views)