Opening Cash drawer through RS 232 cable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • piscut3
    New Member
    • Dec 2009
    • 2

    #1

    Opening Cash drawer through RS 232 cable

    I'm developing a POS with cash drawer integration.But I can't open cash drawer.
    I have RS232 cable used to connect cash drawer to PC , dot matrix and cash drawer. This cash drawer has no DLL packaged. Also I tried to open it in DOS
    Code:
     echo>com1
    but it failed. Another code is
    Code:
    mode com1:9600,n,8,1 
    copy con com1
    A
    ^z
    but it failed too.
    Here's my code in VB, but it doesn't worked too..

    Code:
     Sub OpenCashDrawer()
    
            ' create an array to hold the command code bytes
            Dim cashDrawerCmd() As Byte = {27, 112, 0, 25, 250}
    
            ' sets up comPort as SerialPort and opens the port
            With My.Computer.Ports.OpenSerialPort("COM7")
    
                Dim blOpen As Boolean = .IsOpen
                Dim blRtsEnabled As Boolean = .RtsEnable
    
                'comPort.RtsEnable = True
                .ReadTimeout = 90000
                .BaudRate = 9600
                .DataBits = 8
                .Parity = System.IO.Ports.Parity.None
                .StopBits = System.IO.Ports.StopBits.One
                .Handshake = System.IO.Ports.Handshake.RequestToSend
    
                ' writes the whole of the byte array containg the open drawer command codes to the port
                .Write(cashDrawerCmd, 0, cashDrawerCmd.Length)
    
            End With
          
        End Sub
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    The cash draw connects direct to the PC?
    Every cash drawer I've ever used connects to a receipt printer such as an Epson TM-88

    When the receipt printer finishes a receipt it sends +12vdc to the drawer to momentarily fire a solinoid and release the drawer.

    Does your drawer have what looks like a RJ-45 or RJ-12 on the underside of it? That is where a custom cable to the receipt printer would go.

    Comment

    • piscut3
      New Member
      • Dec 2009
      • 2

      #3
      No, it doesn't have any RJ-45 nor RJ-12 port for these. Just a power outlet and port for the RS232 cable ( 9 pin).

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Without the documentation for the drawer it's hard to give much advice. The volunteers here have no way of knowing what the correct commands are for your device... or communication speed etc.

        I suppose its possible that the drawer is expecting your command string to be CR/LF terminated though. Have you tried it with .WriteLine instead of Write ?

        Comment

        • Jerome Mercado

          #5
          Try this dos command...

          Create a textfile and save it as .bat file...

          ex. open.bat

          dir *.bat > COM1

          Note: its depends on which port you insert the serial cable if this not work try to change the COM1 to COM2,COM3,COM4, COM5,COM6

          Comment

          Working...