Functions

23.08.2021

FPScript offers you a host of built-in functions. You use a function by writing the name, followed by a list of arguments, which is to be specified in parentheses, into the formula. The following example integrates a data set:

Integral(DataSet)

If you have to specify several arguments, these are comma-separated:

Expand(DataSet, 2)

Even for functions that do not need an argument, the argument list parentheses must be included:

CurrentDate()

Some functions have optional arguments. In most cases, the argument list is created in such a way that the optional arguments are at the end of the argument list and can be omitted:

Mean(Signal), for instance, is the equivalent of Mean(Signal, MEAN_ARITHMETIC + PROCESS_ROWS).

For some functions, however, an optional argument can be omitted in the middle of the argument list:

Noise(1, , 0), for instance, is the equivalent of Noise(1, NOISE_NORMAL, 0).

Functions account for the units of their arguments and also provide quantities as the result:

LevelCrossings(Height, 25 cm) also returns the correct result, for instance, if Height is in the unit m and not, like the threshold value, in the unit cm.

Note:   Only a small selection of functions is available in FlexPro View.

Share article or send as email:

You might be interested in these articles