Transfer Siemens S7-1200 PLC Program to SD Card: TIA Guide

David Krause20 min read
S7-1200SiemensTutorial / How-to
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

A SIMATIC S7-1200 CPU (and the newer S7-1200 G2 family) stores the compiled user program in load memory. When a Siemens SIMATIC Memory Card (SMC) is seated in the CPU's card slot at the moment the CPU powers up, the CPU redirects load memory to the card and treats the SMC as the deployment container. The card then becomes the artifact you ship, store, and plug into a replacement CPU. The card also becomes the medium for a one-time program push, for firmware updates, and for spare-PLC cloning.

Engineering teams that run TIA Portal inside a Hyper-V virtual machine frequently lose access to the host's USB ports and cannot use a local SD-card reader. The supported Siemens procedure does not require a local reader: TIA Portal writes the project to the SMC through the PLC's PROFINET/Ethernet interface, with the card already seated in the CPU. This article documents that path, the alternative card-writing methods, the supported Hyper-V and RDP workarounds, the verification steps, and the field-proven safety constraints.

S7-1200 Memory Architecture and SMC Behavior

An S7-1200 CPU partitions its memory into three areas that the engineer must distinguish before choosing a card strategy:

  • Load memory — non-volatile storage for the project: code blocks (OB/FB/FC/DB), hardware configuration, symbols, comments, and PLC tags. By default this is internal flash. When an SMC is in the slot at power-up, the CPU uses the SMC as load memory and the internal flash is bypassed for project storage.
  • Work memory — volatile RAM that holds the running blocks and runtime data. Always internal; never on the card.
  • Retentive memory — a configurable slice of work memory that survives power cycling (tag values, recipe snapshots). Always internal; never on the card.

The SMC occupies the SD card slot on the underside of the CPU module (CPU 1211C/1212C/1214C/1215C/1217C and the G2 family 1212G/1214G/1215G/1217G). The slot is spring-loaded and accepts cards that conform to the SD physical specification. The CPU inspects the card at every power-up. If a valid project is present, the CPU copies the relevant blocks into work memory and starts execution. If the card is empty, the CPU uses internal load memory and the card is held in reserve.

The original S7-1200 (CPU 121xC) supports SD cards up to 2 GB formatted FAT16 and SDHC cards up to 32 GB formatted FAT32. The S7-1200 G2 (CPU 121xG) extends support to higher-grade cards. Always use a Siemens-branded SMC; third-party cards are not validated for industrial temperature, write-cycle endurance, or the CPU's slot diagnostics. Refer to the S7-1200 System Manual for the exact list of supported card families and sizes for your CPU firmware version.

SIMATIC SD Card Types and Selection

An SMC can hold one of three payload types. The CPU inspects the first sector of the card at power-up and selects behavior based on a SIMATIC.S7S job file written by TIA Portal or by a firmware-update utility.

SMC payload types recognized by the S7-1200
Card type Job / contents on card CPU behavior on power-up
Program card Project blocks in a S7-1200 folder layout (no SIMATIC.S7S job file or with a program-card marker) CPU runs the program from the card. Subsequent TIA Portal downloads write to the card and to internal load memory; the card remains the master.
Transfer card Project binary plus SIMATIC.S7S job file with the TRANSFER keyword CPU copies the project from the card into internal load memory, erases the job file, and runs from internal load memory. The card is consumed in one power-up.
Firmware update card Firmware files plus SIMATIC.S7S job file with the FWUPDATE keyword CPU installs the firmware on the card, erases the job file, and reboots into the new firmware.

For a deployable program image that survives CPU replacement, use a program card. The program stays on the card; the card is the deployment artifact. Use a transfer card when you want a one-time push of a project into a CPU that has no SMC in the slot and will be deployed without one. Use a firmware update card only when you need to update the CPU firmware itself, not the project.

SMC Article Numbers and Sizing

Siemens-branded SMCs for the S7-1200 family are ordered from the 6ES7954-8L series. The article number encodes the capacity and the operating-temperature grade. Use the following table as a starting point and confirm with the Siemens SiePortal catalog for the current ordering data.

