# Calculate maximum, minimum and mean values of channel 1
# Berechne Maximum, Minimum und Mittelwert von Kanal 1

# constN= Number of values for max, min and mean acquisition
# Anzahl der Werte, ber die Maximum, Minimum und Mittelwert ermittelt werden
constN= 1000;

# init max, which is in x1
IF(CNT=0){x1= ch1};
# compare ch1 with previous max value
ELIF(ch1>x1L){x1= ch1};
ENDIF;
# compare min
IF(CNT=0){x2= ch1};
ELIF(ch1<x2L){x2= ch1};
ENDIF;

# make mean, which is in x3
x3= MEAN(ch1,constN);

#reset Max/Min acquisition. Comment the following line out,if intended to work over hole time while measuring is started
IF(CNT=constN){RESET(0)};