NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to kill testexec.exe from commandline ?

I am writing a perl application to kill & restart test stand if something goes wrong( an irrecoverable error)
To start the test stand from the application I am using testexec.exe(VB). However if I try to kill this testexec.exe on the occurence of an exception or some other event, it does not work? How can I kill a testexec.exe (while it is executing a sequence file)from command line? Manually terminating the process from the taskmanager however always works.
0 Kudos
Message 1 of 9
(5,103 Views)
Hi,
It is not recommended that you try to kill the TestExec.exe process from the command line. It may leave your code modules in a bad state and will not properly clean up anything that has been done. Ideally, you should have a button that terminates or aborts execution by making an API call to the Engine.

However, if you still wish to end the program from the command line, it is not any different than any other process that would be running on Windows (supposing there is such a way). There is nothing special about Testexec.exe that will allow it to somehow recieve a command to terminate nicely.

Allen P.
NI
0 Kudos
Message 2 of 9
(5,071 Views)
Thanks for the reply!
The problem is : if I try to kill testexec.exe from command line , it throws
a popup saying "Can terminate while a sequence is running".
This doesnot happen if I try to terminate the process from taskmanager.

I wanted to implement an external watchdog
to keep track of batch tests & restart teststand if all ways of recovering from the
error, from within the master sequence file in teststand, fail.

This will happen only in extreme cases but I wanted to ensure
a batch executable to recover from any exceptions thrown by teststand.

Is there any work around for the above. I am using the windows kill utility
to kill testexec.exe
0 Kudos
Message 3 of 9
(5,061 Views)
sorry! the error message is 'Can't terminate testexec while a sequence is running'!!
0 Kudos
Message 4 of 9
(5,060 Views)
Try using the -f argument for kill, like "kill -f processid".
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 9
(5,053 Views)
Hello Allen,
 
I'm trying to develop an "automation" package that'll include teststand. I will be invoking teststand with commandline and will want to close it 
and reopen it again several times during the execution. I use testexec to start the TestStand app. But from then on...I do not have any
control over TestStand...(like a handle...etc..) so that I can get the results of the tests executed to be added to some file...etc...etc...
 
Also I do not know how to close the TestStand App once it runs....
 
Can you please give me any pointers on this?
 
Your help is greatly appreciated.
 
thanks,
Naveen
0 Kudos
Message 6 of 9
(4,813 Views)

Hi Naveen,

Its not quite obvious what you are trying to accomplish. There are several command line options for TestStand that you can use to run sequences, sequence files, entry points, and quit applications.  Refer to the TestStand Help with the search of CommandLineArguments under the Index tab.

If you are trying to send the test results to a file once you have completed your execution, simply add some extra code to your sequence file or your operator interface that writes to a file.  If this isn't what you are trying to accomplish, let us know.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 7 of 9
(4,775 Views)
Jonathan,
 
Thanks a lot. That helped me a lot to progress further. We have an in-house automation tool that talks to a lot of devices and
automates them in a predefined sequence. And TestStand is one of the packages that we use for testing.
 
We want to start TestStand with a sequence, run it and and then collect the results onto a file so that they can be processed
internally. Now the starting, executing and closing the TestStand is working (thanks to you).
 
You mentioned to me that to send the results on to a file (preferably in text format i.e. non-HTML format), I need to simply add extra
code to my sequence. I'm thinking this would be another step in the sequence. Can you please provide me such a code
snippet if you have one? I'm new to TestStand and I don't quite understand how to add this myself or about the operator interface that
writes to a file, that you mentioned to me.
 
thanks,
Naveen
0 Kudos
Message 8 of 9
(4,769 Views)
Hi Naveen,
 
One of the report options is to send the results of the TestStand sequence to a .txt file. This option is under Configure >> Report Options. From there you can choose different formats to output your data in. You could even go a step further and have the report that is generated open up in an environment such as Microsoft Word or Excel. Under the Configure menu, you will see the External Viewers option. From here you can select, for example Microsoft Word to open up your results if the report format is a .txt file. 
 
This is the best method to store the results and is one of the coolest features of Teststand.
 
Hope this helps!
 
Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 9 of 9
(4,765 Views)