9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

1. Bidirectional Movement of the Cart

Using S7-200 to achieve automatic control of the cart’s bidirectional movement. The control process is initiated by pressing the start button, causing the cart to move from left to right (or right to left). When it reaches the right (or left) limit switch, the cart automatically returns. Upon hitting the other limit switch, it again reverses direction. This back-and-forth movement continues until the stop button is pressed, at which point the cart halts.

9 PLC Programming Cases You Can Understand

▲ Electrical Wiring Diagram

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Program

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

9 PLC Programming Cases You Can Understand

▲ Control Platform Operation Panel

When SB2 is pressed, i0.0 (mouse click i0.0f) is activated, Q0.0 is energized, and the cart moves to the right (indicated by the light Q0.0). When the cart hits the right limit switch SQ2, i0.4 (simulated by clicking i0.4f), it then moves left (Q0.0 light goes off, Q0.1 light goes on). When it reaches the left limit switch SQ1, i0.3 (mouse click i0.3f), it moves right again (Q0.1 light goes off, Q0.0 light goes on). This back-and-forth motion continues until SB1 is pressed, i0.2 (mouse click i0.2f), at which point the cart stops.

Appendix:

9 PLC Programming Cases You Can Understand

2. Flashing Circuit

When the start button is pressed, the requirement is to have one second on and one second off within two seconds, repeating this pattern, causing the light to flash.

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Program

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The written program is downloaded to the Siemens S7-200 PLC for debugging. Observe whether the running results meet the experimental requirements. Through the online control panel, when I0.0f (i.e., I0.0 is activated) is pressed, Q0.0 outputs, and the connected load light turns on, while timer T37 starts timing. After one second, T37 operates, its normally closed contact opens, so Q0.0 has no output, and the connected load light goes off. At the same time, timer T38 starts timing, and after one second, the normally closed contact in series with timer T37 opens, resetting T37, and its normally closed contact returns to closed. At this point, Q0.0 outputs again, and the connected load light turns on. Thus, the load light connected to output Q0.0 flashes on for one second and off for one second continuously until I0.1f (i.e., I0.1 is activated) is pressed, at which point the flashing circuit stops working. To change the flashing frequency of the light, simply adjust the timer’s timing.

3. Star-Delta Reduced Voltage Start

Using the Siemens S7-200 PLC to implement the star-delta connection for reduced voltage starting.

Star-Delta Reduced Voltage Start Circuit and Control Diagram

9 PLC Programming Cases You Can Understand

Flow Framework Diagram

9 PLC Programming Cases You Can Understand

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Program

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The written program is downloaded to the Siemens S7-200 PLC for debugging. After downloading, we open the online control panel for debugging to see if the running results meet the requirements. First, set the I0.2f on the control panel to indicate that the button is pressed, i.e., I0.2 is activated, indicating that the circuit breaker QF is closed. Press the start button I0.0f (SB2), i.e., I0.0 is activated, at which point the motor starts in star mode, with outputs Q0.0 and Q0.1, indicating that both lights L1 and L2 are on, simultaneously driving the timer. When the timer counts to 10 seconds, it switches to delta starting mode, at which point Q0.1 has no output, Q0.2 has output, and both Q0.0 and Q0.2 are energized, causing the motor to run in delta mode. The lights L1 and L3 on the wiring panel are lit. When I0.1f on the online panel is pressed (i.e., I0.1 is activated), the motor stops running, and all output points are deactivated.

4. Color Light Control

Using the PLC’s outputs Q0.0 to Q0.7 to control eight color lights, turning one on every second in a loop. When I0.0 is activated, all lights turn off. When I0.1 is activated, the cycle restarts from Q0.0.

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Program

9 PLC Programming Cases You Can Understand9 PLC Programming Cases You Can Understand9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The written program is downloaded to the PLC for debugging. After downloading, we open the online control panel for debugging to see if the running results meet the requirements.

Once the PLC is powered on, SM0.0 remains activated. Therefore, T37 starts timing. After the delay, T38 starts timing. When T38 times out, its normally closed contact opens, causing T37 to stop timing, and its normally open contact returns to open, so T38 also stops timing. At this point, T38’s normally closed contact returns to closed, so T37 starts timing again, while counter C0 begins counting. This process repeats. When the count reaches 1, Q0.0 is activated. When the count reaches 2, Q0.1 is activated, and so on. When the counter reaches 8, Q0.7 is activated. When the counter reaches 9, the counter C0 resets. When I0.0f (i.e., I0.0) is pressed, the counter and Q0.0 to Q0.7 all reset, meaning no lights are on. When I0.1f (i.e., I0.1) is pressed, the counter starts counting again, and the lights turn on one by one starting from Q0.0.

5. Comparison Instruction

Record the goods entering and exiting the warehouse. The warehouse can hold a maximum of 6000 boxes. If there are more than 1000 boxes, light L1 turns on; if there are more than 5000 boxes, light L2 turns on.

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Program

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The program is downloaded to the S7-200 PLC for debugging. Before downloading, we first reduce the numbers in the program so that we can better and faster observe the experimental results. We set the light L1 to turn on when the count is 5. We set the light L2 to turn on when the count is 10. This way, we can see the experimental results more quickly.

