Solved

Read/Write to Paralel port

Posted on 2001-06-22
9
214 Views
Last Modified: 2010-04-06
How do i read/write to the paralel port without using asm(in/out).

Thanks

_LR_
0
Comment
Question by:_lr_
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 13

Expert Comment

by:Epsylon
Comment Utility
0
 

Author Comment

by:_lr_
Comment Utility
With componet, there isn't any there that alows the read and write from/to the paralel port

_LR_
0
 
LVL 2

Expert Comment

by:egono
Comment Utility
it's possible to use the standard file functions to read/write the parallel port

use

CreateFile( 'LPT1:',GENERIC_READ + GENERIC_WRITE,
           0 , nil, OPEN_EXISTING, 0 + FILE_FLAG_WRITE_THROUGH, 0 );

to open a file handle, after that you can use the ReadFile() and WriteFile() functions

good luck
0
 
LVL 5

Expert Comment

by:Gwena
Comment Utility
If you need to access the port on NT then you may need this freeware
that gives you access http://www.internals.com/utilities/winio.zip  I have
a unit to make it easier to use... just let me know if you need that :-)
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
or

http://www.wideman-one.com/gw/tech/Delphi/iopm/index.htm

+ some good texts at that site for io programming.
:-)

0
 
LVL 5

Expert Comment

by:Gwena
Comment Utility
Hi inthe :-)

  That is a GREAT link!
0
 
LVL 2

Expert Comment

by:egono
Comment Utility
gwena - it's absolutely the wrong way to use such a driver for accesing the parallel port on NT/W2K!
NT/W2K have two standard drivers for both the seriell and the parallel ports which can be accessed in the described way. So if you use another driver, then two drivers accessing the same hardware - not a very good idea.
Such I/O drivers are only good for non standard hardware, which have no NT/W2K drivers.

if someone is interested in german resources look here:

http://www.nt-treiberentwicklung.de/kapitel5.htm


good luck
0
 

Accepted Solution

by:
bullen earned 100 total points
Comment Utility
For Win95,98 but You should use it with care.

procedure Lpt_Out(b:byte);
asm
  mov dx,$378
  mov al,b
  out dx,al
end;

function Lpt_in : byte;
asm
  mov dx,$378
  in al,dx
end;
// $378 = LPT1 on my computer

bullen
0
 
LVL 17

Expert Comment

by:inthe
Comment Utility
"  without using asm(in/out)  "

strange answer you accepted there ...
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

10 Experts available now in Live!

Get 1:1 Help Now