Locating Real Number Comparator Blocks and Implementing CompAn02 in SIMATIC PCS 7

Locating Real Number Comparator Blocks and Implementing CompAn02 in SIMATIC PCS 7

If the real number comparison operator 'CMP_R' is missing from the 'Compare' family in the CFC catalog in SIMATIC PCS 7 V9.0 SP2, it is because the block exists in the global CFC library rather than the local AS chart folder. To retrieve it, open the CFC catalog, select the 'Libraries' tab, expand 'CFC Library' -> 'ELEMENTA' -> 'Blocks', and drag 'CMP_R' into your chart. Alternatively, for Advanced Process Library (APL) compliance, use the technological comparator block 'CompAn02' (FB1816) from the APL library, which supports structured REAL values, signal status (ST), deadband, and faceplate integration.

Table of Contents

Executive Summary

When developing control logic in SIMATIC PCS 7 Continuous Function Chart (CFC) V9.0 SP2, engineers frequently need to compare floating-point analog process values (REAL). A common point of confusion occurs when browsing the CFC catalog: under the local 'Blocks' tab, the 'Compare' family appears empty or lacks the standard CMP_R operator. This occurs because the 'Blocks' tab displays only blocks already instantiated in the active CPU program. This guide clarifies the distinction between local project blocks and global library catalogs, explains the location of elementary operators in the ELEMENTA library, and demonstrates how to deploy the modern APL CompAn02 comparator.

Architectural and System Mechanics

CFC Catalog Architecture and Analog Comparison Models in PCS 7:

  • CFC Catalog Organization:
  • 'Blocks' Tab (Lower Left): Represents the active offline block folder of the current S7 program. It only displays blocks that have already been placed in charts or imported into the project.
  • 'Libraries' Tab (Upper Left): Displays all installed system libraries, master data libraries, and global elementary blocks.
  • Elementary Operator CMP_R:
  • Located in: CFC Library / ELEMENTA / Blocks / CMP_R.
  • Operates on basic 32-bit IEEE 754 floating-point values (REAL).
  • Inputs: IN1 (REAL), IN2 (REAL). Outputs: LT (<), LE (<=), EQ (==), GE (>=), GT (>).
  • APL Technological Comparator CompAn02 (FB1816):
  • Designed for modern PCS 7 APL architectures.
  • Operates on structured analog values (Struct containing .Value and .ST quality code).
  • Features configurable hysteresis (Hys), inversion flags, signal status propagation, and WinCC faceplate integration.

Step-by-Step Engineering and Implementation Procedure

Step 1: Locate CMP_R in the CFC Elementary Library

  1. Open any CFC chart in SIMATIC Manager.
  2. In the catalog window on the left side, select the Libraries tab.
  3. Expand CFC Library -> expand the ELEMENTA folder -> expand Blocks.
  4. Locate CMP_R in the list.
  5. Drag and drop CMP_R directly onto your CFC chart sheet.
  6. Once placed, CMP_R automatically appears under the 'Compare' family in your project's local 'Blocks' tab.

Step 2: Evaluate Using APL CompAn02 for Technological Analog Values

If your analog signals originate from APL channel drivers (Pcs7AnIn) or technological blocks (MonAnL, PIDConL), use CompAn02:
1. In the CFC catalog, select the Libraries tab.
2. Expand PCS 7 AP Library V90 -> Blocks -> Math.
3. Select CompAn02 (FB1816) and drag it into your chart.

Step 3: Wire and Parameterize CompAn02

  1. Connect the structured process value: Pcs7AnIn.PV_Out -> CompAn02.In1.
  2. Connect the comparison setpoint or static value: CompAn02.In2.
  3. Configure the comparison condition:
    - Set CompOp = 0 for In1 > In2, CompOp = 1 for In1 >= In2, etc.
    - Set hysteresis Hys (e.g., 0.5 engineering units) to prevent high-frequency chattering around the switching threshold.

Step 4: Compile the Chart Folder

Execute a delta compilation in CFC; verify that the comparator compiles with 0 errors.

Verification

To verify comparator functionality:
1. Open the CFC chart in test mode (Debug -> 'Test Mode').
2. Adjust the analog input signal above the threshold; confirm that the output (Out on CompAn02 or GT on CMP_R) transitions from 0 to 1.
3. Lower the signal below the hysteresis band; confirm that the output resets cleanly to 0.
4. For CompAn02, verify that if the input quality code degrades (ST = 16#00), the block flags bad quality at its Out.ST pin.

Limitations and Operational Precautions

Operational precautions:
- Elementary CMP_R does not evaluate signal quality (ST). If an analog transmitter fails, CMP_R continues evaluating the frozen raw value, potentially causing dangerous control decisions.
- Never connect structured pins (Pcs7AnIn.PV_Out) directly to elementary CMP_R inputs without decomposing the structure, as CFC will flag a data type mismatch.
- CompAn02 consumes more work memory than elementary CMP_R, but provides essential fail-safe status handling required for industrial automation.

Engineer FAQ

Q: Why was CMP_R missing from my project's Blocks folder?

A: Because it had not yet been placed in any chart. The Blocks folder only lists blocks already imported into the current CPU program.

Q: Where is CMP_R located in the standard libraries?

A: Under CFC Library / ELEMENTA / Blocks / CMP_R.

Q: What is the advantage of CompAn02 over CMP_R?

A: CompAn02 supports structured analog types with signal status (ST), hysteresis to prevent chattering, and WinCC faceplate integration.

Q: Can CompAn02 compare a structured Real with an elementary Real?

A: Yes. You can enter an elementary real number directly into In2.Value while leaving In2.ST at good quality (16#80).

Q: Does CompAn02 consume a Process Object (PO)?

A: No, CompAn02 is a mathematical utility block and does not consume OS or AS Process Objects.

Technical References

Related Articles

Related Tags

CMP_R, CompAn02, CFC Elementary Blocks, APL Math, Analog Comparison

20 respuestas