LPT port control in Windows 7 (x86), Windows 10 (x64) and Embarcadero Delphi XE

571 views Asked by At

I am now faced with the task of managing the LPT port from a program on Embarcadero Delphi XE in Windows 7 (x86) (in the future on Windows 10 (x64)). To begin with, at least blink the LEDs connected to the outputs of the LPT port. The LPT port is organized on a PCI card, which is connected to the computer via PCI-Express and its own driver is installed for it. In device manager, the board is visible as WCH PCI Express=>DUAL SERIAL&&PARALLEL. There is such a dll: inpout32.dll, there are such functions

function Inp32(PortAddr: Word): byte; stdcall; external 'inpout32.dll';
function Out32(PortAddr: Word; Data: byte): byte; stdcall; external 'inpout32.dll';

That is, to work with the LPT port, you need to specify the port address PortAdr. Where can you watch it? In the "Resources" tab of the driver properties? If the inpout32.dll library is not suitable for Window 10, then what can be used instead?

I googled the query "parallel port control in delphi windows 10" but didn't find anything relevant.

1

There are 1 answers

0
Rix1970 On

Problem solved. I used the inpout32.dll driver, as the port address I used the address from the "Input / output range (I / O)" from the "Resources" tab of the parallel port driver in the "Device Manager".

PortAdr1 := $EEFC;
PortAdr2 := $EEFF;
Data := 255;
for PortAdr := PortAdr1 to PortAdr2 do
    Out32(PortAdr, Data);