M01/M02 Development Guide 2009-08-17 Beijing Bright Technology Development Co.,Ltd M01/M02 Development Guide REVISION SHEET Revision Date Draft and Amend Description V01 2009-7-29 Enactment 2009-10-19 Add commands Beijing Bright Technology Development Co.,Ltd i M01/M02 Development Guide Table of Contents REVISION SHEET ................................................................................................................... i Table of Contents .................................................................................................................... ii Features .................................................................................................................................. 1 Features........................................................................................................................... 1 Specifications ................................................................................................................... 1 IrDA.......................................................................... ....................... ........................ ....2 Bluetooth ........................................................................................... .............................2 WIFI ................................................................................................................................. 2 232 ................................................................................................................................... 2 USB ................................................................................................................................. 3 Control Commands Details ..................................................................................................... 3 Basic control command...................................................................... ............................. 3 Initialize Printer .................................................................................................. 3 Carriage return .................................................................................................. 3 Print and line feed.............................................................................................. 3 n Dot Line Feed ......................................................................................... 3 Select Character Commands ........................................................................................... 4 select character ................................................................................................. 4 select Chinese character ................................................................................... 4 exit Chinese character ....................................................................................... 4 Character Setting Commands.......................................................................................... 4 set the gray degree............................................................................................ 4 Enlarge Width .................................................................................................... 5 Enlarge Height ................................................................................................... 5 Enlarge Width and Height .................................................................................. 5 Select/cancel Underline Print............................................................................. 5 Select/cancel Up-line Print................................................................................. 5 Turn emphasized mode on / off ......................................................................... 6 Select/cancel Reverse Print............................................................................... 6 Set Character Rotational Print ........................................................................... 6 format setting command ................................................................... .............................. 6 Set n Dot-line Spacing ....................................................................................... 6 set the space between characters ..................................................................... 7 Select justification .............................................................................................. 7 Set Vertical Tab Value ........................................................................................ 7 Carry out Vertical Tab Value............................................................................... 7 Set Horizontal Tab Value.................................................................................... 8 Carry out Horizontal Tab Value .......................................................................... 8 Set Right Margin ................................................................................................ 8 Set Left Margin .................................................................................................. 9 bit-map graphics command................................................................ .............................. 9 Print bit-map graphics ........................................................................................ 9 one dimention barcode command..................................................... ............................... 9 Print bar code .................................................................................................. 10 Set the height of the bar code.......................................................................... 11 Beijing Bright Technology Development Co.,Ltd ii M01/M02 Development Guide Set the landscape orientation size of the bar code .......................................... 11 PDF417 barcode ............................................................................................................ 11 print PDF417barcode....................................................................................... 12 appendix ................................................................................................... ........................... 13 international escape character set ............................................. ........................... 13. 1. the barcode rule .......................................................................... ........................... 13 3. the length of barcode set ........................................................... ........................... 13 4. character format setting command ............................................. ........................... 14 5. connect us .................................................................................. ........................... 15 Beijing Bright Technology Development Co.,Ltd iii M01/M02 Development Guide Features Features
Stylish, delicate and elegant appearance Ergonomic structure , convenient hand-held. Infrared interface.
Rich interface, strong expansionSupport 232/USBBluetooth/WI-FI
Low-power design Bulk battery support long time to print.
Any dot matrix font download, equipment automatic identification.
One dimensional and two dimensional bar code.
compatible with ESC / POS command set more Character Style Set command. Specifications Item Printing method Direct thermal line printing Printing speed 60mm/s M01 M02 Resolution ration 203 DPI Paper loading way Easy paper loading Character size Depend on user Characters per Depend on user line Character sets ASCIIGB2312 Barcode Printing Emulation 1 dimensionUPC A UPC E CODE 39 CODE 93 Code 128 EAN 8 EAN 13 INTERLEAVED 25(ITF)Codabar. 2 dimensionPDF417 No Windows Windows No paper sensor Tear-Bar Support user language Thermal paper 58 0.5mm Max 40mm1.57in 0.067 0.004 mm (0.003 0.0001) 50km Rechargeable up to 500 times 80 0.5mm Driver SDK Sensor Paper cutter Language Type Width Diameter Thickness THP Battery Interface Serial/USBBluetooth/WIFIIrDA Input 100 ~ 240VAC 1.0Amax 110VA Paper Communicat ion Battery charger Battery Using size Weight Output Type Output Charging time Temperature Humidity 8.4 VDC 1.2A Lithium battery 7.4 VDC8.4 ~ 6.8VDC capacity1800mAh 2.5hours Printer-10~5014~122 battery0~4032~104 Printer 10~90% RH non-condensing battery 20~70% RH non-condensing 111 X 107 X 47(mm) Outline dimension 111 X 85 X 47(mm) Printer Battery Paper 0.175kg 0.100kg 0.030kg 0.215kg 0.100kg General description of communication protocol Infrared There is a RF transceiver in line with IrDA specification, Compatible with IrDA Ver1.2 Maximum communication baud rate is 115200kbps Communication distance30cm Communication perspective30 Bluetooth Printer provide SPP service to other Bluetooth equipment.; receive the data through the SPP Agreement. For the equipment under windowswindows mobilesymbiandistribute a virtual Bluetooth serial port number before established connection. According to different equipment, allocate automatically by operation system or user does manual operation. More information about Bluetooth and SPP Pay a visit to Bluetooth Official Website:
http://www.bluetooth.org 232 1equipment communicates with the printer though serial port or USB. 2The setting of serial port: default baud rate:115200, 8 bits data, 1 bit stop bit, 1 bit odd parity. USB Full compliance with USB2.0 specificationfull speed. Beijing Bright Technology Development Co.,Ltd 2 M01/M02 Development Guide Control Commands Details Basic control command Initialize Printer Format: ASCII: ESC @
Dec: 27 64 Hex: 1B 40 Explanation:
This command is used to initialize the printer. There are two ways we can initialize the printer :
(1) use the command ESC @
(2) re-power the printer Carriage return Format: ASCII:
Dec:
Hex:
CR 13 0D Explanation:
If a CR command is sent to printer the total data in the print buffer will be printed out and paper will be fed for one line forwards. Print and line feed FormatASCII LF Dec 10 Hex 0A Explanation:
Content in the buffer will be carried out after this command. The paper feeds in for a new line. The length is the high of one character and the distance rows between. n Dot Line Feed FormatASCII ESC J n Dec 27 74 n 4A n Hex 1B Explanation:
The printer feeds paper n dot lines. N=0~255. This command sends carriage return and feed line. It won t influence the latter feed line command. Print and Feed Page to the BM position Format: ASC: FF Dec: 12 Beijing Bright Technology Development Co.,Ltd 3 M01/M02 Development Guide Hex: 0c Explanation:
Print the data of buffer, and feed paper to the position of main black mark. Notice: The command is used to fix the black mark position, when the printing paper is pre-printed with a black mark, and the setting position will be the printer starting position. If the paper is pre-printed with a black mark, the printer will print the data of buffer, then feed paper to the black mark position. If the black mark is not detected, the printer will feed 4cm. Select Character Commands select character FormatASCII ESC Dec 27 Hex 1B 8 n 56 n 38 n Explanation:
After the command, it will print out the download Chinese characters set n(from zero begin to count). The printer can download any dot matrix character set and Graphical user-defined font. The first address of user-defined font is 0x20. User can find the download character set in self-test. select Chinese character Format: ASCII FS &
Dec 28 38 Hex 1C 26 Explanation:
After the command, it will print out the first download Chinese characters set GB2312 or GB18030.Printer accept standard internal code, and base on the code if find the characters, the printer print, otherwise not print. When printer power on, the default printing type is Chinese character. exit the Chinese character FormatASCII FS
& . 46 Dec 28 Hex 1C 2E Explanation:
After the command, it will exit the Chinese character, and it will select the first ASCII set in ASCII sets. If user want to select other character, use the command select character.. Character Setting Commands set the gray degree FormatASCII ESC m n Beijing Bright Technology Development Co.,Ltd 4 M01/M02 Development Guide Dec 27 109 Hex 1B 6D n n Explanation:
N ranges from 1 to 12 the larger of the n value, the darker the dot it is . The initial n=0. It is used to modify the final expression of different thermal paper roll. Dec 27 Hex 1B n 85 n 55 n Enlarge Width Format ASCII ESC U Explanation:
The characters and graphics following this command are printed at n times of normal width, n=1~4, default n=,that means normal width, no width enlarging. Enlarge Height FormatASCII ESC V n Dec 27 86 n Hex 1B 56 n Explanation:
The characters and graphics following this command are printed at n times of normal height, n= 1~4, default n=1. Enlarge Width and Height Format ASCII ESC W 87 57 Dec 27 Hex 1B n n n Explanation:
The characters and graphics following this command are printed at n times of normal width and height, n=1~4, default n=1. Select/cancel Underline Print Format ASCII ESC - n Dec 27 45 n Hex 1B 2D n Explanation:
When n=1, select underline print; when n=0, cancel underline print. All characters including spaces will be printed out with underline after selecting underline print command. Default n=0. Select/cancel Up-line Print Format ASCII ESC + n Dec 27 43 n Hex 1B 2B n Explanation:
Beijing Bright Technology Development Co.,Ltd 5 M01/M02 Development Guide When n=1, select up-line print ; when n=0, cancel up-line after selecting up-line print command, unless cancel the up-line print command. Default n=0. Turn emphasized mode on / off Format: ASCII: ESC I n Dec: 27 105 n Hex: 1B 69 n Explanation:
- When the LSB of n is 0, emphasized mode is turned off.
- When the LSB of n is 1, emphasized mode is turned on. Select/cancel Reverse Print ESC c n Format: ASCII:
27 99 n Dec:
1B 63 n Hex:
Explanation:
When n=0, select reverse print, printing from right to left. When n=1, cancel reverse print, printing from left to right. When the printer is assembled vertically, it is convenient to read the word reversely so its initial value is 1. Set Character Rotational Print Format: ASCII:
Dec:
Hex:
FS I n 28 73 n 1C 49 n Explanation:
This command is to rotate characters, the values of n are as following:
Characters rotated widdershins n 0 1 2 3 0 90 180 270 Parameter setting Command for print typeset 1 n Dec 27 49 n 31 n Hex 1B Set n Dot-line Spacing Format ASCIIESC Explanation:
The space between lines are n dots after this command (The dot Beijing Bright Technology Development Co.,Ltd 6 t be affected by enlarging and can M01/M02 Development Guide is unconditional number command.) 1n255. The original setting: n=3. set the space between characters FormatASCII ESC p n Dec 27 112 n Hex 1B 70 n and Explanation:
This command sets the space between characters n dots (The dot enlarging number is unconditional command.) 1n255. The original setting: n=0. 1.1.1.1Select justification FormatASCII ESC a n Dec 27 97 n Hex 1B 61 n affected can t be by 0 n 2, 48 n50 n=0 Aligns all the data in one line to the specified position. n 0 1 2 Justification Left justification Centering Right justification 48 49 50 Set Vertical Tab Value FormatASCII ESC B n1 n2...NUL Dec 27 Hex 1B 66 n1 n2...0 42 n1 n2...00 Explanation:
The vertical tab positions are entered as n1, n2 and so on, The total number of position is 8, all of these should be within the page length set by ESC C command. For example, when n1 = 3, n2=6,the printer executes VT command and paper will feed in to the 3rd and print ,then the printer executes VT command again and paper will feed in to the 6th. The height of unit line is the sun of 8 dots add dots characters between, and is unconditional. Command NUL added at the end indicates the command is over. All vertical tab positions that input can be deleted by using this command in ESC B NUL format. VT command is to carry out vertical tab, the paper fed to the next vertical position. Carry out Vertical Tab Value Format ASCII VT Dec 11 Beijing Bright Technology Development Co.,Ltd 7 M01/M02 Development Guide Hex 0B Explanation:
Feed paper to the next vertical tab position which is set by ESC B command. Notice: if there is no vertical tab value setting, or the current position equals or is beyond the last vertical tab position, VT command is to feed paper one line only(same to LF command). Set Horizontal Tab Value Format ASCII ESC D n1 n2...NUL Dec 27 68 n1 n2...0 Hex 1B 44 n1 n2...00 Explanation:
The tab positions are entered as n1,n2 and so on, the total number of position is 8, and all of these should be within the line width of this model printer. For example, when n1 = 3, the printer executes HT command paper will feed in to the 3rd unit length (unit lengh:0.25mm) then print. The width of each step is the sum of width of character matrix and dots characters between horizontal. Command NUL added at the end indicates the command is over. All horizontal tab positions that set can be deleted by using this command in ESC D NUL format. Carry out Horizontal Tab Value Format ASCIIHT Dec 9 Hex 09 Explanation:
The print position is advanced to the next horizontal tab position which is set by ESC D command. If there is no horizontal tab value setting, or the current position equals or is beyond the last horizontal tab position, HT command won t be carried out. Set Right Margin FormatASCII ESC Q n Dec 27 81 n Hex 1B 51 n Explanation:
N value means n-characters blank space on the right side will be left. Each character space is the sum of width of the character matrix and the horizontal space between. The value of n should be in the range from 0 to the line width of this model printer. Default n = 0, that means no right margin. Set Left Margin FormatASCIIESC 1 n Beijing Bright Technology Development Co.,Ltd 8 M01/M02 Development Guide Dec27 108 n Hex1B 6C n Explanation:
N value means n-characters blank apace on the left side will be left. Each character space is the sum of width of the character matrix and the horizontal space between. The command is relative to the enlarging command. Default n = 0, that means no left margin. Graphic/image printing command Print bit-map graphics Format: ASCII: ESC K ml mh n1 n2...ni... Dec: 27 75 ml mh n1 n2...ni... Hex:
1B 4B ml mh n1 n2...ni... Explanation:
mi mh stand for a 16 bits binary datum . ml is the low 8 bits and mh is the high 8 bits. The number of graph data is mh256+ml. The size of graph depends on the enlarging command. The command will print a iX8 dots graph unit for the 16X16 dots type printer. Its width is i dots and height is 8 dots. A 8-bit binary datum express row structure and the high bit is on the top. The command will print ai/324 dots graph unit for the 24X24 dots type printer. Its width is i/3 dots and height is 24 dots. A 8-bit binary datum express a 8-dot row structure, so three 8-bit binary data is need to express the whole row, the 24-dot row. The high bit is on the top. The order of the data is first from the top to the bottom and then from left to right. If your graph is larger than one graph unit, you can divide the graph to different unit, set and print them separately. For example more than 8-dot height for a 16X16 dots type printer, you can divide the graph to different 8-dot unit and print them respectively. 1 2 3 4 5 6 7 8 9 10 11 12 High bit D7:
Low bit D0:
44H 02H 44H c0H Beijing Bright Technology Development Co.,Ltd 9 M01/M02 Development Guide Dec28 75 n1 n2 data.1data.n2 Hex1C 4B n1 n2 data.1~data.n2 dot line print Format: ASCIIFS K n1 n2 data.1~data.n2 n1:
when n1.0=1print graph twice in height n1.0=0print graph in original height n1.1=1print graph twice in width n1.1=0print graph in original width n2: the large number of the byte of one line. The max is 48(one line is 384 in dot, one byte is 8 dot 8*48)when print in twice width is 24. Data.1~data.n2n2 graph data The command is used to print one line graph data 6.3 print curving 1 Format: ASCII ESC ml mh l1 h1. l2 h2. li hi CR Dec 27 39 ml mh l1 h1. l2 h2. li hi 13 Hex 1B 27 ml mh l1 h1. l2 h2. li hi 0D Note: Both the number and the position of the dots are expressed by double byte data. ml andl1 are the low byte and mh hi are the high byte. The command is used to set and print the curving graph along the paper-feeding orientation. The value of ml mh indicates the number of dots you need in this current line. It should be not bigger than 384. The value of li hi sets the position of the dot i .It should be not bigger than 384 imax = ml mh . 0D is to execute this command. One dimension barcode Print bar code Format:
ASCII GS k Dec 29 107 6B Hex 1D n m d n m d n m d Explanation:
n is used to choose the bar code system. n 65 66 67 68 69 70 71 72 73 Bar Code System UPC_A UPC_E EAN-8 EAN-13 CODE_39 CODABAR Code93 CODE128 INTERLEAVED 25(ITF) Beijing Bright Technology Development Co.,Ltd 10 M01/M02 Development Guide d=the data of barcode. Mthe length of the barcode data Print barcode NOTICE Notice the numbers of each barcode .EAN-13 EAN_128 CODE_39 Code93 UPC_A and EAN-8 barcode can generate parity bit automatically, user doesn t need to transmit that data. The received data must be in the standard bar code set, if exceeding the set ,the command is in vain. CODE39 and CODE93 do not include extend codeEXTERN CODE 39 EXTERN CODE 93 The head of CODE128 barcode data link must be CODE A, CODE B, or CODE C, inside of barcode, also user can switch to another coding. combination{
and one character to define a new function. And transfer two { to define ASCII { . as following:
ASCII
{A
{B
{C
{S
{1
{2
{3
{4 HEX 7B, 41 7B, 42 7B, 43 7B, 53 7B, 31 7B, 32 7B, 33 7B, 34 Function Select coding A Select coding B Select coding C SHIFT}
FNC1 FNC2 FNC3 FNC4 n n n If the length of INTERLEAVED 25(ITF) barcode data is even number, then the n is even number, if it is odd number, then add 0 on the left of data to make the barcode data is even number. (such as :123 change to 0123) Permit /forbid printing HRI character FormatASCII GS Dec 29 Hex 1D H 72 48 Explanation:
When n=0,HRI character will not be printed out and it is the initial value. When n=1,HRI character will be printed out under the bar code. When print HRI character is affected by command of character setting command Set the height of the bar code Format ASCII GS 29 1D Dec Hex h 104 68 n n n Explanation:
Beijing Bright Technology Development Co.,Ltd 10 M01/M02 Development Guide n=0255,when n=0,the height is 256 dot. Default : n=60. Set the landscape orientation size of the bar code FormatASCII GS w n Dec 29 119 n Hex 1D 77 n Explanation:
n=1~4, the size of the bar code be different when the n is different. Default: n=3. narrow bar wide bar 1 2 3 4 3 5 7 9 n 1 2 3 4 n=1~4, the size of the bar code be different when the n is different. Default: n=3. Pinter PDF417 print PDF417 bar code FormatASCII GS Dec 29 Hex 1D 28 6b R C
(
40 r R C
[L 1 H1][L n Hn]
k 107 R C r [L 1 H1][L n Hn]
[L 1 H1][L n Hn]
r the rows of barcode data matrix the columns of barcode data matrix the check grade of barcode0R8 the low byte and high byte of PDF417barcode data matrix n= R*C Explanation:
R=PDF417 C= PDF417 R=PDF417
[L n Hn]
NOTICE The command of Set the height of the bar codeeffect the PDF417 barcode printing. The width of PDF417 barcode is the same with the strip width of one dimension barcode. The height of PDF417 barcode is four times in strip width of one dimension barcode. This command doesnt calculate data coding and validation on the user s input text, but our company s Windows dynamic library will do. Beijing Bright Technology Development Co.,Ltd 12 M01/M02 Development Guide Appendix 1. International escape character set The character after 0x80 code in this set can print only after using the command[exit Chinese character], About Chinese characters ,user can refer to GB-2312 and CP936 Beijing Bright Technology Development Co.,Ltd 13 M01/M02 Development Guide 2. The barcode rule
UPC-A: UPC-A coding must accord with the standard of UCC organization (http://www.uccnet.org ).
UPC-E: UPC-E coding must accord with the standard of UCC organization (http://www.uccnet.org ) .
ENA8: ENA8 coding must accord with the standard of EAN organization (http://www.ean-int.org).
ENA13: ENA13 coding must accord with the standard of EAN organization (http://www.ean-int.org).
CODE39: the beginning bit and the stop bit must be* among that must not contain* amount the data can contain check code or not. The check code has its regular arithmetic. With our printer, user do not need input*and check code . ITF: INTERLEAVED 25 INTERLEAVED 2 of 5The length of data must be eleven number, The data will be include check code or not . The printer will check computation automatically.
CODABAR: Start bit and end bit must be A, B, C, D four characters in a Starting a character that without the same character space, can contain data can also check code includes the check code, check code by coding people custom. 3. The length of barcode set length 12 8 8 13 No limit Barcode type UPC-A UPC-E EAN8 EAN13 CODE 39 INTERLEAVED 25 Even number 0~9 CODABAR CODE 93 No limit No limit character(ASCII) 0~9 0~9 0~9 0~9 0~9 A~Z - . SP $ / + % *
0~9 - : / % . A~D 0~9 A~Z - . SP $ / + % *
4. Character format setting command Character format setting is 1. select character 2. select Chinese character 3. exit Chinese character 4. Enlarge Width 5. Enlarge Height 6. Enlarge Width and Height 7. Select/cancel Underline Print 8. Select/cancel Up-line Print 9. Select/cancel Reverse Print 10. Set Character Rotational Print 11. Set n Dot-line Spacing Beijing Bright Technology Development Co.,Ltd 14 M01/M02 Development Guide This device complies with Part 15 of the FCC and RSS 210 Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate the equipment. NOTE: This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:
-- Reorient or relocate the receiving antenna.
-- Increase the separation between the equipment and receiver.
-- Connect the equipment into an outlet on a circuit different from that to which the receiver is connected.
-- Consult the dealer or an experienced radio/TV technician for help. RF Exposure Statement To maintain compliance with FCC and IC Rule RF Exposure guidelines, This equipment should be installed and operated with minimum distance between 20cm the radiator your body: Use only the supplied antenna. 5. Contact us Company : Beijing Bright Technology Development Co., Ltd Address: 20 th floor, No.5 building, Huihuang International building, the 10 Shangdi District, Beijing, China th street ZIP : 100085 Tel : 0086-10 51655555 Fax : 0086-10 62101720 Website : http://www.whkj.com.cn Beijing Bright Technology Development Co.,Ltd 15