S7-1200 Memory Card: Load/Work Memory Architecture Guide

David Krause14 min read
S7-1200SiemensTechnical 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

The S7-1200 CPU family does not behave like an S7-300/400 with respect to data block (DB) placement: a DB declared in the project is always loaded into work memory at runtime, and there is no instruction equivalent to SFC 82 / SFC 83 / SFC 84 ("Read from load memory", "Write to load memory") that can page a large DB in and out of the SIMATIC Memory Card (SMC) on demand. Understanding the three-tier memory model, the role of the SMC, and the firmware-specific size limits is mandatory before declaring an Array [0..30000] of Byte or planning a 1 MB+ data store on a 1211C/1212C/1214C/1215C/1217C.

This reference consolidates the system manual constraints, firmware version deltas, and the field-proven workarounds (DataLog, recipes, OPC UA, external storage) that let you push beyond the native work memory ceiling without re-architecting the PLC.

S7-1200 Memory Architecture

Every S7-1200 CPU contains three logically distinct storage areas, described in the S7-1200 Programmable Controller System Manual:

Area Physical Location Contents Volatile? Typical Size
Load Memory Internal flash + SIMATIC Memory Card (SMC) Project (blocks, symbols, comments), system data, DataLog files, recipe files Non-volatile Internal: 1-4 MB; SMC: 4 MB to 32 GB (firmware dependent)
Work Memory RAM (inside CPU) Runtime code (OB/FC/FB) + active DB instances + runtime stack Volatile (lost on power-down unless in retentive area) 50 KB to 400 KB depending on CPU model and firmware
Retentive Memory Non-volatile area in CPU Selected M bits, DB tags, IEC timers/counters marked "retain" Non-volatile 10 KB to 512 KB (configured in PLC properties)

On a download from TIA Portal, the entire project is written to the SMC (or, in older firmware, to internal load memory) and the CPU copies the executable portions into work memory at start-up. The DB instances your program reads and writes are physically located in work memory; the SMC only retains them in compressed project form for power-up reload.

Critical: On the S7-1200, the SMC is not user-addressable at runtime. You cannot read or write a single DB tag to the card via standard LAD/FBD/SCL instructions. The only user-facing data sets that are stored persistently on the SMC are the files created by DataLog and Recipe instructions introduced in firmware V2.x and expanded in V4.x.

Role of the SIMATIC Memory Card (SMC)

The SMC is a pre-formatted SD-card style device (some early CPUs used MMC). Its functions are:

  1. Project storage: When a card is inserted, the project is downloaded to the card; without a card, project storage falls back to internal flash on supported CPUs.
  2. CPU firmware update: The card can be used to update the CPU's firmware (front switch or automated).
  3. Transfer of a working project between CPUs: Insert a programmed SMC into a new CPU of the same family; the CPU boots from the card.
  4. Data storage for DataLog/Recipe files: CSV-formatted data created at runtime by the user program.
  5. Service data backup: Optional, when the card contains a project file with the same article number.

The 24 MB card the user observed is the standard 6ES7954-8LF02-0AA0 (or the legacy 6ES7954-8LE02-0AA0 for 12 MB). Newer firmware levels accept the 256 MB (6ES7954-8LL02-0AA0), 2 GB (6ES7954-8LP02-0AA0), and 32 GB (6ES7954-8LT03-0AA0) variants. The card is not user-partitioned - the entire card is one Siemens-proprietary file system.

Can a DB be Placed in Load Memory Only?

Short answer: No. The S7-1200 instruction set does not include SFC 82 (S7-300/400) or the S7-1500 READ_DBL/WRIT_DBL instruction family (SFC/FB) that would allow a DB to live in load memory and be paged on demand. Every DB declared in TIA Portal - including an Array [0..30000] of Byte - is statically allocated in work memory after the program is loaded.

This is a deliberate platform design decision. The S7-1200 targets mid-size discrete control and is not designed for large structured-data handling; the S7-1500 is the platform that introduces load-memory-resident DBs through READ_DBL / WRIT_DBL and the "memory area in load memory" attribute on the DB.

Platform Runtime DB in load memory? Mechanism
S7-300/400 Yes SFC 82 READ_DBL, SFC 83 WRIT_DBL copy blocks between load memory and work memory
S7-1200 No No equivalent instruction; DB always in work memory; only DataLog/Recipe files on SMC
S7-1500 Yes (firmware V1.5+) DB property "Memory area = Load memory" + READ_DBL/WRIT_DBL FBs

