Developing Custom Motor Temperature Tripping Logic in SCL for SIMATIC PCS 7 - 6-RTD Combinations vs Standard Interlock Blocks

Developing Custom Motor Temperature Tripping Logic in SCL for SIMATIC PCS 7 - 6-RTD Combinations vs Standard Interlock Blocks

In SIMATIC PCS 7, implementing multi-sensor thermal protection logic for electric motors—such as evaluating 6 resistance temperature detectors (RTDs) across winding and bearing zones to trip under 2-out-of-3 or specific combinatorial High-High temperature conditions—can be programmed using Structured Control Language (SCL) or configured using standard APL interlock blocks (Intlk08 / Intlk04). When writing custom SCL code, syntax errors typically stem from using 'VAR' instead of 'BEGIN' before executable logic, omitting semicolons, or improper Boolean assignments. Alternatively, deploying standard library interlock blocks eliminates custom code, provides native operator faceplates, and supports maintenance bypass tracking.

Table of Contents

Thermal Monitoring Requirements in Large Industrial Motors

Medium- and high-voltage industrial motors (compressors, large pumps, crushers, and kilns) deploy multiple embedded resistance temperature detectors (RTDs, typically PT100 or Cu10) to protect stator windings and drive-end / non-drive-end bearings from thermal destruction:
- Typical 6-RTD Configuration:
* 3 RTDs embedded within the stator windings (Phase U, V, W).
* 2 RTDs embedded in the drive-end (DE) and non-drive-end (NDE) bearings.
* 1 RTD monitoring cooling air or oil sump temperature.
- Complex Tripping Criteria:
* To avoid nuisance trips caused by sensor wire breaks or localized hot spots, trip logic frequently evaluates combinatorial voting:
1. Condition 1: $R_1 \land R_2 \land R_3$ High-High = 1 (All three winding phases hot).
2. Condition 2: $R_4 \land R_5 \land R_6$ High-High = 1 (Both bearings and lube oil hot).
3. Condition 3: $R_1 \land R_4 \land R_5$ High-High = 1 (Cross-zone thermal coupling).
4. Condition 4: $R_2 \land R_5 \land R_6$ High-High = 1.
5. Condition 5: $R_3 \land R_5 \land R_6$ High-High = 1.
* If any of these combinatorial conditions evaluates TRUE, the master motor trip signal must de-energize instantly.

Writing Clean Combinatorial Protection Logic in SCL

When implementing this voting logic inside an SCL function block (FUNCTION_BLOCK FB 1600 Motor_Therm_Prot):
1. Common SCL Syntax Traps:
- VAR vs BEGIN: VAR declares internal static variables; executable code statements must strictly begin after the keyword BEGIN.
- Boolean Assignments: In SCL, assignment is written := (e.g. Trip := TRUE;), whereas conditional comparison in an IF statement uses = (e.g. IF R1 AND R2 THEN).
- String vs Boolean Literals: Never write Boolean states in quotation marks (~true~ or 'TRUE'). SCL keywords TRUE and FALSE are native language constants.

  1. Optimized SCL Implementation:
    scl FUNCTION_BLOCK FB 1600 TITLE = 'Motor 6-RTD Thermal Tripping Matrix' VAR_INPUT R1_HH : BOOL; // Winding Phase U High-High R2_HH : BOOL; // Winding Phase V High-High R3_HH : BOOL; // Winding Phase W High-High R4_HH : BOOL; // Bearing DE High-High R5_HH : BOOL; // Bearing NDE High-High R6_HH : BOOL; // Lube Oil / Auxiliary High-High END_VAR VAR_OUTPUT Trip : BOOL; // Master Thermal Trip Output END_VAR BEGIN // Combinatorial Trip Logic: Trip := (R1_HH AND R2_HH AND R3_HH) OR (R4_HH AND R5_HH AND R6_HH) OR (R1_HH AND R4_HH AND R5_HH) OR (R2_HH AND R5_HH AND R6_HH) OR (R3_HH AND R5_HH AND R6_HH); END_FUNCTION_BLOCK
    Note: Directly assigning the Boolean expression eliminates unnecessary IF/THEN/ELSE branching, reducing CPU execution cycles.

Alternative Architectural Approach - Standard APL Interlock Blocks

While custom SCL is compact, standard SIMATIC PCS 7 engineering guidelines recommend deploying the Advanced Process Library Interlock Blocks (Intlk08 FB 1875 or Intlk04 FB 1874):
- Why Use APL Interlock Blocks:
* Zero Coding: Implemented purely through graphical CFC chart connections.
* Operator Visualization: Generates a standard APL block icon and faceplate (@pg_Intlk08.pdl).
* First-In Diagnostic Detection: The faceplate records which specific sensor combination triggered the trip first, logging the event with millisecond precision.
* Maintenance Bypassing: Certified operators can apply software bypasses to a defective RTD channel without recompiling or downloading controller code.

Custom SCL Implementation vs Standard APL Interlock Blocks Table

The following table contrasts custom SCL coding with standard APL interlock blocks:

Engineering DimensionCustom SCL Block (FB 1600)Standard APL Intlk08 / Intlk04Engineering EffortWrite, compile, and test SCL sourceDrag and drop in CFC; wire inputsHMI Operator FaceplateRequires custom faceplate creationBuilt-in standard APL faceplateFirst-In Alarm DetectionRequires manual logic codingAutomatic hardware timestampingMaintenance Bypass CapabilityRequires manual logic codingBuilt-in faceplate bypass controlLibrary Lifecycle MaintenanceCustomer maintains source across updatesMaintained and tested by SiemensController CPU Memory FootprintMinimal (few bytes)Moderate (Standard APL overhead)

Verification

To confirm that the motor thermal tripping logic functions deterministically:
1. Compile the SCL block in STEP 7 and place it into a CFC chart, connecting Trip to the Protect input of the motor block (MotL).
2. Switch CFC to Test Mode (Ctrl + T).
3. Test Condition 1: Force R1_HH = 1, R2_HH = 1, and R3_HH = 1.
- Verify that output Trip transitions to 1 immediately.
- Set R3_HH = 0: verify that Trip resets to 0.
4. Test Condition 3: Force R1_HH = 1, R4_HH = 1, and R5_HH = 1.
- Verify that Trip fires immediately.
5. In WinCC Runtime, confirm that the motor faceplate displays the interlock protection trip icon and inhibits motor restart.

Limitations and Operational Precautions

When programming protective tripping logic in PCS 7:
1. Fail-Safe Principle: In physical wiring, temperature trip switches are typically normally-closed (NC), de-energizing on alarm (0 = Trip). Ensure the SCL logic or channel driver inversion (~-~) correctly accounts for fail-safe active-low inputs.
2. De-bouncing and Time Delays: Raw analog inputs can fluctuate around threshold limits. Always utilize analog monitoring blocks with hysteresis (MonAnL with deadband) or downstream pulse/delay timers (Timer_P) to prevent trip chatter.
3. Safety Instrumented Systems (SIS): If motor over-temperature protection is classified under SIL (Safety Integrity Level) safety loops, logic must be programmed in S7 F-Systems using fail-safe F-blocks (F_QU_MOD, F_INTLK) rather than standard SCL.

Engineer FAQ

Why did the SCL compiler report 'Unknown statement' at VAR?

Because executable logic was placed after VAR instead of after BEGIN. In SCL, VAR is reserved strictly for declaring variables, while BEGIN marks the start of procedural execution statements.

What is the difference between '=' and ':=' in SCL?

:= is the assignment operator used to store a value into a variable (e.g. A := B;). = is the relational comparison operator used in conditional expressions (e.g. IF A = B THEN).

Where can I learn standard PCS 7 SCL programming conventions?

Consult Hans Berger's reference Automating with STEP 7 in STL and SCL, the SCL for S7-300/400 Manual, and the official PCS 7 APL Styleguide published on SIOS.

How do I connect the SCL trip output to an APL motor block?

In CFC, connect the SCL block output Trip to the motor block's Protect input pin (or pass it through an inverter if using active-low de-energize-to-trip conventions).

Technical References

Related Articles

Related Tags

  • PCS7_SCL
  • Motor_Protection
  • RTD_Monitoring
  • Interlocks
  • Intlk08
  • SCL_Syntax
  • Thermal_Tripping
6 respuestas