Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL Expect program works, can't port over to TK for GUI

Status
Not open for further replies.

slodahl

Technical User
May 13, 2009
1
I've got a Tcl script that does some tests on hardware, and it works okay but I'd like to add a GUI and am having issues. The Tcl script interacts with a UART by spawning, then sending a command (using send), and then expecting a response from the hardware (using expect). As soon as I require the Tk package, the send command no longer allows me to send packets commands to the UART, since a new send process is loaded for Tk.

The code in question:
...
spawn -noech $uart "host=$host" "port=$port"
set $pid $spawn_id
send -i $pid "$cmd\r"
expect {
-i $pid
{...

The error code when package Tk is loaded:
bad option "-i": must be -async, -displayof, or --

Please let me know if you know of a workaround here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top