Configuring SINAMICS S120 Working Hour Alarm via S7-1200 PLC

David Krause12 min read
S7-1200SiemensTutorial / 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

Monitoring accumulated motor runtime on a SINAMICS S120 drive and surfacing it as a maintenance alarm on an HMI is a common commissioning requirement. The drive itself exposes the operating hour counter through parameter r0650 (the read value) and parameterizes its threshold through P0650 (the setpoint used for the maintenance interval). When the runtime exceeds the configured value, the drive raises alarm A01590 and, if configured to do so, fault F01590.

This article walks through the full chain: drive parameter setup, alarm acknowledgment behavior, SINA_PARA acyclic parameter access from an S7-1200 CPU (specifically an S7-1215) using TIA Portal, and HMI visualization. The implementation pattern applies to any S7-1200/S7-1500 PLC paired with a SINAMICS S120 CU320-2 (or CU320) Control Unit.

The drive is typically integrated into PROFINET via a GSD file, which is the official Siemens-recommended method for the S7-1500/S7-1200 motion control environment. Refer to Configuring SINAMICS S120 in TIA Portal for the network integration steps that precede the parameter logic below.

Prerequisites

  • TIA Portal V17 or later (V18/V19 supported the DriveLib V17-V19 blocks; align TIA, DriveLib, and S120 firmware for clean compilation).
  • SIMATIC S7-1215 DC/DC/DC or DC/DC/RLY CPU, firmware V4.4 or higher recommended.
  • SINAMICS S120 with CU320-2 DP/PN Control Unit, firmware V5.x or V6.x. Older CU320 (non-2) units also expose r0650/P0650 but require matching STARTER/Startdrive versions.
  • Siemens DriveLib (SiemensDrivesLib or SINAMICS_Blocks) installed in TIA Portal. The library provides the SINA_PARA function block used for acyclic read/write of drive parameters.
  • Startdrive V17/V18/V19 in TIA Portal or STARTER V5.x for offline parameter configuration of the S120.
  • GSD file for the SINAMICS S120 installed in TIA Portal hardware catalog (typically "SINAMICS S120 CU320-2 PN Vx.x").
  • PROFINET network between PLC and drive with logical IP addressing configured.
  • HMI: SIMATIC HMI (KTP1200, TP1500, Comfort Panel, or WinCC Runtime) connected to the S7-1215 via the same PROFINET/subnet.
The alarm behavior (warning-only vs. warning + fault) and the threshold value are stored in the drive. The PLC only needs to read these values; it does not need to be the source of truth for the timer.

SINAMICS S120 P0650 and r0650 Parameters

The runtime counter on the SINAMICS S120 is implemented as a pair of parameters. Knowing the difference between them is critical when writing the PLC code.

Parameter Type Description Units Range
r0650 Read-only Actual operating hours of the motor (live counter) hours 0 – 4,294,967,295 (DWord)
P0650 Read/Write Operating hours threshold for maintenance alarm (setpoint) hours 0 – 65,535 (Word)
r2122 Read-only CO/BO: Alarm word (shows active alarm numbers) – Bit-coded
r2132 Read-only CO/BO: Status word, faults/alarms 1 – Bit-coded
r2134 Read-only CO/BO: Status word, faults/alarms 2 – Bit-coded

Behavior: when the runtime r0650 crosses P0650, the drive raises alarm A01590 "Drive: Operating hours counter has reached the set threshold". If you have configured the fault reaction in P2118/P2119 to escalate the alarm to a fault, F01590 is also triggered. By default, the alarm is warning-only and can be acknowledged via the standard mechanism.

To confirm the threshold: open Startdrive, navigate to the S120 drive online, and verify P0650 = 1000. To reset the counter after a maintenance event, write 0 to P0651 (motor operating hours maintenance interval) or use the standard parameter reset for the maintenance counter, depending on firmware.

Alarm A01590 and F01590 Configuration

The drive-side configuration determines whether A01590 remains a warning or escalates to a fault. Both behaviors can be combined with the PLC reading the runtime.

Alarm/Fault Meaning Default Reaction Relevant Parameter
A01590 Operating hours threshold reached WARNING – drive continues running P0650
F01590 Same condition, escalated to fault OFF2 stop (configurable) P2100[0] = 1590, P2101[0] = reaction (e.g., OFF2)

For a typical maintenance scenario where the line must continue running until a planned shutdown, leave F01590 disabled and rely on A01590 plus an HMI message. If you want a hard shutdown at 1000 h, configure:

