Troubleshooting
Why a PLC CHAR tag will not show as text in an HMI I/O field
Short answer
A PLC Char tag appears as a letter in an HMI I/O field only when that field offers a string representation for the tag. When the format list shows only Decimal, Hexadecimal and Binary, declare a one-character String on the PLC or copy the Char into an HMI internal string tag with a change-triggered script, then test the field at startup.

On this page
- Why does my CHAR tag only offer Decimal, Hexadecimal and Binary formats?
- What is the difference between CHAR and STRING in the PLC?
- Why can't I select my tag when String is in the format list?
- How do I show the character with a one-character STRING?
- How do I copy a CHAR into an HMI internal string tag with a script?
- Will WCHAR or WSTRING display the character correctly?
- How do I test the field at startup and after a change?
- Which fix should I choose?
- Questions asked
A PLC Char tag shows in an HMI I/O field as a letter only when that field offers a string representation for the tag. When the format list offers nothing but the three numeric formats, the field is rendering your character as a number, and no format choice converts it to text. Two fixes work: declare the variable as a one-character String on the PLC, or keep the Char and copy it into an HMI internal string tag with a script that runs when the Char changes. This article gives the diagnosis, both fixes with their steps, and the bench test that proves the field works from startup rather than from the first change.
Why does my CHAR tag only offer Decimal, Hexadecimal and Binary formats? #
Because the I/O field is applying a numeric representation to your tag: a Char is stored as one 8-bit byte, and the Decimal, Hexadecimal and Binary formats render that byte as a number, so a letter appears as a code instead of a character. Selecting a different numeric format changes only the base, never the kind of value the field shows.
Take the letter A as the character in your tag. Its code is 65 decimal. Switch the field to Hexadecimal and it shows 41, because 65 = 4 × 16 + 1. Switch to Binary and it shows 0100 0001, because 65 = 64 + 1. The field is not converting your character; it is showing the storage byte in whichever base you picked, and a correct code there actually confirms the tag and its connection are healthy.
The gap between a stored value and the representation chosen for it is the same distinction explained for data representation versus transmission of hexadecimal in industrial protocols, and it is why the display side needs a string type, not another base.
What is the difference between CHAR and STRING in the PLC? #
Char is an 8-bit single character, while String is a variable-length string of up to 254 characters, and a String declared with length 1 is still a string to the HMI, which is exactly what the field's text representation expects. These are the documented definitions for an S7-1200 CPU: the Char carries one character in a single byte, and the String carries its characters together with a character count, so a one-character String occupies more than one byte in the data block.
That extra count is not overhead you fight; it is what makes the value acceptable to a text field. The HMI sees a string type, routes the content to the text renderer, and prints the character. A Char never enters that path, because to the field it is one byte without the string type attached.
Why can't I select my tag when String is in the format list? #
Because the format list and the tag type are two separate checks: the String entry proves the field can render text, but the field still refuses any tag whose PLC type is not a string, so your Char tag cannot be picked. The drop-down lists what the field can do; the tag filter lists what it will accept, and your tag fails the second test.
Use what you see as the diagnostic:
| What you see | What it means | What to do |
|---|---|---|
| Only the three numeric formats in the list | The field is bound to a numeric representation of the tag | Change the tag's type to a string, or display an internal string tag instead |
| String is listed but your Char tag is refused | The field renders text but rejects non-string tags | Declare the PLC variable as String[1], or copy to an internal string tag |
| The character appears as a plain number | The field is formatting the Char's byte in a numeric base | A format change alone will not fix it; apply one of the two fixes |
| A wide type shows a wrong glyph | WCHAR or WSTRING rendering mismatch on that runtime | Fall back to String[1] and repeat the glyph test |
The mirror image of this fault, a numeric field that corrupts a PLC write because the tag's type does not match its content, is the case in why an HMI writes the wrong PLC value above 9.
How do I show the character with a one-character STRING? #
Declare the variable in the PLC as String[1], update the HMI tag so its type follows the new declaration, and bind the I/O field to that tag with the String format: the field then shows the character directly, with no script. This is the cleanest fix, because the conversion happens once at the declaration and nothing has to run at runtime.
- Change the declaration from Char to
String[1]in the PLC block and recompile. - Download the changed block to the CPU.
- Update or re-import the HMI tag so its data type matches the new declaration.
- Assign the tag to the I/O field and select the String format.
- Run the startup and change checks from the test section below.
Before you change the declaration, walk through every use of the variable: assignments, comparisons, any communication that moves it, and every other panel that references it. Logic written for a Char does not automatically accept a String, and this is the one step of the fix that can break something that was working.
How do I copy a CHAR into an HMI internal string tag with a script? #
Create an internal tag of type String in the HMI project, attach a script to the Char tag's value-change event that writes the character into the internal tag, and point the I/O field at the internal tag; the PLC declaration stays untouched. The event and script mechanics differ between engineering tools, so use the value-change event your tool offers for tags, and keep the script to a single copy of the character.
- Create the internal tag with type String in the HMI tag table.
- Attach the copy script to the Char tag's value-change event; the script reads the Char and writes it to the internal tag.
- Bind the I/O field to the internal tag with the String format.
The startup trap is the reason this method fails on site: a change-triggered script runs only on a transition, and at power-up there is no transition. The internal tag holds its initial value and the field stays blank until the first change. Add an initial copy, an assignment that runs when the screen loads or the runtime starts, and the field is correct from the first frame.
If the tag browser offers only V-memory addresses where you expected PLC string tags, that listing problem is the one handled in HMI shows only V-memory for PLC string tags.
Will WCHAR or WSTRING display the character correctly? #
Not as a first choice: wide-character types are a separate compatibility question, incorrect rendering of WCHAR and WSTRING values has been reported in exactly this configuration, and a length-1 WSTRING is a test case rather than a documented fix. A report of one runtime showing a character, next to a report of wide types showing wrong glyphs, is a symptom to test, not a compatibility result you can build on.
The decision: use String[1] for the fix. Allow a wide type only when your own test on the target panel shows every character your application uses as the intended glyph, and be ready to fall back when it does not.
How do I test the field at startup and after a change? #
Run three checks on the target panel: the field must show a known printable character at startup before any change occurs, it must follow a change made while the runtime is running, and it must render every character your application uses as the intended glyph. Do them on the bench with a test tag, not on the running machine.
- Startup: put a known character in the tag before the panel boots; the field must show it immediately. This check catches the missing initial copy in the script method.
- Change: write a different character online and confirm the field follows at the panel's normal update rate; with the copy method, watch the internal tag to tell a script miss from a field problem.
- Glyphs: cycle through the whole set of characters the application uses; each must appear as the intended glyph, never as a code, a blank or a substituted symbol.
- Recovery: drop and restore the PLC connection; after reconnect the field must return to the live character without waiting for a fresh change.
Which fix should I choose? #
Choose the PLC-side String[1] when you can change the declaration without breaking other logic, and choose the internal-tag copy when the Char must stay; in both cases the field is done only when it passes the startup test. Nothing else decides it: the format drop-down cannot help, and wide types stay out until they pass the glyph test on your panel.
| Your situation | Fix | Why |
|---|---|---|
| You own the PLC block and nothing else reads the variable as a Char | Declare String[1], update the HMI tag, bind the field with the String format |
One tag, no script, no startup trap |
| Other code, communications or panels use the variable as a Char | Internal string tag plus the change-triggered copy and a startup copy | The PLC stays as it is; all conversion lives in the panel |
| Only a wide type seems accepted on your runtime | Test every glyph on the target panel; otherwise fall back to String[1] |
Wide-type rendering is reported as unreliable in this configuration |
Questions asked
Is the number in a Decimal-formatted field the code of my character?
Yes. A Char shown in Decimal displays the code of the stored character, and the other numeric formats show the same code in other bases. That is why switching between those formats never produces a letter: they are all views of the same byte, and only a string-type tag reaches the field's text renderer.
Does a one-character STRING take more PLC memory than a CHAR?
Yes. A Char holds one 8-bit character, while a String also carries its character count alongside the characters, so the String occupies more than one byte in the data block. For one displayed character that difference is negligible in a modern CPU, and it is the price of a type the HMI text field accepts.
Is the output format configured the same way in WinCC Unified?
No. WinCC Unified builds the output format from formatting codes that act as placeholders for groups of characters, so text display is configured through those codes rather than through the format list of the classic I/O field. The type rule is unchanged: the tag itself must still be a string before the field renders it as text.
Does the same fix work for a longer text value?
Yes. The rule is about type, not length: any string tag the panel accepts renders in a field with the String format, and the Char case is only special because one byte arrives without the string type. Declare the length you need; on an S7-1200 CPU a String holds up to 254 characters.


