Board index » delphi » Parallel Port/ CreateFile()

Parallel Port/ CreateFile()

Hi,
   I need some help putting data out through the parallel port.  I am
using Win98.   I  tried using the outportb() function, but it doesn't
work so well.  It will output one data byte  upon program termination,
and then only after running the program twice.  I've read that this is
an operating system problem and that the better route to take is to
create a HANDLE via CreateFile.  Fine.  Can someone show me how to do
this?  That is, specify all the DCB structure settings and CommTimeOuts
and what not for the parallel port?   All this "abstraction" stuff is a
nightmare when it comes to trying to do something as basic as writing to
the parallel port.
Thanks,
Phillip
 

Re:Parallel Port/ CreateFile()


Phillip,

Quote
> I  tried using the outportb() function, but it doesn't
> work so well.

.and in case you don't already know it won't work at all under WinNT
or Win2K.

Andrue Cope
[Bicester, UK]

Re:Parallel Port/ CreateFile()


Hi Phillip

If you really want direct port access under Windows
go to http://www.internals.com and take a look
at WinIO. Use with care!

I've used it myself for controlling a device connected to the
parallel port and it worked just great.

Eudy

Re:Parallel Port/ CreateFile()


I used outport() for the same purpose  and it worked fine.  Once it
sends something to the port, it keeps
sending it until you output something to stop it.

Steve

Quote
Phillip Cervantes wrote:
>Hi,
>   I need some help putting data out through the parallel port.  I am
>using Win98.   I  tried using the outportb() function, but it doesn't
>work so well.  It will output one data byte  upon program termination,
>and then only after running the program twice.  I've read that this is
>an operating system problem and that the better route to take is to
>create a HANDLE via CreateFile.  Fine.  Can someone show me how to do
>this?  That is, specify all the DCB structure settings and CommTimeOuts
>and what not for the parallel port?   All this "abstraction" stuff is a
>nightmare when it comes to trying to do something as basic as writing to
>the parallel port.
>Thanks,
>Phillip

Re:Parallel Port/ CreateFile()


outport() and inport() should only work under Win16. Outport() doesn't
continue to send. Rather, it sends once to a latch at the data outputs
of the port. Once the data is latched there, it remains there until
overwritten by another outport() or some other application that uses
the port.

Cheers
Glenn

Quote
steve <steve...@hotmail.com> wrote:
>I used outport() for the same purpose  and it worked fine.  Once it
>sends something to the port, it keeps
>sending it until you output something to stop it.

>Steve

>Phillip Cervantes wrote:

>>Hi,
>>   I need some help putting data out through the parallel port.  I am
>>using Win98.   I  tried using the outportb() function, but it doesn't
>>work so well.  It will output one data byte  upon program termination,
>>and then only after running the program twice.  I've read that this is
>>an operating system problem and that the better route to take is to
>>create a HANDLE via CreateFile.  Fine.  Can someone show me how to do
>>this?  That is, specify all the DCB structure settings and CommTimeOuts
>>and what not for the parallel port?   All this "abstraction" stuff is a
>>nightmare when it comes to trying to do something as basic as writing to
>>the parallel port.
>>Thanks,
>>Phillip

Other Threads