Selected SIMATIC Memory Card article numbers for the S7-1200 family
SMC size Article number Typical use case
4 MB 6ES7954-8LF02-0AA0 Small CPU 1211C/1212C programs, firmware-update distribution
12 MB 6ES7954-8LE02-0AA0 CPU 1214C projects with a small HMI tag set
24 MB 6ES7954-8LL02-0AA0 CPU 1215C/1217C projects with Web-server artifacts
256 MB 6ES7954-8LE03-0AA0 Programs with recipe/DataLog archive on the card
2 GB 6ES7954-8LP02-0AA0 S7-1200 G2 programs and large web pages
32 GB 6ES7954-8LR02-0AA0 S7-1200 G2 with extended DataLog retention

Size the SMC for the project binary plus a generous headroom for DataLog files, recipe databases, and web-server artifacts. The S7-1200 System Manual provides the maximum project size per CPU; the SMC must be at least that large.

Prerequisites and Compatibility Matrix

  1. TIA Portal version. TIA Portal V14 supports the original S7-1200 (CPU 121xC) family. S7-1200 G2 CPUs require TIA Portal V18 Update 2 or later with the S7-1200 G2 HSP installed. Use the TIA Portal Online > Accessible devices function to read the CPU's firmware version and confirm that the active TIA Portal project can communicate with it.
  2. CPU firmware. Specific card-size support is firmware-dependent. Update the CPU firmware with a firmware-update SMC if the latest S7-1200 system manual lists a higher required version for your SMC.
  3. SMC. Siemens-branded SIMATIC Memory Card of the size required for the project footprint. Allow headroom for DataLog and recipe folders if these are configured to write to the card.
  4. Ethernet path. The PLC and the engineering station (physical or virtual) must share an IPv4 subnet reachable from the TIA Portal project tree. PROFINET, standard Ethernet, and routed paths through SCALANCE switches are all supported.
  5. Online access rights. The TIA Portal user must have Download to device rights on the project and know the PLC's protection password if one is configured under PLC Properties > Protection > Connection mechanisms.
  6. CPU state. For card creation, the CPU must be reachable online; it does not need to be in STOP. The download itself will stop the CPU briefly if it is in RUN and the project differs from the running program.

Method 1 — Direct Download from TIA Portal with the SMC in the CPU

This is the standard Siemens flow for writing a project to an SMC without a local SD reader. It is the recommended path on virtualized workstations because the only physical connection is Ethernet.

  1. Insert the SIMATIC Memory Card into the CPU's card slot. The CPU must be powered off. Push the card fully into the slot until it latches. Confirm the card's mechanical write-protect switch is in the unlock position.
  2. Power on the CPU. The CPU performs a card check (1-3 s) and adopts the card as the new load memory target. The RUN/STOP and MAINT LEDs return to their normal pattern within a few seconds.
  3. In TIA Portal, expand the project tree to the target CPU and right-click > Download to device > Software (all blocks).
  4. In the Download to device wizard, set the PG/PC interface to the S7ONLINE access point over the appropriate TCP/IP network card. Specify the target CPU by IP address or click Show accessible devices to pick the CPU from the broadcast list.
  5. Click Download. TIA Portal compiles, transfers the project to the CPU, and writes the project to the SMC. If the SMC is read-only because the lock switch is set, TIA Portal reports a write-protect error.
  6. After the download completes, the CPU's MAINT LED blinks briefly, then the RUN/STOP LED returns to solid green if the CPU was in RUN before the download and the project is consistent.
  7. To verify the card is the load memory: in TIA Portal, navigate to Online > Diagnostics > Memory and confirm that load memory reports the SMC's capacity, not the CPU's internal load memory size.

The KB article Usage of the S7-1200 memory card (entry ID 87133851) documents this exact flow and the LED indications for the card-slot state machine.

Method 2 — Building a Transfer Card with an External Reader

Use this method when you want to create deployment cartridges from a physical SD reader connected to the engineering station. This is the method that fails under Hyper-V when USB is not passed through, but it works on a host machine or a VM with USB passthrough enabled.

