beautypg.com

Transition expressions – Micromod MOD: 1800P - MOD 30ML Identity Module (Version 2) Algorithms, Tables and Sequential Logic Functions User Manual

Page 132

background image

Logic Functions - Book 2

SEQUENCE BLOCK

10-12

10.4.4 Transition

Expressions

The transition expressions are user written equations that can control progression through the
steps in a sequence. The block evaluates the transition expressions and either changes to a
new step or remains on the current step depending on the result of the evaluation. The result
can cause progression to the next sequential step, skipping of steps, and return to previous
steps. When the result is no value, the sequence remains on the current step. A transition
expression can be written for each step, but is not required for every step because step
progression can also be controlled by signals from an external source.

The transition expressions are written in terms of user names for inputs, values for constants,
and ‘C‘ symbology for operators and functions. The expressions can use all supported data
types. The result of a transition expression evaluation is converted to the count data type to
generate a valid step number. For example, a result of 9.684 is converted to 9.

Operator precedence in an expression starts with the unary (single operand) operators and
continues with the binary (double operand) operators. The order of evaluation can be
changed using parentheses or the conditional (IF, THEN, ELSE) operators. The operators,
listed in order of precedence, are as follows:

1.

**

(RAISED_TO_THE_POWER)

2. SQRT (SQUARE_ROOT),

MOM

(MOMENTARY),

!

(Logical NOT),

ABS

(ABSOLUTE),

EXP

(EXPONENTIAL),

NLOG (NATURAL_LOG),
LOG

(LOG_10),

INT

(INTEGER)

3.

*

(TIMES),

/

(DIVIDE),

4.

+

(PLUS),

(MINUS)

5.

<

(LESS_THAN),

>

(GREATER_THAN),

<=

(LESS_THAN_OR_EQUAL),

>=

(GREATER_THAN_OR_EQUAL),

6.

==

(EQUALS),

!=

(UNEQUAL)

7.

&&

(Logical AND)

8.

| |

(Logical OR)

The conditional operators (IF, THEN, and ELSE) let you specify when operations are
evaluated. The IF expression (between the IF and THEN conditionals) is evaluated first. This
expression may be enclosed in parentheses. When the calculated value of the IF expression
is TRUE (non-zero), the THEN expression is evaluated. When it is FALSE (zero), the ELSE
expression is evaluated. The ELSE expression is optional. When the IF expression evaluates
to FALSE and there is no ELSE, the expression is not updated. Brackets ({}) should be used
for nesting conditionals. If brackets are not present, an ELSE expression is paired with the
last unpaired IF. See IB-23G600 Section 8.2 Expression Block for additional information.