PLCnext communication with label printer

Hello,
Is is possible to connect PLCnext to a label printer like GODEX in order to send printing commands?

What physical interface and communication protocol is used by the label printer?

I am going to be connected to the printer with the followings: (UTP cable → TCP/IP).

Some industrial printers support the ability to (for example) receive messages on a raw TCP socket that will print labels using pre-defined templates filled in with data from the TCP message. In that case you would need to know the details of the protocol that is implemented by the printer, i.e. what message you need to send the printer in order to print a label. In this case I suspect that the printer is simply an office or home printer that has a printer driver for Windows, and perhaps Linux. In that case it will probably not be easy to install and use that printer driver from a PLCnext Control device. But if the printer comes with a description of the API, or communication protocol, then it might be possible to print labels from the PLC.

… for example, you mentioned GODEX printers. This extract from the GODEX „EZPL“ Programmer’s Manual suggests that it’s possible to send commands to the printer through an RS232 (serial) connection. That would be possible from a PLCnext Control device with a suitable Serial Communications module.
image.png

Raw TCP socket is what applies to my situation. The message string is also known to me. What I am actually asking is how to establish a TCP connection through PLCnext.
Printer IP&Port should be configured from my HMI (not hardcoded).

Any updates on this?

I haven’t used this printer before, but I would think you could use the UDP_Socket and UDP_Send commands.
image.png

But I do not want to use UDP though, I want to use TCP

The TLS function blocks can also be used for TCP.
TLS_SOCKET_2
');\n mywindow.document.close(); \n mywindow.focus();\n setTimeout(function () {\n mywindow.print();\n mywindow.close();\n }, 1000)\n return true;\n}\r\n\r\n\r\n