1 - How to Open a Cash Drawer Using Escape Codes
|
Top |
There are a number of different
ways that you may have your cash drawer attached to your PC.
Either through a printer (serial or parallel) or connected directly
to the PC (serial or parallel) via a power supply in any of
the above cases the command stays the same but accessing the
port changes.
The Escape character from Epson to fire a cash drawer is a lower
case 'p'.
PARALLEL CONNECTION
' (assuming LPT1)
' ************************************************
Private Sub Kick()
Dim IntFreeFile As Integer
'Set IntFreeFile to the next available file number
IntFreeFile = FreeFile 'Open the parallel port
with #IntFreeFile
Open "LPT1" For Output As #IntFreeFile
'Print to the parallel port, This is the line that fires the
drawer.
Print #IntFreeFile, Chr$(27) + "p" + "0"
'Close the port
Close IntFreeFile
End Sub
' ************************************************
SERIAL CONNECTION
If you are using a serial connection it is slightly different.
Below is an example of firing the drawer from a VB application.
From VB
Add a Comm control to the form. You may need to add a reference
to the comm control (right click your tool bar then click components.
Next tick the MScommControl then Apply. You can now add the
control from your toolbar.
From Access
Click on the form you want active, click "Insert",
then "ActiveX control", on the toolbar. Next choose
"Microsoft Communication Control" from the list of
ActiveX controls. A control appears on the form with a telephone
Icon.
All you need now is the following code.
(Assuming that your comm control is named MsComm1)
MSComm1.CommPort = 2
'Sets the Com Port number (this can be changed here)
MSComm1.Settings = "9600,n,8,1"
'Sets the Baud rate (9600 in this case)
MSComm1.PortOpen = True
'opens the port
MSComm1.Output = Chr$(27) + "p" + "0" +
"zz"
'Sends a pulse to the Com Port
MSComm1.PortOpen = False
'Closes the port when finished
Chr$(27) is an escape character to set the hardware to wait
for a command, and the LOWER CASE p is the pulse command to
fire the cash draw and the "0" + "zz" keeps
the signal high for a period of time to make sure the solenoid
opens fully (only needed when using the serial port).
The baud rate of the printer that the Cash Drawer is attached
to can be printed by keeping the form feed button pressed down
when you turn the printer on (turn the printer of then on again
to get out of the "Test" mode). You may ignore this
if you don't have a printer.
Put the above code on the "On-Click" event of a button
to test it. |
2 - Setting an End Sentinel on a Metrologic 6130
|
Top |
The 6130 Scanner
consists of two parts. The MS6130 (the handheld "transmitting"
part) which uses the IS4120 Scan engine, and the MX0034-47 which
is the "Receiver" part that attaches to your PC.
It has been noted that the Transmitter (MS6130) supports only
one programmable prefix, ASCII value of 33 (21H) to 127 (7FH).
The Receiver (MX0034-47) however supports two programmable prefixes.
In this example we will add the F9 (ASCII 152) character as
an end sentinel to the 6130. Therefore the the Receiver (MX0034-47)
has to be programmed so we do the following:
- Enter/Exit Program Mode for the Receiver (MS6130 Installation
Guide - page 11). This is a specific barcode for the receiver,
not the normal enter exit found in the IS4120 guide.
- Recall Defaults
- 1st Programmable Suffix ID (IS4120 Programming Guide page
61)
- RB1
- RB5
- RB2
- Enter/Exit Program Mode for the Receiver (MS6130 Installation
Guide - page 11). |
3 - How do I Initiate the Extended Self Test on a H6000
|
Top |
The Extended Self
Test will show information like the number of cuts the unit
has performed, the number of receipts printed through to the
Temperature of the print head at that time.
To perform the extended self test switch the printer off. Hold
your finger on the feed button and switch the printer on. This
will perform the standard print test giving you information
regarding the setup of the printer. Once the standard print
test is complete open the cover to the thermal roll (you should
see a red LED light) press the feed button once more. Finally
close the lid, the extended self test will be printed. |
|