Monitoring Integer and Word Variables in PCS 7 APL: MonAnL Conversion and Formatting

Monitoring Integer and Word Variables in PCS 7 APL: MonAnL Conversion and Formatting

In SIMATIC PCS 7 Advanced Process Library (APL), there are no dedicated monitoring blocks for INT or WORD data types, as continuous process monitoring is standardized on floating-point REAL structures. To monitor integer or word variables with full APL faceplates, limit supervision, and alarm logging, convert the INT/WORD value to REAL using the standard conversion block I_R (FC106) in CFC, connect it to MonAnL (FB1838), and set the WinCC block icon 'format' property to 0 decimal places.

Table of Contents

APL Standardization on Floating-Point (REAL) Process Values

In process automation systems running SIMATIC PCS 7 with the Advanced Process Library (APL), process engineers frequently need to visualize non-floating-point metrics on the Operator Station (such as batch cycle counters, step counters, discrete sequence codes, or raw encoder counts stored as 16-bit INT or WORD variables).

When searching the APL library, engineers find:
* Analog Monitoring blocks: MonAnL (FB1838) and MonAnS (FB1845) for REAL variables.
* Digital Monitoring blocks: MonDiL (FB1848) and MonDiS (FB1847) for BOOL variables.
* No MonInt or MonWord blocks exist in the library.

This is an intentional architectural standard: APL standardizes process monitoring on IEEE 754 floating-point numbers (REAL) encapsulated in structured records (Struct_Analog: Value + ST). S7-400 floating-point processing provides unified engineering units, alarm threshold comparisons, deadband filters, and hysteresis algorithms that cannot be uniformly executed across diverse integer ranges.

To monitor integers seamlessly, the established PCS 7 engineering methodology converts the integer to REAL within controller logic and suppresses decimal places in the WinCC visualization layer.

Analog Monitoring Block Selection and Data Conversion Matrix

Evaluate conversion and monitoring options for non-REAL variables:

Data Type OriginConversion Block in CFCTarget Monitoring BlockWinCC Formatting PropertyResulting Operator Experience16-bit Signed INTI_R (FC106 / Standard Library)MonAnL (FB1838)format = 0Full APL faceplate with integer limits and 0 decimals16-bit Unsigned WORDW_R or custom SCL converterMonAnL (FB1838)format = 0Analog trending, limits, and alarms with integer display32-bit Signed DINTDI_R (FC105 / Standard Library)MonAnL (FB1838)format = 0High-range counter monitoring up to 2 billionPacked 16-bit Status WordBit extraction / EventTSMonDi08 (FB1849)N/A8 or 16 discrete status indicators and alarms

Design standard: Standardizing on MonAnL provides historical archiving, alarms, and trend views out of the box.

Implementing INT-to-REAL Conversion and MonAnL Scaling in CFC

Follow this verified engineering procedure in CFC:

  1. Insert Conversion Block in CFC:
    * Open the technological CFC chart.
    * From the STEP 7 Standard Library (S7 Program > Blocks), drag I_R (FC106) into the chart.
    * Connect your integer process variable (e.g., Counter.Out) to input IN of I_R.
  2. Connect to MonAnL:
    * From the APL library (PCS 7 AP Library > Monitor), insert MonAnL (FB1838).
    * Connect the output OUT (REAL) of I_R to input PV_In.Value of MonAnL.
    * Ensure PV_In.ST is set to 16#80 (Good) or connected to a valid signal status source.
  3. Configure Technological Limits:
    * In MonAnL properties, configure engineering range:
    • PV_OpScale.High = 1000 (Max integer count).
    • PV_OpScale.Low = 0.
    • PV_Unit = Assigned engineering unit code (e.g., 1001 for pieces/items).
    • Configure alarm and warning limits as needed.

Configuring WinCC Block Icon and Faceplate Format Properties

To ensure the operator station displays integer numbers without decimal points:

  1. Compile the OS:
    * Run Compile OS to generate the WinCC tags and place the block icon (@MonAnL/1) in the process picture.
  2. Configure Block Icon Formatting:
    * Open the process screen in Graphics Designer.
    * Select the generated @MonAnL/1 block icon.
    * Under Object Properties > Styles / Configuration, locate the property: format (or Format_PV).
    * By default, the property is set to 2 (displaying two decimal places: 123.45).
    * Change the value to 0 (or integer formatting string %d).
  3. Faceplate Pass-Through:
    * In PCS 7 APL, when an operator clicks the block icon, the standard faceplate (@pg_MonAnL.pdl) automatically inherits the format property from the calling icon.
    * Both the block icon and the faceplate process value display cleanly as whole numbers (e.g., 45 instead of 45.00).

Verification

Verify integer monitoring in WinCC Runtime:
1. Online in CFC: Force an integer value of 150 on input Counter.Out.
2. Observe I_R: Output converts cleanly to 150.0.
3. Open WinCC Runtime:
* Confirm that the block icon displays 150 with zero decimal places.
* Click the icon to open the faceplate: Confirm that the faceplate process value and limits display whole numbers.
* Increase the value to 200 to exceed the configured high alarm: Confirm that MonAnL logs an alarm in WinCC Alarm Logging.

Limitations and Operational Precautions

  • Converting integers greater than 16,777,216 (2^24) to IEEE 754 32-bit REAL can introduce floating-point rounding errors due to 23-bit mantissa limitations. For ultra-large 64-bit counters, author a custom DINT monitoring block.
  • Unsigned WORD variables containing values above 32767 must be converted with care; using standard signed I_R will interpret values above 32767 as negative numbers. Use a double-word conversion pathway (W_DINT -> DI_R).
  • Each MonAnL block consumes 1 AS RT Process Object license.

Engineer FAQ

Why didn't Siemens create a dedicated MonInt block in APL?

Siemens standardized continuous process control on REAL to allow uniform alarm hysteresis, filtering, scaling, and trending. Maintaining duplicate INT, DINT, and REAL block families across APL would triple library maintenance overhead.

Can I enter integer setpoints using OpAnL?

Yes. Use OpAnL for setpoint entry, convert the REAL output to INT using the R_I (FC108) truncation block, and set the WinCC format property to 0 decimals.

What happens to the decimal formatting in trend curves?

In WinCC TrendControl, the vertical Y-axis values can be formatted independently by setting decimal places to 0 under the Axis properties.

Technical References

Related Articles

Related Tags

  • MonAnL
  • Integer Monitoring
  • WORD Variable
  • I_R
  • FC106
  • Format Property
  • Decimal Suppression
  • PCS 7 APL
6 respuestas