Command Notation


[Name]

Shows the name of the command.

[Format]

Shows the code sequence. [ ] k indicates the contents in brackets [] should be repeated k times.
The first row titled "ASCII" shows the sequence with ASCII characters, names of control code, or names of parameter.
The second row titled "Hex" shows it with hexadecimal numbers or names of variable parameter.
The third row titled "Decimal" shows it with decimal numbers or names of variable parameter.

[Range]

Shows the allowable range of each parameter like "n = 0, 1, 3 – 6, 10".
The en-dash ("–") between numerals joins numbers in a range. For instance, "3 – 6" indicates 3, 4, 5 and 6.

[Default]

Shows the default value of each parameter.

[Description]

Describes the function of the command.
The minus ("−") in tables indicates 0 or 1.

[Notes]

Provides important information on setting and using the command, if necessary.

Model specific information of selected products is shown after the above.

Parameter notation

  • Parameters are shown in bold italics.
  • Typical parameter notations are as follows:
    • n specifies 1 byte parameter in the range 0 – 255.
    • nL, nH specify 1 word (2 bytes) parameter as (nL + nH × 256) in the range 0 – 65535 or -32768 – +32767.
    • pL, pH specify the number of parameters after pH as (pL + pH × 256) in the range 1 – 65535.
    • p1, p2, p3, p4 specify the number of parameters after p4 as (p1 + p2 × 256 + p3 × 65536 + p4 × 16777216) in the rage 1 – 4294967295.
    • kc1, kc2 specify key code (2 bytes) of NV graphics or download graphics. Each range of kc1 and kc2 is 32 – 126.

Value notation

  • Numerical values are expressed in a hexadecimal, a decimal, or a binary format.
  • The hexadecimal notation has suffix 'h', and the binary notation has suffix 'B' except in a Bit value table.
  • Example: 10h, A6h, FFh, 00010000b, 10100110b, 11111111b
  • 'x' in a binary notation indicates the bit is '0' or '1'.
  • Example: 0xxx1xxxb

Using Bit Value Tables

For each command that has a complex method of determining the variable n, there is a table showing how to calculate the variable in three numbering systems: binary, hexadecimal, and decimal.
When you look at the table, first find the value of each component of the variable. Then add the values of the components together to determine the value of the variable n.
For example, here is how you would use the table on the following table, which selects the print mode, to combine double-height, double-width, and underline. In the table, you see that bit 4 on (or hex 10 or decimal 16) turns on double-height, bit 5 on (or hex 20 or decimal 32) turns on double-width, and bit 7 on (or hex 80 or decimal 128) turns on underline mode.
Bit
Binary
Function
Hex
Decimal
0
0
Selects Font 1
00
0
1
Selects Font 2
01
1
1
(Reserved)
2
(Reserved)
3
0
Emphasized mode: OFF
00
0
1
Emphasized mode: ON
08
8
4
0
Double-height mode: OFF
00
0
1
Double-height mode: ON
10
16
5
0
Double-width mode: OFF
00
0
1
Double-width mode: ON
20
32
6
(Reserved)
7
0
Underline mode: OFF
00
0
1
Underline mode: ON
80
128
Binary, decimal, and hexadecimal numbers all have the same printing results.
To combine all three, turn on bits 4, 5, and 7, which is 10110000 in binary. Or you can add the hex values 10, 20, and 80 for the hex sum of B0, or you can add the decimal values 16, 32, and 128 for the decimal value of 176. Therefore, you send the following to turn on double-height, double-width, and underline, depending on the numbering system used:
ASCII
   
ESC
  
!
  
n
Hex
1B
21
B0
Decimal
27
33
176
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

ESC/POS® includes patented or patent pending commands. The contents must not be disclosed to third parties.


ESC/POS® Command Reference for TM Printers

Jump to the top