NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS_EngineNewExecution not executing sequence

I'm trying to run a TestStand sequence from CVI.  The TS_EngineNewExecution call returns correctly but doesn't seem to actually run the sequence.  I can write this same code in TestStand and the sequence runs fine.

Here's a code snippet from the CVI project:

         tsErrChkMsgPopup( TS_EngineGetSeqFileEx (objEngine,
                                             &errorInfo,
                                             pszSequenceFile,
                                             TS_GetSeqFile_OperatorInterfaceFlags,
                                             TS_ConflictHandler_Error,
                                             &objSeqFile));
       
          tsErrChkMsgPopup( TS_EngineNewExecution( objEngine,
                                             &errorInfo,
                                             objSeqFile,
                                             "MainSequence",
                                             objProcessModel,    // where objProcessModel is 0
                                             VFALSE,
                                             TS_ExecTypeMask_InitiallyHidden,
                                             CA_DEFAULT_VAL,
                                             CA_DEFAULT_VAL,
                                             CA_DEFAULT_VAL,
                                             &objExecution)) ;

            tsErrChkMsgPopup( TS_EngineReleaseSeqFileEx( objEngine, &errorInfo, objSeqFile, 0L, &unloaded)) ;
            CA_DiscardObjHandle(objSeqFile) ;

In TestStand, the code which does the same thing, successfully:

            FileGlobals.objSeqFile = RunState.Engine.GetSequenceFileEx("C:\\Documents and Settings\\Jen\\Desktop\\Sequence File 2.seq", 0, ConflictHandler_Error)
            RunState.Engine.NewExecution( FileGlobals.objSeqFile, "MainSequence",  Nothing, False, ExecTypeMask_InitiallyHidden)
            RunState.Engine.ReleaseSequenceFileEx( FileGlobals.objSeqFile, 0)

Why isn't the TS_EngineNewExecution call working correctly?  What subtlety might I be missing?  I know the engine handle is OK because I can use it to display a popup dialog;  the sequence object handle seems correct also.

I'm running CVI 8.5 and TS 4 on Windows XP.

Thanks.  -- Jen
0 Kudos
Message 1 of 4
(3,740 Views)
Hello JenniferB,

Could you post the entirety of your code here so I can take a look at how you are setting up your input parameters?

Have you stepped into this code as it executes and checked the values of your variables and object handles before and after each step?  The code looks okay to me, but I am guessing that one of your object references or possibly your file path is invalid.
Regards,


Marty H.
National Instruments
0 Kudos
Message 2 of 4
(3,687 Views)
Hi JenniferB,
 
I'm not sure exactly what is wrong with the code you posted, in either case, you probably will want to use the TestStand UI Controls to starts a new execution rather than call into the API directly.
 
The TestStand UI Controls make it really easy to do this kind of thing and handles a lot low level functionality behind the scenes that you would otherwise have to implement yourself. There are 3 Manager Controls, the ApplicationMgr, SequenceFileViewMgr, and the ExecutionViewMgr. They can be used to develop user interfaces, and connect visible UI controls (like buttons and list boxes) to automatically control the TestStand API.
 
We always encourage people to use these Manager Controls as it is less prone to error and also a lot easier to implement.
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 3 of 4
(3,598 Views)

Hi,

Are you sure objProcessModel is actually set to Nothing | NULL | 0.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 4
(3,584 Views)