Work Memory Limits by CPU Model

The most relevant constraint for declaring a 30,001-byte array or planning 1 MB+ of data is the work-memory budget. The values below are nominal totals; usable memory is smaller because the runtime system, system blocks, and the OB/FC/FB code also consume work memory.

CPU MLFB (example) Work Memory (FW V4.0+) Work Memory (FW V4.2+) Work Memory (FW V4.4+)
CPU 1211C DC/DC/DC 6ES7211-1AE40-0XB0 50 KB 75 KB 100 KB
CPU 1212C DC/DC/DC 6ES7212-1AE40-0XB0 75 KB 100 KB 125 KB
CPU 1214C DC/DC/DC 6ES7214-1AG40-0XB0 100 KB 150 KB 200 KB
CPU 1215C DC/DC/DC 6ES7215-1AG40-0XB0 150 KB 200 KB 250 KB
CPU 1217C DC/DC/DC 6ES7217-1AG40-0XB0 250 KB 300 KB 400 KB

A single Array [0..30000] of Byte consumes 30,001 bytes (~30 KB) just for the data section, before the compiler adds symbol table overhead and any structure alignment. On a 1211C with 50-100 KB of work memory, this single array can consume 30-60% of the budget and will trigger a download diagnostic if the residual memory is insufficient for code.

Engineering rule of thumb: Keep the sum of all DB instances under 40% of the CPU's work memory rating. Above that ratio, OB1 cycle time degrades and you risk "insufficient memory" errors at compile or download time.

Memory Card File System Internals

The SMC uses a Siemens-proprietary FAT-like file system. Files visible from the user-program perspective are limited to:

  • LOG_<DataLogName>.csv - created by the DataLogCreate / DataLogWrite instruction family.
  • <RecipeName>.csv or .bin - created by the RecipeExport / RecipeImport family (V4.0+).
  • S7_JOB.S7S - read/write/delete operations queued by the Web server or user program.
  • The project archive: SIMATIC.S7S (or crashdump.bin on diagnostics event).

From TIA Portal you can browse the card via "Online > Memory card > [user-card]" and read/write CSV files. The user program accesses the file system through the extended instructions DataLog and Recipe in the program editor under Optional packages > Recipes and File handling.

Storing >1 MB of Data on S7-1200 - Practical Strategies

When the application demands more data than the work memory can hold, the following field-proven strategies apply. Each has different latency, persistence, and bandwidth characteristics.

Strategy 1 - DataLog to SMC

The DataLog instruction family (V2.0+) writes a CSV file directly to the SMC. The file is not loaded into work memory; the CPU streams records from the user program buffer (typically 1 KB to 4 KB) into the card file.

  • Max records per file: limited by SMC free space (multi-MB).
  • Access latency: ~5-20 ms per record write, depending on record size.
  • Read-back: DataLogRead can pull N records into a target DB.

Best fit: trending, batch records, audit trails, event logs. Not suitable for fast random access.

Strategy 2 - Recipe DB + SMC file export

Create one or more "active" recipe DBs of the data you actively manipulate (must fit in work memory), and use RecipeExport to push the current DB contents to a CSV file on the SMC, then free the DB for a different recipe. The data on the SMC survives power-cycle, the in-RAM copy is replaced by RecipeImport when the user picks a different set.

Best fit: machine set-ups with dozens of named recipes but only one loaded at a time.

Strategy 3 - Store-and-forward over network

The user's original requirement ("store > 1 MB and send it by network") is a classic store-and-forward problem. On S7-1200 with firmware V4.4+ the native OPC UA server (DA profile) exposes selected DBs as readable nodes, with no additional hardware. A SCADA/IoT gateway pulls the data on schedule, freeing the PLC from the storage burden. Older firmware (V4.0-V4.3) requires a S7 connection (PUT/GET on PN, or TSEND/TRCV on TCP) and a partner PLC or HMI/PC that archives the stream.

Best fit: when the consumer of the 1 MB+ data is a host system, not the PLC program itself.

Strategy 4 - External storage via I/O-Link or Modbus TCP

For data that does not need to be in the PLC, a Modbus TCP register bank on an external gateway (Phoenix Contact, Wago, Beckhoff) or an SD-card-equipped I/O-Link master (e.g., Siemens SCALANCE + ET200 I/O-Link master) provides GB-scale storage. The S7-1200 exchanges only the working set in work memory.

Best fit: long-term historian data, video stills, large recipe libraries.

Strategy 5 - Migrate to S7-1500

