Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2004-11-29
Medium Priority
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
  • 2

Expert Comment

ID: 12703774
First of all ; if you're writing a POS programm I'll suggest to use OPOS (see http://www.monroecs.com/posstandards.htm). Very interesting for using in VB.

Based on info at :http://www.iposltd.com/drwty5tc.html 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 http://www.pos.epson-europe.com/support/drivers.htm 

Author Comment

ID: 12713216
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

Accepted Solution

jlsjls earned 800 total points
ID: 12713598
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
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 …
Six Sigma Control Plans

580 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