Zebra printer and PLC

catenaccio81

Member
Join Date
Jun 2013
Location
basque country
Posts
9
Hi, i need to use a Zebra printer directly from a PLC by serial port. I don't know very much about this, so i will be very grateful if someone can help me. It's easy what i have to print,i know how to do it directly from the computer, but i need some steps to do it from a PLC. Anyone can help me??
 
Hi, i need to use a Zebra printer directly from a PLC by serial port.
I don't know of any PLC brand where that would be easy to do. Most PLCS have some ASCII instructions that can control characters sent to the PLC ASCII serial output port. But that only helps if your printer can be completely controlled using ASCII characters, and that you have a copy of all the ASCII commands for your printer. Even then, you would have to have the correct cable and the correct serial communications settings for the printer.

It would probably be easier and quicker and maybe cheaper to set a very small cheap computer (of some type) next to the PLC, send the program data to the computer, then print it out.

Another possibility is to replace your Zebra printer with a special-purpose printer made to work with your PLC, such as a label printer or something similar.
 
Last edited:
I have a few Zebra printers being controlled by AB Micrologix PLCs. The Zebra printers I was given by my IT department are specifically designed to read variables from an ASCII string.

I send it an ASCII string containing print variables and start command variables, and it prints a template filled with the variables.

So depending on what Zebra printer you have, I would say it is a special purpose printer. I will gather more info on our printer model number later today when I get out on the shop floor.

Edit:
Yes, these are label printers.

Edit:
These Zebra printers are model number ZM400.
From what I remember about their setup, a template is 'printed' to them from a computer. This template contains a file name and permanent/variable data. This is done once. Then it waits for an ASCII command across it's serial port. The command contains a File Name and any variable data. Prints a label using the named template filled with the variables in the ASCII string.

It's been about 5 or 6 years since they were initially setup, so my memory's a little flaky, but I could look up my old information if you need it. I know our IT guy worked with the Zebra Tech support and they were helpful.
 
Last edited:
Thanks for the info. You would think that if he had a label printer, that he would also have a manual for it, or get a manual and read the directions. I don't see how anyone could set up an ASCII printer without the user manual. There are simply too many arcane commands to remember.
 
Zebra printers use ZPL (Zebra Programming Language), similar to Intermec's IPL, which I have some experience with. They are indeed ASCII based command sets.

The 'templates' you are refering to Tharon are usually called 'Formats' or 'Masks' in the printing world. I'm not sure what software is used to create formats for Zebra printers, but I have used LabelDesigner for Intermec printers. You design your label using fields, such as text or barcode, etc. You can then open created format files in Notepad and use 'Print' to send the format to the printer. This doesn't print anything, it just stores the label format in the Printers memory. Or you may be able to use software similar to Intermec's 'PrintSet' to send format and graphics files to the printer. You then send ASCII strings containing ZPL commands such as font type, size and co-ordinates, barcode type, number and co-ordinates, and which stored format to use. Your label format then prints out with its fields filled with the data contained in the ASCII string.

We were supposed to upgrade all our Intermec 3600 printers to Zebra ZM600 earlier this year, but that was knocked on the head. However, I had done some reading in preparation for that upgrade.

Here are links to Zebra's Programming Language Vol 1 & 2:

http://www.ptshome.com/kb/Manuals/ZPL_Vol1.pdf

http://www.ptshome.com/kb/Manuals/ZPL_Vol2.pdf

A bit of light reading there. đź“š

G.
 
A bit of light reading there. đź“š
Not to mention the long hours of head-scratching, trial-and-error, and pacing in circles. I remember when most printers were controlled with those type of commands. That comes back to the solution that Catenaccio81 already saw in his crystal ball:
It's easy what i have to print, I know how to do it directly from the computer...

Zebra Label Printer Example.JPG
 
Last edited:
Thanks for the information. But this is a bit complicated for me. My Zebra printer is GK420t. And the PLC is a Schneider that use the software Unity.
Could you give me an example of how to send for example this order to the printer or what steps to follow?

