NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to terminate TestStand Application after a LabView error.

Solved!
Go to solution

We've just started launching TestStand from a command line, and when it (TS) stops sequence execution due to a LabView error, the command window doesn't know its status. So, I have a two part question:

 

1) Is there a way to COMPLETELY STOP the TestStand application when a LabView error is encountered? (I have been able to get the error popup to stop, but TestStand is still active and the command line is still sitting there thinking everything is fine).

 

2) Assuming that there is a solution to #1, is there also a way to get LV or TS to report the error to an external command prompt or batch file?

 

 Thanks,

 

   - Paul Iovanna

0 Kudos
Message 1 of 20
(8,386 Views)

Hi Paul,

 

In case your using a operator interface instead of sequence editor, I can suggest you a method to do this.

 

You can use the SequenceFilePostStepRuntimeError callback in your sequence.You can report the error in this callback. You will have to trigger a user event in this callback, which will be captured by the event structure in the operator interface to quit the application. Look at the user interface code "\TestStand 4.1\UserInterfaces\Full-Featured\LabVIEW" in the following location to do this. At the end of the callback you can terminate all the executions using the TestStand API RunState.Engine.TeraminateAll(). I think this should work.

 

Thanks 

0 Kudos
Message 2 of 20
(8,368 Views)

Paul -

 

Perhaps you can provide a simple example of what your doing via some attached files. I would prefer to take a step back and get an understanding of what your overall goal is. What is the purpose of launching TestStand from the command line? Perhaps there is a different way to accomplish your goal.

Manooch H.
National Instruments
0 Kudos
Message 3 of 20
(8,346 Views)

Hi Manooch,

 

We've managed to get the TestStand sequence to stop when we want it to (by using the /quit option in the command line), but now we can't seem to get Reports to generate.

 

Specifically what we are doing is including a particular test sequence in a fully automated Build/Test/Report system. After an automated build of our product completes, we have tools and command files that load all appropriate code into the various components of our system, and then we lauch a TestStand sequence that exercises much of the newly imaged system. Since we are running from the command line - and that command line is being monitored by other processes within our Build/Test/Report system, we need to have TestStand stop AND exit, or else the command line just hangs.

 

So, we really need two things to happen:

 

1) Get TestStand to stop execution AND exit - and we seem to have this working.

 

2) Report the results from the test sequence:

 

   - We have no problem doing this when the Sequnce Editor is launched directly, and the sequence is started from its GUI.

   - However, when we use the command line to launch the sequence via your "TestExec.exe" - there's no report! All of the Report Options settings are the same as for the Sequnce Editor GUI.

 

So, at a minimum, we need to get the usual report to be generated and saved when we launch from the command line - and the preferred option would be to have any error codes from TestStand (or LabView, since the test sequence uses only LV steps) reported directly to the stdout, in this case the command line.

 

Hopefully that explains our setup and requirements a little better - and thanks in advance for the assistance.

 

FYI - TestStand version 4.1.1 running on Windows XP.

0 Kudos
Message 4 of 20
(8,337 Views)

Paul -

 

I wonder what command line arguments you are passing. Are you running the Test UUTs or Single Pass entry point or are you simply running the sequence using the Run Sequence entry point? Reports are not generated when using the Run Sequence entry point. For example:

 

"<TestExec.exe full path>" /run "<name of sequence>" "<sequence file full path>" /quit

 

Will not generate a report ever (unless you've included reporting in the sequence that you execute).

 

However:

 

"<TestExec.exe full path>" /runEntryPoint "<name of entry point>" "<sequence file full path>" /quit

 

Will generate a report if reporting has been enabled. Hope this helps. Please let me know.

Manooch H.
National Instruments
0 Kudos
Message 5 of 20
(8,334 Views)

Manooch,

 

As you suggest, I'm using the former command - that is, not using EntryPoints. I've inherited a sizable sequence file of LabView tests, and I don't believe that there are any Entry Points in it.

 

As I'm less than a novice at TestStand, can you point me to some examples or articles that might suggest how I can adapt the Sequence File that I'm using to include Entry Points? I messed around with this a bit on my own, but no luck so far...

 

Thanks,

 

   - Paul Iovanna

0 Kudos
Message 6 of 20
(8,316 Views)
Solution
Accepted by topic author paulio

Hi Paul,

 

You don't have Entry Points within your client sequence file, those belong in your process model. Think of your process model as the overall test framework and the client sequence file as a test routine for testing specific UUTs. Whenever you execute a sequence, typically you execute a client sequence file using a process model. The process model (such as the SequentialModel.seq) contains the Entry Points (such as Configuration and Execution) and you start your execution from one of these entry points. The sequences within a client sequence file are executed using Callbacks that are located within the process model. 

 

The TestStand class goes through all this information in depth, but you can start by reading Chapter 2 of the Using TestStand manual that ships with TestStand.

 

I hope that helps some. 

Message 7 of 20
(8,300 Views)

There is an online version of that manual here: http://digital.ni.com/manuals.nsf/websearch/42E450026C31466C8625755C00582960

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 8 of 20
(8,297 Views)

Thanks to all for the assistance. Ultimately, the following command syntax worked (that is, allowed reports to be automatically generated and stored):

 

seqEdit.exe /runEntryPoint "SinglePass" <full path to sequence file> /quit.

0 Kudos
Message 9 of 20
(8,265 Views)

I have a query: what if we want to run another teststand sequence after completion of first teststand sequence without closing teststand through command line? Is there any possibility that we can know the execution state of teststand and based on execution state we can command for next seqeunce to execute?

 

I know Execution.getstate() will give us states, but not sure how to get that done in Labview.

0 Kudos
Message 10 of 20
(8,098 Views)