EasyManua.ls Logo

Emerson DSM314 - Whitespace

Emerson DSM314
519 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
User Manual Chapter 12
GFK-1742F Jan 2020
Local Logic Language Syntax 289
Local Logic Conditional Statements
Conditional statements permit conditional code execution based on simple relational and
bitwise logical operations. A conditional statement has the following format.
IF <expression> THEN
Local Logic Statements
END_IF;
The <expression> may consist of a constant, a variable, a relational or bitwise logical
operation on two variables, or a bitwise complement of a constant or variable. Write-only
variables are not allowed in the expression. If the relational expression is true, or if a bitwise
operation, variable or constant has a non-zero value, the Local Logic statements in the body
of the IF statement are executed. Any number of program statements may appear in the
body of an IF statement (subject to the total limit). Each IF-THEN statement must have an
accompanying END_IF.
Examples:
IF P226 THEN
This construct is okay.
IF CTL_1_to_32 BWAND 2#1010 THEN
This construct is okay.
IF Strobe1_Level_1 = TRUE THEN
This construct is okay.
IF BWNOT P100 THEN
This construct is okay.
IF BWNOT P001 <> P002 THEN
This construct is ILLEGAL too
many operations.
If statements may nest up to 8 levels deep. When counting the number of program
statements, the IF-THEN and END_IF statements count as two separate statements.
Table 54: Valid Operators
Statement Type
Valid Operators
Conditional
Relational
<, >, <=, >=, <>, =
Bitwise Logical
BWAND, BWOR, BWXOR, BWNOT
Assignment
Arithmetic
+, -, /, *, MOD
Bitwise Logical
Abs Function
BWAND, BWOR, BWXOR, BWNOT
ABS ()
12.1.4 Whitespace
Blanks, end-of-lines, and tabs are considered whitespace. Whitespace is ignored, except
when used to separate adjacent syntactic elements, and may be used to improve program
readability by the use of indention and blank lines.

Table of Contents

Related product manuals