返回列表 发布新帖

16bit 计数器

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

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

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

×
<p><span style=";font-size:17px;font-family:黑体;color:rgb(35,31,32)">&nbsp;</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">一般用计数器和停电保持用状态的分配,可通过系统参数配置进行变更设定。 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">对于 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">16bit </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">计数器,其有效设定值为</span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)"> K1 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">~ </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">K32,767 (10 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">进制常数);设定值</span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)"> K0 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">和 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">K1 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">具有相同效果,即在 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">第一次计数开始时输出触点就动作。如下例: </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">X6 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">X5 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">1 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">2 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">3 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">4 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">5 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">6 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">7 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">8 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">9 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">C10 </span><span style=";font-size:13px;font-family:Arial;color:rgb(0,0,0)">Y1 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">计数输入 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">X5 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">每驱动 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">C10 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">线圈一次,计数器的当前值就增加,在执行第 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">9 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">次的线圈指令时,输出触点动作。 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">以后即使计数输入 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">X5 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">再动作,计数器的当前值不变。如果复位输入 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">X6 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">为 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">ON</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">,则执行 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">RST </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">指令,计数器 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">的当前值清为 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">0</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">,输出触点复位。 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">计数器的设定值,除用上述常数 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">K </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">设定外,还可由数据寄存器编号指定。如上例中,指定 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">D20</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">,如果 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">D20 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">的内容为 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">9</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">,则与设定 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">K9 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">是一样的。 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">在以 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">MOV </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">等指令将设定值以上的数据写入当前值寄存器时,则在下次输入时,输出线圈接通,当前值寄存 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">器变为设定值。 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">对于一般用计数器,如果切断可编程控制器的电源,则计数器的计数值被清除,而停电保持用的计数器则可 </span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">存储停电前 的计数值,因此计数器可接着上一次数值累计计数。</span></p>

回复

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

本版积分规则

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