Max('Expression',' Reset=0')

Arguments

'Expression'

Signal, for which the maximum value should be determined

'Reset’

Optional digital parameter that can be used to reset the maximum, e.g., in order to ignore the leveling-off processes of the measuring signal during the start-up phase. ‘Reset’ can be an expression as well.

'Reset' = TRUE

Stop calculation and set result to the instantaneous "Expression" value

'Reset' = 0

Perform calculation; most recently detected maximum is displayed. (Default)

Description

This function returns the maximum value of 'Expression' as its result. It is displayed as a constant value (horizontal line) in the signal strip. Each value is compared to the previous one. If the new value is higher than the previous one, the higher value will be incorporated into the curve. If the new value is equal or lower than the previous one, the previous value will be included. With the digital 'Reset' signal, the maximum value calculation can be stopped and the result can be reset to the current value of the input signal. Without the reset signal there is no way to reset the display unless the measurement is stopped and restarted. 'Reset' can also be formulated as an expression.

Examples:

Max([0:0])

No reset takes place.

Max([0:0],If(Mod(T(),20)=0,TRUE(),FALSE()))

The maximum value is reset every 20 seconds.

Max([0:0],[3.1])

e.g. with [3.1] = If([0:0]<10, 1, 0)

The maximum value is reset as soon as the expression [3.1] returns TRUE, i.e., if the expression [0:0] falls below the limit value of 10.

Example

The maximum should be determined for a signal. The start phase should be ignored in the calculation.

Task description

In order to remove fluctuations during the start phase, the maximum value is reset using the 'reset' function. This can be done using the TriggerConstant function, which waits for the leveling off of the signal. The setting of the 'reset' parameter is done via the edge detection ('OneShot') of the trigger.

Solution