NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Having problems with programmatic execution of a single TestStand step.

I recently wrote some C++ code that programmatically executes a single step from a TestStand sequence. This works find if the step is inside the sequence file main sequence, but doesn't work when the step is inside a sub-sequence. I've attached an example sequence file that has two sub-sequences, each with a single message popup step. I've written some code to execute just the message popup step in the second sub-sequence (see attached word document). When I run the code, the engine executes both sub-sequences - the same execution behavior as a "Single Pass". Of course when I try it from the sequence editor, only one message box pops up, as expected.

What am I doing wrong?

Aaron
Download All
0 Kudos
Message 1 of 5
(3,566 Views)
> I recently wrote some C++ code that programmatically executes a single
> step from a TestStand sequence. This works find if the step is inside
> the sequence file main sequence, but doesn't work when the step is
> inside a sub-sequence. I've attached an example sequence file that has
> two sub-sequences, each with a single message popup step. I've written
> some code to execute just the message popup step in the second
> sub-sequence (see attached word document). When I run the code, the
> engine executes both sub-sequences - the same execution behavior as a
> "Single Pass". Of course when I try it from the sequence editor, only
> one message box pops up, as expected.
>

I don't think you want the entry point name in your NewExecution call. Try
passing the name of
the sequence you want to run instead.

IOW change CComBSTR( "Single Pass" ).m_str --> _T("Sub-sequence 2").

Good luck,

---
Bob
0 Kudos
Message 2 of 5
(3,566 Views)
When I change the 'sequenceName' parameter to the "Sub-sequence 2", the NewExecution() method throws exception TS_Err_UnknownFunctionOrSequenceName. Also, remember that this code works for steps in the main sequence, and I don't have to specify "Main Sequence" as the 'sequenceName'.

Aaron
0 Kudos
Message 3 of 5
(3,566 Views)
Aaron,

> When I change the 'sequenceName' parameter to the "Sub-sequence 2",
> the NewExecution() method throws exception
> TS_Err_UnknownFunctionOrSequenceName. Also, remember that this code
> works for steps in the main sequence, and I don't have to specify
> "Main Sequence" as the 'sequenceName'.

Hm. I've only used NewExecution to start entry-point executions, never to
run steps interactively, so I'm just guessing here...

None of the NI C or C++ examples are very clear on what the sequenceName
parameter should be when running just steps interactively. They pass a
variable, but never show you what its actually set to. However, in the
LabVIEW example in the NI document "Executing Steps Interactively Inside of
the Operator Interface", the ONLY
terminal wired in the NewExecution call is
the InteractiveArgsParam parameter. My LabVIEW skills are rusty, but isn't
this the equivalent of passing NULLs for the other arguments? Try passing
NULL (or varNoParam the sequenceArgParams and editArgParams) and for the
other arguments and see if that helps.

Good luck,

---
Bob
0 Kudos
Message 4 of 5
(3,566 Views)
The idl parameter list for NewExecution takes a variant for all three of the parameter arguments, and I initialize the sequenceArgParams and editArgParams variants to vtMissing. That should be equivilent to not hooking up those terminals on the LabView VI.

I'll take a look at the "Executing Steps Interactively Inside of the Operator Interface" document and see if it has any tips.

Thanks for you help Bob.
0 Kudos
Message 5 of 5
(3,566 Views)