Per the TIA Portal cloud documentation for the SIMATIC S7-1200 G2 manual collection, the procedure is:

  1. Insert an empty, write-enabled SIMATIC Memory Card into an SD card reader attached to the engineering station.
  2. In the TIA Portal project tree, expand the project and the target CPU. TIA Portal exposes a Card Reader/USB node that lists every connected removable drive.
  3. Right-click the target CPU (or the project) and select Card Reader/USB > [drive letter] > Create a transfer card. In older TIA Portal builds the menu entry is Write to memory card. TIA Portal writes the project binary to the card, including a SIMATIC.S7S job file that triggers a one-time copy on the next CPU power-up.
  4. Wait for the TIA Portal status bar to report Card write complete and for the reader's activity LED to stop blinking.
  5. Eject the card from the reader using the operating system's safe-eject procedure. Do not yank the card while the reader's LED is still active.
  6. Move the card to the target CPU, power off the CPU, insert the card, and power on. The CPU reads the job file, copies the project to internal load memory, erases the job file, and starts the program.

A transfer card is a consumed card after one power-up. To redeploy the same program to another CPU, build a fresh transfer card from the TIA Portal project. Do not pre-format the card with Windows; the S7-1200 expects a specific file system layout and job file in the first sector.

Method 3 — Online Snapshot from CPU to SMC

If the CPU already runs a known-good program and you want to capture that exact program onto an SMC for spare-PLC deployment, use the online-to-card snapshot. This is also the only practical way to recover a project whose TIA Portal source is lost or out of date.

  1. Power off the CPU and insert the empty, write-enabled SMC. Power on the CPU. The card is detected and becomes the load memory target, but the CPU continues to execute from internal load memory until the next power cycle.
  2. In TIA Portal, connect to the CPU (Online > Go online). Confirm that the online project tree shows the running blocks.
  3. Right-click the online CPU in the project tree and select Download to device > Software (all blocks). TIA Portal compiles the online block list, uploads the runtime blocks from the online CPU, and writes them to the SMC. When an SMC is present, the download path targets the card.
  4. When the download finishes, the project lives on the card. Power-cycle the CPU to confirm the project loads from the card and the CPU enters RUN with the expected block list.

For S7-1200 CPUs that have never had a project on the SMC, the card is detected as a new load memory and the CPU formats the card as part of the download. No manual formatting is required.

Method 4 — Card-Image Capture for Off-Site Cloning

For organizations that maintain a card library and want to duplicate a known-good card without going back to TIA Portal, the workflow is:

  1. Power off the source CPU and remove the master SMC.
  2. Insert the master SMC into a USB SD reader connected to an engineering station with TIA Portal installed.
  3. In TIA Portal, navigate to the project tree > Card Reader/USB. Right-click the SMC drive and select Read from memory card (or the equivalent menu entry in your TIA Portal version). TIA Portal uploads the project from the card into a TIA Portal project file in the project tree.
  4. Insert the blank target SMC into the same reader. Right-click the project and select Create a transfer card (Method 2). The new card is byte-identical to the master for project purposes, with the SIMATIC.S7S job file added.
  5. Label both cards. Store the master in an ESD bag in a temperature-controlled cabinet; deploy the duplicate to the field.

For an off-line raw-image copy, you can use a disk-imaging tool (Win32 Disk Imager, dd on Linux). Use a card-to-card reader or two SD readers; do not image between different card families or sizes.

Cloning Workflow for Spare-PLC Deployment

For customers who keep one or more spare S7-1200 CPUs on the shelf and want zero-touch field replacement, use the program-card workflow rather than the transfer-card workflow.

  1. Build a final program in TIA Portal and download it once into a development CPU with an SMC in the slot (Method 1). Confirm the program runs and the diagnostic buffer is clean.
  2. Power off the development CPU, remove the SMC, label it with the TIA Portal project name, project version, target CPU article number, and the date of the last download, and store the SMC in an ESD bag with the spare CPU.
  3. At the field site, power off the failed CPU, swap in the spare, insert the labeled SMC, and power on. The spare CPU copies the SMC project into work memory and starts in RUN after approximately 5-10 s.
  4. Match the IP address, PROFINET device name, and any module configuration if the spare CPU is unconfigured. Use a TIA Portal connection from a service laptop to set the IP/subnet mask and PROFINET name from the device configuration before commissioning the spare in a PROFINET network.
Spare-CPU replacement checklist
Item Source of truth Verify after swap
CPU firmware Original CPU's online diagnostics Online > Diagnostics > CPU > Firmware
IP address Project hardware configuration or device display Ping the spare's IP from the service laptop
PROFINET device name Project hardware configuration PROFINET IO diagnostics in TIA Portal
Retentive tags Internal work memory Watch-table online check on key tags
DataLog files SMC folder Open the card in a reader and inspect the LOG folder
Time of day / timezone NTP or PLC clock Online > Diagnostics > CPU > Time

Recipes, DataLogs, and Card Layout

The SMC is the storage target for two runtime artifacts in addition to the project itself:

  • Recipes. Recipe databases configured in the S7-1200 program are stored in a folder on the SMC. The card must be sized to hold the maximum recipe count and the largest record size you expect to deploy. TIA Portal exposes the recipe folder under PLC > Recipes.
  • DataLogs. DataLog files (CSV format) are written to a LOG folder on the SMC by the DataLog instructions. If DataLog retention is part of the application, size the SMC accordingly and plan a card-swap rotation. A 2 GB card holds years of DataLogs for a typical 1-Hz tag set.

When the SMC is the load memory, the project lives at the card root and runtime artifacts live in the LOG and USER folders. Removing the card from a powered CPU breaks the file system, so recipe and DataLog I/O is not hot-pluggable. Engineering teams that need a hot-swap archive for DataLogs should use the recipe/DataLog functions with a network share rather than the SMC, or accept the planned-downtime model.

Hyper-V and Virtualized Workstation Workarounds

Hyper-V does not expose the host's USB ports to a guest VM by default, and in some deployments the host OS does not enumerate USB devices at all. The supported workarounds, in order of preference, are:

  1. Program the SMC in place over Ethernet (Method 1). This is the recommended path on a virtualized workstation: the SMC is seated in the CPU, the engineering VM reaches the CPU over the network, and TIA Portal writes to the card as part of the project download. No USB or local reader is required.
  2. Enable Enhanced Session Mode in Hyper-V and forward the host's USB reader. Open Hyper-V Manager, select the VM, click Connect, and in the toolbar choose View > Enhanced Session. The host's smart-card/USB devices can be redirected into the guest. This requires Hyper-V 2012 R2 or later on the host and a current-generation VM.
  3. USB pass-through at the Hyper-V host level. Stop the VM, identify the SD reader's USB device instance path in the host's Device Manager, and use the Dismount-VmHostAssignableDevice cmdlet or the Hyper-V Manager SCSI controller to attach the device. Reboot the VM and the device appears as a removable disk.
  4. RDP from the engineering VM into a physical workstation that has the SD reader, and run the TIA Portal Create a transfer card command (Method 2) from the remote session. The RDP client's drive redirection will mount the physical reader on the remote desktop session.
  5. Network share for the SD reader: connect a USB-SD reader to a small network-attached storage device that exports the SD card as a CIFS/SMB share. TIA Portal can read from and write to a network-mapped drive letter, and the engineering VM can mount the share.

The in-place Ethernet download (Option 1) is the only path that is fully supported on the S7-1200 hardware regardless of virtualization platform. The other options are USB-level workarounds that shift the problem to the host's USB stack and can break when Hyper-V, RDP, or the SD reader driver changes.

Verification, Diagnostics, and Slot LED Interpretation

After every SMC operation, run a quick verification:

  1. Online connection. In TIA Portal, click Go online and confirm the project tree shows the same blocks as the offline project. Any block with a different badge indicates a mismatch between the offline project and the program on the card.
  2. CPU load memory size. Online > Diagnostics > Memory > Load memory. The reported size must equal the SMC's capacity, not the CPU's internal load memory size. If the size matches the internal load memory, the card is not in use.
  3. Card-state LED. The S7-1200 has a dedicated LED (or a MAINT pattern) that indicates card access and fault states. A solid or slow-blinking green LED means the card is in use. A fast-blinking green LED means the card is being read or written. A solid red or alternating red/green LED means the card is in an error state — incompatible card, write-protect, or unsupported file system.
  4. Watch-table run/stop test. Force a value on a known tag and confirm the change is reflected online. This confirms the CPU is running the program from the card, not a stale image.
  5. Power-cycle test. Power off the CPU with the card in the slot, power on, and confirm that the program loads and the CPU enters RUN. This is the same power-up the field will see during a spare-CPU swap.

Troubleshooting Matrix

Common S7-1200 SD card faults and resolutions
Symptom Likely cause Resolution
TIA Portal reports "Card is write-protected" Lock switch on the SD card adapter is in the locked position Power off the CPU, remove the card, slide the lock switch to unlock, reinsert, power on
CPU stays in STOP after SMC insertion and power-up Card contains a project that fails the consistency check (e.g., missing hardware configuration for the actual rack) Connect online, read the diagnostic buffer, correct the project, re-download
Download fails with "Incompatible memory card" Card is not a Siemens SMC, or the card size/family is not supported by the CPU firmware Replace with a Siemens SMC of a supported size; update CPU firmware if required
CPU reports "Memory card removed during operation" Card was extracted while the CPU was powered Power off the CPU, reinsert the card, power on. Recreate the card image from the project before commissioning
Online Memory page still shows internal load memory size after SMC insertion Card was inserted after power-up; the CPU does not re-detect mid-run Power off the CPU with the card in place, then power on
Hyper-V guest cannot see the host's SD reader USB is not passed through; the host's USB stack is not enumerating Use Ethernet download (Method 1), enable Enhanced Session Mode, or move the reader to a separate machine reachable over RDP/SMB
Transfer card does not auto-load on the new CPU Card was formatted by Windows and lost the SIMATIC.S7S job file, or the project on the card is corrupt Re-create the transfer card from TIA Portal; do not pre-format the card with Windows
CPU card LED solid red after firmware update Firmware file on the card is incomplete or for a different CPU family Rebuild the firmware-update card from the Siemens support download and re-apply
Spare CPU comes up in STOP with diagnostic buffer entry "Card does not contain a project" Master and spare cards were swapped or the card was mislabeled Verify the card label and the project hash; redeploy from the master TIA Portal project

Safety and Operational Constraints

Critical: Always power off the S7-1200 CPU before inserting or removing the SIMATIC Memory Card. Hot-swapping the card can corrupt the file system, drop the CPU into STOP with a diagnostic-buffer entry, and in rare cases brick the card's directory structure so that the CPU cannot read the project. The S7-1200 System Manual explicitly states that the card slot is not hot-pluggable.

Other field-proven constraints:

  • Do not pre-format an SMC with Windows; the S7-1200 expects a specific file system layout and job file in the first sector.
  • Lock the SD card's mechanical write-protect switch when the card is deployed in a vibrating environment; this prevents accidental field-side corruption but also blocks future downloads.
  • Store blank and program SMCs in ESD bags in a temperature-controlled cabinet; industrial-temperature cards (operating -25 to +70 °C) are recommended for non-conditioned panels.
  • Maintain a 1:1 label-to-project mapping: the label on every spare SMC must list the TIA Portal project name, version, target CPU article number, and the date of the last download. Engineering teams that maintain a library of cards without a registry will deploy the wrong program in an emergency.
  • For failsafe (F-CPU) S7-1200 deployments, the F-signature and F-runtime version on the card must match the safety approval in use. Replace the card with a freshly built F-program card if the F-signature changes between revisions.

Frequently Asked Questions

Does the S7-1200 use the SIMATIC SD card automatically once it is inserted?

Yes, if the SMC is in the slot at the moment the CPU powers up, the CPU treats the card as load memory. If the card is inserted while the CPU is already running, the CPU does not re-detect; you must cycle power for the card to take effect.

Is it safe to remove the SIMATIC Memory Card from a powered S7-1200?

No. The S7-1200 System Manual requires the CPU to be powered off before the card is removed or inserted. Hot-removal can corrupt the card and put the CPU into STOP with a diagnostic buffer entry.

What is the difference between a program card and a transfer card?

A program card holds the project as load memory and remains in the card slot during operation. A transfer card contains a one-time SIMATIC.S7S job that the CPU executes on power-up: it copies the project to internal load memory, erases the job file, and then runs from internal memory. Use a program card for spare-PLC deployment, a transfer card for one-time project rollout.

Can I program the SD card from a Hyper-V virtualized engineering station?

Yes, by downloading the project from TIA Portal over Ethernet to the CPU that holds the card in its slot. The in-CPU download writes the project to the SMC without any local USB reader. Methods 1 and 3 in this article do not require a local SD reader.

Which SIMATIC Memory Cards are supported by the S7-1200?

The original S7-1200 (CPU 121xC) supports Siemens SMCs up to 2 GB (FAT16) and 32 GB (FAT32). The S7-1200 G2 (CPU 121xG) extends support to higher grades and to 32 GB SDXC. Always use a Siemens-branded SMC such as the 6ES7954-8L series; third-party cards are not validated for industrial temperature or write-cycle endurance.

Back to blog