P2100[0] = 1590 (assign fault number) P2101[0] = 2 (OFF2 reaction) P2118[0] = 1590 (alarm type) P2119[0] = 1 (fault, not warning)

Reference: Siemens FAQ 41746959 – Reading out alarm A01590 via the PLC documents the standard acyclic read pattern. The PLC can read both r0650 (raw runtime) and r2122/r2134 (alarm status word) without changing the drive configuration.

SINA_PARA Function Block Overview

SINA_PARA is the standard Siemens block for acyclic parameter access over PROFINET/PROFIBUS using the DPV1/Record-Data mechanism (record read/write). It is shipped in DriveLib and works with all SINAMICS platforms.

Key inputs:

  • ID (HW identifier of the PROFINET IO device / drive) – link to the device from the PLC's device view.
  • PARAM (DWord) – the parameter number to access.
  • INDEX (Word) – parameter index (0 for non-indexed parameters).
  • VALUE (Word, in/out) – read result or value to write.
  • RD_WR (Bool) – 0 = read, 1 = write.
  • REQ (Bool) – rising edge starts a request.
  • DONE, BUSY, ERROR, STATE – status outputs.

Acyclic parameter access is rate-limited (one outstanding request per drive at a time). For monitoring r0650 and P0650, use two SINA_PARA instances, or poll the same parameter sequentially using a state machine.

Important: SINA_PARA can only read or write one parameter per call. If you need multiple parameters, run them sequentially with a debounce timer (e.g., 200 ms between requests) to avoid overwhelming the acyclic channel.

PLC Program Structure (TIA Portal, SCL)

The following TIA Portal V18 SCL example shows an FB that periodically reads r0650 from the S120 and exposes it to the HMI. It also reads P0650 for display and computes a Boolean bThresholdExceeded for an HMI indicator. Create an FB called FB_S120_MaintenanceMonitor in the S7-1215 program and instantiate a single instance DB.

FB_S120_MaintenanceMonitor (SCL)

FUNCTION_BLOCK FB_S120_MaintenanceMonitor
VAR_INPUT
    i_hwID : HW_IO;            // HW identifier of SINAMICS S120 PROFINET device
    i_pollTime : TIME := T#500ms; // poll interval
END_VAR
VAR_OUTPUT
    o_runtimeHours : DWORD;    // r0650 – motor operating hours
    o_thresholdHours : WORD;   // P0650 – configured threshold
    o_alarmActive : BOOL;       // A01590 status
    o_error : BOOL;
    o_errorID : WORD;
END_VAR
VAR
    siParaRead : SINA_PARA;     // instance 1: read r0650
    siParaThreshold : SINA_PARA;// instance 2: read P0650
    siParaAlarmWord : SINA_PARA;// instance 3: read r2134 (alarm status word)
    tonPoll : TON;
    bReqReadRuntime : BOOL;
    bReqReadThreshold : BOOL;
    bReqReadAlarm : BOOL;
    iState : INT := 0;
    tStep : TIME;
END_VAR

BEGIN
    tonPoll(IN := TRUE, PT := i_pollTime);

    CASE iState OF
        0: // idle – wait for poll timer
            IF tonPoll.Q THEN
                tonPoll(IN := FALSE);
                iState := 1;
            END_IF;

        1: // trigger read r0650 (motor hours counter)
            siParaRead.REQ := FALSE;
            siParaRead.ID := i_hwID;
            siParaRead.PARAM := 650;        // r0650
            siParaRead.INDEX := 0;
            siParaRead.RD_WR := FALSE;
            siParaRead.VALUE := 0;
            bReqReadRuntime := TRUE;
            iState := 2;

        2: // wait for r0650 completion
            siParaRead(
                REQ := bReqReadRuntime,
                ID := i_hwID,
                PARAM := 650,
                INDEX := 0,
                VALUE := o_runtimeHours,
                RD_WR := FALSE,
                DONE => ,
                BUSY => ,
                ERROR => o_error,
                STATE => o_errorID
            );
            IF siParaRead.DONE THEN
                bReqReadRuntime := FALSE;
                o_error := FALSE;
                iState := 3;
            ELSIF siParaRead.ERROR THEN
                bReqReadRuntime := FALSE;
                iState := 99;
            END_IF;

        3: // read P0650 (threshold)
            bReqReadThreshold := TRUE;
            siParaThreshold(
                REQ := bReqReadThreshold,
                ID := i_hwID,
                PARAM := 650,
                INDEX := 1,                 // P0650 indexed
                VALUE := o_thresholdHours,
                RD_WR := FALSE,
                DONE => ,
                BUSY => ,
                ERROR => ,
                STATE =>
            );
            IF siParaThreshold.DONE THEN
                bReqReadThreshold := FALSE;
                iState := 4;
            END_IF;

        4: // read r2134 (alarm status word 2, contains A01590 status)
            siParaAlarmWord(
                REQ := bReqReadAlarm,
                ID := i_hwID,
                PARAM := 2134,
                INDEX := 0,
                VALUE := o_runtimeHours,    // reuse temp, low word used
                RD_WR := FALSE,
                DONE => ,
                BUSY => ,
                ERROR => ,
                STATE =>
            );
            IF siParaAlarmWord.DONE THEN
                bReqReadAlarm := FALSE;
                // A01590 typically maps to a specific bit in r2134; verify via drive parameter list
                // Default mapping: alarm number - 1 = bit position in r2134 (1590 - 1 = 1589, exceeds 16-bit)
                // Use r2122 (alarm word 16-bit) for direct bit check instead:
                o_alarmActive := FALSE; // assignment logic dependent on mapping
                iState := 0;
            END_IF;

        99: // error handler – log, reset, retry next cycle
            o_error := TRUE;
            iState := 0;
    END_CASE;

    // Compute threshold exceeded (used as alternative to alarm status)
    // o_runtimeHours is DWORD; threshold is WORD (max 65535)
    IF o_thresholdHours > 0 AND DWORD_TO_DINT(o_runtimeHours) >= WORD_TO_INT(o_thresholdHours) THEN
        o_alarmActive := TRUE;
    END_IF;
END_FUNCTION_BLOCK
The exact bit mapping of A01590 in r2134 depends on firmware. For a reliable Boolean alarm flag, prefer comparing r0650 >= P0650 in the PLC (as shown) and use SINA_PARA to read the runtime values only. This avoids version-dependent bit math.

Main OB1 call

// Instantiate FB once (e.g., in a cyclic OB or as instance DB)
fbMaintenance(
    i_hwID := "SINAMICS_S120".PROFINET_Interface.HW_ID,  // HW identifier from device configuration
    i_pollTime := T#500ms
);

// Push to HMI tags
"HMI".MotorRuntimeHours := fbMaintenance.o_runtimeHours;
"HMI".MaintenanceThreshold := fbMaintenance.o_thresholdHours;
"HMI".MaintenanceAlarmActive := fbMaintenance.o_alarmActive;
"HMI".MaintenanceError := fbMaintenance.o_error;

HMI Integration (WinCC / TIA Portal)

  1. Create HMI tags connected to the PLC variables: MotorRuntimeHours (DWord), MaintenanceThreshold (Word), MaintenanceAlarmActive (Bool), MaintenanceError (Bool).
  2. Add a numeric output field bound to MotorRuntimeHours with a scaling factor of 1.0 (already in hours).
  3. Add a second numeric field bound to MaintenanceThreshold for reference (operator display).
  4. Add a text list or status indicator bound to MaintenanceAlarmActive: green for "Below threshold", amber for "Service due", red for "Threshold exceeded".
  5. Add an alarm in the HMI tag alarms or in a WinCC message configuration that triggers when MaintenanceAlarmActive transitions from FALSE to TRUE, with text "Motor operating hours exceeded 1000 h – schedule maintenance".
  6. Configure the HMI alarm class to require operator acknowledgment and write the alarm event to the audit trail.
  7. Optional: add a "Reset Maintenance Counter" button protected by an authorization level (e.g., "Service") that writes 0 to P0650 via a separate SINA_PARA call with RD_WR := TRUE.
Drive parameters cannot be written while the drive is running in certain states. The reset button should only be enabled when the drive is in Ready or Off state, and the SINA_PARA call must include write-access credentials if your project uses access protection on the drive.

Drive-Side Commissioning (Startdrive / STARTER)

  1. Open the S120 project in Startdrive, connect online to the CU320-2.
  2. Navigate to Drive > Diagnostics > Operating hours counter.
  3. Set P0650 = 1000 hours.
  4. Set P0651 if you want an additional counter for cumulative service intervals.
  5. Configure alarm response: leave F01590 disabled (default) so the drive only emits A01590.
  6. Save to ROM (RAM to ROM copy) via Copy RAM to ROM.
  7. Verify with the parameter list that the value is stored persistently.

