Counter
This externally activated block counts up or down depending on the choice of the block parameter, Rule.
Library
Activate/SignalGenerators
Description
The Counter block implements a counter which is either increasing (from minimum value to maximum value) or decreasing (from upper maximum to minimum value). The counter initial value is a block parameter and increments (or decrements) are specified by the Step parameter.
The block is externally activated: an activation port is placed on the block to connect to an event generator such as an EventClock block.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
minim | Minimum | Minimum value of the counter. Default: 0. | Matrix | |
step | Step | Step of the counter. Default: 1. | Scalar | |
maxim | Maximum | Maximum value of the counter. Default: 4. | Matrix | |
Initv | Initial output | Initial output of the counter. Default: 0. | Matrix | |
rule | Rule | Counter counts up or counts down. | String | 'Increment' |
typ | Output datatype | Specifies the output datatype. Complex datatype is not supported. | String | 'double' |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | activation | input | 1 | |
Port 2 | explicit | output | 1 |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | standard mode activation | |
direct-feedthrough | no | |
zero-crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | yes |