Connect Zebra zt410 printer and print label by ignition

Hi everyone, I’m doing a project which need to print 2D barcode and some label informationl. We bought a zebra zt410 printer. I find a function in the forum as in the pictures , but there is an error come up, Please help me to check, and if you have any good function to print the label and barcode by clicking the button to trigger the zebra printer, please show me ! I realy need your help. Thanks !

error:PrinterException: Printer is not accepting job

java.awt.print.PrinterException: Printer is not accepting job.
at sun.print.RasterPrinterJob.print(Unknown Source)
at com.inductiveautomation.factorypmi.application.print.FPMIPrinterJob.print(FPMIPrinterJob.java:453)
at com.inductiveautomation.factorypmi.application.script.builtin.PrintUtilities$JythonPrintJob.print(PrintUtilities.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186)
at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:204)
at org.python.core.PyObject.call(PyObject.java:387)
at org.python.core.PyObject.call(PyObject.java:391)
at org.python.core.PyMethod.call(PyMethod.java:109)
at org.python.pycode._pyx13.f$0(event:actionPerformed:5)
at org.python.pycode._pyx13.call_function(event:actionPerformed)
at org.python.core.PyTableCode.call(PyTableCode.java:165)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1275)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:624)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:168)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:265)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at com.sun.proxy.$Proxy33.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Ignition v7.8.0 (b2015101414)
Java: Oracle Corporation 1.8.0_31






How is the printer connected? IMO, you can usually get better results using ZPL than going through ZDesigner.

An example of ZPL, sending this plaintext to the printer (if you are still looking to do this through Windows, you can use the Generic Text driver.)

~JA ^XA ^BY2,2,167 ^FT015,280,^B3N,N,,N,N ^FDP4CJ9496SA24^FS ^FT050,080^A0N,40,45 ^FDP4CJ9496SA24^FS ^PQ11,0,0,N ^XZ

This will print a barcode (Code39 in this instance) and some readable text.

Part of asking how the printer is set up is to help tailor a more specific answer. :slight_smile:

We recently integrated a Zebra printer into an Ignition system. We ended up using ZPL as Jordan suggests, sending it to the printer using raw TCP sockets. The following Python script should give you an idea of how to go about this:

import socket
HOST = '192.168.1.122'
PORT = 9100
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.sendall('^XA')
s.sendall('^FO50,50^ADN,36,20^FDHello world')
s.sendall('^FS')
s.sendall('^XZ')
s.close()

Just put this script on a button in Ignition and make sure the HOST variable is set to the IP address of your printer. After that, sorting the layout, choosing the type of barcode you want printed etc. is a matter of reading the ZPL manual!

1 Like

Zebras… my favorite topic :mrgreen:

A quick way is to print directly to LinkOS enabled printers is to use HTTP and post the ZPL.
zebra.com/content/dam/zebra … ost-v5.pdf

The way I like to do printing is to:

  • manage the printers using Zebra Mirror (fancy FTP server)
  • create labels using ZDesigner and export them to Mirror for XML enabled printing
  • send print jobs to the printer via HTTP or LinkOS SDK.

Here is a private video that I have shared with some Zebra techs when working on a particular problem.
youtube.com/watch?v=P7AdWY6ZQFI

Feel free to call me at the number on the video if you want to chat about Zebras in the wild…

/c

Hello Everyone, sorry to send a message to the this topic, but if we use a Local Zebra Printer By USB, how can I send the ZPL code for that?

If you use the RS232 port on the printer you can send ZPL over Serial.

You could check to see if the USB connection also allows a for a serial protocol, not sure if there is another way.

Thanks for the fast reply, I will try this method.