Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 19

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Operation overview
The program of a function is stored in the FB/FUN file and called by the calling source program when executed.
Execution
(Program file)
flow
Main program
Ò
FUN1
Ö
FUN2
Ø
Up to 32 subroutine type function blocks, macro type function blocks, and functions in total can be nested.
Labels defined by a function
The labels defined by a function are assigned in the temporary areas of the storage-target memory during execution of the
function, and the areas are freed after the processing completes.
The following figure shows the label assignments while the above functions are being executed.
Ò
Main program being
executed
Ö
Main program being
executed
For the types of labels can be defined by a function, refer to the following.
Page 39 Classes
The label to be defined by a function must be initialized by a program before the first access because the label
value will be undefined.
(FB file)
FUN1 program
Ó
FUN3
Õ
(FB file)
FUN2 program
×
Ó
FUN1 being executed
(before FUN3 is called)
Label area of FUN1
×
FUN2 being executed
Label area of FUN2
(FB file)
FUN3 program
Ô
Ô
FUN3 being executed
Label area of FUN3
Label area of FUN1
Ø
Main program being
executed
3 PROGRAM ORGANIZATION UNITS
Õ
FUN1 being executed
(after FUN3 is executed)
Label area of FUN1
3.2 Functions (FUN)
3
17

Advertisement

Table of Contents
loading

Table of Contents