TIA Portal String and CHAR Tutorial Part 1: PLC and HMI Example

TIA Portal String and CHAR
TIA Portal String and CHAR

Handling text in a PLC project is something many engineers come across sooner or later. Whether you want to display names, process IDs, product codes, timestamps, messages, or operator input, understanding how STRING, WSTRING, and CHAR work in Siemens TIA Portal is essential.

In this tutorial, I start a practical example based on a PLC and HMI database-style setup to show how string data can be used in a real automation project. Instead of keeping it purely theoretical, this example focuses on how string handling can actually be tested and visualised through the HMI.

Why string handling matters in PLC programming

A lot of PLC programming revolves around integers, timers, counters, and Boolean logic. But in real industrial systems, text data also plays an important role. You may need to:

  • store names or descriptions
  • search inside a text value
  • display messages on an HMI
  • manipulate parts of a string
  • build operator-friendly interfaces
  • prepare data for recipes, databases, or reports

That is where TIA Portal string instructions become useful.

What is covered in Part 1

This first part focuses on the foundation of string handling in Siemens PLCs. The video introduces the core data types used for text processing and shows how they fit into a practical project.

Topics covered include:

  • the difference between STRING, WSTRING, and CHAR
  • how text is stored in TIA Portal
  • how to structure a simple PLC/HMI example around text data
  • how to prepare for advanced string operations inside the program
  • how to test the results through WinCC Unified runtime

This makes the tutorial useful both for beginners and for engineers who want a cleaner way to handle text in HMI-driven applications.

STRING, WSTRING and CHAR in TIA Portal

Before using any advanced instruction, it is important to understand the text-related data types available in Siemens PLC programming.

STRING

A STRING is used to hold a sequence of standard characters. It is the most common option when working with text values in a PLC program.

WSTRING

A WSTRING is designed for wider character support and is useful when Unicode handling is needed.

CHAR

A CHAR stores a single character only. This is useful when you want to work with text one character at a time or build logic around individual symbols.

Understanding the difference between these types helps prevent mistakes later, especially when passing values between PLC logic and HMI objects.

Building a practical PLC/HMI example

Rather than just listing instructions, this project uses a more practical approach. The tutorial builds a simple database-style example where text values can be entered, processed, and displayed.

This is a smart way to learn string handling because it mirrors the type of structure often used in real machines and industrial applications. The HMI side makes it much easier to test the behaviour of the logic and immediately see what each instruction is doing.

Testing string instructions with WinCC Unified

One of the strong points of this example is that the logic is not left hidden inside the PLC code. The project is connected to an HMI runtime so the results of the string operations can be viewed directly.

That makes it easier to understand:

  • what the input string contains
  • what the instruction changes
  • what the final output looks like
  • how an operator might interact with these functions in a real application

For training purposes, this is much better than only watching code in a function block.

Why this tutorial is useful

Many engineers avoid string handling because it looks less familiar than standard PLC instructions. But once you understand the basics, it becomes a very practical tool for HMI design, diagnostics, text formatting, and data presentation.

This tutorial helps bridge that gap by showing the topic in a visual, hands-on way using Siemens tools that many automation engineers already work with.

Final thoughts

If you are learning Siemens PLC programming, string handling is worth understanding properly. It gives you more flexibility in HMI design, message handling, user input, and structured data processing.

This first part lays the groundwork by explaining the main text data types and building a practical PLC/HMI example in TIA Portal. In the next part, the more advanced string instructions can be explored in even greater detail.

If you are working with S7-1200, S7-1500, or WinCC Unified, this is a useful topic to add to your Siemens programming toolbox.

By admin

Related Post

Leave a Reply