Label Manager functions are available under system.labelManager. They can be used from supported Ignition script contexts. Functions that perform validation or printing return maps with success information and operation details. Errors are reported as script exceptions. A successful print result means the job was sent to the printer connection.
system.labelManager.getPrinters()
Purpose
List configured printers and their basic setup.
Returns
A list of maps, that include printer information, such as name, dpi, connected, ready, and state.
system.labelManager.getPrinters(readyOnly)
Purpose
List configured printers, optionally filtering to printers currently reported as ready.
Parameters
-
readyOnly(Boolean): Whentrue, only ready printers are returned. Otherwise, all configured printers are returned.
Returns
A list of printer information maps. The list is empty if no printers match.
system.labelManager.getPrinter(printerName)
Purpose
Get information for one configured printer.
Parameters
-
printerName(String): Configured printer name.
Returns
A printer information map, or None if no matching printer is configured.
system.labelManager.isReady(printerName)
Purpose
Check whether a configured printer is currently reported as ready.
Parameters
-
printerName(String): Configured printer name.
Returns
True when the printer exists and is ready, otherwise False.
system.labelManager.getPrinterStatus(printerName)
Purpose
Query the printer’s current status.
Parameters
-
printerName(String): Configured printer name.
Returns
A pretty-printed JSON string containing status details, including connection/readiness, and reported conditions such as media out, ribbon out, printhead open, or paused. A query failure is raised as a script exception.
Example
print system.labelManager.getPrinterStatus("Printer 1")
system.labelManager.testPrint(printerName)
Purpose
Send a diagnostic label to a configured printer.
Parameters
-
printerName(String): Configured printer name.
Returns
A map describing the send result, including success information and printer/job details. A successful send does not confirm physical output.
system.labelManager.validate(zpl)
Purpose
Check a raw ZPL Payload without sending it to a printer.
Parameters
-
zpl(String): ZPL data to validate.
Returns
A map containing valid, payload size, recognized format information, and any reported errors or warnings.
Example
zpl = "^XA^FO30,30^A0N,30,30^FDHello^FS^XZ"
result = system.labelManager.validate(zpl)
if result["valid"]:
print "ZPL passed validation!"
else:
print result["errors"]
system.labelManager.print(printerName, zpl) and system.labelManager.print(printerName, zpl, copies)
Purpose
Send raw ZPL to a configured printer.
Parameters
-
printerName(String): Configured printer name. -
zpl(String): ZPL payload. -
copies(Integer, optional): Number of copies. Defaults to 1.
Returns
A map describing the send result, including printer, copies, payload size and duration. Errors are raised as script exceptions. A SENT state means the data was sent to the printer connection, not that a label was physically printed.
system.labelManager.getLabelParameters(labelName) and system.labelManager.getLabelParameters(labelName, projectName)
Purpose
Find the declared parameters for a saved label.
Parameters
-
labelName(String): Label resource path. -
projectName(String, optional): Project containing the label. If omitted, the current script project is used when available.
Returns
A list of parameter names in alphabetical order.
system.labelManager.renderLabel(labelName, args) and system.labelManager.renderLabel(labelName, args, projectName)
Purpose
Resolve a saved label and generate its ZPL without printing.
Parameters
-
labelName(String): Label resource path. -
args(Dictionary or List): Values for the label’s declared parameters. -
projectName(String, optional): Project containing the label. If omitted, the current script project is used when available.
Returns
Generated ZPL as a String. Missing or invalid arguments, bindings, project, or label cause a script exception.
system.labelManager.print(labelName, args) and system.labelManager.print(labelName, args, copies)
Purpose
Print a saved label using its configured default printer.
Parameters
-
labelName(String): Label resource path. -
args(Dictionary or List): Values for the label’s declared parameters. -
copies(Integer, optional): Number of copies. Defaults to 1.
Returns
A map describing the print send result. Errors are raised as script exception.
system.labelManager.printLabel(labelName, args, printerName)
Other supported signatures
system.labelManager.printLabel(labelName, args, printerName, copies)
system.labelManager.printLabel(labelName, args, printerName, copies, projectName)
Purpose
Print a saved label.
Parameters
-
labelName(String): Label resource path. -
args(Dictionary or List): Values for the label’s declared parameters. -
printerName(String): Configured printer name. -
copies(Integer, optional): Number of copies. Defaults to 1. -
projectName(String, optional): Project containing the label. If omitted, the current script project is used when available.
Returns
A map describing the print send result. Errors are raised as script exception.