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
- Analog Monitoring Block Selection and Data Conversion Matrix
- Implementing INT-to-REAL Conversion and MonAnL Scaling in CFC
- Configuring WinCC Block Icon and Faceplate Format Properties
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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:
INTI_R (FC106 / Standard Library)MonAnL (FB1838)format = 0WORDW_R or custom SCL converterMonAnL (FB1838)format = 0DINTDI_R (FC105 / Standard Library)MonAnL (FB1838)format = 0EventTSMonDi08 (FB1849)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:
- Insert Conversion Block in CFC:
* Open the technological CFC chart.
* From the STEP 7 Standard Library (S7 Program > Blocks), dragI_R(FC106) into the chart.
* Connect your integer process variable (e.g.,Counter.Out) to inputINofI_R. - Connect to
MonAnL:
* From the APL library (PCS 7 AP Library > Monitor), insertMonAnL(FB1838).
* Connect the outputOUT(REAL) ofI_Rto inputPV_In.ValueofMonAnL.
* EnsurePV_In.STis set to16#80(Good) or connected to a valid signal status source. - Configure Technological Limits:
* InMonAnLproperties, configure engineering range:PV_OpScale.High=1000(Max integer count).PV_OpScale.Low=0.PV_Unit= Assigned engineering unit code (e.g.,1001for 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:
- Compile the OS:
* Run Compile OS to generate the WinCC tags and place the block icon (@MonAnL/1) in the process picture. - Configure Block Icon Formatting:
* Open the process screen in Graphics Designer.
* Select the generated@MonAnL/1block icon.
* Under Object Properties > Styles / Configuration, locate the property:format(orFormat_PV).
* By default, the property is set to2(displaying two decimal places:123.45).
* Change the value to0(or integer formatting string%d). - Faceplate Pass-Through:
* In PCS 7 APL, when an operator clicks the block icon, the standard faceplate (@pg_MonAnL.pdl) automatically inherits theformatproperty from the calling icon.
* Both the block icon and the faceplate process value display cleanly as whole numbers (e.g.,45instead of45.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
32767must be converted with care; using standard signedI_Rwill interpret values above32767as negative numbers. Use a double-word conversion pathway (W_DINT -> DI_R). - Each
MonAnLblock 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
- SIMATIC PCS 7 Advanced Process Library (APL) Manual (A5E32106040)
- SIMATIC STEP 7 V5.5 System Software for S7-300/400 System and Standard Functions Manual
- Siemens Support Entry 109780813: Displaying Non-Decimal Values in APL Faceplates
Related Articles
- Interpreting Quality Codes and Resolving Shaded Attention Icons on WinCC I/O Fields in PCS 7 APL
- Customizing Alarm Logging Column Headers and Message Blocks in WinCC and PCS 7
- Selecting and Migrating Block Libraries for SIMATIC PCS 7 V8.1: APL vs. Standard Library
Related Tags
- MonAnL
- Integer Monitoring
- WORD Variable
- I_R
- FC106
- Format Property
- Decimal Suppression
- PCS 7 APL