POS for .NET & Star Micronics Printer

Slightly different topic today: Programming a POS application.

I have been working on a lettings management program with built in till for use in our Sports Lettings. Couldn’t find anything out there that met all of our needs at a suitable price. So, I have took it upon myself to develop an application that does what we want.

Anyway, program written, and the final part was to make both the lettings and the till use a Cash Drawer and Receipt Printer. The devices that we had purchased for this are a Star Micronics TSP113 Thermal Receipt Printer & a Star Micronics CB2002 Cash Drawer. Both are claimed to support POS for .NET.

Parts arrived, and wired up. Things that you have to do next (with this model at least)

  1. Go into the Star Configuration Utility. Select Star Line Mode when asked.
  2. On the OPOS section, specify Device Names for both the printer and the cash drawer. Then, select each item, click Configure and specify a Logical Device Name.
  3. I advise then running the sample application to check that you can connect and operate the two devices.
  4. Close the Star Configuration Utility.

With this complete, I believed that I should be able to operate the drawer and the printer from within an application. In a new application (so not to change my final application whilst discovering how this all worked), I inserted two buttons and entered the following code:

Everytime the application was ran, and I clicked either of the buttons to either print the test line or open the cash drawer, I got an error on the line RPrinter.Open() or CDrawer.Open(). The error was

Next I confirmed that the OPOS settings in the Star Configuration Utility were correct, and double checked that I had put Open and Claim commands in the right order.

Next came a considerable amount of time researching Service Objects and OPOS definitions and standards to try and understand how all of the POS systems are meant to work together.

After a while, I found that there are some Common Control Objects (CCO) which are available and interface between your application and your device. I was currenly using the objects supplied with the printer.

The CCO are available using the link below:

http://www.monroecs.com/files/OposCCOs-1_13_000.zip

This site also gives (IMHO) a great overview of POS, POS for .NET, OPOS and JavaPOS. A good place for beginners in programming POS systems to get some background information.

The fix for me was to do the following:

  1. Download and extract the OPOS CCO’s from above.
  2. Register the DLL’s (register batch script provided)
  3. In Visual Studio 2010, Add a Reference to the extracted DLL that you require. In my case I added two references, one for OPOSCashDrawer.ocx and one for OPOSPOSPrinter.ocx.
  4. Rebuild and run your application.

The code above then works to open the cash drawer and print a single test line on the receipt printer.

Although this post was written about Receipt Printers and Cash Drawers, I understand from my research that the problem can affect all types of POS devices. I beleive this fix may work ifyou are having issues with other devices too. Just change the name of the OCX file that you add as a reference in step 3 above to the device type that you are including.

Shortly I am going to need to find out if I need to copy these CCO’s into the application when I build it for final release. If anyone knows the answer, it would be great if you could post. If not, I will post my findings when I get that far.

8 people found this post useful.


8 thoughts on “POS for .NET & Star Micronics Printer

  1. I think suppose this problem exist because the Microsoft POS for dot net is only compatible with the CCO that you downloaded from monroe not from the star manufacturer. Actually POS for .net only works and compatible with some device manufacturer until you download the MONROE CCO.

    To solve your last ocx. problem I think all is automatically included
    in your project when you use Set Up and Deployment Project.

  2. Brilliant post. Had exactly the same problem, was using an Epson till printer until the cash draw port broke, swapped to a Star TSP100 and all hell broke loose.

    Thanks for the post

    James

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.