Loading local progress…
PLC Gym
PLC Gym homeLevel 1, 0 XP · your progress
All guides

Siemens S7-1200 and S7-1500: how they differ and how to program them

S7-1200 and S7-1500 explained: how they differ, what they replaced, which languages they use, GRAPH included, and how to start programming one.

A compact PLC with wired inputs and outputs, mounted on a rail inside a control panel.
A compact controller in a panel, the kind of job the S7-1200 is built for
In this guide
  1. What is the Siemens S7-1200?
  2. What is the Siemens S7-1500?
  3. S7-1200 vs S7-1500 at a glance
  4. Which one should you use?
  5. The S7-1200 G2, and why the date matters
  6. What they replaced: S7-200, S7-300 and S7-400
  7. Which software and languages program them?
  8. How to start programming an S7-1200 or S7-1500
  9. Where PLC Gym fits, and where it doesn't
  10. Sources

This guide covers what the S7-1200 is, how it differs from the S7-1500, which one to use and how you actually program one, with a short piece of real SCL near the end.

Here's the short version. The S7-1200 is Siemens' compact PLC and the S7-1500 is its bigger, modular one. Both belong to the SIMATIC S7 family, both are programmed in TIA Portal, and both use LAD, FBD and SCL. The S7-1500 adds GRAPH and STL, which the S7-1200 doesn't have.

The technical facts below come from Siemens' own manuals and product pages, linked at the bottom. This range is changing right now, so anything that could go stale has a date on it, and it was all checked on 3 November 2026.

What is the Siemens S7-1200?

Siemens calls the S7-1200 its Basic Controller. It's aimed at compact jobs in the low to medium performance range, with inputs, outputs and communication on the CPU itself, and modules you can add when you need more. Siemens lists temperature control, pump and fan control, conveyors and even packaging machines as suitable work.

It also has high speed counters, pulse outputs, simple motion control and PID built in, and Siemens says those work without special expansion modules. There are fail safe versions as well as standard ones.

What is the Siemens S7-1500?

The S7-1500 is the Advanced Controller. It's modular, with several CPU performance classes and separate modules for I/O, technology and communication. The family goes well beyond a standard CPU too: technology CPUs for advanced motion control, redundant CPUs where a backup has to take over, software controllers that run on PC hardware, and a virtual PLC.

S7-1200 vs S7-1500 at a glance

S7-1200S7-1500
Siemens' name for itBasic ControllerAdvanced Controller
Built forCompact jobs, low to medium performanceModular systems, several performance classes
LanguagesLAD, FBD, SCLLAD, FBD, SCL, GRAPH, STL
STEP 7 editionBasic or ProfessionalProfessional
Fail safe versionsYesYes
Also in the familyThe newer G2 generationTechnology, redundant, software and virtual versions

Memory and speed vary CPU by CPU, so this guide leaves the numbers out rather than give you one that's wrong for your model. Siemens' own product overview points to a five step check on its site that suggests a controller from what you need.

Which one should you use?

Treat this as a summary of how Siemens positions them, and let a controls engineer make the real call.

  • Look at the S7-1200 for a compact machine, such as pumps, fans or conveyors, where LAD, FBD and SCL are enough.
  • Look at the S7-1500 for a bigger modular system, or when you want GRAPH for sequences, advanced motion, redundancy or a software controller.
  • Got a site standard? Follow it. And if you're learning for a job, learn whichever one that site or employer uses.

The S7-1200 G2, and why the date matters

Older guides won't mention this. Siemens announced the S7-1200 G2 at Hannover Messe in April 2024, calling it its first new controller generation in ten years. The first CPUs were the 1212C, 1212FC, 1214C and 1214FC, and Siemens says to use at least TIA Portal V20 to fully support them.

The original S7-1200 is now on its way out. Siemens' migration overview says the discontinuation announcement was scheduled for 1 November 2026. Components stay available as new parts until 1 October 2027, then it's spare parts only, until 2036. Siemens also says all future development goes into the G2. Its product overview for the S7-1200 carried that same October 2027 date when checked for this guide, but check the status of your own article number.

A G2 isn't a straight swap, because Siemens says it isn't hardware compatible with the earlier family. Existing programs can usually be converted with minor changes, though, and there's a migration tool for TIA Portal.

There's good news for learners too. Siemens describes the G2 as using the same instructions as the S7-1500, and the G2 manual tells you to follow the S7-1500 option when the help differs by PLC family. So what you learn on one carries over well. You'll still meet the original S7-1200 for years too, with spares planned to 2036.

What they replaced: S7-200, S7-300 and S7-400

Older familyMoved toWhat Siemens says
S7-200S7-1200The S7-1200 is its successor. Phased out from 1 October 2013, new parts to 1 October 2014, then spares for 9 more years.
S7-300S7-1500Phase out announced October 2023, new parts to October 2025, spares to at least October 2033. Exceptions for single modules are possible.
S7-400S7-1500Listed as a legacy controller alongside the S7-300. Siemens gives no firm public date, so check your article number.

None of these moves is a straight copy across. Siemens publishes a transition manual for the S7-200 and a full migration guide for the S7-300 and S7-400, and that guide notes the CPU isn't automatically changed to an S7-1500 when you bring an old project into TIA Portal. And the S7-1200 has no STL, so a program written in STL would have to be rewritten for it.

Which software and languages program them?

Both are programmed with STEP 7, which lives inside TIA Portal, Siemens' engineering software. Siemens describes STEP 7 Basic as a price optimised subset of STEP 7 Professional. Its migration guide lists Basic for the S7-1200 only, and Professional for the S7-1200, S7-1500, S7-300 and S7-400. That table dates from 2015, so check the scope of your own version before you buy.

These are the languages you'll choose between.

  • LAD, ladder logic, drawn like a circuit diagram. S7-1200 and S7-1500.
  • FBD, function block diagram, drawn with logic boxes. S7-1200 and S7-1500.
  • SCL, Structured Control Language, a high level text language. S7-1200 and S7-1500.
  • GRAPH, sequences drawn as steps and transitions. S7-1500 only.
  • STL, statement list, which you'll meet when older S7-300 and S7-400 programs are migrated. S7-1500 only.

So does the S7-1200 support GRAPH? No. Siemens' comparison list says the S7-1200 only supports LAD, FBD and SCL. The G2 manual (December 2025) lists those three plus Cause Effect Matrix for function blocks, and no GRAPH. If you need a sequence on an S7-1200, you'd write it yourself, for example as a state machine using a CASE statement in SCL.

Each block in a program can use a different language. Siemens says its languages compile directly to machine code, with the same level of performance for the same kind of data access. The one to watch is GRAPH, which Siemens says takes longer to process. So you can pick whichever reads best for that job. Its programming guideline for the S7-1200 and S7-1500 is worth reading once you're past the basics. The edition used here is from December 2018, so look for a newer one.

How to start programming an S7-1200 or S7-1500

  1. Get TIA Portal in an edition that covers your controller. It's licensed software, so ask Siemens or your distributor about licences. The V21 installation notes describe a one time 21 day trial.
  2. Create a project and add your CPU. In the Portal view, choose Devices & Networks, then Add new device, and pick the correct article number and firmware version from the list.
  3. Set up the hardware configuration. That means telling the software which modules are fitted.
  4. Add a code block. You choose the language when you create it.
  5. Call it from Main. The CPU runs its program cycle blocks every scan, starting with the lowest numbered, which is usually Main, OB 1.
  6. Compile and download to a real CPU. With no hardware, you can use S7-PLCSIM instead, and the guide to TIA Portal simulation covers how.
  7. Watch it run. Go online and use a watch table to see your tags change.

A short SCL example

Here's a small function block, laid out the way a TIA Portal source file looks. It starts a pump and raises an alarm if the pump runs without proving flow. The first generation S7-1200, the G2 and the S7-1500 all have SCL, so it isn't tied to one controller.

FUNCTION_BLOCK "FB_Pump"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT
      Start : Bool;
      Stop : Bool;
      Permit : Bool;
      FlowProven : Bool;
   END_VAR

   VAR_OUTPUT
      PumpOn : Bool;
      FlowAlarm : Bool;
   END_VAR

   VAR
      FlowCheck {InstructionName := 'TON_TIME'; LibVersion := '1.0'} : TON_TIME;
   END_VAR

BEGIN
	// Start latches the pump. Stop or losing Permit drops it out.
	#PumpOn := (#Start OR #PumpOn) AND NOT #Stop AND #Permit;

	// A command isn't proof. Alarm if the pump runs 5 s with no flow.
	#FlowCheck(IN := #PumpOn AND NOT #FlowProven,
	           PT := T#5S);
	#FlowAlarm := #FlowCheck.Q;
END_FUNCTION_BLOCK

You then call it from Main through its instance data block, passing in your real tags.

"PumpControl_DB"(Start := "StartButton",
                 Stop := "StopButton",
                 Permit := "LinePermit",
                 FlowProven := "FlowSwitch",
                 PumpOn => "PumpContactor",
                 FlowAlarm => "PumpAlarm");

Here's how to read it.

Here Stop is TRUE while pressed. A real stop button is often wired normally closed, so its input is on until someone presses it. You'd then pass Stop := NOT "StopButton".

  • # marks a tag that belongs to this block, and double quotes mark a tag or block from the wider project.
  • := sets a value or passes one in, and => reads an output back out.
  • The first line is a seal in. #PumpOn feeds back into itself, so the pump keeps running after Start is released. Stop and Permit sit outside the brackets, so either one can drop it out.
  • #FlowCheck is an on delay timer with its own instance, so it remembers its time between scans. It only counts while the pump is commanded and there's no flow, and after 5 seconds its Q output turns the alarm on.

This block does all of that in PLC Gym's own engine, but it hasn't been run on a real CPU, so test it in TIA Portal before you trust it. It's also ordinary control logic for learning, not a safety function. Real emergency stops need proper safety rated equipment and a competent person.

Where PLC Gym fits, and where it doesn't

PLC Gym teaches the TIA Portal languages, SCL, LAD, FBD and GRAPH, in a web browser on its own simulator, with a 20 millisecond scan. You write the code, press Run, and a 3D machine reacts to it.

But it doesn't simulate a particular CPU, so there's no CPU 1214C to pick from a list. There's no hardware configuration, no modules, no high speed counters, no networks and no Siemens library blocks. It isn't a real controller, it doesn't connect to real I/O, and it isn't made by or affiliated with Siemens. GRAPH is taught as it's used on the S7-1500, so remember a real S7-1200 won't have it.

So if you need to learn the hardware side, you need TIA Portal and either a real PLC or S7-PLCSIM. The PLC training kit guide covers the buying side. PLC Gym is for the logic, so the logic is already familiar when you sit down at the real software.

You can practise the ideas from the example in making a pump stay running and waiting for the process, then try one batch in four phases in GRAPH. PLC Gym's Siemens PLC training puts it all in order. The first few missions are free with a free account, and the rest is on Pro.

Once your SCL works, you can export it as an .scl file made for TIA Portal. Nobody has yet proved those files import into the real software, so test yours there before you rely on it.

Sources

Questions about this?Ask in the Locker Room

Try it on a machine

Free · Runs in your browser

Try it on a working machine

Write real Siemens or Rockwell code in the free online PLC simulator and watch a 3D pump, tank or filling line do exactly what you told it. Nothing to install.