Discussion:
Opening COM ports >= 10 (eg COM10, COM11, etc.) under MS-Windows
(too old to reply)
Robert Heller
2016-09-05 20:29:45 UTC
Permalink
I have a piece of software that wants to open a serial port (COM port)
[actually a USB psuedo serial port]. This is a pure Tcl program and I am just
using open, fconfigure, gets, and puts (the device is sending and receiving
lines of ASCII text and converting that to/from binary bit streams over a CAN
bus).

Under MS-Windows sometimes the COM port name is something like COM10, and
MS-Windows has a known problem with that -- the underlying MS-Windows file I/O
system wants to treat "COM10" as a actual file and not a device name, since it
is mode the 4 characters. At least that is what appears to be happening.

*I* don't have a MS-Windows machine myself, but I need to be able to support
people using this software on MS-Windows machines. Is there some Tcl "hack" to
deal with this? I have seen that there are "tricks" involving low-level
MS-Windows I/O hackery for this, but I need a pure Tcl solution. The software
in question is cross platform (it is perfectly happy to open /dev/ttyACM0 or
/dev/ttyACM99, if that happens to be the kernel assigned device name under
Linux, and it will open /dev/cu.<mumble> under MacOSX).
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
Brad Lanam
2016-09-05 21:23:37 UTC
Permalink
Post by Robert Heller
I have a piece of software that wants to open a serial port (COM port)
[actually a USB psuedo serial port]. This is a pure Tcl program and I am just
using open, fconfigure, gets, and puts (the device is sending and receiving
lines of ASCII text and converting that to/from binary bit streams over a CAN
bus).
Under MS-Windows sometimes the COM port name is something like COM10, and
MS-Windows has a known problem with that -- the underlying MS-Windows file I/O
system wants to treat "COM10" as a actual file and not a device name, since it
is mode the 4 characters. At least that is what appears to be happening.
*I* don't have a MS-Windows machine myself, but I need to be able to support
people using this software on MS-Windows machines. Is there some Tcl "hack" to
deal with this? I have seen that there are "tricks" involving low-level
MS-Windows I/O hackery for this, but I need a pure Tcl solution. The software
in question is cross platform (it is perfectly happy to open /dev/ttyACM0 or
/dev/ttyACM99, if that happens to be the kernel assigned device name under
Linux, and it will open /dev/cu.<mumble> under MacOSX).
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
http://stackoverflow.com/questions/11775185/open-a-com-port-in-c-with-number-higher-that-9

Try: \\.\COM10

Loading...