NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass a constant value to input parameter (type container) of a subsequence

Hi,

 

I would like to be able to pass some constant values to the parameter type "Container" when I am giving values from the calling sequence to the subsequence.

 

TestStand Container 2.jpg

 

For example, with parameter type arrays, I can do it using {x1, x2, ..}

 

For now, I have to create the container of the same type as the parameter in the form of a variable and then store the values in the variable and then pass it to the subsequence. I find this quite cumbersome. Is there some way around it?

 

Also, when loading a VI through the LabVIEW adapter, I get the entire hierarchy of the container/cluster. Why can't I get this with the Sequence adapter too??

 

TestStand Container.jpg

 

Thanks and regards,

Aditya

0 Kudos
Message 1 of 6
(8,543 Views)

If you want constant values defined for parameters you can set the value of the parameter in the subsequence to be what you would like and then check the default checkbox when you call that subsequence.

 

For example, in your screenshot below suppose Sample had a numeric field called 'Foo'. In the subsequence you can change the value of 'Foo' to be 5, then in the SequenceCall simply check the Default checkbox and when the code runs the value of 'Foo' will be 5.

 

However, aside from testing purposes doesn't hard-coding parameter values defeat the purpose of parameters?

 

As far as your second question, there's no way to expand the fields of the container when passing it to a subsequence (that I'm aware of....)

CTA, CLA, MTFBWY
0 Kudos
Message 2 of 6
(8,537 Views)

Hi snowpunter,

 

Thanks for the response. I am aware of the method you suggested. And the question you raised about 'constant' parameters is a valid one. Perhaps I did not put the question clearly enough.

 

What I mean is that if I call the subsequence several times and I want to pass different values to it, how can I do it without creating a variable of the container type first? I am able to do this with array type parameters and the regular parameter types (Numeric, String, Boolean). But the container type has me stumped.

 

The second part of the question is also related since if there is a way to have the parameter contents shown like it is theough LV adapter, then passing of values is very easy. If it is indeed not possible, it will be pity.

 

Aditya

0 Kudos
Message 3 of 6
(8,529 Views)

You'll probably just have to create a variable and then change the value of the variable in the pre-expression for each call to the subsequence.

CTA, CLA, MTFBWY
0 Kudos
Message 4 of 6
(8,506 Views)

[For example, with parameter type arrays, I can do it using {x1, x2, ..}]

 

There is not a similar way as with an array, you will have to create a variable and use that.

 

 

 

[Also, when loading a VI through the LabVIEW adapter, I get the entire hierarchy of the container/cluster. Why can't I get this with the Sequence adapter too??]

 

Why dont you suggest this in the TestStand Ideas forum.

 

 

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(8,497 Views)