Creating Operator-Modifiable Calculation Inputs in WinCC: Connecting I/O Fields to CFC Math Blocks via OpAnL

Creating Operator-Modifiable Calculation Inputs in WinCC: Connecting I/O Fields to CFC Math Blocks via OpAnL

In SIMATIC PCS 7, standard arithmetic calculation blocks (such as Mul_R FC63, Add_R, and Div_R) lack the s7_m_c system attribute and cannot generate WinCC tags directly. To allow operators to modify an input parameter dynamically from a WinCC I/O field, place an APL analog operator block (OpAnL FB1866) in the CFC chart. Connect OpAnL.Out to the input pin of Mul_R. When you compile the OS, WinCC automatically creates the structured tag for OpAnL. In WinCC Graphics Designer, bind the I/O field (or standard APL block icon) to OpAnL.SP_LiOp or OpAnL.SP_Int, enabling secure, authorized operator setpoint entry.

Table of Contents

The s7_m_c Attribute: Why Standard Math Blocks Are Not Taggable

When engineers build process calculations in Continuous Function Charts (CFC)—such as mass flow temperature compensation, heat duty calculations, or ratio blending—they utilize elementary arithmetic function blocks from the standard library (such as Mul_R FC63 for real multiplication, Add_R FC60 for addition, and Div_R FC61 for division).

A frequent stumbling block occurs when an engineer attempts to expose a multiplication factor or divisor to the operator on the WinCC OS screen. When opening WinCC Tag Management or the WinCC Graphics Designer tag browser, the inputs to Mul_R cannot be found. This occurs because elementary math functions are pure algorithmic routines without instance data blocks. They lack the s7_m_c = 'true' attribute required by the AS-OS compiler to generate WinCC tags.

The APL Operator Block Concept: OpAnL vs Raw Static Constants

In the SIMATIC PCS 7 Advanced Process Library (APL), operator input values must pass through dedicated supervisory blocks. For analog values, the standard block is OpAnL (Analog Value Operation, FB1866):

  1. Full OCM Support: OpAnL possesses the s7_m_c attribute on its setpoint and operator inputs, automatically creating structured WinCC tags during OS compile.

  2. Built-in Engineering Ranges and Limits: OpAnL includes configurable high and low operator entry limits (SP_HiLim, SP_LoLim), engineering units (PV_Unit), and decimal place formatting, preventing operators from entering dangerous, out-of-range numbers.

  3. Audit Trail and Operating Messages: When an operator adjusts the value from WinCC, OpAnL generates an operator intervention message in the WinCC Alarm Logging journal with username, old value, and new value.

Step-by-Step CFC Interconnection and OS Compilation Workflow

Follow this sequence in CFC and SIMATIC Manager to implement dynamic calculation inputs:

  1. Place OpAnL in CFC: Open the target CFC chart. Drag OpAnL (FB1866) from the APL library catalog into the chart. Rename it meaningfully, such as Ratio_Factor.
  2. Configure Range and Default: Double-click OpAnL. Set SP_LoLim (e.g., 0.1), SP_HiLim (e.g., 5.0), and initial internal setpoint SP_Int (e.g., 1.0).
  3. Wire to Math Block: Interconnect OpAnL.Out to input pin In2 of the arithmetic block Mul_R.
  4. Compile AS Program: Execute Charts > Compile > Changes only.
  5. Execute OS Compile: In SIMATIC Manager, right-click the OS project and select Compile. The compiler registers Ratio_Factor in WinCC Tag Management with all associated structure tags.

Binding WinCC I/O Fields and Standard APL Faceplates

In WinCC Graphics Designer, the operator interface can be implemented in two ways:

  1. Standard APL Block Icon: Drag the standard OpAnL block icon from @PCS7TypicalsAPLV8.pdl into your process graphic. At runtime, clicking the icon opens the full APL faceplate where operators view trends, limits, and type new values.

  2. Direct WinCC I/O Field: If a compact embedded input box is preferred on the process graphic:

  • Insert an I/O Field from the Smart Objects palette.
  • Under Properties > Output/Input > Output Value, bind the tag to: Plant/Area/Ratio_Factor.SP_Op#Value.
  • Set the field type to Input/Output and format to Decimal (999.99).

Operator Input Integration Method Comparison

The following table compares architectural methods for exposing calculation parameters to operators:

Engineering MethodCFC Blocks UsedOS Alarming & Audit TrailRange Limit ProtectionRecommended Industrial UseAPL OpAnL BlockOpAnL (FB1866) + Mul_RYES (Integrated operator logs)YES (SP_HiLim / SP_LoLim)Flagship PCS 7 Standard PracticeClassic Library Op_AOp_A (FB45) + Mul_RYES (Classic PCS 7 messages)YES (Range limits)Legacy PCS 7 V6/V7 migrationsCustom SCL BlockUser FB with s7_m_cCustom programming requiredCustom code requiredSpecialized mathematical equationsRaw DB with WinCC TagShared DB + Mul_RNONO (Operator can enter any value)Strictly Forbidden in DCS systems

Verification

Verify dynamic parameter modification through the following steps:

  1. Open WinCC Runtime. Locate the newly created I/O field or OpAnL block icon.
  2. Click the field and enter a new multiplication factor (e.g., 2.5). Press Enter.
  3. Open the CFC chart online in Test Mode. Confirm that OpAnL.Out reflects 2.5.
  4. Verify that Mul_R computes the output correctly (e.g., Input 10.0 * Factor 2.5 = Output 25.0).
  5. Attempt to enter a value exceeding SP_HiLim (e.g., 99.0). Confirm that WinCC rejects the entry with an out-of-range advisory.

Limitations and Operational Precautions

Consider these operational rules when implementing operator inputs:

  1. Never Allow Division by Zero: If feeding an operator input into a division block (Div_R), always place a limit or minimum clamping block (SelA02In or Polygon) to prevent Div_R from dividing by zero, which results in NaN (Not a Number).

  2. Operator Authorization: Ensure the OpAnL block icon or I/O field is assigned appropriate user authorization (e.g., Level 5 or Level 6 in WinCC User Administrator) to prevent unauthorized personnel from altering plant calculation factors.

  3. Signal Status Handling: Verify that OpAnL generates valid signal status (ST = 16#80), ensuring downstream APL controllers do not treat the calculated value as an uncertain or bad sensor signal.

Engineer FAQ

How do I restrict the minimum and maximum value an operator can enter?

Configure the SP_LoLim and SP_HiLim parameters on OpAnL in CFC, which restrict the input limits in the WinCC faceplate and I/O field.

What parameter on OpAnL stores the engineering units (e.g., kg/h or %)?

The PV_Unit parameter defines the engineering unit code according to the IEC 61987 standard, which renders automatically on the WinCC faceplate.

Can I use OpDi01 for Boolean operator switches in CFC?

Yes, OpDi01 is the digital counterpart to OpAnL, providing a secure operator toggle button for Boolean logic inputs.

Technical References

Related Articles

Related Tags

  • OpAnL
  • CFC Math Blocks
  • Mul_R
  • WinCC I/O Field
  • s7_m_c
  • Operator Input
6 respuestas