14.17 Command: If
Loops the underlying program commands. Depending on the selection, the underlying pro-
gram commands are either looped infinitely, a certain number of times or as long as the given
condition is true. When looping a certain number of times, a dedicated loop variable (called
loop 1 in the screen shot above) is created, which can be used in expressions within the loop.
The loop variable counts from 0 to N − 1.
When looping using an expression as end condition, PolyScope provides an option for con-
tinuously evaluating that expression, so that the “loop” can be interrupted anytime during its
execution, rather than just after each iteration.
14.17 Command: If
If and If...Else statements change the robot’s behavior based on sensor inputs or variable
values.
Select conditions in the Expression Editor that make up expressions using an If statement. If
a condition is evaluated as True, the statements within this If command are executed. An If
statement can have only one Else statement. Use Add ElseIf and Remove ElseIf to add
and remove ElseIf expressions.
Select Check Expression Continuously to allow If, ElseIf and Loop statements to be
evaluated while the contained lines are executed. If an expression inside an If statement is
evaluated as False, the ElseIf or Else statements are followed.
Version 3.11
Copyright © 2009–2019 by Universal Robots A/S. All rights reserved.
II-85 e-Series