返回列表 发布新帖

PLC中断功能怎么用?最强攻略就在这儿!

577 0
发表于 2024-7-10 18:16:53 | 查看全部 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
<p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63); visibility: visible;">PLC程序中经常用到中断功能,中断相当于子程序,子程序相当于主程序,说起来 PLC里的中断平时根本没什么用。这么说,像告诉脉冲处理,不用中断,只用1MS的计时能实现其功能,但是却没有中断计时来的精确,毕竟不用中断,程序扫瞄受扫描周期束缚。</span><br/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63); visibility: visible;">但有些程序,必须要用到中断,典型的就是PID,检测读取周期必须精确。不管是以前自己编PID中断程序,还是现在集成的PID中断程序块,都使用到了精确的时间控制,立即处理信息的中断。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><em style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; color: rgb(76, 121, 255); visibility: visible;"><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; visibility: visible;">今天这篇文章,我们就来谈谈,PLC中断功能怎么用?</span></strong></span></em></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63); visibility: visible;">PLC这样理解中断功能,在理解中断时,首先要清楚PLC的运算周期或者说是扫描周期,有必要说下PLC顺控循环执行的流程,这是理解中断的前提,必须要掌握,分为三部分,输入处理、程序处理、输出处理。</span></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px 0em; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><img class="rich_pages wxw-img" src="https://mmbiz.qpic.cn/mmbiz_jpg/eha0pY0oUZd1uZlQGREpURWg6obDN7zrb0mxyOD2jicv8TTKbGibM9icFMdzs9SVWiaicJwyfKDz9UYE0NFnodjLPtw/640?wx_fmt=jpeg&tp=wxpic&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" style="margin: 0px; padding: 0px; outline: 0px; vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important; height: auto !important; visibility: visible !important; width: 657px !important;"/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p><section><section><section><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">0</strong><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">1</strong></section><section><section><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 16px; visibility: visible;"><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">输入处理</strong></span></section><section><img class="rich_pages wxw-img __bg_gif" src="https://mmbiz.qpic.cn/mmbiz_gif/JaFvPvvA2J0ABlIrLd9RvOcz2com6Vtb2dPX2AltaoXOfRF068N5S9hjw9km5DFOvCZYs4Ubiaggckv1XFEC4TA/640?wx_fmt=gif&tp=wxpic&wxfrom=5&wx_lazy=1" alt="图片" style="margin: 0px; padding: 0px; outline: 0px; box-sizing: border-box; vertical-align: inherit; display: block; overflow-wrap: break-word !important; height: auto !important; visibility: visible !important; width: 592px !important;"/></section></section></section></section></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63); visibility: visible;">可编程控制器在执行程序前,将可编程控制器的所有输入端子的ON/OFF状态读入输入映像区,程序执行过程中即使输入发生变化,输入映像区的内容也不会变化,在执行下一个循环的输入处理时读取该变化。&nbsp;</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p><section><section><section><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">0</strong><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">2</strong></section><section><section><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 16px; visibility: visible;"><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; visibility: visible;">程序处理</strong></span></section><section><img class="rich_pages wxw-img __bg_gif" src="https://mmbiz.qpic.cn/mmbiz_gif/JaFvPvvA2J0ABlIrLd9RvOcz2com6Vtb2dPX2AltaoXOfRF068N5S9hjw9km5DFOvCZYs4Ubiaggckv1XFEC4TA/640?wx_fmt=gif&tp=wxpic&wxfrom=5&wx_lazy=1" alt="图片" style="margin: 0px; padding: 0px; outline: 0px; box-sizing: border-box; vertical-align: inherit; display: block; overflow-wrap: break-word !important; height: auto !important; visibility: visible !important; width: 592px !important;"/></section></section></section></section></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; visibility: visible; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63); visibility: visible;">PLC根据程序内存中的指令内容,从输入映像区和其他软元件的映像区中读出各软元件的ON/OFF状态,然后从0步依次开始运算,并将每次得出的结果写入到映像区中。因此,各软元件的映像区随着程序的执行逐步改变其内容,此外,输出继电器的内部触点根据输出映像区的内容而执行动作。&nbsp;</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p><section><section><section><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">0</strong><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">3</strong></section><section><section><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 16px;"><strong style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important;">输出处理</strong></span></section><section><img class="rich_pages wxw-img __bg_gif" src="https://mmbiz.qpic.cn/mmbiz_gif/JaFvPvvA2J0ABlIrLd9RvOcz2com6Vtb2dPX2AltaoXOfRF068N5S9hjw9km5DFOvCZYs4Ubiaggckv1XFEC4TA/640?wx_fmt=gif&tp=wxpic&wxfrom=5&wx_lazy=1" alt="图片" style="margin: 0px; padding: 0px; outline: 0px; box-sizing: border-box; vertical-align: inherit; border-width: 1px; border-style: solid; border-color: rgb(238, 237, 235); display: block; overflow-wrap: break-word !important; height: auto !important; background-color: rgb(238, 237, 235) !important; background-size: 22px !important; background-position: center center !important; background-repeat: no-repeat !important; width: 592px !important; visibility: visible !important;"/></section></section></section></section></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63);">所有指令执行结束后,输出Y映像区中的,ON/OFF状态会传送至输出锁存内存,这个就作为可编程控制器的实际输出。&nbsp;</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63);">执行以一次动作所需要的时间就是运算周期也叫扫描时间,那么中断与扫描周期有什么联系呢,中断就是不按照从上到下顺序的完整执行,而是中断程序优先单独运行程序处理而且是立即输出不参与整个周期运算。</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63);">中断的作用是什么呢,我们知道PLC扫描周期是很短的,因此我们很难看出PLC顺控执行过程,这里我们不妨假设扫描周期为10s的时间,就是执行全部的程序需要10s的时间,有一个很简单的程序LD X0,OUT Y0,根据上图当X0为ON时,Y0不是马上就有输出的,而是等到10s后才输出,断开X0后,同样Y0也不是马上就关闭的,都需要得到扫描完后才有结果。那么这样在我们实际应用中PLC就没什么使用了设备就无法进行工作了,这时候就需要中断处理了,采用输入中断功能,立即执行输入。实际上PLC的运算时间是很短只有几毫秒,完全能够满足需要,但一些如高频脉冲输入、脉冲捕捉等时间在微秒级的肯定要受到周期运算的影响了。&nbsp;</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63);">因此如果在一个周期内要完成很多次ON/OFF状态处理时,必须使用中断功能了。在我们一般情况下很少用到中断,即使需要PLC的高速指令都带有中断功能无需自己专门编写中断子程序了,例如高速计数器采用中断的方式对从特定的输入继电器出来的高速脉冲进行处理,所以无论运算时间多少都可进行计数,计数的结果或是使用高速计数器专用的比较指令立即输出,或是对高速计数器的计数值用高速计数器中断方式执行特定的程序处理。&nbsp;</span></p><p style="margin-top: 0px; margin-bottom: 0px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><br/></p><p style="margin: 0px 10px; padding: 0px; outline: 0px; max-width: 100%; clear: both; min-height: 1em; font-size: 17px; letter-spacing: 0.544px; text-align: justify; text-wrap: wrap; color: rgb(34, 34, 34); font-family: -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif; background-color: rgb(255, 255, 255); vertical-align: inherit; box-sizing: border-box !important; overflow-wrap: break-word !important;"><span style="margin: 0px; padding: 0px; outline: 0px; max-width: 100%; box-sizing: border-box !important; overflow-wrap: break-word !important; font-size: 15px; color: rgb(63, 63, 63);">对高频脉冲进行计数不采用高速计数器进行计数,我们举例使用中断功能对高速输入进行计数,示例如下,从EI到FEND是主程序,从指针I101(输入X0的中断指针)开始到IRET是中断子程序,每当感应到X1的上升沿就执行子程序将数值立即传送到D10中,这样就避免了PLC运算周期的影响。&nbsp;</span></p><p><br/></p>

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright © 2001-2025 英威腾技术论坛 版权所有 All Rights Reserved. 粤ICP备07504406号
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表