Parallel port monitoring

Chris Liechti cliechti at gmx.net
Sun Aug 3 12:47:47 EDT 2003


Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote in
news:m7duv-uk3.ln1 at beastie.ix.netcom.com: 

> Mark Daley fed this fish to the penguins on Friday 01 August 2003
> 09:38 am:
>> I've read many threads regarding parallel port manipulation, but is
>> there anything that can simply monitor what's happening on the
>> parallel port, and
>> perhaps react to certain events on said port?  I would much rather do
>> that than simply program a preset wait time.

dpends what you mean with events... depending on the parallelport mode and 
which pins you use, thee are no interrupts available. so that you need to 
do polling and wont be able to detect short events.

>         You are using M$ Outlook to post... Are you using W9x or an NT
> derivative (NT, 2K, XP)?
> 
>         On the latter, low-level access to the I/O port addresses
>         requires 
> privileged drivers... the W9x line still allows user programs to do 
> direct I/O port access... So the next question would be "Does Python 
> have a library that allows for machine code access to "in" and "out" 
> instruction.

yes it has :-)
i have a modules on http://pyserial.sourceforge.net/pyparallel.html
it works on win nt/2k/xp and 9x/me (linux under slow developement)

>         Not sure, but I suspect Linux also puts those in the
>         privileged mode. 

there is the ppdev kernel module for the parallelport, or you can access it 
with ioctls and ioperms.

>         These also ignore such things as USB -> Parallel adapters.

yep, but as there is no parallelport abstraction in Windows and not on all 
linux (not all have ppdev) there isn't much choice :-(

chris 



-- 
Chris <cliechti at gmx.net>





More information about the Python-list mailing list