Run calculation

This function "run calculation" enables creating an expression by using arithmetic and logic operators. The result is assigned to a variable for further use. User permission can be set to prevent the function from being used by unauthorized users.

Figure 1. Overview - Run calculation

Structure

The following paragraphs list all fields and options of the function "run calculation" and explain how to use them.

The system does not check whether compatible data types are used. It is the user’s responsibility to check type compatibility manually. Using the Define Variable function, the data types of the variables must be correctly specified for a proper calculation.

Variables

This variable list contains all available variables, which can be used for calculation.

$-parameter

The dollar-parameter list contains all already defined dollar-parameter, which can be used for calculation.

Expression

Create an expression in the expression field by using arithmetic and logic operators. The arithmetic/logic operations are executed and the result is stored in the target variable.

Target variable

This list contains all available target variables, to which the result of a calculation will be assigned. The defined variables of dpConnects are displayed with their description and the variable name (in brackets) in the dropdown menu.

The data type of the target variable must be either the same as the data type of the calculation's result (int => int), or the data type of the target variable must be convertible into the data type of the calculation result (e.g. float => string, int => string, int => anytype, etc.).

Needed permission

The user permission setting defines which user permissions a user needs to have to be able to execute the calculation. The drop-down list contains all user permission levels available in WinCC OA.

Help

For more information about the function "run calculation" please refer to the WinCC OA 3.11 online help by clicking on the push button "Help".

Apply

Click on the push button "Apply", then an expression is created and will be assigned to the target variable. This setting is then applied to the current function.

Cancel

Click on the push button "Cancel" and calculation is rejected. A new function can be then selected.

Figure 2. A new calculation is added successfully