11-13-2006 11:47 AM
11-13-2006 03:29 PM
Hi,
The top level is actual the level that is currently executing. the next level is the caller and soon
for example
you are currently in a subsequence called from MainSequence which has been called from Test UUTs
therefore level 2 is your SubSequence found by using RunState. Using NameOf(RunState.Sequence) would give you the name of your SubSequence.
Level 1 is your MainSequence and you would use RunState.Caller.RunState. Using a statement like NameOf(RunState.Caller.RunState.Sequence) in you SubSequence would give you the name of the caller ie MainSequence and level 0 will be the Test UUTs sequence and you would use RunState.Caller.RunState.Caller.RunState.
There is a property that indicates the RunState level call CallStackDepth. When CallStackDepth == 0 then RunState.Caller doesn't exist.
Hope this hepls
Regards
Ray Farmer
11-13-2006 03:52 PM
Thank you Ray,
I was wondering if there is a way to do it from top to bottom (Runstate.Root.Runstate...) instead of from bottom to top (Runstate.Caller.Runstate.Caller. etc)
Do you know if this is possible???
Thanks again
11-14-2006 12:22 AM
09-27-2012 09:46 AM
Hello all,
I found this forum thread while searching for some related information. I just want to post this help document on RunState.Thread.GetSequenceContext as a future reference for others that run into this problem.
Cheers,
06-16-2014 04:03 AM - edited 06-16-2014 04:04 AM
Hello,
Here, in VB.Net, a reccursive function which allows to find the sequence callStack, even for parallel sequence call ...
The idea is to find the caller of the caller ... of the caller reccursivly !
Public Shared Function getCallStack( ByVal sequenceContext As NationalInstruments.TestStand.Interop.API.SequenceContext) As String
Dim result As String = ""
Dim frameId As Integer = 0
Dim caller As NationalInstruments.TestStand.Interop.API.SequenceContext = Nothing
result = sequenceContext.Sequence.Name
caller = sequenceContext.Caller
Do
If caller Is Nothing Then
Exit Do
End If
result = caller.Sequence.Name & "\" & result
caller = caller.Caller
Loop
Return result
End Function
06-16-2014 09:08 AM
You can also do (C# syntax):
int callstackSize = mainContext.Thread.CallStackSize;
string callstackstring = "";
for (int i= 0; i < callstackSize; i++)
{
int frameid;
SequenceContext currentStackItem = mainContext.Thread.GetSequenceContext(i, out frameId);
if (i > 0)
callstackstring+= "\n";
callstackstring+= currentStackItem.CallStackName;
}
Hope this helps,
-Doug
05-18-2015 03:33 AM
Hello,
I develop an application operator of testsrand in c#, and I etulise the order dowry Net, I want to get the current sequence execution in a listview in c#
I do not arrive introduced the code
RunStat.CallStack in my code
here my code
private void btnStart_Click(object sender, EventArgs e)
{
affichageDeroulementTest.Clear();
// Execution de Programmme
myExecution = myEngine.NewExecution(mySqFile,
"Test UUTs", mySqFile.GetModelSequenceFile(out sDummyString), false, 0, null, null, null);
}
Please
it is somebody can help me has recovers the sequence in the course of execution
thank you;
05-19-2015 03:45 PM
As seen in this link, GetModelSequenceFile will get the process model sequence file of "mySqFile," so I'm not sure if that's what you are wanting based on your description:
This also is quite an old thread and I'm not sure how related your question is to the original post, so you might get more visibility on a new thread!
05-26-2015 06:40 AM
Thank you KeaneSenses