04-15-2016 08:36 AM
Hi guys,
probably I'm not the first to hit this issue, but I haven't found anything on the forum....
I'm planning to invoke a sequence in the PreExpr of my step definitions (to add GUI messaging). As an example, I refer to this this.
It works invoking sequences without parameters. As soon as parameters for the sequence to be called are introduced, I get errors.
The PreExpr used is
RunState.Engine.NewExecution(SeqFileReference, "SeqName", Nothing, False, 0, Step) where Step is the container to be passed.
During debugging, I found out, that using this PreExpr with a standard step (in this case a Statement) placed in the sequence, everything works as expected.
So I removed the PreExpr from my Typedef and retried inserting the PreExpr into the step manually. No luck...
So... is there a context-wise difference between the PreExpr used in the (user) TypeDef of the step and the NI Typedef?
Cheers
Oli
BTW.... still on TS2013 / Win7
04-21-2016 03:34 AM
Hi,
can you attach your sequence file?
Anna
04-21-2016 09:11 AM - edited 04-21-2016 09:12 AM
Hi Anna,
the problem has magically disappeared when modifying a sequence to be posted here
Now, that this is working I have stumbled over another issue I am not really understanding:
The PreExpr starts a sequence from a different seq file in new execution:
RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11, Step)
--> calling PreExecutionMsgs passing the Step container as Parameter
So I have defined the Parameters for the sequence as
Now... running my seqeunce having set a breakpoint in the sequence and taking a look at the variables I get this
Parameter.Step is shown as type Boolean instead of Container!
And.... where do all the other Parameters come from?
Accepting this for the moment, I decided to delete Step from the Parameter section of PreExecutionMsgs. At runtime, this results in no variables available in the Parameter section, which seems reasonable.
Re-implemeting the Step Parameter, it turns out, that both
RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11, Step)
(--> handing over Parameter to the sequence)
and
RunState.Engine.NewExecution(StationGlobals.SystemParameter.GUI_MsgProcessing_Seq, "PreExecutionMsgs", Nothing, False, 0x11)
(--> handing over NO Parameter to the sequence)
are working equally fine: Variables showing up as mentioned above for both cases.
What is the point I'm missing? The implementation seems to be working, but I'd like to understand what I'm doing before using it.
Cheers
Oli
04-26-2016 09:11 AM
Hi Oli,
the change of the Parameter has no logic background. I have never seen, that the type of a variable in TestStand changed when executing it.
A thing, that could cause the change, is, when you click on the parameter or variable, you have to rightclick it to change the type. If you often use shortcuts, this might be the reason for accidently changing it.
As long, as it works for you now, I would leave it at that and watch the behavior and if it changes again. If so, you can try to use Ctrl+Z to see the last changes in the project.
Best,
Melanie
04-26-2016 09:33 AM
Hi Melanie,
it is very strange.... that's why I'm a bit suspicious.
Before changing all my custom step types, I'd like to be sure not to base on a bug / unwanted behaviour
Cheers
Oli
04-26-2016 09:40 AM
Hi Oli,
I think, if that is an unexpected behavior, this would effect other users and there would be a lot of forums entries about it.
Melanie
04-26-2016 10:50 AM
Oli,
Can you attach a sequence file which shows the behavior, including your custom step type definition? We can take a look at it and see if the behavior occurs on our side as well.
04-27-2016 02:08 AM
Hi Daniel,
Please find attached the files.
If you run MainSequence of PreExpr_Demo.seq, it will run several steps with different PreExpressions.
ExtRoutine.seq consists of three sequences:
My findings are
For PropObject Parameter:
For Cluster Parameter (not: Cluster has turned into Boolean)
I'm happy to have this data available, but I would have expected to have it in a different arrangement.
05-17-2016 09:40 AM - edited 05-17-2016 09:41 AM
Hi,
so I have been in contact with the NI Support: this behaviour is not necessarily linked to own type definitions. It's rather a general thing.
There is a documented way to pass parameters to a subsequence using (local) variables: please refer to http://forums.ni.com/t5/NI-TestStand/NewExecution-sequenceArgsParam/td-p/2363606 for more information.
In this particular case, it turned out that TestStand seems to feature a kind of "dynamic parameter injection". Please refer to the sequence file attached as an example of this (AFAIK undocumented?) feature.
The type changed I have described in an earlier post is still not explainable.
Please ignore the the earlier attchement. due to some missing links to Typedef Properties, it won't work. The current one features TestStand types only.
Cheers
Oli