How to Scale Analog Values in SIMATIC PCS 7 APL Using Channel Drivers and Conversion Blocks

How to Scale Analog Values in SIMATIC PCS 7 APL Using Channel Drivers and Conversion Blocks

In SIMATIC PCS 7 Advanced Process Library (APL), analog process measurements are scaled from raw fieldbus or I/O signals into real engineering units directly within the input channel driver block Pcs7AnIn (FB1870) by configuring its compound parameter Scale. Unlike classic PLC ladder logic that requires manual mathematical formulas or conversion calls (like FC105 SCALE), Pcs7AnIn automatically handles raw analog-to-digital integer conversion, zero/span normalization, live sensor error filtering, and NAMUR signal status generation. For custom non-linear scaling (e.g., strapping curves for horizontal cylindrical tanks) or secondary mathematical range transformations, PCS 7 provides specialized mathematical blocks such as Polygon (FB1881) and Mul04.

Table of Contents

Architecture of Analog Signal Processing in the PCS 7 APL

In SIMATIC PCS 7, analog signal conversion bridges raw electrical measurements with engineering visualization:
- Raw Peripheral Values: Standard analog input modules (e.g., 4–20 mA, PT100 RTDs, thermocouple cards) convert electrical currents into 16-bit signed integers in controller peripheral memory (e.g., $4\ \text{mA} = 0$, $20\ \text{mA} = 27648$ under Siemens S7 representation).
- The Modern Channel Driver (Pcs7AnIn): Connects to the raw peripheral address (e.g., IW 512), converts the integer to IEEE 754 floating-point (REAL), scales the value according to physical transmitter limits, and emits an APL structure (Out: STRUCT Value + ST).
- Direct Technological Feeding: The output structure feeds directly into PID controllers (PIDConL), monitoring blocks (MonAnL), or totalizers without requiring intermediate math blocks.

The Pcs7AnIn Channel Driver: Automated Linear Scaling

The Pcs7AnIn block executes automated linear scaling using the standard formula:

$$\text{Out.Value} = \left(\frac{\text{Raw} - \text{RawLow}}{\text{RawHigh} - \text{RawLow}}\right) \times (\text{Scale.High} - \text{Scale.Low}) + \text{Scale.Low}$$

Where standard Siemens analog cards evaluate $\text{RawLow} = 0$ ($4\ \text{mA}$) and $\text{RawHigh} = 27648$ ($20\ \text{mA}$). Furthermore, Pcs7AnIn continuously monitors Under-range ($< 3.6\ \text{mA}$) and Over-range ($> 22.8\ \text{mA}$) thresholds defined by NAMUR NE 43, asserting sensor failure diagnostics automatically whenever the wire is shorted or severed.

Configuring the Scale Parameter Structure (Scale.High and Scale.Low)

In CFC, the scaling boundaries are parameterized on the compound structure input Scale:

Structure ElementData TypeEngineering FunctionTypical Example (Pressure)Scale.HighREALThe physical engineering value at $100\%$ span ($20\ \text{mA}$).100.0 (bar)Scale.LowREALThe physical engineering value at $0\%$ span ($4\ \text{mA}$).0.0 (bar)PV_UnitINTStandard IEC 61158-2 engineering unit code.1137 (bar) or 1130 (Pa)

By setting Scale.Low and Scale.High, all downstream faceplates, alarm thresholds, and trend scales in WinCC automatically inherit the calibrated span.

Method: Step-by-Step Analog Scaling Configuration in CFC

Follow this standardized procedure to scale an analog input channel:

Step 1: Instantiate Pcs7AnIn in CFC

  1. In SIMATIC Manager, open the target CFC chart.
  2. From the APL library catalog, drag Pcs7AnIn (FB1870) into the chart.
  3. Assign a symbolic block name matching the instrument tag (e.g., PT_101).

Step 2: Connect the Raw Peripheral Address

  1. Locate the input parameter PV_In.
  2. Right-click PV_In and select Interconnection to Address....
  3. Enter the absolute hardware I/O address or symbolic tag from the Symbol Table (e.g., IW 512 or PT_101_Raw).

Step 3: Configure Engineering Span and Unit

  1. In the block parameter list, expand Scale:
    - Set Scale.Low to the minimum calibrated transmitter range (e.g., 0.0).
    - Set Scale.High to the maximum calibrated transmitter range (e.g., 250.0).
  2. Locate parameter PV_Unit:
    - Enter the corresponding integer unit code (e.g., 1137 for bar, 1001 for °C, 1342 for m³/h).

