Reading MM4 Fault Codes over Profibus-DP via DriveES FB38
Field engineers commissioning a Siemens MICROMASTER 4 (MM420 / MM430 / MM440) on Profibus-DP from an S7-300 (CPU315-2 PN/DP) frequently need to surface drive fault codes on an MP377 (or other WinCC flexible HMI) without sending an operator to the BOP/AOP on the drive cabinet. MM4 drives do not natively publish fault numbers in the PZD (process data) channel. Instead, fault information must be read out cyclically over the PKW (parameter channel) of the PPO structure, or acyclically through DriveES function blocks. This reference covers both methods and provides a working integration path to the HMI.
1. Problem Statement and Architecture
The reported configuration is:
- Controller: SIMATIC S7-300, CPU315-2 PN/DP (6ES7 315-2EH14-0AB0 and earlier -0AH/0AB versions behave identically for DP master operation).
- Drive: MICROMASTER 440 (MM440) with the Profibus-DP option module (6SE6400-1PB00-0AA0) - the same module fits MM420 and MM430.
- HMI: SIMATIC MP377 (Profinet variant, e.g. 6AV6 644-0AB01-2AX0) running WinCC flexible 2008 / WinCC (TIA Portal) with the runtime version matching the panel image.
- Bus topology: CPU315-2 PN/DP acting as DP master on the integrated MPI/DP interface; MP377 connected on the PN side of the CPU.
The fundamental constraint is that MM4 firmware does not place the active fault code (r0947 / r0948 / r0949 / r2109 etc. on SINAMICS) into the PZD words by default. Only status word 1 (r0052, ZSW1) and status word 2 (r0053, ZSW2) are broadcast cyclically. Any fault code, fault value, warning, or fault time must therefore be fetched explicitly by the PLC through either:
- Cyclic PKW via PPO type 1 or PPO type 5 (8 PKW words + 2/6 PZD words), updated every DP cycle.
- Acyclic PKW via DriveES Simatic function blocks FB36 / FB37 / FB38 (DEV_FLT3), which read the drive's internal fault buffer.
2. Profibus PPO Structure and PKW Channel
Every MM4 on Profibus exposes a PPO (Parameter Process data Object) selected in HW Config under the DP slave properties. The PPO type determines how many words of PZD and PKW are exchanged:
| PPO Type | PKW Words | PZD Words (Out/In) | Use Case |
|---|---|---|---|
| PPO1 | 4 PKW + 2 PZD out / 2 PZD in | Cyclic parameter access + speed/telegraph | |
| PPO2 | 4 PKW + 6 PZD out / 6 PZD in | Cyclic parameter + extended process data | |
| PPO3 | No PKW + 2 PZD out / 2 PZD in | Pure speed/telegraph control | |
| PPO4 | No PKW + 6 PZD out / 6 PZD in | Pure extended process data | |
| PPO5 | 4 PKW + 10 PZD out / 10 PZD in | Cyclic parameter + maximum PZD |
The PKW channel is 4 words. Each word has a fixed meaning:
- PKE (Word 1) - Parameter Keword. Bits 0-10 = parameter number, bits 11-15 = AK (Auftrags-Kennung / request/response ID).
- IND (Word 2) - Index. Bit 15 selects the parameter page (upper/lower 2000-parameter bank in MM4); bits 0-7 are parameter sub-index, used for MM4 to extend the address range.
- PWE1 / PWE2 (Words 3-4) - Parameter Value. For a 16-bit value only PWE2 is used; for 32-bit values both words carry low/high.
The MM4 Profibus module operating instructions document the AK codes. The most relevant ones are:
| AK (Hex) | Direction | Meaning |
|---|---|---|
| 1 | Master → Drive | Read parameter value (word) |
| 2 | Master → Drive | Write parameter value (word, EEPROM) |
| 3 | Master → Drive | Write parameter value (word, RAM only) |
| 4 | Master → Drive | Read parameter value (double word) |
| 5 | Master → Drive | Write parameter value (double word) |
| 6 | Master → Drive | Read parameter value (array / string) |
| 7 | Master → Drive | Write parameter value (array / string) |
| 8 / 9 / 10 / 11 | Drive → Master | Response codes (with sub-IDs 0=ok, 7=busy, 8=illegal PKE, 9=illegal PWE, etc.) |
For MM4, parameter numbers above 2000 are addressed by setting bit 15 of the IND word (the "page bit"). Example: to read parameter r0947 (last fault code) you actually address parameter 947 with IND = 16#8000; to read r0948 you use parameter 948 with IND = 16#8000. The parameter page bit is essential on MM4 and is a frequent source of "illegal PKE" responses.
3. Method A - Cyclic Read of P947 through the PKW Channel
Configure the DP slave as PPO1 or PPO5. In HW Config, drag the MM4 GSD file (SIEM8170.GSD for the original DP option, or SIEM8180.GSD / SIEM8190.GSD depending on firmware) into DP master, choose the desired PPO type, and assign the I/O addresses (e.g., PIW 256-263 / PQW 256-263 for PPO1).
Then in OB1 (or a dedicated cyclic OB) build the request once per DP cycle:
// Read r0947 (last fault code) from MM4 station 1
L W#16#1200 // AK = 1 (read word), parameter 947 in bits 0-10
T PQW 256 // PKE
L W#16#8000 // IND high = page bit, sub-index = 0
T PQW 258 // IND
L 0 // PWE1 = 0 for 16-bit read
T PQW 260
L 0 // PWE2 = 0 for 16-bit read
T PQW 262
After one DP cycle, the drive returns its response in PIW 256-263. Decode it:
L PIW 256 // PKE response
L W#16#0FFF // mask parameter number
T "PKW.ParamNo" // ignore on response
L PIW 256 // AK response
L W#16#F000 // mask AK bits
SRW 12
T "PKW.AK_resp" // expect 1=ok, 7=drive busy, 8=illegal PKE, 9=illegal IND
L PIW 262 // PWE2 = fault code value (e.g. F0001 = 1, F0002 = 2)
T "MM4.FaultNumber"
Important caveats when using cyclic PKW:
- The drive returns an AK code; only AK = 1 or AK = 8-9 need a sanity check.
- You cannot change parameters on every cycle - PKW requests must alternate read/write to avoid EEPROM wear. Writes use AK = 3 (RAM only) when the value is transient.
- You only see the currently pending fault in r0947. To get the full history you need the fault buffer - use Method B.
4. Method B - DriveES Function Blocks (FB38 DEV_FLT3)
DriveES Simatic is a Siemens function block library (article ID 23322610 in the Siemens Industry Online Support, formerly known as DriveES DriveMon / DriveES PCS7) that wraps the acyclic DP-V1 read/write services for SIMATIC and SINAMICS / MICROMASTER. The relevant blocks for MM4 fault buffer access are:
| FB / FC | Name | Purpose |
|---|---|---|
| FB36 | DEV_PAR | Generic parameter read/write (replacement for FC14 in newer projects) |
| FB37 | DEV_FLT2 | Reads the most recent fault from a MM4 / SINAMICS |
| FB38 | DEV_FLT3 | Reads the entire fault buffer of a MM4 (up to 8 entries) with fault code, fault value and fault time |
| FC14 | (legacy) | Basic MM4 control block (on / off / speed setpoint) used in older Step7 V5 projects |
4.1 Installing DriveES Blocks
- Download "DriveES SIMATIC" or the successor package from Siemens support entry 23322610.
- Unzip into a Step7 V5.x S7-Library folder; integrate the .s7l file into your project (Options → Standard Library / DriveES_Lib).
- Copy the required FBs into your project's blocks directory and copy the supplied UDTs (UDT_FLT3, UDT_DIAG, UDT_PARAM) into the S7 program.
- If using TIA Portal, the equivalent library is "SINAMICS DriveLib" - the FB equivalents are present but renamed; verify block version compatibility against the panel/MP377 firmware.
4.2 FB38 DEV_FLT3 Block Interface
The block interface in the DriveES documentation is as follows (verify against your specific library version):
| Parameter | Direction | Type | Description |
|---|---|---|---|
| REQ | IN | BOOL | Rising edge starts a buffer read |
| DRIVE_NO | IN | INT | Drive station number / logical device |
| ADDR_DIAG | IN | WORD | DP slave diagnostic address (from HW Config) |
| ENABLE | IN | BOOL | Master enable |
| FLT3_DATA | OUT | UDT_FLT3 | Decoded fault buffer structure |
| BUSY | OUT | BOOL | Operation in progress |
| DONE | OUT | BOOL | Read completed successfully |
| ERROR | OUT | BOOL | Read failed |
| STATUS | OUT | WORD | Hex error / status code |
4.3 UDT_FLT3 Structure
The supplied UDT_FLT3 is an array of fault entries. A typical DriveES instance exposes eight fault records. Each record contains:
| Field | Type | Source on MM4 | Meaning |
|---|---|---|---|
| Flt_Code | WORD | r0947 (mapped by index) | Fault number (e.g. 1 for F0001) |
| Flt_Value | WORD | r0949 value field | Drive-specific fault value |
| Flt_Time | DWORD | r2113 / r2114 / r2115 | Operating hours at fault |
| Flt_TextID | WORD | Internal | Internal DriveES code |
4.4 Calling FB38 in OB1
// One-shot trigger on rising edge of fault detected
A "MM4.StatusWord1".Fault // ZSW1 bit 3 = fault active
FP M 100.0 // edge memory
= DB20.DBX0.0 // REQ input to FB38 instance
CALL FB38, DB38 // FB38 instance DB38
REQ := DB20.DBX0.0
DRIVE_NO := 1 // first MM4 on DP
ADDR_DIAG := W#16#0FFF // use HW Config diagnostic address
ENABLE := TRUE
FLT3_DATA := "MM4.FltBuffer" // UDT_FLT3, e.g. DB100
BUSY := DB20.DBX2.0
DONE := DB20.DBX2.1
ERROR := DB20.DBX2.2
STATUS := DB20.DBW4
5. Driver Control with FC14 (Legacy) / FB36 DEV_PAR
To complement the fault read, the drive must be controllable from the PLC (On/Off/Reset/Setpoint). The legacy path uses FC14 (article in the field report); the modern equivalent is FB36 DEV_PAR. FC14 expects:
| Input | Type | Meaning |
|---|---|---|
| ADDR | WORD | Logical address of PZD out area (from HW Config) |
| SPEED | REAL | Setpoint in RPM (NOT Hz - MM4 internally normalizes) |
| ON_OFF1 | BOOL | Start command (STW1 bit 0) |
| OFF2 | BOOL | Coast stop (STW1 bit 1) |
| OFF3 | BOOL | Quick stop (STW1 bit 2) |
| ACK | BOOL | Fault acknowledge (STW1 bit 7) |
| BUSY, FAULT | OUT | Status |
Once FC14 is instantiated, the same DIAG address feeds FB38. Avoid mixing FC14 with FB36 on the same DP slave - both blocks will try to claim ownership of the parameter channel.
6. Mapping the Fault Code to an Operator-Friendly Text
The integer in r0947 is the fault index, not the Fxxxx string the operator expects. The MM4 fault list (chapter 6 of the MM440 Parameter List) maps numeric values to fault text:
| Fault Number | BOP / AOP Display | Meaning |
|---|---|---|
| 1 | F0001 | Overcurrent |
| 2 | F0002 | Overvoltage |
| 3 | F0003 | Undervoltage |
| 4 | F0004 | Drive overtemperature |
| 5 | F0005 | Drive I²t overload |
| 11 | F0011 | Motor overtemperature (via PTC / KTY) |
| 12 | F0012 | Drive temperature signal lost |
| 20 | F0020 | Mains phase failure |
| 35 | F0035 | Auto restart after n attempts exceeded |
| 41 | F0041 | Motor data identification failure |
| 52 | F0052 | Power stack data read failure |
| 60 | F0060 | ASIC timeout |
| 70 | F0070 | CB / comm board setpoint loss |
| 71 | F0071 | USS / Modbus setpoint loss |
| 72 | F0072 | Profibus / DP setpoint loss |
| 80 | F0080 | Signal loss on analog input |
| 85 | F0085 | External fault |
7. HMI Integration on MP377 (WinCC flexible)
- In WinCC flexible (or TIA Portal HMI), create an HMI tag set of type WORD named
MM4_FltCodebound to the PLC DB address that holds the PKW response (e.g., DB100.DBW0 = first fault code). - Insert an IO field with format string
F0000on the drive status screen. This pads the integer 1 → "F0001", matching the BOP display. - Use a text list for automatic plain-language description: assign text list entries 0..99 with the corresponding fault messages from the MM4 manual.
- For the full history, create an array of 8 IO fields bound to DB100.DBW0 through DB100.DBW14 (one fault record per row). Show the timestamp as a separate field.
- Place a single bit lamp bound to ZSW1 bit 3 (fault active) to give an operator a one-glance "drive faulted" indicator.
- Use the MP377 function key to trigger
Ack_Fault, wired to FC14.ACK so the operator can clear the fault from the panel without walking to the cabinet.
8. Step-by-Step Commissioning Procedure
- Confirm MM4 Profibus option is installed - LED "Link" on the option module steady green; check P0922 = 1 (DP), P0014 = 4 (control source = Profibus).
- Set DP address on MM4 (P0918 / DIP switches on the option module) - address 1..125, must match HW Config.
- Import GSD into Step7 (Options → Install GSD); restart HW Config.
- Insert MM4 DP slave in the S7-300 station and select PPO1 (or PPO3 if no PKW). Note the diagnostic address - e.g., 1023.
- Compile and download HW Config. Verify "no diagnostics" on the DP slave in online view.
- Call FC14 in OB1 with a 0 RPM setpoint and ON_OFF1 = TRUE; observe ZSW1 in the VAT.
- Force a known fault (e.g., open the motor cable with the drive running) and check ZSW1 bit 3 transitions to 1.
- Trigger FB38 on the rising edge; verify FLT3_DATA populates with F0003 (undervoltage) or the relevant fault.
- Configure WinCC flexible tags to the FB38 output DB and download to MP377.
- Validate on HMI that fault code and text match the BOP display.
9. Verification and Diagnostics
After commissioning, verify the following live on the VAT / Watch table:
- ZSW1 bit 3 (fault active) toggles when a real fault is forced.
- DB100.DBW0 contains a value matching Fxxxx after a fault.
- STATUS of FB38 returns 16#0000 on success; non-zero values indicate DP-V1 issue.
- PIW updates for the PZD area even when no PKW request is active - this confirms DP slave is in cyclic data exchange.
Use Status / Modify on the DB and run the "Read online / Monitor" function in Step7 to compare FB38's FLT3_DATA against the MM4 BOP display when a fault is present. They must agree. If FB38 shows 0 (no fault) but the BOP shows F0001, check the page-bit on IND and verify the DP slave diagnostic address is correct.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| FB38 STATUS = 16#80xx | DP-V1 acyclic channel not supported on the DP slave / wrong slot | Verify the slave firmware supports DP-V1 acyclic; some MM4 DP option firmware below V1.05 needs update |
| AK response = 8 (illegal PKE) | Page bit missing on parameter > 2000 | Set IND bit 15; double-check PKE parameter number |
| AK response = 7 (busy) | Drive is still processing previous request | Retry after BUSY clears; space out PKW requests in OB35 |
| FLT3_DATA always 0 | Fault buffer empty / wrong DB address | Force a fault first; check DB number matches the FB38 instance |
| Fault number shown but text is wrong | HMI text list misaligned | Re-import the MM4 fault list into the HMI text list |
| HMI shows "No connection" | MP377 Profinet cable / CPU PN port | Verify PN link LEDs; ping the panel from TIA diagnostics |
| Fault value not updating | DB overwritten in OB1 by PKW read logic | Move PKW request to OB35 (100 ms) and read into separate DB |
| Drive acknowledges but ZSW1 still = fault | Fault latched in drive | Send ACK via FC14.ACK (STW1 bit 7 with rising edge); wait 100 ms |
11. Field-Proven Caveats
- EEPROM wear: Do not write parameters (PKE AK = 2) on every cycle. MM4 EEPROM endurance is approximately 100,000 write cycles. Use AK = 3 (RAM-only) for transient setpoint writes.
- PKW PPO type consistency: If you select PPO3 / PPO4 (no PKW), FB38 still works because DriveES uses the acyclic DP-V1 read/write service over the same DP slave slot. PKW is only required if you want true cyclic parameter reads.
- Multiple drives: For more than one MM4 on the same DP segment, give each a unique diagnostic address and unique PPO slot. FB38 must be instantiated per drive.
- CPU load: Each FB38 instance consumes roughly 1 ms of CPU315-2 PN/DP time per call. Limit polling to OB35 (100 ms) if you have more than four drives.
- Firmware cross-reference: MM4 firmware V3.2 and below does not expose all parameters above 2000. Verify your parameter range with the connected BOP before scripting automatic parameter access.
- Profinet vs Profibus split: The CPU315-2 PN/DP can act simultaneously as Profinet controller and Profibus-DP master. The MP377 on PN and the MM4 on DP are independent subnets - do not try to bridge them at the panel level.
12. References to Official Documentation
- MM4 Profibus Module Operating Instructions - Section 3.4 covers PKW parameter access.
- DriveES SIMATIC Application - Contains FB38 (DEV_FLT3) and the example project.
- MICROMASTER 4 Parameter List - Full fault number / value mapping.
- MICROMASTER 4 & SINAMICS G Function block (FC14) to control an MM4 via Profibus-DP - Legacy control block documentation.
FAQ
Can MM4 fault codes be transmitted natively over Profibus-DP without DriveES?
No. MM4 firmware only emits Status Word 1 (r0052) and Status Word 2 (r0053) on the PZD channel. Fault codes must be read through the PKW channel of a PPO1 / PPO5 slot (parameter r0947) or via an acyclic DP-V1 read of the fault buffer using DriveES FB38.
Which PPO type should I select for fault readout with FB38?
PPO3 or PPO4 (no PKW) is sufficient when using FB38, because DriveES uses the acyclic DP-V1 channel. PPO1 or PPO5 (with PKW) is needed only if you want cyclic parameter access without calling DriveES blocks.
Why does my MM4 reject the parameter read with AK = 8?
The most common cause is the page bit. For any MM4 parameter number above 2000 (r0947, r0948, r0949, r2110, etc.) set bit 15 of the IND word. Example: to read r0947 use PKE = 16#1200, IND = 16#8000.
How do I display the fault code as F0001 instead of 1 on the MP377?
Bind the integer fault code to an IO field in WinCC flexible with a format string of "F0000". This pads the value with leading zeros and prepends the "F" so it matches the BOP/AOP display convention.
What is the difference between FB37 and FB38 in DriveES?
FB37 (DEV_FLT2) reads only the most recent fault and is faster; FB38 (DEV_FLT3) reads the entire 8-entry fault buffer including fault values and fault times. Use FB38 when you need a full fault history visible on the HMI.