Resolving S7-1200 CTRL_PWM Error 0x80D0 PWM Hardware

David Krause11 min read
S7-1200SiemensTroubleshooting
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

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:

  1. 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).
  2. Manual entry of the hardware identifier. Typing the decimal or hex equivalent of Pulse_1[PTO/PWM] (for example 16#9) into the PWM input of CTRL_PWM instead 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.
  3. 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_PWM reports 0x80D0.
Safety Notice: PWM outputs switch at frequencies up to 100 kHz. Do not connect inductive loads (relays, solenoids, motors without free-wheeling diodes) directly to a PWM output. Always use a solid-state interface rated for the switching frequency and verify with an oscilloscope before commissioning.

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_1 rather than Pulse_1[PTO/PWM].

Prerequisites

Before applying the corrective procedure, verify the following:

  1. 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 in 0XB0 for transistor outputs, not 0XB1 or 0XB2 relay variants.
  2. TIA Portal is opened with a project that matches the connected PLC exactly (same article number, same firmware version).
  3. You have a backup of the project, including the device configuration and all blocks, exported to a portable archive.
  4. A programming cable (PROFINET or USB-PPI depending on CPU) is connected and online access is functional.
  5. 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:

  1. In the project tree, open Devices & Networks and select the CPU.
  2. In the device view, select Pulse Generator (PTO/PWM) from the properties pane.
  3. Choose the pulse generator (PWM1, PWM2, ...).
  4. Set the operating mode to PWM.
  5. Assign the output (Q0.0 for PWM1, Q0.1 for PWM2 by default).
  6. Select a conservative time base: microseconds or milliseconds depending on application.
  7. Set Pulse duration format to either hundredths (percent) or absolute value per S7-1200 system manual.
  8. Define an initial cycle time (e.g. 100 µs) and initial pulse width (e.g. 10 hundredths = 10%).
  9. 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:

  1. Open the CTRL_PWM instance DB or the block in which the call resides.
  2. Delete any literal value (for example 16#0009) at the PWM input.
  3. From the dropdown selector, choose Pulse_1[PTO/PWM] (the literal name depends on firmware; V4.x uses Pulse_1).
  4. Verify the small constant tag symbol appears in the rung or network.
  5. Compile the block.
Critical: Do not type the numeric value of the hardware ID into the 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.

  1. Disconnect all outputs that could be affected by the reset.
  2. In TIA Portal, select the CPU in the project tree.
  3. Right-click and choose Online & Diagnostics → Functions → Reset to factory settings.
  4. Confirm the prompt. The CPU goes to STOP and erases all retentive data, the IP address, and the hardware configuration.
  5. Power-cycle the PLC if required by the firmware version.

Step 5 - Re-Download Hardware Configuration

  1. After the reset, reconnect online to the CPU.
  2. Compile the hardware configuration (right-click device → Compile).
  3. Download the hardware configuration first, before downloading the software blocks.
  4. Verify in the online diagnostics that the pulse generator is shown as Enabled.

Step 6 - Re-Download Software Blocks

  1. Compile all blocks (project tree → right-click → Compile all).
  2. Download all blocks to the CPU.
  3. Set the CPU to RUN.
  4. Monitor the STATUS output of CTRL_PWM in the watch table.

Verification Procedure

After the corrective steps, verify that the PWM output is operating correctly:

  1. In TIA Portal, add a watch table with the CTRL_PWM instance DB tags: STATUS, DUTY, PERIOD, and the boolean RUN.
  2. Force RUN to TRUE.
  3. Confirm STATUS reads 16#0000 on each scan.
  4. 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 ms and DUTY = 50% produces an audible click if wired to a piezo buzzer and is visible on a multimeter as approximately half-scale average voltage.
  5. Toggle DUTY from 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:

  1. Identify the current firmware version (Online & Diagnostics → Diagnostics → CPU Information).
  2. Download the matching firmware update file from Siemens Industry Online Support for the exact article number.
  3. Place the firmware file on a formatted SIMATIC memory card or use the online update dialog.
  4. Perform the firmware update. The CPU automatically restarts.
  5. Repeat the manufacturing reset and re-download procedure.
Caution: Firmware downgrades on S7-1200 are not supported. Always update forward only. A downgrade bricks the CPU and requires RMA replacement.

Best Practices

  • Always configure the pulse generator in the device configuration before inserting the CTRL_PWM call 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 PWM input. 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.

Back to blog