If the data genuinely must live in the PLC and be randomly accessible, an S7-1500 CPU (e.g., CPU 1511-1 PN at 300 KB work memory, CPU 1515-2 PN at 500 KB, or 1518 with 3 MB) plus the load-memory DB attribute and the READ_DBL / WRIT_DBL instructions is the engineering-correct solution. A S7-1500 DB flagged "Memory area = Load memory" can exceed work memory; the runtime instructions page 4 KB segments in and out on demand. This is not available on S7-1200 and will not be added in any planned firmware.

Firmware-Version-Conditional Behavior

Memory-related behavior changed across S7-1200 firmware versions. The points below are the ones that affect the 1 MB+ data question:

Firmware Added or Changed Behavior Impact on this Use Case
V2.0 DataLog instructions introduced Enabled SMC file storage from user program
V2.2 Web server improvements; basic Recipe support Manual recipe editing through WebUI
V4.0 RecipeExport / RecipeImport FB family, security levels, knowledge protection Full recipe set/load cycle now available
V4.1 Memory card handling refinements, improved diagnostic buffers Card-failure detection faster; better online diagnostics
V4.2 ProDiag, increased work memory on most CPUs (see table) More headroom for 30 KB arrays on 1214C/1215C
V4.4 OPC UA server, secure PG/HMI communication, expanded work memory OPC UA strategy becomes practical
V4.5 / V4.6 / V4.7 Further diagnostic and security improvements, larger SMC support (up to 32 GB) Larger DataLog archives possible; 32 GB card requires V4.5+

The user's observation that the SMC is 24 MB is consistent with the 6ES7954-8LF02-0AA0 card; that article number is supported across all V4.x firmware. Larger 256 MB / 2 GB / 32 GB cards are usable on V4.4+, and the V4.5+ firmware added 32 GB support to support long DataLog retention in edge applications.

Worked Example - 30,001-Byte Array on a 1214C

To make the trade-off concrete, suppose the goal is to declare myDB.data : Array [0..30000] of Byte on a CPU 1214C (6ES7214-1AG40-0XB0) at firmware V4.2.

  1. Data bytes required: 30,001 B ≈ 29.3 KiB.
  2. Code + system block overhead typical: 25-40 KB (depends on OB/FC/FB count).
  3. Work memory budget (V4.2): 150 KB.
  4. Residual after array: ~80-95 KB for code and other DBs.
  5. Verdict: Fits, but tight. If additional DBs or large FBs (PID_Compact instances, Motion blocks) are added, the compile will fail with diagnostic "Insufficient work memory in CPU" or the download will warn about > 80% utilization.

If the target were a 1211C (V4.0, 50 KB work memory), the same array would exceed 50% of the budget before code and is not advisable. Re-size the array or use a tighter element type (Array [0..30000] of Bool ≈ 3.8 KB, packed into a DB bit area).

Diagnostics and Verification

After deployment, verify the actual load on the CPU and the SMC via TIA Portal online diagnostics:

  1. Right-click the CPU in the project tree > Online > Diagnostics. The "Memory" tab reports the current load memory usage, work memory usage, and retentive memory usage in bytes and as a percent of nominal.
  2. Open Online > Memory card > [user-card] to list the file-system contents and free space on the SMC.
  3. In the CPU's diagnostic buffer, the following events are memory-related and should be alerted in the HMI:
