CX-one CLEARjet Printer CX-one Programmers Manual V1.
CLEARjet GmbH CX-one Acknowledgements Last edition : Edited by: June 2004 Zirl All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior permission in writing.
CLEARjet GmbH CX-one CONTENTS 1 Introduction ........................................................................................................ 4 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 2 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 General procedure to combine driver and control functions .................................8 Sample Program...................................................................................................
CLEARjet GmbH CX-one 1 Introduction The CLEARjet printers are controlled using a special command language based on ASCII characters. This command set allows using of all features and options of CLEARjet printers. The CX-one printer provides an USB- and two RS 232-Interfaces for communication. A printer driver for Windows Operating Systems is available. The CLEARjet “ESCAPE” sequences can be used directly to control the CX-one printer from computers with different or no Operating Systems.
CLEARjet GmbH CX-one 1.1.1 Operating RS 232 - Interface A correct serial communication between Host and printer is only granted by using serial interface cables including RTS / CTS Hardware-handshake and a handshakeoperating Host computer. Note: While the printer is processing (printing / erasing) the handshake is active. The printer won’t be able to respond to brief status requests. Communication activity at the USB interface will also cause activation of the RS 232 Handshake. 1.
CLEARjet GmbH CX-one This illustration shows a typical command sequence for a print cycle: Resets the printer (Flags, Printerbuffer, ...) ESC "r1" (Hex: 1B 72 31) Yello LED on The printer is waiting for a card ESC "1" (Hex: 1B 31) Get brief status CTRL "Z" (Hex: 1A) Delay: min.
CLEARjet GmbH CX-one The following source code (C++) shows a typical sequence using CLEARjet Active CX SDK: Print a label to the card: // Define a variable for the status of transport the commands long lRet = 0; // Select the font size with wich you want to print lRet += m_ctrlCXone.SelectFontSize( 3 ); // See printer manual for fontsize parameter // Set coordinates of the first textline lRet += m_ctrlCXone.PrintPosX( 20 ); lRet += m_ctrlCXone.PrintPosY( 850 ); // Print first line lRet += m_ctrlCXone.
CLEARjet GmbH CX-one 1.4 Use of CX-one Printer Driver Follow the CX-one Setup Instructions for Printer Driver to correctly install the printer driver and/or USB driver. In general the printer driver is designed to operate as a standard driver for Windows operating systems. The CLEARjet printer driver is a plain printer driver for executing of print-jobs only. It includes no additional functions like MAG-Encoding, Chip-reading etc.
CLEARjet GmbH CX-one 1.4.2 Sample Program Use this or a similar program to proceed after printing (if the Windows driver was used). The following steps must be executed for requesting the printer status: 1. Create a handle of the printer with the function "OpenPrinter". 2. Check existing print jobs for the CLEARjet printer with the function "EnumJobs" 3. This function returns the count of existing print jobs in the queue. 4. If the return value is "0" execution of printer commands (e.g.
CLEARjet GmbH CX-one 1.4.3 List of tested functions which can be used prior to Windows driver execution The correct function of the Windows driver in combination with the ESC-commands listed below is tested carefully. Use of commands not listed is not recommended and may cause unpredictable results.
CLEARjet GmbH CX-one 2 CX-one command description 2.1 Used conventions for command description To describe functions and commands the following conventions are used in this manual: CMD {DATA} [n,m,o] [c] [h] [nn\mm] < > Indicates a printer-command Indicates data to or from printer device numerical parameters (num. ASCII char.) parameter (ASCII char.) hexadecimal Parameter selectable parameter.
CLEARjet GmbH CX-one 2.
CLEARjet GmbH CX-one Character and Font Commands Command Parameter Description C D E h b w [n] [m] [n] [n] Select Font 3 ( small ) Select Font 2 ( medium ) Select Font 1 ( large ) Get charactersize Print double-width character Print double-height character Page 27 27 27 27 28 28 Print – and erase Commands Command Parameter Description {DATA} x y d e %p $a %l o T U O N u G $G J [nn]
CLEARjet GmbH CX-one Special commands Command Parameter Description 8 7PRINTER 6 7PRINTER c %h Y # - Auxiliary mode ON Auxiliary mode OFF Transparent mode ON Transparent mode OFF Get card from hopper Eject card on backside Capture card Read direction detector Command Parameter Description z $b %b %z [n]{DATA} [n] [n] Print barcode Mirror barcode Read Barcode Print barcode with double width Command Parameter Description $Mr
CLEARjet GmbH CX-one 2.3 Detailed command descriptions 2.3.1 General control commands Enable printer Description ASCII – Code HEX – Code Disable printer Description ASCII – Code HEX – Code Return card Description ASCII – Code HEX – Code Programmers Manual 1 Enables the printer to take a card from front. When inserted the card is moved to the print position ( = chipreader position). In this position data transfer to the chipcard is possible.
CLEARjet GmbH CX-one Printenergy offset Description ASCII – Code HEX – Code Example $Op[c] [nnn] This offset is used to adjust the printenergy. The offset value is added to the DIP-switch setting. Use Ms command to store the offset-value to the memory for permanent use. [c][nnn].... Offset value -100 to +200 Note: Power down or a printer reset within 5 sec. after using this command may cause unpredictable results.
CLEARjet GmbH CX-one Set printer resolution Description i[c] This command sets the resolution of your printer in y-direction. [c]=0 200 dpi [c]=1 300 dpi (default) [c]=2 not in use [c]=3 not in use [c]=4 600 dpi Note: All settings other than [c]=1 (300 dpi) are active for one card only. For the next card the printer automatically returns to the default of 300 dpi. ASCII – Code HEX – Code Example The resolution in x-direction is 200 or 300dpi, depending on the printhead actually used.
CLEARjet GmbH CX-one Disable erase roller heating permanent Description %L[n] Use this command to activate or deactivate the eraserroller heating permanent. In deactivated state the eraseroller heating is stopped and no heat-up will be done. Use parameter 1 to reactivate erase-roller heating. Parameter is stored to EEPROM.
CLEARjet GmbH CX-one Move-in erase Description ASCII – Code HEX – Code Example $p[n] Erase operation is done during move-in the card from front. Card cycle time is shortened because of saving one transport cycle. Please note, that the printer can’t erase the first 30% of the card. This command is useful only if cards are fetched from front [n] = 0..... disable move in erase [n] = 1.....
CLEARjet GmbH CX-one Save parameter Ms Description Save all parameters to EEPROM ASCII – Code HEX – Code Note: Power down or a printer reset within 5 sec. after using this command may cause unpredictable results.
CLEARjet GmbH CX-one Read parameter from RAM Mm [nn] Read presently used parameter from RAM memory. [nn] parameter-code (See table below). Mm [nn] 1B 4D 6D [nn] Mm00 Description ASCII – Code HEX – Code Example Read presently used printenergy value from RAM Response : +00150 1 char.
CLEARjet GmbH CX-one Reset Description r[n] Usage at normal printer mode: [n]=1: Reset all parameters to default values and clear the printer buffer [n]=2: clear the printer buffer ____________________________________________ Usage at error state: a warm start is executed.
CLEARjet GmbH CX-one Brief status Description ASCII – Code HEX – Code Return-Parameter from printer Read card position and printer status. 1A The response is one binary character.
CLEARjet GmbH CX-one Printhead status Description ASCII – Code HEX – Code Return-Parameter from printer A[n] Read printhead status. The result string shows number and position of electrical dot-failures.
CLEARjet GmbH CX-one ERROR code $E Description ASCII – Code HEX – Code Return-Parameter from printer Example Use this command to read the ERROR code if printer is in ERROR mode. The table below will help you to find the fault.
CLEARjet GmbH 00931 Printhead position could not be found • • • 00932 Photosensor defective or interrupted (clean sensor path) Motor for printhead rotation defective Mainboard defective Card path or motor movement blocked (card got stuck) Error at preheating: No signal-change during preheating • • • 00992 Photosensor defective or interrupted (clean sensor path) Motor for printhead rotation defective Mainboard defective Card jam at printing • • • • 00991 CX-one Temp.
CLEARjet GmbH CX-one 2.3.2 Character and font commands All internal printer-fonts use proportional character spacing. Charactersize of internal Fonts is different when using 300 dpi printhead. Select Font3 Description ASCII – Code HEX – Code C Select the small typeface, Font3. Print height ca. 1.5 mm at 200 dpi printhead C 1B 43 Select Font2 Description ASCII – Code HEX – Code D Select the medium typeface, Font2. Print height ca.
CLEARjet GmbH CX-one Print double-width characters b[n] Description Print all characters at double width [n]=0 double-width character OFF (default) [n]=1 double-width character ON ASCII – Code HEX – Code b[n] 1B 62 [n] Print double-height characters w[n] Description Print all characters at double height [n]=0 double-height character OFF (default) [n]=1 double-height character ON ASCII – Code HEX – Code w[n] 1B 77 [n] Programmers Manual Page 28 / 53
CLEARjet GmbH CX-one 2.3.3 Print- and erase commands Start printing Description ASCII – Code HEX – Code {DATA} Printing of previous sent data starts after . ( find the character-set table at Appendix of this manual ) {DATA} {DATA} 0C Print position x-coordinate Description ASCII – Code HEX – Code Example x[nn] Sets the print position of the following text to position x. The parameter [nn] determines the offset from zero; Possible values for [nn] between 00 and 48.
CLEARjet GmbH CX-one Print position y-coordinate Description ASCII – Code HEX – Code Example y[nnn] Sets the print position of the following text to position y. The parameter [nnn] determines the offset from zero in micro lines.
CLEARjet GmbH CX-one Limit erase area Description ASCII – Code HEX – Code Example e[nnn][mmm] The erase area is limited to the domain [nnn] to [mmm] During the next print procedure this limited area will be erased. The rest of the card will not be affected, the data in those areas retains unchanged. [nnn] possible values range from 000 to 990 [mmm] possible values range from 000 to 990 Note: Power down or a printer reset within 5 sec. after using this command may cause unpredictable results.
CLEARjet GmbH CX-one Partial erase Description $a[l][mm][nnn][oo][ppp] This command erases and prints a defined rectangle within only one operating-cycle (Maximum width is 15 units in x direction).
CLEARjet GmbH CX-one Get erase area Description ASCII – Code HEX – Code Example %l This command returns you the actually set erase area in y-direction. %l 1B 25 6C %l Response: 400700 Shift print area Description ASCII – Code HEX – Code Example o[c][nnn] This command enables you to shift the print area in y-direction. [c]... + shift in print-direction [c]... - shift against print-direction Note: Power down or a printer reset within 5 sec.
CLEARjet GmbH CX-one Reset 180° rotation Description ASCII – Code HEX – Code Example U Reset to default (unrotated) orientation This command resets the T function. Note: This command must be used before the print position commands for x- and y-direction.
CLEARjet GmbH CX-one Reset 90° rotation Description ASCII – Code HEX – Code Example N Print text in horizontal direction (default orientation). This command resets the O function. Note: This command must be used before the print position commands for x- and y-direction.
CLEARjet GmbH CX-one Send graphic data Description ASCII – Code HEX – Code Example G[b]{DATA} This command sends the printer data for one dot line to the printer. A parameter between 0x01 and 0x30 must be entered. The parameter must correspond with the number of data bytes that follow. The maximum print width depends on the printhead type (see table below). A logic '1' in is the equivalent of one printed pixel.
CLEARjet GmbH CX-one Send greyscale graphic data Description This command is used to extend the “send graphic data” command, to print dots in greyscale mode.
CLEARjet GmbH CX-one 2.3.4 Card transport commands Start motor forward Description ASCII – Code HEX – Code F Start transport motor in forward direction.
CLEARjet GmbH CX-one 2.3.5 Special commands The following special commands are for use with CX-one special models only. This special models include optional hardware. Use of this commands at standard CX-one models may cause unpredictable results. Auxiliary mode ON Description ASCII – Code HEX – Code 8 Enables the auxiliary mode. A gateway from RS 232 - HOST to RS 232 - CHIP is opened. All following data are copied to the other interface and vice versa.
CLEARjet GmbH CX-one Transparent mode ON Description ASCII – Code HEX – Code 6 Enables the transparent mode. A gateway from RS 232 - HOST to RS 232 - CHIP is opened. All following data are copied to the other interface and vice versa. This function works with 9600 Bd for RS 232 - CHIP port. This feature allows communication with internal interfacedevices by use of only one RS 232 -Port.
CLEARjet GmbH CX-one Get card from hopper Description ASCII – Code HEX – Code The printer gets a card from the hopper. This command works only on special models with a card hopper module. c 1B 63 Eject card on backside Description ASCII – Code HEX – Code ASCII – Code HEX – Code Y This command ejects the card at the rear side of the printer. This command can be used to capture cards and can only be used in conjunction with specific hardware.
CLEARjet GmbH CX-one 2.3.6 Barcode encoding Print barcode Description ASCII – Code HEX – Code z[n]{Data} This commands prints {Data} in the form of a barcode. Use parameter [n] to select the barcode type. Currently supported Barcode: [n]=1: Interleaved 2/5 The number of characters has to be even. z[n]{Data} 1B 7A [n] {Data} 0D Mirror barcode Description ASCII – Code HEX – Code Example $b[n] Rotate barcode 180° (at same printposition).
CLEARjet GmbH CX-one Print barcode with double width Description ASCII – Code HEX – Code Example Programmers Manual %z[n] Additional command for barcodeprinting. Use this command to print readable barcodes for the CX-one barcodereader.
CLEARjet GmbH CX-one 2.3.7 Commands for magnet encoding Note: See character tables Appendix 4.3 Read magnetcode ISO Description $Mr1[n] Read magnetcode - ISO 7816. [n] = 1 select ISO Track 1 [n] = 2 select ISO Track 2 [n] = 3 select ISO Track 3 Note: For this command is a special hardware necessary! In case of read error, no retry is done. For an unwritten magnetcard or a card without a magstripe the printer responses 999, for other read errors the printer responses 000.
CLEARjet GmbH CX-one Read magnetcode JIS II Description $Mr31 Read magnetcode – JIS II Standard. Note: For this command is a special hardware necessary! In case of read error, no retry is done. For an unwritten magnetcard or a card without a magstripe the printer responses 999, for other read errors the printer responses 000. $Mr31 ASCII – Code 1B 24 4D 72 33 31 HEX – Code Response from Printer [nnn]{Read-Data} [nnn]...
CLEARjet GmbH CX-one Write magnetcode JIS I Description ASCII – Code HEX – Code Example $Mw2[n][mmm]{ DATA} Write magnetcode – JIS I Standard. [n] = 1 select JIS I Track 1 (max. 79 alphanumeric char incl. 3 control characters) [n] = 2 select JIS I Track 2 (max. 40 numeric char incl. 3 control characters) [n] = 3 select JIS I Track 3 (max. 107 numeric char incl. 3 control characters) [mmm]...
CLEARjet GmbH CX-one Auto read Description $m[n] This function allows automatically decoding of the magstripe of inserted cards. Activate or deactivate this function with parameter [n] [n] = 0..... disable auto read [n] = 1..... enable auto read Read data are stored in printer memory. To get the data use the "Read magnetcode" command ($Mr..... ) ASCII – Code HEX – Code Example Note: For this command is a special hardware necessary! Command is active until reset.
CLEARjet GmbH CX-one 3 Special Printer-Modes The printer detects several error-situations and is automatically switched to the corresponding error mode. There are 3 different error types: 3.1 Fatal error All LEDs are flashing periodically and printer stops working. In this mode the printer accepts and responds to 4 commands only: r1,r2 Hardware Reset Brief Status $E Read ERROR number 3.2 Non fatal error Error is not indicated, but the command $E returns an error number.
CLEARjet GmbH CX-one 4 Appendix 4.1 ASCII Character set The following table shows the printable character set of CX-one. Note: Characters below hex 20 are not printable control codes! Hex code Character Hex code Character Hex code Character Hex code 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F Space ! “ # $ % & ‘ ( ) * + , .
CLEARjet GmbH * * * * * * * * * * * * * * CX-one Hex code Character Hex code Character Hex code Character A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF ½ Space C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF à ß â ã ä å æ ç è é ê ë ì í î ï
CLEARjet GmbH CX-one 4.3 Character set for Magnet Encoding 4.3.1 ISO & JIS I - Track 1 b4 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 b3 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 b2 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 b1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b6 b5 MSB LSB 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 0 0 1 1 0 1 1 0 1 2 3 SP a a c $ %d a a ( ) a a a .
CLEARjet GmbH CX-one 4.3.2 ISO & JIS I - Track 2/3 b5 MSB b4 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 b3 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 b2 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 b1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 LSB 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0 1 0 1 2 3 4 5 6 7 8 9 * Start sentinel * Separator * Stop sentinel Note: - These characters are not available at these tracks.
CLEARjet GmbH CX-one 4.4 DIP-Switch settings Using the DIP switches you can alter various printer settings.