Cash Drawer Connection

J

JimJam

We have obtained a M-S KLIC cash drawer and have an
existing MS Access database we want to use to open the
drawer using a comand button (OnClick event). We have the
drawer connected to the computer serial port. Dip switches
in the drawer can adjust the baud rate (1200 baud; Factory
Setting) and the drawer open character (Control G, ASCII7:
Factory Setting). the instructions say to use: even
parity, 7 transmit data bits, 1 stop bit,ignor clear to
send (CS) and ignor data set ready (DS). I think I
remember these parameters from BASIC, but cannot find any
refernce to them in VB.
 
A

Arvin Meyer

JimJam said:
We have obtained a M-S KLIC cash drawer and have an
existing MS Access database we want to use to open the
drawer using a comand button (OnClick event). We have the
drawer connected to the computer serial port. Dip switches
in the drawer can adjust the baud rate (1200 baud; Factory
Setting) and the drawer open character (Control G, ASCII7:
Factory Setting). the instructions say to use: even
parity, 7 transmit data bits, 1 stop bit,ignor clear to
send (CS) and ignor data set ready (DS). I think I
remember these parameters from BASIC, but cannot find any
refernce to them in VB.

Pretty much the same in VB/VBA

Here is an old function that I cannot retest now (I don't have a cash
register handy):

Function Write2ComPort()
Dim i As Integer
Dim j As Integer

i = OpenComm("COM1", 10, 10)
j = Writecomm(i, "U", 5)
j = CloseComm(i)

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

Hey Arvin,
I must be missing a DDL or a reference somewhere, I got an
error, compile error, sub or function not defined, and
OpenComm as highlighted. Any suggestions?
Jim.... .. ......
 
A

Arvin Meyer

OOPs! the API declares:

Declare Function OpenComm Lib "User" (ByVal lpComName$, ByVal wInQueue%,
ByVal wOutQueue%) As Integer

Declare Function CloseComm Lib "User" (ByVal nCid%) As Integer

Declare Function WriteComm Lib "User" (ByVal nCid%, ByVal lpBuf$, ByVal
nSize%) As Integer

Watch out for line wrapping
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

Arvin,
Sorry about not getting back, it is the end of school year
and everything goes nuts. I am still getting an error
message"File not found, 'User'". I can send you screen
captures of my code if that would help.
Jim .... (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top