马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
<p><span style=";font-size:17px;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)">32bit </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)">/ </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)">-2,147,483,648 </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)">+2,147,483,647(10 </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)">D </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)"> M8200~M8234 </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)">/ </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)">C </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)"> M8 </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)">1</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">,则为减计数,不驱动时清零,则为增计数。 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">X11 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">X12 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">1 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">2 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">3 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">4 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">5 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">C200 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">Y1 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">X10 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">4 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">3 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">1 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">2 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">0 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">-1 -2 -3 -4 -5 -6 -7 -8 -9 -8 -7 -6 -5 -4 -3 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">0 </span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">0 </span><span style=";font-size:10px;font-family:黑体;color:rgb(0,0,0)">若</span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">Y1</span><span style=";font-size:10px;font-family:黑体;color:rgb(0,0,0)">为</span><span style=";font-size:10px;font-family:Arial;color:rgb(0,0,0)">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)"> 2,147,483,647 </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)">-2,147,483,648 </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)">-2,147,483,648 </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)">2,147,483,647</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)">X11 </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: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:宋体;color:rgb(35,31,32)">使用供停电保持用的计数器时,计数器的当前值、输出触点动作与复位状态停电保持。 </span><span style=";font-size:13px;font-family:Arial;color:rgb(35,31,32)">32bit </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)">32bit </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)">32bit </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)">16 </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)">DMOV </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: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)">bit15</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:Arial;color:rgb(35,31,32)">32767 </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)">32bit </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)">bit31</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)">-2,147,483,648 </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)">2,147,483,647</span><span style=";font-size:13px;font-family:宋体;color:rgb(35,31,32)">;</span></p> |