10 repeat commands: while...wend – Yaskawa MP900 Series Motion Programming Manual User Manual

Page 111

Advertising
background image

3.1 High-Level Control Commands

3 -21

3.1.10 Repeat Commands: WHILE...WEND

J

Overview

The repeat commands (WHILE...WEND) repeatedly execute a designated range of blocks for
as long as the conditional expression is satisfied.

J

Description

The repeat commands (WHILE...WEND) are designated as follows:

WHILE (conditional_expression);

⋅⋅⋅ ;
⋅⋅⋅ ; (process_1)
⋅⋅⋅ ;

WEND ;

← End of REPEAT

With these commands, the blocks from WHILE to WEND are repeatedly executed as long as
the conditional expression is satisfied. When the conditional expression is no longer satisfied,
program execution will jump to the next block after WEND.

Conditional

expression

Not satisfied

Satisfied

Process

1. Nesting of the repeat commands (WHILE...WEND) is restricted to a maximum of eight levels.
2. If the repeated program section is created using only commands for which processing is completed in one

scan, an infinite loop will be created and a watchdog timer error (system error) will be generated. When
using a command for which processing is executed in one scan, be sure to enter the SCAN WAIT (EOX)
command.

3. The commands for which processing is not completed in one scan are as follows:

MOV, MOS, MCW/MCC, ZRN, SKP, MVT, EXM, ACC, SCC, PFN, VEL, INP, TIM, and IOW

4. Processing of all commands other than those listed above is completed in one scan.

ABS, INC, IFP, PLN, IAC, IDC, FMX, POS, PLD, MSEE, END, RET, IF, WHILE, PFORK, SFORK,
and all sequence commands

3

IMPORTANT

Advertising
This manual is related to the following products: