Epson Point of Sale Printer - Cannot Print Using C #

I have an Epson TM-U220A, I am writing a C # desktop application for printing receipts. But he can not find the printer.

The printer prints strange characters if I send something via notepad (thereby its operation)

I have the following:

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

the 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 cannot be connected to the device. In line: m_Printer.Claim (1000);

Set up

+7
source share
3 answers

In my experience with Epson POS printers with the Windows printer driver installed, it prevents the printer from being used in any other way.

I think the first thing you should try is to remove the printer, configure it again in SetupPOS and try your program again.

Good luck

+4
source

please check the configuration.xml file. The NAme port should be the same as in xml and SetupPOS, which should be in the 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

+1
source

Have you opened the printer ports for the printer? This can be a problem.

The printer needs the following ports:

9100 to 9100 with protocol set to "Both" 81 to 1800 with protocol set to "Both"

0
source

All Articles