PLC编程:从原理图到程序的4个经典实例详解

<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">本次拆解的案例包括:</span></strong></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">1、喷泉控制</span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">2、交通信号灯控制</span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">3、多级传送带控制</span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">4、车库自动门控制</span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">1. 喷泉控制</span></strong></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">(1)明确系统控制要求</span></strong></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">系统要求用两个按钮来控制A、B、C三组喷头工作(通过控制三组喷头的泵电动机来实现),三组喷头排列如下图所示。</span></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/d94251c7044a466ea639805eab54e395~tplv-tt-origin-web:gif.jpeg?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1744796819&x-signature=dk50tMfeKeB3%2Bmmvb7TigGjhyYE%3D" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;"><strong style="color: blue;"><span style="color: green;">系统控制要求具体如下:</span></strong></span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">当按下起动按钮后,A组喷头先喷5s后停止,然后B、C组喷头同时喷,5s后,B组喷头停止、C组喷头继续喷5s再停止,而后A、B组喷头喷7s,C组喷头在这7s的前2s内停止,后5s内喷水,接着A、B、C三组喷头同时停止3s,以后重复前述过程,按下停止按钮后,三组喷头同时停止喷水,下图为A、B、C三组喷头工作时序图。</span></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">(2)确定输入/输出设备,并为其分配合适的I/O端子</span></strong></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">喷泉控制需用到的输入/输出设备和对应的PLC端子见下表:</span></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">(3)绘制喷泉控制电路图</span></strong></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">控制电路图</span></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">(4)编写PLC控制程序</span></strong></p>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;">启动STEP 7-Micro/WIN编程软件,编写满足控制要求的梯形图程序,编写完成的梯形图如下所示。</span></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><span style="color: green;"><strong style="color: blue;"><span style="color: green;">下面对照控制电路来说明梯形图的工作原理:</span></strong></span></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px;"></div>
<p style="font-size: 18px; line-height: 40px; text-align: left; margin-bottom: 30px;"><strong style="color: blue;"><span style="color: green;">(2)停止控制</span></strong></p>
<div style="text-align: left; margin-bottom: 10px;"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="width: 100%; margin-bottom: 20px