Step Parameters Don't Match Sequence Parameters Error Using TestStand XML API

Updated Jul 10, 2020

Reported In

Software

  • TestStand

Issue Details

I am using the example sequence located at <TestStand Public>\Examples\TestStand API\Building a Sequence Using API\LabVIEW\Building a Sequence Using API - XML.seq to build my sequence dynamically using specifications listed in a XML file. I want to create a Sequence Call step in my generated file, so I use the following syntax in the XML file:

<Step Name="Call subSequence" Type="SequenceCall" Adapter="Sequence Adapter">
        <Prop LookupString="Module.SFPath">.\path of sequence to be called\test.seq</Prop>
        <Prop LookupString="Module.UseCurFile">false</Prop>
        <Prop LookupString="Module.SeqName">MainSequence</Prop>
        <Prop LookupString="Module.UsePrototype">true</Prop>
</Step>


However, I am facing the following error in the sequence call of my generated sequence file:


The error states "The parameters specified by the step do not match the sequence parameters".
How do I make sure that the parameters are properly loaded in the sequence call?

Solution

When a Sequence Call Step is created in a TestStand sequence, the called sequence prototype is automatically loaded, so the parameters (if any) are automatically loaded. However, when adding a Sequence Call Step in a dynamically created sequence, the called sequence prototype is not loaded.
So, some sort of load command needs to be specified in the XML file using which the sequence is generated.
To that end, the pre-expressions property of the Sequence Call can be used to execute the LoadPrototype method. Modify the Sequence Call step in the XML file as follows:

<Step Adapter="Sequence Adapter" Name="Call subSequence" Type="SequenceCall">
                <Prop LookupString="Module.SFPath">.\sampleXML\LabVIEW Load Test.seq</Prop>
                <Prop LookupString="Module.UseCurFile">false</Prop>
                <Prop LookupString="Module.SeqName">MainSequence</Prop>
                <Prop LookupString="Module.UsePrototype">False</Prop>    
                <Prop LookupString="TS.PreExpr">Step.Module.LoadPrototype(0x1), Step.Module.ActualArgs.BoolParam.expr=True, Step.Module.ActualArgs.StrParam.Expr=\"Locals.TEST\"</Prop>
</Step>
    

There are 3 pre-expressions added in the above XML sample. The first one is to load the prototype and the rest are to set values of the loaded parameters.
Note that Module.UsePrototype property needs to be set to False as this enables the 'Use Prototype of Sequence' option available in the Sequence Call Module Tab.
The result of generating a sequence call using this format is shown below:



 

Additional Information

To set other properties using the Pre-Expressions, the path of said property needs to be known which can be found of using the Property Browser of each step as shown in article: Display the Unique Step ID of TestStand Steps in the Step Settings Pane .