Mitsubishi Electric MELSEC iQ-F Series Programming Manual page 21

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

Advertisement

Operation overview
■Macro type function blocks
The program of a macro type function block is loaded by a calling source program along the execution flow. At the time of
program execution, the loaded program is executed in the same way as the main program.
Use a macro type function block when giving a higher priority to the processing speed of the program.
Ex.
When calling FB1_a and FB2_a from the main program, calling FB3_a by FB1_a, and calling FB3_b by FB2_a
Execution
(Program file)
flow
Main program
FB1_a
FB1
FB2_a
FB2
(1) The FB1 program is loaded into the main program and executed.
(2) The FB3 program called by FB1 is loaded into the FB1 program.
(3) The FB2 program is loaded into the main program and executed in the same way as the FB1 program.
(4) The FB3 program called by FB2 is loaded into the FB2 program.
■Subroutine type function blocks
The program of a subroutine type function block is stored in the FB file and called by the calling source program when
executed.
Use a subroutine type function block to reduce the program size.
Ex.
When calling FB1_a and FB2_a from the main program, calling FB3_a by FB1_a, and calling FB3_b by FB2_a (Nested three
times)
 to  indicate the execution flow (order).
(Program file)
Main program
FB1_a
FB1
FB2_a
FB2
Up to 32 subroutine type function blocks, macro type function blocks, and functions in total can be nested.
Actual structure of
main program
FB1 program
FB3 program
FB2 program
FB3 program
(FB file)
FB1 program
FB3_a
FB3
(FB file)
FB2 program
FB3_b
FB3
(1)
(2)
(3)
(4)
(FB file)
Program memory
FB3 program
Main program
FB1 program
FB2 program
FB3 program
3 PROGRAM ORGANIZATION UNITS
3.3 Function Blocks (FB)
3
19

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-f fx5

Table of Contents