473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

vba code to open a register drawer??

ARC
I have a user asking if I could put in a code that will open a register
drawer. My understanding is the receipt printer will normally send the code
the cash drawer. Is there a vba function that someone can share that will
open a drawer without printing? Or does it depend on the drawer? I suppose
if it's just a sequence of characters, then it could be made customizable to
work for many different users. Any ideas?

Thanks!

Andy

Jan 18 '08 #1
4 5360
On Fri, 18 Jan 2008 04:24:52 GMT, "ARC" <PC*****@PCESoft.invalid>
wrote:

Ask the register drawer company. They have every incentive to make it
as easy as possible for guys like you to integrate with their
hardware,
Last time I had to do this it was just a matter of sending some chars
out of the serial port.

-Tom.

>I have a user asking if I could put in a code that will open a register
drawer. My understanding is the receipt printer will normally send the code
the cash drawer. Is there a vba function that someone can share that will
open a drawer without printing? Or does it depend on the drawer? I suppose
if it's just a sequence of characters, then it could be made customizable to
work for many different users. Any ideas?

Thanks!

Andy
Jan 18 '08 #2
Here's a sample to make the printer port do what you want it to do. There
must be an easier way to talk to the IO ports (give me the old peek/poke
days) but haven't found it yet. I haven't tested this code completely yet,
but I'm sure it'll lead you in the right direction.

Public Sub open_cashdrawer()
Dim intFileNo As Integer = FreeFile()

FileOpen(1, "c:\escapes.txt", OpenMode.Output)
PrintLine(1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250))
FileClose(1)
Shell("print /d:lpt1 c:\escapes.txt", vbNormalFocus)
End Sub

The truth is though, every cash drawer is different. Either check the book
for the exact details, call the manufacturer or check out
http://pages.prodigy.net/daleharris/popopen.htm, there are many drawers in
there!!
Dominic
MS-Access Wizard of Oz-tralia,
"ARC" <PC*****@PCESoft.invalidwrote in message
news:oS******************@newssvr21.news.prodigy.n et...
>I have a user asking if I could put in a code that will open a register
drawer. My understanding is the receipt printer will normally send the code
the cash drawer. Is there a vba function that someone can share that will
open a drawer without printing? Or does it depend on the drawer? I suppose
if it's just a sequence of characters, then it could be made customizable
to work for many different users. Any ideas?

Thanks!

Andy

Jan 18 '08 #3
hmmm, or this is more VBA, sorry
Open "c:\escapes.txt" For Output As #1
Print #1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250)
Close #1

Shell("print /d:lpt1 c:\escapes.txt", vbNormalFocus)
Dominic

"Dominic Vella" <do***********@optusnet.com.auwrote in message
news:47***********************@news.optusnet.com.a u...
Here's a sample to make the printer port do what you want it to do.
There must be an easier way to talk to the IO ports (give me the old
peek/poke days) but haven't found it yet. I haven't tested this code
completely yet, but I'm sure it'll lead you in the right direction.

Public Sub open_cashdrawer()
Dim intFileNo As Integer = FreeFile()

FileOpen(1, "c:\escapes.txt", OpenMode.Output)
PrintLine(1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250))
FileClose(1)
Shell("print /d:lpt1 c:\escapes.txt", vbNormalFocus)
End Sub

The truth is though, every cash drawer is different. Either check the
book for the exact details, call the manufacturer or check out
http://pages.prodigy.net/daleharris/popopen.htm, there are many drawers in
there!!
Dominic
MS-Access Wizard of Oz-tralia,
"ARC" <PC*****@PCESoft.invalidwrote in message
news:oS******************@newssvr21.news.prodigy.n et...
>>I have a user asking if I could put in a code that will open a register
drawer. My understanding is the receipt printer will normally send the
code the cash drawer. Is there a vba function that someone can share that
will open a drawer without printing? Or does it depend on the drawer? I
suppose if it's just a sequence of characters, then it could be made
customizable to work for many different users. Any ideas?

