Introduction to Siemens PLC Programming: Nine Classic Cases

Introduction to Siemens PLC Programming: Nine Classic Cases

01
Car Back-and-Forth Movement

Implement the back-and-forth movement of the car using S7-200.Automatic control is achieved. The control process involves pressing the start button, causing the car to move from left to right (and vice versa). When it reaches the right (or left) limit switch, it automatically returns, and upon hitting the other limit switch, it again returns. This back-and-forth movement continues until the stop button is pressed, at which point the car stops moving.

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Program Debugging and Result Analysis

Introduction to Siemens PLC Programming: Nine Classic Cases

When SB2, i0.0 (click to connect i0.0f), is pressed, Q0.0 connects, making the car move right (indicated by light Q0.0 being on).

When the car hits the right limit switch SQ2, i0.4 (click to simulate SQ2 being pressed), it connects, and the car moves left (light Q0.0 goes off, light Q0.1 turns on). Upon reaching the left limit switch SQ1, i0.3 (click to connect i0.3f), the car moves right again (light Q0.1 goes off, light Q0.0 turns on).

This back-and-forth movement continues until SB1, i0.2 (click to connect i0.2f), is pressed, stopping the car.

Appendix:

Introduction to Siemens PLC Programming: Nine Classic Cases

02
Flashing Circuit

When the start button is pressed, it is required to flash the light on for one second and off for one second, repeatedly, making the light blink.

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases
➤ Program Debugging and Result Analysis

Download the written program to the Siemens S7-200 PLC for debugging, observe whether the running results match the experimental requirements. Debugging is done through the online control panel. When I0.0f (i.e., I0.0 connected) is pressed, Q0.0 has output, and the connected load light turns on. At the same time, timer T37 starts timing. After one second of timing, T37 acts, its normally closed contact opens, so Q0.0 has no output, and the connected load light goes out.

As the light goes out, timer T38 starts. After one second of timing, the normally closed contact connected in series with timer T37 opens, causing T37 to reset, and its normally closed contact returns to closed. At this point, Q0.0 has output again, and the connected load light turns on.

Thus, the load light connected to output Q0.0 turns on for one second and off for one second, continuously flashing until I0.1f (i.e., I0.1 connected) is pressed, stopping the flashing circuit.

If you want to change the flashing frequency of the light, just change the timer’s time to achieve the desired effect.

03
Star-Delta Soft Start
Use Siemens S7-200 PLC to implement star-delta connection for soft starting.

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases
➤ Program Debugging and Result Analysis

Download the written program to the Siemens S7-200 PLC for debugging. After downloading, we open the online control panel to debug and see if the running results meet the requirements.

First, set the switch on the control panel to i0.2f, indicating the circuit breaker QF is closed. Press the start button i0.0f (SB2), i.e., i0.0 connected, which indicates that the motor starts in star mode, with outputs Q0.0 and Q0.1. The lights L1 and L2 in the experimental wiring diagram light up, and the timer starts counting. When the timer counts to 10 seconds, it switches to delta starting, at which point Q0.1 has no output, and Q0.2 has output, resulting in outputs Q0.0 and Q0.2 being active, and the motor runs in delta mode. The lights L1 and L3 light up. Pressing i0.1f on the online panel (i.e., i0.1 connected) stops the motor. All output points go off.

04
Color Light Control

Use PLC outputs Q0.0 to Q0.7 to control eight color lights, making them light up one by one every second in a loop. When I0.0 is connected, all lights go out. When I0.1 is connected, it starts looping again from Q0.0.

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

Introduction to Siemens PLC Programming: Nine Classic Cases

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases
➤ Program Debugging and Result Analysis

Download the written program to the PLC for debugging. After downloading, we open the online control panel to debug and see if the running results meet the requirements.

After powering up the PLC, sm0.0 remains connected. Therefore, t37 starts timing. After the delay, t38 starts timing. After t38 times out, its normally closed contact opens, disconnecting t37, and its normally open contact returns to open, thus t38 also stops timing. At this point, t38’s normally closed contact returns to closed, so t37 starts timing again, and counter C0 starts counting once. This repeats. When the counter reaches 1, Q0.0 connects. When the counter reaches 2, Q0.1 connects…

Continuing this way, when the counter reaches 8, Q0.7 connects. When the counter reaches 9, counter C0 resets. When I0.0f on the online control panel is pressed (i.e., I0.0 connected), the counter and Q0.0~Q0.7 reset, meaning no lights are on. When I0.1f on the online control panel is pressed (i.e., I0.1 connected), the counter starts counting again, and the lights turn on one by one from Q0.0.

05
Comparison Instruction

Record the goods entering and exiting the warehouse. The warehouse can hold a maximum of 6000 boxes. When the goods exceed 1000 boxes, light L1 turns on, and when it exceeds 5000 boxes, light L2 turns on.

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Program Debugging and Result Analysis

Download the program to the S7-200 PLC for debugging. Before downloading, we should reduce the numbers in the program, so we can better and faster observe the experimental results.

We set L1 light to turn on when the value is 5. We set L2 light to turn on when the value is 10. This way we can see the experimental results faster.

When I0.0f on the online control panel is pressed, i0.0 connects, indicating goods are entering. When we click I0.0f on the online control panel five times, the timer’s count value is 5 (indicating there are already 1000 boxes of goods in the warehouse), so light L1 turns on, meaning Q0.0 has output.

