Implementing Parallel Port Writing & Reading

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Tue, 03 Aug 1999 04:00:00



How can I access the parallel port under windows ce.
Something like
ofstream optr("LPT1", ios::out);  would be nice, but there is no
fstream and iostream lib.
I tried also something with CreateFile(TEXT("LPT1:"), ...) but it
doesn't work. At least not the way I wrote it.
The Documentation of the CE Toolkit and the Platform Builder is so poor
and I 'm missing some good books.
I have the book of Douglas Boling but is helped me not a dime !!

Thanks for any good hint or advice where to look :-)

Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by Tim Gregso » Tue, 03 Aug 1999 04:00:00


What platform are you developing for?  HPC, PSPC, custom PB built, etc?
What sort of Parallel port does your machine have (my PSPC doesn't have one
at all)?  Do you have a driver installed for the parallel port that provides
the stream based (LPT1) interface?  If you are making a custom platform, and
you have a parallel port in it, then you will need to write a driver for it
(or modify one of the sample drivers in the PB).

Tim



Quote:> How can I access the parallel port under windows ce.
> Something like
> ofstream optr("LPT1", ios::out);  would be nice, but there is no
> fstream and iostream lib.
> I tried also something with CreateFile(TEXT("LPT1:"), ...) but it
> doesn't work. At least not the way I wrote it.
> The Documentation of the CE Toolkit and the Platform Builder is so poor
> and I 'm missing some good books.
> I have the book of Douglas Boling but is helped me not a dime !!

> Thanks for any good hint or advice where to look :-)

> Ciao Sven


 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Wed, 04 Aug 1999 04:00:00


Quote:> What platform are you developing for?

It is custom build x86 for PC104 Module

Quote:> What sort of Parallel port does your machine have:

ECP and EPP is possible !

I implemented the parallel.dll into the build system. As far as I
understood (see Device Driver List in Online Help) this is for CEPC
enough to use commands like CreateFile or PrinterOpen or StartDoc.
Am I wrong ?? Where do I find helpful information about this topic.

Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by Jeff McLema » Wed, 04 Aug 1999 04:00:00


Did you put the appropriate registry entries in the platform.reg file?

If so, run a registry editor and see if the parallel port is active under
HLM\Drivers\Active

jeff



Quote:

> > What platform are you developing for?

> It is custom build x86 for PC104 Module
> > What sort of Parallel port does your machine have:

> ECP and EPP is possible !

> I implemented the parallel.dll into the build system. As far as I
> understood (see Device Driver List in Online Help) this is for CEPC
> enough to use commands like CreateFile or PrinterOpen or StartDoc.
> Am I wrong ?? Where do I find helpful information about this topic.

> Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Thu, 05 Aug 1999 04:00:00


Jeff McLeman schrieb:

Quote:

> Did you put the appropriate registry entries in the platform.reg file?

> If so, run a registry editor and see if the parallel port is active under
> HLM\Drivers\Active

> jeff

I looked at the registry with remote registry and this is what I got

[HKEY_LOCAL_MACHINE\Drivers\Active\06]
"Name"="LPT1:"
"ClientInfo"=dword:00000000
"Hnd"=dword:00030bec
"Key"="Drivers\\BuiltIn\\Parallel">

AND

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
"DeviceArrayIndex"=dword:00000000
"Prefix"="LPT"
"Dll"="Parallel.Dll"
"Order"=dword:00000000
"IoBase"=dword:00000278
"IoLen"=dword:0000000c
"DeviceType"=dword:00000000
"FriendlyName"="Parallel Cable on LPT1:"
"DevConfig"=hex:\

10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

For me it looks pretty good. But maybe it is not the parallel.dll which
should be included in order to drive a primitive Line Printer ?

Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Thu, 05 Aug 1999 04:00:00


Jeff McLeman schrieb:

Quote:

> Did you put the appropriate registry entries in the platform.reg file?

> If so, run a registry editor and see if the parallel port is active under
> HLM\Drivers\Active

> jeff

I looked at the registry with remote registry and this is what I got

[HKEY_LOCAL_MACHINE\Drivers\Active\06]
"Name"="LPT1:"
"ClientInfo"=dword:00000000
"Hnd"=dword:00030bec
"Key"="Drivers\\BuiltIn\\Parallel">

AND

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
"DeviceArrayIndex"=dword:00000000
"Prefix"="LPT"
"Dll"="Parallel.Dll"
"Order"=dword:00000000
"IoBase"=dword:00000278
"IoLen"=dword:0000000c
"DeviceType"=dword:00000000
"FriendlyName"="Parallel Cable on LPT1:"
"DevConfig"=hex:\

10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

For me it looks pretty good. But maybe it is not the parallel.dll which
should be included in order to drive a primitive Line Printer ?

Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Thu, 05 Aug 1999 04:00:00


Jeff McLeman schrieb:

Quote:

> Did you put the appropriate registry entries in the platform.reg file?

> If so, run a registry editor and see if the parallel port is active under
> HLM\Drivers\Active

> jeff

I looked at the registry with remote registry and this is what I got

[HKEY_LOCAL_MACHINE\Drivers\Active\06]
"Name"="LPT1:"
"ClientInfo"=dword:00000000
"Hnd"=dword:00030bec
"Key"="Drivers\\BuiltIn\\Parallel">

AND

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
"DeviceArrayIndex"=dword:00000000
"Prefix"="LPT"
"Dll"="Parallel.Dll"
"Order"=dword:00000000
"IoBase"=dword:00000278
"IoLen"=dword:0000000c
"DeviceType"=dword:00000000
"FriendlyName"="Parallel Cable on LPT1:"
"DevConfig"=hex:\

10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

For me it looks pretty good. But maybe it is not the parallel.dll which
should be included in order to drive a primitive Line Printer ?

Ciao Sven

 
 
 

Implementing Parallel Port Writing & Reading

Post by mark » Thu, 05 Aug 1999 04:00:00



> Jeff McLeman schrieb:

> > Did you put the appropriate registry entries in the platform.reg file?

> > If so, run a registry editor and see if the parallel port is active under
> > HLM\Drivers\Active

> > jeff

> I looked at the registry with remote registry and this is what I got

> [HKEY_LOCAL_MACHINE\Drivers\Active\06]
> "Name"="LPT1:"
> "ClientInfo"=dword:00000000
> "Hnd"=dword:00030bec
> "Key"="Drivers\\BuiltIn\\Parallel">

> AND

