(10 dec 2004) Umberto Zanghieri
ZP Engineering srl [1 ] offers the LPTTCL extension for parallel-port access that works on Windows 98, NT, 2K and XP.
We reorganized this page with separate sections for the two versions. Please refer to the lpttcl page for a command reference and some tcl code to start with, along with compatibility notes between the two versions.
LPTTCL ver. 3.0
To overcome some of the limitations of LPTTCL v.1.0, a new wrapper has been added to the Inpout32.dll available at Logix4U [4 ].
This new low-level access library allows you to avoid any installation and uninstall (a great advantage!!) and offers better compatibility on WinXP and on all machines (as we were reported that some desktops did not work properly with rev 1.0). In addition:
Please notice that the new LPT selection mode and the removed requirement for installation allow you to simply copy a few files with a wrapped executable, and you have a perfectly transportable Tcl application with LPT access. We do this with TclKit and Freewrap all the time.
Installation can be as follows: keep both DLLs in your working directory, or copy them on the system32 folder.
Consider that the extension is just released, so please report any issues you may find. In particular, we could not verify proper access with a PCI card; these LPT cards typically require a high base address ( > 1024).
LPTTCL ver. 1.0
There are still reasons to keep the old LPTTCL around: access is a faster, and may be interesting for slower hosts; also for Windows 98 it does not require installation.
A brief summary of its characteristics:
Users have reported that it works correctly under Windows XP, but on some hosts it fails; we could not identify the reason, but in any case the new 3.0 version works fine for the same users.
TV (Nov 21 2003) I just tried it on XP SP1 on a few year old home pc with tcl 8.4.1, and it works fine with your driver and tcl extension. In fact it seems to process about 300 KiloBytes per second, which is hardly slow, in tcl. Do you consider it reasonable to ask for the sources, for instance of the driver? At least the machine I can use isn't in electronic isolation anymore, which is great!
For those interested, I'll make a page on applying the parallel port to drive a LED and read a switch from tcl.
(15 april 2004) Anyone ever try this library with a USB-to-parallel connection ? (I want to know if that could work on a note-book!)
UZ 15 apr04 I never tried, but I think it will not work as LPTTCL works directly on parallel port registers.
On Linux (or any other PC Unix) just open the right device (/dev/parportX, X = 0 for first port, then 1, 2, etc) and then read and write it as you wish for basic access.
Marc van DoornikOn Linux, this doesn't work for me (as root, obviously):
set f [open /dev/parport0 r] set data [read $f]
as it gives me "error reading "file6": invalid argument". When I try this:
set f [open /dev/lp0 r] set data [read $f]
it gives me "error reading "file6": I/O error". So what gives, here?
More-or-less public packages for dealing with parallel ports include dlportio [5 ] and winioport.
Serial port programming is of related interest.