9 PLC programming program debugging and result analysis

Publisher:Chunjie2022Latest update time:2022-11-28 Source: elecfansKeywords:PLC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Reciprocating motion of the trolley

Use S7-200 to realize the automatic control of the trolley's reciprocating movement. The control process is to press the start button, and the trolley moves from the left to the right (right to the left). When it moves to the right (left) and touches the right (left) travel switch, the trolley automatically returns, and when it touches the travel switch on the other side, it returns again. This reciprocating movement continues until the stop button is pressed and the trolley stops moving.

214014c8-698c-11ed-8abf-dac502259ad0.png

▲Electrical wiring diagram

I/O Allocation Table

215485f2-698c-11ed-8abf-dac502259ad0.png

Ladder diagram program

21699ca8-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

217a4d8c-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

21896a42-698c-11ed-8abf-dac502259ad0.png

▲Control platform operation panel

When SB2, that is, i0.0, is pressed (mouse click i0.0f), Q0.0 is turned on, and the car moves to the right (indicator light Q0.0 is on). When the car runs and hits the right limit switch SQ2, that is, i0.4 (click i0.4f with the mouse to simulate SQ2 being pressed down), the car moves to the left (indicator light Q0.0 is off, and indicator light Q0.1 is on). When it runs to the left and hits the left limit switch SQ1, that is, i0.3 (mouse click i0.3f), the car moves to the right again (indicator light Q0.1 is off, and indicator light Q0.0 is on). The car moves back and forth like this until SB1, that is, i0.2, is pressed (mouse click i0.2f), and the car stops.

Attachment:

219cf6b6-698c-11ed-8abf-dac502259ad0.png

2. Flash Circuit

When the start button is pressed, the light is required to be on for one second and off for one second within two seconds, and repeat this process, with the light flashing.

I/O Allocation Table

21b1f9da-698c-11ed-8abf-dac502259ad0.png

Ladder diagram program

21c59d3c-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

21d4d1bc-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

Download the written program to Siemens s7-200PLC for debugging. Observe whether the running results are the same as the experimental requirements. Debug through the online control panel. When I0.0f on the online control panel is pressed (i.e. I0.0 is turned on), Q0.0 has output, and the load light connected to Q0.0 is on. At the same time, start timer T37 to start timing. After one second of timing, T37 is activated and its normally closed contact is disconnected, so Q0.0 has no output and the connected load light is off. When the light is off, start timer T38. After T38 counts for one second, the normally closed contact in series with timer T37 is disconnected, so T37 is reset and the normally closed contact of T37 is restored to normally closed. At this time, Q0.0 has output again, and the connected load light is on again. In this way, the load light connected to output Q0.0 keeps flashing at a frequency of one second on and one second off until I0.1f on the online control panel is pressed (i.e. I0.1 is turned on), and the flash circuit no longer continues to work. If you want to change the frequency of the light flashing, just change the time of the timer to achieve the change requirement.

3. Star-delta step-down starting

The Siemens S7-200 PLC is used to realize the star-delta connection step-down starting.

Circuit diagram and control diagram of star-delta step-down starting

21e83126-698c-11ed-8abf-dac502259ad0.png

The process framework diagram is as follows

21fd54c0-698c-11ed-8abf-dac502259ad0.png

I/O Allocation Table

2212a9c4-698c-11ed-8abf-dac502259ad0.png

Ladder diagram program

2226c328-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

223f3246-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

Download the written program to the PLC of Siemens S7-200 for debugging. After downloading, we open the online control panel for debugging to see if the running results meet the requirements. First, set i0.2f on the control panel to a button and press it, that is, i0.2 is turned on, indicating that the circuit breaker QF is closed. Press the start button i0.0f (SB2), that is, i0.0 is turned on. At this time, the motor starts in star shape, Q0.0 and Q0.1 have outputs. The experimental wiring diagram shows that the two lights L1 and L2 are both on and drive the time counter at the same time. When the timer counts to 10S, it switches to delta start. At this time, Q0.1 has no output, Q0.2 has output, then Q0.0 and Q0.2 have output, and the motor delta star runs. The lights L1 and L3 on the wiring panel are on. After pressing i0.1f on the online panel (i0.1 is turned on), the motor stops running. All output points have no output.

