SNBC BTP-M300 Programming Manual

SNBC BTP-M300 Programming Manual

Hide thumbs Also See for BTP-M300:

Advertisement

Programming Manual
Receipt Printer
BTP-M300
Shandong New Beiyang Information Technology Co., Ltd.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BTP-M300 and is the answer not in the manual?

Questions and answers

Summary of Contents for SNBC BTP-M300

  • 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.
  • Page 5: Table Of Contents

    BTP-M300 Programming Manual Contents 1 Overview ............................- 1 - 1.1 Commands classification ......................- 1 - 1.2 Key terms........................... - 1 - 1.3 Command format ........................- 1 - 2 Command Description ........................- 3 - 2.1 Print command........................... - 3 - LF ..............................
  • Page 6 BTP-M300 Programming Manual ESC t n............................- 14 - ESC { n............................- 15 - FS ! n............................- 15 - FS & ............................- 16 - FS – n............................- 16 - FS .............................. - 17 - FS 2 c1 c2 d1...dk ........................- 17 - FS ? c1 c2 ..........................
  • Page 7 BTP-M300 Programming Manual ESC @ ............................- 30 - ESC U n ............................. - 30 - ESC c 3 n ........................... - 30 - ESC c 4 n ........................... - 31 - ESC c 5 n ........................... - 31 - ESC I............................
  • Page 9: Overview

    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 -...
  • Page 11: Command Description

    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]...
  • Page 12: Esc D N

    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: •...
  • Page 13: Location Command

    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.
  • Page 14: Esc A N

    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.
  • Page 15: Gs Ff

    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...
  • Page 16: Character Commands

    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.
  • Page 18: Esc & Y C1 C2 [X1 D1

    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.
  • Page 19: Esc - N

    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:...
  • Page 20: Esc E 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...
  • Page 21: Esc G N

    BTP-M300 Programming Manual 1B 45 00 (Emphasized mode is not selected) 41 41 41 42 42 42 0A 1B 45 01 (Emphasized mode is selected) 41 41 41 42 42 42 0A Result: ESC G n Turn on/off double-strike mode...
  • Page 22: Esc R N

    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...
  • Page 23: Esc { N

    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...
  • Page 25: Fs 2 C1 C2 D1

    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.
  • Page 26: Fs ? C1 C2

    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:...
  • Page 27: Fs S N1 N2

    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.
  • Page 28: Fs P N M

    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.
  • Page 29 BTP-M300 Programming Manual 1 ≤ n ≤ 255 [Range] 1 ≤ ( xL + xH × 256) ≤ 1023 (0 ≤ xL ≤ 255, 0 ≤ Xh ≤ 3) 1 ≤ ( yL + yH × 256) ≤ 288 (0 ≤ yL ≤ 255, yH = 0,1) 0 ≤...
  • Page 30: Status Command

    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...
  • Page 32: Esc U N

    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.
  • Page 33: Gs A N

    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]...
  • Page 34: Gs R N

    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.
  • Page 35: Other Commands

    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.
  • Page 36: Dle Dc4 Fn M T

    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...
  • Page 37: Xoff

    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.
  • Page 38: Esc

    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...
  • Page 39: Esc C 4 N

    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 •...
  • Page 40: Esc I

    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]...
  • Page 46 BTP-M300 Programming Manual Decimal 29 40 69 pL fn d1 d2 d3 (pL + pH × 256) = 4 (   pL = 4 , pH = 0) [Range] fn = 2 d1 = 79 d2 = 85 d3 = 84 •...
  • Page 47 BTP-M300 Programming Manual (pL + pH × 256) = 2 ( pL = 2, pH = 0)   [Range] fn = 4 a = 2, 8 • This command is valid for serial, parallel, and USB interface printer. [Note] (Function 5)GS ( E pL pH fn [a1 n1L n1H ]...[ak nkL nkH] (fn = 5) Set paper width.
  • Page 48 BTP-M300 Programming Manual ASCII fn a d1 … dk [Format] 28 45 pL fn a d1 … dk Decimal 29 40 69 pL fn a d1 … dk 3 ≤ (pL + pH × 256) ≤ 8 (3≤pL≤8, pH= 0) [Range] fn = 11 1 ≤...
  • Page 49: ①Gs V M ② Gs V M N

    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. ① ②...
  • Page 51: Programming Process Guide

    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.
  • Page 52: Appendix A: Character Index Table

    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—...

Table of Contents

Save PDF