EasyManuals Logo

Mitsubishi FX1N Series Programming Manual

Mitsubishi FX1N Series
466 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #134 background imageLoading...
Page #134 background image
FX Series Programmable Controlers Applied Instructions 5
5-14
5.1.7 FOR, NEXT
(FNC 08, 09)
Operation:
The FOR and NEXT instructions allow the
specification of an area of program, i.e. the program
enclosed by the instructions, which is to be repeated
S number of times.
Points to note:
a) The FOR instruction operates in a 16 bit mode hence, the value of the operand S may be
within the range of 1 to 32,767. If a number between the range -32,768 and 0 (zero) is
specified it is automatically replaced by the value 1, i.e. the FOR-NEXT loop would execute
once.
b) The NEXT instruction has NO operand.
c) The FOR-NEXT instructions must be programmed as a pair e.g. for every FOR instruction
there MUST be an associated NEXT instruction. The same applies to the NEXT
instructions, there MUST be an associated FOR instruction. The FOR-NEXT instructions
must also be programmed in the correct order. This means that programming a loop as a
NEXT-FOR (the paired NEXT instruction proceeds the associated FOR instruction) is NOT
allowed.
Inserting an FEND instruction between the FOR-NEXT instructions, i.e. FOR-FEND- NEXT,
is NOT allowed. This would have the same effect as programming a FOR without a NEXT
instruction, followed by the FEND instruction and a loop with a NEXT and no associated
FOR instruction.
d) A FOR-NEXT loop operates for its set number of times before the main program is allowed
to finish the current program scan.
e) When using FOR-NEXT loops care should be taken not the exceed the PLCs watchdog
timer setting. The use of the WDT instruction and/or increasing the watchdog timer value is
recommended.
Mnemonic Function
Operands
Program steps
S
FOR
FNC 08
(Start of a
FOR-NEXT
loop)
Identifies the start
position and the
number of
repeats for the
loop
K, H,
KnX, KnY, KnM, KnS,
T, C, D, V, Z
FOR:
3step
NEXT
FNC 09
(End of a
FOR-NEXT
loop)
Identifies the end
position for the
loop
N/A
Note:
The FOR-NEXT loop can be nested for 5 lev-
els,
i.e. 5 FOR-NEXT loops are programmed within
each other.
NEXT:
1step
FX
1S
FX1N FX2N
FX2NC
PULSE-P
16 BIT OPERATION
32 BIT OPERATION
FOR K1X0
NEXT
[ S ]

Table of Contents

Other manuals for Mitsubishi FX1N Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Mitsubishi FX1N Series and is the answer not in the manual?

Mitsubishi FX1N Series Specifications

General IconGeneral
Programming LanguageLadder Logic
Output TypeRelay, Transistor
Operating Temperature0 to 55°C
Power Supply100-240V AC or 24V DC
Program Capacity8K steps
Communication PortsRS-422
Data Memory8000 words
High-speed CountersUp to 6 channels
Expansion ModulesAvailable
Pulse Output2 points

Related product manuals