4. Color Light Control

Use the eight output terminals Q0.0 to Q0.7 of the PLC to control eight colored lights, so that one lights up every second and cycles. When I0.0 is turned on, all lights go out. When I0.1 is turned on, the cycle starts again from Q0.0.

I/O Allocation Table

224f60ee-698c-11ed-8abf-dac502259ad0.png

Ladder diagram program

226af4b2-698c-11ed-8abf-dac502259ad0.png

2280a7d0-698c-11ed-8abf-dac502259ad0.png

229485a2-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

22aa02c4-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

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

As soon as the PLC is powered on, sm0.0 remains connected. So t37 performs delay timing, and after the delay is up, t38 is started. After t38 is up, the normally closed contact of t38 is disconnected, so t37 is disconnected. The normally open contact of t37 returns to normally open, so t38 is also disconnected. At this time, the normally closed contact of t38 returns to normally closed, so t37 starts counting again, and counter C0 starts counting once. This counting is repeated. When the count is 1, Q0.0 is connected. When the counter counts to 2, Q0.1 is connected... and so on. When the counter counts to 8, Q0.7 is connected. When the counter counts to 9, counter C0 is cleared. When I0.0f (i.e. I0.0) on the online control panel is pressed, the counter and Q0.0~Q0.7 are all cleared, that is, no light is on. When I0.1f on the online control panel is pressed (i.e. I0.1 is turned on), the counter starts counting again, and the lights start lighting up one by one from Q0.0.

5. Comparison Instructions

Record the goods in and out of the warehouse. The warehouse can hold up to 6,000 cartons of goods. If there are more than 1,000 cartons, light L1 will be on, and if there are more than 5,000 cartons, light L2 will be on.

I/O Allocation Table

22c1c878-698c-11ed-8abf-dac502259ad0.png

Ladder diagram program

22d4c914-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

22eb2ec0-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

Download the program to the S7-200 PLC for debugging. Before downloading, we first reduce the numbers in the program so that we can see the experimental results better and faster in the experiment. We set the light of L1 to 5. We set the light of L2 to 10. In this way, we can see the experimental results faster.

When I0.0f on the online control panel is pressed, I0.0 is connected, indicating that there are goods entering. When we click I0.0f on the online control panel five times, the count value in the timer is 5 (that is, there are already 1000 boxes of goods in the warehouse), then the light L1 will be on, that is, Q0.0 has output. When I0.0f is clicked ten times, the count value of the counter is 10 (that is, there are 5000 items in the warehouse), and the light L2 is also on, that is, Q0.1 has output. When I0.0f on the online control panel is clicked, the count value in the counter continues to increase. When I0.1f is pressed on the online control panel, the counter starts to decrease. Click once, and the count value in the counter decreases once. When the value in the counter is less than 10, it means that there are less than 5000 boxes of goods in the warehouse, and the light L2 is off (that is, Q0.1 has no output). When I0.1f is clicked, the count value in the counter continues to decrease, and when it decreases to less than 5 times. Indicates that there are less than 1000 items in the warehouse, and the light L1 is off. Q0.0 has no output. When I0.2f on the online control panel is pressed, the counter is reset. L1 and L2 are not lit (that is, Q0. and Q0.1 have no output).

6. 8 color lights shift control

Use IO wires to control the cyclic shift of the eight colored lights connected to Q0.0 to Q0.7. Use t37 timing to shift one position every 0.5S. Set the initial value of Q0.0 to Q0.7 during the first scan, so that Q0.0 and Q0.2 have output first. Use I0.1 to control the direction of the colored lights' displacement.

I/O Allocation Table

2303d7fe-698c-11ed-8abf-dac502259ad0.png

Ladder diagram programming

2313cf42-698c-11ed-8abf-dac502259ad0.png

PLC Wiring Diagram

2323beb6-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

Download the program to the Siemens S7-200 PLC for debugging. Once the PLC is powered on, Q0.0 and Q0.2 will have outputs, and Q0.0 and Q0.2 will light up. When the I 0.0f (indicates that I0.0 has input) setting switch on the online panel is pressed, timer T37 starts timing, and the colored lights shift to the right based on Q0.0 and Q0.2 every 0.5 seconds. When I0.1f (indicates that I0.1 has input) on the online control panel is pressed to set it, the colored lights move to the left in the same way.

