01-06-2012 06:39 AM
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.
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??
Thanks and regards,
Aditya
01-06-2012 12:06 PM
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....)
01-06-2012 10:03 PM
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
01-09-2012 11:12 AM
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.
01-10-2012 01:27 AM
[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.
06-21-2012 04:18 PM
Suggestion made
http://forums.ni.com/t5/ideas/v2/ideapage/blog-id/teststandideas/article-id/501/comment-id/502