locked
Claiming/Releasing Epson Printer woes RRS feed

  • Question

  • OK, so I was getting cocky that I had succeeded in printing a report to my Epson Tm88IV.  But I should have known it wouldn't be that "easy".  My situation is that I essentially poll my db every 5 seconds looking for invoices, etc that require printing.  Then I loop through the invoices items, print and mark them as printed and then releasing the printer.  What seems to be happening is that my app, or something within my loop isn't releasing it, I guess... Basically I can reset the printer and run one invoice.  Afterwards I get either an invalid port exception of an exception that the device is already claimed.  I thought I was following the pattern I've seen in Sean's book and elsewhere but clearly something's not right.

    I'm awfully tired of battling this thing... be very very grateful for any help!

    Saturday, November 17, 2012 7:12 PM

Answers

  • Thanks for that suggestion... printing logos doesn't appear to have anything to do with it.  I seem to have "solved" the problem by incorporating a procedure Epson shows in their samples, where you check for "is initialized" and if not, you sleep the thread for a second before trying to claim.  These POS printers seem pretty fussy, but that seems to have solved it...
    • Marked as answer by PaulBinCT Tuesday, November 27, 2012 3:42 PM
    Tuesday, November 27, 2012 3:42 PM

All replies

  • OK... I got 99.9% of it sorted out by fiddling with where I was claiming and releasing the printer, turns out there was also a loop problem that was being concealed by the printer problem... oy. 

    Anyway, there's one remaining issue which is that, apparently, when the first print event fires, the printer doesn't respond quickly enough and I get the port not valid or can't be connected, etc etc.  If I first "ping" it from the Epson Health utility, or I immediately restart it, it's fine.  I tried increasing the printer.claim() parameter but that doesn't seem to help...

    Any suggestions?

    Saturday, November 17, 2012 8:37 PM
  • Do you print with bitmap image /logo?
    If yes, it might be better to flash the bitmap to the Printer's memory and just call it at the printer side to print. Other that that I couldn't find any reason to have slow print on the first attempt.
    I use TM88IV and print logo (using flash bitmap) but have no problem as yours.

    Tuesday, November 27, 2012 6:20 AM
  • Thanks for that suggestion... printing logos doesn't appear to have anything to do with it.  I seem to have "solved" the problem by incorporating a procedure Epson shows in their samples, where you check for "is initialized" and if not, you sleep the thread for a second before trying to claim.  These POS printers seem pretty fussy, but that seems to have solved it...
    • Marked as answer by PaulBinCT Tuesday, November 27, 2012 3:42 PM
    Tuesday, November 27, 2012 3:42 PM