Program Block - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Program design
Hide thumbs Also See for MELSEC iQ-F FX5:
Table of Contents

Advertisement

2.1

Program Block

A program block is a unit of a program.
Multiple program blocks can be created in one program file, and are executed in the registered order.
By dividing program blocks by functions or processing, changing the program order or replacing the program becomes easy.
Program blocks are stored in program files of each program in the registration destination.
Program block 1
Program block 2
Creating main routine programs, subroutine programs, and interrupt programs for each program block makes the program
easy to read.
Type
Main routine program
Subroutine program
Interrupt program
For details on the main routine program, subroutine program, and interrupt program, refer to the following.
User's manual (Application)
• Create subroutine programs and interrupt programs after the FEND instruction. The program area after the FEND
instruction is not executed as the main routine program. For example, when the FEND instruction is used at the end of the
second program block, the third program block and later are handled as subroutine programs or interrupt programs.
• To make the program easy to read, use twin instructions, such as FOR and NEXT instructions and MC and MCR
instructions, in the same program block.
• A simple program can be executed by the CPU module with just a main routine program in one program block.
2 PROGRAM CONFIGURATION
10
2.1 Program Block
Program file
Description
Program segment from the step 0 to the FEND instruction
Program segment from a pointer (P) to the RET instruction
Executed only when a subroutine call instruction (CALL instruction etc.) is executed.
Program segment from an interrupt pointer (I) to the IRET instruction
When an interrupt is triggered, the interrupt program corresponding to the interrupt pointer number is executed.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents