MP370 IF2 Serial Port Printing: Setup and Corruption Resolution

David Krause15 min read
HMI / SCADASiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview of MP370 IF2 Serial Printing

The Siemens Multi Panel 370 (MP370) is a 10/12/15 inch HMI from the WinCC flexible / ProTool era. The panel exposes two physical serial interfaces: IF1 (RS232 only, reserved for engineering and project transfer) and IF2 (RS232/RS422/RS485, used for runtime communication). When a field technician connects an ASCII serial printer directly to the panel, the IF2 port is the only practical destination because IF1 baud rate and protocol are fixed for ES transfer and are not available to runtime scripts.

Reports from commissioning engineers describe a recurring symptom: data sent from HyperTerminal on a PC to the same physical printer prints correctly, but identical data sent from a WinCC flexible runtime script on the MP370 arrives with corrupted characters. The error is rarely a hardware defect and is almost always traceable to one of four layers: port parameters, protocol driver, flow control, or string encoding. This reference walks through each layer and documents the field-verified corrections.

Engineering note: The MP370 family is in the active phase-out lifecycle. WinCC flexible was the configuration environment (versions 2004 through 2008 SP5). Project compatibility continues through the WinCC Comfort / TIA Portal migration path for successor panels, but the IF2 behavior described here is specific to the MP370 and its firmware images.

Hardware Architecture, Connectors, and Pinout

The MP370 ships in three display sizes (10"/12"/15"). The IF2 connector type and electrical standard depend on the ordered MLFB (catalog number). The most common configurations are:

MP370 IF2 Hardware Reference
Model (typical MLFB) Display IF2 Connector Electrical Standard
MP370-10 Touch 10.4" Sub-D 9-pin male RS232 / RS422 / RS485 (software selected)
MP370-12 Touch 12.1" Sub-D 25-pin male RS232 / RS422 / RS485
MP370-15 Touch 15.1" Sub-D 25-pin male

Always verify the exact MLFB on the rating label on the back of the unit before terminating the cable. Mixing RS422/485 and RS232 pinouts on a custom cable is the single most common cause of "all characters wrong" symptoms because the differential pair is being driven by a single-ended transmitter.

RS232 Pinout (Sub-D 9-pin) Used in Production

IF2 RS232 Pinout (typical, verify against rating label)
Pin Signal Direction (Panel) Printer DB-9
2 RXD Input 3 (TXD)
3 TXD Output 2 (RXD)
4 DTR Output 6 + 8 (DSR + CTS tied)
5 Signal GND — 5
6 DSR Input 4 (DTR)
7 RTS Output 8 (CTS)
8 CTS Input 7 (RTS)

A null-modem (crossover) cable is mandatory for panel-to-printer connections because both ends are DTE. Do not use a straight-through "modem" cable, even if the connector fits; RTS/CTS will be looped back to the panel's own transmitter and characters will be discarded silently or corrupted.

WinCC Flexible Port Configuration

All serial port parameters on the MP370 are set at compile time in WinCC flexible under Project → Device Settings → Interfaces. There is no runtime API to change baud rate, parity, data bits, or stop bits from VBScript. This is the fundamental reason that "characters go wrong only from a script" complaints arise: the script cannot accidentally change parameters, but it can change the data stream, the active connection, or the protocol driver interpretation.

Parameter Mapping for IF2

IF2 Serial Port Parameter Reference
Parameter Typical Value for ASCII Printer Notes
Baud rate 9600 or 19200 Match the printer's DIP switch / menu setting exactly
Data bits 8 7 only for legacy 7-bit ASCII / industrial protocols
Parity None Many thermal printers default to None; some to Even
Stop bits 1 Use 2 only if the printer explicitly requires it
Flow control RTS/CTS or XON/XOFF Never select "None" on a thermal printer with a 16-byte buffer
Protocol None (raw ASCII) or "Printer" PPI / MPI / PROFIBUS will interpret the data as PLC telegrams
Critical: If the protocol field is set to SIMATIC S7 PPI / MPI / PROFIBUS-DP, the MP370's IF2 driver will frame every outgoing byte sequence as a PLC telegram. The printer will see control characters interleaved with the printable data, producing the "every character wrong" symptom described in field reports. For pure ASCII printing, the protocol selection must be a printer or a raw channel.

Verifying the Active Protocol

Open the WinCC flexible project, navigate to the MP370 device node, open the Connections editor, and confirm the IF2 connection is configured for the printer, not for a PLC. When the panel is in transfer mode, the project on the panel is the source of truth; recompile and re-transfer the project after any change. There is no on-panel menu in the MP370 Control Panel to override protocol parameters at runtime.

Standard Print Functions: PrintReport and Hardcopy

WinCC flexible exposes several print functions that internally drive the IF2 port when a serial printer is configured. These are the supported paths for runtime output and are far more reliable than writing a VBScript that opens the port directly.

PrintReport

PrintReport outputs the report currently displayed in the report area of the active screen. It is the recommended path for printing a structured, paginated document. The function honors the report layout defined in the project and inserts page breaks, headers, and footers as configured. In VBScript under WinCC flexible Runtime:

' Switch to the report screen and trigger the print
HMIRuntime.ActiveScreen = "Report_ProductionLog"
HMIRuntime.PrintReport

Hardcopy

HMIRuntime.Hardcopy prints a raster screenshot of the current screen. The MP370 rasterizes the active screen at the panel's internal pixel resolution and streams it to the configured printer. For dot-matrix or thermal line printers this function is generally unsupported; use it only with PCL or PostScript-compatible printers.

Print Alarm Buffer

For alarm log printing, configure the alarm log destination to the serial printer under Logs → Alarm Log → Properties → Printer. WinCC flexible will then call PrintAlarm on demand or on a schedule. No VBScript is required.

Recommendation: When the application needs to print only a short string (for example, a barcode label, a job ID, or a counter reading), use a report template with a single field bound to a tag, and call PrintReport. This avoids the encoding issues of a hand-written VBScript stream.

VBScript String Output to IF2

The MP370 runtime does not expose the IF2 UART as a generic stream object. Attempting to instantiate an MSComm control or similar COM object inside the runtime sandbox fails silently because WinCC flexible runtime does not register those type libraries. Scripted output is limited to the WinCC flexible object model, which means PrintReport, Hardcopy, and the related report functions are the only legitimate paths.

If a custom VBScript appears to be "sending" data to the printer and characters are wrong, the most common explanation is that the script is writing to a tag, opening a screen, and the screen's print-event is firing with the wrong tag value. Walk the chain:

  1. Identify the event the script triggers (button press, value change, schedule).
  2. Trace which function the script calls (PrintReport, Hardcopy, Trace, tag write).
  3. Confirm the data source feeding the print function.
  4. Confirm the printer driver and protocol assigned to IF2 in the project.
' Typical WinCC flexible VBScript that triggers a printer output
Sub PrintJobID(JobID)
    SmartTags("PrintBuffer") = JobID           ' Tag bound to a report field
    HMIRuntime.ActiveScreen = "Screen_Print"   ' Forces evaluation of the screen
    HMIRuntime.PrintReport                    ' Renders report, streams to IF2
End Sub

If HyperTerminal prints the same string correctly and the runtime does not, the runtime path is writing additional framing bytes, escaping the data, or triggering a different report template. Capture the bytes with a serial line analyzer (Saleae, Total Phase Beagle, or a USB-RS232 dongle in monitor mode) to confirm. The data on the wire from runtime should be byte-for-byte identical to the data from HyperTerminal after the link is up and stable.

Character Corruption: Root Cause Analysis

Five root causes account for the overwhelming majority of "all characters wrong" or "first character wrong" symptoms in the field. Diagnose in the order listed because each subsequent cause assumes the prior ones are correct.

Corruption Symptom → Cause Matrix
Symptom Likely Root Cause Verification Fix
All characters replaced by garbage Protocol driver selected (PPI/MPI/DP) is framing the stream as PLC telegrams Inspect project, capture wire with analyzer Set protocol to Printer / raw; recompile
All characters wrong, repeatable pattern Baud rate mismatch (e.g., 19200 vs 9600) Loopback test at known rate Match WinCC flexible setting to printer DIP/menu
All characters wrong, intermittent Parity or stop-bit mismatch Compare printer datasheet to project Match parity (None/Even/Odd) and stop bits
First 1–3 characters wrong, rest correct Flow control not asserted before first byte (XON/XOFF race) or printer is in slow-start mode Enable RTS/CTS, set DTR high in project Switch to RTS/CTS or add a small inter-byte delay
Characters correct but line breaks / form feeds missing Printer expects CR+LF, panel sends LF only (or vice versa) Inspect output with terminal emulator Set translation in the printer driver, or change the report template's line termination
Characters correct in ASCII, German umlauts corrupted Code page mismatch (Latin-1 vs CP437 vs UTF-8) Verify printer code page, verify tag string source Match code page in printer menu to project

Layer 1 — Protocol Driver Mismatch

WinCC flexible uses the protocol selection to decide whether to escape, frame, or check outgoing data. Selecting SIMATIC S7 PPI, MPI, or PROFIBUS-DP on IF2 will cause the runtime to wrap every byte sequence in an SD1/SD2/SD3 telegram header. The printer sees 0x10 0x02 ... 0x10 0x03 wrapping around the printable string and discards most of it. This is the highest-priority check and should be ruled out before any cable or parameter work.

Layer 2 — Baud Rate, Data Bits, Parity, Stop Bits

These are the four classic UART parameters. A baud rate mismatch produces consistent character corruption that looks random but is deterministic. The classic check: if HyperTerminal works at 9600 and the project is set to 19200, every character the panel sends will be off by a factor of two. Set the project to 9600, recompile, transfer, and re-test.

Layer 3 — Flow Control

Thermal printers typically have a small input buffer (16–256 bytes). Without hardware flow control, the MP370 will stream the entire report at full speed. The printer's UART will drop characters past its buffer. Symptoms are missing characters or extra garbage at the end of a page. Enable RTS/CTS in the project, wire the cable to loop RTS to CTS on the panel side and DTR to DSR/CTS on the printer side, and the corruption disappears.

Layer 4 — Encoding / Code Page

If the source data is a string tag populated from a PLC of PC and contains non-ASCII characters (German umlauts, French accents, Cyrillic, or box-drawing characters), the printer will print garbage even with all UART parameters correct. The string source, the WinCC flexible project's default code page, and the printer's configured code page must all agree. For pure ASCII applications, force the tag to ASCII 0x20–0x7E only.

Layer 5 — Line Termination

Some printers ignore LF (0x0A) and require CR+LF (0x0D 0x0A). Others perform a CR-to-CRLF translation by default and double-space when the application also sends CR+LF. WinCC flexible does not expose a per-line termination control, so the fix is on the printer side (set "Auto CR" or "CR translation" in the printer's menu) or in the report template's line break style.

Cable Construction and Flow Control Wiring

For a DTE-to-DTE panel-to-printer connection (which is the only topology the MP370 IF2 supports with a printer), the cable must be a null-modem. The minimum viable null-modem is the 2/3 crossover plus signal ground. The full RTS/CTS null-modem is recommended for thermal printers.

MP370 IF2 (DTE)               Printer (DTE)
DB-9 pin    Signal            DB-9 pin
2 RXD  <--------------------  3 TXD
3 TXD  -------------------->  2 RXD
4 DTR  -------------------->  6 DSR
5 GND  ---------------------  5 GND
6 DSR  <--------------------  4 DTR
7 RTS  -------------------->  8 CTS
8 CTS  <--------------------  7 RTS

Industrial serial printers (Epson TM-T88, Star TSP, Citizen CL-S) ship with female DB-9 or DB-25 connectors. Always check the printer's data sheet for the exact pin numbering; some models label RXD/TXD from the printer's perspective (making the printer a DTE) while others ship as DCE.

Common field failure: A cable is built that crosses TXD/RXD but does not cross RTS/CTS, and the printer is left with flow control disabled. Characters print correctly for short reports and corrupt for long ones. Symptom is intermittent. The fix is to enable hardware flow control on the printer (typically a DIP switch or a configuration command) and to wire RTS to CTS on the printer end.

Verification Procedure

Follow this procedure in order. Stop at the first passing step; the root cause has been isolated.

  1. Verify the protocol selection. In WinCC flexible, confirm IF2 is configured for a printer driver or raw channel, not a PLC protocol.
  2. Verify UART parameters. Confirm baud, data bits, parity, stop bits on the project match the printer's DIP switch or menu configuration exactly.
  3. Verify the cable with a loopback. Short pins 2-3 on the panel end, send a test string from HyperTerminal on a PC connected to the printer end, and confirm the printer echoes correctly. Then reverse the test.
  4. Capture the wire. Insert a serial analyzer between the panel and the printer. Trigger a script that prints a known string (e.g., ABCDEFGH). Compare the captured bytes to the bytes captured from HyperTerminal sending the same string.
  5. Verify the report template. If the captured bytes are identical and the printer still prints garbage, the report template is binding a different tag than expected. Inspect the screen's report area in WinCC flexible ES.
  6. Verify the code page. Force the tag to a known ASCII string (e.g., TEST 1234). If this prints correctly, the issue is encoding. Trace the string source.
  7. Verify flow control. Print a long report (full screen of 50+ lines) and inspect for dropped characters at the bottom. If present, enable RTS/CTS on the printer and confirm the cable.

Firmware, Lifecycle, and Migration Notes

The MP370 was programmed with WinCC flexible 2004, 2005, 2007, and 2008 SP1–SP5. Project transfer over IF1 uses PPI/MPI at 187.5 kbaud or 115.2 kbaud. Once a project is compiled, the IF2 port's runtime parameters are baked into the panel's firmware image and cannot be changed without re-transferring the project.

For new installations, Siemens has migrated the MP370 footprint to the SIMATIC Comfort Panels (TP700 Comfort, TP900 Comfort, TP1200 Comfort, TP1500 Comfort, TP1900 Comfort, TP2200 Comfort). Comfort Panels are configured in TIA Portal and expose the same print functions (PrintReport, Hardcopy) under the same names. The serial port topology is different: Comfort Panels expose a single RS422/RS485 combo port labeled X10, plus USB and PROFINET. For an exact drop-in replacement with the same IF2 RS232 behavior, use the TP1500 Comfort with the RS232 adapter module or select a panel with native RS232.

For projects that must continue running on existing MP370 hardware, the firmware image on the panel must match the project version. Mismatched WinCC flexible versions (e.g., project compiled in 2008 SP1 installed on a panel running 2004 firmware) are an additional source of runtime instability that can manifest as intermittent print failures.

Field Commissioning Checklist

MP370 IF2 Serial Printing Commissioning Checklist
Step Check Pass Criteria
1 MLFB on rating label matches the cable pinout Pinout table above matches the wiring diagram
2 IF2 protocol set to Printer / raw (not PPI/MPI/DP) Connection editor confirms
3 UART parameters match printer DIP/menu Baud, data, parity, stop identical
4 Null-modem cable with RTS/CTS crossover Continuity check on all 7 signals
5 Hardware flow control enabled on printer Printer configuration menu confirms
6 Code page agreement (project, tag source, printer) Test ASCII string prints correctly
7 Report template binds to the intended tag PrintReport outputs the expected value
8 Long-report test (50+ lines) passes No dropped characters, correct pagination
9 Firmware on panel matches project version WinCC flexible → OS Update confirms
10 Power cycle test (3 cycles) Print function works on cold start

Why do characters print correctly from HyperTerminal on a PC but come out corrupted from a script on the MP370?

HyperTerminal writes raw bytes to the COM port with the parameters you set in its UI. The MP370 runtime does not expose IF2 as a raw COM port; it uses a printer or protocol driver selected in WinCC flexible. If the project has IF2 configured for a PLC protocol such as PPI, MPI, or PROFIBUS-DP, every byte the script sends is framed as a PLC telegram and the printer sees only garbage. Open the project's connection editor, set IF2 to a printer or raw channel, recompile, and re-transfer.

Can the MP370 IF2 port be reconfigured from a runtime VBScript?

No. WinCC flexible does not expose a runtime API to change baud rate, parity, data bits, stop bits, or protocol on IF2. All serial port parameters are set at compile time and baked into the project image. Runtime scripts can only trigger built-in functions such as PrintReport, Hardcopy, and PrintAlarm. To change parameters you must edit the project in WinCC flexible, recompile, and re-transfer it to the panel.

What is the difference between PrintReport and Hardcopy on the MP370?

PrintReport outputs the structured report template currently displayed in the report area of the active screen, including headers, footers, and page breaks. Hardcopy outputs a raster screenshot of the current screen content. PrintReport is supported on most serial printers including thermal and dot-matrix; Hardcopy requires a PCL or PostScript-compatible printer and is generally not usable with low-cost thermal line printers.

Only the first one to three characters of every printout are wrong, the rest are correct. What is the cause?

This is the classic XON/XOFF race or slow-start symptom. The printer is asserting flow control but the panel has not yet received the XON character (or the RTS handshake is still being established) when it sends the first bytes. Switch to hardware flow control (RTS/CTS) and confirm the cable wires RTS to CTS on the printer side. Adding a 50–100 ms inter-byte delay in the report template is an alternative workaround when the printer cannot be reconfigured.

How do I migrate an MP370 printing project to a current Siemens Comfort Panel?

Open the original WinCC flexible project and use the TIA Portal migrator under "Project → Migrate to TIA Portal". The function names (PrintReport, Hardcopy) are preserved. Be aware that Comfort Panels expose a single RS422/RS485 port (X10) plus USB and PROFINET; for a true RS232 drop-in, add the RS232 adapter module or use a panel with native RS232. Re-validate the printer driver selection in TIA Portal because the default protocol options differ between WinCC flexible and TIA Portal.

Back to blog