NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Changi
Posts: 26
0 Kudos

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

Active Participant
snowpunter
Posts: 272
0 Kudos

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

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, CLD, MTFBWY
Member
Changi
Posts: 26
0 Kudos

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

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

Active Participant
snowpunter
Posts: 272
0 Kudos

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

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, CLD, MTFBWY
Trusted Enthusiast
RayFarmer
Posts: 4,648
0 Kudos

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

[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
Active Participant
snowpunter
Posts: 272
0 Kudos

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

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page