Step 4: Interconnect to Process Monitoring or Control

  1. Connect Pcs7AnIn.Out directly to the input of a technological block:
    - For simple display and alarm limits: Connect to MonAnL.PV.
    - For closed-loop control: Connect to PIDConL.PV.
  2. Compile CFC (Generate module drivers checked) and execute an OS Compile.

Non-Linear Scaling for Tanks and Profiles Using the Polygon Block

When scaling non-linear process variables—such as liquid volume in a horizontal dished-end tank, or mass flow from differential pressure across an uncompensated orifice—linear scaling yields inaccurate readings:
1. Scale the raw level measurement linearly ($0\% - 100\%$) using Pcs7AnIn.
2. Insert the APL block Polygon (FB1881) immediately downstream.
3. Configure the interpolation table in Polygon:
- Up to 8 or 16 interpolation coordinate pairs $(X_1, Y_1)$ through $(X_n, Y_n)$.
- $X$ corresponds to liquid level percentage ($0\% - 100\%$).
- $Y$ corresponds to true volumetric liters calculated from strapping tables.
4. Polygon executes linear spline interpolation between points, outputting an accurate volume structure with preserved signal quality.

Verification

To verify that the analog scaling operates accurately:
- Connect a calibrated 4–20 mA current simulator to the physical field terminals.
- Inject $4.00\ \text{mA}$ ($0\%$): verify in online CFC Test Mode that Pcs7AnIn.Out.Value displays the exact Scale.Low value (e.g., 0.0).
- Inject $12.00\ \text{mA}$ ($50\%$): verify that Out.Value reads precisely midpoint span (e.g., 125.0).
- Inject $20.00\ \text{mA}$ ($100\%$): verify that Out.Value displays Scale.High (e.g., 250.0).
- Open WinCC Runtime: confirm that the bar graph limits match $0–250$, the engineering unit label displays bar, and alarms trigger at calibrated setpoints.

Limitations and Operational Precautions

  • Square Root Extraction on Differential Flow: If measuring flow via differential pressure ($\Delta P$), do not perform manual square root math if the transmitter already executes square root extraction. Verify whether square root extraction is performed in the field transmitter, in HW Config module properties, or via parameter Feature.Bit in Pcs7AnIn. Enabling square root twice results in severe flow measurement errors.
  • Transmitter Span Alignment: Always ensure that Scale.Low and Scale.High in PCS 7 match the physical calibration programmed into the field transmitter via HART / SIMATIC PDM. If the transmitter is calibrated for $0–150\ \text{bar}$ but the DCS driver is set to $0–250\ \text{bar}$, readings will be completely misaligned.
  • Never Use FC105 in APL Architectures: Avoid legacy STEP 7 blocks like FC105 SCALE. They do not generate NAMUR signal status structures, do not interface with the PCS 7 Driver Generator, and cannot link to WinCC faceplates.

Engineer FAQ

Where do I find the integer unit code for my engineering unit?

The complete list of integer codes is published in the SIMATIC PCS 7 APL Manual under "Selecting a unit of measure" or in the STEP 7 online help under "Engineering Units".

Can I scale temperature RTD inputs (PT100) using Pcs7AnIn?

Yes. For standard temperature modules configured in HW Config as RTD inputs, the module outputs temperature directly in tenths of a degree (e.g., $250 = 25.0\ ^\circ\text{C}$). Configure Scale.Low and Scale.High to match the expected operating range, or use mode settings to read degrees directly.

What happens if field current drops below 3.6 mA?

Under NAMUR NE 43 rules, current below 3.6 mA indicates a wire break or transmitter failure. Pcs7AnIn asserts Bad = 1, changes signal status ST to 16#00, and raises a system diagnostic alarm.

How do I invert an analog signal (e.g., 20 mA = 0% and 4 mA = 100%)?

Invert the scaling boundaries: set Scale.Low to 100.0 and Scale.High to 0.0. Pcs7AnIn handles negative slope scaling automatically.

Technical References

  • Siemens Industry Online Support: SIMATIC PCS 7 Advanced Process Library (APL) Manual.
  • SIOS Entry 109742323: PCS 7 Compendium Part A - Configuration Guidelines (Section: Analog Processing).
  • NAMUR Recommendation NE 43: Standardization of the Output Signal Level of Measuring Transmitters.
  • Siemens Support FAQ: How to Configure Analog Scaling in SIMATIC PCS 7 APL.

Related Articles

Related Tags

  • Pcs7AnIn
  • Analog Scaling
  • APL
  • Scale
  • Polygon
  • NAMUR NE 43
  • Industrial Automation
20 respuestas