2026-09-18
The physical connection between a Siemens PLC and an HMI is typically Ethernet or PROFINET. The PLC and HMI are connected to the same network, with IP addresses in the same subnet. The printer can be connected in one of two ways. If the HMI supports direct printing (as WinCC Comfort and Advanced panels do), the printer can be connected to the HMI via USB or Ethernet. If the HMI does not support direct printing, a communication module (such as a CP 340 or CP 341) is added to the PLC, and the printer is connected to that module via RS232 or RS485. The logical connection is the HMI connection, which defines how the HMI reads and writes data from the PLC. In TIA Portal, this is configured in the “Devices & Networks” editor by dragging a connection between the PLC interface and the HMI interface.
Network requirement: The PLC and HMI must be on the same subnet. For example, if the PLC is 192.168.0.1, the HMI can be 192.168.0.2. The printer, if networked, should also be on the same subnet. This simplifies configuration and troubleshooting.
Yueyang Tongtu E-commerce Co., Ltd. supplies Siemens PLC and HMI components for industrial automation projects. Our factory works with system integrators who configure these connections daily, and we understand the practical challenges of getting three devices to communicate reliably.
The HMI connection is created in the “Devices & Networks” editor. First, both the PLC and the HMI must be added to the project and their interfaces configured. Then, click the “Connections” button and select “HMI connection” as the connection type. Drag from the PLC’s PROFINET interface to the HMI’s interface to create the connection. Once the connection is established, the next step is variable mapping. In the HMI’s “HMI variable table,” you create variables that reference PLC tags. The table below shows the typical variable mapping for a data display application.
| HMI variable name | Data type | PLC tag reference | Display object |
| Motor_Speed | Real | DB10.DBD0 (Speed) | IO Field (numeric) |
| Product_Count | Int | DB10.DBW4 (Count) | IO Field (numeric) |
| Batch_Number | String | DB10.DBB8 (Batch) | IO Field (text) |
| Alarm_Active | Bool | M10.0 (Alarm) | Indicator Light |
After the variables are created, they are linked to display objects on the HMI screen. For a data display application, the most common objects are IO Fields (for numeric and text values) and Trend Views (for historical data). In our factory, we recommend using a structured data block in the PLC for all HMI data. This keeps the data organized and makes it easier to update the HMI when the PLC program changes.
The method for printing depends on the HMI platform and the printer type. There are two common approaches. The first approach uses the HMI’s built-in printing capability. WinCC Comfort and Advanced panels can print reports directly to a connected printer. The print job is configured in the “Report Designer” within TIA Portal. You create a report layout, define the data sources, and then create a print job that links the layout to a printer. The print job can be triggered by a button on the HMI screen. The second approach uses a communication module on the PLC. If the HMI does not support printing, or if the printer needs to receive data directly from the PLC, a CP 340 or CP 341 module is used. The PLC program sends data to the module using the ASCII driver, and the module transmits the characters to the printer via RS232. The table below compares these two approaches.
| Approach | Hardware required | Configuration location | Best for |
| HMI direct printing | HMI with USB/Ethernet port | WinCC Report Designer | Simple reports, operator-triggered |
| PLC communication module | CP 340/341 module | PLC program + module parameters | Continuous data logging, custom formats |
Yueyang Tongtu E-commerce Co., Ltd. supplies both HMI panels with direct printing capability and CP 340/341 communication modules for PLC-based printing. Our factory can provide the configuration files and sample programs for both approaches.
The most common issue is that the HMI connection is created, but the variables do not update. This is usually caused by a mismatch in the access point settings. The HMI connection uses an access point (typically S7ONLINE), and the PG/PC interface on the engineering station must be set to the same access point. Another common issue is that the printer prints garbled characters. This is caused by a mismatch in the character encoding or the baud rate between the PLC and the printer. The ASCII driver parameters must match the printer’s settings exactly: baud rate, data bits, parity, and stop bits. A third issue is that the print job does not trigger. This is usually caused by the trigger variable not being set correctly, or the print job not being linked to the correct button event. In our factory, we recommend testing the print function with a simple text output before adding complex report layouts.
Integrating a Siemens PLC with an HMI and printer involves three steps: establishing the physical network connection, creating the logical HMI connection and mapping variables, and configuring the print job. The HMI connection is created in the “Devices & Networks” editor and uses PROFINET or Ethernet. Variables are mapped from the PLC to the HMI variable table and then linked to display objects. Printing can be done directly from the HMI or through a PLC communication module. The most common issues are access point mismatches and baud rate mismatches, both of which are resolved by verifying the configuration parameters. Yueyang Tongtu E-commerce Co., Ltd. supplies Siemens PLC, HMI, and communication modules for these integration projects.
Yueyang Tongtu E-commerce Co., Ltd. provides Siemens automation components including PLCs, HMI panels, and CP 340/341 communication modules. We offer technical support for connection configuration and sample programs.