Siemens PCS 7 FC Online Parameter Change: Complete Guide

David Krause14 min read
HMI ProgrammingSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

In Siemens SIMATIC PCS 7 and STEP 7 environments, the ability to modify block parameters while the CPU is in RUN (online) depends entirely on the block type, parameter interface declaration, and block attribute set. The most common field complaint is: "I built a custom FC (Function / Function Chart), wired constants to its inputs, downloaded the program, and now I cannot change those constants in Test Mode without going offline, editing, and re-downloading." The same user notes that PCS 7 APL (Advanced Process Library) blocks such as Add04, Or04, And04, and Mul04 clearly do expose their In01..In04 inputs to online modification. This behavior is not magic — it is the result of three deliberate design choices in the STEP 7 block interface and the PCS 7 master data library.

This reference documents the underlying mechanism (the S7_dynamic system attribute), the difference between INPUT, IN_OUT, and OUTPUT parameter classes, the memory model difference between FC and FB blocks, the PCS 7 V6.1 SP1 / V7.0+ online-to-offline writeback feature, and the field-proven workarounds that allow online parameter edits on user-defined FCs.

Block Type Memory Model: FC vs FB

STEP 7 differentiates FCs (Functions) from FBs (Function Blocks) at the memory-allocation layer, not just at the syntax layer. The PCS 7 engineering toolset (CFC, SFC, or the SIMATIC Manager / TIA Portal) treats them differently:

Property FC (Function) FB (Function Block)
Instance data storage None — FC has no associated Instance DB Required — FB writes its STAT section to a background DB
Parameter persistence across calls None — values are passed on the call stack only Stored in Instance DB until overwritten
Static variables (STAT) Not permitted Permitted (and required for retentive data)
Temporary variables (TEMP) Permitted Permitted
Online parameter modification visibility Limited — only IN_OUT and OUTPUT are visible/moddable in test mode by default Full — all INPUT, IN_OUT, OUTPUT, and STAT elements are visible/moddable via the Instance DB
CFC chart insertion Allowed; appears with thin border Allowed; appears with thick border, requires an Instance DB

Because the FC has no permanent memory, the online monitor buffer cannot "see" an INPUT parameter the way it can see an FB's STAT in an Instance DB. STEP 7 only retains online-moddable values for parameters whose physical backing store is allocated in the CPU's load memory — that means Instance DBs, bit memory (M), and I/O (P/Q). Plain FC inputs sit in the local stack frame and disappear when the call ends.

The S7_dynamic System Attribute

The S7_dynamic attribute is the cornerstone of online parameter editability for PCS 7 APL blocks. The attribute is set on each parameter declaration inside the block interface (VAR_INPUT, VAR_IN_OUT, VAR_OUTPUT, VAR_STAT sections). It is a Boolean system attribute that STEP 7 / CFC interprets during the Chart compilation pass.

Attribute value Effect on online behavior
S7_dynamic := 'false' (default) Parameter is treated as a static, compile-time input. Its value is wired at chart compile and stored in the chart's referenced tag.
S7_dynamic := 'true' Parameter is flagged as a "dynamic" runtime parameter. CFC generates an additional DB slot and a runtime pointer that allows the value to be modified via the CFC Test Mode, the S7-Pdiag faceplate, or the WinCC runtime picture.

