NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Fileglobal variable usage with model

Hi all,

 

I am developing a test application which uses the batch model. Executing the test application starts in the batch model and then executes the sequence "ProcessSetup" in the test application sequence file. During this "ProcessSetup" I decide how many tests will be run in parallel and write this number to a file global variable. After executing the "ProcessSetup", execution goes back to the model. When I set a breakpoint in the test application sequence file at the next sequence that will be called from the model, the file global variable has its default value and not the value I wrote in "ProcessSetup".

 

Are the file globals reinitialized every time the model executes a sequence in the application sequence file?

 

Is there another way to "remember" variables in the application sequence file without passing these product specific variables via the model?

 

Thanks in advance

Stef

0 Kudos
Message 1 of 7
(3,940 Views)

Stef,

 

as the name clearly states, it is a "file global". So access scope is limited to the file.

Simply creating a new file global in another file and assign the same name is NOT sufficient to pass the data values.

 

Please use parameters to solve this or change the ProcessSetup in your custom model. Do not forget that you should not change the original mode, so create a copy before modification.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(3,934 Views)

Hi Norbert,

 

But I am using the same file, see the schema attached.

 

Is the scope for the file global variables as long as the seq file is used during the test or only during execution of the sequence called from the model?

0 Kudos
Message 3 of 7
(3,931 Views)

I am confused. ModelOptions is called BEFORE ProcessSetup by the default BatchModel. Did you make modifikations?

 

My guess is that you deal with separate executions. Default configuration for sequence files is to have separate file globals for each execution. You can change this in the client sequence file property dialog.


Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 7
(3,922 Views)

Hi Norbert,

 

Yes we use a modified model.

 

What is the definition of an execution? Is there an execution per sequence call from the model or is there an execution per test in the batchtest ?

 

Thanks in advance,

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

svh,

 

Which version of TestStand are you using.  In TS 2010 the ProcessSetup callback occurs before Model Options.  However, I'm surpised that your FileGlobals aren't persisting like that because Model Options occurs outside of the UUT loop.

 

I ran into this issue with other callbacks.  When your client file is executing there are 3 copies of it that you need to be aware of: The copy on disk, the copy in memory (also called the edit time copy), the execution copy.   When you click TestUUTs basically TestStand takes the edit time copy and makes an execution copy.  It just so happens that when you get to Initialize Test Sockets step when it spawns the different threads it pulls the edit time copy into memory for each of those threads.  NOT the execution copy like I would have expected.  So therefore, the first execution copy has the FileGlobals in its memory space and the newly spawned executions have the default FileGlobals from the edit time copy.  What I had to do to overcome this is Clone the first execution FileGlobals and paste them into the newly spawned execution FileGlobals.  I did this in the process model and used queues to pass them.  It was very tricky and caused some other issues but worked.  I'm not sure it is the cleanest way to do it.

 

However, all that being said, I am surprised that your FileGlobals don't persist because they are both operating on the first execution copy.  I just tested it out and it works fine for me.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 7
(3,914 Views)

Each Socket runs in its own execution.

"Initialize TestSockets" (Looping) spawns a new execution for each configured Socket. This at least is the default BatchModel.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 7
(3,912 Views)