PLC Programming · Lab Manual

Siemens PLC Programming for Beginners: Lab Manual from Push Button to Running Motor

Every PLC engineer starts with the same circuit: start, stop, seal-in. This beginner lab manual builds it the professional way through all six stages – wiring and PLC tags, input mapping, the seal-in rung, HMI tags, a panel lamp – and lets you test it online in the browser, including what happens when the stop wire breaks.

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, declare every physical signal in the PLC tag table, copy the inputs into DB_IO in an input mapping FC, write the start/stop seal-in rung on DB members, drive the output from an output mapping FC, then test with a watch table and the HMI before touching real equipment.

  • Stop buttons are wired NC and read with a normally open contact.
  • Physical addresses live in the tag table and the mapping FCs only.
  • Test with PLCSIM and a watch table before the first download to real hardware.

What a PLC Actually Does

A PLC reads its inputs, executes the program and writes its outputs – over and over, every few milliseconds. Everything in this series builds on that loop, explained in detail in the PLC scan cycle. In TIA Portal you organise the program in blocks: OB1 calls FCs and FBs, data lives in DBs – see OB, FB, FC and DB.

Lab Flow: From Push Button to Running Motor

Every lesson in the Softwell PLC lab manual series follows the same six stages and the same address rule, so the code you write here plugs straight into the HMI lessons.

Lab manual flow: field input to tested HMI screenSix stages: field device and PLC tag, input mapping to DB_IO, PLC logic, HMI tags, graphics linking, and perform and test.1Field + tags%I6.0 .. %I6.2start, stop, overload2Input mappingFC_InputMapping→ DB_IO3LogicFC_MotorM1seal-in rung4HMI tagsDB_M1_Run_Cmd+ HMI commands5GraphicsLamp, buttonsfrom feedback6Perform + testSimulatorbroken wireAddress rule for every lesson: %I only in FC_InputMapping, %Q only in FC_OutputMapping, symbolic DB members everywhere else – including the HMI.
Figure 1 – Six-stage lab flow for this lesson.

Stage 1Field Wiring and PLC Tag Table

Create a project, add the CPU that matches your hardware (for example an S7-1200 CPU 1214C), and declare every physical signal with a meaningful name and comment. A good name survives handover: S2_Stop, not I6_1.

PLC tagAddressTypeDevice / comment
S1_Start%I6.0BoolStart push button, NO
S2_Stop%I6.1BoolStop push button, NC, 1 = not pressed
F1_Overload%I6.2BoolOverload relay auxiliary, NC, 1 = healthy
K1_M1%Q3.0BoolMotor contactor coil

Stage 2Input Mapping into DB_IO

Create a global data block DB_IO and an FC FC_InputMapping called first in OB1. From now on the logic never uses %I; this is the same rule used throughout the HMI lab manual series.

// FC_InputMapping
"DB_IO".Start_PB    := "S1_Start";
"DB_IO".Stop_OK     := "S2_Stop";        // NC: 1 = healthy
"DB_IO".Overload_OK := "F1_Overload";    // NC: 1 = healthy

Stage 3Logic: the Start/Stop Seal-In Rung

Start/stop latching rung with normally closed stop and overloadStart push button in parallel with the seal-in contact of the run command, in series with the stop and overload contacts, driving the run command coil.FC_MotorM1 · Network 1 — Start/stop with seal-in (all operands from DB_IO)Start_PB"DB_IO" · NORun_Cmd"DB_M1" · seal-inStop_OK"DB_IO" · NC wiredOverload_OK"DB_IO" · NC wiredRun_Cmd"DB_M1"Stop and overload are wired NC in the field (1 = healthy) and read with normally open contacts here: a broken wire stops the motor.
Figure 2 – The first rung every PLC engineer should be able to write from memory.
// SCL equivalent
"DB_M1".Run_Cmd := ("DB_IO".Start_PB OR "DB_M1".Run_Cmd) AND "DB_IO".Stop_OK AND "DB_IO".Overload_OK;

// FC_OutputMapping
"K1_M1" := "DB_M1".Run_Cmd;

The next step on a real machine is adding permissives and interlocks around this rung – see PLC interlocks and permissives.

Stage 4Link PLC Tags to the HMI

Add a panel in the same project, drag DB_M1 into the HMI tag table, and add two command bits HMI_Start and HMI_Stop that are ORed into the rung in the PLC. The panel never writes to %Q. The full pattern is in HMI buttons, lamps and auto/manual mode.

HMI tagPLC memberUsed by
DB_M1_Run_Cmd"DB_M1".Run_CmdRun lamp
DB_M1_HMI_Start / _HMI_Stop"DB_M1".HMI_Start / HMI_StopHMI buttons

Stage 5Link the Graphics: Lamp and Buttons

#ObjectPropertiesTag / event
①Circle lamp M1Appearance: 0 white STOP, 1 dark RUNDB_M1_Run_Cmd (better: contactor feedback)
②Button STARTPress: SetBit, PLC clears itDB_M1_HMI_Start
③Button STOPPress: SetBit, PLC clears itDB_M1_HMI_Stop

Compile with Software (rebuild all), download to PLCSIM, open a watch table with the DB_IO members and test before connecting any real equipment.

Stage 6Perform and Test: Start/Stop Circuit Online

Hold START, release it, then press STOP. Break the stop wire, and compare the correct NC wiring with the wrong NO wiring. The rung below is the online view of the network above, with power flow in green.

Field and PLC
Online view and panel
FC_MotorM1 · onlineM1
Lamp

Troubleshooting

SymptomLikely causeFirst check
Motor runs only while START is heldSeal-in contact missingParallel Run_Cmd branch
Motor never startsStop or overload contact programmed NC on an NC-wired inputContact type vs wiring
Stop button does nothingStop wired NO and the wire is brokenRewire NC
Output ignores the rungWritten a second time laterCross reference of K1_M1

Hands-On Lab: Your First Start/Stop Circuit

Hands-on
Before you start
  • TIA Portal and an S7-1200 or PLCSIM
  • Two push buttons and a lamp on the trainer kit, or simulated inputs
  • Estimated time: 60 minutes
1

Wire and declare the tags

Wire S1 start (NO), S2 stop (NC), F1 overload (NC) and contactor K1, and declare them in the PLC tag table.

Each signal has a name, address and comment.
2

Map inputs into DB_IO

Create DB_IO and copy the three inputs in FC_InputMapping.

DB_IO follows each button in a watch table.
3

Write the seal-in rung

In FC_MotorM1 write the start/stop rung on DB_IO members and DB_M1.Run_Cmd; drive K1 in FC_OutputMapping.

The motor runs after START is released and stops on STOP or overload.
4

Link HMI tags

Drag DB_M1 into the HMI tag table and add command bits for HMI start and stop.

The HMI tags appear with the same data types.
5

Build the lamp and buttons

Add a run lamp from feedback and HMI start/stop buttons that write command bits.

Lamp and buttons work from the panel without writing %Q.
6

Download and test

Compile, download to PLCSIM, test start, stop, overload and a broken stop wire.

A broken stop wire stops the motor.
Checkpoint—how to know you did it right

The motor starts, latches, stops on STOP, overload or a broken wire, and no block except the mapping FCs touches a physical address.

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, 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.

Why map inputs into a DB instead of using %I directly in the logic?

So every physical address appears in one place only. If a wire moves to another terminal, you change one line in FC_InputMapping and the logic, the HMI and the alarms stay untouched.

Why is the stop contact programmed as normally open?

Because the NC stop button gives 1 when it is not pressed. A normally open contact passes power while the signal is 1, so the rung conducts until someone presses stop or a wire breaks.

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: 16 October 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