[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

Connection via LPT

Where can I find components that makes me manage data IN/OUT the Parallel port ,
I also need full informations about how does the LPT work

Thanks for help
anas
0
anas_madani
Asked:
anas_madani
1 Solution
 
Fatman121898Commented:
Hi, anas.
You have no need of any Delphi components in order to work with LPT. For every LPT there are three IO addresses (Ports) which are: Data port, Status port and Control port. They are as follows:
 
for LPT1:
$378 - Data port (Read/Write)
$379 - Status port (Read)
$37a - Control port (Read/Write)

for LPT2:
$278 - Data port (Read/Write)
$279 - Status port (Read)
$27a - Control port (Read/Write)
.

If you are using Delphi1 or Delphi2 you should use code like this:

Port[xxx]:=SomeValue;   //  in order to write SomeValue to IO port #xxx
SomeVar:=Port[xxx];      //  in order to read IO port #xxx into SomeVar
.

If  you are using any 32 bit Delphi (Delphi 3 or Delphi 4) you should use this:

// to write SomeValue to IO port #xxx:
asm
  mov DX, xxx;
  mov AL, SomeVal;
  out DX, AL;
end;
.
// to read port #xxx into SomeVar:
asm
  mov DX, xxx;
  in AL, DX;
  mov SomeVar, AL;
end;
.
Where: xxx : IO port number
           SomeValue: Byte type value;
           SomeVar:     Any Integer type variable;

NOTES:
1.All this stuff will not work if your OS is WindowsNT, because it doesn't allow direct access to such resources as IO ports.
2.The meaning of every bit in Status and Control port is fully described in literature.  


0
 
anas_madaniAuthor Commented:
Hi  Fatman

You have mentioned my problem in your NOTES   ( Yes I'm working with WINDOWS NT4)

0
 
anas_madaniAuthor Commented:
I do work with DELPHI 3
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
intheCommented:
there's a good component called tvichw32 probably here
also one called tserial i think that does nt lpt ports
http://sunsite.icm.edu.pl/delphi/
or
 www.torry.ru/

comes with good examples etc and is fine for nt
(it maybe shareware cant remember)
Regards Barry

0
 
MotazCommented:
Hi Anas nice to see you here, I'm interested in your quesion, so I'll check for notification.

Motaz A. Azim
0
 
intheCommented:
here are some more for ya.
it seems there are no free ones for nt, these were cheapest around
http://www.torry.ru/  under system#4   IOPort_v2.0  $35.00
http://www.torry.ru/  under system#4   TinyPort_V2.0 $50.00
tvichw32 is there as well and although is much better is also more expensive

fot more info on parallel port there are many links here about how the ports work and faq's etc:
http://www.lvr.com/parport.htm

Regards Barry
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now