User`s guide

Counter
5-105
16 bits specifies a counter with a range of 0 to 65535.
32 bits specifies a counter with a range of 0 to 2
32
-1.
User defined enables the supplementary Maximum count parameter,
which allows you to specify an arbitrary integer as the upper count limit. The
range of the counter is then 0 to the
Maximum count value.
Sample-Based Operation
The block operates in sample-based mode when the Clk input is a sample-based
scalar. Sample-based vectors and matrices are not accepted.
When the
Count direction parameter is set to Up, a sample-based trigger
event at the
Clk input causes the block to increment the counter by one. The
block continues incrementing the counter when triggered until the counter
value reaches the upper count limit (e.g., 255 for an 8-bit counter). At the next
Clk trigger event, the block resets the counter to 0, and resumes incrementing
the counter with the subsequent
Clk trigger event.
When the
Count direction parameter is set to Down, a sample-based trigger
event at the
Clk input causes the block to decrement the counter by one. The
block continues decrementing the counter when triggered until the counter
value reaches 0. At the next
Clk trigger event, the block resets the counter to
the upper count limit (e.g., 255 for an 8-bit counter), and resumes
decrementing the counter with the subsequent
Clk trigger event.
Between triggering events the block holds the output at its most recent value.
The block resets the counter to its initial state when the trigger event specified
in the
Count event menu is received at the optional Rst input. When trigger
events are received simultaneously at the
Clk and Rst ports, the block first
resets the counter, and then increments or decrements appropriately. (If you
do not need to reset the counter during the simulation, you can disable the
Rst
port by deselecting the
Reset input check box.)
The
Output pop-up menu provides three options for the output port
configuration of the block icon:
Count configures the block icon to show a Cnt port, which produces the
current value of the counter as a sample-based scalar with the same sample
period as the inputs.
Hit configures the block icon to show a Hit port. The Hit port produces zeros
while the value of the counter does not equal the integer
Hit value