Resolving SFC Type Formula Programming Error 35 on FC1105 in PCS 7

Resolving SFC Type Formula Programming Error 35 on FC1105 in PCS 7

In SIMATIC PCS 7, encountering runtime error "Programming Error 35: FC1105 806/0/5" during the execution of an SFC Type instance containing embedded mathematical formulas occurs when a mathematical division by zero, invalid floating-point operation, or square root of a negative number is executed within a step action. In the PCS 7 SFC runtime library, FC1105 is the internal Formula Evaluation engine responsible for parsing dynamic mathematical expressions. When an expression evaluates with an uninitialized or zero-valued denominator, the CPU's floating-point math co-processor flags an arithmetic exception, triggering error code 806 / 35 and causing the SFC step to output corrupted or unwritten results.

Table of Contents

SFC Type Formula Evaluation Architecture and FC1105

In SIMATIC PCS 7 batch and sequential control, SFC Types permit embedding mathematical expressions directly within step actions and transition conditions (for example, dynamically calculating a reactor heating ramp rate: $Ramp = (TargetTemp - CurrentTemp) / BatchDuration$).

During SFC compilation, the SFC compiler parses these high-level formulas and generates calls to the standard system function FC1105 (SFC Formula Evaluation).

When the SFC executes in the S7-400 CPU, FC1105 dynamically reads the input variables, computes the floating-point math in the CPU accumulator, and writes the calculated result to the target parameter. If any mathematical expression violates IEEE 754 arithmetic validity, FC1105 halts calculation and writes a diagnostic fault to the CPU diagnostic buffer.

Decoding Programming Error 35 and Parameter Code 806/0/5

The diagnostic alarm string provides exact details regarding the failed formula:

Diagnostic TokenDiagnostic MeaningUnderlying System ConditionProgramming Error 35S7 CPU Software Error 35Illegal instruction or arithmetic evaluation exception inside system codeFC1105SFC Formula Evaluation BlockThe standard PCS 7 SFC library block executing the formula806Error IdentifierMath exception: Division by zero, square root of negative float, or NaN0Phase / Sub-Step IndexThe specific processing phase within the SFC sequence5Formula NumberThe 5th configured formula expression inside that step action

When error 35 occurs, FC1105 terminates calculation for formula 5, leaving the destination variable at its previous value or set to IEEE 754 NaN (Not a Number), causing subsequent sequence logic to fail.

Root Causes: Division by Zero and Out-of-Range Floats

The overwhelming cause of error 35 in SFC Types is uninitialized or zero-valued variables during startup:
* An engineer configures a formula containing a denominator: $Val = Numerator / Denominator$.
* When the SFC instance is initialized, all unassigned floating-point inputs default to 0.0.
* If the sequence begins executing before the operator or recipe enters a non-zero denominator, FC1105 attempts to divide by 0.0.
* In IEEE 754 floating-point hardware, division by zero asserts an invalid operation flag, triggering error 806.
* Other causes include calculating logarithms of zero or negative numbers ($\ln(x)$ where $x \le 0$) or square roots of negative numbers ($\sqrt{x}$ where $x < 0$).

Guarding Mathematical Expressions and SFC Initialization

To eliminate error 35 and protect SFC formula execution:

  1. Implement Denominator Clamping:
    - Never allow an unguarded raw variable in a denominator.
    - Guard the denominator by applying a minimum limit in an earlier step:
    text SafeDuration = MAX(Duration, 0.001) Ramp = (Target - Current) / SafeDuration
  2. Initialize Default Values in SFC Type:
    - Open the SFC Type Editor.
    - Navigate to the Characteristics tab.
    - For all numerical setpoints used in formula denominators, set Default Value to a safe, non-zero number (e.g., 1.0 instead of 0.0).
  3. Condition Step Execution in Transitions:
    - In the transition preceding the calculation step, verify that all necessary parameters are valid:
    Transition: BatchDuration > 0.0 AND RecipeValid = TRUE.

Verification

To verify that SFC Type formula calculation is stable:
1. In the SFC Editor, open the instance online in test mode.
2. Initialize the SFC with zero inputs; confirm that transition conditions block entry into the calculation step until valid parameters are loaded.
3. Advance the sequence into the calculation step with valid inputs; confirm that FC1105 executes cleanly.
4. Inspect the CPU Diagnostic Buffer; verify that zero Programming Error 35 events are recorded.
5. In WinCC Runtime, verify that the calculated setpoint displays a valid floating-point value on the SFC faceplate.

Limitations and Operational Precautions

Never ignore math exceptions in SFC Types. When FC1105 encounters an error, the destination variable remains uncalculated, which can leave a cooling valve shut or a heating element locked on. If complex multi-variable differential equations are required, compute them inside a dedicated, compiled S7-SCL function block with comprehensive error handling rather than relying on embedded SFC step formulas.

Engineer FAQ

Can error 35 cause the S7-400 CPU to transition to STOP?

If organization block OB121 (Programming Error OB) is downloaded to the CPU, the controller absorbs the error and remains in RUN. If OB121 is missing, the CPU transitions to STOP immediately.

How do I identify which formula is Formula 5?

In the SFC Type Editor, open the step action flagged by the diagnostic message. Count the formula assignments from top to bottom; the 5th assignment corresponds to formula number 5.

Does SFC Type formula execution slow down controller cycle times?

FC1105 is an interpreted expression parser and is slightly slower than compiled SCL code. For high-speed calculations, compiled SCL blocks are preferred.

Technical References

Related Articles

Related Tags

  • SFC Type
  • FC1105
  • Error 35
  • Division by Zero
  • Formula Evaluation
6 respuestas