7. Jump Instructions

Use the jump instruction to control the two lamps L1 and L2, connect them to Q0.0 and Q0.1 respectively, switch position I0.0, and the control switch positions of the two lamps I0.1 and I0.2. When manually, use the control switches of the two lamps to control them respectively. When automatically, the two lamps light up alternately every one second.

I/O Allocation Table

233334fe-698c-11ed-8abf-dac502259ad0.png

Ladder Diagram Programming

23491a62-698c-11ed-8abf-dac502259ad0.png

Program debugging and result analysis

Download the written program to the PLC of s7-200 for debugging. When I0.0 is OF, the PLC runs the manual program. Pressing the set buttons I0.1f and I0.2f on the online control panel means (I 0.1 and I0.2 are closed) the lights L1 and L2 are on, and Q0.0 and Q0.1 have outputs. When we press I0.0f on the online control panel, I0.0 is ON at this time, and the program jumps to the automatic program operation. The two lights cycle every second. L1 lights up for one second and then L2 lights up. When I0.0f on the online control panel is pressed, I0.0 is OFF at this time, and the program jumps to the manual program operation.

[1] [2]
Keywords:PLC Reference address:9 PLC programming program debugging and result analysis

Previous article:What should I pay attention to when customizing R-type transformers?
Next article:Siemens S7-1500 MODBUS communication technology

Recommended ReadingLatest update time:2024-11-16 10:28

Process writing of common PLC automatic programs
The function of the PLC automatic sequence is to control the equipment to work according to the pre-designed process flow. There are also several ways to write the process of the PLC automatic program. Let's make a detailed explanation below. The first method: the reset method of the auxiliary relay. This method is
[Embedded]
Process writing of common PLC automatic programs
Explain the key points of learning Siemens PLC
Learning Siemens PLC is not as difficult as you think. It can be summarized in one sentence: for beginners, it is enough to roughly grasp the hardware composition, programming software, system instructions and program structure of PLC! Next, let us explain the key points of PLC learning one by one.
[Embedded]
Do you know the nine basic steps of PLC programming?
The scientific programming steps are actually very simple, but most engineers often think that they are simple and ignore many details. Ignoring details will inevitably lead to problems in the future. If you want to avoid problems in the future, you can only follow the rules well. There is no order without rules, an
[Embedded]
Siemens S7-200 SMART series PLC wiring summary
The load current of a relay is larger than that of a transistor, but the output frequency cannot be too fast due to the influence of the mechanical device, and there is also a limit on the mechanical life. The load current of a transistor is smaller than that of a relay, but the output frequency is fast and can be u
[Embedded]
Siemens S7-200 SMART series PLC wiring summary
How to use PLC to program the most advanced servo system in motion control?
The use of servo drives is generally the same as that of frequency converters. It should be noted that the selection of servo drives is not only based on power, but also on low inertia and high inertia. Low inertia types generally have low torque and high speed, which are suitable for some light load and frequent mo
[Embedded]
How to use PLC to program the most advanced servo system in motion control?
Reasonable selection and use of Siemens PLC power supply
A large part of the failure of PLC control system comes from the power supply. It is very important to choose and use the power supply properly. This article uses Siemens PLC as a reference to explain. The CPU module of the PLC contains a power board, an interface board and a main control board. It uses t
[Embedded]
Reasonable selection and use of Siemens PLC power supply
Design Concept and Format Specification of PLC Ladder Diagram Programming Language
PLC ladder diagram programming language is a programming language used to write automation applications. Its name comes from the shape of the ladder diagram, each ladder represents a logical function block. Ladder diagram programming language is a graphical programming language with the advantage of being easy to un
[Embedded]
Siemens commonly used PLC instruction table
Siemens commonly used PLC instruction table Calculates the time difference between the current time and the time provided by IN and stores the time difference in ouT. The maximum time interval for a double-word millisecond value is 2 to the power of 32, or 49.7 days. Depending on when the BGN_ITIMB instruction
[Embedded]
Siemens commonly used PLC instruction table
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号