57
Chapter 3 Programming Guide
3
Error handling
Refer to the following program for the error handling method by a callback function.
var epos = new epson.CanvasPrint(address);
// Set a response receipt callback function
epos.onreceive = function (res) {
// Obtain the print result and error code
var msg = ''Print ' + (res.success ? 'Success' : 'Failure') + '\n
Code:
'
+ res.code + '\nStatus
:
\n';
// Obtain the printer status
var asb = res.status;
if (asb & epos.ASB_NO_RESPONSE) {
msg += ' No printer response\n';
}
if (asb & epos.ASB_PRINT_SUCCESS) {
msg += ' Print complete\n';
}
if (asb & epos.ASB_DRAWER_KICK) {
msg += ' Status of the drawer kick number 3 connector pin = "H"\n';
}
if (asb & epos.ASB_OFF_LINE) {
msg += ' Offline status\n';
}
if (asb & epos.ASB_COVER_OPEN) {
msg += ' Cover is open\n';
}
if (asb & epos.ASB_PAPER_FEED) {
msg += ' Paper feed switch is feeding paper\n';
}
if (asb & epos.ASB_WAIT_ON_LINE) {
msg += ' Waiting for online recovery\n';
}
if (asb & epos.ASB_PANEL_SWITCH) {
msg += ' Panel switch is ON\n';
}
if (asb & epos.ASB_MECHANICAL_ERR) {
msg += ' Mechanical error generated\n';
}
if (asb & epos.ASB_AUTOCUTTER_ERR) {
msg += ' Auto cutter error generated\n';
}
if (asb & epos.ASB_UNRECOVER_ERR) {
msg += ' Unrecoverable error generated\n';
}
if (asb & epos.ASB_AUTORECOVER_ERR) {
msg += ' Auto recovery error generated\n';
}
if (asb & epos.ASB_RECEIPT_NEAR_END) {
msg += ' No paper in the roll paper near end detector\n';
}
if (asb & epos.ASB_RECEIPT_END) {
msg += ' No paper in the roll paper end detector\n';
}
if (asb & epos.ASB_BUZZER) {
msg += ' Sounding the buzzer (limited model)\n';
}
if (asb & epos.ASB_SPOOLER_IS_STOPPED) {
msg += ' Stop the spooler\n';
}
//Display in the dialog box
alert(msg);
}
Summary of Contents for TM-T88V-i
Page 10: ...10 ...
Page 14: ...14 ePOS Print Canvas API Monochrome or Grayscale Monochrome ...
Page 160: ...160 ...
Page 258: ...258 ...