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.
1. Click "Detailed Setting" on the Program Setting.
2. Select the program name and set the execution type to
"Event".
3. Click "Detailed Setting Information".
"Event Execution Type Detailed Setting" window
ItemDescriptionSetting rangeDefault
Interruption OccurrenceSets the interrupt pointer used as the trigger.I0 to I23, I50 to I177
ON of Bit Data (TRUE)Sets the device used as the trigger.Page 26 Bit data ON (TRUE)
Passing TimeSets the elapsed time.• When "ms" is selected: 1 to
4. Set the trigger type to execute the event execution type
program.
65535 ms (in 1 ms units)
• When "s" is selected: 1 to
65535 s (in 1 s units)
When "Clear Output and Current Value of Timer" is enabled together with "ON of Bit Data (TRUE)" or
"Passing Time", the current values of the output (Y) and timer (T) of this program can be cleared at the first
execution turn of this program that comes after the trigger turns OFF.
1 PROGRAM EXECUTION
1.4 Execution Type of Program
27
Stand-by type program
P100
I0
P100
I0
Scan execution type programScan execution type program
Stand-by type program
Main routine
program
Subroutine
program
Interrupt
program
Main routine
program
Subroutine
program
Interrupt
program
This program is executed only when there is an execution request.
Saving programs in library
Subroutine programs or interrupt programs are saved as standby type programs so that they can be used when controlled
separately from the main routine program. Multiple subroutine programs and interrupt programs can be created in one
standby type program.
How to execute
Execute standby type programs as follows.
• Create sub-routine programs and interrupt programs in the standby type program which is called up by a pointer, etc. or
when an interrupt is generated.
28
1 PROGRAM EXECUTION
1.4 Execution Type of Program
1.5Program Type
RET
END
P1
RET
Y12
RET
Y11
P8
P0
FEND
Y10
Subroutine program 1
Subroutine program 2
Subroutine program 3
Pointer
Main routine program
Programs that use pointers (P) or interrupt pointers (I) are explained below.
Subroutine program
This is the program from pointer (P) up to the RET instruction. Subroutine programs are executed only when they are called
by the CALL instruction. Pointer type labels also can be used instead of pointers (P). The applications of subroutine programs
are as follows:
• By grouping programs that are executed multiple times in one scan into a single subroutine program, the number of steps
in the entire program can be reduced.
• A program that is executed only under certain conditions can be saved as a subroutine program which shortens the scan
time proportionately.
1
Precautions
The precautions when using subroutine programs are explained below.
• Do not use timers (T, ST). Note, however, that timers can be used when a timer coil (OUT T instruction) is always
executed only once in one scan.
• An error occurs when program execution returns to the call source program and the program is terminated without using
the RET instruction.
• An error occurs when there is no pointer (P) or pointer type global label in FB or FUN.
• Subroutine programs can also be managed as separate programs by turning them into standby type
programs. (Page 28 Stand-by type program)
• Pointers need not be programmed starting with the smallest number.
1 PROGRAM EXECUTION
1.5 Program Type
29
Interrupt program
I0
I29
Main routine program
I0 interrupt program
I29 interrupt program
Indicates the end of the main routine program.
Interrupt pointer
IRET
IRET
END
FEND
El
Y13
Y12
Y11
Y10
Main routine program
I0 interrupt program
I29 interrupt program
ExecutionExecution
Execution
Execution
Execution
IRET
IRET
Interrupt
occurs for I0
Interrupt
occurs for I29
Time
This is the program from interrupt pointer (I) up to the IRET instruction.
When an interrupt is generated, the interrupt program corresponding to that interrupt pointer number is executed. Note,
however, that interrupt enabled status must be set with the EI instruction before executing the interrupt program.
• Only one interrupt program can be created with one interrupt pointer number.
• Interrupt pointers need not be programmed starting with the smallest number.
• Interrupt programs can also be managed as separate programs by turning them into standby type
programs. (Page 28 Stand-by type program)
30
1 PROGRAM EXECUTION
1.5 Program Type
Operation when an interrupt is generated
Main routine program
Not executed because the interrupt program
execution is in disabled status (DI).
Executed as soon as the interrupt program
execution status changes to enabled.
Interrupt Program
Interrupt occurrenceEnable Interrupt (EI)
Execution
Executed as soon as PAUSE → RUN and
the interrupt program execution status
changes to enabled.
Not executed because the CPU module
is in the STOP status.
Interrupt occurrenceEnable Interrupt (EI)
Execution
Main routine program
Interrupt Program
PAUSE→ RUN
Main routine program
I0 interrupt program
Enable Interrupt (EI)
Simultaneous occurrence of
multiple interrupt factors
Execution
I10 interrupt program
Execution
Wait status
Wait status
I16 interrupt program
Priority
rank
IRET
IRET
IRET
I0 I10
I16
Execution
Higher
Lower
Operation when an interrupt is generated is explained below.
■If an interrupt cause occurs when interrupt is disabled (DI)
The interrupt that was generated is stored, and the stored interrupt program is executed the moment that the status changes
to interrupt enabled. An interrupt is stored only once even if the same interrupt is generated multiple times. Note, however,
that all interrupts cause are discarded when interrupt disable is specified by the IMASK and SIMASK instructions.
■When an interrupt cause is generated by a PAUSE status
The interrupt program is executed the moment that the CPU module changes to the RUN status and the status changes to
interrupt enabled. An interrupt is stored only once when the same interrupt is generated multiple times before the CPU
module changes to the RUN status.
1
■When multiple interrupts are generated at the same time while in an interrupt enabled status
Interrupt programs are executed in order starting from program having the highest priority. Interrupt programs also run in order
of priority rank when multiple interrupt programs having the same priority are generated simultaneously.
■When an interrupt is generated during standby while executing constant scan
The interrupt program for that interrupt is executed.
■When another interrupt is generated during execution of the interrupt program
If an interrupt such as a fixed scan execution type program (including an interrupt which triggers the event execution type
program) is triggered while an interrupt program is being executed, the program operates in accordance with the interrupt
priority.
1 PROGRAM EXECUTION
1.5 Program Type
31
■If an interrupt cause with the same or a lower priority occurs while the interrupt program is
I0
Time
Main routine program
I0 interrupt program
I50 interrupt program
I80 interrupt program
I100 interrupt program
I100 I80 I50 I100 I80 I50
The second interruption cause and later causes
that occur during the execution of an interruption
are not memorized.
After the interruption being
executed is completed, the
interruptions are executed
from I0, which has higher
priority level. I50, which
has higher priority rank, is
executed ahead of I80,
which has the same
priority.
I80 is executed.
(I50 is not executed for
the second time.)
I100 is executed.
(I80 is not executed for
the second time.)
Higher
Lower
Priority
rank
I31
Time
Main routine program
Higher
Lower
I31 interrupt program
*
* The priority is the same.
I29 interrupt program
*
I28 interrupt program
*
I28 I29I28
When "Execution Count
Takes Priority" is set
When "Precede Fixed
Scan" is set
B
A
I29
TO A
TO B
The second and following interruption causes,
which occur while an interruption is executed,
operate according to the setting of the fixed scan
execution mode.
After the interruption being
executed is completed,
I29, which has higher
priority, is executed.
The second
interruption is
not executed.
The second
interruption
is executed.
The second
interruption is
executed.
Priority
rank
being executed
• For I0 to I23 and I50 to I177
The occurred interrupt cause is memorized, and the interrupt program corresponding to the factor will be executed after the
running interrupt program finishes. Even if the same interrupt factor occurs multiple times, it will be memorized only once.
• For I28 to I31
The interrupt cause that occured is memorized, and the interrupt program corresponding to the cause will be executed after
the running interrupt program finishes. If the same interrupt cause occurs multiple times, it will be memorized once but
operation at the second and later occurrences depends on setting of the fixed scan execution mode. (Page 23 Fixed scan
execution mode)
When "Execution Count Takes Priority" is enabled, the interrupt program corresponding to the memorized interrupt causes will
be executed after the running interrupt program finishes. When "Precede Fixed Scan" is enabled, the second and later
occurrences will not be memorized.
32
1 PROGRAM EXECUTION
1.5 Program Type
■If the same interrupt cause occurs while the interrupt program is being executed
Window
Displayed items
I0
Time
Main routine program
I0 interrupt program
I0I0
The second and following interrupt causes, which
occur while an interruption executed, are not saved.
After the interruption being executed is completed,
the first interrupt program is executed.
I31
Time
Main routine program
I31 interrupt program
I31I31
When "Execution Count
Takes Priority" is set
When "Precede Fixed Scan" is set
The second and following interruption causes, which occur while an interruption
is executed, operate according to the setting of the fixed scan execution mode.
The second interruption
is not executed.
The second interruption is executed.
• For I0 to I23 and I50 to I177
The interrupt cause that occured is memorized, and the interrupt program corresponding to the cause will be executed after
the running interrupt program finishes. Even if the same interrupt cause occurs multiple times, it will be memorized only once.
• For I28 to I31
The interrupt cause is memorized, and the interrupt program corresponding to the cause will be executed after the running
interrupt program finishes. If the same interrupt factor occurs multiple times, it will be memorized once but operation at the
second and later occurrences depends on setting of the fixed scan execution mode. (Page 23 Fixed scan execution
mode)
When "Execution Count Takes Priority" is enabled, the interrupt program corresponding to the memorized interrupt cause will
be executed after the running interrupt program finishes. When "Precede Fixed Scan" is enabled, the second and later
occurrences will not be memorized.
1
Setting the interrupt cycle
Set the interrupt cycle of interrupts I28 to I31 using the internal timer of the interrupt pointer.
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
1 PROGRAM EXECUTION
1.5 Program Type
33
Processing at startup of interrupt program
Processing is as follows when an interrupt program is started up.
• Purge/restore of index registers (Z, LZ)
■Purge/restore of index registers (Z, LZ)
When an interrupt program is started up, the values of the index registers (Z, LZ) in the currently executing program are
purged, and those values are handed over to the interrupt program. Then, when an interrupt program is terminated, the
purged values are restored to the currently executing program.
Precautions
The precautions for interrupt programs are explained below.
■Restrictions in programming
• The PLS/PLF instructions execute OFF processing at the scan following instruction execution. ON devices remain ON until
the interrupt program runs again and the instruction is executed.
• Only a routine timer can be used in an interrupt program. Timers (T, ST) cannot be used.
■Splitting of data
Processing may be interrupted during instruction execution and an interrupt programs can be executed. Accordingly, splitting
of data might occur if the same devices are used by both the interrupt program and the program that is aborted by the
interrupt. Implement the following preventive measure.
• Set instructions that will result in inconsistencies if interrupted to "interrupt disabled" using the DI instruction.
• When using bit data, ensure that the same bit data is not used by both the interrupt program and the program that is
aborted by the interrupt.
■Interrupt precision is not improved
If interrupt precision is not improved, this might be remedied by implementing the following:
• Give higher priority to the interrupt that needs higher precision.
• Use an interrupt pointer with high interrupt priority order.
• Recheck the section of interruption disabled.
34
1 PROGRAM EXECUTION
1.5 Program Type
2PROCESSING OF OPERATIONS ACCORDING
TO CPU MODULE OPERATION STATUS
The CPU module has three operation statuses as follows:
• RUN status
• STOP status
• Paused
Processing of operations on the CPU module in each status is explained below.
Processing of operations in RUN status
In the RUN mode, operations in the sequence program are executed repeatedly in order step 0END (FEND)
instructionstep 0.
■Output when CPU module enters RUN mode
Operation results are output after the sequence program is executed for the duration of one scan.
The device memory other than the output (Y) holds the state immediately before the RUN state. However, if device initial
value is set up, this initial value is set.
■Processing time until start of operation
The processing time from the CPU module switching from STOPRUN up to start of execution of operations in the sequence
program fluctuates according to the system configuration and parameter settings. (Normally, this time is within one second.)
Processing of operations in STOP status
In the STOP status, execution of operations in the sequence program is stopped by the RUN/STOP/RESET switch or a
remote stop. The CPU module also enters the STOP status when a stop error occurs.
2
■Output when CPU module enters STOP status
When the CPU module enters the STOP status, all output points (Y) turn OFF. For device memory other than outputs (Y),
non-latch devices are cleared and latch devices are held.
However, when SM8033 is on and CPU module switches RUNSTOP, it is possible to hold an output state and the current
value of a device.
Processing of operations in paused status
In a paused status, execution of operations in the sequence program is stopped after one scan execution but with outputs and
device memory states held, by a remote pause.
2 PROCESSING OF OPERATIONS ACCORDING TO CPU MODULE OPERATION STATUS
35
Processing of operations by the CPU module during switch operations
Processing of operations by the CPU module is as follows according to the RUN or STOP mode.
RUN/STOP statusProcessing of operations by CPU module
Processing of operations
in sequence program
RUNSTOPThe program is executed up to
the END instruction and then
stops.
STOPRUNProgram execution starts from
step 0.
The CPU module performs the following processing regardless of RUN or STOP status or paused status.
• Refreshing of input/output modules
• Automatic refreshing of intelligent function modules
• Self-diagnostic processing
• Device/label access service processing
• Setting of values to special relays/special registers (set timing: when END processing is executed)
For this reason, the following operations can be performed even in the STOP status or paused status:
• Monitoring of I/O or test operations by the engineering tool
• Reading/writing from external device using SLMP
• N:N Network
• MODBUS RTU slave
External outputDevice memory
Other than YY
All output points turn OFF.Latch devices are held, and
non-latch devices are cleared.
Operation results are output
after the PLC is run for the
duration of one scan.
The states of device memories
immediately before the CPU
module entered the RUN mode
are held.
Note, however, that when
device initial values are set, the
device initial values are set.
All output points turn OFF.
Operation results are output
after the PLC is run for the
duration of one scan.
36
2 PROCESSING OF OPERATIONS ACCORDING TO CPU MODULE OPERATION STATUS
3CPU MODULE MEMORY CONFIGURATION
3.1Memory Configuration
CPU module memory is explained below.
Memory configuration
The configuration of CPU module memory is explained below.
Memory typeApplication
CPU built-in memoryData memoryThe following files are stored in this memory:
• Program files, FB files
• Restored information files
• Parameter files
• Files that contain device comments, etc.
Device/label memoryData areas for internal devices/labels, etc. are located in this memory.
SD memory cardThis is for storing files that contain device comments, etc. and folders and files that are created
by SD memory card functions.
Data memory
The following files are stored in data memory.
CategoryFile typeMax. number of filesStorage area sizeRemarks
ProgramProgram file321 Mbytes
FB files16 (Up to 15 for user)
Restored informationRestored information files481 Mbytes
ParametersParameter files common to system11 Mbytes
Device/label memory (standard)96 KbytesR, W, SW, labels, and latch labels can be placed in this memory in variable lengths.
R and W can be backed up in the event of a power interruption only when the optional battery
is installed. Also, latch label capacity can be increased when the battery is installed.
Device/label memory (fast)24 KbytesBit devices, T, ST, C, LC, D, Z, LZ, labels, and latch labels can be placed in this memory in
variable lengths.
For saving device/label memory25 KbytesThis memory is for saving latch devices and devices in fast area that require a latch in the
event of a power interruption.
3 CPU MODULE MEMORY CONFIGURATION
3.1 Memory Configuration
37
SD memory card
The following files are stored in SD memory card.
CategoryFile typeMax. number of filesStorage area sizeRemarks
ProgramProgram file321 Mbytes
FB files16 (Up to 15 for user)
Restored informationRestored information files481 Mbytes
ParametersParameter files common to system11 Mbytes
Built-in positioning functionExecutes positioning operation of up to 4 axes by using the
PWM output functionExecutes a PWM output by using the transistor output of the CPU
Analog input functionTwo analog inputs and one analog output are built in the FX5U CPU
Analog output function
Detects an error in the hardware and program of the CPU module by
monitoring the scan time.
the system operates such as the date of the error history.
Writes the part of a program edited on the ladder editor using the
engineering tool to the CPU module in units of ladder blocks. Edited
contents spanning multiple portions can be written to the CPU
module at once.
another cause is running, stops the program if its priority is lower
than that of the new interrupt, and runs the higher-priority program
whenever its execution condition is satisfied.
externally while the RUN/STOP/RESET switch of the CPU module is
in RUN status.
STOP status.
the program) to the devices.
the power is turned ON etc.
Makes the SD memory card unavailable without turning OFF the
power even when the function accessing the SD memory card is
executed.
destination memory judged automatically by the CPU module when
the power is turned ON or is reset.
service processing executed by END processing, with parameter.
system of the FX5 from illegal access by a third party such as theft,
alteration, accidental operation and unauthorized execution.
interruption, timer interruption, high-speed counter interruption, etc.
by using the input of the CPU module.
transistor output of the CPU module.
module.
module so that voltage input/voltage output can be performed.
MELSOFT products and GOTs, and socket communication.
MC protocol, inverter communication function and non-protocol
communication.
The cautions at the time of repeatedly performing online change
When online change is performed repeatedly, RUN writing may not be able to be carried out due to insufficient memory in the
CPU module. Please set the CPU module to STOP and write the program.
The operation when a pulse type instruction is included in the range of an online ladder
block change
The operation when a pulse related instruction is included in the range of an online ladder block change is as follows.
Pulse type instructionDescription
Rising instruction (PLS and P
instructions)
Falling instruction (PLF and F
instructions)
When a rising instruction exists within the range to be changed, the rising instruction will not be executed if the
execution condition (OFF to ON) is fulfilled at completion of online program change.
When a falling instruction exists within the range to be changed, the falling instruction will not be executed even if the
execution condition (ON to OFF) is fulfilled at completion of online program change.
7
■Rising instruction
When a rising instruction exists within the range to be changed, the rising instruction will not be executed if the execution
condition (OFF to ON) is fulfilled at completion of online program change.
(1) The rising instruction will not be executed even if the execution condition is
OFF to ON.
7 ONLINE CHANGE
7.1 Online Ladder Block Change
51
■Falling instruction
Online change completion
END
1 scan
ENDEND00 0
OFF→OFF
ON
OFF
OFF
OFF
OFF
ON
ON
ON
ON→
OFF
Status of X0
X0
M0
X0
M0
(1)
[ PLF M0 ]
X0
A
A
(2)
When a falling instruction exists within the range to be changed, the falling instruction will not be executed even if the
execution condition (ON to OFF) is fulfilled at completion of online program change.
(1) The falling instruction will not be executed even if the execution condition is
OFF to OFF.
(2) If online program change and transition of ON to OFF occur simultaneously,
the falling instruction will not be executed.
52
7 ONLINE CHANGE
7.1 Online Ladder Block Change
8INTERRUPT FUNCTION
• When the multiple interruption function is enabled
I10 interrupt program
I0 interrupt program
Main routine program
Time
(1)
• When not set (at default)
During interruption execution
During interruption stop
I10 interrupt program
I0 interrupt program
Main routine program
Time
(2)
[Priority]
• I10: High
• I0: Low
Interruption occurred
Program stops
Program restarts
This chapter describes the interrupt function.
8.1Multiple Interrupt Function
When an interrupt occurs while an interrupt program triggered by another cause is running, stops the program if its priority is
lower than that of the new interrupt, and runs the higher-priority program whenever its execution condition is satisfied.
(1) A high-priority interrupt is executed by interrupting a low-priority interrupt.
(2) Even if a high-priority interrupt occurs, it enters the waiting status until the executing interrupt is completed.
Interrupt priority
If the interrupt priority of a program for which its execution condition has been satisfied is higher than that of the running
program, the programs are executed in accordance with their interrupt priority. If the interrupt priority of the new program is the
same or lower, it enters the waiting status until the running program finishes.
8
8 INTERRUPT FUNCTION
8.1 Multiple Interrupt Function
53
Interrupt priority setting
Operating procedure
Displayed items
The interrupt priority (1 to 3) of interruptions from modules can be changed.
Multiple InterruptSets whether or not to enable multiple interrupt.• Disable
Interrupt PriorityDetailed SettingSets the priority of the interrupt pointers I0 to I31.1 to 3
*1 The lower the numerical value, the higher the interrupt priority.
1. Set Multiple Interrupt to "Enable" on the "Interrupt
Settings" window, and click "Detailed Setting".
2. Change the priority of each interrupt pointer.
Disable
• Enable
*1
2
Disabling/enabling interrupts with a specified or lower priority
Interrupts with a priority equal or lower than that specified by the DI or EI instruction can be disabled or enabled even when
multiple interrupts are present.
For details, refer to MELSEC iQ-F FX5 Programming Manual (Instructions, Standard Functions/Function Blocks).
Disabled interrupt priorities and the current interrupt priority can be checked in SD758 (Interrupt disabling for
each priority setting value) and SD757 (Current interrupt priority) respectively.
54
8 INTERRUPT FUNCTION
8.1 Multiple Interrupt Function
9PID CONTROL FUNCTION
CPU module
Target value (SV)
Measured value (PV)
Controlled object
Output value (MV)
PID instruction
ΔMV=KP{(EVn-EVn-1)+
EVn=PVnf-SV
Dn=
MVn=ΣΔMV
TS
TI
TD
TS+KD•TD
KD•TD
TS+KD•TD
EVn+Dn}
(-2PVnf-1+PVnf+PVnf-2)+•Dn-1
ΔMV=KP{(EVn-EVn-1)+
EVn=SV-PVnf
Dn=
MVn=ΣΔMV
TS
TI
TD
TS+KD•TD
KD•TD
TS+KD•TD
EVn+Dn}
(2PVnf-1-PVnf-PVnf-2)+
•Dn-1
9.1Outline of Function
PID control is performed by PID control instruction. The PID instruction requires the system to calculate the output (MV) value
from the measured (PV) value. Through combining the P (proportional) action, I (integral) action, and D (derivative) action the
target (SV) value can be obtained.
• Alarm output function
The alarm function can be set for input variation (measured value) or output variation (value).
• Setting limit values
The upper limit and lower limit can be set for the output value.
• Auto-tuning function
The proportional gain (KP), integral time (TI) and differential time (TD) can be set automatically for both the limit cycle method
and step response method.
• Operation method of the PID instruction
Both PID speed type operation and measured value differential type operation are executed.
9
9.2Basic Operation Expressions in PID Instruction
The PID instruction executes using the speed type or measured value differential type operation expression. According to the
contents of (s3)+1, bit 0 (operation setting (ACT)) specified by (s3) in the PID control, either forward operation or backward
operation is executed. Each value required in the operation is specified by a corresponding parameter (s3) or later.
Basic operation expression for PID control
Operation
setting (ACT)
(s3+1: b0)
Forward operation
(OFF)
Backward operation
(ON)
Operation expressionThe meaning of the signs
EVn: Deviation in sampling at this time
EVn-1: Deviation in previous cycle
SV: Target value
PVnf: Measured value in sampling at this time
(after filter)
PVnf-1: Measured value in previous cycle
(after filter)
PVnf-2: Measured value in two cycles before
(after filter)
MV: Output variation
MVn: Operation quantity at this time
Dn: Differential term at this time
Dn-1: Differential term in previous cycle
TS: Sampling cycle
KP: Proportional gain
TI: Integral constant
TD: Differential constant
KD: Differential gain
9 PID CONTROL FUNCTION
9.1 Outline of Function
55
Expression for calculating the measured value (after the filter) in sampling at this time
Setting data
Processing details
(s1) (s2) (s3) (d)
ENENO
ds1
s2
s3
Command input
Target value (SV)
Measured value (PV)
Parameters
Output value (MV)
PID(s1)(s2)(s3)(d)
(PVnf)
The value "PVnf" is obtained from the following expression based on the read measured value.
Measured value after filter: PVnf = PVn+L (PVnf-1-PVn)
PVn:Measured value in sampling at this time
L:Filter coefficient
PVnf-1:Measured value in previous cycle (after filter)
9.3How to Use PID Instruction
This instruction executes PID control which changes the output value according to the input variation.
For details on the PID instruction, refer to the following manual.
MELSEC iQ-F FX5 Programming Manual (Instructions, Standard Functions/Function Blocks)
Ladder diagramStructured text
ENO:=PID(EN,s1,s2,s3,d);
FBD/LD
■Descriptions, ranges, and data types
OperandDescriptionRangeData typeData type (label)
(s1)Device number storing the target value (SV)-32768 to +3276716-bit signed binaryANY16
(s2)Device number storing the measured value (PV)-32768 to +3276716-bit signed binaryANY16
(s3)Device number storing PID parameters1 to 3276716-bit signed binaryANY16
(d)Device number storing the output value (MV)-32768 to +3276716-bit signed binaryANY16
■Applicable devices
Operand BitWordDouble word Indirect
X, Y, M, L, SM,
F, B, SB, S
(s1)*1
(s2)
(s3)
(d)
*1 Only D, SD, R can be used.
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
*1
*1
*1
U\G ZLCLZK, H E$
specification
• Once the target value (s1), measured value (s2) and PID parameters (s3) to (s3)+6 are set and the program is executed,
the operation result (MV) is transferred to the output value (d) at every sampling time. The sampling time is specified by
(s3)
ConstantOthers
56
9 PID CONTROL FUNCTION
9.3 How to Use PID Instruction
■Set item
Set itemDescriptionOccupie
d points
(s1)Target value
(SV)
(s2)Measured value
(PV)
(s3)ParameterPID control
(d)Output value
(MV)
The target value (SV) is set.
The PID instruction does not change the settings.
[Caution on using the auto-tuning (limit cycle method)]
If the target value for auto-tuning is different from the target value in the PID control, it is necessary to set a value
to which a bias value is added, and then store the actual target value when the auto-tuning flag turns OFF.
This is the input value of the PID operation.
It is necessary to read a normal measurement data before the execution of the PID operation for the measurement
value of PID (PV). If an input value from an analog input is used for the PID operation, use caution to its conversion
time.
25 devices are occupied from the head device specified in (s3)
Auto-tuning: In the limit cycle (1)
29 devices are occupied from the head device specified in (s3)
Auto-tuning: In the step response method (2)
25 devices are occupied from the head device specified in (s3)
PID control (normal processing)
The user sets the initial output value before driving the instruction. After that, the operation result is stored.
Auto-tuning: In the limit cycle
The Upper Limit Value (ULV) or Lower Limit Value (LLV) value is automatically output during auto-tuning. The
specified MV value is output when auto-tuning is finished.
Auto-tuning: In the step response method
The user sets the step output value before driving the instruction. The MV value is not changed by PID instruction
during auto-tuning.
1 point
1 point
25 points
29 points
25 points
1 point
9
■Precautions for using the PID instruction
For the precautions for using the PID instruction, refer to the following manual.
MELSEC iQ-F FX5 Programming Manual (Instructions, Standard Functions/Function Blocks)
9.4Relationship Between Parameter Setting and
Auto-Tuning
When auto-tuning is not executed (parameter setting)
It is necessary to write the set value of the parameters (s3) to (s3)+6 using MOV instruction in advance, etc. before starting
the PID operation when auto-tuning is not executed. If a device with a latch setting is specified, the setting data is retained
even after the power to the CPU module is turned OFF; therefore, the writing at the 2nd power ON is not required.
For details on parameters, refer to Page 58 Parameter.
When auto-tuning is executed
The proportional gain ((s3)+3), integral time ((s3)+4) and differential time ((s3)+6) are important constants for executing the
auto-tuning function described later and for optimizing the PID control. These constants can be set automatically.
For a detailed description of auto-tuning, refer to Page 68 Auto-Tuning.
9 PID CONTROL FUNCTION
9.4 Relationship Between Parameter Setting and Auto-Tuning
57
9.5Parameter
Set itemDescription/Setting rangeRemarks
(s3)Sampling time (TS)1 to 32767 (ms)It cannot be shorter than operation cycle of the PLC.
(s3)+1Operation setting
(ACT)
(s3)+2Input filter constant ()0 to 99 [%]When "0" is set, input filter is not provided.
(s3)+3Proportional gain (KP)1 to 32767 [%]
(s3)+4Integral time (TI)0 to 32767 [100 ms]When "0" is set, it is handled as "" (no integration).
(s3)+5Differential gain (KD)0 to 100 [%]When "0" is set, differential gain is not provided.
(s3)+6Differential time (TD)0 to 32767 [10 ms]When "0" is set, differential is not executed.
(s3)+7 to
(s3)+19
(s3)+20
(s3)+21
(s3)+22
(s3)+23
(s3)+24
(s3)+25PV value threshold
(s3)+26Output value upper limit (ULV) Set maximum value (ULV) of output value (MV).
(s3)+27Output value lower limit (LLV)Set minimum value (LLV) of output value (MV).
(s3)+28Wait setting from end of tuning
These devices are occupied for internal processing of PID operation. Do not change data.
*1
Input variation (incremental)
alarm set value
*1
Input variation (decremental)
alarm set value
*1
Output variation (incremental)
alarm set value
Output upper limit set value-32768 to +32767It is valid when operation setting (ACT) (b2 of (s3)+1) is
*1
Output variation (decremental)
alarm set value
Output lower limit set value-32768 to +32767It is valid when operation setting (ACT) (b2 of (s3)+1) is
*1
Alarm outputb00: Input variation (incremental) is not exceeded.
(hysteresis) width (SHPV)
cycle to start of PID control
(KW)
*1 (s3)+20 to +24 become used only if b1, b2, or b5 are set to "1" to determine the action (ACT) (s3) of +1.
b00: Forward operation
1: Backward operation
b10: Input variation alarm is invalid
1: Input variation alarm is valid
b20: Output variation alarm is invalid
1: Output variation alarm is valid
b3Not used
b40: Auto-tuning is not executed.
1: Auto-tuning is executed
b50: Upper and lower limits of output value are not
valid
1: Upper and lower limits of output value are valid
b60: Step response method
1: Limit cycle method
b7 to b15 Not used
0 to 32767It is valid when operation setting (ACT) (b1 of (s3)+1) is
0 to 32767It is valid when operation setting (ACT) (b1 of (s3)+1) is
0 to 32767It is valid when operation setting (ACT) (b2 of (s3)+1) is
0 to 32767It is valid when operation setting (ACT) (b2 of (s3)+1) is
1: Input variation (incremental) is exceeded.
b10: Input variation (decremental) is not exceeded.
1: Input variation (decremental) is exceeded.
b20: Output variation (incremental) is not exceeded.
1: Output variation (incremental) is exceeded.
b30: Output variation (decremental) is not exceeded.
1: Output variation (decremental) is exceeded.
Set it according to measured value (PV)
fluctuation.
-50 to +32717 [%]
Operation direction
Do not set b2 and b5 to ON at the same time.
Do not set b2 and b5 to ON at the same time.
Select auto-tuning mode.
"1".
"1".
"1" and (ACT) (b5 of (s3)+1) is "0".
"0" and (ACT) (b5 of (s3)+1) is "1".
"1" and (ACT) (b5 of (s3)+1) is "0".
"0" and (ACT) (b5 of (s3)+1) is "1".
It is valid when operation setting (ACT) (b1 or b2 of
(s3)+1) is "1".
The setting below is required when the limit cycle method
is used (when the operation setting (ACT) b6 is set to
ON).
58
9 PID CONTROL FUNCTION
9.5 Parameter
9.6Details of Parameters
Temperature
Measured value (PV)
Time
Target value (SV)
This chapter describes the details of parameters.
Sampling time (s3)
Set the cycle time (ms) for the PID operation. Setting range: 1 to 32767 (ms)
• In PID control and auto-tuning (Limit cycle method)
Set the sampling time longer than the operation cycle of the PLC.
• In auto-tuning (Step response method)
Set the sampling time to 1000 ms (= 1 second) or more.
Maximum error
The maximum error of the sampling time (TS) is from "- (one operation cycle+1 ms)" to "+ (one operation cycle)."
• When the sampling time (TS) is a small value
Fluctuation of the maximum error described above may cause a problem. In such a case, execute the PID instruction in the
constant scan mode, or program it in a timer interrupt routine.
• When the sampling time (TS) is shorter than one operation cycle of the PLC
A PID operation error occurs, however when PID operation is executed, the sampling time (TS) is equal to the operation cycle
of the PLC. In such a case, use the PID instruction in a timer interrupt, and clear (s3)+7 just before executing the PID
instruction.
9
Operation setting (S3)+1
Forward operation/backward operation
Set the PID control direction (forward or backward).
• During auto-tuning for the limit cycle method
It is necessary to set the PID control direction (forward or backward) for auto-tuning.
• During auto-tuning for the step response method
The PID control direction (forward or backward) is not required, as the direction is automatically set when auto-tuning is
complete.
Operation setting (S3)+1: b0Operation
Forward
operation
(b0=OFF)
Backward
operation
(b0=ON)
As the measured value (PV) becomes larger than the target value
(SV), the output (MV) increases.
For example, cooling is a forward operation.
As the measured value (PV) becomes smaller than the target value
(SV), the output (MV) increases.
For example, heating is a backward operation.
Temperature
Target value (SV)
Measured value (PV)
Time
9 PID CONTROL FUNCTION
9.6 Details of Parameters
59
• Relationship between the forward/backward operation and the output (MV), measured value (PV) and target value (SV)
Measured value (PV)
Output value (MV)
Target value (SV)
Backward
operation
Forward
operation
The relationship is as follows.
Alarm setting (for input variation and output variation)
If b1 and b2 in (s3) +1 are turned ON, the input variation and the output variation can be checked. The check is executed by
following the values of (s3) +20 to (s3) +23.
These parameters can be set in (s3)+24.
For details on operation of alarm output, refer to Page 67 Alarm output (s3)+24.
• Input variation
If the input variation alarm is used, turn ON b1 in (s3) +1, and specify the input variation alarm set value.
Set itemSetting description/Setting range
Operation setting(s3)+1: b1Input variation alarmON: Used
OFF: Not used
Input variation alarm set value(s3)+20Input variation (incremental) alarm set value0 to 32767
(s3)+21Input variation (decremental) alarm set value0 to 32767
• Output variation
If the output variation alarm is used, turn ON b1 in (s3) +1, and specify the output variation alarm set value.
When this function is used, make sure to turn OFF b5 of (s3) +1.
Set itemSetting description/Setting range
Operation setting(s3)+1: b2Output variation alarmON: Used
OFF: Not used
(s3)+1: b5Output value upper/lower limit settingMake sure to set it to OFF
Output variation alarm set value(s3)+22Output variation (incremental) alarm set value0 to 32767
(s3)+23Output variation (decremental) alarm set value 0 to 32767
Variation means (Previous value) - (Current value)
60
9 PID CONTROL FUNCTION
9.6 Details of Parameters
Upper and lower limits for output value
Output value upper limit
Output value lower limit
Time
(s3)+22
Output value (MV)
(s3)+23
These values are not output
These values are not output
When the upper limit and
lower limit of output value are set
When the upper limit and
lower limit of output value are not set
Measured value (PV) processed
by input filter
Input amplitude
Pulse input by noiseActual measured value (PV)
Time
Time
Time
Time
Input amplitude processed
by input filter
When the upper and lower limit settings of the output value are valid, the output value is as shown in the chart. The upper limit
and lower limit of the output value can moderate the increase of the integral item in the PID control.
When using the upper limit and lower limit of the output value, make sure to set (s3)+1, b2 to OFF.
Set itemSetting description/Setting range
Operation setting(s3)+1: b2Output variation alarmMake sure to set it to OFF
(s3)+1: b5Output value upper/lower limit settingON: Used
OFF: Not used
9
Input filter constant (s3)+2
The input filter () is a software filter to reduce the fluctuation of the measured value (PV) caused by noise. By setting this time
constant of the filter according to the control target characteristics and noise level, the effect of noise can be reduced. If the
input filter value is too small, the filter effect is small. If the input filter value is too large, the input response is bad. Setting
range: 0 to 99 (%).
Because the input filter () acts on the target value (SV), all of the proportional operation, integral operation and differential
operation are affected.
9 PID CONTROL FUNCTION
9.6 Details of Parameters
61
Proportional gain (s3)+3
Ex.
Ex.
Output value (MV)
Temperature
Remaining deviation
Proportional gain
KP3>KP2>KP1
Proportional gain
Time
Time
Target value (SV)
Measured value (PV)
KP3>KP2>KP1
KP3KP2KP1
KP3KP2KP1
Output value (MV)
Temperature
Remaining deviation
Proportional gain
KP3>KP2>KP1
Proportional gain
Time
Time
Target value (SV)
Measured value (PV)
KP3>KP2>KP1
KP3KP2KP1
KP3KP2KP1
During the proportional operation, the output (MV) increases in proportion to the deviation (difference between the target
value (SV) and the measured value (PV)). This deviation is called proportional gain (Kp), and expressed in the following
relational expression:
Output (MV) = Proportional gain (KP) Deviation (EV)
The reciprocal of the proportional gain (KP) is called proportional band. As the proportional gain (KP) is larger (as shown in
the example below), the motion to let the measured value (PV) be nearer to the target value (SV) becomes stronger.
Setting range: 1 to 32767 (%)
Proportional operation (P operation) in backward operation (heating)
Proportional operation (P operation) in forward operation (cooling)
62
9 PID CONTROL FUNCTION
9.6 Details of Parameters
Integral time (s3)+4
Ex.
Ex.
Output value (MV)
Temperature
Integral time (TI)
0<TI3<TI2<TI1
Integral time (TI)
Time
Time
Output in PI operation
Output in proportional operation
Measured value in PI operation
Measured value in proportional operation
0<TI3<TI2<TI1
TI3
TI2
TI1
TI3
TI2
TI1
Target
value
(SV)
Output value (MV)
Temperature
Integral time (TI)
0<TI3<TI2<TI1
Integral time (TI)
Time
Time
Output in PI operation
Output in proportional operation
Measured value in PI operation
Measured value in proportional operation
0<TI3<TI2<TI1
TI3
TI2
TI1
TI3
TI2
TI1
Target
value
(SV)
During the integral operation, the time after deviation is generated until the integral operation output becomes the proportional
operation output. This is called integral time and is expressed as "TI".
As TI becomes smaller, the integral operation becomes stronger.
Setting range: 0 to 32767 ( 100 ms). "0" is handled as "" (no integration).
PI operation in backward operation (heating)
9
PI operation in forward operation (cooling)
9 PID CONTROL FUNCTION
9.6 Details of Parameters
63
The integral operation changes the output so that the continuously generated deviation is eliminated. As a
Deviation
Output (MV)
Deviation (EV)
Time
Time
Output of "proportional operation + integral operation"
Output of integral operation
Output of proportional operation
Proportional gain (KP) × Deviation (E)
Integral time (TI)
result, the remaining deviation generated in the proportional operation can be eliminated.
Differential gain (s3)+5
The filter is applied to the output at the differential operation. Setting range: 0 to 100 (%)
Only the differential operation is affected by the differential gain (KD).
• When the differential gain (KD) is small, the output is immediately given with regard to changes in the measured value (PV)
caused by disturbance, etc.
• When the differential gain (KD) is large, the output is given after a long time with respect to changes in the measured value
(PV) caused by disturbance, etc.
Set the differential gain (KD) to "0", and then adjust the operation using the input filter ().
If the output response is too close to the disturbance, increase the differential gain (KD).
64
9 PID CONTROL FUNCTION
9.6 Details of Parameters
Differential time (s3)+6
Ex.
Output value (MV)
Deviation
Disturbance
Deviation (EV)
Time
Time
TD3>TD2>TD1
TD3 (PID operation)
TD1 (PID operation)
TD2 (PID operation)
TD3 (PID operation)
TD1 (PID operation)
TD2 (PID operation)
Output value (MV)
Temperature
Target value (SV)
Time
Time
TD3>TD2>TD1
TD3>TD2>TD1
TD3 (PID operation)
PI operation (without differential operation)
PI operation (without differential operation)
TD2 (PID operation)
TD3 (PID operation)
Changes in output caused by disturbance
Changes caused by disturbance
TD1 (PID operation)
TD1 (PID operation)
TD2 (PID operation)
Use the differential time (TD) to respond sensitively to fluctuations in the measured value (PV) caused by disturbance, etc.
and to minimize the fluctuations. Setting range: 0 to 32767 ( 10 ms)
• When the differential time (TD) is large, it prevent large fluctuation in the control target caused by disturbance, etc.
• It is not always necessary to use the differential time (when disturbance is small, for example).
PID operation in backward operation (heating)
9
9 PID CONTROL FUNCTION
9.6 Details of Parameters
65
Ex.
PID operation in forward operation (cooling)
Output value (MV)
Temperature
Target value (SV)
Time
Time
TD3>TD2>TD1
TD3>TD2>TD1
TD3 (PID operation)
PI operation (without differential operation)
PI operation (without differential operation)
TD2 (PID operation)
TD3 (PID operation)
Changes in output caused by disturbance
Changes caused by disturbance
TD1 (PID operation)
TD1 (PID operation)
TD2 (PID operation)
66
9 PID CONTROL FUNCTION
9.6 Details of Parameters
Alarm output (s3)+24
Measured value (PV)
Variation
Time
Sampling time (TS)
ON
ON
Alarm output
(s3)+24: b1
(s3)+24: b0
Output value (MV)
Variation
Variation
Time
Sampling time (TS)
ON
ON
Alarm output
(s3)+24: b3
(s3)+24: b2
If the input variation and the output variation specified with (s3) +20 to (s3) +23 are exceeded, each bit of (s3) +24 turns ON
as a warning output.
ItemDescriptionRemarks
Alarm output(s3)+24: b0OFF: Input variation (incremental) is not exceeded.
ON: Input variation (incremental) is exceeded.
(s3)+24: b1OFF: Input variation (incremental) is not exceeded.
ON: Input variation (incremental) is exceeded.
(s3)+24: b2OFF: Output variation (incremental) is not exceeded.
ON: Output variation (incremental) is exceeded.
(s3)+24: b3OFF: Output variation (incremental) is not exceeded.
ON: Output variation (incremental) is exceeded.
It is valid when operation setting (ACT) (b1 of
(s3)+1) is "1".
It is valid when operation setting (ACT) (b2 of
(s3)+1) is "1".
In the case of input variation
9
In the case of output variation
9 PID CONTROL FUNCTION
9.6 Details of Parameters
67
9.7Auto-Tuning
on
1-
33×on
on
1-
20×on
This chapter describes the auto-tuning function of PID instruction.
The auto-tuning function will automatically set the important constants, such as the proportional gain and the integral time, to
ensure optimum PID control. There are two auto-tuning methods: limit cycle method and step response method.
Limit Cycle Method
For acquiring satisfactory control results in PID control, it is necessary to obtain the optimal value of each constant
(parameter) suitable to the control target. This paragraph explains the limit cycle method to obtain the amplitude (a) and
vibration cycle (, on) of the input value, and then calculate the proportional gain (KP), integral time (TI) and differential time
(TD) based on the expressions shown in the table below.
What is the limit cycle method? Changes in the input value in two-position control (in which the output Upper Limit Value (ULV)
and output Lower Limit Value (LLV) are switched according to the deviation) are measured, and then three constants in the
PID control are obtained.
How to obtain three constants in PID control (Reference)
■Operation characteristics and three constants
Control typeProportional gain (KP) [%]Integral time (TI) [ 100 ms]Differential time (TD) [ 10 ms]
Only proportional control (P
operation)
PI control (PI operation)
1
(ULV-LLV)×100
a
0.9
(ULV-LLV)×100
a
PID control (PID operation)
1.2
(ULV-LLV)×100
a
50×on
on
1-
68
9 PID CONTROL FUNCTION
9.7 Auto-Tuning
■Operation characteristics (in an example of backward operation)
Input value
Time (s)
Output value (MV)
a
on
SV (target value)
SV+SHPV
SV-SHPV
0
1
2
W
Time
SHPV: PV Input threshold (hysteresis)
Output lower
limit value (LLV)
Output upper
limit value (ULV)
During the "W" period after the tuning cycle is finished, the output value is held at the output Lower Limit Value (LLV), and
then normal PID control is started. The value "W" can be obtained by the expression "W = (50 + KW)/100 ( - on)", and
the wait setting parameter "KW" can be set in the parameter (s3)+28. (Setting range: Kw = -50 to +32717 [%]) (When the
abnormal range is specified, "W" is handled as "0")
9
9 PID CONTROL FUNCTION
9.7 Auto-Tuning
69
Parameters set in limit cycle method
The parameters specified in the limit cycle method are shown below.
ParameterSetting position
Proportional gain (KP)(s3)+3
Integral time (TI)(s3)+4
Differential time (TD)(s3)+6
Auto-tuning procedure
1. Set forward or backward operation
Set the operation direction flag (b0) in the operation setting parameter (ACT) (s3)+1.
2. Select the auto-tuning method (limit cycle method)
Set the auto-tuning method to ON (b6) in the operation setting parameter (ACT) (s3)+1. (When bit 6 is set to OFF, the step
response method is selected.)
3. Set the auto-tuning execution flag to ON
Set the auto-tuning execution flag to ON (b4) in the operation setting parameter (ACT) (s3)+1.
4. Set the input filter
Set the input filter in the operation setting parameter (ACT) (s3)+2.
5. Set the sampling time
Set the sampling time (s3).
6. Set the Upper Limit Value (ULV)
Set the Upper Limit Value (ULV) of the output value (MV) in the operation setting parameter (ACT) (s3)+26.
7. Set the Lower Limit Value (LLV)
Set the Lower Limit Value (LLV) of the output value (MV) in the operation setting parameter (ACT) (s3)+27.
8. Set the threshold (hysteresis) (SHPV)
Set the threshold (hysteresis) width (SHPV) in the operation setting parameter (ACT) (s3)+25.
9. Set the target value (SV)
Set the target value (SV) in PID instruction.
10. Set the PID instruction command input ON to start auto-tuning
Auto-tuning is executed according to the measured value (PV).
When auto-tuning is completed, the auto-tuning flag (b4 and b6) turns OFF in the operation setting parameter (ACT) (s3)+1.
70
9 PID CONTROL FUNCTION
9.7 Auto-Tuning
Step Response Method
RL
1
Output value
(MV)
××100
RL
0.9
Output value
(MV)
××100
RL
1.2
Output value
(MV)
××100
0 %
100 %
Output value (MV)
Output value (MV)
Time
Dead time (L) [s]
Time (s)
1 (s)
Maximum ramp (R)
Input value variation
For acquiring satisfactory control results during PID control, it is necessary to obtain the optimal value of each constant
(parameter) suitable for the control target. This paragraph explains the step response method to obtain three constants in the
PID control (proportional gain (KP), integral time (TI) and differential time (TD)).
In this method, by giving stepped output from 0 to 100 % to the control system, three constants in the PID control are obtained
from the operation characteristics (maximum ramp (R) and dead time (L)) and the input value variation. The stepped output
may be obtained from 0 to 75% or from 0 to 50 %.
How to obtain three constants in PID control (Reference)
■Operation characteristics and three constants
Control typeProportional gain (KP) [%]Integral time (TI) [ 100 ms]Differential time (TD) [ 10 ms]
Only proportional control (P
operation)
PI control (PI operation)33L
PID control (PID operation)20L50L
■Operation characteristics
9
Parameters set in step response method
The parameters specified in the step response method are shown below.
Remote ResetSet whether or not to enable remote RESET.• Disable
• Enable
Disable
11 REMOTE OPERATION
11.3 Remote RESET
89
Method of execution of remote RESET
Precautions
The following are the methods of execution of remote RESET.
Engineering tool method
Refer to the following.
GX Works3 Operating Manual
Method using external devices that use SLMP
Refer to the following.
MELSEC iQ-F FX5 User's Manual (SLMP)
When executing remote RESET, the settings that allow the remote reset of the CPU parameter must be
written to CPU module beforehand. In the case that they are not set, remote RESET will not be possible.
■Remote RESET in RUN status
When the CPU module is in RUN status, it cannot be reset by remote RESET. Change the CPU module to STOP status by
operations like remote STOP and then execute remote RESET.
■State after completion of the reset process
When the reset process is completed on a CPU module on which remote RESET was executed, the CPU module will change
to an operation status set by the RUN/STOP/RESET switch. Setting the RUN/STOP/RESET switch to the STOP position, will
change the status to STOP and setting the switch to the RUN position will change the status to RUN.
• Note that if a remote RESET is executed when the CPU module has stopped due to an error, the CPU
module will change to an operation status set by the RUN/STOP/RESET switch, by reset process
completion.
• If status of CPU module does not change even after executing remote RESET by engineering tool, check
the remote reset settings in the CPU parameter. If it is not set, even after completion of the remote process
of engineering tool, reset process of the CPU module will not be carried out.
■When an error occurs due to noise
When there an error due to noise, exercise caution as there is a possibility that PLC cannot be reset by remote RESET. When
reset by remote RESET is not possible, either execute reset by RUN/STOP/RESET switch or once again start up the power of
CPU module.
90
11 REMOTE OPERATION
11.3 Remote RESET
11.4Relationship Between Remote Operation and CPU
Module
Relationship between remote operation and RUN/STOP status of the CPU module
The following table shows operation status of the CPU module by the combination of remote operation and RUN/STOP status
of the CPU module.
Switch RUN/STOP statusRemote operation
*1
RUN
RUNRUNSTOPPAUSEOperation not possible
STOPSTOPSTOPSTOPRESET
*1 When executing by the RUN contact, setting of RUN contact is required in the CPU parameter.
*2 Remote reset setting is required in the CPU parameter.
*3 When a CPU module is changed to STOP status by a remote operation, remote reset is possible.
*4 Includes even the cases where CPU module has stopped due to an error.
STOPPAUSERESET
*2
*3
*4
11
11 REMOTE OPERATION
11.4 Relationship Between Remote Operation and CPU Module
91
12 DEVICE/LABEL MEMORY AREA SETTING
(1)
(2)
The capacity of each area in device/label memory can be specified.
(1) The capacity of each area can be changed. (Page 94 Device/Label Memory Area Setting)
(2) The number of points of user devices can be changed. (Page 95 Device Setting)
12.1Default Capacity of Each Area
The default capacity of each area is as follows.
ItemCapacity
Device (high speed) Area Capacity12 K words
Device (standard) Area Capacity35 K words
Label Area Capacity12 K words
Latch Label Area Capacity1 K words
92
12 DEVICE/LABEL MEMORY AREA SETTING
12.1 Default Capacity of Each Area
12.2The Setting Range of the Capacity of Each Area
The setting range of the capacity of each area on the device/label memory is as follows.
ItemSetting range of capacity of each area
Device (high speed) Area Capacity0 to 12 K words
Device (standard) Area Capacity0 to 48 K words
Label Area Capacity0 to 48 K words
Latch Label Area Capacity0 to 48 K words
Restriction of a label/latch label area capacity
■When device area setting using by label/latch label is standard area
Label Area Capacity + Latch Label Area Capacity + Device (standard) Area Capacity 48 K Word (1 K word unit)
■When device area setting using by label/latch label is high speed area
Label Area Capacity + Latch Label Area Capacity + Device (high speed) Area Capacity 12 K Word (1 K word unit)
■When FB is used
In using FB, it consumes the margin area for a label addition in addition to the label defined for FB.
The following capacities are consumed per FB instance.
Label area: 48 words
Latch area: 16 words
12
12 DEVICE/LABEL MEMORY AREA SETTING
12.2 The Setting Range of the Capacity of Each Area
93
12.3Device/Label Memory Area Setting
Operating procedure
Displayed items
The capacity of each data area allocated within the device/label memory can be changed.
1. In "Option Battery Setting", select whether or not to use
a option battery.
2. In "Device/Label Memory Area Capacity Setting", set
the capacity of each area.
ItemDescriptionSetting rangeDefault
Option Battery SettingSet when using option battery.
The points which can be held can be increased by
this setup.
The latch device of standard area can be held with a
battery.
The latch area of latch label can be changed to
battery latch area from standard latch area
(nonvolatile memory).
Device/Label
Memory Area
Capacity Setting
Device AreaDevice (high speed)
Area Capacity
Device (standard)
Area Capacity
Label AreaLabel/Latch Label
Use Device Area
Setting
Label Area Capacity Sets the capacity of the label area to be used for
Latch Label Area
Capacity
Set the capacity of device (high speed) area.Page 93 The
Set the capacity of device (standard) area.Page 93 The
Select the used device area of label and latch label
from standard area and high speed area.
When device (high speed) area + label area + latch
label area is 12 K word or less, it is possible to set
label area/label latch area in high-speed area.
non-latched labels.
Sets the capacity of the latch label area to be used
for latch-type labels.
• Not Mounted
• Mounted
Setting Range of the
Capacity of Each Area
Setting Range of the
Capacity of Each Area
• Standard Area
• HighSpeed Area
Page 93 The
Setting Range of the
Capacity of Each Area
Page 93 The
Setting Range of the
Capacity of Each Area
Not Mounted
12 K word
35 K word
Standard
Area
12 K word
1 K word
94
12.3 Device/Label Memory Area Setting
12 DEVICE/LABEL MEMORY AREA SETTING
High-speed area: Area which can be accessed at high speed. Latch is always held by nonvolatile memory.
Standard area: Area which can be held when option battery is used. In addition, about a latched type label,
when a latch area is set as a standard latch area, latch type label is held by nonvolatile memory.
12.4Device Setting
Window
The number of points of each user device can be changed.
Memory Area Setting" "Device/Label Memory Area Detailed Setting" "Device (high speed) Setting/Device
(standard) Setting"
"Device (high speed) Setting" details window
12
"Device (standard) Setting" details window
Specify each item so that the total number of points for each user device does not exceed the capacity of the
device area. (Page 94 Device/Label Memory Area Setting)
12 DEVICE/LABEL MEMORY AREA SETTING
12.4 Device Setting
95
Range of use of device points
The following table lists the range of use of device points to be set in the device setting.
Device (high speed) Setting
TypeDevice nameSymbolRange of useIncrement of setting
BitInputXX0 to X1777
BitOutputYY0 to Y1777
BitInternal relayMM0 to M3276764 points
BitLink relayBB0 to B7FFF64 points
BitLink special relaySBSB0 to SB7FFF64 points
BitAnnunciatorFF0 to F3276764 points
BitStep relaySS0 to S4095
WordTimerTT0 to T102316 points
WordRetentive timerSTST0 to ST102316 points
WordCounterCC0 to C102316 points
WordLong counterLCLC0 to LC102316 points
WordData registerDD0 to D79994 points
BitLatch relayLL0 to L3276764 points
Device (standard) Setting
TypeDevice nameSymbolRange of useIncrement of setting
WordFile registersRR0 to R327674 points
WordLink registerWW0 to W7FFF4 points
WordLink special registerSWSW0 to SW7FFF4 points
96
12 DEVICE/LABEL MEMORY AREA SETTING
12.4 Device Setting
13 INITIAL DEVICE VALUE SETTING
SM402
MOV H100 D0
MOV H2020 D0
(1)
CPU module
CPU module
Device initial value settingDevice memory
Directly sets the initial value of a device used by the program (i.e., not via the program).
(1) If initial device values are used, a program to set data to the devices becomes unnecessary.
13
13.1Setting Initial Device Values
This section describes the settings required to use initial device values.
Setting initial device values
This section describes the settings of initial device values.
Setting procedure
The procedure for using initial device values is as follows.
1. First, the user must create an initial device value file. To set initial values to a global device, create an initial device value
file (with any name) which sets these initial values, and specify the range of the values.
2. On the device memory, set up initial device value data within the range specified in the initial device value file.
GX Works3 Operating Manual
3. In the "Device Memory Register Diversion", select the device memory which was set up in Step 2. Setting "Device
Memory Register Diversion" enables data set up on the device memory to be used as initial device values for the device
which is specified in the initial device value file.
GX Works3 Operating Manual
4. Configure CPU parameters. (Page 98 Initial value setting)
5. Write the set initial device value file and the CPU parameters to the CPU module.
GX Works3 Operating Manual
6. The data in the specified initial device value file is automatically set to the specified device when the CPU module is
powered off and on, reset, or the status changes from STOP to RUN.