Mapping SINAMICS Drive Fault Codes to HMI Text via WinCC VBA

David Krause15 min read
HMI / SCADASiemensTutorial / How-to
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

When a SINAMICS drive enters a fault state, the controller surfaces a numeric fault code in status word r2132 (or r3122 in extended mode). Operators cannot interpret raw integers such as 1010 on a panel, so the HMI must translate the number into a human-readable string like Drive type unknown. With SINAMICS firmware V2.5x, a single drive can surface 1,065 or more fault numbers, which rules out one tag per text. The recommended pattern in SIMATIC WinCC V7 is to bind a TextList object to a single INT/WORD tag and drive the displayed value through TextList.Assignments populated at runtime via VBA. This reference documents that workflow on WinCC V7 SP2, the equivalent procedure in TIA Portal / WinCC Professional, and the cross-platform mappings for CODESYS, AutomationDirect C-more, Inductive Automation Ignition, and Unitronics UniLogic panels.

Prerequisites

  • SIMATIC WinCC V7 SP2 or later runtime with the Graphics Designer and the VBA runtime enabled (Project > Properties > Options > Activate VBA).
  • SINAMICS S120 / S150 / G120 List Manual for firmware V2.5x, or the exported CSV/Excel fault list shipped with the drive project.
  • Configured HMI connection to the SINAMICS drive over PROFINET IRT, PROFIBUS DP, or EtherNet/IP, with the fault number mapped to a tag of type INT or WORD (typical tag name FLT_TAG_VALUE).
  • Microsoft Excel or a text editor for reformatting the CSV into the value,text;value,text pair syntax that WinCC expects.
  • VBA editor access: Tools > Macros > Visual Basic Editor (Alt+F11) inside the WinCC Graphics Designer.
Important: The fault numbers in the SINAMICS List Manual appear as F1000, F1001, ... F1065 and beyond. When the drive reports a fault, the leading "F" is dropped and only the integer portion lands in the status word. The TextList must therefore use the integer form (1010 for F1010, not "F1010"). Bind the HMI tag to r2132.0 or to the configured fault word, not to a stringified version of the fault code.

SINAMICS Fault Code Reference (Firmware V2.5x, Subset)

The table below reproduces the first dozen entries from the SINAMICS S120/S150 List Manual for firmware V2.5x. The full list extends well beyond 1,065 entries and is published in the official List Manual. The integer column is what the HMI must receive; the F-prefix is a presentation suffix only.

Fault Number Integer Tag Value Text
F1000 1000 Internal software error
F1001 1001 Internal software error
F1002 1002 Internal software error
F1003 1003 Acknowledgement delay when accessing the memory
F1004 1004 Internal software error
F1005 1005 Firmware download for DRIVE-CLiQ component unsuccessful
F1006 1006 Firmware update for DRIVE-CLiQ component required
F1007 1007 POWER ON for DRIVE-CLiQ component required
F1009 1009 CU: Control module overtemperature
F1010 1010 Drive type unknown
F1011 1011 Download interrupted
F1012 1012 Project conversion error

Fault numbers above F3000 belong to the SINAMICS safety functions (SS1, STO, SLS, SDI, etc.). Fault numbers above F5000 belong to the safety integrated extended functions. They share the same HMI mechanism but should be grouped into a separate TextList so the operator can filter on category.

System Architecture

The text lookup happens in three layers. The SINAMICS drive writes the active fault number into status word r2132. The PLC reads that word over PROFINET IO and forwards it to the HMI tag database. The HMI TextList evaluates the integer and returns the matching string to the screen object. The diagram below shows the data path and the boundary at which the VBA macro injects the assignment table.

SINAMICS Drive r2132 fault word PROFINET PLC FLT_TAG_VALUE Tag link WinCC HMI TextList + Screen Operator view VBA Macro EditTextList() CSV file

WinCC V7 / WinCC Flexible VBA Approach

WinCC V7 stores text lists as HMITextList automation objects. Each list has an Assignments property that takes a single string of value,text pairs separated by semicolons. The standard workflow populates this list through the WinCC Configuration Studio, but the property is also writable at runtime through VBA, which is the only practical way to load 1,000+ entries without manual data entry.

Step 1: Format the CSV to a Semicolon-Delimited String

Open the Excel fault list and produce a single column formatted as <integer>,<text> per row, then concatenate the rows with a ; separator. A small Excel formula does the job:

=A2 & "," & B2 & ";"

Copy the result column to a UTF-8 text file F1000_F1065.txt with line breaks removed. The result for the first twelve rows is:

