![background image](http://html1.mh-extra.com/html/omron/cx-supervisor-script-reference-rev2-0/cx-supervisor-script-reference-rev2-0_reference-manual_744212034.webp)
OMRON
CHAPTER 4 – CX-Supervisor Script Language
Revision 2.0
Page 21
FOR... NEXT Loop
Syntax
FOR pointname = startpt TO endpt STEP steppt
statementblock1
NEXT
Remarks
Argument Description
pointname
The pointname to be used as the loop counter.
startpt
The initial setting of
pointname
, and the first value to be used through the
loop.
endpt
The last value to be used. The loop ends when
pointname
exceeds this value.
steppt
Amount to increase
pointname
by every pass of the loop.
Steppt
can be
negative to count backwards providing
startpt
is larger than
endpt
. The STEP
keyword and variable may be omitted in which case
pointname
is
incremented at each pass of the loop (identical to adding STEP 1).
Typical Examples
FOR loopcount = 0 TO 100
Ellipse_1.vertical%fill = loopcount
NEXT
In this example, ‘Ellipse_1’ is gradually filled 100 times.
FOR loopcount = 100 TO 0 STEP -5
Ellipse_1.vertical%fill = loopcount
NEXT
In this example, the fill for ‘Ellipse_1’ is gradually removed 20 times (100 times/-5).
Note:
Loop statements should be used with caution, as they consume processor time while
they are running and some other parts of the system may not be updated.
DO WHILE/UNTIL Loop
Syntax
DO WHILE expression
statementblock
LOOP
or
DO
statementblock
LOOP WHILE expression
Содержание 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...