NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

FileGlobals scope. How to extend it to another file?

Hi,

 

From the file - let say file A -  from which my Main Sequence is called by Sequential model, I have to call the sub-sequence which is in the other file - let say file B.

 

What are the ways to cause that FileGlobals from file A will be inherited by the FileGlobals from file B (dynamically, during executions)?

 

In other words:

 

FileA:FileGlobals.Settings.Temperature = 5   >----copy? ---parameter pass?--- inherit?---share?-----> FileB:FileGlobals.Settings.Temperature = 5

0 Kudos
Message 1 of 5
(4,527 Views)

Pass them into the sub-sequence as parameters.  If you want universally available variables, use Station Globals.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(4,524 Views)

I'm wondering, that it could be good to have an option during the call of the sequence like: "Inherit FileGlobals from the caller". Of course could be area for conflicts, but still see advantage of it.

0 Kudos
Message 3 of 5
(4,515 Views)

You could place the following statement in your top-level sequence:

 

Locals.SetPropertyObject("FileGlobals", PropOption_InsertIfMissing | PropOption_NotOwning, FileGlobals),
Locals.SetFlags("FileGlobals", PropOption_NoOptions, Locals.GetFlags("FileGlobals", PropOption_NoOptions) | PropFlags_Propagate)

 

 

From then on you can refer to the file globals from within that sequence and any sub-sequence with Locals.FileGlobals.Foo

0 Kudos
Message 4 of 5
(4,511 Views)

I'm sorry but I didn't give the scenario, which I think is important for the answers.

 

I ask for an advice for it because I have to split up my project by asking another developer to prepare a test sequence. The sequence will be prepared in another file. However, I have to secure the same critical test parameters which, I store in the FileGlobals containers in file A, to be accessible as a FileGlobals from file B. Why? Because, later on maybe I'd like to merge it in to the A file and I'd like to keep the same method of accessing them, avoiding the recopying between containers with different names. 

 

James, your solution wouldn't work for me, as I'd have the FileGlobals from A file accessible from within the Local container in file B.

 

Crossrulz, passing FG as parameters is the the best solution so far, but I still think that kind of option I mentioned before could bring some advantage.

0 Kudos
Message 5 of 5
(4,504 Views)