Improve company productivity with a Business Account.Sign Up

x
?
Solved

Connection via LPT

Posted on 1998-12-29
6
Medium Priority
?
356 Views
Last Modified: 2010-04-04
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
Comment
Question by:anas_madani
6 Comments
 
LVL 1

Expert Comment

by:Fatman121898
ID: 1353666
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
 

Author Comment

by:anas_madani
ID: 1353667
Hi  Fatman

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

0
 

Author Comment

by:anas_madani
ID: 1353668
I do work with DELPHI 3
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
LVL 17

Expert Comment

by:inthe
ID: 1353669
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
 
LVL 7

Expert Comment

by:Motaz
ID: 1353670
Hi Anas nice to see you here, I'm interested in your quesion, so I'll check for notification.

Motaz A. Azim
0
 
LVL 17

Accepted Solution

by:
inthe earned 40 total points
ID: 1353671
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
When you have multiple client accounts to manage, it often feels like there aren’t enough hours in the day. With too many applications to juggle, you can’t focus on your clients, much less your growing to-do list. But that doesn’t have to be the cas…

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question