Nested Conditional Statements - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Control Statements
4-3-2

Nested Conditional Statements

IF burner AND fuel > 0 AND rate > 0 THEN
fuel = fuel - rate
ELSE
lift = 0
altitude = 0
ENDIF
Provided that Boolean point 'burner' is ''TRUE'' AND points 'fuel' and 'rate' are
greater in value than 0, then 'fuel' is assigned a new value. Otherwise points
'lift' and 'altitude' are assigned a new value.
References
Refer to chapter 4, Punctuation, Indentation for details on the layout of code.
Syntax
IF conditionA THEN
statementblock1
IF conditionB THEN
statementblock3
ENDIF
ELSE
statementblock2
ENDIF
or
IF conditionA THEN
statementblock1
IF conditionB THEN
statementblock3
ELSE
statementblock4
ENDIF
ELSE
statementblock2
ENDIF
or
IF conditionA THEN
statementblock1
ELSEIF conditionB THEN
statementblock3
ENDIF
or
IF conditionA THEN
statementblock1
ELSE
statementblock2
IF conditionB THEN
statementblock3
ELSE
statementblock4
ENDIF
ENDIF
Remarks
SECTION 4 CX-Supervisor Script Language
25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents