failure using expect with serial line on windows.

  • Follow


Hi

I am using the below tcl version
ActiveTcl8.4.19.1.286921-win32-ix86-threaded

My tcl script opens the serial com port and then uses the file handle
to setup an expect session as shown below.

set serialfd [open $defSerialPort r+]
fconfigure $serialfd -mode 115200,n,8,1
fconfigure $serialfd -blocking 0 -buffering full -buffersize 500 -
encoding binary
spawn -open $serialfd
set ser_spawn_id $spawn_id

But when I am using the expect command to search for a pattern, the
command returns immediately without waiting for the timeout period.

eval expect -i $ser_spawn_id $patlist

When I set exp_internal to 1. I get the below output

expect: does "" (spawn_id exp4) match glob pattern "LTC - Pop up"? no
expect: read eof
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) ""

Sometimes it works fine without any problems. but most of the time it
does not.
I checked on hyper terminal that there is data on the serial line.
Does anyone know how to fix this ?
0
Reply zeus 12/2/2009 6:42:10 AM


0 Replies
297 Views

(page loaded in 0.04 seconds)

Similiar Articles:













7/24/2012 11:58:31 AM


Reply: