5. CX7000多功能IO使用

5.3. 多功能IO的增量编码器模式

 

通过扫描IO后进行各种模式配置,默认是8数字量输入4数字量输出。

双击CX7028,选择Slots,选择下面窗口的Slot,选中InOut[1..2],可以看到右侧能够配置的Module进行配置,可以选择编码器ENC还是计数器CNT或者普通DIO。

此处选中右侧编码器比如ENC,点击中间图标后,完成编码器配置

配置前后对比:

输入和输出接线如下图:

可以看到Input1Input2接编码器连接A\B(单端输入的24V信号类型)。可以实现编码器计数器向上计数值到设置限制值后清零重新计数,向下计数值到0时将计数值设置成限制值。设置CoE-Online如下图, 8000:09 Enable reload设置True, 8000:12 Counter reload value设置成限制值。

Input3可以锁存计数值,需要Enable Latch extern on positive edge上升沿启用功能后,Input3输入时当前计数值写入Latch ValueLatch extern valid1,如果要继续锁存值,Enable Latch extern on positive edge需要再次触发上升沿。

Output1可以设置“Switch on threshold value”和“Switch off threshold value”这两个阈值来控制输出打开或关断,无需PLC处理,此功能需要设置Enable Output functions1生效(如下图)。Output2通过PLC来控制输出与计数值无关。

2023.11.24 俞文升 供稿

 

也就是说,当编码器值增大到所设置的值后,立即会将Output1置为1(大于等于switch on threshold value)或置为0(大于等于switch off threshold value);但若是数值减小到所涉阈值后,情况会相反,会立即将Output1置为0(小于switch on threshold value)或置为1(小于switch off threshold value)。

举例说明:

switch on threshold value=100,switch off threshold value=150,当数值增加到100时,Output1会变为true;增到到150时,Output1会变为false;数值减小时,小于150,Output1会变为true,小于100,Output1会变为false。

switch on threshold value=150,switch off threshold value=100,当数值增加到100时,Output1会变为false;增到到150时,Output1会变为true;数值减小时,小于150,Output1会变为false,小于100,Output1会变为true。

2024.5.22 朱元 更新