Average

Symbol:

Description:

This function block calculates the average of a specified number of input values.

Based on the formula

the following calculation has been implemented:

The function block supports three types of averages:

Type 1 simple

The input signals are added up until the number of values is reached. After adding the last value, the average is calculated. The result is written to the Average-output. Then the summing of the input values starts again. The previous average is shown at the output until the new result is calculated. The number of values that was specified in the parameter dialog is available on the ValNbr-output.

Type 2 simple triggered

At this type the function block gets the additional Trigger-input. As long as a HIGH-signal is set to this input, the incoming signals are summed up and the counter for the number of values is incremented. After that, in the first cycle with a LOW-signal on the Trigger-input, the average is calculated and output. The number of values is written to ValNbr. The previous values for the average and the number of values remain on the outputs until the new results are calculated.

Type 3 moving

First, after starting the application, the incoming signals are summed up, until the entered number of values is reached. When the last signal is added the average is calculated and written to the Average-output. After that the average is calculated in every subsequent cycle using the stored previous signal values. The number of values that was specified in the parameter dialog is available on the ValNbr-output.

The type of the average can only be set in the Edit mode. The number of values can be entered in the Edit mode (then the entered value is used by the class and all new created instances) and in the Run mode (the value is only used by the current instance).

If the type of the average is changed in the class then the same type is assigned to all existing instances of the function block. If the new type is the simple or the moving average then the number of values that was specified in the class is written to all instances.

The dialog cannot be opened during the online observation.

Signals: | Name | I/O | Type(s) | Function
 | Signal | I | FLOAT | Input signal
 | Trigger | I | BIT | Activate the calculation
 | Average | O | FLOAT | Average
 | ValNbr | O | WORD | Number of values
Comment: | The calculation is performed with FLOAT values. Therefore precision problems may occur at wide dispersion of the input signal.


Envelope

Symbol:

Description:

This function block calculates the envelope around the input signal.

Parameter:

The type of envelope and its quality can be defined in the parameter dialog.

Signals: | Name | I/O | Type(s) | Function
 | Signal | I | FLOAT | Input signal
 | EVP | O | FLOAT | Envelope (positive)
 | EVN | O | FLOAT | Envelope (negative)
Comments: | The specification of the decay time determines the quality of the corresponding envelope.


Minimum / Maximum

Signal processing

Min / Max

Symbol:

Description:

This function block saves the minimum and maximum value of the input signal. If the input „Freeze" is high, the current minimum and maximum value is frozen. If the input "Reset" is high, the current value of „Input" is defined as the base for further minimum and maximum determination.

Signals: | Name | I/O | Type(s) | Function
 | Input | I | WORD, LONG, FLOAT | Input signal
 | Reset | I | BIT | Reset
 | Freeze | I | BIT | Freezing
 | Max | O | WORD, LONG, FLOAT | Maximum
 | Min | O | WORD, LONG, FLOAT | Minimum
Comments: | This function block is data type independent. The data type will be assigned by connecting the input signal. If there are already connections on the output with another data type, these connections will be deleted.


Variance

Symbol:

Description:

This function block calculates the variance of a specified number of values.

Based on the formula

the following calculation has been implemented:

The function block supports two types of variances:

Type 1 simple

Until the number of values is reached, the input signals are combined to intermediate results. When the last input signal is processed the variance is calculated and written to the Varianc-output. Then the process starts again. The previous variance is output until the new result is calculated. The number of values that was specified in the parameter dialog is available on the ValNbr-output.

Type 2 simple triggered

At this type the function block gets the additional Trigger-input. As long as a HI-signal is written on this input, the input signals are combined to intermediate results and the counter for the number of values is incremented. After that, in the first cycle with a LO-signal on the Trigger-input, the variance is calculated and output. The number of values is written to ValNbr. The previous values for the variance and the number of values remain on the outputs until the new results are calculated.

The type of the variance can only be set in the Edit mode. The number of values can be entered in the Edit mode (then the entered value is used by the class and all new created instances) and in the Run mode (the value is only used by the current instance).

If the type of the variance is changed in the class then the same type is assigned to all existing instances of the function block. If the new type is the simple variance then the number of values that was specified in the class is written to all instances.

The dialog cannot be opened during the online observation.

Signals: | Name | I/O | Type(s) | Function
 | Signal | I | FLOAT | Input signal
 | Trigger | I | BIT | Activate the calculation
 | Varianc | O | FLOAT | Variance
 | ValNbr | O | WORD | Number of values
Comment: | The calculation is performed with FLOAT values. Therefore precision problems may occur at wide dispersion of the input signal.