Monitoring the cash drawer "Open/Close" status in vb

Posted on 2004-11-29
Last Modified: 2008-03-17
I am trying to write a POS program which uses an RS232 generic cash drawer PCD-005. I was able to kick open the cash drawer using some of the codes suggested here in experts exchange. I am now having problems as to how to monitor the cash drawer whether it is open or not. I tried searching through experts exchange solutions but I have no premium account and I cannot view the answers posted for a similar problem as mine. Can anyone help me?

Additional Info:
Computer Info:
    Intel Celeron 534 Mhz
    256 MB RAM
    Windows XP Professional
Question by:fiSBoN3
    LVL 3

    Expert Comment

    First of all ; if you're writing a POS programm I'll suggest to use OPOS (see Very interesting for using in VB.

    Based on info at : it isn't to difficult to get the position of the drawerposition.
    The site mentions one can use the EPSON commands to open/close the drawer.
    Maybe you can use the EPSON service objects for the Cashdrawer to steer the drawer see drivers at

    Author Comment

    I've tried all of them but none worked. Are there drawers that do not support open/close status monitoring?

    Here are the codes that I used. It opens the drawer but the status monitoring doesn't work... please check what's wrong.

    Dim sopen As Boolean

    Private Sub Form_Load()
     ' Set and open port
     MSComm1.CommPort = 1
     MSComm1.Settings = "9600,n,8,1"
     MSComm1.PortOpen = True

     Timer1.Enabled = True
     Timer1.Interval = 1000 'change as you see fit. now set to 1 second
    End Sub

    Private Sub OpenDrawer_Click()
        MSComm1.Output = Chr(&H1B) + Chr(&H70) + Chr(&H0) + Chr$(&H19) + Chr$(&HFA) + Chr$(0)  'hex code

    End Sub

    Private Sub Timer1_Timer()

        Dummy = DoEvents()
        Loop Until MSComm1.InBufferCount >= 5
    If MSComm1.Input <> Chr(&H1) Then
      MsgBox "Warning Cash Drawer Is Open"
    End If

    End Sub
    LVL 3

    Accepted Solution

    Based on information on the website; the drawer doesn't automatically tells its position when status has changed. One need to query the position each time it's needed.
    Maybe you can build into your timer, the command to get the drawerposition and then process the answer.
    Most drawer don't support automatic status reporting.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Help with my python script 6 136
    Adobe Customization Wizard XI issues 26 136
    Enhanced For loop vs ForEach Loop 4 42
    countAbc challenge 9 35
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now