Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to write directly to the LPT port under DELPHI

Posted on 1997-10-28
2
Medium Priority
?
766 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 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