Indicates that incorrect handling may cause hazardous conditions, resulting in
death or severe injury.
CAUTION
Indicates that incorrect handling may cause hazardous conditions, resulting in
minor or moderate injury or property damage.
(Read these precautions before use.)
Before using this product, please read this manual and the relevant manuals introduced in this manual carefully and pay
attention to safety in order to handle the product correctly.
This manual classifies the safety precautions into two categories: [WARNING] and [CAUTION].
Depending on the circumstances, procedures indicated by [CAUTION] may also cause severe injury.
It is important to follow all precautions for personal safety.
Store this manual in a safe place so that it can be read whenever necessary. Always forward it to the end user.
[DESIGN PRECAUTIONS]
WARNING
● Make sure to set up the following safety circuits outside the PLC to ensure safe system operation
even during external power supply problems or PLC failure. Otherwise, malfunctions may cause
serious accidents.
- Most importantly, set up the following: an emergency stop circuit, a protection circuit, an interlock
circuit for opposite movements (such as forward vs. reverse rotation), and an interlock circuit to
prevent damage to the equipment at the upper and lower positioning limits.
- Note that when the CPU module detects an error, such as a watchdog timer error, during self-
diagnosis, all outputs are turned off. Also, when an error that cannot be detected by the CPU
module occurs in an input/output control block, output control may be disabled. External circuits
and mechanisms should be designed to ensure safe machine operation in such a case.
- Note that the output current of the 24 V DC service power supply varies depending on the model
and the absence/presence of extension modules. If an overload occurs, the voltage automatically
drops, inputs in the PLC are disabled, and all outputs are turned off. External circuits and
mechanisms should be designed to ensure safe machine operation in such a case.
- Note that when an error occurs in a relay or transistor of an output circuit, the output might stay on
or off. For output signals that may lead to serious accidents, external circuits and mechanisms
should be designed to ensure safe machine operation.
● Construct an interlock circuit in the program to ensure safe operation for the whole system when
executing control (for data change) of the PLC in operation.
Read the manual thoroughly and ensure complete safety before executing other controls (for program
change, parameter change, forced output and operation status change) of the PLC in operation.
Otherwise, the machine may be damaged and accidents may occur due to erroneous operations.
● In an output circuit, when a load current exceeding the current rating or an overcurrent caused by a
load short-circuit flows for a long time, it may cause smoke and fire. To prevent this, configure an
external safety circuit, such as a fuse.
● For the operating status of each station after a communication failure of the network, refer to relevant
manuals for the network. Incorrect output or malfunction may result in an accident.
1
[DESIGN PRECAUTIONS]
CAUTION
● After the CPU module is powered on or is reset, the time taken to enter the RUN status varies
depending on the system configuration, parameter settings, and/or program size.
Design circuits so that the entire system will always operate safely, regardless of this variation in time.
[INSTALLATION PRECAUTIONS]
CAUTION
● Connect the expansion board and expansion adapter securely to their designated connectors. Loose
connections may cause malfunctions.
● Connect the extension cables, peripheral device cables, input/output cables and battery connecting
cable securely to their designated connectors. Loose connections may cause malfunctions.
● When using an SD memory card, insert it into the SD memory card slot. Check that it is inserted
completely. Poor contact may cause malfunction.
● Turn off the power to the PLC before attaching or detaching the following devices. Failure to do so
may cause device failures or malfunctions.
-Peripheral devices, expansion board and expansion adapter
-Extension modules, bus conversion module and connector conversion module
-Battery
[WIRING PRECAUTIONS]
CAUTION
● Do not bundle the power line, control line and communication cables together with or lay them close to
the main circuit, high-voltage line, load line or power line. As a guideline, lay the power line, control
line and connection cables at least 100 mm (3.94") away from the main circuit, high-voltage line, load
line or power line. Noise may cause malfunctions.
2
[STARTUP AND MAINTENANCE PRECAUTIONS]
WARNING
● Do not touch any terminal while the PLC's power is on. Doing so may cause electric shock or
malfunctions.
● Before modifying the program in mid-operation, forcing output, running or stopping the PLC, read this
manual and the associated manuals carefully and ensure complete safety. An operation error may
damage the machinery or cause accidents.
● Do not change the program in the PLC from two or more peripheral equipment devices (such as an
engineering tool and a GOT) at the same time. Doing so may cause destruction or malfunction of the
PLC program.
● Use the battery for memory backup in conformance to the FX5 User's Manual (Hardware).
-Use the battery for the specified purpose only.
-Connect the battery correctly.
-Do not charge, disassemble, heat, put in fire, short-circuit, connect reversely, weld, swallow or
burn the battery, or apply excessive force (vibration, impact, drop, etc.) to the battery.
-Do not store or use the battery at high temperatures or expose to direct sunlight.
-Do not expose to water, bring near fire or touch liquid leakage or other contents directly.
Incorrect handling of the battery may cause excessive heat, bursting, ignition, liquid leakage or
deformation, and lead to injury, fire or failures and malfunction of facilities and other equipment.
[PRECAUTIONS IN OPERATION]
CAUTION
● Construct an interlock circuit in the program to ensure safe operation for the whole system when
executing control (for data change) of the PLC in operation. Read the manual thoroughly and ensure
complete safety before executing other controls (for program change, parameter change, forced
output and operation status change) to the PLC in operation. Otherwise, the machine may be
damaged and accidents may occur by erroneous operations.
3
INTRODUCTION
This manual contains text, diagrams and explanations which will guide the reader in the correct installation, safe use and
operation of the FX5 Programmable Controllers and should be read and understood before attempting to install or use the
module.
Always forward it to the end user.
Regarding use of this product
• This product has been manufactured as a general-purpose part for general industries, and has not been designed or
manufactured to be incorporated in a device or system used in purposes related to human life.
• Before using the product for special purposes such as nuclear power, electric power, aerospace, medicine or passenger
movement vehicles, consult Mitsubishi Electric.
• This product has been manufactured under strict quality control. However when installing the product where major
accidents or losses could occur if the product fails, install appropriate backup or failsafe functions in the system.
Note
• If in doubt at any stage during the installation of the product, always consult a professional electrical engineer who is
qualified and trained in the local and national standards. If in doubt about the operation or use, please consult the nearest
Mitsubishi Electric representative.
• Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference, please use it after
confirming the function and safety of the equipment and system. Mitsubishi Electric will accept no responsibility for actual
use of the product based on these illustrative examples.
• This manual content, specification etc. may be changed without a notice for improvement.
• The information in this manual has been carefully checked and is believed to be accurate; however, if you notice a doubtful
point, an error, etc., please contact the nearest Mitsubishi Electric representative. When doing so, please provide the
2 PROCESSING OF OPERATIONS ACCORDING TO CPU MODULE OPERATION STATUS
3 CPU MODULE MEMORY CONFIGURATION
PART 1
15
1PROGRAM EXECUTION
Inside the CPU module
Scan configuration
Program operations
END processing
Initial processing/RUN time
initialization processing
I/O refresh
1.1Scan Configuration
The configuration of the scan of the CPU module is explained below.
Initial processing and initialization processing in RUN mode
Initial processing according to CPU module status and initialization processing in the RUN status are explained below.
: Execute, : Do not execute
Processing itemCPU module status
At power ONAt resetSTOPRUN after
write to PLC
Initialization of input/output module
Boot from SD memory card
CPU parameter check
System parameter check
Initialization of device/label outside latch range
(bit device: OFF, word device: 0)
Assignment of I/O numbers of input/output
module
Setting of module parameters
Setting of device
*1 Indicates an instance of power OFFON or setting to RUN status without a reset after modifying parameters or program in STOP
status.
*1
At STOPRUN
16
1 PROGRAM EXECUTION
1.1 Scan Configuration
I/O refresh
Execute I/O refresh before starting program operations.
• Input ON/OFF data input from input module/intelligent function module to CPU module
• Output ON/OFF data input from CPU module to output module/intelligent function module
When executing constant scan, I/O refresh is executed after the constant scan waiting time ends.
Program operations
Step 0 of each program up to the END/FEND instruction is executed according to program settings. This program is called the
"main routine." Main routine programs can be divided into subroutines. (Page 29 Subroutine program)
END processing
END processing involves the following processes:
• Refreshing of network modules
• Refreshing of intelligent function modules
• Instruction termination processing
• Device/label access service processing
• Resetting of the watchdog timer
• Self-diagnostic processing
• Setting of values to special relays/special registers (set timing: when END processing is executed)
1
1 PROGRAM EXECUTION
1.1 Scan Configuration
17
1.2Scan Time
I/O refresh
Program operations
END processing
RUN time
Scan time
RUN time initialization processing*1
The CPU module repeats the following processing. The scan time is the sum total of each process and execution time.
*1 This process is included in the initial scan time.
Initial scan time
This refers to the initial scan time when the CPU module is in the RUN mode.
How to check the initial scan time
The initial scan time can be checked by the following information:
• Value stored in SD518 (initial scan time (ms)), SD519 (initial scan time (s))
• Program list monitor (GX Works3 Operating Manual)
Monitoring the initial scan time
The initial scan time is monitored by the initial scan time execution monitor time. (5 SCAN MONITORING FUNCTION)
■Initial scan time execution monitor time precautions
• Set an initial execution monitor time longer then the execution time of the initial scan time. An error occurs when the initial
scan time exceeds the set initial execution monitor time.
• The measurement error margin of the initial scan execution monitor time is 10 ms. For example, if the initial execution
monitor time (t) is set to 100 ms, an error occurs in the initial scan time in the range 100 ms < t < 110 ms range.
1 PROGRAM EXECUTION
18
1.2 Scan Time
1.3Program Execution Sequence
STOP/PAUSE→RUN
END processing
Initial execution
type program
Scan execution
type program
Event execution
type program
Fixed scan
execution type
program
Standby type
program
Exists
Does not exist
Does an initial
execution type
program exist?
When the CPU module enters the RUN status, the programs are executed successively according to the execution type of the
programs and execution order setting.
1
When the execution type of the programs is the same, the programs are executed in the order in which the
execution order was set.
1 PROGRAM EXECUTION
1.3 Program Execution Sequence
19
1.4Execution Type of Program
Ex.
When an initial execution type program is used
Program A
Program B
Control by one program
Initial execution
type program
Scan execution
type program
One program can be divided into initial execution
type and scan execution type program.
Processing performed
only once
Processing performed
in every scan
1st scan2nd scan3rd scan
STOP/PAUSE→RUN
END processing
Initial execution type program A
Initial execution type program B
Scan execution type program
Initial execution type program C
0END
0END
0
0
END
0END0END
Initial scan time is the sum of the execution time of initial execution type programs
and the END processing time.
Set the program execution conditions.
Initial execution type program
This program type is executed only once when the CPU module changes from the STOP/PAUSE to the RUN status. This
program type is used for programs, that do not need to be executed from the next scan once they are executed, like initial
processing on an intelligent function module.
Also, the execution time of initial execution type programs is the same as the initial scan time.
When multiple initial execution type programs are executed, the execution time of the initial execution type programs
becomes the time until execution of all initial execution type programs is completed.
Precautions
The precautions for initial execution type programs are explained below.
■Restrictions in programming
With initial execution type programs, do not use instructions that require several scans to complete execution (instructions for
which completion devices exist).
e.g. RBFM and WBFM instructions
20
1 PROGRAM EXECUTION
1.4 Execution Type of Program
Scan execution type program
1st scan2nd scan3rd scan4th scan
STOP/PAUSE→RUN
END processing
Initial execution type program
Scan execution type program A
Scan execution type program C
Scan execution type program B
Scan time
0END
0END
0END
0END
0END
END
0END
0
Fixed scan interval
END processing
Scan execution type program
Fixed scan execution type program
Condition
established
Condition
established
This program type is executed only once per scan from the scan following the scan where an initial execution type program
was executed.
When multiple scan execution type programs are executed, the execution time of the scan execution type programs becomes
the time until execution of all scan execution type programs is completed. Note, however, that when an program/event
execution type program is executed before a scan execution type program is completed, the execution time of these
programs is included in the scan time.
1
Fixed scan execution type program
An interrupt program which is executed at a specified time interval. Different from the normal interrupt program, this type of
program does not require interrupt pointer (I) and IRET instruction to be written (pointer is assigned by parameter). Execution
is performed by program file basis.
You can use 4 files of fixed scan execution type programs at the maximum.
To execute a fixed scan execution type program, the EI instruction must be used to enable interrupts.
1 PROGRAM EXECUTION
1.4 Execution Type of Program
21
Make the following settings for fixed scan execution type program in CPU parameter.
Window
Displayed items
Window
Displayed items
• Interrupt pointer setting (Interrupt from internal timer: I28 to I31)
• Fixed scan interval setting
Interrupt pointer setting
The interrupt pointer (Interrupt from internal timer: I28 to I31) assigned to a fixed scan execution type program is set up.
I28Sets the execution interval of I28.1 to 60000 ms (1 ms units)100 ms
I29Sets the execution interval of I29.1 to 60000 ms (1 ms units)40 ms
I30Sets the execution interval of I30.1 to 60000 ms (1 ms units)20 ms
I31Sets the execution interval of I31.1 to 60000 ms (1 ms units)10 ms
Action when the execution condition is satisfied
Fixed scan interval
END processing
Scan execution type program
Fixed scan execution type program
Condition
established
Constant scan
*1
Waiting time
Performs the following action.
■If the execution condition is satisfied before the interrupt is enabled by the EI instruction
The program enters the waiting status and is executed when the interrupt is enabled. Note that if the execution condition for
this fixed scan execution type program is satisfied more than once during the waiting status, the program is executed only
once when the interrupt is enabled.
■When there are two or more fixed scan execution type programs
When the specified time intervals expire in the same timing, the programs are executed in order according to the priority (I31
> I30 > I29 > I28) of the periodic interrupt pointer.
■If another or the same execution condition is satisfied while the fixed scan execution type
program is being executed
Operates according to the fixed scan execution mode setting.
■If the execution condition is satisfied while the interrupt is disabled by the system
Operates according to the fixed scan execution mode setting.
■When an interrupt is generated during a standby while executing constant scan
Executes the fixed scan execution type program.
1
*1 If processing does not finish during the waiting time, the scan time is extended.
■If another interrupt occurs while the fixed scan execution type program is being executed
If an interrupt program is triggered while the fixed scan execution type program is being executed, the program operates in
accordance with the interrupt priority.
Processing when the fixed scan execution type program starts
The same processing as when the interrupt program starts. (Page 34 Processing at startup of interrupt program)
Fixed scan execution mode
If execution condition for a fixed scan execution type program and fixed cycle interrupt (I28 to I31) based on the internal timer
of the CPU module is satisfied while interruption is disabled, the operation of the program execution after interruption
becomes allowed is specified. However, if execution condition is satisfied while interruption is set to be disabled because of a
DI instruction or the like, this is out of the scope of the fixed scan execution mode.
"Interrupts disabled" refers to the following:
• A program having an interrupt priority higher than or the same as the corresponding program is currently
being executed.
• The corresponding program is currently being executed.
• Program execution is currently at a part in which interrupts are disabled by the system.
1 PROGRAM EXECUTION
1.4 Execution Type of Program
23
■Operation in the fixed scan execution mode
Window
Displayed items
[1]
Execution condition satisfied:
6 times
Cycle interval of TEISYU
"TEISYU"
(Fixed scan execution type program)
Number of executions:
6 times
All pending executions are executed and the
number of executions of the fixed scan is
guaranteed. (In the chart, three executions are
made immediately after interruption becomes
allowed [1]).
Section where interruptions
are disabled
Section where interruptions
are disabled
Execution condition satisfied:
6 times
Delay behind the cycle
Cycle interval of TEISYU
"TEISYU"
(Fixed scan execution type program)
Number of executions:
4 times
The program is executed once, and the fixed period
execution of the program is maintained. (Even if
execution condition was satisfied twice or more, only
one execution is made.)
This section describes the operation which can be performed in the fixed scan execution mode.
• Execution Count Takes Priority
The program is executed for all the pending number of executions so that it can be executed the same number of times as
execution condition was satisfied.
• Precede Fixed Scan
When the waiting for execution , one execution is made when interrupt becomes allowed. Even if execution condition was
satisfied twice or more, only one execution is performed.
For Precede Fixed Scan, the periodicity of the program is maintained. For
Execution Count Takes Priority, the program is executed for all pending number
of executions.
• Precede Fixed Scan
• Execution Count
Takes Priority
Precede Fixed Scan
24
1 PROGRAM EXECUTION
1.4 Execution Type of Program
Event execution type program
Y50
M0
10 ms
*1
10 ms
*1
1st scan
I60 interrupt occurs
2nd scan3rd scan4th scan5th scan
STOP/PAUSE→RUN
Scan execution type program A
END processing
Scan execution type program B
Execution order
Y50 turns ON
Event execution type program E
(Executed when 10 ms elapses)
Event execution type program D
(Executed when I60 interrupt occurs)
Event execution type program C
(Executed when Y50 turns ON)
(1)
1st scan
I60 interrupt occurs
2nd scan3rd scan
STOP/PAUSE→RUN
Scan execution type program A
END processing
Scan execution type program B
Execution order
Event execution type program C
(Executed when I60 interrupt
occurs)
Execution of this program type is triggered by a user-specified event. (Page 25 Trigger type)
*1 Measurement of elapsed time is 10 ms or more because it is determined depending on the scan time.
Trigger type
Triggers for event execution type programs are explained below. (Page 27 Trigger setting)
■Generation of interrupt by interrupt pointer (I)
The program is executed once, immediately, when a specified interrupt cause is generated. An interrupt pointer label can be
appended by adding the FEND instruction to a different program, and the program description partitioned by the IRET
instruction can be turned into an exclusive program.
1
(1) Event execution type program C is executed immediately when the specified event is generated.
• Specifiable interrupt pointer (I)
Specifiable interrupt pointers are I0 to I15, I16 to I23, and I50 to I177.
Execution conditions for the event execution type program which is triggered by interrupt occurred by the
interrupt pointer (I) are the same as those for general interrupt programs. (Page 31 Operation when an
interrupt is generated)
1 PROGRAM EXECUTION
1.4 Execution Type of Program
25
■Bit data ON (TRUE)
Y50
M0
Y50
M0
(1)
1st scan2nd scan3rd scan4th scan
STOP/PAUSE→RUN
Scan execution type program A
END processing
Scan execution type program B
Execution order
Y50 is the ON interval
Y50 turns OFFY50 turns ON
Event execution type program C
(Executed when Y50 turns ON)
10 ms10 ms
(1)
1st scan2nd scan3rd scan4th scan
STOP/PAUSE→RUN
Scan execution type program A
END processing
Scan execution type program B
Execution order
Measurement interval
Event execution type program C
(Executed when 10 ms elapses)
Specified time 10
ms has passed
Specified time 10
ms has passed
When it is the turn of the corresponding program to be executed, the program is executed if the specified bit data is ON. This
eliminates the need for creating a program for monitoring triggers in a separate program.
(1) The program is executed if Y50 is ON when it is the turn of event execution type program C to be executed.
Applicable devices are as follows.
ItemDescription
*1
Device
Bit deviceX (DX), Y, M, L, F, SM, B, SB
Bit specification in word deviceD, SD, W, SW, R, U\G
*1 Indexed devices cannot be specified.
■Elapsed time
The program is executed once when it is the turn of the corresponding program to be executed first after the CPU module is
run and the specified time has elapsed. For second execution onwards, the time is re-calculated from the start of the previous
event execution type program. When it is the turn of the corresponding program to be executed first after specified time has
elapsed, program execution is repeated. Output (Y) currently used in the corresponding program and the current values of
timer (T) can be cleared at the next scan following execution of the corresponding program. This will not be always executing
an interrupt at a constant cycle but can be used when executing a specified program after a specified time has elapsed.
(1) When it is the turn of the first execution after the specified time has elapsed, event execution type program C is executed.
Output and timer current values are not cleared even when the program is set so that output and timer current
values are cleared, if the scan time is longer than the elapsed time set value.