NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiving live status of sequence in TestStand

Hi There, 


I'm new to TestStand, and I'm asking if there is a plug-in or some other tool ( API for example ) that can give you access to the live status of the TestStand sequencer. 
Something like: => the sequence is Running or stopped, or there is an error in the sequence. this kind of informations.

Thank You.

0 Kudos
Message 1 of 8
(1,389 Views)

Hi Hanoub,

 

Short answer: Yes.

 

Long answer: there's a few ways with the API to get execution status, which depend on where you're asking from:

From the Test Executive Application:

GetRunState Method

Syntax

ApplicationMgr.GetRunState ( exec)

Return Value

ExecutionRunStates

Use the following constants with this data type:

  • ExecRunState_Paused–(Value: 2) The execution is suspended.
  • ExecRunState_Running–(Value: 1) The execution is running.
  • ExecRunState_Stopped–(Value: 3) The execution has finished executing.

 

and 

GetTerminationState Method

Syntax

ApplicationMgr.GetTerminationState ( exec)

Return Value

ExecutionTerminationStates

Use the following constants with this data type:

  • ExecTermState_Aborting–(Value: 4) TestStand is aborting the running execution.
  • ExecTermState_KillingThreads–(Value: 5) TestStand is ending the threads in the execution.
  • ExecTermState_Normal–(Value: 1) The execution is not terminating.
  • ExecTermState_Terminating–(Value: 2) TestStand is terminating the running execution.
  • ExecTermState_TerminatingInteractive–(Value: 3) TestStand is terminating the running interactive execution.

If you're looking to get it from an execution of a sequence or via the process model:

GetStates Method

Syntax

Execution.GetStates ( runState, termState)

Purpose

Returns the current state of the execution.

 

I hope this helps.

Message 2 of 8
(1,381 Views)

You might be interested in SystemLink, specifically SystemLink Test Module:

https://www.ni.com/en-us/shop/electronic-test-instrumentation/add-ons-for-electronic-test-and-instru...

 

SystemLink does this by using a results processing plugin in TestStand to send data through the SystemLink client back to the server. You could use a similar approach and write your own plug-in if you don't want to use SystemLink but I would definitely encourage you to check it out... it solves a lot of the hard problems you're likely to run into (intermittent connectivity, authentication, etc...)

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
Message 3 of 8
(1,374 Views)

Hi Capitain_Jack 

it's really helpful all the suggestions you've mentioned above, I'm positive that by using a custom solution (3rd party solution) the application could be achieved successfully using those methods.


What I'm trying to achieve is to continuously send the status of the TestStand sequencer to a Local server to see it TestStand is free or still running, or even mentioning an error, etc... . That's why I'm asking if there is a clean way to do it, using a plugin or something developed already by NI.

Thank You, your answer was very helpful 😉 

0 Kudos
Message 4 of 8
(1,372 Views)

Thank You Mr. WireWeaver,

Well, the SystemLink Test Module seems to be a great solution, but due to the licencing fees, we cannot go any further with this solution. 
What I found instead is the use of the native UI Messages that are sent continuously by TestStand Engine & Process Models to the User Interface. 
The problem is that I don't know how to implement HomeMade Man-in-Middle API in order to get this information and send them to my local server.

Hanoub_0-1605027733891.png

 



0 Kudos
Message 5 of 8
(1,311 Views)

I know this thread is a few years old but are there any TestStand.seq file EXAMPLES out there ANYWHERE that I can use to implement these 3 methods?

 

The TestStand "Examples" folder does not show anything and I am not an expert enough in TestStand to understand how to write the expression.

 

1.   GetRunState

2.   GetTerminationState

3.   GetStates

0 Kudos
Message 6 of 8
(540 Views)

To clarify: the purpose of there API commands is to enable other applications like operator interfaces to interact with the TestStand Engine.

 

So some of this stuff can be found IIRC in the operator interface examples that come with TestStand

0 Kudos
Message 7 of 8
(530 Views)

I found something of an example here: https://forums.ni.com/t5/Example-Code/Determining-the-Termination-Status-of-a-TestStand-Execution/ta... 

 

//pass 0 for the RunState parameter because we are not using it
RunState.Execution.GetStates(0, Locals.TermState)

 

Just advocating for more/better examples available for TestStand.seq steps like there is for LabVIEW.vi's.

0 Kudos
Message 8 of 8
(506 Views)