NCR Manual Printer 18-I-2024
NCR Manual Printer 18-I-2024
NCR Manual Printer 18-I-2024
User Guide
for NCR Retail Printers
B005-0000-1609
Issue G
The product described in this book is a licensed product of NCR Corporation.
It is the policy of NCR Corporation (NCR) to improve products as new technology, components, software,
and firmware become available. NCR, therefore, reserves the right to change specifications without prior
notice.
All features, functions, and operations described herein may not be marketed by NCR in all parts of the
world. In some instances, photographs are of equipment prototypes. Therefore, before using this document,
consult with your NCR representative or NCR office for information that is applicable and current.
To maintain the quality of our publications, we need your comments on the accuracy, clarity, organization,
and value of this book.
Copyright © 2017
By NCR Corporation Duluth,
GA U.S.A.
All Rights Reserved
i
Preface
Audience
This guide is targeted to users who want to understand how NCR
printer driver works in order to maximize the capabilities of the printer
and print text/graphics documents successfully.
This guide is also geared toward software developers who need to
create custom application to perform special printer functionalities
using native printer command sequences such as barcode printing,
bit-image download, bit-image printing, printer status notification, etc.
Notice: This document is NCR proprietary information and is not to be
disclosed or reproduced without consent.
ii
References
• NCR 7197 Thermal Receipt Printer Owner’s Manual (B005-000-1409)
• NCR 7167 Two Station-POS Printer Owner’s Manual (B005-000-1406)
• NCR K590 Self Service Printer Owner’s Guide (B005-0000-1346)
• NCR 7198 Thermal Receipt Printer Owner’s Guide (B005-0000-1736)
• NCR 7168 Thermal Receipt Printer Owner’s Guide (B005-0000-1713)
• NCR F306 FastLane Thermal Printer Owner’s Guide
• NCR 7152 Self Service Printer Owner’s Manual (B005-0000-1739)
• NCR 7346-F309 2ST FastLane Printer Owner’s Manual (B005-0000-
1816)
iii
Table of Contents
Introduction............................................................................................... 1
Printer driver Architecture...................................................................... 2
Printing Mechanism in Windows .................................................... 2
Printer Driver Components .............................................................. 4
Minidriver ........................................................................................... 5
Language Monitor ............................................................................. 5
NCR POS Application Programming Interface ............................. 6
SETTINGS.................................................................................................. 9
Resolution ........................................................................................... 9
Paper Sizes ........................................................................................ 10
Paper Sources ................................................................................... 11
Paper Orientation ............................................................................. 13
Two sided thermal Printing............................................................ 14
Two Sided Thermal(2ST) Printing Modes ............................... 15
Print on both Sides ...................................................................... 17
Knife Cut Feature ............................................................................. 19
Changing Default Settings .............................................................. 21
Programming (NCR Language Monitor & NCRPOSAPI) ............... 22
Commands ........................................................................................ 22
Application Information & Error Notification ........................ 22
How To Use NCRPOSAPI.dll ........................................................ 27
Interfaces ........................................................................................... 31
NCRPOS API Exported Functions ............................................ 31
DLL-Related Functions ............................................................... 34
Job Control Functions ................................................................. 36
iv
Revision Record
Issue Date Remarks
A Nov 2004 First issue
B Jun 2007 Driver 4.0 release; NCRPOSAPI 4.2 release;
Windows standalone install documentation
C Jan 2008 Addition of Knife Cut Feature
D Feb 2008 Addition of F307, F309, 7198 Receipt, 7198 Slip
printer models.
E May 2008 Two Sided thermal printing feature
F May 2008 Addition of 7198 Receipt Label printer. Removal of
references for O/S prior to XP, and non-existant
printer models
G Apr 2017 Driver 6.x.x Release
Windows Printer Driver 1
Introduction
This manual discusses the windows printer driver technology in order
to successfully print on the following NCR Retail raster printers:
• NCR 7167 Receipt Printer
• NCR 7167 Slip Printer
• NCR 7197 Receipt Printer
• NCR K590 Self-Service Printer
• NCR F306 Self-Service Printer
• NCR 7168 Receipt 2ST Printer
• NCR 7168 Slip Printer
• NCR 7198 Receipt 2ST Printer
• NCR 7198 Slip Printer
• NCR F307 Self-Service Printer
• NCR F309 Self-Service Printer
• NCR 7198xx4x Label Receipt Printer
• NCR 7199 Receipt Printer
2 Windows Printer Driver
Program
GDI 32 Module
Printer Driver (Win XP SP3/ 7/ 10)
Spooler Process
Print Provider Router
(SPOOLER.EXE)
Language Port
Monitor Monitor
Printer
Minidriver
A printer minidriver is data file that provides device-driver support for
a particular class of printers. A printer minidriver contains a collection
of data structures referred to as the printer's data table. A data table
contains data such as the printer's resolution, color capabilities, metrics
for device fonts, and the strings that correspond to various printer
commands. It also specifies printer model-specific aspects of how
primitive bitmap and text operations are to be performed.
NCR provides minidrivers to allow Unidrv to support NCR POS
printers.
Language Monitor
NCR printer drivers also include a language monitor based on ESC/P
POS language to provide a full-duplex communication channel
between the print spooler and the NCR printers.
This Language Monitor will be able to handle the following
errors/status in the printer:
1. Printer is busy.
6 Windows Printer Driver
Application
NCR POS
Printer Driver
NCR POS
Printer Object
Settings
Resolution
This printer driver supports various print resolutions.
The following table describes the printer wise breakup of supported
resolutions:
Printer Supported Resolution Displayed Resolution
NCR K590 Self-Service 203 dpi x 68 dpi 203 x 68 dots per inch
NCR F306 Self-Service 203 dpi x 203 dpi 203 x 203 dots per inch
NCR F307 Self-Service 203 dpi x 203 dpi 203 x 203 dots per inch
NCR F309 Self-Service 203 dpi x 203 dpi 203 x 203 dots per inch
203 dpi x 68 dpi 203 x 68 dots per inch
NCR 7197 Receipt
203 dpi x 203 dpi 203 x 203 dots per inch
NCR 7167 Receipt
NCR 7168 Receipt
NCR 7198 Receipt 203 dpi x 68 dpi 203 x 68 dots per inch
NCR 7198xx4x Label 203 dpi x 203 dpi 203 x 203 dots per inch
Receipt
NCR 7199 Receipt
NCR 7167 Slip
70 dpi x 72 dpi 70 x 72 dots per inch
NCR 7168 Slip
140 dpi x 72 dpi 140 x 72 dots per inch
For K590, 7167, 7197, 7198 and 7199 Receipt printers, the default
resolution is set to 203 x 203 dpi.
10 Windows Printer Driver
For 7167 and 7168 Slip printer, the default resolution is set to 140 x 72
dpi.
Paper Sizes
This printer driver supports various paper sizes. The following table
describes the printer wise breakup of supported paper sizes:
Printer Supported Paper Sizes
For 7167, 7197, 7198 and 7199 Receipt printers, the default paper size is
80mm.
For K509 Self-Service printer, the default paper size is 80mm x 75mm
TO 80mm x 600mm.
Paper Sources
This driver provides the following paper source for POS Printer.
Printer Supported Paper Source
NCR K590 Self-Service Receipt
NCR 7197 Receipt Receipt
NCR 7167 Receipt Receipt
NCR 7167 Slip Slip
NCR 7168 Receipt Receipt
NCR 7168 Slip Slip
12 Windows Printer Driver
Paper Orientation
This printer driver supports the following paper orientation
• Portrait
• Landscape
The default paper orientation is set to Portrait.
14 Windows Printer Driver
Single-sided Receipt:
In this mode printer prints the data on front side of paper, as soon as it
receives the data from application. This is the usual printing mode just
like other printers.
Single-sided Buffered Receipt:
In this mode printer buffers the data until a paper cut command and
then it prints the data at once on front side of the paper.
Duplex
In this mode the printer receives the data until paper cut command and
then it prints the data on both sides of paper, where data on odd page
number is printed on front side of paper and data on even page
number is printed on back side of the paper.
Duplex Split Receipt
In this mode the printer receives single sided data until a paper cut
command is received. The print data is then automatically divided into
two parts where the first part is printed on the front side and the
second part is printed on back of the receipt when knife cut command
is send to the printer.
Duplex Pre-Defined Image
This option will allow the automatic printing of predefined data on
back of the receipt. The pre-defined data is preloaded into the printer
and when the receipt is printed the predefined data is automatically
printed on the back of the receipt.
Windows Printer Driver 17
End page option cuts the paper upon reaching the end of every page of
the document.
EndDoc option cuts the paper upon reaching the end of the document.
EndJob option cuts the paper upon reaching the end of the job.
The default Knife Cut option is set to End Page.
Note: The K-590 printer configured with EndDoc or EndJob knife cut
option, supports maximum document limit of 610 mm.
Windows Printer Driver 21
Commands
The different features and functions provided by the printer are
controlled by sending commands from the host computer to the
printer. The printer commands are made up of one or more bytes of
data starting with a command control code followed by its supporting
parameters. For in-depth information regarding the available
commands supported by your printer, see references.
To be able to send commands to and read status from the printer, use
the functions exported by NCRPOSAPI.dll.
Sr. No. NCR printer status 32-bit error code used by Language Monitor
Macro 32-bit value
#include <windows.h>
UINT NCRMsgID = 0;
if (msg == NCRMsgID)
{
if (wParam & PTRSTAT_COVER_OPEN)
MessageBox(hwnd, "Cover Open", "Error", MB_OK);
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
return Msg.wParam;
}
Windows Printer Driver 27
#include windows.h
hLibrary =LoadLibrary("NCRPOSAPI.DLL");
if(hLibrary == NULL)
{
MessageBox(NULL,"NCRAPI.DLL cannot be loaded", "Error", MB_ICONERROR);
return 1;
}
hFunction = GetProcAddress(hLibrary,"NCRPOS_WritePrinter");
if(hFunction == NULL)
{
MessageBox(NULL, "NCRPOS_WritePrinter function failed", "Error", MB_ICONERROR);
return 1;
}
StartDocPrinter(hPrinter, 1, (LPBYTE)&pDocInfo);
StartPagePrinter(hPrinter);
pBarCode[0] = 0x1D;
pBarCode[1] = 0x6B;
pBarCode[2] = 0x00; /* UPC-A bar code type */
else
MessageBox(NULL, "Command successfully Written to the Printer", "Success", MB_OK);
EndPagePrinter(hPrinter);
EndDocPrinter(hPrinter);
ClosePrinter(hPrinter);
FreeLibrary(hLibrary);
return 0;
}
Windows Printer Driver 31
Interfaces
pBuf - [in] Pointer to an array of bytes that contains the data that
should be written to the printer.
Returns:
If the function succeeds the return value is nonzero.
If the function fails, the return value is zero.
BOOL NCRPOS_ReadPrinter(HANDLE hPrinter, LPVOID pBuf,
DWORD cbBuf, LPDWORD pNoBytesRead)
Retrieves data from the specified printer.
32 Windows Printer Driver
Parameters:
hPrinter - [in] Handle to the printer for which to retrieve data. Use
the OpenPrinter function to retrieve a printer handle.
cbBuf - [in] Specifies the size, in bytes, of the buffer to which pBuf
points.
Returns:
If the function succeeds the return value is nonzero.
If the function fails, the return value is zero.
BOOL CALLBACK NCRPOS_PrinterStatus(LPSTR PrinterName,
LPDWORD NCRPOSMsg)
Retrieves 32-bit printer status message identifier posted by the
Language Monitor Module of the specified Printer Driver.
Parameters:
Returns:
If the function succeeds the return value is True.
If the function fails, the return value is False.
Windows Printer Driver 33
Sr. No. NCR printer status 32-bit error code used by Language Monitor
Macro 32-bit value
DLL-Related Functions
HMODULE LoadLibrary(LPCTSTR lpFileName)
Maps the specified executable module into the address space of the
calling process.
Parameter:
lpFileName - [in] Pointer to a null-terminated string that names the
executable module (either a .dll or .exe file). The name specified is
the file name of the module and is not related to the name stored in
the library module itself, as specified by the LIBRARY keyword in
the module-definition (.def) file.
If the string specifies a path but the file does not exist in the
specified directory, the function fails. When specifying a path, be
sure to use backslashes (\), not forward slashes (/).
If the string does not specify a path, the function uses a standard
search strategy to find the file.
Returns:
If the function succeeds, the return value is a handle to the module.
If the function fails, the return value is NULL. To get extended
error information, call GetLastError.
Parameters:
hModule - [in] Handle to the DLL module that contains the function
or variable. The LoadLibrary function returns this handle.
Returns:
If the function succeeds, the return value is the address of the
exported function or variable.
If the function fails, the return value is NULL. To get extended
error information, call GetLastError.
Parameters:
hModule - [in, out] Handle to the loaded DLL module. The
LoadLibrary function returns this handle.
Returns:
If the function succeeds the return value is nonzero.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
36 Windows Printer Driver
Parameters:
pPrinterName - [in] Pointer to a null-terminated string that
specifies the name of the printer or print server.
Returns:
If the function succeeds the return value is nonzero.
If the function fails, the return value is zero.
Parameters:
hPrinter - [in] Handle to the printer.
Returns:
If the function succeeds, the return value identifies the print job.
If the function fails, the return value is zero.
Parameters:
hPrinter - [in] Handle to the printer.
Returns:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
38 Windows Printer Driver
Parameters:
hPrinter - [in] Handle to the printer for which the page will be
concluded.
Returns:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters:
hPrinter - [in] Handle to a printer for which the print job should be
ended.
Returns:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters:
hPrinter - [in] Handle to the printer object to be closed.
Returns:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.