So I need to communicate with a serial port using tcl/tk 8.3 but am having a problem: when I try to send data down it, nothing happens. Also, when I try to use fconfigure to set the mode of the serial connection, I get an error that -mode is not a valid argument, as if the program does not recognize it as a serial port. I am using a machine that runs on Red Hat Linux.
This is the code I'm using:
-------------------------------
set port [open /dev/ttyS4 w+]
#I also tried options w and r+ with no better results
fconfigure $port -mode "9600,n,8,1"
#didn't work so I remove it to try writing to the port as is...
puts $port "pos=1\n" #output command to port
-------------------------------
That command should set the device in position one, but the device does not respond at all. Also, in this way when I try to read from the port:
set myData [read $port 1] ## Just read 1 char.
The program just freezes. Is there anything I'm doing wrong?
This is the code I'm using:
-------------------------------
set port [open /dev/ttyS4 w+]
#I also tried options w and r+ with no better results
fconfigure $port -mode "9600,n,8,1"
#didn't work so I remove it to try writing to the port as is...
puts $port "pos=1\n" #output command to port
-------------------------------
That command should set the device in position one, but the device does not respond at all. Also, in this way when I try to read from the port:
set myData [read $port 1] ## Just read 1 char.
The program just freezes. Is there anything I'm doing wrong?