Engee documentation

Counter Free-Running

Incremental counter with reset to zero after reaching the maximum value for the specified number of bits.

blockType: Counter Free-Running

Path in the library:

/Basic/Sources/Counter Free-Running

Description

The block Counter Free-Running counts until it reaches a maximum value equal to , where is the number of bits. Then the counter is reset to zero and starts increasing again.

Ports

Output

# OUT_1 — counter values
scalar

Details

Counter value as an unsigned integer with a bit size of 8, 16 or 32 bits.

Data types

UInt8, UInt16, UInt32, UInt64, UInt128.

Complex numbers support

No

Parameters

Main

# Sample time — interval between calculation steps
SampleTime (real number / vector of two real numbers)

Details

Specify the interval between calculation steps as a non-negative number. To inherit a calculation step, set this parameters to -1.

Default value

-1

Program usage name

tsamp

Tunable

No

Evaluatable

Yes

# Number of bits — number of bits
Real number

Details

Specify the number of bits as a real scalar. When you specify:

  • positive integer, for example 8, the block counts up to , that is, up to 255.

  • an unsigned integer expression, such as UInt8(8), the block counts up to , that is, up to 254.

Default value

16

Program usage name

NumBits

Tunable

No

Evaluatable

Yes

Additional options

C code generation: Yes