1 2 Previous Next 18 Replies Latest reply on Jan 2, 2017 1:34 AM by monkeybreadsoftware

    how to send an HEX code to printer


      Have built a POS system, using the receipt printer to open the cash drawer. Problem now is when the printer is set to "receipt" mode, it opens the drawer, but then entire roll of paper runs out, does not see the end. Manufacturer of printer said I have to send a HEX code to force it to stop and cut the receipt.  So, how do I send a hex code to a printer?

        • 1. Re: how to send an HEX code to printer

          what are you using now to send the 'command' to open the drawer?

          what kind of printer? what OS? what version of FM?

          are you using any plug-in?

          can you post screenshot(s) and/or code? (use Advanced Editor in this forum)



          • 2. Re: how to send an HEX code to printer

            Without a plug in, the only way to send data to a printer is to print. Don't know if you can put that hex code as a character on a layout and print it to send it to the printer or not.

            • 3. Re: how to send an HEX code to printer

              Here's a search that might help find your answer:




              This is a problem of a user friendly db app and avoiding the pain of coding byte by byte dot matrix printing...


              A second question is why have printing open the drawer automatically when payment might be made by credit card?


              Random guess but in a supermarket only 1 in 10 sales involve cash and a need to open the drawer.


              You might consider a different printer/etc and say your POS is approved to use xxx.

              • 4. Re: how to send an HEX code to printer

                can Send Event be used in any way?

                • 5. Re: how to send an HEX code to printer

                  I have done this . There are a number of ways to do it..  It depends on the printer and the interface it uses.  HEX would be my last choice.  There are several that have more friendly interfaces.


                  In order to help you need to tell us which printer you are using and how you are printing. There are several options that are needed that the print command likely won't do one of them being cut the other being to toggle the drawer .

                  1 of 1 people found this helpful
                  • 6. Re: how to send an HEX code to printer

                    Not strictly true Phil  There are other ways of doing it and in any case the print command does not toggle the on/off for the till drawer in 99% of printers

                    • 7. Re: how to send an HEX code to printer

                      In most case the fact of printing a ticket produce also the opening of the drawer.


                      Even if customers pay with credit card the drawer is opened to permit the cashier to collect the credit card ticket for store in a place of drawer.

                      • 8. Re: how to send an HEX code to printer

                        The opening and not opening of a drawer as well as the cutting of the ticket at the end of printing are both functions which you can control in a raw state.


                        Using the Print functioning treating it like a normal printer in 99% of cases does not allow the toggle for the till drawer but it often allows for the cutter function.


                        in some it does not and so a command has to be sent to achieve this.  it all depends on the interface of the till roll printer.

                        1 of 1 people found this helpful
                        • 9. Re: how to send an HEX code to printer
                          David Moyer


                          back when I was a kid, I could make a bell ring (literally - on a dumb, hard-copy terminal, and a beep on other terminals) by typing ctrl-g.  Is it possible to simply put control characters, like Char(10) for a line feed, into the text?

                          I have a feeling that HEX is some acronym I'm unaware of.  For me, it's hexadecimal; and it implies control characters.

                          hope this helps

                          • 10. Re: how to send an HEX code to printer

                            You can try to put your HEX code in a text file and send it for printing but you will obtain the same thing : a page or some portion of paper will be passed and drawer will open.


                            I use TSP100 Thermal printer from Star Microtronics with FileMaker on Macs and sometimes on PCs.

                            In Mac settings for printing, "Printer functions", lets you the possibility to do or not do an opening of drawer, but it's always after printing a piece of something.


                            In Mac Terminal software, perhaps using redirection to printer when printing only you HEX char can you send this HEX code to printer, I've not tried.


                            You can also use AppleScripts to send CUPS commands, not tried also.

                            • 11. Re: how to send an HEX code to printer

                              I don't believe alan40201 ever got back to us with specifications. There may be ways that work for a particular setup.

                              • 12. Re: how to send an HEX code to printer

                                yes and no. hexadecimal is one representation of characters (all characters not just control characters).

                                simply typing and printing:

                                20 // hexadecimal for ascii 32 - the space character

                                does not necessarily send that HEX code, but the characters '2' & '0'.

                                my presumption is that there is a string of HEX code that must be sent not as plain text.


                                I used to control my mom's old dot matrix with binary characters and there was a specific way to send them. so I still ponder if there's a way to Send Event in FileMaker:


                                but we may need details from OP.


                                • 13. Re: how to send an HEX code to printer
                                  David Moyer

                                  yes, I speak ASCII.  I'm not going go into my CS/EE past any more.

                                  • 14. Re: how to send an HEX code to printer

                                    Star printers are good an I prefer to use them but they have many interfaces and some are better suited than others. They have a very mac compatible one that is AirPrint and that has an app for the iPad. There is however limited drawer control on this printing. Having said the I have not seen their latest now yet which seems designed to work with a tablet and even has usb charging right at the printer.  I am looking forward to getting my hands on that one!


                                    It should even be possible to send an open draw command without any printing.  Open draw on a star  is a pulse command and is not just usable for opening a till draw. It just sends an electrical pulse down the channel that you would connect the drawer to. So theoretically it could be used for many things.

                                    1 2 Previous Next