(1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions;
i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident;
and
ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the
case of any problem, fault or failure occurring in the PRODUCT.
(2) The PRODUCT has been designed and manufactured for the purpose of being used in general industries.
MITSUBISHI SHALL HAVE NO RESPONSIBILITY OR LIABILITY (INCLUDING, BUT NOT LIMITED TO ANY AND ALL
RESPONSIBILITY OR LIABILITY BASED ON CONTRACT, WARRANTY, TORT, PRODUCT LIABILITY) FOR ANY
INJURY OR DEATH TO PERSONS OR LOSS OR DAMAGE TO PROPERTY CAUSED BY the PRODUCT THAT ARE
OPERATED OR USED IN APPLICATION NOT INTENDED OR EXCLUDED BY INSTRUCTIONS, PRECAUTIONS, OR
WARNING CONTAINED IN MITSUBISHI'S USER, INSTRUCTION AND/OR SAFETY MANUALS, TECHNICAL
BULLETINS AND GUIDELINES FOR the PRODUCT.
("Prohibited Application")
Prohibited Applications include, but not limited to, the use of the PRODUCT in;
• Nuclear Power Plants and any other power plants operated by Power companies, and/or any other cases in which the
public could be affected if any problem or fault occurs in the PRODUCT.
• Railway companies or Public service purposes, and/or any other cases in which establishment of a special quality
assurance system is required by the Purchaser or End User.
• Aircraft or Aerospace, Medical applications, Train equipment, transport equipment such as Elevator and Escalator,
Incineration and Fuel devices, Vehicles, Manned transportation, Equipment for Recreation and Amusement, and
Safety devices, handling of Nuclear or Hazardous Materials or Chemicals, Mining and Drilling, and/or other
applications where there is a significant risk of injury to the public or property.
Notwithstanding the above, restrictions Mitsubishi may in its sole discretion, authorize use of the PRODUCT in one or
more of the Prohibited Applications, provided that the usage of the PRODUCT is limited only for the specific
applications agreed to by Mitsubishi and provided further that no special quality assurance or fail-safe, redundant or
other safety features which exceed the general specifications of the PRODUCTs are required. For details, please
contact the Mitsubishi representative in your region.
(Read these precautions before using this product.)
Before using this product, please read this manual and the related manuals introduced in this manual, and pay full attention to
safety to handle the product correctly.
Please store this manual in a safe place and make it accessible when required. Always forward a copy of the manual to the
end user.
CONDITIONS OF USE FOR THE PRODUCT
1
INTRODUCTION
This manual "MELSEC-Q/L Programming Manual (Common Instruction)" describes the common instructions required for
programming of the QCPU and LCPU.
"Common instructions" are all instructions except for dedicated instructions for intelligent function modules; PID control
instructions; process control instruction; SFC instructions; ST instructions; instructions for socket communication features;
trigger logging instructions for the LCPU; and dedicated instructions for LCPU positioning/counter functionality.
Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the
functions and performance of the MELSEC-Q or -L series programmable controller to handle the product correctly.
When applying the program examples introduced in this manual to an actual system, ensure the applicability and confirm that
it will not cause system control problems.
Relevant CPU module
CPU moduleModel
Basic model QCPUQ00JCPU, Q00CPU, Q01CPU
High Performance model QCPUQ02CPU, Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU
Process CPUQ02PHCPU, Q06PHCPU, Q12PHCPU, Q25PHCPU
Redundant CPUQ12PRHCPU, Q25PRHCPU
Universal model QCPUQ00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU, Q03UDCPU, Q03UDVCPU, Q03UDECPU,
To understand the main specifications, functions, and usage of the CPU module, refer to the basic manuals.
Read other manuals as well when using a different type of CPU module and its functions.
Order each manual as needed, referring to the following lists.
The numbers in the "CPU module" and the respective modules are as follows.
NumberCPU module
1)Basic model QCPU
2)High Performance model QCPU
3)Process CPU
4)Redundant CPU
5)Universal model QCPU
6)LCPU
●: Basic manual, : Other CPU module manuals
Manual name
<Manual number>
User's manual
QCPU User's Manual (Hardware Design, Maintenance and
Inspection)
<SH-080483ENG>
QnUCPU User's Manual (Function Explanation, Program
Fundamentals)
<SH-080807ENG>
Qn(H)/QnPH/QnPRHCPU User's Manual (Function
Explanation, Program Fundamentals)
<SH-080808ENG>
QnUCPU User's Manual (Communication via Built-in Ethernet
Port)
<SH-080811ENG>
MELSEC-L CPU Module User's Manual (Hardware Design,
Maintenance and Inspection)
<SH-080890ENG>
MELSEC-L CPU Module User's Manual (Function
Explanation, Program Fundamentals)
<SH-080889ENG>
MELSEC-L CPU Module User's Manual (Built-In I/O Function)
<SH-080892ENG>
MELSEC-L CPU Module User's Manual (Built-In Ethernet
Function)
<SH-080891ENG>
Specifications of the hardware (CPU modules, power supply
modules, base units, extension cables, memory cards, SD
memory cards, extended SRAM cassettes, and batteries),
system maintenance and inspection, and troubleshooting
Functions, methods, and devices for programming●
Functions, methods, and devices for programming●●●●
Functions for the communication via built-in Ethernet port of
the CPU module
Specifications of the hardware (CPU modules, power supply
modules, a branch module, an extension module, and SD
memory cards), system maintenance and inspection,
troubleshooting, and error codes
Functions, methods, and devices for programming●
Built-in I/O Functionality of the CPU
Functions for the communication via built-in Ethernet port of
the CPU module
Specifications, procedures and settings before system operation, parameter settings,
programming, and troubleshooting of the CC-Link IE Controller Network module
Specifications, procedures and settings before system operation, parameter settings,
programming, and troubleshooting of the CC-Link IE Field Network module
Specifications, procedures and settings before system operation, parameter settings,
programming, and troubleshooting of the CC-Link IE Field Network module
Specifications, procedures and settings before system operation, parameter setting,
programming, and troubleshooting of a MELSECNET/H network system (PLC to PLC
network)
Specifications, procedures and settings before system operation, parameter setting,
programming, and troubleshooting of a MELSECNET/H network system (remote I/O network)
Describes the general concept, specifications, and part names and settings for MELSECNET
() and MELSECNET/B.
E-mail function, programmable controller CPU status monitoring function, communication via
CC-Link IE Field Network, CC-Link IE Controller Network, MELSECNET/H, or MELSECNET/
10, communication using the data link instructions, and file transfer function (FTP server) of
the Ethernet module
13
TERMS
This manual uses the generic names and abbreviations shown below to refer to Q/L series CPU modules, unless otherwise
specified.
indicates a part of the model or version.
TermDescription
A5BA generic term for the power source-free type A52B, A55B, and A58B extension base unit on which the A Series
I/O module and special function module can be mounted
A6BA generic term for the A62B, A65B, and A68B extension base unit on which the A Series I/O module and special
Basic model QCPUA generic term for Q00JCPU, Q00CPU and Q01CPU
Built-in Ethernet port LCPUA generic term for the L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P, L26CPU-BT, and
Built-in Ethernet port QCPUA generic term for Q03UDVCPU, Q03UDECPU, Q04UDVCPU, Q04UDEHCPU, Q06UDVCPU,
CC-Link IEA generic term for the CC-Link IE Controller Network and the CC-Link IE Field Network
CPU moduleA generic term for Basic model QCPU, High Performance model QCPU, Process CPU, Redundant CPU,
GX DeveloperThe product name of Q/L series Corresponding SW D5C-GPPW-type GPP function software package
GX Works2The product name of Q/L series Corresponding SW D5C-GXW2-type GPP function software package
High Performance model QCPUA generic term for Q02CPU, Q02HCPU, Q06HCPU, Q12HCPU and Q25HCPU
High-speed Universal model QCPUA generic term for Q03UDVCPU, Q04UDVCPU, Q06UDVCPU, Q13UDVCPU and Q26UDVCPU
Intelligent function module deviceA generic term for intelligent function module devices and special function module devices
L seriesThe abbreviation for Mitsubishi MELSEC-L series programmable controller
LCPUA generic term for L02SCPU, L02SCPU-P, L02CPU, L02CPU-P, L06CPU, L06CPU-P, L26CPU, L26CPU-P,
MELSECNET(, /B)The abbreviation for MELSECNET and MELSECNET/B data link system
MELSECNET/10The abbreviation for MELSECNET/10 network system
MELSECNET/HThe abbreviation for MELSECNET/H network system
Process CPUA generic term for Q02PHCPU, Q06PHCPU, Q12PHCPU and Q25PHCPU
Programming toolA generic term for GX Developer and GX Works2
Q seriesThe abbreviation for Mitsubishi MELSEC-Q series programmable controller
Q3DBA generic term for the Q35DB, Q38DB and Q312DB type Multiple CPU high speed main base unit on which
Q5BA generic term for Q52B and Q55B extension base unit on which the Q Series I/O and intelligent function
Q6BA generic term for Q63B, Q65B, Q68B and Q612B extension base unit on which Q Series power supply
Q6WRBAnother term for Q65WRB extension base unit for redundant system on which redundant power supply module,
QA1S5BA generic term for QA1S51B extension base unit on which AnS Series I/O module, special function module can
QA1S6BA generic term for QA1S65B and QA1S68B extension base units on which AnS Series power supply module, I/
QA6ADPThe abbreviation for the QA6ADP QA conversion adapter module
QA6ADP+A5B/A6BThe abbreviation for the A large type extension base unit equipped with the QA6ADP
QA6BA generic term for the QA65B and QA68B extension base units on which the A Series power supply module, A
QnCPUA generic term for Q00JCPU, Q00CPU, Q01CPU and Q02CPU
QnHCPUA generic term for Q02HCPU, Q06HCPU, Q12HCPU and Q25HCPU
function module can be mounted
L26CPU-PBT
Q06UDEHCPU, Q10UDEHCPU, Q13UDVCPU, Q13UDEHCPU, Q20UDEHCPU, Q26UDVCPU,
Q26UDEHCPU, Q50UDEHCPU and Q100UDEHCPU
Universal model QCPU and LCPU
: Version of the software
Check the GX Developer versions that can be used for each CPU module in "System Configuration," User's
Manual (Hardware Design, Maintenance and Inspection).
: Version of the software
Check the GX Works2 versions that can be used for each CPU module in "System Configuration," User's
Manual (Hardware Design, Maintenance and Inspection).
L26CPU-BT and L26CPU-PBT
CPU module (except the Q00JCPU), Q series power supply module, Q series I/O module, and intelligent
function module can be mounted
module can be mounted
module, I/O module, intelligent function module can be mounted
Q series I/O module, and intelligent function module can be mounted.
be mounted
O module, special function module can be mounted
Series I/O module, and special function module can be mounted
14
Ter mDescription
QnPHCPUA generic term for Q02PHCPU, Q06PHCPU, Q12PHCPU and Q25PHCPU
QnPRHCPUA generic term for Q12PRHCPU and Q25PRHCPU
QnU(D)(H)CPUA generic term for Q02UCPU, Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q10UDHCPU, Q13UDHCPU,
QnUCPUA generic term for Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU, Q03UDCPU, Q03UDVCPU, Q03UDECPU,
QnUD(H)CPUA generic term for Q03UDCPU, Q04UDHCPU, Q06UDHCPU, Q10UDHCPU, Q13UDHCPU, Q20UDHCPU and
QnUDE(H)CPUA generic term for Q03UDECPU, Q04UDEHCPU, Q06UDEHCPU, Q10UDEHCPU, Q13UDEHCPU,
QnUDVCPUA generic term for Q03UDVCPU, Q04UDVCPU, Q06UDVCPU, Q13UDVCPU and Q26UDVCPU
Redundant CPUA generic term for Q12PRHCPU and Q25PRHCPU
Universal model QCPUA generic term for Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU, Q03UDCPU, Q03UDVCPU, Q03UDECPU,
Describes the instructions
other than those described
in the manuals on the right.
MELSEC-Q/L/
QnA Programming
Manual
(PID Control
Instructions)
Describes the instructions
to perform PID control.
MELSEC-Q/L/
QnA Programming
Manual (SFC)
MELSEC-Q/L
Programming
Manual
(MELSAP-L)
Describes MELSAP-L.
MELSEC-Q/L
Programming
Manual
(Structured Text)
Describes the ST
language.
Describes the functions
and devices of the CPU
module, and programming.
This manual describes the common instructions required for programming of the QCPU and LCPU.
"Common instructions" are all instructions except for dedicated instructions for intelligent function modules; PID control
instructions; process control instruction; SFC instructions; ST instructions; instructions for socket communication features;
trigger logging instructions for the LCPU; and dedicated instructions for LCPU positioning/counter functionality.
1.1Related Programming Manuals
Before reading this manual, check the functions, programming methods, devices and others that are necessary to create
programs with the CPU in the manuals below:
QnUCPU User's Manual (Function Explanation, Program Fundamentals)
Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program Fundamentals)
MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamentals)
Basic model QCPU
16
1 GENERAL DESCRIPTION
1.1 Related Programming Manuals
High Performance model QCPU
Describes SFC.
This manual
Qn(H)/QnPH/
QnPRHCPU
User's Manual
(Function Explanation,
Program
Fundamentals)
MELSEC-Q/L/QnA
Programming Manual
(PID Control
Instructions)
MELSEC-Q/L/QnA
Programming Manual
(SFC)
MELSEC-Q/L
Programming Manual
(MELSAP-L)
MELSEC-Q/L
Programming Manual
(Structured Text)
Describes the instructions
other than those described
in the manuals on the right.
Describes the instructions
to perform process control.
Describes SFC.Describes MELSAP-L.Describes the ST
language.
This manual
(Function Explanation,
Program
Fundamentals)
Describes the functions and
devices of the CPU module,
and programming.
1 GENERAL DESCRIPTION
20
1.1 Related Programming Manuals
2INSTRUCTION TABLES
2.1Types of Instructions
The major types of CPU module instructions consist of sequence instructions, basic instructions, application instructions, data
link instructions, QCPU instructions and redundant system instructions. These types of instructions are listed in the following
Table.
Types of instructionsDescriptionReference
Sequence
instruction
Basic instructionComparison operation
Contact instructionOperation start, series connection, parallel connectionPage 131 SEQUENCE
Association instructionLadder block connection, store/read operation results, creation of pulses
Other instructionProgram stop, instructions such as no operation which do not fit in the
above categories
instructions
Arithmetic operation instructionAddition, subtraction, multiplication or division of BIN or BCD
BCD BIN conversion
instruction
Data transfer instructionTransmits designated data
Program branch instructionProgram jumps
Program run control instructionEnables or inhibits interrupt programs
I/O refresh instructionExecutes partial refresh
Other convenient instructionInstructions for: Counter increment/decrement, teaching timer, special
Comparisons such as =, >, <Page 187 BASIC
Conversion from BCD to BIN and from BIN to BCD
function timer, rotary table shortest direction control, etc.
INSTRUCTIONS
INSTRUCTIONS
2
2 INSTRUCTION TABLES
2.1 Types of Instructions
21
Types of instructionsDescriptionReference
Application
instruction
Data link
instruction
Multiple CPU
dedicated
instruction
Multiple CPU highspeed transmission
dedicated
instruction
Redundant system
instruction
Logical operation instructionLogical operations such as logical sum, logical product, etc.Page 355
Rotation instructionRotation of designated data
Shift instructionShift of designated data
Bit processing instructionBit set and reset, bit test, batch reset of bit devices
Data processing instruction16-bit data searches, data processing such as decoding and encoding
Structure creation instructionRepeated operation, subroutine program calls, indexing in ladder units
Table operation instructionData table read/write
Buffer memory access
instruction
Display instructionPrint ASCII code, etc.
Debugging and failure diagnosis
instruction
Character string processing
instruction
Special function instructionTrigonometric functions, conversion between angles and radians,
Data control instructionUpper and lower limit controls, dead band controls, zone controls
Switching instructionFile register block No. switches, designation of file registers and comment
Clock instructionReading/writing of the values of year, month, day, hour, minute, second, and
Expansion clock instructionReading of the values of year, month, day, hour, minute, second,
Program control instructionInstructions to switch program execution conditions
Other instructionInstructions that do not fit in the above categories, such as watchdog timer
Link refresh instructionDesignated network refreshPage 820
Routing information read/write
instruction
Refresh device write/read
instruction
Multiple CPU dedicated
instruction
Multiple CPU device write/read
instruction
Instruction for Redundant CPUSystem switchingPage 880
Data read/write from/to an intelligent function module
Check, status latch, sampling trace
Conversion between BIN/BCD and ASCII; conversion between BIN and
character string; conversion between floating decimal point data and
character strings, character string processing, etc.
exponential operations, natural logarithm, common logarithm, square roots
files
day of the week; addition/subtraction of the values of hour, minute, and
second; conversion of the values of hour, minute, and second into second;
comparison between the values of year, month, and day; and comparison
between the values of hour, minute, and second
millisecond, and day of the week; addition/subtraction of the values of hour,
minute, second, and millisecond
reset instructions and timing clock instructions
Reads, writes, and registers routing information
Reads or writes the refresh device.
Writing to host CPU shared memory, Reading from other CPU shared
memory
Writes/reads devices to/from another CPU.Page 861 MULTIPLE
APPLICATION
INSTRUCTIONS
INSTRUCTIONS FOR
DATA LINK
Page 846 MULTIPLE
CPU DEDICATED
INSTRUCTIONS
CPU HIGH-SPEED
TRANSMISSION
DEDICATED
INSTRUCTIONS
REDUNDANT
SYSTEM
INSTRUCTIONS
(FOR REDUNDANT
CPU)
22
2 INSTRUCTION TABLES
2.1 Types of Instructions
2.2How to Read Instruction Tables
ÒÓÔÕÖרÙ
Example
+
D+
16-bit instruction 32-bit instruction
Example
+
+P
Instruction executed
when ON
Instruction executed
only at the leading
edge of OFF to ON
Example
+
E+
Real number instructions
Example +$+
Character string instructions
+
Indicates destination.
Indicates source.
Indicates instruction symbol.
SD
Indicates destination.
Indicates source.
Indicates instruction symbol.
+
D
S1 S2
The instruction tables found from Page 25 Sequence Instructions to Page 79 Redundant System Instructions (For Redundant
CPU) have been made according to the following format:
Classifies instructions according to their application.
Indicates the instruction symbol added to the instruction in a program.
Instruction code is built around the 16-bit instruction.
The following notations are used to mark 32-bit instructions, instructions executed only at the rising edge of OFF to ON, real number instructions, and character
string instructions:
• 32-bit instruction: The letter "D" is added to the first line of the instruction.
2
• Instructions executed only at the rising edge of OFF to ON: The letter "P" is added to the end of the instruction.
• Real number instructions: The letter "E" is added to the first line of the instruction.
• Character string instructions: A dollar sign $ is added to the first line of the instruction.
Shows symbol diagram on the ladder.
• Destination: Indicates where data will be sent after operation.
• Source: Stores data prior to operation.
2 INSTRUCTION TABLES
2.2 How to Read Instruction Tables
23
Indicates the type of processing that is performed by individual instructions.
(D)+(S)(D)
Indicates 16 bits.
Indicates execution conditions for individual instructions.
(D+1, D) +(S+1, S)(D +1, D)
16 bits
16 bits
Indicates 32 bits.
D+1D
Upper 16 bits Lower 16 bits
Execution condition Non-conditional
execution
Recorded codeNo symbol recorded
For execution conditions, refer to Page 117 Conditions for Execution of Instructions.
Indicates the basic number of steps for individual instructions.
See Page 118 Counting Step Number for a description of the number of steps.
The ● mark indicates instructions for which subset processing is possible.
See Page 108 Reducing Instruction Processing Time for details on subset processing.
Indicates the page numbers where the individual instructions are explained.
Executed at ONExecuted at the
rising edge
Executed at OFFExecuted at the
falling edge
24
2 INSTRUCTION TABLES
2.2 How to Read Instruction Tables
2.3Sequence Instructions
Contact instructions
CategoryInstruction
SymbolProcessing detailsExecution
symbol
ContactLD• Starts logic operation (Starts A contact logic operation)
LDI• Starts logical NOT operation (Starts B contact logic
AND• Logical product (A contact series connection)
ANI• Logical product NOT (B contact series connection)
OR• Logical sum (A contact parallel connection)
ORI• Logical sum NOT (B contact parallel connection)
LDP• Starts rising edge pulse operation
LDF• Starts falling edge pulse operation
ANDP• Rising edge pulse series connection
ANDF• Falling edge pulse series connection
ORP• Rising edge pulse parallel connection
ORF• Falling edge pulse parallel connection
operation)
condition
Number
of basic
steps
*1
*1
Subset Reference
●Page 131
●Page 134
2
LDPI• Starts rising edge pulse NOT operation3
LDFI• Starts falling edge pulse NOT operation3
ANDPI• Rising edge pulse NOT series connection4
ANDFI• Falling edge pulse NOT series connection4
ORPI• Rising edge pulse NOT parallel connection4
ORFI• Falling edge pulse NOT parallel connection4
*2*3
*2*3
*2*3
*2*3
*2*3
*2*3
●Page 136
2 INSTRUCTION TABLES
2.3 Sequence Instructions
25
*1 The number of steps may vary depending on the device being used.
ORB
MPS
MRD
MPP
Vn
Vn
DeviceNumber of steps
Internal device, file register (R0 to R32767)1
Direct access input (DX)2
Devices other than above3
*2 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of steps
Basic model QCPU
High Performance model QCPU
Process CPU
Redundant CPU
Universal model QCPU
LCPU
• Internal device, file register (R0 to R32767)
• Direct access input (DX)
Devices other than above3
Internal device, file register (R0 to R32767)Number of basic steps
• Serial number access format file register (ZR), Extended data register
(D), Extended link register (W), Multiple CPU shared device
(U3En\G10000)
• Direct access input (DX)
Devices other than aboveNumber of basic steps +2
1
Number of basic steps +1
*3 For the High-speed Universal model QCPU, the number of basic steps is two.
Association instructions
CategoryInstruction
SymbolProcessing detailsExecution
symbol
ConnectionANB• AND between logical blocks
ANB
ORB• OR between logical blocks
MPS• Memory storage of operation
MRD• Read of operation results
MPP• Read and reset of operation
INV• Inversion of operation result1Page 143
MEP• Conversion of operation result
MEF• Conversion of operation result
EGP• Conversion of operation result
EGF• Conversion of operation result
(Series connection between
logical blocks)
(Series connection between
logical blocks)
results
stored with MPS instruction
results stored with MPS
instruction
to rising edge pulse
to falling edge pulse
to rising edge pulse (Stored at
Vn)
to falling edge pulse (Stored at
Vn)
*1 The number of steps may differ, depending on CPU modules.
CPU moduleNumber of basic steps
High Performance model QCPU
Process CPU
Redundant CPU
Universal model QCPU
LCPU
Basic model QCPU2
1
condition
Number
Subset Reference
of basic
steps
1Page 138
1Page 140
1Page 145
1Page 146
*1
26
2 INSTRUCTION TABLES
2.3 Sequence Instructions
Output instructions
RSTD
PLSD
MCn D
CategoryInstruction
symbol
OutputOUT• Device output
SET• Sets device
RST• Resets device
PLS• Generates 1 cycle program pulse
PLF• Generates 1 cycle program pulse
FF• Reversal of device output2Page 167
DELTA• Pulse conversion of direct output2Page 169
DELTAP
SymbolProcessing detailsExecution
SETD
at rising edge of input signal.
PLFD
FF
DELTAD
DELTAP D
D
at falling edge of input signal.
condition
Annunciator (F)
Annunciator (F)
Number
of basic
steps
*1
*1
*1
2Page 164
Subset Reference
Page 148
Page 150
Page 154
Page 156
Page 158
Page 162
Page 160
Page 162
2
*1 The number of steps may vary depending on the device being used. See description pages of individual instructions for number of steps.
Shift instructions
CategoryInstruction
symbol
ShiftSFT• 1-bit shift of device2Page 171
SFTP
SymbolProcessing detailsExecution
condition
SFTD
SFTPD
Number
of basic
steps
Subset Reference
Master control instructions
CategoryInstruction
symbol
Master
control
MC• Starts master control2Page 173
MCR• Resets master control1
SymbolProcessing detailsExecution
condition
MCRn
Number
of basic
steps
Subset Reference
2 INSTRUCTION TABLES
2.3 Sequence Instructions
27
Termination instructions
STOP
NOPLF
PAGEn
CategoryInstruction
SymbolProcessing detailsExecution
symbol
Termination FEND• Termination of main
END• Termination of sequence
FEND
END
program
program
*1 For the High-speed Universal model QCPU, the number of basic steps is two.
Other instructions
CategoryInstruction
symbol
StopSTOP• Terminates sequence
IgnoredNOP• Ignored (For program
NOPLF• Ignored (To change pages
PAGE n• Ignored (Subsequent
SymbolProcessing detailsExecution
operation after input
condition has been met.
• Sequence program is
executed by placing the
RUN/STOP key switch
back in the RUN position.
deletion or space)
during printouts)
programs will be controlled
from step 0 of page n)
condition
condition
Number
Subset Reference
of basic
steps
*1
1
Number
1Page 177
1Page 179
Subset Reference
of basic
steps
1Page 181
1Page 183
28
2 INSTRUCTION TABLES
2.3 Sequence Instructions
2.4Basic Instructions
S1 S2
S1 S2
S1 S2
S1 S2
S1 S2
DS2S1CMP
DS2S1CMPP
S3S2S1DZCP
S3S2S1DZCPP
Comparison operation instructions
CategoryInstruction
symbol
BIN 16-bit
data
comparisons
LD=• Conductive status when (S1)
AND=
OR=
LD<>• Conductive status when (S1)
AND<>
OR<>
LD>• Conductive status when (S1)
AND>
OR>
LD<=• Conductive status when (S1)
AND<=
SymbolProcessing detailsExecution
condition
S1 S2
S1 S2
= (S2)
• Non-conductive status when
(S1) (S2)
S1 S2
S1 S2
S1 S2
(S2)
• Non-conductive status when
(S1) = (S2)
S1 S2
> (S2)
• Non-conductive status when
S1 S2
(S1) (S2)
S1 S2
(S2)
• Non-conductive status when
S1 S2
(S1) > (S2)
Number
Subset Reference
of basic
steps
3●Page 187
3●
3●
3●
2
BIN 16-bit
data
comparisons
OR<=
LD<• Conductive status when (S1)
AND<
OR<
S1 S2
S1 S2
< (S2)
• Non-conductive status when
(S1) (S2)
S1 S2
LD>=• Conductive status when (S1)
AND>=
OR>=
CMP• (D) Conductive status when
CMPP
ZCP• (D) Conductive status when
ZCPP
S1 S2
(S2)
• Non-conductive status when
(S1) < (S2)
(S1) > (S2)
• (D)+1 Conductive status
when (S1) = (S2)
• (D)+2 Conductive status
when (S1) < (S2)
(S1) > (S3)
• (D)+1 Conductive status
when (S1) (S3) (S2)
• (D)+2 Conductive status
when (S3) > (S2)
3●
3●
4Page 205
5Page 208
2 INSTRUCTION TABLES
2.4 Basic Instructions
29
CategoryInstruction
DS1S2
D
S1 S2
DS1S2
DS2S1DCMP
DS2S1DCMPP
S3S2S1DDZCP
S3S2S1DDZCPP
symbol
BIN 32-bit
data
comparisons
LDD=• Conductive status when
ANDD=
ORD=
LDD<>• Conductive status when
ANDD<>
ORD<>
LDD>• Conductive status when
ANDD>
ORD>
LDD<=• Conductive status when
ANDD<=
ORD<=
SymbolProcessing detailsExecution
condition
DS1S2
DS1S2
(S1+1, S1) = (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
DS1S2
DS1S2
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) = (S2+1, S2)
DS1S2
DS1S2
(S1+1, S1) > (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
S1 S2D
DS1S2
DS1S2
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) > (S2+1, S2)
Number
of basic
steps
*1
*1
*1
*1
Subset Reference
●Page 189
●
●
●
BIN 32-bit
data
comparisons
DS1S2
LDD<• Conductive status when
ANDD<
ORD<
LDD>=• Conductive status when
ANDD>=
ORD>=
DS1S2
D
S1 S2
DS1S2
DS1S2
(S1+1, S1) < (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) < (S2+1, S2)
DS1S2
DCMP• (D) Conductive status when
DCMPP
DZCP• (D) Conductive status when
DZCPP
(S1, S1+1) > (S2, S2+1)
• (D)+1 Conductive status
when (S1, S1+1) = (S2,
S2+1)
• (D)+2 Conductive status
when (S1, S1+1) < (S2,
S2+1)
(S1, S1+1) > (S3, S3+1)
• (D)+1 Conductive status
when (S1, S1+1) (S3,
S3+1) (S2, S2+1)
• (D)+2 Conductive status
when (S3, S3+1) > (S2,
S2+1)
*1
*1
4Page 207
5Page 210
●
●
30
2.4 Basic Instructions
2 INSTRUCTION TABLES
CategoryInstruction
ES1S2
ES1S2
ES1S2
ES1S2
ES1S2
ES1S2
ECMPPDS1 S2
EZCPDS1 S2 S3
EZCPPDS1 S2 S3
symbol
Floating
decimal
point data
comparisons
(single
precision)
LDE=• Conductive status when
ANDE=
ORE=
LDE<>• Conductive status when
ANDE<>
ORE<>
SymbolProcessing detailsExecution
condition
ES1S2
ES1S2
(S1+1, S1) = (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
ES1S2
ES1S2
E
S1 S2
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) = (S2+1, S2)
Number
Subset Reference
of basic
steps
3Page 191
3
2
LDE>• Conductive status when
ANDE>
ORE>
ES1S2
(S1+1, S1) > (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
ES1S2
LDE<=• Conductive status when
ANDE<=
ORE<=
LDE<• Conductive status when
ANDE<
ORE<
ES1S2
ES1S2
ES1S2
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) > (S2+1, S2)
(S1+1, S1) < (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) (S2+1, S2)
ES1S2
LDE>=• Conductive status when
ANDE>=
ORE>=
ES1S2
(S1+1, S1) (S2+1, S2)
• Non-Conductive status when
(S1+1, S1) < (S2+1, S2)
3
3
3
3
Floating
point
comparisons
(single
precision)
Floating
point band
comparisons
(single
precision)
ECMP• (D) is on when (S1, S1+1) >
ECMPP
EZCP• (D) is on when (S1, S1+1) >
EZCPP
ECMPDS1 S2
(S2, S2+1)
• (D)+1 is on when (S1, S1+1)
= (S2, S2+1)
• (D)+2 is on when (S1, S1+1)
< (S2, S2+1)
(S3, S3+1)
• (D)+1 is on when (S1, S1+1)
(S3, S3+1) (S2, S2+1)
• (D)+2 is on when (S3, S3+1)
> (S2, S2+1)
4Page 212
5Page 216
2 INSTRUCTION TABLES
2.4 Basic Instructions
31
CategoryInstruction
EDS1 S2
EDS1 S2
EDS1 S2
EDS1 S2
EDS1 S2
EDS1 S2
EDCMPPDS1 S2
symbol
Floating
decimal
point data
comparisons
(double
precision)
LDED=• Conductive status when
ANDED=
ORED=
LDED<>• Conductive status when
ANDED<>
ORED<>
SymbolProcessing detailsExecution
condition
EDS1 S2
EDS1 S2
(S1+3, S1+2, S1+1, S1) =
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
EDS1 S2
EDS1 S2
ED
S1
S2
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1) =
(S2+3, S2+2, S2+1, S2)
Number
Subset Reference
of basic
steps
3Page 193
3
LDED>• Conductive status when
ANDED>
ORED>
E
DS1S2
(S1+3, S1+2, S1+1, S1) >
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
EDS1 S2
LDED<=• Conductive status when
ANDED<=
ORED<=
LDED<• Conductive status when
ANDED<
ORED<
EDS1S2
EDS1 S2
EDS1 S2
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1) >
(S2+3, S2+2, S2+1, S2)
(S1+3, S1+2, S1+1, S1) <
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
EDS1 S2
LDED>=• Conductive status when
ANDED>=
ORED>=
EDS1 S2
(S1+3, S1+2, S1+1, S1)
(S2+3, S2+2, S2+1, S2)
• Non-Conductive status when
(S1+3, S1+2, S1+1, S1) <
(S2+3, S2+2, S2+1, S2)
3
3
3
3
Floating
point
comparisons
(double
precision)
Floating
point band
comparisons
(double
precision)
2 INSTRUCTION TABLES
32
2.4 Basic Instructions
EDCMP• (D) is on when (S1 to S1+3)
EDCMPP
EDZCP• (D) is on when (S1 to S1+3)
EDZCPP
EDCMPDS1 S2
EDZCPDS1 S2 S3
EDZCPPDS1 S2 S3
> (S2 to S2+3)
• (D)+1 is on when (S1 to
S1+3) = (S2 to S2+3)
• (D)+2 is on when (S1 to
S1+3) < (S2 to S2+3)
> (S3 to S3+3)
• (D)+1 is on when (S1 to
S1+3) (S3 to S3+3) (S2
to S2+3)
• (D)+2 is on when (S3 to
S3
+3
) > (S2 to S2+3)
4Page 214
5Page 218
CategoryInstruction
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
symbol
Character
string data
comparisons
LD$=• Compares character string
AND$=
OR$=
LD$<>• Compares character string
AND$<>
OR$<>
LD$>• Compares character string
AND$>
OR$>
LD$<=• Compares character string
AND$<=
OR$<=
LD$<• Compares character string
AND$<
OR$<
LD$>=• Compares character string
AND$>=
OR$>=
SymbolProcessing detailsExecution
condition
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
$S1S2
S1 S2$
$S1S2
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1) =
(character string S2)
• Non-Conductive status when
(character string S1)
(character string S2)
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1)
(character string S2)
• Non-Conductive status when
(character string S1) =
(character string S2)
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1) >
(character string S2)
• Non-Conductive status when
(character string S1)
(character string S2)
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1)
(character string S2)
• Non-Conductive status when
(character string S1) >
(character string S2)
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1) <
(character string S2)
• Non-Conductive status when
(character string S1)
(character string S2)
S1 and character string S2
one character at a time.
• Conductive status when
(character string S1)
(character string S2)
• Non-Conductive status when
(character string S1) <
(character string S2)
*2
*2
*2
*2
*2
*2
Number
Subset Reference
of basic
steps
3Page 196
3
3
3
3
3
2
2 INSTRUCTION TABLES
2.4 Basic Instructions
33
CategoryInstruction
BKCMPnS1 S2 D
BKCMPnS1 S2 D
BKCMPn
S1 S2 D
BKCMPnS1 S2 D
BKCMPnS1 S2 DP
BKCMP
nS1 S2 D
P
BKCMP
nS1 S2 D
P
BKCMPnS1 S2 D
P
DBKCMP
nS1 S2 D
DBKCMP
nS1 S2 D
DBKCMP
nS1 S2 D
DBKCMP
n
S1 S2 D
DBKCMP
nS1 S2 D
DBKCMP
nS1 S2 D
P
DBKCMP
nS1 S2 D
P
DBKCMP
nS1 S2 D
P
DBKCMP
nS1 S2 D
P
symbol
BIN 16-bit
Block data
comparisons
BKCMP=• This instruction compares
BKCMP<>
BKCMP>
BKCMP<=
BKCMP<
BKCMP>=
BKCMP=P
BKCMP<>P
SymbolProcessing detailsExecution
condition
BIN 16-bit data stored in npoint devices starting from
BKCMP
S1 S2 D
BKCMPnS1 S2 D
n
the device specified by S1
with BIN 16-bit data stored in
n-point devices starting from
the device specified by S2,
and then stores the result
into the nth device specified
by (D) and up.
Number
Subset Reference
of basic
steps
5Page 199
BIN 32-bit
block data
comparisons
BKCMP>P
BKCMP<=P
BKCMP<P
BKCMP>=P
DBKCMP=• This instruction compares
DBKCMP<>
DBKCMP>
DBKCMP<=
DBKCMP<
DBKCMP>=
DBKCMP=P
DBKCMP<>
P
DBKCMP>P
DBKCMP<=
P
DBKCMP<P
BKCMPnS1 S2 DP
BKCMP
DBKCMP
DBKCMP
P
P
nS1 S2 D
BIN 32-bit data stored in npoint devices starting from
nS1 S2 D
the device specified by S1
with BIN 32-bit data stored in
n-point devices starting from
the device specified by a
constant and S2, and then
stores the result into the nth
device specified by (D) and
up.
nS1 S2 D
5Page 202
34
2.4 Basic Instructions
2 INSTRUCTION TABLES
DBKCMP>=
P
DBKCMP
P
nS1 S2 D
*1 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
Remark
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPU
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above3The number of steps may increase
All devices that can be used3
5When using a High Performance model
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
*2 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.
2
2 INSTRUCTION TABLES
2.4 Basic Instructions
35
Arithmetic operation instruction
+S1 S2 D
+PS1 S2 D
S1 S2 D
P
S1 S2 D
D+S1 S2 D
D+PS1 S2 D
DDS
DS1 S2 D
DS1 S2 DP
S1 S2 D
*
S1 S2 D
/S1 S2 D
/PS1 S2 D
S1 S2 D
S1 S2 D
D/S1 S2 D
D/PS1 S2 D
CategoryInstruction
symbol
BIN 16-bit
addition and
subtraction
operations
BIN 32-bit
addition and
subtraction
operations
+•D+(S)(D)3●Page 220
+P
+•(S1)+(S2)(D)4●Page 222
+P
-• (D)-(S)(D)3●Page 220
-P
-• (S1)-(S2)(D)4●Page 222
-P
D+• (D+1, D)+(S+1, S)(D+1, D)
D+P
D+• (S1+1, S1)+(S2+1, S2)(D+1,
D+P
SymbolProcessing detailsExecution
condition
+SD
+PSD
SD
P
SD
D+SD
D+PS
D
D)
Number
of basic
steps
*1
*2
Subset Reference
●Page 224
●Page 226
BIN 16-bit
multiplication
and division
operations
BIN 32-bit
multiplication
and division
operations
D-• (D+1, D)-(S+1, S)(D+1, D)
D-P
D-• (S1+1, S1)-(S2+1, S2)(D+1,
D-P
*•(S1)(S2)(D+1, D)
*P
/•(S1)(S2)Quotient(D),
/P
D*• (S1+1, S1)(S2+1, S2)(D+3,
D*P
D/• (S1+1, S1)(S2+1,
D/P
DSDP
D)
Remainder (D+1)
D+2, D+1, D)
S2)Quotient (D+1, D),
Remainder (D+3, D+2)
*1
*2
*3
*4
4
*4
4
*4
4
●Page 224
●Page 226
●Page 228
●
●Page 230
●
36
2.4 Basic Instructions
2 INSTRUCTION TABLES
CategoryInstruction
B+DS
B+PSD
B+S1 S2 D
B+PS1 S2 D
BDS
BDSP
BS1 S2 D
BS1 S2 DP
DB+SD
DB+PSD
DB+S1 S2 D
DB+PS1 S2 D
DBSD
DBSDP
DBS1 S2 D
DBS1 S2 DP
BS1S2D
BS1S2D
P
B/S1 S2 D
B/PS1 S2 D
DBS1 S2 D
DBS1 S2 DP
DB/S1 S2 D
DB/PS1 S2 D
symbol
BCD 4-digit
addition and
subtraction
operations
B+• (D)+(S)(D)3●Page 232
B+P
B+• (S1)+(S2)(D)4Page 234
B+P
B-• (D)-(S)(D)3●Page 232
B-P
B-• (S1)-(S2)(D)4Page 234
B-P
SymbolProcessing detailsExecution
condition
Number
of basic
steps
Subset Reference
2
BCD 8-digit
addition and
subtraction
operations
BCD 4-digit
multiplication
and division
operations
BCD 8-digit
multiplication
and division
operations
DB+• (D+1, D)+(S+1, S)(D+1, D)3Page 236
DB+P
DB+• (S1+1, S1)+(S2+1, S2)(D+1,
D)
DB+P
DB-• (D+1, D)-(S+1, S)(D+1, D)3Page 236
DB-P
DB-• (S1+1, S1)-(S2+1, S2)(D+1,
D)
DB-P
B*• (S1)(S2)(D+1, D)4●Page 240
B*P
B/• (S1)(S2)Quotient(D),
Remainder (D+1)
B/P
DB*• (S1+1, S1)(S2+1, S2)(D+3,
D+2, D+1, D)
DB*P
4Page 238
4Page 238
4●
4Page 242
DB/• (S1+1, S1)(S2+1,
DB/P
S2)Quotient (D+1, D),
Remainder (D+3, D+2)
4●
2 INSTRUCTION TABLES
2.4 Basic Instructions
37
CategoryInstruction
E+SD
E+PSD
E+S1 S2 D
E+PS1 S2 D
ES1 S2 D
ES1 S2 DP
E
D+SD
ED+PSD
ED+S1 S2 D
ED+PS1S2D
EDSD
EDS1S2D
EDS1S2DP
S1 S2 D
S1 S2 D
E/S1 S2 D
E/PS1 S2 D
EDS1S2
D
EDS1S2DP
ED/S1 S2 D
ED/PS1S2D
symbol
Floating
decimal
point data
addition and
subtraction
operations
(single
precision)
E+• (D+1, D)+(S+1, S)(D+1, D)3●
E+P
E+• (S1+1, S1)+(S2+1, S2)(D+1,
E+P
E-• (D+1, D)-(S+1, S)(D+1, D)3●
SymbolProcessing detailsExecution
condition
D)
ESD
Number
of basic
steps
*4
4
Subset Reference
*6
Page 244
*6
●
Page 246
*6
Page 244
Floating
decimal
point data
addition and
subtraction
operations
(double
precision)
Floating
decimal
point data
multiplication
and division
operations
(single
precision)
E-P
E-• (S1+1, S1)-(S2+1, S2)(D+1,
E-P
ED+• (D+3, D+2, D+1, D)+(S+3, S+2,
ED+P
ED+• (S1+3, S1+2, S1+1, S1)+(S2+3,
ED+P
ED-• (D+3, D+2, D+1, D)-(S+3, S+2,
ED-P
ED-• (S1+3, S1+2, S1+1, S1)-(S2+3,
ED-P
E*• (S1+1, S1)(S2+1, S2)(D+1,
E*P
E/• (S1+1, S1)(S2+1,
E/P
ESDP
D)
S+1, S)(D+3, D+2, D+1, D)
S2+2, S2+1, S2)(D+3, D+2,
D+1, D)
S+1, S)(D+3, D+2, D+1, D)
EDSDP
S2+2, S2+1, S2)(D+3, D+2,
D+1, D)
D)
S2)Quotient (D+1, D)
*4
4
3●Page 248
4●Page 250
3●Page 248
4●Page 250
3●
4●
*6
●
Page 246
*6
Page 252
*6
Floating
decimal
point data
multiplication
and division
operations
(double
precision)
2 INSTRUCTION TABLES
38
2.4 Basic Instructions
ED*• (S1+3, S1+2, S1+1, S1)(S2+3,
S2+2, S2+1, S2)(D+3, D+2,
ED*P
ED/• (S1+3, S1+2, S1+1, S1)(S2+3,
ED/P
D+1, D)
S2+2, S2+1, S2)Quotient
(D+3, D+2, D+1, D)
4●Page 254
4●
CategoryInstruction
BK+S1 S2nD
BK+PS1 S2nD
BKS1 S2nD
BKS1 S2nDP
DBK+S1 S2nD
DBK+PS1 S2nD
DBK
S1 S2nD
DBK
S1 S2nDP
$+SD
$+
S1 S2 D
$+P
S1 S2 D
INCD
INCPD
DINCD
DINCPD
DECD
DECPD
DDECD
DDECPD
symbol
BIN 16-bit
data block
addition and
subtraction
operations
BIN 32-bit
data block
addition and
subtraction
operations
Character
string data
Connection
BIN data
increment,
decrement
BK+• This instruction adds BIN 16-bit
BK+P
BK-• This instruction subtracts BIN
BK-P
DBK+• Adds BIN 32-bit data stored in
DBK+P
DBK-• Subtracts BIN 32-bit data stored
DBK-P
$+• Links character string
$+P
$+• Links character string
$+P
INC• (D)+1(D)2●Page 265
INCP
SymbolProcessing detailsExecution
condition
data stored in n-point devices
starting from the device
specified by (S1) to the n-point
data stored in the devices
starting from the device
specified by (S2) in batch.
16-bit data stored in the n-point
devices starting from the
devices specified by (S2) from
BIN 16-bit data stored in n-point
devices starting from the device
specified by (S1) in batch.
the n-point devices starting from
the device specified by (S1) and
a constant to BIN 32-bit data
stored in the n-point devices
starting from the device
specified by (S2) and stores the
result into the nth device
specified by (D) and up.
in the n-point devices starting
from the device specified by
(S2) or a constant from BIN 32bit data stored in n-point devices
starting from the device
specified by (S1) and stores the
operation result into the nth
device specified by (D) and up.
designated with (S) to character
string designated with (D), and
$+PSD
stores the result from (D)
onward.
designated with (S2) to
character string designated with
(S1), and stores the result from
(D) onward.
Number
Subset Reference
of basic
steps
5Page 256
5
5Page 259
5
3Page 262
4Page 264
2
DINC• (D+1, D)+1(D+1, D)
DINCP
DEC• (D)-1(D)2●Page 265
DECP
DDEC• (D+1, D)-1(D+1, D)
DDECP
*5
*5
●Page 267
●Page 267
2 INSTRUCTION TABLES
2.4 Basic Instructions
39
*1 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPU
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above3The number of steps may increase
All devices that can be used3
5When using a High Performance model
*2 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPUAll devices that can be used4
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above4The number of steps may increase
6When using a High Performance model
3
Remark
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
Remark
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
*3 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
QCPU, LCPU• 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
indexing.
• Constant: No limitations
Devices other than above4The number of steps may increase
3
*4 The number of basic steps is three for the Universal model QCPU and LCPU.
*5 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPU
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above2The number of steps may increase
All devices that can be used2
3When using a High Performance model
Remark
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
Remark
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
*6 The subset is effective only with Universal model QCPU and LCPU.
2 INSTRUCTION TABLES
40
2.4 Basic Instructions
Data conversion instructions
BCDSD
(S)(D)
BIN (0 to 9999)
BCD conversions
BCDPSD
DBCDSD
(S+1, S)(D+1, D)
BIN (0 to 99999999)
BCD conversions
DBCDPSD
BINSD
BINPSD
DBINSD
(S+1, S)(D+1, D)
BCD (0 to 99999999)
BIN conversions
DBINPSD
FLTSD
FLTPSD
DFLTSD
DFLTPSD
FLT
DSD
(S)
Conversion to real number
( D+3, D+2, D+1, D)
BIN( 32768 to 32767)
FLTDPS D
DFLTDS D
DFLTDPS D
INT
SD
INTPSD
DINTSD
(S+1, S)(D+1, D)
Real number
(-2147483648 to 2147483647)
Conversion to BIN
DINTPSD
INTDSD
(S+3, S+2, S+1, S)
Conversion to BIN
(D)
Real number (-32768 to 32767)
INTDPS D
DINTDS D
(S+3, S+2, S+1, S)
Conversion
to BIN
(D+1, D)
Real number
(-2147483648 to 2147483647)
DINTDPS D
CategoryInstruction
symbol
BCD
conversions
BIN
conversions
BIN
Floating
point
conversions
(single
precision)
BIN
Floating
point
conversions
(double
precision)
Floating
point (single
precision)
BIN
conversions
BCD3
BCDP
DBCD3
DBCDP
BIN3
BINP
DBIN3
DBINP
FLT3
FLTP
DFLT3
DFLTP
FLTD4●Page 275
FLTDP
DFLTD4●
DFLTDP
INT3
INTP
DINT3
SymbolProcessing detailsExecution
condition
BIN conversions
(S)(D)
BCD (0 to 9999)
Conversion to real number
(S)
BIN(
(
D+1, D)
32768 to 32767)
Conversion to real number
(S+1, S)(D+1, D)
BIN( 2147483648 to
2147483647)
Conversion to real number
(S+1, S)(D+3, D+2, D+1, D)
BIN( 2147483648 to
2147483647)
Conversion to BIN
(S+1, S)(D)
Real number
(-32768 to 32767)
Number
of basic
steps
*1
*1
*1
*1
*1
*1
*1
*1
Subset Reference
●Page 269
●
●Page 271
●
*2
●
●
●
●
Page 273
*2
*2
Page 277
*2
2
DINTP
Floating
point
(double
precision)
BIN
conversions
INTD3●Page 279
INTDP
DINTD3●
DINTDP
2 INSTRUCTION TABLES
2.4 Basic Instructions
41
CategoryInstruction
DBLSD
(S)
Conversion
(D+1, D)
BIN (-32768 to 32767)
DBLPSD
WORDSD
WORDPSD
GRYSD
(S)(D)
BIN (-32768 to 32767)
Conversion to gray code
GRYPSD
DGRYSD
(S
+1, S)
(D+1, D)
BIN (-2147483648 to
2147483647)
Conversion to gray code
DGRYPSD
GBINSD
(S)(D)
Gray code (-32768 to 32767)
Conversion to BIN data
DGBINSD
DGBINPSD
(D)(D)
BIN data
NEGPD
(D+1, D)(D+1, D)
BIN data
DNEGPD
Real number data
(D+1, D)(D+1, D)
BKBCD
nS D
BKBCDPnS D
BKBINnS D
BKBINPnS D
ECONS D
(S+1, S)
Conversion to double precision
(D+3, D+2, D+1, D)
32-bit floating-point real number
EDCONS D
(S+3, S+2, S+1, S)
Conversion to single precision
(D+1, D)
64-bit floating-point real number
EDCONP S D
symbol
BIN 16-bit
32-bit
conversions
DBL3
DBLP
SymbolProcessing detailsExecution
condition
Number
of basic
steps
*3
Subset Reference
Page 281
BIN Gray
code
conversions
Gray code
BIN
conversions
Complement
to 2
WORD3
(S+1, S)
WORDP
GRY3
GRYP
DGRY3
DGRYP
GBIN3
GBINP
DGBIN3
GBINPSD
Conversion
(D)
BIN (-32768 to 32767)
Conversion to BIN data
*3
*3
*3
*3
*3
Page 282
Page 283
Page 285
(S+1, S)(D+1, D)
DGBINP
Gray code
(-2147483648 to 2147483647)
NEG2Page 287
NEGP
NEGD
Block
conversion
Floatingpoint Single
precision
Double
precision
Floatingpoint Double
precision
Single
precision
DNEG2
DNEGP
ENEG2Page 289
ENEGP
EDNEG3Page 290
EDNEGP
BKBCD• Batch converts BIN data n points
BKBCDP
BKBIN• Batch converts BCD data n points
BKBINP
ECON3Page 295
ECONP
EDCON3Page 296
EDCONP
DNEGD
ENEGD
ENEGPD
EDNEGD
EDNEGP D
ECONPS D
Real number data
(D+3, D+2, D+1, D)(D+3, D+2, D+1, D)
4Page 291
from (S) to BCD data and stores the
result from (D) onward.
4Page 293
from (S) to BIN data and stores the
result from (D) onward.
42
2 INSTRUCTION TABLES
2.4 Basic Instructions
*1 The number of basic steps is two for the Universal model QCPU and LCPU.
*2 The subset is effective only with Universal model QCPU and LCPU.
*3 For the High-speed Universal model QCPU, the number of basic steps is two.
2
2 INSTRUCTION TABLES
2.4 Basic Instructions
43
Data transfer instruction
MOVSD
MOVPSD
DMOVSD
DMOVPSD
EMOVSD
(S+1, S)(D+1, D)
Real number data
EMOVPSD
E
DMOVS D
(S+3, S+2, S+1, S) (D+3, D+2, D+1, D)
Real number data
EDMOVP S D
$
MOV
SD
$MOVPSD
CMLSD
CMLPSD
DCMLSD
DCMLPSD
n
(S)
(D)
FMOVPnSD
XCH
D1
D2
XCHP
D1
D2
DXCH
D1
D2
DXCHP
D1
D2
BXCHnSD
n
(S)
(D)
CategoryInstruction
symbol
16-bit data
transfer
32-bit data
transfer
Floating
decimal
point data
transfer
(single
precision)
Floating
decimal
point data
transfer
(double
precision)
Character
string data
transfer
MOV• (S)(D)
MOVP
DMOV• (S+1, S)(D+1, D)
DMOVP
EMOV
EMOVP
EDMOV2●
EDMOVP
$MOV• Transfers character string
$MOVP
SymbolProcessing detailsExecution
condition
designated by (S) to device
designated by (D) onward.
Number
Subset Reference
of basic
steps
*1
*2
*2
3Page 302
●Page 297
●
*3
●
Page 299
*3
Page 301
16-bit data
negation
transfer
32-bit data
negation
transfer
Block
transfer
Identical
16-bit data
block
transfers
Identical
32-bit data
block
transfers
16-bit data
exchange
32-bit data
exchange
CML• (S)
CMLP
DCML• (S+1, S)
DCMLP
BMOV4●Page 307
BMOVP
FMOV4●Page 310
FMOVP
DFMOV4●Page 312
DFMOVP
XCH• (D1)(D2)3●Page 314
XCHP
DXCH• (D1+1, D1)(D2+1, D2)3●
DXCHP
BMOVnSD
BMOVPnSD
FMOVnSD
DFMOVnSD
DFMOVPnSD
(D)
(S)
(S+1,S)
(D+1, D)
(D)
n
(D+1,D)
n
*1
*2
●Page 304
●
Block data
exchange
2 INSTRUCTION TABLES
44
2.4 Basic Instructions
BXCH4Page 316
BXCHP
BXCHPnSD
CategoryInstruction
b0b15b8 b7
......
b0b15b8 b7
......
(D)
(D)
8 bits8 bits
8 bits8 bits
n2 Dn1Sn3SMOV
n2 Dn1Sn3SMOVP
symbol
Exchange
of upper
and lower
bytes
SWAP3Page 318
SWAPP
SymbolProcessing detailsExecution
condition
SWAPD
SWAPPD
Number
of basic
steps
Subset Reference
2
ShiftSMOV6Page 319
SMOVP
4th digit 3rd digit 2nd digit 1st digit
*1 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
Remark
steps
QCPU, LCPU• 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
indexing.
• Constant: No limitations
Devices other than above3The number of steps may increase
2
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
*2 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
Remark
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPU• Word device: Internal device (except for file register
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above3The number of steps may increase
ZR)
• Bit device: Devices whose device Nos. are multiples of
16, whose digit designation is K8, and which use no
indexing.
• Constant: No limitations
(The number of steps is 3 when the above device +
constant are used.)
Devices other than above3The number of steps may increase
All devices that can be used2
3
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
2
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
*3 The subset is effective only with Universal model QCPU and LCPU.
2 INSTRUCTION TABLES
2.4 Basic Instructions
45
Program branch instructions
JMPPn
GOEND
DI
EI
IMASKS
IRET
RFSnS
RFSPnS
CategoryInstruction
SymbolProcessing detailsExecution
symbol
JumpCJ• Jumps to Pn when input
SCJ• Jumps to Pn from the scan
JMP• Jumps unconditionally to Pn.2●
GOEND• Jumps to END instruction
CJPn
SCJPn
conditions are met.
after the meeting of input
condition.
when input condition is met.
Program execution control instructions
CategoryInstruction
symbol
Disable
interrupts
Enable
interrupts
Interrupt
disable/
enable
setting
ReturnIRET• Returns to sequence
DI• Prohibits the running of an
EI• Resets interrupt program
IMASK• Inhibits or permits interrupts
SymbolProcessing detailsExecution
interrupt program.
execution prohibition.
for each interrupt program.
program from an interrupt
program.
condition
condition
Number
Subset Reference
of basic
steps
2●Page 321
2●
1Page 324
Number
Subset Reference
of basic
steps
1Page 325
1
2
1Page 331
I/O refresh instructions
CategoryInstruction
symbol
I/O Refresh RFS• Refreshes the relevant I/O
RFSP
SymbolProcessing detailsExecution
area during scan.
condition
Number
Subset Reference
of basic
steps
3Page 332
46
2 INSTRUCTION TABLES
2.4 Basic Instructions
Other convenient instructions
UDCNT1nSD
UDCNT2nSD
12 45 43 10-1032
(S)+1
(S)+0
Present
Cn
value
Cn
contact
STMRnSD
ROTCn2n1SD
SPDnSD
PLSYn1 n2 D
PWMn1 n2 D
CategoryInstruction
SymbolProcessing detailsExecution
symbol
Up/Down
counter
Teaching
timer
Special
timer
Shortest
direction
control
Ramp
signal
Pulse
density
Fixed cycle
pulse
output
Pulse width
modulation
Matrix input MTR• Reads data of 16 points n
UDCNT14Page 334
(S)+0
(S)+1
Present
Cn
value
Cn
contact
Up
1 2 3 4 6 7 6 5 3 2 1 0 -1 -2 -3 -2 -1 0045
Down
UDCNT24Page 336
TTMR3Page 338
TTMRnD
(Time that TTMR is ON)
n
n=0:1, n=1:10, n=2:100
STMRThe 4 points from the bit device
designated by (D) operate as
shown below, depending on the
ON/OFF status of the input
conditions for the STMR
instruction:
• (D)+0: Off delay timer output
• (D)+1: One shot after off timer
output
• (D)+2: One shot after on timer
output
• (D)+3: On delay and off delay
timer output
ROTC• Rotates a rotary table with n1
divisions from the stop position
to the position designated by
(S+1) in the shortest direction.
RAMP• Changes device data
RAMPD1 n3n1 n2D2
designated by D1 from n1 to n2
in n3 scans.
SPD• Counts the pulse input from the
device designated by (S) for
the duration of time designated
by n, and stores the count in
the device designated by (D).
PLSY• Outputs a pulse at a frequency
designated by n1 the number
of times designated by n2, to
the output number (Y)
designated by (D).
PWM• Outputs the pulse of the cycle
set by n2, for the amount of
time ON designated by n1, to
the output number (Y)
designated by (D).
MTRD2 nD1S
rows from the devices starting
from the one specified by (S),
and stores them to the devices
starting from the one specified
by (D2).
Up
(D)
condition
Number
Subset Reference
of basic
steps
3Page 340
5Page 343
6Page 345
4Page 347
4Page 349
4Page 351
5Page 353
2
2 INSTRUCTION TABLES
2.4 Basic Instructions
47
2.5Application Instructions
WANDP S1 S2 D
DANDPSD
WORS1 S2 D
BKORPnS1 S2 D
Logical operation instructions
CategoryInstruction
symbol
Logical
product
Logical
sum
WAND• (D)(S)(D)3●Page 356
WANDP
WAND• (S1)(S2)(D)4
WANDP
DAND• (D+1, D)(S+1, S)(D+1, D)
DANDP
DAND• (S1+1, S1)(S2+1, S2)(D+1,
DANDP
BKAND5Page 361
BKANDP
WOR• (D)(S)(D)3●Page 363
WORP
WOR• (S1)(S2)(D)4
SymbolProcessing detailsExecution
condition
WANDSD
WANDPSD
WANDS1 S2 D
DANDSD
DANDS1 S2 D
D)
DANDPS1 S2 D
BKANDnS1 S2 D
(S1)(S2)(D)
n
BKANDPnS1 S2 D
WORSD
WORPSD
Number
of basic
steps
*1
*2
*3
*1
Subset Reference
●Page 358
●Page 356
●Page 358
●Page 365
WORP
DOR• (D+1, D)(S+1, S)(D+1, D)
DORP
DOR• (S1+1, S1)(S2+1, S2)(D+1,
DORP
BKOR5Page 367
BKORP
WORPS1 S2 D
DORDS
DORPDS
DORS1 S2 D
DORPS1 S2 D
BKORnS1 S2 D
D)
(S1)(S2)(D)
*2
*3
●Page 363
●Page 365
n
48
2.5 Application Instructions
2 INSTRUCTION TABLES
CategoryInstruction
WXORP S1 S2 D
WXNRDS
(D)
(S)
(D)
WXNRS1 S2 D
(S1)
(S2)
(D)
(D+1,D)
(S+1,S)
(D+1,D)
BKXNRPnS1 S2 D
symbol
SymbolProcessing detailsExecution
condition
Number
of basic
Subset Reference
steps
Exclusive ORWXOR• (D)(S)(D)3●Page 369
WXORSD
NON
exclusive
logical sum
WXORP
WXOR• (S1)(S2)(D)4
WXORP
DXOR• (D+1, D)(S+1, S)(D+1, D)
DXORP
DXOR• (S1+1, S1)(S2+1, S2)(D+1,
DXORP
BKXOR5Page 373
BKXORP
WXNR3●Page 375
WXNRP
WXNR4
WXNRP
DXNR
WXORPSD
WXORS1 S2 D
DXORSD
DXORPSD
DXORS1 S2 D
DXORPS1 S2 D
BKXORnS1 S2 D
BKXORPnS1 S2 D
WXNRPDS
WXNRP S1 S2 D
DXNRDS
D)
(S1)(S2)(D)
*1
*2
*3
●Page 371
●Page 369
●Page 371
n
*1
*2
●Page 377
●Page 375
2
DXNRP
DXNR
DXNRP
BKXNR5Page 379
BKXNRP
DXNRPDS
DXNRS1 S2 D
DXNRPS1 S2 D
BKXNRnS1 S2 D
(S1+1,S1)
(S2+1,S2)
(S1)(S2)(D)
(D+1,D)
n
*3
●Page 377
2 INSTRUCTION TABLES
2.5 Application Instructions
49
*1 The number of basic steps is three for the Universal model QCPU and LCPU.
*2 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPU
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above3The number of steps may increase
All devices that can be used3
5When using a High Performance model
*3 The number of steps may differ, depending on the device or CPU module to be used.
CPU moduleDeviceNumber of
steps
High Performance model QCPU
Process CPU
Redundant CPU
Basic model QCPUAll devices that can be used4
Universal model QCPU
LCPU
• 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
indexing.
• Constant: No limitations
Devices other than above4The number of steps may increase
All devices that can be used3
6When using a High Performance model
Remark
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
Remark
QCPU, Process CPU or Redundant CPU,
the number of steps increases but the
processing speed becomes faster.
depending on the conditions.
Page 118 Conditions for increasing the
number of steps
50
2 INSTRUCTION TABLES
2.5 Application Instructions
Rotation instructions
RORnD
RORPnD
RCRnD
SM700
Right rotation by n bits
(D)b0b15
Carry flag
RCRPnD
ROLnD
ROLPnD
RCLnD
SM700
Left rotation by n bits
(D)b0b15
Carry flag
RCLPnD
DRORnD
b0b31SM700b16
to
b15
to
(D+1)(D)
Right rotation by n bits Carry flag
DRORPnD
DRCRnD
b0b31SM700b16
to
b15
to
(D+1)(D)
Right rotation by n bits Carry flag
DRCRPnD
DROLnD
b0b31SM700b16
to
b15
to
(D+1)(D)
Left rotation by n bitsCarry flag
DROLPnD
DRCLnD
(D+1)(D)
SM700b31 to b16 b15 to b0
Left rotation by n bitsCarry flag
DRCLPnD
CategoryInstruction
symbol
Right
rotation of
16-bit data
Left r otation
of 16-bit
data
Right
rotation of
32-bit data
ROR3
RORP
RCR3
RCRP
ROL3
ROLP
RCL3
RCLP
DROR3
DRORP
SymbolProcessing detailsExecution
condition
(D)b0b15
SM700
Right rotation by n bits Carry flag
SM700
(D)b0b15
Left rotation by n bitsCarry flag
Number
of basic
steps
*1
*1
*1
*1
*1
Subset Reference
●Page 381
●
●Page 384
●
●Page 387
2
DRCR3
DRCRP
Left r otation
of 32-bit
data
DROL3
DROLP
DRCL3
DRCLP
*1 For the High-speed Universal model QCPU, the number of basic steps is four.
*1
*1
*1
●
●Page 389
●
2 INSTRUCTION TABLES
2.5 Application Instructions
51
Shift instructions
SFRnD
b15 bnb0
0 to 0
b15
SM700
b0
Carry flag
SFLPnD
BSFRnD
(D)
n
SM700
0
Carry flag
SFTBRDn1n2
SFTBRPD n1 n2
SFTBLDn1n2
(D)
SM700
00
n1
n2
Carry flag
SFTBLP Dn1n2
DSFRnD
(D)
n
0
DSFLnD
(D)
n
0
DSFLPnD
SFTWRDn1n2
(D)
n1
n2
00
SFTWRP Dn1n2
SFTWLDn1n2
(D)
00
n1
n2
SFTWLP Dn1n2
CategoryInstruction
symbol
n-bit shift of
16-bit data
1-bit shift of
n-bit data
n-bit shift of
n-bit data
SFR3
SFRP
SFL3
SFLP
BSFR3Page 394
BSFRP
BSFL3
BSFLP
SFTBR4Page 396
SFTBRP
SFTBL4
SymbolProcessing detailsExecution
condition
bn
b15
b0
Carry flag
SFRPnD
b0 SM700b15
0 to 0
SFLnD
BSFRPnD
BSFLnD
BSFLPnD
Carry flag
SM700
n1
00
n
(D)
0
n2
(D)
Carry flag
SM700
Number
of basic
steps
*1
*1
Subset Reference
●Page 391
●
1-word shift
of n-words
data
n-words
shift of nwords data
SFTBLP
DSFR3●Page 399
DSFRP
DSFL3●
DSFLP
SFTWR4Page 401
SFTWRP
SFTWL4
SFTWLP
DSFRPnD
52
2 INSTRUCTION TABLES
2.5 Application Instructions
CategoryInstruction
SFTRn2SDn1
SFTLn2SDn1
(D)(S)
n1
n2
n2
WSFRPn2SDn1
WSFLn2SDn1
(D)(S)
n1
n2
n2
WSFLPn2SDn1
symbol
Bit shift
right/shift
left
SFTR5Page 404
SFTRP
SFTL5Page 406
SymbolProcessing detailsExecution
condition
n1
n2n2
(D)(S)
SFTRPn2SDn1
Number
of basic
steps
Subset Reference
2
SFTLP
SFTLPn2SDn1
Word shift
right/shift
left
WSFR5Page 408
WSFRn2SDn1
WSFRP
WSFL5Page 408
WSFLP
n1
*1 For the High-speed Universal model QCPU, the number of basic steps is four.
n2n2
(D)(S)
2 INSTRUCTION TABLES
2.5 Application Instructions
53
Bit processing instructions
TESTS1 S2 D
DTESTS1 S2 D
(D)
b0
b31
(S1)
to
Bit designated by (S2)
BKRSTnD
OFF
OFF
OFF
OFF
(D)
Reset
n
ON
OFF
ON
ON
(D)
CategoryInstruction
symbol
Bit set/reset BSET3●Page 412
BSETP
BRST3●
BRSTP
Bit testsTEST4Page 414
TESTP
DTEST4
DTESTP
Batch reset
of bit
devices
BKRST3Page 416
BKRSTP
SymbolProcessing detailsExecution
condition
BSETnD
BSETPnD
BRSTnD
BRSTPnD
TESTPS1 S2 D
DTESTP S1 S2 D
BKRSTPnD
(D)
b15
(D)
b15
(S1)
to
Bit designated by (S2)
b0bn
1
b0bn
0
(D)b0b15
Number
of basic
steps
Subset Reference
54
2 INSTRUCTION TABLES
2.5 Application Instructions
Data processing instructions
(S1)
(S2)
(D): Match No.
(D + 1): nNumber of
matches
DSERnS1 S2 D
(S2)
(D): Match No.
(D + 1):
(S1)
32 bits
n
Number of
matches
DSERPnS1 S2 D
b0
b15
(S)
(D): Number of 1s
SUMPSD
DSUMSD
(S)(S + 1)
(D): Number of 1s
DSUMPSD
(S)
Encode
(D)
n
2 bits
n
Decode from 256 to 8
CategoryInstruction
symbol
SymbolProcessing detailsExecution
condition
Number
of basic
Subset Reference
steps
Data
searches
Bit checksSUM3●Page 421
DecodeDECO4Page 423
EncodeENCO4Page 425
7-segment
decode
SER5Page 418
SERP
DSER5
DSERP
SERnS1 S2 D
SERPnS1 S2 D
SUMSD
SUMP
DSUM3●
DSUMP
Decode from 8 to 256
(S)
Decode
n
(D)
n
bits
2
DECOP
DECOnDS
DECOPnDS
ENCOnDS
ENCOP
SEG3●Page 427
SEGP
ENCOPnDS
SEGSD
SEGPSD
(S)
0to
7SEG
(D)
2
2 INSTRUCTION TABLES
2.5 Application Instructions
55
CategoryInstruction
DISPnSD
UNInSD
UNIPnSD
NDISS1S2D
NDISPS1S2D
NUNIS1S2D
WTOBnSD
MAXnSD
MINnSD
MINPnSD
DMINnSD
DMINPnSD
SymbolProcessing detailsExecution
symbol
Separating
and linking
SearchMAX• Searches the data of n points
DIS• Separates 16-bit data
DISP
UNI• Links the lower 4 bits of n
UNIP
NDIS• Separates the data in the
NDISP
NUNI• Links the data in the devices
NUNIP
WTOB• Breaks n points of 16-bit data
WTOBP
BTOW• Links the lower 8 bits of 16-bit
BTOWP
MAXP
MIN• Searches the data of n points
MINP
DMAX• Searches the data of 2n
DMAXP
DMIN• Searches the data of 2n
DMINP
DISnSD
NUNIPS1S2D
WTOBPnSD
BTOWnSD
BTOWPnSD
MAXPnSD
DMAXnSD
DMAXPnSD
designated by (S) into 4-bit
units, and stores at the lower
4 bits of n points from (D).
(n4)
points from the device
designated by (S) and stores
at the device designated by
(D). (n4)
devices starting from the one
specified by (S1) into bits
specified by the devices from
(S2), and stores them to the
devices starting from the one
specified by (D).
starting from the one
specified by (S1) with bits
specified by the devices from
(S2), and stores them to the
devices starting from the one
specified by (D).
from the device designated by
(S) into 8-bit units, and stores
in sequence at the device
designated by (D).
data of n points from the
device designated by (S) into
16-bit units, and stores in
sequence at the device
designated by (D).
from the device designated by
(S) in 16-bit units, and stores
the maximum value at the
device designated by (D).
from the device designated by
(S) in 16-bit units, and stores
the minimum value at the
device designated by (D).
points from the device
designated by (S) in 32-bit
units, and stores the
maximum value at the device
designated by (D).
points from the device
specified by (S) in 32-bit units,
and stores the minimum value
in the device specified by (D).
condition
Number
Subset Reference
of basic
steps
4Page 429
4Page 431
4Page 433
4Page 437
4Page 440
Page 442
4Page 440
Page 442
56
2 INSTRUCTION TABLES
2.5 Application Instructions
CategoryInstruction
DSORTS1nS2 D1 D2
WSUMnSD
WSUMPnSD
DWSUMnSD
DWSUMPnSD
MEANSDn
CCDPnSD
symbol
SortSORT
DSORT
Tota l v a l u e
calculations
WSUM• Adds 16 bit BIN data of n
WSUMP
SymbolProcessing detailsExecution
condition
SORTS2 D1S1
• S2: Number of comparisons to be
made during a single run
• D1: Device to be turned ON at the
completion of sort
• D2: For system use
• S2: Number of comparisons to be
made during a single run
• D1: Device to be turned ON at the
completion of sort
• D2: For system use
n
• Sorts data of n points from
D2
device designated by (S1) in
16-bit units. (n (n-1)/2 scans
required)
• Sorts data of 2n points from
device designated by (S1) in
32-bit units. (n (n-1)/2 scans
required)
points from the device
specified by (S), and stores it
in the device specified by (D).
Number
Subset Reference
of basic
steps
6Page 444
4Page 448
2
DWSUM• Adds 32 bit BIN data of n
DWSUMP
Calculation
of averages
Check code CCD• Performs addition of the data
MEAN• Calculates the mean of n-
MEANP
DMEAN• Calculates the mean of n-
DMEANP
MEANPSDn
DMEANSDn
DMEANP SDn
CCDnSD
CCDP
CRC
operation
CRC• Generates the CRC value of
CRCnSD
CRCP
CRCPnSD
points from the device
specified by (S), and stores it
in the device specified by (D).
point devices (in 16-bit units)
starting from the device
specified by (S), and then
stores the result into the
device specified by (D).
point devices (in 32-bit units)
starting from the device
specified by (S), and then
stores the result into the
device specified by (D).
stored in the devices
designated by (S) to (S)+n-1
and calculates the horizontal
parity, and stores the added
data in the device designated
by (D) and the horizontal
parity in the device
designated by (D)+1.
n points of 8-bit data starting
from the device designated by
(S) and stores it in the device
designated by (D).
Page 449
4Page 450
4Page 452
4Page 455
2 INSTRUCTION TABLES
2.5 Application Instructions
57
Structure creation instructions
FORn
NEXT
BREAKPnD
BREAKPPnD
CALLPn S1 Sn
CALLPPn S1 Sn
RET
FCALL
Pn
S1
Sn
FCALLP
Pn
Sn
S1
ECALLPn
ECALLP
EFCALL
Pn
EFCALLPPn
EFCALLPPn
S1toSn
:File name
XCALL
Pn
S1 Sn
CategoryInstruction
symbol
Number of
repeats
Subroutine
program
calls
FOR• Executes n times between
NEXT1
BREAK• Forcibly ends the
BREAKP
CALL• Executes subroutine
CALLP
RET• Returns from subroutine
FCALL• Performs non-execution
FCALLP
SymbolProcessing detailsExecution
condition
the [FOR] and [NEXT].
execution of the [FOR] to
[NEXT] cycle and jumps
pointer Pn.
CALLPn
program Pn when input
condition is met. (S1 to Sn
are arguments sent to
subroutine program. n5)
CALLPPn
program
FCALLPn
FCALLP Pn
processing of subroutine
program Pn if input
conditions have not been
met. (S1 to Sn are
arguments sent to
subroutine program. n5)
Number
Subset Reference
of basic
steps
2Page 457
3Page 460
*1
2+n
1Page 467
*1
2+n
*3
●
Page 468
Page 462
Subroutine
program
calls
ECALL• Executes subroutine
ECALL
PnS1 Sn
: File name
ECALLP
program Pn from within
designated program name
when input condition is
met. (S1 to Sn are
arguments sent to
subroutine program. n5)
ECALLPPnS1 Sn
:
File name
EFCALL• Performs non-execution
EFCALLPn
S1toSn
:File name
EFCALLP
XCALL• Executes subroutine
processing of subroutine
program Pn if input
conditions have not been
met. (S1 to Sn are
arguments sent to
subroutine program. n5)
program Pn when input
condition is met.
• Performs non-execution
processing of subroutine
program Pn if input
conditions have not been
met. (S1 to Sn are
arguments sent to
subroutine program. n5)
3+n
3+n
2+n
*2
Page 472
*2
Page 477
*1
Page 481
58
2.5 Application Instructions
2 INSTRUCTION TABLES
CategoryInstruction
CCOM
symbol
Select
refresh
Fixed
indexing
COM• Performs auto refresh of
CCOM• Performs auto refresh of
CCOMP1
IX• Perform indexing for
IXEND1
IXDEV• Stores indexing value used
IXSET3
SymbolProcessing detailsExecution
condition
COM
CCOMP
IX
Device indexing ladder
intelligent function
modules, auto refresh of
link refresh, and
communications with
peripherals.
• Performs auto refresh of
intelligent function
modules, link refresh, auto
refresh of CPU shared
memory, and
communications with
peripherals.
intelligent function
modules, auto refresh of
CPU shared memory, and
communications with
peripherals after the input
conditions are met.
S
individual devices used in
device indexing ladder.
IXEND
IXDEV
IXSETSD
for indexing performed
between the [IX] and
[IXEND] to the device
designated by D or later.
Number
Subset Reference
of basic
steps
1Page 487
1Page 489
1Page 492
2Page 493
1Page 496
2
Designates indexing value.
*1 n indicates number of arguments for subroutine program.
*2 n indicates the total of the number of arguments used in the subroutine program and the number of program name steps.
The number of program name steps is calculated as "number of characters in the program 2" (decimal fraction is rounded up).
*3 The subset is effective only with the Universal model QCPU and LCPU.
2 INSTRUCTION TABLES
2.5 Application Instructions
59
Data table operation instructions
FIFWSD
(S)
Pointer
(D)
Pointer + 1
Device at
pointer + 1
FIFWPSD
FIFRSD
(S)
Pointer
(D)
Pointer - 1
FIFRPSD
FPOPSD
(S)
Pointer
(D)
Pointer - 1
Device at pointer + 1
FPOPPSD
FDELnSD
FDELPnSD
FINSnSD
(S)
Pointer
(D)
Designated by n
Pointer + 1
FINSPnSD
FROMn3n1 n2 D
FROMPn3n1 n2 D
DFROn3n1 n2 D
DFROPn3n1 n2 D
TOn3n1 n2 S
TOPn3n1 n2 S
DTOn3n1 n2 S
DTOPn3n1 n2 S
CategoryInstruction
symbol
Data table
processing
FIFW3Page 498
FIFWP
FIFR3Page 500
FIFRP
FPOP3Page 502
FPOPP
FDEL4Page 504
FDELP
FINS4Page 504
SymbolProcessing detailsExecution
condition
(S)
Pointer
Pointer - 1
(D)
Designated by n
Number
of basic
steps
Subset Reference
FINSP
Buffer memory access instructions
CategoryInstruction
symbol
Data readFROM• Reads data in 16-bit units from an
FROMP
DFRO• Reads data in 32-bit units from an
DFROP
Data writeTO• Writes data in 16-bit units to an
TOP
DTO• Writes data in 32-bit units to an
DTOP
SymbolProcessing detailsExecution
intelligent function module.
intelligent function module.
intelligent function module.
intelligent function module.
condition
Number
Subset Reference
of basic
steps
5Page 506
5
5Page 509
5
60
2 INSTRUCTION TABLES
2.5 Application Instructions
Display instructions
When SM701 is OFF
PRS D
PRCSD
Check condition
CHK
CHKCIR
CategoryInstruction
symbol
SymbolProcessing detailsExecution
condition
Number
of basic
Subset Reference
steps
ASCII printPR• Outputs ASCII code from
PR• Outputs ASCII code of 8
When SM701 is ON
PRS D
PRC• Converts comments from
ResetLEDR• Resets an annunciator.1Page 518
LEDR
device designated by (S) to
00H to output module.
points (16 characters) from
device designated by (S) to
output module.
device designated by (S) to
ASCII code and outputs to
output module.
3Page 512
Page 515
Debugging and failure diagnosis instructions
CategoryInstruction
symbol
ChecksCHKST• The CHK instruction is
CHK• During normal conditions
CHKCIR• Starts update in the ladder
CHKEND• Ends update in the ladder
SymbolProcessing detailsExecution
condition
CHKST
CHKEND
executed when CHKST is
executable.
• Jumps to the step following
the CHK instruction when
CHKST is in a nonexecutable status.
SM80: OFF, SD80: 0
• During abnorm al conditions
SM80: ON, SD80:
Failure No.
pattern being checked by
the CHK instruction.
pattern being checked by
the CHK instruction.
Number
Subset Reference
of basic
steps
1Page 520
1Page 524
2
2 INSTRUCTION TABLES
2.5 Application Instructions
61
Character string processing instructions
BCDDAP SD
DABINSD
DHABINP SD
CategoryInstruction
symbol
BIN
Decimal
ASCII
BIN
Hexadecimal
ASCII
BCD
Decimal
ASCII
Decimal
ASCII BIN
Hexadecimal
ASCII BIN
BINDA• Converts 1-word BIN value
BINDAP
DBINDA• Converts 2-word BIN value
DBINDAP
BINHA• Converts 1-word BIN value
BINHAP
DBINHA• Converts 2-word BIN value
DBINHAP
BCDDA• Converts 1-word BCD value
BCDDAP
DBCDDA• Converts 2-word BCD value
DBCDDAP
DABIN• Converts a 5-digit, decimal
DABINP
DDABIN• Converts a 10-digit, decimal
DDABINP
HABIN• Converts a 4-digit, hexadecimal
HABINP
DHABIN• Converts a 8-digit, hexadecimal
DHABINP
SymbolProcessing detailsExecution
condition
BINDASD
BINDAPSD
DBINDASD
DBINDAP SD
BINHASD
BINHAPDS
DBINHASD
DBINHAP SD
BCDDASD
DBCDDA SD
DBCDDAP SD
DABINPSD
DDABINSD
DDABINP SD
HABINSD
HABINPSD
DHABINSD
designated by (S) to a 5-digit,
decimal ASCII value, and stores
it at the word device designated
by (D).
designated by (S) to a 10-digit,
decimal ASCII value, and stores
it at word devices following the
word device number designated
by (D).
designated by (S) to a 4-digit,
hexadecimal ASCII value, and
stores it at a word device
following the word device
number designated by (D).
designated by (S) to a 8-digit,
hexadecimal ASCII value, and
stores it at a word device
following the word device
number designated by (D).
designated by (S) to a 4-digit,
decimal ASCII value, and stores
it at a word device following the
word device number designated
by (D).
designated by (S) to a 8-digit,
decimal ASCII value, and stores
it at a word device following the
word device number designated
by (D).
ASCII value designated by (S) to
a 1-word BIN value, and stores it
at a word device number
designated by (D).
ASCII value designated by (S) to
a 2-word BIN value, and stores it
at a word device number
designated by (D).
ASCII value designated by (S) to
a 1-word BIN value, and stores it
at a word device number
designated by (D).
ASCII value designated by (S) to
a 2-word BIN value, and stores it
at a word device number
designated by (D).
Number
Subset Reference
of basic
steps
3Page 528
3
3Page 531
3
3Page 534
3
3Page 537
3
3Page 540
3
62
2 INSTRUCTION TABLES
2.5 Application Instructions
CategoryInstruction
COMRDSD
STRS1 S2 D
STRPS1 S2 D
DSTRS1 S2 D
DSTRPS1 S2 D
VALD1 D2S
VALPD1 D2S
DVALD1 D2S
DVALPD1 D2S
ESTRS1 S2 D
ESTRPS1 S2 D
symbol
Decimal
ASCII
BCD
Device
comment
read
operation
DABCD• Converts a 4-digit, decimal
DABCDP
DDABCD• Converts a 8-digit, decimal
DDABCDP
COMRD• Stores comment from device
COMRDP
SymbolProcessing detailsExecution
condition
DABCDSD
DABCDP SD
DDABCD SD
DDABCDP SD
ASCII value designated by (S) to
a 1-word BCD value, and stores
it at a word device number
designated by (D).
ASCII value designated by (S) to
a 2-word BCD value, and stores
it at a word device number
designated by (D).
designated by (S) at a device
designated by (D).
COMRDP SD
Number
Subset Reference
of basic
steps
3Page 543
3
3Page 546
2
Character
string length
detection
BIN
Decimal
character
string
Decimal
character
string BIN
Floating
decimal
point
Character
string
Character
st
r
ing
Floating
decimal
point
LEN• Stores data length (number of
LENP
STR• Converts a 1-word BIN value
STRP
DSTR• Converts a 2-word BIN value
DSTRP
VAL• Converts a character string
VAL P
DVAL• Converts a character string
DVALP
ESTR• Converts the 32-bit floating
ESTRP
EVAL• Converts the character string
EVALP
LENSD
LENPSD
EVALSD
EVALPSD
characters) in character string
designated by (S) at a device
designated by (D).
designated by (S2) to a decimal
character string with the total
number of digits and the number
of decimal fraction digits
designated by (S1) and stores
them at a device designated by
(D).
designated by (S2) to a decimal
character string with the total
number of digits and the number
of decimal fraction digits
designated by (S1) and stores
them at a device designated by
(D).
including decimal point
designated by (S) to a 1-word
BIN value and the number of
decimal fraction digits, and
stores them into devices
designated by (D1) and (D2).
including decimal point
designated by (S) to a 2-word
BIN value and the number of
decimal fraction digits, and
stores them into devices
designated by (D1) and (D2).
decimal point data designated
by (S) to a character string, and
stores it in devices designated
by (D).
designated by (S) to a 32-bit
floating decimal point data, and
stores it in devices designated
by (D).
3Page 549
4Page 551
4
4Page 556
4
4Page 561
3Page 568
2 INSTRUCTION TABLES
2.5 Application Instructions
63
CategoryInstruction
ASCnSD
ASCPnSD
HEXnSD
HEXPnSD
RIGHTnSD
RIGHTPnSD
LEFTnSD
LEFTPnSD
MIDRS1S2D
MIDRPS1S2D
MIDWS1S2D
MIDWPS1S2D
INSTRnS1 S2 D
INSTRPnS1 S2 D
STRINSSDn
EMODS1 S2 D
EMODPS1 S2 D
EREXPS1 S2 D
EREXPP S1 S2 D
symbol
Hexadecimal
BIN ASCII
ASCII
Hexadecimal
BIN
Character
string
ASC• Converts the 1-word BIN value
ASCP
HEX• Converts n hexadecimal ASCII
HEXP
RIGHT• Stores n characters from the end
RIGHTP
SymbolProcessing detailsExecution
condition
at the device numbers
designated by (S) to
hexadecimal ASCII, and stores
n characters of them at the
device numbers designated by
(D) and after.
characters of the device
numbers designated by (S) and
after to BIN values, and stores
them at the device numbers
designated by (D).
of a character string designated
by (S) at the device designated
by (D).
Number
Subset Reference
of basic
steps
4Page 572
4Page 574
4Page 576
Floating
decimal
point BCD
BCD
Floating
decimal
point
LEFT• Stores n characters from the
LEFTP
MIDR• Stores the designated number of
MIDRP
MIDW• Stores the character string of
MIDWP
INSTR• Searches character string (S1)
INSTRP
STRINS• Inserts the character string data
STRINSP
STRDEL• Deletes the (n2) characters data
STRDELP
EMOD• Converts 32-bit floating decimal
EMODP
EREXP• Converts BCD data (S1) to 32-
EREXPP
STRINSP SDn
STRDELDn1n2
STRDELP Dn1n2
beginning of a character string
designated by (S) at the device
designated by (D).
characters in the character
string designated by (S1) from
the position designated by (S2)
at the device designated by (D).
(S1) in the specified number to
the character string of (D) at the
position specified by (S2).
from the nth character of
character string (S2), and stores
matched positions at (D).
specified by (S) to the (n)th
character (insert position) from
the initial character string data
specified by (D).
specified by (D) starting from the
device (insert position) specified
by n1.
point data (S1) to BCD data with
number of decimal fraction digits
designated by (S2), and stores
at device designated by (D).
bit floating decimal point data
with the number of decimal
fraction digits designated by
(S2), and stores at device
designated by (D).
conversion data (16-bit data units)
specified by (S2) with the input
value specified by (S1), and then
stores the result into the device
specified by (D). The scaling
conversion is executed based on
the scaling conversion data stored
in the device specified by (S2) and
up.
conversion data (32-bit data units)
specified by (S2) with the input
value specified by (S1), and then
stores the result into the device
specified by (D). The scaling
conversion is executed based on
the scaling conversion data stored
in the device specified by (S2) and
up.
5
4Page 670
4
68
2.5 Application Instructions
2 INSTRUCTION TABLES
CategoryInstruction
RSETS
RSETPS
QDRSET
File name
QDRSETP
File name
QCDSET
File name
QCDSETP
File name
SymbolProcessing detailsExecution
symbol
X or Y
coordinate
data
SCL2• Executes scaling for the scaling
SCL2P
DSCL2• Executes scaling for the scaling
DSCL2P
SCL2S1 S2 D
SCL2PS1 S2 D
DSCL2S1 S2 D
DSCL2P S1 S2 D
Switching instructions
conversion data (16-bit data units)
specified by (S2) with the input
value specified by (S1), and then
stores the result into the device
specified by (D). The scaling
conversion is executed based on
the scaling conversion data stored
in the device specified by (S2) and
up.
conversion data (32-bit data units)
specified by (S2) with the input
value specified by (S1), and then
stores the result into the device
specified by (D). The scaling
conversion is executed based on
the scaling conversion data stored
in the device specified by (S2) and
up.
condition
Number
Subset Reference
of basic
steps
4Page 674
4
2
CategoryInstruction
SymbolProcessing detailsExecution
symbol
Block
number
switching
File setQDRSET• Sets file names used as file
RSET• Converts extension file register
block number to number
RSETP
QDRSETP
QCDSET• Sets file names used as comment
QCDSETP
designated by (S).
registers.
files.
*1 n indicates ([number of file name characters] 2) steps. (Decimal fraction is rounded up.)
condition
Number
Subset Reference
of basic
steps
2Page 677
*1
2+n
2+n
Page 679
*1
Page 681
2 INSTRUCTION TABLES
2.5 Application Instructions
69
Clock instructions
(D)+0
Year
Month
Day
Hour
Sec.
Day of the week
+1
+2
+3
+4
+5
+6
(Clock elements)
Minute
DATEWRP S
DATE+S1 S2 D
DATE+P S1 S2 D
DATE-S1 S2 D
DATE-PS1 S2 D
SECOND SD
(D)
Sec. (Lower 16 bits)
Sec. (Upper 16 bits)
(S)
Hour
Minute
Sec.
SECONDP SD
HOURSD
HOURPSD
CategoryInstruction
symbol
Read/write
clock data
Clock data
addition/
subtraction
Clock data
translation
DATERD2Page 683
DATERDP
DATEWR2Page 685
DATEWRP
DATE+4Page 687
DATE+P
DATE-4Page 689
DATE-P
SECOND3Page 691
SECONDP
SymbolProcessing detailsExecution
condition
DATERD D
DATERDP D
(Clock elements) (D)+0
Year
+1
Month
+2
Day
+3
Hour
+4
Minute
+5
Sec.
+6
Day of the week
DATEWR S
(S2)
(S1)
Hour
Minute MinuteMinute
+
Sec.
(S1)
(S2)
Hour
MinuteMinuteMinute
Sec.
Hour
Sec.
Hour
Sec.
(D)
Hour
Sec.
(D)
Hour
Sec.
Number
of basic
steps
Subset Reference
HOUR3Page 693
HOURP
Hour meterHOURM• While the execution
HOURMD2SD1
DHOURM• While the execution
DHOURMD2SD1
(S)
Sec. (Lower 16 bits)
Sec. (Upper 16 bits)
specification is on, the current
value is stored in increments
of hour in the device
designated by (D1) and the
current value less than an
hour is stored in increments of
second in the device
designated by (D1)+1.
• The device designated by
(D2) turns on when the
cumulative ON time of the
execution command exceeds
the time designated by (S).
specification is on, the current
value is stored in increments
of hour in the devices
designated by (D1), (D1)+1
and the current value less
than an hour is stored in
increments of second in the
device designated by (D1)+2.
• The device designated by
(D2) turns on when the
cumulative ON time of the
execution command exceeds
the time designated by (S).
(D)
Hour
Minute
Sec.
4Page 695
4Page 696
70
2 INSTRUCTION TABLES
2.5 Application Instructions
CategoryInstruction
S1 S2DTn
S1 S2
DTn
DTS1 S2
n
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
YearYear
Day
Month
Day
Month
Comparison
operation
result
DTS1 S2
n
S1 S2
nDT
S1 S2DTn
S1 S2
nDT
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
YearYear
Day
Month
Day
Month
Comparison
operation
result
DTS1 S2 n
S1 S2
nDT
DTS1 S2 n
DT
S1 S2
n
DTS1 S2 n
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
YearYear
Day
Month
Day
Month
Comparison
operation
result
S1 S2DTn
S1 S2
DTn
symbol
Date
comparison
LDDT=4Page 697
ANDDT=
ORDT=
LDDT<>4
ANDDT<>
ORDT<>
SymbolProcessing detailsExecution
condition
YearYear
DTS1 S2 n
S1
S1
S1
S2
Month
S2
+1
Day
S2
+2
Comparison
operation
Month
+1
result
Day
+2
Number
of basic
steps
Subset Reference
2
LDDT<4
S1 S2 nDT
ANDDT<
YearYear
S1
Month
S1
+1
Day
S1
+2
S2
S2
S2
Comparison
operation
Month
+1
result
Day
+2
ORDT<
LDDT<=4
DTS1 S2 n
ANDDT<=
ORDT<=
LDDT>4
DTS1 S2 n
ANDDT>
YearYear
S1
Month
S1
+1
Day
S1
+2
S2
S2
S2
Comparison
operation
Month
+1
result
Day
+2
ORDT>
LDDT>=4
ANDDT>=
ORDT>=
2 INSTRUCTION TABLES
2.5 Application Instructions
71
CategoryInstruction
+2
S1
S1
S1
+1
Hour
Second
Minute
Hour
Second
Minute
+2
S2
S2
S2
+1
Comparison
operation
result
S1 S2TMn
S1 S2
TMn
TMS1 S2
n
TMS1 S2
n
S1 S2
nTM
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
Comparison
operation
result
HourHour
Second
Minute
Second
Minute
S1 S2TMn
S1 S2
nTM
TMS1 S2 n
S1 S2
nTM
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
Comparison
operation
result
HourHour
Second
Minute
Second
Minute
TMS1 S2 n
TM
S1 S2
n
TMS1 S2 n
+2
S1
S1
S1
+1
+2
S2
S2
S2
+1
Comparison
operation
result
HourHour
Second
Minute
Second
Minute
S1 S2TMn
S1 S2
TMn
DS3S2TCMPS1S4
DS3S2TCMPPS1S4
symbol
Clock
comparison
LDTM=4Page 701
ANDTM=
ORTM=
SymbolProcessing detailsExecution
condition
TMS1 S2 n
Number
of basic
steps
Subset Reference
LDTM<>4
ANDTM<>
HourHour
S1
Minute
S1
+1
Second
S1
+2
S2
S2
S2
+1
+2
Minute
Second
Comparison
operation
result
ORTM<>
LDTM<4
S1 S2 nTM
ANDTM<
ORTM<
LDTM<=4
TMS1 S2 n
ANDTM<=
HourHour
S1
Minute
S1
+1
Second
S1
+2
S2
S2
S2
+1
+2
Minute
Second
Comparison
operation
result
ORTM<=
LDTM>4
TMS1 S2 n
ANDTM>
Clock data
comparison
ORTM>
LDTM>=4
ANDTM>=
ORTM>=
TCMP6Page 705
TCMPP
Hour
S1
min.
S2
Sec.
S3S4
Hour
S1
min.
S2
Sec.
S3
Hour
S1
min.
S2
Sec.
S3
Hour
S4
min.
Sec.
Hour
min.
Sec.
Hour
min.
Sec.
turns on.
D
D
+2 turns on.
D
S4
+1
+2
S4
S4
+1+1 turns on.
S4
+2
S4
+1
S4
+2
S4
72
2 INSTRUCTION TABLES
2.5 Application Instructions
CategoryInstruction
S3
S3
S3
+2
S2
S2
S2
+1
S1
S1
S1
+2
S3
S3
S3
+1
+2
S2
S2
S2
+1
+1
S1
S1
S1
+2
S3
S3
D
S3
+1
+2
+1
+2
+1
+2
+1
turns on.
D
+2 turns on.
D
Hour
Sec.
min.
Hour
Sec.
min.
Hour
Sec.
min.
Hour
Sec.
min.
Hour
Sec.
min.
Hour
Sec.
min.
Hour
Sec.
min.
turns on.
TZCPPDS1 S2 S3
(Clock elements)
(D)+0
Year
Month
Day
Hour
Sec.
Day of the week
+1
+2
+3
+4
+5
+6
1/1000 sec.
+7
Minute
S.DATE+ S1 S2 D
SP.DATE+ S1 S2 D
S.DATES1 S2 D
SP.DATE S1 S2 D
SymbolProcessing detailsExecution
symbol
Clock data
band
comparison
TZCP5Page 707
TZCPDS1 S2 S3
TZCPP
Expansion clock instructions
condition
Number
of basic
steps
Subset Reference
2
CategoryInstruction
symbol
Reading
data of the
expansion
clock
Adding or
subtracting
data values
of the
expansion
clock
S.DATERD6Page 709
SP.DATERD
S.DATE+8Page 712
SP.DATE+
S.DATE-8
SP.DATE-
SymbolProcessing detailsExecution
condition
S.DATERD D
SP.DATERD D
(S1)
Hour
MinuteMinuteMinute
Sec.
1/1000 sec.
(S1)
Hour
Minute
Sec.
1/1000 sec.
(S2)(D)
Hour
+
Sec.
1/1000 sec.
(S2)(D)
Hour
MinuteMinute
Sec.
1/1000 sec.
Hour
Sec.
1/1000 sec.
Hour
Sec.
1/1000 sec.
Number
of basic
steps
Subset Reference
2 INSTRUCTION TABLES
2.5 Application Instructions
73
Program control instructions
PSTOP
File name
PSTOPP
File name
POFF
File name
POFFP
File name
PSCAN
File name
PSCANP
File name
PLOW
File name
PLOWP
File name
PCHK
File name
PCHK
File name
PIDDS1 S2 S3
CategoryInstruction
symbol
Program
control
instructions
PSTOP• Places designated program in
PSTOPP
POFF• Turns OUT instruction coil of
POFFP
PSCAN• Registers designated program
PSCANP
PLOW• Registers designated program
PLOWP
LDPCHK• In conduction when program of
ANDPCHK
ORPCHK
SymbolProcessing detailsExecution
condition
standby status.
designated program OFF, and
places program in standby
status.
as scan execution type.
as low-speed execution type.
PCHK
File name
specified file name is being
executed.
• In non-conduction when
program of specified file name
is not executed.
Number
of basic
steps
*1
2+n
*1
2+n
*1
2+n
*1
2+n
*1
2+n
Subset Reference
Page 719
Page 720
Page 722
Page 724
Page 725
*1 n indicates ([number of file name characters] 2) steps. (Decimal fraction is rounded up.)
PID instruction
CategoryInstruction
symbol
PID
operation
PID• Performs PID operation based
SymbolProcessing detailsExecution
on the value set in the devices
designated by (S1), (S2), and
(S3) and stores the operation
result every sampling time in
the device designated by (D).
condition
Number
Subset Reference
of basic
steps
5Page 729
74
2.5 Application Instructions
2 INSTRUCTION TABLES
Other instructions
DUTYn1 n2 D
TIMCHK S1 S2 D
Lower 8 bits
(D)
Upper 8 bits
Lower 8 bits
Upper 8 bits
8 bits
0
1
2
3
n
ZR0
ZR1
ZRRDBP nD
ZRWRBn S
Lower 8 bits
(S)
Upper 8 bits
Lower 8 bits
Upper 8 bits
8 bits
0
1
2
3
n
ZR0
ZR1
ADRSETDS
(S)(D)
Indirect address of
designated device
Device name
KEYD1 D2nS
ZPUSHP D
ZPOPD
ZPOPPD
UNIRD n1n2D
TRACE
TRACER
CategoryInstruction
SymbolProcessing detailsExecution
symbol
WDT resetWDT• Resets watchdog timer during
WDTP
Timing
clock
Time check TIMCHK• Turns ON device specified by (D)
Direct read/
write
operations
in 1-byte
units
DUTY4Page 754
ZRRDB3Page 757
ZRRDBP
ZRWRB3Page 759
ZRWRBP
WDT
WDTP
ZRRDBnD
ZRWRBP n S
sequence program.
(D)
n1 scans
SM420 to SM424, SM430 to SM434
if measured ON time of input
condition is longer than preset
time continuously.
n2 scans
condition
Number
Subset Reference
of basic
steps
1Page 752
4Page 756
2
ADRSET3Page 761
ADRSETP
Numerical
key input
from
keyboard
Batch save
of index
register
Batch
recovery of
index
register
Reading
module
information
Module
model
name read
Trace setTRACE• Stores the trace data set with
Trace resetTRACER• Resets the data set the TRACE
KEY• Takes in ASCII data for 8 points of
ZPUSH• Saves the contents of index
ZPUSHP
ZPOP• Reads the data stored in the
ZPOPP
UNIRD• Reads the module information
UNIRDP
TYPERD• Reads the module model name of
TYPERDP
ADRSETP SD
ZPUSHD
UNIRDP n1n2D
TYPERDDn
TYPERDPDn
input unit designated by (S),
converts to hexadecimal value
following device number
designated by (D1), and stores.
registers to a location starting
from the device designated by (D).
location starting from the device
designated by (D) to index
registers.
stored in the area starting from the
I/O No. designated by (n1) by the
points designated by (n2), and
stores it in the area starting from
the device designated by (D).
the head I/O No. designated by (n)
and stores it in the area starting
from the device designated by (D).
peripheral device by the number
of times set when SM800, SM801
and SM802 turn on, to the
sampling trace file.
instruction.
5Page 762
2Page 766
4Page 769
3Page 773
1Page 777
1
2 INSTRUCTION TABLES
2.5 Application Instructions
75
CategoryInstruction
SP.FWRITES1 S2S0 D0D1U0
SP.FREADS1 S2S0 D0D1U0
SSP.DEVST n1Dn2
SP.DEVLDn1n2D
PUNLOADP SD
PSWAPP S1 S2 D
RBMOV SnD
RBMOVP
SnD
UMSGS
symbol
Writing data
to the
designated
file
Reading
data from
designated
file
Writing data
to standard
ROM
Reading
data from
standard
ROM
Loading
program
from
memory
Unloading
program
from
program
memory
Loading +
Unload
High-speed
block
transfer of
file register
SP.FWRITE• Writes data to the designated file.11Page 779
SP.FREAD• Reads data from the designated
SP.DEVST• Writes data to the device data
S.DEVLD• Reads data from the device data
SP.DEVLD
PLOADP• Transfers the program stored in a
PUNLOADP• Deletes the standby program
PSWAPP• Deletes standby program stored in
RBMOV• Transfers n points of 16-bit data
RBMOVP
SymbolProcessing detailsExecution
condition
file.
storage file in the standard ROM.
S.DEVLDn1 n2D
PLOADP SD
storage file in the standard ROM.
memory card or standard memory
(other than drive 0) to drive 0 and
places the program in standby
status.
stored in standard memory (drive
0).
standard memory (drive 0)
designated by (S1). Then,
transfers the program stored in a
memory card or standard memory
(other than drive 0) designated by
(S2) to drive 0 and places it in
standby status.
from the device designated by (S)
to the devices of n points starting
from the one designated by (D).
Number
Subset Reference
of basic
steps
11Page 789
9Page 801
8Page 803
3Page 805
3Page 808
4Page 810
4Page 812
User
message
UMSG• Displays the specified character
strings on the display unit as a
user message.
2Page 817
76
2 INSTRUCTION TABLES
2.5 Application Instructions
2.6Instructions for Data Link
S.ZCOM Jn
SP.ZCOM Jn
S.ZCOM Un
SP.ZCOM Un
D1n2S2S1SP.REFDVWRB n1
D2n2D1S1SP.REFDVRDW n1
Instructions for network refresh
CategoryInstruction
symbol
SymbolProcessing detailsExecution
condition
Number
of basic
steps
Link
instruction:
Network
refresh
S.ZCOM• Refreshes the designated
network.
SP.ZCOM
S.ZCOM
SP.ZCOM
5Page 820
Instructions for reading/writing routing information
CategoryInstruction
symbol
Reading
routing
information
Registering
routing
information
S.RTREAD• Reads data set at routing
SP.RTREAD
S.RTWRITE• Writes routing information to
SP.RTWRIT
E
SymbolProcessing detailsExecution
condition
DnS.RTREAD
parameters.
DnSP.RTREAD
SnS.RTWRITE
the area designated by
routing parameters.
SnSP.RTWRITE
Number
of basic
steps
7Page 825
8Page 827
Subset Reference
Subset Reference
2
Refresh device write/read instruction
CategoryInstruction
symbol
Refresh
device write
instruction
Refresh
device read
instruction
S.REFDVW
RB
SP.REFDVW
RB
S.REFDVW
RW
SP.REFDVW
RW
S.REFDVRD
B
SP.REFDVR
DB
S.REFDVRD
W
SP.REFDVR
DW
SymbolProcessing detailsExecution
• Writes data in 1-bit units to
D1n2S2S1S.REFDVWRB n1
the specified refresh device.
• Writes data in 16-bit units to
D1n2S2S1S.REFDVWRW n1
the specified refresh device.
D1n2S2S1SP.REFDVWRW n1
• Reads data in 1-bit units
D2n2D1S1S.REFDVRDBn1
from the specified refresh
n2D1S1SP.REFDVRDB n1D2
device.
• Reads data in 16-bit units
D2n2D1S1S.REFDVRDW n1
from the specified refresh
device.
condition
Number
Subset Reference
of basic
steps
11Page 829
11Page 833
11Page 838
11Page 842
2 INSTRUCTION TABLES
2.6 Instructions for Data Link
77
2.7Multiple CPU Dedicated Instruction
Dn4n3n2S.TOn1
D
n4n3n2SP.TO
n1
n3n2
TO
n1
S
n3n2
TOP
n1
S
n3n2
DTO
n1
S
n3n2
DTOP
n1
S
n3Dn2n1FROM
n3Dn2n1FROMP
n3Dn2n1DFRO
n3Dn2n1DFROP
Instructions for writing to the CPU shared memory of host CPU
CategoryInstruction
symbol
Write to
host CPU
shared
memory
S.TO• Writes device data of the host
SP.TO
TO• Writes device data of the host
TOP
DTO• Writes device data of the host
DTOP
SymbolProcessing detailsExecution
condition
station to the host CPU shared
memory.
station to the host CPU shared
memory.
station to the host CPU shared
memory in 32-bit units.
Number
of basic
steps
5Page 848
5Page 851
5
Subset Reference
Instructions for reading from the CPU shared memory of another
CPU
CategoryInstruction
symbol
Read from
other CPU
shared
memory
FROM• Reads device data from the
FROMP
SymbolProcessing detailsExecution
condition
other CPU shared memories,
and stores the data in the host
station.
Number
of basic
steps
5Page 856
Subset Reference
DFRO• Reads device data from the
DFROP
other CPU shared memories in
32-bit units, and stores the
data in the host station.
5
78
2 INSTRUCTION TABLES
2.7 Multiple CPU Dedicated Instruction
2.8Multiple CPU High-speed Transmission Dedicated
D2D1S2S1D.DDWR n
Instruction
Instructions for multiple CPU high-speed transmission
CategoryInstruction
symbol
Writing
devices to
another
CPU
Reading
devices
from
another
CPU
D.DDWR• In multiple CPU system, data
DP.DDWR10
D.DDRD• In multiple CPU system, data
DP.DDRD10
SymbolProcessing detailsExecution
condition
stored in a device specified by
host CPU ((S2)) or later is
DP.DDWR
DP.DDRD
n
n
D2D1S2S1
D2D1S2S1D.DDRD n
D2D1S2S1
stored by the number of write
points specified by ((S1)+1) into
a device specified by another
CPU (n) ((D1)) or later
stored in a device specified by
another CPU (n) ((D1)) or later
is stored by the number of read
points specified by ((S1)+1) into
a device specified by host CPU
((S2)) or late
Number
of basic
steps
10Page 872
10Page 876
Subset Reference
2.9Redundant System Instructions (For Redundant
CPU)
Instructions for redundant system (for Redundant CPU)
2
CategoryInstruction
symbol
System
switching
SP.CONTS
W
SymbolProcessing detailsExecution
condition
SP.CONTSW SD
• Switches between the control
system and standby system at
the END processing of the scan
executed with the SP.CONTSW
instruction.
Number
of basic
steps
8Page 880
Subset Reference
2 INSTRUCTION TABLES
2.8 Multiple CPU High-speed Transmission Dedicated Instruction
79
3CONFIGURATION OF INSTRUCTIONS
Ex.
Ex.
DS2S1
+
DS
+
Stores only the
operation results.
Stores the data needed for operation
before the actual operation.
n
DSBMOV
Designates the number of transfers
used by a BMOV instruction
3.1Configuration of Instructions
Most CPU module instructions consist of an instruction part and a device part.
Each part is used for the following purpose:
• Instruction part: indicates the function of the instruction.
• Device part: indicates the data that is to be used with the instruction.
The device part consists of source data, destination data, and number of devices.
Source (S)
Source is the data used for operations.
The following source types are available, depending on the designated device:
Typ eDescription
ConstantDesignates a numeric value to be used in the operation. This is set when the program is created, and cannot
Bit devices and word devicesDesignates the device that stores the data to be used in the operation. Data must be stored in the designated
Destination (D)
The destination stores the data after the operation has been conducted. However, some instructions require storing the data
to be used in an operation at the destination prior to the operation execution.
be changed during the execution of the program. Constants should be indexed when used as variable data.
device until the operation is executed. By changing the data stored in a designated device during program
execution, the data to be used in the instruction can be changed.
An addition instruction involving BIN 16-bit data
A device for the data storage must always be set to the destination.
Number of devices and number of transfers (n)
The number of devices and number of transfers designate the numbers of devices and transfers used by instructions involving
multiple devices.
Block transfer instruction
The number of devices or number of transfers can be set between 0 and 32767.
However, if the number is 0, the instruction will be a no-operation instruction.
80
3 CONFIGURATION OF INSTRUCTIONS
3.1 Configuration of Instructions
3.2Designating Data
(1)
(6)
(2)
(3)
(4)
(5)
Word data
Data that can be handled
by CPU module
Bit data
Numeric data
Character string data
Integer data
Real number
(floating point) data
Single-precision
floating point data
Double-precision
floating point data
Double-word data
The following six types of data can be used with CPU module instructions.
(1) Page 82 Using bit data
(2) Page 83 Using word (16 bits) data
(3) Page 85 Using double word (32 bits) data
(4) Page 87 Single-precision real number data (single-precision floating-point data)
(5) Page 88 Double-precision real number data (double-precision floating-point data)
(6) Page 91 Using character string data
Each bit of a word device can be
used (1=ON, 0=OFF)
D0.5
SETY10
Bit designated for word device
(Turns ON Y10 if bit 5 (b5) of D0 is ON (1).)
X0
SETD0.5
Bit designated for word device
(Bit 5 (b5) of D0 is turned ON if X0 is ON.)
Bit data is data used in one-bit units, such as for contacts or coils.
"Bit devices" and "Bit designated word devices" can be used as bit data.
When using bit devices
Bit devices are designated in one-point units.
Using word devices
Word devices enable the use of a designated bit number 1/0 as bit data by the designation of that bit number.
Word device bit designation is done by designating "[Word device].[Bit No.]". (Designation of bit numbers is done in
hexadecimal.)
For example, bit 5 (b5) of D0 is designated as D0.5, and bit 10 (b10) of D0 is designated as D0.A. However, there can be no
bit designation for timers (T), retentive timers (ST), counters (C) or index register (Z). (Example Z0.0 is not available).
82
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
Using word (16 bits) data
XF
K1 designation
range
(4 points)
K2 designation range
(8 points)
K3 designation range
(12 points)
K4 designation range
(16 points)
XC XBX8 X7
X4
X3X0
to to to
to
X010
MOV K1X0D0
Source (S) data
Word data is 16-bit numeric data used by basic instructions and application instructions.
The following two types of word data can be used with CPU module:
• Decimal constants: K-32768 to K32767
• Hexadecimal constants: H0000 to HFFFF
Word devices and bit devices designated by digit can be used as word data.
For direct access input (DX) and direct access output (DY), word data cannot be designated by digit. (For details of direct
access input and direct access output, refer to the User's Manual (Function Explanation, Program Fundamentals) for the CPU
module used.)
When Using Bit Devices
Bit devices can deal with word data when digits are designated.
Digit designation of bit devices is done by designating "[Number of digits][Head number of bit device]".
Digit designation of bit devices can be done in 4-point (4-bit) units, and designation can be made for K1 to K4.
(For link direct devices, designation is done by "J[Network No.]\[Number of digits][Head number of bit device]". When X100 to
X10F are designated for Network No.2, it is done by J2\K4X100). For example, if X0 is designated for digit designation, the
following points would be designated:
•K1X0 The 4 points X0 to X3 are designated.
•K2X0 The 8 points X0 to X7 are designated.
•K3X0 The 12 points X0 to XB are designated.
•K4X0 The 16 points X0 to XF are designated.
3
In cases where digit designation has been made at the source (S), the numeric values shown in the following table are those
which can be dealt with as source data.
Number of digits designatedWith 16-bit instructions
K1 (4 points)0 to 15
K2 (8 points)0 to 255
K3 (12 points)0 to 4095
K4 (16 points)-32768 to 32767
When destination (D) data is a word device, the word device for the destination becomes 0 following the bit designated by
digit designation at the source.
Ladder exampleProcessing
• With 16-bit instructions
Filled with 0s
b15b4
0 0
D0
0000000000
3 CONFIGURATION OF INSTRUCTIONS
K1X0
X3 X2 X1 X0
X3
X2 X1 X0
3.2 Designating Data
b0
b1b2b3
83
In cases where digit designation is made at the destination (D), the number of points designated are used as the destination.
X010
MOV H1234K2M0
Destination (D)
M15M8
0 0 1 1 0 1 00
M7
M0
Not changed
K2M0
0 0
1 101
00
H1234
00
1
00
1
00
3
4
3
4
12
X10
MOV D0K2M100
Destination (D)
M0
MOV K100D0
Designation of 1 point of word
device D0 (16 bits)
Bit devices below the number of points designated as digits do not change.
Ladder exampleProcessing
• When source (S) data is a numerical value
• When source (S) data is a word device
Using word devices
Word devices are designated in 1-point (16 bits) units.
• When digit designation processing is conducted, a random value can be used for the bit device initial device
number.
• Digit designation cannot be made for the direct access I/O (DX, DY).
b15b8
D0
10011101
M115M108
K2M100
Not changed
b7b0
1 0 0 1 1 1 01
M107
1
0 0
1 1 1
M100
0
1
84
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
Using double word (32 bits) data
X1FX1C X1BX18 X17X14 X13X10 XFXC XBX8 X7X4 X3X0
K1
designation
range
(4 points)
K2 designation
range
(8 points)
K3 designation range
(12 points)
K4 designation range
(16 points)
K5 designation range
(20 points)
K6 designation range
(24 points)
K7 designation range
(28 points)
K8 designation range
(32 points)
Double word data is 32-bit numerical data used by basic instructions and application instructions.
The two types of double word data that can be dealt with by CPU module are as follows:
• Decimal constants: K-2147483648 to K2147483647
• Hexadecimal constants: H00000000 to HFFFFFFFF
Word devices and bit devices designated by digit designation can be used as double word data.
For direct access input (DX) and direct access output (DY), designation of double word data is not possible by digit
designation.
When Using Bit Devices
Digit designation can be used to enable a bit device to deal with double word data.
Digit designation of bit devices is done by designating "[Number of digits][Head number of bit device]".
(For link direct devices, designation is done by "J[Network No.]\[Number of digits][Head number of bit device]". When X100 to
X11F are designated for Network No.2, it is done by J2\K8X100.) Digit designation of bit devices can be done in 4-point (4-bit)
units, and designation can be made for K1 to K8.
For example, if X0 is designated for digit designation, the following points would be designated:
•K1X0 The 4 points X0 to X3 are designated.
•K2X0 The 8 points X0 to X7 are designated.
•K3X0 The 12 points X0 to XB are designated.
•K4X0 The 16 points X0 to XF are designated.
•K5X0 The 20 points X0 to X13 are designated.
•K6X0 The 24 points X0 to X17 are designated.
•K7X0 The 28 points X0 to X1B are designated.
•K8X0 The 32 points X0 to X1F are designated.
3
In cases where digit designation has been made at the source (S), the numeric values shown in the following table are those
which can be dealt with as source data.
Number of digits designatedWith 32-bit instructionsNumber of digits designatedWith 32-bit instructions
K1 (4 points)0 to 15K5 (20 points)0 to 1048575
K2 (8 points)0 to 255K6 (24 points)0 to 16777215
K3 (12 points)0 to 4095K7 (28 points)0 to 268435455
K4 (16 points)0 to 65535K8 (32 points)-2147483648 to 2147483647
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
85
When destination (D) data is a word device, the word device for the destination becomes 0 following the bit designated by
X10
DMOV K1X0D0
Source (S) data
0 0
X3
b0
D0
K1X0
b1
b2b3
0000000000
X2 X1 X0
Filled with 0s
X3
X2 X1
X0
00D100000000000000
Filled with 0s
b31b16
b15b4
X10
DMOV H78123456 K5M0
Destination (D)
1001 1 101
M17
M10
b15b80b7
011 0 1 11
b0
D1
11
0
1
Not changed
1001 1 101
b7b0
D0
10011100
10000011
10011100
b15b8
M25M18
M41M30M29M26
digit designation at the source.
Ladder exampleProcessing
• With 32-bit instructions
In cases where digit designation is made at the destination (D), the number of points designated are used as the destination.
Bit devices below the number of points designated as digits do not change.
Ladder exampleProcessing
• When source (S) data is a numerical value
H78123456
00
0 0
00
11 1
00
1
1
0
1
1
• When source (S) data is a word device
X10
DMOV D0K5M10
Destination (D)
• When digit designation processing is conducted, a random value can be used for the bit device initial device
number.
• Digit designation cannot be made for the direct access I/O (DX, DY).
34
10000011
7
K5M0
M15M8
M31M20
812
M7
Not changed
5
001 00011
10 010100
6
10011100
M19
000
1
M0
M16
Using word devices
A word device designates devices used by the lower 16 bits of data. A 32-bit instruction uses (designation device number)
and (designation device number + 1).
M0
DMOV K100D0
86
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
Designation of 2 points of
word devices D0 and D1 (32 bits)
32-bit data transfer instruction
Using single/double-precision real number data
Designation of 2 points of R100 and R101 (32 bits)
M0
EMOV R100
D0
Designation of 2 points of word devices D0 and D1
(32 bits)
Single-precision floating-point data transfer instruction
b31b30
to
b23 b22b16
to
b15b0
to
b31
Sign
b23 to b30
Exponent
b0 to b22
Mantissa
b23 to b30FFHFEH FDH81807FH 7EH020100
n
Not used
127
126
2
10-1
-125
-126
Not used
Real number data is floating decimal point data used with basic instructions and application instructions.
Only word devices are capable of storing real number data.
Single-precision real number data (single-precision floating-point data)
Instructions which deal with single-precision floating-point data designate devices which are used for the lower 16 bits of data.
Single-precision floating-point data are stored in the 32 bits which make up (designated device number) and (designated
device number + 1).
In a sequence program, floating-point data are designated by E.
Single-precision floating-point data can be represented as follows, using two word devices.
[Sign] 1.[Mantissa] 2
The bit configuration and meaning for the internal representation of single-precision floating-point data are described below:
[Exponent]
3
• Sign: The most significant bit, b31, is the sign bit.
• 0: Positive
•1: Negative
• Exponent: The 8 bits, b23 to b30, represent the excess n of 2
n
. The following shows the excess n according to the binary
values in b23 to b30.
• Mantissa: Each of the 23 bits, b0 to b22, represents the "XXXXXX..." portion when the data is represented in binary,
"1.XXXXXX...".
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
87
Double-precision real number data (double-precision floating-point data)
Designation of 4 points of R100, R101, R102 and
R103 (64 bits)
M0
EDMOV R100
D0
Designation of 4 points of word devices D0, D1, D2
and D3 (64 bits)
Double-precision floating-point data transfer
instruction
b63 b62
to
b52 b51b16tob15b0
to
b63
Sign
b52 to b62
Exponent
b0 to 51
Mantissa
b52 to b627FFH 7FEH 7FDH400H 3FFH 3FEH3FCH02H01H00H
n
Not used
1023 1022
3FD
H
-2-301-1-1021 -1022 Not used
Instructions which deal with double-precision floating-point data designate devices which are used for the lower 16 bits of
data.
Double-precision floating-point data are stored in the 64 bits which make up (designated device number) to (designated
device number + 3).
In a sequence program, floating-point data are designated by E.
Double-precision floating-point data can be represented as follows, using four word devices.
[Sign] 1.[Mantissa] 2
The bit configuration and meaning for the internal representation of double-precision floating-point data are described below:
[Exponent]
• Sign: The most significant bit, b63, is the sign bit.
• 0: Positive
•1: Negative
• Exponent: The 11 bits, b52 to b62, represent the excess n of 2n. The following shows the excess n according to the binary
values in b52 to b62.
• Mantissa: Each of the 52 bits, b0 to b51, represents the "XXXXXX..." portion when the data is represented in binary,
"1.XXXXXX...".
88
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
Precautions
Example 1: When '2147483647' is set for the input value
8th digit '6' is rounded.
The value is handled as '2147484000'.
Example 2: When 'E1.1754943562' is set for the input value
8th digit '3' is rounded.
The value is handled as 'E1.175494'.
Example 1: When '2147483646.12345678' is set for the input value
16th digit '6' is rounded.
The value is handled as '2147483646.12346'.
Example 2: When 'E1.7976931348623157+307' is set for the input value
16th digit '5' is rounded.
The value is handled as 'E1.79769313486232+307'.
Precautions when an input value of a single/double-precision real number is set using a programming tool are shown below.
■Single-precision real number
Because single-precision real number data are processed as the 32-bit single-precision in a programming tool, the number of
significant digits becomes approximately 7. An input value of the single-precision real number data exceeds 7 digits, 8th digit
is rounded. If the value after rounding exceeds the range of -2147483648 to 2147483647, an operation error occurs.
■Double-precision real number
Because double-precision real number data are processed as the 64-bit double-precision in a programming tool, the number
of significant digits becomes approximately 15. An input value of the double-precision real number data exceeds 15 digits,
16th digit is rounded. If the value after rounding exceeds the range of -2147483648 to 2147483647, an operation error occurs.
3
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
89
The CPU module floating decimal point data can be monitored using the monitoring function of a
programming tool.
When floating-point data is used to express 0, all data in the following range are turned to 0.
• Single-precision floating-point data: b0 to b31
• Double-precision floating-point data: b0 to b63
The setting range of floating decimal point data is as follows.
• Single-precision floating-point data: -2
• Double-precision floating-point data: -2
128
< Device data -2
1024
< Device data -2
*1
-126
, 0, 2
-1022
-126
Device data < 2
-1022
, 0, 2
Device data < 2
128
1024
Do not specify -0 in floating-point data (only when the most significant bit of the floating-point real number is
1). (An operation error will occur if floating-point operation is performed with -0.) When -0 is specified, the
following CPU module internally converts the value to 0 to perform a floating-point operation. Therefore an
operation error does not occur.
*2
• The High Performance model QCPU with the internal processing set to "double precision".
(Double
precision is set by default for the floating-point operation processing.)
• Universal model QCPU (QnUDVCPU only)
When -0 is specified, the following CPU module performs a floating-point operation with -0, keeping its
processing speed. Therefore an operation error occurs.
• Basic model QCPU
• High Performance model QCPU where internal operation is set to single precision
*3
*2
• Process CPU
• Redundant CPU
• Universal model QCPU (QnUDVCPU is excluded)
•LCPU
*1 For operations when a real number is out of range and operations when an invalid value is input, refer to the QnUCPU User's Manual
(Function Explanation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program
Fundamentals).
*2 Switch between single precision and double precision of the internal operation of floating-point operation in the PLC system of the PLC
parameter dialog box. For the single precision and double precision of floating-point operation, refer to the QnUCPU User's Manual
(Function Explanation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program
Fundamentals).
*3 The Basic model QCPU can perform floating-point operation if its first five digits of serial No. are "04122 or later".
90
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
Using character string data
Designation of NULL code (00H)
M0
$MOV
" "
D0
Character string data transfer instruction
D0
NULL
Designation of a character string
composed of even numbers
M0
$MOV
"ABCD"
D0
D0
Character string data transfer instruction
42
H
44H
41H
43H
NULL
D1
D2
Designation of a character string
composed of odd numbers
M0
$MOV
"ABCDE"
D0
D0
Character string data transfer instruction
42
H
44H
41H
43H
NULL
D1
D2
45H
Character string data is character data used by basic instructions and application instructions.
The target ranges from the designated character to the NULL code (00H) that indicates the end of the character string.
When designated character is the NULL code
One word is used to store the NULL code.
When character string is even
Uses (number of characters/2 + 1) words, and stores character string and NULL code.
For example, if "ABCD" is transferred to D0, the character string ABCD is stored at D0 and D1, and the NULL code is stored
at D2. (The NULL code is stored as the last one word.)
3
When number of characters is odd
Uses (number of characters/2) words (rounds up decimal fractions) and stores the character string and NULL code.
For example, if "ABCDE" is transferred to devices starting from D0, the character string (ABCDE) and the NULL code are
stored from D0 to D2. (The NULL code is stored into the upper 8 bits of the last one word.)
3 CONFIGURATION OF INSTRUCTIONS
3.2 Designating Data
91
3.3Indexing
X0
MOV
K
Z0
X0
MOV D10Z0
D0
Indexing
Stores -1 at Z0.
Stores the data of D10Z0=
D{10+(-1)} = D9 at D0.
1
Overview of indexing
Indexing is an indirect setting made by using an index register.
When an Indexing is used in a sequence program, the device to be used will become the device number specified directly
plus the contents of the index register.
For example, if D2Z2 has been specified, the specified device is calculated as follows: D(2+3) = D5 and the content of Z2 is 3
become the specified device.
Indexing with 32-bit index registers in addition to 16-bit index registers is available with the Universal model QCPU and LCPU.
Indexing with 16-bit index registers
■Example of indexing
Each index register can be set between -32768 and 32767.
Indexing is performed in the way shown below:
*1 For the specifications of index registers, refer to the User's Manual (Function Explanation, Program Fundamentals) for the CPU module
used.
*1
92
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
■Device that indexing can be used
T0Z0
T1Z1
K100
C0Z1
C1Z0
K100
SM400
Present value of timer
X0
Value set for timer
T0
K100
T0Z4K4Y30
BCD
SM400
Present value of counter
X1
Value set for counter
C100
K10
C100Z6K2Y40
BCD
With the exception of the restrictions noted below, indexing can be used with devices used with contacts, coils, basic
instructions, and application instructions.
• Devices to which indexing cannot be used
DeviceDescription
EFloating decimal point data
$Character string data
.Word device bit designation
FX, FY, FDFunction devices
PPointers used as labels
IInterrupt pointers used as labels
ZIndex register
SStep relay
TRSFC transfer devices
BLSFC block device
*1 SFC transfer devices and SFC block devices are devices for SFC use.
Refer to the manual below for how to use these devices.
MELSEC-Q/L/QnA Programming Manual (SFC)
*2 For the High-speed Universal model QCPU, the SFC block device (BL) and step relay (S) can be modified using indices within the
following range.
• For the SFC block device (BL), the range is BL0 to BL319.
• For the step relay (S), the range is specified in the device settings using parameters.
Note that if a step relay (S) in the SFC block is specified, index modification can be specified within the range of S0 to S511.
• Devices with limits for use with index registers
DeviceDescriptionApplication example
T, ST• Only Z0 and Z1 can be used for timer contacts and coils.
*3
*2
*1
*1*2
3
C• Only Z0 and Z1 can be used for counter contacts and coils.
*3 Universal model high speed type QCPU is excluded.
For timer and counter present values, there are no limits on index register numbers used.
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
93
■A case where indexing has been performed, and the actual process device (Z0 =20, Z1 = -5)
Description
Hexadecimal number
X1
MOV D20
K3Y12A
D
0Z0
K3Y12FZ1
D (0 + 20) = D20
K3Y(12F - 5) = K3Y12A
Ladder exampleActual process device
X0
X1
X0
X1
MOV K20Z0
MOV K 5Z1
MOV K2X50Z0 K1M38Z1
MOV K20Z0
MOV KZ1
MOV D0Z0 K3Y12FZ1
5
X1
Description
K2X50Z0
K1M38Z1
MOV K2X64
K2X(50 + 14) = K2X64
Converts K20 into a hexadecimal number.
K1M(38 - 5) = K1M33
K1M33
94
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
Indexing with 32-bit index registers
MOV
ZR10Z0
D0
Indexing
DMOV
X0
X0
K40000Z0
Stores 40000 at Z0.
Stores the data of ZR10Z0=
ZR{10+40000}=ZR40010 at D0.
GX Developer 8.68R or earlier
GX Developer 8.68W or later
A method of specifying index registers in indexing with 32-bit can be selected from the following two methods.
• Specifying the index registers' range used for indexing with 32-bit.
• Specifying the 32-bit indexing using "ZZ" specification.
*1 The methods applies only to Universal model QCPU (excluding Q00UJCPU) and LCPU.
32-bit indexing with the "ZZ" specification is only available for the following CPU modules. See the
programming tool operating manual for the available programming tools.
• The first five digits of the serial No. for QnU(D)(H)CPU is "10042" or higher (excluding Q00UJCPU).
• Built-in Ethernet port QCPU
•LCPU
*1
■Example of specifying the range of index registers for use of 32-bit indexing
Each index register can be set between -2147483648 and 2147483647.
An example of indexing is shown below.
3
• Specification method
For indexing with a 32-bit index register, specify the head number of an index register to be used on the Device tab of the Q
parameter setting screen.
When the head number of the index register used is changed on the Device tab of the Q parameter setting
screen, do not change the parameters only or do not write only the parameters into the programmable
controller. Be sure to write the parameter into the programmable controller with the program.
When the parameter is forced to be written into the programmable controller, an error of CAN'T EXE. PRG.
occurs. (Error code: 2500)
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
95
• Device that indexing can be used
X0
DMOVK100000Z0
MOV ZR1000Z0 D13000Z2
DMOVK-20Z2
X1
MOVZR101000 D12980
X1
DescriptionZR1000Z0 ZR (1000 + 100000) = ZR101000
D13000Z2 D (13000 - 20) = D12980
Indexing can be used only for the device shown below.
DeviceDescription
ZRSerial number access format file register
DExtended data register (D)
WExtended link register (W)
• Usable range of index registers
The following table shows the usable range of index registers for indexing with 32-bit index registers.
For indexing with 32-bit index registers, the specified index register (Zn) and the next index register of the specified register
(Zn+1) are used. Be sure not to overlap index registers to be used.
Set valueIndex registers to be usedSet valueIndex registers to be used
Z0Z0, Z1Z10Z10, Z11
Z1Z1, Z2Z11Z11, Z12
Z2Z2, Z3Z12Z12, Z13
Z3Z3, Z4Z13Z13, Z14
Z4Z4, Z5Z14Z14, Z15
Z5Z5, Z6Z15Z15, Z16
Z6Z6, Z7Z16Z16, Z17
Z7Z7, Z8Z17Z17, Z18
Z8Z8, Z9Z18Z18, Z19
Z9Z9, Z10Z19Unusable
• A case where Indexing has been performed, and the actual process device (Z0 (32-bit) =100000, Z2 (32-bit) = -20)
Ladder exampleActual process device
96
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
■Example of specifying 32-bit indexing with "ZZ" specification
M0
MOVPK100
DMOVPK100000Z4
ZR0ZZ4
M0
Stores 100000 at Z4 and Z5.
Indexing ZR device with 32-bit
index registers (Z4 and Z5)
ZR (0+100000) =ZR100000
One index register can specify 32-bit indexing by using "ZZ" specification such as "ZR0ZZ4".
The 32-bit indexing with "ZZ" specification is as follows.
• Specification method
To perform 32-bit indexing by using "ZZ" specification, select "Use of ZZ" in "Indexing Setting for ZR Device" in PC parameter.
• Device that indexing can be used
The following device is available for indexing.
DeviceDescription
ZRSerial number access format file register
DExtended data register (D)
WExtended link register (W)
*1
M
*1
B
*1
D
*1
W
Jn\B
Jn\W
*1
*1
Internal relay
Link relay
Data register
Link register
Link relay
Link register
3
*1 This device can be used only for the High-speed Universal model QCPU.
• Usable range of index registers
The following table shows the usable range of index registers in 32-bit indexing used "ZZ" specification.
The 32-bit indexing with "ZZ" specification is specified as the format ZRmZZn.
Specifying ZRmZZn enables Zn and Zn+1 of 32-bit values to index the device number, ZRm.
"ZZ" specification
ZZ0Z0, Z1ZZ10Z10, Z11
ZZ1Z1, Z2ZZ11Z11, Z12
ZZ2Z2, Z3ZZ12Z12, Z13
ZZ3Z3, Z4ZZ13Z13, Z14
ZZ4Z4, Z5ZZ14Z14, Z15
ZZ5Z5, Z6ZZ15Z15, Z16
ZZ6Z6, Z7ZZ16Z16, Z17
ZZ7Z7, Z8ZZ17Z17, Z18
ZZ8Z8, Z9ZZ18Z18, Z19
ZZ9Z9, Z10ZZ19Unusable
*2
Index registers used"ZZ" specification
*2 refers to device name (ZR, D, W) for indexing target.
*2
Index registers used
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
97
• A case where 32-bit indexing used "ZZ" specification has been performed, and the actual process device (Z0 (32-bit)
The 32-bit indexing specification with "ZZ" specification applies in the following functions.
No.Function name and description
1Specifying devices in program instruction
2Monitoring device registrations
3Testing devices execution type
4Testing devices with conditions
5Setting monitor conditions
6Tracing sampling (Trace point (specifying devices), trace target device)
7Data logging function (Sampling interval (specifying devices), logging target data)
ZZn cannot be used alone as a device like "DMOV K100000 ZZ0". When setting values of index registers to
specify 32-bit indexing with "ZZ" specification, set the value of Zn (Z0 to Z19).
ZZn alone cannot be input to each function.
98
3 CONFIGURATION OF INSTRUCTIONS
3.3 Indexing
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.