Predefined Calculation Formulas in the Formula Library

You can use predefined formulas for creating calculated signals. To use a predefined formula, select it from the list of custom formulas in the Define Calculated Signals dialog box.

The following formulas are available:

Name

Function

Use case

Average

Total of all measure values divided by the number of values

Calculating the average

BinaryAND

The input signal will be calculated with the mathematical function AND against a user defined bitmask. Binary means in this case that for e.g. a UINT8 signal each bit 0..7 will be calculated separately.

Masking individual bits from a bit field

BinaryOR

The input signal will be calculated with the mathematical function OR against a user defined bitmask. Binary means in this case that for e.g. a UINT8 signal each bit 0..7 will be calculated separately.

Setting individual bits in a bit field

BinaryXOR

The input signal will be calculated with the mathematical function XOR against a user defined bitmask. Binary means in this case that for e.g. a UINT8 signal each bit 0..7 will be calculated separately.

Toggling individual bits in a bit field

Const

Creates a signal with a constant value.

Creating a signal with a constant value for using it in further calculations

CountTimeLevel

Note

Only in MDA

Total time in which a signal had a defined value

CountTimeLevel-

Tolerance

Note

Only in MDA

Total time in which a signal was in a defined value range

Debounce

Changes of the input signal are only forwarded to the output after a configurable delay.

Suppressing spikes on a signal

Delta

Difference between the current signal value and a previous value: inputk- input(k-count)

Showing the changes in a period of samples

DeltaT

Calculates the time difference between two measure points

Gradient

Gradient of a given period from start of measurement to end of measurement of a given signal:

inputk- input(k-count) /timek- time(k-count)

Showing the gradient of a period of samples

Integral

Integral of a given signal

LevelReachedCount

Note

Only in MDA

Frequency indicating how often a signal has a defined value

Lookup<dim>D_<cal>

Note

These are generated formulas that are derived from actual calibration data. A more detailed description of the usage of these formulas can be found in the manual "Custom Calculated Signals" (CalculatedSignals_Manual_EN.pdf), which is installed together with the software.

Looks up the inputs in the <dim>-dimensional calibration table <cal> and calculates the interpolated result.

Calculating the output of a curve or map

LowPassFilter

Filters the input signal according to the time constant.

Function:


y(n) = y(n-1) + ( x(n) - y(n-1)) *
(t(n)-t(n-1))/T

With:

y = output

x = input

T = filter time constant

t = measure time

If the time constant is smaller than the acquisition rate, this can cause overshooting!

Parameters:

time = measure time

input = signal to be filtered

time constant in s

Maximum

Maximum over all samples of the input signal from the start to the current position

MaxOf2Inputs

Sample-wise maximum of two signals

MaxReset

The maximum value can be reset via the rising edge of a bit.

Resetting the maximum value

Minimum

Minimum over all samples of the input signal from the start to the current position

MinOf2Inputs

Sample-wise minimum of two signals

MinReset

The minimum value can be reset via the rising edge of a bit.

Resetting the minimum value

Phaseshift

Returns a previous value: input(k-count), where inputk is the current value.

Example:
The ECU calculates a = b + c, whereat b was measured in the previous period

Pulse11

Returns an evaluation of time for a condition

Example: Bit is True for more than x seconds

RollingAverage

Calculates an average of a period of samples <count>

Example:
Noise filtering

RSFlipFlop

Returns a Boolean signal, which is True when the Set signal is True, and changes to False when the Reset signal becomes True.

SampleCounter

Signal counts the input signal samples and increments with each sample

Knock signals

SumTotal

Adds all values of a signal: a = a + measured value(t)

TableMap1D

Note

This formula is obsolete; the generic formula Lookup<dim>D_<cal> can be used instead.

Predefined mapping of one 1D map to another one.

The <extrapolation flag> determines how values will be extrapolated ( = 1: linear, 0: constant) .

TableMap2D

Note

This formula is obsolete; the generic formula Lookup<dim>D_<cal> can be used instead.

Predefined mapping of one 2D map to another one.

The <extrapolation flag> determines how values will be extrapolated ( = 1: linear, 0: constant) .

Threshold1

The output value will be determined by the following sequence of conditions:


if <const1> < <input1> <= <const2>
,
then <input2>
else <const3>

where:
const1 = lower threshold
const2 = upper threshold
input1 = input signal 1
input2 = input signal 2
const3 = constant

Calculating a threshold

Threshold2

The output value will be determined by the following sequence of conditions:


if <const1> > <input1>
then <const1>
else if <const2> < <input1>
then <const2>
else <input2>

where:
const1 = lower threshold
const2 = upper threshold
input1 = input signal 1
input2 = input signal 2

Calculating a threshold

Threshold3

The output value will be determined by the following sequence of conditions:


if <const1> <= <input1> <= <const2>
then <input2>
else <input3>



where:
const1 = lower threshold
const2 = upper threshold
input1 = input signal 1
input2 = input signal 2
input3 = input signal 3

Calculating a threshold

Threshold4

The output value will be determined by the following sequence of conditions:


if <const1> <= <input1> <= <const2>
then <input2>
else last value between <const1> and <const2>

where:
const1 = lower threshold
const2 = upper threshold
input1 = input signal 1
input2 = input signal 2

Calculating a threshold

TriggerTrue1

Generates an impulse at each rising edge of the assigned bit signal

WeightedCounter

Counts all values between defined bound <const1> and <const2>, and weights this number with <factor>.

Counting Peaks or repetitions

See also

Defining a Calculated Signal (Predefined Calculation Formula)