Resolving S7-1200 CTRL_PWM Error 0x80D0: PWM Hardware Configuration
The Siemens SIMATIC S7-1200 CTRL_PWM extended instruction is the standard mechanism for generating a pulse-width modulated signal on an onboard digital output. When the function executes successfully, STATUS returns 0x0000. A persistent non-zero return value such as 0x80D0 indicates that the pulse generator channel is not in a runnable state when the function is invoked, and the output (typically Q0.0 or Q0.1) never toggles. Because 0x80D0 is not explicitly listed in the PWM section of the S7-1200 System Manual, troubleshooting requires cross-referencing high-speed counter documentation and verifying that the hardware configuration in TIA Portal is consistent with the PLC firmware.
Problem Description
An S7-1200 project calls CTRL_PWM from OB1 (Main cyclic OB). The PWM input is connected to the hardware identifier of a pulse generator, and a Boolean enable is provided to RUN. The block executes each scan but never asserts Q0.0. The STATUS output reports the hex value 16#80D0 on every cycle, regardless of input transitions.
Typical project environment:
- CPU: SIMATIC S7-1200 1214C DC/DC/DC
- Firmware: V3.0.1 (also reproduced on V3.0.0)
- Engineering: TIA Portal V11 SP2 Update 4 (or V13/V14/V15 equivalents)
- Pulse generator: PTO/PWM channel 1
- Output: Q0.0
Root Cause Analysis
The 0x80D0 return code is documented in the S7-1200 System Manual in the high-speed counter (HSC) chapter where it represents "HSC not enabled in hardware configuration." Because the pulse generator and HSC subsystems share underlying hardware resources on the S7-1200, the same diagnostic is returned by CTRL_PWM when the pulse channel itself is not properly activated in the device configuration, or when the PLC firmware holds a stale hardware descriptor that does not match the project.
Three root conditions have been observed to produce the 0x80D0 return:
- Stale PLC hardware image. The CPU retains a hardware configuration from a previous download that does not include a pulse generator, or that defines the channel with parameters incompatible with the current project (for example, a PTO assignment on a relay-output CPU).
-
Manual entry of the hardware identifier. Typing the decimal or hex equivalent of
Pulse_1[PTO/PWM](for example16#9) into thePWMinput ofCTRL_PWMinstead of using the named constant from the PLC tag table. The integer value resolves to the same identifier numerically but bypasses the symbolic validation performed during compile, and on certain firmware/TIA Portal combinations the run-time rejects the descriptor. -
Relay-output CPU. The CPU variant has relay outputs (for example 1214C AC/DC/RLY or DC/DC/RLY) which cannot source a high-frequency PWM signal. The hardware configuration silently fails to enable the pulse channel and
CTRL_PWMreports 0x80D0.
Affected Hardware and Firmware
Per Siemens Knowledge Base entry 109811546, the modules that support the PWM operating mode and the corresponding upper frequency limits are:
| Module family | Maximum PWM outputs | Max frequency | Period runtime change |
|---|---|---|---|
| S7-1200 CPU (DC output variants only) | 2 (Q0.0, Q0.1) on 1211C/1212C/1214C; 4 on 1215C/1217C | 100 kHz | Yes (with restrictions) |
| S7-1500 compact CPU | 4 | 100 kHz | Yes |
| S7-1500 standard CPU (signal board/PM) | Depends on module | Up to 100 kHz | Yes |
| ET 200SP digital output modules | Channel-dependent | Module-dependent | Module-dependent |
Firmware-specific behavior relevant to the 0x80D0 condition:
- V3.0.0 and V3.0.1: most frequently reported occurrences. The PLC accepts the hardware configuration download but the pulse channel descriptor in run-time does not bind to the physical output.
- V3.0.2 and later: improved consistency between TIA Portal hardware descriptors and run-time. Siemens recommends V3.0.2 as a minimum baseline for new PWM projects.
- V4.x and later: pulse generator naming changed; the constant tag may appear as
Pulse_1rather thanPulse_1[PTO/PWM].
Prerequisites
Before applying the corrective procedure, verify the following:
- The CPU is a DC-output variant (for example
6ES7 214-1AG31-0XB0). Check the article number on the side label; the fourth character group ends in0XB0for transistor outputs, not0XB1or0XB2relay variants. - TIA Portal is opened with a project that matches the connected PLC exactly (same article number, same firmware version).
- You have a backup of the project, including the device configuration and all blocks, exported to a portable archive.
- A programming cable (PROFINET or USB-PPI depending on CPU) is connected and online access is functional.
- No active process is being controlled by the digital output that will be reconfigured as a PWM output.
Step-by-Step Resolution
The procedure below resolves the 0x80D0 condition in the order that has been empirically validated on 1214C DC/DC/DC firmware V3.0.x.
Step 1 - Confirm CPU Output Type
Open the device configuration in TIA Portal, select the CPU, and examine the part number. If the order code contains RLY or the catalog entry indicates relay output, PWM is not supported on that physical output. Either select a different PLC or use an S7-1200 signal module or external drive for the PWM requirement.
Step 2 - Configure the Pulse Channel
Per the Siemens function manual Configuring a pulse channel for PWM or PTO:
- In the project tree, open Devices & Networks and select the CPU.
- In the device view, select Pulse Generator (PTO/PWM) from the properties pane.
- Choose the pulse generator (PWM1, PWM2, ...).
- Set the operating mode to PWM.
- Assign the output (Q0.0 for PWM1, Q0.1 for PWM2 by default).
- Select a conservative time base: microseconds or milliseconds depending on application.
- Set Pulse duration format to either hundredths (percent) or absolute value per S7-1200 system manual.
- Define an initial cycle time (e.g. 100 µs) and initial pulse width (e.g. 10 hundredths = 10%).
- Click Compile and then download the hardware configuration alone (right-click the device → Download to device → Hardware configuration only).
Step 3 - Replace Manual Hardware ID With the Symbolic Constant
The hardware identifier for the pulse channel is a symbolic tag that resolves at compile time. To use the constant tag:
- Open the
CTRL_PWMinstance DB or the block in which the call resides. - Delete any literal value (for example
16#0009) at thePWMinput. - From the dropdown selector, choose Pulse_1[PTO/PWM] (the literal name depends on firmware; V4.x uses
Pulse_1). - Verify the small constant tag symbol appears in the rung or network.
- Compile the block.
PWM input. Although the numeric value is identical to the symbolic tag, TIA Portal does not perform the same cross-checks at compile time, and certain firmware/Portal combinations refuse to bind the descriptor at run-time, returning 0x80D0.
Step 4 - Perform a Manufacturing Reset of the CPU
This step has been confirmed as the resolution in multiple field reports on firmware V3.0.x.
- Disconnect all outputs that could be affected by the reset.
- In TIA Portal, select the CPU in the project tree.
- Right-click and choose Online & Diagnostics → Functions → Reset to factory settings.
- Confirm the prompt. The CPU goes to STOP and erases all retentive data, the IP address, and the hardware configuration.
- Power-cycle the PLC if required by the firmware version.
Step 5 - Re-Download Hardware Configuration
- After the reset, reconnect online to the CPU.
- Compile the hardware configuration (right-click device → Compile).
- Download the hardware configuration first, before downloading the software blocks.
- Verify in the online diagnostics that the pulse generator is shown as Enabled.
Step 6 - Re-Download Software Blocks
- Compile all blocks (project tree → right-click → Compile all).
- Download all blocks to the CPU.
- Set the CPU to RUN.
- Monitor the
STATUSoutput ofCTRL_PWMin the watch table.
Verification Procedure
After the corrective steps, verify that the PWM output is operating correctly:
- In TIA Portal, add a watch table with the
CTRL_PWMinstance DB tags:STATUS,DUTY,PERIOD, and the booleanRUN. - Force
RUNto TRUE. - Confirm
STATUSreads16#0000on each scan. - Use an oscilloscope or logic analyzer on the physical output terminal (Q0.0 or Q0.1) and verify the waveform matches the configured period and duty cycle. A conservative test point of
PERIOD = 1000 msandDUTY = 50%produces an audible click if wired to a piezo buzzer and is visible on a multimeter as approximately half-scale average voltage. - Toggle
DUTYfrom 10 to 90 and confirm the waveform tracks.
PWM Configuration Parameters
The S7-1200 PWM hardware setup exposes the following key parameters. Values outside the documented ranges produce a configuration error during hardware compile rather than the 0x80D0 status, but values that are technically valid yet incompatible with the connected load are a common commissioning pitfall.
| Parameter | Type | Typical range | Notes |
|---|---|---|---|
| Time base | Enumeration | 1 ms / 0.1 ms / 1 µs | Resolution and maximum period depend on selection |
| Pulse duration format | Enumeration | Hundredths (percent) / Absolute value | Absolute value uses the time base unit |
| Cycle time (period) | UINT | 4 to 16,777,215 base units | 1 µs base: ~16.7 s maximum period |
| Initial pulse width | UINT | 0 to cycle time | Value greater than cycle time is rejected |
| Hardware ID | HW_IO (HWn) | Symbolic constant | Use the PLC tag, not the numeric value |
Troubleshooting Matrix
| Observed symptom | Probable cause | Corrective action |
|---|---|---|
| STATUS = 16#80D0, output silent | Pulse channel not enabled in HW config | Configure pulse generator, compile, download HW |
| STATUS = 16#80D0, HW config visible | Stale PLC hardware image | Manufacturing reset, re-download HW then SW |
| STATUS = 16#80D0, manual numeric HW ID | Bypassed symbolic validation | Replace numeric ID with PLC constant tag |
| STATUS = 16#80D0, relay-output CPU | Hardware does not support PWM on physical output | Replace CPU with DC-output variant or use external module |
| STATUS = 16#80A1 | Hardware ID does not refer to a pulse generator | Re-select the constant tag from the dropdown |
| STATUS = 16#8090 | Module does not support the function | Verify the order number supports PWM per KB 109811546 |
| STATUS = 16#80C0, output silent | Output is forced or overridden | Disable force table entries |
| STATUS = 0, but waveform absent on scope | Wiring fault or wrong terminal | Verify terminal assignment; check sink/source jumper |
Firmware Update Considerations
If the manufacturing reset does not clear the 0x80D0 condition, or if the issue reproduces immediately on every new project, update the CPU firmware. The following procedure applies to S7-1200 CPUs with SD card slot or online update capability:
- Identify the current firmware version (Online & Diagnostics → Diagnostics → CPU Information).
- Download the matching firmware update file from Siemens Industry Online Support for the exact article number.
- Place the firmware file on a formatted SIMATIC memory card or use the online update dialog.
- Perform the firmware update. The CPU automatically restarts.
- Repeat the manufacturing reset and re-download procedure.
Best Practices
- Always configure the pulse generator in the device configuration before inserting the
CTRL_PWMcall in code. Inserting the call first causes TIA Portal to auto-generate a placeholder HW ID that may not match the physical channel. - Use the named constant tag for the
PWMinput. Code review checklist should require the symbolic name, not the literal value. - When migrating projects between TIA Portal versions, perform a "Compile all (rebuild)" operation and re-download the hardware configuration before testing PWM behavior.
- Document the firmware version in the project properties. Code generated for V3 may not bind correctly to V4 hardware descriptors and vice versa.
- Periodically export the device configuration to a separate archive. The hardware image is the single most common cause of non-zero STATUS returns from
CTRL_PWM.
What does S7-1200 CTRL_PWM STATUS 0x80D0 mean?
STATUS 16#80D0 indicates that the pulse generator channel referenced by the PWM input is not enabled in the CPU's run-time hardware image. Although the code is documented in the high-speed counter chapter, the same diagnostic is returned by CTRL_PWM when the channel descriptor cannot be bound to a physical output. Verify the pulse generator is configured in the device configuration and that the PLC was reset to factory settings before the most recent hardware download.
Can I type the numeric hardware ID 16#9 into the CTRL_PWM PWM input?
Although the value is numerically identical to the Pulse_1[PTO/PWM] constant tag, manual entry bypasses the symbolic cross-check performed at compile time. On firmware V3.0.x in combination with TIA Portal V11 SP2 Update 4, the run-time rejects the descriptor and returns 0x80D0. Always select the constant tag from the dropdown selector or via the PLC tag table.
Why does my relay-output CPU show 0x80D0 on CTRL_PWM?
Relay outputs (AC/DC/RLY and DC/DC/RLY CPU variants) cannot source a high-frequency PWM signal because the mechanical relay cannot switch faster than a few tens of hertz. TIA Portal allows the pulse generator configuration to be created, but the PLC rejects it at run-time. Replace the CPU with a DC-output variant (for example, 1214C DC/DC/DC, order code ending 0XB0) or interface to an external solid-state module.
Does performing a manufacturing reset fix the 0x80D0 error?
In multiple field cases on the 1214C DC/DC/DC with firmware V3.0.1, a manufacturing reset followed by a recompile and re-download of hardware and software blocks cleared the 0x80D0 condition. The reset erases any stale hardware descriptor held in non-volatile memory that is causing the mismatch between the project configuration and the run-time image.
Which Siemens S7-1200 CPUs support PWM and what is the maximum frequency?
Per Siemens KB 109811546, all S7-1200 CPUs with transistor (DC) outputs support PWM. The 1211C, 1212C, and 1214C provide two PWM-capable outputs (Q0.0 and Q0.1); the 1215C and 1217C provide four. The maximum PWM frequency is 100 kHz. Period and duty cycle can be changed during run-time within the limits defined by the selected time base.