When we continue to click I0.0f ten times, the counter value becomes 10 (indicating there are 5000 boxes of goods in the warehouse), so light L2 also turns on, meaning Q0.1 has output. When we continue to click I0.0f, the counter value continues to increase.

When I0.1f on the online control panel is pressed, the counter starts to decrease. Each click decreases the counter by one. When the counter value is less than 10, it indicates there are less than 5000 boxes of goods in the warehouse, at which point light L2 goes out (meaning Q0.1 has no output). When we continue to click I0.1f, the counter value continues to decrease. When it decreases to less than 5, it indicates there are less than 1000 boxes of goods in the warehouse, at which point light L1 goes out, and Q0.0 has no output.

When I0.2f on the online control panel is pressed, the counter resets. Both L1 and L2 go out (i.e., Q0.0 and Q0.1 have no output).

06
Eight Color Lights Shift Control

Control the eight color lights connected to Q0.0 to Q0.7 to shift in a loop using IO wires, shifting every 0.5 seconds with t37 timing. Initially, set Q0.0 to Q0.7 to have output, allowing Q0.0 and Q0.2 to be on first. Use I0.1 to control the direction of the color light shift.

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Program Debugging and Result Analysis

Download the program to the Siemens S7-200 PLC for debugging. Once powered on, Q0.0 and Q0.2 will output, meaning Q0.0 and Q0.2 light up.

When the I0.0f switch on the online panel is pressed, timer T37 starts timing every 0.5 seconds, and the color lights shift right each time. When I0.1f is pressed (indicating I0.1 has input), the color lights shift left in the same way.

07
Jump Instruction

Use jump instructions to control two lights L1 and L2, connected to Q0.0 and Q0.1, with toggle switch positions I0.0, I0.1, and I0.2. In manual mode, use the control switches for the two lights separately. In automatic mode, the two lights alternate every second.

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Program Debugging and Result Analysis

Download the written program to the S7-200 PLC for debugging. When I0.0 is OFF, the PLC runs the manual program. Pressing the online control panel buttons I0.1f and I0.2f (indicating I0.1 and I0.2 are closed) lights up L1 and L2, meaning Q0.0 and Q0.1 have output.
When we press I0.0f on the online control panel, I0.0 becomes ON, and the program jumps to run the automatic program. The two lights alternate every second, first L1 for one second, then L2. When I0.0f is pressed again, I0.0 becomes OFF, and the program jumps back to manual mode.
08
Sequential Start Control of Blower and Inducer

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases

Introduction to Siemens PLC Programming: Nine Classic Cases

▲ Program monitoring diagram when PLC is powered on, blue indicates connected.

➤ Program Debugging and Result Analysis

Sm0.1 is connected during the first scanning cycle and remains disconnected thereafter. When I0.0f on the online control panel is pressed (i.e., I0.0 connected), Q0.0 connects (indicating light Q0.0 is on), starting the inducer. At the same time, timer T37 connects and starts timing. When the timer counts to 50 (indicating light Q0.1 is on), the blower starts. At this point, both fans are running.

When I0.1f on the online panel is pressed (i.e., I0.1 connected), the blower stops running (indicating light Q0.1 goes off), while timer T38 connects and starts timing. After 5 seconds, the inducer stops running (indicating light Q0.0 goes off).

09
Liquid Mixing

Use S7-200 to implement automatic control of liquid mixing. When the start button is pressed, Liquid Valve A opens, allowing Liquid A to flow into the mixer. When the liquid level reaches the middle limit, Valve A closes, and at the same time, Liquid Valve B opens, allowing Liquid B to flow into the mixer. When the liquid level reaches the upper limit, Valve B closes, then the motor starts to stir.

After stirring for one minute, the motor stops, and Valve C opens, allowing the mixed liquid to flow out. When the liquid level reaches the lower limit, after 5 seconds, the container empties, closing Valve C. At the same time, Valve A opens, injecting Liquid A. This cycle repeats. If the stop button is pressed, the system must wait for one complete cycle to finish before stopping.

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ I/O Allocation Table

Introduction to Siemens PLC Programming: Nine Classic CasesIntroduction to Siemens PLC Programming: Nine Classic Cases

➤ Ladder Diagram Program

Introduction to Siemens PLC Programming: Nine Classic CasesIntroduction to Siemens PLC Programming: Nine Classic Cases

➤ PLC Wiring Diagram

Introduction to Siemens PLC Programming: Nine Classic Cases

➤ Program Debugging and Result Analysis

When I0.03f (i.e., I0.3 closed) is pressed, Valve A opens (i.e., Q0.0 lights up). When I0.0f (i.e., I0.0 middle limit closed) is pressed, Valve A closes, and Valve B opens (i.e., Q0.0 goes off, Q0.1 lights up).

When I0.1f (i.e., upper limit I0.1 closed) is pressed, Valve B closes, and the motor starts stirring (i.e., Q0.1 goes off, Q0.2 lights up), while timer T37 starts timing for one minute. After one minute, the mixer stops stirring, and Valve C opens (i.e., Q0.2 goes off, Q0.3 lights up). When the liquid level reaches the lower limit, Valve C remains open (i.e., Q0.3 lights up), while timer T38 starts timing.

After 5 seconds, Valve C closes. Valve A opens (i.e., Q0.3 goes off, Q0.0 lights up), entering the next cycle. Pressing I0.4f (indicating stop I0.4 closed) on the online control panel will not stop the system immediately; it will only stop after completing one cycle.

Disclaimer: This article is reprinted from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact us to delete it promptly. Thank you!

Leave a Comment