Re: Parallel port- byte mode printer read - Working.. Done! by KaruppuSwamy
KaruppuSwamy
Tue Oct 07 00:35:23 CDT 2003
IOCTL_PARALLEL_GET_ECP_CHANNEL32 - this IOCTL does not serve the purpose of
byte mode reading from printer. So we wrote a function to read in Byte mode.
This function was called from LPT_Read after changing the mode to PS/2. It
works well.
Thank you Mr. David, for your support.
"David Liao (MS)" <davli@online.microsoft.com> wrote in message
news:3f78d18d$1@news.microsoft.com...
> You are right, my mistake. Please take look at
> IOCTL_PARALLEL_GET_ECP_CHANNEL32 and make a modification as necessary for
> reading data from specified channel.
>
> David Liao
>
> "KaruppuSwamy T" <swamytk@tandbintl.com> wrote in message
> news:OmLbStNhDHA.2504@TK2MSFTNGP09.phx.gbl...
> > Thank you for quick and prompt reply.
> >
> > But we did not find such CTL CODE (IOCTL_PARALLEL_GET_ECP_REV_TRANS ) in
> our
> > WinCE .Net 4.2 installation. The installation kit used was:
> > Kit: 814-00279
> > WinCE Platform Builder 4.2 EmbedSys
> > Date: 5/22/03
> > SW CD WinCE Platform Builder 4.2 EMBSYS
> > English #1 OEM, #2 OEM,....
> >
> > The following code snippet is a part of
> > %_WINCEROOT%\PUBLIC\COMMON\OAK\INC\pegdpar.h. Here
> > IOCTL_PARALLEL_GET_ECP_REV_TRANS has not been defined.
>
> --------------------------------------------------------------------------
> --
>
> --------------------------------------------------------------------------
> --
> > ---------
> > //
> > #define IOCTL_PARALLEL_SET_TIMEOUTS
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,1,METHOD_BUFFERED,FILE_ANY_ACCESS)
> > #define IOCTL_PARALLEL_GET_TIMEOUTS
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,2,METHOD_BUFFERED,FILE_ANY_ACCESS)
> > #define IOCTL_PARALLEL_GETDEVICEID
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,3,METHOD_BUFFERED,FILE_ANY_ACCESS)
> > #define IOCTL_PARALLEL_WRITE
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,4,METHOD_BUFFERED,FILE_ANY_ACCESS)
> > #define IOCTL_PARALLEL_GET_ECP_CHANNEL32
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,5,METHOD_BUFFERED,FILE_ANY_ACCESS)
> > #define IOCTL_PARALLEL_STATUS
> > CTL_CODE(FILE_DEVICE_PARALLEL_PORT,6,METHOD_BUFFERED,FILE_ANY_ACCESS)
>
> --------------------------------------------------------------------------
> --
>
> --------------------------------------------------------------------------
> --
> > ---------
> >
> > And also it is verified with mdd.c of
> > "%_WINCEROOT%\Public\Common\Oak\Csp\HD64465\Parallel" and
> > "%_WINCEROOT%\Public\Common\Oak\Drivers\Parallel". There is no such CTL
> CODE
> > has been handled.
> >
> > We need your valuable assistance in this regard.
> >
> >
> > "David Liao (MS)" <davli@online.microsoft.com> wrote in message
> > news:3f746e94$1@news.microsoft.com...
> > > Strange it is implement in my 4.2 tree.
> > public\common\oak\drivers\parallel.
> > > This is where I got it. I also found it is inside
> > > common\oak\cps\hd64465\parallel. Are you sure you are looking Windows
CE
> > 4.2
> > > code?
> > >
> > > There is nothing stop you to write this code in LPT_Read.
> > >
> > > David Liao
> > > "KaruppuSwamy T" <swamytk@tandbintl.com> wrote in message
> > > news:%235yNyRBhDHA.3276@tk2msftngp13.phx.gbl...
> > > > 1. The IOCTL you have mentioned, IOCTL_PARALLEL_GET_ECP_REV_TRANS is
> not
> > > > implemented in the following parallel port device drivers in Windows
> CE
> > > .NET
> > > > 4.2.
> > > > %_WINCEROOT%\Public\Common\Oak\Csp\HD64465\Parallel
> > > > %_WINCEROOT%\Public\Common\Oak\Drivers\Parallel
> > > > Is there any other parallel port driver which implements the
> > > > IOCTL_PARALLEL_GET_ECP_REV_TRANS code?
> > > >
> > > > 2. Is there any other parallel port driver for Windows CE .Net which
> > > > implements Byte mode
> > > > communication to read data from printer / peripheral ?
> > > >
> > > >
> > > > "David Liao (MS)" <davli@online.microsoft.com> wrote in message
> > > > news:3f731668$1@news.microsoft.com...
> > > > > If you are using Windows CE 4.2, Pleaes try
> > > > > BOOL DeviceIoControl(
> > > > > HANDLE hDevice,
> > > > > IOCTL_PARALLEL_GET_ECP_REV_TRANS,
> > > > > &dwAddr,
> > > > > sizeof(DWORD),
> > > > > lpOutBuffer,
> > > > > nOutBufferSize,
> > > > > lpBytesReturned,
> > > > > NULL
> > > > > );to get reverse data, For retrieve status, you can useBOOL
> > > > DeviceIoControl(
> > > > > HANDLE hDevice,
> > > > > IOCTL_PARALLEL_STATUS,
> > > > > NULL,
> > > > > NULL,
> > > > > &dwStatus,
> > > > > sizeof(DWORD),
> > > > > NULL,
> > > > > NULL
> > > > > );David Liao"KaruppuSwamy T" <swamytk@tandbintl.com> wrote in
> message
> > > > > news:Oq26C%230gDHA.2300@TK2MSFTNGP10.phx.gbl...
> > > > > > Hi,
> > > > > > We have a APS Printer CP290MRS , We were able to read the
> status
> > > > byte
> > > > > of
> > > > > > the printer from the dataport by implementing byte mode in our
> test
> > > > > > application inWindows 2000 successfully.
> > > > > > When we try to read the status byte of the printer from the
> > > dataport
> > > > > by
> > > > > > implementing byte mode in our test application in WIN CE 4.2, We
> > were
> > > > NOT
> > > > > > getting the status on data port.
> > > > > > The APS Printer CP290MRS uses compatibility mode to write to
> the
> > > > > printer
> > > > > > and byte mode to read from the printer.
> > > > > > We were able to write to the printer successfuly using
> WriteFile
> > > ()
> > > > > API.
> > > > > > But we were not able to read using ReadFile() API .
> > > > > > After checking the parallel port device driver in WIN CE 4.2
> for
> > > > > > ReadFile, It was found the Driver funtions LPT_Read has a
single
> > > > > statement
> > > > > > which returns 0 ( Zero).
> > > > > >
> > > > > > Any help in this regard ( to read data from parallel port
> > printer
> > > in
> > > > > > byte mode ) is highly appreciated.
> > > > > >
> > > > > > With Warm Regards,
> > > > > > Swamy T.K.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>