The text of a manual · part 3 of 7
MtP Series & FieldPro Programmer's Manual: Introduction, pages 15 to 24
Pages 15 to 24 of 63, from MtP Series & FieldPro Programmer's Manual
The original document is the PDF (923 KB). 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 Printek MtP300
Page 15
Printek Emulation Horizontal Tab
HT
Advances to the next horizontal tab stop. If no tab stop exists between the active column and the right margin, the print position will advance to the beginning of the next line. Horizontal tab stops are associated with columns, not absolute physical positions. Changing the character spacing or font will change the physical position of the tab stops. Default tab stops are set to every fourth column, i.e. 5,9,13,17,21,25,29,33,37 …. Control code: Hexadecimal:
HT 09
Set Horizontal Margins
ESC H l r
Sets the left and right margins in millimeters. l and r may be set from zero up to ½ the line length. Example: The following escape sequence will set both the left and right margins to 10mm (0.394”). Escape Sequence: ESC Hexadecimal: 1B
H 48
10 0A
10 0A
Vertical Position Line Feed
LF
Causes the current line to be printed and/or advances the paper to the next line. The total distance the paper is advanced is based on the vertical size of the current font plus the Text Line Spacing. A Carriage Return is also performed which places the current print position at the beginning of the next line. Note that either a Carriage Return (CR) or a Line Feed (LF) will cause both functions to be performed. However, a Carriage Return and Line Feed “pair” (CRLF) will only perform a single line feed. Control code: Hexadecimal:
LF 0A
Variable Size Line Feed
ESC J n
Causes paper to be moved forward n x 0.125mm. 0 ≤ n ≤ 255. A Carriage Return is also performed which places the current print position at the beginning of the next line. Example: The following escape sequence performs a line feed of five millimeters ( 5 ÷ 0.125 ). Escape Sequence: ESC J Hexadecimal: 1B 4A
40 28
11
Page 16
Printek Emulation Variable Size Reverse Line Feed
ESC Q J n
Causes paper to be moved in the reverse direction n x 0.125mm. 0 ≤ n ≤ 255. A Carriage Return is also performed. Note that reverse paper motion is not supported in MtP400 SL models and this command is ignored. Example: The following escape sequence moves paper in the reverse direction two millimeters (2 ÷ 0.125). Escape Sequence: ESC Hexadecimal: 1B
Q 51
J 4A
16 10
Vertical Tab
VT
Advances the paper five lines. If a partial line exists in the buffer, that line will be printed including a Carriage Return and Line Feed, and then the paper advanced five lines. A Carriage Return is also performed which places the current print position at the beginning of the next line. Control code: Hexadecimal:
VT 0B
Form Feed
FF
If a partial line exists in the buffer, that line will be printed including a Carriage Return and Line Feed, and then the paper will be advanced as described below. For printers that use rolls of print media, (not “SL” models), the paper will be advanced by the “FFeed Distance” set for the current Format (refer to the Operator’s Manual for more information). For printers that use cassette media (MtP400 SL), the current sheet of paper will be ejected. A Carriage Return is also performed which places the current print position at the beginning of the next line. Control code: Hexadecimal:
12
FF 0C
Page 17
Printek Emulation
Bar Codes Several types barcode symbols may be printed using the following command. The specification for each bar code type is also described.
Print Bar Code
ESC a t n h data
Printek printers support several bar code symbologies including Code 39, Code 128, UCC/EAN-128, Interleaved 2 of 5, UPC/EAC/JAN, and Codabar. The following table describes the Bar Code command. Details for each specific bar code type, including examples, are found below. Variable a t n h
Value z (lower case) Z (upper case) 1 2 3 4 5 1 ≤ n ≤ 255 1 ≤ h ≤ 255 data
Description Print bar code only. Print bar code and human readable text. Code 39 Code 128, UCC/EAN-128 Interleaved 2 of 5 UPC/EAN/JAN Codabar Number of characters in bar code. Height of bar code in increments of 0.125mm. n characters to be represented in the bar code. See individual bar code types for allowable characters and other specific requirements.
Notes: All barcodes are printed with the minimum bar width (“x-dimension”) of 0.250mm, in compliance with the respective official specification. All barcodes are printed centered between the left and right margins. For information on setting margins, please refer to the Operator’s Manual.
Code 39 Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: 43 ASCII characters including A-Z (uppercase only), 0-9, . (period), - (dash), $, /, +, %, and SPACE Elements per symbol: 9 (5 bars, 4 spaces) Character density: 6.25 CPI Bar width: 0.25mm (narrow to wide ratio = 1:3) Example: The following escape sequence will print a bar code containing the characters "CODE-39" 1 mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1b 5A
1 31
7 07
8 08
C 43
O 4F
D 44
E 45
2D
3 33
9 39
13
Page 18
Printek Emulation Code 128 Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: 256 ASCII via three Code Sets and an “Extend” function. Elements per symbol: 6 (3 bars, 3 spaces) Character density: 9.1 CPI Bar width: 0.25mm The first character position in the data portion of the escape sequence must contain a “Start Character”, as defined below. This Start Character defines the Code Set to be used to interpret the following data characters. Each Code Set has special character values defined that allow switching to a different Code Set(s) within the bar code. Start Character
Code Set
Characters Sent To Printer 20 – 5F 60 – 7F
Characters Read By Scanner 20 – 5F 00 – 32
87
A
88
B
20 – 7F
20 – 7F
89
C
Pairs of 30 – 39
Numeric Character Pairs 30, 30 – 39, 39 (00-99 Dec.)
All character values shown in Hexadecimal. Special data characters are available for each Code Set that allow switching to a different Code Set and other special functions. These characters have values of 80-86 Hexadecimal and their functions in each Code Set are defined below. Character Value (Hex) 80 81 82 83 84 85 86
Code Set A
Code Set B
Code Set C
FNC3 FNC2 Shift Switch to Code Set C Switch to Code Set B FNC4 FNC1
FNC3 FNC2 Shift Switch to Code Set C FNC4 Switch to Code Set A FNC1
Switch to Code Set B Switch to Code Set A FNC1
FNC 1: Reserved for EAN use. FNC 2: Concatenate the data in this bar code with the data in the next bar code read. Not supported by all bar code readers. FNC 3: Reset the bar code reader. Any other data in this bar code will be discarded. FNC 4: Extended characters. The bar code reader will add 128 (80 Hex.) to each character. Example 1: The following escape sequence will print a bar code containing “ABC123” that is 10mm high and is followed with human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A 14
2 32
7 07
80 Start B A 50 88 41
B 42
C 43
1 31
2 32
3 33
Page 19
Printek Emulation Example 2: The following escape sequence will print a bar code using numeric pairs of numeric characters containing “123456” that is 10mm high without human readable text. Escape Sequence: ESC z Hexadecimal: 1b 7A
2 32
7 07
80 Start C 1 50 89 31
2 32
3 33
4 34
5 35
6 36
Example 3: The following escape sequence will print the same data as in Example 1, “ABC123”, using Code Sets that allow a mixture of alphanumeric character and numeric pairs. The bar code will be 20mm high without human readable text. Escape Sequence: ESC z Hexadecimal: 1B 7A
2 32
7 07
160 Start A A A0 87 41
B 42
C 43
1 Switch C 2 31 83 32
3 33
UCC/EAN-128 Specifications Description: The UCC/EAN-128 specification is an internationally recognized format for application identifiers in code 128 bar codes. The bar code symbology is identical to Code 128. Only recognized bodies of the UCC or EAN may assign application identifiers. For more information visit www.ean-int.org and www.uc-council.org. Character set: 256 ASCII via three Code Sets and an “Extend” function. Elements per symbol: 6 (3 bars, 3 spaces) Character density: 9.1 CPI Bar width: 0.25mm Example: The following escape sequence prints an all numeric bar code containing “1234” in an EAN-128 format that is 10mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A
2 32
6 06
80 FNC1 1 50 86 31
2 32
3 33
4 34
UPC/EAN/JAN Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Left Guard Bars, Left Data Symbols, Center Bar Pattern, Right Data Symbols, Check Character, ending with Right Guard Bars and Trailing Quiet Zone. The UPC, EAN/JAN-8, EAN/JAN-13 specifications comprise an internationally recognized format for application identifiers. Unlike the UCC/EAN-128 specification, these identifiers are intended for point-of-sale applications. Only recognized bodies of the UCC and EAN may assign application identifiers. For more information visit www.ean-int.org and www.uc-council.org. Character set: numeric - fixed length as follows: • • • •
UPC-A – Requires 12 digits. The first 11 will be printed and the 12th will be replaced by a check digit calculated by the printer. UPC-E – Requires 7 digits. (The check digit will be added by the printer.) EAN/JAN-8 – Requires 8 digits. The first 7 will be printed and the 8th will be replaced by a check digit calculated by the printer. EAN/JAN-13: – Requires 13 digits. The first 12 will be printed and the 13th will be replaced by a check digit calculated by the printer.
15
Page 20
Printek Emulation Elements per symbol: 4 (2 bars, 2 spaces) Character density: 14.5 CPI Bar width: 0.25mm Note: When specifying the bar code height that h represents the total height including a 1.25mm drop bar pattern printed after the barcode pattern. Example 1: The following escape sequence will print a UPC-A bar code containing “12345678901” that is 30mm high followed by human readable text. Note that a check digit “9” is also sent, but will be ignored and recalculated by the printer. Escape Sequence: ESC Z Hexadecimal: 1B 5A
4 34
12 240 1 0C F0 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
0 30
1 31
9 39
Example 2: The following escape sequence will print a UPC-E bar code containing “1234567” that is 30mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A
4 34
7 07
240 F0
1 31
2 32
3 33
4 34
5 35
6 36
7 37
Example 3: The following escape sequence will print an EAN/JAN-8 bar code containing “1234567” that is 30mm high followed by human readable text. Note that a check digit “9” is also sent, but will be ignored and recalculated by the printer. Escape Sequence: ESC Z Hexadecimal: 1B 5A
4 34
8 08
240 F0
1 31
2 32
3 33
4 34
5 35
6 36
7 37
9 39
Example 4: The following escape sequence will print an EAN/JAN-13 bar code containing “123456789012” that is 30mm high followed by human readable text. Note that a check digit “9” is also sent, but will be ignored and recalculated by the printer. Escape Sequence: ESC Z Hexadecimal: 1B 5A
4 34
13 240 1 08 F0 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
0 30
1 31
Interleaved 2 of 5 Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: numeric pairs. Elements per symbol: 10 (5 bars, 5 spaces) Character density: 11.11 CPI Bar width: 0.25mm Example: The following escape sequence will print a bar code containing “123456” that is 10mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A
16
3 33
6 06
80 50
1 31
2 32
3 33
4 34
5 35
6 36
2 32
9 39
Page 21
Printek Emulation Codabar Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: 0-9, $, -, :, /, ., + and the start/stop pairs of A/T, B/N, C/*, and D/E. Elements per symbol: 7 (4 bars, 3 spaces) Character density: 8.1 CPI Bar width: 0.25mm Example 1: The following escape sequence will print a bar code containing “123456”, using the A/T start/stop characters, and 20mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A
5 35
8 08
160 A0
A 41
1 31
2 32
3 33
4 34
5 35
6 36
T 54
Example 2: The following escape sequence will print a bar code containing “123456”, using the C/* start/stop characters and 20mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A
5 35
8 08
160 A0
C 43
1 31
2 32
3 33
4 34
5 35
6 36
* 2A
Graphics The printer uses a single line thermal print head with elements spaced at 0.125mm. The maximum number of graphic data bytes allowed for each model printer is shown for each command. After each line of graphic data, the paper is automatically advanced 0.125mm to position the paper for the next graphic line. To advance the paper by additional graphic increments without printing, refer to “Variable Size Line Feed” on page 11.
8-Bit Graphics
ESC # h w data
This command may be used to print any graphics pattern. The height and width of the graphic image may be specified as shown below. Each line must contain the same number of bytes (width). The image will be printed starting from the left margin and up to the right margin. If the width specified will not fit within the margins, the right side of the image will be truncated. Variable h w data
Value 1 ≤ h ≤ 255 MtP300: 0 ≤ w ≤ 72 MtP400: 0 ≤ w ≤ 104 FieldPro RT43: 0 ≤ w ≤ 104 A line of graphic data bytes where the value of each byte is 0-255
Description Number of graphic lines in the data to follow. Number of bytes per graphic line in the data to follow. Each byte contains 8 bits. h x w bytes per line are required.
17
Page 22
Printek Emulation
Example 1: The following escape sequence will print a horizontal line 2mm long starting 2mm from the left margin. Escape Sequence: ESC Hexadecimal: 1B
# 23
1 01
4 04
0 00
0 00
255 FF
255 FF
Example 2: The following escape sequence will print a square box 2mm x 1mm starting 2mm from the left margin, and then move the paper forward an additional 5mm. Escape Sequence: ESC # Hexadecimal 1B 23 Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: Hexadecimal Escape Sequence: ESC J Hexadecimal: 1B 4A
8 08
4 04
0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00
0 00 0 00 0 00 0 00 0 00 0 00 0 00 0 00
255 FF 128 80 128 80 128 80 128 80 128 80 128 80 255 FF
255 FF 1 01 1 01 1 01 1 01 1 01 1 01 255 FF
40 28
8 Bit Compressed Graphics
ESC v h w c data [c data] [c data] …
This command differs from the 8 Bit Graphics command described above by reducing the number of bits (bytes) that have to be sent to the printer. This allows for faster data transfer between the host computer and the printer. Variable h w c data
Value 1 ≤ h 255 MtP300: 0 ≤ w ≤ 72 MtP400: 0 ≤ w ≤ 104 FieldPro RT43: 0 ≤ w ≤ 104 0 ≤ c ≤ 255 Graphic data bytes where the value of each byte is 0255
Description Number of graphic lines in the image. Number of bytes in each graphic line of the image. Counter(s) describing how following bytes are to be interpreted. A description of how counter values and the following data are interpreted follows this table. Graphic data bytes to be interpreted as specified by the preceding counter, c.
Multiple “sets” of counters and data may be sent to the printer as necessary to describe the graphic pattern to be printed. The values specified by the counter(s) are interpreted as follows.
18
Page 23
Printek Emulation The counter may be considered as either a signed 7 bit value or an unsigned 8 bit value. For signed 7 bit values:
0 ≤ c ≤ 127 -128 ≤ c ≤ –1
Process the next (c + 1) bytes as simple 8 bit graphic patterns. Repeat the next byte (-c + 1) times.
For unsigned 8 bit values: 0 ≤ c ≤ 127 128 ≤ c ≤ 255
Process the next (c+1) bytes as simple 8 bit graphic patterns. Repeat the next byte (256 - c + 1) times.
Example: The following escape sequence will print a graphic image that is two lines long and six bytes (48 bits) wide as shown below. Note that the outlines for each bit are shown only to explain this example and that only the image represented by the black “bits” will actually be printed.
In the following escape sequence the data bytes are shown in binary. The hexadecimal values for each byte are shown on the second line. ESC v 2 6 255 01010101 255 10101010 3 00010001 00100010 00110011 01000100 25310011001 1B 76 02 06 FF 55 FF AA 03 11 22 33 44 FD 99
Vector Graphics
ESC > id lines size data ESC > id p data t
Note: This feature is only available in units with firmware version 2.8 or later. Vector graphics may be used to print images of straight lines, curved lines, or even more complex shapes such as a person’s signature. Each shape is defined as one or more “line segments”. A curved line is simply several shorter, straight lines connected together. To define such a line, the data sent to the printer contains the endpoints, or nodes, of each line segment and the printer will draw the entire line by drawing line segments between the nodes. Note that the image will be automatically scaled, up or down, to fit between the currently defined left and right margins. Vector graphic data may be sent in two different formats as specified by id and as described below. id 0 lines size data lines = Eight bit value indicating the number of lines to be drawn. This is the number of distinct lines, not line segments. size = wmsb wlsb hmsb hlsb = 16 bit width and 16 bit height of the grid that the image will be specified in. The image does not have to be this large, but nodes may not be specified outside of the grid size. Maximum values: w = 65,535, h = 32,767. data = xmsb xlsb ymsb ylsb = 16 bit X position and 16 bit Y position of each node. Multiple lines are drawn in a single graphic image by setting the most significant bit of ymsb = 1 (0x80). This indicates the end of the current line and will cause no line segment to be drawn between this node and the next.
19
Page 24
Printek Emulation Example: id = 0 This example will print the following signature. The size of the grid that the image is specified in is 277 points wide by 145 points high. When printed the image will be scaled to fit between the left and right margins.
Escape Sequence: ESC Hexadecimal: 1B
> 3E
0 30 w = 277 h = 145 x = 63 y = 91 2 wmsb wlsb hmsb hlsb xmsb xlsb ymsb ylsb 02 01 15 00 91 00 3F 00 5B
… … …
The entire string of data representing the graphic nodes for this example is: 00 3F 00 5B 00 34 00 31 00 39 00 5D 00 31 00 69 00 3F 00 58 00 50 00 5E 00 53 00 56 00 59 00 32 00 5B 00 53 00 62 00 57 00 70 00 62 00 80 00 58 00 84 00 56 00 8F 00 61 00 B8 00 5A 00 B8 00 35 00 C0 00 59 00 D0 00 56 00 D9 00 5E 00 D7 00 54 00 E9 00 51 00 EC 00 4A id 1
00 3B 00 5A 00 3E 00 2C 00 2C 00 77 00 39 00 63 00 3E 00 5D 00 4F 00 5C 00 56 00 54 00 57 00 30 00 5A 00 5F 00 65 00 55 00 75 00 5F 00 7F 00 5C 00 8C 00 53 00 99 00 61 00 BA 00 5C 00 C2 00 39 00 BA 00 5B 00 D3 00 55 00 DB 00 5E 00 D9 00 54 00 EF 00 50 00 EE 00 53
00 35 00 57 00 40 00 2D 00 24 00 80 00 43 00 5B 00 43 00 60 00 4B 00 59 00 5C 00 50 00 55 00 32 00 59 00 61 00 66 00 58 00 78 00 5C 00 7D 00 5F 00 8E 00 54 00 99 80 61 00 B9 00 57 00 C7 00 3F 00 B8 00 59 00 CF 00 55 00 DC 00 5A 00 DD 00 55 00 F7 00 4E 00 FD 00 5B
00 2F 00 51 00 41 00 34 00 1F 00 80 00 49 00 55 00 49 00 61 00 49 00 59 00 5E 00 4B 00 55 00 38 00 56 00 62 00 64 00 5C 00 7B 00 58 00 7B 00 61 00 8C 00 57 00 B7 00 4D 00 B6 00 4E 00 C9 00 47 00 C1 00 57 00 CB 00 56 00 DA 00 58 00 E0 00 54 00 FA 00 4C 01 06 80 5D
00 28 00 41 00 41 00 3A 00 1F 00 7E 00 4A 00 53 00 4D 00 61 00 47 00 58 00 5D 00 40 00 57 00 3C 00 5A 00 5C 00 63 00 5E 00 7D 00 56 00 7C 00 5E 00 8B 00 59 00 B8 00 51 00 B2 00 3D 00 C9 00 4C 00 C5 00 57 00 CB 00 58 00 D6 00 55 00 E2 00 53 00 F7 00 49
00 2B 00 38 00 3F 00 4A 00 24 00 74 00 45 00 54 00 4F 00 60 00 4D 00 58 00 5A 00 36 00 5A 00 47 00 60 00 58 00 69 00 62 00 7F 00 56 00 7E 00 59 00 8B 00 5D 00 B8 00 57 00 B4 00 37 00 C7 00 53 00 CD 00 56 00 D3 00 5C 00 D3 00 53 00 E5 00 51 00 F1 00 48 p data t p = A variable number of prefix characters that may be inserted by some signature capturing devices. These characters may not include a pair of adjacent characters that would represent a valid hexadecimal value (00-FF) at any position in the string. These characters will be ignored by the printer and are not required. data = xmsb xlsb ymsb ylsb = 8 bit X position and 8 bit Y position of each node (xy). Each X and Y value is sent as a pair of ASCII characters that represent the hexadecimal value of the position. Maximum values: x = 127, y = 127. Multiple lines are drawn in a single graphic image by setting the most significant bit of ymsb = 1 (0x80). This indicates the beginning of a new line and will cause no line segment to be drawn between the previous node this node. t = Terminating character. The vector graphic command is terminated by any ASCII control character (< 0x20) such as a Carriage Return (0x0d).
20