NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Current Teststand Version

Solved!
Go to solution

Hi,

I have installed two version of teststand RTE in one pc(V3.1 and V4.2). And I will make a tool to switch between those two version.

But how can I get current acticve teststand version using some API's?

 

Anyone can help to give an example?

 

BR

Gavin

0 Kudos
Message 1 of 5
(4,432 Views)

Hi,

 

try this link

 

 

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(4,428 Views)

Hi,

but whether there is some API can do this? I still hope to use some API's if possibile.

 

I check the list in API functions and seems there is one TS_EngineGetVersionString();

However, when I run it first, it goes Ok, but if I run it second time, code went error.

Am I using the right one?

 

Here is my code:

status = TS_NewEngine ("", &hHandle);

status = TS_EngineGetVersionString (hHandle, NULL, &szVersion);

status = TS_EngineShutDown (hHandle, NULL, VTRUE);

status = CA_DiscardObjHandle (hHandle);

 

 

0 Kudos
Message 3 of 5
(4,397 Views)
Solution
Accepted by gavin.gqchen

Hi,

 

What is the error that you are getting.

 

I dont think you are closing the engine properly. You should be doing two passes on the shutdown.

 

Check out this topic

 

Shutting Down the Engine
»Table of Contents
NI TestStand™ 4.2 Help
May 2009

NI Part Number:
370052H-01

»View NI TestStand Product Info You shut down the engine just before you exit the application and when you log out the current user. Shutting down the engine is a two-pass process in which you release sequence files and wait for their unload callbacks to complete.

First Pass
Unload all sequence files and close all completed executions. The application must release all references to sequence files and executions so TestStand can unload all associated sequence files and run any unload callbacks they include.
Call the Engine.ShutDown method, passing False for the final parameter.
The first pass ends when you receive the UIMsg_ShutDownComplete or UIMsg_ShutDownCancelled UIMessage. If you receive the UIMsg_ShutDownComplete event, continue with pass two. If you receive the UIMsg_ShutDownCancelled event instead, resume the normal operation of the application. The user can cancel shutdown by clicking Cancel in the Waiting for Execution to Complete Timeout dialog box, which TestStand launches for executions that do not end within their allotted time.

Second Pass
Close all executions TestStand created as a result of the first pass. Release references to all executions and close the windows you used to display them.
Call the LoginLogout Front-End callback, passing True for the logoutOnly argument.
When the LoginLogout callback completes and you receive the UIMsg_EndExecution event, call the Engine.ShutDown method again, this time passing True for the final parameter.
The second pass ends when you receive the UIMsg_ShutDownComplete event. When you receive this event and you are shutting down in preparation to exit the application, it is safe for the application to exit. If you are shutting down because the current user logged out, you can resume normal operation at this time.

 Note  For a LabVIEW user interface, if the TestStand Engine attempts to launch a dialog box during shutdown and the main application window no longer exists, the user interface hangs. To prevent this hang, ensure that the engine is closed before you close the front panel of the user interface.

 

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 5
(4,392 Views)

In order to more easily and precisely check the engine version I recommend using Engine.MajorVersion, Engine.MinorVersion, and Engine.RevisionVersion instead. This way you can avoid having to do string parsing to programmatically do version comparisons.

 

-Doug

0 Kudos
Message 5 of 5
(4,310 Views)