When I0.0f on the online control panel is pressed, i0.0 is activated, indicating that goods are entering. After clicking I0.0f five times, the counter’s value is 5 (indicating that there are 1000 boxes in the warehouse), so light L1 turns on, meaning Q0.0 has output. When we continue to click I0.0f ten times, the counter’s value becomes 10 (indicating that there are 5000 boxes in the warehouse), at which point light L2 also turns on, meaning Q0.1 has output. When we continue to click I0.0f, the counter’s value continues to increase. When I0.1f is pressed, the counter starts to decrease. Each click decreases the counter by one. When the counter’s value is less than 10, indicating that there are fewer than 5000 boxes in the warehouse, light L2 turns off (i.e., Q0.1 has no output). When we continue to click I0.1f, the counter’s value continues to decrease. When it drops below 5, indicating that there are fewer than 1000 boxes in the warehouse, light L1 turns off (i.e., Q0.0 has no output). When I0.2f is pressed, the counter resets to zero, and both L1 and L2 turn off (i.e., Q0.0 and Q0.1 have no output).

6. Eight Color Light Shift Control

Using I/O wires to control the eight color lights connected to Q0.0 to Q0.7 to shift in a loop, using T37 to time, shifting every 0.5 seconds. During the first scan, initial values are set for Q0.0 to Q0.7, allowing Q0.0 and Q0.2 to output first. I0.1 is used to control the direction of the color light shift.

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Programming

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The program is downloaded to the Siemens S7-200 PLC for debugging. Once powered on, Q0.0 and Q0.2 output, causing them to light up. When the I0.0f (indicating I0.0 input) switch is pressed, timer T37 starts timing, shifting the color lights to the right every 0.5 seconds. When I0.1f (indicating I0.1 input) is pressed, the color lights shift to the left in the same manner.

7. Jump Instruction

Using jump instructions to control two lights L1 and L2, connected to Q0.0 and Q0.1, with switch I0.0 controlling the two lights’ control switches I0.1 and I0.2. In manual mode, the two lights are controlled separately using their respective control switches. In automatic mode, the two lights alternate every second.

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Programming

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

The written program is downloaded to the S7-200 PLC for debugging. When I0.0 is OFF, the PLC runs the manual program. Pressing the online control panel’s set buttons I0.1f and I0.2f (indicating I0.1 and I0.2 are closed) turns on lights L1 and L2, with outputs Q0.0 and Q0.1. When we press the online control panel’s I0.0f, 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 run the manual program.

8. Sequential Start Control of Blower and Inducer

9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

I/O Allocation Table

9 PLC Programming Cases You Can Understand

Ladder Diagram Programming

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

▲ Program Monitoring Diagram when PLC is Powered On, Blue Indicates Activation

Program Debugging and Result Analysis

The characteristic of SM0.1 is that it is activated during the first scan cycle and not activated afterwards. When I0.0f on the online control panel is pressed, i0.0 is activated, causing Q0.0 to output (i.e., the indicator light Q0.0 turns on), starting the inducer, while timer T37 is activated and starts timing. When the timer counts to 50 (i.e., the indicator light Q0.1 turns on), the blower starts. At this point, both fans are running. When I0.1f on the online control panel is pressed (i.e., I0.1 is activated), the blower stops running (i.e., the indicator light Q0.1 turns off), and timer T38 is activated and starts timing. After 5 seconds, the inducer stops running (i.e., the indicator light Q0.0 turns off).

9. Liquid Mixing

Using S7-200 to achieve 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 liquid valve B opens, allowing liquid B to flow into the mixer. When the liquid level reaches the upper limit, valve B closes, and the motor starts mixing. After one minute of mixing, 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 is emptied, and valve C closes. Valve A opens again to inject liquid A. This cycle continues. If the stop button is pressed, the system must wait for one complete cycle to finish before stopping.

9 PLC Programming Cases You Can Understand

I/O Allocation Table

9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

Ladder Diagram Programming

9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

PLC Wiring Diagram

9 PLC Programming Cases You Can Understand

Program Debugging and Result Analysis

When I0.03f (i.e., I0.3 is closed) is pressed, valve A opens (i.e., Q0.0 is on). When I0.0f (i.e., I0.0 middle limit is closed) is pressed, valve A closes, and valve B opens (i.e., Q0.0 is off, Q0.1 is on). When I0.1f (i.e., upper limit I0.1 is closed) is pressed, valve B closes, and the motor starts mixing (i.e., Q0.1 is off, Q0.2 is on). At the same time, timer T37 starts timing for one minute. After one minute, the mixer stops mixing, valve C opens (i.e., Q0.2 is off, Q0.3 is on). When the liquid level reaches the lower limit, valve C continues to open (i.e., Q0.3 is on), and timer T38 starts timing. After 5 seconds, valve C closes, and valve A opens (i.e., Q0.3 is off, Q0.0 is on), entering the next cycle. When I0.4f (i.e., stop I0.4 is closed) is pressed, the system does not stop immediately but waits until one cycle is completed before stopping.

Source: Internet

Previous Recommendations9 PLC Programming Cases You Can Understand9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can Understand

9 PLC Programming Cases You Can UnderstandIf you like, click here9 PLC Programming Cases You Can UnderstandFree PLC and Electrical Courses, click to read the original text

Leave a Comment