Solved

Trying to open Cash Drawer connected by printer

Posted on 2004-08-19
5
1,851 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2003, my txt file export is running backwards 4 52
Excel object stays open 19 76
Set email body to html using vbscript 6 41
Excel Automation VBA 19 71
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

803 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