Open cash drawer with vba code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matatov
    New Member
    • Aug 2010
    • 2

    Open cash drawer with vba code

    I am running a pos system out of excel and just bought a cash drawer that connects to my usb epson tm88iv receipt printer. I know that the code I need to send to the drawer is 27 112 48 55 121 but I dont know how to code that into vba. Can someone please help. Thanks
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    I'm afraid you will almost certainly need to direct this question to the supplier of the device. There is far, far too little information here for an Access expert to be able to help you with it.

    Good luck :)

    Comment

    • matatov
      New Member
      • Aug 2010
      • 2

      #3
      The supplier said they wouldnt know the exact code. Just that I need to send the printer the ascii code to trigger the cash drawer to open.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32662

        #4
        Sounds like you didn't get the good luck I'm afraid. Reputable suppliers would be expected to provide a driver and publish an interface (API) for their devices. It sounds like you bagged a bum one there.

        You may get lucky and find someone who knows printing well enough to work out a method to send the string, but I wouldn't hold your breath. Formulating the data itself is no big deal. It's the interface that is pretty undefined that is the problem. Hence the manufacturer of the device needs to be involved I'd suggest.

        Comment

        • mshmyob
          Recognized Expert Contributor
          • Jan 2008
          • 903

          #5
          I haven't worked with a POS register in over 15 years, but those are just simple ASCII codes ie: 27 is the ESC key so chr(27).

          So just build a simple string of ASCII codes and send it to the port the register is connected to. They used to be connected to a simple serial port so just sending the string to the serial port would open the register.

          Hope this helps some.

          cheers,

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            I'm guessing from the OP that the string would need to be sent to a specific printer. This brings so much in that we have no info about that I'd hesitate to lead anyone in that direction without at least hands-on access to the project. Others more experienced at controlling printers and printing from code may find themselves in a better position to help maybe.

            BTW 27 112 48 55 121 resolves to <ESC>, p, 0, 7, y or Chr(27) & "p07y".
            Last edited by NeoPa; Aug 12 '10, 08:06 PM.

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              I guess you could open port the printer is connected to as a binary file and send the code sequence to it. Ports associated with USB devices have names like "USBnnn".
              Sending plain text printer port

              Comment

              Working...