1000,Internal software error;1001,Internal software error;1002,Internal software error;1003,Acknowledgement delay when accessing the memory;1004,Internal software error;1005,Firmware download for DRIVE-CLiQ component unsuccessful;1006,Firmware update for DRIVE-CLiQ component required;1007,POWER ON for DRIVE-CLiQ component required;1009,CU: Control module overtemperature;1010,Drive type unknown;1011,Download interrupted;1012,Project conversion error;

Step 2: Insert a Text List Object in the Picture

  1. Open the target picture in the Graphics Designer.
  2. From the Smart Objects palette, drag a Text List object onto the canvas.
  3. Rename the object to TextList in the Object Name field of the Properties pane. The name must match the string passed to ActiveDocument.HMIObjects(...) in the VBA macro.
  4. Configure the List range property to map to the FLT_TAG_VALUE tag.
  5. Set Output to Text and Assignment to Value/Range.

Step 3: Add the VBA Macro

Open the VBA editor (Alt+F11) and add a new module with the following code. The macro reads the assignment string from disk, trims any trailing whitespace, and pushes it into the TextList.Assignments property:

Sub EditTextList()
    Dim objTextList As HMITextList
    Dim strAssignments As String
    Dim strFile As String
    Dim iFile As Integer
    Dim sLine As String

    strFile = "C:\WinCC\FaultLists\F1000_F1065.txt"
    iFile = FreeFile
    Open strFile For Input As #iFile
        strAssignments = ""
        Do While Not EOF(iFile)
            Line Input #iFile, sLine
            strAssignments = strAssignments & sLine
        Loop
    Close #iFile

    Set objTextList = ActiveDocument.HMIObjects("TextList")
    objTextList.Assignments = strAssignments
End Sub

Run EditTextList from the macro menu. The TextList object is now populated with all 1,065 entries. When the drive writes 1010 into FLT_TAG_VALUE, the Text List displays "Drive type unknown".

Performance: 1,065 entries in a single TextList.Assignments string is roughly 60 to 80 KB. WinCC V7 SP2 parses this in under 50 ms on a typical engineering station, so there is no need to split the list. Keep the file on a local SSD rather than a network share to avoid slow startup on the first picture change.

Step 4: Persist the Assignment in the Project

The runtime assignment written by VBA is not persisted in the .pdl file. To make the change permanent, open the configuration dialog of the Text List object and paste the same string into the Assignments editor. The configuration dialog also supports importing a tab-separated list directly through the Windows clipboard. After the import, save the picture and rebuild the runtime database.

TIA Portal / WinCC Professional Alternative

WinCC Professional (TIA Portal) does not expose TextList.Assignments as a writable runtime property. The TIA Portal workflow uses the built-in Text list editor instead:

  1. In the project tree, expand HMI > Text and graphic lists and create a new Text list named FLT_LIST.
  2. Set List range to Value/Range and Output to Text.
  3. In the List entries editor, click Import and supply a CSV file of the form Number;Text;Bit with one fault per row. TIA Portal accepts several thousand rows in a single list; for very large lists, split into multiple text lists and switch with a C-script.
  4. On the screen, place a Symbolic I/O field with Display mode: Text list and bind it to FLT_LIST and the PLC tag carrying the fault number.

The TIA Portal CSV import handles commas inside the text by quoting the field (1010,"Drive type unknown"), which avoids the manual escaping needed in the WinCC V7 VBA string. Multilingual projects benefit from the same import file: place the default-language column first, then add a column per active runtime language and select the language-specific column in the import dialog.

CODESYS Visualization Text List

In CODESYS V3.5 SP16 and later, the Text List visualization element provides a Fallback value property for codes that do not match any defined entry. Configure the element in the Visualization Manager: add a Text List with ID and Text columns, then bind the visualization element to FLT_TAG_VALUE through the Variable property. The Fallback value is shown whenever the integer does not match any defined ID. Update the list at runtime by writing a recipe or by loading the list from a CSV file using the FileDevice library. For more than 1,500 entries, consider splitting the list into several Text Lists and routing the lookup through a CASE structure in the controller to pick the right sublist.

AutomationDirect C-more HMI Dynamic Text

The C-more and C-more Micro product lines implement dynamic text through the Dynamic Text object. The object subscribes to a string tag in the PLC and to a numeric Trigger Tag; when the trigger value changes, the panel reads a new string from the PLC. To map 1,065 fault codes without ballooning the PLC code, build a CASE structure that selects the matching string in the controller and writes it to the string tag. C-more does not run user scripts, so all branching must live in the PLC. C-more EA9 and EA9-T panels support up to 4,096 characters in a single string tag, which is enough for the longest fault descriptions. The Dynamic Text object polls the trigger tag at the configured screen-update rate; use a one-shot edge in the trigger to avoid excessive network traffic.

Ignition Perspective / Vision

Ignition Vision and Perspective do not have a native text-list element bound to an integer. The standard pattern is to expose a dataset from the gateway with two columns (Code, Text) and to bind a Label expression to {[default]FaultList/Code = {FLT_TAG_VALUE}].[Text]}. For 1,000+ rows, store the dataset as a database query or a memory tag driven by a tag history binding so the lookup happens server-side and does not pollute the client. Use the indexed query binding to keep the lookup under 30 ms even at 10,000 rows. For Perspective, bind the Label component's text property to an Expression binding that returns text from the dataset row where code = {FLT_TAG_VALUE}.

UniLogic Text Display

UniLogic (Unitronics) offers a Text After suffix on numeric display objects. The unit string is overlaid after the numeric value. This is a unit-display feature, not a fault-lookup feature, so for fault translation on UniLogic you embed a CASE structure in the PLC ladder and write the resulting string into a String Display tag. UniLogic strings are limited to 40 characters in the standard data types; the UniStream platform supports up to 1,024-character strings. For 1,000+ faults, prefer the String Table data type if your UniLogic version supports it; otherwise, truncate the fault text to fit the panel width and follow up with a long-form description in a separate help screen.

Performance and Memory Considerations

Platform Max recommended list size Lookup latency Memory footprint per list
WinCC V7 TextList (in-process) 2,000 entries < 50 ms ~80 KB
TIA Portal Text list (imported) 10,000 entries < 20 ms ~400 KB
CODESYS Text List 1,500 entries < 10 ms ~60 KB
Ignition dataset expression 10,000+ (server-side) < 30 ms Server memory
C-more Dynamic Text n/a (PLC driven) PLC scan + HMI poll PLC string RAM

For WinCC V7, keep the assignment file on a local SSD and do not share the picture across multiple runtime instances. For TIA Portal, use a separate text list per fault category (CU, Power Unit, DRIVE-CLiQ, Safety) so each list stays under 2,000 entries and the editor remains responsive. For C-more, keep the CASE structure in fast task or in a periodic subroutine triggered at 50 ms to avoid scan jitter.

Multilingual Support

WinCC V7 supports per-language text lists through the same Assignments property by appending the language ID to the object name (TextList_de, TextList_en, TextList_zh). TIA Portal exposes the language columns directly in the text list editor and swaps the displayed language at runtime through the SetLanguage system function. CODESYS handles multilingual text lists through separate list IDs per language. C-more and UniLogic require per-language string tables in the PLC; plan for the largest language (typically German) when sizing the string memory.

Acknowledgement and Reset Behavior

Mapping the fault number to text is only half the workflow. The operator must also be able to acknowledge the fault and reset the drive. Wire three actions to the picture:

  1. Set FLT_ACK to TRUE to write STW2.7 (control word 2, bit 7) on the SINAMICS and acknowledge the active fault.
  2. Set FLT_RESET to TRUE to write STW1.7 (control word 1, bit 7) and reset the drive.
  3. Bind a separate TextList or symbolic I/O field to status word ZSW1 to show the drive state (e.g., 0 = "Ready", 1 = "Run", 2 = "Fault", 3 = "Fault active, ack pending").

Verification

  1. Force the drive to fault F1010 by setting p2100[0] = 1010 in the SINAMICS Starter or Startdrive commissioning tool. The drive should enter fault state and write 1010 to status word r2132.
  2. Confirm the tag value in WinCC tag management: Diagnostics > Tag simulation, read FLT_TAG_VALUE.
  3. Switch to the picture that contains the Text List. Verify that "Drive type unknown" is rendered in the configured text box.
  4. Cycle through at least five other fault codes (F1003, F1005, F1007, F1009, F1012) and verify the text updates without restarting the runtime.
  5. Reset all faults (p3981 = 1 on SINAMICS) and verify the Text List shows the configured default value (typically 0 = "No fault").
  6. Test the fallback path by writing a fault number that is not in the list (e.g., 9999) and verifying the configured default or fallback text is displayed.

Troubleshooting Matrix

