![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-script-reference-rev2-0/cx-supervisor-script-reference-rev2-0_reference-manual_744212029.webp)
CHAPTER 4 – CX-Supervisor Script Language
OMRON
Page 16
Revision 2.0
Remarks
Argument Description
Condition
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.
Statementblock1
One or more statements which are performed if the
condition
is met.
Statementblock2
One or more statements which are performed if the
condition
is not met.
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.
Содержание CX-SUPERVISOR - SCRIPT REFERENCE REV2.0
Страница 2: ...CX Supervisor Script Language Software Revision 2 0...
Страница 3: ......
Страница 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...
Страница 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...
Страница 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...
Страница 13: ......
Страница 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...
Страница 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...
Страница 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...
Страница 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...