Please enable JavaScript to view this site.

AlphaPawn User Guide

Navigation: Appendix

Appendix K: Printer ESCape Control Codes

Scroll Prev Top Next More

The various printed forms used in the pawn shops are printed with specific characters per inch (CPI) and lines per inch (LPI). The printers have to be "told" what size print to use. This document shows the control codes required to set Okidata (and emulations) printers to the necessary CPI and LPI.

The APS software has selected the Okidata printers as the standard dot matrix line printer. Even though only one manufacturer has been selected, the Okidata printers still "emulate" other manufacturers. They are the Okidata Microline, IBM, and the Epson printers.

In order to understand the concept of control codes, an example of setting up the control codes for a pawn ticket printer will be discussed. First determine what kind of printer emulation is being used. On the Okidata 320's and 192+s the type of printer is displayed in the menu setup. On the older 190's and 180's, the control codes are Microline unless there is a red (IBM) sticker on the back of the printer below the plug where the computer cable is attached. So in this example the printer is an Okidata Microline and the pawn ticket printer needs to be 12 CPI and 8 LPI. The control codes are sent to the printer before each pawn ticket is printed. Look at the table below and find in the Microline section the 12 CPI line and the 1/8 inch (8 LPI) entries. To the right of the 12 CPI is the ASCII code of FS and the decimal value of 28. To the right of the 1/8 inch entry is ESC 8 and then decimal values of 27 56. So these values are to be entered in the store parameters screen. From the MASTER MENU enter:

E   E   A   A   field 18

027056028000    The decimal numbers are entered as a string of 12 numbers with the control codes each being three digits long with leading zeros. So a 27 becomes 027. Fill the rest of the twelve character field with zeros.

 

Printer control codes

 Function        ASCII        Decimal        Hexadecimal

 

MICROLINE CODES:

 Character Width

         10 CPI        RS        30        1E

         12 CPI        FS        28        1C

         17 CPI        GS        29        1D

 Line Spacing

         1/6 inch, (6 LPI)        ESC 6        27 54        1B 36

         1/8 inch, (8 LPI)        ESC 8        27 56        1B 38

 Print mode

         NLQ        ESC 1        27 49        1B 31

         Utility        ESC 0        27 48        1B 30

         Draft        ESC # 0        27 35 48        1B 23 30

 Clear buffer set default        CAN        24        18

 

IBM COMPATIBLE

 Character Width

         10 CPI        DC2        18        12

         12 CPI        ESC        27 58        1B 3A

         17 CPI        SI        15        0F

 Line Spacing

         1/6 inch, in multiples of

         of 1/216 inch.

         36/216 = 1/6        ESC 3 36        27 51 36        1B 33 24

               1/8 inch, (8 LPI)        ESC 0        27 48        1B 30

 Skip over perforation

 Clear skip-over perf.        ESC O        27 79        1B 4F

         ESC Letter "O"

 Print mode

         NLQ        ESC I 3        27 73 51        1B 49 33

         Utility        ESC I 1        27 73 49        1B 49 31

 Clear buffer set to default        CAN        24        18

 

 

EPSON FX Commands

 Character Width

         10 CPI        ESC P        27 80        1B 50

         12 CPI        ESC M        27 77        1B 4D

         17/20 CPI condense        SI        15        0F

 Cancel condensed        DC2        18        12

 Line Spacing

         1/6 inch, (6 LPI)        ESC 2        27 50        1B 32

         1/8 inch, (8 LPI)        ESC 0        27 48        1B 30

         ESC then zero

 Skip over perforation

 Clear skip perf.        ESC O        27 79        1B 4F

       ESC Letter "O"

 Print mode

 NLQ                ESC x 1        27 120 49        1B 78 31

 Utility        ESC x 0        27 120 48        1B 78 30

 Clear print buffer        CAN        24        18

 

 

POWER ON CONTROLS

 182 Microline

         Self Test        push LINEFEED

         17 cpi        push TOF

         NLQ        push FORM FEED

 192 Microline emulating an IBM

       Menu Mode        push FORM FEED

                 push SELECT to print the menu

                 push FORM FEED to move forward

                 push SELECT to select value

                 push LINEFEED to move backward

                 push TOF SET to exit menu mode

         Turning off the printer will save the settings.

         Self Test        push LINEFEED

 

 Okidata 320

 Top of Form - Form tear off capability

                 1. Turn off printer

                 2. Roll paper up until the perf is aligned with the tear bar.

                 3. Turn on power to the printer.

                 4. Push the Select light to turn it off.

                 5. Hold down the TOF/QUIET button

                    and push the LINE FEED button.

         This will roll the paper down to set the top of form.

         Do NOT roll the paper below the paper bail.

 

HP Laser control codes

 Reset printer        Esc E        27 69                1B 45

 Character pitch (cpi)

 10 CPI        ESC (10H        27 40 49 48 72        1D 28 31 30 48

 12 CPI        ESC (12H        27 40 49 50 72        1D 28 31 32 48

 17 CPI (16.66)        ESC (17H        27 40 49 55 72        1D 28 31 37 48

 

If the pitch is not available then use the next larger size. Above, where the pitch to set to 17 cpi, the printer should reset to 16.66 cpi.

 Automatic feed        Esc &l0H        27 38 108 48 72        1D 26 6C 30 48

 Manual feed        Esc &l2H        27 38 108 50 72        1D 26 6C 32 48

 Page size

         8.5 x 11        Esc &l2A        27 38 108 50 65        1D 26 6C 32 41

         8.5 x 14        Esc &l3A        27 38 108 51 65        1D 26 6C 33 41

 Portrait        Esc &l0O        27 38 108 48 79        1D 26 6C 30 4F

 Landscape        Esc &l1O        27 38 108 49 79        1D 26 6C 31 4F

 

Note, in the Esc sequences above the "&l" is "Ampersand and then a lower case letter "L". A lower case l is 108 decimal and 6C in hex.