0

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
  • 3
    What you want to do (How work?) is in an incredible old technology, when the LPT port corresponded to a set of bytes in the processor Input/output address space. Today, no user mode application can use the input/output address space. Anyway, it is likely that the LPT port hardware you use is not even based on the old architecture. Look at en.wikipedia.org/wiki/Parallel_port Have you tried to open the file "LPT:" and simply write the bytes you want on the output. You probably need some wire to simulate the presence of a printer in ready state.
    – fpiette
    Feb 8 at 16:06

1 Answer 1

0

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.