Ortund
Ortund

Reputation: 8245

Why isn't my cash drawer appearing in the list of devices from pos for .net?

I'm trying to write a proof of concept application (so that I understand the code) that demonstrates how to print to my receipt printer and open the cash drawer.

The printer is getting print jobs from the software perfectly fine, but I'm having no luck with the cash drawer. So I printed a list of devices:

+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft Msr Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft Keylock Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft Scanner Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft CashDrawer Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft CheckScanner Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft LineDisplay Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft PinPad Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft PosPrinter Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Microsoft PosKeyboard Simulator
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : Example Scanner
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
    -Logical Names
    Service Object Name : ExampleMsr
    Service Object Version : 1.14.1.0
-Device
+Device
    Device Hardware Id : 
    Device Hardware Description : 
    Device Hardware Path : 
    +Logical Names
        rp-600 printer
    -Logical Names
    Service Object Name : RP-600_USB
    Service Object Version : 0.0
-Device

Most of them are POS for .NET simulators and such, but the RP-600_USB device is my printer. My cash drawer doesn't appear on the list at all.

The cash drawer connects to the printer via an RJ11 connector. The printer connects to the pc via USB - so where is the cash drawer and why isn't is appearing anywhere?

Upvotes: 3

Views: 2088

Answers (2)

Mario
Mario

Reputation: 293

If you use the OPOS Utility Setup from Partner Tech available here, you can set your OPOS Printer and Cash Drawer and give it a Logical Device Name. Then you can use Microsoft POS Library to do something as simple as

        DeviceInfo myDevice;
        CashDrawer _myCashDrawer;
        PosExplorer posExplorer = new PosExplorer();
        myDevice = posExplorer.GetDevice("CashDrawer", "Drawer Logical Name Given");

        _myCashDrawer = (CashDrawer)posExplorer.CreateInstance(myDevice);

        _myCashDrawer.Open();
        _myCashDrawer.Claim(1000);
        _myCashDrawer.DeviceEnabled = true;
        _myCashDrawer.OpenDrawer();
        _myCashDrawer.DeviceEnabled = false;
        _myCashDrawer.Release();
        _myCashDrawer.Close();

, so you skip the need to use specific codes to open drawers and add additional code for it. Each manufacturer has its own OPOS Utility Setup, the process is exactly the same for all. Unfortunately I haven't found yet an "universal" utility, as each one only recognizes its own brand's printers.

Upvotes: 0

N. Greene
N. Greene

Reputation: 141

Cash drawers hooked up through an RJ11 connector to the printer won't show up as a "device" like you would see a printer or a scanner.

In your code the reference to the Cash Drawer is probably for a USB cash drawer that is independent of the printer.

You will send a print job to the printer stating "Open Cash Drawer." Depending on the model printer and what interface will determine what code you need.

List of Open Drawer Codes

There is a list, but best case is to find the manual for the printer to tell you which codes are used.

When the cash drawer is closed, it's locked and ready to be opened. It's just waiting on a pulse from the printer to release the lever holding the "bill tray" against a spring.

Each cash drawer can be different on it's cable, but generally 4 wires are used. 24Volts,drawer open, open/close signal,ground. The 24V can be 12V if you are using a 12V drawer. If you are using a standard thermal printer (Epson TM88 for example), those printers use a 24V power supply, and will only open a 24V drawer. 12V drawers are generally hooked up into the POS (Point of Sale) station where the station is powered by 12V instead of 24V.

The POS program I'm in front of right now, uses this codes to send to the printer to open the drawer.

27,112,0,50,200,256,256,256,256,256

A lot of Thermal Printers utilize the epson interface. Star & Citizen printers do use their own interface, but most printers will have settings to change it to Epson interface. I have used the RP-600 before, and pretty confident they came defaulted to Epson interface.

Not all Epson codes will work on printers, but generally the basic commands: Cut Paper Print barcode Open Drawer....

Things like that will work.

TLDR;

To open a cash drawer, you send a print job to the printer. The printer sees that job as an "Open Cash Drawer" job and sends the signal to the cash drawer.

Hope that helps.

Upvotes: 4

Related Questions