NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem calling Tcl script from TestStand, which contains "package" command

I am attempting to call a Tcl script which loads a Spirent Ax4000 lib using the package command and the call appears to fail when trying to execute that line.  The Tcl script works fine when executed from the Tcl shell.  Any ideas on how to work around this problem?   Is it a problem with the TSTCL.dll?  Can this dll be re-compiled to support the use of package? 
0 Kudos
Message 1 of 15
(6,227 Views)
Hey Apaquett,

I assume you are using the TSTCL.dll from our website which is found at the link listed below.  If you are using that same dll, is the package command the only command that doesn't seem to work?  For example, can you run other tcl scripts without the package command successfully?  Also what version of TestStand and TCL interpretor are you using?

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DA592F2D5ECC311FE034080020E74861&p_node=DZ52236&p_source=External
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 15
(6,201 Views)

I have found a problem in that example that it does not call Tcl_Init before attempting to run a script.  Here is a modified version of the DLL used by the step type.  Replace your existing DLL with this one, and you should be able to load packages.

Allen P.

NI

0 Kudos
Message 3 of 15
(6,138 Views)

Allen,

  I am unable to use the dll which you provided.  When I try to run the NI Tcl example, the Sequence editor window closes with no error messages.  Fatal crash of the application.  I noticed that the dll which you provided is approximately 64Kb in size while the TSTTCL dll I was using was approximately 277Kb.  Do you have any idea why the dll size is somuch smaller for yours?

Thanks

0 Kudos
Message 4 of 15
(6,126 Views)
I apologize about the problem in the new DLL.  I have traced the problem to any function that attempts to write to the console (for example, anything that uses puts).  I am currently investigating a solution for this issue.  Since we are calling the TCL Interpreter from a DLL, there is no console for the TCL commands to send their output.  I will create a new post if I am able to find a solution to this issue.
 
The reason why it is smaller is because I have sent a release version of the DLL, rather than a debug version.
 
Allen P.
NI
0 Kudos
Message 5 of 15
(6,109 Views)

Try this new DLL and let me know if it works for you.  If it does not, can you attach a small TCL script that can reproduce any problems that you see?

Allen P.

NI

0 Kudos
Message 6 of 15
(6,101 Views)
Hi Allen,
 
  I tried the latest dll and I am experiencing the same results.  The Sequence Editor crashes when I attempt to run the NI example Tcl file.  I am currently running TestStand 2, could this be the source of some of my problems?  I have not even attempted to run a script that requires to load a package yet.
 
Thanks for your help.
0 Kudos
Message 7 of 15
(6,097 Views)

Sorry about the misunderstanding.  I was reading the first post, and I thought you were only having trouble with packages.  I have only tested this example using 3.0 and higher so far.  Are you getting any error messages when it is running?

Allen P.

NI

0 Kudos
Message 8 of 15
(6,086 Views)

No error messages.  It just kills the Sequence Editor and the window disappears all together.  I validated the example Tcl sequence with the original dll and it works.  Obviously the "package" command does not work with that version of the dll. 

 

0 Kudos
Message 9 of 15
(6,081 Views)

Hi,

I'm also interested in this, so I hope I can bring this thread back to life.

I want to run a tcl script from teststand, and the NI dll TSTCL.dll looked very promising indeed. However, as apaquett I couldnt get it working with the package command in the tcl file. I have just added the line "package req IxTclHal" to the small example script that came with .dll. IxTclHal is the package I want to load.

The first version of the dll just dont work, no error msg from TS at all.
The second one returns the error "can't find package IxTCLHAL".
The third one returns "Unable to initialize the interpreter" (Error code: -2147467259; User-defined error code. Possible System Error: Unspecified error)

I'm using Teststand 3.1 and tcl83.dll

Any ideas? Right now Im leaning to using labview and calling a external tcl interpreter.

 

Thanks,

David

0 Kudos
Message 10 of 15
(5,810 Views)