For And Next - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions

FOR and NEXT

FOR:
Marks the starting position for repeat processing and specifies the repeat condition.
NEXT:
Marks the ending position for repeat processing.
Instruction
FOR
Repeat Start
NEXT
Repeat End
Variables
Name
Meaning
InitVal
Initial value
EndVal
End value
StepVal
Increment
Index
Control
variable
*1 If you omit an input parameter, the default value is not applied. A building error will occur.
*2 If you omit the input parameter in a ladder diagram, the default value is not applied. A building error will occur. If you omit
the input parameter in ST, a default value of 1 is applied.
Bit strings
InitVal
EndVal
StepVal
Index
2-76
Name
FB/FUN
FUN
FUN
I/O
Description
Value to set the Index to
when repetition is started.
Value of Index where repeti-
Input
tion is stopped
Value to add to Index each
time processing is repeated
Output
Loop index
OK OK OK OK OK OK OK OK
Must be the same data type as InitVal.
Must be the same data type as InitVal.
Must be the same data type as InitVal.
Graphic expression
FOR
EN
ENO
InitVal
Index
EndVal
StepVal
NEXT
EN ENO
Valid range
Depends on data type.
Depends on the data
type (but 0 is not
allowed)
Depends on data type.
Integers
NJ-series Instructions Reference Manual (W502)
ST expression
FOR Index:=InitVal TO End-
Val BY StepVal DO
expression
END_FOR*;
* In ST, do not use NEXT to
mark the ending position
of repeat processing. Use
END_FOR instead.
Unit
Default
*1
---
*2
---
---
Times, durations,
dates, and text strings

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents