It is sometimes useful to have the possibility to print from a nano PLC, especially for small machines.
Here we will see how to connect an RS232 thermal printer to a PLC, e.g. to print machine status information, print the machine’s alarm history, print the number of products from the PLC’s counter,..
First of all, design the template of your ticket to be printed
|In our example, we choose to print this template on you right.
For this purpose, built your template on https://convert.town/text-to-ascii
Your ASCII code list on the right should end with “95”, and have 1 or more “35” for each digit inside.
Copy your template into a array of values
|You have 3 subroutines in the program you can download here
You can use this program for your test and then import the 3 subroutines into your machine program or create your machine program from it.
Dont forget to increment the pointer of the Numbers[x] tag : Numbers, Numbers, Numbers,..
Start printing on the printer!
|Finally, in your main program: