NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access Subsequences/callees properties?

Is there any method to access properties or variable directly from caller to callee, without using parameter and global variable?
0 Kudos
Message 1 of 6
(3,768 Views)
Hi km9394,

Yes, use the Lookup string RunState.caller.RunState..

For each level of call you would add 'RunState.Caller.'

If you run a SequenceFile using the process model and you were a step inside the MainSequence of your SequenceFile.
The order of the properties would be
RunState. - this would be for the SequenceFile MainSequence.
RunState.Caller.RunState. - this would be for the ProcessModel.

Therefore if your step wanted to get the name of the Step of the caller then the expression would be Locals.CallerName = NameOf(RunState.Caller.RunState.Step) would return "MainSequence Callback"

Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 6
(3,768 Views)
May be my question is quite misleading. If I want to get the property of a subsequence that the current sequence will call (Callee, not caller), is it possible?
0 Kudos
Message 3 of 6
(3,768 Views)
Hi km9394,

Yes, RunState.SequenceFile.Data.Seq[0] (this is usually the MainSequence).
Therefore if you ahave a sequencefile with two sequencecalls eg MainSequence and SubSequence. Then the expression called somewhere in MainSequence
'RunState.SequenceFile.Data.Seq[1].Locals.MyBoolean = True' will set the local boolean in SubSequence.


I have attached an example. In the MainSequence a step changes the value of Locals.MyResult in SubSequence from 10 to 16.

But once this has been changed it will always be set to 16. I haven't changed the ChangeCount so thats why the editor doesn't think the sequencefile has been changed.


Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 6
(3,768 Views)

So this thread is ancient, but I still found it helpful.  It was also useful to know that you can use the Step.StepIndex parameter instead of hardcoding the index to the subsequence you're calling, like so:

 

RunState.SequenceFile.Data.Seq[Step.StepIndex].Requirements.Links[0]

 

I'm using this to customize the TestStand report to include the requirement property listed under that subsequence.

0 Kudos
Message 5 of 6
(3,200 Views)

Correction, using Step.StepIndex as in my above post doesn't make any sense, it was only working by coincidence.  The following is what I wanted, using the name of the callee as the index:

 

RunState.SequenceFile.Data.Seq[Step.Module.SeqName].Requirements.Links[0]

0 Kudos
Message 6 of 6
(3,195 Views)