Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Epson Point of Sale Printer - Unable to print using c#

I have an Epson TM-U220A, I am writing and c# desktop application to print receipt. But it is unable to find the printer.

The printer prints strange characters if i send something via notepad (thus its working)

I have the following:

  • POS for .Net v1.12.exe
  • OPOSN1.11.16 (Espon Wrapper for .net)
  • Espon driver installed
  • USB interface to the printer.

Code:

private void FormLoad(object sender, System.EventArgs e)
        {

            //<<<step1>>>--Start
            //Use a Logical Device Name which has been set on the SetupPOS.
            string strLogicalName = "PosPrinter";
           // string strLogicalName = "ESDPRT001";

            try
            {
                //Create PosExplorer
                PosExplorer posExplorer = new PosExplorer();

                DeviceInfo deviceInfo = null;

                try
                {
                    deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName);
                    m_Printer = (PosPrinter)posExplorer.CreateInstance(deviceInfo);
                }
                catch (Exception)
                {
                    ChangeButtonStatus();
                    return;
                }

                //Open the device
                m_Printer.Open();

                //Get the exclusive control right for the opened device.
                //Then the device is disable from other application.
                m_Printer.Claim(1000);

                //Enable the device.
                m_Printer.DeviceEnabled = true;
            }
            catch (PosControlException)
            {
                ChangeButtonStatus();
            }
            //<<<step1>>>--End

        }

Error: The port name is illegal, or couldn't be connected to the device. On line: m_Printer.Claim(1000);

Set Up

like image 892
Amarnauth Persaud Avatar asked Jul 28 '11 11:07

Amarnauth Persaud


People also ask

Why won't my Epson printer print from my computer?

Make sure the USB cable is connected securely at both ends and meets the requirements. Run a printer check. If the test page prints, make sure your software is installed correctly. Make sure the printer cover is closed.

Why won't my wireless Epson printer print from my computer?

If you cannot print over a network, try these solutions: Make sure that your product is turned on. Make sure you install your product's network software as described in your product documentation. Print a network status sheet and verify that the network settings are correct.

How do I change the print settings on my Epson printer?

Select Printer Settings from the drop-down list, and select the Basic settings tab. Select Advanced. You will find the predefined settings in the list on the right of Automatic. Select the most appropriate setting from the list according to the type of document or image you want to print.

What should I do if my Epson product is not printing?

If your Epson product is not printing properly, search for your specific product on our printer hub page to obtain helpful troubleshooting information. Some common printing issues include banding, incorrect colors appearing, blurry prints, grainy prints, or faded prints. Search for your printer

Why won't my Epson printer work with setuppos?

In my experience working with Epson POS printers having the Windows printer driver installed prevents using the printer in any other way. I think the first thing you should try is deleting the printer, set it up again in SetupPOS, and try your program again. Good luck! this works as is ... not sure why this would've been the issue.

How do I find error codes on my Epson printer?

Epson Printer Errors. If your printer is displaying an error code or message on the control panel, search for 'Error code' on your product's FAQs tab. Examples include 'Paper jam,' 'Replace maintenance box,' and 'Printer is Offline.'. Search for your printer.

Why is my printer not printing properly?

Then, print an operation check page. See Running a printer operation check. If the check page prints correctly, make sure that the printer software and your application are installed correctly. If you are trying to print a large image, your computer may not have enough memory to print. Try printing a smaller image.


2 Answers

In my experience working with Epson POS printers having the Windows printer driver installed prevents using the printer in any other way.

I think the first thing you should try is deleting the printer, set it up again in SetupPOS, and try your program again.

Good luck!

like image 158
Daniel Dreier Avatar answered Oct 10 '22 06:10

Daniel Dreier


please Check the configuration.xml file. Port NAme must be same as in xml And SetupPOS that should be in serial Port.

For xml configuration Please check this link http://social.msdn.microsoft.com/Forums/en-US/5baad480-f2be-4cc9-94e0-572a3fa4697a/sharing-information-for-posnet-112-epson-tmt88v?forum=posfordotnet

like image 39
Sheela K R Avatar answered Oct 10 '22 07:10

Sheela K R