ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling sequence (callback)

Solved!
Go to solution

Hello, Sequence No. 1 calls sequence No. 2 and sequence No. 2 calls sequence No. 3. I want to retrieve the name of the calling sequence (sequence N ° 1) from sequence N ° 3 without modifying the sequence N ° 1. If anyone can give me a method to retrieve this information. Thank you in advance.

---------------------------------------------------------------------------------------------------------------------------

Bonjour,

La séquence N°1 appelle la séquence N°2 et la séquence N°2 appelle la séquence N°3.

Je souhaite récupérer le nom de la séquence appelant (séquence N°1) depuis la séquence N°3 sans modifier la séquence N°1.  

Si quelqu'un peut me donner une méthode  pour récupérer cette information.

 

Merci d'avance.

 

Exemple

0 Kudos
Message 1 of 5
(3,285 Views)

RunState.Caller.RunState.Caller.Sequence.Name or maybe

RunState.Caller.RunState.Caller.SequenceFile.Path

0 Kudos
Message 2 of 5
(3,263 Views)

Thank you for your answer #James_Grey
Your solution function if we know the number of sub-sequence but I want a method that goes back automatically until the sequence call

 

 

0 Kudos
Message 3 of 5
(3,247 Views)
Solution
Accepted by Yannick69

@Yannick69,

 

You could also use Thread.CallStackSize to get the size of the call stack and then Thread.GetSequenceContext to get the SequenceContext that you need.

 

Cheers,

Ryan C.

0 Kudos
Message 4 of 5
(3,236 Views)

 @RandallCrandall'sCandleHandle RandallCrandall'sCandleHandle

Thank you for your answer. it works very well

0 Kudos
Message 5 of 5
(3,209 Views)