Solved

Connection via LPT

Posted on 1998-12-29
6
295 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
Comment Utility
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
Comment Utility
Hi  Fatman

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

0
 

Author Comment

by:anas_madani
Comment Utility
I do work with DELPHI 3
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 17

Expert Comment

by:inthe
Comment Utility
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
Comment Utility
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 20 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now