NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters in Teststand

I've defined Parameter variables in my main seq. Using Specify Module and the f(x) icon in that window,how do you navigate to those variables from a sub-sequence within the same file? In other words I have a sub seq w/in a seq w/in a file. I want to access the parameters I've defined in the main seq. Do I want to pass by reference or value ? What's the difference ?
0 Kudos
Message 1 of 3
(3,625 Views)
You have to use a global because you cannot access a parameter or local variable from another sequence, whether it is in the main or another sub suequence. That is why they are called locals and gloabals. A parameter is always local. Or you could send the parameter from the main as a parameter to the sub sequence. You have to define a variable in the parameter section of the sub sequence in order to pass the main parameter to the sub sequence. By reference means that the storage location (address) of the variable is passed, and if the sub sequence changes the value then the main will see that change. By value means that the value of the variable is passed, the sub sequence creates a different storage location for the variable, and if the sub sequence changes the
value then it changes at the newly created location. The main does not see the change, it sees the value that was originally passed (at original address, not newly created address). It is your choice depending on what you want done.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(3,625 Views)
tbob,
Thanks. I looked a little further and expanded every path in the expression browser (f(x)) and got to the parameters in my main seq from the sub seq. Its VERY convoluted !!
0 Kudos
Message 3 of 3
(3,625 Views)