Printer Status

This action communicates with the printer to acquire its real-time state, and contacts the Windows Spooler for additional information about the printer and its jobs.

As a result, the information about errors, spooler status, number of jobs in the spooler is collected. This uncovers potential errors and makes them easy to identify.

[Note] Note

Possible use case scenarios. (1) Verifying the printer status before printing. If the printer is in an error state, you print the label to a backup printer. (2) Counting the number of jobs waiting in a spooler of the main printer. If there are too many, you will print the label to an alternative printer. (3) You will verify the printer status before printing. If the printer is in an error state, you will not print labels, but report the error back to the main system using any of the outbound actions, such as Send Data to TCP/IP Port, Send Data to HTTP, Execute SQL Statement, Web Service, or as the trigger response.

Live Printer Status Prerequisites

To make live printer status monitoring possible, follow these instructions:

  • Use the Loftware Printer Driver to receive detailed status information. If using any other printer driver, you can only monitor the parameters retrieved from the Windows Spooler.

  • The printer must be capable of reporting its live status. For the printer models supporting bidirectional communication see Loftware Download web page.

  • Printer must be connected to an interface with support for bidirectional communication.

  • Bidirectional support must be enabled in Control Panel > Hardware and Sound > Devices and Printers > driver > Printer Properties > Ports tab > Enable bidirectional support.

  • If using a network-connected label printer, make sure you are using Advanced TCP/IP Port, not Standard TCP/IP Port. For more information, see the Knowledge Base article.

Printer group selects the printer.

  • Printer name: specifies the printer name to be used for the current print job.

    You can select a printer from the list of locally installed printer drivers, or you can enter any printer name. Data source enables variable printer name. When enabled, select or create a variable that contains the printer name when a trigger is executed or an event takes place. Usually, the variable value is assigned by a filter.

Data Mapping group sets the parameters that are returned as a result of the Printer Status action.

[Warning] Warning

Most of the following parameters are only supported with Loftware printer drivers. If you are using any other printer driver, you can use only the spooler-related parameters.

  • Printer status: specifies the printer live status formatted as a string.

    If the printer reports multiple states, all states are merged into a single string, delimited by comma ",". If there are no reported printer issues, this field is empty. Printer status might be set to Offline, Out of labels or Ribbon near end. Since there is no standardized reporting protocol, each printer vendor uses proprietary status messages.

  • Printer error: boolean (true/false) value of the printer error status.

  • Printer offline: boolean (true/false) value of the printer offline status.

  • Driver paused: boolean (true/false) value of the driver pause status.

  • LoftwareDriver: specifies boolean (true/false) value of the printer driver status. Provides information if the selected driver is a Loftware driver.

  • Spooler status: specifies the spooler status in a string form – as reported by the Windows system. The spooler can simultaneously report several statuses. In this case, the statuses are merged using comma ",".

  • Spooler status ID: specifies spooler status formatted as a number – as reported by the Windows system. The spooler can simultaneously report several statuses. In this case, the returned status IDs contains all IDs as flags. For example, value 5 represents status IDs 4 and 1, which translates to "Printer is in error, Printer is paused". Refer to the table below.

    [Tip] Tip

    The action returns a decimal value, the values in the table below are in hex format, so you will have to do the conversion before parsing the response.

  • Table of spooler status IDs and matching descriptions

    Spooler status ID (in hex)

    Spooler status description

    0

    No status.

    1

    Printer is paused.

    2

    Printer is printing.

    4

    Printer is in error.

    8

    Printer is not available.

    10

    Printer is out of paper.

    20

    Manual feed required.

    40

    Printer has a problem with paper.

    80

    Printer is offline.

    100

    Active Input/Output state.

    200

    Printer is busy.

    400

    Paper jam.

    800

    Output bin is full.

    2000

    Printer is waiting.

    4000

    Printer is processing.

    10000

    Printer is warming up.

    20000

    Toner/Ink level is low.

    40000

    No toner left in the printer.

    80000

    Current page can not be printed.

    100000

    User intervention is required.

    200000

    Printer is out of memory.

    400000

    Door is open.

    800000

    Unknown error.

    1000000

    Printer is in power save mode.

  • Number of jobs in the spooler: specifies the number of jobs that are in the spooler for the selected printer.

  • Loftware driver extended printer status: returns printer status and errors data in JSON format. Data includes also printer parameters like firmware version, printhead distance, and ink level.

    [Note] Note

    You need the latest Loftware driver to get the Loftware driver extended printer status.

    Example 48. Example

    Loftware Automation returns the following JSON content:

    {
    	"printerName":"Production_printer_09",
    	"version":"1",
    	"responseType":"status3",
    	"overallStatus":"error",
    	"operationState":"pause",
    	"printerType":"Thermal Transfer Label Printer",
    	"deviceStatus":
    	[
    		{
    			"item": "fatalError",
    			"type": "string",
    			"internalId":"ERR_PAPER_OUT",
    			"shortString":"Paper Out",
    			"longString":"Printer is out of paper."
    		},
    		{
    			"item": "error",
    			"type": "string",
    			"internalId": "ERR_RIBBON_OUT",
    			"shortString": "Ribbon Out",
    			"longString": "Printer is out of Ribbon."
    		}
    	],
    	"deviceParameters":
    	[
    		{
    			"item":"state",
    			"type":"float",
    			"internalId":"INFO_PRINTHEAD_DISTANCE",
    			"unit": "meter",
    			"value": 789,
    			"shortDescription":"Printhead distance",
    			"longDescription":"Distance of printhead usage."
    		},
    		{
    			"item": "state",
    			"type": "string",
    			"internalId": "INFO_FW",
    			"unit": "",
    			"value": "FW27.3.13",
    			"shortDescription": "Firmware version",
    			"longDescription": "The version of the Firmware loaded on the printer."
    		},
    		{
    			"item": "property",
    			"type": "integer",
    			"internalId": "INFO_PRINT_DISTANCE",
    			"unit": "seconds",
    			"value": 16004,
    			"shortDescription": "Print Distance",
    			"longDescription": "Print Distance that the printer printed since odometer reset."
    		}
    	]
    }