Specifications
SIMATIC Instructions
9-152
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
For/Next Example
I2.0
FOR
EN
INDX
INIT
VW100
1
FINAL 100
I2.1
FOR
EN
INDX
INIT
VW225
1
FINAL2
Network
LD I2.0
FOR VW100, 1, 100
.
.
.
Network
LD I2.1
FOR VW225, 1, 2
.
.
.
Network
NEXT
.
.
Network
NEXT
When I2.0 comes on,
the outside loop
indicated by arrow 1 is
executed 100 times.
The inside loop
indicated by arrow 2 is
executed twice for each
execution of the outside
loop when I2.1 is on.
2
1
Network 1
Network 10
Network 15
Network 20
NEXT
NEXT
LAD STL
FBD
Network 1
Network 10
Network 15
Network 20
FOR
EN
INDX
INIT
VW100
1
FINAL 100
I2.0
FOR
EN
INDX
INIT
VW225
1
FINAL2
I2.1
NEXT
NEXT
ENO
ENO
ENO
ENO
Figure 9-56 Example of For/Next Instructions for LAD and STL