Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Point Of Service .NET

  1. #1

    Point Of Service .NET

    Ciao a tutti,

    sto sviluppando un'applicazione web in vb.net che si interfacci con una stampante fiscale (epson FP90II TM-T90). Dopo aver scaricato POS for .net v1.12, installato l'OCX, e installato OPOS.NET, quando avvio il CheckHealth dell'OPOS il programmino mi restituisce questo errore:

    codice:
    ================== Exception =====================
    Microsoft.PointOfService.PosControlException 
    ErrorCode : Failure (111)
    ErrorCodeExtended : 0
    Message : It is not initialized.
    Target : System.String CheckHealth(Microsoft.PointOfService.HealthCheckLevel)
    ## StackTrace ##
      at jp.co.epson.upos.pntr.CommonPrinterService.CheckHealth(HealthCheckLevel level)
      at CheckHealthTest.MainForm.ExecuteCheckHealth(DeviceInfo objInfo)
      at CheckHealthTest.MainForm.btnCheckHealth_Click(Object sender, EventArgs e)
    Non riesco a effettuare una stampa dalla mia applicazione web, perchè l'errore è il medesimo.


    Qualche suggerimento?

    Grazie

    Ciao Alessia

  2. #2
    Provo a spiegarmi meglio ...

    l'applicazione web registra delle vendite di prodotti

    Obiettivo: gli utenti della logista, dopo aver preparato l'ordine, devono stampare lo scontrino fiscale della merce venduta.

    E' stata acquistata una stampante fiscale, che non si comporta come tutte le stampanti, ma si può interagire con essa tramite pc. Sono sicura che fino ad adesso la procedura seguita è corretta, quindi l'installazione del OPOS.NET, come l'implementazione del OCX, tutto ciò mi è stato già confermato dai tecnici Epson.

    Adesso il mio problema è durante la vera e propria fase di stampa.

    Riporto il codice

    codice:
    Private Sub ButtonStampa_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonStampa.Click
        InizializzaStampante()
        Stampa()
        ChiudiStampante()
      End Sub
    
    
      Public Sub InizializzaStampante()
        '<<<step1>>>--Start
        'Use a Logical Device Name which has been set on the SetupPOS.
        Dim strLogicalName As String
        Dim deviceInfo As DeviceInfo
        Dim posExplorer As PosExplorer
    
        strLogicalName = "PosPrinter"
    
        'Create PosExplorer
        posExplorer = New PosExplorer
    
        m_Printer = Nothing
    
        Try
    
          deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName)
          m_Printer = posExplorer.CreateInstance(deviceInfo)
    
        Catch ex As Exception
          Return
        End Try
    
        Try
    
          '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 ex As PosControlException
          m_Printer.Release()
        End Try
      End Sub
    
      Public Sub Stampa()
        Try
          'As using the PrintNormal method, send strings to a printer, and print it
          '[vbCrLf] is the standard code for starting a new line.
          m_Printer.PrintNormal(PrinterStation.Receipt, "Hello OPOS for .Net" + vbCrLf)
    
        Catch ex As PosControlException
    
        End Try
        '<<<step2>>> End
      End Sub
    
      Public Sub ChiudiStampante()
        If m_Printer Is Nothing Then
          Return
        End If
    
        Try
          'Cancel the device
          If m_Printer.DeviceEnabled Then
            m_Printer.DeviceEnabled = False
          End If
    
          'Release the device exclusive control right.
          m_Printer.Release()
    
    
        Catch ex As Exception
    
        Finally
          'Finish using the device.
          m_Printer.Close()
    
        End Try
      End Sub
    Il programma si stoppa quando cerco di eseguire la stampa "m_Printer.PrintNormal(PrinterStation.Receipt, "Hello OPOS for .Net" + vbCrLf)" restituendomi questo errore:

    codice:
    ================== Exception =====================
    Microsoft.PointOfService.PosControlException
    ErrorCode : Failure (111)
    ErrorCodeExtended : 0
    Message : It is not initialized.
    Target : System.String CheckHealth(Microsoft.PointOfService.HealthCheckLevel)
    ## StackTrace ##
      at jp.co.epson.upos.pntr.CommonPrinterService.CheckHealth(HealthCheckLevel level)
      at CheckHealthTest.MainForm.ExecuteCheckHealth(DeviceInfo objInfo)
      at CheckHealthTest.MainForm.btnCheckHealth_Click(Object sender, EventArgs e)
    helppppppp ....... nessuno ha dei suggerimenti???

  3. #3
    Utente di HTML.it L'avatar di U235
    Registrato dal
    Mar 2006
    Messaggi
    1,539
    il codice entra in
    codice:
    Catch ex As PosControlException
          m_Printer.Release()
        End Try
    ?

    sembrerebbe che vada in errore entrando li

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.