Features II JS/JSR4400N SCARA Robot
JSG GANTRY Robot
JR2000N Desktop Robot
76
The
for
command parameters: initial value, end value and step value, can be given using variables or
expressions.
declare num loop
declare num ival
if
ld #genIn1
then
loop = 5
else
loop = 10
endIf
for ival=1 to loop step 1
(Contents to be repeated)
next
Declare a local variable
loop
.
Declare a local variable
ival
.
If
#genIn1=ON
then
Assign 5 to
loop
.
If not
Assign 10 to
loop
.
The initial value of the variable
ival
is 1. Add 1 to the variable for
every loop and repeat the commands between
for
and
next
until
the
ival
becomes the same value (5 or 10) as the variable
loop
.
■
do
…
exitDo
…
loop
The
do … exitDo … loop
command lines are repeated until the
exitDo
command exists.
do
(Contents to be repeated)
loop
Without a condition to exit from the
do
loop, the command goes
into an infinite loop.
do
(Contents to be repeated)
if
ld #genIn1
then
exitDo
endIf
(Contents to be repeated)
loop
z
The contents to be repeated can be put both before and after
Condition.
Condition:
If #genIn1=1, break out of the
do … loop
loop and go to the next
command of the
loop
.
z
When the [for, do-loop] commands are used, an error (No. 046: [for, do Nesting Error]) is returned
if the nest level exceeds Level 10.
z
If the [for, do-loop] commands are set to the (base) point type [CP Passing Point] points as point
jobs, the robot may be stopped due to there being too many loops.