6-4 Application Development Information for APD Rev. C
6.4 Drawer Control
6.4.1 Drawer Open
When you control a drawer connected to this printer using APD, you have two methods to open
the drawer. The first method is using “Control font”; the second is using “Status API.“
Below is as example of a program (Visual Basic) to open a cash drawer using Control font.
Below is as example of a program (Visual Basic) to open a cash drawer using Status API.
6.4.2 Checking Drawer Status
You can get drawer status by using Status API. Below is an example program which checks the
drawer status.
There are the other checking method (BiSetStatusBackFunction, BiSetStatusBackWnd) in Status
API. Refer to the Status API User’s Manual and the sample programs for details.
'Execute open cash drawer1.
Printer.Font.Name = "control"
Printer.Print "A" ’This ”A” means “open the drawer1 with 50msec pulse.“
'call api to open the drawer1
rtn = BiOpenDrawer(m_hApi, EPS_BI_DRAWER_1, EPS_BI_PULSE_100)
’This calling means “open the drawer1 with 100msec pulse.“
Note: Program needs to call “BiOpenMonPrinter“ before calling “BiOpenDraewer.“
'get the current printer status
rtn = BiGetStatus(m_hApi, getstatus)
If rtn < 0 Then
ErrMsg (rtn) ’Error handling
Exit Sub
End If
If (getstatus And ASB_DRAWER_KICK) = ASB_DRAWER_KICK Then
MsgBox("Drawer is opened") ’Pin No.3 is high
Else
MsgBox("Drawer is closed")
End If