03-23-2023 11:03 AM
Running Batch model.
Each test socket needs to dynamically load a sequence file reference and get an unique memory space
Been using Engine.GetSequenceFileEx.
But each call points to the same memory space mainly the load sequence file FileGlobals.
Socket 1 calls a subSequence and stories some FileGlobals. Then Socket 2 calls the same subSequence and overwrites Socket 1's values
How can each test socket get an unique ref to a dynamically loaded Sequence File using Engine.GetSequenceFileEx?
SequenceFile.AddLoadReference?
Thanks
11-25-2024 06:00 PM
Hi Omar,
Did you determine a way to do this? I am struggling with the same issue.
Thanks!
Denise
11-26-2024 12:02 AM
@Omar_II wrote:
Running Batch model.
Each test socket needs to dynamically load a sequence file reference and get an unique memory space
To clarify: the sequence file is the same for all sockets, right?
In general, FileGlobals can be configured to be shared or seperated for executions (SequenceFileSettings), yet this only happens, when the SequenceFile is part of an execution.
So the answer this in more details... what do you want to do after the GetSequenceFileEx?
11-26-2024 07:23 AM
Yes, the same sequence file (for now) is in each test socket and I am running the ParallelModel.
After I get the GetSequenceFileEx, I preload content from our custom database (which we retrieve with an api) with the limits in numeric and multinumeric limit tests. I also preload Step.str_Parameters on the steps that provide specific variables with their values to the code. And, Step.int_Page or Step.str_Page which typically puts an integer that the code needs to display a specific page of a file. So once these steps are preloaded with their Model specific information, the sequence is dynamically run.
11-26-2024 08:47 AM
I don't know, if my explanation is technically correct...
If you use the GetSequenceFileEx() Method, it's a bit like you'd access the SequenceFile like you would do with the SequenceEditor.
This also means, that changes you are making from multiple locations (--> Sockets) will all be applied to the same shared resource (file) which in turn results in Race Conditions.
To achieve what you want to, you need to have the SequenceFile in question in Execution Mode which creates a dedicated memory space per socket execution.
This also means that the paramerization of the steps have to happen "inline" in the sequence file (callee) instead of in the caller.
For parameterization use cases like this, TestStand has the PropertyLoader Steps, that can also communicate with a database.
Hope this makes sense so far
11-26-2024 09:03 AM
Hi Oli,
Many thanks for your insights.
Our database is custom and we retrieve data through an api specific for the model that is running and the station that it is running on. The property loader, from what I could tell, needs to be setup with NI tables. Also, to avoid having code distributed for loading parameters and limits in each custom sequence, we have the SequentialModel do this process. Property Loader looks like it needs to be in each of the custom sequences.
Our process has worked fine for many years for the SequentialModel, but yeah not working for the ParallelModel and I see from what you've explained why that is. Any thoughts on how I could get a socket ready for execution and load things from the batch model prior to running the sequence?
11-26-2024 11:29 PM
It really depends, which amont of flexibility you are willing to sacrifice....
Both Batch and Parallel Model start with a Controller Execution which in turn spins up executions for each socket.
You could parameterize your sequence as described if:
1.) you already know, which Sequence is to be called and parameterized
and
2.) the Sequence is the same for all of sockets.
I guess 1.) is more of a challenge...
Let's introduce a new condition:
2.5) the sequence is the same for all sockets for a batch (Batch Model)
You could implement some logic in your calling code, that does the job, yet is run in a One-Thread-Only Synchronized section. Still, you would see database access for each batch and not just once.
But If I understood correctly, you want to have this functionality somewhere in the model, so the Sequence Programmer doesn't have to care about all this...