Shandong New Beiyang Information Technology Co. BTP-R880NP Programming Manual

1
PROGRAMMING MANUAL
Receipt Printer
BTP-R880NP
Shandong New Beiyang Information Technology Co., Ltd.
CONFIDENTIAL
Confidential BTP-R880NP Programming Manual
- 1 -
REVISION HISTORY
Date Version Description Drafted by
2010-11-12 V100 Primary version
Ding Jinfeng, Cao
Yongkang
Confidential BTP-R880NP Programming Manual
- 2 -
Declaration
Information in this document is subject to change without notice. SHANDONG NEW BEIYANG
INFORMATION TECHNOLOGY CO., LTD. (hereinafter referred to as “SNBC”) reserves the right to
improve products as new technology, components, software, and firmware become available. If users
need further data about this products or have any doubt about safety issues that might arise from
using it, please feel free to contact SNBC or your local distributor.
No part of this document may be reproduced or transmitted in any form or by any means, electronic
or mechanical, for any purpose without the express written permission of SNBC.
Copyright
Copyright © 2010 by SNBC
Printed in China
Trademarks
Our registered trademarks are and
Contact us
Address: No.169 Huoju Rd, Weihai, Shandong, China.
Order Tel: +86—631—5671111
Techinical support: +86—631—5675888 800861368
Fax: +86—631—5680499 5675111
PC: 264209
Website: www.newbeiyang.com
E—mail : support@newbeiyang.com
Confidential BTP-R880NP Programming Manual
- 3 -
Contents
1 Overview ......................................................................................................................................... - 1 -
1.1 Commands classification ..................................................................................................................... - 1 -
1.2 Key terms ............................................................................................................................................. - 1 -
1.3 Command format ................................................................................................................................. - 2 -
2 Command Description ................................................................................................................... - 3 -
2.1 Print command ..................................................................................................................................... - 3 -
LF ........................................................................................................................................................... - 3 -
FF ........................................................................................................................................................... - 3 -
CR .......................................................................................................................................................... - 3 -
ESC FF .................................................................................................................................................. - 3 -
ESC J n .................................................................................................................................................. - 4 -
ESC d n .................................................................................................................................................. - 4 -
2.2 Location command............................................................................................................................... - 5 -
HT ........................................................................................................................................................... - 5 -
ESC $ nL nH .......................................................................................................................................... - 6 -
ESC D n1...nk NUL ................................................................................................................................ - 6 -
ESC T n .................................................................................................................................................. - 7 -
ESC W xL xH yL yH dxL dxH dyL dyH .................................................................................................. - 9 -
ESC \ nL nH ......................................................................................................................................... - 10 -
ESC a n ................................................................................................................................................ - 11 -
GS $ nL nH .......................................................................................................................................... - 12 -
GS L nL nH .......................................................................................................................................... - 12 -
GS P x y ............................................................................................................................................... - 13 -
GS W nL nH ......................................................................................................................................... - 14 -
GS \ nL nH ........................................................................................................................................... - 14 -
2.3 Character command .......................................................................................................................... - 15 -
CAN ...................................................................................................................................................... - 15 -
ESC SP n ............................................................................................................................................. - 16 -
ESC ! n ................................................................................................................................................. - 17 -
ESC % n ............................................................................................................................................... - 18 -
ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)] .......................................................................... - 18 -
ESC – n ................................................................................................................................................ - 20 -
ESC ? n ................................................................................................................................................ - 21 -
ESC E n ............................................................................................................................................... - 21 -
ESC G n ............................................................................................................................................... - 22 -
ESC M n ............................................................................................................................................... - 22 -
ESC R n ............................................................................................................................................... - 22 -
ESC V n ............................................................................................................................................... - 23 -
ESC t n ................................................................................................................................................. - 24 -
ESC { n ................................................................................................................................................. - 25 -
GS ! n ................................................................................................................................................... - 26 -
GS B n .................................................................................................................................................. - 26 -
FS ! n .................................................................................................................................................... - 27 -
FS & ..................................................................................................................................................... - 28 -
Confidential BTP-R880NP Programming Manual
- 4 -
FS - n ................................................................................................................................................... - 28 -
FS . ....................................................................................................................................................... - 29 -
FS 2 c1 c2 d1...dk ................................................................................................................................ - 29 -
FS C n .................................................................................................................................................. - 29 -
FS S n1 n2 ........................................................................................................................................... - 30 -
FS W n ................................................................................................................................................. - 31 -
2.4 Bitmap Command .............................................................................................................................. - 31 -
ESC * m nL nH d1... dk ........................................................................................................................ - 31 -
ESC # n ................................................................................................................................................ - 33 -
GS * x y d1...d(x × y × 8) ...................................................................................................................... - 33 -
GS / m .................................................................................................................................................. - 34 -
GS v 0 m xL xH yL yH d1....dk ............................................................................................................. - 34 -
FS p n m ............................................................................................................................................... - 35 -
FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n ........................................................................ - 36 -
2.5 Status command ................................................................................................................................ - 38 -
DLE EOT n ........................................................................................................................................... - 38 -
GS a n .................................................................................................................................................. - 40 -
GS r n ................................................................................................................................................... - 41 -
2.6 Barcode command ............................................................................................................................. - 42 -
GS H n ................................................................................................................................................. - 42 -
GS f n ................................................................................................................................................... - 42 -
GS h n .................................................................................................................................................. - 43 -
GS k m d1...dk NULGS k m n d1...dn ........................................................................................... - 43 -
GS s n1 n2 n3 n4 n5 n6 n7 n8 ............................................................................................................. - 48 -
GS o n .................................................................................................................................................. - 50 -
GS p n .................................................................................................................................................. - 50 -
GS q n .................................................................................................................................................. - 51 -
GS w n ................................................................................................................................................. - 51 -
2.7 Bi-colour command ............................................................................................................................ - 51 -
ESC r n ................................................................................................................................................. - 51 -
ESC C n ............................................................................................................................................... - 52 -
GS ( N pL pH fn a............................................................................................................................ - 52 -
2.8 Upside-down print command ............................................................................................................. - 52 -
GS ( z nL nH 0 S .................................................................................................................................. - 52 -
GS ( z nL nH 0 E .................................................................................................................................. - 54 -
2.9 water based print command .............................................................................................................. - 54 -
GS { w f n1 n2 n3 n4 n5 ....................................................................................................................... - 54 -
GS { w n ............................................................................................................................................... - 55 -
2.10 Greyscale printing commannd ......................................................................................................... - 55 -
FS r n xl xh yl yh zl zh d1 d2 d3...d(k) .................................................................................................. - 55 -
ESC c 6 n yl yh zl zh d1 d2 d3 ...d(k) ................................................................................................... - 57 -
ESC c 7 n RAM .................................................................................................................................... - 58 -
2.11 Other commands ............................................................................................................................. - 59 -
ESC c : n .............................................................................................................................................. - 59 -
DLE ENQ n .......................................................................................................................................... - 59 -
DLE DC4 n m t ..................................................................................................................................... - 60 -
Confidential BTP-R880NP Programming Manual
- 5 -
ESC 2 ................................................................................................................................................... - 60 -
ESC 3 n ................................................................................................................................................ - 60 -
ESC = n ................................................................................................................................................ - 61 -
ESC @ ................................................................................................................................................. - 61 -
ESC L ................................................................................................................................................... - 62 -
ESC S .................................................................................................................................................. - 62 -
ESC c 0 n ............................................................................................................................................. - 63 -
ESC c 3 n ............................................................................................................................................. - 63 -
ESC c 4 n ............................................................................................................................................. - 64 -
ESC c 5 n ............................................................................................................................................. - 64 -
ESC p m t1 t2 ....................................................................................................................................... - 64 -
GS ( A pL pH n m ................................................................................................................................. - 65 -
GS ........................................................................................................................................................ - 66 -
GS V m GS V m n ........................................................................................................................ - 66 -
GS ^ r t m ............................................................................................................................................. - 66 -
3 Programming Process Guide ...................................................................................................... - 68 -
Appendix .......................................................................................................................................... - 69 -
Appendix A: Code128 Bar Code .............................................................................................................. - 69 -
Appendix B: Print mode and its change ................................................................................................... - 73 -
Appendix C: Control Sequences .............................................................................................................. - 76 -
- 1 -
1 Overview
This manual classifies the printer commands into several kinds based on its functions, and also
describes the applications of relative commands in detail depending on its sorts. We hope that it is
helpful for programmers to get known of those commands.
1.1 Commands classification
This receipt printer commands are classified as below:
Print commands: used for printing and feeding paper;
Position commands: to control the print position;
Character commands: to set character property;
Bitmap commands: to download bitmap and print, including NV and RAM bitmap;
Status commands: used for printer status query;
Barcode commands: barcode print and property settings;
Other commands: used for periphery control, Macro-definition and initialization;
Command instruction refers to the detailed function of relative commands.
1.2 Key terms
Real-time commands – These commands are acted on immediately upon being received by the
printer;
Print buffers – used to store figure data to be printed;
Page mode –Under this mode, the printer stores all data in a specified memory and thinks of this as a
virtual page. The page is printed when the printer receives print command either FF or ESC FF;
Standard mode – Standard mode is the default mode of printer, namely line mode. Under this mode,
the printer prints data and feeds paper upon print line buffer full (data is enough for one print line) or
receiving print command like LF;
HRI character – Barcode note character. Human Readable Interface;
NV – Non-volatile memory in which data stored does not loss when powered off. NV: Non-volatile;
RAM –Random Access Memory;
DPI – Print dots per inch (one inch equals to 25.4mm). It is used to identify the resolution of a printer.
Example, 203DPI means 203 print dots per inch. DPI: Dot Per Inch
Baseline – The standard position where character data in print buffers are stored. The figure shows the
position of ordinary characters in standard mode and page mode:
Confidential BTP-R880NP Programming Manual
- 2 -
1.3 Command format
[Function] The name and function summary of commands;
[Format] The format of command data, such as ASCII, Hex and Decimal;
[Range] The value range of parameter in the command;
[Note] Explain the main features and application notices of commands;
[Default] The initial value used after the printer initialized;
[Relative] Other commands related to current command;
[Example] Example used for current or relative commands.
All command data in programming Demo use HEX. All normal font/characters are data.
There is no explanation for the data of command such as 42 43 which is data. The
font/character underlined and emphasized is a command such as 1B 40.
All the data
inside parentheses after all commands in Demo is used to explain the meanings of this
command. The parentheses and data inside it is not the command to be transmitted to
the printer.
Confidential BTP-R880NP Programming Manual
- 3 -
2 Command Description
2.1 Print command
LF
[Function] Print and line feed
[Format] ASCII LF
Hex 0A
Decimal 10
[Note] This command sets the print position to the beginning of the line.
[Reference] ESC 2, ESC 3
FF
[Function] Print all data in the print buffers and return to the standard mode.
[Format] ASCII FF
Hex 0C
Decimal 12
[Notes] · This command is valid only in page mode.
· The buffer data is deleted after being printed.
· The printer does not execute paper cutting.
· This command sets the print position to the beginning of the line.
[Relative] ESC FF, ESC L, ESC S
CR
[Function] When the command is enabled, it equals to LF; it is ignored when disabled,
[Format] ASCII CR
Hex 0D
Decimal 13
[Notes] · Sets the print starting position to the beginning of the line.
· This command is set according to the printer configuration.
[Relative] LF
ESC FF
[Function] Print data in page mode
[Format] ASCII ESC FF
Hex 1B 0C
Decimal 27 12
[Notes] · This command is enabled only in page mode.
· After printing, the printer does not clear the buffered data, setting values for ESC T and
ESC W, and the position for buffering character data.
Confidential BTP-R880NP Programming Manual
- 4 -
[Relative] FF, ESC L, ESC S
ESC J n
[Function] Print and feed paper
[Format] ASCII ESC J n
Hex 1B 4A n
Decimal 27 74 n
[Range] 0 n 255
[Notes] After printing is completed, this command sets the print starting position to the beginning
of the line.
The paper feed amount set by this command is not affected by the values set by ESC 2
or ESC 3.
The horizontal and vertical motion unit is specified by GS P.
In standard mode, the printer uses the vertical motion unit (y).
In page mode, this command functions as follows, depending on the starting position of
the printable area:
1)When the starting position is set to the upper left or lower right of the printable area
by ESC T, the vertical motion unit (y) is used.
2)When the starting position is set to the upper right or lower left of the print able area
by ESC T, the horizontal motion unit (x) is used.
The maximum paper feed amount is 1016mm (40 inches). When the setting value
exceeds the maximum, it is converted to the maximum automatically.
[Relative] GS P
[Example] 1B 40
(initialize printer)
1D 50 CB CB
(set the resolution 203×203)
41 41 41 41 41 41 41(data to be printed)
1B 4A 50
(print and feed paper 80/203 inches)
42 42 42 42 42 42 42 0A
(data to be printed)
Results:
ESC d n
[Function] Print and feed n lines
[Format] ASCII ESC d n
Hex 1B 64 n
Confidential BTP-R880NP Programming Manual
- 5 -
Decimal 27 100 n
[Range] 0 n 255
[Notes] · This command sets the print starting position to the beginning of the line.
· This command does not affect the line spacing set by ESC 2 or ESC 3.
· The maximum paper feed amount is 1016 mm. If the paper feed amount is more than
1016 mm , the printer feeds paper only 1016 mm.
[Relative] ESC 2, ESC 3
[Example] 1B 40
(initialize printer)
41 41 41 41 41 41 41(data to be printed)
1B 64 02 (print and feed 2 character line spacing, 2/6 inches)
42 42 42 42 42 42 42 0A
(data to be printed)
Results:
2.2 Location command
HT
[Function] Move the print position to the next tab position.
[Format] ASCII HT
Hex 09
Decimal 9
[Notes] · This command is ignored unless the next horizontal tab position has been set.
· If the next horizontal tab position exceeds the printing area, the printer sets the printing
position to [Print area width + 1].
· Horizontal tab positions are set with ESC D.
· If this command is received when the printing position is at [print area width + 1], the
printer executes print buffer-full printing of the current line and horizontal tab processing
from the beginning of the next line.
· The default setting of the horizontal tab position is 8 ASCII characters (12×24).
· When current buffer is full, the printer shall execute the actions as below:
1) In standard mode, the printer shall print current line and set the print position to the
beginning of next line;
2) In page mode, the printer shall shift the line and set the print position to the beginning
of next line.
[Reference]
ESC D
[Example] 0A (set the print starting position to the beginning of the line)
1B 40
(initialize printer)
1B 53
(enter standard mode)
33 33 33 33 33 33
Confidential BTP-R880NP Programming Manual
- 6 -
1B 44 08 10 1C 00set the horizontal tab position
09
move the print position to the next tab
33 33 33 33
09
the same as above
33 33 33 33
09
the same as above
33 33 33 33
0A
print
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
0A
print
Results:
ESC $ nL nH
[Function] The distance from the beginning of the line to the print position is [(nL + nH × 256) ×
(vertical or horizontal motion unit)] inches.
[Format] ASCII ESC $ nL nH
Hex 1B 24 nL nH
Decimal 27 36 nL nH
[Range] 0≤nL 255
0 nH255
[Notes] · Settings outside the specified printable area are ignored.
· The horizontal and vertical motion units are specified by GS P.
· In standard mode, the horizontal motion unit (x) is used.
· In page mode, horizontal or vertical motion unit differs depending on the starting position
of the printable area as follows:
1) When the starting position is set to the upper left or lower right of the printable area
by ESC T, the horizontal motion unit (x) is used.
2) When the starting position is set to the upper right or lower left of the printable area
using ESC T, the vertical motion unit (y) is used.
[Reference] ESC \, GS $, GS \, GS P
[Example] Refer to ESC W
ESC D n1...nk NUL
[Function] Set horizontal tab positions.
Set a tab position at the nth column from the beginning of the line.
There are k tab positions in all,
[Format] ASCII ESC D n1... nk NUL
Confidential BTP-R880NP Programming Manual
- 7 -
Hex 1B 44 n1...nk 00
Decimal 27 68 n1...nk 0
[Range] 1 ≤ n 255
0 k 32
[Notes] · The horizontal tab position is stored as a value of [character width × n] measured from
the beginning of the line. The character width includes the right-side character spacing,
and double-width characters are set with twice the width of normal characters.
· This command cancels the previous horizontal tab settings.
·When setting n = 8, the print position is moved to column 9 by sending HT.
·Up to 32 tab positions (k = 32) can be set. Data exceeding 32 tab positions is processed
as normal data.
·Transmit [n] k in ascending order and place a NUL code 0 at the end.
·When [n] k is less than or equal to the preceding value [n] k-1, tab setting is finished and
the following data is processed as normal data.
· ESC D NUL cancels all horizontal tab positions settings.
·The previously specified horizontal tab positions do not change, even if the character
width changes.
·The character width is memorized for each standard and page mode.
[Default] The default tab positions are at intervals of 8 characters (columns 9, 17, 25...) for font A
(12 × 24).
[Reference] HT
[Example] Refer to HT
ESC T n
[Function] Select the print direction and starting position in page mode.
[Format] ASCII ESC T n
Hex 1B 54 n
Decimal 27 84 n
[Range] 0 ≤ n 3 48 ≤ n 51
n specifes print direction and starting position:
[Notes] · When the command is input in standard mode, the printer executes only internal flag
operation. This command does not affect printing in standard mode.
Confidential BTP-R880NP Programming Manual
- 8 -
· This command sets the position where data is buffered within the printing area.
Parameters for horizontal or vertical motion units (x or y) differ as follows, depending on
the starting position of the printing area:
1) If the starting position is the upper left or lower right of the printing area, data is
buffered in the direction perpendicular to the paper feed direction:
Commands using character width: ESC SP, ESC $, ESC \
Commands using vertical motion units: ESC 3, ESC J, GS $, GS \
2) If the starting position is the upper right or lower left of the printing area, data is
buffered in the paper feed direction:
Commands using horizontal motion units: ESC 3, ESC J, GS $, GS \
Commands using vertical motion units: ESC SP, ESC $, ESC \
[Default] n = 0
[Reference] ESC $, ESC L, ESC W, ESC \, GS $, GS P, GS \
[Example] 1B 4C
(enter page mode)
1D 50 CB CB
set printer resolution
1B 57 20 00 00 00 40 02 90 02
set the print area in page mode
1B 54 00
(select the print area direction in page mode)
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0A
(newline)
1B 54 01
(select the print area direction in page mode)
31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 0A
newline
1B 54 02
(select the print area direction in page mode)
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 0A
(newline)
1B 54 03
(select the print area direction in page mode)
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 0A
print
50 72 69 6E 74 20 45 6E 64
0C
print
Results:
Confidential BTP-R880NP Programming Manual
- 9 -
ESC W xL xH yL yH dxL dxH dyL dyH
[Function] ·Define the horizontal starting position, vertical starting position, printing area width, and
printing area height.
Horizontal starting position: x0 = [( xL + xH × 256) × (horizontal motion unit)] Vertical starting posirion: y0 = [( yL + yH × 256) × (vertical motion unit)] Print area width: dx = [ (dxL + dxH × 256) ×(horizontal motion unit)] Print area height: dy = [ (dyL + dyH × 256) ×(vertical motion unit)]
[Format] ASCII ESC W xL xH yL yH dxL dxH dyL dyH
Hex 1B 57 xL xH yL yH dxL dxH dyL dyH Decimal 27 87 xL xH yL yH dxL dxH dyL dyH
[Range] 0 xL, xH, yL, yH, dxL, dxH, dyL, dyH 255 (except dxL= dxH=0 or dyL= dyH=0)
[Notes] · If this command is input in standard mode, the printer executes only internal flag
operation. This command does not affect printing in standard mode.
· If the horizontal or vertical starting position is set outside the printable area, the printer
stops command processing and processes the following data as normal data.
· If the printing area width or height is set to 0, the printer stops command processing and
processes the following data as normal data.
· This command sets the position where data is buffered to the position specified by ESC
T within the printing area.
· If (horizontal starting position + printing area width) exceeds the printable area, the
printing area width is automatically set to (horizontal printable area horizontal starting
position).
· If (vertical starting position + printing area height) exceeds the printable area, the printing
area height is automatically set to (vertical printable area – vertical starting position).
· The horizontal and vertical motion units are specified by GS P. Changing the horizontal
or vertical motion unit does not affect the current printing area.
· Use the horizontal motion unit (x) for setting the horizontal starting position and printing
area width, and use the vertical motion unit ( y) for setting the vertical starting position
and printing area height.
· When the horizontal starting position, vertical starting position, printing area width, and
printing area height are defined as X, Y, Dx, and Dy respectively, the printing area is set
as shown in the figure below.
Confidential BTP-R880NP Programming Manual
- 10 -
[Default] Decided by printer configuration
[Reference] CAN, ESC L, ESC T, GS P [Example] 0A
1D 50 CB CB
set printer resolution 203×203
1B 4C
(enter page mode)
1B 57 20 00 00 00 40 01 90 01
set print area in page mode
1B 24 00 00
set absolute horizontal starting position to be starting point
41
1B 24 32 00
set absolute horizontal starting position to be 50/203 inches
42
1B 24 64 00
set absolute horizontal starting position to be 100/203 inches
43
0A
newline
1B 24 00 00
set absolute horizontal starting position to be starting point
41
1B 5C 32 00
set relative horizontal starting position to be 50/203 inches
1B 5C 64 00
set relative horizontal starting position to be 100/203 inches
43
0A
newline
0C
print in page mode
Results:
ESC \ nL nH
[Function] Set the print starting position based on the current position by using the horizontal or
vertical motion unit.
This command sets the distance from the current position to the print position to be [(nL +
nH × 256) × horizontal or vertical motion unit]
[Format] ASCII ESC \ nL nH
Hex 1B 5C nL nH
Decimal 27 92 nL nH
[Range] 0 ≤ nL 255
0 nH 255
[Notes] ·Any setting that exceeds the printable area is ignored.
Confidential BTP-R880NP Programming Manual
- 11 -
·When pitch N is specified to the right: nL+ nH × 256 = N
·When pitch N is specified to the left (the negative direction), use the complement of
65536.
·When pitch N is specified to the left: nL+ nH × 256 = 65536 - N
·The print starting position moves from the current position to [N × horizontal or vertical
motion unit]
·The horizontal and vertical motion units are specified by GS P.
·In standard mode, the horizontal motion unit is used.
·In page mode, the horizontal or vertical motion unit differs as follows, depending on the
direction and starting point of the printing area:
1) When the starting position is set to the upper left or lower right of the printable area
using ESC T, the horizontal motion unit (x) is used.
2) When the starting position is set to the upper right or lower left of the printable area
using ESC T, the vertical motion unit (y) is used.
[Reference] ESC $, GS P
ESC a n
[Function] Align all the data in one line to the specified position
[Format] ASCII ESC a n
Hex 1B 61 n Decimal 27 97 n
[Range] 0 ≤ n 2, 48 n 50
n selects the justification as follows:
n Justification
0, 48 Left justification
1, 49 Centering
2, 50 Right justificatoin
[Notes] · This command is enabled only when processed at the beginning of the
line in the standard mode.
·If this command is input in page mode, the printer performs only internal flag operations.
· This command adjusts the space area according to HT, ESC $ or ESC\.
[Default] n = 0
[Example] 0A
Entering line mode
1B 40Initialization 1B 61 00
Setting left justification
41 42 43 0A 41 42 43 44 0A 41 42 43 44 45 0A
1B 61 01
Setting centering
41 42 43 0A 41 42 43 44 0A 41 42 43 44 45 0A
1B 61 02
Setting right justification
Confidential BTP-R880NP Programming Manual
- 12 -
41 42 43 0A 41 42 43 44 0A 41 42 43 44 45 0A
Results:
GS $ nL nH
[Function] This command sets the absolute vertical position.
[Format] ASCII GS $ nL nH
Hex 1D 24 nL nH
Decimal 29 36 nL nH
[Range] 0 nL 255, 0 nH 255
[Notes] · This command is effective only in page mode.
· If the [( nL + nH × 256) × (vertical or horizontal motion unit)] exceeds the specified printing area, this command is ignored.
· The horizontal starting buffer position does not move after executing. this command.
·. The positions of relative commands are specified by ESC T.
· This command operates as follows, depending on the direction and starting position of the printing area specified by ESC T:
1) When the starting position is set to the upper left or lower right, this command sets the absolute position in the direction.
2) When the starting position is set to the upper right or lower left, this command sets
the absolute position in the vertical direction.
· The horizontal and vertical motion units are specified by GS P.
[Reference] ESC $, ESC T, ESC W, ESC \, GS P, GS \
[Example] See ESC W
GS L nL nH
[Function] Set left margin to [( nL + nH × 256) × horizontal motion unit)] inches
[Format] ASCII GS L nL nH
Hex 1D 4C nL nH
Decimal 29 76 nL nH
[Range] 0 ≤ nL 255
0 nH 255
[Notes] · This command is effective only when processed at the beginning of the line in standard
mode.
Confidential BTP-R880NP Programming Manual
- 13 -
· If this command is input in page mode, it is disabled.
· This command does not affect printing in page mode.
· If the setting exceeds the printable area, the maximum value of the printable area is used.
· The horizontal and vertical motion units are specified by GS P. Changing the horizontal and vertical motion unit does not affect the current left margin.
[Default] nL = 0, nH = 0
[Reference] GS P, GS W [Exmple] 0A
Setting printing position at the beginning of the line
1B 40
Initialization
30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37
38 39 0A
1D 4C 30 00
Setting left margin to 48/203 inches
30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37
38 39 0A
1D 57 C8 00
Setting printing width to 200/203 inches
30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37
38 39 0A
Results:
GS P x y
[Function] Set the horizontal and vertical motion units to approximately 25.4/ x mm { 1/ x inches}
and approximately 25.4/ y mm {1/ y inches}, respectively.
[Format] ASCII GS P x y
Hex 1D 50 x y Decimal 29 80 x y
[Range] 0 ≤ x 255
0 y 255
[Notes] · When x and y are set to 0, the default setting of each value is used.
· The horizontal direction is perpendicular to the paper feed direction and the vertical direction is the paper feed direction.
· In standard mode, the following commands use x or y, regardless of character rotation (upside-down or 90° clockwise rotation):
1)  Commands using x: ESC SP, ESC $, ESC \, FS S, GS L, GS W
2) Commands using y:ESC 3, ESC J, GS V
· In page mode, the following commands use x or y, depending on the direction and starting position of print area :
1) When the print starting position is set to the upper left (Printing direction from left to right)or lower right(Printing direction from right to left) of the printing area by ESC T:
Confidential BTP-R880NP Programming Manual
- 14 -
Commands using x: ESC SP, ESC $, ESC W, ESC \, FS S Commands using y: ESC 3, ESC J, ESC W, GS $, GS \, GS V
2) When the print starting position is set to the upper right(Printing direction from top to
down) or lower left (Printing direction from down to top)of the printing area by ESC T: Commands using x: ESC 3, ESC J, ESC W, GS $, GS \ Commands using y: ESC SP, ESC $, ESC W, ESC \,FS S, GS V
· The command does not affect the previously specified values.
· The minimum motion unit is the compositive result of this command and other
commands.
· 1inch=25.4mm.
[Default] x = 203, y =203, at this time, one motion unit is a printing dot. The horizontal distances is
about 1/8mm and the vertical distance is about 1/8mm.
[
Reference] ESC SP, ESC $, ESC 3, ESC J, ESC W, ESC \, GS $, GS L, GS V, GS W, GS \
GS W nL nH
[Function] Set printing area width
[Format] ASCII GS W nL nH
Hex 1D 57 nL nH Decimal 29 87 nL nH
[Range] 0 ≤ nL 255
0 nH 255
[Notes] · The printing area width is set to [( nL + nH × 256) × horizontal motion unit)] inches.
· In standard mode,the command is enabled only when processed at the beginning of the line.
· In page mode, this command is disabled.
· This command does not affect the printing in page mode.
· If the [left margin + printing area width] exceeds the printable area, [printable area width ­left margin) is used.
· The horizontal and vertical motion units are specified by GS P. Changing the horizontal and vertical motion units does not affect the current left margin or print area width.
· The horizontal motion unit ( x) is used for calculating the printing area width.
[Default] nL = 76, nH = 2
[Reference] GS L, GS P
[Example] See GS L
GS \ nL nH
[Function] Set relative vertical print position in page mode [Format] ASCII GS \ nL nH
Hex 1D 5C nL nH Decimal 29 92 nL nH
[Range] 0 ≤ nL 255
Confidential BTP-R880NP Programming Manual
- 15 -
0 nH 255
[Notes] · This command sets the distance from the current position to [( nL + nH × 256) × vertical
or horizontal motion unit] inches.
· This command is ignored unless page mode is selected.
· When pitch N is specified to the movement downward:nL + nH × 256 = N When pitch N is specified to the movement upward:nL + nH × 256 = 65536 - N
· Any setting that exceeds the specified printing area is ignored.
· This command functions as follows, depending on the print starting position set by ESC T:
1) When the starting position is set to the upper left (printing from left to right )or lower right (printing from right to left )of the printing, the vertical motion unit (y) is used.
2) When the starting position is set to the upper right (printing from up to down )or lower left (printing from down to up)of the printing area, the horizontal motion unit (x) is used.
·The horizontal and vertical motion units are specified by GS P.
· The horizontal and vertical motion units can be changed by GS P.
[Reference] ESC $, ESC T, ESC W, ESC \, GS $, GS P
2.3 Character command
CAN
[Function] In page mode, delete all the print data in current area. [Format] ASCII CAN
Hex 18 Decimal 24
[Notes] ·This command is enabled only in page mode.
·If the previously specifited printing data also exists in the currentlly specified printing area, it is deleted.
[Reference] ESC L, ESC W
[Example] 1B 40
Initialization
1D 50 CB CBSetting resolution 203×203
1B 4C
Enter page mode
1B 57 00 00 00 00 20 02 E8 00Setting printing width and height in page mode 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 31 32 33 34 35 36 37 38 39 30 61 62 63 64 65 64 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79
1B 57 44 00 10 00 7C 01 AA 00Setting the size of page needed to be deleted
18
Delete data in page buffer
Confidential BTP-R880NP Programming Manual
- 16 -
1B 24 64 00(Setting abosulute horizontal print position as 100 dots) 1D 24 60 00
Setting abosulute vertical print position as 96 dots
43 61 6E 63 65 6C 20 74 68 65 20 64 61 74 61 20
0A 0C
Printing
Results:
ESC SP n
[Function] Set right-side character spacing [Format] ASCII ESC SP n
Hex 1B 20 n Decimal 27 32 n
[Range] 0 n255 [Notes] · Set the character spacing for the right side of the character to [n×horizontal or vertical
motion unit] inch.
· When characters are enlarged, the right-side character spacing is enlarged the same times.
· This command sets values independently in each mode (standard and page modes)
· The horizontal and vertical motion units are specified by GS P. Changing the horizontal or vertical motion unit does not affect the current right-side spacing.
· In standard mode, the horizontal motion unit is used.
· In page mode, the horizontal or vertical motion unit differs in page mode, depending on starting position of the printable area as follows:
1) When the starting position is set to the upper left or lower right of the printable area by ESC T, the horizontal motion unit (x) is used.
2) When the starting position is set to the upper right or lower left of the printable area by ESC T, the vertical motion unit (y) is used.
· The maximum right-side spacing is 255/180 inches. Any setting exceeding the maximum is converted to the maximum automatically.
[Default] n = 0
[Example] 1B 40
1B 20 00Set right-side character spacing as 0
41 41 41 41 41 0A 1B 20 06
Set character spacing as 6/203 inch
42 42 42 42 42 0A 1B 20 0C
Set character spacing as 12/203 inch
43 43 43 43 43 0A Results:
Confidential BTP-R880NP Programming Manual
- 17 -
ESC ! n
[Function] Select print mode(s) [Format] ASCII ESC ! n
Hex 1B 21 n Decimal 27 33 n
[Range] 0 n 255 [Notes] · Select print mode(s) according to n as follow
Bit 1/0 HEX Decimal Function
0 0 00 0
Standard ASCII Font (12 × 24)
1 01 1
Compressd ASCII Font (9 × 17)
1,2
Undefined
3 0 00 0
Emphasized mode not selected
1 08 8
Emphasized mode selected
4 0 00 0
Double-height mode not selected
1 10 16
Double-height mode selected
5 0 00 0
Double-width mode not selected
1 20 32
Double-width mode selected
6
Undefined
7 0 00 0
Underline mode not selected
1 80 128
Underline mode selected
· When both double-height and double-width modes are selected, quadruple size
characters are printed.
· The printer can underline all characters, but can not underline the space set by HT or 90°
clockwise rotated characters.
· The thickness of the underline is decided by ESC -, regardless of the character size.
· When some characters in a line are double or higher, all the characters in the line are
aligned at the baseline.
· ESC E can also turn on or off emphasized mode. However, the setting of the last received
command is effective.
· ESC – can also turn on or off underline mode. However, the setting of the last received
command is effective.
· GS ! can also select character size. However, the setting of the last received command is
effective.
[Default] n = 0
[Reference] ESC -, ESC E, GS !
[Example] 1B 40
Initialize printer
1B 21 00(Select normal print mode
48 1B 21 01
Select compressed font mode
Confidential BTP-R880NP Programming Manual
- 18 -
48 1B 21 08Select emphasized mode 48 1B 21 10
Select double-height mode
48 1B 21 20
Select double-width mode
48 1B 21 80
Select underline mode
48 1B 21 B9
Select compressed, emphasized,double-width,double-height and underline
mode
48 0A
Results:
ESC % n
[Function] Select/cancel user-defined character set [Format] ASCII ESC % n
Hex 1B 25 n Decimal 27 37 n
[Range] 0 n 255 [Notes] When the LSB of n is 0, the user-defined character set is canceled.
When the LSB of n is 1, the user-defined character set is selected. When the user-defined character set is canceled, the internal character set is automatically selected. n is available only for the least significant bit.
[Default] n = 0 [Reference] ESC &, ESC ?
ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]
[Function] Define user-defined characters [Format] ASCII ESC & y c1 c2 [x1 d1...d(y
× x1)]...[xk d1...d(y × xk)]
Hex 1B 26 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)] Decimal 27 38 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]
[Range] y = 3
32 c1 c2 127 0 x 12 Standard ASCII font (12
× 24)
Confidential BTP-R880NP Programming Manual
- 19 -
0 x 9 Compressed ASCII font (9 × 17) 0 d1 ... d(y
× xk) ≤ 255
· y specifies the number of bytes in the vertical direction.
· c1 specifies the beginning character code for the definition, and c2 specifies the final code.
· x specifies the number of dots in the horizontal direction.
[Notes] ·The allowable character code range is from ASCII code <20>H to <7F>H (96
characters).
· It is possible to define multiple characters for consecutive character codes. If only one character is desired, use c1 = c2.
· d is the data for downloaded characters. The dot pattern is in the horizontal direction from the left side.
· The data to define a user-defined character is (y × x) bytes.
· Set a corresponding bit to 1 to print a dot or 0 to not print a dot.
· The user-defined character definition is cleared when:
1) ESC ? is executed.
2)The power is turned off.
[Default] The internal character set [Reference] ESC %, ESC ? [Example] · When standard ASCII font (12
× 24) is selected
· When compressed ASCII font (9
× 17) is selected
Loading...
+ 58 hidden pages