e.g. Count('Expression','Level','Hysteresis','EdgeType','Reset=0')

The function counts the crossings of 'Expression' through 'Level'.

The 'Hysteresis' parameter can be used to define a tolerance band which is above and below 'Level' by equal amounts. Only complete crossings through the tolerance band are counted.

The 'EdgeType' parameter determines which kind of edges are counted.

The 'Reset' parameter is used to reset the counter value to 0. 'Reset' can also be formulated as an expression.

Arguments

Give at least the following arguments.

Function

Count

Input (expression)

Signal or expression for which the crossings are to be counted

Level

Specification of the level value

Hysteresis

Specification of a hysteresis band

Edge type

Indication of whether rising, falling, or rising and falling edges should be counted

'EdgeType' < 0

Only falling edges (leaving hysteresis band in negative direction)

'EdgeType' > 0

only rising edges (leaving hysteresis band in positive direction)

'EdgeType' = 0

Falling and rising edges

Reset

Optional digital parameter that can be used to reset the counter. ‘Reset’ can also be an expression itself.

'Reset' > 0

Counter is reset

'Reset' = 0

Counter value is retained / continues to count (default)