LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zebra printer - Printing from LabVIEW using ZPL commands....

I created the label and got the prn file and the label prints using the generic text driver. However my problem is this, no matter what I do the spacing of the text is weird. For a ^FD command whatever text follows this command it is spaced weird.

 

For example, the code ^FDABT Moceluar Imaging, Incorporated^FS comes out as: ABT               Molecular Imaging,            Incorporated

For example, the code ^FDKnoxville, TN 37777^FS comes out as Knoxv        ille, TN 37777

 

 

Any thoghts?

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 41 of 163
(5,261 Views)

@DougFerguson wrote:

I created the label and got the prn file and the label prints using the generic text driver. However my problem is this, no matter what I do the spacing of the text is weird. For a ^FD command whatever text follows this command it is spaced weird.

 

For example, the code ^FDABT Moceluar Imaging, Incorporated^FS comes out as: ABT               Molecular Imaging,            Incorporated

For example, the code ^FDKnoxville, TN 37777^FS comes out as Knoxv        ille, TN 37777

 

 

Any thoghts?


I am not sure what happens when you convert it to a prn. This may change your formatting. I would suggest using all ZPL and send that to the printer using the generic text. By passing it through the prn conversion you are allowing some other system to perform the formatting. Without seeing your complete label it is hard to tell if you are formatting everything correctly. Do you specify the font and size to use in the label? Are you specifying the positions correctly? How about justification? All of this is direclty supported in ZPL itself and it would be better to let the printer render the image rather than your PC.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 42 of 163
(5,254 Views)

I have tried a simple example as outlined in the ZPL guide and even it puts in these weird spaces. I think it has to do with the Report VIs. I am trying to send the string directly to the printer, but I am having problems finding the intrument address (printer is USB).

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 43 of 163
(5,245 Views)

You can try printing directly to the printer, through the print driver, but without using the Report VI's. They do not work very well with Zebra printers since they have no knowledge of the internal fonts, bar codes, etc. I have printed using USB as described earlier without issue. The VISA can be a bit tricky to setup the first time but once that is done sending data to the printer is simply a call to VISA write.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 44 of 163
(5,245 Views)

Using the Driver Wizard I did just that and it was so simple it was genius.

 

Now the challenge switches to decoding the prn file to pragmatically insert data.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 45 of 163
(5,231 Views)

Can you post the prn file? Is it ASCII only? What data do you need to replace?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 46 of 163
(5,221 Views)

Each label will have a date and lot number inserted. These will change daily.

 

I haven't even started to look at decoding the prn file since they were created by someone else.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 47 of 163
(5,216 Views)

Unfortunately that is not a format you will be able to easily modify. This format is basically sending bitmaps to the printer and placing them on the label for printing. You would be much better off defining the label itself in ZPL. Do you have an example of what you want the label to look like? ZPL is not that difficult to create once you have a little experience with it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 48 of 163
(5,213 Views)

I have figured out a way to insert my text.

 

The engineer in charge of the visual layout makes the label in Zebra software minus all variable fields and exports the prn file. I import the prn file text and insert between the ^XA and ^XZ commands the field data I want. This required me to find the field origin coordinates for each field data entry through trial and error.

 

Maybe there is a more elegant way, but given my workload this was easy enough.

 

Thanks for the input.

Doug Ferguson

www.southerndaqsolutions.com
0 Kudos
Message 49 of 163
(5,207 Views)

FWIW, here's managed to modify labels reflect variable data:

 

I used the Zebra label designer software and placed text fields everywhere I wanted variable data.  I used something easily recognizeable and roughly the same length as my expected data (e.g. "111111").  I then created the prn file through the Zebra driver.  To print the label with updated/variable data I read the prn file as a text file and do sequential "search and replace" calls to replace all of the "111111", etc.  I save the prn file to a temporary location and send that to the printer, preserving my original "template" prn. 

0 Kudos
Message 50 of 163
(5,199 Views)