EasyManua.ls Logo

Mitsubishi Electric R64MTCPU - Repeat Control with Specified Count: for - NEXT

Mitsubishi Electric R64MTCPU
354 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
Loading...
198
4 OPERATION CONTROL PROGRAMS
4.14 Program Control
Repeat control with specified count: FOR - NEXT
Setting data
Usable Data
: Usable
Description, data type of result
Processing details
(S1) is substituted to the device specified with (D) as initial value, and the block between FOR and NEXT is repeatedly
executed.
The incremental value specified with (S3) is added to the device specified with (D) at every execution of NEXT. If the device
value specified with (D) is larger than the final value specified with (S2), the repeat control of the block between FOR and
NEXT is ended, and the next block of NEXT is executed.
When the incremental value specified with (S3) is negative number, if the device value specified with (D) is smaller than the
final value specified with (S2), the repeat control of the block between FOR and NEXT is ended.
STEP can be omitted. If STEP is omitted, the repeat control is executed as "STEP 1".
Maximum multiplicities of repeat control are eight.
When data types of (D), (S1), (S2) and (S3) are different, type conversion processing is executed but an unintended
operation may occur. Set the same data type.
Operation error
In the following case, an operation error will occur, and the corresponding Motion SFC program No. execution will be stopped.
For the subroutine called program, the call source program also stops to execute.
(S1) data is outside the range of (D) data type.
(D), (S1), and (S2) are indirectly specified devices, and the device No. is outside the range.
FOR to NEXT instruction is executed over the limited count for repeat control set in parameter in an operation control
program or a transition program.
Format Number of basic steps Usable steps
F/FS G
FOR(D) = (S1)TO(S2)STEP(S3) -
NEXT
FOR: 18
NEXT: 15

Setting
data
Usable Data
Bit
device
Word device Constant Calculation
expression
Bit
conditional
expression
Comparison
conditional
expression
16-bit
integer
type
32-bit
integer
type (L)
64-bit
floating
point
type (F)
16-bit
integer
type
(K/H)
32-bit
integer
type
(K/H, L)
64-bit
floating
point
type (K)
(D) 
(S1) 
(S2) 
(S3) 
Setting data Description Data type of result
(D) Device used for loop control counter
(S1) Initial value of loop control counter
(S2) Final value of loop control counter
(S3) Incremental value of loop control counter
FOR...
FOR...
NEXT
NEXT
(2 level) (1 level)

Table of Contents

Other manuals for Mitsubishi Electric R64MTCPU

Related product manuals