Advantech EP-55XX-AR10 User Manual page 78

Ep-55xx series efficiency all-in-one point of sales system
Table of Contents

Advertisement

Private Sub
Form_Load()
'-1673527296 Come from c code (40000 <<16)
ADV_OPEN_CTL_CODE = CTL_CODE(-1673527296, &H900, METHOD_BUFFERED, FILE_ANY_ACCESS)
ADV_STATUS_CTL_CODE = CTL_CODE(-1673527296, &H901, METHOD_BUFFERED, FILE_ANY_ACCESS)
DeviceHandle = CreateFile("\\.\ADVSYS", GENERIC_READ
FILE_SHARE_WRITE, SA, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
If
DeviceHandle = INVALID_HANDLE_VALUE
'Failed to Open Cash Drawer Driver
MsgBox("Error opening ADVSYS.sys. Error = "
End If
End Sub
Private Sub
Command1_Click()
Dim
iBytesRtn
As Long
Dim
iRet
As
Integer, iDrawer
' Open Drawer #1
iDrawer = &H1
iRet = DeviceIoControl(DeviceHandle, ADV_OPEN_CTL_CODE, iDrawer, 4, 0, 0, iBytesRtn, SA1)
If
(iRet = 0
Or
iBytesRtn <> 1)
MsgBox("Error opening ADVSYS.sys. Error = "
End If
End Sub
Private Sub
Command2_Click()
Dim
iBytesRtn
As Long
Dim
iRet
As
Integer, iDrawer
' Open Drawer #2
iDrawer = &H2
iRet = DeviceIoControl(DeviceHandle, ADV_OPEN_CTL_CODE, iDrawer, 4, 0, 0, iBytesRtn, SA1)
If
(iRet = 0
Or
iBytesRtn <> 1)
MsgBox("Error opening ADVSYS.sys. Error = "
End If
End Sub
Private Sub
Timer1_Timer()
Dim
iBytesRtn
As Long
Dim
iRet
As
Integer, iStatus
' Get Drawer Status
iRet = DeviceIoControl(DeviceHandle, ADV_STATUS_CTL_CODE, 0, 0, iStatus, 4, iBytesRtn, SA1)
If
(iRet = 0
Or
iBytesRtn <> 1)
Timer1.Enabled =
MsgBox("Error opening ADVSYS.sys. Error = "
End If
If
(iStatus = 0)
Then
Label1.Caption =
Else
Label1.Caption =
End If
End Sub
As Integer
Then
As Integer
Then
As Integer
Then
False
"Cash Drawer(s) Closed"
"Cash Drawer(s) Open"
Or
GENERIC_WRITE, FILE_SHARE_READ
Then
& Err.LastDllError)
& Err.LastDllError)
& Err.LastDllError)
& Err.LastDllError)
Or
71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ep-55xx-ar30Ep-55xx-ar20

Table of Contents