Solved

Opening a Cash Drawer Through Reciept Printer in VB

Posted on 2001-06-17
4
829 Views
Last Modified: 2007-12-19
Hi,
I can't seem to get this to work - I am using a Star SP200 Reciept Printer and a MMC ECD200 Cash Drawer.

The Star Documentation states to send this:
<BEL> or Hex - 07

I am not farmiliar with sending data through a printer, just to it - I tried

Printer.Print "<BEL>"
Printer.EndDoc

and about every other possible variation I can think of and the documentation doesn't offer a VB example.
Any help will be appreciated.

Thanks,
Tom
0
Comment
Question by:flosoft
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
q2eddie earned 100 total points
ID: 6200634
Hi, flosoft.

#Try This
Open "LPT1" For Output As #1
Print #1, Chr(7)
Close #1

Bye. -e2
0
 
LVL 7

Expert Comment

by:q2eddie
ID: 6200665
Hi, again.

or use the MSComm control...

Dim Codes2Send As String
MSComm1.Settings = "9600, N, 8, 1"
'example
MSComm1.CommPort = 1
MSComm1.RTSEnable = True
If MSComm1.PortOpen = False Then
  MSComm1.PortOpen = True
End If
Codes2Send = Chr$(7)
'etc.
MSComm1.Output = Codes2Send

#Links
1. "Re: Open a Cash Drawer Sending Special Characters to th Receipt Printer"
http://news.devx.com/cgi-bin/dnewsweb.exe?cmd=article&group=vb.getting.started&item=19963&utag=

2. "Testing a Cash Drawer that is connected to the receipt printer"
http://www.pcamerica.com/tech/answers/prntest.txt

3. "I would like to know if there is any way to send a single line of text to the printer..."
http://members.aol.com/ymwymw/vbmain.htm#Q0189

Bye. -e2
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6200892
Ya, as g2eddie mentioned, use MSComm Control. Some cash box accept the command as 10 "0"s, so the output should be:

MSComm1.Output = "0000000000"


Hope this make help too.
0
 

Expert Comment

by:mrjoco824
ID: 25607615
Should also consider whether the Rj-11 pinout for the STar printer matches the pin for the MMC cash drawer.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

776 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