2010-10-22 45 views
7

actual C# POS.NET Impresión Edición:PrintNormal() Emisión 'No se ha inicializado'

PrintNormal() ha producido una excepción = 'No se ha inicializado'
CheckHealth = 'No se ha inicializado' 'No es inicializado excepción' al imprimir en Epson TM-T88IV

el uso de POS para .NET 1.12 y la Epson OPOS ADK for .NET (v1.11.9) el servicio de objetos con éxito capaz de abrir, reclamación y establecer la realidad para DeviceEnabled PosPrinter

Número enviando cualquier cosa a la impresora después de esto PrintNormal() da como resultado una excepción 'No se ha inicializado'. La utilidad CheckHealth que viene con Epson OPOS ADK produce exactamente el mismo error. Al utilizar PrintNormal (PrinterStation.Receipt la excepción es 'La estación especificada no está montado "

impresora imprime muy bien usar directa de impresora paralelo sí imprime

¿Cómo no tirar la exención con el mensaje -. 'Se no se ha inicializado '

void K8POSPrint() 
{ 
    /// <summary> 
    /// PosPrinter object 
    /// </summary> 
    PosPrinter m_Printer = null; 
    try 
    { 
     //Use a Logical Device Name which has been set on the SetupPOS. 
     string strLogicalName = "PosPrinter"; 
     try 
     { 
      //Create PosExplorer 
      PosExplorer posExplorer = new PosExplorer(); 
      DeviceInfo deviceInfo = null; 

      try 
      { 
       // Device Info is not null when the printer has the logical name 
       deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName); 
       m_Printer = (PosPrinter)posExplorer.CreateInstance(deviceInfo); 
      } 
      catch (Exception ExDevice) 
      { 
      } 

      //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; 
      // ////CheckHealth. 
      //m_Printer.CheckHealth(Microsoft.PointOfService.HealthCheckLevel.Interactive); 
      // //As using the PrintNormal method, send strings to a printer, and print it [\n] is the standard code for starting a new line. 
      /// Current Issue Next Line thows an exception - 'It is not initialized' 
      m_Printer.PrintNormal(PrinterStation.Receipt, "Hey Now OPOS for .NET\n"); 
      // the next line would throw the exception 'The specified station is not mounted.' 
      // m_Printer.PrintNormal(PrinterStation.Slip,"Hey Now Slip OPOS.NET\n"); 
     } 
     catch (PosControlException) 
     { 

     } 
    } 
    catch (Exception ex) 
    { 

    } 
} 

Información adicional:? programas instalados al intentar imprimir en la impresora de la posición son: 1. instalado
APD4 controlador de impresora Epson TI88IV
APD_412EWM.exe
https://www.epsonexpert.com/ee/techRes/index.htm?ProductId=570
Después de este conjunto en las impresoras del panel de control que pueda seleccionar las propiedades de la impresora & impresión de una prueba a la impresora correctamente.
2. instalado Microsoft POS.NET 1,12
POSfor.NET.msi http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eaae202a-0fcc-406a-8fde-35713d7841ca
3. Instalado V2.67 Epson OPOS ADK
ADK267ER4.exe
https://www.epsonexpert.com/ee/appDev/appDevOPOS.htm
4. Instalado EPSON OPOS ADK para. NET 1.11.8
OPOSN 1 11 18.exe
https://www.epsonexpert.com/ee/appDev/appDevOPOS.htm
5. Instalado OPOS control de objetos comunes 1.13.001
OPOS_CCOs_1.13.001.msi
http://monroecs.com/oposccos_current.htm
6. SetupPOS - dispositivo & nombre lógico Añadido
7. Comprobar la Salud lanza todavía los errores No se ha inicializado OPOS_E_ILLEGAL 10007 (0x00002717)

+1

Creo que su try catch nesting es el problema, aquí no se obtiene el verdadero problema. Intenta eliminar algunos de los códigos de captura de prueba y deja solo uno. Entonces verás cuál es el verdadero problema. – Rumplin

+0

¿Tiene una impresora OPOS llamada PosPrinter configurada? Puede verificar en el registro en HKEY_LOCAL_MACHINE \ SOFTWARE \ OLEforRetail \ ServiceOPOS \ PosPrinter' debe haber una clave secundaria llamada 'PosPrinter'. ¿La impresora está configurada en Windows en Impresoras y dispositivos, si se trata de eliminar? Por lo que recuerdo, si la impresora está configurada en Windows, no siempre funcionará en OPOS. – Re0sless

Respuesta

0

el problema podría no ser software, sino hardware. Vi una pregunta similar (al http://social.msdn.microsoft.com/Forums/vstudio/en-US/446fd4cc-db6b-4822-b3c8-7d9a98bf7eb4/it-is-not-initialized-when-trying-to-printnormal?forum=posfordotnet), donde el desarrollador estaba usando un cable de extensión que no era paralelo. Tan pronto como conectó el cable paralelo directamente a la impresora (sin el cable de extensión), su software funcionó. Esto fue después de llamar a Epson y pedir una impresora más nueva, porque le dijeron que su impresora original no era compatible con .NET, por lo que también podría ser su problema.

Cuestiones relacionadas