Reputation: 1567
I am using the following code to open a cash drawer using lpt and com port.
Dim intFileNo As Integer = FreeFile()
FileOpen(1, "c:\escapes.txt", OpenMode.Output)
PrintLine(1, Chr(27) & "p" & Chr(0) & Chr(25) & Chr(250))
FileClose(1)
Shell("print /d:com1 c:\escapes.txt", vbNormalFocus)
The above code works great. However, one of my client is using a USB.
Anyone know of any code to open cash drawer using USB port?
Thank you
Upvotes: 2
Views: 9849
Reputation: 4122
From what I remember some of the USB cash drawers will need to be opened by setting a memory location to a specific value. It's all down to the driver required for the cash drawer so you'll have to acquire the manufacturer's specifications.
Telling us which brand of cash drawer would be a big first step.
Addendum: After some searching I've turned up the following useful links.
A proper answer is really too big and time consuming to fit in here and will demand a bit of experimentation to get it working but basically you can install a USB to COM driver from Prolific and then write software to that or rework the VB6 answer you linked into VB.NET using the usual techniques.
http://www.jack-frost.co.uk/vb6_usb_cash_drawer.html
http://www.prolific.com.tw/US/index.aspx
http://support.epostraders.co.uk/support-files/documents/27/ldi-C4141_USB_InstallationGuide.pdf
http://edvoncken.net/2010/08/pl-2303-usb-to-serial-driver/
Upvotes: 1