ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

wait until execution ends

Hello,

 

I am using TestStand API in CVI to run a test sequence. I want the button start to be dimmed during the execution, so I wrote these lines: 

 

SetCtrlAttribute(panel, PANEL_COMMANDBUTTON, ATTR_DIMMED, TRUE);

TS_NewEngine (NULL, &lEngine));
TS_EngineGetProperty (lEngine, &errorInfo, TS_EngineGlobals, CAVT_OBJHANDLE, &stationGlobalsHandle));

TS_EngineGetSeqFileEx (lEngine, &errorInfo, "SequenceFile1.seq",TS_GetSeqFile_OperatorInterfaceFlags, TS_ConflictHandler_UseGlobalType,&lCurrentSequenceFile ));

TS_SeqFileGetFileGlobalsDefaultValues (lCurrentSequenceFile,&errorInfo, &fileGlobalsHandle);

TSerrChk( TS_EngineNewExecution (lEngine, &errorInfo, lCurrentSequenceFile,"MainSequence", modelSeqFile, VFALSE,TS_ExecTypeMask_Normal, CA_DEFAULT_VAL, CA_DEFAULT_VAL, CA_DEFAULT_VAL, &lCurrentExecution));
TS_ExecutionWaitForEndEx(lCurrentExecution,&errorInfo, INFINITE,TRUE,CA_DEFAULT_VAL,CA_DEFAULT_VAL,&end);

SetCtrlAttribute(panel, PANEL_COMMANDBUTTON, ATTR_DIMMED, FALSE);

 

 

But it's not working, the sequence is not even executed and the button remains dimmed.

If anyone can help me I would appreciate it. 

 

Thank you

0 Kudos
Message 1 of 2
(4,525 Views)

There are several flaws in your approach:

  • You are not using Manager Controls
  • You are using WaitForEndEx which is documented as This method is not meant to be used by a user interface or sequence editor, as it does not process UIMessages. Instead, use this method from a step to synchronize with another execution. Remove this from your UI code!
  • The default visible TestStand button provides properties. Use them to do what you want.

 

thanks,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(4,371 Views)