Solved

Printing BARCODE Code39 on ZEBRA Printer HOW TO?

Posted on 2002-03-06
12
836 Views
Last Modified: 2013-11-18
hi experts,

Can anybody please help me on this, I have a ZEBRA Barcode/Label Printer, bu I don't know how to print using VB 6. Please help.

thanks in advance.


posboy
0
Comment
Question by:posboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +3
12 Comments
 

Author Comment

by:posboy
ID: 6843783
Please give me a sample code...
0
 

Author Comment

by:posboy
ID: 6843788
Please give me a sample code...
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 6843799
Connect your Barcode to your Comm Port then Using MSComm Control to Print the Barcode from your Barcode Machine.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:rspahitz
ID: 6844701
Alternately, you can directly print to the com or parallel port as follows:

Dim iFileNumber as integer

' Pick one of these and use it in the open statement
Const cCommPort as String = "COM1:"
Const cParallelPort as String = "LPT1:"

iFileNumber = freefile()
open cCommPort for output as #iFileNumber
print #iFileNumber, "Barcodestring here";
close #iFileNumber
0
 

Author Comment

by:posboy
ID: 6855900
any other comments?
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6857121
What else do you want?  You either print directly to the port (Open "...") or through an object that supports the port (MSComm).

Did you try either one?  Were they useful?  Did you have problems?
0
 
LVL 3

Accepted Solution

by:
kfrick earned 200 total points
ID: 6860869
All barcode printers have some control codes required to print the proper bar codes. I don't use Zebra printers (I use Datamax), but just lookup the proper codes in your printer's documentation. Be sure you understand the required syntax to implement the control codes....often you will need a specific "Start" charachter to alert the printer that coontrol codes are coming in. not printable data.

I will assume that your printer is conected to a serial port. That is by far easier than the parallel port.

First, open your port:

Sub OpenPort()
  With comMyPort
    .CommPort = 1
    .Setting = "9600,8,n,1"
    .PortOpen = True
  End With
End Sub

Now send data:

Sub SendLabel()
  'set up printer heat and speed
  SendPrinter Chr$(2) & "LH07PKSK" & Chr$(13)
  'send the barcode definition parameters and data
  SendPrinter "1a31100000000050" & CStr(SomeVariable)
  'tell the printer to print the label
  SendPrinter "E" & Chr$(13)
End Sub

Sub SendPrinter(szData as String)
  With comMyPort
    .Output= szData
    While .OutBufferCount > 0
      DoEvents
    Wend
End Sub
 
Don't forget to your port:

Sub ClosePort()
  comMyPort.PortOpen = False
End Sub

You're gonna have to understand the data your printer requires, the above example is for Datamax, but should give you an idea of the principles involved.

hope this helps!
-karl
0
 

Author Comment

by:posboy
ID: 6863014
hi karl, i will try your suggestion, i will get back to you when im done. thanks
0
 

Author Comment

by:posboy
ID: 6927558
unfortunately i was not able to make it work. How about ZPL II? do you have any idea how to integrate those script with VB? can I use the simple Print method to send those script to the printer?
0
 
LVL 3

Expert Comment

by:kfrick
ID: 6927986
The data commands in the example I gave is for prodigy printers...the data commands you use will probably be found in the printer's programming manual. Possibly this ZPL II is a ZebraPrinterLanguage, and you have to use those commands instead of mine!

-karl
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7610480
Hi posboy,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept kfrick's comment(s) as an answer.

posboy, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:modulo
ID: 7657284
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
passing parameter in sql procedure 9 68
SLMGR Switches Are Not Working On KMS Host 3 145
MsgBox 4 71
vbModal 12 66
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question