Citizen CT-D101 Series Programming Manual

Citizen CT-D101 Series Programming Manual

Hide thumbs Also See for CT-D101 Series:
Table of Contents

Advertisement

UWP POS Print SDK
Programming Manual
For Ver. 2.00

Advertisement

Table of Contents
loading

Summary of Contents for Citizen CT-D101 Series

  • Page 1 UWP POS Print SDK Programming Manual For Ver. 2.00...
  • Page 2 CITIZEN UWP POS Print SDK - Programming Manual Revision Record Date Version Description May 22 2017 1.00 New issue. - Added CT-S751/CT-S4500 to supported models. May 8, 2019 1.01 - Added “3.3 About printing UTF-8 encode characters”. - Added CT-D101/CT-E301/CT-E601 and CT-D151-L/CT-E651-L to supported models.
  • Page 3 Microsoft Corporation in the United States and/or other countries. (Official name for Windows is Microsoft Windows Operating System.) Company names and product names appearing on this document are trademarks and/or registered trademarks of respective companies. CITIZEN is a registered trademark of Citizen Watch Co., Ltd.
  • Page 4: Table Of Contents

    CITIZEN UWP POS Print SDK - Programming Manual Table of Contents 1. Introduction ................................ 7 1.1. Document target range ..........................7 1.2. System summary ............................7 1.3. Supported printer models .......................... 7 1.4. Printer setting ............................9 1.5. Supported Peripheral Devices models ....................18 1.6.
  • Page 5 CITIZEN UWP POS Print SDK - Programming Manual 2.3.36. RecLineSpacing property ........................68 2.3.37. MapMode property ..........................69 2.4. Notes ................................. 70 2.4.1. Function to detect the completion of printing ..................70 2.4.2. Log function ............................70 2.4.3. About printing UTF-8 encode characters ..................... 71 2.4.4.
  • Page 6 CITIZEN UWP POS Print SDK - Programming Manual 4.4.1. Logging function ..........................112 4.4.2. List of Constants Predefined ......................113...
  • Page 7: Introduction

    CITIZEN UWP POS Print SDK - Programming Manual 1. Introduction This document is a programming manual for the CITIZEN UWP POS Print SDK. 1.1. Document target range This document is intended for developers who integrate their UWP (Universal Windows Platform) application programs with CITIZEN POS printers.
  • Page 8 CITIZEN UWP POS Print SDK - Programming Manual Series of Model Object Model Interface Printer Functions CT-D101 Series CT-D101 Wired LAN Standard CT-D150 Series CT-D150 Wired LAN Standard CT-D151 Standard Wired/Wireless LAN, CT-D151 Series Bluetooth CT-D151-L Blackmark paper is supported...
  • Page 9: Printer Setting

    CITIZEN UWP POS Print SDK - Programming Manual 1.4. Printer setting It is the prerequisite for the use of this SDK that the memory switch of the printer is set as listed below. CT-D101 Series Memory Switch Setting MSW No.
  • Page 10 CITIZEN UWP POS Print SDK - Programming Manual CT-D151 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receive Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 11 CITIZEN UWP POS Print SDK - Programming Manual CT-E351 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 12 CITIZEN UWP POS Print SDK - Programming Manual CT-E651 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 13 CITIZEN UWP POS Print SDK - Programming Manual CT-S281 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 14 CITIZEN UWP POS Print SDK - Programming Manual CT-S601/651/801/851 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 15 CITIZEN UWP POS Print SDK - Programming Manual CT-S751 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 16 CITIZEN UWP POS Print SDK - Programming Manual CT-S4000 Series Memory Switch Setting MSW No. Function Setting Power ON Info Valid Buffer Size 4K bytes Busy condition Full Receiving Error Print ? CR Mode Ignored Auto cutter Valid Full Col Print...
  • Page 17 CITIZEN UWP POS Print SDK - Programming Manual Series. The firmware of a printer with older than followings, it is necessary to update the firmware. Model Firmware Version CT-S601 DL00-2000 or newer CT-S651 DM00-2000 or newer CT-S801 DH00-2000 or newer...
  • Page 18: Supported Peripheral Devices Models

    CITIZEN UWP POS Print SDK - Programming Manual 1.5. Supported Peripheral Devices models The models of peripheral devices applicable for control with this service are as follows. For details on the functions of each model, refer to the instruction manual of each peripheral device.
  • Page 19 CITIZEN UWP POS Print SDK - Programming Manual Prohibited Actions ⚫ Connecting other than a supported peripheral device (USB hub, smartphone, etc.) to a USB port of the interface. ⚫ Inserting and removing the cable connector of the peripheral device into/from a USB port of the interface while the printer power is on.
  • Page 20: Install Instruction

    CITIZEN UWP POS Print SDK - Programming Manual 1.6. Install instruction 1. Close Visual Studio if you are using it. 2. Open "CITIZEN_UWP_POS_SDK###.vsix" ( the installer, where ### represents its version 3. Click "Install" on the "VSIX Installer" window. 4. Click "Close"...
  • Page 21 CITIZEN UWP POS Print SDK - Programming Manual and the "Extensions and Updates..." dialog will be opened. If "CITIZEN UWP POS Print SDK" is listed in this dialog, UWP POS Print SDK is installed successfully.
  • Page 22: Definition Method

    CITIZEN UWP POS Print SDK - Programming Manual 1.7. Definition method Adding Library In your Universal Windows application project in the Solution Explorer window, right-click the "References", and click "Add Reference...". Then the Reference Manager (see below) will open.
  • Page 23 Click "Extensions" on the left side tree, and installed extensions are listed in the Reference Manager. Check "CITIZEN UWP POS Print SDK" in this list and click "OK". Then CITIZEN UWP POS Print SDK will be registered in the project. You can find it in the Solution Explorer.
  • Page 24 Open Package.appxmanifest in the Solution Explorer and open "Capabilities" tab (see below), check "Bluetooth", "Internet (Clients)" and "Private Networks (Client & Server)". Adding Namespace A reference to the name space "com.citizen.sdk" must be stated at the top of the program source code. In the case of C#: using com.citizen.sdk;...
  • Page 25: Printer Control

    CITIZEN UWP POS Print SDK - Programming Manual 2. Printer Control 2.1. Program structure Here is an example program in C# which uses the SDK. // Create an instance. Class definition ESCPOSPrinter printer = new ESCPOSPrinter(); // Connect printer int result = await printer.ConnectAsync ( Connect ESCPOSConst.CMP_PORT_WiFi, "192.168.123.45");...
  • Page 26: Functions List

    CITIZEN UWP POS Print SDK - Programming Manual 2.2. Functions list This SDK provides the following functions. Methods list Function Detail Create class This is constructor method. (Constructor) Connect printer Connect to the printer. (ConnectAsync method) Disconnect printer Disconnect the printer connection.
  • Page 27 CITIZEN UWP POS Print SDK - Programming Manual Set print completed timeout Set the timeout to check the print completion notification. (SetPrintCompletedTimeout method) Log settings Set the log function. (SetLog method) Properties List Function Attribute Detail PageMode area Shows the page area of page mode.
  • Page 28: Library Interfaces

    CITIZEN UWP POS Print SDK - Programming Manual 2.3. Library interfaces The following are the interfaces of this SDK. 2.3.1. Return value Methods to be described later return the value in the list below. Return value Description CMP_SUCCESS (0) The operation is success.
  • Page 29: Constructor

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.2. Constructor Syntax ESCPOSPrinter () Parameter Not exist. Description It is the constructor for this library. It creates an instance. Return value Not exist. Example ESCPOSPrinter printer = new ESCPOSPrinter();...
  • Page 30: Connectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.3. ConnectAsync method Syntax 1) Task<int> ConnectAsync (int connectType, string addr) 2) Task<int> ConnectAsync (int connectType, string addr, int port) 3) Task<int> ConnectAsync (int connectType, string addr, int port, int timeout) Parameter The meaning and the setting range of the parameters are as follows.
  • Page 31 CITIZEN UWP POS Print SDK - Programming Manual (1) The cover of the printer opens. (2) The printer is out of paper. (3) Auto Cutter Error occurred due to paper jam, etc. (4) Unrecoverable error occurred due to circuit failure, etc.
  • Page 32: Disconnectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.4. DisconnectAsync method Syntax Task<int> DisconnectAsync () Parameter Not exist. Description This method is used to disconnect the printer connection. When the end of the print or errors occur, please disconnect the connection by the execution of this method.
  • Page 33: Setencoding Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.5. SetEncoding method Syntax int SetEncoding (string charset) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range charset [IN] Encoding that is supported depends on the Character set name implementation of Windows.
  • Page 34: Printercheckasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.6. PrinterCheckAsync method Syntax Task<int> PrinterCheckAsync () Parameter Not exist. Description This method is used to send the command to get the status of the printer. If the result of this method is successful, you can get the status of the printer by Status method.
  • Page 35: Status Method

    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...
  • Page 36 CITIZEN UWP POS Print SDK - Programming Manual int status3 = printer.Status(ESCPOSConst.CMP_STS_DRAWER_LEVEL_H); if ( (ESCPOSConst.CMP_STS_DRAWER_LEVEL_H & status3) > 0 ) { // Status of pin 3 of drawer kick-out connector = H...
  • Page 37: Printtextasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.8. PrintTextAsync method Syntax Task<int> PrintTextAsync (string data, int alignment, int attribute, int textSize) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range...
  • Page 38: Printbitmapasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.9. PrintBitmapAsync method Syntax 1) Task<int> PrintBitmapAsync (string fileName, int alignment) 2) Task<int> PrintBitmapAsync (string fileName, int width, int alignment) 3) Task<int> PrintBitmapAsync (string fileName, int width, int alignment, int mode) 4) Task<int> PrintBitmapAsync (BitmapDecoder bitmap, int alignment) 5) Task<int>...
  • Page 39 CITIZEN UWP POS Print SDK - Programming Manual Mode can be specified in combination with the halftone and output method. If you want to combine, please specify the logical sum. If mode is omitted, printed at CMP_BM_MODE_HT_THRESHOLD | CMP_BM_MODE_CMD_RASTER. For more information on mode is as follows.
  • Page 40: Printnvbitmapasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.10. PrintNVBitmapAsync method Syntax Task<int> PrintNVBitmapAsync (int nvImageNumber) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range nvImageNumber [IN] Bitmap image number that is stored in...
  • Page 41: Printbarcodeasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.11. PrintBarCodeAsync method Syntax Task<int> PrintBarCodeAsync (string data, int symbology, int height, int width, int alignment, int textPosition) Parameter The meaning and the setting range of the parameters are as follows. Value...
  • Page 42 CITIZEN UWP POS Print SDK - Programming Manual Return value Return CMP_SUCCESS (0) in success. Please refer to "2.3.1. Return value" for the error code except it. Example await printer.PrintBarCodeAsync ( "123456789012", ESCPOSConst.CMP_BCS_UPCA, ESCPOSConst.CMP_ALIGNMENT_LEFT, ESCPOSConst.CMP_HRI_TEXT_ABOVE );...
  • Page 43: Printpdf417Async Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.12. PrintPDF417Async method Syntax Task<int> PrintPDF417Async (string data, int digits, int steps, int moduleWidth, int stepHeight, int ECLevel, int alignment) Parameter The meaning and the setting range of the parameters are as follows.
  • Page 44: Printqrcodeasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.13. PrintQRCodeAsync method Syntax int PrintQRCodeAsync (string data, int moduleSize, int ECLevel, int alignment) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range...
  • Page 45: Printgs1Databarstackedasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.14. PrintGS1DataBarStackedAsync method Syntax Task<int> PrintGS1DataBarStackedAsync (string data, int symbology, int moduleSize, int maxSize, int alignment) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning...
  • Page 46: Cutpaperasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.15. CutPaperAsync method Syntax Task<int> CutPaperAsync (int type) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range type [IN] CMP_CUT_FULL: Full cut Cut type CMP_CUT_PARTIAL: Partial cut CMP_CUT_FULL_PREFEED:...
  • Page 47: Unitfeedasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.16. UnitFeedAsync method Syntax Task<int> UnitFeedAsync (int ufCount) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range ufCount [IN] Expressed in the unit of measure...
  • Page 48: Markfeedasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.17. MarkFeedAsync method Syntax Task<int> MarkFeedAsync (int type) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range type [IN] CMP_MF_TO_CUTTER: Handling type of label paper or...
  • Page 49: Opendrawerasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.18. OpenDrawerAsync method Syntax Task<int> OpenDrawerAsync (int drawer, int pulseLen) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range drawer [IN] Cash drawer number...
  • Page 50: Transactionprintasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.19. TransactionPrintAsync method Syntax Task<int> TransactionPrintAsync (int control) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range control [IN] Transaction control CMP_TP_TRANSACTION: Begin a transaction.
  • Page 51: Rotateprintasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.20. RotatePrintAsync method Syntax Task<int> RotatePrintAsync (int rotation) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range rotation [IN] Direction of rotation CMP_RP_ROTATE180: Start rotated printing 180°, that is, print...
  • Page 52: Pagemodeprintasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.21. PageModePrintAsync method Syntax Task<int> PageModePrintAsync (int control) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range control [IN] CMP_PM_PAGE_MODE: Page Mode control...
  • Page 53 CITIZEN UWP POS Print SDK - Programming Manual Example // Standard print await printer.PrintNormalAsync( "\u001b|2vCSample 2 - Print\n"); await printer.PrintTextAsync( "1234567890123456789012345678901234567890123456789012345678901234 567890123456789012345678901234567890\n", ESCPOSConst.CMP_ALIGNMENT_RIGHT, ESCPOSConst.CMP_FNT_DEFAULT, ESCPOSConst.CMP_TXT_1WIDTH | ESCPOSConst.CMP_TXT_1HEIGHT); // Start of Page Mode await printer. PageModePrintAsync( ESCPOSConst.CMP_PM_PAGE_MODE ); // Set offset of Page Mode printer.SetPageModeVerticalPosition( 0 );...
  • Page 54: Clearprintarea Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.22. ClearPrintArea method Syntax int ClearPrintArea () Parameter Not exist. Description This method is used to clear the area defined by the PageModePrintArea property. Return value Return CMP_SUCCESS (0) in success. Please refer to "2.3.1.
  • Page 55: Clearoutputasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.23. ClearOutputAsync method Syntax Task<int> ClearOutputAsync () Parameter Not exist. Description This method is used to clear all buffered output data by TransactionPrintAsync method PageModePrintAsync method. Also, when possible, halts outputs that are in progress. At the same time, the command to clear print data on the printer is sent.
  • Page 56: Printdataasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.24. PrintDataAsync method Syntax Task<int> PrintDataAsync (byte[] data) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range data [IN] Send data Description This method is used to send data bytes to the printer directly.
  • Page 57: Printnormalasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.25. PrintNormalAsync method Syntax Task<int> PrintNormalAsync (string data) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range data [IN] Print data (Support OPOS escape sequence) Description This method is used to print using the escape sequences that are defined in the OPOS.
  • Page 58: Getversioncode Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.26. GetVersionCode method Syntax int GetVersionCode () Parameter Not exist. Description This method is used to get a numerical value for the version number of this SDK. Return value Return a numerical value for the version number of this SDK. (200 means Ver2.00) Example printer.GetVersionCode();...
  • Page 59: Getversionname Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.27. GetVersionName method Syntax string GetVersionName () Parameter Not exist. Description This method is used to get a string for the version number of this SDK. Return value Return a string for the version number of this SDK. ("2.00" means Ver2.00) Example printer.GetVersionName();...
  • Page 60: Watermarkprintasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.28. WatermarkPrintAsync method Syntax Task<int> WatermarkPrintAsync (int start, int nvImageNumber, int pass, int feed, int repeat) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning...
  • Page 61: Setprintcompletedtimeout Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.29. SetPrintCompletedTimeout method Syntax int SetPrintCompletedTimeout(int timeout) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range timeout [IN] Timeout until the end Timeout is calcurated from print data, of printing automatically.
  • Page 62: Setlog Method

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.30. SetLog method Syntax void SetLog (int mode, string path, int maxSize) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range mode [IN]...
  • Page 63: Pagemodearea Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.31. PageModeArea property Syntax string PageModeArea Attribute Read only Description This property holds the page area. Expressed in the unit of measure given by MapMode (default dots). The string consists of two ASCII numbers separated by a comma, in the following order: horizontal size, vertical size.
  • Page 64: Pagemodeprintarea Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.32. PageModePrintArea property Syntax string PageModePrintArea Attribute Read/Write Description This property holds the print area of Page Mode. Expressed in the unit of measure given by MapMode (default dots). The maximum print area is the page area.
  • Page 65: Pagemodeprintdirection Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.33. PageModePrintDirection property Syntax int PageModePrintDirection Attribute Read/Write Description This property holds the print direction of the Page Mode print area. The print direction values are as follows. Value Meaning CMP_PD_LEFT_TO_RIGHT Print left to right, starting at top left position of the print area, i.e., normal printing.
  • Page 66: Pagemodehorizontalposition Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.34. PageModeHorizontalPosition property Syntax int PageModeHorizontalPosition Attribute Read/Write Description This property holds the horizontal start position offset within the Page Mode print area. Expressed in the unit of measure given by MapMode (default dots).
  • Page 67: Pagemodeverticalposition Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.35. PageModeVerticalPosition property Syntax int PageModeVerticalPosition Attribute Read/Write Description This property holds the vertical start position offset within the Page Mode print area. Expressed in the unit of measure given by MapMode (default dots).
  • Page 68: Reclinespacing Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.36. RecLineSpacing property Syntax int RecLineSpacing Attribute Read/Write Description This property holds the spacing of each single-high print line, including both the printed line height plus the whitespace between each pair of lines. Expressed in the unit of measure given by...
  • Page 69: Mapmode Property

    CITIZEN UWP POS Print SDK - Programming Manual 2.3.37. MapMode property Syntax int MapMode Attribute Read/Write Description This property holds the mapping mode of the printer. The mapping mode defines the unit of measure used for other properties, such as line heights and line spacing. The map mode values are as follows.
  • Page 70: Notes

    CITIZEN UWP POS Print SDK - Programming Manual 2.4. Notes Notes of this SDK are as follows. 2.4.1. Function to detect the completion of printing In this SDK, after the printing output, the SDK waits for the printing completion reply from a printer and judge the success / failure of the method.
  • Page 71: About Printing Utf-8 Encode Characters

    CITIZEN UWP POS Print SDK - Programming Manual Log file name The extension of log files is ".log". In the file name, a numeric character which means the day of week is followed to ”CSJPOSLib”. The numeric character is from 0 to 6. "0" means Sunday, "1" means Monday.
  • Page 72 CITIZEN UWP POS Print SDK - Programming Manual Example printer.SetEncoding( "UTF-8" ); Supported models Model Firmware Version Conditions CT-S251 EM01-0304 or newer DT00-1000 or newer CT-S310II DT10-1100 or newer CT-S601II EE00-0200 or newer CT-S651II EA00-0200 or newer CT-S801II ED00-0200 or newer...
  • Page 73: List Of Constants Predefined

    CITIZEN UWP POS Print SDK - Programming Manual 2.4.4. List of Constants Predefined Data Type Name Value Description type Result/Error CMP_SUCCESS 0 Successfully completed CMP_E_CONNECTED 1001 Already connected CMP_E_DISCONNECT 1002 Not connected CMP_E_NOTCONNECT 1003 Failed to connect CMP_E_CONNECT_NOTFOUND 1004 Non supported model...
  • Page 74 CITIZEN UWP POS Print SDK - Programming Manual CMP_TXT_7HEIGHT 6 7 times height CMP_TXT_8HEIGHT 7 8 times height Side CMP_SIDE_RIGHT 0 Right side CMP_SIDE_LEFT 1 Left side Bitmap width CMP_BM_ASIS -11 One bitmap pixel per printer dot Bitmap mode CMP_BM_MODE_CMD_RASTER...
  • Page 75 CITIZEN UWP POS Print SDK - Programming Manual Transaction CMP_TP_TRANSACTION 11 Begin transaction control CMP_TP_NORMAL 12 End transaction Rotation CMP_RT_NORMAL 0x0001 End rotation control CMP_RT_ROTATE180 0x0103 Begin upside-down rotation CMP_RP_BARCODE 0x1000 Begin barcode rotation CMP_RP_BITMAP 0x2000 Begin bitmap rotation Page mode...
  • Page 76: Linedisplay Control

    CITIZEN UWP POS Print SDK - Programming Manual 3. Linedisplay Control 3.1. Program structure Here is an example program in C# which uses the SDK // Create an instance. Class definition LineDisplay display = new LineDisplay(); // Connect Linedisplay int result = await display.ConnectAsync(LineDisplayConst.CDP_PORT_WiFi, Connect "192.168.10.1");...
  • Page 77: Functions List

    CITIZEN UWP POS Print SDK - Programming Manual 3.2. Functions list This SDK provides the following functions. Methods list Function Detail Connect display This method connects to the line display (ConnectAsync method) Disconnect display This method disconnects the line display connection.
  • Page 78: Library Interfaces

    CITIZEN UWP POS Print SDK - Programming Manual 3.3. Library interfaces The following are the interfaces of this SDK. 3.3.1. Return value Methods to be described later return the value in the list below. Return value Description CDP_SUCCESS (0) The operation is success.
  • Page 79: Constructor

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.2. Constructor Syntax LineDisplay () Parameter Not exist. Description It is the constructor for the library. Create an instance. Return value Not exist. Example LineDisplay display = new LineDisplay();...
  • Page 80: Connectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.3. ConnectAsync method Syntax 1) Task<int> ConnectAsync (int connectType, String addr) 2) Task<int> ConnectAsync (int connectType, String addr, int port) 3) Task<int> ConnectAsync (int connectType, String addr, int port, int timeout) Parameter The meaning and the setting range of the parameters are as follows.
  • Page 81: Disconnectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.4. DisconnectAsync method Syntax Task<int> DisconnectAsync () Parameter Not exist. Description This method is used to disconnect the line display connection. When the end of the line display or some kind of errors occurs, please disconnect the connection by the execution of this method.
  • Page 82: Displaytextasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.5. DisplayTextAsync method Syntax Task<int> DisplayTextAsync (String data, boolean reverseFlag) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range Data Text data String ReverseFlag Reverse specification flag...
  • Page 83: Cleardisplayasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.6. ClearDisplayAsync method Syntax await Task<int> ClearDisplayAsync (int displayArea) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range displayArea Clear area CDP_AREA_ALL(0): Entire area CDP_AREA_CURSORLINE(1):Cursor line When the argument is omitted, it is treated as CDP_AREA_ALL.
  • Page 84: Blinkdisplayasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.7. BlinkDisplayAsync method Syntax Task<int> BlinkDisplayAsync (int intervalBlink) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range IntervalBlink Blink interval (msec) From 0 Description This method causes the entire display screen to blink.
  • Page 85: Setdisplaymodeasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.8. SetDisplayModeAsync method Syntax Task<int> SetDisplayModeAsync (int displayMode) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range DisplayMode Display mode CDP_OVERWRITE(1): Overwrite mode CDP_VERTICALSCROLL(2): Vertical scroll mode...
  • Page 86: Setdisplayconfigasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.9. SetDisplayConfigAsync method Syntax Task<int> SetDisplayConfigAsync (int brightness) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range Brightness Brightness (%) 0 to 100 Description This method changes the brightness of the display screen.
  • Page 87: Setcursorpositionasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.10. SetCursorPositionAsync method Syntax Task<int> SetCursorPositionAsync (int x, int y) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range Digit position From 1 Line position...
  • Page 88: Movecursorasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.11. MoveCursorAsync method Syntax Task<int> MoveCursorAsync (int dx, int dy) Parameter The meanings and settable values of the parameters are as follows. Value Meaning Settable range Rightward/leftward -128 to 127 movement amount...
  • Page 89: Setcursortypeasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.12. SetCursorTypeAsync method Syntax Task<int> SetCursorTypeAsync (int cursorType) Parameter The meanings and settable values of the parameters are as follows. Element Meaning Settable range CursorType Cursor type specification CDP_TYPE_NONE: Hide cursor CDP_TYPE_UNDERLINE: Display cursor...
  • Page 90: Initializedisplayasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.13. InitializeDisplayAsync method Syntax Task<int> InitializeDisplayAsync () Parameter None Description Initializes the device. Return value Return CDP_SUCCESS (0) in success. Please refer to "3.3.1 Return value"" for the error code except it.
  • Page 91: Displaydataasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.14. DisplayDataAsync method Syntax Task<int> DisplayDataAsync (byte[] data) Parameter The meanings and settable values of the parameters are as follows. Element Meaning Settable range data Send data Description This method is used to transmit byte data as it is to the device.
  • Page 92: Setencoding Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.15. SetEncoding method Syntax int SetEncoding (String charset) Parameter The meanings and settable values of the parameters are as follows. Element Meaning Settable range data Send data Description This method is used to set the encoding of the send data to the display.
  • Page 93: Setcodepageasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.16. SetCodePageAsync method Syntax Task<int> SetCodePageAsync (int codePage) Parameter The meanings and settable values of the parameters are as follows. Element Meaning Settable range 0 - 255 codePage Code page specification Description Please refer to the command reference "ESC t"...
  • Page 94: Setinternationalcharactersetasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.17. SetInternationalCharactersetAsync method Syntax Task<int> SetInternationalCharactersetAsync (int characterset) Parameter The meanings and settable values of the parameters are as follows. Element Meaning Settable range 0 - 16 codePage International character specification Description Set the following international character set.
  • Page 95: Displaycheckasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.18. DisplayCheckAsync method Syntax Task<int> DisplayCheckAsync () Parameter Not exist. Description This method is used to check the display connection status. When the execution result of this method is successful, you can confirm that the display is connected.
  • Page 96: Getversioncode Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.19. GetVersionCode method Syntax int GetVersionCode () Parameter Not exist. Description This method is used to get a numerical value for the version number of this SDK. Return value Return a numerical value for the version number of this SDK. (Ver1.00 is 100) Example int vno = display.GetVersionCode();...
  • Page 97: Getversionname Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.20. GetVersionName method Syntax String GetVersionName () Parameter Not exist. Description This method is used to get a string for the version number of this SDK. Return value Return a string for the version number of this SDK. (Ver1.00 is "1.00") Example String vname = display.GetVersionName();...
  • Page 98: Setlog Method

    CITIZEN UWP POS Print SDK - Programming Manual 3.3.21. SetLog method Syntax void SetLog (int mode, String path, int maxSize) Parameters Parameter [IN/OUT] Description Setting range mode [IN] Logging mode 0: None 1: Access logs 2: Error logs path [IN]...
  • Page 99: Notes

    CITIZEN UWP POS Print SDK - Programming Manual 3.4. Notes Notes of this SDK are as follows. 3.4.1. Logging function This SDK supports the log function which records the methods and properties. When setting the log function, use the SetLog method, or placing a file "CSJPOSLibD.cfg"...
  • Page 100: List Of Constants Predefined

    CITIZEN UWP POS Print SDK - Programming Manual 2019/12/24 13:26:33 ------------------------------------------------------- 2019/12/24 13:26:33.706 8028 008 METHOD result DisplayTextAsync() -> Success(0) * When this SDK works with logging, it performs uncomfortably because a log file will be updated at every method and accessing properties .
  • Page 101: Barcode Scanner Control

    CITIZEN UWP POS Print SDK - Programming Manual 4. Barcode Scanner Control 4.1. Program structure Here is an example program in C# which uses the SDK // Create an instance. Class definition Scanner scanner = new Scanner(); // Data event definition.
  • Page 102: Functions List

    CITIZEN UWP POS Print SDK - Programming Manual 4.2. Functions list This SDK provides the following functions. Methods list Function Detail Connect scanner This method connects to the scanner. (connectAsync method) Disconnect scanner This method disconnects the scanner connection. (DisconnectAsync method) Get version code This method gets a numerical value for the version number of this SDK.
  • Page 103: Library Interfaces

    CITIZEN UWP POS Print SDK - Programming Manual 4.3. Library interfaces The followings are the interfaces of this SDK. 4.3.1. Return value Methods to be described later return the value in the list below. Return value Description CSC_SUCCESS (0) The operation is success.
  • Page 104: Constructor

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.2. Constructor Syntax Scanner () Parameter Not exist. Description It is the constructor for the library. Create an instance. Return value Not exist. Example Scanner scanner = new Scanner();...
  • Page 105: Connectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.3. ConnectAsync method Syntax 1) Task<int> ConnectAsync (int connectType, String addr) 2) Task<int> ConnectAsync (int connectType, String addr, int port) 3) Task<int> ConnectAsync (int connectType, String addr, int port, int timeout) Parameter The meaning and the setting range of the parameters are as follows.
  • Page 106: Disconnectasync Method

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.4. DisconnectAsync method Syntax Task<int> DisconnectAsync () Parameter Not exist. Description This method is used to disconnect the barcode scanner connection. When the end of the scanner or some kind of errors occurs, please disconnect the connection by the execution of this method.
  • Page 107: Getversioncode Method

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.5. GetVersionCode method Syntax int getVersionCode () Parameter Not exist. Description This method is used to get a numerical value for the version number of this SDK. Return value Return a numerical value for the version number of this SDK. (Ver1.00 is 100) Example int vno = scanner.GetVersionCode();...
  • Page 108: Getversionname Method

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.6. GetVersionName method Syntax String getVersionName () Parameter Not exist. Description This method is used to get a string for the version number of this SDK. Return value Return a string for the version number of this SDK. (Ver1.00 is "1.00") Example String vname = scanner.GetVersionName();...
  • Page 109: Setlog Method

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.7. SetLog method Syntax void SetLog (int mode, String path, int maxSize) Parameters Parameter [IN/OUT] Description Setting range mode [IN] Logging mode 0: None 1: Access logs 2: Error logs path [IN]...
  • Page 110: Dataevent Event

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.8. DataEvent event Syntax void DataEventHandler(byte[] status) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range data [IN] Scan data Description This event notifies data entry from the barcode scanner.
  • Page 111: Statusupdate Event

    CITIZEN UWP POS Print SDK - Programming Manual 4.3.9. StatusUpdate event Syntax void StatusUpdateEventHandler(int status) Parameter The meaning and the setting range of the parameters are as follows. Value [IN/OUT] Meaning Setting range Status [IN] Status information CSC_SUE_POWER_ONLINE(2001): Device is ready...
  • Page 112: Notes

    CITIZEN UWP POS Print SDK - Programming Manual 4.4. Notes Notes of this SDK are as follows. 4.4.1. Logging function This SDK supports the log function which records the methods and the events. When setting the log function, use the SetLog method, or placing a file "CSJPOSLibS.cfg"...
  • Page 113 CITIZEN UWP POS Print SDK - Programming Manual * When this SDK works with logging, it performs uncomfortably because a log file will be updated at every method and accessing properties. * Because of the following reasons or else, log data will not be stored without any notification.
  • Page 114 CITIZEN UWP POS Print SDK - Programming Manual CITIZEN UWP POS Print SDK - Programming Manual July 28, 2021 For Ver. 2.00 CITIZEN SYSTEMS JAPAN CO., LTD. http://www.citizen-systems.co.jp/...

Table of Contents