Counter

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

    Counter

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

Counter_0

NameLabelDescriptionData TypeValid 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'
'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