Diagnostic Event (W#16#...) Meaning Recommended Action
457F / 4310 Memory card inserted / removed during RUN Stop CPU before card exchange; verify project presence after insert
4580 / 4311 Memory card write-protected or full Check write-protect slider; offload or delete DataLog files
4312 Inconsistent memory card detected Re-format card using TIA Portal; reload project
4313 Memory card file system error (S7-Job) Inspect S7_JOB.S7S queue; clear if stale
35xx / 38xx Work memory / load memory overflow during compilation Reduce DB size, split into multiple smaller DBs, upgrade CPU or firmware

The diagnostic buffer can be exported as plain text and correlated to the application timestamp; many SCADA packages log it as part of plant historian. The SMC free-space should be monitored via the user program if DataLog is used heavily; a DataLogClose and DataLogDelete sequence at the end of each shift prevents card-full events.

Troubleshooting Matrix

Symptom Likely Cause Check Fix
Download fails with "insufficient work memory" DB total size + code exceeds CPU work memory rating Online > Diagnostics > Memory Reduce DB size, split DB, upgrade CPU or firmware
DataLogWrite returns error 80A1 or 80A2 SMC full or write-protected Online > Memory card Delete old logs; check write-protect slider; re-format card
DB values lost on power-down despite retain flag Retentive area not configured for that DB or size exceeds retentive budget PLC properties > Retain memory Increase retain memory, mark tags retain, redownload
CPU stays in STOP after insert of new SMC Card contains project of a different article number or corrupted Diagnostic buffer 4312 Reset card via TIA Portal > Card Reader; reload project
OPC UA server cannot expose large DB DB size exceeds OPC UA server resource limits (V4.4) Server configuration > resource limits Increase max. session/subscribed nodes, or use store-and-forward to external host

Decision Path for the Original Question

Returning to the user's question: "I need to store more than 1 MB of information with the program on S7-1200 and send it by network. Do you know a way to store information that is not on work memory?" The decision tree:

  1. If the data is structured and randomly accessed at runtime by the PLC program - it must be in work memory. A 1 MB+ structure is impractical on S7-1200 (largest work memory is 400 KB on a 1217C at V4.4+). Choose an S7-1500 CPU or external storage.
  2. If the data is collected and forwarded - use the OPC UA server (FW V4.4+) or PUT/GET on PROFINET to push records to a host as they are created. Do not store them in the PLC at all.
  3. If the data is appended and archived - use DataLog on the SMC. The 24 MB card is sufficient for tens of thousands of records; the 256 MB/2 GB/32 GB cards extend this to millions.
  4. If the data is a set of named recipes, only one active at a time - keep one active DB in work memory and use the Recipe FB family to swap CSV files on the SMC.

Across all four cases the user's underlying assumption - that the SMC is a generic secondary memory that can be addressed like an S7-300 MMC - is incorrect for the S7-1200 platform. The card is project + DataLog + Recipe storage, and the user program can only manipulate it through the predefined instructions, not by direct symbol access.

Field-Proven Tips

  • Always insert the SMC before powering the CPU; hot-swap is not supported and will generate diagnostic buffer events.
  • Keep at least 5 MB free on the SMC at all times. DataLog performance degrades sharply when free space drops below this threshold.
  • For firmware upgrades, copy the project to the SMC after the firmware update has been performed; the order matters to avoid an inconsistent project archive.
  • If you must retain DB values across a power-cycle, configure the retentive area in PLC properties > Retain memory before downloading. A common mistake is to mark tags "retain" without increasing the retain budget - the compiler accepts it but the values are not actually saved.
  • When planning a CPU upgrade, check that the new MLFB accepts the same SMC article number. Some early CPU revisions had SMC compatibility restrictions documented in the release notes.

FAQ

Does the S7-1200 SIMATIC Memory Card work the same as the MMC on S7-300?

No. The SMC stores the project and DataLog/Recipe files, but there is no SFC 82 / SFC 83 / SFC 84 equivalent on the S7-1200. You cannot page DBs between load memory and work memory on demand. Only the S7-1500 (with DB property "Memory area = Load memory" and the READ_DBL/WRIT_DBL instructions) supports this model.

Can I declare an Array [0..30000] of Byte on a CPU 1214C?

Yes on a 1214C with firmware V4.0+ (50-200 KB work memory depending on the firmware level). The array consumes ~30 KB; ensure the sum of all DBs plus program code stays under roughly 40% of the rated work memory to avoid compile-time "insufficient work memory" errors.

What is the largest SIMATIC Memory Card supported by my S7-1200 firmware?

Firmware V4.0 to V4.3 supports up to 2 GB SMC. Firmware V4.4+ supports 32 GB SMC. The 6ES7954-8LF02-0AA0 24 MB card and the 6ES7954-8LL02-0AA0 256 MB card are the most commonly stocked and are safe choices across all V4.x revisions.

Why does my S7-1200 show 24 MB of load memory when I expected more?

You are observing the SMC capacity (24 MB) in the TIA Portal "Memory" tab; this is the load-memory container for the project archive, not the work memory available for runtime. Work memory is a separate, smaller RAM area (50-400 KB) where the code and active DB instances are executed.

What is the best way to send 1 MB+ of data from the S7-1200 to a host system?

On firmware V4.4+ use the OPC UA server (DA profile) to expose selected DB tags. On V4.0-V4.3 use PUT/GET over PROFINET or TSEND/TRCV over TCP/ISO-on-TCP to push records to an HMI, SCADA, or partner PLC. For long-term archival, stream records to a DataLog on the SMC and read them back from a host later.

Back to blog