From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-29-2013 03:35 PM
I am currently using Station Globals for sharing values among the main sequence and subsequence files. But I constantly need to add the variables on the many computers we own.
I tried using the File Globals in the main sequence file, but the variables are not displayed in or passed to the subsequence file. It works just like a local variable.
I also tried selecting the option "propagnate to subsequence" for the local variable in the main sequence, but still didn't get passed to the subsequence.
Thanks!
ph2
08-29-2013 04:19 PM
You should use parameters in the subsequences and pass the locals, values or fileglobals down to them. That is the correct way to get data in subsequences anyhow.
Hope this helps,
08-29-2013 04:56 PM
Thanks Jigg !
08-30-2013 04:52 AM
The file globals should work the way you want it ( scope valid accross all sub sequences including main sequence of a sequence file).
The file globals are meant for this purose so maybe you are missing something?
As for using station globals it should always be dynamically generated by your test sequence if not exist.This way it can be used across computers.
08-30-2013 09:38 AM
Hi
In this thread there one of the best explanation in the forums about variables.
Just see Rays anwesers. http://forums.ni.com/t5/NI-TestStand/Using-variables-in-TestStand-4-0/m-p/658815
To Jigg: I knew that you also have provied a great resoucre, but i did not found it -sorry!
Maybe you can provide link to your thread.
Regards
Juergen
08-30-2013 09:58 AM
SunRS,
Not sure what I'm missing for File Globals. I added a variable x under the Sequence File Globals view of the main sequence file, called the subsequence and expected to see the variable x ( much the same way it works for station globals).
Do I need to add a parameter or local x in the subsequence file to accept the file global passed from main sequence?
Thanks!
08-30-2013 10:02 AM - edited 08-30-2013 10:03 AM
One way in which you could do this with less changes is by adding the station globals dynamically when you start the main sequence you are running, something like a statement step with the following statement:
StationGlobals.SetValString("MyStationGlobal", PropOption_InsertIfMissing, "My Value!")
And then all the sequences run after that will have the variable on all machines you run.
Hope this helps,
Francisco
08-30-2013 10:06 AM - edited 08-30-2013 10:09 AM
@ph2 wrote:
I am currently using Station Globals for sharing values among the main sequence and subsequence files. But I constantly need to add the variables on the many computers we own.
I tried using the File Globals in the main sequence file, but the variables are not displayed in or passed to the subsequence file. It works just like a local variable.
I also tried selecting the option "propagnate to subsequence" for the local variable in the main sequence, but still didn't get passed to the subsequence.
Thanks!
ph2
I'd recommend you consider using sequence parameters rather than globals. If you use globals, and you someday want to switch to a multi-socket test system, you might have to make signficant changes to your code because you likely would not want all of the threads using the same globals. If you use parameters instead, then every thread already would automatically have its own copy of the variables. Also parameters do not have the problem you are asking about here.
-Doug
08-30-2013 10:15 AM
Thanks to All for the help! Those are all good resources.
08-30-2013 10:32 AM
file globals will be there if the sequence is in the current file, is this the case for the sequence you are calling?