LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use EntryPointRun to start a single pass execution

Now i use :
     tsErrChk( TSUI_ApplicationMgrOpenSequenceFile(gMainWindow.applicationMgr, &errorInfo, "c:\\fichier\\fichier.seq", NULL));
     tsErrChk( TSUI_SequenceFileViewMgrRun(gMainWindow.sequenceFileViewMgr, &errorInfo, CA_DEFAULT_VAL,NULL));
I do not want to execute the mainsequence directly. I want to make execution of an single pass type.
I think that I must use EntryPointRun, but I have difficulty to understand how to use it.
How?
thank you!
0 Kudos
Message 1 of 5
(3,917 Views)

After loading the sequence file (TSUI_ApplicationMgrOpenSequenceFile) you will first have to get the ExecutionEntryPoints with the method TSUI_ExecutionViewMgrGetExecutionEntryPoints. This method needs the ExecutionViewManagerReference as an input (object handle) and returns the TSUIObj_EntryPoints (value). The TSUIObj_EntryPoints Collection contains x Entry Points, depending on your processmodell. In the standard sequencial process model, there are two entry points (TestUUTs and SinglePass). to get the entry point you want, you have to call the method TSUI_EntryPointsGetItem. This method needs the TSUIObj_EntryPoints Reference as an input, the index of the entry point you want to have (0 for TestUUTs and 1 for SinglePass in the example above), and returns a TSUIObj_EntryPoint (value).  Now you can call the TSUI_EntryPointRun method to start this entrypoint. This method will need the TSUIObj_EntryPoint Reference as an input, adn will retrunr an reference to the Execution (value) in which the sequence will be executed.

Here is an example for that:

static CAObjHandle ExeViewMngRef;
static CAObjHandle EntryPointsCollection;
static CAObjHandle EntryPointRef;
static TSUIObj_Execution ExecutionRef;

...
TSUI_ExecutionViewMgrGetExecutionEntryPoints (ExeViewMngRef, NULL, &EntryPointsCollection);
TSUI_EntryPointsGetItem (EntryPointsCollection, NULL, 0, &EntryPointRef);
TSUI_EntryPointRun (EntryPointRef, NULL, CA_DEFAULT_VAL, &ExecutionRef);

 

Hope this helps!

 

André

 

Message 2 of 5
(3,881 Views)

Thank you for the answer.

Now I understand the application of TSUI_EntryPointRun method. But, for the moment, it does not work.

In TSUI_EntryPointsGetItem, the compilator dislike the index item 0 because it want a type VARIABLE... So I replaced 0 by CA_VariantULong(0) to pass 0 in parameter. After, the program compile correctly but... A error message show :"index out of range"

     tsErrChk( TSUI_ApplicationMgrOpenSequenceFile(gMainWindow.applicationMgr, &errorInfo, "c:\\fichier\\fichier.seq", NULL));
     tsErrChk( TSUI_ExecutionViewMgrGetExecutionEntryPoints (gMainWindow.executionViewMgr, &errorInfo, &EntryPointsCollection));
     tsErrChk( TSUI_EntryPointsGetItem (EntryPointsCollection, &errorInfo,CA_VariantULong(0), &EntryPointRef));

     tsErrChk( TSUI_EntryPointRun (EntryPointRef, &errorInfo, CA_DEFAULT_VAL, &ExecutionRef));

Why I have this error message?
Is it possible that my EntryPointsCollection contains no EntryPoint?
Merci!
0 Kudos
Message 3 of 5
(3,861 Views)

Hi,

 

I tried it out myself now, before I just played it through in theory 😉 and found the small mistake: We have to use the SequenceViewMgr, not the ExecutinViewMgr, then it works (after loading, the sequence is loaded in the SequnceView, but isn´t in the ExecutionView until you start it).

 

Here is the correct code, and you find a modified Operator Interface attached:

int CVICALLBACK StartSpecificSequence (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
{
 ERRORINFO errorinfo;
 int error=0;
 TSUIObj_Execution EntryPointExecution;
 TSUIObj_EntryPoint EntryPoint;
 TSUIObj_EntryPoints EntryPoints;
 TSUIObj_SequenceFile LoadedSeq;
 switch (event)
 {
  case EVENT_COMMIT:
   tsErrChk( TSUI_ApplicationMgrOpenSequenceFile (gMainWindow.applicationMgr, &errorinfo,
                 "C:\\Programme\\National Instruments\\TestStand 3.5\\Examples\\Demo\\C\\computer.seq", &LoadedSeq));
   tsErrChk( TSUI_SequenceFileViewMgrGetExecutionEntryPoints (gMainWindow.sequenceFileViewMgr, &errorinfo, &EntryPoints));
   tsErrChk( TSUI_EntryPointsGetItem(EntryPoints,&errorinfo,CA_VariantULong(0),&EntryPoint));
   tsErrChk( TSUI_EntryPointRun(EntryPoint,&errorinfo,CA_DEFAULT_VAL,&EntryPointExecution));
   CA_DiscardObjHandle(EntryPoint);
   CA_DiscardObjHandle(EntryPoints);
   CA_DiscardObjHandle(LoadedSeq);
   CA_DiscardObjHandle(EntryPointExecution);
   
   Error:
   DisplayError(error);
   return error;
   break;
 }
 return 0;
}

 

Message Edited by Andre_Saller on 08-09-2006 02:59 AM

Message Edited by Andre_Saller on 08-09-2006 03:00 AM

Message 4 of 5
(3,845 Views)

It work perfectly!

thank you!

0 Kudos
Message 5 of 5
(3,831 Views)