35
CITIZEN UWP POS Print SDK - Programming Manual
2.3.7. Status method
Syntax
1)
int Status ()
2)
int Status (int type)
Parameter
The meaning and the setting range of the parameters are as follows.
Value
[IN/OUT]
Meaning
Setting range
type
[IN]
Status type
CMP_STS_DRAWER_LEVEL_H
CMP_STS_PAPER_NEAREMPTY
CMP_STS_COVER_OPEN
CMP_STS_PAPER_EMPTY
CMP_STS_PRINTEROFF
Description
This method is used to get the status of the printer obtained by the PrinterCheckAsync method.
Before the execution of this method, you must run the
When there is not a parameter, return the logical sum of the status (CMP_STS_COVER_OPEN,
CMP_STS_PAPER_EMPTY, CMP_STS_PRINTEROFF) indicating the error of the printer.
When the status type is specified, return the status that matches. Status type can be specified in
combination. If you want to combine, please specify the logical sum.
Return value
Return the following status codes.
Status codes
Description
CMP_STS_NORMAL (0)
The printer is normal.
CMP_STS_DRAWER_LEVEL_H (2)
Status of pin 3 of drawer kick-out connector = H (when the type
parameter is set)
CMP_STS_PAPER_NEAREMPTY (4)
Paper near empty. (when the type parameter is set)
CMP_STS_COVER_OPEN (16)
The cover of the printer opens.
CMP_STS_PAPER_EMPTY (32)
The printer is out of paper.
CMP_STS_PRINTEROFF (128)
The printer is off-line.
Example
int status = printer.Status();
if ( ESCPOSConst.CMP_STS_NORMAL == status ) {
// No Error
int status2 = printer.Status(ESCPOSConst.CMP_STS_PAPER_NEAREMPTY);
if ( (ESCPOSConst.CMP_STS_PAPER_NEAREMPTY & status2) > 0 ) {
// Paper Near Empty
}
} else {
if ( (ESCPOSConst.CMP_STS_COVER_OPEN & status) > 0 ) {
// Cover Open
}
if ( (ESCPOSConst.CMP_STS_PAPER_EMPTY & status) > 0 ) {
// Paper Empty
}
if ( (ESCPOSConst.CMP_STS_PRINTEROFF & status) > 0 ) {
// Printer Offline
}