Dynamic Functions
Formulas are defined when using the configuration feature with dynamic BOMs and checklists. Formulas to be used in different BOM and checklists can be separated by dynamic functions.
These formulas can be entered manually in the formula fields or created using the Formula Editor, accessed using Tell Me for general formula review or from dynamic master BOM or checklist formula lines by choosing the Functions action. Additionally, default functions can be entered directly in the Dyn. User Function page.
The various arithmetic functions and terminal symbols, functions, and constants are accessed from the Actions menu.
To see the result of the formula, choose the Calculate action or press F9 if the cursor is not in the Formula field. The result of the function calculation is provided as the return value to the formula field that opened the Formula Editor.
Note
2048 characters can be used to create a formula in the Formula Editor, which is also displayed as a count below the Formula field.
Variables in Dynamic Functions
Variables can be transferred as parameters to dynamic functions. To calculate with this parameter, placeholders like %1, %2 can be used. When using these dynamic functions in a formula, use a semi-colon (;) to separate the parameters.
For example, two functions are defined in the Dyn. User Function page:
Code | Formula |
---|---|
AREA | %1*%2 |
VOL | %1*%2*%3 |
In the formula field or Formula Editor, the calculations of "AREA(3;4)" and "VOL(2;3;4)" will result in "12" and "24", respectively.
Dyn. User Functions
Dynamic user functions allow you to create formulas that can be reused in formula fields and the Formula Editor. This is useful when you have a calculation (simple or complex) that is used many times in several formulas because you can select this formula instead of needing to know the right formula and enter it directly into the formula field.
For example, to calculate the area of a circle, you can create a Dyn. User Function "CIRCLEAREA" with formula "%1^2*PI" and then in the formula fields, replace the placeholder with the variable RADIUS: CIRCLEAREA(RADIUS)
. Without the Dyn. User Function, you would need to enter RADIUS^2*PI
each time. Additionally, with the quick access to the Dyn. User Functions in the formula fields, you can easily select the functions from the list and update the placeholders.
Note
To ensure proper calculations, Dyn. User Functions must be named differently than variables.
Examples
The following section provides examples of the various functions.
Arithmetic Functions
The arithmetic syntax that can be entered in the formula fields are described in the following table.
Syntax | Examples |
---|---|
Comparison | Expression =, <=, =<, >=, =>, <> Expression |
Expression | Term { + Term | - Term | OR Term } |
Term | Factor { * | / | AND | XOR | DIV | MOD Factor} |
Factor | [NOT] number | (Comparison) | Function | ^ Factor [!] |
Number | [-|+] Digit {Digit} [, {Digit}] |
Function | Character {Character} [(Comparison{; Comparison} )] |
Character | A | B | C | D ... W | X | Y | Z |
Digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
:= | is defined as |
{ ... } | The expression in curly brackets can be repeat as often as possible. |
[ ... ] | The expression in square brackets can be omitted. |
| | Alternative selection, e.g., a number can be a 0, 1, 2, ... 8 or 9 |
Terminal Symbols, Functions, and Constants
The following list contains terminal symbols, functions, and constants as well as some examples.
- Terminal Symbols
- Digits, characters, and the marks '(', ')', '+', '-', '*', '/', '=', '>', '<', '^', '!', ';'
- Expressions 'AND', 'OR', 'XOR', 'NOT', 'DIV', 'MOD' are terminal symbols
- Internal Functions
- SIN(), ARCSIN(), COS(), ARCCOS(), TAN(), COT(), IF (boolean expression is true or false)
- String Functions
- CONCAT(), MID(), LEFT(), RIGHT(), for example:
- CONCAT(String1; String2; String3; ...)
- MID(String; StartPos; NoOfCharacters)
- RIGHT(String; NoOfCharacters)
- LEFT(String; NoOfCharacters)
- CONCAT(), MID(), LEFT(), RIGHT(), for example:
- Dynamic User Functions
- Square meter calculation: %1*%2
- Circular area calculation: %1^2 * PI (placeholder = %1 must be the radius)
- Constants
- PI as a constant for the number PI (3.1415...)
- Examples
- COS(15) * 10^3 = 965.9258
- 16 MOD 3 = is 1
- (15 * 3) > (60 / 10) = 1 (1 is equal to yes or true)
- (15 * 3) < (60 / 10) = 0 (0 is equal to no or false)
See Also
Dynamic Checklist
Dynamic Master BOM
Feedback
Submit feedback for this page .