Page 1
Programming Manual Receipt Printer BTP-M300 Shandong New Beiyang Information Technology Co., Ltd.
Page 3
BTP-M300 Programming Manual Revision history Date Version Description Drafted by 2013-3-5 V1.0 Primary version Mr. Mu Jianping - 1 -...
Page 4
When you terminate the cooperation with SNBC or bring about your request, you have to stop using this manual and return it to SNBC or its distributor, or destroy the confidential information.
BTP-M300 Programming Manual 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.
Page 10
BTP-M300 Programming Manual 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. - 2 -...
BTP-M300 Programming Manual 2 Command Description 2.1 Print command Print the data in buffer and feed one line; when the print buffer is vacant, feed one line [Function] and the paper feed amount is the current line spacing. ASCII [Format]...
BTP-M300 Programming Manual ASCII [Format] Decimal 0 ≤ n ≤ 48 [Range] If n exceeds the paper retraction range, the data in the buffer will be printed but the printer [Notes] will not retract paper. Paper retraction may cause the issues below: •...
BTP-M300 Programming Manual • In paper retraction, the paper may be colored due to ribbon. [Relative] ESC 2, ESC 3 2.2 Location command Move the current position to the next tab position. [Function] ASCII [Format] Decimal • The default tab positions are at intervals of 8 characters for Font B.
BTP-M300 Programming Manual Set horizontal tab positions. [Notes] • n specifies the column number for setting a horizontal tab position from the beginning of a line. • k indicates the total number of horizontal tab positions to be set. • ESC D NUL cancels all tab positions.
BTP-M300 Programming Manual 1B 61 02 (Set the right alignment of characters) 41 42 43 0A 41 42 43 44 0A 41 42 43 44 45 0A Result: GS ( F PL PH a m nL nH Set location offset of black mark...
BTP-M300 Programming Manual ASCII [Format] Decimal • This Command is valid only when the paper type is set to marked paper; [Notes] • Detect black mark and feed paper to the print start position set by GS F (; • When black mark is already at the print start position, the printer shall not feed paper if sending this command at this time;...
Page 17
BTP-M300 Programming Manual Emphasized mode selected Double-height mode not selected Double-height mode selected Double-width mode not selected Double-width mode selected Undefined Underline mode not selected Underline mode selected •The command can underline ASCII characters and the right-side spacing, but can not underline the space set by HT.
BTP-M300 Programming Manual 0 ≤ n ≤255 [Range] Select or cancel the user-defined characters: [Notes] • When the LSB of n is 0, the user-defined characters are not used. • When the LSB of n is 1, the user-defined characters are used.
BTP-M300 Programming Manual • When Font B is selected: ESC – n Turn underline mode on/off [Function] ASCII [Format] 2D n Decimal 45 n 0 ≤ n ≤2, 48 ≤n ≤ 50 [Range] Turns underline mode on or off, based on the following values of n:...
BTP-M300 Programming Manual • The command can underline ASCII characters, but cannot underline the space set by • Underline mode can also be turned on or off by using ESC !. The last executed command is effective. n = 0...
BTP-M300 Programming Manual ESC R n Select an international character set [Function] ASCII [Format] Decimal 0 ≤ n ≤ 15 [Range] Selects an international character set: [Notes] Character set U.S.A. France Germany U.K. Denmark I Sweden Italy Spain I Japan...
BTP-M300 Programming Manual Page 20 [Thai character code 42]* Page 21 [Thai character code 11]* Page 26 [Thai character code 18]* Page 34[PC1251]** Page 38[PC1257]** Page 255 [User-defined page] *Printers that have been installed with Thai code page; ** Printers that have been installed with English or GB2312 fonts.
Page 24
BTP-M300 Programming Manual 0 ≤n ≤ 255 [Range] Set the print mode for Asian characters, using n as follows: [Notes] Decimal Function Undefined Double-width mode OFF Double-width mode ON Double-height mode OFF Double-height mode ON Undefined Underline mode OFF Underline mode ON •When both double-width and double-height modes are set (including right- and left-side...
BTP-M300 Programming Manual • The printer can underline all characters (including right- and left-side character spacing), [Notes] but cannot underline the space set by HT. • The specified line thickness does not change even when the character size changes • It is possible to turn underline mode on or off using FS !, and the last received command is effective.
BTP-M300 Programming Manual [Relative] FS ?, FS C FS ? c1 c2 Cancel the user-defined characters [Function] ASCII FS ? c1 c2 [Format] 1C 3F c1 c2 Decimal 28 63 c1 c2 The value range of c1, c2 is related to different Asian character type:...
BTP-M300 Programming Manual FS S n1 n2 Set left-side and right-side character spacing [Function] ASCII [Format] Decimal 0 ≤ n1 ≤ 32 [Range] 0 ≤ n2 ≤ 32 The left-side character spacing of Asian characters is [n1 ×0.158]mm, and the right-side [Notes] character spacing is [n2 ×0.158]mm.
BTP-M300 Programming Manual Encrypted 8-dot 200 dots single-density Encrypted 8-dot 400 dots double-density • If the bitmap data input exceeds the number of dots to be printed on a line, the excess [Notes] data is ignored. • If the value of m is out of the specified range, nL and the data that follows are processed as normal data.
BTP-M300 Programming Manual • A definition data of a NV bitmap consists of [xL xH yL yH d1...dk]. Therefore, when only one NV bitmap is defined, n=1. The printer uses ([number of bitmap data bytes: ( xL + xH × 256) × ( yL + yH× 256) × 8] + [header:4]) bytes of NV memory.
Page 31
BTP-M300 Programming Manual Printer off-line Fixed to 1 Reserved Fixed to 0 • n = 2: off-line status Decimal Function Fixed to 0 Fixed to 1 Top cover closed Top cover open FEED button not pressed FEED button pressed down...
BTP-M300 Programming Manual Paper present 2, 3 Paper near end Fixed to 1 Paper present 5, 6 Paper end Fixed to 0 • If print data contains the same character strings as this command, those data shall be executed as this command. Users must consider this case.
BTP-M300 Programming Manual GS a n Enable/disable Automatic Status Back (ASB) [Function] ASCII [Format] 61 n Decimal 97 n 0 ≤ n ≤ 255 [Range] Determine the content of ASB, and the meaning of parameter n is as below: [Notes]...
BTP-M300 Programming Manual Second byte (printer information) Decimal Printer status Reserved Reserved No carriage error Carriage error occurs No cutter error Cutter error Reserved No unrecoverable error Unrecoverable error occurs No auto-recovery error Auto-recovery error occurs Reserved Bit 5: Unrecoverable error means that input voltage is abnormal.
BTP-M300 Programming Manual Return the status specified by n as follows: [Notes] Function 1, 49 Return paper sensor status 2, 50 Return cash drawer status • This command is valid for serial, parallel and USB interface printers. [Notes] • This command is executed after the data before the command in the receive buffer is processed.
BTP-M300 Programming Manual DLE DC4 fn m t Generate cash drawer opening pulse at real time. [Function] ASCII [Format] Decimal fn = 1 [Range] m = 0, 1 1 ≤ t≤ 8 Generate the opening pulse in the specified cash drawer connector pin, with pins...
BTP-M300 Programming Manual XOFF Data return is disabled. [Function] ASCII XOFF [Format] Decimal • This command is effective when the interface is serial and flow control is software [Notes] handshake. • Data return is forbidden. • This command disables printer to return data. At prohibitive stage, the data to be returned are thrown away.
BTP-M300 Programming Manual Function Printer on-line Printer off-line • When the printer is disabled, it ignores all other commands except for this command [Notes] and real-time commands (DLE EOT, DLE ENQ, DLE DC4). [Relative] DLE EOT, DLE ENQ, DLE DC4...
BTP-M300 Programming Manual Decimal Function Paper near end sensor disabled Paper near end sensor enabled Paper near end sensor disabled Paper near end sensor enabled Paper end sensor disabled Paper end sensor enabled Paper end sensor disabled Paper end sensor enabled Undefined •...
BTP-M300 Programming Manual n = 0 [Default] ESC I Partial cut [Function] ASCII [Format] Decimal • Printer doesn’t feed paper and cut paper directly. [Notes] • Partial cut refers to the cutting operation with several dots in the middle left uncut.
Page 41
BTP-M300 Programming Manual Print color 0, 48 Black 1, 49 This command is enabled at the beginning of a line. [Default] GS ( A pL pH n m Execute test print. [Function] ASCII GS ( pL pH n [Format] 1D 28 41 pL pH n...
Page 42
BTP-M300 Programming Manual Command format Functions Delete data record specified by c1 and 0, 48 GS ( C pL pH m fn b c1 c2 GS ( C pL pH m fn b c1 c2 1, 49 Store data in the specified record [d1...dk]...
Page 43
BTP-M300 Programming Manual 32 ≤ d ≤ 254 k = (pL + pH 256) – 5 Total capacity = 8KB • Data (d1……dk), as the record data of key code (c1, c2), is stored in user NV memory. [Notes] [d1…dk] specifies the stored data (record content).
Page 44
BTP-M300 Programming Manual (Function 5)GS ( C pL pH m fn b (fn = 5, 53) Query data record list. [Function] ASCII GS ( pL pH m fn b [Format] 1D 28 43 pL pH m fn b Decimal 29 40 67 pL pH m fn b (pL + pH ×...
Page 45
BTP-M300 Programming Manual 0, 48 DLE DC4 fn m t and DLE EOT n are disabled. 1, 49 DLE DC4 fn m t and DLE EOT n are enabled. a = 1, b = 1 [Default] GS ( E pL pH fn [parameters]...
BTP-M300 Programming Manual d1 = 48 (a = 2) d1 = 48 (a = 3) d1 = 56 (a = 4) (Function 12)GS ( E pL pH fn a (fn = 12) Query serial communication parameters. [Function] ASCII GS (...
Page 50
BTP-M300 Programming Manual Cutting mode 0, 48 Full cut 1, 49 Partial cut Cut paper after feeding (the distance from print position to cutter +[n 65, 66 ×0.176]mm) • This command is effective at the beginning of a line. ① ②...
BTP-M300 Programming Manual 3 Programming Process Guide Because the different printing status and error can be returned by Auto Status Back (ASB) command, it is recommended that you can use ASB command to inquire status. ASB command is effective when powering on the printer and can be directly sent to inquire the status.
BTP-M300 Programming Manual Appendix A: character index table ESC u n Peripheral status transmission —C— ESC U n Select /cancel unidirectional print mode CR Print and carriage return ESC v Paper status transmission —D— DLE DC4 fn m t Generate cash drawer opening pulse at —F—...
Need help?
Do you have a question about the BTP-M300 and is the answer not in the manual?
Questions and answers