• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Using the LPT component to read status of a printer?

Started by chedges, November 27, 2008, 03:10:20 pm

Previous topic - Next topic

chedges

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

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

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

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.