PredAlien
Newbie level 6
tcl/tk serial communication com1
hi psubiaco
im really stressing out about finding this error about the "flush" command in tcl, it dosn't fluch the out put when i use the following script, thing is it works in the "wish" commmand line when i do it line by line, but dosn't work for when i do the whole thing all at once.
entry .u -textvar "new" ;pack .u
button .y -text "Goooo" -command {serial_proc};pack .y
proc serial_proc {} {
global input #pass_input_LRS pass_input_PL pass_input_UL pass_input_PHOR
#setuot serial port
set serial [open com1 "r+"]
fconfigure $serial -mode "9600,n,8,1"
fconfigure $serial -blocking 0 -buffering full -ttycontrol {RTS 0 DTR 1}
puts -nonewline $serial "A" ;
flush $serial
set data5 [fconfigure $serial -queue]
.u insert 0 $data5
}
-----------------
after all things are done correctley i should have in the entry box the value of {fconfigure $serial -queue} which is somthing like {4 0} input output respectivley, but i get {0 1} which means that flush is not working when i execute the script all at once,
any ideas gurus
hi psubiaco
im really stressing out about finding this error about the "flush" command in tcl, it dosn't fluch the out put when i use the following script, thing is it works in the "wish" commmand line when i do it line by line, but dosn't work for when i do the whole thing all at once.
entry .u -textvar "new" ;pack .u
button .y -text "Goooo" -command {serial_proc};pack .y
proc serial_proc {} {
global input #pass_input_LRS pass_input_PL pass_input_UL pass_input_PHOR
#setuot serial port
set serial [open com1 "r+"]
fconfigure $serial -mode "9600,n,8,1"
fconfigure $serial -blocking 0 -buffering full -ttycontrol {RTS 0 DTR 1}
puts -nonewline $serial "A" ;
flush $serial
set data5 [fconfigure $serial -queue]
.u insert 0 $data5
}
-----------------
after all things are done correctley i should have in the entry box the value of {fconfigure $serial -queue} which is somthing like {4 0} input output respectivley, but i get {0 1} which means that flush is not working when i execute the script all at once,
any ideas gurus