Symptom Likely Cause Fix
Text List shows the integer instead of text List range is set to numeric output Set Output property to Text in the configuration
Text List is blank Tag type mismatch (INT vs. WORD) Match the tag data type in WinCC tag management to the SINAMICS fault word
Only first 100 entries visible CSV import truncated by row count in TIA Portal Increase the import row limit or split into multiple text lists
VBA macro "Object required" error Text List object name is not "TextList" Rename the object in the Graphics Designer before running the macro
Special characters in text render incorrectly CSV not UTF-8 encoded Re-save the CSV as UTF-8 without BOM before importing or concatenating
Text List shows stale data after fault clears Tag remains at last value Add a default range entry 0,No fault at the start of the assignment list
VBA macro runs but TextList unchanged Read-only project mode Open the project with write access and disable the Read only flag on the picture
Fault text in English only Multilingual list not configured Add per-language list objects and bind the SetLanguage system function to a language toggle

Field-Proven Caveats

  • Some SINAMICS firmware versions change the fault number when the drive is configured in a different operating mode (servo, vector, V/f). Always export the fault list for the specific firmware version that ships on the drive, not the one in the design spec.
  • After a firmware update, the assignment file must be regenerated. Old fault numbers can become obsolete and new ones added; an old TextList will display "Unknown fault" for entries added in the new firmware.
  • DRIVE-CLiQ faults (F1005 through F1007, F1011) often arrive as a flood during commissioning. The TextList should be populated before the drive is first powered up to avoid showing blanks during the initial bring-up.
  • Safety faults (F3000 to F5xxx) must be in a separate TextList. The operator must not see them mixed with drive faults because the acknowledgment procedure is different.
  • For redundant HMI pairs (two panels reading the same drive), the VBA macro must be executed on both panels. Export the assignment string from the project tree and apply it to both targets to keep them in sync.

Related Configuration

After the TextList is wired, the related configuration items that should be reviewed are: (a) the fault buffer mode in the SINAMICS (parameter p2100 for fault selection, p2101 for acknowledgement mode, r0947 for the active fault number); (b) the WinCC alarm logging configuration so that the same fault number triggers an alarm in the alarm view; (c) the operator role permissions on the Acknowledge and Reset buttons so that only authorized personnel can clear safety-related faults; (d) the WinCC audit trail so that fault acknowledgements are logged with operator ID, timestamp, and the new fault number.

FAQ

Why does my WinCC V7 Text List only accept 200 entries in the editor?

The default Text List editor view limits display, but the runtime accepts up to approximately 2,000 entries in a single list. If you need more, split the faults into multiple Text List objects and switch the visible one based on a fault category tag (for example, 0=Communication, 1=Power, 2=Safety). Each category list stays well below the editor limit and the runtime parses them in parallel.

Can I bind the same Text List to a SIMATIC Comfort Panel and a WinCC Runtime?

Yes. Export the list to a CSV, import it into TIA Portal, and re-export as a WinCC V7 *.txt assignment string. Both products use the same value,text pair syntax, but TIA Portal adds a leading Bit column that must be removed for V7. Use a small Excel macro to strip the third column before importing into WinCC V7.

How do I update the Text List when the SINAMICS firmware changes?

Re-export the fault list from the SINAMICS List Manual matching the new firmware version (for example, V5.2), regenerate the CSV in the format <int>,<text>, and re-run the VBA EditTextList macro. Re-import the CSV into TIA Portal for WinCC Professional projects. The new entries overwrite the old assignments at runtime; no picture recompile is needed. Re-test at least F1010, F3001, and F5001 to confirm the safety and standard paths are still correct.

Does the leading "F" in the fault number get dropped automatically?

Yes. SINAMICS faults are surfaced as integers in status word r2132 or r3122. The "F" prefix is a presentation suffix only and never reaches the HMI. Bind your HMI tag directly to the integer and let the Text List handle the translation; do not try to encode the "F" in the data, or you will spend extra work stripping it back out.

What happens if the drive reports a fault code that is not in the list?

WinCC V7 shows the configured default text (typically the first entry of the list, which is often 0,No fault). WinCC Professional shows the Fallback value. CODESYS shows its own Fallback value. Configure the default or fallback to "Unknown fault, see SINAMICS List Manual F<code>" so the operator can look it up by number. Update the assignment list as soon as the missing fault is identified in the List Manual.

Can the same TextList object show multiple active faults at once?

No. SINAMICS exposes one active fault number per status word. To show a list of all active faults, bind a multi-line alarm view to the WinCC alarm logging, which is configured to log all faults in r2132 over time. The TextList is for showing the currently displayed fault on a status screen.

Back to blog