Thanks!

Andy


Jan 18 '08 #4
ARC
Thanks, all!

As a little more info, I really don't want to make this specific to a
particular drawer (lots of users, shareware product), but somehow let them
configure the codes, then I just send what they put in, so hopefully it
would work with most drawers depending on the code they put in. Maybe a
config field in a setup table that holds the open codes.

Thanks again,

Andy
"Dominic Vella" <do***********@optusnet.com.auwrote in message
news:47***********************@news.optusnet.com.a u...
hmmm, or this is more VBA, sorry
Open "c:\escapes.txt" For Output As #1
Print #1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250)
Close #1

Shell("print /d:lpt1 c:\escapes.txt", vbNormalFocus)
Dominic

"Dominic Vella" <do***********@optusnet.com.auwrote in message
news:47***********************@news.optusnet.com.a u...
>Here's a sample to make the printer port do what you want it to do. There
must be an easier way to talk to the IO ports (give me the old peek/poke
days) but haven't found it yet. I haven't tested this code completely
yet, but I'm sure it'll lead you in the right direction.

Public Sub open_cashdrawer()
Dim intFileNo As Integer = FreeFile()

FileOpen(1, "c:\escapes.txt", OpenMode.Output)
PrintLine(1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250))
FileClose(1)
Shell("print /d:lpt1 c:\escapes.txt", vbNormalFocus)
End Sub

The truth is though, every cash drawer is different. Either check the
book for the exact details, call the manufacturer or check out
http://pages.prodigy.net/daleharris/popopen.htm, there are many drawers
in there!!
Dominic
MS-Access Wizard of Oz-tralia,
"ARC" <PC*****@PCESoft.invalidwrote in message
news:oS******************@newssvr21.news.prodigy. net...
>>>I have a user asking if I could put in a code that will open a register
drawer. My understanding is the receipt printer will normally send the
code the cash drawer. Is there a vba function that someone can share that
will open a drawer without printing? Or does it depend on the drawer? I
suppose if it's just a sequence of characters, then it could be made
customizable to work for many different users. Any ideas?

Thanks!

Andy


Jan 18 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: PW | last post by:
I have an electronic cash drawer as part of a point-of-sale installation. You're supposed to be able to automatically open the cash drawer with some printer commands (drawer is connected to the...
22
by: Liang Chen | last post by:
Is the file "bcopy.c" in the "libitery" directory the implement of the GNU C library function "bcopy"? If so, how can it run so fast?(copy-by-byte rather than copy-by-word) When I copy the code of...
2
by: Tor Inge Schulstad | last post by:
Hi I'm developing a POS software using an Epson TM-T88iii printer with a cash drawer connected to the printer. The printer is connected via a usb interface to the pc. Can anyone tell me how I...
2
by: wahid_kalo | last post by:
Hi There I Have Finished A Point Of Sale Program On Access, I Still Need To ControlThe Cash Register Drawer By Code. In The Manual It Is Mentionned To Open The Drawer through com1 under qbasic...
5
by: John\\ | last post by:
Okay I have been searching the web for a couple of days now and can not seem to find a solution. I have a USB Epson TM-T88III receipt printer with a Cash Drawer connected to it and I can not...
0
by: fidamon | last post by:
hi all there i am a new member i hope you could help me with this Q how to open a cash drawer which is linked to serial port and have a 12 v power and has no name or user book? is there a...
3
by: fidamon | last post by:
hi if any body can help me with that question i will be thankfull How to open a cash drawer connected to serial comm it has no name no user manual and nothing but a serial port connection and a...
0
by: CyberKnight | last post by:
Hello Friends, What function that enable the cash drawer in a POS, using visual basic coding. Thanks.
1
by: danishce | last post by:
Hi, I've been trying to configure the cash drawer connected directly to the CPU of the IBM Surepos PC. The cash drawer IBM P/N is 74F6178, IBM FRU P/N is 93F1901. The cash drawer port is connected to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.