Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting a printers status if there is no windows print driver

Posted on 1997-06-21
8
Medium Priority
?
252 Views
Last Modified: 2010-04-04
I want to be able to get the status from a printer connected to LPT1,LPT2 etc. The printer has no windows print driver installed, its data is sent via a text file opened as LPT1 etc. Any solutions?
0
Comment
Question by:DaveG
[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
  • 5
  • 2
8 Comments
 

Expert Comment

by:bsys
ID: 1337361
I guess that this is the same question as I asked before (a couple of days ago).
So the value for this question is 200 + 230 points (isn't that worth the answer??).
(FOR WHAT KIND OF APPLICATION THAT)
0
 

Expert Comment

by:bsys
ID: 1337362
Can this software be used for COM ports also???
0
 
LVL 3

Expert Comment

by:sperling
ID: 1337363
What delphi and windows version(s) do you need to support?

Regards,

Erik.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Accepted Solution

by:
bsys earned 400 total points
ID: 1337364
I have found it!!! I have two assembler routines, one for a com port and one for a lpt port!! It works just fine, let me know if you are interested!!! I'll send it by E-Mail!!!
0
 

Expert Comment

by:bsys
ID: 1337365
Here it is DaveG,I am using this in my POS program:

function TPrinterStatusForm.CheckCOM(Printer: Word): Word;
var
   PS: Word; {PS = Printer Status}
begin
     asm
       mov dx,Printer {COM, starts from 0}
       mov ax,300h
       int 14h
       and ax, 127
       mov PS,ax
     end;
     Result := PS;
end;

function TPrinterStatusForm.CheckLPT(Printer: Word): Word;
var
   PS: Byte; {PS = Printer Status}
begin
     asm
       mov dx,Printer {LPT}
       mov ah,02h {Status request}
       int 17h
       mov PS,ah
     end;
     Result := PS;
end;

And this works!!!
0
 

Expert Comment

by:davegreen
ID: 1337366
This is the routine I worked out myself from investigation- it is more or less the same:

function PrinterStatus(OutFile: Word) : byte;
var
  PrinterPort: Word;

  function GetStatus : byte;
  asm
     mov AH,$02 {get printer status}
     mov DX, PrinterPort   {lpt1=0, lpt2=1}
     Int $17   {get printer status}
     mov AL, AH
  end;
begin
  PrinterPort := OutFile;
  Result := GetStatus;
end;


The bits returned should correspond as follows

7 6 5 4 3 2 1 0   bit value
-----------------------------
1                   printer not busy
0                   printer busy
  1                 printer acknowledgment
    1               out of paper
      1             printer selected
        1           i/o error
          ? ?       unused
              1     timeout

This code works too....
0
 

Expert Comment

by:davegreen
ID: 1337367
I withdraw this question...
0
 

Expert Comment

by:bsys
ID: 1337368
Ok, what do you want then?????????
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

704 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