PLC Programming · Technical Blog

Siemens PLC Programming for Beginners: Step-by-Step Guide

Everything in industrial automation starts with one working rung. This guide takes you from an empty TIA Portal project to a tested start/stop circuit, explaining what each step is actually doing.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Next batch: contact for dates
Quick answer

Create a project, add the CPU that matches your hardware, build a tag table with meaningful names, write bit logic in OB1, compile and download, then test with a watch table before touching real equipment. A latching start/stop circuit with a normally closed stop contact is the first program every PLC engineer should be able to write from memory.

  • Symbolic tag names are not decoration; a program written with I0.0 and Q0.1 becomes unmaintainable within a year.
  • A stop button is wired normally closed and programmed normally open, so a broken wire stops the machine.
  • Test with a watch table and simulation before energising an output on real hardware.

What a PLC Actually Does

A programmable logic controller reads inputs, runs your program, and writes outputs, over and over, thousands of times a minute. That loop is the whole idea. Everything else is detail built on top of it.

PartFunctionExample
CPURuns the program and holds the memoryS7-1214C, S7-1511
Digital inputsRead on/off field signalsStart button, limit switch, proximity sensor
Digital outputsSwitch field devicesContactor coil, solenoid valve, lamp
Analog inputsRead measured values4-20 mA pressure transmitter
Analog outputsDrive continuous actuatorsControl valve, drive speed reference
CommunicationTalk to HMI, SCADA and drivesPROFINET to a KTP panel

Compared to relay logic, the wiring is fixed and the behaviour is in software. Changing a machine sequence becomes an edit and a download instead of a rewiring job, which is why PLCs replaced relay panels almost everywhere.

The repeated loop has consequences you need to understand early, because output states only update once per cycle. That behaviour is explained in the PLC scan cycle.

Setting Up Your First TIA Portal Project

Open TIA Portal, create a project and work through these steps in order.

  1. Add the CPU. Select the exact article number and firmware version of your hardware. A mismatch here causes download failures later that look like network problems.
  2. Check the I/O addresses. Open the device view and note the start addresses of the input and output modules.
  3. Build the tag table. Give every physical signal a name before you write logic: Start_PB, Stop_PB, Motor_Run, Motor_Feedback.
  4. Set the CPU protection and IP address so the PLC is reachable and not open to accidental changes.

Naming that survives handover

Use a pattern and stick to it across the project: device, then function, then type. Conveyor1_Start_PB tells another engineer everything; Tag_17 tells them nothing. Add a comment on every tag stating the wiring terminal, and troubleshooting time on site drops immediately.

Choose data types deliberately as the program grows; the reasoning is in PLC data types and memory areas.

Writing the Start/Stop Latching Circuit

The first real program is a motor that starts on a button press, keeps running when the button is released, and stops on the stop button. In ladder logic it is one rung.

  • A normally open contact for Start_PB.
  • In parallel with it, a normally open contact for Motor_Run, which is the seal-in or latch.
  • In series, a normally open contact for Stop_PB.
  • The coil Motor_Run at the end of the rung.

The parallel contact is what holds the output on after the operator lets go of the button. Remove it and the motor runs only while the button is held.

Why the stop contact is programmed normally open

Wire the stop button as a normally closed contact in the field, so the PLC input is true when the button is not pressed. In the program, use a normally open contact for it. Pressing stop breaks the circuit and the input goes false, stopping the motor. A broken wire does exactly the same thing, which is the behaviour you want. Wiring stop as normally open means a broken wire leaves the machine running with a dead stop button, and that has injured people.

The same reasoning extends into full permissive chains, covered in PLC interlocks and permissives.

Learn on real Siemens hardware

Practical PLC training with S7-1200 and S7-1500 trainers, online or in the Pune classroom.

Book a Free Demo Class

Compile, Download and Test Safely

Compile the block first and read every warning, not just the errors. Warnings about unused tags or overlapping addresses are usually telling you something real.

  1. Download to the CPU with the machine isolated, or to PLCSIM if you have no hardware.
  2. Go online and watch the rung. Contacts and coils show live state, which makes logic errors obvious.
  3. Create a watch table with the four tags and modify the inputs from there rather than pressing field buttons.
  4. Test the stop path first. Prove the machine stops before proving it starts.
  5. Only then energise real outputs, with the drive isolated if there is any doubt.
SymptomUsual cause
Motor runs only while the button is heldMissing seal-in contact
Motor will not start at allStop contact programmed normally closed with an NC field button
Motor cannot be stoppedOutput written in two places in the program
Download refusedCPU article number or firmware does not match the hardware
Output true in software, nothing in the fieldWiring, fuse or output module fault, not a program fault

Forcing is a commissioning tool, not a running mode. Remove every force before you leave site and record it in the handover; see Siemens PLC troubleshooting.

Hands-On Lab: Your First Start/Stop Program

Hands-on
Before you start
  • TIA Portal with an S7-1200 or S7-1500 CPU, or PLCSIM
  • Two digital inputs and one digital output, real or simulated
  • Isolate any real motor before downloading
  • Estimated time: 30 minutes
1

Create the project and tags

Add the CPU and build a tag table with Start_PB, Stop_PB, Motor_Run and Motor_Feedback, each with a comment.

Every tag has a name, address, data type and comment.
2

Write the rung

In OB1, build the start contact in parallel with the Motor_Run seal-in, in series with the stop contact, driving the Motor_Run coil.

The block compiles with no errors.
3

Download and go online

Download to the CPU or PLCSIM and open the online view of OB1.

Contact and coil states are visible live in the rung.
4

Test the stop path first

With the motor running in simulation, force the stop input false and confirm the output drops.

The output turns off immediately and does not latch back on.
5

Test with a watch table

Create a watch table with all four tags, then start and stop from there.

The seal-in holds the output after the start input returns to false.
Checkpoint—how to know you did it right

The motor starts on a momentary press, stays running, stops reliably, and a simulated broken stop wire also stops it.

Frequently asked questions

Which PLC should a beginner start with?

The Siemens S7-1200 with TIA Portal is the most common entry point in India, and the same software and concepts carry directly to the S7-1500 used on larger plants.

Why is the stop button wired normally closed?

So a broken wire or a loose terminal produces the same result as pressing stop. If it were wired normally open, a broken wire would leave the machine running with a stop button that does nothing.

What is a seal-in contact?

A contact from the output itself, wired in parallel with the start button, that keeps the output energised after the operator releases the button.

Do I need real hardware to learn PLC programming?

No. PLCSIM simulates the CPU well enough to learn logic, timers, counters and sequences. Hardware matters when you reach wiring, analog signals and commissioning.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full syllabus + free demo class

Share your details—a Softwell training advisor will contact you with batch dates, fees and hardware-practice options.

No spam. Used only to share course details for this enquiry.

Learn with practical industrial examples

Join live online, Pune classroom or corporate in-plant automation training.

Request Course Details
Verified learning pathway

Discuss Siemens PLC Programming for Beginners

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 09 September 2026

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB
☎ Call WhatsApp ✉ Email Enquire Now