Hi,
Something like this is happening to me everytime.
I have 2 printers in my b4A project, one USB connected and one LAN, the USB works ok but the LAN only prints once.
I send a notification for LAN printer, notification works OK but The printer seems like disconnect.
I also tried Printer.Connect(Host,Port) before printing and Printer.Disconnect after printing... but only prints first time
Can anyone help me?
The relevant code is the next: (L_Printer is the lan printer and I setup a timer for printing)
Sub tmrComanda_Tick
TimerComanda.Enabled=False
Log("INTENTANDO CONECTAR")
If L_Printer.IsInitialized Then
L_Printer.Connect(strIP,9100)
Wait For LAN_Connected(Success As Boolean)
If Success Then
Try
L_Printer.CenterJustify
L_Printer.WriteLine(ESC_POS.BoldOn & ESC_POS.DoubleOn & strEncabezado)
L_Printer.Writeline(ESC_POS.BoldOn & ESC_POS.DoubleOn & strOrdenComanda)
L_Printer.LeftJustify
L_Printer.Write(ESC_POS.BoldOff & ESC_POS.DoubleOff & strImpresion)
L_Printer.WriteLine(ESC_POS.CutPaper)
L_Printer.WriteLine(ESC_POS.DoubleOn & " ")
L_Printer.Beep(4,2)
Sleep(1000)
L_Printer.Disconnect
Catch
Log("ERROR AL IMPRIMIR COMANDA")
Log(LastException)
End Try
Else
Log("NO CONECTÓ IMPRESORA")
Sleep(2000)
TimerComanda.Enabled=True
End If
Else
Log("INICIANDO IMPRESORA")
L_Printer.Initialize(Me,"LAN")
TimerComanda.Enabled=True
End If
End Sub
Here are the logs:
[log]
INTENTANDO CONECTAR
INTENTANDO CONECTAR
NO CONECTÓ IMPRESORA
INTENTANDO CONECTAR
NO CONECTÓ IMPRESORA
INTENTANDO CONECTAR
NO CONECTÓ IMPRESORA[/log]
It looks like after disconnect it is not able to connect again... what should I do?
I tried many many things, but havent reach to a solution
Any help will be highly appreciated
Many Thanks