?
Solved

How to write directly to the LPT port under DELPHI

Posted on 1997-10-28
2
Medium Priority
?
744 Views
Last Modified: 2006-11-17
I have a problem, i want to connect some external electronics to my LPT port, and then i want to be able to write directly to the port. - Is it possible to do, running Windows NT 4 ?  - Please, i need this one badly
0
Comment
Question by:beamer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 600 total points
ID: 1349057
Yes, why not?

I can give you already this code. That's the easiest way. It's the way to print by bypassing windows. Don't think it's different to send your codes to your hardware.
But I have also a zip -file with documents very well accessing the hardware ports via delphi 2.0. With examples. I can send it to you, if you want it. Just give me your e-mail adres. I really recommend this file!

var
 f : TextFile;
begin
 AssignFile( f, 'LPT1' );
 Rewrite( f );
  //
  // do your printing here...
  //
 WriteLn( f, {codes});
 CloseFile( f );
end;

(Following:  I'm not sure if you need it)
If you plan on sending control codes to the printer, call this function immediat

 procedure SetBinaryMode (var F: Text);  assembler;

 asm
   mov ax,$4400
   les di,F
   mov bx,word ptr es:[di]
   int $21
   or dl,$20
   xor dh,dh
   mov ax,$4401
   int $21
   end;


This is the read.me file from the zip file I offer you! Like I said it's really good documented. If you really want to program your hardware ports, it just what you need. Really, IT IS!

The Delphi Hardware Programmers's Archive
All of the files in this archive were collected
from FTP sites to illustrate how to interface
Delphi with IBM PC hardware. They are all public
domain and should be used with care. I disclaim
everything, this file is provided as a service
to all who are interested.

GOOD LUCK!      Alan Young
            ajtech@apc.net

DELFHDWR.DOC      Contains a MS Word document
            explaining how to interface
            Delphi with hardware. Contains
            references to the other files
            below.

VBAJGAME.ZIP      Shows how to interface a Delphi
            DLL with Visual Basic. Accesses
            joystick port

LPCTRL.ZIP      Shows how to program parallel LPT
            port in Delphi

HWPORT95.ZIP      A PORT I/O Driver for Win 95. Use
            with Delphi as per document's
            instructions

loaddrv.ZIP      CONTAINS LOADDRV program
            for WinNT. This is for loading
            the giveio.sys driver

DIRECTIO.ZIP      Contains GIVEIO.SYS driver for WINNT.


I'm almost going home. So you have to wait till tomorrow for this file if you don't answer in a half hour.

Need more help, just ask
Have fun,
c.u. ZifNab;
0
 

Author Comment

by:beamer
ID: 1349058
Thanks for the answer.!

I'll return when i know wether it works or not !

Cya.
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.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 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