26 oktober 2005

Printing to LPD Printer Is Slow or Fails with Windows

Experienced a nasty printing problem, which was caused by a number of ingredients that together will make it very odd that someone else will ever experience this problem, but anyway: here's the story...

At a customer's site, we implemented new industrial labelprinters (Zebra's, very fine machines). Per label printing went fine to these printers, but printing a higher number of labels (> 10) showed a strange phenomenon: a number of labels printed fine, the system waited for a couple of minutes, then some labels again, then some minutes waiting again and so on... Very strange, but more important: very irritating!

Other relevant infrastructure components: SAP R3 on Windows 2000 Server, printing to LPR-printers on the 2000-box, which in turn delivers the label on a print server (running Teklynx Sentinel S4 Print Pack for adding barcode functionality etc.). On this print server, the label processing is carried out and at last the label is delivered to the labelprinter. Quite a number of places where things could go wrong...

We determined that the problem had to be somewhere in SAP or the SAP-server, because during such a "wait time" (number of minutes waiting in between printing a bunch of labels) other applications were able to print. Having said that, we measured the wait time in between label printing, and that was about four minutes (this is important!)...

So, as Google is your friend, we asked Google where this four minute timeout was coming from, and it lead us to this page: Printing to LPD Printer Is Slow or Fails with Windows. This page shines a little light into this problem and also suggest reading this page: Updated TCP/IP printing options for Windows NT 4.0 SP3.

What was the case? I mentioned that our SAP R/3 is running on Windows 2000 Server. That is true, but, this server started its life being a Windows NT SP3 Server. In NT4/SP3, an old version of the LPR protocol was implemented: "Per RFC 1122, each port must not be reused for four minutes (2 * Maximum Segment Lifetime as defined in RFC 1122)." This four minute timeout was needed because only 11 TCP-ports could be used for printing (TCP 721-731). With RFC 1179, this limitation was overcome by using the high ports for printing (> 1024). As this server had been NT4/SP3 in the past, the LPR-ports had been created under the old LPR-regime.

We solved this by the solution that is mentioned in Q179156: deleting and recreating the HKLM\SOFTWARE\Microsoft\LPDSVC\lpr-regkey and adding the REG_DWORD "UseNonRFCSourcePorts". By doing that, we continue to use the old LPR-ports, but instruct them to use the high-ports instead of the old low ports in the range 721-731.

As I said in the beginning: it sounds quite rare that someone will ever experience this problem again, but hey... maybe you do and you find this post helpful ;-)

2 opmerkingen:

Anoniem zei

Hi there,

I just found your blog, it has been a really interesting read! On the subject of labels, a while back i managed to find a british labels company who sold me a batch of plain labels for a really low price.

print notepad zei

Notepad printing is one of the best ways to create an impression in the minds of your customers. Its really necessary in business to promote yourself and make aware the people about your brand.The main aim of printing notepads is to create brand awareness among your prospective consumers.