# What is the difference between using an USB Logging Software and Logic Analyzer for signal sent to the printer?

In my recent pursuit in exploring the workings of an inkjet printing head, I need information like the default firing voltage and waveform set by the printer's manufacturer for different instructions sent to each pin on the printing head.

Assuming that the printer is connected to the computer via USB, can I use an USB Logging Software (eg. USBlyzer etc.) installed on the computer, in place of a Logic Analyzer or Oscilloscope(probing the pins of the printing head) to get the information for the purpose above?

What is the main difference between such a software and hardware approach of measurement, apart from the cost?

• use an oscilloscope to determine what the signal looks like .... use that information to design a digital interface, basically a level converter .... when the interface is completed, then design something that can read the signals and make sense of them ... there are many ways to spit ink from a nozzle, so you will need to design a separate interface for each type of printhead – jsotola Jun 14 at 4:39

Assuming that the printer is connected to the computer via USB, can I use an USB Logging Software (eg. USBlyzer etc.) installed on the computer, in place of a Logic Analyzer or Oscilloscope(probing the pins of the printing head) to get the information for the purpose above?

In short, no.

The universal serial bus (USB) has one job: transferring commands and data from the computer to the printer. For printers, the printer commands and data formats are defined by one or more industry standards--e.g., Hewlett-Packard's Printer Command Language (PCL). As an example, these HP PCL commands inform the printer of the print job's paper size and orientation:

unsigned char  pcl_paper_size_us_letter[] = { '\x1b', '&', 'l', '2', 'A' };
unsigned char  pcl_paper_orientation_portrait[] = { '\x1b', '&', 'l', '0', 'O' };


The first character of each PCL command is the ASCII ESCAPE 'ESC' caracter (0x1b) which is a non-printing character. Therefore these commands are commonly referred to as "printer escape codes" or "printer escape sequences".

A microprocessor within the printer receives the incoming information from the USB. The microprocessor decodes the PCL commands and data and then generates the required logic signals that actuate the hardware that physically performs the commands.

COMPUTER <--USB--> [ <-> uP <-> (other_hardware) <-> PRINT_HEAD ]
\------------------ PRINTER -----------------/


The PCL commands the computer sends the printer via the USB do not directly define hardware logic signals. It is the microprocessor's job to decode the incoming PCL commands (to determine which specific PCL command was received) and to generate the required sequence of logic signals that actuate each PCL command on the printer's hardware.

If you want to reverse engineer how a printer's microcontroller controls the printer's print head you could start by mapping specific PCL commands to specific hardware signals as captured by the logic analyzer, or the oscilloscope, or both. You probably need to find or create a custom program that runs on the computer, that allows you to send individual/specific PCL commands from the computer to the printer so that you can then capture with a logic analyzer the resulting logic signals, or capture with an oscilloscope the resulting analog voltage levels, or both, at the print head.

• Thanks for your well-written explanation. Kudos! – Jack Oat Jun 15 at 3:49
• For modern printers(running with PCL and similar language), I presume the software driver to drive the hardware should be running on the microprocessor installed within the printer. However, for older printers, they used to have the user install the software driver on the host computer. In this scenario, is it right to say that the PCL decoding to logic signals is first done on the computer(with driver installed on it) and subsequently, the decoded logic signals then pass on via USB or some cable to the microcontroller in the printer to actuate the hardwares? – Jack Oat Jun 15 at 3:52
• The device driver software on the PC communicates with the printer's onboard microcontroller or combinatorial logic. The driver software manages the communication link (the communication protocol) between the PC and the printer, and it monitors and manages the printer's state--e.g., monitoring ink/tonor levels--and other ancillary tasks that are not defined by the PCL specification (which IIRC primarily governs how information is rendered during a print job). (cont...) – Jim Fischer Jun 15 at 15:44
• (cont...) I imagine if one goes back many decades to a time when inexpensive embedded microprocessors didn't yet exist, the CPU probably played a much bigger role in managing the printer hardware, but that's a guess. – Jim Fischer Jun 15 at 15:45

A logic analyzer just grabs the raw digital ones and zeroes but can do it for almost anything. You need to do the decoding work yourself, more or less.

A protocol analyzer can only grab data for one protocol, but will do a much more extensive job of it and help you interpret it.

Some logic analyzers do some decoding for you, but it's not as good or as extensive. You also probably have to set it up in the logic analyzer software yourself manually.

• My understanding is that the logic analyzer is a physical hardware, thus, is the protocol analyzer mentioned here referring to the USB Logging Software? – Jack Oat Jun 14 at 4:29
• Amended my qs with a more precise ending - What is the main difference between such a software and hardware approach of measurement, apart from the cost? – Jack Oat Jun 14 at 4:31

...workings of an inkjet printing head, I need information like the default firing voltage and waveform set by the printer's manufacturer for different instructions sent to each pin on the printing head.

can I use an USB Logging Software (eg. USBlyzer etc.) installed on the computer, in place of a Logic Analyzer or Oscilloscope(probing the pins of the printing head) to get the information for the purpose above?

The entire premise of this question is ill-conceived. USB commands and data traffic have very little to do with what voltages and their shapes are applied to nozzles of inkjet printer. Or any other printer head.

Modern printers operate under control of PDL - Page Description Language, "PDL". There are several languages, most used is PostScript Language. As the name says, it is a text-based description of page, which fonts to use, which text to print, and where to put it on that page. Function of USB interface is to download the PDL file into a printer. And there is a long-long way form loading the page description to how the printer head starts spitting ink through nozzles. You can look into definitions of what the USB Printer Class of devices are doing.

Before the printer head gets started, a powerful microcomputer within the printer parses and analyzes the PDL code, and forms corresponding pixel-level image of the page, using sophisticated font-generating algorithms, and renders a bitmap of page image in its internal memory buffer. Only then an independent software process scans that image buffer and begins to control the paper feed, head movement, and spits the dots sending internal commands to these three units: paper feed, head positioner, and local head hardware driver that forms voltages to hit piezo-elements forcing tiny drops of ink to fly. As one can see, USB commands have absolutely nothing with the voltages that drive the printer head.

More, USB signals are essentially in digital serial format with tiny fixed amplitude of about 400 mV, while the voltages on head terminals are likely in 12-V see this publication.