带有复位配置文件的简单计数器示例
概述
这这种简单计数器的操作步骤如下:
- 通用输入 1 (UI1) 时,DXM150-B2R1 上的本地寄存器 1(通过 UI1 输入的 Cntr 1)通电。
- 本地寄存器 4(Cntr 1 Low Cnt)递增 1。
- 本地寄存器 4(Cntr 1 Low Cnt)达到 65535 后,在下一次输入 Cntr 1 时,该值将复位为 0。
- 本地寄存器 5(Cntr 1 High Cnt)递增 1。
- 当 DXM150-Bx 上的 UI2 通电时,本地寄存器 Cntr 1 High Cnt 和 Cntr 1 Low Cnt 的值都将复位为 0。
如果使用其他器件复位本地寄存器 3(Cntr1 High Cnt)或 4(Cntr1 Low Cnt)的计数值,则应在从属 ID 199 上相应的本地寄存器 5(Cntr1 High Cnt 复位操作规则)或 6(Cntr1 Low Cnt 复位操作规则)中写入 0。
所有本地寄存器均可在显示屏上看到,以便排除故障和确认输入是否处于激活状态。
要配置这种简单计数器:
- 将 DXM150-Bx 的 UI1 设置为计数器寄存器 4908 = 1(使用 DXM Configuration Tool 软件的寄存器视图或 DXM150-B2R1 的 LCD)。寄存器 4908 在输入信号的上升沿启用计数功能。
- 使用寄存器 4910 和 4911 监控计数值。
DXM150-Bx 无线控制器上的通用输入(UI)从从属 ID 200(I/O 板)上的寄存器 3 开始。
演示的功能包括:
- 将本地寄存器定义为:
计数器输入和计数器复位输入
计数器数值
- 创建读写规则,以便:
输入到本地寄存器
复位计数器值 n DXM150 I/O 基板
- 通过复位输入或写入计数器值复位本地寄存器,执行将计数器值复位为 0 的操作规则
This simple counter functions by following these steps:
- When Universal Input 1 (UI1), Local Register 1 (Cntr 1 Input via UI1) on the DXM150-B2R1 energizes.
- Local Register 4 (Cntr 1 Low Cnt) increments by a count of 1.
- After Local Register 4 (Cntr 1 Low Cnt) reaches 65535, on the next Cntr 1 input, the value resets to 0.
- Local Register 5 (Cntr 1 High Cnt) increments by 1.
- When UI2 on the DXM150-Bx is energized, the values of both Local Registers Cntr 1 High Cnt and Cntr 1 Low Cnt are reset to 0.
If you are resetting the count values of either Local Registers 3 (Cntr1 High Cnt) or 4 (Cntr 1 Low Cnt) using another device, write a 0 to the appropriate Local Register 5 (Cntr 1 H Cnt Reset Action Rule) or 6 (Cntr 1 L Cnt Reset Action Rule) on Slave ID 199.
All local registers are visible on the display to allow for troubleshooting and acknowledgement of inputs being active.
To configure this simple counter:
- Set UI1 on the DXM150-Bx to be counter registers 4908 = 1 (use either the Register view of the DXM Configuration Tool software or the DXM150-B2R1's LCD). Register 4908 enables the counting function on the rising edge of the input signal.
- Monitor the count value using registers 4910 and 4911.
The Universal Inputs (UI) on the DXM150-Bx Wireless Controller start at Register 3 on Slave ID 200 (I/O Board).
The demonstrated functions include:
- Defining local registers to be:
◦ Counter inputs and counter reset inputs
◦ Counter values
- Creating Read and Write Rules to:
◦ Input to Local Registers
◦ Reset the counter value n the DXM150 I/O Base Board
- Implementing Action Rules to reset the counter value to 0 based on either resetting the input or writing to the counter value reset Local Registers