Engee documentation

Counter Free-Running

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

counter free running

Description

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

Ports

Output

Port_1 - counter values
scalar

Counter value as an unsigned integer with 8, 16 or 32 bits.

Data types: UInt8, UInt16, UInt32, UInt64, UInt128.

Parameters

Sample time - interval between calculation steps
-1 (by default) | scalar

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

Usage in program code

Block parameter

tsamp

Values

scalar

By default

-1

Number of Bits - number of bits
16 (by default) | scalar.

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

  • positive integer, such as 8, the block counts up to , that is, 255.

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

Usage in program code

Block parameter

NumBits

Value

scalar

By default

16

Additional options

C code generation: Yes