Solved

Read/Write to Paralel port

Posted on 2001-06-22
9
215 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
ID: 6218541
0
 

Author Comment

by:_lr_
ID: 6218862
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
ID: 6219089
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
ID: 6220408
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:inthe
ID: 6220499
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
ID: 6220514
Hi inthe :-)

  That is a GREAT link!
0
 
LVL 2

Expert Comment

by:egono
ID: 6223978
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
ID: 6245103
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
ID: 6441174
"  without using asm(in/out)  "

strange answer you accepted there ...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 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

16 Experts available now in Live!

Get 1:1 Help Now