Constraint editorSyntax of constraint expressions The constraint expressions syntax is a subset of the LN Tools syntax. You can make constraint expressions with the following basic instructions. Arithmetic operators:
Logical operators:
Relational operators:
Domain expresssions A is {a1,a2,a3-a4,..} means: (A=a1 or A=a2 or A >= a3 and A <= a4 and so on). The domain expression syntax is an abbreviated notation for logical expressions regarding the domain of a variable. Priority in expressions Arithmetic operators have a higher priority than relational operations. Relational operations have a higher priority than logical operators. The priority sequence for arithmetic operators : * / \ + - The priority sequence for logical operators : not, and, or Round brackets ('()') can be used to change the priority sequence for arithmetic and logical operators. Example 3 + 4 * 5 = 23 (3 + 4) * 5 = 35 Boolean expressions Boolean expressions can have the value true or false (1 or 0). This can be applied in constraints, especially conditional expressions. Example If not e then ' means: If e = false then' or If e = 0 then' If-then-else constructions Extensive if-then-else constructions can be used in constraints. Nesting of statements is allowed. Example If expression1 then expression2 else expression3 endif An if-then-else construction is always closed with an endif statement. The else statement is not mandatory. If, else and endif statements always start on a new line. (Conditional) expressions can be divided over several lines. A validation constraint may be defined without if-then-else statements; this constraint must start with c:. A constraint can be provided with comments using the | sign. During the configuration process, you can generate messages using the variable message (up to 80x25 lines of text). Constraint variables Both global and local variables can be used in constraint expressions. Global variables are product features and user-defined constraint variables that are declared as global. The variables predefined by the product configurator, such as input, display, length, width, and so on, are local ones. Global variables retain their value throughout the configuration process unless their values are changed. A constraint variable can have the following type declarations:
The user-defined constraint variables must always be declared at the top of the constraint. All local variables are initialized before execution of the constraint: alphanumeric variables are cleared and numeric variables are given the value zero. The global variables input and validating are initialized with the value true. Use of constraint variables Product features must be provided with opening and closing square brackets ([......])in constraint expressions. The remaining variables can directly be used in expressions. Alphanumeric variables (string arrays) can be indexed according to the notation: (startposition[;length]). Example [color] = "red" validating = true The values of variables can be alphanumeric or numeric. Alphanumeric values must be written in quotation marks ("...."). Numeric values can directly be entered. The decimal sign is a point ('.'). Example machine(1;2) = "A5" volume = 28.673 The constants true/false can be used for boolean expressions. Arithmetic functions
Goniometric functions
Logarithmic functions
String functions
Date functions
Example date(1995,06,01) = 728445
| |||