NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Current Execution Number

Howdy all,
 
In order to ensure that only one test execution is running at a time, I want to be able to disable the Restart button for completed executions while one is a currently running. I've got a custom Terminate/Restart button, so I'm not using the Active-X button here. I can get a 'key' for the currently displayed execution using the function below:
 
TSUI_ExecutionViewMgrGetCaptionText (gMainWindow.executionViewMgr, &errorInfo, TSUIConst_CaptionSource_CurrentExecution, VFALSE, "", &psTemp);
 
This returns "Test UUT - TPS_Template [4]" as a string. where the number in the [ ]'s is the key that I want so that I can tell which execution is the currently running one. While I can get it through string manipulation, I am pretty sure that there must be a function that returns this value directly; only, I can't find it.
 
Does anyone know which API call or calls will get (or a similar 'key') for me?
 
Thanks,
 
-Jack
0 Kudos
Message 1 of 2
(3,154 Views)

Well,

You hunt around enough and you eventually stumble on the answer by accidient - The function:

TS_ExecutionGetId (execution, &errorInfo, &currentExecution);

does exactly what I want.

Hope this helps someone down the road...

-Jack

Message 2 of 2
(3,151 Views)