Skip to content

Counter ​

Integer counter that increments on a configurable trigger (rising edge / falling edge / level). Optional reset port. Useful for event counting and frequency division. Counting past 2147483647 wraps to -2147483648.

Category: Discrete

Ports ​

PortKindSignalNotes
clockControl inputIntegerShown when Trigger is External clock
outControl outputInteger

Parameters ​

ParameterTypeDefaultUnitsDescriptionID
n₀Integer0—Initial count value (the count starts here at t=0).initial_value
TriggerChoice: Every time step / External clock / Internal clockEvery time step—What causes the count to increment.trigger
fNumber1—Internal-clock frequency. The count increments every 1/f seconds.frequency

Used in samples ​