11-28-2018 02:29 AM
Hi guys,
I have a special problem. An important Index (something like the socket number) is needed everywhere during the execution of tests (in "call sequence" steps, in Model Options Callbacks, etc.). When the sequence is in the same file, I can use file globals to share the varaible, when the called sequence is in an other file I could propagate the variable or use a parameter. But parameters are seen only in the main sequence of the sequence file so how can I see a parameter from the caller in i.e the Model Options Callback? It is from a different file, so file globals do not work here!!!
Background: I need to define the Result directory for the report before or in the Report Options Model callback. So if I have a wrapper, which knows only by runtime which Test to call, this important index should come from the wrapper and should be handled before the Report Options Model callback is called (i.e. Model Options Callback would be my favorite, as this one is called only twice even with when two Reports are generated)....
Are there any ideas of how this parameter could be passed?
For me it is verry complicated to have such a lot of different methods to pass or share parameters, but still I haven't found a single one for my needs....
Thanks for your help.
Best Regards
Matthias
Solved! Go to Solution.
12-13-2018 07:57 AM
Not ideal, but have you looked into Station Globals? You should have access there from any file within TestStand.
12-13-2018 08:15 AM
Hi Matthias,
It may be that you can use file globals for this purpose. For an execution, Runstate.Main.FileGlobals will give you access to the file globals variables of the sequence file that contained the MainSequence that was called by the process model. So you could put shared globals into that file and have access to them in all sequence files. If you have control of the Process Model, you can also use Runstate.Root.FileGlobals and you'll be able to see everything in the Process Model's file globals from any file.
Alternatively, if you know which of your callers has the data you need, you can use Runstate.Caller.Fileglobals (or anything that the Caller can see). Note you can go up the call stack by nesting Runstate.Caller.Runstate.Caller... etc.
I hope this helps!
-Jack
12-13-2018 08:37 AM
Hi Jack,
thanks for your post. In the meantime I was able to pass the parameter into the sequence call of a new execution, even into the model options callback. It was not needed at all to change the parameter list of the callback!!!!!
But your approach is very interresting. I wonder if this would also be possible for a call of a sequence in a new execution. Normally with Runstate.Caller.Runstate.Caller.Runstate..... you can only step up the stack inside one execution and not higher :).
To use station globals does not help here, as I have 4 parallel executions, each with a different index (something like the Testsocket Index).
Best regards
Matthias
12-13-2018 08:48 AM
RunState.Caller will not work in a sequence called in a new execution. The call stack is reset for that execution.
Your only option is to parameterize this somehow when you kick off the new execution.
The attached sequence file demonstrates this.
12-13-2018 08:57 AM
Hi jiggawax,
thanks for your post. That's what I expected. Hope to find some time to check your sequence as the problem is solved already and I have a lot of time pressure right now.
I have no Xmas BBQ here so I give you a Kudo
Best regards
Matthias
03-28-2019 05:30 AM
Hi Jack,
I found a solution with file globals in the Sequence file (some time ago). The modell callbacks where in the same file so there was no problem in sharing the variables.
As these callbacks could change and then needs to be updated to all sequence files,... I thought it would be a good idea to generate a StationCallbacks.seq file to keep all callbacks. Unfortunately then I use another file so the link between the callbacks (all using file globals) and the main sequence in the sequence file is broken.... I would need to read the file globals from the StationGlobals.seq file. Then I tried to copy this variable into the Runstate.Main.FileGlobals..... but when I set a breakpoint, this new value of the variable does not appear......
The reason might be that the main is not jet started and RunState.Main. is still "nothing".
I hate to give up so close to the solution 🙂
Do you have any suggestion?
Thanks a lot.
Best regards
Matthias
03-28-2019 07:25 AM
Hi Jack,
this is just to tell you that I made it
I created a fileGlobals variable in the SequentialModel during runtime, so I can read it from the Main sequence.
The only thing I'm not so shure that it works would be after the deployement.
As I'm forced to work with environments (here different pathes) I wonder if it works when putting the StationCallbacks in the same relative (but not absolute) directory....
Hope it works.
Best regards
Matthias