Adding PLC Alarm Text on SINUMERIK 840Dsl HMI: TS-QM Conversion Fix
This procedure documents how to surface a user-defined PLC alarm text (for example A620070) on a SINUMERIK 840Dsl HMI when the standard Setup menu, the Commissioning Manual workflow, and the Access MyMachine / P2P route all leave the alarm visible only by number. The hardware configuration referenced is OP015A operator panel + TCU30.3 thin client unit + PCU50.5 industrial PC running SINUMERIK Operate. The root cause is a Qt translation chain failure between the editable .ts source file and the compiled .qm binary that the HMI runtime actually loads. The complete fix is to validate the .ts XML, then delete the corresponding .qm so the translation service regenerates the binary on the next HMI boot.
Problem Statement
On a SINUMERIK 840Dsl grinding machine with the configuration OP015A + TCU30.3 + PCU50.5, a PLC input trigger raises alarm number A620070 in the HMI alarm line but the descriptive text never appears. The integrator attempted three documented approaches from the SINUMERIK 840Dsl Commissioning Manual and the Operate help system:
- Editing the alarm text from
Setup > HMI > alarmtext. Only the entryUserdef_Ka_nccontains the manufacturer-supplied NC alarm text. The other three entries (oem_alarms_plc,oem_alarms_cycles,oem_partprogram_messages) are empty placeholders. Adding a row inoem_alarms_plcand rebooting did not change the runtime display. - Manually editing the Qt Linguist source files
kapp_alarms_chs.tsandkapp_alarms_eng.tsdirectly inC:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lngand rebooting. No text appeared. - Connecting through Access MyMachine / P2P. The remote project view only exposed the OEM file path. The user path remained inaccessible and the PLC DB2 interface was not used by the machine builder, so this route did not produce a deployable change.
.qm files, not the editable .ts sources. The .ts edits are syntactically rejected (a literal carriage return inside the <translation> tag breaks Qt's XML parser) and the stale .qm is not regenerated.SINUMERIK 840Dsl Alarm Number Format
The six-digit alarm number that appears on the HMI is structured. The first digit identifies the alarm source per the SINUMERIK 840Dsl alarm system:
| First digit | Source | Origin |
|---|---|---|
| 1 | NCK alarms | NC kernel internal |
| 2 | NCK alarms (extended range) | NC kernel internal |
| 3 | Drive alarms | Sinamics / drive objects |
| 4 | HMI / Operate alarms | HMI software |
| 5 | PLC alarms from DB2 | SINUMERIK PLC interface |
| 6 | PLC user alarms | User PLC program |
| 7 - 8 | Reserved | Reserved range |
| 9 | HMI / system alarms | HMI software |
An alarm number beginning with 6 originates from the user PLC program. The second digit encodes the clearance behaviour: 0 = clearable by Cancel, 1 = clearable only with NCK reset, 8 = self-clearing on condition fall. Digits 3 - 6 are the integrator-assigned alarm ID. The full number 620070 therefore parses as: user-PLC alarm, normal clearance, ID 20070. Siemens does not ship default text for user-defined PLC alarms; the text is the integrator's responsibility.
HMI Component Roles (OP015A + TCU30.3 + PCU50.5)
Locating the correct file path requires understanding the SINUMERIK 840Dsl HMI hardware layout:
| Component | Role | File system role |
|---|---|---|
| PCU50.5 (PCU 50.5) | Industrial PC hosting the SINUMERIK Operate runtime | Owner of C:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng\. Runs the .ts → .qm conversion at boot. |
| TCU30.3 (TCU 30.3) | Thin client unit connecting to the PCU over Ethernet | Holds no alarm text files in default thin-client mode. Renders the pages delivered by the PCU. |
| OP015A | 15-inch TFT operator panel with touch + hard keys | Display and input only. No local file system. |
When the PLC toggles the input that triggers A620070, the PLC writes the alarm number to the PLC/NCK interface. The NCK forwards the alarm to the HMI software running on the PCU. The HMI looks up the alarm number in the compiled .qm for the active language. If no text matches, the alarm row shows only the number.
Why the Three Common Methods Fail
Method 1 - Setup > HMI > alarmtext
The Setup > HMI > alarmtext menu exposes the four built-in OEM alarm files (oem_alarms_plc, oem_alarms_cycles, oem_partprogram_messages, Userdef_Ka_nc). The fourth file is pre-populated with the machine builder's NC alarm text. The first three are intentionally empty. Adding a text in oem_alarms_plc from the menu writes to a parallel OEM path that the runtime does not consult for the active alarm list. The change is also not always persisted to the user .ts source, so the next reboot loses the entry.
Method 2 - Direct .ts File Edit
The .ts file is the Qt Linguist source format (XML). It is the editable source. SINUMERIK Operate does not load .ts files at runtime. The runtime loads only the compiled .qm binary. If a .qm with a newer timestamp than the .ts exists in the same directory, the conversion service skips the .ts entirely. The diagnostic test is simple: compare file timestamps. If the .qm modified time does not change after a reboot following a .ts edit, the runtime did not recompile.
Method 3 - Access MyMachine / P2P
Access MyMachine allows remote access to the PCU file system. The P2P project view shows only the OEM file path. The user scope (user\sinumerik\hmi\lng) is hidden. Edits made through P2P land in the OEM scope, not in the user scope that the active HMI session reads. This route therefore cannot add a user PLC alarm text to the live alarm system without an additional copy step.
The .ts to .qm Conversion Process
SINUMERIK Operate uses the Qt translation framework. The conversion chain is:
- The
.tssource (XML, editable) is stored in the userlngdirectory. - On HMI boot, the translation service checks each
.tsagainst its companion.qm. - If a
.tsis newer than its.qm, the.qmis recompiled from the.ts. - If a
.qmis missing entirely, a new.qmis generated from the.ts. - If the
.qmtimestamp is more recent than the.ts, the existing.qmis used unchanged. - The runtime loads the
.qminto memory; subsequent edits to the.tshave no effect until the next recompile.
The critical detail: SINUMERIK will not overwrite a .qm that already exists with a newer timestamp than its source .ts. This is the behaviour observed in the original problem report - the .ts file was edited, the .qm should have been older, but the .qm was not regenerated because of a second issue: a literal CR/LF inside the <translation> tag made the .ts XML invalid, so the parser rejected the file before conversion could begin.
Root Cause: Stale .qm Binary Files
The original post identified two distinct failure modes that are easy to confuse:
| Failure | Symptom | Detection |
|---|---|---|
XML syntax error in .ts
|
.ts saved, but .qm timestamp does not change on reboot |
Open .ts in Qt Linguist - parser reports a line/column error. A literal line break inside <translation> is the most common cause. |
Stale .qm with newer timestamp |
.ts valid, but .qm timestamp is more recent than the .ts
|
Compare Modified timestamps. If .qm > .ts, the runtime uses the existing binary and ignores the new source. |
The fix for both is identical: delete the .qm file. The next HMI boot will detect the missing .qm, parse the .ts from scratch, and generate a fresh .qm. The conversion runs during HMI initialisation; on the next alarm event, the descriptive text appears.
Step-by-Step Procedure
Prerequisites
- Service-level access to the SINUMERIK 840Dsl HMI (keyswitch position 3, or service login:
service/SINUMERIK, or the machine-specific service password). - Network access to the PCU50.5 (RDP, VNC, or local keyboard/mouse) OR direct access to the PCU file system.
- Knowledge of the six-digit alarm number to add (for example
620070). - Backup of the active CFG image before any file edit.
- Text editor that preserves encoding and line endings correctly: Notepad++, VS Code, UltraEdit. Do not use Windows Notepad, which can introduce CRLF and BOM issues.
Procedure
- Switch to Service mode. Turn the keyswitch to position 3, or log in as the service user.
- Open the HMI file system. On the PCU, navigate to:
C:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng - Identify the active language file. Standard names:
-
kapp_alarms_eng.ts/kapp_alarms_eng.qm(English) -
kapp_alarms_deu.ts/kapp_alarms_deu.qm(German) -
kapp_alarms_chs.ts/kapp_alarms_chs.qm(Simplified Chinese)
-
- Back up the original. Copy the
.tstokapp_alarms_eng.ts.bak(and the.qmtokapp_alarms_eng.qm.bak). - Open the
.tsfile in the proper text editor. Verify the first line is:<?xml version="1.0" encoding="utf-8"?> - Search for the alarm number. Use Find for the six-digit string (e.g.
620070) or the full tokenA620070. The<source>tag in Qt Linguist uses the digits only, without theAprefix. - If the entry exists, edit the
<translation>tag. If it does not exist, add a new<message>block inside the appropriate<context>:<context> <name>Alarms</name> <message> <location filename="kapp_alarms_eng.ts" line="123"/> <source>620070</source> <translation>Spindle overload detected - check lubrication</translation> </message> </context> - Critical rule: the entire
<translation>tag, from opening to closing, must be on a single physical line. Do not press the keyboard Enter key inside the tag. For a forced line break in the displayed text, use the XML entity which Qt renders as a line break at display time. - Save the
.tsfile. Confirm the file size increased by the new text length. Confirm noEnterwas inserted inside any<translation>block. - Delete the corresponding
.qmfile. For English: deleteC:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng\kapp_alarms_eng.qm. Repeat for every language file you have edited. - Trigger an HMI restart. From the HMI main menu:
Diagnostics > HMI restart. Alternatively, perform an NCK reset followed by a full PCU reboot. The translation service regenerates the.qmfiles during the boot sequence. - After the HMI returns to operation, verify the
.qmfile exists again in thelngdirectory and has a Modified timestamp equal to the most recent HMI boot time. The file size should be roughly proportional to the source.tssize (compaction ratio is typically 30% - 50%). - Trigger the alarm by toggling the PLC input that generates
A620070. The HMI alarm list should now display the number, the new text, and the timestamp.
Editing the .ts File: XML Syntax Reference
A valid Qt Linguist .ts entry has the structure shown in the procedure above. The following rules must be observed:
| Rule | Detail |
|---|---|
<source> content |
Six-digit alarm number as a string, no A prefix |
<translation> content |
User-facing text, no literal line breaks |
| Line endings | CRLF or LF consistent within the file; do not mix |
| Encoding | UTF-8 (no BOM). First line must declare utf-8 |
| HTML entities |
& for &, < for <, > for >, " for " |
| Forced line break | Use inside the translation text |
| Quotes | Use single quotes ' inside the text; do not use unescaped double quotes |
| Tag matching | Every <message> closed with </message>; every <context> closed with </context>
|
Common .ts errors that prevent .qm regeneration:
- Unclosed
<message>or<context>tag. - Literal CR/LF inside the
<translation>tag (the most common cause of silent rejection). - Mismatched or unescaped double quotes inside the text.
- Wrong encoding declaration (the
encodingattribute must match the file's actual encoding). - BOM added by the editor (Qt's parser does not accept BOM in front of the XML declaration).
- Empty
<translation>tag - Qt may skip the entry if the translation is blank.
Verification Procedure
-
Timestamp check. Open Windows Explorer, right-click the
.qmfile, select Properties. The Modified date must equal the time of the most recent HMI boot. If the timestamp is unchanged, the.tswas rejected by the parser. -
Alarm list check. On the HMI, navigate to
Diagnostics > Alarm list. Trigger the alarm (toggle the PLC input). The alarm row should show the number, the descriptive text, and the timestamp. -
Language check. Change the HMI language via
Start-up > HMI > Language(if available) and trigger the alarm again. The translated text from the corresponding language.tsfile should display. - Persistence check. Perform an NCK reset (without powering down the PCU) and verify the alarm text remains loaded.
-
Full reboot check. Power cycle the PCU and confirm the
.qmis regenerated on the next boot and the alarm text persists.
Multi-Language Alarm Text
The .ts / .qm pair exists per language. Standard SINUMERIK Operate language files in the user lng directory:
| Language | File base name |
|---|---|
| English | kapp_alarms_eng |
| German | kapp_alarms_deu |
| Simplified Chinese | kapp_alarms_chs |
| Traditional Chinese | kapp_alarms_cht |
| French | kapp_alarms_fra |
| Italian | kapp_alarms_ita |
| Spanish | kapp_alarms_spa |
| Japanese | kapp_alarms_jpn |
| Korean | kapp_alarms_kor |
To add multi-language text, edit the .ts file for each target language, save as UTF-8 (no BOM), and delete the corresponding .qm. The HMI boot regenerates one .qm per language. The first line of every .ts must be <?xml version="1.0" encoding="utf-8"?>. For non-Latin scripts (Chinese, Japanese, Korean), verify the editor saves the file in UTF-8 without a BOM; the BOM causes Qt's parser to reject the file.
File Path Reference
| Path | Scope | Editable |
|---|---|---|
C:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng\ |
User | Yes (integrator) |
C:\ProgramData\Siemens\MotionControl\oem\sinumerik\hmi\lng\ |
OEM | Read-only at runtime; OEM scope only |
C:\ProgramData\Siemens\MotionControl\add_on\sinumerik\hmi\lng\ |
Add-on | Read-only at runtime; addon scope only |
Edits must be made in the user scope. The OEM and add-on scopes are typically write-protected; even if a write succeeds, the runtime will not load the file from those scopes for the active alarm list.
Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Alarm number visible, no text |
.qm missing the alarm number or stale .qm in use |
Edit .ts; delete .qm; reboot HMI |
| Text visible in one language only | Corresponding language .ts not edited, or its .qm not regenerated |
Edit all target language .ts files; delete all corresponding .qm files; reboot HMI |
.qm timestamp unchanged after reboot |
.ts XML syntax error (line break in <translation>, unclosed tag, BOM, encoding mismatch) |
Validate .ts in Qt Linguist; fix syntax; re-save; delete .qm; reboot HMI |
| Alarm appears with garbled characters in Chinese |
.ts saved in wrong encoding (e.g., GB2312 instead of UTF-8) or BOM present |
Re-save .ts as UTF-8 without BOM; verify first line declares utf-8; delete .qm; reboot HMI |
| Alarm text disappears after NCK reset | Edit was made in the OEM scope, not the user scope | Move edit to the user lng directory; delete the OEM .qm if present; reboot HMI |
| Alarm text visible in Setup menu but not in the alarm line | Edit was made through the field-driven configurator and did not propagate to the .ts
|
Edit the .ts source file directly; delete .qm; reboot HMI |
| Alarm 6xxxxx text appears as a number on TCU but not on OP015A | TCU is connected to a different PCU; the edit was made on a different PCU | Verify the network binding: TCU > PCU. Edit the file on the PCU that the OP015A is connected to. |
| Multiple new alarm numbers, only some display text | Some .ts entries are valid; others have syntax errors |
Validate the entire .ts file in Qt Linguist; correct all reported errors; delete .qm; reboot HMI |
Edge Cases and OEM Separation
SINUMERIK Operate separates user, OEM, and add-on file scopes. The runtime resolution order for an alarm number lookup is: add-on, OEM, then user. If a text is defined in the OEM scope, it overrides a user-scope definition. The integrator must therefore ensure that the OEM .ts does not contain an entry for the same alarm number, or the user entry will be ignored.
The PLC interface in SINUMERIK 840Dsl is DB2. The user PLC writes alarm numbers to DB2 in the format defined by the SINUMERIK 840Dsl PLC Programming Manual. The HMI then reads DB2 to populate the alarm list. If the machine builder is not using DB2 (as in the original report), the alarm numbers are still being driven by the PLC, but the HMI-side text lookup is independent of DB2 - the text is in the .ts / .qm files regardless.
For alarm numbers above the user-PLC range (above 6xxxxx), the HMI looks up the text in the Siemens-supplied alarm database. The user scope cannot override these. For numbers in the 6xxxxx range, the user scope is the only source for text.
Alternative: TIA Portal Openness Workflow
For users maintaining alarm text lists in TIA Portal (typically for S7-1500 / ET 200SP PLCs that feed the HMI), the TIA Portal Openness API provides programmatic management of PLC text lists. The Openness API supports copying PLC text lists to a library as a Master copy, or deleting PLC text lists from library Master copy folders. This enables automated text management for fleet deployments and is documented in the official TIA Portal Openness API reference. See the Managing alarm text list in PLC and Mastercopy library documentation for the v21 Openness API procedure.
Best Practices and Pitfalls
- Always back up the
.tsand.qmfiles before any edit. A CFG image backup is the safest restore point. - Use a proper text editor (Notepad++, VS Code, UltraEdit, Qt Linguist) - not Windows Notepad, which can introduce CRLF and BOM issues that break Qt's parser.
- Delete the
.qmonly AFTER you have validated the.tssyntactically (open in Qt Linguist; the parser will flag any XML error). - Restart the HMI, not just the NCK. The
.ts-to-.qmconversion runs on HMI boot, not on NCK reset. - Edit only the user scope (
user\sinumerik\hmi\lng). The OEM and add-on scopes are typically write-protected at runtime. - For multi-language support, edit all target language
.tsfiles before the next HMI boot. The conversion runs once per boot, generating one.qmper.ts. - For fleet management, use TIA Portal Openness to maintain text lists centrally. Export the text list from TIA Portal, then deploy via Access MyMachine or a CFG image update.
- Avoid duplicating alarm numbers across user and OEM scopes. The OEM scope wins on conflict.
- Test the alarm trigger in service mode before handing the machine back to production. Verify text in all installed languages.
- Document the alarm number, the source
.tsfile, and the boot timestamp in the machine log so future service engineers can re-derive the configuration.
Why does the alarm number appear on the HMI but the text stays blank even after editing the .ts file?
The HMI runtime loads the compiled .qm binary, not the .ts source. If a .qm with a newer timestamp than the .ts exists in C:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng, SINUMERIK Operate skips the .ts entirely. Verify by comparing Modified timestamps; if the .qm is newer than the .ts, delete the .qm and reboot the HMI to force regeneration.
How do I force SINUMERIK Operate to regenerate the .qm from a .ts file?
Delete the .qm file in the user lng directory (for example kapp_alarms_eng.qm). The translation service on the next HMI boot detects the missing .qm and regenerates it from the .ts source. Verify by checking that the .qm exists after the reboot and that its Modified timestamp equals the boot time.
What is the correct XML format for adding an alarm text in a .ts file?
Use a <message> block inside the <context> for the Alarms section. The <source> tag contains the six-digit number (no A prefix); the <translation> tag contains the user-facing text. The entire <translation> tag must be on a single physical line - a literal carriage return inside the tag breaks Qt's parser and silently rejects the file.
Where do I find the alarm text files on a SINUMERIK 840Dsl with PCU50.5?
The user-scope alarm text files are in C:\ProgramData\Siemens\MotionControl\user\sinumerik\hmi\lng. The base names are kapp_alarms_<lang>.ts and kapp_alarms_<lang>.qm (for example kapp_alarms_eng for English). The OEM scope at \oem\sinumerik\hmi\lng is typically write-protected and the runtime reads from the user scope by default.
Can the SINUMERIK 840Dsl display Chinese alarm text, and what encoding is required?
Yes. Save the kapp_alarms_chs.ts file as UTF-8 without a BOM. The first line of the file must declare encoding="utf-8". Use the XML entity for forced line breaks inside the <translation> tag. After saving, delete the corresponding kapp_alarms_chs.qm and reboot the HMI to regenerate the binary.