Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
serial input - with MS windows

Posted by TimT (TimT), 24 January 2005
I am trying to setup the serial port for use with windows
The port is via the USB and looking at the settings it is com5

In Linux I have defined it using the code:

set fp [open /dev/ttyUSB0]
fconfigure $fp -blocking 1 -buffering none

In Windows I have deflined it as:

set fp [open com5]
fconfigure $fp -blocking 1 -buffering none

It comes back with the error:
couldn't open "COM5": permission denied while executing
"open COM5"

What do I have to do to get permission?
[I am using win98 if that makes any difference, it will be used on an old 98 machine]
thanks


Posted by TimT (TimT), 23 February 2005
To  set up the serial port for windows use:

set rsport [open com1: r+]
fconfigure $rsport -mode "9600,n,8,1" -blocking 0 -buffering none


tim

Posted by Dimon (Dimon), 1 February 2006
on 02/23/05 at 17:07:03, TimT wrote:
To  set up the serial port for windows use:

set rsport [open com1: r+]
fconfigure $rsport -mode "9600,n,8,1" -blocking 0 -buffering none

- Yes, it's true. And I have a question about opening virtual COM ports with names over then COM10. As  known, Tcl has a predefined names for serial ports starting from COM1 and endind with COM10.  Is it possible to open and work with serial ports like COM11, COM12 etc?
- I can run command set rsport [open COM11 r+] and get file ID but cannot operate with that file descriptor like with port. For example, when I try to run
fconfigure $rsport -mode
- I recieve an error:
bad option "-mode": ........

And the 2-nd question: is it possible to open and work with USB devices with Tcl?
Any ideas?

Posted by admin (Graham Ellis), 1 February 2006
on 02/01/06 at 10:32:12, Dimon wrote:
And the 2-nd question: is it possible to open and work with USB devices with Tcl?
Any ideas?


You always ask really difficult questions!  

I'm sure it could be done by extending Tcl using some C, but as for doing it directly from Tcl ... it's probably do-able with the Active State version but I wouldn't know how;  I'm not enough of a Windows expert, I'm afraid



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho