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.
| Part | Function | Example |
|---|---|---|
| CPU | Runs the program and holds the memory | S7-1214C, S7-1511 |
| Digital inputs | Read on/off field signals | Start button, limit switch, proximity sensor |
| Digital outputs | Switch field devices | Contactor coil, solenoid valve, lamp |
| Analog inputs | Read measured values | 4-20 mA pressure transmitter |
| Analog outputs | Drive continuous actuators | Control valve, drive speed reference |
| Communication | Talk to HMI, SCADA and drives | PROFINET 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.
- 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.
- Check the I/O addresses. Open the device view and note the start addresses of the input and output modules.
- Build the tag table. Give every physical signal a name before you write logic:
Start_PB,Stop_PB,Motor_Run,Motor_Feedback. - 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_Runat 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.
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.
- Download to the CPU with the machine isolated, or to PLCSIM if you have no hardware.
- Go online and watch the rung. Contacts and coils show live state, which makes logic errors obvious.
- Create a watch table with the four tags and modify the inputs from there rather than pressing field buttons.
- Test the stop path first. Prove the machine stops before proving it starts.
- Only then energise real outputs, with the drive isolated if there is any doubt.
| Symptom | Usual cause |
|---|---|
| Motor runs only while the button is held | Missing seal-in contact |
| Motor will not start at all | Stop contact programmed normally closed with an NC field button |
| Motor cannot be stopped | Output written in two places in the program |
| Download refused | CPU article number or firmware does not match the hardware |
| Output true in software, nothing in the field | Wiring, 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- 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
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.
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.
Download and go online
Download to the CPU or PLCSIM and open the online view of OB1.
Test the stop path first
With the motor running in simulation, force the stop input false and confirm the output drops.
Test with a watch table
Create a watch table with all four tags, then start and stop from there.
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.
