NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

aborting script execution (tcl exit)

I would like abort the execution of my TCL script when a variable changes its value. I use the "exit" command. This work well in Labview, but in TestStand occur a Error: "System Level Exception Error Code: -17502". Can I use other TCL command? Can I ignore this TestStand Error? Or I should re-write my script?
Thanks
0 Kudos
Message 1 of 4
(9,821 Views)
Hello Marcio,

Using the exit command terminates the current process and stops all computations. TestStand is throwing the 17502 error as a result of the Tcl_EvalFile function failing. This is TCL function that is used to pass a TCL script to the interpreter for evaluation (execution). Creating a stand-alone Win 32 application produces the same behavior. I am not sure what LabVIEW is doing, but the TCL C interface cannot process any scripts that have the exit command embedded in them. Maybe there are some other functions that must be called in order to get this script working correctly. A post to a TCL developer exchange site may provide some more info as to what is going wrong.

Bob Muppets
0 Kudos
Message 2 of 4
(9,821 Views)
Hi Marcio,

This is one of the challenges of automating scripting languages that weren't initially intended to be automated. I have seen similar challenges when calling PERL scripts that use exit functions. It IS possible to call these PERL scripts, but requires calling them in a slightly different way from TestStand. Here is a link to an example that discusses how to call PERL scripts with Exit functions from TestStand. You may be able to do something similar with TCL.

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3EC6656A4E034080020E74861&p_node=DZ52236&p_submitted=N&p_rank=&p_answer=&p_source=External
0 Kudos
Message 3 of 4
(9,821 Views)
Thanks Richard!
But, to run Perl Script with "exit" command, is used a "Call Exe" TestStand Step (I saw it in the Perl example above) instead a "Call Perl Script" Step.
To use "Call Tcl Script" instead "Call Exe" is more easy and practical to send/read variables to/from Tcl script.

I've noted that some commands which causes errors in the script execution, as a invalid command or "puts stdout" command, terminate the script execution but don't cause errors to TestStand.
0 Kudos
Message 4 of 4
(9,821 Views)