Resolving PLCSIM and Timestamp Synchronization Conflicts in SIMATIC PCS 7

Resolving PLCSIM and Timestamp Synchronization Conflicts in SIMATIC PCS 7

To resolve timestamp synchronization conflicts and download blocks to S7-PLCSIM when offline CFC timestamps diverge from the online target, perform a full compilation of the S7 program ('Entire program') followed by downloading the entire program to PLCSIM with the simulator in STOP mode. In CFC, navigate to 'PLC -> Download -> Scope: Entire program', which resets the online compilation signature and clears timestamp mismatch errors. If PLCSIM rejects the download due to lingering session locks, close PLCSIM, clear temporary S7 project lock files, and restart the simulation environment.

Table of Contents

Executive Summary

When developing, testing, or modifying SIMATIC PCS 7 applications in virtual simulation, engineers frequently encounter timestamp conflicts between the offline STEP 7/CFC database and the emulated CPU in S7-PLCSIM. Typical symptoms include error messages stating that 'The timestamp of the program to be loaded does not match the online program', blocked 'Changes only' downloads, or inability to activate CFC online watch mode. This guide explains how compilation timestamps operate in PCS 7, why timestamp divergence occurs between offline projects and PLCSIM, and how to cleanly synchronize the engineering system.

Architecture and Fundamental Mechanics

Timestamp Architecture and S7-PLCSIM Memory Mechanics:

  • S7 Program Timestamps:
  • PCS 7 maintains two distinct timestamps in every S7 program: the Interface Timestamp and the Code Timestamp.
  • The CFC chart compiler generates a global program signature (compilation timestamp) linking all interconnected blocks, instance DBs, and run sequences.
  • Why Timestamps Diverge:
  • If a user restores an older project archive, opens an external SCL block, or modifies HW Config without a complete compile, the offline timestamp diverges from the CPU's memory image.
  • When downloading to S7-PLCSIM, attempting a 'Changes only' download against a simulation instance initialized from a different project version triggers timestamp rejection.
  • Timestamp Validation in CFC Test Mode:
  • CFC Test Mode strictly validates that the offline chart compilation timestamp is identical to the active program running in the CPU.
  • If the timestamps differ by even a millisecond, CFC disables online monitoring to prevent displaying mismatched variables.

Step-by-Step Implementation Procedure

Step-by-Step Procedure to Synchronize Timestamps with S7-PLCSIM:

  1. Reset the S7-PLCSIM Memory Instance:
    - In S7-PLCSIM, switch the CPU mode switch to STOP.
    - Select PLC -> Clear/Reset (MRES) to completely wipe existing blocks and memory flags from simulated RAM.
  2. Execute Full Program Compilation:
    - In SIMATIC Manager, open the CFC editor.
    - Select Chart -> Compile -> Charts as Program.
    - Under Scope, select Entire program.
    - Check 'Generate SCL source' if block debugging is required.
    - Click OK and allow compilation to finish with zero errors.
  3. Perform Full Download to PLCSIM:
    - With PLCSIM still in STOP mode, select Target System -> Download in the CFC editor.
    - Under Scope, select Entire program.
    - Confirm the prompt to overwrite system data blocks and controller memory.
  4. Switch PLCSIM to Run:
    - Switch the PLCSIM mode switch to RUN-P.
    - Verify the RUN LED illuminates green without flashing.
  5. Re-Enter CFC Test Mode:
    - In CFC, click Debug -> Test Mode.
    - Click the 'Watch On' glasses icon; verify that all block pins display online dynamic values without timestamp mismatch warnings.

Verification

To verify timestamp synchronization:
1. In SIMATIC Manager, select the S7 Program -> Blocks folder -> right-click -> 'Compare Blocks...'.
2. Compare Offline Blocks against Online Blocks (in PLCSIM); verify that all DBs, FBs, and FCs show identical timestamps.
3. In CFC test mode, add several inputs and outputs to the watch list; confirm values update cyclically without error prompts.

Limitations and Operational Precautions

Operational precautions:
- Downloading 'Entire program' resets all DB data to initial load values, wiping out current operational variables; never perform an entire program download on a live running plant without planned downtime.
- S7-PLCSIM stores simulated memory in RAM; if PLCSIM is closed without saving an .alc simulation image, the memory is lost and will require a full download upon reopening.
- Ensure that the PG/PC Interface is configured to point to PLCSIM(ISO) or PLCSIM(MPI), not a physical Ethernet card.

Engineer FAQ

Why does CFC say 'The timestamps of the offline and online program do not match'?

Because the offline CFC charts were compiled after the last download, or a different program version was loaded into the CPU/PLCSIM.

How do I fix a timestamp mismatch when downloading changes is blocked?

Perform a full compilation ('Entire program') in CFC and download the entire program with the target CPU/PLCSIM in STOP mode.

Can I bypass timestamp checking in CFC Test Mode?

No. CFC enforces strict timestamp verification to ensure engineering data consistency and prevent catastrophic control errors.

Does clearing PLCSIM memory (MRES) damage the offline project?

No. MRES only wipes the temporary simulated memory inside the PLCSIM application; the offline engineering project is untouched.

What tool compares offline and online block timestamps in STEP 7?

The 'Compare Blocks' utility, accessed by right-clicking the Blocks container in SIMATIC Manager.

Technical References

Related Articles

Related Tags

  • S7-PLCSIM
  • Timestamp Conflict
  • CFC Compile
  • Compare Blocks
  • Entire Download
20 respuestas