Omron CX-Supervisor Reference Manual page 123

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

Advertisement

Balloon Script
122
ENDIF
ENDIF
IF burner AND fuel > 0.0 AND rate > 0.0 THEN
lift = lift + rate/5.0
ELSE
IF alt > 140.0 THEN
lift = lift - 0.2
ENDIF
ENDIF
IF lift < -10.0 THEN
lift = -10.0
ENDIF
alt = alt + lift
IF alt <= 140.0 THEN
IF distance>630.0 AND distance<660.0 AND lift>=-
3.0 THEN
winner = TRUE
burner = FALSE
ENDIF
IF lift < -3.0 then
crash = TRUE
burner = FALSE
ENDIF
lift = 0.0
ENDIF
speed = (alt-140.0 )/100.0
IF speed < 0.0 then
speed = 0.0
ENDIF
distance = distance + speed
The following paragraphs describe the above script on a line by line basis.
IF burner AND alt > 400.0 THEN
burner = FALSE
ENDIF
If the fuel burner is on, based on Boolean point 'burner' set to 'TRUE', and the
altitude of the balloon, based on point 'alt', exceeds 400, then the fuel burner is
turned off. Point 'alt' is measured in pixels between 140 and 1000, so the
value of 400 is the height in pixels.
IF burner THEN
fuel = fuel - rate
IF fuel < 0.0 THEN
fuel = 0.0
burner = FALSE
ENDIF
ENDIF
If the fuel burner is on, the amount of fuel remaining decreases by the rate of
ascent. The rate of ascent, point 'rate' can be modified by moving the slider. If
point 'fuel' currently has a value of less than 0, then there is no fuel left and the
fuel burner is turned off.
IF burner AND fuel > 0.0 AND rate > 0.0 THEN
lift = lift + rate/5.0
ELSE
SECTION 7 Script Example

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents