Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual page 29

Script language
Table of Contents

Advertisement

CHAPTER 4 – CX-Supervisor Script Language
Remarks
Argument
Condition
Statementblock1
Statementblock2
Typical Examples
IF fuel < 0 THEN
fuel = 0
ENDIF
Provided Integer point 'fuel' is less than 0, then it is assigned the value 0.
IF burner THEN
fuel = fuel - rate
ENDIF
Provided Boolean point 'burner' is ''TRUE'', then Integer point 'fuel' is assigned a new value. It is
also possible to apply 'IF burner == TRUE THEN' as the first line, with identical results.
IF distance > 630 AND distance < 660 AND lift >= -3 THEN
winner = TRUE
burner = FALSE
ENDIF
Provided that Integer point 'distance' is greater in value than 630 AND 'distance' is less in value than
660 (i.e. 'distance' is a value between 630 and 660) AND point 'lift' is greater than or equal to -3,
then Boolean points 'winner' and 'burner' are assigned new values.
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.
Page 16
The condition is made up of points and constants, using relational, logical or
arithmetical notation as a test. The condition can evaluate Boolean state
'TRUE' and 'FALSE', Integer or Real numbers, or a text string.
One or more statements which are performed if the condition is met.
One or more statements which are performed if the condition is not met.
Description
OMRON
Revision 2.0

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents