NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing local variable to subsequence

Solved!
Go to solution

I have a sequence that sets a local variable, Locals.LowPassFreqGhz = 1.800. 

Then it runs 5 subsequences.

The Local is set to a new value and then the same 5 subsequences are run again.

 

Now I have new model numbers where the pair is different and soon will have models where there will be groups of 4 frequencies instead of two. Therefore I would like to put the 5 seqs into a subseq and pass the freq based on a select statement. In my limited understanding and knowledge of TestStand I think the subsequence would have its own Local.variables. How should I pass this local to a subsequence, convert to a File.global?

 

thanx,

 

jvh 

0 Kudos
Message 1 of 7
(5,598 Views)
Solution
Accepted by topic author jvh75021
The subsequence could have it's own locals but you would use parameters to pass locals in the main to the subsequence. See chapter 1 of the TestStand Reference Manual and the section on sequences.
Message 2 of 7
(5,595 Views)

Thanks Mr K.!

 

Haven't read that section yet but the light bub (albeit maybe 52 watts rather than a full 60) came on when I read your post. As a vague paraphrase: "One man's locals are another's parameters".

 

 

jvh 

0 Kudos
Message 3 of 7
(5,586 Views)

Hi,

 

I just wanted to mention a trick a friend showed me once. The Main Sequence Locals are copied to the subseq Parameters. In his subseq he always copies the Parameters to the subseq Locals in a Statement step at the beginning of the subseq. All the steps in the subseq point to the subseq Locals. That way, if you need to change the subseq Parameters, then you won't break all the steps.

 

cc

Message 4 of 7
(5,550 Views)

there is another way also to  

Teststand give us an option of "Propagation" of a  variable to subseqeunce.

we need to  create a local variable both in main and sub sequence with same name and use "Propogate to subsequence" in main seqeunce and " allowpropagation from caller" in sub seqeunce.

This option of propagation one can see by right click of a variable in variables pane. This allows us to get the values of variables in main seqeuence to sub seqeunce.

But need to remember that both variable names in main and sub sequence should be the same.

 

Regards,

Praveen.

 

Message 5 of 7
(5,430 Views)

Thanks dowNow and Sury.

 

Good info to know. 

0 Kudos
Message 6 of 7
(5,400 Views)

14 years later. I just had the same light bulb moment 😄

0 Kudos
Message 7 of 7
(46 Views)