> [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
> "DeviceArrayIndex"=dword:00000000
> "Prefix"="LPT"
> "Dll"="Parallel.Dll"
> "Order"=dword:00000000
> "IoBase"=dword:00000278
> "IoLen"=dword:0000000c
> "DeviceType"=dword:00000000
> "FriendlyName"="Parallel Cable on LPT1:"
> "DevConfig"=hex:\

> 10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

> For me it looks pretty good. But maybe it is not the parallel.dll which
> should be included in order to drive a primitive Line Printer ?

> Ciao Sven

Did you notice that IOBase is 0x278.  0x378 is usually the default
LPT1:  That might be confusing.
--
 Running Linux Kernel 2.2.5
 Fight broadband monopolies - www.opennetcoalition.org
 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Sat, 07 Aug 1999 04:00:00


Thanks I will look at this.

mark schrieb:


> > Jeff McLeman schrieb:

> > > Did you put the appropriate registry entries in the platform.reg file?

> > > If so, run a registry editor and see if the parallel port is active under
> > > HLM\Drivers\Active

> > > jeff

> > I looked at the registry with remote registry and this is what I got

> > [HKEY_LOCAL_MACHINE\Drivers\Active\06]
> > "Name"="LPT1:"
> > "ClientInfo"=dword:00000000
> > "Hnd"=dword:00030bec
> > "Key"="Drivers\\BuiltIn\\Parallel">

> > AND

> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
> > "DeviceArrayIndex"=dword:00000000
> > "Prefix"="LPT"
> > "Dll"="Parallel.Dll"
> > "Order"=dword:00000000
> > "IoBase"=dword:00000278
> > "IoLen"=dword:0000000c
> > "DeviceType"=dword:00000000
> > "FriendlyName"="Parallel Cable on LPT1:"
> > "DevConfig"=hex:\

> > 10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

> > For me it looks pretty good. But maybe it is not the parallel.dll which
> > should be included in order to drive a primitive Line Printer ?

> > Ciao Sven
> Did you notice that IOBase is 0x278.  0x378 is usually the default
> LPT1:  That might be confusing.
> --
>  Running Linux Kernel 2.2.5
>  Fight broadband monopolies - www.opennetcoalition.org

 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Sat, 07 Aug 1999 04:00:00


Your are right. I had the wrong IOBASEADDRESS.
now with 378 in the registry it works.
Thank you very much. I think it save me a couple of additional days,
cause there so many parameters, which can be wrong and I'm ion the very
beginning.
Do you know a good summary about the registry-entries, cause there is so
many differnt kinds of entries, that I guess I will never know what to
enter if I want to add a device by myself.
Example: How to ajust baud-rates of serial ports ?

mark schrieb:


> > Jeff McLeman schrieb:

> > > Did you put the appropriate registry entries in the platform.reg file?

> > > If so, run a registry editor and see if the parallel port is active under
> > > HLM\Drivers\Active

> > > jeff

> > I looked at the registry with remote registry and this is what I got

> > [HKEY_LOCAL_MACHINE\Drivers\Active\06]
> > "Name"="LPT1:"
> > "ClientInfo"=dword:00000000
> > "Hnd"=dword:00030bec
> > "Key"="Drivers\\BuiltIn\\Parallel">

> > AND

> > [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Parallel]
> > "DeviceArrayIndex"=dword:00000000
> > "Prefix"="LPT"
> > "Dll"="Parallel.Dll"
> > "Order"=dword:00000000
> > "IoBase"=dword:00000278
> > "IoLen"=dword:0000000c
> > "DeviceType"=dword:00000000
> > "FriendlyName"="Parallel Cable on LPT1:"
> > "DevConfig"=hex:\

> > 10,00,00,00,05,00,00,00,10,01,00,00,00,4b,00,00,00,00,08,00,00,00,00,00,00

> > For me it looks pretty good. But maybe it is not the parallel.dll which
> > should be included in order to drive a primitive Line Printer ?

> > Ciao Sven
> Did you notice that IOBase is 0x278.  0x378 is usually the default
> LPT1:  That might be confusing.
> --
>  Running Linux Kernel 2.2.5
>  Fight broadband monopolies - www.opennetcoalition.org

 
 
 

Implementing Parallel Port Writing & Reading

Post by tao » Sat, 07 Aug 1999 04:00:00



> Your are right. I had the wrong IOBASEADDRESS.
> now with 378 in the registry it works.
> Thank you very much. I think it save me a couple of additional days,
> cause there so many parameters, which can be wrong and I'm ion the very
> beginning.
> Do you know a good summary about the registry-entries, cause there is so
> many differnt kinds of entries, that I guess I will never know what to
> enter if I want to add a device by myself.
> Example: How to ajust baud-rates of serial ports ?

To be honest, it cost me a day or so <g>.  That's why I remember.
Typically I would think the baud rate is usually set via a DCB in an
app.  I will put together my list of registry tricks soon and post or
send to you
--
 Running Linux Kernel 2.2.5
 Fight broadband monopolies - www.opennetcoalition.org
 
 
 

Implementing Parallel Port Writing & Reading

Post by Dr. Sven Bod » Wed, 11 Aug 1999 04:00:00


Thanks I will look forward to read this list ! :-)

tao schrieb:

Quote:> To be honest, it cost me a day or so <g>.  That's why I remember.
> Typically I would think the baud rate is usually set via a DCB in an
> app.  I will put together my list of registry tricks soon and post or
> send to you
> --
>  Running Linux Kernel 2.2.5
>  Fight broadband monopolies - www.opennetcoalition.org