Adding OB Blocks to S7-300 CPU 314: MMC Setup and STEP 7 Download Procedure
The Siemens SIMATIC S7-300 CPU 314 (for example, 6ES7314-1AE04-0AB0) is a compact, entry-level central processing unit for the S7-300 family. Like every S7-300 CPU, the CPU 314 separates work memory (RAM, volatile, used for code execution) from load memory (non-volatile, used to retain the project after power-off). The 24 kB figure quoted in the CPU datasheet refers to work memory only. The load memory lives on the Micro Memory Card (MMC) inserted in the slot behind the front cover. Without an MMC, the CPU cannot accept a project download, cannot retain retentive data, and effectively behaves as a read-only device that displays the last loaded configuration from a previous MMC if one is present, or remains in STOP with an empty project if it is the first power-up.
This article walks through the complete path from a CPU that cannot accept a download to a CPU running a user-written OB1 with a working digital output. It covers the memory architecture, MMC selection, hardware insertion, STEP 7 project configuration, MPI/DP connection, block download, and verification with a small fan/LED test program.
1AE0x (CPU 314, 24 kB work memory) and the related 1AG1x / 1AH0x variants. CPUs with firmware version < V2.0 use the legacy MMC slot. Always confirm the order number on the front of the module and on the side label before ordering accessories.1. Overview: Why the CPU 314 Will Not Accept a Download
The S7-300 platform uses a three-tier memory model defined in the Siemens support document SIMATIC S7-300 CPU Memory Concept:
| Memory area | Location | Volatile? | CPU 314 size |
|---|---|---|---|
| Work memory (code) | Integrated RAM | Yes | 24 kB |
| Work memory (data) | Integrated RAM | Yes | 16 kB (typical for CPU 314) |
| Load memory | MMC | No (Flash) | None until MMC installed |
| System memory | Integrated RAM | Yes | Timers, counters, bit memory |
| Retentive memory | MMC (with backup) or internal (no battery) | Depends | Set in HW Config |
When the PLC programmer clicks Accessible Nodes in STEP 7, the PG/PC polls the MPI/DP interface of the CPU. The CPU responds with the diagnostic buffer and the block list currently loaded into work memory, but if no MMC is present the CPU will refuse any download attempt with an error such as:
Error 33:1213 "Download to CPU not possible because no memory card is inserted"-
Error 33:2121 "Online: The CPU is in the wrong operating mode"(CPU remains in STOP because load memory is empty) Diagnostic buffer entry: "No memory card inserted; no download possible"
The diagnostic buffer is the first place to confirm this condition. Open the CPU in STEP 7 via PLC > Diagnostic/Setting > Diagnostic Buffer and read the most recent entries.
2. Prerequisites
Before starting, gather the following items:
- CPU 314 module, e.g. 6ES7314-1AE04-0AB0 (24 kB work memory, MPI/DP interface, MMC slot behind front cover). The exact order number is printed on the front label and on the side of the housing.
- SIMATIC MMC, 64 kB minimum, e.g. 6ES7953-8LF00-0AA0. A 64 kB MMC holds roughly 5-10 typical OB/FB/DB blocks at this CPU size, which is more than enough for learning exercises.
- SIMATIC S7-300 backplane (rail), e.g. 6ES7390-1AE80-0AA0 (530 mm) or 6ES7390-1AF30-0AA0 (830 mm). The CPU 314 requires a slot with a bus connector.
- PS 307 power supply, e.g. 6ES7307-1KA00-0AA0 (10 A, 24 V DC, 120/230 V AC input). This is the unit referenced in the original question and provides 24 V for the backplane and sensor supply.
- SM 323 digital I/O module, e.g. 6ES7323-1BL00-0AA0 (16 DI 24 V DC / 16 DO 24 V DC, 0.5 A). This is the module referenced in the original question and provides the test points for the LED/fan program.
- STEP 7 programming software, version V5.5 + SP4 or later (TIA Portal V13 SP1 or later also supports the CPU 314 via GSD/legacy import, but STEP 7 V5.x is the canonical tool for this generation).
- PC adapter or MPI cable: Siemens PC Adapter USB A2 (6GK1571-1AA00) for USB-to-MPI/DP, or a legacy RS-232 PC Adapter (6ES7972-0CA23-0XA0) if the PG has a serial port. The original poster already owns such a cable.
- 24 V load for output testing: a 24 V LED indicator or 12 V fan with a 24 V supply through a 24 V relay, or a 24 V fan directly on a 24 V output (observe 0.5 A per channel limit on the SM 323).
- Wiring: 2.5 mm² front connector cables for the PS 307 and SM 323, ferrules, and a small screwdriver.
3. S7-300 CPU 314 Memory Architecture in Detail
The 24 kB figure on the CPU 314 datasheet is the integrated work memory split between the program (OB/FB/FC/DB code) and the data (DBs, instance data). The CPU has no integrated load memory; load memory is implemented entirely on the MMC. The MMC is also the storage for:
- The project file (system data, blocks, comments, symbols)
- Retentive data and remanent tags
- Firmware updates (when performed via MMC)
- Recipes and configuration archives
Two CPU behaviors follow directly from this architecture:
- No MMC, no download. STEP 7 will return error class 33 ("Resource problem") because the target buffer is missing.
-
MMC removal while powered is detected and raises diagnostic event
SF: MMC removed. The CPU may continue to run from work memory but cannot be downloaded to until the MMC is reinserted.
For the CPU 314 with 24 kB work memory, the MMC must be at least 64 kB to provide headroom for system data, even if the user's program is only a few hundred bytes. The Siemens FAQ S7-300 / S7-400 / C7 MMC Compatibility and Order Numbers lists every approved MMC for every CPU generation.
4. MMC Selection: Part Numbers, Sizes, and the Non-Siemens Rule
| MMC size | Order number (MLFB) | Typical use |
|---|---|---|
| 64 kB | 6ES7953-8LF00-0AA0 | Minimum for CPU 314, smallest available |
| 128 kB | 6ES7953-8LG00-0AA0 | Small projects with HMI tags |
| 512 kB | 6ES7953-8LJ00-0AA0 | Medium projects, firmware updates |
| 2 MB | 6ES7953-8LL00-0AA0 | Large projects, web server data |
| 4 MB | 6ES7953-8LM00-0AA0 | Project archival |
| 8 MB | 6ES7953-8LP00-0AA0 | CPU 317/CPU 319, large projects |
Siemens MMCs use a proprietary wear-leveling controller that emulates a Siemens-specific Flash filesystem. The CPU authenticates the MMC on power-up; non-Siemens cards (Kingston, SanDisk, Team Group, generic SD-to-MMC adapters) fail authentication and the CPU raises diagnostic event SF: MMC not Siemens and refuses to mount the volume. The MMC must never be formatted with Windows; the FAT16 layout is non-standard and Windows format will permanently make the card unreadable to the CPU. If a non-Siemens card was used in the past and the CPU still shows "MMC fault", the only recovery is to insert a genuine Siemens MMC and re-download the project.
5. Hardware Installation: Power-Off, Insert MMC, Power-On
- Power off the rack. Switch the PS 307 mains breaker to 0 and disconnect the line cord.
- Open the front cover of the CPU 314 by flipping down the bottom hinge. The MMC slot is behind this cover, near the bottom-left of the CPU faceplate.
- Insert the MMC with the label facing right (contacts facing left). Push it gently into the slot until the ejector tab clicks. The card should sit flush with the slot edge.
- Close the cover and verify the SF, BF, DC5V, and FRCE LEDs are off initially.
- Apply power. The CPU performs a self-test, the RDY/STOP LEDs go through a sequence, and after a few seconds the CPU settles in STOP (no project loaded).
- Wire the SM 323 inputs and outputs: connect input 0 (terminal 1) to a 24 V source through a normally-open pushbutton (sinking input). Connect output 0 (terminals 8/9 depending on wiring) to a 24 V LED indicator or a 12 V fan via a 24 V relay coil, observing the 0.5 A per channel rating.
- Wire the PS 307 24 V output to the SM 323 sensor supply (terminals 1L+/1M for inputs, 2L+/2M for outputs) and to the CPU 24 V terminals (1L+, 1M).
6. STEP 7 Project Setup and Hardware Configuration
- Launch STEP 7 V5.5. Select File > New Project and name it
CPU314_OB1_Demo. - Right-click the project, choose Insert New Object > SIMATIC 300 Station. This creates the station object.
- Open the Hardware editor (HW Config) by double-clicking the Hardware icon.
- From the hardware catalog, drag the following into the rack view:
- Slot 1: RACK-300 > Rail (6ES7390-1xxxxx).
- Slot 1: PS-300 > PS 307 10A (6ES7307-1KA00-0AA0).
- Slot 2: CPU-300 > CPU 314 > 6ES7 314-1AE04-0AB0. When prompted, the catalog may show the firmware as V1.2; select that variant.
- Slot 4: SM-300 > DI/DO-300 > SM 323 DI16/DO16 (6ES7323-1BL00-0AA0).
- Double-click the CPU to open its properties. On the Cycle / Clock Memory tab, set Clock memory byte to
MB10. On the Retentive Memory tab, set the number of retentive MB, timers, and counters (defaults: 0 MB, 16 timers, 16 counters is fine for a learning project). - Save and compile the hardware configuration. The system data block (SDB) is generated automatically.
7. Establishing Online Connection via MPI/DP
- Connect the PC Adapter USB A2 to the PG's USB port and to the CPU's MPI/DP port (the 9-pin Sub-D on the front of the CPU).
- In STEP 7, open Options > Set PG/PC Interface. Choose PC Adapter (MPI) > PC Adapter USB A2. Verify the transmission rate is 187.5 kbit/s (default for MPI) and the highest station address is 31.
- Set the CPU's MPI address (default 2) in HW Config (CPU properties > General > Interface > Properties > MPI).
- Click the Accessible Nodes button in the toolbar. STEP 7 should display a node with MPI address 2. If the node appears, the cable, adapter, and PG interface are correctly configured.
- Right-click the SIMATIC 300 Station and choose Download to Target System. STEP 7 prompts for the MPI subnet and target CPU; click OK. The system data and any existing blocks are loaded onto the MMC.
If Accessible Nodes returns nothing, double-check the cable pinout (the PC Adapter cable is crossed, not straight-through), the PG/PC interface selection, and the MPI address of the CPU. The CPU's MPI address is shown in the diagnostic buffer or by selecting PLC > Edit Ethernet Node if the CPU is on a Profibus-capable port.
8. Creating and Downloading OB Blocks
The S7-300 uses the Organization Block (OB) as the top-level container for user code. The most common blocks are:
| OB | Trigger | Typical use |
|---|---|---|
| OB1 | Cyclic, main scan | Primary program, runs continuously |
| OB10 | Time-of-day | Daily/scheduled routines |
| OB35 | Cyclic interrupt | Time-critical tasks (default 100 ms) |
| OB82 | Diagnostic interrupt | Module diagnostic handling |
| OB100 | Warm restart | One-shot initialization after power-on |
| OB121 | Programming error | Error handling for invalid code |
| OB122 | I/O access error | Error handling for missing modules |
Step-by-step OB1 creation
- In the project tree, expand S7 Program (1) > Blocks. The default blocks include System Data, OB1, and possibly OB100.
- Right-click Blocks and select Insert New Object > Organization Block. Name it
OB1with OB number 1 and language LAD (Ladder) or STL (Statement List) or FBD (Function Block Diagram). Click OK. - Double-click OB1 to open the editor. In the first network, write the program for the test fan/LED:
NETWORK 1 // LED test on output Q0.0 of SM 323
// Input I0.0 (pushbutton) controls output Q0.0 directly (self-holding optional)
| I0.0 Q0.0
--| |------( )--
NETWORK 2 // Fan: pulse output Q0.1 every 2 seconds using clock memory
// Clock memory bit M10.0 = 0.1 s, M10.7 = 2.0 s
| M10.7 Q0.1
--| |------( )--
- Save the block (Ctrl+S).
- Select the Blocks folder in the project tree. Right-click and choose Download > Selected Objects, or click the Download to CPU toolbar button. The download sequence:
- STEP 7 first checks whether a system data block download is required (it is, because the HW Config defines the rack population). It downloads the SDB implicitly.
- OB1 is compressed and written to the MMC. A progress bar shows the transfer.
- After successful download, the CPU performs a restart and OB1 begins execution.
- If a Download to CPU prompt appears asking to reinitialize, click Yes. If it warns about CPU in RUN - stop CPU first, accept the prompt to stop the CPU, download, then restart.
Common download errors
| Error | Cause | Fix |
|---|---|---|
| 33:1213 | No MMC inserted | Power off, insert Siemens MMC, power on |
| 33:2121 | CPU is in wrong mode | Stop CPU from STEP 7 or mode switch, then download |
| 31:2121 | Wrong MPI address / cable | Verify PG/PC interface and MPI cable |
| SF LED steady | MMC fault or non-Siemens card | Insert genuine Siemens MMC, perform memory reset |
| BF LED flashing | Bus fault / no Profibus connection | Check DP cable and terminator (not relevant for MPI-only use) |
| "Insufficient work memory" | Program exceeds 24 kB code + data | Reduce block count or use CPU 315 (128 kB) |
9. Verification: Online Monitoring and I/O Test
- After the download, the CPU is in RUN-F (run with flash card). The RUN LED is green; the STOP LED is off.
- Open OB1 and click the Monitor button (glasses icon) or press F5. STEP 7 highlights active rungs in green; you can see the I0.0 and Q0.0 status change in real time as you press the pushbutton.
- Open PLC > Monitor/Modify > Monitor (All) to see the I/Q/M state tables. The clock memory bits M10.0 through M10.7 cycle in a fixed pattern (0.1 s, 0.2 s, 0.5 s, 1 s, 2 s, etc.).
- Open PLC > Diagnostic Buffer. The most recent entries should show:
Download completed, mode transition from STOP to RUNRestart completed, OB100 executed (if present)
- Press the input pushbutton. The LED on output Q0.0 illuminates. The fan (driven by Q0.1 through the 2 s clock memory bit) toggles every 2 s.
If the LED does not light:
- Check the sensor supply (terminal 1L+ on the SM 323 must be 24 V).
- Check the load supply (terminal 2L+ on the SM 323 must be 24 V for the outputs).
- Check the I/O address mapping in HW Config: the SM 323 in slot 4 is at default address 0/0, so I0.0 and Q0.0. If you placed the SM in a different slot, addresses shift accordingly (slot 4 = 0/0, slot 5 = 4/4, slot 6 = 8/8, slot 7 = 12/12).
10. Troubleshooting Matrix
| Symptom | LED pattern | Diagnostic buffer keyword | Likely cause | Resolution |
|---|---|---|---|---|
| CPU will not accept download | SF + STOP | No memory card | No MMC installed | Insert genuine Siemens MMC, power-cycle |
| CPU stays in STOP after download | STOP blinking | Download error, OB not loaded | Project size exceeds MMC | Use larger MMC, prune unused blocks |
| SF LED on after power-up | SF steady | MMC fault / MMC not Siemens | Foreign MMC inserted | Replace with Siemens MMC, perform MRES |
| RUN LED off, STOP blinking | STOP 0.5 Hz | Hardware configuration error | Slot population mismatch | Re-run HW Config download, fix slot order |
| BF LED on | BF steady | DP bus fault | DP cable short or terminator missing | Check DP cabling, enable terminator on end nodes |
| Accessible Nodes empty | All off | No entry | Wrong PG/PC interface or cable | Set PC Adapter (MPI), check MPI cable pinout |
| Online: "Cannot write to MMC" | SF + STOP | Write protection active | MMC write-protect tab set | Remove write protection on MMC |
| Online: "Firmware update required" | SF + STOP | Wrong firmware | Project compiled for newer FW | Match CPU order number & FW in HW Config |
Performing a memory reset (MRES)
If the CPU is locked up by a corrupt MMC, perform a memory reset before reinserting a known-good card:
- Turn the mode switch to STOP.
- Hold the switch in the MRES position for 3 seconds until the STOP LED blinks slowly.
- Return the switch to STOP, then back to MRES within 3 seconds.
- The STOP LED blinks fast, then solid: the work memory is cleared. The MMC is not erased by MRES; remove it and replace if needed.
11. Sizing Notes: How Many OB Blocks Fit on a 64 kB MMC?
Empirically, a 64 kB MMC holds approximately 10-20 small OBs/FBs of ~1-2 kB each plus system data and the SDB. The CPU 314's 24 kB work memory is the real ceiling, not the MMC. If the program exceeds work memory at runtime, the CPU raises SF: Insufficient work memory in the diagnostic buffer and the new block is rejected. The rule of thumb:
- Each NW in OB1 with one segment ≈ 10-20 bytes of work memory code.
- Each FB instance DB ≈ 200-500 bytes.
- Each global DB ≈ 100-300 bytes base + data type size.
For the LED/fan test program above, total work memory consumption is well under 1 kB; the 24 kB work memory is more than enough. The MMC is the limiting factor only because, without it, the program cannot be stored at all.
12. Going Beyond the First OB1
Once OB1 is running, additional learning steps in the same hardware context include:
- Add OB35 cyclic interrupt at 100 ms to drive a blinking LED at fixed rate, independent of OB1 scan time.
- Add a DB100 global data block with a few BOOL and INT tags; use them as setpoints for the cyclic interrupt.
- Add a FC10 function for the LED/fan logic and call it from OB1; this is the first step toward modular code.
- Add OB100 warm restart to initialize counters and setpoints at every power-up.
- Add OB82 diagnostic interrupt to detect a missing or faulty SM 323.
When the program outgrows the 24 kB work memory, the next upgrade is a CPU 315-2 DP (6ES7315-2AF03-0AB0, 128 kB work memory) which fits in the same backplane and uses the same MMC family.
FAQ
Do I really need an MMC to add OB blocks to a CPU 314?
Yes. The CPU 314 has 24 kB of work memory (RAM) but no integrated load memory; load memory lives on the MMC. Without a genuine Siemens MMC inserted, STEP 7 returns error 33:1213 ("Download to CPU not possible because no memory card is inserted") and the CPU stays in STOP. The smallest supported MMC is 64 kB, order number 6ES7953-8LF00-0AA0.
Can I use a third-party SD or MMC card instead of a Siemens one to save cost?
No. Siemens S7-300 / S7-400 CPUs authenticate the MMC against a Siemens-specific firmware and filesystem. A Kingston, SanDisk, or generic SD card will not mount; the CPU raises SF and refuses any download. The MMC must also never be formatted in Windows; doing so permanently breaks the card on the CPU. Use a genuine Siemens MMC every time.
What is the difference between work memory, load memory, and retentive memory on the CPU 314?
Work memory is the volatile RAM that holds executing code and DB data (24 kB for CPU 314). Load memory is the non-volatile area on the MMC that stores the entire project so it survives power-off. Retentive memory is a subset of DB bit memory that retains its value across power cycles; on the CPU 314 it is configured in HW Config and is also backed up to the MMC (no internal battery is required for the CPU 314, but a battery is required for full NVRAM operation; verify per order number).
My CPU shows in "Accessible Nodes" but the blocks are read-only - why?
The block list returned by Accessible Nodes is read from the MMC; if the MMC has its write-protect tab set, or if the CPU is in RUN with no MMC, or if the PG's "Operating Mode" is set to "Monitor only" (Tools > Options > PG/PC Interface > Properties), blocks are read-only. Move the MMC write-protect slider to the off position, set the PG/PC mode to "Process Operation - Test", and re-attempt the download.
Which STEP 7 version supports the CPU 314 with order number 6ES7314-1AE04-0AB0?
STEP 7 V5.5 with SP4 or later is the recommended tool. TIA Portal V13 SP1 or later can also program the CPU 314 in legacy mode, but STEP 7 V5.5 is the canonical environment for S7-300 projects of this generation. The HW Config catalog for V5.5 lists the CPU 314 with firmware V1.2 / V2.0 / V2.6 variants under CPU-300 > CPU 314.