Copyright CG Times (based upon Times New Roman), CG Triumvirate, MicroType, and TrueType are trademarks of the AGFA Monotype Corporation. PCL, Intellifont, and HP Laser JetII are trademarks of the Hewlett Packard Corporation. Macintosh is a trademark of the Apple Corporation. Windows is a trademark of the Microsoft Corporation. All other brand and product names are trademarks, service marks, registered trademarks, or registered service marks of their respective companies.
Thermal Printer Programmer’s Guide
Table of Contents Table of Contents 1. Programmer’s Guide Overview ...............................................................................................1 Scope ...................................................................................................1 Referenced Documents ........................................................................1 Trademark References .........................................................................1 Datamax-O'Neil Commands ..........................
Table of Contents 2. Appendix A Printer Model Printable Print Widths ...................................................51 3. Appendix B Printer Model Speed ...........................................................................
1 Programmer’s Guide Overview This Programmer’s Guide provides information about printer specific commands that are supported by the following printer(s): • p1115 • p1120n • p1125 • p1115s • p1725 • w1110 The Datamax-O'Neil Performance & Workstation Series printers language is based on Hewlett Packard® PCL 5e. Because this language does not have native support for barcode printing, Datamax-O'Neil has extended the language by adding barcode specific commands.
1 | Programmer’s Guide Microsoft, Windows, and MS-DOS are U.S. registered trademarks of Microsoft Corporation. TrueType is a registered trademark of Apple Computer, Inc. Helvetica and Times Roman are trademarks of Linotype AG and its subsidiaries. Univers is a U.S. registered trademark of Linotype AG and its subsidiaries. Antique Olive is a trademark of Monsieur Marcel OLIVE. Arial is a registered trademark of The Monotype Corporation plc.
Programmer’s Guide | 1 Datamax-O'Neil Commands There are frequent references to Hewlett Packard’s (HP) PCL Technical Reference Manual (TRM). This document can be found on HP’s website listed in the Referenced Documents above. Datamax-O'Neil provides unique commands not within the command set found in the HP’s PCL TRM. No command defined within this document supersedes or negates any commands found within the PCL TRM.
1 | Programmer’s Guide Character (X) Symbol Purpose 0x25 % PCL Language Parameter 0x26 & PCL Cursor Parameter 0x27 ‘ Not Used 0x28 ( PCL Font Parameter 0x29 ) PCL Font Parameter 0x2A * PCL Graphic Parameter 0x2B + Not Used 0x2C , Not Used 0x2D - Not Used 0x2E . Not Used 0x2F / Not USed The value field ‘#’ is a group of characters specifying a numeric value. The value is an ASCII string of characters within the range 0x30 – 0x39.
Programmer’s Guide | 1 The following: &l1O&l2A &l5.81C can be combined into the following single escape sequence: &l1o2a5.81C In the example above, the capital ‘O’ becomes a lower case ‘o’, the ‘A’ of the second command becomes an ‘a’ and the ‘EC&l’ are dropped from the second and third commands. The printer commands are performed in the order they are combined, from left to right. Barcode Clipping PCL normally clips print objects at the dot level on the logical page boundary.
1 | Programmer’s Guide for the next character to be rendered. With raster images, the CAP is moved vertically to the next dot row below the raster image previously rendered and then returned to the horizontal start position of the raster image. The terminus CAP of the barcode is selectable with the commands described below. Set the Current Active Position (CAP) to the right of the last printed text character at a distance equal to the width of that character so the next character can be rendered.
Programmer’s Guide | 1 Table 2: Fonts and Escape Sequences Font Name Escape Sequence Albertus Medium ((s1pv0s1b4362T Albertus Extra Bold ((s1pv0s4b4362T Antique Olive ((s1pv0s0b4168T Antique Olive Italic ((s1pv1s0b4168T Antique Olive Bold ((s1pv0s3b4168T Arial ((s1pv0s0b16602T Arial Italic ((s1pv1s0b16602T Arial
1 | Programmer’s Guide Font Name Escape Sequence Times New Roman Bold Italic ((s1pv1s3b16901T Univers Medium ((s1pv0s0b4148T Univers Medium Italic ((s1pv1s0b4148T Univers Bold ((s1pv0s3b4148T Univers Bold Italic ((s1pv1s3b4148T Univers Condensed Medium ((s1pv4s0b4148T Univers Condensed Medium Italic ((s1pv5s0b414
Programmer’s Guide | 1 PCL Symbol Set PJL Symbol Name Control Panel Name Symbol Set Description 6N ISOL6 ISO-L6 ISO 8859-10 Latin 6 9N ISOL9 ISO-L9 ISO 8859-15 Latin 9 26U PC775 PC-775 PC-775 5M PSMATH PS MATH PS-Math 8M MATH8 MATH-8 Math-8 15U PIFONT IP FONT Pi Font 6J MSPUBL MS PUBL Microsoft Publishing 11U PC8DN PC-8 DN PC-8 Danish/Norwegian 12U PC850 PC-850 PC-850 Multilingual 17U PC852 PC-852 PC-852 13U PC858 PC-858 PC-858 Multilingual 9T PC8TK PC-8 TK
1 | Programmer’s Guide PCL Symbol Set 19M PJL Symbol Name SYMBOL Control Panel Name Symbol Symbol Set Description Symbol Font The table below (PC-850 Symbol Set) is an example of character code mapping and the character image associated with that code.
Programmer’s Guide | 1 Printing Unicode Characters in PCL To print Unicode characters, the symbol set 18N (UCS-2) should be used to set handling to Unicode mapping together with UTF-8 text parsing method. Refer to the following syntax: &t83P(18N(sn1Tdata … The 83P in &t command signifies the UTF-8 text parsing method. The 18N in ( command sets the Unicode mode. The n1T is used to select a font in the (s command where n1 is the typeface id of the font.
1 | Programmer’s Guide Table 4: Example of Printing Barcodes (Compressed Commands) Commands Description %-12345X@PJL SET RESOLUTION = 300CRLF Reset the printer and enter into PJL mode, Set the resolution to 300 DPI @PJL SET PAPERWIDTH=2880CRLF Set the label width to 2880 decipoints (4 inches) @PJL SET PAPERLENGTH=2880CRLF Set the label length to 2880 decipoints (4 inches) @PJL ENTER LANGUAGE = PCLCRLF Select the PCL emulation &a2160h720v270P Set the horizontal cursor position at 2160 d
Programmer’s Guide | 1 Commands Descriptions &a270P Set the writing direction to 270 degrees counter clockwise from horizontal $b1030C Select barcode number 1030 (Code 128 /w Auto select) $b360H Set the barcode height to 360 decipoints (½ inch) $b2A Enable barcode autoprint with checksum $b10W9876543210 With the current barcode (1030) print the 10 bytes of data: 9876543210 &0P Set the writing direction at 0 degrees.
1 | Programmer’s Guide Select Guard Boxes/Bars The following will select guard boxes or bars on barcodes that support them: $b#B 0x1b 0x24 0x62 0x42 Select Barcode Type The following will select the current barcode type: $b#C 0x1b 0x24 0x62 0x43 Note that all barcode commands below operate on the currently selected barcode. The table below contains the list of barcodes and their numerical values.
Programmer’s Guide | 1 Values: Aztec (0-4) PDF 417 (0-8) 0 - 23% 1 - 10% 2 - 23% 3 - 36% 4 - 50% 0 - 2 Codewords 1 - 4 Codewords 2 - 8 Codewords 3 - 16 Codewords 4 - 32 Codewords 5 - 64 Codewords 6 - 128 Codewords 7 - 256 Codewords 8 - 512 Codewords Datamaxtrix (1) 1 - ECC 200 QR Code (1-4) 1 - High Density 7% 2 - Standard Density 15% 3 - High Reliablity 25% 4 - Ultra Reliabilty 30% For Maxicode barcodes: $b#E 0x1b 0x24 0x62 0x45 Where n= 2 = Structured carrier, numeric, US 3 = Structure
1 | Programmer’s Guide Select Barcode Height (PCL Units) The following will set the barcode height in PCL units with 1 decimal. The number of codewords per line are as follows: PDF417 (0-30), Micro PDF (0-4), QR Code (0-40). For Datamatrix it is the symbol size value per the table below.
Programmer’s Guide | 1 and will round up to 1 dot. (3*300)/720 = 1.25 and will round down to 1 dot. (4*300)/720= 1.667 and will round up to 2 dots. The printer will not ensure that the narrow element width is within specification for that barcode type. The default narrow element width will be defaulted to a reasonable value for each barcode type. Select Narrow Bar Width (Dots) The following command, like the one above, will set the width of a narrow bar in PCL units.
1 | Programmer’s Guide Select Barcode Ratio The following command will set the wide-to-narrow bar ratio. $b#R 0x1b 0x24 0x62 0x52 The value of ‘#’ may be one of the following: 1 = 2:1 2 = 7:3 3 = 5:2 4 = 3:1 Any other value will default to the standard ratio of the currently selected barcode. This command only affects Code 3 of 9 and Interleaved 2 of 5. Print Barcode Data The following command will use the provided data in this sequence to print the currently selected barcode.
Programmer’s Guide | 1 insure every resident barcode produced by Datamax-O'Neil Barcode Printers are within industry specification. Upon deciding to modify these values, be aware that some barcode scanners may not be able to property decode the barcode. Also note that any modified values are not stored permanently in the printer. Once the job of labels has completed, the default values are restored.
1 | Programmer’s Guide Barcode ID 1530 Barcode Description USPS Intelligent Mail (OneCode) Narrow Element Width Default Ratio Dots Decipoints 5 12 N/A Default Height Dots Decipoints 45 108 Table 7: 2D Barcodes 2000 QR Code Auto 2010 PDF 417 2020 Micro PDF 2030 Datamatrix 2040 UPS MaxiCode 2050 Aztec Table 8: Valid Barcode Data Barcode ID Barcode Description Length Valid Characters Checksum 1000 Code 3 of 9 1-75 0-9, A-Z, $,%,+,-,.
Programmer’s Guide | 1 Barcode ID Barcode Description Length Valid Characters Checksum 1110 HIBC Code 39 1-36 0-9, A-Z, $,%,+,-,.,/,space Yes 1111 HIBC Code 128 1-36 0-9, A-Z, $,%,+,-,.
1 | Programmer’s Guide The following sequence will print a QR Code (Auto) barcode with error correction capacity of 2, height 10 units, anchor position bottom left and data “This is a test, this is only a test.” $b2000c2e10j0o36WThis is a test, this is only a test. The following sequence will print a UPS Maxicode with anchor point top left, mode 2 structured carrier U.S. numeric.
Programmer’s Guide | 1 Table 9: PJL Commands Command Description Modifications 1 Downloads a file to the printer file system Restrictions added (See below) 1FSMKDIR Creates the specified directory on the printer file system Restrictions added (See below) 1FSDELETE Deletes files or empty directories from the printer file system Restrictions added (See below) 1FSINIT Initializes (formats) the mass storage system Clears user flash file system and reboots (See below) COMMENT Adds a line of info
1 | Programmer’s Guide Caution: Exercise caution when issuing these PJL Commands. They cannot be undone. 1 Use the PJL DISKLOCK variable to prevent unauthorized file system access. Refer to the PJL Technical Reference document for more information. PJL File System Commands For the FSDOWNLOAD, FSMKDIR, and FSDELETE commands, the additional parameter “TYPE” is used to restrict access to the user flash file system.
Programmer’s Guide | 1 In this example, “aaa” is the binary size of the font to be downloaded. “FontName” is the desired internal name of the font. The maximum length of “FontName” is 16 characters. “bbbbb” is the desired typeface id (1-65535) used to access the font in PCL. ”data” is the actual True Type font. Note the “TYPE” parameter must be 5 to download to the user fonts directory in user flash. The filename should be in quotes with the leading 0: to maintain the HP convention.
1 | Programmer’s Guide PJL INFO Read-Back Command This command is used to read back printer information. In addiction to standard parameters the following table are also available, where: %-12345X@PJL INFO xxx @PJL EOJ %-12345X “xxx” is the desired parameter as noted below: Table 11: PJL INFO Read-Back Command Parameters Parameter Description DATETIME Returns the date and time from the printer. SENSORS Returns value of system sensors.
Programmer’s Guide | 1 MOTORTEMPADC=215; HEADVOLTAGEADC=211; TOFADC=190; PAPERLOWADC=137; AUTOLOADADC=213; HEADPRESSUREDECODE=2; PAPERWIDTHDECODE=3; PAPERWIDTHSECTIONS=6; REWINDERCTR=0; The following is sample SYSTEMSTATUS response: @PJL INFO SYSTEMSTATUS ENGINE=IDLE; WARNING=NONE; ERROR=NONE; LASTSYSWARNING=0; LASTSYSERROR=0; ERRORCOUNT=0; LASTLABELCOUNT=0; LASTLABELCOPIES=0; SESSIONLABELS=0; EQUIPPED=0; The following is a sample SYSTEMINFO response: @PJL INFO SYSTEMINFO PRINTERMODEL=p1120n; PRINTHEADMOD
1 | Programmer’s Guide @PJL INFO SETUPFILES File1.stc File2.stc File3.stc File4.stc The PJL INFO RESIDENTFONTS command will return the list of resident fonts, the font number and a PCL sample sequence. There are place holders for the ten allowed download fonts named “Downloaded Font0”, “Downloaded Font1”, “Downloaded Font2”, etc. These names will be replaced with the downloaded font name starting from Font 0.
Programmer’s Guide | 1 The syntax of the command is as follows: %-12345X@PJL JOB NAME = "JOB_NAME" @PJL PERFORM PARAMETER [= value] @PJL EOJ The value is optional as noted below: Table 12: PJL PERFORM Command Parameter Description Value Notes DOTCHECK Performs a dotcheck diagnostic on the print head Number of dots to check. 0 for all EMPTYCAL Performs empty calibration.
1 | Programmer’s Guide Parameter Description Value GPIOREAD Test of GPIO output pins N/A PRINTSETTINGS Print the settings report N/A PRINTINFO Print system info report N/A PRINTNETWORK Print network report N/A PRINTSERIAL Print serial report N/A PRINTGPIO Print Applicator (GPIO) report N/A PRINTFONTS Print fonts report N/A PRINT10 Print internal 10% pattern Quantity to print PRINT20 Print internal 20% pattern Quantity to print PRINT50 Print internal 50% pattern Quantity to p
Programmer’s Guide | 1 %-12345X@PJL JOB NAME = "JOB_CLEAN_END" @PJL PERFORM HEADCLEANMODE = 0 @PJL EOJ PJL Cutter, Rewinder, and Ribbon Assembly Self-Test Commands Prior to performing self test procedures for options, the self test mode must be entered as the following: %-12345X@PJL JOB NAME = "JOB_SELFTEST_INIT" @PJL PERFORM SELFTEST = 1 @PJL EOJ For rewinder or ribbon assembly tests the media should be detached from the mechanism.
1 | Programmer’s Guide %-12345X@PJL JOB NAME = "JOB_SELFTEST_INIT" @PJL PERFORM SELFTEST = 1 @PJL EOJ When the self tests are complete the following command is used to disable the self test mode: %-12345X@PJL JOB NAME = "JOB_SELFTEST_END" @PJL PERFORM SELFTEST = 0 @PJL EOJ PJL GPIO Wrap Test To run the GPIO wrap test, either the wrap connector or the GPIO test board with wrap jumper should be connected to the printer and the following command should be issued:
Programmer’s Guide | 1 PJL GPIO Write Test Prior to performing the GPIO write test, the GPIO parameters in the database should be set using either the front panel, PJL variables or by other means. The signal function for all pins should be “None”. The signal type for all pins should be “High”. For pulse mode, the “High Pulse” value should be used for output pins. The I/O configuration should be set with an integer representing a bitwise value where first bit is pin 1, the second bit is pin 2, etc.
1 | Programmer’s Guide %-12345X@PJL JOB NAME = "JOB_NAME" @PJL PERFORM CONFIG [= value] @PJL EOJ The value is optional as noted below. Table 13: PJL CONFIG Command Parameter Description Value Notes SAVEMEDIA Saves current media settings to internal media setups “0:filename.stm” See below SAVESETUP Saves current setup settings to internal user setups “0:filename.stc” See below LOADMEDIA Loads a media configuration from internal media “filename.
Programmer’s Guide | 1 %-12345X@PJL JOB NAME = "JOB_UPGRADE" @PJL UPGRADE SERVERIP = “xxx.xxx.xxx.xxx” FILENAME = “SW…bin” @PJL EOJ %-12345X SERVERIP is the IP address of the TFTP server and FILENAME is the software package name. PJL Variables The PJL variables supported by the printer include some standard as well as custom variables. The DEFAULT command allows the user to set a variable permanently, however this should never appear in a configuration header for a PCL print job.
1 | Programmer’s Guide Variable Description Range Default KEYPROMPT Informs the user interface to prompt the user for the next label OFF, ON OFF PAUSEMODE Same as KEYPROMPT OFF, ON OFF CUTTER7 When a cutter is installed, this controls the cutting action for the media OFF, ON, PERLABEL OFF CUTBYCOUNT10 The number of labels to print before cutting 0-32767 1 REWINDER When the rewinder is installed, this controls the operation and direction of the powered internal label rewinder OFF, CLOC
Programmer’s Guide | 1 Variable Description Range Default AUTOCALIBRATE Automatically calibrates the paper out sensors after loading the paper OFF, ON ON AUTOPRESENTDIST Enables the automatic setting of the present distance OFF, ON ON AUTOTENSION 6 Enables the automatic setting of tension OFF, ON ON AUTOPRESSURE 6 Enables the automatic setting of pressure OFF, ON ON AUTOMEDIAGLOBAL 6 Enables the automatic setting of media parameters OFF, ON ON AUTOSPEEDADJUST Enables the automatic
1 | Programmer’s Guide Variable Description Range Default PRINTONGAP Sets the printer to print on gap/ mark or not OFF, ON OFF DARKNESS7 This allows for the adjustment of the darkness of the printed image due to printhead thermal variations. ± 20 0 SHARPNESS4, 7 This allows for the adjustment of the leading edge darkness of the printed image due to printhead thermal variations.
Programmer’s Guide | 1 Variable Description Range Default PAPERREFLDOWNRIGHT4 Paper reflective sensor threshold for the bottom outside sensor 0-255 128 GAPTRANSLEFT 4 Gap transmissive sensor threshold for the inside sensor 0-255 128 GAPTRANSRIGHT 4 Gap transmissive sensor threshold for the outside sensor 0-255 128 MARKREFLUPLEFT 4 Mark reflective sensor threshold for the top inside sensor 0-255 128 MARKREFLUPRIGHT 4 Mark reflective sensor threshold for the top outside sensor 0-255 12
1 | Programmer’s Guide Variable Description Range Default COPIES 7 The number of copies of each label for a print job 1 – 9999 1 PORTNUMBER The TCP port number 0 - 65535 9100 DISKLOCK Prevents writing to user flash OFF, ON OFF GPIO Enables use of external GPIO device OFF, MODE1 OFF HEXTRANSFERMODE Enables Hex Transfer mode OFF, ON OFF GPIOSIGNALTYPE1 Selects the type of input/output signal for pin 1 LOW, HIGH, LOWPULSE, HIGHPULSE, EDGE LOW GPIOSIGNALTYPE2 Selects the type of in
Programmer’s Guide | 1 Variable Description Range Default GPIOSIGNALNAME8 Selects the function of pin 8 SOP, REPRINT, SLEW, PAUSE, EOP, READY, MEDIALOW, SERVICE SERVICE GPIOPULSEWIDTH Width of pulse in ms.
1 | Programmer’s Guide To cut at the end of a job, the CUTBYCOUNT should be set to 0. A PJL EOJ command must be used at end of the print job to trigger the cut. Note: Note the PERLABEL value for CUTTER has been maintained for backwards compatibility. This is really the same as CUTTER equals ON and CUTBYCOUNT equals 1. 11 Max PAPERWIDTH varies by model. For p1120n and1125 = 3074 decipoints; p1115, p1115s, and w1110 = 2995 decipoints; p1725 = 4917 decipoints.
Programmer’s Guide | 1 @PJL EOJ %-12345X This PJL command will create or reset the ID variable to the value specified. The ID value must be a unique number between 1 and 32767. This value is used within the PCL body as a reference to the internal variable accessed. Multiple formats of the time, date, or increment fields may be specified as demonstrated in the examples below. The total number of Increment and Date/Time definitions must not exceed 15.
1 | Programmer’s Guide Template Action %b Abbreviated month name (Jan, Feb, etc.) %B Full month name (January, February, etc.
Programmer’s Guide | 1 The following is a hex dump of a test file that uses the increment field and the date/time stamp. The printed output is included below the example.
1 | Programmer’s Guide 00000310 00000320 00000330 00000340 00000350 00000360 00000370 00000380 00000390 000003a0 000003b0 000003c0 000003d0 000003e0 000003f0 00000400 00000410 00000420 00000430 00000440 00000450 00000460 00000470 00000480 00000490 000004a0 000004b0 000004c0 000004d0 000004e0 000004f0 00000500 00000510 00000520 00000530 00000540 00000550 00000560 00000570 00000580 00000590 000005a0 000005b0 000005c0 000005d0 000005e0 000005f0 00000600 00000610 00000620 00000630 00000640 00000650 00000660 3
Programmer’s Guide | 1 00000670 00000680 00000690 000006a0 000006b0 000006c0 000006d0 000006e0 000006f0 00000700 00000710 00000720 00000730 00000740 00000750 00000760 00000770 00000780 00000790 000007a0 000007b0 000007c0 000007d0 000007e0 000007f0 00000800 00000810 00000820 00000830 00000840 00000850 00000860 00000870 00000880 00000890 000008a0 000008b0 32 31 74 31 30 36 59 35 30 62 1b 61 30 24 1b 61 35 2a 1b 69 35 70 35 36 35 73 39 36 62 59 37 30 68 70 78 30 0c 30 32 3a 35 50 61 1b 78 50 32 26 72 78 69
1 | Programmer’s Guide Hex Transfer Method The hex transfer method allows the user to send PCL escape sequence printer commands to the printer with ASCII text strings. Any valid command or data sequence can be sent using this method. The printer will convert the sequences to the appropriate binary data used internally. Syntax: &%X1X2…$ where the characters "&%" initiate the sequence, X1X2 are a hexadecimal pair representing the character value. For instance the character is value 1B.
Programmer’s Guide | 1 or Send the PJL command DEFAULT with variable HEXTRANSFERMODE and value ON. or Using webpages by clicking Advanced->Communication->General->Host Settings and setting Hex Transfer to True. Save settings. The following is a sample of a standard PJL/PCL sequence: %-12345X@PJL JOB @PJL SET PAPERLENGTH = 4320 @PJL ENTER LANGUAGE = PCL *t300R*p230x1100Y$b2050c10n0j1o36WThis is a test, this is only a test.
1 | Programmer’s Guide Thermal Printer Programmer’s Guide 50
2 Appendix A Printer Model Printable Print Widths The table below lists the available printable print widths for the different printer models. Table 1: Printable Print Widths Printer Model Minimum Default Maximum p1115 .1 inches 2.54 mm 72 decipoints 4 inches 108 mm 2880 decipoints 4.16 inches 105.7 mm 2995.2 decipoints p1120n .1 inches 2.54 mm 72 decipoints 4 inches 108 mm 2880 decipoints 4.27 inches 108.4 mm 3074.4 decipoints p1125 .1 inches 2.
2 | Appendix A Thermal Printer Programmer’s Guide 52
3 Appendix B Printer Model Speed Table 1: Print Speed (Inches Per Second) Printer Model Minimum Default Maximum p1115 2 4 6 p1120n 2 6 8 p1125 2 8 10 p1115s 2 4 6 p1725 2 8 10 w1110 2 4 4 Table 2: Feed Speed (Inches Per Second) Printer Model Minimum Default Maximum p1115 2 4 8 p1120n 2 6 10 p1125 2 8 12 p1115s 2 6 8 p1725 2 8 12 w1110 2 4 4 Table 3: Reverse Speed (Inches Per Second) Printer Model Minimum Default Maximum p1115 2 3 5 p1120n 2