Board index » delphi » Getiing Parallel PC Port Signal

Getiing Parallel PC Port Signal

I would like to be able to get from my Delphi Application the different
signal coming from the LPT1 ou LPT2 port.
Is there a way to do that ?
Thanx!
 

Re:Getiing Parallel PC Port Signal


"Philippe LASMAN" <Philippe.Las...@Wanadoo.fr> p?e v diskusnm p?spvku
news:94tskk$5pa$1@wanadoo.fr...

Quote
> I would like to be able to get from my Delphi Application the different
> signal coming from the LPT1 ou LPT2 port.
> Is there a way to do that ?
> Thanx!

Hello,
The LPT1 can be accessed in two ways.
First, by the Win32 api calls:
  fh := CreateFile('LPT1'...)
  ReadFile(fh ...);
Second, directly by I/O ports, like this:
  asm
    mov dx, 379h ;printer status
    in  al, dx
    mov b, al
  end;
  ShowMessage(IntToHex(b, 8));
 The second method works on Win95, but I have doubdts if it works on WinNT.
Look at Win32.hlp, Techhelp or ask me for details.

Other Threads