Announcement
Collapse
No announcement yet.
Visual Basic conversion (1 declare)
Collapse
X
-
Well, "remotely" doesn't necessarily mean "far away". Could be as simple as that the "cash register" is simply a PC running a cash register program which than opens the cash drawer attached to it for collecting money/giving out change.
Leave a comment:
-
Not a prob Mike
Although I am sure there is a reason to be able to remotely open a "Cash-Drawer" I can not think of one (unless I was out to mess with someone as a prank, or do something illegal)
The one legal idea I can think of is one brought to me a while back was a kiosk type of thing that users put in their money, get their picture taken, and for added security, whoever collects the money not only had to have the passcode to open the drawer/vault, but the main office had to know it was them trying to access (either by phone, or knowing it was time and human patterns etc) and allow the drawer to open from a remote location by issuing the "Open" code from a remote location)
Needless to say, with my knowledge of USB at the time....I had to take a pass (just because I KNEEEEWWWW my lack of knowledge could bite me financially later, nomatter how good the system was)
I guess I was just curious what the project presented to you was? And if you dare take it on?
Leave a comment:
-
It was zero. It appears the drawer number is ascii (0-7).
Thank you.
Leave a comment:
-
Without the real API documentation, another guess would be
Handle = GetDrawerHandle(0)
On top of that, from the looks of the document shown, if ANY of the dipswitches, are not in the default position (either by accident, or by someone fooling with them), then the results are "UnKnown" and you can not test application specifics such as this without a clone of what you are trying to code for.
Just a word of caution from one that interfaces external hardware with computer software, "You can make guesstimations, but only by luck, can you get it right"
Leave a comment:
-
E-mail pending to manufacturer. Unfortunately, can't test here.
Trying unsuccessfully to get a fixed font.
In USB POS DLL v110.PDF Visual Basic sample
----------------------- ----------------------
Handle=GetDrawerHandle(0) DrawerHandle=GetDrawerHandle(DrawerNumber)
1)Is GetDrawerHandle called with the drawer number or zero?
2)Is the DrawerNumber ascii (1-8) or (49-57)?Last edited by Mike Doty; 10 Apr 2008, 06:52 PM. Reason: Have been unable to get fixed font with courier new
Leave a comment:
-
Hi Mike,
A quick search for MSPOS_USB.DLL turned up this , which seems to suggest that drawer numbers start at zero.
It also shows the return value for C++ as being ULONG, which I believe would translate into a DWORD in PB. However, it gives the return type for the same function in VB as INTEGER, which is certainly not a DWORD.
Regardless of that last point, I'd try sending a 0 to the GetDrawerHandle function and see what comes back. I'd also load up the MSPOS_USB dll in Dependency Walker to make sure you're specifying the correct alias.
Regards,
Pete.
Leave a comment:
-
I sent the manufacturer some more test code.
I added 48 to the drawer number to see if it works.
Nobody has reported anything wrong with my headers so that is hopefully it. I'm writing this for a client that bought a cash drawer from this company in California.
Leave a comment:
-
Visual Basic conversion (1 declare)
I'm having trouble opening a cash drawer on a remote system (don't have a drawer.) Anyone see a problem with this code conversion?
Do these drawers usually use ascii 1-8 or ASC("1") - ASC"("8")?
Private Declare Function GetDrawerHandle Lib "MSPOS_USB.dll" (ByVal DrawerNumber As Byte) As Long
DECLARE FUNCTION GetDrawerHandle LIB "MSPOS_USB.dll" ALIAS "GetDrawerHandle" (BYVAL DrawerNumber AS BYTE) AS LONGTags: None
Leave a comment: