Cash Drawer Open/Close Status

Read the status of a Cash drawer - System Hangs

Page 1 of 1

1 Replies - 11304 Views - Last Post: 02 June 2009 - 02:29 AM Rate Topic: -----

#1 MartinTschutte  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-June 08

Cash Drawer Open/Close Status

Posted 17 June 2008 - 09:49 AM

I am using the following code to open a cash drawer attached to a receipt printer via the parallel port

The KickCashDrawerParallel Sub works Perfectly

The CashDrawerStatus Function 'Hangs at Line 9'

Public Sub KickCashDrawerParallel()
Dim FileNum As Integer
FileNum = FreeFile
Open "LPT1" For Output As #FileNum
Print #FileNum, Chr$(27) + "p" + "0"
Close FileNum
End Sub

Public Function CashDrawerStatusParallel() As Integer
Dim FileNum As Integer
FileNum = FreeFile
Open "LPT1" For Output As #FileNum
Print #FileNum, Chr$(27) + "u" + "0"
Close FileNum

Open "LPT1" For Input As #FileNum
Input #Filenum, Drawer_Stat '-----------> Program Hangs Here
Close Filenum

CashDrawerStatusParallel=Drawer_Stat

End Function



I Cannot work out why the system hangs at that Point

Is This A Good Question/Topic? 0
  • +

Replies To: Cash Drawer Open/Close Status

#2 Swannie  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 2
  • Joined: 02-June 09

Re: Cash Drawer Open/Close Status

Posted 02 June 2009 - 02:29 AM

Hi Martin,

Fancy meeting you here.........

Try this:
Public Sub OpenDrawer()
	Open "LPT1" For Output As #1
	Print #1, Chr$(27); Chr$(112); Chr$(0)
	Close #1
End Sub



Maybe you can help me to determine if the drawer is open or closed?
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1