Professional Documents
Culture Documents
MitsubishiQ5 Training Manual
MitsubishiQ5 Training Manual
MODEL SCHOOL-Q-BASIC-WIN-E
MODEL 13JW50
CODE
SH(NA)-080617ENG-A(0601)MEE
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN
When exported from Japan, this manual does not require application to the
Ministry of Economy, Trade and Industry for service transaction permission.
When designing the system, always read the relevant manuals and give sufficient consideration to safety.
During the exercise, pay full attention to the following points and handle the product correctly.
[EXERCISE PRECAUTIONS]
WARNING
Do not touch the terminals while the power is on to prevent electric shock.
When opening the safety cover, turn off the power or conduct a sufficient check of safety before
operation.
Caution
Follow the instructor’s direction during the exercise.
Do not remove the module of the demonstration machine or change wirings without permission.
Doing so may cause failures, malfunctions, personal injuries and/or a fire.
When the demonstration machine (X/Y table, etc.) emits abnormal odor/sound, press "Power switch" or
"Emergency switch" to turn off.
This textbook 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 textbook.
CHAPTER 9 MAINTENANCE 9- 1 to 9- 8
This textbook describes the PLC, the program editing methods, the sequence instructions
and the application instructions to help you understand the MELSEC-Q series
programming.
The multiple CPU system is available for the MELSEC-Q series with multiple CPU
modules, but this textbook explains the case in which one CPU module is used.
Refer to the following school textbook for the exercises when the multiple CPU system is
used.
: Q Programming School Textbook (Practice) .............................SH-080045-D or later
1.1 Program
Taking PLC as a control ladder, PLC can be described by an input ladder, output
ladder, and internal sequential operation.
PLC
PB1 X6 T1
Y70
X0 Y74 PL
Y71
LS1 X1 Output relay
Y74
Y72
X2
Electro-
Y73
X3 K30 magnetic
PB2 Y74 X6
Y74 valve
X4 T1 MC
Y75 Magnet
X5 Timer
Sensor Y76 contactor
X6
Contacts for
Input relay external
(virtual coil) outputs
COM COM
(+) (-)
Turns on/off the Activates the Transmits the on/off Activates the
input relay with internal sequential operations of the external loading.
external signal. operation by the output relay.
contact of the input relay.
"Relay", which is also called an electromagnetic relay, is a switch that passes on signals. Also, it is a key component
that makes up a logic ladder.
1) Energizing the coil Excitation Coil off Coil on
• Closes the normally open (all times) (in operation)
(Conducted) Normally
• Opens the normally close open Not conducted Conducted
(Not conducted) Common
Coil
2) De-energizing the coil Normally
Demagnetization close Conducted Not condcuted
A-contact
• Opens the normally open
(Not conducted) B-contact
1-1
Internal Sequential Operation
The signal flow of figure 1.1 internal sequential operation is described below.
1) When the sensor turns on, the coil of input relay X6 is energized.
2) Energizing the coil of input relay X6 conducts the normally open X6 and energizes
the coil of output relay Y74.
(As the timer is not energized at this moment, the normally close remains
conducted.)
3) Once the coil of output relay Y74 is energized, the external connection Y74 is
conducted allowing the magnet contactor (MC) to be turned on.
4) Turning off the sensor demagnetizes the coil of input relay X6 and ceases the
conduction of normally open X6. As self-maintaining the normally open Y74 is
conducted, the coil remains energized. (Self-maintaining operation)
5) When the coil of output relay Y74 is energized (with the normally open Y74
conducted), turning off the sensor (with normally close X6 conducted) energizes
the coil of the timer T1 so that the timer starts measuring the time.
After a lapse of three seconds (K30 indicates 3.0 seconds), the normally open of
the timer becomes conducted and the normally close is brought non conductive.
6) As a result, the coil of output relay Y74 demagnetizes and the load magnet
contactor drops.
The output relay self- maintenance is also released.
Time Chart
A time chart that explains the input/output relays and timer operations is shown below.
Input X6
Output Y74
Timer T1 (Coil)
Timer T1 (Contact)
3 sec.
1-2
The internal sequential operation can be described as a program of PLC. The program
is saved in the program memory as close to the instruction list described below.
Instruction
Step number I/O number
words
X6 T1
0 Y74 0 LD X6
1 OR Y74
Y74 2 ANI T1
3 OUT Y74 Repeat
K30
Y74 X6 4 LD Y74 operation
4 T1 5 ANI X6
6 OUT T1 K30
7 END
(a) Ladder diagram (b) Instruction list (program list)
• The instructions, which contain instruction words and I/O numbers, are added
numbers that represent the order of operations.
Those numbers are called step numbers.
(Instruction words are sometimes referred to as instructions.)
• The number of steps varies depending on the types of instructions or the setting
method for the numbers to be used for the I/O numbers and operations. (The more
complicated the operations become, the more numbers are added to the
instructions.)
• The instructions repeat from "Step number = 0" to "Instruction words end" endlessly.
This is called "repeat operation", "cyclic operation" or "scanning".)
Amount of time required to take once through is called operation cycle (scan time).
• The number of the programming steps from step number = 0 to the END instruction
defines the length or the size of the program.
• The program is stored in the program memory within the CPU. The operation is
performed in one ladder block unit.
One ladder block ranges from the operation START instruction (LD, LDI) to the OUT
instruction (including the DATA instruction).
1-3
1.2 Program Processing Procedure
The operation process is performed serially from the start step of the program memory
left to right then top to bottom (in the order corresponding to 1), 2)... 17)) in ladder
block unit as shown below.
1) 2) 3)
X0 X1
0 Y10
4) 5) 7)
X2 X3
3 Y11
6)
X4
8) 9) 10)
X5 X6
7 Y12
11) 12)
X7
Y13
13) 14)
X8
Y14
1-4
1.3 MELSEC-Q Module Configuration
1-5
(3) Basic configuration of the PLC system
The actual configuration of the PCL is explained below using the building-block
type.
Base Unit
Power supply
Power supply
CPU
Power supply
modules
Q35B Q65B
Power supply
Power supply
modules
Q38B Q68B
Power supply
Power supply
With 12 I/O
CPU
modules
Q312B Q612B
• The main roles of the base unit are; to attach the power supply module, CPU module,
and I/O modules securely, to supply 5VDC power from the power supply module to
the CPU module and I/O modules, and to transmit the control signals to each module.
• Q00JCPU, which is all-in-one power supply base, is available for the basic model
CPU.
1-6
Power Supply Module
Input Output Module model
100V-120V AC 5V DC 6A Q61P-A1
200-240V AC 5V DC 6A Q61P-A2
100V-120V AC 5V DC 3A, 24V DC 0.6A Q62P
24V DC 5V DC 6A Q63P
CPU Module
Maximum number of I/O Program Capacity Basic instruction
CPU type
connected to the PLC (Maximum) processing speed
28 K steps 79ns Q02CPU
28 K steps Q02HCPU
4096 points 60 K steps Q06HCPU
34ns
124 K steps Q12HCPU
256 K steps Q25HCPU
256 points 8 K steps 200ns Q00JCPU
14 K steps 160ns Q00CPU
1024 points
14 K steps 100ns Q01CPU
I/O Module
No. of I/O
8 points 16 points 32 points 64 points
Format
120V AC
240V AC
Input module
Independent contact
output
Triac output
Transistor output (Sink)
Transistor output (Source)
I/O mixed
1-7
Memory Card
QCPU equips a built-in memory as a standard to store the parameters and the
program so that a program can normally execute without a memory card.
The memory cards are required when using the following functions;
Type Description
Can be written/changed within the amount of the memory.
<Example of the usage>
• During boot operation
SRAM card • When using the file register that exceeds 32 K points/128 K points in volume.
• For storing the sampling trace data
• For storing the SFC trace data
• For storing the failure history data
Writes the contents of the program memory or the specified file in one pass.
The newly written data replaces all the original data. Can only be read by using the sequence
program.
Flash card
<Example of the usage>
• During boot operation
• When no change will be made to the data
Can be written/changed within the amount of the program.
Using the file access order (such as FWRITE instruction) in the sequence program, accesses
the PLC user data of the ATA card in the CSV type/binary type.
ATA card
<Example of the usage>
• During boot operation
• When used by PLC user data (general-purpose data)
Memory Card
3
4
according to the size of the program or the
5
STOP RUN
type of the data to be stored.
• The SRAM-type RAM card must install the
RESETL CLR
supplied batteries upon purchase. The SRAM
card data cannot be duplicated unless those
batteries are installed.
• Format the memory card before using it first.
• The Flash card is writable 100,000 times. The
ATA card is writable 1,000,000 times.
1-8
<Reference: QCPU System Configuration>
Drive number 3
Drive number 2
Standard ROM
Drive number 4
• Program memory :Stores the program that is used by QCPU for operation.
The programs stored in the standard ROM or in the memory
card are read into the program memory before execution.
• Standard RAM :Stores the data of the file register and the local device.
• Standard ROM :Stores the data of the parameters and the program when the
QCPU is operated with ROM.
• Memory card (RAM) :Stores the local device, debug data, SFC trace data, and
failure history data as well as the parameters and program.
• Memory card (ROM) :The Flash card stores the parameters, program, and the file
register.
:The ATA card stores the parameters, program, and the PLC
user data (general-purpose file).
1-9
1.4 External I/O Signals and I/O Numbers
0 1 2 3 4 Slot numbers
(Power (CPU)
supply)
(QY)
Base unit
(QX)
Input numbers Output numbers
Y10
PB1 V1
X0
CS1 Y11
X1 V2
CS2
X2
Y12
V3
PB2
X3 · Input numbers are hexadecimal numbers
PB3 Y13 that start with 0. I/O numbers share the
X4 RL same numbers. "X" at the beginning of
LS1 the number represents "Input", and "Y"
X5 Y14 indicates "Output".
GL
LS2
X6 · Maximum number of the QCPU (Q
Y15 mode) I/O number is 4,096.
LS3 MC1
X7
LS4 Y16
X8 MC2
PB4
X9
Y17
PB5 MC3
XA
CS3 COM1
XB
XC
Y18
XD
Y1F
XE
XF COM2
COM
Output module
Input module
1 - 10
(2) I/O numbers of the main base unit
The I/O numbers of the I/O modules that are attached to the main base unit are
assigned as follows. This concept applies both to the I/O modules and to the
intelligent function module.
0 1 2 3 4 5 6 7 8 9 10 11 Slot numbers
Power supply module
00 to 0F
10 to 1F
20 to 2F
30 to 3F
40 to 4F
50 to 5F
60 to 6F
70 to 7F
A0 to AF
B0 to BF
80 to 8F
90 to 9F
CPU
I/O numbers
• The I/O numbers of one slot (one module) is assigned in ascending order in units of 16 points. (0 to FH)
The status that 16-point module is attached to each slot is considered as a standard.
For example, the I/O numbers when 32-point module is attached to the fifth slot is as shown below.
Main base unit
0 1 2 3 4 5 6 7 Slot numbers
Power supply module
10 to 1F
20 to 2F
30 to 3F
40 to 4F
80 to 8F
CPU
• The vacant slot (The slot with no I/O modules installed) is also assigned with the I/O numbers.
For example, if the third slot is vacant, the I/O numbers are assigned as described below. (Default)
The number of assigned point is changeable depending on the setting.
Main base unit
0 1 2 3 4 5 6 7 Slot numbers
Power supply module
10 to 1F
00 to 0F
20 to 2F
40 to 4F
70 to 7F
60 to 6F
50 to 5F
(30 to 3F)
Vacant slot
CPU
• As for the multiple CPU configuration (Two to four CPUs), the I/O numbers are assigned from the slot
next to the one to which a CPU is attached.
1 - 11
(3) I/O numbers of the extension base unit
Connect the extension base unit when the required number of the slots exceeds
the number of the slots of the main base unit.
The I/O numbers are assigned as follows by default.
This concept applies both to the I/O modules and to the intelligent function
module.
0 1 2 3 4 5 6 7 Slot numbers
Power supply module
00 to 0F
10 to 1F
20 to 2F
30 to 3F
40 to 4F
50 to 5F
60 to 6F
70 to 7F
CPU
Extension cable
8 9 10 11 12 13 14 15
Power supply module
80 to 8F
90 to 9F
A0 to AF
B0 to BF
C0 to CF
D0 to DF
E0 to EF
F0 to FF
With one
extension As for the number of the slots, setting the
base units number different from the actual number is
possible. For example, setting the base unit
for 12 slots as for three slots is possible and
Extension base unit (Q65B) vice versa. This is in order to handle the
future extension, and to prevent the gap of
I/O numbers which is likely to happen when
16 17 18 19 20 making the transition from the conventional
system to the new one. For details, refer to
Power supply module
110 to 11F
120 to 12F
130 to 13F
140 to 14F
21 22 23 24 25 26 27 28
Power supply module
150 to 15F
160 to 16F
170 to 17F
180 to 18F
190 to 19F
1A0 to 1AF
1B0 to 1BF
1C0 to 1CF
With three
extension
base units
• The slots of the extension base unit are also assigned in ascending order in units of 16 points.
• The head I/O numbers of the extension bases follow the last number of the main base or the one of the
previous extension base.
• It is possible to assign "0" as the I/O number to the vacant slot or to the area with no slot.
The number of the extension base units that can be extended is as follows;
CPU type Number of stages (Including the ones
connected via GOT bus)
High Performance model 7
Basic model Q00JCPU 2
Q00CPU,Q01CPU 4
1 - 12
1.5 System Configuration and I/O Numbers of Demonstration Machine
*
QCPU QCPU QX QY Q64 Q62
Q61P (One (Two
-A1 42 42P AD DA
station) station) (64 (64 (16 (16
points) points) points) points)
Peripheral device
I/O panel
ON
OFF
1 - 13
MEMO
1 - 14
CHAPTER 2 OPERATING GX DEVELOPER
1) Title bar
2) Menu bar
3) Tool bar
5) Edit screen
6) Status bar
2-1
1) Title bar
Shows the name of the active project.
2) Menu bar
Most frequently used item when operating GX Developer.
Click the menu bar to select a variety of functions from the drop-down menu under
the menu bar.
3) Tool bar
Equips buttons to easily access the commonly-used functions. This enables
quicker and speedier operation.
5) Edit screen
Displays a ladder program creation screen or a comment creation screen. Various
screens are displayed so that you can edit ladder diagrams, comments, or
parameters.
6) Status bar
Shows the status information of the GX Developer.
2-2
2.1.2 Project
Program
········
Program
Device comment
········
Device comment
Parameter
Device memory
Device default
Item Description
Program A sequential program that is required to operate the PLC CPU.
A comment for the sequential program device, which is classified into
two types. One is "common comment" that is common to all the
Device comment
projects, and the other is "comment by program", which varies by
projects.
Used for specifying the range of various settings such as the network
Parameter
related setting and device spectrum.
Displays the current device capacity. The device capacity can be
Device memory
changed by entering numeric value.
Device default Sets the device default for the PLC CPU.
2-3
1) One project per GX Developer
One GX Developer can edit only one project unit.
To edit two or more projects at a time, run as many GX Developers as the number
of projects.
2) Device Comments
The device comments of GX Developer are categorized into common comment
and comments by program.
Comment type Number of comments Description
A device comment that is common to all the
Common comment 1
programs within the project.
A device comment that is set by each
Comments by Equals the number of
program. The name of the comment must
program the programs
be the same as of the program.
If the contents of the two device comments overlap with one another, select
[Tools] [Option] [By program] to set priorities of them.
2-4
2.2 Operation Before Creating Ladder Programs
2-5
2.2.2 Creating a new project
2-6
(Continued from the previous page)
6) Click!
2-7
2.2.3 Changing the assignment of the function keys
1) Click!
2) Select the desirable 2) Click on the desirable key type to select it.
key type!
As an example, the window on the left shows
the case when "GPPA type" is selected.
3) Click!
3) Click the OK button.
REFERENCE
Display of the tool bar changes depending on the selected key type. Assignment of the shortcut keys alters
accordingly.
GPPA format
GPPQ format
MEDOC format
2-8
2.3 Preparations for Starting Up CPU
Setting up switches and formatting the built-in memory are required in advance to
writing a program to the CPU.
Connect or set up the connectors and the switches indicated as (1) to (3) shown
below.
(The figures below are illustrations of Q02HCPU. The locations of the switches and
connectors are the same with other CPUs.)
MODE
RUN
ERR.
USER
BAT.
BOOT
ON SW
1
2
3 (2)
4
5
STOP RUN
RESET L CLR
(3)
(1)
2-9
(4) Format the built-in memory of the CPU
The program memory of the QCPU is formatted in the following procedure.
1) Click!
3) Click!
4) Click!
6) Click!
2 - 10
(5) Clear all the device memory from the CPU
Clears the device memory from the QCPU.
1) Click!
3) Check
3) Check the "Include latch" checkbox.
4) Click!
5) Click!
7) Click!
2 - 11
(6) Clear the fault history in the CPU
Clear the fault history data stored in the QCPU.
1) Click!
4) Click!
2 - 12
2.4 Creating a Ladder Program
Y70
XO
6) The symbol you entered ( ) will appear.
6) The symbol will appear. 7) Press the F7 key, and enter "Y70".
2 - 13
(Continued from the previous page)
9) The symbol will appear! 9) The symbol you entered ( Y70 ) will
appear.
Y70
12) The symbol will appear! 12) The symbol you entered ( ) will appear.
Y70
13) Move the cursor! 13) Move the cursor to the ladder under .
14) Enter "X3"! 14) Press the F5 key, and enter "X3".
X3
16) The symbol you entered ( ) will appear.
16) The symbol will appear! 17) Press the F7 key, and enter "Y71".
18) Press Enter !
17) Enter "Y71"!
18) Press Enter to confirm the entry.
2 - 14
2.4.2 Creating a ladder program using the tool buttons
X3
Y71
X2
3) The symbol you entered ( ) will appear.
3) The symbol will appear! 4) Click on the tool bar, and enter "X0".
X0
6) The symbol you entered ( ) will appear.
6) The symbol will appear! 7) Click on the tool bar, and enter "Y70".
2 - 15
(Continued from the previous page)
9) The symbol will appear! 9) The symbol you entered ( Y70 ) will
appear.
Y70
12) The symbol you entered ( ) will appear.
12) The symbol will appear! Y70
13) Move the cursor to the ladder under .
13) Move the cursor!
14) Click on the tool bar, and enter "X3".
14) Click ,
15) Click! 15) Click the OK button.
then enter "X3".
X3
16) The symbol you entered ( ) will appear.
16) The symbol will appear! 17) Click on the tool bar, and enter "Y71".
2 - 16
2.5 Converting the Program
(1) Parameter setting for Multiple CPUs (if only one CPU is installed, omit this step.)
The Q-series Multiple-CPU version demonstration machines are equipped with
two CPUs.
Those machines are not dealt with in this textbook, however, it is required to set
the PLC parameters of each CPU for the reason mentioned below.
Each CPU should be informed where in the main base slot the I/O numbers
begin
<When two CPUs are installed>
Power supply
Output unit
Input unit
CPU 1
CPU 2
AD unit
DA unit
Follow the steps below to set the parameters. For details on parameters, refer to
"3.2 Parameters".
1) Double-click!
2 - 17
(Continued from the previous page)
2) Click!
4) Click!
RESET L CLR
3) Click!
2 - 18
(Continued from the previous page)
8) Click!
2 - 19
(Continued from the previous page)
9) Set the RUN/STOP switch of the second PLC
CPU to STOP.
10) Click the Transfer setup button on the
"Write to PLC" dialogue box.
10) Click!
12) Click!
2 - 20
(Continued from the previous page)
5) Click!
IMPORTANT
If you practice the operation by following the procedures described in this textbook,
resetting/rewriting the parameter for the CPU No.2 is required only in Section 6.3 or
in Chapter 7. (In the case where two CPUs are installed.)
<Reasons>
(1) Only the CPU No.1 drives the CPU program.
(2) No changes are made to the parameter items that correspond to the multiple
CPU system.
(The number of CPUs, refresh, I/O assignment setting)
2 - 21
2.7 Monitoring the Condition of the Ladder Program
RESET L CLR
3) Click!
Operation Practice
1) Confirm that the LED indicator Y70 lights up by turning the snap switch X2 on, and
that the indicator remains lit after the snap switch is turned off.
2) Confirm that the LED indicator Y70 turns off by pressing push button X0, and that
the indicator does not light up when releasing the button.
3) Turn the snap switch X3 on to turn on LED indicator Y71.
2 - 22
(1) In monitor mode, the monitor status dialogue box shown below will appear
regardless of whether the monitoring is activated or not.
<QCPU (Q mode) or QnA series>
1) 2) 3)
1) Scan time
Shows the maximum scan time of the monitored PLC CPU.
The Q-series device will display the scan time in 0.1-ms increments.
2 - 23
POINT
· The monitor of RST instruction shows on/off status of the device to be reset.
The device to be reset is off :
The device to be reset is on :
· By alternating to list mode, the ladder program can be displayed in list form.
2 - 24
2.8 Editing Ladder Program
Y71
SET M3
RST M3
Added!
2) Double-click!
2 - 25
(Continued from the previous page)
2 - 26
2.8.2 Drawing/Deleting lines
Y70
Y73
X3
Y72
1) Click!
2 - 27
(Continued from the previous page)
4) Click , 5) Click!
then enter "Y73"!
2 - 28
(2) Deleting lines
Y70
Y73
X3
Y72
1) Click!
4) Press "Delete"!
2 - 29
2.8.3 Inserting/Deleting rows
X2 X0
Y70
Y70
X3
Y72
2) The menu
will appear!
2 - 30
(Continued from the previous page)
3) Click!
2 - 31
(Continued from the previous page)
X7
7) The symbol will appear! 7) The symbol ( ) you entered will appear.
2 - 32
(2) Deleting rows
X2 X0
Y70
Y70
X3
Y72
2) The menu
will appear!
2 - 33
(Continued from the previous page)
3) Click!
2 - 34
2.8.4 Cutting/Copying ladder program
A ladder program Follow the steps below to cut and copy the ladder
to be modified program shown on the left.
X7
Y77
X2 X0
Y70
Y70
2 - 35
(Continued from the previous page)
6) Click !
2 - 36
(Continued from the previous page)
8) Click!
9) Complete!
2 - 37
2.9 Saving Ladder Program
( Saving newly-created project) 2) Specify the area to store the new project.
2) Specify the location 5) Click the Save button to confirm your entry.
to store the project! 5) Click!
Reference
· The following characters cannot be used for the project name.
/, , >, <, *, ?," ", |, :, ; (: and can only be used to specify a drive.)
Do not place a period (.) at the end of the name.
· Eight or more characters can be used for the project name when operating with GX Developer
(SW8D5-GPPW or later), however, only the first seven characters will be displayed if the project is read
in GX Developer (SW2D5-GPPW or older).
· Maximum 150 characters are allowed for the project path + project name.
· Maximum 32 characters are allowed for the title.
· If space(s) is included in the project path or the project name, GX Developer will not start up properly by
double-clicking GPPW.gpj, ***.gps on the Explorer.
To open such project, start GX Developer first and open the project by selecting the [Project] [Open
project] menu.
2 - 38
2.9.2 Saving a project under another name
1) Click!
2 - 39
2.10 Reading the Saved Project
1) Click!
2 - 40
CHAPTER 3 PLC DEVICES AND PARAMETERS
3.1 Devices
The devices are imaginary elements for programming in the PLC’s CPU, as well as the
components (such as contacts and coils) that compose a program.
X6 T2 Y 74
Y74
Y74 Device No.
Device symbol
3-1
Type Description Remark
N Nesting Shows the nesting (nested structure) of the master control.
Locates the jump addresses of the branch instructions (CJ, SCJ,
P Pointer
CALL and JMP).
Interruption Locates the jump address that corresponds to the factor of the
I
pointer interruption when an interruption occurs.
SFC block Device that checks if the SFC program designated block is
BL
device activated or not.
SFC transition Device to check if the designated transition condition of SFC
TR
device program designated block is specified as forced transition or not.
Network No.
Used when designating Network No. by the instructions of data
J designation
link.
device
I/O No.
Used when designating I/O No. by the instructions for the
U designation
intelligent function module.
device
Used when designating the followings; timer counter set value,
Decimal
K pointer number, interruption pointer number, number of digits of
constant
bit device, and basic/application instruction values.
Hexadecimal Used when designating the basic/application instruction values.
H
constant
E Real constant Used when specifying real numbers as instructions.
"Character Character-string Used when specifying character strings as instructions.
string" constant
Jn X · Bit device
Jn Y · Mainly deals with the
Jn S on/off signals.
Link direct Device that can access directly to the link device of the network
Jn SB
device module.
Jn W · Word device
(Establish the refresh parameter beforehand.)
Jn SW · Mainly deals with a data.
Un G · One word consists of 16
Intelligent bits.
Device that can access directly to the buffer memory of the
Un G function module
intelligent function module.
device
3-2
3.2 Parameters
The parameters are basic settings applied to the PLC in order to control the object as
planned.
The parameters are divided into the PLC parameter, network parameter, and remote
password as shown below.
PLC Name Setting
Label................................................. Sets the QCPU label (name and purpose)
Comment .......................................... Sets the comment of QCPU label
Timer interval setting.............................. Sets either the low-speed/high-speed timer
RUN-PAUSE contact ............................. Sets contact that controls QCPU RUN/PAUSE
Remote reset ............................................ Permits/Prohibits the remote reset operations from GX Developer
STOP-RUN output mode...................... Sets the output (Y) status after switching from STOP to RUN
Computation on floating decimal
point data ................................................... Sets the execution of computing floating decimal point data in double accuracy
Intelligent function module setting ..... Sets the following items: Interruption pointer assignment (I50 to I255),
head I/O No. and head SI No. of intelligent function module
PLC System Setting Common pointer ...................................... Sets the head No. of the pointer used as a common pointer
Number of vacant slots ......................... Sets the number of vacant slots for the basic/expanded bases
System interruption setting .................. Sets execution interval for head No. of interruption counters and
interruption pointers (I28 to I31)
Interruption program/Fixed-cycle
program setting........................................ Sets the execution of interruption program at high speeds
Unit synchronization setting................. Sets the synchronization of the start-up of QCPU with that of intelligent
function module
A series CPU compatibility setting .... Sets whether or not to use the special relay/register for MELSEC-A series
File register....................................... Sets the file of the file register used throughout the program
PLC File Setting Comment file used in instructions..... Sets the file of the comment used throughout the program
Device initial value............................ Sets file of the device initial value used for QCPU
Local device file................................ Sets the local device file used throughout the program
WDT setting......................................Sets the QCPU watchdog timer
PLC Operation mode in error condition ....Sets the QCPUs operation mode in the error status
Parameter Error check .......................................Sets the detection of specified errors
PLC RAS Setting
Constant scan ..................................Sets constant scan time
Low speed program execution time .Sets the execution time for each scanning of the low speed program
Failure history ...................................Sets the area to store the QCPUs failure history
Program Setting ....................................................................... Sets the file name and execution type (execution condition) of
the program when writing multiple programs for QCPU
Boot option ....................................... Sets whether or not to clear the program memory at boot
Boot File Setting Boot file setting ................................. Sets the type, data name, and transfer from drive of the program file
that operate at boot
Standard ROM automatic refresh..... Sets the execution of automatic refresh on the standard ROM
SFC Setting ...................................................................... Sets the start mode/condition of the SFC program when the program is in use,
and sets the output mode when the block is at a stop
I/O assignment .................................
Sets the type, model, occupation numbers, and start input/output numbers
of the installed module
Basic setting .....................................
I/O Assignment Sets the basic base module in use, expanded base module, power supply
module, model of expanded cable, and the number of the slot of the base module
Switch setting ................................... Sets various switches of the intelligent function module
Detailed setting................................. Sets the operations at an error and the response time of the input module
MELSECNET,
Network Ethernet Setting ....................................................................Sets the network parameters for MELSECNET/H and Ethernet
Parameter
CC-Link Setting ....................................................................Sets the parameters for CC-Link
Remote Password .......................................................................................................................... Sets the password that limits the access via the Ethernet or serial
communication modules
3-3
· When GX Developer starts, it employs the preset values as the parameters. These
values are called the default (initial values).
· PLC can run with those values unchanged, however, modify them within a specified
range as necessary.
· The second CPU is installed on the demonstration machine for making up a Multiple
CPU structure. In MELSEC-Q series, multiple CPU setting for the parameters is
required if two to four CPUs are installed.
Operation Example: Changing Multiple-CPU Setting
The number of CPUs of Multiple CPU setting is one by default.
Change the value to "two". (If only one CPU is installed, omit this step.)
1) Double-click "PLC parameter" on the GX
Developer project list.
1) Double-click!
2) Click!
4) Click!
3-4
CHAPTER 4 SEQUENCE & BASIC INSTRUCTIONS -Part 1-
The table below shows the sequence and basic instructions described in this chapter.
Instruction Instruction
symbol Functions Drawing (devices to be used) symbol Functions Drawing (devices to be used)
(Name) (Name)
Conditional
OUT CJ CJ Pn
Coil output jump
Out n = 0 to 4095
Designates bit for bit (non-delay)
devices and word devices. (pointer number)
MCR Calls a
Terminates MCR Nn CALL CALL Pn
Master subroutine
master control n = 0 to 14 n = 0 to 4095
control reset program
(nesting) (pointer number)
Calls a
SET subroutine
SET CALLP CALLP Pn
Sets devices program
Set n = 0 to 4095
Designates bit for bit (pulsing
(pointer number)
devices and word devices. operation)
Pulse Terminates a
Generates the mainroutine
PLS pulses for one PLS FEND program FEND
Pulse program cycle
during an Designates bit for bit
devices and word devices.
input
Pulf
Generates the
PLF pulses for one PLF
Pulf program cycle
during an Designates bit for bit
devices and word devices.
input
4-1
[List of Instructions Not Described in this Chapter: Part 1]
"Introduction: PLC Course" covers the instructions shown below. The conventional
A series also support them. Refer to "QCPU (Q mode) / QnACPU Programming
Manual (Common Instructions)" for more details.
Instruction Instruction
symbol Functions Drawing (devices to be used) symbol Functions Drawing (devices to be used)
(Name) (Name)
LD MRD Intermediate
Load Starts logical Lead branching
operation
Starts to
operate normally Designates bit for bit
devices and word devices.
open
LDI MPP Terminates
Load Starts logical Pop branching
inverse inverse operation
Starts to
operate normally Designates bit for bit
devices and word devices.
open
AND NOP Ignored For a space or deleting a
And Logical AND Nop program
operation
normally open
series connection Designates bit for bit
devices and word devices.
OR STOP Stops
Or Logical OR operation STOP
operation
normally open
parallel connection Designates bit for bit
devices and word devices.
Logical OR inverse
ORI SFT
operation SFT 1-bit shift
Or
normally close Shift for devices
inverse Designates bit for bit
parallel connection Designates bit for bit devices and word devices.
devices and word devices.
OR operation Ignored
ORB between logical (Inserts a page
NOPLF NOPLF
Or block blocks break when
Parallel connection printing)
between blocks
Ignored
MPS Starts to cause (Recognized
PAGE PAGE n
Push a branch as zero step of
n-page)
4-2
[List of Instructions Not Described in this Chapter: Part 2]
The instructions listed below are intended for the Q series and not supported by the
A series.
Some of them are explained in "Q Programming Practice Course".
Refer to "QCPU (Q mode) / QnACPU Programming Manual (Common Instructions)"
for more details.
Instruction Instruction
symbol Functions Drawing (devices to be used) symbol Functions Drawing (devices to be used)
(Name) (Name)
Inverts the
LDF Starts to start INV
operation
Load F a falling pulse Inverse Designates bit device and
Designates bit for bit results
devices and word devices. word device
Converts the Vn
Series results into a
ANDP EGP
connection of rising pulse
And P Edge P
rising pulse Designates bit for bit (Memorized by Designates bit device and
devices and word devices. word device
Vn)
Converts the Vn
Series results into a
ANDF EGF
connection of falling pulse
And F Edge F
falling pulse Designates bit for bit (Memorized by Designates bit device and
devices and word devices. word device
Vn)
Parallel FF
ORP Inverts a
connection of FF
Or P device output Designates bit device and
rising pulse Designates bit for bit
word device
devices and word devices.
Parallel Converts a
ORF DELTA
connection of direct output to DELTA
Or F Delta DY
falling pulse Designates bit for bit a pulse
devices and word devices.
Converts the
DELTAP Converts a
operation DELTAP
MEP Delta P direct output to
results into a Designates bit device and DY
a pulse
rising pulse word device
4-3
4.2 Differences between OUT and SET • RST
X0
0 Y70
• The OUT instruction turns the specified device ON when receiving the input
condition, and turns the device OFF when the condition becomes OFF.
[Timing Chart]
X0
Y70
X0
0 SET Y70
X1
2 RST Y70
• The SET instruction turns the specified device ON when receiving the input
condition, and maintains the device ON status even if the condition becomes OFF.
To turn the device OFF, use the RST instruction.
[Timing Chart]
X0
X1
Y70
4-4
4.3 Measuring Timer
K30
X5
0 T0
T0
7 Y71
[Timing Chart]
X5contact • The timer contact operates
when a given delay time elapses
after the coil is energized.
T0 coil (Ondelay timer)
• The allowable range of timer
3.0 s
setting is between K1 to
T0Normally open, Y70 coil K32767.
Low-speed (100 ms) timer
T0Normally closeY71 coil
0.1 to 3276.7 s
High-speed (10 ms) timer
0.01 to 327.67 s
• When the timer setting value is
set to zero, it turns ON (Time
out) by the execution of the
instruction.
4-5
4.4 Counting by the Counter
K12
X1
0 C20
X7
7 RST C20
[Timing Chart]
• Counts when an input signal
rises.
•X1contact • After the count, the subsequent
input signals are not counted.
• Once the counter counts, the
contact status and the current
C20 coil counter value do not change
1 2 3 11 12 0
until the RST instruction is
(Current value of counter)
performed.
• Perfoming the RST instruction
C20contact, Y72 coil
before the count returns the
counter to zero.
• The allowable range of the
X7contact (Input of the RST instruction) counter setting is between K0
and K32767. (K0 turns ON
(Count up) by the execution of
the instruction.)
In addition to the direct designation using K, indirect designation using D (Data register)
is available.
• The counter C30 counts when
the number of rising edges on
the input signal X0 becomes
Setting value the same as the number (e.g.;
D10 24) specified by the data
X0
Digital register D10.
0 2 4 0 C30
switch • This indirect designation is
useful for applying a value
C30 specified with an external
5 Y71 digital switch to the counter.
D10 24
The indirect designation using
data register D is also
available for the timer.
4-6
Path name A: SCHOOL
Project name QEX1
Program name MAIN
Ladder Example
When the conveyor belt operation start switch (X0) is turned ON, the buzzer (Y70)
beeps for three seconds and then the conveyor belt (Y71) starts to operate.
The conveyor belt automatically stops when the sensor (X1) detects that six
packages have passed through.
Sensor
(X1)
Conveyor belt
Control panel Motor
Operating panel
MC
Operation Buzzer
(X0) (Y70)
(Y71)
X0 C0
0 M0 During operation
M0
M0 Y71
4 Y70 Buzzer
M0 K30
7 T0 3-sec timer
T0
12 Y71 Operating the conveyor belt
X1 K6
14 C0 Counter for counting the number
Y71 of packages
19 RST C0
4-7
Operating Procedure
(1) Create a new project
1) Click on the tool bar.
Click
Click
3) If the project in preparation exists, the dialog box appears asking if you want
to save the product.
Click the No button.
Click
4-8
(2) Create a program
[Using the keyboard]
F5 X 0 Shift + F5 C 0 F7 M 0
F4
Convert
Enter after
clicking . 3) Click on the toolbar to open the ladder
Click
input window.
4) Enter "C0" with the keyboard and click the
OK button.
Enter after
clicking . 5) Click on the toolbar to open the ladder
Click
input window.
4-9
(3) Write to the PLC
Click
2) Click the Param+Prog button. Checkboxes for the program of the write
data and the parameter displayed in the window are automatically marked.
Click
4 - 10
4) If the parameters have been already written, the dialog box appears asking if
you want to overwrite them. Click the Yes button.
Click
5) The progress bar dialog box appears to show how much the PLC parameter is
written.
6) If the program has already been written, the dialog box appears asking if you
want to overwrite it. Click the Yes button.
Click
7) The progress bar dialog box appears to show how much the program MAIN is
written.
Click
4 - 11
(4) Monitor the ladder
Reset the CPU
Click
Operation Practice
1) Turn the push button switch (X0) ON. Y70 becomes ON, and T0 starts at the same
time.
2) When the timer T0 counts three seconds (time is up), Y70 goes OFF and at the same
time, Y71 becomes ON.
3) Turn the push button switch (X1) ON and OFF. The counter C0 counts the number of
ON to turn Y71 OFF after counting ON for six times.
4 - 12
4.5 PLS Pulse (Turns the specified device ON for one scan at rising edge of an input condition.)
PLF Pulf (Turns the specified device ON for one scan at falling edge of an input condition.)
X0 1
0 PLS M5
X1 2
3 PLF M0
1 • The PLS instruction turns the specified device ON only for one scan at rising edge of
the PLS command.
[Timing Chart]
X0
M5
One scan One scan
2 • The PLF instruction turns the specified device ON only for one scan at falling edge
of the PLF command.
[Timing Chart]
X1
M0
One scan One scan
4 - 13
Application
• The instructions can be used in the standby program that waits for the operation
condition.
Operation Trigger
X0
PLS M0
M0
SET M5
M5
Y70
TO
TO
RST M5
[Timing Chart]
X0
(Trigger)
M0
M5
Y70
5s
(Operation)
Time to wait
for the condition
Operation
Condition
Intelligent
Constant
Pointer
function
(system user) register (H) Direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
PLS D
D 2
PLF D
4 - 14
• The instructions can be used for the detection program that detects passage of
moving objects.
After detecting the passage of a product, the next process for the product is started.
X0
PLF M0
M0
SET Y70 Product
Y70 Sensor
Sensor
(Detection of input from X0) Conveyor belt
[Timing Chart]
X0
M0
Y70
[Timing Chart]
Input(X0)
[Program example]
Path name A: SCHOOL
Project name QB-6
Program name MAIN
X0
0 PLF M1
M1 T16 K100
3 T16
Y76
Y76
4 - 15
Other Useful Ways of PLS & PLF Part 2
• The program for the repeated operation such as switching ON/OFF status alternately
by pressing the push button switch can be made using the instructions.
If you use the PLS for the above program, the rising edge caused when the
push button switch is pressed triggers the program. If you use the PLF, the
falling edge caused when the switch is released becomes the trigger.
[Timing Chart]
X0
Y70
Y71
[Program Example]
Path name A: SCHOOL
Project name QB-7
Program name MAIN
X0
0 PLS M0
PLF M1
M0 Y70
5 Y70
M0 Y70
M1 Y71
11 Y71
M1 Y71
4 - 16
Path name A: SCHOOL
Project name QEX2
Program name MAIN
Ladder Example
Create the following ladder and check if it works properly.
X2
0 PLS M0
M0 X0
3 Y70
Y70
X3
7 PLF M1
M1 X1
10 Y71
Y71
[Timing Chart]
X2
M0
PLS
Y70
X0
X3
M1
PLF
Y71
X1
REFERENCE
The following is a timing chart of a lockup ladder programmed using OUT
instructions. Compare this with the lockup ladder created using the PLS
instructions.
X2
Y70
X0
X2 X0
Y70
Y70
4 - 17
Operating Procedure
See Section 4.4 Operating Procedure for the procedure of the following operations.
Operation Practice
• Turning X2 switch ON makes Y70 turn ON, and Y70 switch OFF when X0 turns ON.
(Even when X2 stays ON, Y70 is turned OFF when X0 turns ON.)
• Turning X3 switch OFF makes Y71 turn ON, and Y71 switch OFF when X1 turns ON.
__
Related Exercise Exercise 3
REMARK
Input pulse processing is not required for the QCPU as it uses a derivative contact.
( / ).
[A/AnSCPU case]
X0
PLS M0
M0
SET M5
[QCPU case]
X0
SET M5
Supported instructions are; LDP, LDF, ANDP, ANDF, ORP, and ORF.
4 - 18
4.6 MC Master control (Start)
X7
0 MC N0 M98
N0 M98
X2
3 Y70
X3
5 Y71
7 MCR N0
Reference
X7
You do not need to write contacts for the master
0 MC N0 M98 control when creating the ladder.
After creating the ladder, convert it ( F4 ) and enter
NO M98
into the read mode. The contacts are automatically
inserted.
Application
• The instructions can be used to create the program for switching between manual
and automatic operations. (Refer to the Ladder Example.)
Applicable Device
Basic number of steps
Intelligent
Constant
Pointer
function
(system user) register (H) Direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
MC n D n
2
MCR n D 1
The basic number of steps of the MC instruction is two, and that of the MCR instruction is one.
4 - 19
Nested "MC to MCR" Program Example
• The MC and MCR instructions can be nested as shown below.
X5
0 Y70
X2
2 MC N0 M6
N0 M6 K5
X6
5 C0
X3
10 MC N1 M7
1
N1 M7 K100
N1 N0
X7
13 TO
18 MCR N1
X20
19 Y71
21 MCR N0
X0
22 SET Y72
X4
24 MC N0 M8 2
N0 M8
X1 N0
27 RST Y72
29 MCR N0
X30
30 Y73
M6
32 Y74
1 • The "MC to MCR" program is nested under the "MC to MCR" program . (It is
called "nested structure".)
To do that;
1) Assign the nesting number (N) of MC instructions in ascending order.
2) For the MCR nesting number (N), assign the numbers used for the MC in
descending order.
2 • The "MC to MCR" program is independent from the program. The nesting
numbers (N) used in the program can be used for the program.
• The internal relay number (M) must be changed by MC.
4 - 20
Path name A: SCHOOL
Project name QEX3
Program name MAIN
Ladder Example
A program for switching between manual and automatic operations can be made using
the MC and MCR instructions.
• When selecting manual operation by turning X7 OFF
1) The system goes into low-speed operation mode when X2 is turned ON.
2) The system goes into high-speed mode when X3 is turned ON.
• When selecting automatic operation by turning X7 ON, the system operates in
low-speed mode for 3 s after X0 is turned ON. Then it operates in high-speed mode
for 10 s and stops.
High speed
Low Speed
3s 10 s
Manual
X7
0 MC N0 M10
9 MCR N0
Automatic
X7
10 MC N0 M11
34 MCR N0
M71
35 Y71 Low speed operation
M81
M72
38 Y72 High speed operation
M82
4 - 21
Operating Procedure
See Section 4.4 Operating Procedure for the detailed procedure of the following
operations.
Operation Practice
• The manual operation is selected by turning the X7 switch OFF.
When the X2 switch is turned ON, Y71 lights and the low-speed operation is
performed. To perform the high-speed operation, turn the X3 switch ON. Y72 lights
and the high-speed operation starts.
• Automatic operation is selected by turning the X7 switch ON.
When the X0 switch is turned ON, Y70 lights and indicates that it being automatically
operated. Y71 also lights at the same instant and stays on for three seconds
indicating the system is in low-speed mode. After the three seconds elapsed, Y72
lights and stays on for 10 s indicating in high-speed mode. Then the operation is
stopped. (Y70, Y71, and Y72 have stopped lighting at the end.)
NOTE
For the MCR instructions in one nested program block, all master controls in the
program can be terminated with the lowest nesting (N) number only.
4 - 22
4.7 CJ • SCJ • CALL • RET • FEND
1
X0
0 CJ P10
2
X1
3 SCJ P10
X0 X1
6 Y70
Pointer
P10
X3
9 Y71
2 • The SCJ instruction executes a program without jumping for the scan when the input
condition is ON. From next scan, the instruction executes a program with jumping it
to the designated jump address (pointer number).
When the input condition is OFF, the program is not executed.
• The SCJ instruction is used when some operations must be executed before
jumping the program.
For example, when the output needs to be ON or reset in advance.
[Timing Chart]
Input Condition
(X0, X1)
Executes at Executes at
CJ every scan every scan
Executes at Executes at
SCJ every scan every scan
4 - 23
Caution
• The pointer numbers available for both CJ and SCJ are P0 to P4095.
• Use the FEND instruction as shown below when a program using the CJ and SCJ
must be concluded in each program block. (See Section 4.7.3 for explanation on the
FEND.)
Start
0 Sequence program A When Not executing CJ When executing CJ
Input Condition Step 0 Step 0
Sequence
program A CJ P
CJP
Sequence program B
Input condition
YES
FEND FEND
is ON?
P
P Sequence program C
NO
X0 X0
1100 CJ P10 1100 CJ P10
X2 X2
1103 Y72 1103 Y72 Because X0 is ON, all instructions within
this area are not executed.
Hence Y72 remains ON even after X2 is
turned OFF.
P10 X1 P10 X1
1330 PLS M1 1330 PLS M1
• Once the coil of the timer is energized, the timer updates even if the coil is skipped
by the CJ or SCJ instruction.
When time is up, the contact becomes ON. This is because the timer updates and
turns the contact ON/OFF after each END.
Intelligent
Constant
Pointer
function
(system user) register (H) Direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
CJ P**
P 2
SCJ P**
4 - 24
Path name A: SCHOOL
Project name QEX4
Program name MAIN
Ladder Example
Create the following ladder with GX Developer and write it on the CPU of the
demonstration machine. Then check the difference between CJ and SCJ
instructions.
X0
0 CJ F3
P10
X1
3 SCJ F3
P10
X0 X1
6 Y70
P10 X3
9 Y71
Operating Procedure
See Section 4.4 Operating Procedure for the detailed procedure of the following
operations.
4 - 25
Operation Practice
(1) When X0 and X1 are OFF, the CJ and SCJ (2) When X0 is turned ON, the CJ instruction
instructions are not executed. Therefore, Y70 is is executed jumping to P10. Therefore, Y70
ON. remains ON.
[Before executing CJ and SCJ] [Executing CJ] First scan and subsequent scans
X0 X0
CJ P10 CJ P10
X1 X1
SCJ P10 SCJ P10
X0 X1 X0 X1
Y70 Y70
P10 X3 P10 X3
Y71 Y71
(3) The SCJ instruction is executed when X0 is turned OFF and X1 is turned ON.
The instruction is executed jumping to P10 from the next scan.
Therefore, Y70 becomes OFF.
[Executing SCJ] First scan [Executing SCJ] Second scan and subsequent scans
X0 Second X0
scan & CJ P10
CJ P10
First subsequent
X1 times X1
scan SCJ P10
SCJ P10
X0 X1 X0 X1
Y70 Y70
P10 X3 P10 X3
Y71 Y71
0 LD X0 0 LD X0
1 CJ P10 1 CJ P10
3 LD X1 3 LD X1
4 SCJ P10 4 SCJ P10
6 LDI X0 6 LDI X0
7 ANI X1 7 ANI X1
8 OUT Y70 8 OUT Y70
9 P10 9 P10
10 LD X3 10 LD X3
11 OUT Y71 11 OUT Y71
12 END 12 END
____
Related Practice Question Practice Question 4
4 - 26
4.7.2 CALL (P) Call
Executes a subroutine program
RET Return
M0
0 CALL P10
M5 X2
50 CALL P10
Sequence
program
103 FEND
1
P10
2 X1
104 Y70
Subroutine
program
157 RET
• The above program is a basic style to execute the subroutine program using the
CALL and RET instructions.
Keep this structure, otherwise an error occurs and PLC stops.
1 A subroutine program consists of the ladders for executing the same data many times
in one program.
The subroutine starts at Pointer P and ends with the RET instruction.
2 • 0 to 4095 can be used as the Pointer P number. (Same as the pointer numbers used
for the CJ and SCJ instructions.)
• The subroutine program is executed as shown in the following diagrams.
Sequence program
Subroutine program
Sequence program
Execution of subroutine program
RET
RET
END
4 - 27
About Nesting
CALL P3
CALL P5
CALL P1 CALL P4
RET
RET
RET
FEND
CALL P1
Sequence program
FEND
P1
P5 subroutine program
RET
Applicable Device
Basic number of steps
Intelligent
Constant
Pointer
function
(system user) register (H) Direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
CALL(P) P** P ○ 2
RET 1
The basic number of steps of CALL (P) is 2 tn, and that of RET is one. ("n" is a argument passed to the subroutine.)
4 - 28
Path name A: SCHOOL
Project name QEX5
Program name MAIN
Ladder Example
Create the following ladder with the GX Developer and write it on the CPU of the
demonstration machine to check if the CALL and RET instructions work properly.
X2
0 CALL P10
X3
3 Y70
5 FEND
P10 X4
6 Y71
9 RET
Operating Procedure
Refer to Section 4.4 Operating Procedure for the detailed procedure of the
following operations.
4 - 29
Operation Practice
Verify the operation of the ladder, which was created with the GX Developer and
written to the CPU of the demonstration machine, by monitoring the ladder on the
screen.
X2
0 CALL P10
X3
3 Y70
5 FEND
P10 X4
6 Y71
9 RET
10 END
____
Related Practice Question Practice Question 4
4 - 30
4.7.3 FEND F end
FEND is a one-step
FEND
instruction.
• Use the FEND instruction as the END instruction under the following conditions:
1) When a sequence program must be executed and terminated in each program
block.
For example, use this instruction with CJ and SCJ instructions.
2) When using the subroutine programs (CALL and RET instructions).
3) When using an interrupt program.
• After each execution of the FEND, the PLC processes the current value of the timer
and counter and makes self-diagnostic check, and then re-operates from 0 step.
0
CALL P**
Operation Sequence program
when not Sequence program
executing CJ Jump by CJ
CJ P** FEND
Operation P**
Sequence program Subroutine program
when executing CJ
FEND I**
P** Interrupt program
Sequence program
END END
(a) When operating in each program block by CJ instruction (b) When using the subroutine and interrupt
programs
Caution
• There is no limit to the number of FEND instructions in a sequence program,
however, it cannot be used in the subroutine and interrupt programs.
• The FEND instruction cannot be used to terminate the main or sub sequence
program.
Make sure to use an END instruction for the end of a whole program.
REFERENCE
The interrupt program allows you to stop the current process and processes an
interrupt upon receiving an interrupt request in the middle of processing a normal
program.
4 - 31
Path name A: SCHOOL
Project name QEX6
Program name MAIN
Ladder Example
Create the following ladder with the GX Developer and write it to the CPU of the
demonstration machine to check if the FEND instruction work properly.
X3
0 CJ F3
P10
X4
3 Y70
5 FEND
P10 X5
6 Y72
Operating Procedure
Refer to Section 4.4 Operating Procedure for the detailed procedure of the
following operations.
4 - 32
Operation Practice
Verify the operation of the ladder, which was created with the GX Developer and
written to the CPU of the demonstration machine, by monitoring the ladder on the
screen.
X3
0 CJ P10
X4
3 Y70
5 FEND
P10 X5
6 Y72
9 END
____
Related Practice Question Practice Question 4
4 - 33
Path name A: SCHOOL
Project name QTEST1
Program name MAIN
4.8 Practice Questions
LD to NOP
When X0 turns ON, Y70 is self-maintained, and Y74 and Y77 flicker alternately every
0.5 s.
When X1 turns ON, Y70 turns OFF and flickering of Y74 and Y77 also stops.
[Timing Chart]
X0
Y70
T0
Y74
T1
Y77
X1
0.5 s 0.5 s 0.5 s 0.5 s
Create the following program with the GX Developer filling in the blanks , and
verify the operation using the demonstration machine.
X0 2)
0 Y70
1)
Y70 3) K5
4 T0
4) K5
10 T1
Y74
5) Y70
16 Y77
4 - 34
Path name A: SCHOOL
Project name QTEST2
Program name MAIN
4.8.2 Practice Question (2)
SET, RST
When turning X0 ON, Y70 starts to flicker at one-second intervals and stops the
flickering for five seconds after flickering 10 times, then restart flickering.
The flickering of Y70 can be stopped by turning X1 ON.
Create the following program with the GX Developer filling in the blanks , and
verify the operation using the demonstration machine.
X0
0 1)
M0 M1 T1 K10
2 T0
T0 K10
T1
T0
Y70
K10
C0
2) 3)
23 4)
K50
T2
T2
30 RST M1
5)
X1
36 6)
7)
1) 5)
2) 6)
3) 7)
4)
4 - 35
Hint
(1) The following shows the timing chart of the program.
X0
M0
X1
Restart
T0-contact
1s
T1-contact
1s
1s
Y70
1s 1s 5s
C0-contact
(2) The following shows the basic flickering ladder and its timing chart.
REFERENCE
The flickering ladder can be created using the special relay that generates clock as
shown below.
Other than the SM413 (2-s clock), the following
K10 can be used.
SM413 (2-s clock)
T0 SM409 (0.01-s clock)
SM410 (0.1-s clock)
SM411 (0.2-s clock)
[Timing Chart] SM412 (1-s clock)
SM414 (2n-s clock)
Y70
1s 1s 1s SM415 (2-nms clock)
Starts from OFF when the PLC is reset or the
power is turned ON.
4 - 36
Path name A: SCHOOL
Project name QTEST3
Program name MAIN
4.8.3 Practice Question (3)
PLS, PLF
Y70 starts to switch between ON and OFF alternately upon detecting a rising edge of
X0 signal, and a falling edge of the signal triggers Y71 to do the same operation as
Y70 does.
[Timing Chart]
X0
Y70
Y71
Create the following program with the GX Developer filling in the blanks , and
verify the operation using the demonstration machine.
X0
0 1) M0
2) M1
M0 Y70
5 Y70
M0 Y70
M1 Y71
11 Y71
M1 Y71
1)
2)
4 - 37
Path name A: SCHOOL
Project name QTEST4
Program name MAIN
4.8.4 Practice Question (4)
Create the following program filling in the blanks , and verify the program with
the demonstration machine.
T0 K9999
T0
T200 K9999
T200
X7
CJ 1)
SM401 T11 K5
T10
T10 K5
T11
Flip flop ladder
Y70
T10
Y71
X0
2) P10
F3
3)
SM401 T20 K10
P0 T21
T21 K10
T20
Flip flop ladder
Y72
T21
Y73
X0
4) P10
5)
SM401
P10 RST Y70
F3
RST F3
Y71
RST F3
Y72
RST F3
Y73
6)
4 - 38
Hint
1)
START
2)
3)
Y <CJ P0>
X7 ON? 4)
5)
N
P0 6)
Y70 & Y71 Y72 & Y73
0.5-s flickering 1-s flickering
Y Y
X0 ON? X0 ON?
N N
P10
Reset Y70 Subroutine
to Y73 program
<FEND>
<FEND>
END
4 - 39
Chapter 4 Practice Question Answers
Question
Answers
No.
1) Y70
2) X1
1 3) T1
4) T0
5) Y74
1) SET M0
2) C0
3) Y70
2 4) SET M1
5) RST C0
6) RST M0
7) RST C0
1) PLS
3
2) PLF
1) P0
2) CALL
3) FEND
4
4) CALL
5) FEND
6) RET
4 - 40
CHAPTER 5 BASIC INSTRUCTION Part 2
The PLC CPU converts all the input signals into ON or OFF signals (logical 1 or 0,
respectively) to store and process them, and performs the numeric operation using the
numeric value stored with the logical 1 or 0 (binary numbers = BIN).
In our everyday life, on the other hand, a decimal system is most commonly used
because it is easier to understand. Therefore, decimal-to-binary conversion or the
reverse is required whenever you write/read (monitor) numbers to/from the PLC. The
programming system and some instructions have the function of performing the
conversion.
This section explains how numbers (data) are expressed in decimal, binary,
hexadecimal and binary-coded decimal notation (BCD), and how the conversion is
made.
Decimal
• A decimal number system consists of ten single-digit numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8,
and 9 which represent the order and size (amount). The number after 9 is 10. The
number after 19 is 20 and so forth. Additional powers of 10 require the addition of
another positional digit.
• The following shows how a base-ten number (in this case 153) is represented.
153 = 100 + 50 + 3
= 1 x 100 + 5 x 10 + 3 x 1
= 1 x 102 + 5 x 101 + 3 x 100
Decimal (0 to 9) symbol
Base number 10 raised to the power of digit number
n .......Digit number (0,1,2…)
10 .......Decimal number
• The Q series PLC uses a symbol K when it expresses numbers in decimal notation.
5-1
Binary (BIN)
• The binary number is a base 2 method of counting in which only the digits 0 and 1
are used. When 1 is reached, counting begins at 0 again, with the digit to the left
being incremented. The two digits 0 and 1 are referred to as bits.
Binary Decimal
0 0
1 1
10 2
11 3
100 4
101 5
110 6
111 7
1000 8
…
…
• Let’s look at how the binary number shown below is converted to decimal.
"10011101"
The diagram below depicts the binary number with the powers of two written beneath
it. The same incrementing pattern as the decimal system goes for the binary system
except for the difference of the radix. Since the binary method uses only 0 and 1
digits, it has more carries than the decimal method.
7 6 5 4 3 2 1 0
Bit number
1 0 0 1 1 1 0 1 Binary symbol
27 26 25 24 23 22 21 20 Base number 2 raised to
= Bit value
the power of digit number
...
...
...
...
...
...
...
...
128 64 32 16 8 4 2 1
From the diagram, we see that the binary number can be broken down as:
1×128 0×64 0×32 1×16 1×8 1×4 0×2 1×1
5-2
Hexadecimal
• The hexadecimal (often called hex for short) is a numeral system with a radix of 16
usually written using the symbols 0-9 and A-F. The A-F represent 10-15 respectively
as shown in the table below. When F is reached, counting begins at 0 again, with the
digit to the left being incremented just like the decimal and binary system.
Decimal Hexadecimal Binary
0 0 0
1 1 1
2 2 10
3 3 11
4 4 100
5 5 101
6 6 110
7 7 111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
16 10 10000
17 11 10001
18 12 10010
…
…
19101 4A9D 0100 1010 1001 1101
3 2 1 0 Digit number
n ........Digit number
4 A 9 D Hex symbol
16 ....... Hexadecimal
3 2 1 0
=(4)×16 (A)×16 (9)×16 (D)×16
=4×4096 10×256 9×16 13×1
=19101
5-3
Binary Coded Decimal (BCD)
• The binary-coded decimal is a code in which a string of four binary digits represents a
decimal number.
A decimal number 157, for example, is expressed as shown below in BCD.
2 1 0 Digit number
1 5 7 Decimal
(100) (10) (1) Place (digit)
• In BCD, decimal numbers (0 to the biggest 4-digit number; 9999) can be represented
by 16 bits.
The diagram below shows the bit values allocated to each digit of BCD.
Thousand digits
Hundred digits
Ten digits
Unit digits
0 0 0 0 0 0 0 1 0 1 0 1 0 1 1 1
8000
4000
1000
2000
200
800
400
100
80
40
20
10
1
4
2
• The BCD is used for the following signals.
1) Output signals of digital switches
2) Signals of seven-element display (digital display)
0 1 2 3 4 5 6 7 8 9
1(0) (1) (0) (1) (0) (1) (0) (1) (0) (1)
2(0) (0) (1) (1) (0) (0) (1) (1) (0) (0)
4(0) (0) (0) (0) (1) (1) (1) (1) (0) (0)
8(0) (0) (0) (0) (0) (0) (0) (0) (1) (1)
COM
BCD Code Digital Switch
5-4
How to Convert Decimal to Binary
A decimal number 157, for example, is converted to binary as shown below.
1)
1 0 0 1 1 1 0 1
128 64 32 16 8 4 2 1 Bit
157 value
- 128
29
- 16
13
- 8
5
- 4
1
- 1
0
2)
Quotient Remainder
2 157
2 78 1
2 39 0
2 19 1
2 9 1
2 4 1
2 2 0
1 0
1 0 0 1 1 1 0 1
128 64 32 16 8 4 2 1
16 157 1 0 0 1 1 1 0 1
9 ...13(D)
9 D
5-5
Valid Numbers for Q series PLC
• 8 bits is usually called 1 byte and 16 bits (2 bytes) is called 1 word.
1 bit
1 0 0 1 1 1 0 1
1 byte
0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1
1 word (2 bytes)
16384
8192
4096
2048
1024
512
256
128
64
32
16
1
• Current counter C value
• File register R Binary digit value
• Link register W
etc.
• The following two ranges of numbers can be processed using 16 bits (1 word).
1) 0 to 65535
2) -32768 to +32767
• The MELSEC-Q PLC uses the 2) range.
The negative numbers adopt two’s complement to positive numbers (1+0+32767).
• In the two’s complement, each binary bit is inverted, and then 1 is added to the lower bits.
Example)
Negative 1 is represented as shown below using two’s complement:
1 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
-1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
5-6
(Binary Coded Decimal) BCD (Binary) BIN (Decimal) K (Hexadecimal) H
00000000 00000000 00000000 00000000 0 0000
00000000 00000001 00000000 00000001 1 0001
00000000 00000010 00000000 00000010 2 0002
00000000 00000011 00000000 00000011 3 0003
00000000 00000100 00000000 00000100 4 0004
00000000 00000101 00000000 00000101 5 0005
00000000 00000110 00000000 00000110 6 0006
00000000 00000111 00000000 00000111 7 0007
00000000 00001000 00000000 00001000 8 0008
00000000 00001001 00000000 00001001 9 0009
00000000 00010000 00000000 00001010 10 000A
00000000 00010001 00000000 00001011 11 000B
00000000 00010010 00000000 00001100 12 000C
00000000 00010011 00000000 00001101 13 000D
00000000 00010100 00000000 00001110 14 000E
00000000 00010101 00000000 00001111 15 000F
00000000 00010110 00000000 00010000 16 0010
00000000 00010111 00000000 00010001 17 0011
00000000 00011000 00000000 00010010 18 0012
00000000 00011001 00000000 00010011 19 0013
00000000 00100000 00000000 00010100 20 0014
00000000 00100001 00000000 00010101 21 0015
00000000 00100010 00000000 00010110 22 0016
00000000 00100011 00000000 00010111 23 0017
5-7
Demonstration Machine Configuration & Input/Output No.
Peripheral device
I/0 Panel
ON
OFF
5-8
5.2 Transfer Instruction
K50
X7 T0
0 T0
K1500
T0
C10
X1
13 RST C10
S D 1
X2
18 MOV T0 D0
X3
21 MOVP C10 D1
X4 2
24 MOVP K157 D2
X5 3
27 MOVP H4A9D D3
1 • As soon as the input condition goes active, the current value of timer T0 is
transferred to the data register D0.
S …Source, D …Destination
• The current T0 value is stored in the register in binary form and transferred to the
data register D0 without changing the form.
T0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 45
128 64 32 16 8 4 2 1
D0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1
128 64 32 16 8 4 2 1
2 • When the input condition goes active, the decimal number 157 is transferred to the
data register D2 and stored in the register binary form. The decimal number (K) is
automatically converted to binary before it is transferred.
K157
D2 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1
128 64 32 16 8 4 2 1
5-9
3 • When the input condition goes active, the 4A9DH is transferred to the data register
D3.
H4A9D
32768
16384
64
32
16
8192
4096
2048
1024
512
256
128
8
4
2
1
weight
• Use the MOV instruction when the target data is changing and needs to be read
frequently.
To read the fixed data such as setting data, or data required to identify the cause of
abnormal condition, use the MOVP instruction.
• The following both of programs function the same.
X4 X4
MOVP K157 D2 PLS M1
M1
MOV K157 D2
Intelligent
Constant
Pointer
steps
Digit
function
(system user) register (H) Direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
S
MOV S D *
D
* The number of steps varies by the device used.
5 - 10
Check Operation The CPU is in RUN
Input X2, X3, X4, X5, and X7 is ON.
• Enter "D0" in the Device batch monitor dialog box and click the Start monitor
button.
Enter "D0".
Click after
entering the
device number.
5 - 11
Current values of timer
and counter. (They changes.)
16
64
32
256
512
8192
4096
2048
128
1024
16384
1
weight
Sign bit
19101
5 - 12
• Change the displayed decimal numbers into hex.
Select hex in the device batch monitoring dialog box.
Numbers in D3 Numbers in D2
5 - 13
Path name A: SCHOOL
Project name QEX7
Program name MAIN
Ladder Example
Create the following ladder with the GX Developer and write it to the CPU of the
demonstration machine to check if the MOV instruction works properly.
X0
0 MOV K200 D0
MOV D0 D1
X1
5 RST D0
RST D1
Operating Procedure
See Section 4.4 Operating Procedure for the detailed procedure of the following
operations.
3) Move the cursor to "2" of "MOV K200 D0" and write "1" over the "2".
5 - 14
Operation Practice
Check that "200" is displayed under both D0 and D1 on the monitor screen when X0
on the control panel of the demonstration machine is turned ON.
X0
0 MOV K200 D0
200
MOV D0 D1
200 200
X1
5 RST D0
RST D1
10 END
5 - 15
Path name A: SCHOOL
Project name QB-12
Program name MAIN
5.2.2 BIN (P) BCD BIN data conversion instruction
K1500
T0
C10
S D
X0
30 BIN K4X20 D5
X0
34 MOV K4X20 D6
Becomes 0.
• As the ordinary digital switches generate BCD codes, the BIN instruction can be used
to write data of the digital switches to the PLC.
4096
512 1 2 3 4 Digital switch
32
16
+ 4 8 4 2 8 4 1 8 4 8 2 1
K4X20
4660
X2B
X2D
X2F
X2A
X27
X26
X25
X24
X23
X22
X21
X20
X2E
X2C
X29
X28
D6
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 When the BCD code is input
without conversion.
· ·
256
64
32
512
8192
4096
2048
128
1024
16384
16
1024
128
64 D5
16 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0 When the BCD is converted
+ 2
to binary code.
8192
4096
32
64
16384
2048
16
256
512
· ·
128
1024
1234
5 - 16
K4X20
• As each of the word devices D (data register), T (timer current value), and C (counter
current value) consist of 16 bits (1 word), transferring the data is performed in units of
device.
• Using 16 bit devices (such as X, Y, and M) allows you to handle 16-bit data. To do
that, the numbers allocated to the 16 bit devices must be in consecutive order.
• Four bit devices allow you to handle data in units of 4 bits.
1 2 3 4 Place (digit)
8 4 2 8 4 1 8 4 8 2 1 K4 X20
X2D
X2C
X2E
X2B
X2A
X2F
X29
X28
X27
X26
X25
X24
X23
X22
X21
X20
First Number
Specify to read K2X28 K1X20
Read one-digit data "4".
two-digit data "12". (X2F to X28) (X23 to X20)
K2X20
Read two-digit data "34".
(X27 to X20)
K3X20
Read three-digit data "234".
(X2B to X20)
K4X20
Read four-digit data "1234".
(X2F to X20)
As long as four bit devices to read 4-digit data are in consecutive order, any bit device can be the first one.
• Other bit devices can be used in the same way as described above.
M M M M M M M M M M M M M M M M M M M M
(Internal relay M) 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
K2M6 K1M0
K3M5
Applicable Device
Pointer
Direct function
(system user) register register
Jn module
Un G
Bit Word R Bit Word Z K H P I N
S K1
BIN S D to 3
D
K4
5 - 17
Path name A: SCHOOL
Project name QB-13
Program name MAIN
5.2.3 BCD (P) BIN BCD data conversion instruction
K50
X7 T0
0 T0
K1500
T0
C10
S D
X6
37 BCD T0 K2Y40
• As the ordinary digital displays display numbers using BCD code, the BCD instruction
can be used to display data of the PLC (current timer and counter values, operation
results).
16384
8192
4096
2048
1024
512
256
128
64
32
16
1024
8
128 C10
32 0 0 0 0 0 1 0 0 1 0 1 1 1 1 0 1
16 (BIN)
8
4
+ 1
1213 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 1
(BCD)
Y5D
Y5C
Y5E
Y5B
Y5A
Y5F
Y59
Y58
Y57
Y56
Y55
Y54
Y53
Y52
Y51
Y50
K4Y50
8 4 2 8 4 1 8 4 2 8 4
Digital display
5 - 18
Allowable Range with BCD Instruction
• The allowable range of data to be displayed by the BCD instruction (to be converted
from BIN to BCD) is between 0 and 9999. Any data that falls outside the range cause
an error.
(Error code 50: OPERATION ERROR)
• When you want to display the current timer value that exceeds 9,999, use the DBCD
instruction. The instruction allows you to handle 8-digit data up to 99,999,999.
COM
Y4D
Y4C
Y4E
Y4B
Y4A
Y4F
Y53
Y52
Y51
Y50
Y49
Y48
Y47
Y46
Y45
Y44
Y43
Y42
Y41
Y40
8000
4000
2000
1000
80
40
20
10
80000
40000
20000
10000
800
400
200
100
8
4
2
1
Output Power
0 0 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 1 0 1
K18000
X3
0 T5
Applicable Device
Constant
Pointer
Internal device File Index
Level
Digit
Direct function
(system user) register register
Jn module
Un G
Bit Word R Bit Word Z K H P I N
S K1
BCD S D to 3
D
K4
5 - 19
Path name A: SCHOOL
Project name QEX8
Program name MAIN
Ladder Example
Create the following ladder with GX Developer and write it to the CPU of the
demonstration machine to check if the BCD instruction works properly.
X0 K10
0 C0
BCD C0 K2Y40
X1
8 RST C0
Operating Procedure
Refer to Section 4.4 Operating Procedure for the detailed procedure of the
following operations.
Operation Practice
Check that the current value of C0 is displayed on the Y40 to Y47 BCD digital displays
when the X0 on the control panel is turned ON several times. The C0 is reset by
turning the X1 ON.
Y5F to Y5C Y5B toY58 Y57 to Y54 Y53 to Y50 Y4F to Y4C Y4B to Y48 Y47 to Y44 Y43 to Y40
0 - 10
Displays the value of C0
BCD Didital Display
____
Related Practice Question Practice Question 6
5 - 20
5.2.4 Example of specifying digit for bit devices and data transfer
K2M100 1 0 0 0 1 1 0 1
No change.
M15 M8 M7 M0
K2M0 0 0 1 1 0 1 0 0
No change. 3 4
K2M100 0 0 0 0 1 1 0 1
5 - 21
Path name A: SCHOOL
Project name QB-14
Program name MAIN
5.2.5 FMOV (P) FMOV (Batch transfer of the same data)
S D n
X3
0 FMOVP K365 D0 K8
X4
5 FMOVP K7000 D8 K16
S D n
X5
10 BMOVP D0 D32 K16
X6
15 FMOVP K0 D0 K48
Operation Practice
Input condition S D n
FMOVP K365 D0 K8
FMOV
• When the input condition is activated, the FMOV instruction starts to transfer the data
specified in S to the specified number ( n ) of devices starting from the device
specified in D .
Example The FMOV instruction performs the following operation when X3 is
turned ON.
D
365 D0
S
365 D1 n
K365 365
365 D2 8 devices (K8)
365 D7
Example
Input condition Equal
Input condition
FMOV K0 D0 K8 RST D0
RST D1
RST D7
Only one FMOV instruction can be substituted for many RST instructions as shown
above.
5 - 22
Input condition S D n
BMOV
• When the input condition goes active, the BMOV instruction performs the batch
transfer of the data stored in the specified number ( n ) of devices starting from the
device specified in S , to the specified number ( n ) of devices starting from the
device specified in D .
...
...
...
...
...
...
...
...
...
...
Available device
Constant
Pointer
Internal device File Index
Level
Digit
Direct function register
(system, user) register
Jn module
Un G
Bit Word R Bit Word Z K H P I N
(Note) (Note) (Note)
S K1
FMOV S D n
to 4
BMOV S D n D
K4
n
(Note) Not available in BMOV instruction.
5 - 23
Operation Practice
• Write the program on the previous page to the CPU, and run the CPU.
• Follow the following steps to perform device batch monitoring. The contents from D0
to D47 can be monitored.
After writing to PLC Select [Online] [Monitor] [Device batch].
Enter the device "D0" in the device batch monitor dialogue box.
Select “Word” for the monitor type.
Click the Start monitor button.
[Monitor screen]
1) Turn X3 ON.
The numeric value 365 is
sent to eight registers
starting from D0 to D7 all at
once.
2) Turn X4 ON.
The numeric value 7000 is
sent to 16 registers starting
from D8 to D23 all at once.
3) Turn X5 ON.
The contents of the 16
registers starting from D0 to
D15 are sent to the 16
registers starting from D32 to
D47 all at once.
4) Turn X6 ON.
"0" is sent to the all 48
registers starting from D0 to
D47 all at once. In other
words, all the 48 registers
are cleared to 0 at a time.
5 - 24
Reference
• If a bit device is specified as D , the operation becomes as follows;
FMOV instruction
Input condition S D n
FMOV D0 K2Y40 K4
As D is specified
with two-digit numbers,
S
these data are ignored. D D
D0 (Example: when the content is 365.)
• Among the device from Y40 to Y5F, the devices specified as "1" are output first.
• Programming as shown below allows you to turn ON the output of Y40 to Y5F all at
once by activating the input condition (1), or to turn OFF the output of Y40 to Y5F at
a time by activating the input condition (2).
Input condition
FMOV K255 K2Y40 K4
FMOV K0 K2Y40 K4
D1 3 0 5 7 5 7 5 1
n
D D 4 pieces (K4)
D2 3 0 5 6
Y5F to Y58 Y57 to Y50
D3 3 0 5 5 5 5 5 6
• The product codes (hexadecimal numbers) are stored in the devices from D0 to D3
as shown above. The instruction is useful for displaying and monitoring the last two
digits that represent their types.
5 - 25
Path name A: SCHOOL
Project name QEX9
Program name MAIN
Ladder Example
Create the ladder chart shown below using GX Developer, write the chart into the
demonstration machine, and confirm if the FMOV instruction is correctly performed.
X0
0 FMOV K200 D0 K5
X1
5 FMOV K0 D0 K5
Operating Procedure
The following procedures are the same as the Operating Procedure described in
Section 4.4.
(1) Create a new project
(2) Create a program
(3) Write to the PLC
(4) Monitor the ladder
Operation Practice
Make sure that the contents of the devices from D0 to D4 become 200s on the batch
monitor screen by turning X0 ON on the control panel of the demonstration machine.
The data in the devices are cleared by turning X1 ON.
Change the setting of the device batch monitor as shown below to display the
numbers in decimal, hexadecimal, or binary numbers.
Numeric value: decimal………..displays the numbers in decimal.
Numeric value: hexadecimal…..displays the numbers in hexadecimal.
Monitor type: bit…………………displays the numbers in binary.
5 - 26
Path name A: SCHOOL
Project name QB-15
Program name MAIN
5.3 Comparison Operation Instruction
= <> >
Size
comparison
>= < <=
K100
X3 SM413 (2 s clock)
0 C10
X4
6 BCD C10 K4Y40
SM400 (ON at all times) S1 S2
10 > K10 C10 Y70
S1 S2
15 <= K10 C10 Y71
• The comparison operation instruction compares the data of source 1 ( S1 ) and source
2 ( S2 ), and brings the devices into conduction if the conditions are met.
• The instruction can be considered as one normally open ( ) as they are only
conducted when the conditions are met.
5 - 27
Operation Practice
• Write the program to the CPU.
• Turn ON both X3 and X4.
• C10 starts to count (one count every two seconds). The current counted value is
displayed on the digital display (Y40 to Y4F).
• Make sure that the devices Y70 to Y76 turn ON as follows.
Applicable device
Pointer
Internal device File Index
Level
Digit
direct function
(system, user) register register
Jn module
Un G
Bit Word R Bit Word Z K H P I N
S1 K1
Comparison
instruction
S1 S2 to 3
S2
K4
5 - 28
Path name A: SCHOOL
Project name QEX10
Program name MAIN
Ladder Example
Read the following ladder diagram from FD, write it to the demonstration machine,
and make sure that , instructions are correctly performed.
0s T0 3s Y70: ON, 2.7 s T0 3.3 s Y71: ON,
3s T0 6s Y72: ON
Y70:ON Y71:ON Y72:ON
T0:
0 2.8 2.9 3.0 3.1 3.2 6.0 s
X0
0 SET M0
M0 M10 K60
2 T0
T0
8 M10
M20
10 > K30 T0 Y70
BCD T0 K2Y40
X1
33 RST M0
Operating Procedure
Click
5 - 29
• Click beside "Project drive" and select [-a-] to display "SCHOOL" and the
path name.
• Double-click on "SCHOOL".
Click
After setting the project
name, click the button.
The following procedures are the same as the Operating Procedure in Section 4.4.
(2) Write to the PLC
(3) Monitor the ladder
5 - 30
Operation Practice
• Turn X0 ON, and make sure that the program works properly.
X0
X0
0 SET M0
K60
2 T0
30
T0
8 M10
35 END
____
Related Practice Question Practice Question 8
5 - 31
5.4 Arithmetic Operations Instruction
S D
X2
0 +P K5 D0
1
S1 S2 D
X3
4 +P D0 K100 D1
2
D0 + (5) D0
(Input condition)
First ON 0 (Assumption) + 5 5
Second ON 5 + 5 10
Third ON 10 + 5 15
D0 contents are changed
D0 + (100) D1
(Input condition)
ON 15 (Assumption) + 100 115
D0 contents are not changed.
CAUTION
• +P or
should always be used for add-subtract instructions.
-P
• When + or - is used for the instructions, add-subtract operation is
performed upon every scanning. To use + or - for the instructions,
operands must have been converted to pulse beforehand.
X2 X2
+P K5 D0 PLS M0
M0
+ K5 D0
REFERENCE
• The following two instructions work on the same principle in add-subtract operation.
(Addition)
+P K1 D0 INCP D0
(Subtraction)
-P K1 D2 DECP D2
5 - 32
Path name A: SCHOOL
Project name QB-17
Program name MAIN
X4
0 MOVP K1000 D2
S D
X5
3 -P K10 D2
3
S1 S2 D
X6
7 -P D2 K50 D3
4
3 • The device content specified as S is subtracted from the device content specified
as D , and the result is stored in D device every time the input condition is turned
ON.
D S D
D2 - (10) D2
(Input condition)
First ON 1000 - 10 990
(Assumption) - 10 980
Second ON 990 - 10 970
Third ON 980
D2 contents are changed.
4 • The device content specified as S2 is subtracted from the device content specified
as S1 and the result is stored in D device when the input condition is turned ON.
S1 S2 D
D2 - (50) D3
(Input condition)
ON 970 - 50 920
(Assumption)
D2 contents are not changed.
Applicable device
Basic number of steps
Intelligent
Constant
Pointer
Digit
function
(system, user) register (H) direct Jn register
module
Un G
Bit Word R Bit Word Z K H P I N
Add-substract S S1 K1 3
instruction
S D
Add-substract S2 to
instruction
S1 S2 D
D K4 4
The basic number of steps becomes four steps for S1 S2 D type.
5 - 33
Path name A: SCHOOL
Project name QEX11
Program name MAIN
Ladder Example
Create the ladder diagram shown below with GX Developer, write it to the
demonstration machine, and confirm if "+, - instructions" work properly.
X0
0 BINP K4X30 D0
BINP K4X20 D1
+P D0 D1
X1
10 BINP K4X30 D0
BINP K4X20 D1
-P D0 D1
20 >= D1 K0 DBCD D1 K5Y40
26 < D1 K0 Y70
DMOV K0 K5Y40
Operating Procedure
The following procedures are the same as Operating Procedure described in
Section 4.4.
(1) Create a new project
(2) Create a program
(3) Write to the PLC
(4) Monitor the ladder
5 - 34
Operation Practice
(1) When X0 is turned ON, the addition of data in X30 to 3F and data in X20 to 2F is
performed, and the result is output to Y40 to Y53.
(2) When X1 is turned ON, the subtraction of data of X30 to 3F and data of X20 to 2F
is performed, and the result is output to Y40 to 53. When the result is negative
value, Y70 is turned ON while Y40 to 53 are cleared to 0.
X0
0 BINP K4X30 D0
300
BINP K4X20 D1
400
+P D0 D1
300 400
X1
10 BINP K4X30 D0
300
BINP K4X20 D1
400
-P D0 D1
300 400
20 >= D1 K0 DBCD D1 K5Y40
400 400
26 < D1 K0 Y70
400
DMOV K0 K5Y40
34 END
+ D0 D1 = D1 + D0 D1
100 + 300 400
5 - 35
Path name A: SCHOOL
Project name QB-18
Program name MAIN
5.4.2 * (P) BIN 16 bit multiplication
X0
0 MOVP K2000 D0
S1 S2 D
X2 1
3 *P K30 D0 D10
S1 S2 D
X3 2
7 /P D0 K600 D20
16 bit (1 word) is not enough for storing the This device is handled as 32-bit register to
result of 16-bit data x 16-bit data. hold the result. Left-most bit of D10 (b15) is
Thus, D10 that is specified by the program not a sign bit.
and D11, which is the next device number, It is handled as a part of the data.
work as the holder of the result.
The instructions should be handled as 32-bit when programming using the calculation result of the
(P) instruction. (e.g. DMOV instruction, DBCD instruction)
5 - 36
2 • The device content specified by S1 is divided by the device content specified by S2
when the input condition is turned on, and the result is stored in the device specified
by D .
S1 S2 D
D0 K600 D20 D21
2000 ÷ 600 = 3 200
Quotient Remainder
and
Quotient goes to D20 specified by Remainder goes to D21, which is the
the program. next device number.
Digits after the decimal point of the operation result are ignored.
• If a bit device is specified as D , the quotient is stored, however, the remainder is not
saved.
• Examples when handling negative values are explained below.
Example -5 ÷ (-3) = 1, remainder
-2
5 ÷ (-3) = -1, remainder 2
• Examples when dividing a number by 0, or dividing 0 by a number are explained
below.
Example 0÷0
Error “OPERATION ERROR”
1÷0
0÷1 Both quotient and remainder are 0
Operation Practice
• Write the program to the CPU and run the program.
• Turn X0 ON and store "2000" (BIN value) into D0.
• Turn X2 ON. The following operation is performed.
If the "60000" (operation result of D11 and ) is handles as 16-bitD10
integral number and only D10 is monitored, "-5536" is displayed. To avoid this,
follow the procedures on the following pages.
S1 S2 D
K30 D0 = D11 D10
(30) (2000) (60000)
• Turn X3 ON.
S1 S2 D
D0 K600 = D21 D20
(2000) (600) (200) (3)
Remainder Quotient
Applicable device
Basic number of steps
Pointer
Digit
direct function
(system, user) register register
Jn module
Un G
Bit Word R Bit Word Z K H P I N
S1 K1 *
Multiply-division
instruction
S1 S2 D S2 to
D K4 4
The basic number of steps for multiplication instruction is three or four steps, and that for division instruction is four steps.
* The multiplication instruction varies depending on the device to be used.
5 - 37
• How to monitor 32-bit integral number data
If the operation result of the multiplication instruction is out of the range from 0 to 32,767,
the result cannot be displayed properly when the number is handled as 16-bit integral number and
the contents of the lower register are monitored in ladder.
To monitor those numbers correctly, follow the steps below (device registration monitor operation).
5 - 38
Continued from the previous page
• Enter "D10" in the device edit box on the device registration dialogue box.
• Click on the display edit box, and select "32-bit integral number".
• Click the Register button. The items are displayed on the device registration monitor dialogue box.
1) Enter "D10".
5 - 39
Path name A: SCHOOL
Project name QEX12
Program name MAIN
Ladder Example
Create the ladder chart shown below with GX Developer, write it to the
demonstration machine, and make sure that "*, / instructions" can be performed
X0 properly.
0 BINP K4X30 D0
BINP K4X20 D1
*P D0 D1 D10
BINP K4X20 D1
/P D0 D1 D20
Operating Procedure
The following procedures are the same as the Operating Procedure described in
Section 4.4.
(1) Create a new project
(2) Create a program
(3) Write to the PLC
(4) Monitor the ladder
5 - 40
Operation Practice
(1) When X0 is turned ON, the data of X20 to 2F is multiplied by that of X30 to 3F, and
the result is output to Y40 to 5F.
(2) The data of X20 to 2F is divided by that of X30 to 3F when X1 is turned ON. Its
quotient is output to Y50 to 5F, and the remainder is output to Y40 to 4F.
X0
0 BINP K4X30 D0
6
BINP K4X20 D1
3
*P D0 D1 D10
6 3 18
DBCDP D10 K8Y40
18
X1
13 BINP K4X30 D0
6
BINP K4X20 D1
3
/P D0 D1 D20
6 3 0
BCDP D20 K4Y50
0
BCDP D21 K4Y40
0
30 END
D0 x D1 = D10
6 x 3 = 18
As the operation result of this example is in the range from 0 to 32767, the result is displayed
properly even though the number is handled and monitored as 16-bit integral number.
5 - 41
5.4.3 32-bit data instructions and their necessity
• The data memory of Q-series PLC, which consists of 16-bit, is a memory of 1-word
unit. The memory generally processes transfer, comparison, and arithmetic
operations in 1-word unit.
• Q-series PLC also supports 2-word (32-bit) unit. In this case, add "D" at the head of
each instruction to indicate that the instruction is handled as 2-word. The following
shows the examples:
1-word 2-word
Data
16-bit 32-bit
Instruction
MOV(P) DMOV(P)
Transfer BIN(P) DBIN(P)
BCD(P) DBCD(P)
<, >, < = D <, D >, D < =
Comparison
> =, =, < > D > =, D =, D< >
Four arithmetic + (P) D + (P)
operations - (P) D - (P)
* (P) D * (P)
/ (P) D / (P)
Available range of - 32768 0 - 2147483648
numbers to to to
32767 9999 2147483647
Numbers in parentheses are for 0
BIN (P), BCD (P) instructions. to
99999999
Numbers in parentheses are for
BIN (P), DBCD (P) instructions.
Available range of
K1 to K4 K1 to K8
digits
64
32
16
8
4
2
1
512
256
128
As in the case of handling 16-bit data, the PLC handles a 32-bit negative value in
two’s complement form. Therefore, the leftmost bit (B15 for 16-bit) is regarded as a
sign bit.
b31 · · · · · · · · · · · · · · · · · · · · · · · · · · · · b0 Allowable range
-2147483648 to 0 to 2147483647
5 - 42
• Determine if the data should be handled in 2-word (32-bit) unit or not depending on
the data size.
In the following conditions, 2-word instructions must be used.
1) When the data size exceeds the range ( 32768 to 32767) that can be
dealt with by 1 word.
S D
DMOV K50000 D0
* D0 D1 D10
BCD conversion
D43 D42
(Remainder)
5 - 43
Path name A: SCHOOL
Project name QB-19
Program name MAIN
5.4.4 Calculation examples of multiplication/division that include decimal points (in the case where an
arithmetic operation instruction " " or "/" is used)
*
Example 1 Calculation example to determine a circle's perimeter
Numeric value of the digital switch × 3.14
(K4X30) (Circle ratio)
Displays integral part and Displays decimal fraction part
(K8Y50) (K2Y48)
• Programming method
Specify the circle ratio as 314 (3.14 x 100), and divide the result by 100 afterward.
Example 2 Calculation example to handle decimal places (division example)
Numeric value of the digital switch ÷ 0.006
(K4X30)
Displays quotient and Displays remainder
(K8Y50) (K4Y40)
• Programming method
In order to deal with 0.006 as an integer 6, both the dividend and divisor have to be
multiplied 1,000 times.
X0 X1
Ordering Example 1
BINP K4X30 D0 Digital switch set value is taken into D0 .
calculation
*P D0 K314 D1 D0 x 314 → D2 D1
MOV K0 K2Y40
X1 X0
Ordering Example 2
BINP K4X30 D20 Digital switch set value is taken into D20 .
calculation
REMARK
QCPU has instructions that can handle actual (floating point) operation data for
highly accurate operations.
As long as you use the instructions, you don’t have to pay careful attention
concerning the place of the decimal point as shown above.
5 - 44
5.5 Index Register, File Register
• The index register (Zn) is used to indirectly specify the device number. The result of
an addition of data in the index register and the directly specified device number can
be specified as the device number.
Example
D0Z0 Can be interpreted as D(0 + Z0)
Device number.
For example, if Z0 is 0, the device number becomes D0.
if Z0 is 50, the device number becomes D50.
CAUTION
The index register cannot be used for indirectly specifying the timer or the counter
coil.
Example K100
TOZ
K50
COZ
5 - 45
Application Example
• The data is written to the data register whose number is specified with the digital
switch.
K3000
T2
0 T2
X0
5 BINP K2X20 Z0
MOVP T2 D0Z0
5 0
X27 - X20
Z0 = 50
D0Z0 = D50
5 - 46
5.5.2 How to use file register R
• The file register (R) is a register that consists of 16 bits as well as the data register
(D).
• The file register applies to the standard RAM of the QCPU and the memory cards
(SRAM card, Flash card).
• The data in the file register remains after the reset operation or after the power is
turned off. To clear the data, write 0 to the file register by using the MOV(P)
instruction as such or write with GX Developer.
• Use [Write to PLC] of GX Developer or a sequence program to write to the standard
RAM or to the SRAM card.
• Use [Write to PLC (Flash ROM)] of GX Developer to write to the Flash card.
• Specify the area of the file register in 1K-point (1,024-point) unit using the parameter.
Application Example
• Set 32-K points of the file register R0 to R32767, and use them with the program.
• Follow the steps below to register the parameter.
5 - 47
(Continued from the previous page)
3) Click!
5) Click!
6) Click!
5 - 48
(Continued from the previous page)
7) Click!
10) Enter values! 10) Check to see that the device name is
changed to "R". Enter "100", "200", "300",
and "400" in R1, R2, R3, and R4 columns,
respectively.
(To clear, enter "0".)
5 - 49
(Continued from the previous page)
14) Click!
• Check that 100 to 400 are written in the R1 to R4 columns by using the device batch
monitor.
The operating procedure is the same as the one described in Section 5.2.1.
• To write or clear the data of the file register with the program, write the program
below.
For the operating procedure, refer to Section 4.4.
Writing
X0starts when X0 is turned on, and the data is cleared when X1 is turned on.
0 MOV K173 R5
5 - 50
5.6 External Setting of the Timer/Counter Set Value, and the External Display of the Current Value
The timer and the counter can be specified either by K (decimal constant) directly or by
D (data register) indirectly. Programming as described below allows the set value to be
changed with the external digital switch.
X0 Digital switch
0 BINP K4X20 D5 X2F to X20
D5 1 2 3 4
X4
4 T10
T10 D5 1 2 3 4
9 Y70 D5
SM400 T10
11 BCD T10 K4Y40
X1
Digital display
15 BINP K4X30 D6
Y4F to Y40
D6
X5
19 C10
Displays the current value of T10.
C10
24 Y71
X6
26 RST C10
SM400
31 BCD C10 K4Y50
Operating Procedure
The step (1) of the following procedure is the same as that of Operating Procedure
described in Section 5.3.
The steps (2) to (4) of the following procedure are the same as that of
Operating Procedure described in Section 4.4.
5 - 51
Operation Practice
(1) External setting of the timer set value and display of the current value
Set the timer set value in the digital switch (X20 to 2F), and turn the X0 switch
ON.
When the X4 switch is turned ON, Y70 turns ON after the set time specified
with the digital switch elapses. (e.g. Y70 turns ON after 123.4 s elapsed if you
entered 1 2 .)3 4
The digital display (Y40 to 4F) shows the current value of the timer T10.
(2) External setting of the counter set value and display of the current value
Set the counter set value for the digital switch (X30 to 3F), and turn the X1
switch ON.
Turn the X5 switch ON and OFF repeatedly. Y71 turns ON when the number
of
times that X5 is turned ON reaches the number specified with the digital
switch.
The digital display (Y50 to 5F) shows the current value of the timer C10 (the
number of the times that X5 is turned on).
Turning the X6 switch on clears the counter C10 to 0. If the contact C10 is
already turned on, the contact is released.
5 - 52
Path name A: SCHOOL
Project name QTEST5
Program name MAIN
5.7 Practice Question
Temporarily send the eight input conditions (X0 to X7) to D0, and then output them
toY70 to Y77.
(e.g. Y70 turns ON when X0 is turned ON)
X0 Y70
X1 Y71
X2 Y72
X3 Y73
X4 Y74
X5 Y75
X6 Y76
X7 Y77
Fill in the blank square of the program below, create a program with GX Developer and
check to see if it works properly with the demonstration machine.
SM401
0 MOV 1) F3
D0
MOV D0 2)
F3
Hint
CPU
Comparison
The program created by the sequence instruction without MOV instruction is shown on
the next page.
X0
0 Y70
X1
2 Y71
X2
4 Y72
X3
6 Y73
X4
8 Y74
X5
10 Y75
X6
12 Y76
X7
14 Y77
5 - 53
Path name A: SCHOOL
Project name QTEST6
Program name MAIN
5.7.2 Practice Question (2) BIN,BCD conversion
Show the number of times that X1 is turned ON on the display connected to Y40 to
Y4F in BCD. The counter (C0) set value should be input with the digital switch (X20 to
X2F) after X0 is turned ON.
Fill in the blank square of the program below, create a program with GX Developer and
check to see if it works properly with the demonstration machine.
X1 1)
0 C0
X0
5 BIN 2) D0
SM401
9 3) C0 4)
X2
13 RST C0
F3
Hint
CPU
BIN D0
BCD value
C0 BCD
X1:ON/OFF
BIN value BCD digital display
Y40 to Y4F(K4Y40)
1)
2)
3)
4)
5 - 54
Path name A: SCHOOL
Project name QTEST7
Program name MAIN
5.7.3 Practice Question (3) FMOV
Fill in the blank square of the program below, create a program with GX Developer and
check to see if it works properly with the demonstration machine.
X0
0 FMOV K255 1) 2)
X0
5 FMOV 3) K2Y40 K8
Hint
CPU The constant should be output from the CPU in binary form.
(Output cards)
255
1 Y40 Outputting 255 from Y40, for example.
1
Y41 128 64 32 16 8 4 2 1
1
1 Y42 1 1 1 1 1 1 1 1 = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255
1 Y43
1 Y47 Y46 Y45 Y44 Y43 Y42 Y41 Y40
1 Y44
1 Y45 The question deals with 64-point (Y40 to Y7F) outputs.
How many blocks are required for 255 on an output unit basis?
Y46
Y47
MOV
1)
2)
3)
Comparison
The program created by the sequence instruction without FMOV instruction is shown
below. The number of steps used is 130.
X0
0 Y40
Y41
Y42
Y7F
5 - 55
Path name A: SCHOOL
Project name QTEST8
Program name MAIN
5.7.4 Practice Question (4) Comparison instruction
Use the two BCD digital switches, perform (A-B) operation and show the result on the
BCD digital display (Y40 to Y4F).
Fill in the blank square of the program below and check to see if it works properly with
the demonstration machine.
X0
0 1) K4X20 D0
2) K4X30 D1
-P D0 D1
3) K0 D1 SET Y70
F3
MOV K0 K4Y40
4) K0 D1 BCD D1 K4Y40
RST Y70
F3
Hint
The constant should be output from the CPU in binary form.
− D0 D1 = D1 - D0 → D1
1)
2)
3)
4)
5 - 56
Path name A: SCHOOL
Project name QTEST9
Program name MAIN
5.7.5 Practice Question (5) +,-
When X0 turns ON, create a program that imports the value specified by the digital
switch (X20 to X2F) into D3 and D2 (32-bit data), adds them to D1 and D0 and shows
the result on the display (Y40 to Y5F).
Also, when X1 turns ON, the program should import the value specified by the digital
switch (X20 to X2F) into D5 and D4, subtract them from D1 and D0 and show the
result on the display. If the result becomes a negative number, the program should turn
Y77 ON and show the absolute value on the display in two’s complement form.
Fill in the blank square of the program below and check to see if it works properly with
the demonstration machine.
X0
0 DBIN K4X20 D2
Adds the external set value to D0.
1) D2 D0
Only displayed
9 D<= K0 D0 DBCD D0 K8Y40 when the result is a positive number.
X1
17 DBIN K4X20 D4 Subtracts the external set value
from D0.
2) D4 D0
X0
26 PLS M1
F3
X1
M1
30 D> K0 D0 DCML D0 D8 If the result is a negative number,
it is converted and displayed
D+P K1 D8 as a positive number (determines
the negative absolute value).
DBCD D8 K8Y40
1)
2)
Reference
Complement (Deny transfer)
M1 D1 D0
D> K0 D0 DCML D0 D8
b31 b30 b18 b17 b16 b15 b14 b2 b1 b0
Before executing DCML
(negative value) 1 1 1 0 1 1 0 0 1 0
D + P K1 D8
D9 D8
The absolute value is determined
After executing DCML 0 0 0 1 0 0 1 1 0 1
by calculating two's complement
of D0 and D2 (32-bit data). D9 D8
After executing both D + P
(absolute value)
0 0 0 1 0 0 1 1 1 0
If 16-bit data is a negative number, it is changed to the absolute value using NEG
(two’s complement) instruction.
REMARK
The CML instruction inverts S bit pattern and transfers it to D when the input
condition is turned ON.
Input condition S D
CML D0 D10
5 - 57
Path name A: SCHOOL
Project name QTEST10
Program name MAIN
5.7.6 Practice Question (6)
*, /
The multiplication/division data can be set by turning X0 ON. When X2 is turned ON,
the BIN multiplication of the value specified with the digital switch X20 to X27 and X30
to X37 is performed, and a division is performed when X3 is turned ON. The result of
the multiplication or the quotient of the division is displayed on the BCD display of Y40
to Y4F, and the remainder is displayed on the BCD display of Y60 to Y67.
(X30 to X37) × (X20 to X27) (Y40 to Y4F)
(X30 to X37) ÷ (X20 to X27) (Y40 to Y4F)……(Y60 to Y67)
Fill in the blank square of the program below, create a program with GX Developer and
check to see if it works properly with the demonstration machine.
X0
0 1) K2X30 D0
2) K2X20 D1
X2 X3
7 3) D0 D1 D2
X3 X2
12 4) D0 D1 D2
SM401
18 5) D2 K4Y40
6) D3 K2Y60
Hint
D0 D1 D3 D2
BIN-
multiplication
BIN value BIN value 0 BIN value
D0 D1 D2 D3
BIN-division BIN value BIN value BIN value BIN value
1)
2)
3)
4)
5)
6)
5 - 58
Path name A: SCHOOL
Project name QTEST11
Program name MAIN
5.7.7
*
Practice Question (7) D , D/
Create a program that performs the BIN-multiplication of the value specified with the
5-digit digital switch (X20 to X33) by 1100 when X2 is turned ON. If the result is less
than 99999999, show the result on the 8-digit display (Y40 to Y5F).
The program should perform the BIN-division of the value specified with the 8-digit
digital switch (X20 to X3F) by 40000 when X3 is turned ON. If X4 is ON, show the
quotient of the result on the 8-digit display (Y40 to Y5F). If X4 is OFF, show the
remainder on the same display.
(X20 to X33)×1100 (Y40 to Y5F)
Quotient (Y40 to Y5F) X4 ON
(X20 to X3F)÷40000
Remainder (Y40 to Y5F) X4 OFF
Fill in the blank square of the program below, create a program with GX Developer and
check to see if it works properly with the demonstration machine.
X2 X3
0 DBINP K5X20 D0
1) K1100 D2
2) D0 D2 D4
Y077
4) K40000 D12
1)
2)
3)
4)
5)
6)
7)
5 - 59
Answers for the practice questions in Chapter 5
Question Answer
1) K2 X0
5
2) K2 Y70
1) D0
2) K4 X20
6
3) BCD
4) K4 Y40
1) K2 Y40
7 2) K8
3) K0
1) BIN P
2) BIN P
8
3)
4)
1) D P
9
2) D P
1) BIN
2) BIN
3) P
10
4) P
5) BCD
6) BCD
1) DMOV P
2) D P
3) DBIN P
11 4) DMOV P
5) D/P
6) D14
7) D16
5 - 60
CHAPTER 6 USING OTHER FUNCTIONS
With the clock function, the following items can be set in the clock elements
incorporated in the CPU; year, month, day, hour, minute, second, day of the week.
To enable the clock function, use GX Developer or a program.
To set or read the clock data, use GX Developer.
1) Click!
6-1
Reference
The following shows an example of using the clock function with a program.
( Project name QEX13)
Set time a few minutes ahead of actual time, and then write it to the PLC. When actual
time has reached the set time, turn on the input switch X7. Then the clock is activated.
6-2
6.2 Test Function at Online
X4 M10 K1500 1) Read the project from the user floppy disk (FD)
4 TO
0 using GX Developer.
BCD TO K4Y50
0
X6 T1 2) Write the parameter and program of the read
13 Y74
Y74
project to the CPU (PLC).
(The CPU must be at stop to do this.)
Y74 X6 K30 3) Set GX Developer to the monitor mode.
17 T1
0
23 END 4) Confirm a program displayed in the screen.
6-3
6.2.1 Turning device "Y" ON/OFF forcibly
1) Click!
2) Click to set!
2) The Device test dialog box appears. Click
"Device" and input "Y70" in the list box.
NOTE
If the CPU is in a RUN state, operation results of programs are given priority. For
this reason, stop the CPU first to make confirmation with the demonstration
machine.
POINT
To execute setting/resetting of contacts, changing a current value of word devices,
and forced outputs, it is also possible to use the test function while GX Developer is
monitoring ladders.
In the ladder-monitoring screen of GX Developer, double-click the contact or press
Enter key while holding the Shift key. This forcibly switches the contact
between closed and open.
To display the dialog box for changing current values, double-click the word device
or press Enter key while holding the Shift key in the ladder-monitoring
screen of GX Developer.
6-4
6.2.2 Setting and resetting device "M"
1) Click!
POINT
With the same procedure, bit devices other than internal relays (M) can also be set
and reset forcibly.
6-5
6.2.3 Changing a current value of device "T"
1) Click!
POINT
With the same procedure, word devices other than timers (T) can also be changed
in their current values.
6-6
6.2.4 Reading error steps
1) Click!
6-7
6.2.5 Remote RUN/STOP
1) Click!
3) Click!
6-8
6.3 Forced I/O Assignment by Parameter Settings
3) Click!
6-9
Check Using Demonstration Machine
The Write to PLC dialog box opens. Click the parameter of the target data, and then
click the Select button Execute button sequentially to write only the
parameter to the CPU. After that, activate the CPU and confirm the following.
1) A current value of the timer T0 disappears from the screen of the digital display
(Y50 to Y5F). Instead, the LEDs of Y70 to Y77 start flashing. These flashes
continue until the value reaches the set device value.
2) Outputting to Y70 and Y74 with X6 turned on does not m-+ake the LEDs of Y70
and Y74 flash.
Q61P-A1
Q02H Q02H
Power
CPU CPU Address 1 Address 5
supply [BCD T0 K4Y50]
Y5F to Y50
module Address 2 Address 6
Name plate
Address 3 Address 7
Q61P-A1
Q02H Q02H
Power
CPU CPU Address 1 Address 3
supply
Y5F to Y50
module Address 4
Name plate
[BCD T0 K4Y50]
Address 5
POINT
• Note that address 7 has been replaced with address 5. This means that a current
value of the timer T0 is output to the newly assigned address 5, and LEDs of Y70
to Y77 flash as they are connected to the address 5.
• Results of outputting to Y70 or Y74 cannot be confirmed on any displays as
address 7 for output modules no longer exists.
To display normally, change the device number from K4Y50 to K4Y30 and from
Y70-Y77 to Y50-Y57.
6 - 10
6.4 Using Retentive Timers
When an input condition is turned on, the coil is energized. Then the value of a
retentive timer starts increasing. Once a current value has reached the set value, a
retentive timer goes time out and its contact turns on. If the input condition is turned off
during that increase, the coil is de-energized but the current value is kept. To restart
the increase, which means to accumulate values, turn input conditions on again to
re-energize the coil.
X6 contact
X6 K50
ST1
ST1 coil
ST1
Y73 3.0 s 2.0 s
ST1 a contact
X7
RST ST1 X7 contact
(to input RST instructions)
ST1
current
value 0 30 30 50 50 0
Before using as a retentive timer, An RTS instruction must be used to turn off the contact and
specify the number of points in clear the current value after the retentive timer goes time out.
parameters.
In the example operation below, the retentive timer is set to ST0 to ST31.
6 - 11
(From previous page)
3) Click!
4) Enter!
5) Click!
6 - 12
6.5 Batch Replacement of Devices
In the example operation below, Y70 to Y9F (48 in total) are replaced with Y50 to Y7F
(48 in total) in batch.
1) Click!
0
X6 X1
Y70 0
X6 X1
Y50
6) Confirm that the target device numbers have
Y70 Y50
been properly replaced.
X4 M10 K1500 X4 M10 K1500
4 T0 4 T0
BCD TO K4Y50 BCD TO K4Y50
X6 T1 X6 T1
13 Y74 13 Y54
Y74 Y54
Y74 X6 K30 Y54 X6 K30
17 T1 17 T1
6 - 13
6.5.2 Batch switching of specified devices between normally open and normally close
Follow the procedure below to switch specified devices all at once between normally
open and normally close.
1) Click!
3) Click!
NOTE
Before exercising the contents in Section 6.6 after this section, be sure to store the
program in a personal computer to a CPU.
For how to write to a CPU, refer to Section 2.5.
6 - 14
6.6 Write During RUN
This function allows programs to be written to CPUs that are currently running.
2) Click!
3) Click!
NOTE
Note that to execute the write during RUN operation, the PLC CPU and GX
Developer must share an identical program before the modification. So, if it is not
for sure that those two programs are identical, verify them before modifying with GX
Developer and executing write during RUN.
6 - 15
6.7 Registering Devices
Various devices, including ones in separate locations on the ladder, can be monitored
all together in one screen.
1) Click!
2) Click!
6 - 16
(From previous page)
REMARK
To remove registered devices, click the Delete the device button.
6 - 17
6.8 Creating Comments
0.9S Flicker
Starts Operation
Timer 0.6
S NO.1
Activates trigger
Performs reset
6 - 18
(1) Flowchart of creating comments
Create comments
Printout the circuit with comments and devices for which contacts are used
*: The above procedure must be taken to designate the device comment range and write it to a CPU.
6 - 19
(2) Creating comments
3) Enter a comment!
3) Click a desired comment area, and input
desired character strings as shown on the left.
6 - 20
(From previous page)
4) Enter! 5) Click!
4) Click "Device" and input "Y70" in the list box.
Enter!
7) Enter! 8) Click!
6 - 21
(From previous page)
6 - 22
(3) Saving comments
1) Click!
2) Click!
6 - 23
(4) Displaying a ladder with comments in GX Developer screens
1) Click!
0.9S Flicker
Starts Operation
6 - 24
POINT
In addition to device comments, a ladder screen can be displayed with statements (comments on ladder
blocks) and notes (comments on outputs or instructions).
Statement
• Creating statements
Click and then double-click a ladder block where comments are to be attached.
The Enter line statements dialog box appears. Enter desired character strings, and then click the OK
button.
• Creating notes
Click and then double-click an output or instruction where comments are to be attached.
The Enter Note dialog box appears. Enter desired character strings, and then click the OK button.
• There are two types of statements and notes; "Embedded" and "Separate".
"Embedded" ...... The data of statements and notes is stored as a part of a program, so it is stored in a
CPU used in a factory as well. Note, however, that this takes a lot of space in program
memory of PLC CPUs.
"Separate" ......... The data of statements and notes is stored not as a part of a program but separately in
the peripheral device (personal computer). In this way, a program needs only one extra
step at a location. This requires less space in program memory on PLC CPUs.
Note, however, that after taking this way, changing programs at an FA site breaks
consistency between programs of GX Developer on the peripheral device (personal
computer) and PLC CPUs.
6 - 25
MEMO
6 - 26
CHAPTER 7 PROGRAMMING INTELLIGENT FUNCTION MODULES
REMARK
To use AnS series I/O modules or special function modules, install them on
QA1S65B or QA168B extension base unit.
[Main base unit]
7-1
7.2 Data Communication between Intelligent Function Modules and CPUs
An intelligent function module and a CPU exchange mainly two formats of data.
__________
Bit data Signals that use input Xs and output Ys
________
Word data 16-bit data or 32-bit data
QCPU Internal configuration of intelligent function module
(PLC CPU)
External I/F
X/Y
Function
Y, M, T, C, D, etc.
Input X
CPU
Device memory
Output Y (Bit data)
Program
Buffer memory
Read data
For exchanging signals of 1-bit between a QCPU and an intelligent function module,
input Xs and output Ys are used.
X/Y here does not mean external I/Os but symbols that are used in a sequence
program to exclusively represent I/O signals of intelligent function modules. Also note
that I/O numbers are assigned according to the slot where the intelligent function
module is installed.
[X]
Intelligent Xs in a sequence program represent signals
QCPU function module that are input to a QCPU by an intelligent
X
READY signal function module. These signals are
X generated on an intelligent function module.
X Note that the Xs are used as contacts in a
X program. The followings are examples of the
signals.
(1) READY signal
This signal notifies a QCPU that an
intelligent function module started up
Figure 7.3 X from intelligent function normally at power-on and is ready for
module operation.
(2) Comparison result
This signal is used by high-speed counter
modules. The modules compare an input count
value with the set value to notify a QCPU the
results of the comparison; larger (>), smaller
(<) or match (=).
[Y]
Intelligent function module SETs, RSTs, or OUT-Ys represent output
QCPU signals transmitted from a QCPU to an
intelligent function module. These signals are
generated on a QCPU. Note that they are
Output enable
Y used as coils or contacts in a program.
Y
Write to user range
Y (Ex.) D/A conversion modules output an
Channel change
Y
enable instruction (output enable)
Synchronous output
before outputting analog values that
Figure 7.4 Y from CPU were converted from digital values.
7-2
7.2.2 Data communication with intelligent function modules
....
Example of memory map: Q62DA Digital/Analog Conversion Module
(1) QCPUs can read and write buffer memory. Also note that some modules can write
data to buffer memory from peripheral devices via an interface.
(2) In buffer memory, space of one word (16 bits) is reserved for each intelligent
function module’s unique address.
The smallest address is 0, and these addresses are used to specify a target
module to read or write. The minimum unit is one word. 17- to 32-bit data is
treated as 2-word (32-bit) data.
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
0 0 0 1 0 0 0 1 0 1 0 0
Data part
Sign bit
1: Negative Indicated here is + 276.
0: Positive (Negative digital values are represented in complement of 2)
Figure 7.6 Example image of buffer memory content (D/A conversion module)
The buffer memory on Figure 7.6 shows an address of a D/A conversion module
in 16 bits. The number is obtained from digital quantity that a QCPU wrote to the
buffer memory. Digital values ranging from - 2048 to + 2047 can be set in signed
binary (16 bits long).
7-3
7.3 Communicating with Intelligent Function Modules
QCPUs provide the following methods for communicating with intelligent function
modules.
7-4
7.3.2 Using GX Configurator for communication
This section describes the procedure of using GX Configurator for communication with
intelligent function modules.
In the example operation below, Q64AD module/SW D5C-QADU is used.
Start
Install a module
Install an A/D conversion module on a specified slot.
Wiring
Connect external devices to an A/D conversion module.
Offset/gain setting
Offset/gain settings are necessary to use
the user range settings.
NO
Use GX Configurator?
YES
Programming, debug
Create and check sequence programs.
7-5
7.3.3 Data created by GX Configurator
The following data/files can be created with the GX Configurator package and also
used in GX Developer. Refer to the following figure to know in which operation each
data/file is needed.
Personal computer
USB
B A: Shows intelligent function module
parameters
RS-232
B: Shows data stored at text file creation.
Program
Parameter
PLC parameter
Network parameter
Intelligent function module parameter
(b) For how to perform 1) to 3) on the above figure, refer to the followings.
1) Use GX Developer as follows.
[Project] [Open project]/[Save]/[Save as]
2) Open the GX Configurator’s screen for selecting a module on which
parameter settings are to be made.
[File] [Open file]/[Save as]
3) Use GX Developer as follows.
[Online] [Read from PLC]/[Write to PLC] "Intelligent function
module parameters"
Or, open the GX Configurator’s screen for selecting a module on which
parameter settings are to be made. [Online] [Read from PLC]/[Write
to PLC]
<Text files>
(a) These files are text format files created using Text file creation
operation in the initial settings, auto refresh settings and the monitor/test
screen.
Use these files to create user’s documents.
7-6
7.4 Exercise System of Intelligent Function Module
Use an A/D or D/A conversion module to convert analog signals/digital data that are
input with the volume or digital switch on the demonstration machine.
QX QY Q64 Q62
Q61P QCPU QCPU* 42 42P AD DA
-A1 (No.1) (No.2) (64 (64 (16 (16
points) points) points) points)
(Channel 1) (Channel 1)
V V
* Not used in this document (A/D conversion value (Value to be D/A converted
(Keep them at stop) (Input D/A output value) is displayed) is displayed)
I/O panel
Digital display Digital display
(Y5F to Y50) (Y4F to Y40)
Digital switch
(X2F to X20)
1 4 0 2
Voltmeter for Voltmeter for
input voltage output voltage
Input volume
7-7
7.5 Q64AD Analog/Digital Conversion Module
Q64AD
1) RUN
2) ERROR
V+ 1
C V- 2
H
1
I+ 3
SLD 4
V+
5
C
H
V-
6
2 I+
7
SLD
8
V+
9
C V-
H
3 I+
10
SLD
11
V+ 12
C V- 13
H
4 I+ 14
SLD 15
A.G. 16
17
(FG)
A/D 18
0-±10V
0-20mA
Name and
No. Descriptions
appearance
Indicates operation status of an A/D conversion module.
ON: In normal operation
1) RUN LED Flicker: In offset/gain setting mode
OFF: 5V power failure or watchdog timer error
occurred
Indicates errors and status of an A/D conversion module.
ON: Error occurred
OFF: In normal operation
2) ERROR LED
Flicker: Switch settings error occurred
Values other than 0 has been set to the
switch 5 on an intelligent function module.
7-8
7.5.2 A/D conversion characteristics
2003
Digital output
2002
0 2001
2000
2.5mV
5.0000V
5.0025V
- 4000
- 10V 0 10V
Input voltage
Analog input voltage
Figure 7.12 A/D conversion characteristics (voltage input)
Analog-digital conversion modules convert analog values input from other devices
to digital quantity so that CPUs can operate those values. On voltage inputs, for
example, they convert - 10V to digital quantity of – 4000 and 10V to 4000. This
means that the modules convert input voltage of 2.5mV to digital quantity of 1, and
abandon values smaller than 2.5mV.
Digital output
2002
2001
0 2000
5 A
10.000mA
10.005mA
The modules convert current input of 0mA to 0 for output, and 20mA to 4000. This
means that the modules convert input current of 5μA to digital quantity of 1, and
abandon values smaller than 5μA.
REMARK
A voltage/current value (max. resolution) that becomes digital value of 1 through
A/D conversion differs depending on the settings of the resolution mode (1/4000,
1/20000, 1/60000) or the output range.
7-9
7.5.3 Intelligent function module switch settings
Q series uses the I/O assignment settings of GX Developer to configure the switch
settings for intelligent function modules.
The intelligent function module switch settings provide switch 1 to 5, and use 16-bitdata.
When the intelligent function module switch settings are not configured, values of switch
1 to 5 are set to, which is 0.
Setting items
Input range setting Analog output range Setting value for output
range
Switch 1 4 to 20mA 0H
H
CH4 CH3 CH2 CH1
0 to 20mA 1H
1 to 5V 2H
0 to 5V 3H
Input range setting -10 to 10V 4H
Switch 2 0 to 10V 5H
H
User range setting FH
CH8 CH7 CH6 CH5
Switch 3 Vacant
Switch 4
H
REMARK
The settings for the offset/gain setting mode differ between the function version A
and function version B.
Explanations in this section are made based on the function version B.
For details, refer to the User’s Manual.
7 - 10
(2) Setting module switches
1) Click!
6) Click!
7 - 11
7.5.4 Setting with GX Configurator
1) Click!
2) Set!
3) Click!
5) Click!
7 - 12
(From previous page)
7) Set!
8) Click!
9) Confirm!
10) Click!
11) Click!
7 - 13
7.5.5 Exercise with the demonstration machine
AD module READY
Write only the parameter settings to a second CPU in the same way.
(This is not necessary if there is only one CPU incorporated.) For how to how to
write parameters to a second CPU, refer to Section 2.6.
1) Turn on X3, and change input voltages for an A/D conversion module by the
volume on the demonstration machine.
Analog values that were input to channel 1(CH1) on Q64AD are stored to buffer
memory (in digital value). With the automatic refresh settings, a QCPU reads
the stored digital values and stores them in its data register D10.
2) Whenever an analog value is smaller than "-1", 0 is set.
3) Analog-to-digital converted values appear on the digital display (Y50 to Y5F).
7 - 14
7.6 Q62DA Digital/Analog Conversion Module
Q62DA
1) RUN
2) ERROR
V+
1
C COM 2
H
1 I+ 3
4
V+ 5
C COM 6
H
2 I+ 7
8
9
10
11
12
13
14
15
IN 24VDC
16
3)
17
(FG)
18
D/A
0-±10V
0-20mA
7 - 15
7.6.2 D/A conversion characteristics
5.0025V
2.5mV
5.0000V
0
10.005mA
5 A
10.000mA
-20mA 2000 2001 2002 2003
-4000 0 4000 Input
Digital input value
Figure 7.15 D/A conversion characteristics (current output)
For current outputs, the modules convert 0 to 0mA and 4,000 to 20mA. This
means that the modules convert the digital input value of 1 to analog quantity of
5μA, and abandon digital input values in decimal places.
REMARK
A voltage/current value (max. resolution) that becomes digital value of 1 through
D/A conversion differs depending on the settings of the resolution mode (1/4000,
1/20000, 1/60000) or the output range.
7 - 16
7.6.3 Intelligent function module switch settings
Setting items
Input range setting Analog output range Setting value for output
range
Switch 1 4 to 20mA 0H
H
Switch 3
H
REMARK
The settings for the offset/gain setting mode differ between the function version A
and function version B.
Explanations in this section are made based on the function version B.
For details, refer to the User’s Manual.
7 - 17
(2) Setting module switches
1) Click!
6) Click!
7 - 18
7.6.4 Setting with GX Configurator
1) Click!
2) Set!
3) Set!
5) Set!
7 - 19
(From previous page)
6) Confirm!
7) Click!
8) Click!
7 - 20
7.6.5 Exercise with the demonstration machine
X2
0 Y91 D/A CH1 output enable
X90 Set values exceeding 4,000
2 > K4X20 H4000 MOV K4000 D30
DA are treated as 4,000.
module <= K4X20 H4000 >= K4X20 H0 BIN K4X20 D30 Read the digital switch value (D30).
READY Displays D30 value
BCD D30 K4Y40
on the digital display (Y40 to Y4F).
23 END
Write only the parameter settings to a second CPU in the same way.
(This is not necessary if there is only one CPU incorporated.) For how to write
parameters to second CPU, refer to Section 2.6.
7 - 21
MEMO
7 - 22
CHAPTER 8 USING THE LOGIC TEST FUNCTION (GX SIMULATOR)
Offline debugging is possible by adding the logic test function (GX Simulator) to a
computer in which GX Developer is installed.
With the logic test function (GX Simulator), which allows sequence programs to be
developed and debugged on a single computer, checking a modified sequence
program is easier and quicker.
Functions Meaning
Ladder monitor,
Monitors the operation status of the logic test function (GX Simulator).
Device monitor
Forcibly rewrites device values of the logic test function (GX Simulator)
Device test
during monitoring.
Writes parameter files and program files to the logic test function (GX
Write to PLC
Functions Simulator).
executed from PLC diagnostics Checks the logic test function (GX Simulator) status and errors.
the GX Skips (does not execute) program execution in the range between two
Skip execution
Developer menu designated steps.
Partial execution Executes the part of the program in a designated step or pointer range.
Step execution Executes the sequence program one step at a time.
Remote operation Operates the logic test function (GX Simulator) execution status.
Monitors the program execution status and number of executions as a
Program monitor list
table, and starts and stops the program execution in the table.
Conducts testing by monitoring the device memory status, forcing the
Monitor test
devices ON/OFF, and changing present values.
I/O system settings Simulates the operation of external devices by simple settings.
Functions
Tools Saves and reads the device memory and buffer memory.
executed from
Function equivalent to Issues a WDT error if a sequence program is written in such a way that it
the logic test
WDT runs an infinite loop.
function (GX
Error detail display
Simulator) menu Displays detailed error information at occurrence of an error.
function
Unsupported instruction Lists the instructions which are not supported by the logic test function
list display function (GX Simulator) if they are included in a sequence program.
8-1
8.1 Operating Procedure of Logic Test Function (GX Simulator)
This section describes how to use the logic test function (GX Simulator) for debugging.
Exercise this function with the program Project name QLLT .
1) Click!
8-2
(From previous page)
8-3
8.2 Monitoring Device Status and Testing Devices
This section describes how to monitor device status, turn bit devices on/off forcibly,
change word device values, etc.
Exercise this function with the program Project name QLLT .
1) Click!
3) Set!
3) Set X0 in the Device column on the Device
Memory Monitor window.
8-4
(From previous page)
6) Double click!
1) Click!
8-5
(2) Changing word device values
In the example operation below, word device "C (current value)" is monitored and
"C0" is changed to "5".
1) Click!
3) Set!
3) Set C0 in the Device column on the Device
Memory Monitor window.
4) Click!
8-6
(From previous page)
7) "5" is set!
8) Click!
8-7
8.3 I/O System Settings Function
The I/O system settings function allows GX Simulator to simulate how external
devices behave.
The following two setting methods are available for performing I/O system settings.
• Device value input: Specifies a device value that is to be set the set time after the
conditions are fulfilled.
• Timing chart input: Sets a timing chart that is followed once the conditions are
fulfilled.
X0 X1
0 Y70
Y70
M0
4 Y71
SM412 K9999
6 C0
SM400
11 MOV C0 K4Y80
14 END
<<Signal timing>>
M0
X0
X1
T
0 100 200 300 400 500 600 700 800 900 1000
[Time unit: 10ms]
<<Operations to simulate>>
(1) The lamp Y71 on the demonstration machine lights when M0 turns on during the
device test by GX Developer.
(2) An exterior person confirms the lamp Y71 lighting, turns on X0, and then turns it
off. (T = 200) (T = 400)
(3) Confirm that the self-maintaining ladder in the sequence program is in operation,
and then turn on X1 to reset the maintaining status. After that, turn off X1 again.
(T = 600) (T = 800)
(4) Turn off M0.
(T = 1000)
In the example operation below, settings listed in the following table are made.
Signal name Setting method
M0 Device value input
X0, X1 Timing chart input
8-8
8.3.1 Device value input
In the example operation below, a simulation where M0 turns off 10 s after M0 turns on
is set.
1) Click!
2) Double-click!
3) Click!
5) Click!
8-9
(From previous page)
7) Enter!
8) Click!
10) Click!
11) Click!
8 - 10
8.3.2 Timing chart value input
1) Click!
2) Double-click!
3) Click!
5) Click!
8 - 11
(From previous page)
7) Click!
8) Click!
15) Click!
8 - 12
(From previous page)
19) Click!
8 - 13
(From previous page)
31) Click!
8 - 14
8.3.3 Executing the I/O system settings
1) Click!
2) Click!
4) Click
8 - 15
(From previous page)
7) Enter!
7) Enter "M0".
9) Click!
8) Click! 9) Click the Close button.
Self-maintaining circuit
(1) Turns on 2 seconds after M0 turned on
Turns off 4 seconds after M0 turned on
Self-maintaining circuit
Self-maintaining circuit
REFERENCE
The logic test function (GX Simulator) takes 100ms to execute one scan. Time
taken for one scan is the set time for constant scan. (Default is set to 100ms.)
This is designed to operate user-created sequence programs equally regardless of
the performance of personal computers.
To change the default time of 100ms, configure the parameter setting in GX
Developer and set any value as time for constant scan.
(QCPU must be operating to do this.)
8 - 16
CHAPTER 9 MAINTENANCE
The following bar graph shows the ratio of faulty parts and causes of PLC errors.
[Source: Inspection made by JEMA (The Japan Electrical Manufacture’s Association)]
60
40 34.1
20.6 19.3
20
14.3
9.4
2.7
0.9
0
I/O Power CPU Peripheral Commu- Memory Other No
supply devices nication answer
40.4
40
30
26.0 24.7 24.2
20 19.3
12.6 12.1
10
6.3
1.3
0
Unknown Noise Short of Manufacture Other Vibration No
cause load Poor Incorrect shock answer
connection programming
9-1
9.2 Maintenance
To keep PLCs in the best operating condition, conduct the following daily inspection
and periodic inspection.
9-2
(2) Periodic inspection
The items that must be inspected one or two times every 6 months to 1 year are
listed below. Also perform this inspection when following changes are made; the
equipment is moved or modified, layout of the wiring is changed, the power supply
module is changed, etc.
environment
Measure with a 0 to 55 °C
Ambient temperature used in the board, the
thermometer and a
1 Ambient humidity 5 to 95%RH*1 ambient temperature in
hygrometer.
Corrosive gas must not the board becomes the
Ambience Measure corrosive gas.
be present. ambient temperature.
Measure a voltage 85 to 132VAC
across the terminals of Change the power
2 Power voltage
100/200VAC and 170 to 264VAC supply.
24VDC.
Retighten the screws.
Move the module to
Looseness, The module must be If the CPU, I/O, or
Installation
Proximity of
Solderless terminals
solderless
4 Check visually. must be positioned at Correct.
terminals to each
proper intervals.
other.
Retighten the
Looseness of Screws must not be
Check visually. connector fixing
connectors loose.
screws.
Even if the lowering of
a battery capacity is not
Check on the monitor
shown, replace the
mode of the GX (Preventive
5 Battery battery with a new one
Developer that M51 or maintenance)
if a specified service life
SM52 is turned OFF.
of the battery is
exceeded.
Spare product Use the normal product
Install the product on Operation must meet
6 on the actual PLC as a
and the actual PLC. the specifications.
spare product.
Compare the stored
Check on stored The two programs must Correct if there are
7 program with the
program be identical. differences.
running program.
Rotational status Rotation must be Exchange and clean if
Fan (heat exchanger)
8 Rotational sound without sounds or any abnormality is
filter
Clogging clogging. found.
The value must be
Check the offset/gain identical with the Correct if there are
9 Analog I/O
value. specifications (design differences.
value).
*1: When AnS Series Module is included in the system, the judgment criteria will be
from 10 to 90 % RH.
9-3
9.4 Service Life of Output Relay
The relays of modules relaying on contacts to output are subject to consumption due to
the switching operation.
When a relay that is directly mounted on the print board of an output module is
consumed, it is necessary to replace the output module itself.
1000
500
200
100
Limit number of switching (unit: 10,000)
50
20
10
DC30V
t=0ms
5 DC100V
t=7ms
1
0.1 0.2 0.5 1 2 5 10
Switching current (unit: A)
9-4
9.5 Spare Products
Alternative products are easily purchased through the Mitsubishi service centers or
local Mitsubishi representatives in Japan. So the purchasing documents can be
prepared even after an accident. Note, however, that for foreign-related products such
as exported products it is necessary to send alternative products beforehand.
To ease maintenance, refer to the following tips at design work.
9-5
(7) Spare products
Table 9.3 Spare products
No. Product Quantity Remark
name
Storage lives of lithium batteries are about 5 years. So it
is recommended not to keep the stock all the time but to
1 Battery One or two
purchase them when needed. However, keep stock of 1
or 2 for accidental situation.
2 Floppy disk As required Backup FDs for the startup software and FDs for user
Note that I/O modules tend to have an error during test
One per operation.
3 I/O module
module type Also note that the contacts of relay output modules are
subject to consumption in long-term use.
CPU One used
4 CPU modules and memory cards are the core parts of a
module model
PLC. This means that an error on them causes the
Memory One used
5 system to go down.
card model
Same as above. As power supply modules are highly
Power
One used subject to temperature rise, their service lives tend to be
6 supply
model shorter than supposed in a high ambient temperature
module
environment.
Peripheral A PU is recommended as a spare of DOS/V personal
7 As required
devices computer.
9-6
9.6 Using Maintenance Supporters
The following shows examples of maintenance supporters, which are devices that
automatically notify an operator or maintenance person faults or operation status of
PLC-used systems or devices.
Lamp flicker
Output module (Y50 to Y6F)
Error indication lamp
Control panel
SM1 SM412
Lamp (Y50) flashes
Y50
when an error is detected
(Error detection) (1 second clock)
Control panel
9-7
3. Displaying the description of a detected error on the screen
The details of an error occurred on a PLC can be displayed on an external CRT
screen, plasma screen, liquid crystal screen, etc.
Displaying on a screen
9-8
APPENDIX
The CPU supports two types of I/O control modes; the direct mode and refresh mode.
In the direct mode, input signals are imported to a PLC every time they are input and
treated it as input information. The operation results of a program are output to the
output data memory and the output modules. The following diagram shows the flow of
I/O data in the direct mode.
CPU module
CPU
(Operation processing)
2) 1) Input
Test operation using GX Developer
module
3) Rink refresh of MELSECNET/H
Write from serial communication modules, etc.
X0
Y75
Y70 Executes the OUT instruction in the sequence Output
5) module
program.
Test operation using GX Developer
Writes from the serial communication modules,
etc.
App - 1
Appendix 1.2 Refresh mode
In the refresh mode, all changes occurred to an input module are imported to the input
data memory in a PLC CPU at a time before each time a scan is performed. The data
memory is used when performing the operation.
The operation results made in a program for output (Y) are stored to the output data
memory each time the operation is made. All the data stored in the output data
memory is batch-output to the output module after the execution of the END
instruction.
The following diagram shows the flow of I/O data in the refresh mode.
CPU module
CPU
(Operation processing)
When inputs
3) Data memory are refreshed Input
for input (X) 1) module
X0
4)
When outputs
Y75 Data memory are refreshed Output
Y70 for output (Y) 2) module
5)
• Input refresh
Input data in the input module is batch-read 1) before the execution of 0 step, and
stored to the data memory for input (X).
• Output refresh
Data 2) in the data memory for output (Y) is batch-output to the output module before
the execution of 0 step.
• When the input contact instruction is performed:
Input data is read from the input (X) data memory 3), and a sequence program is
performed.
• When the output contact instruction has been performed:
Output data 4) is read from the output (Y) data memory, and a sequence program is
performed.
• When the output OUT instruction is performed:
The sequence program operation result 5) is stored in the output (Y) data memory.
App - 2
Appendix 1.3 Comparisons between the direct mode and refresh mode
In the example ladder given below, input X0 turning on leads to output Y70 turning on.
DX0 X0
1, Ladder example Y70 Y70
App - 3
Appendix 2 Instruction Table
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
REMARK
1) 1: The number of steps may vary depending on the device being used.
Device Number of Steps
Internal device, file register (R0 to R32767) 1
Direct access input (DX) 2
Devices other than above 3
2) 2: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
Internal device, file register (R0 to R32767) 1 1
Direct access input (DX) 2 2
Devices other than above 3 3
App - 4
(2) Connection instructions
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
MPP
MPS instruction
INV • Inversion of operation result 1
• Conversion of operation result to leading edge
MEP
pulse
1
• Conversion of operation result to trailing edge
MEF
pulse
Vn • Conversion of operation result to leading edge
EGP
pulse (Stored at Vn)
1
Vn • Conversion of operation result to trailing edge
EGF
pulse (Stored at Vn)
App - 5
(3) Output instructions
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
*2
RST RST D • Reset device *1
DELTA DELTA D
• Pulse conversion of direct output 2
DELTAP DELTAP D
REMARK
1) *1: The number of steps may vary depending on the device being used.
For details of the number of steps, refer to a page having the
explanation of each instruction.
2) *2: The execution condition applies only when an annunciator (F) is in use.
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
SFT SFT D
Shift • 1-bit shift of device 2
SFTP SFTP D
App - 6
(5) Master control instructions
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
basic steps
Number of
Category
Subset
Instruction Execution
Symbol Processing details
symbol condition
App - 7
Appendix 2.2 Basic instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
AND S1 S2
3
OR
S1 S2
AND S1 S2
3
OR
S1 S2
AND S1 S2
3
OR
S1 S2
16-bit data
comparisons • Conductive status when (S1) ≤ (S2)
LD S1 S2
• Non-conductive status when (S1) > (S2)
AND S1 S2
3
OR
S1 S2
AND S1 S2
3
OR
S1 S2
AND S1 S2
3
OR
S1 S2
App - 8
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
REMARK
*1: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 5
3
modification.
• Constant : No limitations
Devices other than above 3
QCPUs need the increased number of steps but provide faster processing speed.
App - 9
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 10
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
REMARK
1) *: The conditions under which character string comparisons can be made are
as shown below.
• Match: All characters in the strings must match
• Larger string: If character strings are different, determines the string
with the largest number of character codes
If the lengths of the character strings are different,
determines the longest character string
• Smaller string: If the character strings are different, determines the
string with the smallest number of character codes
If the lengths of the character strings are different,
determines the shortest character string
App - 11
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
BKCMP P BKCMP P S1 S2 D n
BKCMP P BKCMP P S1 S2 D n
BKCMP P BKCMP P S1 S2 D n
BKCMP P BKCMP P S1 S2 D n
BKCMP P BKCMP P S1 S2 D n
App - 12
(2) Arithmetic operation instruction
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
+ + S D • (D)+(S) (D)
3
+P +P S D
D+ D+ S D • (D+1,D)+(S+1,S) (D+1,D)
*1
D+P D+P S D
App - 13
REMARK
1) *1: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 5
3
modification.
• Constant : No limitations
Devices other than above 3
2) *2: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 6
4
modification.
• Constant : No limitations
Devices other than above 4
3) *3: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K4, and which use no index 3
4
modification.
• Constant : No limitations
Devices other than above 4
App - 14
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
B+ B+ S D • (D)+(S) (D)
3
B+P B+P S D
BCD
B+ B+ S1 S2 D • (S1)+(S2) (D)
4-digit 4
addition B+P B+P S1 S2 D
and B B S D • (D) (S) (D)
subtraction 3
B P B P S D
operations
B B S1 S2 D • (S1) (S2) (D)
4
B P B P S1 S2 D
division 4
B/P B/P S1 S2 D
operations
BCD DB DB S1 S2 D • (S1+1,S1) (S2+1,S2)
8-digit (D+3,D+2,D+1,D) 4
DB P DB P S1 S2 D
multiplica-
tion and DB/ DB/ S1 S2 D • (S1+1,S1)/(S2+1,S2)
division
Quotient (D+1,D), Remainder (D+3,D+2) 4
DB/P DB/P S1 S2 D
operations
App - 15
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
E+ E+ S D • (D+1,D)+(S+1,S) (D+1,D)
3
Floating E+P E+P S D
decimal
E+ E+ S1 S2 D • (S1+1,S1)+(S2+1,S2) (D+1,D)
point data 4
addition E+P E+P S1 S2 D
and E E S D • (D+1,D) (S+1,S) (D+1,D)
subtrac- 3
E P E P S D
tion
operations E E S1 S2 D • (S1+1,S1) (S2+1,S2) (D+1,D)
4
E P E P S1 S2 D
Floating
decimal
E
* E S1 S2 D • (S1+1,S1)
* (S2+1,S2) (D+1,D)
3
point data *
E P E P S1 S2 D
tion
and 4
E/P E/P S1 S2 D
division
operations
BIN block $+ $+ S D • Links character string designated with (S) to
addition character string designated with (D), and 3
$+P $+P S D
and stores the result from (D) onward.
subtrac- $+ $+ S1 S2 D • Links character string designated with (S2) to
tion character string designated with (S1), and 4
operations $+P $+P S1 S2 D
stores the result from (D) onward.
BK+ BK+ S1 S2 D n • Adds data of n points from (S1) and data of n
Character points from (S2) in batch. 5
BK+P BK+P S1 S2 D n
string data
BK BK S1 S2 D n • Subtracts data of n points from (S1) and data
combinations
of n points from (S2) in batch. 5
BK P BK P S1 S2 D n
App - 16
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
REMARK
*1: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 3
2
modification.
• Constant : No limitations
Devices other than above 2
App - 17
(3) Data conversion instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
BCD conversion
BCD BCD S D · (S) (D)
3
BIN(0 to 9999)
BCD BCDP BCDP S D
conversion DBCD DBCD S D BCD conversion
· (S+1, S) (D+1, D)
BIN(0 to 99999999)
3
DBCDP DBCDP S D
BIN conversion
BIN BIN S D · (S) (D)
3
BCD(0 to 9999)
BIN BINP BINP S D
conversion DBIN DBIN S D · (S+1, S)
BIN conversion
(D+1, D)
BCD(0 to 99999999)
3
DBINP DBINP S D
Conversion Conversion to floating point
FLT FLT S D · (S+1, S) (D)
from BIN to 3
FLTP FLTP S D BIN(-32768 to 32767)
floating
DFLT DFLT S D Conversion to floating point
decimal · (S+1, S) (D+1, D) 3
point DFLTP DFLTP S D Real number(-2147483648 to 2147483647)
App - 18
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 19
(4) Data conversion instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 20
REMARK
*1: The number of steps may vary depending on the device and type of CPU
module being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K4, and which use no index 2
3
modification.
• Constant : No limitations
Devices other than above 3
App - 21
(5) Program branch instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Disable
DI DI • Prohibits the running of an interrupt program 1
interrupts
Enable • Resets interrupt program execution
EI EI 1
interrupts prohibition
Interrupt
disable/ • Prohibits or permits interrupts for each
IMASK IMASK S 2
enable interrupt program
setting
• Returns to sequence program following an
Return IRET IRET 1
interrupt program
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
I/O
RFS RFS D n • Refreshes the relevant I/O area during scan 3
refresh
App - 22
(8) Other convenient instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
(S)+0
Up Down Up
(S)+1
UDCNT1 UDCNT1 S D n Cn current value 0 1 2 3 4 5 6 7 6 5 4 3 2 1 0 -1 -2 -3 -2 -1 0
4
Up/down Cn contact
counter (S)+0
UDCNT2 UDCNT2 S D n (S)+1 4
Cn current value 0 1 2 3 4 5 4 3 2 1 0 -1
Cn contact
Pulse
n1
width n2
PWM PWM n1 n2 D 4
modulati
on (D)
App - 23
Appendix 2.3 Application instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
REMARK
*1: The number of steps may vary depending on the device and type of CPU module
being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 6
modification. 4
• Constant : No limitations
Devices other than above 4
*2: The subset is effective only with QCPU.
App - 24
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
REMARK
*1: The number of steps may vary depending on the device and type of CPU module
being used.
Number of Steps
Device
QCPU QnACPU
• Word device: Internal device (except for file register ZR)
• Bit device: Devices whose device Nos. are multiples of 16, whose
digit designation is K8, and which use no index 6
4
modification.
• Constant : No limitations
Devices other than above 4
*2: The subset is effective only with QCPU.
App - 25
(2) Rotation instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
(D+1) (D)
DROR DROR D n b31 to b16 b15 to b0 SM700
3
DRORP DRORP D n Rotates n bits to the right
Right
rotation (D+1) (D)
DRCR DRCR D n b31 to b16 b15 to b0 SM700
3
DRCRP DRCRP D n Rotates n bits to the right
(D+1) (D)
DROL DROL D n SM700 b31 to b16 b15 to b0
3
DROLP DROLP D n Rotates n bits to the left
Left
rotation (D+1) (D)
DRCL DRCL D n SM700 b31 to b16 b15 to b0
3
DRCLP DRCLP D n Rotates n bits to the left
App - 26
(3) Shift instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
shift
SFL SFL D n b15 bn b0
3
SFLP SFLP D n SM700 b15 b0
0 to 0
n
BSFR BSFR D n (D)
3
BSFRP BSFRP D n SM700
1-bit 0
shift n
BSFL BSFL D n
(D)
3
BSFLP BSFLP D n SM700
0
n
DSFR DSFR D n (D)
3
DSFRP DSFRP D n 0
1-word
shift n
DSFL DSFL D n
(D)
3
DSFLP DSFLP D n
0
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
(D)
BSET BSET D n
b15 bn b0
3
BSETP BSETP D n 1
Bit set/
reset (D)
BRST BRST D n
b15 bn b0
3
BRSTP BRSTP D n 0
App - 27
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
(S1)
TEST TEST S1 S2 D b15 to b0 (D)
4
TESTP TESTP S1 S2 D Bit designated in (S2)
Bit tests
(S1)
DTEST DTEST S1 S2 D b31 to b0 (D)
4
DTESTP DTESTP S1 S2 D Bit designated in (S2)
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
(S2)
(S1)
SER SER S1 S2 D n
n
5
SERP SERP S1 S2 D n (D) : Match No.
Data (D+1): No. of matches
searches 32 bits
DSER DSER S1 S2 D n (S2)
(S1)
n 5
DSERP DSERP S1 S2 D n (D) : Match No.
(D+1): No. of matches
checks
DSUM DSUM S D (S+1) (S)
3
DSUMP DSUMP S D (D):No. of 1s
Decode of 8 to 256
DECO DECO S D n (D)
Decode (S) Decode 4
2n bits
DECOP DECOP S D n n
Decode of 256 to 8
ENCO ENCO S D n (S)
Encode Encode (D) 4
ENCOP ENCOP S D n 2n bits n
App - 28
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 29
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
SORT S1 n S2 D1 D2
• Sorts data of n-points from device
· S2: Number of comparisons made
SORT during one run designated by (S1) in 16-bit units.
· D1: Device to turn ON when sort is
completed (n (n-1)/2 scans required)
· D2: For system use
Sort 6
DSORT S1 n S2 D1 D2
• Sorts data of 2 n-points from device
· S2: Number of comparisons made
DSORT during one run designated by (S1) in 32-bit units.
· D1: Device to turn ON when sort is
completed (n (n-1)/2 scans required)
· D2: For system use
App - 30
(6) Structure creation instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
*1
FCALL FCALL Pn S1 to Sn • Performs non-execution processing of
2
sub-routine program Pn if input
+
FCALLP FCALLP Pn S1 to Sn conditions have not been met.
Sub n
routine ECALL Pn S1 to Sn • Executes sub-routine program Pn from
*2
program ECALL within designated program name when
: Program name 3
calls input conditions have not been met.
+
ECALLP Pn S1 to Sn (S1 to Sn are arguments sent to
ECALLP n
: Program name subroutine program. 0 ≤ (n) ≤ (5)
EFCALL Pn S1 to Sn
EFCALL • Performs non-execution processing of *2
: Program name sub-routine program Pn from within 3
designated program name if input +
EFCALLP Pn S1 to Sn
EFCALLP conditions have not been met. n
: Program name
App - 31
(7) Data table operation instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
3
FIFWP FIFWP S D Device of
pointer+1
Data table
3
processing
FPOPP FPOPP S D
Device of pointer+1
4
FINSP FINS S D n
Designate using n
4
FDELP FDELP S D n
Designate using n
App - 32
(8) Buffer memory access instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 33
(10) Debugging and failure diagnosis instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 34
(11) Character string processing instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 35
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Device
COMRD COMRD S D
comment • Stores comment from device designated by
3
read (S) at a device designated by (D).
COMRDP COMRDP S D
operation
Character
LEN LEN S D • Stores data length (number of characters) in
string
character string designated by (S) at a 3
length
LENP LENP S D device designated by (D).
detection
App - 36
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Floating
decimal ESTR ESTR S1 S2 D • Converts floating decimal point data
point to designated by (S1) to character string, and 4
character stores them in a device designated by (D).
ESTRP ESTRP S1 S2 D
string
Character
EVAL EVAL S D
string to • Converts character string designated by
floating (S1) to floating decimal point data, and 3
decimal stores them in a device designated by (D).
EVALP EVALP S D
point
App - 37
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 38
(12) Special function instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Random 2
SRND SRND D • Updates random number series according
number
to the 16-bit BIN data stored in the device
series
SRNDP SRNDP D designated by (S).
update
App - 39
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
BSQR BSQR S D
(S) (D)+0
· Integral part
3
+1 Decimal fraction
Square BSQRP BSQRP S D
App - 40
(13) Data control instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
• When (S3)<(S1)
LIMIT LIMIT S1 S2 S3 D ................Store value of (S1) at (D)
• When (S1) ≤ (S2) ≤ (S3)
5
................Store value of (S3) at (D)
Upper LIMITP LIMITP S1 S2 S3 D • When (S2)<(S3)
and ................Store value of (S2) at (D)
lower
• When ((S3)+1, (S3))<((S1)+ 1, S1)
limit
DLIMIT DLIMIT S1 S2 S3 D .... Store value of ((S1)+1, (S1)) at ((D)+1, (D))
controls
• When ((S1)+1, (S1)) ≤ ((S3)+1, (S3))<(S2+1, S2)
5
.... Store value of ((S3)+1, (S3)) at ((D)+1, (D))
• When ((S2), (S2)+1)<((S3), (S3)+1)
DLIMITP DLIMITP S1 S2 S3 D
.... Store value of ((S2)+1, (S2)) at ((D)+1, (D))
App - 41
(14) Switching instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 42
(16) Peripheral device instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
App - 43
(18) Other instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Timing (D)
DUTY DUTY n1 n2 D n1 scan n2 scan 4
clock
SM420 to SM424, SM430 to SM434
0 Lower 8 bits
ZRRDB ZRRDB n D Higher 8 bits ZR0
1
2 Lower 8 bits
Higher 8 bits ZR1 3
3
ZRRDBP ZRRDBP n D n 8 bits (D)
Direct
(S) 0 Lower 8 bits
read/write ZRWRB ZRWRB n S 1 Higher 8 bits ZR0
operations 2 Lower 8 bits 3
3 Higher 8 bits ZR1
in 1-byte ZRWRBP ZRWRBP n S n 8 bits
units
ADRSET ADRSET S D (S) (D)
Indirect address of
designated device 3
ADRSETP ADRSETP S D Device name
App - 44
Appendix 2.4 Instructions for data link
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
J.ZCOM Jn
Network JP.ZCOM Jn
ZCOM Refreshes the designated network. 5
refresh
G.ZCOM Un
GP.ZCOM Un
station SREAD 10
JP.SREAD Jn (S1) (S2) (D1) (D2) (D3)
stations SWRITE 11
JP.SWRITE Jn (S1) (S2) (D1) (D2) (D3)
App - 45
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
QnA link
instruction:
Reading JP.ZNFR Jn S1 S2 D1
data from
special Reads data from the special function
ZNFR 8
function modules at remote I/O stations.
modules
at remote GP.ZNFR Un S1 S2 D1
I/O
stations
QnA link
instruction: J.ZNTO Jn S1 S2 D
Writing
data to JP.ZNTO Jn S1 S2 D
special Writes data from the special function
ZNTO 8
function modules at remote I/O stations.
modules G.ZNTO Un S1 S2 D
at remote
I/O
GP.ZNTO Un S1 S2 D
stations
A-series
compatible
J.ZNWR Jn n1 (D1) (S) n2 (D2)
link
instruction:
Writes the data of host station to the word
Writing ZNWR 32
device of other stations.
device
data to JP.ZNWR Jn n1 (D1) (S) n2 (D2)
other
stations
A-series
compatible
J.ZNRD Jn n1 (D1) (S) n2 (D2)
link
instruction:
Reads the word device data of another
Reading ZNRD 32
station to host station.
device
data from JP.ZNRD Jn n1 (D1) (S) n2 (D2)
other
stations
App - 46
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
A-series
compatible
link
G.RFRP Un n1 D1 n2 D2
instruction:
Reading
data from Reads data from the special function
RFRP 11
special modules at remote I/O stations.
function
modules
GP.RFRP Un n1 D1 n2 D2
at remote
I/O
stations
A-series
compatible
link
G.RTOP Un n1 D1 n2 D
instruction:
Writing
data to Writes data from the special function
RTOP 11
special modules at remote I/O stations.
function
modules
GP.RTOP Un n1 D1 n2 D
at remote
I/O
stations
Reading Z.RTREAD n D
routing RTREAD Reads data set at routing parameters. 7
information ZP.RTREAD n D
App - 47
Appendix 2.5 QCPU instructions
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Reading
data from
SP.FREAD SP.FREAD U0 S0 D0 S1 S2 D1 • Reads data from the designated file. 11
designated
file
App - 48
basic steps
Number of
Subset
Instruction Execution
Category Symbol Processing details
symbol condition
Write to
host S.TO S.TO n1 n2 n3 n4 D
• Writes the device data of the host station to
station
the shared memory area of the host station 5
CPU
CPU module.
shared S.TOP S.TOP n1 n2 n3 n4 D
memory
Read from
another FROM FROM n1 n2 D n3
• Reads device data from the CPU shared
station
memory area of another station CPU 5
CPU
module to the host station.
shared FROMP FROMP n1 n2 D n3
memory
Automatic
• Performs the automatic refresh of the
refresh of
intelligent function module, general data
CPU COM COM 1
processing, and the automatic refresh of the
shared
CPU shared memory.
memory
App - 49
Appendix 3 Special Relay List
Special relays, SM, are internal relays whose applications are fixed in the PLC. For this
reason, they cannot be used by sequence programs in the same way as the normal
internal relays. However, they can be turned ON or OFF as needed in order to control
the CPU and remote I/O modules.
The headings in the list that follows have the following meanings.
Item Function of item
No. • Indicates the number of the special relay.
name • Indicates the name of the special relay.
Meaning • Indicates the contents of the special relay.
Explanation • Contains detailed information about the contents of the special relay.
• Indicates whether the relay is set by the system or user and when setting is
performed if it is set by the system.
<Set by>
S: Set by system
U: Set by user (in sequence program or test operation at a peripheral
device)
S/U: Set by both system and user
Set by <When set> indicated only if setting is done by system.
(When set) Each END: Set during each END processing
Initial: Set only during initial processing (when power supply is
turned ON, or when going from STOP to RUN)
Status change: Set only when there is a change in status
Error occurrence: Set when error is generated
Instruction execution: Set when instruction is executed
Request: Set only when there is request from a user(through SM,
etc.)
Correspondi • Indicates special relay (M9 ) corresponding to the ACPU.
ng ACPU (Indicates as "Change" when there has been a change in contents)
M9 • Items indicated as "New" have been newly added for Q/QnACPU
Indicates the applicable CPU type name.
+ Rem: Indicates all the CPU and MELSECNET/H remote I/O
modules.
: Indicates all types of CPU
Applicable
QCPU: Indicates the Q-series CPU
CPU
QnA: Indicates the QnA series and Q2ASCPU.
Remote: Indicates the MELSECNET/H remote I/O modules.
Each CPU type name: Indicates the relevant specific CPU module. (Example:
Q4ARCPU, Q3ACPU)
For details on the following items, refer to these manuals:
• Networks • Q corresponding MELSECNET/H Network System Reference Manual
(PLC to PLC network)
• Q Corresponding MELSECNET/H Network System Reference Manual
(Remote I/O network)
• For QnA/Q4AR MELSECNET/10 Network System Reference Manual
• SFC QCPU (Q Mode)/QnACPU Programming Manual (SFC)
POINT
(1) SD1200 to SD1255 are used for QnACPU.
These relays are vacant with QCPU.
(2) SM1500 or later is exclusively used for Q4ARCPU.
App - 50
Special Relay List
(1) Diagnostic information
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
• ON if diagnosis results show error occurrence (Includes the
Diagnostic OFF: No error S (Error
SM0 annunciator being ON and detecting an error by CHK instruction) New
errors ON: Error occurrence)
• Stays ON subsequently even if normal operations restored
• Comes ON when an error occurs as a result of self-diagnosis.
OFF: No self-diagnosis
Self-diagnostic (excludes the annunciator being ON and detecting an error by CHK S (Error
SM1 errors M9008
error instruction) occurrence)
ON: Self-diagnosis
• Remains ON if the condition is restored to normal thereafter.
OFF: No error common +
Error common information S (Error Rem
SM5 • When SM0 is ON, ON if there is error common information New
information ON: Error common occurrence)
information
OFF: No error common
Error individual information S (Error
SM16 • When SM0 is ON, ON if there is error individual information New
information ON: Error common occurrence)
information
SM50 Error reset OFF ON: Error reset • Performs error reset operation U New
• ON if battery voltage at CPU module or memory card drops below
Battery low OFF: Normal rated value. S (Error
SM51 M9007
latch ON: Battery low Remains ON if the battery voltage returns to normal thereafter. occurrence)
• Synchronizes with the BAT. ALARM/BAT. LED.
OFF: Normal • Same as SM51, but goes OFF subsequently when battery voltage S (Error
SM52 Battery low M9006
ON: Battery low returns to normal. occurrence)
• Turns ON if an instantaneous power failure of within 20ms occurs
during use of the AC power supply module. Reset when power is
switched OFF, then ON.
OFF: AC DOWN not
• Turns ON if an instantaneous power failure of within 10ms occurs
AC DOWN detected S (Error
SM53 during use of the DC power supply module. Reset when power is M9005 QCPU
detection ON: AC DOWN occurrence)
switched OFF, then ON.
detected
• Turns ON if an instantaneous power failure of within 1ms occurs
during use of the DC power supply module. Reset when power is QnA
switched OFF, then ON.
• Goes ON if MINI (S3) link error is detected at even one of the
OFF: Normal S (Error
SM54 MINI link errors installed MELSECNET/MINI-S3 master modules. M9004 QnA
ON: Error occurrence)
Remains ON if the condition is restored to normal thereafter.
Operation OFF: Normal • ON when operation error is generated S (Error
SM56 M9011
errors ON: Operation error • Remains ON if the condition is restored to normal thereafter. occurrence)
• Comes ON even if there is only one output module with a fuse blown,
OFF: Normal
Fuse blown and remains ON even after return to normal S (Error
SM60 ON: Module with fuse M9000
detection • Fuse blown state is checked even for remote I/O station output occurrence)
blown
modules.
+
• Comes ON if there is a discrepancy between the actual I/O modules
Rem
and the registered information when the power is turned on, and
I/O module OFF: Normal S (Error
SM61 remains ON even after return to normal. M9002
verification error ON: Error occurrence)
• I/O module verification is also performed for remote I/O station
modules.
Annunciator OFF: Not detected S (Instruction
SM62 • Goes ON if even one annunciator F goes ON. M9009
detection ON: Detected execution)
OFF: Not detected • Goes ON if error is detected by CHK instruction. S (Instruction
SM80 CHK detection New
ON: Detected • Remains ON if the condition is restored to normal thereafter. execution)
SM90 Corresponds to SD90 M9108
SM91 Corresponds to SD91 M9109
SM92 Startup of Corresponds to SD92 M9110
watchdog timer OFF: Not started
SM93 Corresponds to SD93 • Goes ON when measurement of step M9111
for step (watchdog timer
SM94 Corresponds to SD94 transition watchdog timer is commenced. M9112
transition reset) U
SM95 Corresponds to SD95 • Resets step transition watchdog timer when M9113
(Enabled only ON: Started (watchdog
SM96 Corresponds to SD96 it goes OFF. M9114
when SFC timer started)
SM97 program exists) Corresponds to SD97 New
SM98 Corresponds to SD98 New
SM99 Corresponds to SD99 New
OFF: Normal • Goes ON when at least one module is in the status where the
Detection of ON: There is a module external power supply is OFF. Remains ON even after return to
S (Error QCPU
SM120 external power whose external normal. New
occurrence) remote
supply OFF power supply is *Applicable only for Q-series module.
OFF. (For future use)
App - 51
Special Relay List
(2) System information
Corresponding CPU
Corresponding
Set by
ACPU
No. Name Meaning Explanation (When
set)
M9
LED OFF • When this relay goes from OFF to ON, the LEDs corresponding to the
SM202 OFF ON: LED OFF U New
command individual bits at SD202 go off
S (Status
SM203 STOP contact STOP status • Goes ON at STOP status M9042
change)
S (Status
SM204 PAUSE contact PAUSE status • Goes ON at PAUSE status M9041
change)
S (Status
SM205 STEP-RUN contact STEP-RUN status • Goes ON at STEP-RUN status M9054
change)
OFF: PAUSE disabled • If this relay is ON when the remote PAUSE contact goes ON, the
PAUSE enable coil U M9040
ON: PAUSE enabled PAUSE state is entered.
SM206 OFF: Device test not yet
Device test request S
executed • Comes ON when the device test mode is executed on GX Developer. New remote
acceptance status (Request)
ON: Device test executed
• When this relay goes from OFF to ON and after END instruction
Clock data set OFF: Ignored
SM210 execution of subsequent scan, clock data stored in SD210 to SD213 U M9025
request ON: Set request
are written to the CPU module.
OFF: No error • ON when error is generated in clock data (SD210 to SD213) value, S
SM211 Clock data error M9026
ON: Error and OFF if no error is detected. (Request)
• Displays clock data as month, day, hour, minute, and second at the Q3A
OFF: Ignored
SM212 Time data display LED display at front of CPU module.(Enabled only for Q3ACPU and U M9027 Q4A
ON: Display
Q4ACPU) Q4AR
Clock data read OFF: Ignored • When this relay is ON, clock data is read to SD210 through SD213 as +
SM213 U M9028
request ON: Read request BCD values. Rem
OFF: No. 1 CPU reset • Goes OFF when reset of the No. 1 CPU is canceled.
No. 1 CPU reset cancel • Comes ON when the No. 1 CPU is resetting (including the case where
SM240
flag ON: No. 1 CPU the PLC is removed from the base).
resetting The other PLCs are also put in reset status.
OFF: No. 2 CPU reset • Goes OFF when reset of the No. 2 CPU is canceled.
No. 2 CPU reset cancel • Comes ON when the No. 2 CPU is resetting (including the case where
SM241
flag ON: No. 2 CPU the PLC is removed from the base).
resetting The other PLCs result in "MULTI CPU DOWN" (error code: 7000).
OFF: No. 3 CPU reset • Goes OFF when reset of the No. 3 CPU is canceled.
No. 3 CPU reset cancel • Comes ON when the No. 3 CPU is resetting (including the case where
SM242
flag ON: No. 3 CPU the PLC is removed from the base).
resetting The other PLCs result in "MULTI CPU DOWN" (error code: 7000).
OFF: No. 4 CPU reset • Goes OFF when reset of the No. 4 CPU is canceled.
QCPU
No. 4 CPU reset cancel • Comes ON when the No. 4 CPU is resetting (including the case where S (Status
SM243 New function
flag ON: No. 4 CPU the PLC is removed from the base). change)
Ver. B
resetting The other PLCs result in "MULTI CPU DOWN" (error code: 7000).
OFF: No. 1 CPU normal • Goes OFF when the No. 1 CPU is normal (including a continuation
No. 1 CPU error
SM244 ON: No. 1 CPU during error).
flag
stop error • Comes ON when the No. 1 CPU is during a stop error.
OFF: No. 2 CPU normal • Goes OFF when the No. 2 CPU is normal (including a continuation
No. 2 CPU error
SM245 ON: No. 2 CPU during error).
flag
stop error • Comes ON when the No. 2 CPU is during a stop error.
OFF: No. 3 CPU normal • Goes OFF when the No. 3 CPU is normal (including a continuation
No. 3 CPU error
SM246 ON: No. 3 CPU during error).
flag
stop error • Comes ON when the No. 3 CPU is during a stop error.
OFF: No. 4 CPU normal • Goes OFF when the No. 4 CPU is normal (including a continuation
No. 4 CPU error
SM247 ON: No. 4 CPU during error).
flag
stop error • Comes ON when the No. 4 CPU is during a stop error.
Max. loaded I/O OFF: Ignored • When this relay goes from OFF to ON, maximum loaded I/O number is +
SM250 U New
read ON: Read read to SD250. Rem
• By turning this relay ON after setting the head I/O number of the
replaced I/O module to SD251, the I/O module can be replaced online
(with power on). (Only one module can be replaced for each setting.)
OFF: No replacement • Turn this relay ON in the test mode of the program or peripheral device
SM251 I/O change flag U (END) M9094
ON: Replacement for an I/O module change during RUN, or in the test mode of the Q2A(S1)
peripheral device for an I/O change during STOP. Q3A
• Do not execute a RUN/STOP mode change until I/O module change is Q4A
finished. Q4AR
OFF: Replacement
prohibited
SM252 I/O change OK • Goes ON when I/O replacement is OK. S (END) New
ON: Replacement
enabled
OFF: Refresh arrival
• Effective for the batch refresh (also effective for the low speed cyclic) U (Every
All stations refresh station
SM254 • Designate whether to receive arrival stations only or to receive all slave END New QCPU
command ON: Refresh all
stations. processing)
stations
App - 52
Special Relay List (Continued)
Corresponding CPU
Corresponding
Set by
ACPU
No. Name Meaning Explanation (When
set)
M9
• Goes ON for standby network
OFF: Operative network
SM255 (If no designation has been made concerning active or standby, active S (Initial) New
ON: Standby network
MELSECNET/10 is assumed.)
module 1 OFF: Reads • For refresh from link to CPU module (B, W, etc.), designate whether to
SM256 U New
information ON: Does not read read from the link module.
OFF: Writes • For refresh from CPU module to link (B, W, etc.), designate whether to
SM257 U New
ON: Does not write write to the link module.
• Goes ON for standby network
OFF: Operative network
SM260 (If no designation has been made concerning active or standby, active S (Initial) New
ON: Standby network
MELSECNET/10 is assumed.)
module 2 OFF: Reads • For refresh from link to CPU module (B, W, etc.), designate whether to
SM261 U New
information ON: Does not read read from the link module.
OFF: Writes • For refresh from CPU module to link (B, W, etc.), designate whether to
SM262 U New
ON: Does not write write to the link module.
OFF: Operative network • Goes ON for standby network (If no designation has been made
SM265 S (Initial) New
ON: Standby network concerning active or standby, active is assumed.)
MELSECNET/10
OFF: Reads • For refresh from link to CPU module (B, W, etc.), designate whether to
SM266 module 3 U New
ON: Does not read read from the link module.
information
OFF: Writes • For refresh from CPU module to link (B, W, etc.), designate whether to
SM267 U New
ON: Does not write write to the link module.
• Goes ON for standby network
OFF: Operative network
SM270 (If no designation has been made concerning active or standby, active S (Initial) New
ON: Standby network
MELSECNET/10 is assumed.) )
module 4 OFF: Reads • For refresh from link to CPU module (B, W, etc.), designate whether to
SM271 U New
information ON: Does not read read from the link module.
OFF: Writes • For refresh from CPU module to link (B, W, etc.), designate whether to
SM272 U New
ON: Does not write write to the link module.
• Goes ON when a CC-Link error is detected in any of the installed S (Status QCPU
New
OFF: Normal QJ61QBT11. Goes OFF when normal operation is restored. change) remote
SM280 CC-Link error
ON: Error • Goes ON when a CC-Link error is detected in any of the installed S (Error
New QnA
A(1S)J61QBT11. Stays ON even after normal operation is restored. occurrence)
OFF: SFC programs not
Presence/absence used • Turns ON when an SFC program is registered
SM320 S (Initial) M9100
of SFC program ON: SFC programs • OFF when an SFC program is not registered.
used
• Initial value is set at the same value as SM320.
OFF: SFC programs (Goes ON automatically if SFC program is present.)
M9101
Start/stop SFC stop • Turn this relay OFF before the SFC program processing to suspend S (Initial)
SM321 format
program ON: SFC programs SFC program. U
change
start • Turn this relay from OFF to ON to start program execution.
• Turn this relay from ON to OFF to stop program execution.
• Initial value can be ON or OFF by setting the parameter.
• Turns this relay off to clear execution status of SFC program when
SFC program is stopped. The block which received a start request
M9102
SFC program start OFF: Initial Start starts from its initial step. S (Initial)
SM322 format
status ON: Continue • Turn this relay on to make the execution block restart from the U
change
execution step that was suspended when SFC program was stopped.
(ON is valid only when Continue is specified in the parameter.)
• SM902 is not automatically latch-specified.
OFF: Continuous • Turn this relay off to make all the blocks take 1 step per 1 scan.
Presence/absence
transition not • Turn this relay on to make all the blocks take steps continuously at 1
of continuous
SM323 effective scan. U M9103
transition for entire
ON: Continuous • For specifying blocks, the continuous transition bit takes priority.
block
transition effective (Specification is checked when a block is started.)
OFF: When transition is • OFF during operation in the continuous transition mode, and ON
Continuous S
executed during continuous transition or when continuous transition is not
SM324 transition (Instruction M9104
ON: When no executed.
prevention flag execution)
transition • Always ON during operation in the no continuous transition mode.
Selects the operational outputs of the active steps at the time of a block
Output mode at OFF: OFF stop. S (Initial)
SM325 M9196
block stop ON: Preserves • All coil outputs go OFF when this relay is OFF. U
• Coil outputs are preserved when this relay is ON.
Selects the device status when the stopped CPU restarts running after
SFC device clear OFF: Clear device
SM326 the sequence program or SFC program has been modified when the U New
mode ON: Preserves device
SFC program exists.
Selects operation output of held steps when terminating a block by end
Output during end OFF: OFF step execution. S (Initial)
SM327 New
step execution ON: Hold • All coil outputs go OFF when this relay is OFF. U
• Coil outputs are preserved when this relay is ON.
App - 53
Special Relay List (Continued)
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
• Asynchronous mode
Mode in which the operation of the low speed execution
type program is performed continuously within the excess
Operation mode for low OFF: Asynchronous time.
SM330 speed execution type mode • Synchronous mode U (END) New
program ON: Synchronous mode Mode in which the operation of the low speed execution
type program is not performed continuously and operation
is performed from the next scan even if there is excess
time.
• The status of the intelligent function module access
ON indicates completion instruction executed immediately before is stored.
S (Status
SM390 Access execution flag of intelligent function (This data is overwritten when the intelligent function New QCPU
change)
module access module access instruction is executed again.)
• Used by the user in a program as a completion bit.
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
ON S(Every END
SM400 Always ON • Always ON M9036
OFF processing)
ON S(Every END
SM401 Always OFF • Always OFF M9037
OFF processing)
• After RUN, ON for 1 scan only
After RUN, ON for 1 ON S(Every END
SM402 1 scan • This connection can be used for scan execution type M9038
scan only OFF processing)
programs only.
• After RUN, OFF for 1 scan only
OFF for 1 scan only ON S(Every END
SM403 1 scan • This connection can be used for scan execution type M9039
after RUN OFF processing)
programs only.
ON for 1 scan only after • After RUN, ON for 1 scan only
ON S(Every END
SM404 low speed execution 1 scan • This connection can be used for low speed execution type New
OFF processing)
type program RUN programs only.
OFF for 1 scan only
• After RUN, OFF for 1 scan only
after low speed ON S(Every END
SM405 1 scan • This connection can be used for low speed execution type New
execution type program OFF processing)
programs only.
RUN
• Repeatedly changes between ON and OFF at 5-ms
0.005 sec. S (Status
SM409 0.01 second clock 0.005 sec. interval. New QCPU
change)
• When turned OFF or reset, goes from OFF to start.
0.05 sec.
SM410 0.1 second clock 0.05 sec. M9030
• Repeatedly changes between ON and OFF at each
0.1 sec. designated time interval.
SM411 0.2 second clock 0.1 sec. M9031
• When turned OFF or reset, goes from OFF to start. S (Status
0.5 sec. Note that the ON-OFF status changes when the change)
SM412 1 second clock 0.5 sec. M9032
designated time has elapsed during the execution of the
1 sec. program.)
SM413 2 second clock 1 sec. M9033
M9034
n sec. • Alternates between ON and OFF at intervals of seconds S (Status
SM414 2n second clock n sec. format
specified in SD414. change)
change
n(ms) • Alternates between ON and OFF at intervals of the time S (Status
SM415 2n (ms) clock n(ms) New QCPU
(unit: ms) specified in SD415. change)
SM420 User timing clock No. 0 M9020
• Relay repeats ON/OFF switching at fixed scan intervals.
SM421 User timing clock No. 1 M9021
• When turned ON or reset, goes from OFF to start. S (Every END
SM422 User timing clock No. 2 • The ON/OFF intervals are set with the DUTY instruction. M9022
processing)
SM423 User timing clock No. 3 DUTY n1 n2 SM420 M9023
n2 scan n2 scan
SM424 User timing clock No. 4 M9024
SM430 User timing clock No. 5
SM431 User timing clock No. 6 n1 scan
S (Every END
SM432 User timing clock No. 7 • For use with SM420 to SM424 low speed programs New
processing)
SM433 User timing clock No. 8
SM434 User timing clock No. 9
App - 54
(4) Scan information
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
OFF: Completed or not
Low speed program executed • Goes ON when low speed execution type program is S(Every END
SM510 New
execution flag ON: Execution under executed. processing)
way
• When this relay goes from OFF to ON, the module service
Reads module service OFF: Ignored +
SM551 interval designated by SD550 is read to SD551 through U New
interval ON: Read Rem
552.
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
Memory card usable OFF: Not available
SM600 • ON when memory card is ready for use by user. S (Initial) New
flag ON: Available
Memory card protect OFF: No protect
SM601 • Goes ON when memory card protect switch is ON. S (Initial) New
flag ON: Protect
OFF: No drive 1
SM602 Drive 1 flag • Turns ON when the mounted memory card is RAM. S (Initial) New
ON: Drive 1
OFF: No drive 2
SM603 Drive 2 flag • Turns ON when the mounted memory card is ROM. S (Initial) New
ON: Drive 2
Memory card in-use OFF: Not used
SM604 • Goes ON when memory card is in use. S (Initial) New
flag ON: In use
OFF: Remove/insert
Memory card
enabled • Goes ON when memory card cannot be inserted or
SM605 remove/insert prohibit U New
ON: Remove/insert removed.
flag
prohibited
OFF: Remove/insert • Turned ON by user to enable the removal/insertion of
Memory card
disabled memory card.
SM609 remove/insert enable U/S New
ON: Remove/insert • Turned OFF by the system after the memory card is
flag
enabled removed.
App - 55
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
OFF: File register not
S (Status
SM640 File register use used • Goes ON when file register is in use. New
change)
ON: File register in use
OFF: Comment not
S (Status
SM650 Comment use used • Goes ON when comment file is in use. New
change)
ON: Comment in use
OFF: Internal memory
execution • Goes ON while boot operation is in process. S (Status
SM660 Boot operation New
ON: Boot operation in • Goes OFF if boot designation switch is OFF. change)
progress
OFF: Within access • Goes ON when access is made to area outside the range of
Memory card A file
range file register R of memory card A. (Set within END
SM672 register access range S/U New
ON: Outside access processing.)
flag
range • Reset at user program.
Q2A
OFF: Within access • Goes ON when access is made to area outside the range of
Memory card B file (S1)
range file register R of memory card B. (Set within END
SM673 register access range S/U New Q3A
ON: Outside access processing.)
flag Q4A
range • Reset at user program.
Q4AR
Corresponding
Corresponding
ACPU
Set by
CPU
No. Name Meaning Explanation
(When set)
M9
OFF: Carry OFF S (Instruction
SM700 Carry flag • Carry flag used in application instruction M9012
ON: Carry ON execution)
• When SM701 is OFF, output conducted until NUL (00H)
OFF: Outputs until NUL
Number of output code is encountered.
SM701 ON: 16 characters U M9049
characters selection • When SM701 is OFF, 16 characters of ASCII code are
output
output.
OFF: Search next • Designates method to be used by search instruction.
SM702 Search method U New
ON: 2-part search • Data must be arranged for 2-part search.
OFF: Ascending order • The sort instruction is used to designate whether data
SM703 Sort order U New
ON: Descending order should be sorted in ascending order or in descending order.
OFF: Non-match found • Goes ON when all data conditions have been met for the S (Instruction
SM704 Block comparisons New
ON: All match BKCMP instruction. execution)
• When SM707 is OFF, real number instructions are
Selection of real
OFF: Speed oriented processed at high speed.
SM707 number instructions U New Q4AR
ON: Accuracy oriented • When it is ON, real number instructions are processed with
processing type
high accuracy.
CHK instruction priority OFF: Conditions priority • Remains as originally set when OFF. S (Instruction
SM710 New
ranking flag ON: Pattern priority • CHK priorities updated when ON. execution)
OFF: Other than during
divided • In processing of AD57(S1), goes ON when canvas screen is
Divided transmission S (Instruction
SM711 processing divided for transfer, and goes OFF when split processing is M9065
status execution)
ON: During divided completed.
processing
OFF: Batch processing
Transmission • In processing of AD57(S1), goes ON when canvas screen is S (Instruction
SM712 ON: Divided M9066
processing selection divided for transfer. execution)
processing
QnA
OFF: Communication
request to remote
terminal module
Communication request • Used to determine whether communications requests to
enabled S (Instruction
SM714 registration area BUSY remote terminal modules connected to the AJ71PT32-S3 M9081
ON: Communication execution)
signal can be executed or not.
request to remote
terminal module
disabled
0: During DI S (Instruction
SM715 EI flag • ON when EI instruction is being executed. New
1: During EI execution)
OFF: Comment read
Comment read not completed • Turns on only during one scan when the processing of the S (Status
SM720 New
completion flag ON: Comment read COMRD or PRC instruction is completed. change)
completed
OFF: File not accessed QCPU
• Switches ON while a file is being accessed by the S (Status
SM721 File being accessed ON: File being New
S.FWRITE, S. FREAD, COMRD, PRC, or LEDC instruction. change)
accessed
BIN/DBIN instruction OFF: Error OK • Turned ON when "OPERATION ERROR" is suppressed for
SM722 U New
error disabling flag ON: Error NG BIN or DBIN instruction.
App - 56
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
OFF: Request for
communication wit
intelligent device
BUSY signal for CCLink • Used for determination whether to enable or disable the
station enabled S (Instruction
SM730 communication request communication request for the intelligent device station New QnA
ON: Request for execution)
registration area connected with A(1S)J61QBT11.
communication wit
intelligent device
station disabled
OFF: Instruction not
PKEY instruction • ON when PKEY instruction is being executed.
executed S (Instruction
SM736 execution in progress Goes OFF when CR is input, or when input character string New
ON: Instruction execution)
flag reaches 32 characters.
execution
OFF: Keyboard input
Keyboard input • Goes ON when keyboard input is being conducted.
reception enabled S (Instruction
SM737 reception flag for PKEY Goes OFF when keyboard input has been stored at the New
ON: Keyboard input execution)
instruction CPU.
reception disabled
OFF: Instruction not
MSG instruction executed S (Instruction
SM738 • Goes ON when MSG instruction is executed. New
reception flag ON: Instruction execution)
execution
OFF: Forces match
PID bumpless • Specify whether the set value (SV) will be matched with the
SM774 ON: Does not force U New
processing process value (PV) in the manual mode.
match
OFF: Performs link
Selection of link refresh • Select whether link refresh processing will be performed or
refresh
SM775 processing during COM not when only general data is processed at the execution of U New
ON: Performs no link
instruction execution the COM instruction.
refresh
OFF: Local device
• Set whether the local device of the subroutine program
Enable/disable local disabled U (Status
SM776 called at execution of the CALL instruction is valid or New
device at CALL ON: Local device change)
invalid.
enabled
OFF: Local device
Enable/disable local
disabled • Set whether the local device at execution of the interrupt U (Status
SM777 device in interrupt New
ON: Local device program is valid or invalid. change)
program
enabled
OFF: CC-Link dedicated
instruction
• Switches ON when the number of the CC-Link dedicated
CC-Link dedicated executable U (Status
SM780 instructions that can be executed simultaneously reaches New QnA
instruction executable ON: CC-Link dedicated change)
32. Switches OFF when the number goes below 32.
instruction not
executable
(7) Debug
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
S (Status
Trace preparation • Switches ON when the trace preparation is completed. New QCPU
OFF: Not ready change)
SM800
Sampling trace ON: READY • Switches ON when the sampling trace preparation is S (Status
New QnA
preparation completed. change)
• Trace started when this goes ON.
Trace start U M9047 QCPU
OFF: Suspend • Suspended when OFF (Related special M all OFF)
SM801
ON: Start • Sampling trace started when this goes ON.
Sampling trace start U M9047 QnA
• Suspended when OFF (Related special M all OFF)
Trace execution in S (Status
• Switches ON during execution of trace. M9046 QCPU
progress OFF: Suspend change)
SM802
Sampling trace ON: Start S (Status
• Switches ON during execution of sampling trace. M9046 QnA
execution in progress change)
• Trace is triggered when this relay switches from OFF to
Trace trigger ON. U M9044 QCPU
(Identical to TRACE instruction execution status)
SM803 OFF ON: Start
• Sampling trace is triggered when this relay switches from
Sampling trace trigger OFF to ON. U M9044 QnA
(Identical to STRA instruction execution status)
S (Status
After trace trigger • Switches After trace is triggered. New QCPU
OFF: Not after trigger change)
SM804
After sampling trace ON: After trigger S (Status
• Switches After sampling trace is triggered. New QnA
trigger change)
App - 57
Corresponding CPU
Corresponding
ACPU
Set by
No. Name Meaning Explanation
(When set)
M9
S (Status
Trace completed • Switches ON at completion of trace. M9043 QCPU
OFF: Not completed change)
SM805
Sampling trace ON: End S (Status
• Switches ON at completion of sampling trace. M9043 QnA
completed change)
Status latch OFF: Not ready S (Status
SM806 • Goes ON when status latch is ready. New
preparation ON: READY change)
SM807 Status latch command OFF ON: Latch • Runs status latch command U New
Status latch OFF: Not ready S (Status
SM808 • Goes ON when program trace is ready. M9055
completion ON: Ready change)
SM809 Status latch clear OFF ON: Clear • Enable next status latch U New
Program trace OFF: Not ready S (Status
SM810 • Goes ON when program trace is ready. New
preparation ON: READY change)
OFF: Suspend • Program trace started when this goes ON. S (Status
SM811 Start program trace New QnA
ON: Start • Suspended when OFF (Related special M all OFF) change)
Program trace OFF: Suspend
SM812 • ON when program trace execution is underway. U New
execution under way ON: Start
• Program trace trigger goes ON when this goes from OFF
S (Status
SM813 Program trace trigger OFF ON: Start to ON. New
change)
(Identical to PTRA instruction execution status)
After program trace OFF: Not after trigger S (Status
SM814 • Goes ON after program trace trigger. New
trigger ON: After trigger change)
Program trace OFF: Not completed S (Status
SM815 • Goes ON at completion of program trace. New
completion ON: End change)
OFF: Not ready
SM820 Step trace preparation • Goes ON after step trace is registered and ready. U New
ON: READY
M9182
OFF: Suspend • When this goes ON, step trace is started. S (Status
SM821 Step trace starts format
ON: Start • Suspended when OFF (Related special M all OFF) change)
change
Step trace execution OFF: Suspend • Goes ON when step trace execution is underway. S (Status
SM822 M9181
underway ON: Start • Goes OFF at completion or suspension. change)
• Goes ON if even 1 block within the step trace being
OFF: Not after trigger S (Status
SM823 After step trace trigger executed is triggered. New
ON: Is after first trigger change)
• Goes OFF when step trace is started.
• Goes ON if all blocks within the step trace being executed
OFF: Is not after all triggers S (Status
SM824 After step trace trigger are triggered. New
ON: Is after all triggers change)
• Goes OFF when step trace is started.
OFF: Not completed • Goes ON at step trace completion. S (Status
SM825 Step trace completed M9180
ON: End • Goes OFF when step trace is started. change)
S (Status
Trace error • Switches ON if error occurs during execution of trace. New QCPU
OFF: Normal change)
SM826
ON: Errors • Switches ON if error occurs during execution of sampling S (Status
Sampling trace error New
trace. change)
OFF: Normal • Switches ON if error occurs during execution of status S (Status
SM827 Status latch error New QnA
ON: Errors latch. change)
OFF: Normal • Switches ON if error occurs during execution of program S (Status
SM828 Program trace error New
ON: Errors trace. change)
Corresponding
ACPU
Set by
CPU
OFF: No power cut file • Goes ON if a file being accessed is present when power is S/U (Status
SM900 Power cut file OFF New QnA
ON: Power cut file present disconnected. change)
OFF: Keyboard input not
registered • Goes ON at registration of keyboard input. S (Instruction
SM910 RKEY registration flag New
ON: Keyboard input OFF if keyboard input is not registered. execution)
registered
App - 58
(9) A to Q/QnA conversion correspondences
Special relays SM1000 to SM1255 are the relays which correspond to ACPU
special relays M9000 to M9255 after A to Q/QnA conversion.
These special relays are all set by the system, and cannot be set by the user
program.
To turn them ON/OFF by the user program, change the special relays in the
program into those of QCPU/QnACPU.
However, some of SM1084 and SM1200 to SM1255 (corresponding to M9084
and M9200 to M9255 before conversion) can be turned ON/OFF by the user
program, if they could be turned ON/OFF by the user program before conversion.
For details on the ACPU special relays, see the user's manuals for the individual
CPUs, and MELSECNET or MELSECNET/B Data Link System Reference
Manuals.
POINT
The processing time may be longer when converted special relays are used with the
QCPU. Uncheck "A-series CPU compatibility setting" within the PC system setting in
GX Developer parameters when converted special relays are not used.
REMARK
The following are additional explanations about the Special Relay for Modification
column.
1) When a special relay for modification is provided, the device number should be
changed to the provided QCPU/QnACPU special relay.
2) When is provided, the converted special relay can be used for the device
number.
3) When is provided, the device number does not work with QCPU/QnACPU.
Special Relay List
Corresponding
ACPU Special Special
CPU
Special Relay after Relay for Name Meaning Details
Relay Conversion Modification
App - 59
Special Relay List (Continued)
Corresponding CPU
ACPU Special Special
Special Relay after Relay for Name Meaning Details
Relay Conversion Modification
OFF: No F number
Annunciator • Turned on when OUT F of SET F instruction is executed.
M9009 SM1009 SM62 detected
detection Switched off when SD1124 data is zeroed.
ON: F number Detected
• Turns on when operation error occurs during execution of
Operation error OFF: No error
M9011 SM1011 SM56 application instruction, and remains ON even if the condition
flag ON: Error
is restored to normal thereafter.
OFF: Carry OFF
M9012 SM1012 SM700 Carry flag • Carry flag used in application instruction
ON: Carry ON
• Clears the data memory including the latch range (other than
Data memory OFF: Ignored
M9016 SM1016 special relays and special registers) in remote run mode from
clear flag ON: Output cleared
computer, etc. when SM1016 is on.
• Clears the unlatched data memory (other than special relays
Data memory OFF: Ignored
M9017 SM1017 and special registers) in remote run mode from computer,
clear flag ON: Output cleared
etc. when SM1017 is on.
User timing • Relay which repeats on/off at intervals of predetermined
M9020 SM1020 ––––
clock No. 0 scan.
User timing • When power is turned on or reset is per-formed, the clock
M9021 SM1021 ––––
clock No. 1 starts with off.
n2 scan n2 scan
User timing • Set the intervals of on/off by DUTY instruction.
M9022 SM1022 ––––
clock No. 2
User timing n1 scan
M9023 SM1023 ––––
clock No. 3
User timing
M9024 SM1024 ––––
clock No. 4
OFF: Ignored • Writes the clock data stored in SD1025 to SD1028 to the
Clock data set
M9025 SM1025 –––– ON: Set request present CPU module after the END instruction is executed in the
request
used scan in which SM1025 turned from OFF to ON.
Clock data OFF: No error • Switched ON by clock data (SD1025 to SD1028) error, and
M9026 SM1026 ––––
error ON: Error OFF if no error is detected.
• Clock data is read from SD1025 to SD1028 and month, day,
Time data OFF: Ignored
M9027 SM1027 –––– hour, minute and minute are indicated on the CPU module
display ON: Display
front LED display.
Clock data OFF: Ignored • Reads clock data to SD1025 to SD1028 in BCD when
M9028 SM1028 ––––
read request ON: Read request SD1028 is on.
• The SM1029 relay is turned on using a sequence program to
process all data communication requests accepted during
Batch
OFF: Batch processing not one scan in the END processing of that scan.
processing of
conducted • The batch processing of the data communication requests
M9029 SM1029 data
ON: Batch processing can be turned on and off during running.
communication
conducted • The default is OFF (processed one at a time for each END
s requests
processing in the order in which data communication
requests are accepted).)
0.1 second
M9030 SM1030 –––– 0.05 sec. 0.05 sec.
clock
0.2 second • 0.1 second, 0.2 second, 1 second and 2 second, clocks are
M9031 SM1031 –––– 0.1 sec. 0.1 sec.
clock generated.
• Not turned on or off per scan but turned on and off even
M9032 SM1032 –––– 1 second clock 0.5 sec. 0.5 sec.
during scan if corresponding time has elapsed.
• Starts with off when power supply is turned on or CPU
M9033 SM1033 –––– 2 second clock 1 sec. 1 sec. module reset is performed.
M9036 SM1036 –––– Always ON • Used as dummy contacts of initialization and application
instruction in sequence program.
• SM1038 and SM1037 are turned on and off without regard to
M9037 SM1037 –––– Always OFF
position of key switch on CPU module front. SM1038 and
SM1039 are under the same condition as RUN status except
ON for 1 scan when the key switch is at STOP position, and turned off and
M9038 SM1038 –––– 1 scan
only after RUN on. Switched off if the key switch is in STOP position.
RUN flag (After SM1038 is on for one scan only and SM1039 is off for one
M9039 SM1039 –––– RUN, OFF for 1 scan scan only if the key switch is not in STOP position.
1 scan only)
PAUSE enable OFF: PAUSE disabled
M9040 SM1040 SM206 • When RUN key switch is at PAUSE position or pause contact
coil ON: PAUSE enabled
has turned on and if SM204 is on, PAUSE mode is set and
PAUSE status OFF: PAUSE not in effect SM206 is turned on.
M9041 SM1041 SM204
contact ON: PAUSE in effect
App - 60
Special Relay List (Continued)
Corresponding CPU
ACPU Special Special
Special Relay after Relay for Name Meaning Details
Relay Conversion Modification
App - 61
Special Relay List (Continued)
Corresponding CPU
ACPU Special Special
Special Relay after Relay for Name Meaning Details
Relay Conversion Modification
App - 62
Special Relay List (Continued)
Corresponding CPU
ACPU Special Special
Special Relay after Relay for Name Meaning Details
Relay Conversion Modification
Step transition
watchdog timer
M9112 SM1112 SM94 start
(equivalent of
SD94)
Step transition • Turns ON when the measurement of the step transition
watchdog timer OFF: Watchdog timer reset
watchdog timer is started.
M9113 SM1113 SM95 start ON: Watchdog timer reset
Turning this relay OFF resets the step transition watchdog
(equivalent of start
timer.
SD95)
Step transition
watchdog timer
M9114 SM1114 SM96 start
(equivalent of
SD96)
Active step
OFF: Trace start • Set when sampling trace of all specified blocks is completed.
M9180 SM1180 SM825 sampling trace
ON: Trace completed Reset when sampling trace is started.
completion flag
OFF: Trace not being
Active step
executed • Set when sampling trace is being executed. Reset when
M9181 SM1181 SM822 sampling trace
ON: Trace execution sampling trace is completed or suspended.
execution flag
underway
• Selects sampling trace execution enable/disable.
Active step OFF: Trace ON: Sampling trace execution is enabled.
M9182 SM1182 SM821 sampling trace disable/suspend OFF: Sampling trace execution is disabled.
permission ON: Trace enable Sampling trace execution is disabled. If turned off during
sampling trace execution, trace is suspended.
• Selects the operation output when block stop is executed.
ON: Retains the ON/OFF status of the coil being used by
Operation using operation output of the step being executed at
OFF: Coil output OFF
M9196 SM1196 SM325 output at block block stop.
ON: Coil output ON
stop OFF: All coil outputs are turned off.
(Operation output by the SET instruction is retained
regardless of the ON/OFF status of M9196.)
I/O numbers
SM SM
to be
1197 1198
displayed
M9197 SM1197 X/Y
OFF OFF
Switch 0 to 7F0
Switches I/O numbers in the fuse blow module storage
between blown X/Y
ON OFF registers (SD1100 to SD1107) and I/O module verify error
fuse and I/O 800 to FF0
storage registers (SD1116 to SD1123) according to the
verification X/Y combination of ON/OFF of the SM1197 and SM1198.
error display OFF ON 1000 to
17F0
M9198 SM1198
X/Y
ON ON 1800 to
1FF0
Data recovery • Recovers the setting data stored in the CPU module at restart
OFF: Data recovery
of online when sampling trace/status latch is executed.
disabled
M9199 SM1199 sampling • SM1199 should be ON to execute again.
ON: Data recovery
trace/status (Unnecessary when writing the data again from peripheral
enabled
latch devices.)
ZNRD
instruction • Depends on whether or not the ZNRD (word device read)
(LRDP OFF: Not accepted instruction has been received.
M9200 SM1200 ––––
instruction for ON: Accepted • Used in the program as an interlock for the ZNRD instruction.
ACPU) • Use the RST instruction to reset.
completion
QnA
ZNRD
• Depends on whether or not the ZNRD (word device read)
instruction
instruction execution is complete.
(LRDP OFF: Not completed
M9201 SM1201 –––– • Used as a condition contact for resetting SM1202 and
instruction for ON: End
SM1203 after the ZNRD instruction is complete.
ACPU)
• Use the RST instruction to reset.
completion
App - 63
Appendix 4 Special Register List
Special registers, SD, are internal relays with fixed applications in the PLC. For this
reason, it is not possible to use these registers in sequence programs in the same way
that normal registers are used. Data stored in the special registers are stored as BIN
values if no special designation has been made to the contrary.
Data stored in the special registers are stored as BIN values if no special designation
has been made to the contrary.
The heading descriptions in the following special register lists are shown in the
following table.
Item Function of item
Number • Indicates the number of special register.
Name • Indicates the name of the special register.
Meaning • Indicates the contents of the special register.
Explanation • Indicates the detailed contents of the special register.
• Indicates whether the relay is set by the system or user, and if it is set by the system,
when setting is performed.
<Set by>
S : Set by system
U : Set by user (Sequence program or test operations at a peripheral device)
S/U : Set by both system and user
<When set>
Set by
indicated only for registers set by system.
(When set)
Each END : Set during each END processing
Initial : Set only during initial processing (when power supply is turned
ON, or when going from STOP to RUN)
Status change : Set only when there is a change in status
Error : Set when error occurs
Instruction execution : Set when instruction is executed
Request : Set only when there is a user request (through SM, etc.)
• Indicates corresponding special register in ACPU
Corresponding
(When the contents are changed, the special register is represented as changed)
ACPU
• New indicates the special register newly added to the QnACPU or Q series CPU
D9
module.
POINT
(1) SD1200 to SD1255 are used for QnACPU.
These relays are vacant with QCPU.
(2) SM1500 or later is exclusively used for Q4ARCPU.
App - 64
(1) Diagnostic information
Set by Corresponding
Corresponding
Number Name Meaning Explanation (When ACPU
CPU
set) D9
D9008
Diagnostic Diagnosis • Error codes for errors found by diagnosis are stored as BIN data.
SD0 S (Error) format
errors error code • Contents identical to latest fault history information.
change
• Year (last two digits) and month that SD0 data is updated is stored
as BCD 2-digit code.
SD1
B15 to B8 B7 to B0 (e.g.) Oct. 1995
Year (0 to 99) Month (1 to 12) H9510
Clock time Clock time
for for • The day and hour that SD0 is updated is stored as BCD 2-digit code.
SD2 diagnosis diagnosis B15 to B8 B7 to B0 (e.g.) 25th, 10 o'clock S (Error) New
error error Day (1 to 31) Hour (0 to 23) H2510
occurrence occurrence
• The minute and second that SD0 data was updated is stored as
BCD 2-digit code.
SD3
B15 to B8 B7 to B0 (e.g.) 35, 48
Min. (1 to 59) Sec. (0 to 59) H3548
Category codes which help indicate what type of error information is
being stored in the common information areas (SD5 through SD15)
and the individual information areas (SD16 through SD26) are stored
here.
B15 to B8 B7 to B0
Individual info category code Common info category code Rem
App - 65
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation (When ACPU
CPU
set) D9
SD5 • Common information corresponding to the error codes (SD0) is
SD6 stored here.
SD7 • The following four types of information are stored here:
SD8 1) Unit/module No.
Number Contents
SD9
SD5 Slot No./PLC No.* 1 * 2
SD10 SD6 I/O No.
SD11 SD7
SD8
SD12
SD9
SD13 SD10
SD14 SD11 (Vacancy)
SD12
SD13
SD14
SD15
App - 66
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation (When ACPU
CPU
set) D9
SD5
SD6 (Continued)
3) Time (value set)
SD7
Number Contents
SD8 SD5 Time: In 1 μ s units (0 to 999 μ s)
SD9 SD6 Time: In 1 ms units (0 to 65535 ms)
SD10 SD7
SD8
SD11 SD9
SD12 SD10
SD11 (Vacancy)
SD13
SD12
SD14 SD13
SD15 SD14
SD15
5) Switch cause
Number Contents
SD5 Switching factor (0: Auto/1: Manual)
SD6 Switching direction (0: Standby to control/1: Control to standby)
SD7 Tracking flag * 6
SD8
SD9
SD10
SD11 (Vacancy)
SD12
SD13
SD14 S (Error) New Q4AR
SD15
*6: Tracking flag contents
Shows whether or not the tracking data is valid.
15 14 to 4 3 2 1 0 (Bit No.)
0 0 to 0 0
App - 67
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation (When ACPU
CPU
set) D9
SD16 • Individual information corresponding to error codes (SD0) is stored
SD17 here.
SD18 • The following six types of information are stored here:
SD19 1) File name/Drive name
(e.g.) File name
SD20 Number Contents
ABCDEFGH. IJK
SD16 Drive B15 to B8 B7 to B0
SD21
SD17 42H(B) 41H(A)
SD22 SD18 File name 44H(D) 43H(C)
SD23 SD19 (ASCII code: 8 characters) 46 H(F) 45H(E)
SD20 48 H(H) 47H(G)
SD24
SD21 Extension*3 2E H (. ) 49H(I) 2D H(. )
SD25 SD22 (ASCII code: 3 characters) 4BH(K) 4AH(B)
SD26 SD23
SD24
(Vacancy)
SD25
SD26
App - 68
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
Error
number that
SD50 Error reset • Stores error number that performs error reset U New Rem
performs
error reset
• All corresponding bits go 1(ON) when battery voltage drops.
• Subsequently, these remain 1(ON) even after battery voltage
has been returned to normal.
Bit pattern B4 B3 B2 B1 B0
indicating 0<------------------->
Battery low where CPU error
SD51 Memory card A alarm S (Error) New
latch battery
voltage drop Memory card A error
occurred Memory card B alarm
Memory card B error
• When the QCPU is used, the memory card B is standard and
therefore the corresponding bits always remain OFF.
Bit pattern
• Same configuration as SD51 above
indicating
• Turns to 0 (OFF) when the battery voltage returns to normal
where
SD52 Battery low thereafter. S (Error) New
battery
• When the QCPU is used, the memory card B is standard and
voltage drop
therefore the corresponding bits always remain OFF.
occurred
Number of • Every time the input voltage falls to or below 85% (AC
AC DOWN time for AC power)/65% (DC power) of the rating during operation of the
SD53 S (Error) D9005 Rem
detection DOWN CPU module, the value is incremented by 1 and stored in
detection BIN code.
1) When any of X(n+0)/X(n+20), X(n+6)/X(n+26),
X(n+7)/X(n+27) and X(n+8)/X(n+28) of the mounted
MINI(-S3) turns ON, the bit of the corresponding station
turns to 1 (ON).
Error 2) Turns to 1 (ON) when communication between the mounted D9004
MINI link MINI (-S3) and CPU module cannot be made.
SD54 detection S (Error) format QnA
errors B15 B9 B8 B0
status change
8th
module······ 1st 8th
module module
1st
module
Information of 2) Information of 1)
Number of Number of • Value stored here is the lowest station I/O number of the
SD60 module with module with S (Error) D9000
blown fuse fuse blown module with the blown fuse.
I/O module Rem
I/O module • The lowest I/O number of the module where the I/O module
verification
SD61 verification S (Error) D9002
error module verification error took place.
error number
number
Annunciator Annunciator • The first annunciator number (F number) to be detected is S (Instruction
SD62 D9009
number number stored here. execution)
Number of Number of S (Instruction
SD63 • Stores the number of annunciators searched. D9124
annunciators annunciators execution)
REMARK
Extensions are shown below.
SD10 SD11
Extension File type
Higher 8 Lower 8 Higher 8 name
bits bits bits
51H 50 H 41 H QPA parameters
51 H 50 H 47 H QPG Sequence program/SFC program
51 H 43 H 44 H QCD Device comment
51 H 44 H 49 H QDI Device initial value
51 H 44 H 52 H QDR File register
51 H 44 H 53 H QDS Simulation data
51 H 44 H 4C H QDL Local device
51 H 54 H 53 H QTS Sampling trace data (For QnA)
51 H 54 H 4C H QTL Status latch data (For QnA)
51 H 54 H 50 H QTP Program trace data (For QnA)
51 H 54 H 52 H QTR SFC trace file
51 H 46 H 44 H QFD Trouble history data
App - 69
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
CHK CHK • Error codes detected by the CHK instruction are stored as S (Instruction
SD80 New
number number BCD code. execution)
Stores the
xCH1 preset
transmission transmission K3: 300bps, K6: 600bps, K24: 2400bps, K48: 4800bps
SD105 speed speed when K96: 9600bps, K192: 19.2kbps, K384: 38.4kbps S New
setting GX K576: 57.6kbps, K1152: 115.2kbps
(RS232) Developer is QCPU
used. remote
Module No.
Error No. for
which has • Stores the lowest head No. of the module whose external
external S (Error
SD120 external power supply is OFF. New
power occurrence)
power * Applicable only for Q-series modules (For future use)
supply OFF
supply error
App - 70
Special Register List
(2) System information
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
• The switch status of the remote I/O module is stored in the
following format.
B15 B4 B3 B0
S (Always) New Remote
Vacant 1)
1) Remote I/O module switch status Always 1: STOP
• The CPU switch status is stored in the following format:
B15 B12 B11 B8 B7 B4 B3 B0 S (Every END
processing)
3) Vacant 2) 1)
1) CPU switch status 0: RUN
1: STOP
2: L.CLR New QCPU
2) Memory card
Always OFF
switch
3) DIP switch B8 through BC correspond to
SW1 through SW5 of system
Status of Status of setting switch 1.
SD200 0: OFF, 1: ON
switch CPU switch BD through BF are vacant.
S (Status
8) 7) 6) 5) 4) 3) 2) 1) New QCPU
1): RUN 5): BOOT change)
2): ERROR 6): Vacant
3): USER 7): Vacant
4): BAT.ALARM 8): MODE
Status of Mode bit patter
SD201 LED Status
CPU-LED 0: OFF 1: Green 2: Orange
• The following bit patterns are used to store the statuses of
the LEDs on the CPU module:
• 0 is off, 1 is on, and 2 is flicker.
B15 B12B11 B8 B7 B4 B3 B0
S (Status
New
8) 7) 6) 5) 4) 3) 2) 1) change)
1): RUN 5): BOOT QnA
2): ERROR 6): CARD A (memory card)
3): USER 7): CARD B (memory card)
4): BAT.ALARM 8): Vacant
Bit pattern of • Stores bit patterns of LEDs turned off
SD202 LED off LED that is (Only USER and BOOT enabled) U New
turned off • Turned off at 1, not turned off at 0
App - 71
Special Register List (Continued)
Corresponding
Set by Corresponding
Number Name Meaning Explanation (When set) ACPU
CPU
D9
• The operating status of the remote I/O module is stored in
the following format.
B15 B4 B3 B0
S (Always) New Remote
1)
1) Remote I/O module operating status Always 2: STOP
• The CPU operating state is stored as indicated in the
following figure:
B15 B12B11 B8 B7 B4 B3 B0 S(Every END
processing)
Operating Operating
SD203 2) 1)
state of CPU state of CPU
1) Operating status of CPU 0: RUN
1: STEP-RUN D9015
2: STOP format
3: PAUSE
2) STOP/PAUSE cause 0: Key switch change
1: Remote contact
2: Peripheral, computer
link, or operation
from some other
remote source
3: Internal program
instruction
Note: Priority is earliest first 4: Error
0: Test not yet • Set when the device test mode is executed on GX
executed
Device test 1: During X Developer.
device test
SD206 execution 2: During Y S (Request) New Remote
type device test
3: During X/Y
device test
• When error is generated, the LED display (flicker) is made
Priorities 1 according to the error number setting priorities.
SD207 • The setting areas for priorities are as follows: D9038
to 4
B15 B12 B11 B8 B7 B4 B3 B0
SD207 4th priority 3rd priority 2nd priority 1st priority
LED display SD208 8th priority 7th priority 6th priority 5th priority
D3039
priority Priorities 5 SD209 10th priority 9th priority
U
SD208 format
ranking to 8 Default value SD207 = H4321
change
SD208 = H8765
SD209 = H00A9
Priorities 9 • No display is made if "0" is set.
SD209 However, even if "0" has been set, information concerning New
to 10 CPU module operation stop (including parameter settings)
errors will be indicated by the LEDs without conditions.
• The year (last two digits) and month are stored as BCD code
at SD210 as shown below:
Time data B15
····· B12 B11 ····· B8 B7 ····· B4 B3 ····· B0 (e.g.) July. 1993
SD210 Time data (year, H9307 D9025
month)
Year Month
• The day and hour are stored as BCD code at SD211 as
shown below:
Time data
B15
·····B12 B11 ····· B8 B7 ····· B4 B3 ····· B0 (e.g.) 31st, 10 o'clock
SD211 Time data H3110 D9026 Rem
(day, hour)
Day Hour
• The minutes and seconds (after the hour) are stored as BCD
code at SD212 as shown below:
Time data B15 ·····B12 B11 ····· B8 B7 ····· B4 B3 ····· B0 (e.g.) 35, 48
SD212 Time data (minute, H3548 S/U (Request) D9027
second)
Min. Sec.
• The day of the week is stored as BCD code at SD213 as
shown below:
B15 ·····B12 B11 ····· B8 B7 ····· B4 B3 ····· B0 (e.g.) Friday
H0005
Time data
(Higher
Day of week QCPU
SD213 Time data digits of D9028
0 Sun remote
year, day of Later 2 digits of year (0 to 99) 1 Mon
week) 2 Tues
3 Wed
4 Thur
5 Fri
6 Sat
App - 72
Special Register List (Continued)
Corresponding
Set by Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
• The day of the week is stored as BCD code at SD213 as
shown below:
B15
····· B12 B11 ····· B8 B7 ····· B4 B3 ····· B0 (e.g.) Friday
H0005
Time data
Day of week S/U
SD213 Time data (, day of D9028 QnA
0 Sun (Request)
week)
"0" must be set 1 Mon
2 Tues
3 Wed
4 Thur
5 Fri
6 Sat
SD226 SD225 5th character from right 6th character from right
SD226 3rd character from right 4th character from right
SD227 SD226 1st character from right 2nd character from right
0: Automatic
mode
SD240 Base mode The base mode is stored. S (Initial) New
1: Detail
mode
0: Main only
No. of 1 to 7: • Stores the maximum number of the extension bases being
SD241 extension Number of S (Initial) New
extension installed.
bases
bases
Base type B7 B2 B1 B0
differentiation Fixed to 0 to
0: QA**B is QCPU
Main base
A/Q base installed (A remote
SD242 1st extension S (Initial) New
differentiation mode)
1: Q**B is 2nd extension Fixed to 0
installed (Q to if no extension
mode)
7th extension
B15 B12B11 B8 B7 B4 B3 B0
SD243
SM243 Extension 3 Extension 2 Extension 1 Main
No. of base No. of base
SM244 Extension 7 Extension 6 Extension 5 Extension 4 S (Initial) New
slots slots
SD244 • As shown above, each area stores the number of slots being
installed.
Loaded • When SM250 goes from OFF to ON, the upper 2 digits of the
Loaded S (Request
SD250 maximum I/O final I/O number plus 1 of the modules loaded are stored as New Rem
maximum I/O END)
No. BIN values.
Q2A(S1)
Head I/O No. Head I/O No. • Stores the upper two digits of the head I/O number of an I/O
Q3A
SD251 for for module that is removed/replaced in the online status. U D9094
Q4A
replacement replacement (Default value: 100H)
Q4AR
RS422 baud RS422 baud • Stores the baud rate of RS422. S (When
SD253 rate rate changed) New QnA
0: 9600bps 1: 19.2kbps 2: 38.4kbps
Number of
SD254 modules • Indicates the number of mounted NET/10 modules. S (Initial) New
mounted
SD255 I/O No. • Indicates I/O No. of the 1st NET/10 module mounted.
Information of 1st module
Network
SD256 • Indicates network No. of the 1st NET/10 module mounted.
No.
SD257 Group No. • Indicates group No. of the 1st NET/10 module mounted.
SD258 Station • Indicates station No. of the 1st NET/10 module mounted.
No.
NET/10 Standby • In the case of standby stations, the module number of the
SD259 information information standby station is stored.(1 to 4)
SD260
Information of
to 2nd module • Configuration is identical to that for the first module.
SD264
SD265 Information of
to • Configuration is identical to that for the first module.
3rd module
SD269
SD270
to Information of • Configuration is identical to that for the first module.
4th module
SD274
App - 73
Special Register List (Continued)
Corresponding
Set by Corresponding
Number Name Meaning Explanation (When set) ACPU
CPU
D9
1) When Xn0 of the mounted CC-Link module turns ON, the bit
of the corresponding station turns to 1 (ON).
2) When either Xn1 or XnF of the mounted CC-Link module
turns OFF, the bit of corresponding station turns to 1 (ON).
3) Turns to 1 (ON) when communication between the mounted
CC-Link module and CPU module cannot be made.
Information of 3) Information of 2) Information of 1)
4th module
The above module Nos. n are in order of the head I/O
CC-Link Error detection numbers.
SD280
error status (However, the one where parameter setting has not been
made is not counted.)
1) When Xn0 of the mounted CC-Link module turns ON, the bit
of the corresponding station turns to 1 (ON).
2) When either Xn1 or XnF of the mounted CC-Link module
turns OFF, the bit of corresponding station turns to 1 (ON).
3) Turns to 1 (ON) when communication between the mounted
CC-Link module and CPU module cannot be made.
Information of 3) Information of 2) Information of 1)
S (Error) New QnA
B15 B12 B11 B8 B7 B4 B3 B0
Vacancy
1st module
2nd module
3rd module
4th module
Number of points
SD290 allocated for X • Stores the number of points currently set for X devices
Number of points
SD291 allocated for Y • Stores the number of points currently set for Y devices Rem
Number of points
SD292 allocated for M • Stores the number of points currently set for M devices
Number of points
SD293 allocated for L • Stores the number of points currently set for L devices
Number of points
SD294 allocated for B • Stores the number of points currently set for B devices Rem
Number of points
SD295 allocated for F • Stores the number of points currently set for F devices
Device Number of points
SD296 allocation allocated for SB • Stores the number of points currently set for SB devices Rem
Number of points
SD297 (Same as allocated for V • Stores the number of points currently set for V devices S (Initial) New
parameter Number of points
SD298 allocated for S • Stores the number of points currently set for S devices
contents
Number of points
SD299 allocated for T • Stores the number of points currently set for T devices
Number of points
SD300 allocated for ST • Stores the number of points currently set for ST devices
Number of points
SD301 allocated for G • Stores the number of points currently set for G devices
Number of points
SD302 allocated for D • Stores the number of points currently set for D devices
Number of points
SD303 allocated for W • Stores the number of points currently set for W devices Rem
Number of points
SD304 allocated for SW • Stores the number of points currently set for SW devices
Reserves the designated time for communication processing
with GX Developer or other units
Time reserved Time reserved The greater the value is designated, the shorter the response
for for time for communication with other devices (GX Developer, U(END
SD315 serial communication units) becomes. New
communication communication Setting range: 1 to 100 ms processing) QCPU
processing processing If the designated value is out of the range above, it is assumed remote
to no setting.
The scan time becomes longer by the designated time.
Number of
SD340 modules • Number of modules mounted on Ethernet S (Initial) New
mounted
SD341 I/O No. • Indicates Ethernet I/O No. of the 1st module mounted
Information of 1st module
SD342 Network • Indicates Ethernet network No. of the 1st module mounted
No.
SD343 Ethernet Group • Indicates Ethernet group No. of the 1st module mounted
No.
information Station
SD344 No. • Indicates Ethernet station No. of the 1st module mounted
SD345 • Vacant
to Vacant (With QCPU, the Ethernet IP address of the 1st module is
SD346 stored in buffer memory.)
• Vacant
SD347 Vacant (With QCPU, the Ethernet error code of the 1st module is
read with the ERRORRD instruction.)
App - 74
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
SD348 Information
to from 2nd • Configuration is identical to that for the first module.
SD354 module
SD355 Ethernet QCPU
Information of S (Initial) New
to • Configuration is identical to that for the first module.
information 3rd module remote
SD361
SD362
Information of
to • Configuration is identical to that for the first module.
4th module
SD368
SD340 Number of • Number of modules installed on Ethernet
modules mounted
SD341 I/O No. • Indicates Ethernet I/O No. of the 1st module mounted
Network
SD342 • Indicates Ethernet network No. of the 1st module mounted
Information of 1st
No.
SD343 Group No. • Indicates Ethernet group No. of the 1st module mounted.
SD344 Station No. • Indicates Ethernet station No. of the 1st module mounted.
SD345
module
to Ethernet IP address • Indicates Ethernet station No. of the 1st module mounted.
SD346 information S (Initial) New QnA
SD347 Error Code • Indicates error code of the 1st module mounted.
SD348 Information of
to 2nd module • Configuration is identical to that for the first module.
SD354
SD355 Information of
to 3rd module • Configuration is identical to that for the first module.
SD361
SD362 Information of
to 4th module • Configuration is identical to that for the first module.
SD368
B15 B8 B7 B6 B5 B4 B3 B2 B1 B0
0 to 0
Not used Reception status of channel 1
Reception status of channel 2
Instruction Reception status of channel 3
Reception status of channel 4
SD380 reception status
Reception status of channel 5
of 1st module
Reception status of channel 6
Ethernet Reception status of channel 7
instruction Reception status of channel 8
S (Initial) New
reception ON : Received (channel in use)
status OFF: Not received (channel not in use)
Instruction QnA
SD381 reception status • Configuration is identical to that for the first module.
of 2nd module
Instruction
SD382 reception status • Configuration is identical to that for the first module.
of 3rd module
Instruction
SD383 reception status • Configuration is identical to that for the first module.
of 4th module
• Stores the internal system software version in ASCII code.
Internal system High byte Low byte Stored in low byte
Software Inconsistent value in high byte
SD392 software S (Initial) D9060
version "41H" is stored when using version "A"
version
Note: The internal system software version may differ from the
version indicated by the version symbol printed on the case.
Multi CPU Multi CPU • In a multiple CPU system configuration, the CPU number of QCPU
SD395 the host CPU is stored. S (Error) New function
number number
PLC No. 1: 1, PLC No. 2: 2, PLC No. 3: 3, PLC No. 4: 4 Ver. B
App - 75
(4) Scan information
Corresponding
Set by Corresponding
Number Name Meaning Explanation (When set) ACPU
CPU
D9
Execution Program No. in S (Status
SD500 program • Program number of program currently being executed is New
execution stored as BIN value. change)
No.
Low speed Low speed • Program number of low speed execution type program No. S (Every
SD510 program program in currently being executed is stored as BIN value. END New
No. execution • Enabled only when SM510 is ON. processing)
Current scan S (Every D9017
SD520 time (In 1 ms • The current scan time is stored. (In 1 ms units) END format
units) • Range from 0 to 65535
processing) change
• The current scan time is stored. (In 100 s units)
Current • Range from 000 to 900
scan time S (Every
Current scan (Example) When the current scan time is 23.6ms, the
SD521 time (In 100 s END New
units) following values are stored.
D520=23 processing)
D521=600
• Stores the scan time of an initial execution type program.
SD522 Initial scan time (In 1 ms units)
(In 1 ms units) S (Every
Initial scan • Range from 0 to 65535
time END New
Initial scan time • Stores the scan time of an initial execution type program.
SD523 (In 100 s (In 100 s units) processing)
units) • Range from 000 to 900
Minimum scan • Stores the minimum value of the scan time. S (Every D9018
SD524 Minimum time (In 1 ms (In 1 ms units) END format
scan time units) • Range from 0 to 65535 processing) change
Minimum scan • Stores the minimum value of the scan time. S (Every
SD525 Minimum time (In 100 s units) END New
scan time (In 100 s • Range from 000 to 900
units) processing)
Maximum scan • Stores the maximum value of the scan time except that of 1st D9019
SD526 time scan. (In 1 ms units) S (Every format
Maximum (In 1 ms units) • Range from 0 to 65535 change
scan time Maximum scan • Stores the maximum value of the scan time except that of 1st END
SD527 time scan. processing) New
(In 100 s (In 100 s units)
units) • Range from 000 to 900
Current scan • Stores the current scan time of a low speed program.
SD528 Current time (In 1 ms units) S (Every
scan time (In 1 ms units)
for low Current scan END New
speed time • Stores the current scan time of a low speed program.
SD529 program (In 100 s (In 100 s units) processing)
units) • Range from 000 to 900
Minimum scan • Stores the minimum value of the scan time of a low speed
SD532 Minimum time program. (In 1 ms units) S (Every
scan time (In 1 ms units) • Range from 0 to 65535
for low Minimum scan END New
speed time • Stores the minimum value of the scan time of a low speed
SD533 program (In 100 s program. (In 100 s units) processing)
units) • Range from 000 to 900
Maximum scan • Stores the maximum value of the scan time except that of 1st
SD534 Maximum time (In 1 ms scan of a low speed program.. (In 1 ms units) S (Every
scan time units) • Range from 0 to 65535
for low END New
speed Maximum scan • Stores the maximum value of the scan time except that of 1st
SD535 program time (In 100 s scan of a low speed program.. (In 100 s units) processing)
units) • Range from 000 to 900
END • Stores the time from the end of a scan program to the start of
SD540 processing time the next scan. (In 1 ms units) S (Every
END (In 1ms units) • Range from 0 to 65535
processing END New
time END • Stores the time from the end of a scan program to the start of
SD541 processing time the next scan. (In 100 s units) processing)
(In 100 s • Range from 000 to 900
units)
Constant scan • Stores the wait time for constant scan setting.
SD542 wait time (In (In 1 ms units) S (Every
Constant 1ms units) • Range from 0 to 65535
scan wait END New
time Constant scan • Stores the wait time for constant scan setting.
SD543 wait time (In (In 100 s units) processing)
100 s units) • Range from 000 to 900
Cumulative • Stores the cumulative execution time of a low speed program.
execution time (In 1 ms units)
SD544 Cumulative for low speed • Range from 0 to 65535
programs (In S (Every
execution 1ms units) • Cleared to 0 after the end of one low speed scan.
time for low END New
speed Cumulative • Stores the cumulative execution time of a low speed program.
programs execution time processing)
SD545 for low speed (In 100 s units)
programs (In • Range from 000 to 900
100 s units) • Cleared to 0 after the end of one low speed scan.
• Stores the execution time of a low speed program during one
Execution time scan.
SD546 for low speed (In 1 ms units)
programs
Execution (In 1ms units) • Range from 0 to 65535 S (Every
time for low • Stored every scan.
speed END New
• Stores the execution time of a low speed program during one
programs Execution time processing)
scan.
SD547 for low speed (In 100 s units)
programs (In
100 s units) • Range from 000 to 900
• Stored every scan.
App - 76
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
• Stores the execution time of a scan program during one
Scan program scan.
SD548 execution time (In 1 ms units)
Scan (In 1 ms units) • Range from 0 to 65535
S(Every
program • Stored every scan.
END New
execution • Stores the execution time of a scan program during one
Scan program scan. processing)
time
SD549 execution time (In 100 s units)
(In 100 s units) • Range from 000 to 900
• Stored every scan.
Service
interval
SD550 Unit/module No. • Sets I/O number for module that measures service interval U New
measureme
nt module
Module service • When SM551 is ON, stores service interval for module
Rem
SD551 interval (In 1 ms designated by SD550. (In 1 ms units)
Service • Range from 0 to 65535
units)
interval S (Request) New
Module service • When SM551 is ON, stores service interval for module
time
SD552 interval (In 100 designated by SD550. (in 100 s units)
s units) • Range from 000 to 900
App - 77
Special Register List
(5) Memory card
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
• Indicates memory card A model installed
B15 B8 B7 B4 B3 B0
0<----------->0
S (Initial
Drive 1 0: Does not exist
(RAM) type and card New QCPU
1: SRAM
removal)
0: Does not exist
Drive 2 (1: SRAM)
(ROM) type 2: ATA FRASH
Memory
Memory card A 3: FLASH ROM
SD600 card A
models • Indicates memory card A model installed
models
B15 B8 B7 B4 B3 B0
0<----------->0
S (Initial
Drive 1 0: Does not exist
(RAM) type and card New QnA
1: SRAM
removal)
0: Does not exist
Drive 2
(ROM) type 2: EEPROM
3: FLASH ROM
S (Initial
Drive 1 and card New QCPU
(Standard removal)
SD602 Drive 1 capacity • Drive 1 capacity is stored in 1 K byte units.
RAM) S (Initial
capacity and card New QnA
removal)
S (Initial
Drive 2 and card New QCPU
(Standard removal)
SD603 ROM) Drive 2 capacity • Drive 2 capacity is stored in 1 K byte units.
S (Initial
capacity and card New QnA
removal)
• The use conditions for memory card (A) are stored as bit
patterns.
(In use when ON)
• The significance of there bit patterns is indicated below:
B0: Boot operation (QBT) B8:
B1: Parameters (QPA) B9: CPU fault history S (Status
B2: Device comments (QFD) change) New QCPU
(QCD) BA: SFC trace (QTS)
B3: Device initial value (QDI) BB: Local device (QDL)
B4: File register R (QDR) BC:
B5: Trace (QTS) BD:
B6: BE:
B7: BF:
Memory
Memory card A
SD604 card A use • The use conditions for memory card (A) are stored as bit
use conditions
conditions patterns.
(In use when ON)
• The significance of there bit patterns is indicated below:
B8: Simulation data
B0: Boot operation (QBT) (QDS)
B1: Parameters (QPA)
B9: CPU fault history S (Status
B2: Device comments (QFD) New QnA
(QCD) B10: SFC trace (QTS) change)
B3: Device initial value (QDI)
B11: Local device (QDL)
B4: File R (QDR) B12:
B5: Sampling trace (QTS) B13:
B6: Status latch (QTL)
B14:
B7: Program trace (QTP) B15:
App - 78
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
• Indicates memory card B model installed
B15 B8 B7 B4 B3 B0
0<----------->0
Q2A(S1)
Memory
Memory card B Drive 1 0: Does not exist Q3A
SD620 card B S (Initial) New
models (RAM) type 1: SRAM Q4A
models
0: Does not exist Q4AR
Drive 2
2: EEPROM
(ROM) type
3: FLASH ROM
SD624 • The use conditions for memory card B are stored as bit
patterns.
(ON when in use)
• The significance of there bit patterns is indicated below:
B8: Simulation data
B0: Boot operation (QBT) Q2A(S1)
(QDS)
Memory B1: Parameters (QPA) B9: CPU fault history
Memory card B B2: Device comments S (Status Q3A
card B use (QFD) New
use conditions (QCD) change) Q4A
conditions B10: SFC trace (QTS)
B3: Device initial value (QDI) B11: Local device (QDL)
B4: File R (QDR) Q4AR
B12:
B5: Sampling trace (QTS)
B13:
B6: Status latch (QTL) B14:
B7: Program trace (QTP) B15:
App - 79
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
SD651 • Stores file register file name (with extension) selected at the
parameters or by use of QDRSET Instruction as ASCII
SD652 code.
B15 to B8 B7 to B0
SD653 Comment Comment file SD651 2nd character 1st character S (Status
SD652 4th character 3rd character New
SD654 file name name change)
SD653 6th character 5th character
SD655 SD654 8th character 7th character
SD655 1st character of extension 2E H(. )
SD656 SD656 3rd character of extension 2nd character of extension
Boot designation • Stores the drive number where the boot designation file
SD660 (*.QBT) is being stored. S (Initial) New
file drive number
SD661 • Stores the file name of the boot designation file (*.QBT).
Boot
SD662 B15 to B8 B7 to B0
operation SD661 2nd character 1st character
File name of
SD663 designation SD662 4th character 3rd character
boot designation S (Initial) New
SD664 file SD663 6th character 5th character
file SD664 8th character 7th character
SD665 SD665 1st character of extension 2E H(. )
SD666 3rd character of extension 2nd character of extension
SD666
Number of
vacant
communicati • Stores the number of vacant blocks in the communications S (During
SD714 0 to 32 request area for remote terminal modules connected to the D9081 QnA
on request AJ71PT32-S3. execution)
registration
areas
• Patterns masked by use of the IMASK instruction are stored
SD715 in the following manner:
IMASK B15 B11 B0
SD716 instruction SD715 l15 to l1 l0
S (During
Mask pattern New
mask execution)
SD716 l31 to l17 l16
pattern
SD717
SD717 l47 to l33 l32
SD718
• For use as replacement for accumulators used in A-series
Accumulator Accumulator programs. S/U New
SD719
Program
Program No.
No. Stores the program number of the program to be loaded by
designation for
SD720 designation the PLOAD instruction when designated. U New QCPU
PLOAD
for PLOAD Range: 1 to 124
instruction
instruction
Number of
vacant
CC-Link • Stores the number of vacant registration area for the request S (During
SD730 communicati 0 to 32 for communication with the intelligent device station New QnA
connected to A(1S)J61QBT11. execution)
on request
registration
areas
• Special register that temporarily stores keyboard data input S (During
SD736 PKEY Input PKEY Input by means of the PKEY instruction. New
execution)
App - 80
Special Register List (Continued)
Set by Corresponding
Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
SD738 • Stores the message designated by the MSG instruction.
SD739 B15 to B8 B7 to B0
SD740 SD738 2nd character 1st character
SD741 SD739 4th character 3rd character
SD742 SD740 6th character 5th character
SD743 SD741 8th character 7th character
App - 81
(7) A to Q/QnA conversion
ACPU special registers D9000 to D9255 correspond to Q/QnA special registers
SD1000 to SD1255 after A to Q/QnA conversion.
These special registers are all set by the system, and cannot be turned ON or
OFF by the user program.
To set data by the user program, correct the program for use of the Q/QnACPU
special registers.
However, some of SD1200 to SD1255 (corresponding to D9200 to 9255 before
conversion) can be set by the user program if they could be set by the user
program before conversion.
For details on the ACPU special registers, refer to the user's manual for the
corresponding CPU, and MELSECNET or MELSECNET/B Data Link System
Reference Manuals.
REMARK
App - 82
Special Register List (Continued)
ACPU Special Special
Corresponding
Special Register after Register for Name Meaning Explanation
CPU
Register Conversion Modification
If I/O modules, of which data are different from data entered, are
detected when the power is turned on, the first I/O number of the
I/O module lowest number unit among the detected units is stored in
I/O
verification hexadecimal. (Storing method is the same as that of SD1000.) To
module
D9002 SD1002 error monitor the number by peripheral devices, perform monitor
verificatio
module operation given in hexadecimal.
n error (Cleared when all contents of SD1116 to SD1123 are reset to 0.)
number
• I/O module verify check is executed also to the modules of
remote I/O stations.
• Error status of the MINI(S3) link detected on loaded
MELSECNET/MINI-S3 master module is stored.
B15 B8 B7 B0
8th 7th 6th 5th 4th 3rd 2nd 1st 8th 7th 6th 5th 4th 3rd 2nd 1st
module module module module module module module module module module module module module module module module
Error
NIMI link
D9004 SD1004 detection QnA
error
status On the PLC CPU and A(1S)J71PT32(S3) The corresponding bit turns on when
sides, the bit corresponding to A(1S)J71PT32(S3)'s following signals turn on.
A(1S)J71PT32(S3)
with communication error turns on.
· Hardware error (X0/X20)
· MINI (S3) link error detected
(X6/X26)
· MINI (S3) link communication
error (X7/X27)
App - 83
Special Register List (Continued)
ACPU Special Special
Corresponding
Special Register after Register for Name Meaning Explanation
CPU
Register Conversion Modification
• The operation status of CPU as shown below are stored
in SD203.
B15 B12 B11 B8 B7 B4 B3 B0
STOP 0 RUN
1 instruction execution 1 STOP
2 PAUSE *1
*1: When the CPU module is in RUN mode and SM1040
is off, the CPU module remains in RUN mode if
changed to PAUSE mode.
0: Main program
(ROM)
1: Main program
(RAM)
2: Subprogram 1
(RAM)
3: Subprogram 2
(RAM)
4: Subprogram 3
(RAM)
5: Subprogram 1
Program (ROM) • Indicates which sequence program is run presently. One
D9016 SD1016
number 6: Subprogram 2 value of 0 to B is stored in BIN code.
(ROM)
7: Subprogram 3
(ROM)
8: Main program
(E2PROM)
9: Subprogram 1
(E2PROM)
A: Subprogram 2
(E2PROM)
B:Subprogram 3
(E2PROM)
• If scan time is smaller than the content of SD520, the
Minimum scan
Scan value is newly stored at each END. Namely, the
D9017 SD1017 SD520 time
time minimum value of scan time is stored into SD520 in BIN
(In 10 ms units)
code.
Scan Scan time • At every END, the scan time is stored in BIN code and
D9018 SD1018 SD524
time (In 10 ms units) always rewritten.
• If scan time is larger than the content of SD526, the
Maximum scan
Scan value is newly stored at each END. Namely, the
D9019 SD1019 SD526 time
time maximum value of scan time is stored into SD526 in BIN
(In 10 ms units)
code.
• Sets the interval between consecutive program starts in
Constant scan multiples of 10 ms.
Constant
D9020 SD1020 time (User sets in 0 : No setting
scan
10 ms units) 1 to 200 : Set. Program is executed at intervals of (set
value) 10 ms.
Scan Scan time • At every END, the scan time is stored in BIN code and
D9021 SD1021
time (In 1 ms units) always rewritten.
App - 84
Special Register List (Continued)
ACPU Special Special
Corresponding
Special Register after Register for Name Meaning Explanation
CPU
Register Conversion Modification
• When the PLC CPU starts running, it starts counting 1
1 every second.
Count in units of
D9022 SD1022 SD412 second • It starts counting up from 0 to 32767, then down to
1s.
counter -32768 and then again up to 0. Counting repeats this
routine.
• Stores the year (2 lower digits) and month in BCD.
B15 B12 B11 B8 B7 B4 B3 B0 (e.g.) July. 1987
Time Time data H8707
D9025 SD1025
data (year, month)
Year Month
• Stores the day and hour in BCD.
B15 B12 B11 B8 B7 B4 B3 B0 (e.g.) 31st, 10 o'clock
Time Time data H3110
D9026 SD1026
data (day, hour)
Day Hour
• Stores the minute and second in BCD.
B15 B12 B11 B8 B7 B4 B3 B0 (e.g.) 35, 48
Time Time data H3548
D9027 SD1027
data (minute, second)
Min. Sec.
• Stores the day of the week in BCD.
(e.g.) Friday
B15 B12 B11 B8 B7 B4 B3 B0
H0005
Day of week
Time Time data
D9028 SD1028 "0" must be set 0 Sun
data (, day of week) 1 Mon
2 Tues
3 Wed
4 Thur
5 Fri
6 Sat
Extensio
• Stores the block No. of the extension file register being
D9035 SD1035 SD648 n file Use block No.
used in BCD code.
register
• Designate the device number for the extension file
register for direct read and write in 2 words at SD1036
and SD1037 in BIN data.
D9036 SD1036 Extensio
Device number Use consecutive numbers beginning with R0 of block
n file
when individual No. 1 to designate device numbers.
register Extension file register
devices from
for 0
extension file to
designati Block No.1 area
register are 16383
on of
directly 16384
device Block No.2 areaa
D9037 SD1037 accessed SD1036,SD1037
to
number
Device No. (BIN)
to
App - 85
Special Register List (Continued)
ACPU Special
Special Register Corresponding
Special Register after Name Meaning Explanation
for Modification CPU
Register Conversion
Turned on/off with a peripheral device. When
STRA or STRAR is executed, the value
For Step or time stored in SD1044 is used as the sampling trace
D9044 SD1044 sampling during condition.
trance sampling trace At scanning 0
At time Time (In 10 ms units)
The value is stored into SD1044 in BIN code.
• Stores the block number of the expansion file register
which is used as the work area for the execution of a
Block number
Work area SFC program in a binary value.
D9049 SD1049 of extension file
for SFC • Stores "0" if an empty area of 16K bytes or smaller,
register
which cannot be expansion file register No. 1, is used
or if SM320 is OFF.
• Stores error code of errors occurred in the SFC
program in BIN code.
SFC 0 : No error
Error code 80 : SFC program parameter error
program
D9050 SD1050 generated by 81 : SFC code error
error 82 : Number of steps of simultaneous execution
SFC program
number exceeded
83 : Block start error
84 : SFC program operation error
Block number • Stores the block number in which an error occurred
in the SFC program in BIN code.
D9051 SD1051 Error block where error
In the case of error 83 the starting block number is
occurred stored.
• Stores the step number, where error code 84
Step number occurred in an SFC program, in BIN code.
D9052 SD1052 Error step where error Stores "0" when error code 80, 81 or 82 occurred.
occurred Stores the block stating step number when error
code 83 occurs.
Transition
• Stores the transition condition number, where error
Error condition
D9053 SD1053 code 84 occurred in an SFC program, in BIN code.
transition number where
Stores "0" when error code 80, 81, 82 or 82
error occurred
occurred.
Error Sequence step • Stores the sequence step number of transfer
D9054 SD1054 sequence number where condition and operation output in which error 84
step error occurred occurred in the SFC program in BIN code.
• Stores the step number when status latch is
executed.
• Stores the step number in a binary value if status
latch is executed in a main sequence program.
Status Status latch • Stores the block number and the step number if
D9055 SD1055 SD812 status latch is executed in a SFC program.
latch step
Block No. Step No.
(BIN) (BIN)
App - 86
Special Register List (Continued)
ACPU Special
Special Register Corresponding
Special Register after Name Meaning Explanation
for Modification CPU
Register Conversion
• Sets the time check time of the data link instructions
Register
(ZNRD, ZNWR) for the MELSECNET/10.
for setting • Setting range : 1 s to 65535 s (1 to 65535)
D9085 SD1085 1S to 65535S
time check • Setting unit :S
value • Default value : 10 s (If 0 has been set, default
10 s is applied)
Head
device No.
in data See each micro
area of • For details, refer to the manual of each
D9090 SD1090 computer
microcomp microcomputer package.
uter sub package
routine
INPUT
Instruction Detailed error
D9091 SD1091 • Stores the detail code of cause of an instruction error.
error code
Head I/O Head I/O • Stores the first two digits of the head I/O number of
number of number of I/O the I/O module, which will be dismounted/mounted
D9094 SD1094 SD251 I/O module
to be module to be online (with power on), in BIN value. Example) Input
replaced replaced module X2F0 H2F
D9100 SD1100 • Output module numbers (in units of 16 points), of
which fuses have blown, are entered in bit pattern
D9101 SD1101 (Preset output module numbers when parameter
setting has been performed.).
D9102 SD1102
Bit pattern in 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 1
D9103 SD1103 units of 16 SD1100 0 0 0 (YCO)
0 0 0
(Y80)
0 0 0 0 0 0 0 0
fuses have
D9106 SD1106 Indicates fuse flown status
blown
• Fuse blow check is executed also to the output
modules of remote I/O stations.
D9107 SD1107 (If normal status is restored, clear is not performed.
Therefore, it is required to perform clear by user
program.)
• Set the set value of the step transition watchdog timer
D9108 SD1108
and the annunciator number (F number) that will turn
on when the watchdog timer times out.
D9109 SD1109
B15 to B8 B7 to B0
D9110 SD1110 Step
Time setting
transfer
D9111 SD1111 value and the F Set time limit of timer 0 to 255
monitoring
number at time (1 to 255 sec.: (In 1 sec units))
timer
D9112 SD1112 out
setting
Set F number
D9113 SD1113 (By turning on any of MS1108 to SM1114, the
monitoring timer starts. If the transfer condition
following a step which corresponds to the timer is not
D9114 SD1114 established within set time, set annunciator (F) is
tuned on.)
D9116 SD1116 • When I/O modules, of which data are different from
those entered at power-on, have been detected, the
I/O module numbers (in units of 16 points) are
D9117 SD1117
entered in bit pattern.
(Preset I/O module numbers set in parameters when
D9118 SD1118 Bit pattern, in parameter setting has been performed.).
units of 16 B15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1
D9119 SD1119 I/O module points, SD1116 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 XY
0
verification indicating the 1
SD1117 0 0 0 0 0 0 XY 0 0 0 0 0 0 0 0 0
D9120 SD1120 error modules with 100
1
verification SD1123 0 0 0 0 XY
100
0 0 0 0 0 0 0 0 0 0 0
App - 87
Special Register List (Continued)
ACPU Special
Special Register Corresponding
Special Register after Name Meaning Explanation
for Modification CPU
Register Conversion
• When one of F0 to 2047 is turned on by SET F ,
1 is added to the contents of SD63. When
Annunciat RST F or LEDR instruction is executed, 1
Annunciator is subtracted from the contents of SD63. (If the
or
D9124 SD1124 SD63 detection INDICATOR RESET switch is provided to the CPU
detection
quantity module, pressing the switch can execute the same
quantity
processing.)
Quantity, which has been turned on by SET F is
stored up to 8.
• When any of F0 to 2047 is turned on by SET F ,
D9125 SD1125 SD64 the annunciator numbers (F numbers) that are turned
on in order are registered into D9125 to D9132.
The F number turned off by RST F is erased
from any of D9125 to D9132, and the F numbers
D9126 SD1126 SD65 stored after the erased F number are shifted to the
preceding registers. By executing LEDR
instruction, the contents of SD64 to SD71 are shifted
Annunciator upward by one. (If the INDICATOR RESET switch is
D9127 SD1127 SD66 detection provided to the CPU module, pressing the switch can
numbers execute the same processing.) When there are 8
annunciator detections, the 9th one is not stored into
D9128 SD1128 SD67 SD64 to SD71 even if detected.
SET SET SET RST SET SET SET SET SET SET SET
Annunciat F50 F25 F99 F25 F15 F70 F65 F38 F110 F151 F210 LEDR
or
D9129 SD1129 SD68
detection SD62 0 50 50 50 50 50 50 50 50 50 50 50 99
number SD63 0 1 2 3 2 3 4 5 6 7 8 8 8
SD65 0 0 25 25 99 99 99 99 99 99 99 99 15
SD66 0 0 0 99 0 15 15 15 15 15 15 15 70
D9131 SD1131 SD70
SD67 0 0 0 0 0 0 70 70 70 70 70 70 65
SD68 0 0 0 0 0 0 0 65 65 65 65 65 38
SD69 0 0 0 0 0 0 0 0 38 38 38 38 110
App - 88
(8) Fuse blown module
Corresponding
Set by Corresponding
Number Name Meaning Explanation ACPU
(When set) CPU
D9
SD1300 • The numbers of output modules whose fuses have D9100
blown are input as a bit pattern (in units of 16 points).
SD1301 D9101
(If the module numbers are set by parameter, the
SD1302 parameter-set numbers are stored.) D9102
SD1303 Bit pattern in units of • Also detects blown fuse state at remote station output D9103
SD1304 16 points, indicating modules D9104
SD1305 B15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 D9105
the modules whose
Fuse blown 1 1
SD1306 fuses have blown SD1300 0 0 0 (YC0) 0 0 0 (Y80) 0 0 0 0 0 0 0 0 S (Error) D9106 Rem
module 1 1
SD1307 0: No blown fuse SD1301 (Y1F0) 0 0 0 0 (Y1A) 0 0 0 0 0 0 0 0 0 0 D9107
SD1308 1: Fuse blown 1 1 New
(Y1F (Y1F
present SD1331 0 0 0 0 0 0 0 0 0 0 0 0 0 0
SD1309 B0) 30)
New to
to Indicates fuse flown status
New
SD1330 • Not cleared even if the blown fuse is replaced with a
new one.
SD1331 This flag is cleared by error resetting operation. New
• The module number (in units of 16 points) whose
Bit pattern in units of external power supply has been disconnected is input
16 points, indicating as a bit pattern.
the modules whose (If the module numbers are set by parameter, the
External parameter-set numbers are used.)
external power
power B15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
supply has been
SD1350 supply SD1350 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
disconnected QCPU
to disconnecte S (Error) New
0: External power SD1351 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 remote
SD1381 d module
supply
(For future
disconnected
extension)
1: External power
supply not SD1381 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0
App - 89
Appendix 5 Application Program Examples
(1) Y70 turns ON when X00 is turned ON, and turns OFF when X01 is turned ON.
X0
0 SET Y70
X1
2 RST Y70
CIRCUIT END
(2) When X02 is turned ON, Y71 turns OFF if Y70 is ON, and turns on if Y70 is OFF.
This flip-flop operation is repeated.
Y70
T0
12 Y71
CIRCUIT END
X2
T0 contact
T1 contact
Y70
Y71
App - 90
(3) The flip-flop operation starts when X2 is turn-ed on. In this operation, Y70 turns on
if the timer T0 is on, and Y71 turns on if the timer T1 is on. (Cycle: 10 s)
Path name A: SCHOOL
Project name QA-17
Program name MAIN
X2 T1 K50
0 T0
T1
T0
7 PLS M0
Y70
M0
11 RST T1
T0 K50
16 T1
T1
T1
22 Y71
PLS M1
M1
26 RST T0
CIRCUIT END
X2
T0 contact
T1 contact
Y70
Y71
App - 91
Appendix 5.2 One shot ladder
(1) Output starts and continues for a certain time after input X1 is turned on.
(Time for the input being on must be longer than the set time limit.)
X1 K70
0 T15
T15
Y75
CIRCUIT END
X1
T15
normally
close
Y75
Set time limit
7s
(2) When the input X0 is turned on momentarily, Y76 turns on for a certain time.
X0 T16 K100
0 T16
Y76
Y76
CIRCUIT END
(3) Output starts and continues for a certain time when the input X0 is switched from
on to off.
X0
0 PLF M1
M1 T16 K100
3 T16
Y76
Y76
CIRCUIT END
X0
Y76
Set time limit
Pulse width
10 s
App - 92
Appendix 5.3 Long time timer
X2
T9
normally open
T10
normally open
3000 s 2000 s
Y72
5000 s
T14 K4
12 C7
M56
C7
18 RST C7
CIRCUIT END
1 scan
X2
T14 coil
T14 normally
open (M56)
C7
Y73
900 s x 4 = 3600 s = 1 hour
(Note) Sufficient time is obtained with the counter C7, which counts the number of
time-outs of the timer T14.
With M56, T14 is reset after it goes time-out. With C7, the output Y73 is self-energized
while count up is in progress. With Y73, T14 is reset and following time-limit actions
are stopped.
App - 93
Appendix 5.4 Off delay timer
CIRCUIT END
X5
T6 coil
T6 normally
close
Y70
Set time limit
0.8 s
X6 Y71 K41
4 T8
M45
M45
CIRCUIT END
X5
X6
T8 coil,M45
T8 normally
close
Y71
Set time limit
4.1 s
(Note) The above ladder behaves as an off delay ladder by momentarily turning ON
input X5 and X6.
M45 is equivalent to a momentary contact of T8.
App - 94
Appendix 5.5 On delay timer (momentary input)
PLC's timers operate with the on delay system, which allows easy continuous inputs
but requires relays M for momentary inputs.
Path name A: SCHOOL
Project name QA-19
Program name MAIN
X1 X2 K62 The timer starts
0 T4 after X1 turns ON,
M50 and continue
M50 self-energized.
T4
8 Y70 Turn ON 6.2 s later
T4
10 Y71 Turn OFF 6.2 s later
CIRCUIT END
X1
X2
T4,M50
Y70
Y71
Set time limit
6.2 s
(Note) The above ladder behaves as an on delay ladder by momentarily turning on
input X1 and X2.
App - 95
Appendix 5.6 ON-OFF repeat ladder
In an ON-OFF repeat ladder, Y70 turns ON when X0 is turned ON, and turns OFF
when X0 is turned ON again.
X1
0 FF Y70
CIRCUIT END
The timer is set so that it starts output when the input keeps being on for 0.2 s.
X0 K2
0 T1
T1
5 M1
CIRCUIT END
M1 turns ON when X0 keeps being ON for 0.2 s or longer. Therefore, this is used
instead of X0 when writing a program.
App - 96
Appendix 5.8 Ladders with a common line
The following ladder cannot be operated by PLC programs. To make such ladders
controllable, use master control instructions (MC, MCR) in a program.
Manual Auto
X0 X1 X4 X3 Y71
Y70
Relay ladder X2
X7 Y79 X2
Y71
X6
X7
Y71
N0 M1
X2
4 M10 Manual circuit
X6 X7
6 M11
9 MCR N0
X1 X0
10 MC N0 M2
N0 M2
X4 X3
14 M20 Auto circuit
X7 Y79
17 M21
20 MCR N0
M10 Y71
21 Y70
M20
M11 X2
25 Y71 Common circuit
M21
Y71
CIRCUIT END
App - 97
Appendix 5.9 Time control program
With the time control program, time value is set in the two digits of a digital switch,
according to which the outputs Y70 to Y72 turn on after the set time limit has elapsed.
Currently elapsed time is displayed on Y40 to Y47.
This operation is repeated.
Pushbutton for X3
reading time Turns on if the current value
Y70 is less than 2 s
X3
0 PLS M5
M5 Reading the set time
3 BIN K2X20 D1
2 digits in 0.1 s units
T3 K10
16 T4 Flicker for
X4 T4 D1 repeating the timer
7 <> K0 D1 T3
X5
21 BCD T3 K2Y40 Output time value to exterior
Turns on when a current value
> K20 T3 Y70 of T3 is from 0.1 to 1.9 s
= K30 T3 Y71 Turns on when a current value
of T3 is 3.0 s
< K40 T3 Y72 Turns on when a current value
of T3 is 4.1 s or more.
CIRCUIT END
App - 98
Appendix 5.10 Clock ladder
With a clock ladder, the clock data such as hour, minute and second is output to a
digital display.
0
Ones 1 Ones
47 seconds digit 2
3
digit 64 hours
K2Y40 K2Y50
4
Tens 5 Tens
digit 6 digit
7
8
Ones 9
18 minutes digit A
B
K2Y48
C
Tens D
digit E
F
ON ON ON ON ON ON ON ON ON
Y57 Y56 Y55 Y54 Y53 Y52 Y51 Y50 Y4F Y4E Y4D Y4C Y4B Y4A Y49 Y48 Y47 Y46 Y45 Y44 Y43 Y42 Y41 Y40
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
Tens digit Ones digit Tens digit Ones digit Tens digit Ones digit
K2Y50 hour, Output K2Y48 minute, Output K2Y40 second, Output
App - 99
Appendix 5.11 Starting - operation of electrical machinery
By turning the start switch on, machinery starts operation. After operation time
has elapsed, the machinery enters an arc interlock state and then operation mode.
CIRCUIT END
Start X0
Stop X01
Operation Y70
operation
Y71
operation
Y72
T5 = 2 s
App - 100
Appendix 5.12 Displaying elapsed time and outputting before time limit
With the following ladder, time elapsed in the timer is displayed on the LED, and output
is performed before the set time limit has been reached. This system can also be
applied to counters.
Output module
1234
X2 Y6C to 6F
x 100
Y68 to 6B
x 10
Starts when turned on Y64 to 67
x1
Stops when turned off Y60 to 63
x 0.1
X2 K3000
0 T4 Timer starts when X2 is turned on
App - 101
Appendix 5.13 Retentive timer
(1) When using a ladder that accumulates value without a retentive timer.
X2
0 M0 Timer starts when X2 is turned on
M0
2 PLS M1
K600
T195
M1 Writes D7 to timer when X2 is
9 MOV D7 T195
turned on
M0
12 MOV T195 D7 Save the current value of the
timer to D7
T195
15 MOV K0 D7 Clears D7 when the timer goes
time out
Y72 Y72 turns on when the timer
goes time out
CIRCUIT END
(2) When retentive timers are allocated in the device settings of PLC parameters.
Retentive timer (ST): 224 points (ST0 to ST223)
App - 102
Appendix 5.14 Switching timer set value externally
(1) With an external switch, a value to be set in one timer can be selected from three
patterns; 1 s, 10 s, and 100 s
A timer is activated and reset by a pushbutton switch.
OL
1s
X0 Y70 Indicates the timer is in operation
SC 10 s RL
X1
100 s Y71 Indicates the timer has gone time out
X2
PB Starts the timer
X3 Y72 MC Load
PB Resets the timer
X4
~ to to ~
Input power supply Load power supply
Path name A: SCHO
Project name QA-22
Program name MAIN
X0
0 MOV K10 D0 Set value 1 s
X1
3 MOV K100 D0 Set value 10 s
X2
6 MOV K1000 D0 Set value 100 s
X3
9 SET M0 Starts the timer
X4
11 RST M0 Stops the timer
M0 D0
12 T8
App - 103
Appendix 5.15 Setting counters externally
With an external digital switch having 4 digits, counters can be set remotely and their
current values are displayed in 4 digits. In addition to every count-up, the timer outputs
data when it reaches a value of 100 and 50 before the set limit.
Note that a setting error is indicated if the set limit of counters is less than 100.
1 2 3 4
X20-2F X0-1F Y60-6F Y70-74
DC12V
AC100V
PB
Setting signal X0
Y70
PB RL Setting error
Start X5
Y71 ON during
PB RL
Reset or stop X1 RUN
Y72 Turns on at
DC12V R1 100 before
Count pulse Current value display the set value
X3
BCD x 4 digits Y73 Turns on at
R2 50 before
DC24V the set value
Y74 Turns on at
R3 counter stop
Setting value
Maximum setting value 9999
App - 104
Path name A: SCHOOL
Project name QA-4
Program name MAIN
X0
0 SET M0 Setting
X1
2 RST M0
M0
4 BIN K4X20 D0 Reading the set value
Y71
28 MC N0 M3
N0 M3
X3 D0
31 C0 Counter that turns on
D1 at stop
C1 Counter that turns on
D2 at 100 before the set value
C2 Counter that turns on
at 50 before the set value
44 MCR N0
X1
45 RST C0 Counter is reset by
turning on X1
RST C1
RST C2
M0
58 BCD C0 K4Y60 Display counted values
C1 to exterior
62 Y72 Turns on at 100 before
C2 the set value
64 Y73 Turns on at 50 before
C0 the set value
66 Y74 Turns on at a the set value
CIRCUIT END
App - 105
Appendix 5.16 Measuring operation time
Setting operation time to a control target is useful for judging when to replace its
components, do lubrication to it, etc. The timer ST and data register D must have
back-up power source so that they can continue operating at power failure. With the
contents of D31 (in one hour units) displayed externally, it can work as an operation
timer.
+ K1 D30
1 hour timer
= K10 D30 MOV K0 D30
By measuring operation time of a control target (from its start to end), it is possible to
display cycle time out, control time lag, etc.
The following ladder can indicate cycle time out. To measure time lag, use the <, >,
and = instructions to judge the state of T200, and turn on a counter.
X0 X1
0 M56 In a cycle
M56
App - 106
Complement
Obtain absolute values of negative values – 32768 or smaller (to –2147483648 ...... 32
bit data).
D1 D0
B B B B B B
15 14 ·················· 1 0 15 14
·················· B1 B0
Before
1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0
DCML D0 D20 DCML execution
(Negative number)
D21 D20
After D + execution 0 1 0 0 1 0 1 1 1 0 0 0 1 1 1 0
(Absolute value)
(Example)
999 is subtracted from a set value each time X1 is turned on, and the resulting value is
displayed.
When the resulting value goes down below zero, the output Y70 turns on, and the
absolute value of the resulting value is displayed.
Read the set value Turn on X0
Negative number NO
obtained?
YES
Y70 setting
DCML execution
+ 1 execution
Results display
X0
0 DBIN K4X20 D0 Input data
X1
4 D-P K999 D0 Subtract 999
App - 107
Appendix 5.19 Program showing divided value of 4-digit BIN value to 4 places of decimals
(1) Example 1
Two digital switches are provided, one of which contains a dividend, and the other of
which contains a divisor. The results of operation using this dividend and divisor are
displayed in its 4 integral parts and 4 decimal parts.
Digital display
Digital switch
Y5F to Y50 Y4F to Y40
QCPU QX QY
42 42P
X3F to X30
X2F to X20
X0
FOR
4×(Z1)→(D10) HC-(D10)→(Z0)
Set display address after
the decimal point
1st time 4×0 → 0 HC- K0 →HC
2nd time 4×1 → 4 HC- K4 →H8
Multiply the remainder with 10, 3rd time 4×2 → 8 HC- K8 →H4
divide the result and take 4th time 4×3 → 12 HC- K12 →H0
a quotient of lower 1 digit
(D3)×10→(D3)
Display lower 1 digit (D3)÷(D1)= (D2)……(D3)
Count the number of times (register Z1) Y4C Y48 Y44 Y40
to to to to
INC Z1 4F 4B 47 43
NO
4 obtained?
NEXT
Last-1st 2nd 3rd 4th digit
YES
END
App - 108
The sequence program of example 1.
The FOR-NEXT instruction is issued to divide each decimal place individually and
display 4 decimal places in K4Y40.
Path name A: SCHOOL
Project name QA-5
Program name MAIN
X0
0 BINP K4X30 D0 Reads data
BINP K4X20 D1
/P D0 D1 D2 Division
PLS M0
22 FOR K4
M0
24 * K4 Z1 D10
- H0C D10 Z0
* D3 K10 D3
Repeats 4 times
/ D3 D1 D2
BCD D2 K1Y40Z0
INC Z1
45 NEXT
CIRCUIT END
The value of Z1 is added one every INC Z1 instruction.
App - 109
(2) Example 2
D0 is divided by D1 to obtain D5 in 4 decimal places.
The dividend D0 is multiplied with 10,000. The result of dividing calculation using
this multiplied value is converted to a BCD value and output to an external digital
display.
K4Y50 K4Y40
BINP K4X20 D1
MOVP K0 D2 Clears D2
*P D0 K10000 D3 10000-fold
D/P D3 D1 D5
DBCDP D5 D5
DBCDP D7 D7
App - 110
Appendix 5.20 Carriage line control
Control panel
MELSEC-Q
Input Output
Start button
X0 Y70 RUN indicator
Switch (LS work present)
X1 Y71 M Carriage moves forward
Switch (LS forward limit)
X2 Y72 M Carriage moves back
Switch (LS backward limit)
X3 Y73 Push
Switch (LS open complete)
X4 Y74 Push back
App - 111
Path name A: SCHO
Project name QA-10
Program name MAIN
X0 M2
0 Y70 RUN indicator
Y70 X1 X3
PLS M1
F3
M1
SET Y71
F3 Carriage moves forward
Y71 X2
RST F3
Y71
SET Y73
F3 Push
Y73 K30
T0
T0
RST Y73
F3
SET Y74
F3 Push back
Y74 X4
RST Y74
F3
SET Y72
F3 Carriage moves back
Y72 X3
RST Y72
F3
M2 Completion flag
CIRCUIT END
Timing chart
Start buttonX0
Switch (LS work present)X1
Switch (LS forward limit)X2
Switch (LS backward limit) X3
Switch (LS open complete) X4
RUN indicator Y70
Carriage moves forward Y71
Carriage moves back Y72
Push Y73
Push back Y74
3sec
App - 112
Appendix 5.21 Starting compressors in order using ring counters
MELSEC-Q
Compressor A B C
Pressure switch
MELSEC-Q
Start Input Output
PB0 MC
X0 Y70 Compressor A
A
Stop
PB1
X1
Y71 MC
Pressure switch Compressor B
B
PX1
X2
MC
PX2 Y72 Compressor C
X3 C
PX3
X4 Y73 Sufficient pressure
App - 113
Operation explanation
(1) The pressure switches (X2, X3, X4) are initially off. In this state, turning on the
start switch (X0) activates the three compressors all together, and when sufficient
pressure is obtained (X2, X3, and X4 turn on), the three compressors stop. This is
the basic operation of this system.
If all compressors are at stop with sufficient pressure provided and the pressure
shortage "Minor" is detected (X4 turns off), one compressor is activated and
supplies pressure until sufficient pressure is obtained.
The compressor activated as such is decided in order from A to C each time
compressors are reactivated in reaction to pressure shortage.
Note that the stop switch (X1) is available for stopping compressors at any time.
(2) If one compressor could not supply sufficient pressure, the pressure shortage
level goes up to "Medium" (X3 turns off) and the second compressor is activated
to support the first compressor. This second compressor will be compressor C if
compressor A has been in operation, A if B has been in operation, and B if C has
been in operation.
(3) If two compressors could not supply sufficient pressure, pressure shortage level
goes up to "Major" (X2 turns off), and the last compressor is activated.
When only one compressor is in operation and pressure shortage level goes from
"Minor" to "Major" directly, the rest two compressors are activated at once.
(4) When two or three compressors are in operation, they continue operating together
until sufficient pressure is obtained and stop together when obtained (X4 turns
on).
Timing chart
Start - (X0)
PX3 - (X4)
Pressure switch PX2 - (X3)
PX1 - (X2)
A - (Y70)
Compressor B - (Y71)
C - (Y72)
Pressure shortage
Compressor
Major Minor Minor Medium Major Minor Minor Minor Medium
A,B,C B C A,C A,B,C A B C A,C
App - 114
Path name A: SCHO
Project name QA-11
Program name MAIN
X0 X1
0 M0 RUN
M0
X4
4 Y73 Indicates pressure status
X4 X3 X4 Y76 Y75
6 Y74 Pressure shortage "Major"
Y74 Pressure shortage "Minor" is indicated when
the pressure switch X4 turns off.
X3 X2 X4 Y76
13 Y75 Pressure shortage "Medium"
Y75 Pressure shortage "Medium" is indicated when
the pressure switch X3 (Medium) turns off.
X2 X4
19 Y76 Pressure shortage "Minor"
Y76 Pressure shortage "Major" is indicated when
the pressure switch X2 (Minor) turns off.
M0
23 PLS M1
F3 Turns on M9 at startup
Y74
26 PLS M2
F3 Shifts by pressure
M1 shortage "Minor"
29 SET M9
F3
M0
31 RST M9
F3
RST F3
M12 Reset when X1 (stop)
RST F3
M11 turns on
RST F3
M10
M2
36 SFT M13
F3
SFT F3
M12
Shift register
SFT F3
M11
SFT F3
M10
M10
45 RST F3
M13
M0
M13
48 SET M10
F3 Returns shift to M10
X4 M0 M10
50 Y70 Compressor A
Y75 M11
Y76
M11
Y71 Compressor B
Y75 M12
Y76
M12
Y72 Compressor C
Y75 M10
Y76
CIRCUIT END
App - 115
After the basic operation, one compressor is activated in reaction to pressure shortage
detected. To use the three compressors equally, there is ordering control available.
This control is enabled by the 3-stage ring counter (ring-shaped shift registers) M10 to
M12.
A shift signal is generated when pressure shortage is detected (X04 switches from on
to off).
Compressor
A B C
X0 Start SET
M9 M10 M11 M12
X1 Stop RST
X4(PX3)OFF
Shift operation
X4
M10
M11
M12
App - 116
Appendix 5.22 Application example of positioning control
The following is an example of a positioning system with a pulse generator that outputs
pulses per motor, brake, and unit of distance.
In this system, a command value is set with the digital switch, and this set command
value is compared with the current value at start-up to decide in which way, forward or
reverse, the motor rotates. The current value in the register D16 is subtracted by 1
when in forward direction, and incremented by 1 when in reverse direction. Positioning
completes when the command value matches the current value. The current value is
converted to a BCD value so that current position is represented in 4-digit decimal
numbers.
OP
OP
MELSEC-Q
X2
Start Forward
rotation Reverse
X0 Y70 rotation
Y71
X1 Y72
Command value setting switch Brake for current value display
5 4 0 0 3 6 2 8
mm mm
X20 to X23 Y4C to Y4F
X1 X1000
X24 to X27 Y48 to Y4B
X10 X100
X28 to X2B Y44 to Y47
X100 X10
X2C to X2F Y40 to Y43
X1000 X1
App - 117
Appendix 5.23 Application example using index Z
(1) Counts the number of manufactured products every day in one month cycle, and
stores the resulting number to the corresponding register of the date (D1 to D31).
(2) Inputs the planed number of products to manufacture using the external digital
switch. Production stops when this number is accomplished.
(4) Displays to exterior how many products have been manufactured in the current
month as well as the number manufactured on the current day.
K2X20 K2Y58
Date 3 0 3 0 Date
X02 K4Y60
Count value 3 7 8 2 Accumulated number
How many products manufactured on the current day is counted with C5.
Accumulated number of products manufactured is counted with C6.
The date is entered in the index Z to indirectly designate the data register
corresponding to the date using D0Z0.
When Z0 is 30, D0Z0 becomes 0 + Z, designating D30.
App - 118
Path name A: SCHO
Project name QA-7
Program name MAIN
FMOV K0 K4Y40 K3
CIRCUIT END
FMOV K0 D0 K32 Simultaneously transfers data 0 to D0 to D31.
App - 119
Appendix 5.24 Application example of FIFO instruction
Manual coating work and its working time can be stored and duplicated by machinery
later.
Conveyor system
MELSEC-Q
Steps
to
Teaching panel X 20 21 22 23 24 25
Coating bath
FIFO table
FIFO table 39 0
Pointer D20 6 D1 (timer constant of T1)
40 6
Read using FIFRP
Step 1 21 135 135 41 135
Step 2 22 150 42 150
Washing Step 3 23 120 Data is backed up when X03 is turned on 43 120
time
Step 4 24 100 44 100
Step 5 25 20 Backed up data is read when X05 is turned on 45 20
Step 6 26 135 46 135
Current value of T0 0
D0 135 Write using FIFWP 0
App - 120
Path name A: SCHO
Project name QA-9
Program name MAIN
X0
0 Y70 Moves in right direction
M1
X1
3 Y71 Moves in left direction
M2
X2
6 M3 Washes
K32000
T0
MOV T0 D0
X2
14 PLS M10
F3
M10
17 < D10 K6 FIFWP K2X20 D10 Stores the pattern of coating
bath's position
FIFWP D0 D20 Stores washing time
X3
27 BMOVD10 D30 K20 Backs up stored data
X5
32 BMOVD30 D10 K20 Reads backed up data
X6 Reads the position pattern
37 <= K1 D10 FIFRP K2Y72 D10
of the washing bath
M6
FIFRP D1 D20 Reads washing time
MOV T1 D3
CIRCUIT END
App - 121
Appendix 5.25 Application example of data shift
Working materials are conveyed along with their code numbers, and the data register
of the processing machinery is analyzed to machine the work material according to its
code number.
X0
Start
X1 RUN
Stop Y70
Input Output
Code number K1X20
Type detection module module
1 to 8
X2
Move of Shift
work material instruction
Machinery Data register Code Code Code Code Code Code Code Code
1 2 3 4 5 6 7 8
A D30 M1 M2 M3 M4 M5 M6 M7 M8
B D31 M11 M12 M13 M14 M15 M16 M17 M18
C D32 M21 M22 M23 M24 M25 M26 M27 M28
D D33 M31 M32 M33 M34 M35 M36 M37 M38
E D34 M41 M42 M43 M44 M45 M46 M47 M48
F D35 M51 M52 M53 M54 M55 M56 M57 M58
A code number is stored in the data register, and the M corresponding to the stored
number is activated to perform machining.
App - 122
Path name A: SCHO
Project name QA-12
Program name MAIN
X0 X1
0 Y70 RUN
Y70
= K2 D30 M2
= K3 D30 M3
= K4 D30 M4
Machinery A
= K5 D30 M5
= K6 D30 M6
= K7 D30 M7
= K8 D30 M8
Y70
53 = K1 D31 M11
= K2 D31 M12
= K3 D31 M13
= K4 D31 M14
Machinery B
= K5 D31 M15
= K6 D31 M16
= K7 D31 M17
= K8 D31 M18
Y70
94 = K1 D32 M21
= K2 D32 M22
= K3 D32 M23
= K4 D32 M24
Machinery C
= K5 D32 M25
= K6 D32 M26
= K7 D32 M27
= K8 D32 M28
App - 123
Y70
135 = K1 D33 M31
= K2 D33 M32
= K3 D33 M33
= K4 D33 M34
Machinery D
= K5 D33 M35
= K6 D33 M36
= K7 D33 M37
= K8 D33 M38
Y70
176 = K1 D34 M41
= K2 D34 M42
= K3 D34 M43
= K4 D34 M44
Machinery E
= K5 D34 M45
= K6 D34 M46
= K7 D34 M47
= K8 D34 M48
Y70
217 = K1 D35 M51
= K2 D35 M52
= K3 D35 M53
= K4 D35 M54
Machinery F
= K5 D35 M55
= K6 D35 M56
= K7 D35 M57
= K8 D35 M58
CIRCUIT END
App - 124
Path name A: SCHO
Project name QA-14
Program name MAIN
Appendix 5.26 Example of operation program calculating square root of data
The data stored in D5 is calculated to its square root and the result is stored in D6 and
D7.
X0
0 MOVP K4X20 D5 Sets data
REMARK
QCPUs provide square root operation instructions for data in a real number (floating
point) format.
App - 125
Path name A: SCHO
Project name QA-15
Program name MAIN
Appendix 5.27 Example of operation program calculating n-th power of data
A value stored in D10 is calculated to its n-th power (n is a value stored in D14) and
the result is stored in D10.
X1
0 FMOVP K0 D10 K10 Clears data
SCJ P0
X1
18 CJ P0
21 FOR D14
X1
23 D D10 D15 D10 Multiplies the value n times
28 NEXT
P0 X1
29 D/ D10 K10000 D16
CIRCUIT END
NOTE
App - 126
Appendix 5.28 Program using digital switch to input data
When always inputting and storing a set value of the digital switch to D10 of the PLC
1 2 3 4
X20 Data
to register
X2F BIN conversion
D10
In the above program, changing a value of the digital switch with the PLC in RUN
mode may cause codes other than 0 to 9 to occur at the timing of the change. This
generates "OPERATION ERROR" of the CPU.
To avoid this, write a program as follows.
4 FOR K8
+ K4 Z0
31 NEXT
SM400
32 DBIN K8M100 D10
CIRCUIT END
App - 127
Appendix 5.29 Displaying number of faults with fault numbers using fault detection program
The following program sequentially displays the number of turned-on bit devices (X, M.
F, etc.) among many bit devices being used continuously, together with their device
numbers.
[Application example]
When M or F is used as an output device of a fault detection program, use the
following program to know how many faults were occurred and fault code numbers of
the faults occurred.
X2 ON OFF
Display B Display A
(Y60 to Y6F)
X0 ON OFF
Displays the first fault number Displays the fault number on display C
Condition of program
X1 ON OFF
Displays the number of
remaining faulty devices.
This number includes the Displays the number of remaining faulty devices on display A
next fault number and Displays the next fault number on display C
currently displayed fault
number.
App - 128
Path name A: SCHO
Project name QA-31
Program name MAIN
X20
0 F3
X24
4 F5
X28
8 F8
X2C
12 F13
X30
16 F33
X34
20 F35
X38 Faulty circuit
24 F37
X3C
28 F39
X4
32 F1
X5
36 F11
X6
40 F16
X7
44 F40
X2 M200
48 DSUMP K8F1 D0
F3
MOVP D0 D10
Searches ON devices
DSUMP K8F33 D0
+P D0 D10
SET M400
RST M700
X000 M200M400
73 PLS M500
SET M700
M500
80 SET M200
RST M600
App - 129
M100M200
103 DROR D0 K1 Searches ON devices
SM700 shifting 32-bit data
SET M100
to right
INC Z0
BCD Z0 K4Y60
X1 M700
120 PLS M300
M300
125 RST M100
Searches next ON device
< K0 D10 - K1 D10
CIRCUIT END
(1) Searching ON devices
DSUMP K8F1 D0
DSUMP K8F33 D0
32 bits
F F F F F F
3231 4 3 2 1
S before execution (K8F1) 1 1 1 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1
b15 b0
A0 after execution 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
When X2 is turned on, the number of turned-on bits among F1 to F64 is stored to
D10 and displayed.
App - 130
F Transferred by a MOVP instruction
F
16 1
D0 D10
1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 1
16 16
1 1 1 0 0 1 0 0 1 0 0 1 0 0 0 1
F F
32 17
F F
48 33
D0
0 0 0 1 1 1 0 0 0 0 1 1 0 0 0 1
7 Added by a + P instruction
0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0
F F F
64 5049
D10
Number of turned-on inputs among X20 to 5B 23
DMOV instruction
D1,D0 1 1 1 0 0 0 1
D1 D0
(16 bits) (16 bits)
DRDR D0 K1
D1 D0
After 1 1 1 1 0 0 0 1 1 1 0 1 1 1 0 0 1
execution To b31
(1) When X0 is turned on, the above shift data (D0, D1) is set. After that, the data
is shifted in right direction by 1 bit at each scan until a turned on bit is
detected.
When a turned-on bit is detected, shifting stops in that scan (SM700 turns
on), and the accumulated number of shifts (equivalent to a device number) is
displayed.
(2) Detecting the next turned-on bit takes place each time X1 is turned on, and
the detected device number is displayed in the same manner. At the same
time, 1 is subtracted from the number of turned-on bits, which was obtained
in advance, to display the remaining number of turned-on bits.
App - 131
APPENDIX 6 Keys of GX Developer
The following table lists keys used in GX Developer with their applications.
App - 132
(2) Function keys in ladder mode
Combination F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 C V X
3) Press F4 to convert.
Press Shift + F4 to perform write during RUN.
Press Alt + Ctrl + F4 to perform write during RUN to all
programs currently being edited.
App - 133
Mitsubishi Programmable Logic Controller Training Manual
Q-series basic course(for GX Developer)
Mitsubishi Programmable
Logic Controller
Training Manual
MODEL SCHOOL-Q-BASIC-WIN-E
MODEL 13JW50
CODE
SH(NA)-080617ENG-A(0601)MEE
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN
When exported from Japan, this manual does not require application to the
Ministry of Economy, Trade and Industry for service transaction permission.