Examples and limitations of logical statements for custom messages
- Last UpdatedAug 13, 2024
- 3 minute read
The logical statements require the following syntax:
-
Each logical statement must contain at least one relational operator, and thus one relational statement. The exceptions to this rule are:
-
You append a variable name with a .calculated or .specified suffix to return a value of true or false based on the specified or calculated status of that variable.
-
You manually set the Test value to true or false.
-
-
Logical operators must appear between relational statements.
-
You can use any combination of numerical values, relational operators, and model variables and parameters to define your relational statements.
-
You can use only variables that are in the model.
-
You can use parameter that are in the model as well as the following special parameters:
-
MODE: This built-in parameter allows you to refer to the current simulation mode.
-
<Port>.NumberOfConnections: This integer parameter allows you to refer to the number connections that exist for a port in the model, where <Port> is the name of the port.
-
-
You can enclose relational statements in parentheses for readability. You cannot use braces or brackets in place of parentheses.
-
You cannot enclose logical operators in parentheses.
-
You must separate logical operators from relational statements by using either blank spaces or parentheses.
-
Variables names and logical operators are not case sensitive.
Note that a green badge appears in the Status column when the syntax for your logical statement is correct.
The following example directly sets the Test value to true for a defined condition so that the model gives a warning when it is in the specified condition:

The following example appends a variable name with the .specified suffix to give a warning when the variable is specified.

The following examples are simple error and warning messages that uses only relational operators.


The following examples use both relational operators and logical operators.




Currently, you cannot use mathematical operators in the logical statements.