50
Error handling
Refer to the following program for the error handling method by a callback function.
//Create an ePOS-Print object
var epos = new epson.ePOSPrint(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') + '\
nCode:
' + 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);
}
Содержание TM-T88V-i
Страница 10: ...10 ...
Страница 14: ...14 ePOS Print Canvas API Monochrome or Grayscale Monochrome ...
Страница 160: ...160 ...
Страница 216: ...216 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm ...
Страница 218: ...218 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm ...
Страница 222: ...222 Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported 80mm 58mm ...
Страница 258: ...258 ...