NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically adding a 'Sequence Call' step to a TestStand sequence.

I have been spending way too much time trying to write some C++ code that will insert a 'Sequence Call' step into my sequence file main sequence, and configure it to call a sequence called 'Mount Sample'. The trick is that the 'Mount Sample' sequence takes three parameters, and whenever I try to write those parameters, the TestStand sequence editor starts puking.

I've put the whole gory story into a word document, and I'm attaching the sequence file that contains the horribly disfigured step.
0 Kudos
Message 1 of 4
(4,234 Views)
I'm not sure if the following suggestion would be applicable in your case but here goes:
When I have to make a choice as to which sub-sequence from several possibilities gets called from my main sequence, I put all possible Sequence Call steps into my main, with preconditions for each one. That way, only one (the intended one) gets called according to preconditions. It seems to me like inserting a Sequence Call using C++ code is like doing it the hard way. Hope this helps.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(4,234 Views)
Aaron -
Looking at your sequence file it appears that you are developing in TestStand 2.0.1. Not that this helps you now, but in TestStand 3.0, NI added a full set of classes for the Adapters, editing code modules and parameters. This in general is an easier and more strictly defined way to develop steps programatically.

Now for TestStand 2.0.1. Looking at your code and the bitmaps you are not creating the right container, of type SequenceArgument. I am not sure if internally the SequenceArgument data type might map to an internal class that has additional information that a generic container does not have.

You should be able to call
spProperty->NewSubProperty( "TS.SData.ActualArgs.arg0", TS::PropValType_NamedType, FALSE, "SequenceArgument", Option
_InsertIfMissing);

This will add the arg0 element before you calls to update its subproperties.

Let me know if that makes any difference.

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 3 of 4
(4,234 Views)
That did the trick Scott. Thanks a bunch.

Aaron
0 Kudos
Message 4 of 4
(4,234 Views)