Excel VBA code to send cash drawer control codes RRS feed

  • Question

  • I have a small excel file from where I would like to use VBA code to open cash drawer which is connected via Samsung SRP-350 thermal receipt printer. I need to send printer control codes (27,110,0,25,250) to open drawer. Tried everything but nothing seems to work. All hardware is working ok from commercial cash register application. Please help!!
    • Edited by Sid2051 Thursday, January 3, 2013 9:18 PM
    Thursday, January 3, 2013 8:59 PM

All replies

  • Questions:

    Q1. Where does the Excel document sit in relation to eh thermal receipt printer and the physical hardware?

    Q2. Does the receipt printer normally send the codes?

    Q3. Are connections over ethernet?

    Q4. Is the code transmitted over TCP/IP, UDP, bespokedly interpreted ICMP?

    Q5. Aren't there any DLLs or manufacturer supplied utilities that you could send commands to, to do this?

    Because depending on the circumstances, and if you have no software for the hardware, then:

    1. Use a packetsniffer to determine exactly what protocol and complexity is behind the communications between the two. (Wireshark, for example, is free and the easiest of them all to use).

    2. Write code that will produce the correct sequence of bytes programmatically (you might have use WinPCap to keep track of TCP sesion if required so you can insert the right numbers). Wireshark can help you work out what order the bytes go in, if you've not done stuff like that before.

    3. Install CLI-based software that can create network packets (Hping or Netcat for example).

    4. Have you code simply call the packet crafter and send it the correct data, then it will send the packet for you.

    This approach requires minimal delving into the stack, if you literally are starting with no knowledge of the traffic at all, and no other DLLs you can use to interface with the drawer.

    Sunday, January 6, 2013 9:41 PM