NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence Parameters: Can I use variable number of parameters?

Can I create a sequence that has a variable number of parameters?

 

If not, Can I pass an array of objects as a paramater?

In the sequence code:

 

for (i=0; i< Parameters.Params.GetNumElements(); i++) {
    object o = Parameters.Params[i];
    // Do something with o
}

In the above case, can I call the sequence by putting a "new object[] {(double(2.0)}" as the parameter value?

For example:

call VarParams

Params = PropertyObject.SetPropertyObject (Engine.NewPropertyObject (valueType, asArray, typeName, options))

 

 

 

0 Kudos
Message 1 of 2
(2,504 Views)

Not only can you pass an array of different sizes but you can also make a parameter an empty container and fill it with any container.  The problem is you have to access it correctly within the subsequence.  I can see a practical use for the Array but not really for the container.

 

Your last question regarding creating params dynamically: I would have a local variable that is in the Value for the parameter and then just change the local to what you want in the PreExpression.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 2
(2,503 Views)