(Read these precautions before using this product.)
Before using this product, please read this manual and the relevant manuals carefully and pay full attention
to safety to handle the product correctly.
In this manual, the safety precautions are classified into two levels: " WARNING" and " CAUTION".
WARNING
CAUTION
Under some circumstances, failure to observe the precautions given under " CAUTION" may lead to
serious consequences.
Make sure that the end users read this manual and then keep the manual in a safe place for future
reference.
Indicates that incorrect handling may cause hazardous conditions,
resulting in death or severe injury.
Indicates that incorrect handling may cause hazardous conditions,
resulting in minor or moderate injury or property damage.
A-1
[Design Precautions]
WARNING
Configure safety circuits external to the programmable controller to ensure that the entire system
operates safely even when a fault occurs in the external power supply or the programmable
controller. Failure to do so may result in an accident due to an incorrect output or malfunction.
(1) Configure external safety circuits, such as an emergency stop circuit, protection circuit, and
protective interlock circuit for forward/reverse operation or upper/lower limit positioning.
(2) The programmable controller stops its operation upon detection of the following status, and the
output status of the system will be as shown below.
Status
Overcurrent or overvoltage protection of the power supply module
is activated.
The CPU module detects an error such as a watchdog timer error
by the self-diagnostic function.
All outputs are turned off.
All outputs are held or turned off according to
the parameter setting.
Output
All outputs may turn on when an error occurs in the part, such as I/O control part, where the CPU
module cannot detect any error. To ensure safety operation in such a case, provide a safety
mechanism or a fail-safe circuit external to the programmable controller. For a fail-safe circuit
example, refer to Chapter 10 LOADING AND INSTALLATION in the QCPU User's Manual
(Hardware Design, Maintenance and Inspection).
(3) Outputs may remain on or off due to a failure of an output module relay or transistor. Configure
an external circuit for monitoring output signals that could cause a serious accident.
A-2
[Design Precautions]
WARNING
In an output module, when a load current exceeding the rated current 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.
Configure a circuit so that the programmable controller is turned on first and then the external power
supply.
If the external power supply is turned on first, an accident may occur due to an incorrect output or
malfunction.
For the operating status of each station after a communication failure, refer to relevant manuals for
the network.
Incorrect output or malfunction due to a communication failure may result in an accident.
When changing data of the running programmable controller from a peripheral connected to the
CPU module or from a personal computer connected to an intelligent function module, configure an
interlock circuit in the sequence program to ensure that the entire system will always operate safely.
For program modification and operating status change, read relevant manuals carefully and ensure
the safety before operation.
Especially, in the case of a control from an external device to a remote programmable controller,
immediate action cannot be taken for a problem on the programmable controller due to a
communication failure.
To prevent this, configure an interlock circuit in the sequence program, and determine corrective
actions to be taken between the external device and CPU module in case of a communication
failure.
CAUTION
Do not install the control lines or communication cables together with the main circuit lines or power
cables.
Keep a distance of 100mm (3.94 inches) or more between them.
Failure to do so may result in malfunction due to noise.
When a device such as a lamp, heater, or solenoid valve is controlled through an output module, a
large current (approximately ten times greater than normal) may flow when the output is turned from
off to on.
Take measures such as replacing the module with one having a sufficient current rating.
A-3
[Installation Precautions]
CAUTION
Use the programmable controller in an environment that meets the general specifications in the
QCPU User's Manual (Hardware Design, Maintenance and Inspection).
Failure to do so may result in electric shock, fire, malfunction, or damage to or deterioration of the
product.
To mount the module, while pressing the module mounting lever located in the lower part of the
module, fully insert the module fixing projection(s) into the hole(s) in the base unit and press the
module until it snaps into place.
Incorrect mounting may cause malfunction, failure or drop of the module.
When using the programmable controller in an environment of frequent vibrations, fix the module
with a screw.
Tighten the screw within the specified torque range.
Undertightening can cause drop of the screw, short circuit or malfunction.
Overtightening can damage the screw and/or module, resulting in drop, short circuit, or malfunction.
When using an extension cable, connect it to the extension cable connector of the base unit securely.
Check the connection for looseness.
Poor contact may cause incorrect input or output.
When using a memory card, fully insert it into the memory card slot.
Check that it is inserted completely.
Poor contact may cause malfunction.
Shut off the external power supply for the system in all phases before mounting or removing the
module. Failure to do so may result in damage to the product.
A module can be replaced online (while power is on) on any MELSECNET/H remote I/O station or in
the system where a CPU module supporting the online module change function is used.
Note that there are restrictions on the modules that can be replaced online, and each module has its
predetermined replacement procedure.
For details, refer to the relevant sections in the QCPU User's Manual (Hardware Design,
Maintenance and Inspection) and in the manual for the corresponding module.
Do not directly touch any conductive part of the module.
Doing so can cause malfunction or failure of the module.
When using a Motion CPU module and modules designed for motion control, check that the
combinations of these modules are correct before applying power.
The modules may be damaged if the combination is incorrect.
For details, refer to the user's manual for the Motion CPU module.
A-4
[Wiring Precautions]
WARNING
Shut off the external power supply for the system in all phases before wiring.
Failure to do so may result in electric shock or damage to the product.
After wiring, attach the included terminal cover to the module before turning it on for operation.
Failure to do so may result in electric shock.
CAUTION
Ground the FG and LG terminals to the protective ground conductor dedicated to the programmable
controller.
Failure to do so may result in electric shock or malfunction.
Use applicable solderless terminals and tighten them within the specified torque range. If any spade
solderless terminal is used, it may be disconnected when the terminal screw comes loose, resulting
in failure.
Check the rated voltage and terminal layout before wiring to the module, and connect the cables
correctly.
Connecting a power supply with a different voltage rating or incorrect wiring may cause a fire or
failure.
Connectors for external connection must be crimped or pressed with the tool specified by the
manufacturer, or must be correctly soldered.
Incomplete connections could result in short circuit, fire, or malfunction.
Tighten the terminal screw within the specified torque range.
Undertightening can cause short circuit, fire, or malfunction.
Overtightening can damage the screw and/or module, resulting in drop, short circuit, or malfunction.
Prevent foreign matter such as dust or wire chips from entering the module.
Such foreign matter can cause a fire, failure, or malfunction.
A-5
[Wiring Precautions]
WARNING
A protective film is attached to the top of the module to prevent foreign matter, such as wire chips,
from entering the module during wiring.
Do not remove the film during wiring.
Remove it for heat dissipation before system operation.
Mitsubishi programmable controllers must be installed in control panels.
Connect the main power supply to the power supply module in the control panel through a relay
terminal block.
Wiring and replacement of a power supply module must be performed by maintenance personnel
who is familiar with protection against electric shock. (For wiring methods, refer to the QCPU User's
Manual (Hardware Design, Maintenance and Inspection)).
[Startup and Maintenance Precautions]
WARNING
Do not touch any terminal while power is on.
Doing so will cause electric shock.
Correctly connect the battery connector.
Do not charge, disassemble, heat, short-circuit, solder, or throw the battery into the fire.
Doing so will cause the battery to produce heat, explode, or ignite, resulting in injury and fire.
Shut off the external power supply for the system in all phases before cleaning the module or
retightening the terminal screws or module fixing screws.
Failure to do so may result in electric shock.
Undertightening the terminal screws can cause short circuit or malfunction.
Overtightening can damage the screw and/or module, resulting in drop, short circuit, or malfunction.
A-6
[Startup and Maintenance Precautions]
CAUTION
Before performing online operations (especially, program modification, forced output, and operation
status change) for the running CPU module from the peripheral connected, read relevant manuals
carefully and ensure the safety.
Improper operation may damage machines or cause accidents.
Do not disassemble or modify the modules.
Doing so may cause failure, malfunction, injury, or a fire.
Use any radio communication device such as a cellular phone or PHS (Personal Handy-phone
System) more than 25cm (9.85 inches) away in all directions from the programmable controller.
Failure to do so may cause malfunction.
Shut off the external power supply for the system in all phases before mounting or removing the
module. Failure to do so may cause the module to fail or malfunction.
A module can be replaced online (while power is on) on any MELSECNET/H remote I/O station or in
the system where a CPU module supporting the online module change function is used.
Note that there are restrictions on the modules that can be replaced online, and each module has its
predetermined replacement procedure.
For details, refer to the relevant sections in the QCPU User's Manual (Hardware Design,
Maintenance and Inspection) and in the manual for the corresponding module.
After the first use of the product, do not mount/remove the module to/from the base unit, and the
terminal block to/from the module more than 50 times (IEC 61131-2 compliant) respectively.
Exceeding the limit of 50 times may cause malfunction.
Do not drop or apply shock to the battery to be installed in the module.
Doing so may damage the battery, causing the battery fluid to leak inside the battery.
If the battery is dropped or any shock is applied to it, dispose of it without using.
Before handling the module, touch a grounded metal object to discharge the static electricity from
the human body.
Failure to do so may cause the module to fail or malfunction.
A-7
[Disposal Precautions]
CAUTION
When disposing of this product, treat it as industrial waste.
When disposing of batteries, separate them from other wastes according to the local regulations.
(For details of the battery directive in EU member states, refer to the QCPU User's Manual
(Hardware Design, Maintenance and Inspection).)
[Transportation Precautions]
CAUTION
When transporting lithium batteries, follow the transportation regulations.
(For details of the regulated models, refer to the QCPU User's Manual (Hardware Design,
Maintenance and Inspection).)
A-8
CONDITIONS OF USE FOR THE PRODUCT
(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;
i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major
or serious accident; and
ii) where the backup and fail-safe function are systematically or automatically provided outside of
the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general
industries.
MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT
LIMITED TO ANY AND ALL RESPONSIBILITY OR LIABILITY BASED ON CONTRACT,
WARRANTY, TORT, PRODUCT LIABILITY) FOR ANY INJURY OR DEATH TO PERSONS OR
LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE OPERATED OR
USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS,
OR WARNING CONTAINED IN MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY
MANUALS, TECHNICAL BULLETINS AND GUIDELINES FOR the PRODUCT.
("Prohibited Application")
Prohibited Applications include, but not limited to, the use of the PRODUCT in;
• Nuclear Power Plants and any other power plants operated by Power companies, and/or any
other cases in which the public could be affected if any problem or fault occurs in the PRODUCT.
• Railway companies or Public service purposes, and/or any other cases in which establishment of
a special quality assurance system is required by the Purchaser or End User.
• Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as
Elevator and Escalator, Incineration and Fuel devices, Vehicles, Manned transportation,
Equipment for Recreation and Amusement, and Safety devices, handling of Nuclear or
Hazardous Materials or Chemicals, Mining and Drilling, and/or other applications where there is a
significant risk of injury to the public or property.
Notwithstanding the above, restrictions Mitsubishi may in its sole discretion, authorize use of the
PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT
is limited only for the specific applications agreed to by Mitsubishi and provided further that no
special quality assurance or fail-safe, redundant or other safety features which exceed the general
specifications of the PRODUCTs are required. For details, please contact the Mitsubishi
representative in your region.
A-9
REVISIONS
*The manual number is given on the bottom left of the back cover.
Print dateManual numberRevision
Dec., 2008SH(NA)-080807ENG-A
Mar., 2009SH(NA)-080807ENG-B Revision because of function addition to Built-in Ethernet port QCPU (first five
Jul., 2009SH(NA)-080807ENG-C Revision because of function addition to the Universal model QCPU (first five
Nov., 2009SH(NA)-080807ENG-D Partial correction
First edition
digits of the serial number is "11012" or later)
Partial correction
SAFETY PRECAUTIONS, INTRODUCTION, MANUALS, MANUAL PAGE
ORGANIZATION, GENERIC TERMS AND ABBREVIATIONS, Section 1.3, 1.6,
digits of the serial number is "11043" or later)
Partial correction
Section 5.1.1, 5.1.5, 5.3.3, 6.1, 6.18, 6.21.2, 6.28, 8.1, 9.2.10, 9.6.1, 10.1.3, 12.2,
Appendix 1, Appendix 2, Appendix 3.1.2, Appendix 3.2
Addition
Section 6.31, 6.32
SAFETY PRECAUTIONS, Section 4.2.2, 9.6.1, 9.7.4, Appendix 3.1.1,
Appendix 3.1.2
Addition
CONDITIONS OF USE FOR THE PRODUCT
Japanese manual version SH-080802-D
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur
as a result of using the contents noted in this manual.
C
2008 MITSUBISHI ELECTRIC CORPORATION
A-10
INTRODUCTION
This manual describes the memory maps, functions, programs, I/O number assignment, and devices of the Universal model
QCPU.
Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the
functions and performance of the Q series programmable controller to handle the product correctly.
Relevant CPU module
CPU moduleModel
Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU, Q03UD(E)CPU,
Universal model QCPU
Remark
This manual does not describe the specifications of the power supply modules, base units, extension cables, memory
cards, and batteries.
For details, refer to the following.
QCPU User's Manual (Hardware Design, Maintenance and Inspection)
To understand the main specifications, functions, and usage of the CPU module, refer to the basic manuals.
Read other manuals as well when using a different type of CPU module and its functions.
Order each manual as needed, referring to the following list.
:Basic manual, :Other CPU module manuals
Manual name
< Manual number (model code) >
User's manual
QCPU User's Manual (Hardware Design,
Maintenance and Inspection)
< SH-080483ENG (13JR73) >
QnUCPU User's Manual (Function
Explanation, Program Fundamentals)
< SH-080807ENG (13JZ27) >
QCPU User's Manual (Multiple CPU System)
< SH-080485ENG (13JR75) >
QnUCPU User's Manual (Communication via
Built-in Ethernet Port)
QCPU (Q Mode) / QnACPU Programming
Manual (PID Control Instructions)
< SH-080040 (13JF59) >
Specifications of the hardware (CPU modules, power
supply modules, base units, extension cables, and
memory cards), system maintenance and inspection,
troubleshooting, and error codes
Functions, methods, and devices for programming
Information on multiple CPU system configuration
(system configuration, I/O numbers, communication
between CPU modules, and communication with the
input/output modules and intelligent function
modules)
Functions for the communication via built-in Ethernet
port of the CPU module
How to use sequence instructions, basic instructions,
and application instructions
System configuration, performance specifications,
functions, programming, debugging, and error codes
for SFC (MELSAP3) programs
Programming methods, specifications, and functions
for SFC (MELSAP-L) programs
Programming methods using structured languages
Dedicated instructions for PID control
DescriptionManual type
A-18
Other relevant manuals
Manual nameDescription
CC-Link IE Controller Network Reference
Manual
< SH-080668ENG (13JV16) >
Q Corresponding MELSECNET/H Network
System Reference Manual (PLC to PLC
network)
< SH-080049 (13JF92) >
Q Corresponding MELSECNET/H Network
System Reference Manual (Remote I/O
network)
Q Corresponding Serial Communication
Module User's Manual (Basic)
< SH-080006 (13JL86) >
Q Corresponding Serial Communication
Module User's Manual (Application)
< SH-080007 (13JL87) >
Q Corresponding MELSEC Communication
Protocol Reference Manual
< SH-080008 (13JF89) >
GX Developer Version 8 Operating Manual
< SH-080373E (13JU41) >
Specifications, procedures and settings before system operation, parameter
setting, programming, and troubleshooting of the CC-Link IE controller
network module
Specifications, procedures and settings before system operation, parameter
setting, programming, and troubleshooting of a MELSECNET/H network
system (PLC to PLC network)
Specifications, procedures and settings before system operation, parameter
setting, programming, and troubleshooting of a MELSECNET/H network
system (remote I/O network)
Specifications, procedures for data communication with external devices,
line connection (open/close), fixed buffer communication, random access
buffer communication, and troubleshooting of the Ethernet module
E-mail function, programmable controller CPU status monitoring function,
communication via MELSECNET/H or MELSECNET/10, communication
using the data link instructions, and file transfer function (FTP server) of the
Ethernet module
System configuration, performance specifications, functions, handling,
wiring, and troubleshooting of the QJ61BT11N
Overview, system configuration, specifications, procedures before
operation, basic data communication method with external devices,
maintenance and inspection, and troubleshooting for using the serial
communication module
Special functions (specifications, usage, and settings and data
communication method with external devices of the serial communication
module
Communication method using the MC protocol, which reads/writes data to/
from the CPU module via the serial communication module or Ethernet
module
Operating methods of GX Developer, such as programming and printout
A-19
MANUAL PAGE ORGANIZATION
The detailed explanation of "Note . " is
provided under the corresponding
"Note . " at the bottom of the page.
ReferenceNote (icon)
The section in this manual or
another relevant manual that can
be referred to is shown with .
Chapter
The chapter of the current page can be
easily identified by this indication on the
right side.
Note (detailed explanation)
The detailed note corresponding to each icon
is described.
Section title
The section number and title of the current
page can be easily identified.
* cining page components, and differs from an actual page.
Icons
Universal model QCPU
Universal
Icons indicate that specifications described on the page
contain some precautions.
Description
In addition, this manual uses the following types of explanations.
In addition to description of the page, notes or functions that require special attention are described here.
Remark
The reference related to the page or useful information are described here.
A-20
GENERIC TERMS AND ABBREVIATIONS
Unless otherwise specified, this manual uses the following generic terms and abbreviations.
* indicates a part of the model or version.
(Example): Q33B, Q35B, Q38B, Q312B
Generic term/abbreviationDescription
Series
Q seriesAbbreviation for Mitsubishi MELSEC-Q series programmable controller
CPU module type
CPU moduleGeneric term for the Universal model QCPU
Universal model QCPU
Built-in Ethernet port QCPU
Motion CPU
PC CPU module
C Controller module
CPU module model
QnUD(H)CPU
Base unit type
Base unit
Main base unit
Extension base unit
Slim type main base unit
Redundant power main base unit
Redundant power extension base
unit
Multiple CPU high speed main base
unit
Base unit model
Q3 B
Q3 SB
Q3 RB
Q3 DB
Q5 B
Q6 B
Q6 RB
Q3 B
Generic term for the Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU,
Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q10UDHCPU, Q13UDHCPU,
Q20UDHCPU, Q26UDHCPU, Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU,
Q10UDEHCPU, Q13UDEHCPU, Q20UDEHCPU, and Q26UDEHCPU
Generic term for the Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU,
Q10UDEHCPU, Q13UDEHCPU, Q20UDEHCPU, and Q26UDEHCPU
Generic term for Mitsubishi motion controllers, Q172CPUN, Q173CPUN,
Q172HCPU, Q173HCPU, Q172CPUN-T, Q173CPUN-T, Q172HCPU-T,
Q173HCPU-T, Q172DCPU, and Q173DCPU
Generic term for MELSEC-Q series PC CPU module, PPC-CPU852(MS)-512,
manufactured by CONTEC Co., Ltd.
Generic term for the Q06CCPU-V-H01, Q06CCPU-V, Q06CCPU-V-B, and
Q12DCCPU-V C Controller modules
Generic term for the Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q10UDHCPU,
Q13UDHCPU, Q20UDHCPU, and Q26UDHCPU
Generic term for the main base unit, extension base unit, slim type main base
unit, redundant power main base unit, redundant power extension base unit, and
multiple CPU high speed main base unit
Generic term for the Q3 B, Q3 SB, Q3 RB, and Q3 DB
Generic term for the Q5 B, Q6 B, and Q6 RB
Another name for the Q3 SB
Another name for the Q3 RB
Another name for the Q6 RB
Another name for the Q3 DB
Generic term for the Q33B, Q35B, Q38B, and Q312B main base units
Generic term for the Q32SB, Q33SB, and Q35SB slim type main base units
Another name for the Q38RB main base unit for redundant power supply system
Generic term for the Q38DB and Q312DB multiple CPU high speed main base
units
Generic term for the Q52B and Q55B extension base units
Generic term for the Q63B, Q65B, Q68B, and Q612B extension base units
Another name for the Q68RB extension base unit for redundant power supply
system
A-21
Generic term/abbreviationDescription
Power supply module
Power supply module
Q series power supply module
Slim type power supply moduleAbbreviation for the Q61SP slim type power supply module
Redundant power supply module
Network
MELSECNET/HAbbreviation for the MELSECNET/H network system
EthernetAbbreviation for the Ethernet network system
CC-LinkAbbreviation for the Control & Communication Link
Memory card
Memory cardGeneric term for the SRAM card, Flash card, and ATA card
SRAM card
Flash cardGeneric term for the Q2MEM-2MBF and Q2MEM-4MBF Flash cards
ATA car d
Others
Generic term for the Q series power supply module, slim type power supply
module, and redundant power supply module
Generic term for the Q61P-A1, Q61P-A2, Q61P, Q61P-D, Q62P, Q63P, Q64P, and
Q64PN power supply modules
Generic term for the Q63RP and Q64RP power supply modules for redundant
power supply
Generic term for the Q2MEM-1MBS, Q2MEM-2MBS, Q3MEM-4MBS, and
Q3MEM-8MBS SRAM cards
Generic term for the Q2MEM-8MBA, Q2MEM-16MBA, and Q2MEM-32MBA ATA
cards
GX Developer
Extension cable
Battery
GOT
Product name for SW D5C-GPPW-E GPP function software package compatible
with the Q series
Generic term for the QC05B, QC06B, QC12B, QC30B, QC50B, and QC100B
extension cables
Generic term for the Q6BAT, Q7BAT, and Q8BAT CPU module batteries,
Q2MEM-BAT SRAM card battery, and Q3MEM-BAT SRAM card battery
Generic term for Mitsubishi Graphic Operation Terminal, GOT-A*** series, GOT-F***
series, and GOT1000 series
A-22
CHAPTER1 OVERVIEW
CHAPTER1 OVERVIEW
The CPU module performs sequence control by executing programs.
This chapter describes the processing order in the CPU module, locations where the created programs are stored, and
devices and instructions useful for programming.
1.1 Processing Order in the CPU Module
The CPU module performs processing in the following order.
Power-on or reset
Initial processing
Refresh processing with
input/output modules
1
2
3
4
5
6
7
Program operation processing
Scan time
END processing
Figure 1.1 Processing order in the CPU module
(1) Initial processing ( Section 3.1)
The CPU module performs preprocessing required for program operations.
The preprocessing is performed only once when the module is powered on or reset.
(2) Refresh processing with input and output modules ( Section 3.2)
The CPU module takes on/off data from the input module or intelligent function module and outputs on/off data to
the output module or intelligent function module.
(3) Program operation processing ( Section 3.3)
The CPU module sequentially executes the program stored in the module from the step 0 to the END or FEND
instruction.
8
1.1 Processing Order in the CPU Module
(4) END processing ( Section 3.4)
The CPU module performs refresh processing with network modules or communicates with external devices.
1-1
1.2 Storing and Executing Programs
This section describes where to store and how to execute the programs in the CPU module.
(1) Programming
Programs are created with GX Developer.
For details of program configuration and execution conditions, refer to CHAPTER 2.
(2) Storing programs
Created programs and set parameters are stored in the following memories of the CPU module.
( Section 5.1)
• Program memory
• Standard ROM (parameters only)
• Memory card
(3) Executing programs
The CPU module executes the programs stored in the program memory.
CPU module
Program memory
Parameter
Program
Device comment
Initial device value
The CPU module executes
the programs stored here.
Comments are stored
separately from the program.
Figure 1.2 Executing programs
To execute the programs stored in a memory card, the programs need to be booted to the program memory
( Section 5.1.8) when the CPU module is powered off and then on or reset.
The CPU module executes the programs
booted from a memory card to here.
Program
memory
CPU moduleBoot
ParameterProgram
Memory card
Device
comment
Initial device
value
Figure 1.3 Executing programs stored in a memory card
1-2
CHAPTER1 OVERVIEW
1.3 Structured Programming
The programs to be executed in the CPU module can be structured in the following two ways.
• In one program
• By dividing into multiple files
(1) Structuring in one program
Structured programming is available by creating one program as a collection of three program sections: main
routine program ( Section 2.2.1), subroutine program ( Section 2.2.2), and interrupt program
( Section 2.2.3).
Main routine
program
P1
Subroutine
program 1
CALL P1
FEND
Y10
RET
1
2
3
4
5
6
7
Subroutine
program 2
Interrupt program
Figure 1.4 Structuring in one program
P8
I0
Y11
RET
Y12
IRET
END
8
1.3 Structured Programming
1-3
(2) Structuring by dividing into multiple files
A program is stored in a file.
Changing the file name allows the CPU module to store multiple programs.
Multiple programs can be stored
by changing the file name.
File name: PARAM
ParameterProgramProgram
GX Developer
Figure 1.5 Structuring by dividing into multiple files
Dividing into multiple files according to the processes or functions enables simultaneous programming by two or
more designers. Managing the files separately eases reuse and utilization to other programs.
Structured programming is efficient in this way because only the corresponding file needs to be modified or
debugged in case of change in the specifications.
File name: ABC File name: ABC File name: DEF
Device
comment
CPU module
(a) Dividing into multiple files according to the processes
Program memory/memory card
Program ACarrying in
Manufacturing
Processing contents
are divided according
to the processes.
*1: The processing contents divided according to the processes can further be divided and managed according to the
functions.
*2: The execution order can be set in the Program tab of the PLC parameter dialog box. ( Section 2.3(2)).
Assembly
Carrying out
Figure 1.6 Dividing into multiple files according to the processes
Program B
Program C
Program D
*1
Program A to D will
be executed in the
specified order. *2
1-4
CHAPTER1 OVERVIEW
(b) Dividing into multiple files according to the functions
Program memory/memory card
Initial processing
Main processing
Processing contents
are divided according
to the functions.
*1: The execution order and conditions can be set in the Program tab of the PLC parameter dialog box. ( Section 2.3(2)).
Communication
processing
Error processing
Figure 1.7 Dividing into multiple files according to the functions
Program A
Program B
Program C
Program D
The execution order and
conditions for program
A to D can be set. *1
1
2
3
4
5
6
7
8
1.3 Structured Programming
1-5
1.4 Devices and Instructions Useful for Programming
The CPU module is provided with devices and instructions useful for programming.
This section describes the outline of these devices and instructions.
(1) Various ways of device specification
(a) Using each bit of a word device as a contact or coil
By specifying a bit of a word device, the bit can be used as a contact or coil.
X0
SETD0.5
D0.5
SETY10
Figure 1.8 Specifying a bit of a word device
A bit-specified word device (turns on
(switches to 1) the 5th bit (b5) of D0.)
A bit-specified word device (turns on/off depending
on the on/off (1/0) status of the 5th bit (b5) of D0.)
(b) Easy direct processing in units of one point
Use of the direct access input (DX ) and direct access output (DY ) enables easy direct processing (in units
of one point) in the program. ( Section 3.8.2)
M0 DX10
Direct access input
DY100
On/off data is output to the
output module when the
instruction is executed.
On/off data is input from
the input module when the
instruction is executed.
1-6
Figure 1.9 Direct processing in units of one point
(c) No input pulse conversion required by using a differential contact
Pulse conversion processing for inputs is no longer required with the use of a differential contacts ( and
).
X0
Y100
X1
Differential contact
Y100
Figure 1.10 Use of a differential contact
On at the rising
edge of X0
X0
M0
Y100
X1
PLS
M0
Y100
Loading...
+ 600 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.