[Tutor] Re: Parallel port interface

Jorge Godoy godoy at ieee.org
Sun Apr 25 15:30:26 EDT 2004


On Dom 25 Abr 2004 16:15, Alan Gauld wrote:

>> We're doing a research project that involves controlling
> mini-windtrap
>> speeds and we're reading/writing data from the parallel port.
> 
> For DOS?WIndows have you tried just writing to the LPT: on PRN:
> files?

No, I haven't. And from my previous research, it won't work on all flavours
of Windows. I don't know which one I'll have to run the system on, if I run
it on Windows... 
 
> I doubt that it will be possible, low level I/O is always one of
> the least portable things in an OS, its down at the level of device
> drivers.

I dunno if it's all that hard. There could be some modules that handle the
correct calls on each system. Even something to wrap reads and writes from
the correct ports on the OS would do it. It just need to access those the
right way. 

I just read that there's need for using DLLs on certain versions of Windows
(e.g. 2000, NT) while you can, as you suggested, read/write directly to
PRN: on other (e.g. 95, 98). 
 
> Logical devices like printers can be controlled via a high lrevel
> protocol like lpr but if its the actual port you are controlling
> then I suspect you'll need to write your own interfaces and switch
> according to OS...

I'm just willing to read and set bits as done with inportb and outportb on
C. I'm not willing to have all the work of writing code for each one. :-)
This is some laziness of myself, I admit it, but I can't also test on the
several different flavours of Windows... :-)

>> Any hints for modules I should take a look at?
> 
> If you do find a platform neutral module I'd be interested in
> hearing about it though...

This is just why I've sent the message :-)

I don't imagine that there aren't any modules like that around.

If I find something, I'll let you know.


Thanks for your answer,
-- 
Godoy.      <godoy at ieee.org>




More information about the Tutor mailing list