# Print in line label

**URL:** <https://discourse.nodered.org/t/print-in-line-label/84534>\
**Category:** Hardware\
**Created:** [14 January 2024 13:00 UTC](https://discourse.nodered.org/t/print-in-line-label/84534 "2024-01-14T13:00:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 13:00 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/1 "2024-01-14T13:00:49Z")

</div>

Hello everyone. I'm new to node-red and need help.  
I am creating an interface for the management of two production lines. At the end of this line there is a networked printer (Zebra) that will have to label the pallets.  
Once I have created the label with the necessary information, how can I send it to the printer?  
Node red is installed on a Siemens Simatic Comfort panel (assuming the OS is Linux)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 January 2024 13:10 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/2 "2024-01-14T13:10:02Z")

</div>

You need to find out how prints can be sent to that printer. If, for example, it supports `lp` prints then it should be pretty easy.

> **[How to Use the lp Command in Linux to Print Files From Terminal - Make Tech...](https://www.maketecheasier.com/use-lp-command-linux/)**
>
> Linux printing can be a bit of a challenge. Learn how to use the lp command in Linux to print document from the terminal.

Otherwise, you may need to report back what print methods it supports.

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [14 January 2024 13:25 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/3 "2024-01-14T13:25:03Z")

</div>

> [@miemer](#):
>
> Zebra

A quick search gave me this [page](https://supportcommunity.zebra.com/s/article/000022631?language=en_US):

> A CUPS driver that supports Zebra printers is included with some Linux distributions and Mac OS X 10.6 Snow Leopard and later

so it would seem that the printer is supported by linux.

If you find the command under linux to make the printer print, then you can use the exec node to do that via Node-RED.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 January 2024 13:34 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/4 "2024-01-14T13:34:41Z")

</div>

Not really clear but this article implies that `lp` could also be used?

[https://supportcommunity.zebra.com/s/article/ZEC-Error-lp-unable-to-print-file-client-error-document-format-not-supported?language=en\_US](https://supportcommunity.zebra.com/s/article/ZEC-Error-lp-unable-to-print-file-client-error-document-format-not-supported?language=en_US)

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [14 January 2024 13:49 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/5 "2024-01-14T13:49:02Z")

</div>

Whatever floats your boat 😉 - if the drivers are there then it works!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 January 2024 14:05 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/6 "2024-01-14T14:05:05Z")

</div>

> [@miemer](#):
>
> Siemens Simatic Comfort panel

More that I'm just not sure how much you can do with that unit. You might not be able to install CUPS and the appropriate driver.

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [14 January 2024 14:19 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/7 "2024-01-14T14:19:28Z")

</div>

I doubt very much a company buys components that don't work together, usually you would ask the supplier if what you want to do with their gear will actually work.

And if not, then return to sender.

---

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 14:20 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/8 "2024-01-14T14:20:17Z")

</div>

Thank you all for the replies. The printer in question is a ZE511 Industrial Printing engine [Supporto e download del motore di stampa di ZE511 | Zebra](https://www.zebra.com/it/it/support-downloads/printers/print-engine/ze511.html#downloadlistitem_48b)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [14 January 2024 14:22 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/9 "2024-01-14T14:22:20Z")

</div>

It's a HMI, it's not _really_ used for making photocopies (but it's possible)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [14 January 2024 14:36 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/10 "2024-01-14T14:36:57Z")

</div>

Take a look at this [support](https://support.industry.siemens.com/cs/mdm/109795870?c=151645888011&lc=en-WW) and try to connect your printer.

I don't know how you should configure NR

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [14 January 2024 14:43 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/11 "2024-01-14T14:43:44Z")

</div>

OK, then it sounds like days of trying to get it to work and then making the realisation that it can't work.

Next question: has it ever worked before? Or is this a first time installation? Ie was there something else other than Node Red already working?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 January 2024 15:04 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/12 "2024-01-14T15:04:55Z")

</div>

> [@GogoVega](#):
>
> Take a look at this [support](https://support.industry.siemens.com/cs/mdm/109795870?c=151645888011&lc=en-WW) and try to connect your printer.

Good find. That shows that CUPS is indeed supported.

SO if you have access to the admin setup yourself, you should be able to do it using the docs shown. If not, you will need to find someone with admin rights for the system.

---

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 15:25 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/13 "2024-01-14T15:25:01Z")

</div>

Thanks, i 'm the administrator of the system, I shouldn't have any other problems than figuring out how Siemens makes it possible 😄

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [14 January 2024 15:42 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/14 "2024-01-14T15:42:22Z")

</div>

Can you edit PLC code?

> **[Siemens SiePortal](https://sieportal.siemens.com/en-ww/support/forum/posts/connect-zebra-printer-with-s7-1200/162739)**

- 
### [aciesielski84](https://support.industry.siemens.com/forum/WW/en/users/profile/1087043/) user gives quite good explanation how it is handled.

Basically you can send TCP/IP telegrams either from PLC or from NR into template that is loaded into Zebra printer

---

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 16:14 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/15 "2024-01-14T16:14:49Z")

</div>

unfortunately i have only S7-300, old version of PLC

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [14 January 2024 16:23 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/16 "2024-01-14T16:23:49Z")

</div>

S7-300 also have library function blocks dedicated for TCP/IP communication, but I would suggest using S7 nodes. Read data from PLC, construct a string like it is shown in the forum link I posted:

> a string that I send to the printer :
> 
> Version 1 only DMC and TEXT - I print the number once as text and once as DMC  
> '^XA^XFE:ETYKIET1.ZPL^FN11^FD691234567444443221^FS^FN12^FD691234567444443221^FS^XZ'
> 
> Version 2 -\> DMC, text and time stamp
> 
> '^XA^XFE:ETYKIET1.ZPL^FN11^FD561234567444443221^FS^FN12^FD677123456744443221^FS^FO40,420^A0N,30,30^FC%^FDDATA: %d/%m/%Y^FS^FO350,420^A0N,30,30^FC^FD %H:%M:%S^XZ'

And send it via TCP/IP out node. Assuming you have Ethernet and not RS232 printer

---

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 16:27 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/17 "2024-01-14T16:27:32Z")

</div>

Thanks KarolisL, do you think that via PLC is more simple? Send data from Node-red to PLC is also simple, then PLC print directly to Zebra. This is definitely a viable alternative.

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [14 January 2024 16:50 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/18 "2024-01-14T16:50:20Z")

</div>

I don't know your Siemens programming skills, but working on S7-300 strings I would say is kind of pain. Doing it via PLC is definitely not simple, but you don't need nodered.

Also I assumed that you have label template creating tool - Zebra Designer (If I remember correctly they are licensed)  
How did you install nodered into Comfort HMI?

For testing purposes I would try and establish TCP/IP connection between zebra printer and nodered. And try to send static strings to label template. If i works then worst part is behind you:  
Either stick with Nodered and read from PLC to create dynamic strings, or transfer TCP/IP communication into PLC and drop NR.

(I would stick with nodered)

---

<div class="post-metadata">

**Author:** ![miemer](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miemer](https://discourse.nodered.org/u/miemer)\
**Post date:** [14 January 2024 17:10 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/19 "2024-01-14T17:10:39Z")

</div>

The plcs manage the automation, with node red installed on the panel I would like to develop an MES and also print production labels. So, can I use the exec node to send a template built with zebra designer via tcp?

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [14 January 2024 17:34 UTC](https://discourse.nodered.org/t/print-in-line-label/84534/20 "2024-01-14T17:34:31Z")

</div>

Do you have nodered installed in HMI already or do you plan to do it?

In all printers I've seen templates were passed by USB stick. They were .zpl files like shown in example post above: ETYKIET1.ZPL - is a name of template already on printer.

In templates you create dynamic fields and you name them FN11, FN12 or whatever and then you pass data into those variables:  
'^XA^XFE:ETYKIET1.ZPL^FN11^FD691234567444443221^FS^FN12^FD691234567444443221^FS^XZ'

[Next page](https://discourse.nodered.org/t/print-in-line-label/84534.md?page=2)
