The text of a manual · part 3 of 10
O'Neil Programming Language Reference Manual: Using Line Printer Mode
Pages 9 to 15 of 69, from O'Neil Programming Language Reference Manual
The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the O'Neil MicroFLASH 4T (MF4T) and Datamax MicroFLASH 4T (MF4T)
Page 9
2
Using Line Printer Mode Overview
Line printer mode is the simplest protocol supported by the O'Neil thermal printers. Using Line Printer mode, you can send a line of text as a sequence of characters to the printer followed by a carriage return (0x0D), and/or a line feed (0x0A), or a form feed (0x0C) and the printer prints that line of text. Commands can be used to change the way the printout looks and to select different fonts (fonts are available as the common IBM PC Code Page 437 mapping as well as many other mappings and international character sets). For more information on fonts, refer to the O'Neil Portable Printers Fonts Guide. Commands are usually either a single non-printable character, or a sequence of characters beginning with a non printable character such as ESCape (0x1b). Although these commands can be placed anywhere in the text, they will usually take effect exactly where they are placed. So you must be careful to place them where you want the effect to take place. For example, to change fonts you send ESC w n, where 'n' is the single character name of the font (seen AN-3 or AN-12). If you do this at the beginning of the line, it will affect the entire line. But if you place this in the center of a line, it will affect only those characters that come after. If you place this at the end of the line, it will have no effect on that line at all, but will affect the next line. Use Line Printer mode to print receipts and labels with text and simple, bitmap, graphics that do not need to be stored. You can also use Line Printer mode to insert signatures. Note: This chapter assumes a basic knowledge of computer programming and is designed to be used by programmers, software engineers, and technicians.
Line Printer Commands The following table lists Line Printer commands: Command
Description
Page
ESC C n
Sets form length. Range for n is 1-255.
9
ESC A n
Sets interline spacing; n=0 (default).
9
CAN
Cancels buffer line
9
ESC V n1 n2 Bit-mapped graphics mode select
10
ESC B
Begins acceptance of compressed graphics
11
ESC E
Ends acceptance of compressed graphics
11
SO
Sets double wide print
11
SI
Condensed print
11
FF
Form feed
12
LF
Line feed
12
CR
Carriage return
12
ESC w n
Font select. The range for n is 21-26 hex.
12
ESC @
Resets the printer
12
O’Neil Programming Language Reference Manual
8
Page 10
Chapter 2: Using Line Printer Mode
ESC Hn
Multiplies the height n times
13
ESC Q n1n2
Advances n1n2 from the Q mark. For more information about the Q mark, refer to Specifications in the O'Neil Thermal Programming Guide.
13
ESC R n
International font selection
13
ESC ! n
Sets double wide and double high
13
ESC EZ
Goes to Easy Print Mode
14
Note: Line Printer commands are case-sensitive. Make sure you use the correct case when entering commands. An n indicates binary numbers, not ASCII characters. For more information, see the individual command(s). Esc C n
Set Form Length
Format
ESC C n
Dec
27
67 n
Hex
1B
43 n
Function
Sets the page length in character lines. In the command format, n represents the number of lines in the form and n is a single byte. The default for n is 20 decimal, 14 hexadecimal. The range for n is 1-255.
Esc A n
Set Interline Spacing
Format
ESC A n
Dec
27
65 n
Hex
1B
41 n
Function
Sets the number of blank dotlines that are fed between character lines. The printer adds n (eight-bit binary number) blank lines after completing the current line(s) and before printing the next line. The default value for n is zero where n equals the number of inter-character blank dotlines in a single character. The range for n is 1-155.
CAN
Cancel Line Buffer
Format
CAN
Dec
24
Hex
18
Function
Cancels the character received on the currently forming, but not yet printed, line.
O’Neil Programming Language Reference Manual
9
Page 11
Chapter 2: Using Line Printer Mode
Esc V n1 n2
Bit-Mapped Graphics
Format
ESC V n1 n2
Dec
27
86 n1n2
Hex
1B
56 n1n2
Function
Prints the next (n1*256 + n2) dotlines as bit-mapped graphics. n1n2 form a 16-bit binary number set, the most significant byte first. Used to print user-generated bitmap graphics across the width of the printhead. After receipt of this command, the printer dumps the binary data directly to the printhead. As customary with bitmap data, a 1 bit indicates a dot is on, 0 bit indicates the dot is off. Graphics printed using this command must be the exact width of the head in bits. Bit 7 of the first byte of data received prints at the left-most dot on the head as you view the printhead with the paper feeding away from you. The printer remains in bit-mapped graphics mode until the total amount of bytes necessary to fill n1n2 lines of print are received by the printer. Use the following table for guidelines when adding a bitmapped graphic.
Printer Type
Dots Across
Bytes Across
Dots Per Inch microFlash2
384
48
203 microFlash3
576
72
203 microFlash4t/4tCR
832
104
203 microFlash2t/2tCR
384
48
203 microFlash2i/2iCR
240
30
127 Horizontal 69 Vertical
O’Neil Programming Language Reference Manual
10
Page 12
Chapter 2: Using Line Printer Mode
Esc B, ESC E Accept Compressed Graphics Format
ESC B
ESC E
Dec
27
66
27
69
Hex
1B
42
1B
45
Function
Accepts compressed graphics. The printer decompresses and prints the graphic. Each compressed dotline (using a run-length encoding scheme) is preceded by an uppercase G. Each uncompressed dotline is preceded by an uppercase U. Vertical white space (where several consecutive dotlines have not been printing) is processed using an uppercase A followed by a single byte count of the number of dotlines to advance. Compressed dotlines use a single graphics byte, followed by the number of times the byte is repeated. After the compressed graphics data command (ESC B) is received, each dotline must be preceded by the G or U, or an A may be sent followed by the number of lines to advance. When all data is sent, the final bytes must be ESC E to exit compressed graphics data. Compressed graphics mode requires a graphic image the same width as the printhead in use. Note: The microFlash3 printer has 576 bits across a single line; the microFlash2/2t has 384 bits and the microFlash2i has 240 bits microFlash4t has 832 bits across a single line.
SO
Set Double Wide Print
Format
SO
Dec
14
Hex
OE
Function
Prints the current font in double wide width until an SI (Set Single Wide Print) command is received or a carriage return is received.
SI
Set Single Wide Print
Format
SI
Dec
15
Hex
OF
Function
Prints the current font in single width.
O’Neil Programming Language Reference Manual
11
Page 13
Chapter 2: Using Line Printer Mode
FF
Form Feed
Format
FF
Dec
12
Hex
0C
Function
Prints the current line, then advances the paper to top of form (TOF).
LF
Line Feed
Format
LF
Dec
10
Hex
0A
Function
Prints the current line and advances the paper.
CR
Carriage Return
Format
CR
Dec
13
Hex
0D
Function
Prints the current line and advances the paper to top of form (TOF). The CR command is similar to LF; both commands are provided for your convenience. Note: To print and advance n lines, use the number of CR commands, or LF commands, or a combination of CR/LF and LF/CR commands.
ESC w n
Select Font
Format
ESC w n
Dec
27
119 n
Hex
1B
77
A
Function
Selects a Line Printer font given n, a binary, eight-bit number. For more information on fonts, refer to the O'Neil Portable Printers Fonts Guide.
ESC @
Reset Printer
Format
ESC @
Dec
27
64
Hex
1B
40
Function
Resets the printer to defaults.
O’Neil Programming Language Reference Manual
12
Page 14
Chapter 2: Using Line Printer Mode
Note: Use the following Easy Print command to return to Line Printer mode while in Easy Print mode. {LP} is not a Line Printer command. If you mistakenly use {LP} while in Line Printer mode, {LP} prints on your receipt or label. Format:
{LP}
ESC Hn
Heighten Font n Times
Format
ESC Hn
Dec
27
72 n
Hex
1B
48 n
Function
Multiplies the height of the font by n. Must apply to the entire line.
ESC Q n1n2
Advance n1n2 from Q mark
Format
ESC Q n1n2
Dec
27
81 n
Hex
1B
51 n
Function
Advances the paper n1n2 dotlines from the Q mark. For information on the Q mark, refer to Specifications in the O'Neil Thermal Programming Guide.
ESC R n
Select International Character Set
Format
ESC R n
Dec
27
82 n
Hex
1B
52 n
Function
Select international character sets. Note: The common IBM Code page 437 with 224 characters must be used. 0=USA 4=Denmark 1= France 5=Sweden 2=Germany 6=Italy 3=UK 7=Spain
ESC !n
Set Double Wide and Double High
Format
ESC ! n
Dec
27
33 n
Hex
1B
21 n
Function
Selects font height and width for one line. Must apply to entire line. n=10h 16d Double high n=20h 32d Double wide n=30h 48d Double high and double wide
O’Neil Programming Language Reference Manual
13
Page 15
Chapter 2: Using Line Printer Mode
ESC EZ
Go to Easy Print Mode
Format
ESC EZ
Dec
27
69
90
Hex
1B
45
5A
Function
Puts the printer in Easy Print Mode. You must use uppercase letters EZ.
O’Neil Programming Language Reference Manual
14