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

Script language
Table of Contents

Advertisement

OMRON
FOR... NEXT Loop
Syntax
FOR pointname = startpt TO endpt STEP steppt
statementblock1
NEXT
Remarks
Argument
pointname
startpt
endpt
steppt
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
Revision 2.0
CHAPTER 4 – CX-Supervisor Script Language
The pointname to be used as the loop counter.
The initial setting of pointname, and the first value to be used through the
loop.
The last value to be used. The loop ends when pointname exceeds this value.
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).
Description
Page 21

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 and is the answer not in the manual?

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents