thilino / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

cash drawer did not open with receipt print #230

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have written code following for print receipt and then open cash drawer.

qz.append("\x1B\x40");
qz.append("Thank You\r\n");
qz.append("Have a nice day!\r\n");
qz.append("\r\n");
qz.append("\x1B\x40"); //reset printer 
qz.append("\x1D\x56\x41"); // cut paper 
//start open cash drawer code
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25));
qz.print();

But it print receipt BUT NOT open cash drawer :(

When i execute code only for opening cash drawer like following then it open 
cash drawer

qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25));
qz.print();

similar how to open cash drawer after printing receipt using qz.printHTML(); ? 

Your help are great for me.

Original issue reported on code.google.com by pparesh...@gmail.com on 19 Dec 2014 at 4:39

GoogleCodeExporter commented 8 years ago
> similar how to open cash drawer after printing receipt using qz.printHTML();

Please don't use the bug tracker for support inquiries, we have a mailing list 
for that.  printHTML can't open your register, however you can set this option 
in your print driver if you'd like.

> When i execute code only for opening cash drawer like following then it open 
cash drawer

Then you are using the wrong commands.  Please reference the guides that 
correspond with your hardware please, as these commands have been known to 
change between makes and models of printers.

-Tres

Original comment by tres.fin...@gmail.com on 19 Dec 2014 at 5:26

GoogleCodeExporter commented 8 years ago
> Then you are using the wrong commands.
Is following command or code wrong for print receipt and then open cash drawer?

qz.append("\x1B\x40");
qz.append("Thank You\r\n");
qz.append("Have a nice day!\r\n");
qz.append("\r\n");
qz.append("\x1B\x40"); //reset printer 
qz.append("\x1D\x56\x41"); // cut paper 
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer 
code
qz.print();

when execute only opening cash drawer code like following  , drawer will open, 
means hardware support commands

qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer 
code
qz.print();

But appending receipt text and open cash drawer code in qz object and then 
print will only print receip, like first above code.

Original comment by pparesh...@gmail.com on 20 Dec 2014 at 3:17

GoogleCodeExporter commented 8 years ago
Hello I am trying to use a similar code to open a cash drawer this is my code 
qz.append( chr(27) + "\x70" + "\x30" + chr(55) + chr(121)); but is not 
working... the printer is a Bixolon SRP-275  and I tried like this too  
qz.append( chr(27) + chr(112) + chr(48) + chr(55) + chr(121)); some body can 
help me

Original comment by luisrc...@gmail.com on 30 Jan 2015 at 10:35

GoogleCodeExporter commented 8 years ago
@Luis,

I've also answered this same question on the mailing list, we should probably 
stick to a single location for these... 

For Bixolon, there seems to be an ESC and DC4 approach to this problem.  Not 
sure which applies to your hardware (or both?).  See if this code makes 
sense... 

// ESC p to generate pulse
1. x1B = <ESC>
2. x70 = "p"
3. x00 or x30 (chr48) = Drawer kickout pin 2
   x01 or x31 (chr49) = Drawer kickout pin 5
4. x64 = 200ms pulse "on" time (100 * 2ms)
5. x64 = 200ms pulse "off" time (100 * 2ms) 

qz.appendHex("x1Bx70x00x64x64");

// DC4 to generate pulse
1. x14 = <DC4>
2. x01 = Unknown, always 1
3. x00 = Drawer kickout pin 2
   x01 = Drawer kickout pin 5
4. x02 = 200ms pulse "on" time (2 * 100ms)
5. x02 = 200ms pulse "off" time  (2 * 100ms) 

qz.appendHex("x14x01x00x02x02");

Original comment by tres.fin...@gmail.com on 31 Jan 2015 at 3:42

GoogleCodeExporter commented 8 years ago
And here is the Bixolon programming guide that these commands came from for 
inquiring parties:

http://www.bixolon.com/upload/download/unified%20command%20manual_rev_1_01.pdf

^--- Bixolon Printers only! :)

Original comment by tres.fin...@gmail.com on 31 Jan 2015 at 3:44