I'm on the point of having to write some code to control a motorised
microscope stage via a serial controller. Has anyone got any code
examples on how to interact with the serial port, I need more than just
the snippets in the manual.
Thanks
Andy
Andy Hunt
Software Engineer
Foster Findlay Associates
# substitute your serial port for com1:, such
# as /dev/ttya on Solaris
set serialPort com1:
proc readData {port} {
if [eof $port] {
close $port
} else {
gets $port
}
}
set port [open $serialPort RDWR]
fconfigure $port -blocking 0 -buffering none -mode 9600,o,8,1
fileevent $port readable [list readData $port]
puts $port "start"
Thanks Scott, of the top of your head is better than off the top of
mine, all I've got is a bald patch that I scratched there :)!
There seems to be a dearth of material on how to do this (at least I've
not found any yet) and quite a few people asking about it. If^H^H When I
get this working I may post some of the relevant bits, assuming I can
take the time off from scratching!