Verification Procedure

  1. Online monitor fbMaintenance.o_runtimeHours in TIA Portal and confirm it increments as the motor runs.
  2. Force P0650 = 5 via Startdrive for testing; restart the drive; run motor until r0650 crosses 5.
  3. Confirm A01590 appears in the S120 fault buffer and in r2122.
  4. Confirm o_alarmActive transitions to TRUE in the PLC online watch table.
  5. Confirm the HMI displays the maintenance message and the runtime value.
  6. Acknowledge the alarm on the HMI; verify o_alarmActive returns to FALSE only after the counter is reset or the threshold is raised.
  7. Restore P0650 = 1000 and save to ROM for production.

Troubleshooting Matrix

Symptom Likely Cause Diagnostic Corrective Action
SINA_PARA returns ERROR with STATE = 1 Incorrect HW identifier Check device view, HW ID of the S120 PROFINET interface Re-link i_hwID to the correct HW ID
SINA_PARA returns STATE = 2 Parameter not available Verify parameter number in Startdrive online parameter list Correct PARAM input; confirm firmware supports the parameter
Runtime value never changes Motor not actually running; PLC reading wrong parameter Monitor r0650 directly in Startdrive Verify OFF1/OFF2 is released and motor is enabled
Alarm A01590 never triggers Threshold not saved or alarm reaction disabled Inspect P0650 online; inspect fault buffer Save to ROM; check P2118/P2119 mapping
Fault F01590 triggers unexpectedly Alarm escalated to fault Inspect P2100/P2101 Set fault reaction to NONE or leave P2119 = 0
HMI does not update Tag connection broken; HMI alarm not configured Inspect HMI connection diagnostics Recompile HMI and verify tag names match PLC symbols
Write to P0650 fails Drive running; access protection active Check drive state; check p7762/p7768 Stop drive before write; supply correct access level
Acyclic calls time out (STATE = 5) PROFINET cable issue; PLC too fast Check port LEDs; increase poll time Increase i_pollTime to 1–2 s for diagnostics

Performance and Timing Notes

Each SINA_PARA acyclic read typically completes in 30–100 ms on PROFINET, depending on controller load and network latency. Three sequential reads therefore need 90–300 ms minimum. For monitoring-only use, a 500 ms–2 s poll interval is appropriate and avoids contention with STARTER/Startdrive online access.

For higher-speed sampling, use cyclic process data (PZD) via the standard telegram mapping (e.g., telegram 1, 2, or 3) and select r0650 as part of a free PZD mapping. This bypasses the acyclic stack and gives sub-10 ms update rates, but requires telegram engineering on both sides. The acyclic pattern shown above is preferred when the parameter does not need to be in the fast PZD path.

Drive Version Compatibility

The block diagram above applies to both CU320 (legacy) and CU320-2 DP/PN. The parameter numbers are stable across firmware versions: P0650, r0650, r2122, r2134. Confirm the exact bit position of A01590 in the alarm status word using the drive's parameter list for your firmware version; on V5.x firmware, the alarm number minus 1 is the bit position modulo word width.

FAQ

Which Siemens function block reads SINAMICS parameters from an S7-1200?

Use SINA_PARA from the Siemens DriveLib (SiemensDrivesLib or SINAMICS_Blocks). It performs acyclic parameter read/write over PROFINET using record data and works on S7-1200 (firmware V4.4+) and S7-1500 CPUs.

What parameter holds the SINAMICS S120 motor operating hours?

Parameter r0650 is the live operating hours counter (read-only, DWord in hours). Parameter P0650 is the threshold at which the drive raises alarm A01590. Both are accessed via SINA_PARA with parameter numbers 650 and the appropriate index.

How do I display alarm A01590 on an HMI?

Read r0650 and P0650 from the PLC using SINA_PARA, compute a Boolean alarm status, and bind that Boolean to an HMI message or status indicator. Configure the HMI to require operator acknowledgment and log the event for audit.

Can I reset the operating hours counter from the PLC?

Yes. Write 0 to P0650 using SINA_PARA with RD_WR := TRUE. The drive must be in a non-running state (e.g., Ready/Off) for the write to be accepted, and the HMI control should be protected by an authorization level.

Why does F01590 trip the drive instead of just warning?

When P2118 maps alarm 1590 to a fault type and P2119 marks it as fault rather than alarm, the drive escalates A01590 to F01590 and executes the configured fault reaction (e.g., OFF2). For maintenance-only alarms, leave F01590 disabled.

Back to blog