Solved

How to write directly to the LPT port under DELPHI

Posted on 1997-10-28
2
648 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
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX StringGrid1->Canvas->FillRect Problem 3 150
Printing problem 2 91
DBGrid or StringGrid ? 6 88
Why  'Host Connection unavailable/Socket Error #113 No route to host' 6 38
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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