Resolving FC Number Conflicts When Adding Integer Math Blocks (ADD_I) in SIMATIC PCS 7 CFC
To resolve block number conflicts when inserting elementary integer math blocks like ADD_I (FC80) into a PCS 7 CFC chart, copy the ADD_I block from the CFC Library into the offline S7 Program's Blocks folder in SIMATIC Manager. When prompted with the block number collision dialog, assign a free FC number (such as FC580). Update the Symbol Table with the new FC number under the symbol ADD_I. Then in the CFC Editor, execute 'Options > Block Types', import the renamed FC from the offline block folder into the Chart folder, and place it into your charts. Alternatively, convert the integer to REAL using IntToReal, perform addition via standard APL Add04, and convert back using RealToInt.
Table of Contents
- Executive Summary
- Root Cause: FC Number Space Collisions in S7 Block Containers
- The CFC Elementary Math Library Architecture
- Comparing FC Renumbering vs Native APL REAL Math Strategies
- Step-by-Step Procedure to Renumber and Import ADD_I (FC80)
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
In SIMATIC PCS 7 continuous function chart engineering, automation engineers regularly require basic integer arithmetic, such as incrementing step counters, tracking recipe cycle passes, or calculating operational batch offsets. The CFC Library provides elementary integer math functions under ELEMENTA\MATH_INT, including ADD_I (16-bit integer addition) and ADD_DI (32-bit double integer addition). However, ADD_I is assigned by default to FC80. In many legacy projects, third-party driver packages, or specialized libraries (such as SEA, Modbus, or custom communication blocks), FC80 is already assigned to another function (e.g. TONR). Attempting to drag ADD_I into CFC triggers a compile or insertion error: 'Block FC80 already exists'. Resolving this issue cleanly requires understanding how PCS 7 manages block numbers, symbol tables, and chart folder type pools.
Root Cause: FC Number Space Collisions in S7 Block Containers
In SIMATIC STEP 7 and PCS 7, the controller memory model reserves FC numbers (FC0 through FC65535, depending on CPU architecture). When a block is inserted into a CFC chart:
- The CFC editor checks whether a block with the same FC number already exists in the CPU offline Blocks container.
- If the existing block has a different symbolic name or interface (e.g.
TONRoccupying FC80), the editor halts insertion to prevent catastrophic overwriting of active program logic. - In standard PCS 7 libraries, block numbers FC60 to FC99 were historically utilized by early elementary math functions, making collisions frequent when third-party libraries are present.
The CFC Elementary Math Library Architecture
The CFC elementary library (CFC Library [Current]) contains raw machine blocks organized by mathematical family:
MATH_INT:ADD_I(FC80),SUB_I(FC81),MUL_I(FC82),DIV_I(FC83),MOD_I(FC84).MATH_DI:ADD_DI(FC85),SUB_DI(FC86),MUL_DI(FC87),DIV_DI(FC88),MOD_DI(FC89).
These elementary blocks execute in a fraction of a microsecond because they represent direct MC7 processor opcodes without the substantial status processing, alarm overhead, or faceplate structures found in APL blocks.
Comparing FC Renumbering vs Native APL REAL Math Strategies
The following table compares architectural methods for performing integer math in PCS 7 CFC:
IntToReal -> Add04 -> RealToIntOUT := IN1 + IN2;Step-by-Step Procedure to Renumber and Import ADD_I (FC80)
Method 1: Renumbering ADD_I into the Project Block Folder
- Open SIMATIC Manager.
- Open the CFC standard library (File > Open > Libraries > CFC Library).
- In the CFC Library, navigate to
Blocks > MATH_INTand selectADD_I(FC80). - Copy
ADD_I(Ctrl + C). - In your multiproject, open the target CPU's S7 Program > Blocks folder.
- Paste
ADD_I(Ctrl + V). SIMATIC Manager displays a collision warning prompt: 'FC80 already exists. Do you want to rename it?' - Click Yes, and enter an unused FC number (e.g.
FC580). - Open the CPU's Symbols table. Locate the row for
FC580, enter SymbolADD_I, and save the symbol table. - Open any CFC chart in the project. Select Options > Block Types.
- In the left pane (Block folder offline), select
ADD_I (FC580)and click -> to move it to the Chart folder. - In the CFC catalog, expand the Blocks tab (not the Library tab). Drag
ADD_Idirectly into your chart.
Method 2: Using Native APL Signal Converters (Zero Collision Risk)
- Open the CFC chart.
- From the APL library, insert block
IntToReal(converts INT input to REAL). - Insert block
Add04(APL 4-input REAL addition block). - Connect
IntToReal.OuttoAdd04.In1, and setAdd04.In2to1.0. - Insert block
RealToIntand connectAdd04.OuttoRealToInt.In. - Use
RealToInt.Outas your incremented integer variable.
Verification
To verify proper function of the renumbered or converted integer addition:
- CFC Compilation: Execute Chart > Compile > Changes Only. Confirm that compilation finishes with 0 errors and 0 warnings.
- Online Delta Download: Perform a delta download to the AS controller or S7-PLCSIM.
- Online Monitoring: Switch CFC to Test Mode. Toggle the increment trigger or monitor the addition in real time to verify that
OUT = IN1 + IN2without numeric truncation.
Limitations and Operational Precautions
- Integer Overflow Risks: Standard 16-bit integers (
INT) overflow at+32767. If incrementing continuously, implement clamping or utilize double integer blocks (ADD_DI) with limits (-2,147,483,648to+2,147,483,647). - Master Data Library Consistency: When renumbering blocks in a multiproject, always copy the renumbered block into the Master Data Library (MDL) to ensure clean synchronization across all AS controllers.
- Library Updates: Running 'Update Block Types' from the standard CFC library can inadvertently overwrite your renumbered block if the source catalog points back to the unmodified library.
Engineer FAQ
Can I use ADD_I to add a negative integer for subtraction?
Yes, connecting a negative integer (e.g. -1) to IN2 performs subtraction natively.
Why did CFC not let me drag ADD_I from the CFC Library tab directly?
Dragging directly from the standard library attempts to use the fixed default number FC80. Renumbered blocks must be placed from the 'Blocks' tab.
Does ADD_I support quality code / bad status propagation?
No. Elementary CFC math blocks operate strictly on raw integer values; quality codes must be handled via APL channel drivers or logic flags.
Technical References
- Siemens AG: SIMATIC Process Control System PCS 7 CFC for S7 / PCS 7 Manual (Doc No. A5E03415129)
- Siemens AG: SIMATIC STEP 7 V5.6 Statement List (STL) for S7-300 and S7-400 (Doc No. A5E41221768)
- Siemens Industry Online Support Entry ID 109760968: SIMATIC PCS 7 Advanced Process Library Manual
Related Articles
- https://industrialautomation.net/search?query=pcs7+cfc+add_i+fc80+block+number+conflict
- https://industrialautomation.net/search?query=step7+fc+renumbering+symbol+table+procedure
- https://industrialautomation.net/search?query=apl+integer+to+real+conversion+math
Related Tags
- https://industrialautomation.net/search?query=simatic-pcs7
- https://industrialautomation.net/search?query=cfc-editor
- https://industrialautomation.net/search?query=block-types
- https://industrialautomation.net/search?query=step7