キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Call Stack Navigation

Hi,
 
I want to go navigate trough my call stack starting from the very top level like this: Runstate.Root.Runstate -> going down to where my execution is actually running ...
 
How can I do this?
 
Thanks,
0 件の賞賛
メッセージ1/10
7,575件の閲覧回数

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

Regards
Ray Farmer
メッセージ2/10
7,562件の閲覧回数

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

 

0 件の賞賛
メッセージ3/10
7,560件の閲覧回数
Hi,
 
Using the RunState.CallStackDepth, create a loop and appended to the lookup string n number of 'Caller.RunState' to get to the bottom.
 
Regards
Ray Farmer
Regards
Ray Farmer
メッセージ4/10
7,551件の閲覧回数

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,

KyleP
Applications Engineer
National Instruments
0 件の賞賛
メッセージ5/10
6,965件の閲覧回数

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

 

Manu.net
0 件の賞賛
メッセージ6/10
6,831件の閲覧回数

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

メッセージ7/10
6,821件の閲覧回数

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;

0 件の賞賛
メッセージ8/10
6,639件の閲覧回数

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:

http://zone.ni.com/reference/en-XX/help/370052G-01/tsapiref/reftopics/sequencefile_getmodelsequencef...

 

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!

Michael Keane
National Instruments
0 件の賞賛
メッセージ9/10
6,603件の閲覧回数

Thank you KeaneSensesスマイリー 平静

0 件の賞賛
メッセージ10/10
6,499件の閲覧回数