NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS_EngineNewHierarchicalExecution ??

Bonjour à tous !
Hello
 
Does anyone has ever used this method : TS_EngineNewHierarchicalExecution ?
Cause i have a problem with that.
 
In fact, instead of launching a global sequence, i'd like to launch a single step included in a sequence. If i have well understood the description, it will run all the setups, then run this step, then run all the cleanups.
 
I call it almost like the TS_EngineNewExecution method wich works well :
 
    // On récupère le process Modèle
    oleErrChk( TS_SeqFileGetModelSeqFile (gCurrentSequenceFile, &errorInfo, &modelDesc, &modelSeqFile));
    
    // On insère le nom du step en transformant en SafeArray
    ErrChkCA (CA_VariantSetCString (&variant, szStepName));
    CA_Array1DToSafeArray (&variant, CAVT_BSTR, 1, &safeArray);
    
    // On lance le step
    oleErrChk (TS_EngineNewHierarchicalExecution (gEngine, &errorInfo, safeArray, 0, gCurrentSequenceFile, "Single Pass", modelSeqFile, VFALSE, 0, CA_DEFAULT_VAL, CA_DEFAULT_VAL,CA_DEFAULT_VAL, &gExecution));
It returns an error 17500 !
Thank you...
0 Kudos
Message 1 of 7
(3,769 Views)
For the sequenceCallSteps parameter, you need to pass a SafeArray of steps.  You are passing a SafeArray of strings. 
 
I used a TestStand expression step to call the NewHierarchicalExecution method and passed the same arguments you are using except that I passed an array of steps instead of the step names.  I am not too familiar with CVI, but you should be able to create a SafeArray of IDispatch pointers and pass that to the NewHierarchicalExecution method.
 
Regards.
0 Kudos
Message 2 of 7
(3,756 Views)
What do you mean by "an array of steps" ?
 
Do you mean the indexes of the callback steps ?
 
Because from CVI, i can get :
- The indexes of the steps in a group (setup, main ,cleanup)
- The names of the steps
 
Regards, Ronan
0 Kudos
Message 3 of 7
(3,753 Views)
You need to pass an array of references to the steps.  The steps have to be Sequence Call steps.  I attached two TestStand 4.0 Sequence Files that show how to call HierarchicalExecution and how it works.
 
I think what you really want is to do an interactive execution.  This is what we call when you interactively select some steps in a sequence file and only run those steps.
The attached sequence InteractiveExecution.seq shows how to call a step in a sequence (in addition to the setup and cleanup steps) using a process model.  It is written using TestStand expression steps, but it should give you an idea what you need to do in the CVI code.
 
Hope it helps.  Regards.
 
 
Download All
0 Kudos
Message 4 of 7
(3,742 Views)

Yes it helps !!

I really thank you, now i understand what to put in the array. Effectively, i think i will need an interactive execution to run any step in any sequence.

Regards.

0 Kudos
Message 5 of 7
(3,730 Views)

A last question if you allow me.

Imagine that i'd like to have multiple steps using hierarchicalexecution (because it seems to be the nearest of what i search), for example :

Setup of mainSequence

   Setup of SubSequence1

      One step

      Setup of SubSequence2

         Setup of SubSequence3

            One step

         Cleanup SubSequence3

      Cleanup of SubSequence2

   Cleanup of SubSequence1

Cleanup of MainSequence

Is there a way or have i to call hierarchicalexecution each times for each step?

0 Kudos
Message 6 of 7
(3,723 Views)
Nanor,
Unfortunately, you have to call hierarchicalexecution for each step.  The InteractiveArgs only allows you to specify a single sequence so you can only execute steps in that sequence.
 
Regards.
0 Kudos
Message 7 of 7
(3,706 Views)