To set the attribute in the STEP 7 / SIMATIC Manager block editor:

  1. Open the FC in the LAD/FBD/ST editor.
  2. Right-click on the parameter name in the Interface column.
  3. Select Object Properties → Attributes.
  4. In the System Attributes column, type S7_dynamic.
  5. In the value column, type true (with or without quotes — both are accepted by the STEP 7 parser).
  6. Save and re-install the block (it must be downloaded to the CPU's offline program).
Important: The S7_dynamic := 'true' attribute alone does not grant online modification rights on FC INPUT parameters in all PCS 7 versions. The attribute tells CFC to allocate runtime-moddable backing memory, but PCS 7 V6.x enforces an additional rule: only IN_OUT and OUTPUT parameters expose a monitor/modify window in the CFC Test Mode. See the workaround section below.

Why APL Blocks Permit Online Changes on INPUT Parameters

The PCS 7 APL (Advanced Process Library) blocks supplied by Siemens — for example FB1869 Add04, FB1865 Or04, FB1863 And04, FB1870 Mul04, and the family of CTxx, CTRL_PID, OP_A blocks — have all of their input parameters declared with both S7_dynamic := 'true' and a specific interface ordering that exposes them to the CFC runtime. The reason you can right-click an In01 input on Add04 and see the online value (highlighted yellow) is that the PCS 7 master data library generates a block wrapper DB for each chart instance. That wrapper DB contains a copy of every dynamic input value, and the CFC Test Mode is allowed to write to that DB while the CPU is in RUN.

User-created FCs do not automatically receive a wrapper DB unless:

  • The block is registered in the PCS 7 master data library (XML import via Import/Export → Master Data Library), and
  • The block is compiled with the PCS 7 block container templates (the source STL/SCL contains the proper KNOW_HOW_PROTECT / AUTHOR / FAMILY / NAME block attributes).

If either condition is missing, the CFC will treat the FC as a "custom block" and apply the more restrictive default behavior — only IN_OUT and OUTPUT parameters are modifiable.

Parameter Classes and Test Mode Visibility

Parameter class Visible in Test Mode? Modifiable in Test Mode? Notes
VAR_INPUT (no S7_dynamic) Sometimes (depends on wiring) No Value is bound to the wired tag at chart compile.
VAR_INPUT with S7_dynamic := 'true' Yes (yellow highlight) Yes for APL-registered FCs; No for user FCs See workaround section.
VAR_IN_OUT Yes (always) Yes Pointer-based; modification is local to the FC call scope.
VAR_OUTPUT Yes (always) Yes (write to output) Writes are forwarded to the wired tag.
VAR_STAT (FB only) Yes (via Instance DB) Yes Persistent across calls; retentive option available.
VAR_TEMP Only during active call No Cleared at OB end-of-cycle.

Field-Proven Workarounds for Online FC Parameter Changes

Workaround 1 — Declare the parameter as IN_OUT

The simplest, most widely used technique. Change every constant-bearing parameter from VAR_INPUT to VAR_IN_OUT in the FC interface:

FUNCTION FC100 : VOID
VAR_IN_OUT
    i_SetPoint : REAL;   // was VAR_INPUT
    i_Gain     : REAL;   // was VAR_INPUT
    b_Enable   : BOOL;   // was VAR_INPUT
END_VAR
BEGIN
    // ... logic ...
END_FUNCTION

Then in the CFC chart, wire each IN_OUT pin to a process tag (DB bit, M bit, or input I). In Test Mode, click the tag value (it appears yellow) and type the new constant. The change takes effect on the next OB1 cycle without a download.

Trade-off: IN_OUT parameters cannot be left unwired (unconnected pins). You must provide a tag, even if it is a constant DB element you have reserved for this purpose. Use a single shared DB of constants — for example DB999 "CFG_Constants" — to keep the chart readable.

Workaround 2 — Connect the INPUT to an FB Instance

If you cannot change the parameter class (e.g., the FC is part of a Siemens-supplied library you are not permitted to modify), wrap the input source with an FB instance that exposes a modifiable interface:

  1. Create a "value holder" FB with the same data type as the FC input.
  2. Place the FB in a separate chart.
  3. Wire the FB's OUT to the FC's INPUT.
  4. The FB's output value lives in its Instance DB and is fully modifiable online.

This is the canonical PCS 7 pattern for any constant the operator may need to retune at runtime (controller setpoints, alarm limits, scaling factors).

Workaround 3 — Use a Watch Table / VAT for FC Inputs

STEP 7's VAT (Variable Table) is bound to the CPU's symbol table, not to FC local variables. Therefore you cannot use a VAT to monitor or modify an FC INPUT directly — the FC input is not a global symbol. This approach is a dead-end and is documented here only to forestall confusion.

Workaround 4 — Move the FC Body into an FB

When the FC is large, frequently retuned, or shared across many charts, the cleanest architectural fix is to convert it to an FB. The FB has a permanent Instance DB, supports STAT variables, and exposes every parameter (including INPUT) to online modification by default. Converting FC→FB requires:

  1. Copy the FC code into a new FB.
  2. Convert every local VAR_TEMP that must persist to VAR_STAT.
  3. Generate or assign an Instance DB per chart instance.
  4. Update the call site in the CFC chart (CFC auto-converts the block type on re-compile).
Heads-up: FB block numbers above 1023 require an Instance DB, and instance DB numbers are assigned by the PCS 7 block container generator. If you are migrating an FC to an FB inside an existing project, run Chart → Compile → All Charts after the FB is installed.

PCS 7 V6.1 SP1 / V7.0 Online-to-Offline Writeback

Before PCS 7 V6.1 SP1, any value changed in CFC Test Mode was lost the next time the project was compiled, because the offline chart was not updated. From PCS 7 V6.1 SP1 onward (and stable in V7.0 through V9.0 SP8), the parameter value is automatically written back to the offline chart when you click Apply in Test Mode. This means:

  • The chart's offline representation is kept in sync with the live value.
  • A subsequent Compile → Download will not overwrite your online edits.
  • The online and offline projects can be diff-checked via Chart → Compare.
Configuration check: Verify that Options → Chart Settings → "Update offline value automatically" is enabled. Some V6.1 installations ship with this checkbox cleared.

Step-by-Step Procedure to Add S7_dynamic to an Existing FC

Use this procedure when you have authority to modify the FC source and need the parameter to be modifiable online without converting to an FB.

  1. In SIMATIC Manager (or TIA Portal with PCS 7 V9+), open the project that contains the FC.
  2. Right-click the FC in the S7 Program → Blocks folder and select Open.
  3. Switch to the Interface view (LAD/FBD/ST editor → View → Interface).
  4. For each parameter that must be online-modifiable, right-click the parameter name and choose Object Properties.
  5. Click the Attributes tab.
  6. In the System Attribute column, enter S7_dynamic.
  7. In the same row, in the unnamed value column, enter true.
  8. Click OK. Repeat for every parameter.
  9. Save and close the editor.
  10. Compile the S7 program (Program → Compile All) to refresh the chart's runtime DB references.
  11. Download the FC to the CPU (online → Download to Target System).
  12. Open the CFC chart that calls the FC and re-compile the chart so the new dynamic-attribute metadata is propagated into the chart's block I/O icon.
  13. In Test Mode, the parameters should now appear with a yellow highlight and be modifiable.

Verification Steps

  1. Switch the CPU to RUN (or RUN-P) mode.
  2. Open the CFC chart, right-click the chart, and choose Test Mode.
  3. Click on the desired INPUT / IN_OUT / OUTPUT pin. A small input box appears.
  4. Type a new value, press Enter.
  5. Observe the tag's actual value at the destination (e.g., a WinCC faceplate or a Trend) update within one OB1 cycle.
  6. Stop Test Mode. Verify that Chart → Compare Online/Offline shows no value drift.

Troubleshooting Matrix

Symptom Likely cause Corrective action
FC input pin is greyed out in Test Mode, not yellow Parameter is declared VAR_INPUT with no S7_dynamic, and the chart instance is not APL-registered Change to VAR_IN_OUT, or add S7_dynamic := 'true'
FC input pin is yellow but right-click → "Modify" is disabled CFC runtime is in "Display" mode rather than "Operator" mode, or user lacks CFC operator privilege Right-click the chart background → Operator Control; check PCS 7 user rights in WinCC User Administrator
Change reverts after chart recompile Pre-V6.1 SP1 PCS 7 without auto-writeback enabled Upgrade to V6.1 SP1+ or V7.0+, or enable Options → Chart Settings → Update offline value
Pin is yellow but the new value is ignored by the FC logic Parameter is VAR_INPUT in an FB, and the FC wrapping the FB takes priority in the call stack Use the FB's Instance DB directly; do not double-wrap
Online change is accepted but the CPU goes to STOP shortly after Modified value violates a runtime limit (e.g., divide-by-zero, out-of-range scaling) Check the CPU diagnostic buffer (Online → Module Information → Diagnostic Buffer) for OB121 / OB122 errors
S7_dynamic attribute is set but chart still cannot be edited The FC was not re-downloaded to the CPU after the attribute change Re-download the FC, then re-compile the chart, then re-download the chart
Multiple engineers report "constant cannot be changed" for the same FC The chart is locked by another CFC editor session Close other sessions (Options → Close All Editors) and re-open

Best Practices for Online-Tunable FCs in PCS 7

  • Default to FB, not FC, for any logic with retunable parameters. The memory model aligns with the operator's mental model.
  • Reserve FCs for stateless utility functions — calculations, format conversions, and bit-shuffling — where every input is wired to a tag the operator already tunes elsewhere.
  • Centralize constants in DB999 "CFG_Constants" (or project-named equivalent). Avoid magic numbers in chart wirings.
  • Document the S7_dynamic attribute in the block header (KNOW_HOW_PROTECT aside, the source STL must have a comment block explaining which inputs are operator-tunable).
  • Use the PCS 7 Master Data Library importer if the FC is shared across projects. This unlocks the full set of online test features.
  • Test online modification as part of the FAT (Factory Acceptance Test). Many issues only surface when an operator is actually running the plant.

Edge Cases and Field Notes

  • S7-mEC / S7-1500 controller migration: In TIA Portal with S7-1500 CPUs (PCS 7 V9 onward), the FC INPUT online-edit restriction has been relaxed. With a properly declared S7_dynamic attribute and a PLC tag of the matching data type, INPUT parameters are modifiable directly in the chart's online view. The PCS 7 V7.0 limitations described above apply primarily to S7-400 CPUs with the SIMATIC Manager toolchain.
  • Optimized vs non-optimized block access: For S7-1500, Instance DBs are optimized by default; absolute VAT access is restricted. Use symbolic tags or the watch table with symbolic name resolution.
  • Operator Station authentication: Online value changes are logged to the PCS 7 OS audit trail. Confirm that the operator's WinCC user account has the "CFC Online Change" right enabled in the User Administrator.
  • Fault-tolerant S7-400H: Online changes are synchronized to the standby CPU automatically. Do not attempt simultaneous edits from two ES (Engineering Station) clients.
  • KNOW_HOW_PROTECT blocks: Source-protected blocks display yellow pin values but require the original SCL source to change the S7_dynamic attribute. Plan accordingly.

Standards and Reference Documents

The behavior described here is governed by the STEP 7 / PCS 7 block attribute specifications and the Siemens function manual set. Verify version-specific behavior against the official PCS 7 function manuals:

  • Siemens PCS 7 V9.0 SP8 — Function Manual: CFC (entry ID 109782440 on Siemens Industry Online Support)
  • Siemens PCS 7 V7.0 — Service Manual: CFC Online Test
  • STEP 7 V5.7 — Programming and Operating Manual: S7-300/400 Block Concepts
  • SIMATIC S7-1500 / TIA Portal V18 — Programming Guideline: Block Attribute S7_dynamic

Can I change an FC INPUT parameter online in PCS 7 V7.0?

Not by default. PCS 7 V7.0 allows online modification of FC IN_OUT and OUTPUT parameters in CFC Test Mode. INPUT parameters are visible only on PCS 7 APL-registered blocks. To make a user-defined FC input modifiable, either change the parameter class to IN_OUT, add S7_dynamic := 'true' to the input declaration and register the FC in the PCS 7 master data library, or convert the FC to an FB so its instance data lives in a modifiable Instance DB.

What does the S7_dynamic attribute actually do?

The S7_dynamic := 'true' system attribute instructs CFC to allocate runtime-moddable backing storage for the parameter and to expose it to the CFC Test Mode, the S7-Pdiag faceplate, and the WinCC runtime picture. Without this attribute, the parameter is treated as a compile-time constant and cannot be edited online.

Why does Add04 let me change In01 but my FC does not?

The PCS 7 APL blocks such as Add04 (FB1869), Or04, and And04 are registered in the master data library, have every input declared with S7_dynamic := 'true', and have a wrapper DB allocated per chart instance. User-created FCs lack the library registration and wrapper DB, so the runtime does not permit online edits to INPUT pins. The workaround is to use IN_OUT instead of INPUT or to convert the FC to an FB.

Does my online edit survive a chart recompile?

Yes, provided PCS 7 V6.1 SP1 or later is in use and Options → Chart Settings → "Update offline value automatically" is enabled. From V7.0 onward, the offline chart is automatically synchronized to the live online value when you press Apply in Test Mode.

What is the difference between changing the value in Test Mode versus a Watch Table?

A Watch Table (VAT) operates on global symbols and absolute addresses — it cannot reach FC local INPUT parameters because those exist only on the call stack for the duration of the call. CFC Test Mode operates on the runtime DB representation of the chart instance, so it can reach any parameter that has been declared with S7_dynamic := 'true' or that has runtime-modifiable backing storage (IN_OUT, OUTPUT, FB STAT). For FC INPUTs, Test Mode is the only viable path — and even then, only when the FC is properly registered or the parameter class is changed.

Back to blog