" ^XA
^FO50,50^B3N,N,100,Y,N^FD123456^FS
^XZ "
 
If you need to design labels containing more than a couple of texts make your life easier and get Zebra Designer software. You can design the label in a graphical enviroment and then export it to printer. The tricky part is to figure out the field numbers for the variables but it is easily done to put the printer in dump mode and export the label to printer once again. The printer will print the raw ascii data that you send to it. You search the prinout for ^FN# (where # is the field number of your variable). After that all you have to do is send from the PLC to the printer something like that

Code:
^XA
^XFR:SAMPLE.ZPL
^FN1^FDvariabletext1^FS
^FN2^FDvariabletext2^FS
^XZ

Hope this helps

EDIT: I presumed you need variable fields. If not, then you just have to export label to printer from Zebra Designer and recall it by sending the same text as above without the ^FN lines
 
Last edited:
I tried to send some orders to the printer, it seems to be sent without problem, but the printer didnt do anything.
Have i to change some mode of the printer to be used by a serial port?
 
If the green led blinks then the printer received the command without a problem. If it changes to amber or red then there is some error in the command. Do you have any label design software?
 
I tried to send some orders to the printer, it seems to be sent without problem, but the printer didnt do anything.
Have i to change some mode of the printer to be used by a serial port?

No special settings to use the serial port, but the settings of the PLC serial port and the printer must match (baud, stop bits, parity).

Spent a half-hour last week troubleshooting a printer until I found out that the maintenance associate had reset the printer to default settings. Had to reset the printer's serial port settings to match the PLC serial port.
 
No special settings to use the serial port, but the settings of the PLC serial port and the printer must match (baud, stop bits, parity).

Spent a half-hour last week troubleshooting a printer until I found out that the maintenance associate had reset the printer to default settings. Had to reset the printer's serial port settings to match the PLC serial port.

I got it! Thank you so much to everyone ;)

The problem was the settings of the serial port as JordanCClark said.

I will continue to be able to do things like zap358 said, but the first step is completed.

Thanks for being so polite with me 🍺

BTW can someone explain me better what zap358 told me? i'm a rookie and also my english is not the best. I whould like to do something like he told me, to save something to be called later as many times as i like. what steps have i to follow? any example?
Sorry for my hard head ;)

Edit: I know how to recall a format or a grafic, but how can i save them before? what have i to do to save some formats or grafics?
 
Last edited:
I know how to recall a format or a grafic, but how can i save them before? what have i to do to save some formats or grafics?

Do you have any label design software? How complex is the format you want to use? Do you need texts, graphics, barcodes? These info will help me help you.
 
Do you have any label design software? How complex is the format you want to use? Do you need texts, graphics, barcodes? These info will help me help you.

I have the Zebra designer. I think that the format i will use is going to be simple, i think it's going to be barcodes.

Is it possible to recall for a label saved before? I have to print barcode 39, but it's too big for my printers labels and the command for that barcode has only the possibility of edit the heigh, not the width. So how can i do it?
 
Last edited:

Similar Topics

Hi All Trying to get the PLC to send a commant to the printer to prinnt a lable. evarything is setup except RS linnx cannot see the printers and...
Replies
0
Views
353
Hi All I'm trying to connect two zebra printers to th PLC through Ethernet. I can ping the Printer through my laptop connected to the private...
Replies
0
Views
338
Hi everyone, Does anyone have a guide on how to communicate a zebra printer with a s7-1200 plc via TCP using TIA portal?? or any advices on what...
Replies
2
Views
1,828
Hi I am trying to connect a zebra printer gc420t to a micro 850 a-b, through the serial port, when the plc sends the ascii code the green led on...
Replies
3
Views
1,833
Let me start by saying I love reading through these forums, you guys are amazing! I have been tasked with implementing PLC control for a printing...
Replies
5
Views
2,244
Back
Top Bottom