Solved

How to write directly to the LPT port under DELPHI

Posted on 1997-10-28
2
608 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

15 Experts available now in Live!

Get 1:1 Help Now