Printronix RFID-Label-Printer

Richard Lippmann
5 min readDec 8, 2021

--

This is my resumé after working for one week with Printronix RFID-label-printer T4304, also known as T4000.

How the printer looks like

Printronix T4304, way of printing
Printer in detail

My scenario

I want to support inventory of computer-devices in my office with about 5000 devices spreaded all over my city.

It seems that, from the view of a printer manufacturer I have a very special need about the printing of my RFID labels. This is what I want:

RFID-label with special QR-code and RFID-code (EPC) in clear text

The QR-Code on the label leads directly to one of my webservers and is in clear text:

https://qr.zirndorf.de/rfid/epc/E28011710..0EE

This helps my co-workers to simply take a picture from that qr-code and to go to this special URL. If they are logged in into the webserver they get more information about the device, all other people get a simple info page that this is a device from my office Stadt Zirndorf.

Label printing software

Ususal label printing software is not working in this scenario because it’s only able to print the EPC-code (the “serial number” of the RFID-label) as a QR-code. So the QR-code would be E28011710..00EE — but this does not lead me quickly to a webserver where more information is hided.

This is outcome of a limited ability of the printer language itself. The printer language seems to be veeeeery old, you will see soon.

Making my own labels with the printer language itself

When rolling my own dices to program the printer I have to know about the programming language the printer is using. I found documentation about the printing language, simply google for the words and you will find it:

  • PTX_PRM_PGL_P7_253642C.pdf

I was able to use the Nicelabel software and could catch the outcoming printing commands by printing to a file like this:

printing to a file unveils the raw printer commands

Don’t get shocked, it’s not that difficult (all ### are comments from me, don’t use when commanding the printer)

!PTX_SETUP
ENGINE-IMAGE_SHFT_H;0
ENGINE-IMAGE_SHFT_V;0
ENGINE-WIDTH;03243.
PTX_END
### How to heat the printer, cut yes/no etc.
~NORMAL
~PIOFF
~DELETE LOGO;*ALL
~PAPER;INTENSITY 8;MEDIA 1;FEED SHIFT 0;CUT 0;PAUSE 0;TYPE 0;LABELS 2;SPEED IPS 6;SLEW IPS 6
### Create an internal subroutine in the printer:
~CREATE;MYSUBROUTINE;99
SCALE;DOT;300;300
ISET;0
FONT;FACE 92250
### print some text
ALPHA
POINT;64;551;10;10;"Stadt Zirndorf, EDV"
STOP
### print a qrcode
BARCODE
QRCODE;XD12;T2;E0;31;197;
"http://my.com/whatever"
STOP
ISET;0
FONT;FACE 92250
### ...STOP
END
# Execute the subroutine for ONE label
~EXECUTE;MYSUBROUTINE
~REPEAT;1
~NORMAL

The command how to create a QR-code is described on page 328 in the document PTX_PRM_PGL_P7_253642C.pdf — but (as my knowledge is) the command cannot read the EPC-code from the label and create a barcode where the EPC-code is a part of it.

This seems to be a limitation of the printer language.

Printers do not answer, but they can

I had the job to write a programm which commands the printer to use the RFID-reading-unit and output the result to the command-line.

I send a command to port 9100 and listen to the anser. Usually the printer does not answer anything, but there is a command SNOOP which makes the printer answering.

Test to see it working from a linux -machine

ssh me@shell.mydomain.comexport MYPRINTER=192.168.100.3
# Talk to the printer with the program netcat = nc
nc -v $MYPRINTER 9100
~CONFIG
SNOOP;STATUS
END
~IDENTITY

The result is the printer type, OS-version, memory

T43040,V1.21A,12,131072KB

Well done! Now I can reach for the real needed information:

~CONFIG
SNOOP;STATUS
END
### Create a job named "VERIFY"
### NOMOTION, don't put the label out of the printer

~CREATE;VERIFY;NOMOTION
### Read the RFID-EPC-tag which is 96 bits long
RFRTAG;96;EPC
### put 96 bits to the local variable DF511 as H=Hexnumbers
96;DF511;H
STOP
### run the job VERIFY
### output the variable DF511 in H=Hex

VERIFY;DF511;H;*STARTEPC=*;*=ENDEPC\n*
### Jobdefinition is ready:
END
### Execute the job VERIFY
~EXECUTE;VERIFY;1
~NORMAL

The result is:

STARTEPC=E28068940000501EC931EC87=ENDEPC

Now I am ready to read the EPC-code while talking to the printer in the perl-language I usually use. After reading the EPC-code I create a print-job in where in clear text stands the complete label definition. I send this to the printer on port 9100 and hope the best.

Find the perl-programm to print like this here at github.com:

This kind of communication remembers to the 80ies. Which means jumping back to the time of 1980…

Trouble in printing: hickups

Not seldom the printer gets a hickup in communication and wastes labels:

I made a pause of 20 seconds between every label-print to avoid this, but it happens again and again.

Trouble in printing: printer does not answer anymore

When the printer does not answer for my question about EPC-code. I have to switch it off and on. What is the printer doing after switchin on: pull 8 labels for my 8 Euros:

Switching off and on costs 7 Euros

To avoid that I open the lid and pull them gently back. 7 Euros are 7 Euros which is to much to see them floating out of this printer.

What could be better with a printer like that?

  • Talking with a REST-API would be helpful. With that I could read the RFID-tags in a regular manner.
  • Wasting of labels is a printer software problem, what about a switch in the software to stop that?
  • Communicating with port 9100 is tricky and the printer does not seem to like it, hickups, stopping to answer…
  • Internal printerlanguage can create QR-Codes but is not flexible enough to patch a QR-Code with some fixed text concatenated to the EPC-code.

My result for a week of working with that

A lot of trouble, a lot of unwanted learning. Probably it’s a good idea to let labels producing by a service-provider when they are standardized like mine.

Feedback very welcome.

--

--

Richard Lippmann
Richard Lippmann

Written by Richard Lippmann

CIO in a city-administration in Bavaria, Germany

No responses yet