From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the current sequence name with TestStand API?

Solved!
Go to solution
Hi, I want to get the current sequence name programmatically with TestStand API, Can it be achieved?thanks
0 Kudos
Message 1 of 9
(10,031 Views)

Hi,

 

Using the Sequence File as a reference, you can use SequenceFile.Path to return a string containing the full path to the sequence file. You will then have to strip off the Sequence File filename and extension.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 9
(10,028 Views)
Solution
Accepted by topic author Achilleus

To get the current sequence name you can use the expression: NameOf(RunState.Sequence)

 

Or with the TestStand API you can get the Name property from a reference to the sequence.

 

Hope this help,

-Doug

Message 3 of 9
(10,016 Views)

Hi,

I want to get the status of the sequence programmatically, even if when the sequence is terminated. I get the knowledge if the sequence is passed or failed using the RunState.SequenceFailed property but unfortunately I could not find a property that tells if the sequence is terminated or not. I will be glad if you can help me.

 

Thank you.

 

 

0 Kudos
Message 4 of 9
(9,883 Views)

tsiltu,

 

The termination state is not stored with each sequence.  When you terminate, you are terminating the entire execution, and all threads in it.  You could use Execution.GetStates() to get the current termination state.

 

However, you don't mention why you want to get this information.  If you are looking to get it inside of a code module, or in a TestStand step, then this is the proper way to go about it.  However, if you are getting this information in a User Interface, there are better ways.

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 5 of 9
(9,860 Views)

John,

 

I want to get this information in a TestStand step. I will try the method you mentioned.

Thank you

 

Tugba Siltu | ASELSAN

 

0 Kudos
Message 6 of 9
(9,850 Views)

Tugba,

 

I just want to add that if you are trying to monitor for termination within your step you should use the following API instead of GetStates().

 

Execution.InitTerminationMonitor()

Execution.GetTerminationMonitorStatus()

 

Please see the help file for more information.

 

-Doug

0 Kudos
Message 7 of 9
(9,836 Views)

Many thanks man, you're awesome 

Message 8 of 9
(4,028 Views)

RunState.SequenceFile.AsPropertyObjectFile.DisplayName

 

or

 

RunState.Caller.SequenceFile.AsPropertyObjectFile.DisplayName

Message 9 of 9
(1,783 Views)