Counter

This externally activated block counts up or down depending on the choice of the block parameter, Rule.

    Counter

Library

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

Counter_0

NameLabelDescriptionData TypeValid Values

minim

Minimum

Matrix

step

Step

Scalar

maxim

Maximum

Matrix

Initv

Initial output

Matrix

rule

Rule

Counter counts up or counts down.

String

'Increment'
'Decrement'

typ

Output datatype

Specifies the output datatype. Complex datatype is not supported.

String

'double'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'

Ports

NameTypeDescriptionIO TypeNumber

Port 1

activation

input

1

Port 2

explicit

output

1

Advanced Properties

NameValueDescription

always active

standard mode activation

direct-feedthrough

no

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

yes

Diagram

Counter