Formula

The Evaluation > Formula... command opens a dialog box for entering a mathematical formula for the active curve.

Formula
Enter a mathematical formula. Open a menu for entering the curve names by pressing the >> button.

New Name
Enter the name of the new curve. As a default, the name of the active curve is already in this field.

New Unit
Enter the unit for the new curve. As a default, the unit of the active curve is already in this field.

Insert New Curve
Select this checkbox if a new curve is to be inserted. In this case a copy of the active curve is created, to which the formula, name and unit need to be assigned. The active curve remains unchanged.
If you do not select this check box, the formula is applied to the active curve.

Use the Scaling > Optimize Graph command to optimally scale the new curve.

 
Tip

You can also change the name and unit of the new curve at any time later.
Name and entity

Please note that the original values of the curve are not stored. If the formula is used more than once, the formula will applied to the current, i.e. changed, value each time.

Gating curves

The formula can contain the name of the current curve or any other curve names in the current diagram as parameters. Curve names must be in brackets, e.g.:

[V noml/X]

Please keep in mind that the curve names must be unique.
Use the >> button to correctly enter curve names.
Please note that when recording measured values, curves that are referenced in the formulas of other curves may not be hidden or saved.

Formula

The syntax of the programming language 'C' with the usual precedence rules (multiplication/division before addition/subtraction etc.) apply to the formulas. Only standard parentheses "( )" are permitted for parenthetical expressions. The capitalization case of the keywords is unimportant.

If a formula begins with one of the four basic arithmetic operations or with an exponent sign, the name of the current curve is implicitly placed at the beginning of the calculation.
e.g.

* 1000

corresponds to

 "[<current curve>] * 1000

In ranges where the curve has invalid values for the entered formula (such as division by zero, root of a negative number, etc.), the original value is kept. The curve is then colored gray in such ranges.

Valid operations:

Operation

Keyword / operator

Basic mathematical operations

+ - * /

Boolean operators

<,<=,>,>=,==,!=,!,&&,||

Bitwise AND link (bitmask, useful for PLC operands) The bitmask must be specified as a decimal integer number.

&

Modulo (remainder of division)

%

Power

^

Parentheses

( )

Constants

Fixed decimal point and floating-point numbers with a period as decimal sign and exponent "e", e.g.: 1.204e2

Variables

Curve name in square brackets "[<name>]"

Trigonometric functions (radians)

sin, cos, tan, asin, acos, atan, atan2 sinh, cosh, tanh arsinh, arcosh, artanh

Trigonometric functions (degrees)

sind, cosd, tand, asind, acosd, atand, atan2d sinhd, coshd, tanhd arsinhd, arcoshd, artanhd

Conversion from radians to degrees

deg

Conversion from degrees to radians

rad

Logarithmic functions

log, ln, exp

Square

sqr

Square root

sqrt

Absolute value

abs

Value as a whole number (integer)

int

Algebraic sign function -1 for x < 0 0 for x = 0 1 for x > 0

sign

Heaviside step function 1 for x > 0 0 for x <= 0

heaviside, h

Circle constant pi

pi

Example:

sqrt( [V noml/X]^2 + [V noml/Y]^2 )

Special values

You can use certain characteristic values of curves as variables in the formula. These values are calculated over the entire curve, or for the range between the two vertical auxiliary cursors if both are shown. Please note that these variables are not available during recording! For this reason, an error message appears when recording starts that the formula contains an unknown variable.

The following variables can be used in the formula:

Value

Variable

Minimum value

min

Maximum value

max

Peak-to-peak

peak

Arithmetic mean (average)

av

Quadratic mean (root mean square)

rms

Frequency

freq

Delta-Y Difference between the values at auxiliary cursor 1 and 2

dy

Delta-T Time difference between auxiliary cursors 1 and 2 in ms dt returns an absolute value, dts with algebraic sign

dt, dts

First value

first

Last value

last

Value at vertical auxiliary cursor 1

v1

Value at vertical auxiliary cursor 2

v2

You can also use the specific values of another curve in a formula. Append the name of the desired curve in square brackets to the variable.

Example:

av

Mean of the current curve

av[<name>] 

Mean of the curve <name>

These values can also be shown in a separate table.
Special values