Yaskawa MP900 Series Ladder Programming Manual User Manual
Page 161

5.5 Program Control Instructions
5.5.8 FOR Construct (FOR, END_FOR)
5-92
( 3 ) Programming Example
In the following programming example, the registers from MW00100 to MW00105 are added together and stored in
the MW00000 register.
In this example, variable I is initialized to 0 by storing 0. Thereafter, the ADD instruction is executed until variable I
exceeds the maximum value of 5. The conditional expression is no longer satisfied when I is 6, so program execution
jumps to the next step following the END_FOR instruction.
( 4 ) Additional Information
The FOR, WHILE, and IF constructs can contain other constructs. This is called nesting. The maximum depth of a
nested structure that uses FOR, WHILE, and IF statements is limited to 8 levels.
If an instruction is preceded by a contact, it is treated like an IF construct and is included in the number of nesting lev-
els.