Solved

Trying to open Cash Drawer connected by printer

Posted on 2004-08-19
5
1,853 Views
Last Modified: 2013-12-25
Hi everybody, i have a problem, i got a POS Epson printer TM-U220D, i'm able to print my receipts with it, but now i'm going to have a cahs drawer connected to it.  I want to kick the cash drawer out by sending the escape code but i'm not able to open the port where my printer is.  

The printer is connected on my com port, i use a crosswire cable because if not, i can't print on it.  The port from the printer is a RS-232 and the crosswire adapts it to fit on my comport.  I printed the test page from the printer to get the settings of the printer and it gives me :

Baud Rate=9600
Data Bits=8
Parity=none
Stop Bit=1

So in my app, when i use the mscomm control, i can't open the port and i got the error 8012 : Could not set comm state, there may be one or more invalid communication parameters.

My app is running on Winxp, here is an example of my code:

MSComm1.CommPort = 1
MSComm1.Settings = "9600,n,8,1"
MSComm1.PortOpen = True  This is where the error happen
MSComm1.Output = Chr$(27) + "p" + "0" + "zz"
MSComm1.PortOpen = False

Any help would be appreciated
0
Comment
Question by:flyers_pat
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:mmusante
ID: 11841499
Do you use any program that may lock the serial port? (may be the program you use to print receipts)
0
 
LVL 1

Author Comment

by:flyers_pat
ID: 11841511
apart from the printer itself, no
0
 
LVL 6

Assisted Solution

by:mmusante
mmusante earned 100 total points
ID: 11841667
Somebody else with your problem (without solutions sorry)

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20747351.html

it seems that the printer driver locks the serial port ...
0
 
LVL 6

Accepted Solution

by:
mmusante earned 100 total points
ID: 11841721
Look at here (yes! it's the serial printer driver ...)

http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B318832
0
 
LVL 1

Author Comment

by:flyers_pat
ID: 11841913
Thank you very much for the help, i'll just say that my app can't run with a cash drawer when the printer is connected on the commport
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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