Author Topic: Using the LPT component to read status of a printer?  (Read 2735 times)

chedges

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Using the LPT component to read status of a printer?
« on: November 27, 2008, 05:10:20 pm »
Hello,

I'm currently evaluating your compoents for the task of writing data to a parallel printer.
I've created a very simple test app that sends a string to the printer but I am
not sure how to read the status of the printer afterwards?

will I need to continously poll the LPT port to ensure I get the status
or can it trigger an event etc?

you will have to forgive me, this is my first experience of using the LPT port :)

Thanks for your advice

Chris Hedges

fyi,

The printer can return the following status codes :-

 0x02 = "Start of Text"
 0x03 = "End of Text"
 0x04 = "End of Transmission"
 0x05 = "Test Button Ticket ACK"
 0x06 = "Ticket ACK"
 0x10 = "Out of Tickets"
 0x11 = "X-On"
 0x12 = "Power On"
 0x13 = "X-Off"
 0x15 = "Ticket NAK"
 0x16 = "Ribbon Low"
 0x17 = "Ribbon Out"
 0x18 = "Ticket Jam"
 0x19 = "Illegal Data"
 0x1A = "Power Up Problem"
 0x1C = "Incomplete Logo Stored in FLASH"

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Using the LPT component to read status of a printer?
« Reply #1 on: November 27, 2008, 06:28:18 pm »
Hello Chris

Unfortunately, current version of TnrLpt component does not have events for monitor LPT port state.
You can try to poll port by timer or in separated thread.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

chedges

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: Using the LPT component to read status of a printer?
« Reply #2 on: November 28, 2008, 12:38:39 pm »
Hi Roman,

I can handle the polling by using a background thread easily enough.
So one I have send my string of data to the printer, how do a read back the status?

thanks for helping me with these rather newbie questions :)

regards,

Chris

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Using the LPT component to read status of a printer?
« Reply #3 on: November 29, 2008, 06:44:20 am »
Hi Chris,

You can read a current state of LPT pins over following TnrLpt properties

    TnrLpt.Pins[Index:integer]:boolean;
    TnrLpt.BitsData:byte;
    TnrLpt.BitsStatus:byte;
    TnrLpt.BitsControl:byte;

Roman
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.