Using Cash Drawers

On this tutorial I’ll show you how to operate cash drawers.

###Connection types

  • Serial Connection: Drawer connects to PC through serial port. This connection type is not recommended because drawers does not have power source of their own and to be able to kick drawer they use power from serial port. If port voltage is not enough for cash drawer it won’t work. If you have that kind of drawers on hand you can search Google for USB powered kickers.

  • RJ11 Connection: Drawer connects to a receipt printer with a RJ11 type cable. This is better because we can adjust voltage for drawer so it works with any kind of cash drawer.

###How it works

We’ll use SambaPOS’s printing mechanism to send kick command to cash drawer. This technique works great because you can prefer to open drawer while printing receipts, receiving payments or manually. What we need to do is adding drawer kick command to a printer template and send it to drawer.

So we’ll need to configure a printer for drawer. If our cash drawer connected to the receipt printer we can use existing ticket printer setting to send commands. For serial connection we’ll need to add a Port Printer, configure Port setting and use this printer to send kicking command.

First of all we need to know which command we need to send to open drawer. For serial connection <XCT>21 command should work. For receipt printer connection it depends on your cash drawer model. Most used command is <XCT>27,112,0,25,250. For this tutorial I’ll use this command. You can visit or google your drawer model to find required command. Don’t forget to add <XCT> tag behind command so SambaPOS can understand this is not a printout.

###Preparing printer template
This is simple. If we need to kick drawer while printing bills, the only thing we need to do is adding <XCT>27,112,0,25,250 command to the beginning of the template. When that template prints drawer will open.

For most cases we’ll need finer control. For this reason we’ll prepare a separate printer template and use it when we want to open drawer. Navigate to Settings > Printer Templates and add a printer template that contains only drawer opening command.

We’ll also need a print job to start printing. This print job will map our printer template to printer.

I’ve added a mapping and selected template and printer. We are using Ticket Printer since we assume our drawer connected to receipt printer.

Finally we’ll need an action that executes this print job. Navigate to Automation > Actions and create a new action.

###Opening drawer manually

Adding an Open Drawer button to Payment screen might be handy.

First we’ll create an Automation Command to display a button on Payment Screen. This is how that button should appear. Please note we’re using \r to wrap button header to two lines.

Now we’ll map that to Payment Screen. I’m switching to Mappings tab.

Visibility should be Payment because we need to see this button on payment screen. If you want you can change user role mapping to show this button to a specific user role or you can map it to only Fast Food department.

Now we’ll execute open drawer job when this button clicked. We need to configure a rule for that.

…and we’ll add default mapping to enable this rule.

That’s all. Now we should see cash drawer button on Payment Screen and it should kick drawer when clicked.

###Opening cash drawer on Cash payments

We already did the hard work. Now we can automate drawer opening for our needs. For example we can open it when we receive cash payment. This is simple. We’ll create a rule for Payment Processed event.

Don’t forget to add a default mapping.

This rule will execute open drawer action when we receive a cash payment. Great isn’t it?


superb guide. easy to follow and show the logic behind things. yes mine is working as it should be =D

My printer settings, so what will be the template for open drawer?

This is easier to find the code

Most used command is <XCT>27,112,0,25,250

Should definitely work. Did you try that ?

Yes i did try that but no hope, my printer is a Chinese made wifi printer, is that make any diffrence
Thanks John

Many Thanks its working now !!!

Doesn’t matter if it’s wifi. If you can print the. It’s working.
Where are you putting the cash drawer codes ? It should be the first clans in your ticket template.

Is your cash drawer compatible ? Some printers use 12v instead of 24v to kick a cash drawer.

Try the following code.

Hi @JohnS, ive followed the guide step by step and tried every code possible but i still cant get my cash drawer to kick open.

Everytime i press the open drawer button on the payment screen i get the following error.

'There is a problem while printing. Check printer and printer template settings.

The handle is invalid.’

I am using v3. Thank you

Is your cash drawer connected to the receipt printer?
What brand printer do you have?

Hello! I am from Brazil, and I’ve been trying to use sambapos 3, but I am stuck at the cash drawer config, I am using samba on windows 8 with a local brand receipt printer “Bematech mp-20” attached with a RJ-12 cash drawer, normally the VBS command to open the drawer is:

sComando = chr( 27 ) + chr( 118 ) + chr( 140 )
iRetorno = ComandoTX( sComando, Len( sComando )

You can try adding <XCT>27,118,140 line to printer template.

Hello @emre! thanks for the fast reply! Already tried but no success, I also did all steps of your guide again, my best guess is that the code is wrong, because I tested the printer, the drawer and also the code which in this case is 27+118+140 in plexis pos, all worked fine.

Hi @emre @JohnS. the make model of my printer is:

epson TM-T88IIP

and my cash drawer is connected directly to the printer.

i have tried the tutorial on v3 and v4 and i cant seem to get it working, i have been trying for over 2 weeks now, so your help will really be appreciated!

thank you

@DenizAltun did you checked drawer codes link for your printer model?

Hello friends, I made some other tests and I also found the printer manual that says that 7 code is for the printer sound a beep, so I changed the code at printer templates like this <XCT>7 and tested the drawer button and the printer beeps, I infer then that the steps in the guide are working perfectly

In other section that mentions about the drawer the code is like this:

the translation on the description is: optional drawer (turns on the drawer for n milliseconds) 50ms<n<200ms. I tried many other codes but no success yet. I appreciate very much if someone figure out the solution.

@yurimh which codes you’ve tried? As it starts with ESC it should be something like <XCT>27,118,50

Works like a charm! Many thanks!!!

@emre yes ive tried 2-3 different printers on different systems, still no success.