Epson TM-U220 TM-U220 Technical Reference Guide - Page 93

Checking Drawer Status, 2.2.1, Drawer Open/Close, 2.2.2

Page 93 highlights

TM-U220 Technical Reference Guide 5.2.1.2 Checking Drawer Status You can get drawer status by using Status API. Below is examples of program which checks the drawer status. '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 There are the other checking method (Bi BiSetStatusBackFunction, BiSetStatusBackWnd) in Status API. Refer to the Status API User's Manual and the sample programs for detail. 5.2.2 OPOS Programming examples of how to use API function relating to a Cash Drawer are shown below. 5.2.2.1 Drawer Open/Close Using the OpenDrawer method opens the cash drawer. The DrawerOpened property can be used to check the current state of the drawer. To pause the program until the drawer is closed, the WaitForDrawerClose method is used. Below is as example of a program to open and close a cash drawer. If Not OPOSCashdrawer1.DrawerOpened Then OPOSCashdrawer1.OpenDrawer OPOSCashdrawer1.WaitForDrawerClose 10000, 1000, 100, 100 End If 5.2.2.2 Checking Drawer Status There are methods other than explained in section 5.2.2.1 that can be used to check drawer status. A StatusUpdateEvent is fired whenever the drawer is opened or closed. Rev. H Application Development Information 5-5

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154

Rev. H
Application Development Information
5-5
TM-U220 Technical Reference Guide
5.2.1.2
Checking Drawer Status
You can get drawer status by using Status API. Below is examples of program which checks the
drawer status.
There are the other checking method (Bi BiSetStatusBackFunction, BiSetStatusBackWnd) in
Status API. Refer to the Status API User’s Manual and the sample programs for detail.
5.2.2
OPOS
Programming examples of how to use API function relating to a Cash Drawer are shown below.
5.2.2.1
Drawer Open/Close
Using the OpenDrawer method opens the cash drawer. The DrawerOpened property can be
used to check the current state of the drawer. To pause the program until the drawer is closed,
the WaitForDrawerClose method is used.
Below is as example of a program to open and close a cash drawer.
5.2.2.2
Checking Drawer Status
There are methods other than explained in section 5.2.2.1 that can be used to check drawer
status. A StatusUpdateEvent is fired whenever the drawer is opened or closed.
'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
If Not OPOSCashdrawer1.DrawerOpened Then
OPOSCashdrawer1.OpenDrawer
OPOSCashdrawer1.WaitForDrawerClose 10000, 1000, 100, 100
End If