Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Open A Cash Drawer
Message
 
To
27/01/2003 16:56:41
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00746011
Message ID:
00746121
Views:
13
Hi Raz
Here are two methods I use:
1.
When the till is connected to the printer
Insert a bell character CHR(7)into a text file (let's call it tillfire.txt) and from your program issue the following command:
RUN TYPE TILL1.TXT>LPT1
This will flash a DOS window, but it is so quick as to be barely discernable.
This bypasses the Windows spooler which strips out CHR(7)

2.
This one is when the till is connected to a serial port and requires foxtools.fll

*****************************************************************
PROCEDURE Till2com
PARAMETERS mfPort
MFPort = ALLTRIM(MPort)+":"

IF mfport = "COM1:" OR mfPort = "COM2:" OR mfPort = "COM3:" OR mfFPort = "COM4:"
ELSE
?? CHR(7)
WAIT "Invalid COMM Port .. Press A Key" WINDOW
RETURN
ENDIF

MDialStr = "X"
*// We will fire an X at it

opencomm = RegFn("OpenComm","CII","I")
writecomm = RegFn("WriteComm","ICI","I")
closecomm = RegFn("CloseComm","I","I")

MComPort = CallFn(opencomm,mfPort,100,100)

=CallFn(writecomm,MComPort,MDialStr,LEN(MDialStr))
=CallFn(closecomm,MComPort)

Cheers
John
To move a mountain start with the smallest stone
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform