Epson TM-U220 ePOS-Print XML Users Manual - Page 55
Error handling, Refer to the following program for the error handling method by a callback function.
View all Epson TM-U220 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 55 highlights
Chapter 3 Programming Guide Error handling Refer to the following program for the error handling method by a callback function. // Set a response receipt callback function xhr.onreadystatechange = function () { . . . // Obtain the print result and error code var res = xhr.responseXML; var msg = 'Print' + (res[0].getAttribute('success') ? 'Success' : 'Failure') + '\nCode:' + res[0].getAttribute('code') + '\nStatus:\n'; // Obtain the printer status var asb = res[0].getAttribute('status'); if (asb & 0x00000001) { msg += ' No printer response\n'; } if (asb & 0x00000002) { msg += ' Print complete\n'; } if (asb & 0x00000004) { msg += ' Status of the drawer kick number 3 connector pin = "H"\n'; } if (asb & 0x00000008) { msg += ' Offline status\n'; } if (asb & 0x00000020) { msg += ' Cover is open\n'; } if (asb & 0x00000040) { msg += ' Paper feed switch is feeding paper\n'; } if (asb & 0x00000100) { msg += ' Waiting for online recovery\n'; } if (asb & 0x00000200) { msg += ' Panel switch is ON\n'; } if (asb & 0x00000400) { msg += ' Mechanical error generated\n'; } if (asb & 0x00000800) { msg += ' Auto cutter error generated\n'; } if (asb & 0x00002000) { msg += ' Unrecoverable error generated\n'; } if (asb & 0x00004000) { msg += ' Auto recovery error generated\n'; } if (asb & 0x00020000) { msg += ' No paper in the roll paper near end detector\n'; } if (asb & 0x00080000) { msg += ' No paper in the roll paper end detector\n'; } if (asb & 0x80000000) { msg += ' Stop the spooler\n'; } //Display in the dialog box alert(msg); } 55