Zebra Printer

  • Thread starter Thread starter id10t error
  • Start date Start date
I

id10t error

Can someone please point me in the right direction for printing to a
zebra QL320 printer. I have the drive and Label Vista installed. I can
print a label with a barcode using the print on label Vista but who do
i do this from vb.net 2005. I have the following code but it only
prints out garbage chacters. Is there a better way of printing a
label?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim p As System.IO.Ports.SerialPort

Dim sendValue As String = ""
Dim test As String = "! 0 100 100 50 1"
Dim test2 As String = "VB 128 1 3 50 50 175 123456789"
Dim test3 As String = "T 7 0 24 171 Barcode Value is
123456789"
Dim test4 As String = "FORM"
Dim test5 As String = "PRINT"
Try
p = New System.IO.Ports.SerialPort("COM1")
p.WriteTimeout = 500
p.ReadTimeout = 500

Try
p.Open()
p.WriteLine(test & "CR/LF")
p.WriteLine(test2 & "CR/LF")
p.WriteLine(test3 & "CR/LF")
p.WriteLine(test4 & "CR/LF")
p.WriteLine(test5 & "CR/LF")
Catch ex As Exception
MsgBox(ex.Message)
Finally
If p.IsOpen Then p.Close()
p.Dispose()
p = Nothing
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub
End Class
 
id10t error said:
Can someone please point me in the right direction for printing to a
zebra QL320 printer. I have the drive and Label Vista installed. I can
print a label with a barcode using the print on label Vista but who do
i do this from vb.net 2005. I have the following code but it only
prints out garbage chacters. Is there a better way of printing a
label?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim p As System.IO.Ports.SerialPort

Dim sendValue As String = ""
Dim test As String = "! 0 100 100 50 1"
Dim test2 As String = "VB 128 1 3 50 50 175 123456789"
Dim test3 As String = "T 7 0 24 171 Barcode Value is
123456789"
Dim test4 As String = "FORM"
Dim test5 As String = "PRINT"
Try
p = New System.IO.Ports.SerialPort("COM1")
p.WriteTimeout = 500
p.ReadTimeout = 500

Try
p.Open()
p.WriteLine(test & "CR/LF")
p.WriteLine(test2 & "CR/LF")
p.WriteLine(test3 & "CR/LF")
p.WriteLine(test4 & "CR/LF")
p.WriteLine(test5 & "CR/LF")
Catch ex As Exception
MsgBox(ex.Message)
Finally
If p.IsOpen Then p.Close()
p.Dispose()
p = Nothing
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub
End Class

A couple of things that jump out at me are: 1) you don't set the important
factors on the com port, like BaudRate, Parity, etc. 2) you are sending
strings "CR/LF", which look possibly like you intend to send carriage return,
line feed pairs. Using WriteLine would be redundant though.
 
Set the printer up as a generic text only printer then send ZPL to it.

--
David Streeter
Synchrotech Software
Sydney Australia









- Show quoted text -

David,

I did reaad about that yesterday. I will work on that today and let
you know how it works. I thank you for helping me on this


Dustin
 
A couple of things that jump out at me are: 1) you don't set the important
factors on the com port, like BaudRate, Parity, etc.   2) you are sending
strings "CR/LF", which look possibly like you intend to send carriage return,
line feed pairs.  Using WriteLine would be redundant though.- Hide quoted text -

- Show quoted text -

Do I need to set the com port information if it is definfed for the
printer. Yes I was trying to use the carriage return. I found out how
to do this now. I was just very tired and upset at that point
yesterday.
 
id10t error said:
Do I need to set the com port information if it is definfed for the
printer. Yes I was trying to use the carriage return. I found out how
to do this now. I was just very tired and upset at that point
yesterday.

The settings need to be the same as the printer expects, or you would get
garbage on the printer end.
 
The settings need to be the same as the printer expects, or you would get
garbage on the printer end.- Hide quoted text -

- Show quoted text -

Do you have an exaple Code of what i need?
 
Back
Top