Q L Series Programming Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1646

MELSEC System Q/L Series

Programmable Logic Controllers

Programming Manual

21112011 INDUSTRIAL AUTOMATION


Version A
Programming Manual for the
MELSEC System Q and L Series
Art. No.:

Version Changes / Additions / Corrections


A 11/2011 akl First edition
About this Manual

The texts, illustrations, diagrams, and examples contained in this manual are
intended exclusively as support material for the explanation, handling,
programming, and operation of the programmable logic controllers of the
MELSEC System Q and L series.

If you have any questions concerning the programming and operation of the
equipment described in this manual, please contact your relevant sales office or
department (refer to back of cover).
Current information and answers to frequently asked questions are also
available through the Internet (www.mitsubishi-automation.com)

MITSUBISHI ELECTRIC EUROPE B.V. reserves the right for technical


changes and changes to this manual at any time without prior notice.

© 07/2011
Contents

Contents
1 Introduction
1.1 Further manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2 CPU types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.3 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.4 Finding an instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.5 PLC parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.6 Comparison between the software packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6

2 Instruction Tables
2.1 Subdivision of instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
2.2 Overview of instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.2.1 Description of the overview tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
2.3 Sequence instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.3.1 Input instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
2.3.2 Connection instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
2.3.3 Output instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
2.3.4 Shift instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.3.5 Master control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.3.6 Program termination instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.3.7 Miscellaneous instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
2.4 Application instructions, Part 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.4.1 Comparison operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
2.4.2 Arithmetic operation instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
2.4.3 Data conversion instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
2.4.4 Data transfer instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23
2.4.5 Program branch instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
2.4.6 Interrupt program execution control instructions. . . . . . . . . . . . . . . . . . . . . 2-25
2.4.7 Data refresh instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
2.4.8 Other convenient instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-26
2.5 Application instructions, Part 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2.5.1 Logical operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-27
2.5.2 Rotation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-30
2.5.3 Shift instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
2.5.4 Bit processing instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-32
2.5.5 Data processing instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
2.5.6 Structured program instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
2.5.7 Data table operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-38
2.5.8 Buffer memory access instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
2.5.9 Display instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
2.5.10 Debugging and failure diagnosis instructions . . . . . . . . . . . . . . . . . . . . . . . 2-40
2.5.11 Character string processing instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . 2-41
2.5.12 Special function instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-44

Programming MELSEC System Q and L series VII


Contents

2.5.13 Data control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-48


2.5.14 File register switching instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-50
2.5.15 Clock instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-51
2.5.16 Expansion clock instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-53
2.5.17 Program instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-54
2.5.18 Other instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-55
2.6 Data link instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-58
2.6.1 Instructions for network refresh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-58
2.6.2 Read/write routing information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-58
2.7 Multiple CPU dedicated instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-59
2.7.1 Instructions for writing to the CPU shared memory of host CPU . . . . . . . . 2-59
2.7.2 Instructions for reading from the CPU shared memory of another CPU. . . 2-59
2.7.3 Multiple CPU high-speed transmission dedicated instructions . . . . . . . . . 2-60
2.8 System switching instruction for a redundant system . . . . . . . . . . . . . . . . . . . . . . . 2-61
2.9 Instructions for special function modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-62
2.9.1 Instructions for serial communication modules . . . . . . . . . . . . . . . . . . . . . . 2-62
2.9.2 Instructions for PROFIBUS/DP interface modules . . . . . . . . . . . . . . . . . . . 2-62
2.9.3 Instructions for ETHERNET interface modules. . . . . . . . . . . . . . . . . . . . . . 2-63
2.9.4 Instruction for MELSECNET/H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-63
2.9.5 Instructions for CC-Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-64

3 Configuration of Instructions
3.1 The structure of an instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1.1 Source of data (s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1.2 Destination of data (d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.1.3 Number (n) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
3.2 Notation of instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.2.1 16/32-bit and pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.2.2 MELSEC and IEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
3.2.3 Further characteristics of the instruction notation . . . . . . . . . . . . . . . . . . . . . 3-5
3.2.4 Specification of the notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
3.3 Programming of dedicated instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
3.4 Programming of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3.4.1 Programming with the GX IEC Developer. . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
3.5 Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
3.5.1 Processing of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
3.5.2 Addressing of arrays and registers in the GX IEC Developer. . . . . . . . . . . 3-22
3.5.3 Usage of character string data (STRING). . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
3.6 Index qualification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
3.7 Indirect designation (GX Works2 only). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-39
3.8 Reducing instruction processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42
3.8.1 Subset processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42
3.8.2 Operation processing with standard device registers (Z)
(Universal model QCPU and LCPU only) . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43

VIII
Contents

3.9 Operation errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44


3.9.1 Verification of the device range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-45
3.9.2 Verification of the device data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51
3.9.3 Buffer memory access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51
3.9.4 Multiple CPU shared memory access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-51
3.10 Execution conditions of the instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
3.10.1 Execution condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
3.10.2 EN input and ENO output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53
3.11 Number of program steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-55
3.12 Multiple Instructions using the same device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-61
3.12.1 OUT instructions using the same device . . . . . . . . . . . . . . . . . . . . . . . . . . 3-61
3.12.2 SET/RST instructions using the same device . . . . . . . . . . . . . . . . . . . . . . 3-62
3.12.3 PLS instructions using the same device . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-63
3.12.4 PLF instructions using the same device . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64
3.13 Precautions for use of file registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-66

4 Layout and Structure of the Chapters


4.1 Overview of the instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.2 The CPU table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
4.3 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
4.4 Representation format of the instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.4.1 Representation in the GX IEC Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.4.2 Representation in GX Works2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
4.5 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.6 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
4.7 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.8 Operation errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
4.9 Program examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7

5 Sequence Instructions
5.1 Input instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5.1.1 LD, LDI, AND, ANI, OR, ORI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
5.1.2 LDP, LDF, ANDP, ANDF, ORP, ORF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
5.1.3 LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
5.2 Connection instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5.2.1 ANB, ORB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13
5.2.2 MPS, MRD, MPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15
5.2.3 INV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
5.2.4 MEP, MEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-20
5.2.5 EGP, EGF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22

Programming MELSEC System Q and L series IX


Contents

5.3 Output instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24


5.3.1 OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
5.3.2 OUT T, OUTH T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26
5.3.3 OUT C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30
5.3.4 OUT F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33
5.3.5 SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35
5.3.6 RST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37
5.3.7 SET F, RST F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-40
5.3.8 PLS, PLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43
5.3.9 FF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47
5.3.10 DELTA, DELTAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-49
5.4 Shift instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-51
5.4.1 SFT, SFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-51
5.5 Master control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54
5.5.1 MC, MCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-54
5.6 Termination instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-60
5.6.1 FEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-60
5.6.2 END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-63
5.7 Miscellaneous instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66
5.7.1 STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66
5.7.2 NOP, NOPLF, PAGE n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68

6 Application Instructions, Part 1


6.1 Comparison operation instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2
6.1.1 =, < >, >, < =, <, > = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
6.1.2 D=, D<>, D>, D<=, D<, D>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
6.1.3 E=, E<>, E>, E< =, E<, E>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
6.1.4 ED=, ED<>, ED>, ED< =, ED<, ED>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
6.1.5 $ =, $ < >, $ >, $ < =, $ <, $ > = . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20
6.1.6 BKCMP, BKCMPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25
6.1.7 DBKCMP, DBKCMPP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
6.2 Arithmetic operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35
6.2.1 +, +P, -, -P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
6.2.2 D+, D+P, D-, D-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42
6.2.3 x, xP, /, /P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-45
6.2.4 Dx, DxP, D/, D/P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49
6.2.5 B+, B+P, B-, B-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-52
6.2.6 DB+, DB+P, DB-, DB-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-56
6.2.7 Bx, BxP, B/, B/P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-60
6.2.8 DBx, DBxP, DB/, DB/P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-63
6.2.9 E+, E+P, E-, E-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-67
6.2.10 ED+, ED+P, ED-, ED-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-72
6.2.11 Ex, ExP, E/, E/P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-77
6.2.12 EDx, EDxP, ED/, ED/P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-80

X
Contents

6.2.13 BK+, BK+P, BK-, BK-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-83


6.2.14 DBK+, DBK+P, DBK-, DBK-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-87
6.2.15 $+, $+P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-91
6.2.16 INC, INCP, DEC, DECP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-94
6.2.17 DINC, DINCP, DDEC, DDECP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-97
6.3 Data conversion instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-101
6.3.1 BCD, BCDP, DBCD, DBCDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-103
6.3.2 BIN, BINP, DBIN, DBINP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-106
6.3.3 FLT, FLTP, DFLT, DFLTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-110
6.3.4 FLTD, FLTPD, DFLTD, DFLTPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-113
6.3.5 INT, INTP, DINT, DINTP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-116
6.3.6 INTD, INTPD, DINTD, DINTPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-120
6.3.7 DBL, DBLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-123
6.3.8 WORD, WORDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-125
6.3.9 GRY, GRYP, DGRY, DGRYP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-127
6.3.10 GBIN, GBINP, DGBIN, DGBINP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-130
6.3.11 NEG, NEGP, DNEG, DNEGP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-133
6.3.12 ENEG, ENEGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-136
6.3.13 EDNEG, EDNEGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-138
6.3.14 BKBCD, BKBCDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-140
6.3.15 BKBIN, BKBINP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-143
6.3.16 ECON, ECONP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-146
6.3.17 EDCON, EDCONP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-148
6.4 Data transfer instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-150
6.4.1 MOV, MOVP, DMOV, DMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-151
6.4.2 EMOV, EMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-154
6.4.3 EDMOV, EDMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-156
6.4.4 $MOV, $MOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-158
6.4.5 CML, CMLP, DCML, DCMLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-161
6.4.6 BMOV, BMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-166
6.4.7 FMOV, FMOVP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-170
6.4.8 DFMOV, DFMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-173
6.4.9 XCH, XCHP, DXCH, DXCHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-176
6.4.10 BXCH, BXCHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-179
6.4.11 SWAP, SWAPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-182
6.5 Program branch instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-185
6.5.1 CJ, SCJ, JMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-186
6.5.2 GOEND. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-190
6.6 Program execution control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-192
6.6.1 DI, EI, IMASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-193
6.6.2 IRET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-200
6.7 Link refresh instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-202
6.7.1 RFS, RFSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-203

Programming MELSEC System Q and L series XI


Contents

6.8 Other convenient instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-205


6.8.1 UDCNT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-206
6.8.2 UDCNT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-209
6.8.3 TTMR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-212
6.8.4 STMR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-214
6.8.5 ROTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-218
6.8.6 RAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-222
6.8.7 SPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-225
6.8.8 PLSY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-228
6.8.9 PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-230
6.8.10 MTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-232

7 Application Instructions, Part 2


7.1 Logical operation instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
7.1.1 WAND, WANDP, DAND, DANDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
7.1.2 BKAND, BKANDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
7.1.3 WOR, WORP, DOR, DORP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
7.1.4 BKOR, BKORP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18
7.1.5 WXOR, WXORP, DXOR, DXORP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
7.1.6 BKXOR, BKXORP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
7.1.7 WXNR, WXNRP, DXNR, DXNRP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29
7.1.8 BKXNR, BKXNRP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-35
7.2 Data rotation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38
7.2.1 ROR, RORP, RCR, RCRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
7.2.2 ROL, ROLP, RCL, RCLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
7.2.3 DROR, DRORP, DRCR, DRCRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
7.2.4 DROL, DROLP, DRCL, DRCLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-48
7.3 Data shift instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-51
7.3.1 SFR, SFRP, SFL, SFLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
7.3.2 BSFR, BSFRP, BSFL, BSFLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-55
7.3.3 SFTBR, SFTBRP, SFTBL, SFTBLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
7.3.4 DSFR, DSFRP, DSFL, DSFLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
7.3.5 SFTWR, SFTWRP, SFTWL, SFTWLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64
7.4 Bit processing instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-67
7.4.1 BSET, BSETP, BRST, BRSTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68
7.4.2 TEST, TESTP, DTEST, DTESTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-71
7.4.3 BKRST, BKRSTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
7.5 Data processing instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-79
7.5.1 SER, SERP, DSER, DSERP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-81
7.5.2 SUM, SUMP, DSUM, DSUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-87
7.5.3 DECO, DECOP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-90
7.5.4 ENCO, ENCOP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-93
7.5.5 SEG, SEGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-96
7.5.6 DIS, DISP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-100

XII
Contents

7.5.7 UNI, UNIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-103


7.5.8 NDIS, NDISP, NUNI, NUNIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-106
7.5.9 WTOB, WTOBP, BTOW, BTOWP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-111
7.5.10 MAX, MAXP, DMAX, DMAXP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-116
7.5.11 MIN, MINP, DMIN, DMINP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-119
7.5.12 SORT, DSORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-122
7.5.13 WSUM, WSUMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-126
7.5.14 DWSUM, DWSUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-128
7.5.15 MEAN, MEANP, DMEAN, DMEANP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-130
7.6 Structured program instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-133
7.6.1 FOR, NEXT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-134
7.6.2 BREAK, BREAKP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-137
7.6.3 CALL, CALLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-140
7.6.4 RET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-146
7.6.5 FCALL, FCALLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-148
7.6.6 ECALL, ECALLP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-153
7.6.7 EFCALL, EFCALLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-159
7.6.8 XCALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-164
7.6.9 COM (Refresh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-170
7.6.10 COM (Selective Refresh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-173
7.6.11 CCOM, CCOMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-177
7.6.12 IX, IXEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-179
7.6.13 IXDEV, IXSET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-184
7.7 Data table operation instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-187
7.7.1 FIFW, FIFWP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-188
7.7.2 FIFR, FIFRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-192
7.7.3 FPOP, FPOPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-196
7.7.4 FDEL, FDELP, FINS, FINSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-200
7.8 Buffer memory access instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-207
7.8.1 FROM, FROMP, DFRO, DFROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-208
7.8.2 TO, TOP, DTO, DTOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-212
7.9 Display instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-217
7.9.1 PR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-218
7.9.2 PRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-223
7.9.3 LEDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-227
7.10 Failure diagnosis and debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-231
7.10.1 CHKST, CHK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-232
7.10.2 CHKCIR, CHKEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-240

Programming MELSEC System Q and L series XIII


Contents

7.11 Character string processing instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-245


7.11.1 BINDA, BINDAP, DBINDA, DBINDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-248
7.11.2 BINHA, BINHAP, DBINHA, DBINHAP . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-253
7.11.3 BCDDA, BCDDAP, DBCDDA, DBCDDAP . . . . . . . . . . . . . . . . . . . . . . . . 7-258
7.11.4 DABIN, DABINP, DDABIN, DDABINP . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-263
7.11.5 HABIN, HABINP, DHABIN, DHABINP . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-268
7.11.6 DABCD, DABCDP, DDABCD, DDABCDP . . . . . . . . . . . . . . . . . . . . . . . . 7-272
7.11.7 COMRD, COMRDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-276
7.11.8 LEN, LENP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-280
7.11.9 STR, STRP, DSTR, DSTRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-283
7.11.10 VAL, VALP, DVAL, DVALP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-290
7.11.11 ESTR, ESTRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-296
7.11.12 EVAL, EVALP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-306
7.11.13 ASC, ASCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-312
7.11.14 HEX, HEXP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-315
7.11.15 RIGHT, RIGHTP, LEFT, LEFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-319
7.11.16 MIDR, MIDRP, MIDW, MIDWP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-323
7.11.17 INSTR, INSTRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-329
7.11.18 STRINS, STRINSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-333
7.11.19 STRDEL, STRDELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-336
7.11.20 EMOD, EMODP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-339
7.11.21 EREXP, EREXPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-343
7.12 Special functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-347
7.12.1 SIN, SINP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-351
7.12.2 SIND, SINDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-354
7.12.3 COS, COSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-357
7.12.4 COSD, COSDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-360
7.12.5 TAN, TANP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-363
7.12.6 TAND, TANDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-366
7.12.7 ASIN, ASINP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-369
7.12.8 ASIND, ASINDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-372
7.12.9 ACOS, ACOSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-375
7.12.10 ACOSD, ACOSDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-378
7.12.11 ATAN, ATANP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-381
7.12.12 ATAND, ATANDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-384
7.12.13 RAD, RADP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-387
7.12.14 RADD, RADDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-390
7.12.15 DEG, DEGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-393
7.12.16 DEGD, DEGDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-396
7.12.17 POW, POWP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-399
7.12.18 POWD, POWDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-402
7.12.19 SQR, SQRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-405
7.12.20 SQRD, SQRDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-408
7.12.21 EXP, EXPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-411

XIV
Contents

7.12.22 EXPD, EXPDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-414


7.12.23 LOG, LOGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-417
7.12.24 LOGD, LOGDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-420
7.12.25 LOG10, LOG10P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-423
7.12.26 LOG10D, LOG10DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-426
7.12.27 RND, RNDP, SRND, SRNDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-429
7.12.28 BSQR, BSQRP, BDSQR, BDSQRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-431
7.12.29 BSIN, BSINP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-435
7.12.30 BCOS, BCOSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-438
7.12.31 BTAN, BTANP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-441
7.12.32 BASIN, BASINP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-444
7.12.33 BACOS, BACOSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-447
7.12.34 BATAN, BATANP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-450
7.13 Data control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-453
7.13.1 LIMIT, LIMITP, DLIMIT, DLIMITP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-454
7.13.2 BAND, BANDP, DBAND, DBANDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-458
7.13.3 ZONE, ZONEP, DZONE, DZONEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-462
7.13.4 SCL, SCLP, DSCL, DSCLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-466
7.13.5 SCL2, SCL2P, DSCL2, DSCL2P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-471
7.14 File register switching instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-475
7.14.1 RSET, RSETP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-476
7.14.2 QDRSET, QDRSETP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-479
7.14.3 QCDSET, QCDSETP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-482
7.15 Clock instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-485
7.15.1 DATERD, DATERDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-487
7.15.2 DATEWR, DATEWRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-490
7.15.3 DATE+, DATE+P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-493
7.15.4 DATE-, DATE-P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-498
7.15.5 SECOND, SECONDP, HOUR, HOURP . . . . . . . . . . . . . . . . . . . . . . . . . . 7-503
7.15.6 DT=, DT<>, DT>, DT<=, DT<, DT>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-509
7.15.7 TM=, TM<>, TM>, TM<=, TM<, TM>= . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-514
7.16 Expansion clock instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-519
7.16.1 S.DATERD, SP.DATERP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-520
7.16.2 S.DATE+, SP.DATE+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-524
7.16.3 S.DATE-, SP.DATE- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-528
7.17 Program control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-532
7.17.1 PSTOP, PSTOPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-534
7.17.2 POFF, POFFP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-536
7.17.3 PSCAN, PSCANP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-539
7.17.4 PLOW, PLOWP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-541
7.17.5 PCHK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-543

Programming MELSEC System Q and L series XV


Contents

7.18 Other convenient instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-546


7.18.1 WDT, WDTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-547
7.18.2 DUTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-549
7.18.3 TIMCHK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-552
7.18.4 ZRRDB, ZRRDBP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-554
7.18.5 ZRWRB, ZRWRBP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-558
7.18.6 ADRSET, ADRSETP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-562
7.18.7 KEY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-564
7.18.8 ZPUSH, ZPUSHP, ZPOP, ZPOPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-570
7.18.9 UNIRD, UNIRDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-574
7.18.10 TYPERD, TYPERDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-580
7.18.11 TRACE, TRACER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-586
7.18.12 SP.FWRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-588
7.18.13 SP.FREAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-599
7.18.14 SP.DEVST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-612
7.18.15 S.DEVLD, SP.DEVLD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-615
7.18.16 PLOADP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-617
7.18.17 PUNLOADP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-621
7.18.18 PSWAPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-624
7.18.19 RBMOV, RBMOVP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-627
7.18.20 UMSG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-634

8 Data Link Instructions


8.1 Categories of instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.2 Data refresh instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
8.2.1 S.ZCOM, SP.ZCOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.3 Reading and writing routing information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.3.1 S.RTREAD, SP.RTREAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.3.2 S.RTWRITE, SP.RTWRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10

9 Multiple CPU Dedicated Instructions


9.1 Writing to the CPU shared memory of host CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2
9.1.1 S.TO, SP.TO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4
9.1.2 TO, TOP, DTO, DTOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8
9.2 Read from CPU shared memory of another station . . . . . . . . . . . . . . . . . . . . . . . . . 9-13
9.2.1 FROM, FROMP, DFRO, DFROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14

10 Multiple CPU Device Write/Read Instructions


10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
10.2 Multiple CPU high-speed transmission instructions . . . . . . . . . . . . . . . . . . . . . . . . 10-13
10.2.1 D.DDWR, DP.DDWR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
10.2.2 D.DDRD, DP.DDRD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-18

XVI
Contents

11 Instructions for MELSEC System Q


11.1 Instruction for a redundant system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
11.1.1 SP.CONTSW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2

12 Instructions for Special Function Modules


12.1 Instructions for serial communication modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
12.1.1 BUFRCVS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
12.1.2 GETE, GETEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-6
12.1.3 PUTE, PUTEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11
12.1.4 PRR, PRRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-18
12.2 Instructions for PROFIBUS/DP interface modules. . . . . . . . . . . . . . . . . . . . . . . . . 12-26
12.2.1 BBLKRD, BBLKRDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-27
12.2.2 BBLKWR, BBLKWRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-30
12.3 Instructions for ETHERNET interface modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-33
12.3.1 BUFRCV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-34
12.3.2 BUFRCVS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-39
12.3.3 BUFSND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-42
12.3.4 OPEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-47
12.3.5 CLOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-56
12.3.6 ERRCLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-61
12.3.7 ERRRD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-67
12.3.8 UINI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-72
12.4 Instructions for MELSECNET/H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-78
12.4.1 PAIRSET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-79
12.5 Instructions for CC-Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-82
12.5.1 RLPASET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-83
12.5.2 RIRD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-95
12.5.3 RIWT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-103
12.5.4 RIRCV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-111
12.5.5 RISEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-119
12.5.6 RITO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-126
12.5.7 RIFR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-130

Programming MELSEC System Q and L series XVII


Contents

13 Error Codes
13.1 Error code list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
13.1.1 How to read the error code list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
13.1.2 Types of error codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.1.3 Clearing an error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
13.2 Error code list (1000 to 1999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
13.3 Error code list (2000 to 2999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-19
13.4 Error code list (3000 to 3999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-39
13.5 Error code list (4000 to 4999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-57
13.6 Error code list (5000 to 5999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-71
13.7 Error code list (6000 to 6999). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-73
13.8 Error code list (7000 to 10000). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-81
13.9 Error codes returned to request source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-85

A Appendix A
A.1 Definition of the processing times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
A.2 Processing times for MELSEC System Q CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-2
A.2.1 Table of Processing Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-3
A.2.2 Instructions executable by the product with the first 5 digits
of the serial No. "04122" or higher (Basic model QCPU) . . . . . . . . . . . . . . A-22
A.2.3 Table of the time to be added (Basic model QCPU). . . . . . . . . . . . . . . . . . A-25
A.2.4 Instructions availabe from function version B
(High Performance model QCPU/Process CPU/Redundant CPU). . . . . . . A-26
A.2.5 Table of the time to be added
(High Performance model QCPU/Process CPU/Redundant CPU). . . . . . . A-27
A.2.6 Redundant system instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-27
A.3 Operation Processing Time of Universal Model QCPU . . . . . . . . . . . . . . . . . . . . . . A-28
A.3.1 Subset instruction processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-28
A.3.2 Processing time of instructions other than subset instruction . . . . . . . . . . . A-42
A.4 Operation Processing Time of LCPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-79
A.4.1 Subset instruction processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-79
A.4.2 Processing time of instructions other than subset instruction . . . . . . . . . . . A-86
A.5 Comparison of the CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-102
A.5.1 Available devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-102
A.5.2 I/O control modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-104
A.5.3 Data types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-104
A.5.4 Timer comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-105
A.5.5 Comparison of counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-109
A.5.6 Comparison of display instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-110
A.5.7 QCPU, LCPU instructions whose designation format
has been changed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-111
A.5.8 AnACPU and AnUCPU dedicated instructions . . . . . . . . . . . . . . . . . . . . . A-112

XVIII
Contents

A.6 Table of special relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-113


A.6.1 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-114
A.6.2 System information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-117
A.6.3 System clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-122
A.6.4 Scan information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-124
A.6.5 I/O refresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-124
A.6.6 Drive information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-125
A.6.7 Instruction related special relays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-128
A.6.8 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-131
A.6.9 Conversion from A series to System Q or L series . . . . . . . . . . . . . . . . . . A-132
A.6.10 Built-in Ethernet port and built-in Ethernet function . . . . . . . . . . . . . . . . . A-139
A.6.11 Process control instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-140
A.6.12 Redundant system (host system CPU information) . . . . . . . . . . . . . . . . . A-140
A.6.13 Redundant system (other system CPU information). . . . . . . . . . . . . . . . . A-144
A.6.14 Redundant system (tracking information) . . . . . . . . . . . . . . . . . . . . . . . . . A-145
A.6.15 Redundant power supply module information. . . . . . . . . . . . . . . . . . . . . . A-148
A.6.16 Built-in I/O function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-149
A.6.17 Data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-154
A.7 Table of special registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-156
A.7.1 Diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-157
A.7.2 System information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-170
A.7.3 System clocks/counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-181
A.7.4 Scan information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-182
A.7.5 Memory cards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-185
A.7.6 Instruction related registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-194
A.7.7 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-198
A.7.8 Redundant CPU information (host system CPU information) . . . . . . . . . . A-198
A.7.9 Remote password count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-198
A.7.10 Conversion from A series to System Q or L series . . . . . . . . . . . . . . . . . . A-199
A.7.11 Built-in Ethernet port QCPU and built-in Ethernet function . . . . . . . . . . . . A-207
A.7.12 Fuse blown module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-210
A.7.13 I/O module verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-210
A.7.14 Process control instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-211
A.7.15 Redundant system (host system CPU information) . . . . . . . . . . . . . . . . . A-212
A.7.16 Redundant system (other system CPU information). . . . . . . . . . . . . . . . . A-214
A.7.17 Redundant system (tracking information) . . . . . . . . . . . . . . . . . . . . . . . . . A-217
A.7.18 Redundant power supply module information. . . . . . . . . . . . . . . . . . . . . . A-218
A.7.19 Built-in I/O function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-219
A.7.20 Data logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-227

Programming MELSEC System Q and L series XIX


Contents

XX
Introduction Further manuals

1 Introduction
This manual describes the programming and processing of the sequence and application
instructions that are provided by the CPUs of the MELSEC System Q and L series.

1.1 Further manuals


Qn(H)/QnPH/QnPRHCPU User‘s Manual (Function Explanation, Program Fundamentals)
–Description of functions, methods, and devices for programming
QnUCPU User‘s Manual (Function Explanation, Program Fundamentals)
–Description of functions, methods, and devices for programming
QnUCPU User‘s Manual (Communication via Built-in Ethernet Port)
–Description of functions for the communication via built-in Ethernet port of CPU module
MELSEC-L CPU Module User‘s Manual (Function Explanation, Program Fundamentals)
–Description of functions, methods, and devices for programming
MELSEC-L CPU Module User‘s Manual (Communication via Built-in Ethernet Port)
–Description of functions for the communication via built-in Ethernet port of CPU module
MELSEC-L CPU Module User‘s Manual (Data Logging Function)
–Description of data logging functionality of CPU module
MELSEC-Q/L Programming Manual (Common Instructions)
–Description of how to use sequence instructions, basic instructions,
and application instructions
MELSEC-Q/L/QnA Programming Manual (SFC)
–Description of the instructions for sequential function charts (MELSAP3)
MELSEC-Q/L Programming Manual (MELSAP-L)
–Description of the instructions for sequential function charts (MELSAP-L)
MELSEC-Q/L Programming Manual (Structured Text)
–Description of programming methods using structured languages
MELSEC-Q/L/QnA Programming Manual (PID Control Instructions)
–Description of the PID control instructions
QnPH/QnPRHCPU Programming Manual (Process Control Instructions)
–Description of the dedicated instructions for performing process control

NOTE You can download all manuals as PDF from the MITSUBISHI ELECTRIC homepage (www.mit-
subishi-automation.com).

Programming MELSEC System Q and L series 1–1


CPU types Introduction

1.2 CPU types


The functions described in this manual can be transferred to all CPU types by the current ver-
sion of the GX Works2 provided that the according CPU supports the instructions.
The different PLC types with their specific CPU are listed below in detail:

PLC Type CPU Type CPU Module Model

Basic model Q00JCPU, Q00CPU, Q01CPU

High Performance Q02CPU, Q02HCPU, Q06HCPU, Q12HCPU, Q25HCPU


model

Process model Q02PHCPU, Q06PHCPU, Q12PHCPU, Q25PHCPU

Redundant model Q12PRHCPU, Q25PRHCPU


MELSEC
System Q Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU,
Q03UDCPU, Q04UDHCPU, Q06UDHCPU,
Q10UDHCPU, Q13UDHCPU, Q20UDHCPU,
Q26UDHCPU,
Universal model
Q03UDECPU,
Q04UDEHCPU, Q06UDEHCPU, Q10UDEHCPU,
Q13UDEHCPU, Q20UDEHCPU, Q26UDEHCPU,
Q50UDEHCPU, Q100UDEHCPU

L series L02CPU, L26CPU-BT

If, e.g. in tables, QCPU or LCPU is mentioned, all CPU types of the MELSEC System Q and L
series are included. Exceptions are marked separately.

1.3 Software
All the described instructions can be applied with the available software packages:
– GX Developer
– GX IEC Developer
– GX Works2
The program examples contained in this manual were created with the GX Works2.
Corresponding to the selected CPU only those instructions are available within the GX Works2
dialog box that can actually be processed by the CPU.

NOTE The programming tool GX IEC Developer does not support the CPU modules of the L series.

1–2
Introduction Finding an instruction

1.4 Finding an instruction


Advanced
If you are already familiar with the programming of instructions for the MELSEC System Q, look
up the instruction chapters 5 through 12. The header line contains the name of the instruction
as it is applied within GX Works2.

Beginners
If you are not really familiar with the handling of the instructions, proceed as follows:
● Read through chapter 3 regarding the differing representation of instructions within the
MELSEC and the IEC editor.
● Read through chapter 4 regarding the consistent layout and structure of each description
of instruction.
● Use
–- the tabular overview of instruction categories with brief descriptions in chapter 2
–- the index containing the entire instructions

NOTE All the instructions contained in this manual are also included within the online help of the
GX Works2 as detailed as here.

Programming MELSEC System Q and L series 1–3


PLC parameters Introduction

1.5 PLC parameters


Via parameters several functions, device ranges, etc. are set up. For the programming of the
functions described in this manual, the parameter settings can remain preset or customised to
the user´s needs. Refer to the according hardware manuals of the CPUs and programming
manuals for detailed descriptions of the PLC parameter settings.

Example: MELSEC System Q

1–4
Introduction PLC parameters

Example: L series

Programming MELSEC System Q and L series 1–5


Comparison between the software packages Introduction

1.6 Comparison between the software packages


The most important features of the GX IEC Developer, the GX Developer, and the GX Works2
are listed in the following table:

GX IEC Developer GX Developer GX Works2


Structured use Simple to use Simple and structured use
Programming in comply with — —
IEC (6)1131-3
Editors: Editors: Editors:
 Instruction List  Instruction List  Ladder Diagram
 Ladder Diagram  Ladder Diagram  Structured Text (ST)
 Structured Text (ST)  Sequential Function Chart  Sequential Function Chart
 Sequential Function Chart (SFC) (SFC)
(SFC)  Structured Ladder Diagram
 Function Block (FUB)
Functions and Function Function Blocks Functions and Function
Blocks (V 7.0 or later) Blocks
Program modifications in Program modifications in Program modifications in
online mode online mode online mode
Program change in online Program change in online
mode mode
Diagnostic functions for the Diagnostic functions for the Diagnostic functions for the
PLC PLC PLC
Diagnostic functions for Diagnostic functions for Diagnostic functions for
network systems network systems network systems

1–6
Instruction Tables Subdivision of instructions

2 Instruction Tables
2.1 Subdivision of instructions
The instructions are subdivided into the following categories:
● Sequence instructions
● Application instructions (Part 1 and Part 2)
● Data link instructions
● Multiple CPU dedicated instruction
● Multiple CPU high-speed transmission dedicated instructions
● Redundant system instruction
● Instructions for special function modules

The categories of instructions are described in detail in the following table:

Reference
Category of Instruction Description
Section
Input instructions Operation start, 5.1
series and parallel connection of contacts

Connection instructions Series and parallel block connection,


storage and processing of operation results,
inversion of operation results, 5.2
conversion of operation results into pulses,
setting of edge relays

Output instructions Bit devices, counter and timer contacts,


output, setting, and resetting of annunciators,
setting and resetting of devices, 5.3
Sequence leading edge and trailing edge output,
instructions
bit device output inversion, generating pulses
Shift instructions Shifting bit devices 5.4

Master control Setting and resetting single parts of a program 5.5


instructions

Termination End of a part of program, 5.6


instructions end of sequence and routine programs

Miscellaneous Sequence program stop, 5.7


instructions no operation

Comparison operation Compares data to data (e.g. =, >, ≥) 6.1


instructions

Arithmetic operation Adds, subtracts, multiplies, divides, increments, and


instructions decrements BIN and BCD data, floating point data, and 6.2
BIN block data, links character strings

Data convsersion Converts data types, e.g. 6.3


instruction BCD → BIN, BIN → BCD

Data transfer Transmits designated data 6.4


instructions
Application
instructions
Part 1 Program branch Program jump commands 6.5
instructions

Program execution Enables and disables program interrupts 6.6


control instructions

Refresh instructions Refreshes bit devices, links, and I/O interfaces 6.7

Other convenient Count 1- or 2-phase input up or down,


instructions teaching timer, special function timer,
rotary table near path rotation control, ramp signal, 6.8
pulse density measurement, fixed cycle pulse output,
pulse width modulation, matrix input

Programming MELSEC System Q and L series 2–1


Subdivision of instructions Instruction Tables

Reference
Category of Instruction Description Section

Logical operation Logical AND / OR, logical exclusive OR / exclusive NOR 7.1
instructions

Rotation instructions 16-bit and 32-bit data right / left rotation 7.2

Shift instructions Shift data by bit or word 7.3

Bit processing Set, reset, and test bits 7.4


instructions

Data processing Search, encode, and decode data at specified devices 7.5
instructions Disunite and unite data
Structured program Repeated operation, subroutine program calls,
instructions subroutine calls between program files, switching
between main and subprogram parts, micro computer 7.6
program calls, index qualification of entire ladders, store
index qualification values in data tables

Data table operation Write to and read data from a data table, delete and 7.7
instructions insert data blocks in a data table

Buffer memory access Buffer memory access of special function modules or 7.8
instructions remote modules
Display instructions Output ASCII characters to the outputs of a module or to 7.9
an LED display

Debugging and failure Failure checks, setting and resetting status latch, 7.10
diagnosis instructions sampling trace, program trace
Application Character string Character string (ASCII code) processing
instructions 7.11
Part 2 processing instructions

Special function Trigonometrical functions, square root and exponential 7.12


instructions calculation with BCD data and floating point data
Data control Upper and lower limit control and storage of checked 7.13
instructions data

File register switching Switching between file register blocks and files 7.14
instructions
Clock instructions Reading/writing of the values of year, month, day, hour,
minute, second, and day of the week; addition/
subtraction of the values of hour, minute, and second;
conversion of the values of hour, minute, and second 7.15
into second; comparison between the values of year,
month, and day; and comparison between the values of
hour, minute, and second.

Expansion clock Reading of the values of year, month, day, hour, minute,
instructions second, millisecond, and day of the week; addition/ 7.16
subtraction of the values of hour, minute, second, and
millisecond

Program instructions Select different program execution modes 7.17

Other instructions Reset watchdog timer (WDT), pulse generation, direct


read from indirect access file registers, numerical key
input from keyboard, batch save or recovery of index 7.18
registers, reading module information/model name, trace
set/trace reset, writing to and reading from files/standard
ROM, program instructions, data transfer, user message

2–2
Instruction Tables Subdivision of instructions

Reference
Category of Instruction Description Section

Network refresh Instructions for data refresh operations in network 8.2


instructions modules.
Data link
instructions Read/write routing Read and write routing parameters (network number and
information station number of relay station, station number of routing 8.3
station).
Data exchange instructions in a multi- Writing to the CPU shared memory 9.1
CPU system Reading from the CPU shared memory of another CPU 9.2

Multiple CPU high-speed transmission Writes/reads devices to/from another CPU. chapter 10
dedicated instructions

Instruction for a redundant system System switching (Active system/standby system) chapter 11

Instructions for special function modules Instructions for serial communication modules,
PROFIBUS/DP interface modules, ETHERNET interface chapter 12
modules, MELSECNET/H and CC-Link

Programming MELSEC System Q and L series 2–3


Overview of instructions Instruction Tables

2.2 Overview of instructions


2.2.1 Description of the overview tables

The following sections 2.3 through 2.6 include an overview of all instructions described in this
manual.
In the following the layout of the overview table is described in detail:

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning
Condition Section

+
s, d (d)+(s) → (d) 3  6.2.1
Addition and +P
subtraction
of 16-bit
binary data +
s1, s2, d1 (s1)+(s2) → (d1) 4  6.2.1
+P

(1) (2) (3) (4) (5) (6) (7) (8)

Explanation of the different columns:


(1) Category of instruction
(2) Specification of instruction name ("command") for the programming
The instruction names are represented in MELSEC notation (refer to section 3.2 "Notation
of instructions" for explanation of the notation).
In general, 16-bit instructions are represented. All 32-bit instructions are indicated by a
leading "D".
Example: 16-bit instruction: +
32-bit instruction: D+

Pulse instructions, i.e. instructions that are only executed at leading edge of a signal are
indicated by an appended "P".
Example: Execution when ON: +
Execution at leading edge: +P

1)

2) 2)
1
Execution condition of instruction
P 2 One program scan
3 One execution
3) 3)

2–4
Instruction Tables Overview of instructions

Instructions processing character strings are indicated by a leading "$"


Example: Standard instructions: +
Character string instruction: $+P

(3) Specification of variables


Here, the variables to be used are specified. The data source is represented by an "s", the
data destination is represented by a "d".
Example:
s = if there is only one data source
s1, s2 = if there are several data sources
s+0, s+1, (s1)+0, (s1)+1 = for 32-bit instructions
e.g. s1 = data register D0, (s1)+1 = data register D1
s+0, s+1, s+2, s+3 = 4 successive devices, e.g. for an array

(4) Meaning and processing of the entire control instruction

(d+1,d) + (s+1, s) (d+1, d)


2) 2)
(d) + (s)

1)
(d)

d+1
{ 4)
3)

d
5)
1 Indicates

2
16 bits
16 bits

3 Indicates 32 bits

4 upper 16 bits

5
lower 16 bits

(5) Indication of the execution condition according to the following table

Symbol Execution condition


The instruction is executed continuously and independent from the prior execution
no indication
condition. If the precondition is not set, the instruction is not executed.

The instruction is executed as long as the precondition is ON. If the precondition is OFF,
the instruction is not executed and no processing is conducted.

This instruction is a pulsed instruction. It is only executed once and at leading edge of
the input signal (when the precondition alters from OFF to ON). Afterwards, the
instruction will not be executed any longer even if the input signal is still ON.

Executed during OFF; instruction is executed only while the precondition is OFF. If the
precondition is ON, the instruction is not executed, and no processing is conducted.

This instruction is a pulsed instruction as well. It is only executed once and at trailing
edge of the input signal (when the precondition alters from ON to OFF). Afterwards, the
instruction will not be executed any longer even if the input signal is still OFF.

(6) Indication of the number of program steps


Indicated is the number of steps that is required for the entire execution of the instruction.
Refer to section 3.11 for details.

(7) The  mark indicates instructions for which subset processing is possible.
Refer to section 3.8.1 for details on subset processing.

(8) Indication of the reference section


Indicates the chapter and section of this manual where the instruction is described in detail.

Programming MELSEC System Q and L series 2–5


Sequence instructions Instruction Tables

2.3 Sequence instructions


2.3.1 Input instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Operation start
LD (Load (normally open
contact))
s
Operation start
LDI (Load (normally closed
contact))
Series connection 
AND (of NO contacts)  5.1.1
s
ANI Series connection
(of NC contacts)
Parallel connection
OR
(of NO contacts)
s
Input Parallel connection
ORI (of NC contacts)
instruction
LDP Pulse operation start
(leading edge)
s
LDF Pulse operation start
(trailing edge)
Pulse series connection
ANDP s
(leading edge) 
 5.1.2
Pulse series connection
ANDF s (trailing edge)

ORP s Pulse parallel connection


(leading edge)
Pulse parallel connection
ORF s
(trailing edge)
Starts leading edge pulse 3
LDPI s NOT operation

LDFI s Starts trailing edge pulse 3


NOT operation

ANDPI s
Leading edge pulse NOT 4
Input series connection
 5.1.3
instruction
ANDFI s
Trailing edge pulse NOT 4
series connection

ORPI s Leading edge pulse NOT 4


parallel connection

ORFI s
Trailing edge pulse NOT 4
parallel connection
 The number of program steps depends on the devices used.
 For the use of internal devices or file registers (R0 through R32767) :1
 For the use of a direct access input (DX) :2
 For the use of other devices :3

The number of program steps depends on the devices and types of CPU modules used.
 For the use of internal devices or file registers (R0 through R32767) :1
 For the use of a direct access input (DX) :1
 For the use of other devices :3
The number of program steps depends on the devices used.
 For the use of internal devices or file registers (R0 through 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) : Number of basic steps + 1
 For the use of a direct access input (DX) : Number of basic steps + 1
 For the use of other devices : Number of basic steps + 2

2–6
Instruction Tables Sequence instructions

2.3.2 Connection instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Block series connection


ANB (Ladder block series
connection)
— 1 5.2.1
Block parallel connection
ORB (Ladder block parallel
connection)

Operation result processing


MPS (Store operation result
(memory push))

Operation result processing


MRD — (Read operation result 1 5.2.2
(memory read))
Operation result processing
MPP (Read and clear operation
result (memory pop))

Connection INV — Operation result inversion 1 5.2.3


instruction (Inversion instruction)

Operation result into pulse


conversion
MEP
(Pulse generation at leading
edge of operation result)
— 1 5.2.4
Operation result into pulse
conversion
MEF (Pulse generation at trailing
edge of operation result)

Setting of edge relays


EGP (Setting an edge relay with 1
leading edge of an operation
result)
d 5.2.5
Setting of edge relays
(Setting an edge relay with 
EGF
trailing edge of an operation
result)
 The number of program steps depends on the devices and types of CPU modules used.
 High Performance model QCPU, Process CPU, Redundant CPU, Universal model QCPU, LCPU :1
 Basic Model QCPU :2

Programming MELSEC System Q and L series 2–7


Sequence instructions Instruction Tables

2.3.3 Output instruction

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Setting instructions for 


OUT d 5.3.1
outputs
OUT T
d Timers 4 5.3.2
OUTH T
OUT C d Counter 4 5.3.3
OUT F d Annunciator output 4 5.3.4


SET d Setting of devices 5.3.5
( )


RST d Resetting devices 5.3.6
( )
SET F
Output Setting and resetting the
instruction d 2 5.3.7
annunciators
RST F

PLS Output at leading edge


d 2 5.3.8
PLF Output at trailing edge

Inversion of bit output 2 5.3.9


FF s device

DELTA
Generating pulses at 2 5.3.10
d direct access outputs
DELTAP

The number of program steps depends on the devices and types of CPU modules used.
 When using internal device or file register (R): 1
 When using direct access outputs DY: 2
 When using serial number access format file register:
(Universal model QCPU and LCPU): 2
(Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU): 3
 Devices other than above: 3

This execution condition is only applied, if the annunciator (F) is used.

The number of program steps depends on the devices and types of CPU modules used.
 When using internal device or file register (R0 to R32767): 1
 When using direct access outputs DY or SFC program device (BL): 2
 When using serial number access format file register:
(Universal model QCPU and LCPU): 2
(Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU): 3
 Devices other than above: 3

The number of program steps depends on the devices and types of CPU modules used.
- For bit processing
 internal device (bit to be specified by bit device or word device): 1
 Direct access output: 2
 Timer, counter: 4
- For word processing
 internal device: 2
 Index register: 2
- For bit/word processing
 When using serial number access format file register:
(Universal model QCPU and LCPU): 2
(Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU): 3
 Devices other than above: 3

2–8
Instruction Tables Sequence instructions

2.3.4 Shift instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

SFT
Shift instruction d Shifting bit devices 2 5.4.1
SFTP

2.3.5 Master control instructions

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

Activating indicated 2
MC n, d
Master control program parts
5.5.1
instruction Deactivating indicated
MCR n 1
program parts

2.3.6 Program termination instructions

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

FEND End of program branches 5.6.1


Termination — 1
instruction End of sequence 5.6.2
END program

2.3.7 Miscellaneous instructions


of steps
Number

Subset

Execution Reference
Category Instruction Variables Meaning
Condition Section

Stop STOP — Stop instruction 1 5.7.1

NOP — No operation program


step

Ignored
NOPLF — (To change pages during
Other printouts) 1 5.7.2
instructions
Ignored
(Subsequent programs
PAGE n
will be controlled from
step 0 of page n)

Programming MELSEC System Q and L series 2–9


Application instructions, Part 1 Instruction Tables

2.4 Application instructions, Part 1


2.4.1 Comparison operation instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

LD=

AND= s1, s2 Sets the output, if 3 


s1 = s2
OR=

LD<>
AND<> s1, s2 Sets the output, if 3 
s1 ≠ s2
OR<>

LD>

AND> s1, s2 Sets the output, if 3 


s1 > s2
OR>
BIN 16-bit data 6.1.1
comparison
LD<=
Sets the output, if 3 
AND<= s1, s2 s1 <= s2
OR<=

LD<
Sets the output, if 3 
AND< s1, s2 s1 < s2
OR<

LD>=
Sets the output, if 3 
AND>= s1, s2 s1 >= s2
OR>=

LDD=
Sets the output, if 
ANDD= s1, s2 
s1 = s2
ORD=

LDD<>
Sets the output, if 
ANDD<> s1, s2 
s1 ≠ s2
ORD<>

LDD>
Sets the output, if 
ANDD> s1, s2 
s1 > s2
ORD>
BIN 32-bit data 6.1.2
comparison
LDD<=
Sets the output, if 
ANDD<= s1, s2 
s1 <= s2
ORD<=

LDD<
Sets the output, if 
ANDD< s1, s2 
s1 < s2
ORD<

LDD>=
Sets the output, if 
ANDD>= s1, s2 
s1 >= s2
ORD>=

2 – 10
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

LDE=
Sets the output, if 3
ANDE= s1, s2 s1 = s2
ORE=

LDE<>
Sets the output, if 3
ANDE<> s1, s2 s1 ≠ s2
ORE<>

LDE>
Sets the output, if 3
ANDE> s1, s2 s1 > s2
Floating point
data ORE>
comparison 6.1.3
(Single LDE<=
precision)
Sets the output, if 3
ANDE<= s1, s2 s1 <= s2
ORE<=

LDE<
Sets the output, if 3
ANDE< s1, s2 s1 < s2
ORE<

LDE>=
Sets the output, if 3
ANDE>= s1, s2
s1 >= s2
ORE>=

LDED=
Sets the output, if
(s1 + 3, s1 + 2, s1 + 1, s1) 3
ANDED= s1, s2
=
(s2 + 3, s2 + 2, s2 + 1, s2)
ORED=
LDED<>
Sets the output, if
(s1 + 3, s1 + 2, s1 + 1, s1) 3
ANDED<> s1, s2

(s2 + 3, s2 + 2, s2 + 1, s2)
ORED<>
LDED>
Sets the output, if
(s1 + 3, s1 + 2, s1 + 1, s1) 3
ANDED> s1, s2
Floating point >
(s2 + 3, s2 + 2, s2 + 1, s2)
data ORED>
comparison 6.1.4
(Double LDED<=
Sets the output, if
precision) (s1 + 3, s1 + 2, s1 + 1, s1)
ANDED<= s1, s2 3
<=
(s2 + 3, s2 + 2, s2 + 1, s2)
ORED<=
LDED<
Sets the output, if
(s1 + 3, s1 + 2, s1 + 1, s1) 3
ANDED< s1, s2
<
(s2 + 3, s2 + 2, s2 + 1, s2)
ORED<

LDED>=
Sets the output, if
(s1 + 3, s1 + 2, s1 + 1, s1) 3
ANDED>= s1, s2
>=
(s2 + 3, s2 + 2, s2 + 1, s2)
ORED>=

Programming MELSEC System Q and L series 2 – 11


Application instructions, Part 1 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

LD$= Compares the character


strings in s1 and s2
AND$= s1, s2 character by character.  3
Sets the output, if
OR$= s1 = s2

LD$<> Compares the character


strings in s1 and s2
AND$<> s1, s2 character by character.  3
Sets the output, if
OR$<> s1 ≠ s2

LD$> Compares the character


strings in s1 and s2
AND$> s1, s2 character by character.  3
Sets the output, if
Character OR$> s1 > s2
string data 6.1.5
comparison LD$<= Compares the character
strings in s1 and s2
AND$<= s1, s2 character by character.  3
Sets the output, if
OR$<= s1 <= s2

LD$ < Compares the character


strings in s1 and s2
AND$< s1, s2 character by character.  3
Sets the output, if
OR$< s1 < s2
LD$>= Compares the character
strings in s1 and s2
AND$>= s1, s2 character by character.  3
Sets the output, if
OR$>= s1 >= s2

BKCMP= s1, s2, n, d1

BKCMP<> s1, s2, n, d1

BKCMP> s1, s2, n, d1

BKCMP<= s1, s2, n, d1


It compares the nth BIN
BKCMP< s1, s2, n, d1 16-bit block in s1 to the
nth BIN 16-bit block in s2,
BIN 16-bit BKCMP>= s1, s2, n, d1 beginning with the first
block data 5 6.1.6
number of device.
comparison BKCMP=P s1, s2, n, d1
The result of each block
BKCMP<>P s1, s2, n, d1 comparison is stored from
d1 onwards.
BKCMP>P s1, s2, n, d1

BKCMP<=P s1, s2, n, d1

BKCMP<P s1, s2, n, d1

BKCMP>=P s1, s2, n, d1

2 – 12
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

DBKCMP= s1, s2, n, d1

DBKCMP<> s1, s2, n, d1


DBKCMP> s1, s2, n, d1
This instruction compares
DBKCMP<= s1, s2, n, d1
BIN 32-bit data stored in
n-point devices starting
DBKCMP< s1, s2, n, d1 from the device specified
BIN 32-bit DBKCMP>= s1, s2, n, d1 by S1 with BIN 32-bit
data stored in n-point 6.1.7
block data devices starting from the 5
comparisons DBKCMP=P s1, s2, n, d1
device specified by a
constant and S2, and
DBKCMP<>P s1, s2, n, d1 then stores the result into
DBKCMP>P s1, s2, n, d1 the nth device specified
by (D) and up.
DBKCMP<=P s1, s2, n, d1

DBKCMP<P s1, s2, n, d1


DBKCMP>=P s1, s2, n, d1

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 5 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 5 (NOTE 1)
– Constant; No limitations : 5 (NOTE 1)
Devices other than the above : 3 (NOTE 2)
 Basic model QCPU, Universal model QCPU, LCPU
– All devices that can be used : 3 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

Conditions under which the character string comparison is processed:
 Match : All characters in the string must match.
 Larger string : If the character strings differ, the larger string is determined.
 Smaller string : If the character strings differ, the smaller string is determined.

Programming MELSEC System Q and L series 2 – 13


Application instructions, Part 1 Instruction Tables

2.4.2 Arithmetic operation instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

+
s, d (d)+(s) → (d) 3 

+P

+
s1, s2, d1 (s1)+(s2) → (d1) 4 

BIN 16-bit +P
addition and 6.2.1
subtraction
operations -
s, d (d)-(s) → (d) 3 

-P

-
s1, s2, d1 (s1)-(s2) → (d1) 4 

-P

D+
(d+1, d)+(s+1, s)  
s, d
→ (d+1, d)
D+P

D+
((s1)+1, s1)+((s2) +1, s2)  
s1, s2, d1
→ ((d1)+1, d1)
BIN 32-bit D+P
addition and 6.2.2
subtraction
operations D-
(d+1, d)-(s+1, s)  
s, d → (d+1, d)
D-P

D-
((s1)+1, s1)-((s2)+1, s2)  
s1, s2, d1
→ ((d1)+1, d1)
D-P

x

s1, s2, d1 (s1)x(s2) → ((d1)+1, d1) 

xP
BIN 16-bit
multiplication 6.2.3
and division
/
(s1)/(s2) →
s1, s2, d1 Quotient (d1), 4 
remainder ((d1)+1)
/P

2 – 14
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Dx ((s1)+1, s1)x((s2)+1, s2)


s1, s2, d1 → 4 
((d1)+3, (d1)+2,
DxP (d1)+1, d1)
BIN 32-bit
multiplication 6.2.4
and division
D/ ((s1)+1, s1)/((s2)+1, s2)

s1, s2, d1 Quotient ((d1)+1, d1), 4 
remainder ((d1)+3,
D/P (d1)+2)

B+
s, d (d)+(s) → (d) 3 

B+P

B+
s1, s2, d1 (s1)+(s2) → (d1) 4

BCD 4-digit B+P


addition and 6.2.5
substraction
operations B-
s, d (d)-(s) → (d) 3 

B-P

B-
s1, s2, d1 (s1)-(s2) → (d1) 4
B-P

DB+
(d+1, d)+(s+1, s)
s, d → 3
(d+1, d)
DB+P

DB+
((s1)+1, s1)+((s2)+1, s2)
s1, s2, d1 → 4
((d1)+1, d1)
BCD 8-digit DB+P
addition and 6.2.6
subtraction
operations DB-
(d+1, d)+(s+1, s)
s, d → 3
(d+1, d)
DB-P

DB-
((s1)+1, s1)+((s2)+1, s2)
s1, s2, d1 → 4
((d1)+1, d1)
DB-P

Programming MELSEC System Q and L series 2 – 15


Application instructions, Part 1 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section


s1, s2, d1 (s1)x(s2) → ((d1)+1, d1) 4 

BCD 4-digit B×P


multiplication 6.2.7
and division
operations B/ (s1)/(s2)
→ 4 
s1, s2, d1 Quotient (d1),
B/P remainder ((d1)+1)

DB× ((s1)+1, s1)x((s2)+1, s2)


→ 4
s1, s2, d1
((d1)+3, (d1)+2,
DB×P (d1)+1, d1)
BCD 8-digit
multiplication 6.2.8
and division
operations DB/ ((s1)+1, s1)/((s2)+1, s2)

s1, s2, d1 Quotient ((d1)+1, d1), 4 
remainder ((d1)+3,
DB/P (d1)+2)

E+
(d+1, d)+(s+1, s)
s, d → 3 
(d+1, d)
E+P

E+
((s1)+1, s1)+((s2)+1, s2)
s1, s2, d1 → 4 
Floating point
data addition ((d1)+1, d1)
E+P
and
subtraction 6.2.9
operations
(Single E-
(d+1, d)-(s+1, s)
precision) s, d → 3 
(d+1, d)
E-P

E-
((s1)+1, s1)-((s2)+1, s2)
s1, s2, d1 → 4 
((d1)+1, d1)
E-P

2 – 16
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

ED+
(d+3, d+2, d+1, d)
s, d +(s+3, s+2, s+1, s) → 3 
(d+3, d+2, d+1, d)
ED+P

((s1)+3, (s1)+2, (s1)+1,


ED+ s1)
+((s2)+3, (s2)+2, (s2)+1, 4 
Floating point s1, s2, d1 s2) →
data addition ED+P ((d1)+3, (d1)+2, (d1)+1,
and d1)
subtraction 6.2.10
operations
(Double ED- (d+3, d+2, d+1, d)
precision) – (s+3, s+2, s+1, s) 3 
s, d

ED-P (d+3, d+2, d+1, d)

((s1)+3, (s1)+2, (s1)+1,


ED- s1)
s1, s2, d1 – ((s2)+3, (s2)+2, (s2)+1, 4 
s2) →
ED-P ((d1)+3, (d1)+2, (d1)+1,
d1)

Ex
((s1)+1, s1)x((s2)+1, s2)
s1, s2, d1 → 3 
Floating point ((d1)+1, d1)
data ExP
multiplication
and division 6.2.11
operations
(Single E/
((s1)+1, s1)/((s2)+1, s2)

precision) s1, s2, d1 → 4
Quotient ((d1)+1, d1)
E/P

((s1)+3, (s1)+2, (s1)+1,


EDx s1) x ((s2)+3, (s2)+2,

(s2)+1, s2) 4
Floating point s1, s2, d1 →
data EDxP ((d1)+3, (d1)+2, (d1)+1,
multiplication d1)
and division 6.2.12
operations ((s1)+3, (s1)+2, (s1)+1,
(Double ED/ s1)/((s2)+3, (s2)+2,

precision) (s2)+1, s2) 4
s1, s2, d1

ED/P Quotient ((d1)+3,
(d1)+2,(d1)+1, d1)

BK+
Adds the nth 16-bit block
s1, s2, d, n in s1 to the nth 16-bit 5
block in s2.
BIN block BK+P
addition and 6.2.13
subtraction
operations BK-
Subtracts the nth 16-bit
s1, s2, d, n block in s2 from the nth 5
16-bit block in s1.
BK-P

Programming MELSEC System Q and L series 2 – 17


Application instructions, Part 1 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

DBK+
Adds the nth 32-bit block
s1, s2, d, n in s1 to the nth 32-bit 5
BIN 32-bit block in s2.
DBK+P
block addition
and 6.2.14
subtraction
operations DBK-
Subtracts the nth 32-bit
s1, s2, d, n block in s2 from the nth 5
32-bit block in s1.
DBK-P

$+ Character string data in s


is appended to character
s, d data in d. 3
The linked character
$+P string is stored in d.
Character
string linking 6.2.15
operations
$+ Character string data in s
is appended to character
s1, s2, d1 data in d. 4
The linked character
$+P string is stored in d.

INC
d (d)+1→ (d) 2  6.2.16
INCP
BIN increment
operations
DINC

d (d+1, d)+1 → (d+1, d)  6.2.17
DINCP

DEC
d (d)-1→ (d) 2  6.2.16
DECP
BIN
decrement
operations
DDEC

d (d+1, d)-1 → (d+1, d)  6.2.17
DDECP

2 – 18
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section


The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 5 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 5 (NOTE 1)
– Constant; No limitations : 5 (NOTE 1)
Devices other than the above : 3 (NOTE 2)
 Basic model QCPU, Universal model QCPU, LCPU
– All devices that can be used : 3 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 6 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 6 (NOTE 1)
– Constant; No limitations : 6 (NOTE 1)
Devices other than the above : 4 (NOTE 2)
 Basic model QCPU
– All devices that can be used : 4 (NOTE 2)
 Universal model QCPU, LCPU
– All devices that can be used : 3 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

The number of program steps depends on the devices used and the type of CPU.
 QCPU, LCPU
– Word device: internal word devices (except for file register ZR) :3
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification :3
– Constant; No limitations :3
Devices other than the above : 4 (NOTE 1)
NOTE 1: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

The number of steps is three for the Universal model QCPU and LCPU only.

The subset is effective only with Universal model QCPU and LCPU.

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 3 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 3 (NOTE 1)
– Constant; No limitations : 3 (NOTE 1)
Devices other than the above : 2 (NOTE 2)
 Basic model QCPU, Universal model QCPU, LCPU
– All devices that can be used : 2 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

Programming MELSEC System Q and L series 2 – 19


Application instructions, Part 1 Instruction Tables

2.4.3 Data conversion instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

BCD
BCD conversion
s, d (s) (d) 3 

BCDP BIN (0 to 9999)


Conversion
from BIN data 6.3.1
into BCD data
DBCD BCD conversion
s, d (s+1, s) (d+1, d) 3 

DBCDP BIN (0 to 99999999)

BIN
BIN conversion
s, d (s) (d) 3 

BINP BCD (0 to 9999)


Conversion
from BCD data 6.3.2
into BIN data
DBIN BIN conversion
s, d (s+1, s) (d+1, d) 3 

DBINP BCD (0 to 99999999)

FLT Floating point


conversion
s, d (s+1, s) (d) 3 
Conversion Binary value
from BIN data FLTP (-32768 to 32767)
into floating 6.3.3
point data
(Single DFLT Floating point
precision) conversion
s, d (s+1, s) (d+1, d) 3 

DFLTP Binary value


(-2147483648 to 2147483647)

FLTD Floating point conversion


s, d (s) (d+3, d+2, d+1, d) 4 
Conversion
FLTPD Binary value
from BIN data (-32768 to 32767)
into floating 6.3.4
point data
(Double Floating point
DFLTD conversion
precision)

(s+1, s) (d+3, d+2, d+1, d)
s, d 4
Binary value
DFLTPD (-2147483648 to 2147483647)

INT BIN conversion


s, d (s+1, s) (d) 3 
Conversion Floating point value
from floating INTP (-32768 to 32767)
point data into 6.3.5
BIN data
(Single DINT
precision)
s, d 3 

DINTP

2 – 20
Instruction Tables Application instructions, Part 1

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

INTD
Conversion to BIN
s, d (s+3, s+2, s+1, s) (d ) 3 
Conversion Real number ( 32768 to
from floating INTPD 32767)
point data into 6.3.6
BIN data
(Double DINTD Conversion
precision) to BIN
s, d (s+3, s+2, s+1, s) (d+1,d) 3 
Real number
DINTPD (–2147483648 to 2147483647)

Conversion DBL
from BIN 16- Conversion
bit data into s, d (s) (d+1, d) 3 6.3.7
BIN 32-bit
data DBLP BIN (-32768 to 32767)

Conversion WORD
from BIN 32- Conversion
bit data into s, d (s+1, s) (d) 3 6.3.8
BIN 16-bit
WORDP BIN (-32768 to 32767)
data

GRY Conversion
into Gray code
s, d (s) (d) 3
Binary value
Conversion GRYP (-32768 to 32767)
from BIN 16-/
32-bit data into 6.3.9
Gray code
data DGRY Conversion
into Gray code
s, d (s+1, s) (d+1, d) 3
Binary value
DGRYP (-2147483648 to 214748364 7)

GBIN BIN conversion


s, d (s) (d) 3
Gray code
Conversion GBINP (-32768 to 32767)
from Gray
code data into 6.3.10
BIN 16-/32-bit
data DGBIN BIN conversion
s, d (s+1, s) (d+1, d) 3
Gray code
DGBIN (-2147483648 to 214748364 7)

NEG
(d) (d)
d 2
Sign reversal BIN data
NEGP
for BIN
16-/32-bit data 6.3.11
(complement
of 2) DNEG
(d+1, d) (d+1, d)
d 2
BIN data
DNEGP

Programming MELSEC System Q and L series 2 – 21


Application instructions, Part 1 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

ENEG
(d+1, d) (d+1, d)
d 2 6.3.12
Floating point value
ENEGP
Sign reversal
for floating
point data
EDNEG Floating point number

d (d+3, d+2, d+1, d) 3 6.3.13



EDNEGP (d+3, d+2, d+1, d)

Conversion BKBCD s, d, n This instruction converts


each nth BIN 16-bit block
from BIN block in s into the nth BCD 4- 4 6.3.14
data into BCD
block data digit block. Converted
BKBCDP s, d, n data is stored in d.

This instruction converts


Conversion BKBIN s, d, n each nth BCD 4-digit
from BCD block in s into the nth 4 6.3.15
block data into BIN 16-bit block.
BIN block data BKBINP s, d, n Converted data is stored
in d.

Floating-point 32-bit floating-point real


Conversion ECON s, d number
from single (s+1, s)
precision to → 3 6.3.16
double Conversion to double
precision ECONP s, d precision
(d+3, d+2, d+1, d)

Floating-point 64-bit floating-point real


Conversion EDCON s, d number
from double (s+3, s+2, s+1, s)
precision to → 3 6.3.17
single precision Conversion to single
EDCONP s, d precision
(d+1, d)

The number of steps is two for the Universal model QCPU and LCPU only.

The subset is effective only with Universal model QCPU and LCPU.

2 – 22
Instruction Tables Application instructions, Part 1

2.4.4 Data transfer instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

MOV s, d
BIN 16-bit data  
transfer (s) (d)
MOVP s, d
6.4.1
DMOV s, d
BIN 32-bit data  
transfer (s+1, s) (d+1, d)
DMOVP s, d

Floating point EMOV s, d


(s+1, s) (d+1, d)


data transfer 6.4.2
(Single
precision) EMOVP s, d Floating point value

Floating point EDMOV s, d Real number data


data transfer (s+3, s+2, s+1, s) 2  6.4.3
(Double →
precision) EDMOVP s, d (d+3, d+2, d+1, d)

$MOV s, d
Character
Transfers character string 3  6.4.4
string data data in s to d.
transfer
$MOVP s, d

CML s, d
BIN 16-bit data  
inversion (s) (d)
CMLP s, d
6.4.5
DCML s, d
BIN 32-bit data  
inversion (s+1, s) (d1+1, d1)
DCMLP s, d

BMOV s, n, d (s) (d)


BIN block data 4  6.4.6
transfer n
BMOVP s, n, d

FMOV s, n, d
Identical BIN (d)
block data (s) 4  6.4.7
transfer n
FMOVP s, n, d

DFMOV s, n, d
Identical 32-bit (d+1, d)
block data (s+1, s) 4  6.4.8
transfer n
DFMOVP s, n, d

Programming MELSEC System Q and L series 2 – 23


Application instructions, Part 1 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

XCH d1, d2
BIN 16-bit data 3 
exchange (d1) (d2)

XCHP d1, d2

6.4.9
DXCH d1, d2
BIN 32-bit data 3 
((d1)+1, d1) ((d2)+1, d2)
exchange
DXCHP d1, d2

BXCH n, d1, d2
(d1) (d2)
BIN block data 4 6.4.10
exchange n
BXCHP n, d1, d2

SWAP s
Upper and
lower byte 3 6.4.11
exchanges
SWAPP s


The number of program steps depends on the devices used and the type of CPU.
 QCPU, LCPU
– Word device: internal word devices (except for file register ZR) :2
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification :2
– Constant; No limitations :2
Devices other than the above : 3 (NOTE 1)
NOTE 1: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) :3
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification :3
– Constant; No limitations :3
Devices other than the above : 3 (NOTE 1)
 Basic model QCPU
– Word device: internal word devices (except for file register ZR) :2
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification :2
– Constant; No limitations :2
Devices other than the above : 3 (NOTE 1)
 Universal model QCPU, LCPU
– All devices that can be used : 2 (NOTE 1)
NOTE 1: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

2 – 24
Instruction Tables Application instructions, Part 1

2.4.5 Program branch instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Conditional jump
CJ p
(p = jump destination)
2  6.5.1
Conditional jump from
SCJ p next program scan
Jump (p = jump destination)
instructions
Jump instruction 2  6.5.1
JMP p (p = jump destination)

Jump to the end of a 1 6.5.2


GOEND —
program

2.4.6 Interrupt program execution control instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Interrupt DI — Disables the execution of 1


disabled an interrupt program

Interrupt EI — Enables invoking an 1


enabled interrupt program
6.6.1
Bit pattern of In the bit pattern
execution designated by s a
conditions of IMASK s particular interrupt 2
interrupt address is allocated to
programs each bit.

Return from an
interrupt End of an interrupt 1 6.6.2
program to the IRET — program
main program

2.4.7 Data refresh instructions


of steps
Number

Subset

Category Instruction Variables Meaning Execution Reference


Condition Section

RFS s, n The RFS instruction


refreshes the inputs and
I/O partial refresh outputs of the designates 3 6.7.1
range of I/O devices
RFSP s, n during one program scan.

Programming MELSEC System Q and L series 2 – 25


Application instructions, Part 1 Instruction Tables

2.4.8 Other convenient instructions

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

s+0
1-Phase Input s+1
count-up/-down UDCNT1 s, n, d Current
4 6.8.1
Counter count
0 1 2 3 4 5 6 7 6 5 4 3 2 1 0 -1 -2 -3 -2 -1 0 1 1

Switching period
of counter contact

s+0
2-Phase Input s+1
count-up/-down UDCNT2 s, n, d 4 6.8.2
Current
Counter count
0 1 2 3 4 5 4 3 2 1 0 -1 -2 -1

Switching period
of counter contact

(Time, the timer is set)


x n → (d)
Programmable TTMR d, n 3 6.8.3
(teaching) Timer
n=0:1, n=1:10, n=2:100
The STMR instruction uses
outputs designated by d+0
through d+3 to perform four
Special Function different timer functions:
Timer d+0: OFF delay timer output
(Timer instruction STMR s, n, d 3 6.8.4
for low speed d+1: One shot timer output after
OFF (Set by trailing edge)
timers)
d+2: One shot timer output after
ON (Set by leading edge)
d+3: ON delay timer output
The ROTC instruction rotates a
sector designated by s+2 on a
Positioning
instruction for ROTC s, n1, n2, d table with a specified number of 5 6.8.5
sectors (divisions) designated by
rotary tables n1 to a specified position
designated by s+1.
A RAMP instruction changes the
content in (d1)+0 gradually from
Ramp Signal RAMP n1, n2, n3, the initial value designated by n1 6 6.8.6
d1, d2
to the final value designated by
n2.
The SPD instruction counts
pulses at the input designated by
Pulse density 4 6.8.7
measurement SPD s, n, d s for a period of time specified by
n. The result of the
measurement is stored in d.
The PLSY instruction outputs a
Pulse output with
adjustable PLSY s1, s2, d number of pulses specified by s2 4 6.8.8
at a frequency specified by s1 to
number of pulses an output designated by d.

Pulse width PWM n1, n2, d


n1
4 6.8.9
modulation n2

The MTR instruction reads the


information of 16 bits beginning
from the device designated by s.
Building an input The number of repetitions (rows) 5 6.8.10
MTR s, n, d1, d2
matrix is designated by n.
The conditions of read data are
stored in the device designated
by d2 onwards.

2 – 26
Instruction Tables Application instructions, Part 2

2.5 Application instructions, Part 2


2.5.1 Logical operation instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

WAND
s, d (d) ∧ (s) → (d) 3 

WANDP

WAND
s1, s2, d1 (s1) ∧ (s2) → (d1) 4 

WANDP
7.1.1
DAND
(d+1, d) ∧ (s+1, s)  
Logical product s, d
→ (d+1, d)
DANDP

DAND
((s1)+1, s1) ∧ ((s2)+1, s2)  
s1, s2, d → (d+1, d)
DANDP

BKAND (s1) (s2) (d)


s1, s2, n, d 5 7.1.2
∧ n
BKANDP

WOR
s, d (d) ∨ (s) → (d) 3 

WORP

WOR
s1, s2, d1 (s1) ∨ (s2) → (d1) 4 

WORP
7.1.3
DOR
(d+1, d) ∨ (s+1, s)  
Logical sum s, d
→ (d+1, d)
DORP

DOR
s1, s2, d ((s1)+1, s1) ∨ ((s2)+1, s2)  
→(d+1, d)
DORP

BKOR (s1) (s2) (d)


s1, s2, n, d 5 7.1.4
∨ n
BKORP

Programming MELSEC System Q and L series 2 – 27


Application instructions, Part 2 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

WXOR
s, d (d) ∨ (s) → (d) 3 

WXORP

WXOR
s1, s2, d1 (s1) ∨ (s2) → (d1) 4 

WXORP
7.1.5
DXOR
Logical (d+1, d) ∨ (s+1, s)  
s, d
exclusive OR → (d+1, d)
DXORP

DXOR
s1, s2, d ((s1)+1, s1) ∨ ((s2)+1, s2)  
→ (d+1, d)
DXORP

BKXOR (s1) (s2) (d)


s1, s2, n, d 5 7.1.6
∨ n
BKXORP

WXNR
s, d (d) ∨ (s)→ (d) 3 

WXNRP

WXNR (s1) ∨ (s2) 5 (d1)


s1, s2, d1 4 

WXNRP
7.1.7
DXNR (d+1, d) ∨ (s+1, s)
Logical s, d 5 (d+1, d)  
exclusive NOR
DXNRP

DXNR
((s1)+1, s1) ∨ ((s2)+1, s2)  
s1, s2, d
5 (d+1, d)
DXNRP

BKXNR
(s1) (s2) (d)
s1, s2, n, d 5 7.1.8
∨ n
BKXNRP

2 – 28
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section


The number of steps is three for the Universal model QCPU and LCPU only.

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 5 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 5 (NOTE 1)
– Constant; No limitations : 5 (NOTE 1)
Devices other than the above : 3 (NOTE 2)
 Basic model QCPU, Universal model QCPU, LCPU
– All devices that can be used : 3 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

The number of program steps depends on the devices used and the type of CPU.
 High Performance model QCPU, Process CPU, Redundant CPU
– Word device: internal word devices (except for file register ZR) : 6 (NOTE 1)
– Bit device: whose device numbers are multiplies of 16, whose digit designation is K8,
and which use no index qualification : 6 (NOTE 1)
– Constant; No limitations : 6 (NOTE 1)
Devices other than the above : 4 (NOTE 2)
 Basic model QCPU
– All devices that can be used : 4 (NOTE 2)
 Universal model QCPU, LCPU
– All devices that can be used : 3 (NOTE 2)
NOTE 1: For these models the number of steps increases but processing speed becomes faster.
NOTE 2: The number of steps may increase due to the conditions described in section 3.11 "Number of program steps".

Programming MELSEC System Q and L series 2 – 29


Application instructions, Part 2 Instruction Tables

2.5.2 Rotation instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

ROR b15 (d) b0 SM700

n, d 3 

RORP rotates by n bits to the


Data rotation to right
the right 7.2.1
(16-bit)
RCR b15 (d) b0 SM700

n, d 3 

RCRP rotates by n bits to the


right

ROL
SM700 b15 (d) b0
n, d 3 

ROLP rotates by n bits to the left


Data rotation to
the left 7.2.2
(16-bit)
RCL
SM700 b15 (d) b0
n, d 3 

RCLP rotates by n bits to the left

DROR (d+1) (d)


b31 to b16 b15 to b0 SM700
n, d 3 

DRORP rotates by n bits to the


Data rotation to right
the right 7.2.3
(32-bit)
DRCR (d+1) (d)
b31 to b16 b15 to b0 SM700
n, d 3 

DRCRP rotates by n bits to the


right

DROL (d+1) (d)


SM700 b31 to b16 b15 to b0
n, d 3 

DROLP rotates by n bits to the left


Data rotation to
the left 7.2.4
(32-bit)
DRCL (d+1) (d)
SM700 b31 to b16 b15 to b0
n, d 3 

DRCLP
rotates by n bits to the left

2 – 30
Instruction Tables Application instructions, Part 2

2.5.3 Shift instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

SFR b15 bn b0
n, d 3 

SFRP b15 b0 SM700


Shift a 16-bit 0 to 0
data word by 7.3.1
n bits
SFL b15 bn b0
n, d 3 

SFLP SM700 b15 b0


0 to 0

n
BSFR
(d)
n, d 3
BSFRP SM700
0
Shift n bit 7.3.2
devices by 1 bit
n
BSFL
(d)
n, d 3
BSFLP SM700
0

SFTBR n1
n2

n1, n2, d (d) 4


SFTBRP SM700
Shift n bit 0 0
devices by 7.3.3
n bits n1
SFTBL
n2

n1, n2, d (d) 4


SFTBLP SM700
0 0

n
DSFR
(d)
n, d 3 

DSFRP
Shift n word 0
devices by 7.3.4
one digit n
DSFL
(d)
n, d 3 

DSFLP
0

n1
SFTWR n2

n1, n2, d (d) 4


SFTWRP
Shift n word 0 0
devices by 7.3.5
n words
SFTWL n1
n2
n1, n2, d (d) 4
SFTWLP
0 0

Programming MELSEC System Q and L series 2 – 31


Application instructions, Part 2 Instruction Tables

2.5.4 Bit processing instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

BSET (d)
b15 bn b0 3 
n, d
BSETP 1
Set / reset 7.4.1
single bits
BRST (d)
b15 bn b0 3 
n, d
BRSTP 0

TEST (s1)
b15 to b0 (d)
s1, s2, d 4

Test condition TESTP Bit designated by s2

of single bits in 7.4.2


16-/32-bit data
words DTEST (s1)
b31 to b0 (d)
s1, s2, d 4
DTESTP Bit designated by s2

BKRST (s) ON (s) OFF


Reset sections OFF OFF
RESET
of bits s, n n 3 7.4.3
in a batch
BKRSTP ON OFF
ON OFF

2 – 32
Instruction Tables Application instructions, Part 2

2.5.5 Data processing instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

SER (s2)
(s1)
n
s1, s2, d, n 5
SERP (d) : identical No.
(d+1) : Number of
matches
Search 16-bit 7.5.1
data
DSER 32 bits (s2)
(s1)
n
s1, s2, d, n 5
DSERP (d) : identical No.
(d+1) : Number of
matches

SUM (s)
b15 b0
s, d 3 
(d): Binary coded
SUMP number of
Check data set bits
bits 7.5.2
(16-/32-bit)
DSUM (s+1) (s)

s, d 3 
(d): Binary coded
DSUMP number of
set bits

Decoding from 8 to 256 bits

DECO
(d)
Decoding data s, d, n (s) decode 4 7.5.3
n
2 Bit
n
DECOP

Encoding from 256 to 8 bits


ENCO
(d)
Encoding data s, d, n n
encode (s) 4 7.5.4
2 Bit
n
ENCOP

SEG
b3 to b0
7-segment (s) (d) 3  7.5.5
s, d
decoding
7SEG
SEGP

Programming MELSEC System Q and L series 2 – 33


Application instructions, Part 2 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

The DIS instruction disunites a


DIS 16-bit data value to groupings
of 4 bits. The data value to be
s, n, d disunited in s, the number of 4- 4 7.5.6
bit groupings in n, and the first
DISP number of destination device in
d must be specified.

UNI The UNI instruction separates


each 4 lowest bits of up to four
s, n, d 16-bit data values and unites 4 7.5.7
their conditions in one 16-bit
UNIP data value.

The NDIS instruction disunites


NDIS data in devices specified from
s1 on to bit groupings with a
s1, s2, d number of bits specified by s2.
The disunited bit groupings are
NDISP stored separately in the device
specified by d onwards.
Disunite/unite
16-bit data 4 7.5.8
words The NUNI instruction
NUNI separates bit groupings of a
size specified by s2 from
devices specified by s1 and
s1, s2, d unites these bit groupings in
one data value. The bit
NUNIP groupings are stored
successively from the device
specified by d onwards.

WTOB For this instruction the data


values in s to be disunited, the
s, n, d number of byte units in n, and
the first number of destination
WTOBP device in d must be specified.
4 7.5.9
BTOW The initial number of data
value in s to be united, the
s, n, d number of byte units n, and
destination device in d must be
BTOWP specified.

The MAX instruction searches


MAX for maximum values in 16-bit
data blocks. The number of
s, n, d data blocks to be searched
through is specified by n. The
MAXP greatest value found in s
Search through s+(n-1) is stored in d.
maximum 4 7.5.10
values in 16-/ The DMAX instruction
32-bit data DMAX searches for maximum values
in 32-bit data blocks. The
s, n, d number of data blocks to be
searched through is specified
DMAXP by n. The greatest value found
in s through s+(n-1) is stored in
d.

The MIN instruction searches


MIN for minimum values in 16-bit
data blocks. The number of
s, n, d data blocks to be searched
through is specified by n. The
MINP smallest value found in s
Searching
minimum through s+(n-1) is stored in d.
4 7.5.11
values in 16-/ The DMIN instruction searches
32-bit data DMIN for minimum values in 32-bit
data blocks. The number of
s, n, d data blocks to be searched
through is specified by n. The
DMINP smallest value found in s
through s+(n-1) is stored in d.

2 – 34
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

The SORT instruction sorts


16-bit data specified by s1 in
SORT ascending or descending
order. The number of data to
be sorted is specified by n.
Sorting 16-/ 6 7.5.12
32-bit data s1, n, s2, d1, d2
The DSORT instruction sorts
32-data specified by s1 in
DSORT ascending or descending
order. The number of data to
be sorted is specified by n.

The WSUM instruction


WSUM calculates the total of 16-bit
s, n, d data blocks in the device 4 7.5.13
specified by s. The result is
WSUMP stored in the device specified
Calculating
totals of 16-/ by d and d+1.
32-bit BIN data The DWSUM instruction
blocks DWSUM calculates the total of 32-bit
data blocks in the device 4 7.5.14
s, n, d specified by s and s+1. The
DWSUMP result is stored in d through
d+3.

Calculates the mean of n-point


MEAN devices (in 16-bit units)
s, n, d starting from the device 4
specified by (s), and then
MEANP stores the result into the
Calculation of device specified by (d).
7.5.15
averages Calculates the mean of n-point
DMEAN devices (in 32-bit units)
starting from the device 4
s, n, d specified by (s), and then
DMEANP stores the result into the
device specified by (d).

Programming MELSEC System Q and L series 2 – 35


Application instructions, Part 2 Instruction Tables

2.5.6 Structured program instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

The FOR/NEXT loop


FOR n repeats single program 2
sequences without
setting an input
condition. The program 7.6.1
sequence located
NEXT between the FOR and 1
Repetition the NEXT command is
instructions repeated for n times.

BREAK The BREAK instruction


terminates a FOR/NEXT
p, d loop execution and jumps 3 7.6.2
to the pointer specified
BREAKP by p.

The CALL instruction


CALL calls a subroutine
p program specified by a
pointer p. 2+n   7.6.3
p, s1 to sn 
s1 to sn are arguments
CALLP sent to subroutine
program (n <= 5).
The RET instruction
RET marks the end of a 1 7.6.4
subroutine program.
Subroutine On resetting the
program calls FCALL execution condition for
the FCALL instruction,
the contacts and coils in
the subroutine program
p specified in p (pointer/
label) are treated as if the 2+n 7.6.5
p, s1 to sn 
execution condition of the
FCALLP according instruction was
not set.
s1 to sn are arguments
sent to subroutine
program (n <= 5).
The ECALL instruction
ECALL calls a subroutine
Subroutine program specified by a
file name, p pointer address (label) in
program calls a program file specified 2+n 7.6.6
between file name, p, s1 to sn 
program files by a file name.
ECALLP s1 to sn are arguments
sent to subroutine
program (n <= 5).
On resetting the
EFCALL execution condition for
the EFCALL instruction,
the contacts and coils in
the subroutine program 3+n 7.6.7
file name, p specified in p (pointer/ 
EFCALLP label) are treated as if the
execution condition of the
according instruction was
not set.
Subroutine
program calls  Executes subroutine
between program p when input
program files condition is met.
 Performs non-
execution processing
XCALL p, s1 to sn of subroutine program 2+n 7.6.8
p if input conditions 
have not been met.
(s1 to sn are
arguments sent to
subroutine program.
n <= 5)

2 – 36
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Performs auto refresh of


intelligent function
modules, link refresh,
COM auto refresh of CPU 1 7.6.9
shared memory, and
communications with
peripherals.
Select refresh
Performs auto refresh of
CCOM intelligent function 1 7.6.11
modules, auto refresh of
CPU shared memory,
and communications with
CCOMP peripherals after the 1 7.6.11
input conditions are met.
IX s The IX and IXEND 2
instructions perform
Index index qualification on
qualification of those devices in the 7.6.12
entire ladders IXEND program part located 1
between the IX and
IXEND instructions.
The IXDEV and IXSET
Designation of IXDEV instructions read the 1
addresses of the devices
qualification in the offset designation
values in index 7.6.13
qualification of area and write these
p, d offset numbers to an
entire ladders IXSET 3
index table in the device
designated by d.

n indicates number of arguments for subroutine program.

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).

The subset is effective only with the Universal model QCPU and LCPU.

Programming MELSEC System Q and L series 2 – 37


Application instructions, Part 2 Instruction Tables

2.5.7 Data table operation instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

FIFW (s) (d) Pointer Pointer + 1


Write data to a 3 7.7.1
data table s, d
Pointer + 1
FIFWP Device

FIFR (s) Pointer Pointer - 1 (d )


Read data
entered first s, d 3 7.7.2
from data table
FIFRP

FPOP (s) Pointer Pointer - 1 (d )


Read data
entered last s, d 3 7.7.3
from data table
FPOPP Pointer + 1
Device

FDEL
Delete
specified data
blocks from
data table FDELP
s, n, d 4 7.7.4

FINS (s) (d) Pointer Pointer + 1


Insert specified
data blocks in
data table
FINSP Designated by n

2 – 38
Instruction Tables Application instructions, Part 2

2.5.8 Buffer memory access instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

FROM The FROM instruction


reads 1-word data (16-
bit) from the buffer
memory of a special
Reading data FROMP function module.
from a special 5 7.8.1
n1, n2, n3, d
function
module DFRO The DFRO instruction
reads 2-word data (32-
bit) from the buffer
memory of a special
DFROP function module.

TO The TO instruction writes


1-word data (16-bit) from
the memory of the CPU
to the buffer memory of a
Writing data to TOP special function module.
a special 5 7.8.2
function s, n1, n2, n3
The DTO instruction
module DTO writes 2-word data (32-
bit) from the memory of
the CPU to the buffer
DTOP memory of a special
function module.

2.5.9 Display instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

SM701 set (1):


Output of an ASCII
character string of 16
characters to an output
module. The character
string, divided into twice 8
characters, is read from
the address area s and
PR s, d output to the outputs 3 7.9.1
specified by d.
SM701 not set (0):
ASCII Output of ASCII character
character string data up to the
output character code "00H" in
hexadecimal format from
the address area s to the
outputs specified by d.

The PRC instruction


outputs a comment of a
device (in ASCII code) to
an output module. 3 7.9.2
PRC s, d
If SM701 is set (1), 16
characters are output;
if SM701 is not set (0), 32
characters are output.

Clear display LEDR Resetting annunciators 1 7.9.3


and error displays

Programming MELSEC System Q and L series 2 – 39


Application instructions, Part 2 Instruction Tables

2.5.10 Debugging and failure diagnosis instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

The CHKST instruction


starts the execution of the
CHK instruction. If the
execution condition for
CHKST the CHKST instruction is
not set (0), the program
step following the CHK
instruction will be
executed.
1 7.10.1
The CHK instruction
supports failure check
operations for contact
circuits. Once an error
CHK occurs within such a
Failure check circuit, the device in d1 is
set and the
corresponding error code
is stored in d2.

The CHKCIR instruction


generates error check
circuits for the CHK
CHKCIR instruction and starts the
program section with the
generated error check 1 7.10.2
circuits.

End instructions for a


CHKEND program part with
generated check circuits.

2 – 40
Instruction Tables Application instructions, Part 2

2.5.11 Character string processing instructions

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning Condition Section

The BINDA instruction


BINDA converts a 16-bit binary
value specified by s into a
5-digit decimal value in
Conversion of BINDAP ASCII code and stores it in
16-/32-bit binary the device specified in d.
data into s, d 3 7.11.1
decimal values in The DBINDA instruction
ASCII code DBINDA converts 32-bit binary data
specified by s into a 10-digit
decimal value in ASCII
DBINDAP code and stores it in the
device specified in d.
The BINHA instruction
BINHA converts 16-bit binary data
specified by s into a 4-digit
hexadecimal value in ASCII
Conversion of BINHAP code and stores it in the
16-/32-bit binary devices specified by d.
data into s, d 3 7.11.2
hexadecimal values The DBINHA instruction
in ASCII code DBINHA converts 32-bit binary data
specified by s into a 8-digit
hexadecimal value in ASCII
DBINHAP code and stores it in the
devices specified by d.
The BCDDA instruction
BCDDA converts 4-digit BCD data
specified by s into the
ASCII format and stores it
BCDDAP in the devices specified by
Conversion of 4-/8- d.
digit BCD data into s, d 3 7.11.3
ASCII code The DBCDDA instruction
DBCDDA converts 8-digit BCD data
specified by s into the
ASCII format and stores it
DBCDDAP in the devices specified by
d.
The DABIN instruction
DABIN converts the 5-digit decimal
ASCII data specified by s
into the BIN 16-bit format
DABINP and stores it in the devices
Conversion of specified by d.
decimal ASCII data 3 7.11.4
s, d The DDABIN instruction
into BIN 16-/32-bit
binary data DDABIN converts the 10-digit
decimal ASCII data
specified by s into the BIN
32-bit format and stores it
DDABINP in the devices specified by
d.
The HABIN instruction
HABIN converts the 4-digit
hexadecimal ASCII data in
the device specified by s
into the BIN 16-bit binary
HABINP format and stores it in the
Conversion of
hexadecimal ASCII devices specified by d.
s, d 3 7.11.5
data into 16-/32-bit The DHABIN instruction
binary data DHABIN converts the 8-digit
hexadecimal ASCII data
specified in the area s into
the BIN 32-bit format and
DHABINP stores it in the devices
specified by d.

Programming MELSEC System Q and L series 2 – 41


Application instructions, Part 2 Instruction Tables

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning Condition Section

The DABCD instruction


DABCD converts the decimal ASCII
data in s into the 4-digit
BCD data format and
Conversion of DABCDP stores it in the devices
decimal ASCII data specified by d.
s, d 3 7.11.6
into 4-/8-digit BCD The DDABCD instruction
data DDABCD converts the decimal ASCII
data specified by s into the
8-digit BCD format and
DDABCDP stores it in the devices
specified in d.

COMRD The COMRD instruction


reads comment data from
Read-out of 3 7.11.7
comment data s, d the device specified by s
and stores it as ASCII code
COMRDP in the area d.

LEN The length instruction


Detection of detects the length of a
character string s, d character string specified in 3 7.11.8
length s and stores the result in
LENP the device specified by d.

Adds a decimal point to the


STR BIN 16-bit binary value in
the device specified by s2
to the digit specified by s1,
converts the data into a
STRP character string, and stores
Conversion of it in the area of the devices
BIN 16-/32-bit specified by d.
binary data into s1, s2, d 4 7.11.9
character string Adds a decimal point to the
data DSTR BIN 32-bit binary value in
the device specified by s2
to the digit specified by the
device s1, converts the
DSTRP data into a character string,
and stores it in the area of
the devices specified by d.
Converts the character
VAL strings stored in the area s
into BIN 16-bit data. The
number of digits and the
Conversion of VALP binary value are stored in
character string d1 and d2.
s, d1, d2 4 7.11.10
data into BIN 16-/
32-bit binary data DVAL Converts the character
strings stored in s into BIN
32-bit data. The number of
digits and the binary value
DVALP are stored in d1 and d2.

Converts the floating point


Conversion of ESTR data in s1 into character
floating point data string data. The data format 4 7.11.11
into character string s1, s2, d of the character string is
data ESTRP specified in s2. The result
is stored in d.

EVAL Converts the character


Conversion of
character string string in s into a decimal
s, d floating point number (real 3 7.11.12
data into decimal number). The result is
floating point data EVALP stored in d.

Converts the 16-bit binary


ASC data stored from s onwards
Conversion of 16-bit into the hexadecimal ASCII
data into ASCII s, n, d format and stores the result 4 7.11.13
code considering the number of
ASCP characters specified by n
from d onwards.

2 – 42
Instruction Tables Application instructions, Part 2

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning Condition Section

Converts the hexadecimal


Conversion of HEX ASCII characters from s
onwards into binary values.
hexadecimal s, n, d The number of characters 4 7.11.14
ASCII values into
binary values to be converted is specified
HEXP by n. The result is stored
from d onwards.

Extraction of RIGHT Stores n characters from


character string the right side of the
data s, n, d character string (end of
(right part of character string) in s. The
character string) RIGHTP characters are stored in d.
4 7.11.15
Extraction of LEFT Stores n characters from
character string the left side of the character
data s, n, d string (beginning of
(left part of character string) in s. The
character string) LEFTP characters are stored in d.

MIDR Stores a specified part of


the character string stored
s1, s2, d in s. The first character of
Selecting and the part to be stored is
MIDRP specified in s2.
moving parts of
character strings 4 7.11.16
into a character Stores a part of specified
string MIDW length of the character
string stored in s1 in the
s1, s2, d
area specified in d. The first
MIDWP address of the storage area
in d is specified in s2.
Searches the character
INSTR string specified in s1 within
Search for the character string data 5 7.11.17
character strings s1, s2, n, d specified by s2. The search
INSTRP begins with the character
specified in n.
Inserts the character string
STRINS data specified by (S) to the
Insert character s, n, d (n)th character (insert 4 7.11.18
strings position) from the initial
STRINSP character string data
specified by (D).

STRDEL Deletes the (n2) characters


data specified by (d)
Delete character 4 7.11.19
strings d n1, n2 starting from the
device(insert position)
STRDELP specified by n1.

Calculates the BCD format


EMOD from the floating point
Floating point data number in s1 considering
conversion with s1, s2, d1 4 7.11.20
BCD representation the decimal point shift to
EMODP the right specified in s2.
The result is stored in d1.
Calculates the decimal for-
EREXP mat of the floating point
BCD data
data from the floating point
conversion with s1, s2, d1 data in BCD format in s1, 3 7.11.21
decimal floating
point format considering the decimal
EREXPP places specified in s2. The
result is stored in d1.

Programming MELSEC System Q and L series 2 – 43


Application instructions, Part 2 Instruction Tables

2.5.12 Special function instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Sine SIN
calculation SIN(s+1, s)
(Floating point s, d → 3 7.12.1
single (d+1, d)
precision) SINP

Cosine COS
calculation COS(s+1, s)
(Floating point s, d → 3 7.12.3
single (d+1, d)
precision) COSP

Tangent TAN
calculation TAN(s+1, s)
(Floating point s, d → 3 7.12.5
single (d+1, d)
precision) TANP

Arcus sine ASIN


calculation ASIN(s+1, s)
(Floating point s, d → 3 7.12.7
single (d+1, d)
precision) ASINP

Arcus cosine ACOS


calculation ACOS(s+1, s)
(Floating point s, d → 3 7.12.9
single (d+1, d)
precision) ACOSP

Arcus tangent ATAN


calculation ATAN(s+1, s)
(Floating point s, d → 3 7.12.11
single (d+1, d)
precision) ATANP

Sine SIND
calculation SIN(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.2
double (d+3, d+2, d+1, d)
precision) SINDP

Cosine COSD
calculation COS(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.4
double (d+3, d+2, d+1, d)
precision) COSDP

Tangent TAND
calculation TAN(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.6
double (d+3, d+2, d+1, d)
precision) TANDP

Arcus sine ASIND


calculation ASIN(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.8
double (d+3, d+2, d+1, d)
precision) ASINDP

Arcus cosine ACOSD


calculation ACOS(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.10
double (d+3, d+2, d+1, d)
precision) ACOSDP

2 – 44
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

Arcus tangent ATAND


calculation ATAN(s+3, s+2, s+1, s)
(Floating point s, d → 3 7.12.12
double (d+3, d+2, d+1, d)
precision) ATANDP

RAD (s+1, s)

s, d (d+1, d) 3 7.12.13
Conversion from degrees
RADP into radian
Conversion
from degrees
into radian (s+3, s+2, s+1, s)
RADD

s, d (d+3, d+2, d+1, d) 3 7.12.14
Conversion from degrees
RADDP into radian

DEG
(s+1, s) → (d+1, d)
s, d Conversion from radian 3 7.12.15
into degree
DEGP
Conversion
from radian
into degree (s+3, s+2, s+1, s)
DEGD

s, d (d+3, d+2, d+1, d) 3 7.12.16
Conversion from radian
DEGDP into degree

POW
(s1+1, s1)(s2+1, s2)
s1, s2, d → 4 7.12.17
(d+1, d)
POWP
Exponentiation
POWD (s1+3, s1+2, s1+1,
s1, s2, d s1)(s2+3, s2+2, s2+1, s2) 4 7.12.18

POWDP (d+3, d+2, d+1, d)

SQR
√(s+1, s)
s, d → 3 7.12.19
(d+1, d)
SQRP
Square root
calculation
SQRD
√(s+3, s+2, s+1, s)
s, d → 3 7.12.20
(d+3, d+2, d+1, d)
SQRDP

EXP
s, d e(s+1, s) → (d+1, d) 3 7.12.21
EXPP
Floating point
value as
exponent of e
EXPD
e(s+3, s+2, s+1, s)
s, d → 3 7.12.22
(d+3, d+2, d+1, d)
EXPDP

Programming MELSEC System Q and L series 2 – 45


Application instructions, Part 2 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

LOG
LOG e(s+1, s)
s, d → 3 7.12.23
(d+1, d)
LOGP
Logarithm
(natural)
calculation
LOGD
LOG e(s+3, s+2, s+1, s)
s, d → 3 7.12.24
(d+3, d+2, d+1, d)
LOGDP

LOG10
log10 (s+1, s)
s, d → 3 7.12.25
(d+1, d)
LOG10P
Common
logarithm
LOG10D
log10 (s+3, s+2, s+1, s)
s, d → 3 7.12.26
(d+3, d+2, d+1, d)
LOG10DP

RND
Randomize Stores the generated 2
d
value random value in d.
RNDP
7.12.27
SRND
Updates the series of
Update s random values stored 2
random values
in s.
SRNDP

Square root BSQR


calculation (s) (d) +0 Integer
from s, d 3
4-digit BCD +1 Decimal place
data BSQRP
7.12.28
Square root BDSQR
calculation
from s, d (d) +0 Integer 3
8-digit BCD +1 Decimal place
data BDSQRP

BSIN
Sine
calculation s, d 3 7.12.29
from BCD data
BSINP

BCOS
Cosine
calculation s, d 3 7.12.30
from BCD data
BCOSP

BTAN
Tangent
calculation s, d 3 7.12.31
from BCD data
BTANP

2 – 46
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

BASIN
Arcus sine
calculation s, d 3 7.12.32
from BCD data
BASINP

BACOS
Arcus cosine
calculation s, d 3 7.12.33
from BCD data
BACOSP

BATAN
Arcus tangent
calculation s, d 3 7.12.34
from BCD data
BATANP

Programming MELSEC System Q and L series 2 – 47


Application instructions, Part 2 Instruction Tables

2.5.13 Data control instructions

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning Condition Section

If (s3)<(s1)
the data value
LIMIT in s1 is stored in d.
If (s1)≤(s3)≤(s2)
s1, s2, s3, d the data value in
s3 is stored in d.
LIMITP If (s2)<(s3)
the data value in
s2 is stored in d.

Upper and lower If


limit controls for ((s3)+1, s3)<((s1)+1, s1)
the data value in 5 7.13.1
BIN 16-/32-bit
data DLIMIT ((s1)+1, s1) is
stored in (d+1, d).
If ((s1)+1, s1)≤
((s3)+1, s3) <((s2)+1,s2)
s1, s2, s3, d the data value in
((s3)+1, s3) is
stored in (d+1, d).
If ((s2)+1, s2)<
DLIMITP ((s3)+1, s3)<((s2)+1, s2)
the data value in
((s2)+1, s2) is
stored in (d+1, d).
If (s1)≤(s3)≤(s2)
BAND 0 → (d)
If (s3)<(s1)
s1, s2, s3, d (s3)–(s1)→ (d)
BANDP If (s2)<(s3)
(s3)–(s2)→ (d)
If
Dead band DBAND ((s1)+1, s1)≤((s3)+1, s3)
controls for BIN ≤((s2)+1, s2) 5 7.13.2
16-/32-bit data 0 → (d+1, d)
If
s1, s2, s3, d ((s3)+1, s3)<(s1+1, s1)
((s3)+1, s3) – ((s1)+1, s1)
DBANDP →(d+1, d)
If
((s2)+1, s2)<((s3)+1, s3)
((s3)+1, s3) – ((s2)+1, s2)
→ (d+1, d)
If s3 = 0:
ZONE 0 → (d)
If s3 > 0:
s1, s2, s3, d s3 + s2 → (d)
ZONEP If s3 < 0:
s3 – s1 → (d)
Zone control for
BIN 16-/32-bit If ((s3)+1, s3) = 0 5 7.13.3
data DZONE 0 → (d+1, d)
If ((s3)+1, s3) > 0
s1, s2, s3, d ((s3)+1, s3) + ((s2)+1, s2)
→ (d+1, d)
DZONEP If ((s3)+1, s3) < 0
((s3)+1, s3) + ((s1)+1, s1)
→ (d+1, d)

2 – 48
Instruction Tables Application instructions, Part 2

of steps
Number
Execution Reference

Subset
Category Instruction Variables Meaning Condition Section

Executes scaling for the


scaling conversion data
SCL (16-bit data units) specified
by (s2) with the input value
specified by (s1), and then
stores the result into the 4
s1, s2, d device specified by (D).
The scaling conversion is
SCLP executed based on the
scaling conversion data
stored in the device
Point-by point specified by (s2) and up.
7.13.4
coordinate data Executes scaling for the
scaling conversion data
DSCL (32-bit data units) specified
by (s2) with the input value
specified by (s1), and then
s1, s2, d stores the result into the 4
device specified by (D).
The scaling conversion is
DSCLP executed based on the
scaling conversion data
stored in the device
specified by (s2) and up.
Executes scaling for the
scaling conversion data
SCL2 (16-bit data units) specified
by (s2) with the input value
specified by (s1), and then
s1, s2, d stores the result into the 4
device specified by (D).
The scaling conversion is
SCL2P executed based on the
scaling conversion data
stored in the device
X or Y specified by (s2) and up.
7.13.5
coordinate data Executes scaling for the
scaling conversion data
DSCL2 (32-bit data units) specified
by (s2) with the input value
specified by (s1), and then
stores the result into the 4
s1, s2, d
device specified by (D).
The scaling conversion is
DSCL2P executed based on the
scaling conversion data
stored in the device
specified by (s2) and up.

Programming MELSEC System Q and L series 2 – 49


Application instructions, Part 2 Instruction Tables

2.5.14 File register switching instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

The RSET instruction


Switch RSET switches from a file
instruction for register block being in 2 7.14.1
file register s use by a program to a file
blocks RSETP register block with the
number specified by s.
The QDRSET instruction
Switch QDRSET switches from a file
instruction for s register file being in use 2+n 7.14.2
file register by a program to a file 
files QDRSETP register file specified by
s.

QCDSET The QCDSET instruction


Switch switches from a comment
instruction for s file being in use by a 2+n 7.14.3

comment files program to a comment
QCDSETP file specified by s.

 n = (number of program name characters)/2 = Number of additional steps (Decimal fractions are rounded up)

2 – 50
Instruction Tables Application instructions, Part 2

2.5.15 Clock instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

DATERD (Clock →d+0 Year


element) d+1 Month
d+2 Day
Reading d 2 7.15.1
clock data d+3 Hour
DATERDP d+4 Minute
d+5 Sec.
d+6 Day of the week

DATEWR s+0 Year →(Clock


s+1 Month element)
s+2 Day
Writing s s+3 Hour 2 7.15.2
clock data
s+4 Minute
DATEWRP
s+5 Sec.
Day of the
s+6 week

DATE+ s1 s2 d
Adding Hour Hour Hour
4 7.15.3
s1, s2, d +
clock data Minute Minute Minute
Second Second Second
DATE+P

DATE-
s1 s2 d
Subtracting 4 7.15.4
s1, s2, d Hour Hour Hour
clock data Minute - Minute Minute
Second Second Second
DATE-P

Changing clock SECOND s d


data format Hour Second
from hh:mm:ss s, d Minute
Second
to seconds SECONDP
3 7.15.5
Changing clock HOUR
s d
data format s, d Second Hour
from seconds Minute
to hh:mm:ss HOURP Second

Programming MELSEC System Q and L series 2 – 51


Application instructions, Part 2 Instruction Tables

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

LDDT=
s1 Year s2 Year

ANDDT= s1, s2, n s1+1 Month = s2+1 Month Comparison 4
operation
ORDT= s1+2 Day s2+2 Day result

LDDT<>
s1 Year s2 Year

ANDDT<> s1, s2, n s1+1 Month <> s2+1 Month Comparison 4
operation
ORDT<> s1+2 Day s2+2 Day result

LDDT>
s1 Year s2 Year

ANDDT> s1, s2, n s1+1 Month < s2+1 Month Comparison 4
operation
ORDT> s1+2 Day s2+2 Day result
Date 7.15.6
comparison LDDT<=
s1 Year s2 Year

ANDDT<= s1, s2, n s1+1 Month <= s2+1 Month Comparison 4
operation
ORDT<= s1+2 Day s2+2 Day result

LDDT<
s1 Year s2 Year

ANDDT< s1, s2, n s1+1 Month > s2+1 Month Comparison 4
operation
ORDT< s1+2 Day s2+2 Day result

LDDT>=
s1 Year s2 Year

ANDDT>= s1, s2, n s1+1 Month >= s2+1 Month Comparison 4
operation
ORDT>= s1+2 Day s2+2 Day result

LDTM=
s1 Hour s2 Hour

ANDTM= s1, s2, n s1+1 Minute = s2+1 Minute Comparison 4
operation
ORTM= s1+2 Second s2+2 Second result

LDTM<>
s1 Hour s2 Hour

ANDTM<> s1, s2, n s1+1 Minute <> s2+1 Minute Comparison 4
operation
ORTM<> s1+2 Second s2+2 Second result

LDTM>
s1 Hour s2 Hour

ANDTM> s1, s2, n s1+1 Minute < s2+1 Minute Comparison 4
operation
ORTM> s1+2 Second s2+2 Second result
Clock 7.15.7
comparison LDTM<=
s1 Hour s2 Hour

ANDTM<= s1, s2, n s1+1 Minute <= s2+1 Minute Comparison 4
operation
ORTM<= s1+2 Second s2+2 Second result

LDTM<
s1 Hour s2 Hour

ANDTM< s1, s2, n s1+1 Minute > s2+1 Minute Comparison 4
operation
ORTM< s1+2 Second s2+2 Second result

LDTM>= s1 Hour s2 Hour



ANDTM>= s1, s2, n s1+1 Minute >= s2+1 Minute Comparison 4
operation
ORTM>= s1+2 Second s2+2 Second result

2 – 52
Instruction Tables Application instructions, Part 2

2.5.16 Expansion clock instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

(Clock →d+0 Year


element)
S.DATERD
d+1 Month
Reading clock d+2 Day
data of d+3 Hour 6 7.16.1
d
expansion d+4 Minute
block d+5 Sec.
SP.DATERD d+6 Dayweek
of the

d+7 1/1000 sec.

S.DATE+ (s1) (s2) (d)


Adding Hour Hour Hour
clock data of Minute Minute Minute
8 7.16.2
s1, s2, d
expansion Sec. + Sec. → Sec.
block — — —
SP.DATE+ 1/1000 1/1000 1/1000
sec. sec. sec.

(s1) (s2) (d)


S.DATE- Hour Hour Hour
Subtracting
clock data of Minute Minute Minute
s1, s2, d Sec. Sec. → Sec. 8 7.16.3
expansion –
block — — —
1/1000 1/1000 1/1000
SP.DATE- sec. sec. sec.

Programming MELSEC System Q and L series 2 – 53


Application instructions, Part 2 Instruction Tables

2.5.17 Program instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

PSTOP The PSTOP instruction


Switching
programs into s sets the program 2+n 7.17.1
specified by the device in 
stand-by mode s into the stand-by mode.
PSTOPP

The POFF instruction


Switching POFF sets the program
programs into specified by the device in
stand-by mode s s into the stand-by mode 2+n 7.17.2

and reset of and resets the outputs
outputs POFFP addressed by the
program.

The PSCAN instruction


PSCAN sets the program
Switching specified by the device in
programs into s into the scan execution 2+n 7.17.3
scan execution s mode. In this mode the 
mode PSCANP program is only executed
once during one program
scan.

PLOW The PLOW instruction


Switching sets the program
programs into 2+n 7.17.4
low-speed s specified by the device in 
s into the low-speed
execution mode PLOWP execution mode.

LDPCHK In conduction when


Checking the
program ANDPCHK s program specified by the 2+n 7.17.5
device in s is being 
execution status executed.
CRPCHK
 n = (number of program name characters)/2 = Number of additional steps (Decimal fractions are rounded up)

2 – 54
Instruction Tables Application instructions, Part 2

2.5.18 Other instructions

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

WDT The WDT instruction


Reset resets the watchdog
watchdog timer (WDT) during 1 7.18.1
timer execution of a sequence
WDTP program.

Preset number (d)


of execution DUTY n1, n2, d 4 7.18.2
scans
SM420 to SM424, SM 430 to SM434

Turns ON device
specified by (d) if
measured ON time of 4 7.18.3
Time check TIMCHK s1, s2, d
input condition is longer
than preset time
continuously.

ZRRDB 0 ZR0
1 Higher 8 bits
Direct read of n, d 2 ZR1 3 7.18.4
one byte 3 Higher 8 bits
ZRRDBP
n 8 bits (d)

ZRWRB 0 ZR0
1 Higher 8 bits

Direct write of 2 ZR1


3 7.18.5
one byte n, s Higher 8 bits

ZRWRBP n 8 bits

Stores the indirect


ADRSET adress of the device
Storing of an designated by s at d and
s, d d+1. 3 7.18.6
indirect adress This adress is used
ADRSETP when a indirect device
read is performed.

The KEY instruction


supports the key input of
8 ASCII characters at the
Numerical key inputs specified by s (X).
input from KEY s, n, d1, d2 The values entered at 5 7.18.7
keyboard the inputs are encoded in
hexadecimal format and
stored in the devices
specified by d1.

ZPUSH The ZPUSH instruction


Batch save of saves the contents of the
index register d 2 7.18.8
index registers Z0
contents through Z15 in d.
ZPUSHP

Batch ZPOP The ZPOP instruction


recovery of recovers the contents of
index d 2 7.18.8
register the index registers Z0
ZPOPP through Z15 in d.
contents

Programming MELSEC System Q and L series 2 – 55


Application instructions, Part 2 Instruction Tables

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

Reads the module


UNIRD information stored in the
area starting from the
Reading I/O No. designated by n1
module n1, d, n2 and stores it in the area 4 7.18.9
information starting from the device
UNIRDP designated by d. The
number of points is
designated by n2.

This instruction reads the


TYPERD module information
stored in the area
Reading
module model n, d starting from the I/O 3 7.18.10
number specified by "n",
name and stores it in the area
TYPERDP
starting from the device
specified by (D).

Stores trace data set at a


peripheral device to trace
file in IC memory card by 1
TRACE the designated number
Trace set/ when SM800, SM801, 7.18.11
reset and SM802 turns ON.

TRACER Resets the data set by 1


the TRACE instruction

Writing data to
a designated SP.FWRITE u0, s0, d0, s1, s2, d1 Writes data to a 11 7.18.12
designated file
file

Reading data
from a SP.FREAD u0, s0, d0, s1, d1, d2 Reads data from a 11 7.18.13
designated file
designated file

Writes data to the device


Writing data to S.DEVST n1, s, n2, d data storage file in the 9 7.18.14
standard ROM
standard ROM.

S.DEVLD
Reading data Reads data from the
from standard n1, d, n2 device data storage file 8 7.18.15
ROM in the standard ROM.
SP.DEVLD

Transfers the program


stored in a memory card
Loading or standard memory card
program from PLOADP s, d (other than drive 0) to 3 7.18.16
memory drive 0 and places the
program in standby
status.

Unloading Deletes the standby


program from program stored in 3 7.18.17
PUNLOADP s, d
program standard memory
memory (drive 0)

2 – 56
Instruction Tables Application instructions, Part 2

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

Deletes standby program


stored in standard
memory (drive 0)
designated by s1.Then
Load and the program (s2) stored 4 7.18.18
unload PSWAPP s1, s2, d in a memory card or
standard memory (other
than drive 0) is
transfered to drive 0 and
placed in standby status.

RBMOV s, d, n
Highspeed (s) (d)
block transfer 4 7.18.19
of file register n
RBMOVP s, d, n

Displays the specified


character strings on the 2 7.18.20
User message UMSG s display unit as a user
message.

Programming MELSEC System Q and L series 2 – 57


Data link instructions Instruction Tables

2.6 Data link instructions


2.6.1 Instructions for network refresh

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

S.ZCOM
Jn

Link SP.ZCOM
instruction: Refreshes the 5 8.2.1
Network designated network.
refresh S.ZCOM
Un
SP.ZCOM

2.6.2 Read/write routing information

of steps
Number

Subset
Category Instruction Variables Meaning Execution Reference
Condition Section

S.RTREAD
Reads data set at routing 7 8.3.1
n, d parameters.
SP.RTREAD
Read/Write
routing
information
S.RTWRITE
Writes routing data to the
n, s area designated by 8 8.3.2
routing parameters.
SP.RTWRITE

2 – 58
Instruction Tables Multiple CPU dedicated instruction

2.7 Multiple CPU dedicated instruction


2.7.1 Instructions for writing to the CPU shared memory of host CPU

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

S.TO
Writes device data of the
n1, n2, n3, n4, d host station to the host 5 9.1.1
CPU shared memory.
SP.TO

TO
Write to CPU Writes device data of the
shared host station to the host 5
memory CPU shared memory.
TOP
n1, n2, s, n3 9.1.2
DTO Writes device data of the
host station to the host 5
CPU shared memory in
DTOP 32-bit units

2.7.2 Instructions for reading from the CPU shared memory of another CPU

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Reads data from the


FROM shared memory of
another CPU and stores
the data in the device 5
memory of the CPU
Read from the FROMP performing the FROM
shared n1, n2, d, n3 instruction. 9.2.1
memory of
another CPU
DFRO Reads data from the
shared memory of
another CPU in 32-bit 5
units and stores the data
DFROP in the host station.

Programming MELSEC System Q and L series 2 – 59


Multiple CPU dedicated instruction Instruction Tables

2.7.3 Multiple CPU high-speed transmission dedicated instructions

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

In multiple CPU system,


D.DDWR data stored in a device
specified by host CPU
Writing (s2) or later is stored by
devices to the number of write 10 10.2.1
another CPU points specified by
DP.DDWR (d2+1) into a device
specified by another
CPU (n) (d1) or later.
n, s1, s2, d1, d2
In multiple CPU system,
D.DDRD data stored in a device
specified by another
Reading CPU (d1) or later is
devices from stored by the number of 10 10.2.2
another CPU read points specified by
DP.DDRD (s1+1) into a device
specified by host CPU
(s2) or later.

2 – 60
Instruction Tables System switching instruction for a redundant system

2.8 System switching instruction for a redundant system

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Switches between the


control system and
System standby system at the 8 11.1.1
SP.CONTSW s, d
switching END processing of the
scan executed with the
SP.CONTSW instruction.

Programming MELSEC System Q and L series 2 – 61


Instructions for special function modules Instruction Tables

2.9 Instructions for special function modules


2.9.1 Instructions for serial communication modules

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning Condition Section

Reading of Reading of received data


data from a from a serial communi-
serial commu- BUFRCVS Un, n1, d1 cation module QJ71C24 12.1.1
nication to the PLC CPU in an
module interrupt program.

GETE
Reading of User registered frames
user regis- Un, s1, s2, d are read from a serial 12.1.2
tered frames communication module
GETEP

PUTE User frames are regis-


Registration or tered to or deleted from a
deletion of Un, s1, s2, d 12.1.3
user frames serial communication
module
PUTEP

PRR Sending of data via the


Transmission serial communication
Un, s, d 12.1.4
of data module using user
frames
PRRP

2.9.2 Instructions for PROFIBUS/DP interface modules


of steps
Number

Subset

Category Instruction Variables Meaning Execution Reference


Condition Section

Data is read from the


BBLKRD
buffer memory of a
Reading of Un, n1, n2, d PROFIBUS/DP interface 12.2.1
data
module and stored in the
BBLKRDP PLC CPU

Data stored in the PLC


BBLKWR
CPU is written to the
Writing of data Un, n1, n2, s buffer memory of a 12.2.2
PROFIBUS/DP interface
BBLKWR module

2 – 62
Instruction Tables Instructions for special function modules

2.9.3 Instructions for ETHERNET interface modules

of steps
Number

Subset
Execution Reference
Category Instruction Variables Meaning
Condition Section

BUFRCV Un, s1, s2, d1, d2 Data received during 12.3.1


fixed buffer communica-
Reading from tion is read from the
fixed buffer
ETHERNET interface
BUFRCVS Un, s1, d1 12.3.2
module

Data stored in the PLC


Writing to fixed CPU is moved to a fixed
buffer BUFSND Un, s1, s2, s3, d1 12.3.3
buffer of an ETHERNET
interface module

Open Open processing for a


OPEN Un, s1, s2, d1 12.3.4
connection connection

Close Close processing for a


connection CLOSE Un, s1, s2, d1 12.3.5
connection

Error codes stored in the


buffer memory of the
ETHERNET interface
Error clear ERRCLR Un, s1, d1 12.3.6
module are cleared and
the "ERR.“ LED is
switched off.

Error codes stored in the


buffer memory of the
Reading of an
ERRRD Un, s1, d1 ETHERNET interface 12.3.7
error code
module are read to the
PLC CPU

Re-initial processing of
Re-initializa-
UINI Un, s1, d1 an ETHERNET interface 12.3.8
tion
module

2.9.4 Instruction for MELSECNET/H


of steps
Number

Subset

Execution Reference
Category Instruction Variables Meaning Condition Section

Pairing setting PAIRSET Jn, s1 Setting of stations for 12.4.1


duplex network

Programming MELSEC System Q and L series 2 – 63


Instructions for special function modules Instruction Tables

2.9.5 Instructions for CC-Link

of steps
Number
Execution Reference
Category Instruction Variables Meaning
Condition Section

RLPASET
Transfer of the parameter
Parameter Un, s1 to s5, d1 settings to the master sta- 12.5.1
setting
tion of CC-Link
RLPASET_P

Reading from Data is read from the


the buffer RIRD buffer memory of another
memory or Un, s, d1, d2 stations CC-Link module 8 12.5.2
from the device or from the device mem-
memory of a ory of that stations PLC
CPU RIRD_P CPU

Writing to the Data is written to the


RIWT
buffer memory buffer memory of another
or to the device Un, s, d1, d2 stations CC-Link module 8 12.5.3
memory of a or to the device memory
CPU of that stations PLC CPU
RIWT_P

Data is read with hand-


RIRCV
Reading from shake from the buffer
an intelligent Un, s1, s2, d1, d2 memory of an intelligent 10 12.5.4
device station device station connected
RIRCV_P to CC-Link

Data is written with hand-


RISEND
Writing to an shake to the buffer mem-
intelligent Un, s1, s2, d1, d2 ory of an intelligent device 10 12.5.5
device station station connected to CC-
RISEND_P Link

Data is moved from the


RITO device memory of the PLC
Writing to CPU to the automatic
automatic updating buffer memory of
Un, n1, n2, n3, d 9 12.5.6
updating buffer the master station. This
memory data is then transferred to
RITO_P another station con-
nected to CC-Link.

Data transmitted from


Reading from RIFR another station to the
automatic automatic updating buffer
Un, n1, n2, n3, d 9 12.5.7
updating buffer memory of the master sta-
memory tion is moved to the device
RIFR_P memory of the PLC CPU.

2 – 64
Configuration of Instructions The structure of an instruction

3 Configuration of Instructions
3.1 The structure of an instruction
Most of the instructions consist of an instruction part and a device part. Other instructions do
not require a device part and thus only consist of the instruction part.

PLUS sd
{
{

Instruction Device
part part

Instruction part
The instruction part describes the functions of the instruction.
^ Addition
PLUS =

Device part
The device part describes the constants or variables to be specified. The device part can com-
prise three items: the source of data (s), the destination of data (d), and the number (n).

3.1.1 Source of data (s)

● The data source designates the devices to be processed by the instruction.


For 16-bit instructions the notation of the data source is s.
For 32-bit instructions its notation is s+1 and s.
● Within the data source constants or variables can be specified.

Constants
Constants specify a constant numerical value to be processed by the instruction. This value is
constantly set by the user written program and cannot be altered during program execution. It
is recommended to index qualify each variable to be used as constant.

Variables
Variables specify a device storing data to be processed by the instruction (also refer to section
3.4 "Programming of variables").
Before an instruction is executed, the data must be stored in the device. The data stored in vari-
ables can be altered during program execution.

Programming MELSEC System Q and L series 3–1


The structure of an instruction Configuration of Instructions

3.1.2 Destination of data (d)

● The data destination designates the devices to store the data after being processed by the
instruction.
For 16-bit instructions the notation of the data destination is d.
For 32-bit instructions its notation is d+1 and d. However, some instructions with 2 devices
require a value to be processed stored in the data destination d before the instruction is
executed. In this case, the result of the operation will be stored in the same device as well.
Example: The addition instruction for BIN 16-bit data.
Here, d first stores data for the operation and then the operation result:

s+d=d
s1 + s2 = d1

● A device for the storage of data has always to be set as data destination.

3.1.3 Number (n)

● The number n specifies how many devices are to be used or how often an instruction is to
be executed.
Example: The BMOV instruction for block data transfer:

Specifies the number of


transfers via the BMOV
instruction

● The value n may range from 0 to 32767. If n is specified 0, the instruction will not be executed.

3–2
Configuration of Instructions Notation of instructions

3.2 Notation of instructions

From the notation certain characteristics of the instructions can be derived.

3.2.1 16/32-bit and pulse

SORT 16-bit processing


SORTP 16-bit processing with pulse
DSORT 32-bit processing
DSORTP 32-bit processing with pulse

3.2.2 MELSEC and IEC

The GX IEC Developer includes several editors for the instructions:

Within these editors the instructions are represented in different notations.

For the selection of an instruction in the


GX IEC Developer this dialog box will
appear.
Depending on the selected library diffe-
rent instructions can be chosen:
ALL: MELSEC and IEC instructions
Project: Functions and Function Blocks
created by the user
Manufacturer: MELSEC instructions
Standard: IEC instructions

Programming MELSEC System Q and L series 3–3


Notation of instructions Configuration of Instructions

For example, this dialog box will appear


when the the manufacturer library is
selected. This listing contains the
"adapted" MELSEC instructions.

The functions of the "pure" and "adapted" instructions are identical. Only their notation differs.

Legend of the extensions within the IEC editor:

Extension in IEC Editor Meaning

_M MELSEC instruction

_P_M Pulse execution of an instruction

_MD Dedicated MELSEC instruction


(also refer to section 3.3 "Programming of dedicated instructions")

_P_MD Pulse execution of a dedicated instruction

_K_MD Use of a constant in a dedicated instruction

_K_P_MD Use of a constant and pulse execution in a dedicated instruction.

_S_MD Dedicated MELSEC instruction for CPUs of MELSEC System Q

_P_S_MD Pulse execution of a dedicated MELSEC instruction for CPUs of MELSEC


System Q

3–4
Configuration of Instructions Notation of instructions

3.2.3 Further characteristics of the instruction notation

The table below contains the symbols that represent several functions within the MELSEC
editor. The column on the right shows the according instruction names within the IEC editor.

Example: MELSEC editor IEC editor


LD$> LD_STRING_GT_M

MELSEC Editor IEC Editor


$ STRING
= EQ
<> NE
<= LE
< LT
>= GE
> GT
+ PLUS
- MINUS
x MULTI
/ DIVID

3.2.4 Specification of the notation

The chapters 5 through 12 that give a detailed description of the instructions contain illustra-
tions of both editors, i.e. both notations. The header line contains the "pure" MELSEC instruc-
tion as it occurs in the MELSEC instruction list.

NOTE The tabular overview at the beginning of each instruction category always represents both
notations.

Programming MELSEC System Q and L series 3–5


Programming of dedicated instructions Configuration of Instructions

3.3 Programming of dedicated instructions


The dedicated instructions are customised instructions that do not only differ in notation from
the pure MELSEC instructions. They also require a particular programming technique for the
different CPUs.
In the MELSEC editor the FLOAT_MD instruction has to be programmed in combination with
the LEDA, LEDC, LEDR instructions. In the IEC editors the dedicated instructions can be pro-
grammed as usual.
Example: Programming of the FLOAT_MD instruction (common execution 16-bit)

MELSEC Instruction List Ladder Diagram IEC Instruction List

Example: Programming of the FLOAT_P_MD instruction


(pulse execution 16-bit, use of a constant in device s)

MELSEC Instruction List Ladder Diagram IEC Instruction List

Refer to the following manuals for further information on the programming of dedicated instruc-
tions:
 GX IEC Developer Reference Manual
 Programming Manual (Dedicated Instructions)

3–6
Configuration of Instructions Programming of variables

3.4 Programming of variables


3.4.1 Programming with the GX IEC Developer

The majority of instructions besides the instruction part also require a device part with specified
variables. These variables contain the values for the execution of the instruction.
According to the selected editor in the GX IEC Developer a different method of programming
of the variables is required.

In the MELSEC editor:


The data registers D100 and D10 can be assigned directly to the variable designation D100
and D10.
The connected PLC automatically detects that the following devices are designated:
D100 = D100 and D101
D10 = D10, D11, D12, D13

In the IEC editor:


In the IEC editor direct devices can only be entered, if actually only this device is to be desig-
nated.
Example: AND D10
Before a DWSUMP_M instruction can be processed, the variables have to be defined in the
header of the program organisation unit (POU).

Example: Header of the IEC IL

var_D100 and var_D10 are entered here as identifiers. The PLC actually does not assign the devices D100 and D10 but inernally allocates free register areas for the variables.

Example: DWSUMP

DWSUMP var_D100, 4, var_D10


s n d

32-bit 16-bit array


or
constant

The variable var_D100 is of type DINT (32-bit). The variable var_D10 is of type ARRAY. The
array contains four 16-bit registers of type INT (also refer to section 3.5.2 "Addressing of arrays
and registers in the GX IEC Developer").

Programming MELSEC System Q and L series 3–7


Programming of variables Configuration of Instructions

Specification of the notation


The designation var_D100 or var_D10 in the screenshots indicate that not direct devices are
designated but identifiers. In these cases the variable definition is compulsory! If an instruction
can only be programmed over a variable definition this is explicitely noted.

NOTE As identifier any name can be entered (e.g. Motor1, Indicator). The names var_D100 or var_D10
were selected here for a clear comparison to the programming in the MELSEC editor.

The table of variables at the beginning of any instruction gives an overview of the data types
of the devices for each instruction (the example shows the DWSUM instruction in section
7.5.14).
Variables Data Type
Set Data Meaning
MELSEC IEC
s First number of device storing data to be added. BIN 32-bit ANY32
Array [1..4] of
d First number of device storing result. BIN 64-bit
ANY16
n Number of data blocks to be added. BIN 16-bit ANY16

In GX Works2
The data registers D100 and D10 can be assigned directly to the variable designation D100
and D10.
The connected PLC automatically detects that the following devices are designated:
D100 = D100 and D101
D10 = D10, D11, D12, D13

3–8
Configuration of Instructions Data types

3.5 Data types


The data type determines the number and processing of bits as well as the value range of the
variables.
The following data types exist:

Number of
Data Type Value Range bits

BOOL Boolean 0 (FALSE), 1 (TRUE) 1 bit

INT INTEGER -32768 through 32767 16 bits

DINT Double INTEGER -2147483648 through 2147483647 32 bits

WORD Bit string 16 0 through 65535 16 bits

DWORD Bit string 32 0 through 4294967295 32 bits

Single precision:
32 bits
-2128 < Value ≤ -2-126, 0, 2-126 ≤ Value < 2128
REAL Floating point number
Double precision:
64 bits
-21024 < Value ≤ -2-1022, 0, 2-1022 ≤ Value < 21024

T#-24d-0h31m23s648.00ms
TIME Time value through 32 bits
T#24d20h31m23s647.00ms

STRING Character string max. 50 characters

Hierarchy of data types ANY

ANY

ANY_SIMPLE ARRAY

ANY_NUM ANY_BIT TIME STRING

BOOL

WORD

DWORD

ANY_REAL ANY_INT
REAL INT

DINT

Programming MELSEC System Q and L series 3–9


Data types Configuration of Instructions

Hierarchy of data types ANY16 and ANY32

ANY_16 ANY_32

WORD INT DWORD DINT

Data type Meaning

ANY Any data type

ANY_SIMPLE Simple data type

ANY_NUM Numeric data type

ANY_REAL Floating point number

ANY_INT Integer data type

ANY_BIT Bit processing data type

ANY_16 Any 16-bit data type

ANY_32 Any 32-bit data type

TIME Time

STRING Character string

REAL Floating point number

INT Integer value

DINT Double integer value

BOOL Boolean value

WORD Word (16 bits)

DWORD Double word (32 bits)

ARRAY Array

3 – 10
Configuration of Instructions Data types

3.5.1 Processing of data

Processing of bit data


A bit device (X, Y, M, K, S, B or F) can obtain two states (ON = 1 or OFF = 0). Its status therefore
can be represented by one bit (1 or 0). Bit processing is always performed, if a specified bit
device is addressed by the program. For the processing of 16-bit or 32-bit instructions several
bit devices are grouped in blocks of 16 or 32 device numbers (i.e. 16 or 32 addresses).
● Usage of bit devices
A bit device (e.g. inputs, outputs, relays) consists of one bit.

Ladder Diagram Processing

M0 is a bit device

Y10 is a bit device

● Usage of word devices


The CPUs of the MELSEC System Q and L series support the addressing of each single
bit in a word device.

b15 to b0
Word device 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0

Each single bit represents the


status OFF or ON by 0 or 1.

The bits have to be addressed in hexadecimal format. For example, the bit 5 (b5) in D0 is
addressed D0.5. Bit 10 in D0 is addressed D0.A.
Single bits of timers, counters, and retentive timers can not be addressed.

Ladder Diagram Processing

Bit addressing within a word


device.
(bit 5 (b5) in D0 is set)

Bit addressing within a word


device.
(The status of the contact
D0.5 depends on the I/O sta-
tus of bit 5 in word device D0)

 Usage of bit blocks


Single bits can be grouped in blocks of four and thus process word data. The detailed
description is given in the following sections, "Processing of word data (16/32 bits)".

Programming MELSEC System Q and L series 3 – 11


Data types Configuration of Instructions

Processing of word data (16 bits)


● Usage of bit devices
Bit devices are capable of processing word data provided that the number of bit devices
(addresses) is determined. Up to 16 bits can be processed in blocks of 4 bits each. The
length of each block (i.e. the digit designation) is determined by K1 to K4.
K1X0 4 addresses from X0 through X3
K2X0 8 addresses from X0 through X7
K3X0 12 addresses from X0 through XB
K4X0 16 addresses from X0 through XF

XF bis XC XB bis X8 X7 bis X4 X3 bis X0

K1
4 bits
K2
8 bits
K3
12 bits
K4
16 bits

– Designation of bit blocks for s


The table below shows the range of values processed as source data for the digit
designation of source data (s)

Digit Designation 16-bit instruction

K1 (4 digits) 0 to 15

K2 (8 digits) 0 to 255

K3 (12 digits) 0 to 4095

K4 (16 digits) -32768 to 32767

The bit addresses not used are set to 0.

Ladder Diagram Processing


16-bit instruction
K1X0 X3 X2 X1 X0

set to 0
b15 b4 b3 b2 b1 b0
D0 0 0 0 0 0 0 0 0 0 0 0 0 X3 X2 X1 X0

Source data

NOTE For the block by block addressing of bit devices the number of the first bit device (initial device
number) can be designated at any random value.
Block by block addressing cannot be made for the direct access I/Os (DX, DY).

3 – 12
Configuration of Instructions Data types

– Designation of bit blocks for d


The digit designation for the destination data (d) determines the address range the data
is to be written to. The bit addresses exceeding the determined address range remain
ignored.

Ladder Diagram Processing

Numeric values as source data (s)

1 2 3 4
H1234 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

M15 M8 M7 M0
K2M0 0 0 1 1 0 1 0 0
Data destination (d) is not changed 3 4

Word device as source data (s)

b15 b8 b7 b0
D0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 0 1

M115 M108M107 M100


K2M100 1 0 0 1 1 1 0 1
Data destination (d) is not changed

● Usage of word devices


Word devices are determined by an address. This address comprises 16 bits.

Programming MELSEC System Q and L series 3 – 13


Data types Configuration of Instructions

Processing of double word data (32 bits)


● Usage of bit devices
Bit devices are capable of processing word data provided that the number of bit devices
(addresses) is determined. Up to 32 bits can be processed in blocks of 4 bits each. The
length of each block (i.e. the digit designation) is determined by K1 to K8.
K1X0 4 addresses from X0 through X3
K2X0 8 addresses from X0 through X7
K3X0 12 addresses from X0 through XB
K4X0 16 addresses from X0 through XF
K5X0 20 addresses from X0 through X13
K6X0 24 addresses from X0 through X17
K7X0 28 addresses from X0 through X1B
K8X0 32 addresses from X0 through X1F

X1F X1C X1B X18 X17 X14 X13 X10 XF XC XB X8 X7 X4 X3 X0

K1
4 addresses
K2
8 addresses
K3
12 addresses
K4
16 addresses
K5
20 addresses
K6
24 addresses
K7
28 addresses
K8
32 addresses

– Designation of bit blocks for s


For a specification of the digit designation the range of the values processed as source
data is listed in the table below:

Digit Designation 32-bit Instruction

K1 (4 digits) 0 to 15

K2 (8 digits) 0 to 255

K3 (12 digits) 0 to 4095

K4 (16 digits) -32768 to 32767

K5 (20 digits) 0 to 1048575

K6 (24 digits) 0 to 16777215

K7 (28 digits) 0 to 268435455

K8 (32 digits) -2147483648 to 2147483647

The bit addresses not used are set to 0.

3 – 14
Configuration of Instructions Data types

Ladder Diagram Processing


32-bit instruction K1X0 X3 X2 X1 X0

set to 0
b15 b4 b3 b2 b1 b0
D0 0 0 0 0 0 0 0 0 0 0 0 0 X3 X2 X1 X0
← Source data D1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(s) b31 b16

set to 0

NOTE For the block by block addressing of bit devices the number of the first bit device (initial device
number) can be designated at any random value.
Block by block addressing cannot be made for the direct access I/Os (DX, DY).

– Designation of bit blocks for d


The digit designation for the destination data (d) determines the address range the data
is to be written to. The bit addresses exceeding the determined address range remain
ignored.

Ladder Diagram Processing

Numeric values as source data (s) H76123456

0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0
3 4 5 6
0 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0
7 8 1 2
K5M0
M15 M8 M7 M0
0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0
Data destination (d) M31 M20 M19 M16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
is not changed

Word device as source data (s)


b15 b8 b7 b0
D0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0

b15 b8 b7 b0
D1 0 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0

M25 M18 M17 M10


1 1 1 0 0 1 0 0 0 1 0 1 1 1 0 1
M41 M30 M29 M26
Data destination (d)
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
is not changed

Programming MELSEC System Q and L series 3 – 15


Data types Configuration of Instructions

● Usage of word devices


Double word devices comprise two 16-bit devices.
According to the programming software and selected editor double word devices are
programmed differently.
– In the MELSEC editor of the GX IEC Developer

Ladder Diagram Explanation

D0 and D1 are used

Instruction for the 32-bit data transfer

– In the IEC editor of the GX IEC Developer


Before a 32-bit device can be programmed in the IEC editor of the GX IEC Developer, the
variables have to be defined in the header of the program organisation unit (POU).
The data types DWORD and DINT are of the 32-bit type.

Ladder Diagram Explanation

var_D0 must be declared as


DINT or DWORD

Instruction for the 32-bit data transfer

– In the editor of the GX Works2

Ladder Diagram Explanation

D0 and D1 are used

Instruction for the 32-bit data transfer

3 – 16
Configuration of Instructions Data types

Processing of data of the data type REAL


Data of the REAL type are floating-point numbers. Whether instructions processing floating-
point numbers should be performed with single precision (32-bit) or double precision (64-bit)
can be set in the PLC parameters. Only word devices are capable of storing floating-point num-
bers.
● 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. The 32-bit floating-point number is stored in two successive
16-bit registers (designated device number) and (designated device number + 1).

M0
EMOV R100 D0

Designation of 2 points of word devices D0 and D1


Designation of 2 points of R100 and R101
32-bit floating-point data transfer instruction

NOTES Instructions processing floating-point numbers begin with an E (e.g. EMOV).

Two word devices are required for storing a single precision floating-point number. Therefore,
it is divided into the following components:
[Sign] 1.[Mantissa] x 2[Exponent]
The bit configuration of the registers and their contents are shown in the figure below:

>! >! to > ! > to >$ ># to >


b31 b30 to b23 b22 to b0
Sign Exponent Mantissa

– Sign of the floating-point number: The sign is stored in b31.


0 = Positive
1 = Negative
– Exponent: The n from 2n is binary stored from b23 through b30.
The meaning of the binary value n is shown in the following figure.

b23 to b30 FFH FEH FD H 81H 80H 7FH 7EH 02H 01H 00H
n free 127 126 2 1 0 -1 -125 -126 free

– Mantissa: The 23 bits from b0 to b22, represents the XXXXXX... at binary 1.XXXXXX....

Programming MELSEC System Q and L series 3 – 17


Data types Configuration of Instructions

Example: Representation of the value "10" as floating-point number.


The "x" in (nnn)X designates the base of the number system.
(10)10 → (1010)2 → (1.010000... x 23)2
Sign: Positive → 0
Exponent: 3 → 82H → (10000010)2
Mantissa: (010 00000 00000 00000 00000)2
The value "10" will be stored as 41200000H (see following figure).

Sign Exponent Mantissa

                               

"      

Example: Representation of the value "0.75" as floating-point number.


The "x" in (nnn)X designates the base of the number system.
(0.75)10 → (0.11)2 → (1.100... x 2-1)2
Sign: Positive → 0
Exponent: -1 → 7EH → (01111110)2
Mantissa: (100 00000 00000 00000 00000)2
The value "0.75" will be stored as 3F400000H (see following figure).

Sign Exponent Mantissa

                               

! . "     

NOTE Post decimal positions for binary data are represented as follows:
Example: (0.1101)2

0, 1 1 0 1

Bit significance: Bit significance: Bit significance: Bit significance:


2-1 2-2 2-3 2-4

(0.1101)2 = 2 -1+2 -2+2 -4= 0.5 + 0.25 + 0.0625 = (0.8125)10

3 – 18
Configuration of Instructions Data types

● Double precision floating-point data


Instructions which deal with double precision floating-point data designate devices which
are used for the lower 16 bits of data. The 64-bit floating-point number is stored in four
successive 16-bit registers (designated device number) to (designated device number + 3)

M0
EDMOV R100 D0

Designation of 4 points of word devices (D0, D1, D2, D3)


Designation of 4 points of R100, R101, R102 and R103

64-bit floating-point data transfer instruction

NOTE Instructions processing floating-point numbers begin with an E (e.g. EMOV).

Four word devices are required for storing a double precision floating-point number.
Therefore, it is divided into the following components:
[Sign] 1.[Mantissa] x 2[Exponent]
The bit configuration of the registers and their contents are shown in the figure below:.

>$! >$ to ># ># to >$ ># to >


b63 b62 to b52 b51 to b0
Sign Exponent Mantissa

– Sign of the floating-point number: The sign is stored in b63.


0 = Positive
1 = Negative
– Exponent: The n from 2n is binary stored from bits b52 through b62.
The meaning of the binary value n is shown in the following figure.

b52 – b62 7FFH 7FEH 7FDH 400H 3FFH 3FEH 3FDH 3FCH 02H 01H 00H
Free
n Free
1023 1022 2 1 0 1 2 1021 1022

– Mantissa: The 52 bits from b0 to b51, represents the XXXXXX... at binary 1.XXXXXX....

Programming MELSEC System Q and L series 3 – 19


Data types Configuration of Instructions

NOTES The CPU module floating decimal point data can be monitored using the monitoring function of
a peripheral device.
When floating-point data is used to express 0, the following bits are turned to 0:
Single precision floating-point data: bits b0 to b31
Double precision floating-point data: bits b0 to b63
The setting range of floating decimal point data is as follows:
Single precision floating-point data: -2128 < Value ≤ -2 -126, 0, 2 -126 ≤ Value < 2128
Double precision floating-point data: -21024 < Value ≤ -2 -1022, 0, 2 -1022 ≤ Value < 21024
For operations when a real number is out of range and operations when an invalid value is input,
an error occurs. For more informations refer to the QnUCPU User's Manual (Function Expla-
nation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Expla-
nation, Program Fundamentals).
Do not specify "-0" in floating-point data. (In this case the most significant bit of the floating-point
real number is "1"). An operation error will occur with the following CPU modules, if floating-point
operation is performed with "–0".
– Basic model QCPU (CPUs with first five digits of serial No. are "04122 or higher can perform
floating-point operation)
– High Performance model QCPU where internal operation is set to single precision (setting in
PLC parameter dialog box of the PLC system)
– Process CPU of the MELSEC System Q
– Redundant CPU of the MELSEC System Q
– Universal model QCPU of the MELSEC System Q
– L-series CPUs
The High Performance model QCPU with the internal processing set to "double precision" (dou-
ble precision is set by default for the floating-point operation processing) internally convert the
value "–0" to 0 to perform a floating-point operation. Therefore an operation error does not occur.

3 – 20
Configuration of Instructions Data types

● Floating-point data in the IEC Editor


Since the REAL IEC function uses the data type REAL as input/output but the MELSEC
instructions use the data type DINT, the following functions are provided to compensate this
difference:

The conversion from the IEC data type REAL into the MELSEC data type is performed by
the instruction REAL_TO_M_REAL (REAL_TO_M_REAL_E).
The conversion from the MELSEC data type into the IEC data type is performed by the
instruction M_REAL_TO_REAL (M_REAL_TO_REAL_E).
Example: For the application of dedicated instructions that process the data type REAL and
for IEC instructions the REAL to REAL conversion ist required.

32-bit 32-bit
MITSUBISHI-REAL IEC-REAL
(DINT) (REAL)
MLIB SLIB

When programming in in GX IEC Developer the BMOV_E instruction can be used to switch
off the variable check. No additional code is created.
Any type of data can be specified in s, even arrays are possible. n holds the number of 16-
bit data to copy.

Programming MELSEC System Q and L series 3 – 21


Data types Configuration of Instructions

3.5.2 Addressing of arrays and registers in the GX IEC Developer

Addressing of 32-bit registers


The addressing of 32-bit registers (data type DINT, DWORD) requires a variable definition in
the header of the program organisation unit (POU).
In the following example the DMOV instruction requires two 16-bit registers for moving one
32-bit data word. For the addressing in the MELSEC editor of the GX IEC Developer only the
initial registers (here D10, D20) are designated. Each required second 16-bit register (D11,
D21) is addressed automatically by the compiler.
In the IEC editor of the GX IEC Developer instead of the initial register a variable (here
var_D10, var_D20) with a specific data type (here DINT (32 bits)) has to be defined in the
header of the program organisation unit according to the header of the instruction. For these
variables the compiler assigns corresponding addresses internally.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Header of the DMOV instruction

Header of the program organisation unit (POU)

3 – 22
Configuration of Instructions Data types

Addressing of arrays
For the programming of instructions that use an array with array elements as input or output
devices (16-bit registers) the variables in the header of the program organisation unit have to
be defined according to the header of the instruction.
The individual array elements are addressed by specifying the array and the array element in
square parentheses (var_xx[x]).
The figures below show the addressing via arrays for the positioning instruction for rotary tables
(ROTC):

MELSEC Instruction List Ladder Diagram IEC Instruction List

Header of the ROTC instruction

Header of the program organisation unit (POU)

You can infer from the header of the ROTC instruction that the input device range s consists of
3 array elements of the type ANY16 and the output device range consists of 8 array elements
of the type BOOL.
In the GX Works2 and in the MELSEC editor of the GX IEC Developer for the input/output
device ranges s and d only each of the initial devices D200 and M0 is specified. The compiler
addresses the registers D200 through D202 for s and M0 through M7 for d.
In the IEC editors arrays must be defined for s and d. The input array s is defined as var_D200.
It consists of 3 array elements (var_D200[0] – var_D200[2]) of the type INT (16-bit integer). The
output array d is defined as var_M0. It consists of 8 array elements (var_M0[0] – var_M0[7]) of
the type BOOL (bit). For these variables the compiler assigns corresponding addresses inter-
nally.

Programming MELSEC System Q and L series 3 – 23


Data types Configuration of Instructions

NOTE Arrays can also be addressed variably. In this case instead of the array element number in
square brackets any identifier for example [Number] is entered. "Number" must be declared in
the header of the program organisation unit. Then a value corresponding to the according array
element can be moved to the register "Number".

Instructions for the array address/ initial address conversion


The instruction set for the conversion of an output array into an initial address of a device range
comprises three instructions.
The instruction GET_INT_ADDR converts an output array with array elements of the type INT
(16-bit integer) into an initial address of a device range.
The instruction GET_WORD_ADDR converts an output array with array elements of the type
WORD (16-bit word) into an initial address of a device range.
The instruction GET_BOOL_ADDR converts an output array with array elements of the type
BOOL (bit) into an initial address of a device range.

Ladder Diagram IEC Instruction List

After the conversion the array elements can be processed as individual devices. Therefore, the
variable definition in the header of the program organisation unit is not required.
In the program with the ROTC instruction shown above instead of the array elements
var_M0[0] – var_M0[7] the relays M0 through M7 can be used.
The methods of addressing devices in GX Works2 and the GX IEC Developer are identical.
These instructions only convert output arrays. Input arrays must be addressed and declared
as previously described.

3 – 24
Configuration of Instructions Data types

3.5.3 Usage of character string data (STRING)

The data string STRING ($) processes character strings.


Character strings are all entered characters (max. 50 characters) up to the NULL code (00H).

● If the entered character is the NULL code (00H)


For the storage of the NULL code a data word (register) is required.

Entered Instruction
D0 00H
NULL code for moving
(00H) character
strings

● If the number of characters contained in the string is even


The storage of character strings with an even number of characters requires a number of
data words calculated by the following formula:
(Number of characters / 2) + 1

If for example the character string "ABCD" is to be moved to D0, the registers D0 through
D1 are required for the string and the register D2 is required for the NULL code indicating
the end of string.

Entered Instruction
chracter string for moving D0 42H 41H
with 4 characters character D1 44H 43H
strings D2 00H

Programming MELSEC System Q and L series 3 – 25


Data types Configuration of Instructions

● If the number of characters contained in the character string is odd


The storage of character strings with an uneven number of characters requires a number of
data words calculated by the following formula:
(Number of characters +1) / 2

If for example the character string "ABCDE" is to be moved to D0, the registers D0 through
D2 are required for the character string. The NULL code indicating the end of string is written
to the upper byte of D2.

Entered Instruction D0 42H 41H


character string for moving
D1 44H 43H
with 5 characters character
strings D2 00H 45H

3 – 26
Configuration of Instructions Index qualification

3.6 Index qualification


Overview of indexing
● Index qualification is an indirect addressing method of a device through an index register.
For the index qualification within a program the device obtains the directly entered device
number plus the contents of the index register as adress.
● 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.
The program shown below gives an example of the index qualification. In the first program
line the value –1 is assigned to the index register Z0. This register serves as index for D10
in the second program line. Therefore, D0 stores the value of D9 (D10Z = D(10-1) = D9).

Ladder diagram Explanation

X0
The constant -1 is stored in the index
MOV K 1 Z0
register Z0.
X0
MOV D10Z0 D0 The data from the index register
designated Z0 (D10+Z0(-1)=D9) are
stored under D0.

Indexing

● Devices that can be designated by index qualification


With the exception of the restrictions noted below, Indexing can be used with devices used
with contacts, coils, basic instructions, and application instructions.
– Devices that can not be designated by index qualification

Device Meaning
E Floating point number
$ Character string
. Bit addressing of word devices
FX, FY, FD Function devices
P Pointers used as label
I Interrupt pointers used as label
Z Index registers
S Step relays
TR SFC transfer devices 1)
BL SFC block devices 1)

1 SFC transfer devices and SFC block devices are devices for SFC use.
Refer to the following manual for how to use these devices: MELSEC-Q / L / QnA Programming Manual
(SFC)

Programming MELSEC System Q and L series 3 – 27


Index qualification Configuration of Instructions

– Devices with limits for use with index registers

Device Meaning Application Example


T Only the registers Z0 and Z1 can be used for
addressing timer contacts and coils. T0Z0 K100
T1Z1

C Only the registers Z0 and Z1 can be used for


addressing counter contacts and coils. C0Z1 K100
C1Z0

NOTES There are no restrictions on the addressing of current values of timers and counters.

Ladder Diagram Explanation


Setting value of timer.
X0 Index qualification not supported.
K100
T0

Current value of timer.


SM400 Index qualification supported.
BCD T0Z4 K4Y30
Setting value of counter.
X1 K10 Index qualification not supported.
C100
Current value of counter.
SM400 Index qualification supported.
BCD C100Z6 K2Y40

● A case where indexing has been performed, and the actual process device, would be as
follows:
(When Z0 = 20 and Z1 = 5)

Ladder example Actual Process Device

X0
MOV K20 Z0 X1
MOV K2X64 K1M33
Description
MOV K 5 Z1
K2X50Z0 K2X(50 + 14) = K2X64

X1 Converts K20 into a hexadecimal number.


MOV K2X50Z0 K1M38Z1 K1M38Z1 K1M(38 - 5) = K1M33

X0
MOV K20 Z0 X1
MOV D20 K3Y12A
Description
MOV K 5 Z1
D0Z0 D (0 + 20) = D20
K3Y12FZ1 K3Y(12F - 5) = K3Y12A
X1
MOV D0Z0 K3Y12FZ1
Hexadecimal number

3 – 28
Configuration of Instructions Index qualification

Indexing with 32-bit (Universal model QCPU (excluding Q00UJCPU) and LCPU)
A method of speciyfing index registers in indexing with 32-bit can be selected from the following
two methods.
● Specifing the index registers’ range used for indexing with 32-bit.
● Specifing the 32-bit indexing using “ZZ” specification.

NOTES 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)
 QnUDE(H)CPU
 LCPU

● Example of specifying the range of index registers for use of 32-bit indexing.
Each index register can be set between -2147483648 and 2147483647.

Ladder diagram Explanation

X0
DMOV K40000 Z0 Stores 40000 at Z0.

X0
MOV ZR10Z0 D0 Stores the data of
ZR10Z0 = ZR{10+40000} = ZR40010 at D0.

Indexing

– 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.

GX Works2

NOTES When the head number of the index register used is changed on the Device tab of the Q param-
eter 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)

Programming MELSEC System Q and L series 3 – 29


Index qualification Configuration of Instructions

– Device that indexing can be used


Indexing can be used only for the device shown below.

Device Meaning
ZR Serial number access format file register
D Extended data register (D)
W Extended 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.

Setting Value Index Registers to be Setting Value Index Registers to be


used used
Z0 Z0, Z1 Z10 Z10, Z11
Z1 Z1, Z2 Z11 Z11, Z12
Z2 Z2, Z3 Z12 Z12, Z13
Z3 Z3, Z4 Z13 Z13, Z14
Z4 Z4, Z5 Z14 Z14, Z15
Z5 Z5, Z6 Z15 Z15, Z16
Z6 Z6, Z7 Z16 Z16, Z17
Z7 Z7, Z8 Z17 Z17, Z18
Z8 Z8, Z9 Z18 Z18, Z19
Z9 Z9, Z10 Z19 Cannot be specified

– An example of indexing and the actual process device are as follows.


(When Z0 (32-bit) = 100000 and Z2 (16-bit) = –20)

Ladder example Actual Process Device

X0 
DMOV K100000 Z0   
Description
MOV K-20 Z2
    
X1
   
MOV ZR1000Z0 D30Z2

3 – 30
Configuration of Instructions Index qualification

● Example of specifying 32-bit indexing with “ZZ” specification.


One index register can specify 32-bit indexing by using “ZZ” specification such as “ZR0ZZ4”.
Following figure shows an example.

Ladder diagram Explanation

M0
DMOVP K100000 Z4 Stores 100000 at Z4 and Z5.

M0
MOVP K100 ZR0ZZ4 Indexing ZR device with 32-bit index
registers (Z4 and Z5)
ZR (0+100000) =ZR100000

– 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.

Device Meaning
ZR Serial number access format file register
D Extended data register (D)
W Extended link register (W)

Programming MELSEC System Q and L series 3 – 31


Index qualification Configuration of Instructions

– 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.
Index Registers to be Index Registers to be
"ZZ" specification 1) "ZZ" specification 1)
used used
ZZ0 Z0, Z1 ZZ10 Z10, Z11
ZZ1 Z1, Z2 ZZ11 Z11, Z12
ZZ2 Z2, Z3 ZZ12 Z12, Z13
ZZ3 Z3, Z4 ZZ13 Z13, Z14
ZZ4 Z4, Z5 ZZ14 Z14, Z15
ZZ5 Z5, Z6 ZZ15 Z15, Z16
ZZ6 Z6, Z7 ZZ16 Z16, Z17
ZZ7 Z7, Z8 ZZ17 Z17, Z18
ZZ8 Z8, Z9 ZZ18 Z18, Z19
ZZ9 Z9, Z10 ZZ19 Cannot be specified
1refers to device name (ZR) for indexing target

– Following example shows the 32-bit indexing using the “ZZ” specification and the actual
processing device:
(When Z0 (32-bit) = 100000 and Z2 (16-bit) = –20)

Ladder example Actual Process Device

X1
X0 MOV ZR101000 D10
DMOV K100000 Z0

END
MOV K-20 Z2
Description
X1
MOV ZR1000ZZ0 D30Z2 ZR1000ZZ0 ZR(1000+100000)=ZR101000
D30Z2 D(30-20)=D10

– Available functions for “ZZ” specification


 Specifying devices in program instruction
 Monitoring device registrations
 Testing devices execution type
 Testing devices with conditions
 Setting monitor conditions
 Tracing sampling (Trace point (specifing devices), trace target device)
 Data logging function (Sampling interval (specifying devices), logging target data)

NOTES 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~Z19).
ZZn alone cannot be used as target for data transfer.

3 – 32
Configuration of Instructions Index qualification

Index modification using extended data register (D) and extended link register (W)
(Universal model QCPU (excluding Q00UJCPU) and LCPU)
Like index modification using data register (D) and link register (W) of internal user device, a
device can be specified by index modification within the range of the extended data register (D)
and extended link register (W).

Index modification in internal


Image of D device
User program user device

Z0=0
D100 IInternal user
device
MOV K1234

D1100
Z0=1000

Z1=0 Extended data


D20000
register
MOV K1234

D22000
Z1=2000

Index modification in
extended data register

● Index modification where the device number crosses over the boundary between the internal
user device and the extended data register (D) or extended link register (W)
The specification of index modification where the device number crosses over the boundary
between the internal user device and the extended data register (D) or extended link register
(W) cannot be made. If doing so, an error occurs when the device range check is enabled
at index modification (Error code 4101).

Index modification in internal


Image of D device
User program user device

Z0=0
D100 Internal user
device
MOV K1234

Extended data
D20100
Z0=20000 register

Index modification where the device number


crosses over the boundary between the
internal user device and the extended data
register is not possible.

Programming MELSEC System Q and L series 3 – 33


Index qualification Configuration of Instructions

● Index modification where the device number crosses over the boundary among the file
register (ZR), extended data register (D), and extended link register (W)
Index modification where the device number crosses over the boundary among the file
register (ZR), extended data register (D), and extended link register (W) will not cause an
error. However, an error occurs if the index modification result of file register (ZR), extended
data register (D), and extended link register exceeds the file register range (Error code 4101).

Index modification where the device


number crosses over the boundary
among the file register (ZR), extended
data register (D) will not cause an error.. File register files
User program

File register (8 k)
ZR100
Z0=0
MOV K1234
Z0=10000
D14196
Extended data
register (D)
D20000
Z1=0 (8 k)
D12288–
MOV K1234 Z20000Z1

Z1=4000 Extended link


W2DC0
register (W)
(8 k)
Index modification where the device number W2000–
crosses over the boundary between the
extended data register (D), and extended link
register (W) will not cause an error.

Extended link register exceeds


the file register range. .
Z1=10000

3 – 34
Configuration of Instructions Index qualification

Other index modifcations


● Bit data
Devices can as well be index qualified for the digit designation. The block length of the digit
designation can not be affected.

Ladder Diagram Explanation

BIN K4X0Z2 D0
Input of device numbers via index registers.
If Z2=3 then X(0+3) = X3.

BIN K4Z3X0 D0
This input would designate the block length of the digit
designation.
This designation is not supported.

● Both I/O numbers and buffer memory number can be performed indexing with intelligent
function module devices1)

Ladder Diagram Explanation

MOV U10Z1\G0Z2 D0

If Z1=2 and Z2=8, then


U(10+2)\G(0+8)=U12\G8

● Both network numbers and device numbers can be performed indexing with link direct
devices1)

Ladder Diagram Explanation

MOV J1Z1\K4X0Z2 D0

I If Z1=2 and Z2=8, then


J(1+2)\K4X(0+8)=J3\K4X8

● When indexing is used for multiple CPU shared devices, indexing for the head I/O numbers
of CPU modules and indexing for the CPU shared memory address are automatically
executed.

Ladder Diagram Explanation

MOV U3E0Z1\G0Z2 D0

If Z1= 2 and Z2 = 8, then


U3E(0+2)\G(0+8)= U3E2\G8

NOTE For the intellingent function module device, link direct device and the multiple CPU shared
device refer to the QnUCPU User’s Manual (Function Explanation, Program Fundamentals) or
Qn(H)/QnPH/QnPRHCPU User’s Manuall (Function Explanation, Program Fundamentals).

Programming MELSEC System Q and L series 3 – 35


Index qualification Configuration of Instructions

● Index modification using extended data register (D) and extended link register (W) by 32
bits (Universal model QCPU(except Q00UJCPU) and LCPU)
Like index modification using file register (ZR), index modification using extended data
register (D) and extended link register (W) by 32 bits can be performed by the following two
methods:
– Specifing the index registers’ range used for indexing with 32-bit.
– Specifing the 32-bit indexing using “ZZ” specification.

NOTES 32-bit indexing with the "ZZ" specification is only available for the following CPU modules
(also refer to the User’s manuals of the programming tool used):
 QnU(D)(H)CPU with first five digits of the serial No. is “10042” or higher (excluding
Q00UJCPU)
 QnUDE(H)CPU
 LCPU

3 – 36
Configuration of Instructions Index qualification

Precautions on performing indexing


● Performing indexing between the FOR and NEXT instructions
Pulses can be output between the FOR and NEXT instructions by use of the edge relay (V).
However, pulse output using the PLS/PLF/pulse (P) instruction is not allowed.

When edge relay is used When edge relay is not used


(M0Z1 provides normal pulse output.) (M0Z1 does not provide normal pulse output.)

SM400 SM400
MOV K0 Z1 MOV K0 Z1

FOR K10 FOR K10


X0Z1 V0Z1 X0Z1
M0Z1 PLS M0Z1
SM400 SM400
INC Z1 INC Z1

NEXT NEXT

NOTES The ON/OFF data of X0Z1 is stored by the edge relay V0Z1. For example, the ON/OFF data of
X0 is stored by V0, and that of X1 by V1.

● Performing indexing with the CALL instruction


Pulses can be output with the CALL instruction by use of the edge relay (V). However, pulse
output using the PLS/PLF/pulse (P) instruction is not allowed.

When edge relay is used When edge relay is not used


(M0Z1 provides normal pulse output.) (M0Z1 does not provide normal pulse output.)

SM400 SM400
MOV K0 Z1 MOV K0 Z1

CALL P0 CALL P0

SM400 SM400
MOV K1 Z1 MOV K1 Z1

CALL P0 CALL P0

FEND FEND
X0Z1 V0Z1 X0Z1
P0 M0Z1 P0 PLS M0Z1

RET RET

Programming MELSEC System Q and L series 3 – 37


Index qualification Configuration of Instructions

● Device range check during indexing


– Basic model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU
Device range checks are not conducted during indexing.
Therefore, when the data after index modification exceed the user specified device range,
the data is written to another device without causing an error.
Note, however, that when the data after index modification is written to the device for
system use exceeding the user specified device range, an error occurs. (Error code: 1103)
Take extra precaution when using indexing in programming.

– Universal model QCPU and LCPU


The device range is checked for indexing.
With changing the settings of the PLC parameter, the device range is not checked.
● Changing indexing with 16-bit index register for indexing with 32-bit index register
For changing indexing with 16-bit index register for indexing with 32-bit index register, check
if the program has enough spaces for indexing. 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.

3 – 38
Configuration of Instructions Indirect designation (GX Works2 only)

3.7 Indirect designation (GX Works2 only)


With indirect designation, a device address is stored in a word device. In the sequence program
the device address is not directly designated. For operations concerning this device address
the word device is used instead. This method can be used when the index register is insuffi-
cient.
The device which contains the device address for indirect designation has the prefix "@". For
example, designation of @D100 will make the contents of D100 and D101 the device address.
The address of the device performing indirect designation can be stored in the word device with
the ADRSET instruction.

NOTE The ADRSET instruction is not supported by the GX IEC Developer.

Ladder Diagram Description

W100 is stored in D100 and D101

The constant 1234 is


written to the adress which
is stored in D100 and D101.

D0
D1
Reads the contents of
D100 and D101

D100 W100
D101 W100 1234

A list of devices which are capable of indirect designation is shown below.


Device Type Indirect designation Example of indirect designation
Bit devices Incapable —
Internal devices
(System, user)  @D100
Word devices Capable
 @D100Z2 (Index qualification)
Bit devices Incapable —
Link direct device
Capable
 @J1\W10
Word devices
(The ADRSET instruction  @J1Z1\W10Z2 (Index qualification)
cannot be used to write  @U10\G0
Special function module the indirect adress)
 @U10Z1\G0Z2 (Index qualification)
Index register Zn Incapable —
 @R0, @ZR20000
File register Capable  @R0Z1, @ZR20000Z1
(Index qualification)
Extended data register (D)  @D1000
Capable
Extended link register (W)  @W1000
Nesting —
Pointer —
Incapable
Constants —
Other —

Programming MELSEC System Q and L series 3 – 39


Indirect designation (GX Works2 only) Configuration of Instructions

To store an address for indirect designation, two words are used. Therefore, to decrease or
increase a stored adress for indirect designation by arithmetic instructions, the addition or sub-
traction of 32-Bit data is required.
In the following program examples the device which stores the device for indirect designation
is incremented and decremented by 32-Bit instructions. By doing so, the address of the device
for indirect designation is increased resp. decreased by 1.

Ladder Diagram Description

Device which contains the address of the


device for indirect designation

32-bit instruction to increment D0


(Adds 1 to the data at D0 and D1)

Ladder Diagram Description

Device which contains the address of the


device for indirect designation

32-bit instruction to decrement D0


(Subtracts 1 from the data at D0 and D1)

3 – 40
Configuration of Instructions Indirect designation (GX Works2 only)

Indirect designation of extended data register (D) and extended link register (W)
Indirect designation can be performed in the extended data register (D) and extended link reg-
ister (W).
Note that when indirect designation is performed to the extended data register (D) and data
register (D) in internal device or to the extended link register (W) and link register (W) in internal
device, the areas of the internal user device and extended data register (D) or extended link
register (W) are not treated as a sequence.

Internal user device

ADRSET D12000 D100 Setting an address "D12000" D0


Data register
to D100 and D101.
D12000
"1000" is added to the D12287
address D12000 in D100 and
D+ K1000 D100 D102 D101. Result is stored in
D102 and D103.

MOV K1234 @D102


File register files

File register

D12288
Extended data
register (D)
D13000
Since the areas of the data register
and extended data register are not
D63487 Extended link
sequence, D13000 is inaccessible.
register (W)

Programming MELSEC System Q and L series 3 – 41


Reducing instruction processing time Configuration of Instructions

3.8 Reducing instruction processing time


3.8.1 Subset processing

Subset processing is used to place limits on bit devices used by basic instructions and appli-
cation instructions in order to increase processing speed. However, the instruction symbol
does not change.
To shorten scans, run instructions under the conditions indicated below.

Conditions which each device must meet for subset processing


● When using word data
Device Condition
 Drive number and file name of comment file to be switched to or first number of
device storing such data.
Bit device
 Only K4 can be designated for digit designation.
 Does not perform indexing.
 Internal user device.
 File register (R, ZR 4))
Word device
 Multiple CPU shared device 1, 2)
 Index register (Z) / Standard device register (Z) 3)
Constants No limitations

● When using double word data


Device Condition
 Designates a bit device number in a factor of 16.
Bit device  Only K8 can be designated for digit designation.
 Does not perform indexing.
 Internal user device.
 File register (R, ZR 4))
Word device
 Multiple CPU shared device 1, 2)
 Index register (Z) / Standard device register (Z) 3)
Constants No limitations

● When using bit data


Device Condition
Bit device  Internal user device (indexing possible)
 Bit specification of internal user device
Word device  Bit specification of file register (R, ZR 4))
 Bit specification of multiple CPU shared device 1, 2)
1
Only for Universal model QCPU
2 Valid only for the multiple CPU high speed transmission area (from U3En\G10000)
(Excluding the case that indexing is executed for the head I/O number of the CPU module (U3En\G10000))
3 Applies only to Universal model QCPU and LCPU.

4 Applies only to Universal model QCPU (excluding Q00UJCPU) and LCPU.

3 – 42
Configuration of Instructions Reducing instruction processing time

Instructions for which subset processing can be used

Types of Instructions Instruction Symbols


LD, LDI, AND, ANI, OR, ORI, LDP, LDF, ANDP, ANDF, ORP, ORF, LDPI,
Contact instructions
ANDPI, ANDFI, ORPI, ORFI
Output instructions OUT, SET, RST
Comparison operation instruction =, <>, <, <=, >, >=, D=, D<>, D<, D<=, D>, D>=
+, –, x, /, INC, DEC, D+, D–, Dx, D/, DINC, DDEC
Arithmetic operation
B+, B–, Bx, B/, E+, E–, Ex, E/
Data conversion instructions BCD, BIN, DBCD, DBIN, FLT, DFLT, INT, DINT
MOV, DMOV, CML, DCML, XCH, DXCH
Data transfer instruction
FMOV, BMOV, EMOV
Program branch instruction CJ, SCJ, JMP
Logic operations WAND, DAND, WOR, DOR, WXOR, DXOR, WXNR, DXNR
Rotation instruction RCL, DRCL, RCR, DRCR, ROL, DROL, ROR, DROR
Shift instruction SFL, DSFL, SFR, DSFR
Data processing instructions SUM, SEG
Structure creation instructions FOR, CALL

3.8.2 Operation processing with standard device registers (Z)


(Universal model QCPU and LCPU only)

Operation processing time can be reduced with standard device registers (Z).
The following figure shows an example program with standard device registers.

+ D0 D10 D20 Using data registers takes three steps and the
operation processing time of 28.5 ns.
(With the Q4/Q06/Q10/Q13/Q20/
Q26UD(E)HCPU or Q50/Q100UDEHCPU)

+ Z0 Z1 Z2 Using standard device registers instead of data


registers takes one step and the operation
processing time of 9.5 ns.
(With the Q4/Q06/Q10/Q13/Q20/Q26UD(E)HCPU
or Q50/Q100UDEHCPU)

Operation processing time is reduced with the instructions that the subset processing is pos-
sible.
For the number of steps, refer to section 3.11.
For the operation time for each instruction, refer to Appendix A.

NOTE Because standard device registers are the same devices as index registers, do not use device
numbers of the standard device registers for the index registers.

Programming MELSEC System Q and L series 3 – 43


Operation errors Configuration of Instructions

3.9 Operation errors


In the following cases operation errors occur:
● If the error conditions described under the topic "Operation Errors" for the individual
instructions match, an error code is returned.
● When an intelligent function module device is used, no intelligent function module is installed
at the specified I/O number position.
● When an intelligent function module device is used, the specified buffer memory address
does not exist.
● If a link device is used, but the corresponding network does not exist.
● If a link device is used, but there is no network module connected to the specified I/O number.
● When a multiple CPU shared device is used, a CPU module is not installed at the head I/O
number position of the specified CPU module.
● When a multiple CPU shared device is used, the specified shared memory address does
not exist.
● The setting of the device number crosses over the boundary between the internal user device
and the extended data register (D) or extended link register (W).
(Universal model QCPU (excluding Q00UJCPU) and LCPU)

NOTE When file register is set but a memory card is not installed or when file register is not set, writing/
reading to/from file register is as follows:
 For the High Performance model QCPU, Process CPU, and Redundant CPU
An error does not occur even when writing/reading to/from file register is performed. How-
ever, “0H” is stored when reading from file register is performed.
 For the Universal model QCPU and LCPU
The OPERATION ERROR (error code 4101) occurs when writing/reading to/from file register
is performed.

3 – 44
Configuration of Instructions Operation errors

3.9.1 Verification of the device range

Instructions for specified each device, including MOV and DMOV


● For the Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant
CPU
If instructions use devices with fixed length (MOV, DMOV, etc.), the device range will not be
verified. In those cases where the relevant address range is exceeded the data to be written
is written to a vacant device.
If for example, 12k addresses are designated, there will no error code be returned even if
the register address D12287 is exceeded.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example but D12288 does not
exist. A vacant register will be
overwritten with the contents of
D12288.

For an index qualification the device range is not verified either.


In cases where the corresponding device range is exceeded as the result of performing
indexing, data is written to other devices.
For the assignment order of internal user devices, refer to page 3-48 ("Character string data")
below.

● Universal model QCPU and LCPU


The device range is checked. When the device number is outside the device range, an
operation error occurs.
For example, when12 k points are assigned to a data register, an error occurs if the device
number of the data register exceeds D12287.

Ladder Diagram Explanation

When D12287 is specified with the


DMOV instruction, the target devices
are D12287 and D12288.
However, an operation error occurs
because D12288 does not exist.

The device range is checked even though indexing is executed. With changing the settings
of the PLC parameter, the device range is not checked.
For changing the settings of the PLC parameter of the programming tool, refer to the User’s
Manual of the corresponding programming tool.

Programming MELSEC System Q and L series 3 – 45


Operation errors Configuration of Instructions

Instructions for a block of devices, including BMOV and FMOV


● For the Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant
CPU
If instructions use devices with variable length, the device range is verified (BMOV, FMOV,
and other instructions that designate initial addresses). In those cases where the relevant
address range is exceeded an error code is returned.
If for example, 12k addresses are designated, the error code is returned after the register
address D12287 is exceeded.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example.
However, D12288 does not exist and
an error code is returned.

The device range is verified for an index qualification too.


There is no error code returned, if the initial device number exceeds the address range.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example.
However, D12288 does not exist and
an error code is returned.
The initial device number D12289
exceeds the relevant range. The data
are stored from the register W0
onwards without returning an error
code.

● Universal model QCPU and LCPU


The device range is checked. In those cases where the relevant address range is exceeded
an error code is returned.
If for example, 12k addresses are designated, the error code is only returned after the
register address D12287 is exceeded.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example.
However, D12288 does not exist and
an error code is returned.

3 – 46
Configuration of Instructions Operation errors

The device range is verified for an index qualification too. An error occurs when the head
device number of the devices with indexing exceeds the device range.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example.
However, D12288 does not exist and
an error code is returned.

The initial device number D12289


exceeds the relevant range. An
operation error occurs.

With changing the settings of the PLC parameter, the device range is not checked.
For changing the settings of the PLC parameter of the programming tool, refer to the User’s
Manual of the corresponding programming tool.

Programming MELSEC System Q and L series 3 – 47


Operation errors Configuration of Instructions

Character string data


Since character strings are of variable lengths the device range is verified. In cases where the
corresponding device range is exceeded, an error code is returned.
If for example, 12k addresses are designated, there will no error code be returned until the reg-
ister address D12287 is exceeded.

Ladder Diagram Explanation

D12287 and D12288 are designated in


this example.
However, D12288 does not exist and
an error code is returned.

However, with the Basic Model QCPU, High Performance model QCPU, Process CPU, and
Redundant CPU, when indexing is executed and the head device number is outside the device
range, no error occurs and the other devices are accessed.
When performing the following access in Universal model QCPU or LCPU, an error (error code
4101) occurs.
 Access crossing the boundary of devices caused by indexing (range of A area)

The allocation order of individual devices is shown below:

SM
SD
X
Y
M
L
B
F
SB
V Area A
S
Contact and coil of T
Contact and coil of ST
Contact and coil of C
Present value of T
Present value of ST
Present value of C
D
W
SW
Empty area Boundary B
File register (32k points)

 Access crossing the boundary of file registers caused by indexing


 Access to file registers (R, ZR) without setting file register files
 Access to file registers (R, ZR) exceeded the range of file register files

3 – 48
Configuration of Instructions Operation errors

Presetting PLC parameter not to check indexing device range enables the Universal model
QCPU not to detect an error in the above accesses from  to . Detecting an error in the
above accesses however, depends on the serial No. of Universal model QCPU.

Setting device range First 5 digits of serial No. for Universal model QCPU
in indexing "10021" or lower "10022" or higher
Set Detected errors in accesses  to 
Not set Detected errors in accesses  to  Not detected

For changing the settings of the PLC parameter, refer to the User’s Manual of the programming
tool.

NOTE When indexing is executed only with Universal model QCPU or LCPU, devices between internal
user devices (SW) and file registers (R) cannot be skipped. (Error code 4101)

Index qualification of the direct output (DY)


The device range is verified for an index qualification of the direct output (DY).

Programming MELSEC System Q and L series 3 – 49


Operation errors Configuration of Instructions

Precautions for using the extended data register (D) or extended link register (W) (for
the Universal model QCPU (except Q00UJCPU), and LCPU)
With the following specification methods, data cannot be specified crossing over the boundary
of the internal user device and extended data register (D) or extended link register (W). Doing
so causes an "OPERATION ERROR" (Error code 4101).
● Index modification
● Indirect designation
● Specification with the instructions that handle data blocks
Data block indicates the following data:
– Data used in the instructions, such as FMOV, BMOV, BK+, where multiple words are
targeted for operation
– Control data, composed of two or more words, specified in the instructions, such as
SP.FWRITE, SP.FREAD
– Data whose data type is 32-bit or more (BIN 32-bit, real number, indirect address of the
device)

Data block where the device number


crosses over the boundary between the
internal user device and the extended data
register (D) cannot be handled. Image of D device

D100 Internal user


FMOV K0 D100 K200 device

D199

FMOV K0 D12200 K200


D12200

FMOV K0 D20000 K200 D12299 Extended data


register (D)

D20100

D20299

3 – 50
Configuration of Instructions Operation errors

3.9.2 Verification of the device data

Verification of binary data


● If the operation result exceeds the value range, no error code is returned.
The carry flag in this case is not set.

Verification of BCD data


● Each digit of the BCD values (0 to 9) is verified.
If one individual digit exceeds the range of 0 to 9 (A to F), an error code is returned.
● If the operation result exceeds the value range, no error code is returned.
The carry flag in this case is not set.

Verification of floating-point numbers (with single precision floating-point operation


instruction)
Operation errors occur in the following cases:
● The absolute value of the floating-point number is 1.0 x 2-127 or lower.
● The absolute valuse of the floating-point number is 1.0 x 2128 or higher.

Verification of floating-point numbers (with double precision floating-point operation


instruction)
Operation errors occur in the following cases:
● The absolute value of the floating-point number is 1.0 x 2-1023 or lower.
● The absolute value of the floating-point number is 1.0 x 21024 or higher.

Verification of character strings


The device data are not verified.

3.9.3 Buffer memory access

For accessing buffer memories, using instructions with intelligent function module devices
(from Un\G0) is recommended.

3.9.4 Multiple CPU shared memory access

For accessing multiple CPU shared memories, using instructions with multiple CPU shared
devices (from U3En\G10000) is recommended.

Programming MELSEC System Q and L series 3 – 51


Execution conditions of the instructions Configuration of Instructions

3.10 Execution conditions of the instructions


3.10.1 Execution condition

There are 4 different types of execution conditions for the instructions:


● Non-conditional execution
The instructions are executed regardless of the signal status of the devices.
Example: LD X0, OUT Y10
● Execution at ON
The instructions are executed as long as the execution instruction is set.
Example: MOV, FROM
● Execution at leading edge
The instructions are executed at leading edge (signal status changes from 0 to 1) from the
execution condition.
Example: PLS, MOVP
● Execution at trailing edge
The instructions are executed at trailing edge (signal status changes from 1 to 0) from the
execution condition.
Example: PLF

The vast majority of instructions are of the following two types:


– Execution condition set ON
– Execution at leading edge from the execution condition

Execution condition set ON:


The instruction is executed as long as the execution instruction is set. Such instructions are not
particularly indicated.
Example: MOV_M/ MOV

Ladder Diagram MELSEC Instruction List

Execution at leading edge from the execution condition:


When judging the leading edge from the execution condition the instruction is executed only if
the signal state changes from 0 to 1.
Example: MOVP_M/ MOVP

Ladder Diagram MELSEC Instruction List

3 – 52
Configuration of Instructions Execution conditions of the instructions

The following example shows the execution of the MOV instruction with the execution condition
set ON and the execution at leading edge from the execution condition:

Ladder Diagram Explanation

Execution at
execution condition set ON

Execution at leading edge from


the execution condition

3.10.2 EN input and ENO output

All instructions described in this manual are provided in the manufacturer library of the GX IEC
Developer. These instructions in addition to the input and output variables provide an EN input
and an ENO output.
The figure below shows several MELSEC instructions from the GX IEC Developer manufac-
turer library:

In the IEC standard library nearly all instructions appear twice. They just differ in the suffix "_E".
These instructions provide an EN input and an ENO output.
The figure below shows two IEC instructions from the standard library of the GX IEC Devel-
oper:

The following examples show the differing execution of the instruction with and without EN
inputs and ENO outputs.

Example 1: Without additional connection


Without additional connection the execution condition of the instruction is permanently set.

Programming MELSEC System Q and L series 3 – 53


Execution conditions of the instructions Configuration of Instructions

Example 2: Connection with a contact


If the EN input is connected with a contact, the instruction is executed if the condition is
matched.

Example 3: Connection with an operation result


If the boolean result of an arithmetic operation is connected to the EN input, the instruction is
only executed, if the result of the arithmetic operation is TRUE.

Example 4: Connection with the preceding instruction


If the EN input is connected to the ENO output of the preceding instruction, the instructions are
only executed, if the condition is matched.

NOTE The ENO output must not compulsorily be connected. The signal at the EN input is looped-
through to the ENO output. If the EN input is "TRUE", the ENO output is "TRUE" as well.

3 – 54
Configuration of Instructions Number of program steps

3.11 Number of program steps


In order not to exceed the required memory capacity in the internal memory and ROM or RAM
memory of the memory cards a calculation of the total number of steps in a program is
required. In the following sections the calculation of steps for the instructions is described.

Counting the number of basic steps


The number of steps for an instruction depends on the number of basic steps. Most of the
instructions for their execution only require a number of basic steps. The number of basic steps
depends on the number of used devices plus 1.
The example below shows the calculation of the number of basic steps for the PLUS instruc-
tion:

Ladder Diagram Explanation

3 Program steps
The numbers in brackets specify the
cumulative number of program steps for the
devices.
4 Program steps

The numbers in brackets specify the


cumulative number of program steps for the
devices.

Conditions for increasing the number of steps


The number of steps is increased over the number of basic steps in cases where a device is
used that is designated indirectly or for which the number of steps is increased.
● When device is designated indirectly
In cases where indirect designation is done by @, the number of steps is increased 1 step
over the number of basic steps.
For example, when a 3-step MOV instruction is designated indirectly (example: MOV K4X0
@D0), one step is added and the instruction becomes 4 steps.
● Devices with additional steps (Basic Model QCPU, High Performance model QCPU, Process
CPU, and Redundant CPU):

Devices increasing the Added Steps Example


Number of Steps

Devices of special function modules MOV U4\G10 D0

Multiple CPU shared device MOV U3E1\G0 D0

Link devices MOV J3\B20 D0

Index register 1 MOV Z0 D0

File registers addressed in series MOV ZR123 D0

32-bit constants DMOV K123 D0

Floating point number as constants EMOV E0.1 D0

For an odd number:


(number of characters + 1)/2
Character strings $MOV „123“ D0
For an even number:
Number of characters/2

Programming MELSEC System Q and L series 3 – 55


Number of program steps Configuration of Instructions

● Devices with additional steps (Universal model QCPU(except Q00UJCPU) and LCPU)
– Instructions applicable to subset processing
The following table shows steps depending on the devices.

Added Steps
(Number of Basic Number
Instruction Symbols Devices With Additional Steps
Instruction of Steps
Steps)

Serial number access format file register,


LD, LDI, AND, ANI, OR, ORI, Extended data register (D),
LDP, LDF, ANDP, ANDF, ORP, Extended link register (W) 1(2) 1
ORF
Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
LDPI, LDFI Extended link register (W) 1(4) 3

Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
ANDPI, ANDFI, ORPI, ORFI Extended link register (W) 1(5) 4

Multiple CPU shared device 3)

Serial number access format file register


Extended data register (D),
SET Extended link register (W) 1(2) 1

Multiple CPU shared device 3)

Timer/Counter 3(4)

Serial number access format file register


OUT Extended data register (D), 1
Extended link register (W) 1(2)

Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
RST (bit device) Extended link register (W) 1(2) 1

Multiple CPU shared device 3)

Timer/Counter (Bit/word device) 2(4)

Serial number access format file register,


RST (word device) Extended data register (D), 1(3) 2
Extended link register (W)

Multiple CPU shared device 3) 1(3)

Standard device register 2) -1


LD=, LD<>, LD<, LD<=, LD>,
LD>=, AND=, AND<>, AND<, Serial number access format file register,
AND<=, AND>, AND>=, Extended data register (D), 3
OR=, OR<>, OR<, OR<=, Extended link register (W) 1
OR>, OR>=
Multiple CPU shared device 3)

3 – 56
Configuration of Instructions Number of program steps

Added Steps
Instruction Symbols Devices With Additional Steps (Number of Basic Number
Instruction of Steps
Steps)

Standard device register 2) -1

LDD=, LDD<>, LDD<, LDD<=, Serial number access format file register,
LDD>, LDD>=, Extended data register (D),
ANDD=, ANDD<>, ANDD<, Extended link register (W)
3
ANDD<=, ANDD>, AND>=,
1
ORD=, ORD<>, ORD<, Multiple CPU shared device 3)
ORD<=, ORD>, ORD>=
Decimal constant, hexadecimal constant,
real constant

Standard device register 2) d: -1


+, -, +P, -P,
Serial number access format file register
WAND, WOR, WXOR, WXNR,
Extended data register (D), Extended link 3
WANDP, WORP, WXORP,
register (W) s1: 1, d: 3
WXNRP (2 devices)
Multiple CPU shared device 3)

Standard device register 2) d: -1

Serial number access format file register,


Extended data register (D),
D+, D-, D+P, D-P, DAND, DOR,
Extended link register (W) s1: 1, d: 3
DXOR, DXNR, DANDP, DORP, 3
DXORP, DXNRP (2 devices) 3)
Multiple CPU shared device

Decimal constant, hexadecimal constant,


s1: 1
real constant

Serial number access format file register,


+, -, +P, -P,
Extended data register (D),
WAND, WOR, WXOR, WXNR,
Extended link register (W) s1, s2: 1, d: 2 3
WANDP, WORP, WXORP,
WXNRP (3 devices) 1)
Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
Extended link register (W) s1, s2:1, d: 2
D+, D-, D+P, D-P, DAND, DOR,
DXOR, DXNR, DANDP, DORP, 3
Multiple CPU shared device 3)
DXORP, DXNRP (3 devices)1)
Decimal constant, hexadecimal constant,
s1, s2: 1
real constant

Serial number access format file register,


Extended data register (D),
x, xP, /, /P Extended link register (W) s1, s2:1, d: 2 3

Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
Extended link register (W) s1, s2:1, d: 2
Dx, DxP, D/, D/P, Ex, ExP 3
Multiple CPU shared device 3)

Decimal constant, hexadecimal constant,


s1, s2: 1
real constant

Index register/Standard device register 2) -1

Serial number access format file register,


INC, INCP, DEC, DECP, DINC,
Extended data register (D), 3 2
DINCP, DDEC, DDECP
Extended link register (W)

Multiple CPU shared device 3) 1

Programming MELSEC System Q and L series 3 – 57


Number of program steps Configuration of Instructions

Added Steps
Instruction Symbols Devices With Additional Steps (Number of Basic Number
Instruction of Steps
Steps)

Serial number access format file register,


Extended data register (D),
MOV, MOVP Extended link register (W) 1 2

Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
Extended link register (W)
DMOV, DMOVP, EMOV,
1 2
EMOVP Multiple CPU shared device 3)

Decimal constant, hexadecimal constant,


real constant

Serial number access format file register,


Extended data register (D),
BCD, BCDP, BIN, BINP, FLT,
Extended link register (W) s1: 1, s2: 2 2
FLTP, CML, CMLP
Multiple CPU shared device 3)

Serial number access format file register,


Extended data register (D),
Extended link register (W) s1: 1, s2: 2
DBCD, DBCDP, DBIN, DBINP,
INT, INTP, DINT, DINTP, DFLT, 2
Multiple CPU shared device 3)
DFLTP, DCML, DCMLP
Decimal constant, hexadecimal constant,
s1: 1
real constant

1 If the same device is used for s1 and s2, the number of basic steps increases by one.
2
The number of steps decreases with a standard device register.
3
Not available with LCPU.

3 – 58
Configuration of Instructions Number of program steps

When multiple standard device registers are used in an instruction applicable to subset
processing, the number of steps decreases.
The following table shows the number of steps for each instruction.

Added Steps Basic


Locations Where Standard Device (Number of
Instruction Symbols Register Is Used Instruction Number of
Steps
Steps)

LD=, LD<>, LD<, LD<=, LD>, LD>=,


AND=, AND<>, AND<, AND<=,
AND>, AND>=,
OR=, OR<>, OR<, OR<=, OR>,
OR>=,
LDD=, LDD<>, LDD<, LDD<=, LDD>, s1 and s2 –2(1) 3
LDD>=,
ANDD=, ANDD<>, ANDD<,
ANDD<=, ANDD>, AND>=,
ORD=, ORD<>, ORD<, ORD<=,
ORD>, ORD>=

+, -, +P, -P, D+, D-, D+P, D-P,


WAND, WOR, WXOR, WXNR,
DAND, DOR, DXOR, DXNR, WANDP,
s1 and d –2(1) 3
WORP, WXORP, WXNRP, DANDP,
DORP, DXORP, DXNRP
(2 devices)

s1, s2 and d –2(1)

s1, or s2 and d –1(2)


+, -, +P, -P, D+, D-, D+P, D-P, WAND,
WOR, WXOR, WXNR, DAND, DOR, s1 and s2
DXOR, DXNR, WANDP, WORP, (only when that device that the
±0(3) 3
WXORP, WXNRP, DANDP, DORP, number of steps does not increase is
DXORP, DXNRP specified for d)
(3 devices) 1)
s1 and s2
(only when a serial number access +2(5)
format file register is specified for d)

s1, s2 and d –2(1)


x, xP, /, /P 3
s1, or s2 and d –1(2)

s1, s2 and d –2(1)

s1, or s2 and d –1(2)

s1 and s2
(only when that device that the
Dx, DxP, D/, D/P, Ex, ExP ±0(3) 3
number of steps does not increase is
specified for d)

s1 and s2
(only when a serial number access +2(5)
format file register is specified for d)

MOV, MOVP, DMOV, DMOVP, EMOV,


s1 and d –1(1) 2
EMOVP

BCD, BCDP, BIN, BINP, DBCD,


DBCDP, DBIN, DBINP, FLT, FLTP,
s1 and d –1(1) 2
DFLT, DFLTP, INT, INTP, DINT,
DINTP, CML, CMLP, DCML, DCMLP

1 If the same device is used for s1 and d, the number of basic steps increases by one.

Programming MELSEC System Q and L series 3 – 59


Number of program steps Configuration of Instructions

– Except Instructions applicable to subset processing


The following table shows steps depending on the devices.

Devices with Additional Steps Added Steps Example

Devices of special function modules MOV U4\G10 D0

Multiple CPU shared device MOV U3E1\G10000 D0

Link direct device MOV J3\B20 D0

Index register / standard device register MOV Z0 D0

File registers addressed in series 1 MOV ZR123 D0

Extended data register (D) MOV D123

Extended link register (W) MOV W123

32-bit constants DMOV K123 D0

Floating point number as constants EMOV E0.1 D0

For an odd number:


(number of characters + 1/2)
Character strings $MOV „123“ D0
For an even number:
Number of characters/2

In cases where several of these factors apply the number of steps sums up.
If for example, MOV U1\G10 ZR123 is programmed, 1 step is added for the buffer memory and
1 step for the file register addressed in series, resulting in a total of 2 steps (see the following
figure):

Example: MOV
If U1\G10 ZR123 has been designated, a total of 2 steps is added.

U1\
MOV G10 ZR123

Serial number access format file registers : 1 step


+
: 1 step
Intelligent function module devices
=
Increased by 2 steps

3 – 60
Configuration of Instructions Multiple Instructions using the same device

3.12 Multiple Instructions using the same device


This section describes the operation for executing multiple instructions of the OUT, SET/RST,
or PLS/PLF that use the same device in one scan.

3.12.1 OUT instructions using the same device

Do not program more than one OUT instruction using the same device in one scan. If the OUT
instructions using the same device are programmed in one scan, the specified device will turn
ON or OFF every time the OUT instruction is executed, depending on the operation result of
the program up to the relevant OUT instruction. Since turning ON or OFF of the device is deter-
mined when each OUT instruction is executed, the device may turn ON and OFF repeatedly
during one scan.
The following diagrams show an example of a ladder that turns the same internal relay (M0)
with inputs X0 and X1 ON and OFF.

Ladder diagram

X0
M0

X1
M0

Timing chart
X0 X0
M0 M0
X1 X1
M0 M0
END END END

ON
X0 OFF
ON
X1 OFF

ON
M0 OFF

M0 turns ON because
M0 turns OFF because X1 is OFF. X1 is ON.

M0 turns ON because X0 is ON M0 remains OFF


because X0 is OFF.

With the refresh type CPU module, when the output (Y) is specified by the OUT instruction, the
ON/OFF status of the last OUT instruction of the scan will be output.

Programming MELSEC System Q and L series 3 – 61


Multiple Instructions using the same device Configuration of Instructions

3.12.2 SET/RST instructions using the same device

The SET instruction turns ON the specified device when the execution command is ON and
performs nothing when the execution command is OFF. For this reason, when the SET instruc-
tions using the same device are executed two or more times in one scan, the specified device
will be ON if any one of the execution commands is ON.
The RST instruction turns OFF the specified device when the execution command is ON and
performs nothing when the execution command is OFF. For this reason, when the RST instruc-
tions using the same device are executed two or more times in one scan, the specified device
will be OFF if any one of the execution commands is ON.
When the SET instruction and RST instruction using the same device are programmed in one
scan, the SET instruction turns ON the specified device when the SET execution command is
ON and the RST instruction turns OFF the specified device when the RST execution command
is ON. When both the SET and RST execution commands are OFF, the ON/OFF status of the
specified device will not be changed.

Ladder diagram

X0
SET M0

X1
RST M0

Timing chart X0 X0
SET M0 SET M0
X1 X1
RST M0 RST M0
END END END

ON
X0 OFF
ON
X1 OFF

ON
M0 OFF

M0 turns OFF because


RST M0 is not executed X1 is ON.
because X1is OFF.
(M0 remains ON) SET M0 is not executed because
X0 is OFF. (M0 remains ON)
M0 turns ON because X0 is ON

When using a refresh type CPU module and specifying output (Y) in the SET/RST instruction,
the ON/OFF status of the device at the execution of the last instruction in the scan is returned
as the output (Y).

3 – 62
Configuration of Instructions Multiple Instructions using the same device

3.12.3 PLS instructions using the same device

The PLS instruction turns ON the specified device when the execution command is turned ON
from OFF. It turns OFF the device at any other time (OFF to OFF, ON to ON, or ON to OFF).

If two or more PLS instructions using the same device are executed in one scan, each instruc-
tion turns ON the device when the corresponding execution command is turned ON from OFF
and turns OFF the device in other cases. For this reason, if multiple PLS instructions using the
same device are executed in a single scan, a device that has been turned ON by the PLS
instruction may not be turned ON during one scan.

Ladder diagram

X0
PLS M0

X1
PLS M0

Timing chart

The ON/OFF timing of the X0 and X1 is different.


(The specified device does not turn ON throughout the scan.)
X0 X0
The ON/OFF timing of the X0 and X1 is different.
PLS M0 PLS M0
(The specified device does not turn ON throughout the scan.)
X1 X1
PLS M0 PLS M0
END END END

ON
X0 OFF
ON
X1 OFF

ON ON
M0 OFF M0 turns ON because X1 goes
M0 turns OFF be- ON (OFF → ON).
M0 turns ON because X0 goes cause X1 status is oth- M0 turns OFF because X0 status is other
ON (OFF → ON). er than OFF → ON. than OFF → ON. (M0 remains OFF.)

X0 and X1 turn ON from OFF at the same time.

1
X0 X0
PLS M0 PLS M0
X1 X1
PLS M0 PLS M0
END END END

ON
X0 OFF
ON
X1 OFF

ON
M0 OFF

M0 turns OFF because X1 status is


M0 turns ON because X1 other than OFF → ON.
goes ON (OFF → ON). (M0 remains OFF)
(M0 remains ON)
M0 turns OFF because X0 status
M0 turns ON because X0 goes ON (OFF → ON). is other than OFF → ON

Programming MELSEC System Q and L series 3 – 63


Multiple Instructions using the same device Configuration of Instructions

When using a refresh type CPU module and specifying output (Y) in the PLS instructions, the
ON/OFF status of the device at the execution of the last PLS instruction in the scan is returned
as the output (Y).

3.12.4 PLF instructions using the same device

The PLF instruction turns ON the specified device when the execution command is turned OFF
from ON. It turns OFF the device at any other time (OFF to OFF, OFF to ON, or ON to ON).
If two or more PLF instructions using the same device are executed in one scan, each instruc-
tion turns ON the device when the corresponding execution command is turned OFF from ON
and turns OFF the device in other cases. For this reason, if multiple PLF instructions using the
same device are executed in a single scan, a device that has been turned ON by the PLF
instruction may not be turn ON during one scan.

3 – 64
Configuration of Instructions Multiple Instructions using the same device

Ladder diagram

X0
PLF M0

X1
PLF M0

Timing chart
The ON/OFF timing of the X0 and X1 is different.
(The specified device does not turn ON throughout the scan.)

X0 X0
PLF M0 PLF M0
X1 X1
PLF M0 PLF M0
END END END

ON
X0 OFF
ON
X1 OFF

ON
M0 OFF
M0 turns OFF because M0 turns OFF because X1
X1 status is other than status is other than ON →
ON → OFF OFF. (M0 remains OFF.)
M0 turns ON because X0
goes OFF (ON → OFF). M0 turns OFF because X0 status is other
than ON → OFF. (M0 remains OFF.)

X0 and X1 turn OFF from ON at the same time.

X0 X0
PLF M0 PLF M0
X1 X1
PLF M0 PLF M0
END END END

ON

X0 OFF
ON
X1 OFF

ON
M0 OFF

M0 turns ON because X1 M0 turns OFF because X1


goes OFF (ON → OFF) status is other than ON → OFF.
(M0 remains ON) (M0 remains OFF.)
M0 turns ON because X0 M0 turns OFF because X0 status is other
goes OFF (ON → OFF). than ON → OFF.

When using a refresh type CPU module and specifying output (Y) in the PLF instructions, the
ON/OFF status of the device at the execution of the last PLF instruction in the scan is returned
as the output (Y).

Programming MELSEC System Q and L series 3 – 65


Precautions for use of file registers Configuration of Instructions

3.13 Precautions for use of file registers


This section explains the precautions for use of the file registers in the QCPU and LCPU.

CPU modules that cannot use file registers


The Q00JCPU and Q00UJCPU cannot use the file registers. When using the file registers, use
the CPU module of other than the Q00JCPU and Q00UJCPU.

Setting of file registers to be used


When using the file registers, the file registers to be used must be set with the PLC parameter
or QDRSET instruction. (The PLC parameters of the Q00CPU, Q01CPU and LCPU need not
be set since they are preset to "Use file register". QDRSET instructions are not available with
LCPU.)
If the file registers to be used have not been set, normal operation cannot be performed with
the instructions that use the file registers.

NOTE Even when file registers to be used are not set in the PLC parameter, a program that uses file
registers can be created.
For the CPU module other than the Universal model QCPU and LCPU, an error does not occur
when that program is written to the CPU module.
However, note that the correct data cannot be written/read to/from the file register.
For the Universal model QCPU and LCPU, an error occurs if the program where file registers are
used is executed.

Securing of file register area


● High Performance model QCPU, Process CPU, Redundant CPU, Universal model QCPU
When using file registers, register the file registers to the standard RAM/memory card to
secure the file register area.
● Basic Model QCPU (except Q00JCPU)
The file register area has been secured in the standard RAM beforehand. The user need
not secure the file register area.
● LCPU
To use the file register, secure a file register area by registering the file register in standard
RAM.

The following table indicates the memories that can use the file registers in each CPU module.

High Performance model QCPU /


Process CPU / Redundant CPU / Basic Model QCPU (except Q00JCPU) /
Memory Universal model QCPU (except LCPU
Q00UJCPU)

Standard RAM  

1) 2)
Memory card 

Can be registered

Cannot be registered
1 When the flash memory is used, only read from the file registers can be performed. (Write to the flash
ROM cannot be performed.)
2 Unusable for the Q00UCPU and Q01UCPU.

3 – 66
Configuration of Instructions Precautions for use of file registers

NOTE For the file register setting method and file register area securing method, refer to User’s Manual
(Functions Explanation, Program Fundamentals) for the CPU module used.

Designation of file register number in excess of the registered number of points


● Basic Model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU
An error will not occur if data are written or read to or from the file registers that have numbers
greater than the registered number of points. However, note that the read/write of correct
data to/from the file registers cannot be performed.
● Universal model QCPU and LCPU
When data are written to or read from the file registers that are not registered, an error
occurs. (Error code: 4101)

File register specifying method


There are the block switching method and serial number access method to specify the file reg-
isters.
● Block switching method
In the block switching method, specify the number of used file register points in units of 32k
points (one block). For file registers of 32k points or more, specify the file registers by
switching the block No. to be used with the RSET instruction. Specify each block as R0 to
R32767.

Standard RAM/
Memory card
RSET K1 Specifying
R0 for block 1 R0

to Block 0
MOV D0 R0

R32767

RSET K2 Specifying R0
R0 for block 2 Block 1
to

MOV D0 R0 R32767
R0 Block 2
to

Programming MELSEC System Q and L series 3 – 67


Precautions for use of file registers Configuration of Instructions

● Serial number access method


In the serial number access method, specify the file registers beyond 32k points with
consecutive device numbers. The file registers of multiple blocks can be used as consecutive
file registers. Use "ZR" as the device name.

Standard RAM/
Memory card
MOV D0 ZR32768
ZR0
Block 0
to

ZR32767
MOV D0 ZR65536 ZR32768

Block 1
to

ZR65535
ZR65536
Block 2
to

Settings and restrictions when refreshing file registers


● Settings
The settings of refresh devices are as follows.
– Refresh settings for CC-Link IE controller network (Cannot be set on LCPU.)
– Refresh settings for MELSECNET/H (Cannot be set on LCPU.)
– Refresh settings for CC-Link
– Auto refresh settings for the intelligent function module
– Auto refresh settings for the multiple CPU system (Cannot be set on LCPU.)

● Restrictions
The restrictions when specifying file registers to refresh devices are as follows.
– On QCPU, Refresh cannot be performed correctly if the use of file register which has the
same name as the program is specified by the PLC parameter. When the file register which
has the same name as the program is used, refresh is performed to the data of the file
register having the same name as the program that is set at the last number in the
[Program] tab page of PLC parameter.
To read/write the refresh data, specify the file register to the refresh device after switching
the file register to the corresponding one with the QDRSET instruction.
– Refresh cannot be performed correctly if the file name of file register or the drive number
is changed by the QDRSET instruction. (QDRSET instructions are not available with
LCPU.)
If the file name of file register or the drive number is changed by the QDRSET instruction,
link refresh is performed to the data of the setting file at the time of the END instruction
execution.
To read/write the refresh data, specify the file register of the setting file at the time of the
END instruction execution.

3 – 68
Configuration of Instructions Precautions for use of file registers

If the drive number is changed by the QDRSET instruction when "ZR" is specified for the
device in the CPU modules other than the Universal model QCPU, an error (LINK PARA
ERROR (3101)) occurs. (Note that an error does not occur when "R" is specified for the
device.)
– When a block number is switched by the RSET instruction, refresh is performed to the
data of the file register (R) in the switched block number.
When a block number is switched by the RSET instruction, refresh is performed to the
data of the file register (R) in the block number at the time of the END instruction execution.
To read/write the refresh data, specify the file register of the block number at the time of
the END instruction execution.

Precautions when file registers in the flash memory are used


File registers in the flash memory can be only read in a sequence program.
(Write to the flash memory cannot be performed in a sequence program.)

Sequence program Flash memory

Write
BMOV D100 R0 K10
File
register
BMOV R100 D0 K10
Read

When using the flash memory for the file registers, write data in advance. Using GX Works2,
write data to the flash card.

Programming MELSEC System Q and L series 3 – 69


Precautions for use of file registers Configuration of Instructions

3 – 70
Layout and Structure of the Chapters

4 Layout and Structure of the Chapters


This chapter gives an introduction to the chapters 5 through 12 and describes the layout and
structure of the explanations to the instructions for the MELSEC Sstem Q and L series.
The figure below shows that each of the these chapters starts with a table that lists and com-
ments the structure and subdivision of the instructions described in that chapter.

Each subdivided topic is described in the following according chapter and illustrated by pro-
gram examples.

Programming MELSEC System Q and L series 4–1


Overview of the instructions Layout and Structure of the Chapters

4.1 Overview of the instructions

Each subdivided topic starts with a table that lists all individual instructions described in this
section. As the figure below shows, all variations of the instructions are represented in
MELSEC and IEC editor notation.

When using the GX IEC Developer, always choose the IEC instruction when different notations
are offered.

4.2 The CPU table


The sections describing the instructions start with a table that indicates each CPU (Basic
model QCPU, High Performance model QCPU, Process CPU, Redundant CPU, Universal
model QCPU, LCPU) capable of processing the respective instruction. The capable CPUs are
indicated by a black spot.

Data conversion instructions ENEG, ENEGP

6.3.12 ENEG, ENEGP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)

1
Basic model QCPU: The serial number (upper five digits) is "04122" or higher.

Any particular processing details of a certain CPU are commented in a footnote (e.g. extended
instructions, refer to section 3.3 "Programming of dedicated instructions".

4–2
Layout and Structure of the Chapters Devices

4.3 Devices
The table "Devices" lists all usable devices that can be used for the internal variables (e.g. s1,
s2, d).
The devices are not listed separately; only a distinction is drawn whether the instruction is
capable of designating bit and/or word devices.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Constant
Register Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d       — — —
n         —

Whether the instruction supports file register access is indicated in the column "File Register".
The column "MELSECNET/H Direct J\“ specifies whether the instruction supports read/
write operations of bit and/or word data from/to stations connected to the MELSECNET/H.
"J\" specifies the station number and "“ the device number.
The column "Special Function Module U\G“ specifies whether the instruction supports read/
write operations of data from/to the buffer memory of an installed special function module.
"U\“ specifies the head address of the special function module and "G“ the buffer memory
address.
Whether the instruction can apply an index qualification is indicated in the column "Index
Register Zn".
Whether decimal (K) or hexadecimal (H, 16#) constants can be processed by the instruction is
indicated in the column "Constant K, H (16#)".
The column "Other" specifies whether the instruction uses any other devices and constants.
Any particular details are commented in footnotes below the table.

Programming MELSEC System Q and L series 4–3


Representation format of the instruction Layout and Structure of the Chapters

4.4 Representation format of the instruction


4.4.1 Representation in the GX IEC Developer

The device tables are followed by the representation format of the instruction in the GX IEC
Developer.
The figure below from the left to the right shows the representation of the instruction LD_EQ_M
in the MELSEC editor (MELSEC instruction list) and in the IEC editor (ladder diagram and IEC
instruction list).

4.4.2 Representation in GX Works2

The representation format for the instruction in the GX IEC Developer is followed by the repre-
sentation format of the instruction in GX Works2.

4–4
Layout and Structure of the Chapters Variables

4.5 Variables
The table of variables lists all internal variables of the instruction.

The column "Meaning" describes the functions of the devices and device elements.
The column "Data Type" lists the data types of the devices. Provided that there are differences
between the data types of the MELSEC and the IEC editor, these are listed as well. Refer to
the sections 3.4 "Programming of variables" and 3.5 "Data types" for further details on
variables.

4.6 Functions
The section "Functions" describes the functions of the instruction in detail.
The figure below shows the description of the functions of the LDF/LDP instruction.

Programming MELSEC System Q and L series 4–5


Notes Layout and Structure of the Chapters

4.7 Notes
The section "NOTE" points out particular details, errors, and sources of malfunction in the pro-
gramming of the instruction.

NOTE The MEP and MEF instructions will occasionally not function when pulse conversion is ap-
plied to contacts that are indexed by a subroutine or by a FOR/NEXT instruction. In this ca-
se, the EPG/EGF instruction has to be applied.

The MEP/MEF instruction operates with the ooperation results immediately prior to the
MEP and MEF instructions. For this reason, an AND instruction should be used at the
same position. The MEP and MEF instructions cannot be used at the LD or OR position.

4.8 Operation errors


The description of the operation errors mainly refer to the error code list, see section 13.1 "Error
code list".
The figure below shows the operation errors of the DELTA-/DELTAP instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns
Errors ON, and an error code is stored into SD0.
 The number of output designated by d exceeds the output range.
(Error code: 4101)

4–6
Layout and Structure of the Chapters Program examples

4.9 Program examples


The program examples given at the end of each section primarily contain programs for the
MELSEC System Q.
The program examples are programmed in the representation format of the ladder diagram.
For a clearer description in many cases graphical illustrations were added.
The figure below shows a program example of the instructions LD, AND, OR, and ORI.

In the following figure a program example for the RBMOVP instruction is shown. The represen-
tation of the instructions is that of the GX Works2.

Programming MELSEC System Q and L series 4–7


Program examples Layout and Structure of the Chapters

4–8
5 Sequence Instructions
Sequence instructions, besides conventional instructions to program input and output con-
tacts, also include program jump commands, block connection instructions and bit shift instruc-
tions, master control, program termination and other instructions. These are the fundamental
instructions for programming the MELSEC series.
The following table shows the division of the fundamental instruction set:

Instruction Meaning
Input instruction Operation start,
series and parallel connection of contacts.
Connection instruction Series and parallel block connection,
storage and processing of operation results,
inversion of operation results,
conversion of operation results into pulses,
setting of edge relays.
Output instruction Bit devices, counter and timer contacts,
output, setting, and resetting of annunciators,
setting and resetting of devices,
leading edge and trailing edge output,
bit device output inversion,
generating pulses.
Shift instruction Shifting bit devices.
Master control instruction Setting and resetting single parts of a program.
Termination instruction End of a part of program,
end of sequence and routine programs.
Miscellaneous instructions Sequence program stop,
no operation.

NOTE The following table, besides the MELSEC instructions in the different editors, also contains the
according IEC instructions:

MELSEC Instruction
in IEC Editor IEC Instruction in
in MELSEC Editor IEC Editor
Instruction List Ladder Diagram

LD — — LD

LDI — — LDN

AND — AND

ANI — ANDN

OR — — OR

ORI — — ORN

LDP LDP_M — — —
LDF LDF_M — — —

ANDP ANDP_M — —

ANDF ANDF_M — —

Programming MELSEC System Q and L series 5–1


MELSEC Instruction
IEC Instruction in
in IEC Editor IEC Editor
in MELSEC Editor
Instruction List Ladder Diagram

ORP ORP_M — —

ORF ORF_M — —

LDPI
LDFI
ANDPI
ANDFI
ORPI
ORFI

AND (
ANB — — ...
)

OR (
ORB — — ...
)

MPS MPS_M —

MRD MRD_M —

MPP MPP_M —

INV INV_M NOT

MEP MEP_M — —

MEF MEF_M — —

EGP EGP_M — —

EGF EGF_M — —

OUT OUT_M ST

OUT T TIMER_M — —

OUTH T TIMER_H_M — —

OUT C COUNTER_M — —

5–2
MELSEC Instruction
IEC Instruction in
in IEC Editor IEC Editor
in MELSEC Editor
Instruction List Ladder Diagram
OUT F

SET SET_M S

RST RST_M R

SET F
RST F

PLS PLS_M — R_TRIG 1)

PLF PLF_M — R_TRIG 1)

FF FF_M — —

DELTA DELTA_M — —

DELTAP

SFT SFT_M — SHL/SHR

SFTP

MC MC_M — —

MCR MCR_M — —

FEND FEND_M — 2)

END END_M — 2)

STOP STOP_M — —

NOP — — —
NOPLF
PAGE
1
These are IEC function blocks.
2
FEND and END are set automatically by GX Works2 and the GX IEC Developer.

Programming MELSEC System Q and L series 5–3


LD, LDI, AND, ANI, OR, ORI Input instructions

5.1 Input instructions


5.1.1 LD, LDI, AND, ANI, OR, ORI

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DX, BL
s       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


s Devices used as connections bit

5–4
Input instructions LD, LDI, AND, ANI, OR, ORI

Functions Operation start


LD Load (normally open contact)
LDI Load inverse (normally closed contact)
Every operation starts with an LD (LoaD) or an LDI ((LoaD Inverse) instruction.
The LD instruction specifies an NO contact (normally open) and the LDI instruction specifies
an NC contact (normally closed). The device designated by the instruction is the input condition
(operation result) for the following instruction.

Series connection
AND of NO contacts
ANI of NC contacts
Contacts are connected in series via an AND instruction as NO contact or via an ANI instruc-
tion as NC contact.
The device designated by the instruction sets the operation condition for the following instruc-
tion.
Both commands are logical connections and must not be programmed at the beginning of an
operation.

Parallel connection
OR of NO contacts
ORI of NC contacts
Parallel connection of contacts is established via an OR instruction as NO contact or via an
ORI instruction as NC contact.
The device designated by the instruction sets the operation condition for the following instruc-
tion.
Both commands are logical connections and must not be programmed at the beginning of an
operation.

NOTE The devices designated by the instructions can also be word devices. In this case, the condition
of a specified bit is read as contact.
Word devices are designated in hexadecimal code. Bit b11 in D0 for example is designated as
D0.0B.
For further information on addressing bits in word devices refer to chapter 3 "Configuration of In-
structions".

Programming MELSEC System Q and L series 5–5


LD, LDI, AND, ANI, OR, ORI Input instructions

Program LD, AND, OR, ORI


Example 1
The following program shows series and parallel connections of contacts. Bit 5 (b5) in D0 is
also read as contact.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program LD, LDI, AND, ANI, OR


Example 2
The following program shows combined connections. Some contact points are connected via
ORB and ANB instructions. Bits (b1 and b4) in D6 are read as contacts.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program LD, AND, ANI


Example 3
The following program outputs operation results of devices at Y35 through Y37.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5–6
Input instructions LDP, LDF, ANDP, ANDF, ORP, ORF

5.1.2 LDP, LDF, ANDP, ANDF, ORP, ORF

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DX
s       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s Devices used as connections bit

Programming MELSEC System Q and L series 5–7


LDP, LDF, ANDP, ANDF, ORP, ORF Input instructions

Functions Pulse operation start


LDP leading edge
LDF trailing edge
Similar to the LD and LDI instructions, these instructions designate contacts specified by bit or
word devices.
The result of the LDP instruction is 1, if the addressed bit of the device changes from 0 to 1 (lead-
ing edge).
The result of the LDF instruction is 1, if the addressed bit of the device changes from 1 to 0 (trail-
ing edge). As single instruction the LDP instruction executes the same function as a PLS instruc-
tion and with the input condition at leading edge generates a pulse output.
The program example on the left shows a ladder diagram applying an LDP instruction. The
example on the right does not apply an LDP instruction.

Pulse series connection


ANDP leading edge
ANDF trailing edge
The ANDP instruction connects a contact in series with a contact specified by a bit or word
device. This contact has the condition 1, if the addressed bit of a device changes from 0 to 1.
Using an ANDF instruction the specified contact has the condition 1, if the addressed bit of a
device changes from 1 to 0.

Pulse parallel connection


ORP leading edge
ORF trailing edge
The ORP instruction connects a contact in parallel to a contact specified by a bit or word
device. This contact has the condition 1, if the addressed bit of a device changes from 0 to 1.
Using an ORF instruction the specified contact has the condition 1, if the addressed bit of a
device changes from 1 to 0.

The following table shows the results of an LDP, LDF, ANDP, ORP, ANDF and ORF instruction:

Device specified by Result of Result of


LDP/LDF/ANDP/ORP/ANDF/ORF Instruction LDP/ANDP/ORP LDF/ANDF/ORF
Bit Device/Word Device Bit Designation Instruction Instruction

0→1 1
0 0
1 0
1→0 1

5–8
Input instructions LDP, LDF, ANDP, ANDF, ORP, ORF

NOTE Word devices are designated in hexadecimal code. Bit b11 in D0 for example is designated as
D0.0B.

Program ORP
Example
With leading edge from X0 or by setting (leading edge) bit 10 (b10) in data register D0, the fol-
lowing program executes a MOV instruction.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5–9


LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI Input instructions

5.1.3 LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1
Availability depending on serial number:
 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
 QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DX
s       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
Bit device number / Word device bit designation (s)
X1/D0.1
LDP

X1/D0.1
LDF

X2/D0.2
ANDP

X2/D0.2
ANDF

ORP

X3/D0.3

ORF

X3/D0.3

Variables Set Data Meaning Data Type


s Devices used as connections bit

5 – 10
Input instructions LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI

Functions Pulse NOT operation start


LDPI leading edge
LDFI trailing edge
LDPI is the leading edge pulse NOT operation start instruction that is on only at the leading
edge of the specified bit device (when the bit device goes from on to off) or when the bit device
is on or off. If a word device has been specified, LDPI is on only when the specified bit is 0, 1,
or changes from 1 to 0.
LDFI is the trailing edge pulse NOT operation start instruction that is on only at the trailing edge
of the specified bit device (when the bit device goes from off to on) or when the bit device is on
or off. If a word device has been specified, LDFI is on only when the specified bit is 0, 1, or
changes from 0 to 1.

Pulse NOT series connection


ANDPI leading edge
ANDFI trailing edge
ANDPI is a leading edge pulse NOT series connection, and ANDFI is a trailing edge pulse NOT
series connection.
ANDPI and ANDFI execute an AND operation with the previous operation result, and take the
resulting value as the operation result.

Pulse NOT parallel connection


ORPI leading edge
ORFI trailing edge
ORPI is a leading edge pulse NOT parallel connection, and ORFI is a trailing edge pulse NOT
parallel connection. ORPI and ORFI execute an OR operation with the previous operation
result, and take the resulting value as the operation result.

The on or off data used by LDPI/LDFI/ANDPI/ANDFI/ORPI/ORFI are indicated in the table


below.
Device specified by Result of Result of
LDPI/LDFI/ANDPI/ANDFI/ORPI/ORFI Instruction LDPI/ANDPI/ORPI LDFI/ANDFI/ORFI
Bit Device/Word Device Instruction Instruction

0→1 1
0 0
1 0
1→0 1

Programming MELSEC System Q and L series 5 – 11


LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI Input instructions

Program LDPI, ORFI


Example 1
The following program stores 0 into D0 when X0 is on, off, or turns from on to off, or M0 is on,
off, or turns from off to on.

Ladder Diagram

Program ANDPI
Example 2
The following program stores 0 into D0 when X0 is on and b10 (bit 11) of D0 is on, off, or turns
from on to off.

Ladder Diagram

5 – 12
Connection instructions ANB, ORB

5.2 Connection instructions


5.2.1 ANB, ORB

CPU High
Basic Performance Process Redundant Universal LCPU

     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

ANB

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 5 – 13


ANB, ORB Connection instructions

Functions Ladder block series connection


ANB Block series connection
The ANB instruction (AND block) connects two or more parallel connection blocks in series and
supplies an operation result for the following operations.
If more than two blocks are connected in series, after each parallel block an ANB instruction
has to be programmed.
The ANB connection is an independent instruction and does not require any device.
Within one program the ANB instruction can be applied any number of times.
If more than two blocks are connected consecutively, the number of ANB instructions is limited
to 15 (= 16 blocks). Exceeding this limit results in malfunction.

Ladder block parallel connection


ORB Block parallel connection
The ORB instruction (OR block) connects two or more series connection blocks in parallel and
supplies an operation result for the following operations.
If more than two blocks are connected in parallel, after each series block an ORB instruction
has to be programmed.
For block parallel connections designating one contact only an OR or ORI instruction has to be
set.

The ORB connection is an independent instruction and does not require any device.
Within one program the ORB instruction can be applied any number of times.
If more than two blocks are connected consecutively, the number of ORB instructions is limited
to 15 (= 16 blocks). Exceeding these limits results in malfunction.

Program ANB, ORB


Example
The following program connects the parallel connection block of X0 and X2 in series with the
parallel connection block of X1 and X3. The result is connected in parallel with the series con-
nection of X4 an X5.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 14
Connection instructions MPS, MRD, MPP

5.2.2 MPS, MRD, MPP

NOTE These instructions should not be used within the IEC editors.

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer
MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 5 – 15


MPS, MRD, MPP Connection instructions

Functions Operation result processing


MPS Store operation result (memory push)
The MPS instruction stores the operation result preceding the MPS instruction.
Up to 16 consecutive MPS instructions per network can be programmed.
If the MPP instruction is used during this process, the number of uses calculated for the MPS
instruction will be decremented by one.
MRD Read operation result (memory read)
The MRD instruction reads stored operation results via an MPS instruction. The following oper-
ation executed depends on the reading result.
MPP Read and clear operation result (memory pop)
The MRD instruction reads stored operation results via an MPS instruction. The following oper-
ation executed depends on the reading result. Then the result is cleared.
Subtracts 1 from the number of MPS instruction times of use.

The MPS, MRP and MPP instructions are independent instructions and do not require any
device.
In ladder programming mode the MPS, MRD and MPP instructions are not displayed explicitly.
Whether connections are of the MPS, MRD or MPP type depends on the structure of the ladder
diagram.
The example on the left shows a ladder diagram applying MPS, MRD or MPP instructions. The
example on the right shows a ladder diagram without MPS, MRD or MPP instructions.

The number of MPS instructions in a program must equal the number of MPP instructions. Fail-
ure to observe this will not correctly display the ladder in the ladder mode of the peripheral
device.

5 – 16
Connection instructions MPS, MRD, MPP

Program MPS, MRD, MPP


Example 1
The following program illustrates the use of instructions for programming combined connec-
tions.

MELSEC Instruction List Ladder Diagram

Program MPS, MRD, MPP


Example 2
The following program illustrates the programming of instructions that output interim results in
a series connection.

MELSEC Instruction List Ladder Diagram

Programming MELSEC System Q and L series 5 – 17


INV Connection instructions

5.2.3 INV

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer
MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


— — —

5 – 18
Connection instructions INV

Functions Operation result inversion


INV Inversion instruction
The INV instruction inverts the operation result preceding the INV instruction.
 If the result is 1 before the operation it will be 0 afterwards.
 If the result is 0 before the operation it will be 1 afterwards.

Program The following program inverts the status of X0 and outputs the inverted signal at Y10.
Example

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 19


MEP, MEF Connection instructions

5.2.4 MEP, MEF

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer
MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

5 – 20
Connection instructions MEP, MEF

Functions Operation result into pulse conversion


MEP Pulse generation at leading edge of operation result
The MEP instruction is used in cases where the applied instructions cannot output operation
results as specified pulse output.
The MEP instruction is set after the according instruction and generates one output pulse,
when the input signal changes from 0 to 1 (at leading edge). The next pulse is generated when
the input is at leading edge once again.

MEF Pulse generation at trailing edge of operation result


The MEF instruction is used in cases where the applied instructions cannot output operation
results as specified pulse output. The MEF instruction is set after the according instruction and
generates one output pulse, when the input signal changes from 1 to 0 (at trailing edge). The
next pulse is generated when the input is at trailing edge once again.
These two instructions are especially suitable for multiple contacts connections. For example,
multiple NO contacts (normally open contacts) connected in series would maintain the opera-
tion result 1 if they were all closed. If a relay was set by this operation result, it could not be
reset. With a MEP instruction connected in series with these NO contacts the relay could be
reset because the instruction outputs one pulse only, if the series connection result of all con-
tacts changes from 0 to 1.

NOTE The MEP and MEF instructions will occasionally not function properly when pulse conversion is
applied to contacts that are indexed by a subroutine or by a FOR/NEXT instruction. In this case,
the EGP/EGF instruction has to be applied.
The MEP/MEF instruction operates with the operation results immediately prior to the MEP and
MEF instructions. For this reason, an AND instruction should be used at the same position. The
MEP and MEF instructions cannot be used at the LD or OR position.

Program MEP
Example
With leading edge from the series connection result at X0 and X1, the following program sets
the relay M0.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

Programming MELSEC System Q and L series 5 – 21


EGP, EGF Connection instructions

5.2.5 EGP, EGF

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G V
d — — — — — — — — 

GX IEC
Developer
MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Edge relay, storing the operation result. bit (V only)

Functions Pulse conversions of edge relay operation results


EGP Switching an edge relay with leading edge of an operation result
Operation results up to the EGP instruction are stored in memory by the edge relay (V). Goes
ON (continuity status) at the leading edge (OFF to ON) of the operation result up to the EGP
instruction. If the operation result up to the EGP instruction is other than a leading edge (i.e.,
from ON to ON, ON to OFF, or OFF to OFF), it goes OFF (non-continuity status).

EGF Switching an edge relay with trailing edge of an operation result


Operation results up to the EGF instruction are stored in memory by the edge relay (V). Goes
ON at the trailing edge (from ON to OFF) of the operation result up to the EGF instruction. If
the operation result up to the EGF instruction is other than a trailing edge (i.e., from OFF to
ON, ON to ON, or OFF to OFF), it goes OFF (non-continuity status).
The EGP and EGF instructions are used for subroutine programs, and for conducting pulse
operations for programs designated by indexing between the FOR and NEXT instructions.
The EGP and EGF instructions can be used like an AND instruction.

5 – 22
Connection instructions EGP, EGF

Program EGP
Example
The following program first resets the index register Z0 to 0 and then calls the subroutine UP1 (1).
With leading edge X0Z0 is set to X0 and V0Z0 is set to V0. Further, D0Z0 is set to D0 and incre-
mented by 1.
After returning, the index register Z0 stores 1, and the subroutine is called again (2). With leading
edge from X1, V1 is set and D1 is incremented.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

Programming MELSEC System Q and L series 5 – 23


OUT Output instructions

5.3 Output instructions


5.3.1 OUT

CPU High
Basic Performance Process Redundant Universal LCPU

     

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
d 1)      — — 

1
Except T, C, F

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


d Number of device to be set (1) or reset (0). bit

5 – 24
Output instructions OUT

Functions Output instruction


OUT Out instruction (excluding timers, counters, and annunciators)
An output is set depending on the preceding input condition.
Several OUT instructions can be programmed in parallel following an input condition.
The operation result of an OUT contact can be used as input condition for the following pro-
gram steps as NO contact (normally open) or NC contact (normally closed).
.

OUT Instruction
Bit Device or Word Contact Type
Input Condition Output Contact Device Bit Designa-
tion NO Contact NC Contact
0 OFF 0 Non-continuity Continuity
1 ON 1 Continuity Non-continuity

NOTE See section 3.12.1 for the operation to be performed when the OUT instruction for the same
device is executed more than once during one scan.

Program OUT
Example 1
The following program shows the programming of an OUT instruction using bit devices as out-
puts (Y33 through Y35).

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program OUT
Example 2
The following program shows the programming of an OUT instruction using bits of the word
device D0 (bits b5 through b7).

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 25


OUT T, OUTH T Output instructions

5.3.2 OUT T, OUTH T

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K Other
Bit Word Bit Word U\G
d 1) — — — — — — — —
3) 4)
2) —   —   —  —
1
T only
2
Time setting
3
Except T, C
4
Specification of time settings by decimal constants (K) only. Hexadecimal constants cannot be read.

GX IEC
MELSEC Instruction List Ladder Diagram
Developer

IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Number of timer bit
Set value Timer setting value BIN 16-bit

5 – 26
Output instructions OUT T, OUTH T

Functions Setting timers


OUT T Low speed timer (100 ms)
OUTH T High speed timer (10 ms)
When the operation results up to the OUT(H) T instruction are ON, the timer coil goes ON and
the timer counts up to the value that has been set. This time is designated directly by a constant
or variably by the value in a data register.
After the specified time has passed (setting value  actual value ) the succeeding input contact
is set.
The operation result of the OUT(H) T contact is programmed as input condition in one (or sev-
eral) following program step(s) like a common NO (normally open) or NC (normally closed)
contact.
Several OUT(H) T instructions can be programmed succeeding one single input condition.
The contact responds as follows when the operation result up to the OUT instruction is a
change from ON to OFF:

Timer Timer as Input Condition

Actual Prior to Time Up After Time Up


Type Timer Coil
Value NO contact NC contact NO contact NC contact
Low speed
(100 ms)
OFF 0 Non-continuity Continuity Non-continuity Continuity
High speed
(10 ms)
Low speed
(100 ms),
retentive Actual value
OFF maintained Non-continuity Continuity Continuity Non-continuity
High speed
(10 ms),
retentive

To clear the present value of a retentive timer and turn the contact OFF after time up, use the
RST instruction.
A negative number (–32768 to –1) cannot be set as the setting value for the timer. If the setting
value is 0, the timer will time out when the OUT(H) T instruction is executed. Please note: When
specifying a setting value for the timer using a word device the value is not checked whether it is
in the setting range. Check the value in the user program so that a negative number is not set.
The execution of the OUT(H) T instruction performs as follows:
– The timer coil designated by d is set or reset.
– The according timer contact is set or reset.
– The time settings are refreshed.
If a program jumps to an OUT(H) T instruction while it is executed, the contact conditions and
timer settings are maintained.
If one instruction is executed repeatedly within one cycle, the value of the repetitions is
refreshed.
Indexing for timer coils or contacts can be conducted only by Z0 or Z1. Timer setting value has
no limitation for indexing.

Programming MELSEC System Q and L series 5 – 27


OUT T, OUTH T Output instructions

NOTE Timer’s time limit


Time limit of the timer is set in the PLC system of the PLC parameter dialog box.

Basic Model QCPU, High Perform-


ance model QCPU, Process CPU, Universal model QCPU, LCPU
Type of Timer Redundant CPU
Setting Range Setting Unit Setting Range Setting Unit
Low speed timer 1 ms to 1000 ms 1 ms to 1000 ms
1 ms 1 ms
Low speed retentive timer (Default: 100 ms) (Default: 100 ms)
High speed timer 0.1 ms to 100.0 ms 0.01 ms to 100.0 ms
0.1 ms 0.01 ms
High speed retentive timer (Default: 10.0 ms) (Default: 10.0 ms)

Please refer to section A.5.4 for more information about timers.

Program OUT T
Example 1
10 seconds after setting X0, the following program sets the outputs Y10 and Y14. A low speed
timer (T1, 100 ms) is used.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program OUT T
Example 2
The following program reads the time setting via the inputs X10 to X1F in BCD data format.
With leading edge from X0 BCD data is converted into BIN data first and stored in D10. After
setting X2 the time setting is read. After the set time has passed Y15 is set. A low speed timer
(T2, 100 ms) is used.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 28
Output instructions OUT T, OUTH T

Program OUTH T
Example 3
250 ms after setting X10 the following program sets the output Y10. A high speed timer (10 ms)
is used.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 29


OUT C Output instructions

5.3.3 OUT C

CPU High
Basic Performance Process Redundant Universal LCPU

     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K
Bit Word Bit Word U\G
d 1) — — — — — — — —
2) — 3)  —   — 4) —
1
C only
2 Count setting
3
Except T, C
4
Specification of count settings by decimal constants (K) only. Hexadecimal constants cannot be read.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Number of counter bit
Set value Counter setting value BIN 16-bit

5 – 30
Output instructions OUT C

Functions Setting counters


OUT C Counter
When the operation results up to the OUT instruction change from OFF to ON, 1 is added to
the present value (count value).
The count up status (present value set value), and the contacts respond as follows:
No count is conducted with the operation results at ON. There is no need to perform pulse con-
version on count input.
After the count up status is reached, there is no change in the count value or the contacts until
the RST instruction is executed.
A negative number ( –32768 to –1) cannot be set as the setting value for the timer. If the set
value is 0, the processing is identical to that which takes place for 1.
Indexing for the counter coil and contact can use only Z0 and Z1. Counter setting value has no
limitation for indexing.

NOTE Please refer to section A.5.5 of this manual for more information about counters.

Program OUT C
Example 1
After X0 has been set for 10 times, the following program sets Y30 and if X1 is set resets Y30.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

Programming MELSEC System Q and L series 5 – 31


OUT C Output instructions

Program OUT C
Example 2
The following program sets the setting value in C10 to 10 (D0 =10) with leading edge from X0,
and to 20 (D0 =20) with leading edge from X1.
If X3 is set, the counter starts counting and sets Y30 when it reaches the setting value in D0.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

5 – 32
Output instructions OUT F

5.3.4 OUT F

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d 1) — — — — — — — —
1
F only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


d Number of annunciator to be set bit (F only)

Programming MELSEC System Q and L series 5 – 33


OUT F Output instructions

Functions Output of annunciators


OUT F Annunciator
If the input condition of an OUT F instruction is set, the annunciator is set and the following
operations are performed:
● The "USER" LED ("ERR." LED for Basic model QCPU) lights up.
● The numbers of set annunciators are stored in the special registers SD64 through SD79.
● The value in SD63 is incremented by 1.
If special register SD63 stores the value 16, i.e. 16 annunciators are already ON, no further
numbers are stored in the range of SD64 through SD79.
If an annunciator is reset via an OUT instruction, the condition of the "USER" LED ("ERR." LED
for Basic model QCPU), and the content of the special registers SD63 through SD79 are main-
tained.
Annunciators, registers, and displays are cleared via the RST F instruction.

Program OUT F
Example
If X0 is set, the following program sets the annunciator F7. The number 7 is stored in the reg-
isters SD64 through SD79. The value in register SD63 is incremented by 1 (i.e. 1 number of
annunciator stored).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
X0 is set

5 – 34
Output instructions SET

5.3.5 SET

CPU High
Basic Performance Process Redundant Universal LCPU

     

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G BL DY
 1) 1)     
d  — —
1
Except T, C

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction

GX Works2

Variables Set Data Meaning Data Type


d Number of bit device (output contact) to be set / word device bit designation. bit

Programming MELSEC System Q and L series 5 – 35


SET Output instructions

Functions Setting of devices


SET Set instruction
The SET instruction consists of a SET command followed by a number (address) of device d
to be set.
When the execution command is turned ON, the status of the designated device (bit device or
designated bit of word device) is set to 1.
If the input condition is reset once again, the set device remains set. A device can be reset via
the RST instruction.

:#
5-6 ;
:%
456 ;

NOTE See section 3.12.2 for the operation to be performed when the SET instruction for the same
device is executed more than once during one scan.

Program SET
Example 1
If X8 is set, the following program sets the output Y8B. If X9 is set, Y8B is reset.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program SET
Example 2
If X8 is set, the following program sets bit 5 (b5) in D0 from 0 to 1. If X9 is set, this bit is reset.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 36
Output instructions RST

5.3.6 RST

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
d        — 

GX IEC
IEC Instruction List
Developer MELSEC Instruction List Ladder Diagram (IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


d Device to be reset bit, BIN 16-bit

Programming MELSEC System Q and L series 5 – 37


RST Output instructions

Functions Resetting devices


RST Reset instruction
The RST instruction consists of an RST command followed by a number (address) of device d
to be reset.
After execution of the RST instruction input and output contacts of bit devices are switched off
(0), actual values of timers and counters (T, C) are reset to 0 and the according contacts are
switched off, the designated bit of a word device is reset to 0, and the content of word devices
is reset to 0.
The functions of the word devices designated by the RST instruction are identical to that of the
MOV instruction in the following diagram on the right.

NOTE See section 3.12.2 for the operation to be performed when the RST instruction for the same de-
vice is executed more than once during one scan.

Program RST
Example 1
With leading edge from X0, the following program stores the content at X10 through X1F in the
data register D8. If X5 is set, the content of D8 is reset to 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 38
Output instructions RST

Program RST T, C
Example 2
The following program illustrates resetting of retentive timers and counters.
In the first program step T225 is set, if X4 has been set for 30 minutes (18000 seconds).
In the second program step C23 counts the number of times T225 is set.
If this timer is set for 16 times (setting value of C23 = 16) the output Y55 is set.
If X5 is set, the counter will be reset to 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 39


SET F, RST F Output instructions

5.3.7 SET F, RST F

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d 1) — — — — — — — —
1
F only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

GX Works2

Variables Set Data Meaning Data Type


d (SET) Number of annunciator to be set bit (F only)
d (RST) Number of annunciator to be reset bit (F only)

5 – 40
Output instructions SET F, RST F

Functions Setting and resetting of annunciators


SET F Set instruction
The SET F instruction consists of a SET command followed by an annunciator number desig-
nated by d to be set.
After execution of the input condition, the designated device number d is set. The SET instruc-
tion outputs a pulse to set an annunciator.
The following procedures are executed:
 The "USER" LED lights up. ("ERR." LED for Basic model QCPUs)
 The numbers (addresses) of set annunciators are stored in the registers SD64 through
SD79.
 The value in SD63 is incremented by 1.
If special register SD63 stores the value 16, i.e. 16 annunciators are already ON, no further
numbers are stored in the range of SD64 through SD79.

RST F Reset instruction


The RST F instruction consists of an RST command followed by an annunciator number des-
ignated by d to be reset.
After execution of the input condition the designated device number is reset. The output signal
resetting an annunciator is a pulse.
The number of a reset annunciator is cleared from the registers SD64 through SD79 and the
value in register SD63 is decremented by 1. If the value in the register SD63 was 16 and annun-
ciators are cleared from this register via an RST F instruction then those annunciator numbers
are stored that could not be stored before. These annunciator numbers are stored in the
cleared registers within SD64 through SD79.
If the value in special register SD63 is decremented to 0 and all annunciators are reset, the
"USER" LED turns off ("ERR." LED for Basic model QCPUs).
In the diagram below F30 is set in a first step (1) but cannot be registered because there are
16 numbers already stored. In a second step (2) F90 is reset. Thus, in a third step (3) F30 can
be stored in SD79 because the other stored annunciators are shifted up by one cleared register
(SD65).

Programming MELSEC System Q and L series 5 – 41


SET F, RST F Output instructions

Program SET F/ RST F


Example
If X1 is set, the following program sets the annunciator F11. The number 11 is stored in the
registers SD64 through SD79 and the value in SD63 is incremented by 1 (1). Then, if X2 is set,
the annunciator F11 is reset. The number 11 is cleared from the special registers SD64 through
SD79 and the value in SD63 is decremented by 1 (2).

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 42
Output instructions PLS, PLF

5.3.8 PLS, PLF

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
d       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Device of which the output signal is converted into a pulse bit

Programming MELSEC System Q and L series 5 – 43


PLS, PLF Output instructions

Functions Leading edge and trailing edge output


PLS Output at leading edge
The PLS instruction consists of the PLS command followed by the number of device d to be set.
The PLS instruction (pulse) with leading edge from the input condition sets a device for one
program scan.

X5
PLS M0

1
One scan

NOTE See section 3.12.3 for the operation to be performed when the PLS instruction for the same de-
vice is executed more than once during one scan.

If the RUN/STOP key switch on the CPU unit is set to STOP while a PLS instruction is
executed, the PLS instruction will not be executed further on after the switch is set back to RUN
even if the input condition is still set.


 

2 2

1
   
1
 
    

  

 



One scan of PLS M0

2
RUN/STOP switch of the CPU switched from RUN to STOP
3 RUN/STOP switch of the CPU switched from STOP to RUN
If a latch relay is designated by a PLS instruction, and the power is turned OFF while a latch
relay is set, after turning ON the power again the designated latch relay is set for one scan.

5 – 44
Output instructions PLS, PLF

PLF Output at trailing edge


The PLF instruction consists of the PLF command followed by the number of device d to be set.
The PLF instruction with trailing edge from the input condition sets a device for one program
scan.

X5
PLF M0

1
One scan

NOTE See section 3.12.4 for the operation to be performed when the PLF instruction for the same
device is executed more than once during one scan.

If the RUN/STOP switch of the CPU unit is set to STOP while a PLS instruction is executed,
the PLS instruction will not be executed further on after the switch is set back to RUN even if
the input condition is still set.

NOTE The device d designated by a PLS or PLF instruction remains set for more than one program
scan if a CJ or similar instruction was applied to jump to the PLS or PLF instruction and the part
of program was not executed.

Program PLS
Example 1
With leading edge from X9, the following program sets the internal relay M9 for one program
scan.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
One scan

Programming MELSEC System Q and L series 5 – 45


PLS, PLF Output instructions

Program PLF
Example2
With trailing edge from X9, the following program sets the internal relay M9 for one program scan.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
One scan

5 – 46
Output instructions FF

5.3.9 FF

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
d       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Number of bit device or designated bit of word device to be inverted. bit

Programming MELSEC System Q and L series 5 – 47


FF Output instructions

Functions Bit device output inversion


FF Inversion of bit output device
The FF instruction inverts the operation condition of the device designated by d with leading
edge at the input of the FF instruction. The device can be a bit device or a specified bit of a
word device. If the condition of the output device is set (1) it will be reset (0) after inversion. If
the condition of the output device is reset (0), it will be set (1) after inversion.

Program FF
Example 1
With leading edge from X9, the following program inverts the output condition of Y10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program FF
Example 2
With leading edge from X9, the following program inverts bit 10 (b10) of D10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 48
Output instructions DELTA, DELTAP

5.3.10 DELTA, DELTAP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
d — — — — — — — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type

d Number of direct access output to generate pulse at. bit 1)


1
direct access outputs only

Programming MELSEC System Q and L series 5 – 49


DELTA, DELTAP Output instructions

Functions Generating pulses at direct access outputs


DELTA Pulse conversion of contacts
The DELTA instruction generates a pulse at a direct access output (DY) designated by d, i.e.
the output is set for a certain time only.
If the output designated by the DELTA instruction is DY0, the executed function is identical to
that of the SET/RST instruction (see diagram).
The DELTA(P) instruction is used by commands for leading edge execution in special function
units.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of output designated by d exceeds the output range.
(Error code 4101)

Program DELTAP
Example
With leading edge from X20, the following program presets CH1 of the AD61 output unit
mounted at slot 0 of the main base unit. The preset value 0 is stored at addresses 1 and 2 of
the AD61 buffer memory. The DELTAP instruction outputs the preset instruction at DY11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

5 – 50
Shift instructions SFT, SFTP

5.4 Shift instructions


5.4.1 SFT, SFTP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Other
Constant
Register Module Zn
Bit Word Bit Word U\G DY
d 1) 1) 1) 1) 1) 1) — — 

1 Except T and C

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d Number of device to be shifted. bit

Programming MELSEC System Q and L series 5 – 51


SFT, SFTP Shift instructions

Functions Shift instruction


SFT Shifting bit devices
The SFT instruction shifts devices by one bit. Devices are only shifted via the SFTP instruction,
if the input condition is set (leading edge).
The instruction shifts the condition of a device (specified by d-1) to the destination address d.
The condition of the device with the lower address d-1 is reset. Turn the first device to be shifted
ON with the SET instruction.
If several SFT instructions are applied consecutively, the program starts from the device with
the higher number.
The program below sets the internal relay M10 if X2 is set (2,3). The condition of M10 (1) is
shifted via the SFT P instruction within the shift range (1).

If bits in word devices are shifted, the condition (0/1) of the bit d-1 is shifted to d. The bit d-1 is
reset after the SFT instruction. In the following illustration bit 5 (b5) in D0 is shifted. Bit 4 (b4)
is reset after execution of the instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU and LCPU only.)
(Error code 4101)

5 – 52
Shift instructions SFT, SFTP

Program SFT
Example
With leading edge from X8, the following program shifts the condition of Y57 to Y5B. With lead-
ing edge from X7, Y57 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 53


MC, MCR Master control instructions

5.5 Master control instructions


5.5.1 MC, MCR

NOTE These instructions should not be used within the IEC editors.

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G N DY
n — — — — — — — — 

d       — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


n Level of nesting (N0 – N14). Nesting
d Number of device to set nesting. bit

5 – 54
Master control instructions MC, MCR

Functions Setting and resetting master control

General notes
The MC instruction is applied to create highly efficient ladder switching sequence programs.
After setting the input condition, the program part between the destination d and the MCR
instruction is executed. The master control regions are distinguished by nesting (N). Nesting
can be performed from N0 through N14.
Since the GX IEC Developer Software does not allow a vivid programming of the MC/MCR
instruction, here the ladder diagrams of the GX Works2 Software are shown as an illustration.
The ladder diagram illustrates the function of the MC instruction. If the input X0 is reset, the
program part in level 1 (designated by N1) is skipped (1). If X0 is set, the program part from N1
to the MCR instruction is executed (2).
When programming in the ladder mode, it is not necessary to input MC contacts on the vertical
bus. These are displayed automatically.

MC Activating indicated program parts


The MC instruction is the start instruction for master control to process a specified program
part. If the input condition of the MC instruction is set, the devices between the MC and the
MCR instruction are processed regularly.
The devices between the MC and the MCR instruction are even processed after the input con-
dition of the MC instruction is reset. Therefore, the program scan time in this case is not
decreased. When the input condition is reset, the devices between the MC and the MCR
instruction are processed as follows:

Devices Processing
10 ms timer Count value setting is reset to 0.
100 ms timer Input and output contacts are reset (0).
Retentive 10 ms timer
Retentive 100 ms timer Count value setting and condition of input contacts remai-
ned. Output contact is reset (0).
Counter
Devices in the OUT instruction All outputs are reset.
Devices in the SET, RST, and SFT instruction Actual status remained.

Programming MELSEC System Q and L series 5 – 55


MC, MCR Master control instructions

NOTE If an instruction that does not require any input condition (e.g. FOR/NEXT, EI, DI) is placed bet-
ween the MC and MCR instructions, this instruction is executed by the PLC without regard to the
input condition of the MC instruction.

For one MC instruction, identical nesting levels n are allowed, provided that different numbers
(addresses) of devices are set.
After setting the MC instruction the device designated by d is set. If this device is designated
as input condition elsewhere in the program, the contacts are processed as double contacts
and set or reset in parallel. Therefore, the device designated by d should not be used within
other instructions.

MCR Deactivating indicated program parts


The MCR instruction resets the MC instruction and indicates the end of the program part for
master control.
The MCR instruction must not be set via an input contact.

Notes on programming nesting numbers (addresses):


Nesting can be performed from N0 to N14. The first master control region designated by the
MC instruction has to start with the lowest nesting address and the first MCR instruction has
to start with the highest nesting address. If nesting addresses are designated in a different
order, the nesting levels (1, 2) are not processed accurately by the PLC. The following diagram
illustrates this case.

5 – 56
Master control instructions MC, MCR

If several MCR instructions are progammed consecutively, the program can be shortened by
placing one MCR instruction only with the lowest nesting address to finish all MC program
parts.

Programming MELSEC System Q and L series 5 – 57


MC, MCR Master control instructions

Program MC, MCR


Example
The MC instruction designates a nesting address N to specify the nesting level. Nesting
addresses can be designated within N0 to N14.
The nesting addresses determine the execution sequence of MC program parts. The following
program illustrates designation of different execution levels by nesting addresses. For better
comprehensibility the GX Works2 ladder diagram is shown:

5 – 58
Master control instructions MC, MCR

In addition the GX IEC Developer ladder diagram is shown:

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 59


FEND Termination instructions

5.6 Termination instructions


5.6.1 FEND

NOTE This instruction should not be used within the IEC editors.

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Other
Register Module Zn
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

5 – 60
Termination instructions FEND

Functions End of main routine program


FEND End of program branches
The FEND instruction specifies the end of a program branch. This branch can either be a main
routine program or a subroutine program.
After execution of the FEND instruction the program jumps to the END instruction. The execu-
tion of internal processes like timer/counter processing or CPU self-diagnostics check begin at
program step 1 again.
The program example on the left shows the termination of program branches invoked via the
CJ (conditional jump) instruction.
After execution of the CJ instruction the invoked program part is executed up to the next FEND
instruction. Without execution of the CJ instruction the program jumps back to program step 0
after the next FEND instruction.
The program example on the right shows the execution of the FEND instruction in order to split
a main routine program from a sub-routine or interrupt program.

1
Main routine program
2
Subroutine program
3 Interrupt program

NOTE In the instruction list of the GX Works2 the FEND instruction has to be programmed by the user.
After this program organization unit has been processed no further one will be executed be-
cause it would follow the FEND instruction.
Alternatively to this programming the IEC editor can be used. In that case the FEND instruction
would be set by the GX IEC Developer compiler automatically.

Programming MELSEC System Q and L series 5 – 61


FEND Termination instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The FEND instruction is executed after a CALL, FCALL, ECALL, or EFCALL instruction and
before a RET instruction. (Error code 4211)
● The FEND instruction is executed after a FOR instruction and before a NEXT instruction.
(Error code 4200)
● The FEND instruction is executed during an interrupt program and before an IRET instruction.
(Error code 4221)
● The FEND instruction is executed after a CHKCIR instruction and before a CHKEND instruc-
tion. (Error code 4230)
● The FEND instruction is executed after an IX instruction and before an IXEND instruction.
(Error code 4231)

5 – 62
Termination instructions END

5.6.2 END

NOTE This instruction should not be used within the IEC editors.

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 5 – 63


END Termination instructions

Functions End of sequence program


END End of sequence program
The END instruction specifies the end of a program. Executing the END instruction the pro-
gram jumps back to program step 0.

1
Sequence program

The END instruction cannot be applied in a program routine. A program routine is terminated
by the FEND instruction.
If the END instruction is missing in a program an error message is returned when starting the
program, and the program execution is terminated by the PLC. Without the END instruction
operation errors even occur, if the capacity of a subprogram is set by parameters.
The following diagram illustrates appropriate programming of the END and FEND instruction:

1
Main routine program
2
Subroutine program
3 Interrupt program

4 Sequence program

NOTE The FEND instruction will be set by both the GX IEC Developer and GX Works2 automatically.

5 – 64
Termination instructions END

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The jump destination of a CJ, SCJ, or JMP instruction is allocated after the END instruction.
● A subprogram or interrupt routine allocated after the END instruction is called.
● The END instruction is executed after a CALL, FCALL, ECALL, or EFCALL instruction and before
a RET instruction. (Error code 4211)
● The END instruction is executed after a FOR instruction and before a NEXT instruction.
(Error code 4200)
● The END instruction is executed during an interrupt program and before an IRET instruction.
(Error code 4221)
● The END instruction is executed after a CHKCIR instruction and before a CHKEND instruction.
(Error code 4230)
● The END instruction is executed after an IX instruction and before an IXEND instruction.
(Error code 4231)

Programming MELSEC System Q and L series 5 – 65


STOP Miscellaneous instructions

5.7 Miscellaneous instructions


5.7.1 STOP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

5 – 66
Miscellaneous instructions STOP

Functions Sequence program stop


STOP Stop instruction
If the input condition of the STOP instruction is set, all outputs (Y) are reset and all operations
of the PLC are terminated. The STOP instruction has the same function as the STOP position
of the RUN/STOP key switch on the CPU.
On execution of the STOP instruction the bit b4 through bit b7 in special register SD203 store
the binary value 3.

1 Binary value 3

In order to restart the operation of the PLC the RUN/STOP switch has to be switched to STOP
and then to RUN again.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The STOP instruction is executed after a CALL, FCALL, ECALL, EFCALL or XCALL instruction
and before a RET instruction. (Error code 4211)
● The STOP instruction is executed after a FOR instruction and before a NEXT instruction.
(Error code 4200)
● The STOP instruction is executed during an interrupt program and before an IRET instruction.
(Error code 4221)
● The STOP instruction is executed after a CHKCIR instruction and before a CHKEND instruc-
tion.
(Error code 4230)
● The STOP instruction is executed after an IX instruction and before an IXEND instruction.
(Error code 4231)
● The STOP instruction was executed during the fixed scan execution type program.
(For the Universal model QCPU and LCPU only) (Error code 4223)

Program STOP
Example
If X8 is set the following program terminates operation. All following program steps are
executed after switching the RUN/STOP switch to STOP and to RUN again.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 5 – 67


NOP, NOPLF, PAGE n Miscellaneous instructions

5.7.2 NOP, NOPLF, PAGE n

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

NOTE The NOP instruction does not work with the IEC editors. The only way to program this instruc-
tions is by using the MELSEC instruction list.

GX Works2
In the ladder display, NOP is not displayed.

 




   

Variables Set Data Meaning Data Type


— — —

5 – 68
Miscellaneous instructions NOP, NOPLF, PAGE n

Functions No operation program step


NOP No operation program step
The NOP instruction is a no-operation instruction that does not affect any other operations or
program parts. The NOP instruction creates an empty logical program step that can be
replaced by other program instructions during the development of a new program.
The NOP instruction is especially suitable for the following cases:
 To provide space for debugging sequence programs.
 To delete an instruction (over write it) without changing the number of steps.
 To delete an instruction temporarily for later editing.

NOTE After finishing program editing the NOP instructions should be deleted where possible in order
to shorten program scan time.

NOPLF To change pages during printouts


The NOPLF instruction is a no-operation instruction that does not affect any other operations
or program parts. The NOPLF is used when printing from a peripheral device to force a page
change at any desired location.
When printing ladders:
 A page break will be inserted between ladder blocks with the presence of the NOPLF
instruction.
 The ladder cannot be displayed correctly if an NOPLF instruction is inserted in the midst of
a ladder block.
Do not insert an NOPLF instruction in the midst of a ladder block.
When printing instruction lists:
 The page will be changed after the printing of the NOPLF instruction.
Refer to the Operating Manual for the peripheral device in use for details of printouts from
peripheral devices.

PAGE n Subsequent programs will be controlled from step 0 of page n


This is a no operation instruction that has no impact on any operations up to that point.
No processing is performed at peripheral devices with this instruction.

Programming MELSEC System Q and L series 5 – 69


NOP, NOPLF, PAGE n Miscellaneous instructions

Program NOP
Example 1
The following program contains a NOP instruction to replace the contact connection AND for
debugging purposes.

Program NOP
Example 2
The following program example contains a NOP instruction to replace an LD instruction.

Program NOP
Example 3
The following program example contains a NOP instruction to replace an LD instruction.

NOTE Input contacts (LD, LDI) should be replaced by a NOP instruction carefully, because the logical
structure of the program is changed considerably.

5 – 70
Miscellaneous instructions NOP, NOPLF, PAGE n

Program NOPLF
Example 4
The following program example shows the results of a NOPLF instruction.

Printing the ladder will result in the following:

X0
0 MOV K1 D30

MOV K2 D40

5 NOPLF NOPLF instruction,


inserted as a delimiter
of ladder blocks,
causes print out page
to be changed forcibly.
X1
6 Y40

8 END

Printing an instruction list with the NOPLF instruction will result in the following:

0 LD X0

1 MOV K1 D30

3 MOV K2 D40

5 NOPLF Changes print output


page after printing
NOPLF.

6 LD X1

7 OUT Y40

8 END

Programming MELSEC System Q and L series 5 – 71


NOP, NOPLF, PAGE n Miscellaneous instructions

Program PAGE n
Example 5

NOP

5 – 72
6 Application Instructions, Part 1
The application instructions, part 1 comprise instructions that process numerical 16-bit and
32-bit data, floating point data, and character string data. Commonly, these basic instructions
perform comparison and arithmetic operations.

Instruction Meaning
Comparison operation instruction Compares data to data (e.g. =, >, ≥)
Arithmetic operation instruction Adds, subtracts, multiplies, divides, increments, and
decrements BIN and BCD data, floating point data, and
BIN block data
Links character strings
Data conversion instruction Converts data types (e.g. BCD → BIN, BIN → BCD)
Data transfer instruction Transmits designated data
Program branch instruction Program jump commands
Program execution control instruction Enables and disables program interrupts
Refresh instruction Refreshes bit devices, links, and I/O interfaces
Other convenient instructions Count 1- or 2-phase input up or down,
teaching timer, special function timer,
rotary table near path rotation control, ramp signal,
pulse density measurement, fixed cycle pulse output,
pulse width modulation, matrix input

Programming MELSEC System Q and L series 6–1


Comparison operation instructions

6.1 Comparison operation instructions

Comparison operation instructions compare data values (e.g. equal to =, greater than >, less
than <). Programming the comparison operation instructions is similar to the corresponding
basic instructions:
LD, LDI ⇒ LD=, LDD=
AND, ANI ⇒ AND=, ANDD=
OR, ORI ⇒ OR=, ORD=

MELSEC MELSEC MELSEC MELSEC


Instruction Instruction Instruction Instruction
Function in in Function in in
MELSEC Editor IEC Editor MELSEC Editor IEC Editor
LD= LD_EQ_M LD<= LD_LE_M
AND= AND_EQ_M AND<= AND_LE_M
OR= OR_EQ_M OR<= OR_LE_M
LDD= LDD_EQ_M LDD<= LDD_LE_M
ANDD= ANDD_EQ_M ANDD<= ANDD_LE_M
ORD= ORD_EQ_M ORD<= ORD_LE_M
LDE= LD_EEQ_M LDE<= LD_ELE_M
ANDE= AND_EEQ_M ANDE<= AND_ELE_M
ORE= OR_EEQ_M ORE<= OR_ELE_M

= LDED= ≤ LDED<=
ANDED= ANDED<=
equal less equal
ORED= ORED<=

LD$= LD_STRING LD$<= LD_STRING


_EQ_M _LE_M
AND_STRING AND_STRING
AND$= _EQ_M AND$<= _LE_M
OR_STRING OR_STRING
OR$= OR$<=
_EQ_M _LE_M
BKCMP= BKCMP_EQ_M BKCMP<= BKCMP_LE_M
BKCMP=P BKCMP_EQP_M BKCMP<=P BKCMP_LEP_M
DBKCMP= DBKCMP<=
DBKCMP=P DBKCMP<=P

6–2
Comparison operation instructions

MELSEC MELSEC MELSEC MELSEC


Instruction Instruction Instruction Instruction
Function Function
in in in in
MELSEC Editor IEC Editor MELSEC Editor IEC Editor
LD<> LD_NE_M LD< LD_LT_M
AND<> AND_NE_M AND< AND_LT_M
OR<> OR_NE_M OR< OR_LT_M
LDD<> LDD_NE_M LDD< LDD_LT_M
ANDD<> ANDD_NE_M ANDD< ANDD_LT_M
ORD<> ORD_NE_M ORD< ORD_LT_M
LDE<> LD_ENE_M LDE< LD_ELT_M
ANDE<> AND_ENE_M ANDE< AND_ELT_M
ORE<> OR_ENE_M ORE< OR_ELT_M

≠ LDED<>
< LDED<
ANDED<> ANDED<
not equal less than
ORED<> ORED<
LD_STRING LD_STRING
LD$<> _NE_M LD$< _LT_M
AND_STRING AND_STRING
AND$<> AND$<
_NE_M _LT_M

OR$<> OR_STRING OR$< OR_STRING


_NE_M _LT_M
BKCMP<> BKCMP_NE_M BKCMP< BKCMP_LT_M
BKCMP<>P BKCMP_NEP_M BKCMP<P BKCMP_LTP_M
DBKCMP<> DBKCMP<
DBKCMP<>P DBKCMP<P
LD> LD_GT_M LD>= LD_GE_M
AND> AND_GT_M AND>= AND_GE_M
OR> OR_GT_M OR>= OR_GE_M
LDD> LDD_GT_M LDD>= LDD_GE_M
ANDD> ANDD_GT_M ANDD>= ANDD_GE_M
ORD> ORD_GT_M ORD>= ORD_GE_M
LDE> LD_EGT_M LDE>= LD_EGE_M
ANDE> AND_EGT_M ANDE>= AND_EGE_M
ORE> OR_EGT_M ORE>= OR_EGE_M

> LDED>
≥ LDED>=
ANDED> ANDED>=
greater greater equal
ORED> ORED>=
LD_STRING LD_STRING
LD$> LD$>=
_GT_M _GE_M

AND$> AND_STRING AND$>= AND_STRING


_GT_M _GE_M
OR_STRING OR_STRING
OR$> _GT_M OR$>= _GE_M
BKCMP> BKCMP_GT_M BKCMP>= BKCMP_GE_M
BKCMP>P BKCMP_GTP_M BKCMP>=P BKCMP_GEP_M
DBKCMP> DBKCMP>=
DBKCMP>P DBKCMP>=P

Programming MELSEC System Q and L series 6–3


Comparison operation instructions

NOTE Within the IEC editors please use the IEC commands.
IEC Commands
Function IEC Command Meaning
= EQ Equal
<> NE Not equal
<= LE Less equal
< LT Less than
>= GE Greater equal
> GT Greater than

Execution Conditions
The following illustration shows the execution conditions for the various comparison operation
instructions.

„ = 1 = ON
… = 0 = OFF

LDORI0B1
NOTE When s1 and s2 are assigned by a hexadecimal constant and the numerical value (8 to F) whose
most significant bit (b15) is "1" is designated as a constant, the value is considered as a negative
BIN value in comparison operation.
The result of the comparison operation 16#8000 > 16#7999 is FALSE (0), although TRUE (1)
would be expected. The values are converted to BIN data and therefore bit 15 (b15) is set. If bit
15 is set, the value becomes negative.

Program Comparison of two-digit BCD values:


Example 1

EINLAB1

8731H is processed as -30927 and 568H as 1384. The comparison operation then is
-30927 > 1384 and Y10 is not set.

6–4
Comparison operation instructions

NOTE For comparison operation instructions with 32-bit data, the numerical input value has to be
determined by a 32-bit instruction like DMOV. The instruction will not be carried out correctly, if
the value was determined by a 16-bit instruction like MOV, because a 32-bit instruction always
applies the n and (n+1) data value.

Program Comparison instruction with 32-bit data:


Example 2

EINLAB2, EINLAB3, LDORI0B2


The example shows two comparison operations with 32-bit data. The first program sets M5,
because both values are determined by the 32-bit instruction DMOV.
The second program has no definite result, because the value in the upper bytes is not defined
definitely.

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6–5


=, < >, >, < =, <, > = Comparison operation instructions

6.1.1 =, < >, >, < =, <, > =

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1         —
s2         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

V
_
___ME1, V____KE1, V____IE1

GX Works2

VVVV__

Variables Set Data Meaning Data Type


s1
Comparative data, or device storing comparative data BIN 16-bit
s2

6–6
Comparison operation instructions =, < >, >, < =, <, > =

Functions BIN 16-bit data comparison


=, <>, >, <=, <, >= Comparison operation instructions
A 16-bit comparison operation instruction consists of the instruction itself and two designated
devices s1 and s2 to be compared.
The result of the comparison operation is binary ("1" if the comparison is true, "0" if the com-
parison is false). The binary result can be processed as a logical connection result.
The results of the comparison operations for the individual instructions are as follows:
Comparison Operation Results
Instruction Symbol
1 0
= s1 = s2 s1 ≠ s2
<> s1 ≠ s2 s1 = s2
> s1 > s2 s1 ≤ s2
<= s1 ≤ s2 s1 > s2
< s1 < s2 s1 ≥ s2
>= s1 ≥ s2 s1 < s2

NOTE When s1 and s2 are assigned by a hexadecimal constant and the numerical value (8 to F) whose
most significant bit (b15) is "1" is designated as a constant, the value is considered as a negative
BIN value in comparison operation.

Program Comparison operation instruction =


Example 1
The following program compares the data at X0 to XF with the data in D3. It turns ON Y33, if
the data are equal.

MELSEC Instruction List Ladder Diagram IEC Instruction List

V____MB1, V____KB1, V____IB1

Program Comparison operation instruction <>


Example 2
The following program compares BIN value 100 to the data in D3. It turns ON Y33, if the data
in D3 is not equal to 100.

MELSEC Instruction List Ladder Diagram IEC Instruction List

V____MB2, V____KB2, V____IB2

Programming MELSEC System Q and L series 6–7


=, < >, >, < =, <, > = Comparison operation instructions

Program Comparison operation instruction >


Example 3
The following program compares BIN value 100 to the data in D3. It turns ON Y33, if the data
in D3 is less than 100 and M3 is set. Y33 is also switched ON, if M8 and M3 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

V____MB3, V____KB3, V____IB3

Program Comparison operation instruction <=


Example 4
The following program compares the data in D0 to the data in D3. It turns ON Y33, if the data
in D0 is less than or equal to D3. Y33 is also switched ON, if M8 and M3 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

V____MB4, V____KB4, V____IB4

6–8
Comparison operation instructions D=, D<>, D>, D<=, D<, D>=

6.1.2 D=, D<>, D>, D<=, D<, D>=

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1         —
s2         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

D
_
___ME1, D____KE1, D____IE1

GX Works2

D___KE1

Variables Set Data Meaning Data Type


s1
Comparative data, or device storing comparative data. BIN 32-bit
s2

Programming MELSEC System Q and L series 6–9


D=, D<>, D>, D<=, D<, D>= Comparison operation instructions

Functions BIN 32-bit data comparison


D=, D<>, D>, D<=, D<, D>= Comparison operation instructions
A 32-bit comparison operation instruction consists of the instruction itself and two designated
devices s1 and s2 to be compared.
The result of the comparison operation is binary ("1" if the comparison is true, "0" if the com-
parison is false). The binary result can be processed as a logical connection result.
The results of the comparison operations for the individual instructions are as follows:
Comparison Operation Results
Instruction Symbol
1 0
D= s1 = s2 s1 ≠ s2
D<> s1 ≠ s2 s1 = s2
D> s1 > s2 s1 ≤ s2
D<= s1 ≤ s2 s1 > s2
D< s1 < s2 s1 ≥ s2
D>= s1 ≥ s2 s1 < s2

NOTE When s1 and s2 are assigned by a hexadecimal constant and the numerical value (8 to F) whose
most significant bit (b15) is "1" is designated as a constant, the value is considered as a negative
BIN value in comparison operation.

Program Comparison operation instruction D=


Example 1
The following program compares the data at X0 to X1F with the data in D3 and D4. It turns ON
Y33 if the data are equal.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D____MB1, D____KB1, D____IB1

Program Comparison operation instruction D<>


Example 2
The following program compares BIN value 38000 to the data in D3 and D4. It turns ON Y33,
if M3 is set and the data in D3 and D4 are not equal to 38000.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D____MB2, D____KB2, D____IB2

6 – 10
Comparison operation instructions D=, D<>, D>, D<=, D<, D>=

Program Comparison operation instruction D>


Example 3
The following program compares BIN value -80000 to the data in D3 and D4. It turns ON Y33,
if M3 is set and the data in D3 and D4 are less than -80000. Y33 is also switched ON, if M3
and M8 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D____MB3, D____KB3, D____IB3

Program Comparison operation instruction D<=


Example 4
The following program compares the data in D0 and D1 to the data in D3 and D4. Y33 is set,
if the data in D3 and D4 are greater than or equal to D0 and D1. Y33 is also switched ON if M3
and M8 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D____MB4, D____KB4, D____IB4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 11


E=, E<>, E>, E< =, E<, E>= Comparison operation instructions

6.1.3 E=, E<>, E>, E< =, E<, E>=

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s1 —   —   1)  —
1)
s2 —   —     —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

E
_
___ME1, E____KE1, E____IE1

GX Works2

E___KE1

Variables Set Data Meaning Data Type


s1
Comparative data, or device storing comparative data. Real number
s2

6 – 12
Comparison operation instructions E=, E<>, E>, E< =, E<, E>=

Functions Floating point data comparisons (Single precision)


E=, E<>, E>, E<=, E<, E>= Comparison operation instructions
A comparison operation instruction for floating point data consists of the instruction itself and
two designated devices s1 and s2 to be compared.
The result of the comparison operation is binary ("1" if the comparison is true, "0" if the com-
parison is false). The binary result can be processed as a logical connection result.
The results of the comparison operations for the individual instructions are as follows:

Comparison Operation Results


Instruction Symbol
1 0
E= s1 = s2 s1 ≠ s2
E<> s1 ≠ s2 s1 = s2
E> s1 > s2 s1 ≤ s2
E<= s1 ≤ s2 s1 > s2
E< s1 < s2 s1 ≥ s2
E>= s1 ≥ s2 s1 < s2

NOTE In some cases, rounding errors appear and floating point values that were equal before the com-
parison operation are not equal afterwards. In the following example M0 is not switched ON:

E___
NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the designated device is –0. (For the Basic model QCPU, High Performance
model QCPU, Process CPU, Redundant CPU) (Error code 4100)
NOTE: There are CPU modules that will not result in an operation error if –0 is specified.
Refer to section 3.5.1 for details.
● The value of the specified device is outside the following range:
0, ±2–126 ≤ (Value) < ±2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ± ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

Programming MELSEC System Q and L series 6 – 13


E=, E<>, E>, E< =, E<, E>= Comparison operation instructions

Program Comparison operation instruction E=


Example 1
The following program compares floating point data in D0 and D1 to floating point data in D3
and D4. It turns ON Y33, if the data are equal.

MELSEC Instruction List Ladder Diagram IEC Instruction List

E____MB1, E____KB1, E____IB1

Program Comparison operation instruction E<>


Example 2
The following program compares the floating point real number 1.23 to a floating point real
number in D3 and D4. It turns ON Y33, if M3 is set and the data in D3 and D4 are not equal to
1.23.

MELSEC Instruction List Ladder Diagram IEC Instruction List

E____MB2, E____KB2, E____IB2

Program Comparison operation instruction E>


Example 3
The following program compares floating point data in D0 and D1 to floating point data in D3
and D4. It turns ON Y3, if M3 is set and the data in D3 and D4 are less than the data in D0 and
D1.
Y3 is also switched ON, if M3 and M8 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

E____MB3, E____KB3, E____IB3

6 – 14
Comparison operation instructions E=, E<>, E>, E< =, E<, E>=

Program Comparison operation instruction E<=


Example 4
The following example compares a floating point number in D0 and D1 to the floating point
number 1.23. It turns ON Y33, if the data in D0 and D1 are less than or equal to 1.23. Y33 is
also switched ON, if M3 and M8 are set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

E____MB4, E____KB4, E____IB4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 15


ED=, ED<>, ED>, ED< =, ED<, ED>= Comparison operation instructions

6.1.4 ED=, ED<>, ED>, ED< =, ED<, ED>=

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn E
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
ED /ED /ED /E /E /E

LD s1 s2

AND s1 s2

OR
s1 s2

E___KE1

Variables Set Data Meaning Data Type


s1
Comparative data, or device storing comparative data. Real number
s2

6 – 16
Comparison operation instructions ED=, ED<>, ED>, ED< =, ED<, ED>=

Functions Floating decimal point data comparisons (Double precision)


ED=, ED<>, ED>, ED< =, ED<, ED>= Comparison operation instructions
A comparison operation instruction for 64-bit floating point data consists of the instruction itself
and two designated devices s1 and s2 to be compared.
The result of the comparison operation is binary ("1" if the comparison is true, "0" if the com-
parison is false). The binary result can be processed as a logical connection result.
The results of the comparison operations for the individual instructions are as follows:

Comparison Operation Results


Instruction Symbol
1 0
ED= s1 = s2 s1 ≠ s2
ED<> s1 ≠ s2 s1 = s2
ED> s1 > s2 s1 ≤ s2
ED<= s1 ≤ s2 s1 > s2
ED< s1 < s2 s1 ≥ s2
ED>= s1 ≥ s2 s1 < s2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the specified device is not within the following range:
0, ±2 -1022 ≤ (Value of specified device) < ±21024
(Error code 4140)
● The value of the designated device is –0.
(Error code 4140)

Program Comparison operation instruction ED=


Example 1
The following program compares 64-bit floating decimal point real number data at D0 to D3 with
64-bit floating decimal point real number data at D4 to D7.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 6 – 17


ED=, ED<>, ED>, ED< =, ED<, ED>= Comparison operation instructions

Program Comparison operation instruction ED<>


Example 2
The following program compares the floating decimal point real number 1.23 with the 64-bit
floating decimal point real number data at D4 to D7.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program Comparison operation instruction ED>


Example 3
The following program compares 64-bit floating decimal point real number data at D0 to D3 with
64-bit floating decimal point real number data at D4 to D7.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program Comparison operation instruction ED<=


Example 4
The following program compares the 64-bit floating decimal point data at D0 to D3 with the
floating decimal point real number 1.23.

MELSEC Instruction List Ladder Diagram IEC Instruction List

E____MB4, E____KB4, E____IB4

6 – 18
Comparison operation instructions ED=, ED<>, ED>, ED< =, ED<, ED>=

NOTE Since the number of digits of the real number that can be input by a programing tool is up to 15
digits, the comparison with the real number whose number of significant digits is 16 or more can-
not be made by the instruction shown in this section.
When judging match/mismatch with the real number whose significant digits is 16 or more by the
instruction in this section, compare it with the approximate values of the real number to be com-
pared and judge by the sizes.

EXAMPLE 1 When judging the match of E1.234567890123456+10 (number of significant digits is 16) and the
double-precision floating-point data:

E1.23456789012345+10 E1.234567890123456+10 E1.23456789012346+10

Whether D0 to D3 is within this range is checked.(Values on boundaries are excluded.)

EXAMPLE 2 When judging the mismatch of E1.234567890123456+10 (Number of significant digits is 16)
and the double-precision floating-point data:

E1.23456789012345+10 E1.234567890123456+10 E1.23456789012346+10

Whether D0 to D3 is within this range is checked.(Values on boundaries are included.)

Programming MELSEC System Q and L series 6 – 19


$ =, $ < >, $ >, $ < =, $ <, $ > = Comparison operation instructions

6.1.5 $ =, $ < >, $ >, $ < =, $ <, $ > =

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

S___ME1, S____KE1, S____IE1S


_

GX Works2

S___KE1

Variables Set Data Meaning Data Type


s1
Comparative data, or first number of the device storing comparative data Character string
s2

6 – 20
Comparison operation instructions $ =, $ < >, $ >, $ < =, $ <, $ > =

Functions Character string data comparison


$=, $<>, $>, $<=, $<, $>= Comparison operation instructions
A comparison operation instruction for character string data consists of the instruction itself and
two designated devices s1 and s2 to be compared.
The result of the comparison operation is binary ("1" if the comparison is true, "0" if the com-
parison is false). The binary result can be processed as a logical connection result. The com-
parison is performed with character string data in ASCII code character by character, beginning
with the first character in the string.
The s1 and s2 character strings include all characters from the designated device number up
to the next device storing the code "00H".
If all character strings match, the comparison result for the operations $=, $<=, $>= is 1.

SSSS_0E1

If the character strings are different, the character string with the larger character code will be
the larger one.
Below, the comparison result for the operations $<>, $>, $>= is 1.

SSSS_0E2

If the character strings are different, the first different sized character code determines whether
the character string is larger or smaller.
Below, the comparison result for the operations $<>, $>, $>= is 1.

SSSS_0E3

Programming MELSEC System Q and L series 6 – 21


$ =, $ < >, $ >, $ < =, $ <, $ > = Comparison operation instructions

If the character strings are of different lengths, the data with the longer character string will be
larger.
Below, the comparison result for the operations $<>, $>, $>=, is 1.

SSSS_0E4

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The code "00H" does not exist within the relevant device range of s1 and s2.
(Error code 4101)
● The character string of s1 and s2 exceeds 16383 characters.
(Error code 4101)

NOTE The character string data comparison instruction also checks the device range.
Even though, in cases where one character string exceeds the device range, character string
data is being compared and non-matching characters within the device range are detected. The
comparison operation results are output without returning an error code.

S____AB1, SSSS_0E5
In the example shown above, the s1 character string exceeds the device range, and the most sig-
nificant 16 bits (D12288) were renamed W0. Nevertheless, the comparison result is 0, because
the second character in s1 is detected as different from that in s2. In this case no error code
regarding the device range is returned.
This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 22
Comparison operation instructions $ =, $ < >, $ >, $ < =, $ <, $ > =

Program Comparison operation instruction $=


Example 1
The following program compares character string data in D0 to character string data in D3. It
turns ON Y33, if the data are equal.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

S____MB1, S____KB1, S____IB1

Program Comparison operation instruction $<>


Example 2
The following program compares the character string "ABCDEF" to character string data in
D10. It turns ON Y33, if the data are not equal.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

S____MB2, S____KB2, S____IB2

Programming MELSEC System Q and L series 6 – 23


$ =, $ < >, $ >, $ < =, $ <, $ > = Comparison operation instructions

Program Comparison operation instruction $>


Example 3
The following program compares character string data in D10 to character string data in D100.
It turns ON Y33, if character string data in D10 is greater.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

S____MB3, S____KB3, S____IB3

Program Comparison operation instruction $<=


Example 4
The following program compares character string data in D0 to the character string "12345".
Y33 is set, if character string data in D0 is less than or equal to "12345".

MELSEC Instruction List IEC Instruction List

Ladder diagram

S____MB4, S____KB4, S____IB4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 24
Comparison operation instructions BKCMP, BKCMPP

6.1.6 BKCMP, BKCMPP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
d    — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

CMPME1, BKCMPKE1, BKCMPIE1B


K

GX Works2

BKCMPGE1

Variables Set Data Meaning Data Type


s1 Comparative data, or first number of the device storing comparative data BIN 16-bit
s2 First number of devices storing comparative data BIN 16-bit
d First number of device storing results of comparison operation Bit
n Number of data blocks compared BIN 16-bit

Programming MELSEC System Q and L series 6 – 25


BKCMP, BKCMPP Comparison operation instructions

Functions BIN block data comparisons


BKCMP Comparison operation instructions
A comparison operation instruction for BIN block data consists of the instruction itself, two des-
ignated devices s1 and s2 to be compared, a device d to store the result, and the number of
datablocks to be compared.
It compares the nth BIN 16-bit block in s1 to the nth BIN 16-bit block in s2, beginning with the
first number of device. The result of each block comparison is stored in d.
If the block comparison result is 1, then 1 is stored in d.
If the block comparison result is 0, then 0 is stored in d.

BKCMP0E1

The comparison operation is conducted in 16-bit units.


The constant designated by s1 must be BIN 16-bit data ranging from -32768 to 32767.

BKCMP0E2

The results of the comparison operations for the individual instructions are as follows:

Comparison Operation Results for nth 16-bit Block


Instruction Symbol
1 0
BKCMP= s1 = s2 s1 ≠ s2
BKCMP<> s1 ≠ s2 s1 = s2
BKCMP> s1 > s2 s1 ≤ s2
BKCMP<= s1 ≤ s2 s1 > s2
BKCMP< s1 < s2 s1 ≥ s2
BKCMP>= s1 ≥ s2 s1 < s2

If all comparison results stored in d are 1, the block comparison signal SM704 is set.
If the device designated by d is already set (1), that device will not change. If the conditions
designated by s1 and s2 are changed and the BKCMP_P instruction is executed, the device
designated by d should be reset (0) before.

6 – 26
Comparison operation instructions BKCMP, BKCMPP

Operation In following case an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The BIN block data at s1, s2, or d exceeds the relevant device range.
(Error code 4101)
● The device range from [s1 to (s1) + (n-1)] overlaps with the device range [d to (d) + (n-1)].
(Error code 4101)
● The device range from [s2 to (s2) + (n-1)] overlaps with the device range [d to (d) + (n-1)].
(Error code 4101)
● The device range from [s1 to (s1) + (n-1)] overlaps with the device range [s2 to (s2) + (n-1)].
(Error code 4101)

Program Comparison operation instruction BKCMP=P


Example 1
With leading edge from X20, the following program compares BIN block data in D100 to BIN
block data in R0. The results of the comparison are stored from M10 onward. The number of
blocks (4) to be compared is stored in D0

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKCMPMB1, BKCMPKB1, BKCMPIB1, BKCMP0B1

Programming MELSEC System Q and L series 6 – 27


BKCMP, BKCMPP Comparison operation instructions

Program Comparison operation instruction BKCMP<>P


Example 2
With leading edge from X1C, the following program compares the constant K1000 to the block
data beginning from D10. The number of blocks (4) to be compared is determined by the con-
stant K4. The results of the comparison are stored in b4 through b7 of D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Bits already in this state do not change (see function).
BKCMPMB2, BKCMPKB2, BKCMPIB2, BKCMP0B2

6 – 28
Comparison operation instructions BKCMP, BKCMPP

Program Comparison operation instruction BKCMP<=


Example 3
The following program compares, when X20 is turned ON, block data beginning from D10 to
block data beginning from D30. The number of blocks (3) to be compared is determined by the
constant K3. The results of the comparison are stored from M100 onward.
When all comparison results stored from M100 onward are 1, the block comparison signal
SM704 is set and the character string "ALL ON" is transferred to D100.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

BKCMPMB3, BKCMPKB3, BKCMPIB3, BKCMP0B3

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 29


DBKCMP, DBKCMPP Comparison operation instructions

6.1.7 DBKCMP, DBKCMPP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
d  —  — — — — — —
n —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
=, <>, >, <=, <, >=

DBKCMP DBKCMP s1 s2 d n

DBKCMP P DBKCMP P s1 s2 d n

Variables Set Data Meaning Data Type


s1 Comparative data, or first number of the device storing comparative data BIN 32-bit
s2 First number of devices storing comparative data BIN 32-bit
d First number of device storing results of comparison operation Bit
n Number of data blocks compared BIN 16-bit

6 – 30
Comparison operation instructions DBKCMP, DBKCMPP

Functions BIN 32-bit block data comparisons


DBKCMP Comparison operation instructions
A comparison operation instruction for BIN 32-bit block data consists of the instruction itself,
two designated devices s1 and s2 to be compared, a device d to store the result, and the
number of datablocks to be compared.
It compares the nth BIN 32-bit block in s1 to the nth BIN 32-bit block in s2, beginning with the
first number of device. The result of each block comparison is stored in d.
If the block comparison result is 1, then 1 is stored in d.
If the block comparison result is 0, then 0 is stored in d.

b31 b0 b31 b0
(s1)+1, (s1) 1090 (BIN) (s2)+1, (s2) 1000 (BIN) (d) OFF (0)
(s1)+3, (s1)+2 2080 (BIN) (s2)+3, (s2)+2 2000 (BIN) (d)+1 OFF (0)
(s1)+5, (s1)+4 5060 (BIN) n (s2)+5, (s2)+4 5060 (BIN) n (d)+2 ON (1) n

(s1)+n–1, (s1)+n–2 1106 (BIN) (s2)+n–1, (s2)+n–2 1106 (BIN) (d)+n–1 ON (1)

The comparison operation is conducted in 32-bit units.


The constant designated by s1 must be BIN 32-bit data ranging from -2147483648 to
2147483647.

b31 b0
(s2)+1, s2 32700 (BIN) d ON (1)
b31 b0 (s2)+3, (s2)+2 40000 (BIN) d +1 OFF (0)
(s1)+1, s1 32800 (BIN) (s2)+5, (s2)+4 32800 (BIN) n d +2 ON (1) n

(s2)+n 1, (s2)+n 2 2147400 (BIN) d +n 1 OFF (0)

The results of the comparison operations for the individual instructions are as follows:
Comparison operation results for nth 32-bit Block
Instruction Symbol
1 0
DBKCMP= s1 = s2 s1 ≠ s2
DBKCMP<> s1 ≠ s2 s1 = s2
DBKCMP> s1 > s2 s1 ≤ s2
DBKCMP<= s1 ≤ s2 s1 > s2
DBKCMP< s1 < s2 s1 ≥ s2
DBKCMP>= s1 ≥ s2 s1 < s2

If all comparison results stored into the devices starting from the device specified by d to nth
device are ON (1), or one of the results is OFF (0), the special relays will be ON or OFF in
accordance with the conditions as follows.
All results of comparison operation are on (1) All results of comparison operation are off (0)
Interrupt Interrupt
Relay (other than (other than
Initial executi- Initial executi-
on/scan I45)/ Interrupt (I45) on/scan I45)/ Interrupt (I45)
Fixed scan Fixed scan
execution execution
SM704 ON ON ON OFF OFF OFF
SM716 ON — — OFF — —
SM717 — ON — — OFF —
SM718 — — ON — — OFF

In a standby program, a special relay depending on the caller program turns on or off.
If the value specified by n is 0, the instruction will be not processed.

Programming MELSEC System Q and L series 6 – 31


DBKCMP, DBKCMPP Comparison operation instructions

Operation In following case an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● A negative value is specified for n.
(Error code 4100)
● The BIN block data at s1, s2, or d exceeds the relevant device range.
(Error code 4101)
● The device range of the n-point devices starting from the device specified by s1 overlaps
with the range of the n-point devices starting from the device specified by d.
(Error code 4101)
● The device range of the n-point devices starting from the device specified by s2 overlaps
with the range of the n-point devices starting from the device specified by d.
(Error code 4101)

Program Comparison operation instruction DBKCMP<>


Example 1
The following program compares the value data stored at R0 to R5 with the value data stored
at D20 to D25, and then stores the operation result into Y0 to Y2, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b31 b0 b31 b0
R1,R0 -2147483000 D21,D20 -2147483000 Y0 OFF (0)
R3,R2 0 D23,D22 1 Y1 ON (1)
R5,R4 2147483000 D25,D24 2147482999 Y2 ON (1)

6 – 32
Comparison operation instructions DBKCMP, DBKCMPP

Program Comparison operation instruction DBKCMP>=


Example 2
The following program compares the constant with the value data stored at D0 to D9, and then
stores the operation result into D10.5 to D10.9, when M0 is turned ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b31 b0
D1,D0 -70000 D10.5 ON (1)
b31 b0 D3,D2 50000 D10.6 OFF (0)
-60000 D5,D4 -32768 D10.7 OFF (0)
D7,D6 32767 D10.8 OFF (0)
D9,D8 0 D10.9 OFF (0)

NOTE When certain bits are specified in a word device, bits other than the certain bits that store the
operation result do not change.

D10.F D10.0
Before execution 0 0 1 0 1 1 1 1 1 0 0 1 1 0 0 0

D10.F D10.0
After execution
0 0 1 0 1 1 0 0 0 0 1 1 1 0 0 0

No change No change

Programming MELSEC System Q and L series 6 – 33


DBKCMP, DBKCMPP Comparison operation instructions

Program Comparison operation instruction DBKCMP<=


Example 3
The following program compares the value data stored at D0 to D5 with the value data stored
at D10 to D15, and then stores the operation result into M20 to M22, when M0 is turned ON.
Also, the program transfers the character string "ALL ON" to D100 and up when all devices
from M20 to M22 have reached the ON status.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b31 b0 b31 b0
D1,D0 -2147483000 D11,D10 -2147483000 M20 ON (1)
D3,D2 60000 D13,D12 60001 M21 ON (1)
D5,D4 -900000 D15,D14 -899999 M22 ON (1)

When all operation results are on (1), the special relays (1)
SM704 ON
corresponding to each program turn on (1).
(Since this program examples refer to scan programs, SM716 ON (1)
SM704 and SM716 turn on (1), SM717 and SM718 do SM717 OFF (0)
not change in the scan program)
SM718 OFF (0)

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 34
Arithmetic operation Instructions

6.2 Arithmetic operation Instructions


Arithmetic operation instructions perform simple calculations like addition, subtraction, multipli-
cation, and division.
BIN BCD
Function MELSEC Instruction MELSEC Instruction MELSEC Instruction MELSEC Instruction
in in in in
MELSEC Editor IEC Editor MELSEC Editor IEC Editor
PLUS_M, BPLUS_M,
+ PLUS_3_M B+ BPLUS_3_M

+
PLUSP_M, BPLUSP_M,
+P B+P
PLUSP_3_M BPLUSP_3_M
Addition D+ DPLUS_M, DB+ DBPLUS_M,
DPLUS_3_M DBPLUS_3_M
DPLUSP_M, DBPLUSP_M,
D+P DB+P
DPLUSP_3_M DBPLUSP_3_M

- MINUS_M, B- BMINUS_M,
MINUS_3_M BMINUS_3_M


MINUSP_M, BMINUSP_M,
-P MINUSP_3_M B-P BMINUSP_3_M
Subtraction DMINUS_M, DBMINUS_M,
D- DB-
DMINUS_3_M DBMINUS_3_M

D-P DMINUSP_M, DB-P DBMINUSP_M,


DMINUSP_3_M DBMINUSP_3_M
× MULTI_3_M B× BMULTI_M
× ×P MULTIP_3_M B×P BMULTIP_M
Multiplication D× DMULTI_3_M DB× DBMULTI_M
D×P DMULTIP_3_M DB×P DBMULTIP_M
/ DIVID_3_M B/ BDIVID_M
/ /P DIVIDP_3_M B/P BDIVIDP_M
Division D/ DDIVID_3_M DB/ DBDIVID_M
D/P DDIVIDP_3_M DB/P DBDIVIDP_M
INC INC_M
+1 INCP INCP_M
Increment DINC DINC_M
DINCP DINCP_M
DEC DEC_M
−1 DECP DECP_M
Decrement DDEC DDEC_M
DDECP DDECP_M

NOTE Within the IEC editors please use the IEC commands.

Programming MELSEC System Q and L series 6 – 35


Arithmetic operation Instructions

Floating Point Data BIN Block Data

Function MELSEC Instruction MELSEC Instruction MELSEC Instruction MELSEC Instruction


in in in in
MELSEC Editor IEC Editor MELSEC Editor IEC Editor

E+ EPLUS_M, BK+ BKPLUS_M


EPLUS_3_M

+ E+P
EPLUSP_M,
BK+P BKPLUSP_M
EPLUSP_3_M
Addition
ED+ DBK+

ED+P DBK+P

E- EMINUS_M, BK- BKMINUS_M


EMINUS_3_M

− E-P
EMINUSP_M,
BK-P BKMINUSP_M
EMINUSP_3_M
Subtraction
ED- DBK-

ED-P DBK-P

E× EMUL_M

× E×P EMULP_M

Multiplication EDx

EDxP

E/ EDIV_M

/ E/P EDIVP_M

Division ED/

ED/P

Character String Data


Function MELSEC Instruction MELSEC Instruction
in in
MELSEC Editor IEC Editor

+
STRING_PLUS_M,
$+
STRING_PLUS_3_M
Addition $+P STRING_PLUSP_M,
STRING_PLUSP_3_M

NOTE Within the IEC editors please use the IEC commands.

6 – 36
Arithmetic operation Instructions

BIN data arithmetic operation instructions


If the result of the addition exceeds a BIN value 32767 (2147483647 for a 32-bit instruction), a
negative value is generated (overflow).
If the result of the subtraction falls below a BIN value -32768 (-2147483647 for a 32-bit instruc-
tion), a positive value is generated (underflow).
The calculation of positive and negative values appears as follows:
5 + 8 = 13
5 - 8 = -3
5 × 3 = 15
-5 × 3 = -15
-5 × (-3) = 15
5 / 3 = 1 remainder 2
-5 / 3 = -1 remainder -2
5 / (-3) = -1 remainder 2
-5 / (-3) = 1 remainder -2

BCD data arithmetic operation instructions


If the result of the addition exceeds 9999 (99999999 for a 32-bit instruction), the higher bits are
ignored (overflow). The carry flag in this case is not set.

1 Carry ignored
BCD_0E1

If the result of the subtraction falls below 0000 (underflow), the carry is processed as shown:

2
Carry
BCD_0E2

Programming MELSEC System Q and L series 6 – 37


+, +P, -, -P Arithmetic operation Instructions

6.2.1 +, +P, -, -P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PLUS_ME1, PLUS_KE1, PLUS_IE1P


L

GX Works2

PLUS_GE1

Variables Set Data Meaning Data Type


Addition or subtraction data, or first number of device storing addition or
s
subtraction data
Data to be added to or subtracted from, or first number of device storing such
d
data
Data to be added to or subtracted from, or first number of device storing such BIN 16-bit
s1
data
Addition or subtraction data, or first number of device storing addition or
s2
subtraction data
d1 First number of device storing addition or subtraction data

6 – 38
Arithmetic operation Instructions +, +P, -, -P

Functions BIN 16-bit addition and subtraction operations


+ BIN addition (16-bit)
● Variation 1:
BIN 16-bit data in d is added to BIN 16-bit data in s. The result of the addition is stored in d.

PLUSP0E1

● Varation 2:
BIN 16-bit data in s1 is added to BIN 16-bit data in s2. The result of the addition is stored in d1.

PLUSP0E2
BIN 16-bit data designated by s, d, s1, s2, and d1 have to range within -32768 and 32767.
The most significant bit (b15) determines, whether data in s, d, s1, or d1 are positive (bit = 0)
or negative (bit = 1).
If the least significant bit (b0) is fallen below or the most significant bit (b15) is exceeded, the
carry flag is not set.

Programming MELSEC System Q and L series 6 – 39


+, +P, -, -P Arithmetic operation Instructions

- BIN subtraction (16-bit)


● Variation 1:
BIN 16-bit data in s is subtracted from BIN 16-bit data in d. The result of the subtraction is
stored in d.

MINUP0E1

● Variation 2:
BIN 16-bit data in s2 is subtracted from BIN 16-bit data in s1. The result is stored in d1.

MINUP0E2
BIN 16-bit data designated by s, d, s1, s2, and d1 have to range within -32768 and 32767.
The most significant bit (b15) determines, whether data in s, d, s1, or d1 are positive (bit = 0)
or negative (bit = 1).
If the least significant bit (b0) is fallen below or the most significant bit (b15) is exceeded, the
carry flag is not set.

6 – 40
Arithmetic operation Instructions +, +P, -, -P

Program +P
Example 1
WIth leading edge from X5, the following program adds data in D3 to data in D0. The result is
stored from Y38 to Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

PLUS_MB1, PLUS_KB1, PLUS_IB1

Program -
Example 2
The following program outputs the difference between the nominal and the actual value of timer
T3 to Y40 through Y53 in BCD.

MELSEC Instruction List Ladder Diagram IEC Instruction List

PLUS_MB2, PLUS_KB2, PLUS_IB2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 41


D+, D+P, D-, D-P Arithmetic operation Instructions

6.2.2 D+, D+P, D-, D-P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s         —
d        — —
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

D
P
DPLUSME1, DPLUSKE1, DPLUSIE1

GX Works2

DPLUSGE1

Variables Set Data Meaning Data Type


Addition or subtraction data, or first number of device storing addition or
s
subtraction data
Data to be added to or subtracted from, or first number of device storing such
d
data
Data to be added to or subtracted from, or first number of device storing such BIN 32-bit
s1
data
Addition or subtraction data, or first number of device storing addition or
s2
subtraction data
d1 First number of device storing addition or subtraction data

6 – 42
Arithmetic operation Instructions D+, D+P, D-, D-P

Functions BIN 32-bit addition and subtraction operations


D+ BIN addition (32-bit)
● Variation 1:
BIN 32-bit data in d is added to BIN 32-bit data in s. The result of the addition is stored in d.

DPLUS0E1

● Variation 2:
BIN 32-bit data in s1 is added to BIN 32-bit data in s2. The result of the addition is stored in d1.

DPLUS0E2
BIN 32-bit data designated by s, d, s1, s2, and d1 have to range within -2147483648 and
2147483647.
The most significant bit (b31) determines, whether data in s, d, s1, or d1 are positive (bit = 0)
or negative (bit = 1).
If the least significant bit (b0) is fallen below or the most significant bit (b31) is exceeded, the
carry flag is not set.

D- BIN subtraction (32-bit)


● Varation 1:
BIN 32-bit data in s is subtracted from BIN 32-bit data in d. The result of the subtraction is
stored in d.

DMINU0E1

Programming MELSEC System Q and L series 6 – 43


D+, D+P, D-, D-P Arithmetic operation Instructions

● Variation 2:
BIN 32-bit data in s2 is subtracted from BIN 32-bit data in s1. The result is stored in d1.

DMINU0E2
BIN 32-bit data designated by s, d, s1, s2, and d1 have to range within -2147483648 and
2147483647.
The most significant bit (b31) determines, whether data in s, d, s1, or d1 are positive (bit = 0)
or negative (bit = 1).
If the least significant bit (b0) is fallen below or the most significant bit (b31) is exceeded, the
carry flag is not set.

Program D+P
Example 1
With leading edge from X0, the following program adds data in X10 through X2B to D9 and
D10. The result is stored in Y30 through Y4B.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DPLUSMB1, DPLUSKB1, DPLUSIB1

Program D-P
Example 2
With leading edge from XB, the following program subtracts data in M0 through M23 from data
in D0 and D1. The result is stored in D10 and D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DPLUSMB2, DPLUSKB2, DPLUSIB2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 44
Arithmetic operation Instructions x, xP, /, /P

6.2.3 x, xP, /, /P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) Direct J\ Function
File Module Index Register Constant Other
Register Zn K, H (16#)
Bit Word Bit Word Index Register
U\G
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

LTIME1, MULTIKE1, MULTIIE1M


U

GX Works2

MULTIGE1

Variables Set Data Meaning Data Type


Data that will be multiplied or divided, or first number of device storing data that
s1 BIN 16-bit
will be multiplied or divided
s2 Data to multiply or divide by, or first number of device storing such data BIN 16-bit
First number of device storing the operation results of multiplication or division
d1 BIN 32-bit
operation

Programming MELSEC System Q and L series 6 – 45


x, xP, /, /P Arithmetic operation Instructions

Functions BIN 16-bit multiplication and division


x BIN multiplication (16-bit)
BIN 16-bit data in s1 is multiplied with BIN 16-bit data in s2. The result is stored in d1.

XXPP0E1
If the result in d1 is a bit device, designation is made from the lower bits.
Example:
K1: lower 4 bits (b0 to b3)
K4: lower 16 bits (b0 to b15)
K8: 32 bits (b0 to b31)
BIN 16-bit data designated by s1 and s2 have to range within -32768 and 32767.
The most significant bit (b15 or b31) in d1 determines, whether data in s1, s2 or d1 are positive
(bit = 0) or negative (bit = 1).

/ BIN division (16-bit)


BIN 16-bit data in s1 is divided by BIN 16-bit data in s2. The result is stored in d1.

XXPP0E2
If a word device is used, the result of the operation is stored as 32-bits, and both, the quotient
and remainder are stored. The quotient is stored in the least significant 16-bits. The remainder
is stored in the most significant 16-bits.
If a bit device is used, 16-bits are used and only the quotient is stored.
BIN 16-bit data designated by s1 and s2 have to range within -32768 and 32767.
The most signigicant bit (b15) in d1 determines, whether data in s1, s2, d1 or (d1)+1 is positive
(bit = 0) or negative (bit = 1).

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Division by 0 (Error code 4100)

6 – 46
Arithmetic operation Instructions x, xP, /, /P

Program xP
Example 1
With leading edge from X5, the following program multiplies 5678 and 1234. The result is
stored in D3 and D4.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MULTIMB1, MULTIKB1, MULTIIB1

Program x
Example 2
The following program multiplies BIN data at X8 through XF and BIN data at X10 through X1B.
The result is output at Y30 through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MULTIMB2, MULTIKB2, MULTIIB2

Programming MELSEC System Q and L series 6 – 47


x, xP, /, /P Arithmetic operation Instructions

Program /P
Example 3
With leading edge from X3, the following program divides data at X8 through XF by 3.14. The
result is output at Y30 through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MULTIMB3, MULTIKB3, MULTIIB3

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 48
Arithmetic operation Instructions Dx, DxP, D/, D/P

6.2.4 Dx, DxP, D/, D/P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Devices
Internal Devices MELSECNET/H Special
(System, User) Direct J\ Function Index
File ModuleSpecia RegisterIndex ConstantConst
ant Other
Register l Function Register K, H (16#)
Bit Word Bit Word Module Zn
U\G
s1         —
s2         —
d1    — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

D
M
DMULTME1, DMULTKE1, DMULTIE1

GX Works2

DMULTGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Data that will be multiplied or divided, or first number of device
s1 BIN 32-bit ANY32
storing data that will be multiplied or divided
Data to multiply or divide by, or first number of device storing
s2 BIN 32-bit ANY32
such data
First number of device storing the operation results of Array [1..2] of
d1 BIN 64-bit
multiplication or division operation ANY32

Programming MELSEC System Q and L series 6 – 49


Dx, DxP, D/, D/P Arithmetic operation Instructions

Functions BIN 32-bit multiplication and division


Dx BIN multiplication (32-bit)
BIN 32-bit data in s1 is multiplied with BIN 32-bit data in s2. The result is stored in d1.

DXP_0E1

If the result in d1 is a bit device, designation is made from the lower bits.
Example:
K1: lower 4 bits (b0 to b3)
K4: lower 16 bits (b0 to b15)
K8: 32 bits (b0 to b31)
If the upper 32 bits of the bit device are required for the result of the multiplication operation,
first temporarily store the data in a word device, then transfer the word device data to the bit
device designated by (d1)+2 and (d1)+3.
BIN 32-bit data designated by s1 and s2 has to range within -2147483648 and 2147483647.
The most significant bit (b31 or b63) in d1 determines, whether data in s1, s2 or d1 is positive
(bit = 0) or negative (bit = 1).

D/ BIN division (32-bit)


BIN 32-bit data in s1 is divided by BIN 32-bit data in s2. The result is stored in d1.

DXP_0E2
If a word device is used, the result of the division operation is stored as array of DINT (64-bit),
and both the quotient and remainder are stored. The quotient is stored in the lower array ele-
ments (32-bit). The remainder is stored in the upper array elements (32-bit).
If a bit device is used, 32 bits are used and only the quotient is stored.
BIN 32-bit data designated by s1 and s2 has to range within -2147483648 and 2147483647.
The most significant bit (b31) in d1 determines, whether data in s1, s2, d1 or (d1)+2 is positive
(bit = 0) or negative (bit = 1).

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Division by 0 (Error code 4100)

6 – 50
Arithmetic operation Instructions Dx, DxP, D/, D/P

Program DxP
Example 1
With leading edge from X5, the following program multiplies BIN data in D7 and D8 with BIN
data in D18 and D19. The result is stored in D1 through D4.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DMULTMB1, DMULTKB1, DMULTIB1

Program xP
Example 2
With leading edge from X3, the following program multiplies data at X8 through XF and 3.14.
The result is output at Y30 through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DMULTMB2, DMULTKB2, DMULTIB2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 51


B+, B+P, B-, B-P Arithmetic operation Instructions

6.2.5 B+, B+P, B-, B-P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BPLUSME1, BPLUSKE1, BPLUSIE1B


P
GX Works2

Variables Set Data Meaning Data Type


Addition or subtraction data, or first number of device storing addition or
s
subtraction data
Data to be added to or subtracted from, or first number of device storing such
d
data
Data to be added to or subtracted from, or first number of device storing such BCD 4-digit
s1
data
Addition or subtraction data, or first number of device storing addition or
s2
subtraction data
d1 First number of device storing addition or subtraction data

6 – 52
Arithmetic operation Instructions B+, B+P, B-, B-P

Functions BCD 4-digit addition and subtraction operations


B+ BCD addition (4-digit)
● Variation 1:
BCD 4-digit data in d is added to BCD 4-digit data in s. The result of the addition is stored in d.

BBP_0E1

● Variation 2:
BCD 4-digit data in s1 is added to BCD 4-digit data in s2. The result is stored in d1.

BBP_0E2

BCD 4-digit data designated by s, d, s1, s2, and d1 have to range within 0 and 9999. Undesig-
nated digits are read as 0 (e.g. 12 = 0012).
If the result of the addition exceeds 9999, the higher bits are ignored (overflow). The carry flag
in this case is not set.

BBP_0E3

B- BCD subtraction (4-digit)


● Variation 1:
BCD 4-digit data in s is subtracted from BCD 4-digit data in d. The result is stored in d.

1
Undesignated digits are read as 0.
BBP_0E4

Programming MELSEC System Q and L series 6 – 53


B+, B+P, B-, B-P Arithmetic operation Instructions

● Variation 2:
BCD 4-digit data in s2 is subtracted from BCD 4-digit data in s1. The result is stored in d1.

1 Undesignated digits are read as 0.


BBP_0E5
BCD 4-digit data designated by s, d, s1, s2, and d1 have to range within 0 and 9999.
If the result of the subtraction operation is negative, the minuend is reduced by the number of
steps determined by the subtrahend. The carry flag in this case is not set.

BBP_0E6
In the further course of a program, make sure that either positive or negative results are treated
adequately.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The BCD 4-digit data designated by s, d, s1, s2, or d1 exceed the relevant device range of
0 to 9999. (Error code 4100)

Program B+P (s, d)


Example 1
The following program adds BCD data 5678 to BCD data 1234. The result is stored in D993
and output at Y30 through Y3F.
The first line of the program stores the value 5678 in D993.
The following program step adds BCD data 1234 to BCD data in D993.
The MOV instruction in the last program step outputs the result in D993 at Y30 through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BPLUSMB1, BPLUSKB1, BPLUSIB1

6 – 54
Arithmetic operation Instructions B+, B+P, B-, B-P

Program B-P (s, d)


Example 2
The following program subtracts BCD data 4321 from BCD data 7654. The result is stored in
D10 and output at Y30 through Y3F.
The first line of the program stores the value 7654 in D10.
The following program step subtracts BCD data 4321 from BCD data in D10.
The MOV instruction in the last program step outputs the result in D10 at Y30 through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BPLUSMB2, BPLUSKB2, BPLUSIB2

Program B+P (s1, s2, d1)


Example 3
With leading edge from X20, the following program adds BCD data in D3 to BCD data in Z1.
The result is output at Y8 through Y17.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BPLUSMB3, BPLUSKB3, BPLUSIB3

Program B-P (s1, s2, d1)


Example 4
With leading edge from X20, the following program subtracts BCD data in D20 from BCD data
in D10. The result is stored in R10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BPLUSMB4, BPLUSKB4, BPLUSIB4

Programming MELSEC System Q and L series 6 – 55


DB+, DB+P, DB-, DB-P Arithmetic operation Instructions

6.2.6 DB+, DB+P, DB-, DB-P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DBPLUME1, DBPLUKE1, DBPLUIE1

GX Works2

G
E
1

Variables Set Data Meaning Data Type


s Addition or subtraction data, or first number of device storing addition or
subtraction data
d Data to be added to or subtracted from, or first number of device storing such
data
s1 Data to be added to or subtracted from, or first number of device storing such BCD 8-digit
data
s2 Addition or subtraction data, or first number of device storing addition or
subtraction data
d1 First number of device storing addition or subtraction data

6 – 56
Arithmetic operation Instructions DB+, DB+P, DB-, DB-P

Functions BCD 8-digit addition and subtraction operations


DB+ BCD addition (8-digit)
● Variation 1:
BCD 8-digit data in d is added to BCD 8-digit data in s. The result is stored in d.

1
Undesignated digits are read as 0.
DBP_0E1

● Variation 2:
BCD 8-digit data in s1 is added to BCD 8-digit data in s2. The result is stored in d1.

1 Undesignated digits are read as 0.


DBP_0E2

BCD 8-digit data designated by s, d, s1, and d1 have to range within 0 and 99999999. Undesig-
nated digits are read as 0 (e.g. 12345 = 00012345).
If the result of the addition exceeds 99999999, the higher bits are ignored (overflow). The carry
flag in this case is not set.

DBP_0E3

DB- BCD subtraction (8-digit)


● Variation 1:
BCD 8-digit data in s is subtracted from BCD 8-digit data in d. The result is stored in d.

1
Undesignated digits are read as 0
DBP_0E4

Programming MELSEC System Q and L series 6 – 57


DB+, DB+P, DB-, DB-P Arithmetic operation Instructions

● Variation 2:
BCD 8-digit data in s2 is subtracted from BCD 8-digit data in s1. The result is stored in d1.

1
Undesignated digits are read as 0
DBP_0E5

BCD 8-digit data designated by s, d, s1, and d1 have to range within 0 and 99999999. Undesig-
nated digits are read as 0 (e.g. 12345 = 00012345).
If the result of the subtraction operation is negative, the minuend is reduced by the number of
steps determined by the subtrahend. The carry flag in this case is not set.

DBP_0E6
In the further course of a program, make sure that either positive or negative results are treated
adequately.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The BCD 8-digit data designated by s, d, s1, s2, or d1 exceed the relevant device range of
0 to 99999999. (Error code 4100)

Program DB+P (s, d)


Example 1
The following program adds BCD data 12345600 to BCD data 34567000. The result is stored
in D887 and D888 and output at Y30 through Y4F.
The first line of the program stores the value 12345600 in D887 and D888.
The following program step adds BCD data 34567000 to BCD data in D887 and D888.
The DMOVP instruction in the last program step outputs the result in D887 and D888 at Y30
through Y4F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DBPLUMB1, DBPLUKB1, DBPLUIB1

6 – 58
Arithmetic operation Instructions DB+, DB+P, DB-, DB-P

Program DB-P (s, d)


Example 2
The following program subtracts BCD data 12345678 from BCD data 98765432. The result is
stored in D100 and D101 and output at Y30 through Y4F.
The first line of the program stores the value 98765432 in D100 and D101.
The following program step subtracts BCD data 12345678 from BCD data in D100 and D101.
The DMOVP instruction in the last program step outputs the result in D100 and D101 at Y30
through Y4F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DBPLUMB2, DBPLUKB2, DBPLUIB2

Program DB+P (s1, s2, d1)


Example 3
With leading edge from X20, the following program adds BCD data in D3 and D4 to BCD data
in Z and V. The result is stored in R10 and R11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DBPLUMB3, DBPLUKB3, DBPLUIB3

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 59


Bx, BxP, B/, B/P Arithmetic operation Instructions

6.2.7 Bx, BxP, B/, B/P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ULTME1, BMULTKE1, BMULTIE1B


M

GX Works2

BMULTGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Data that will be multiplied or divided, or first number of
s1 BCD 4-digit WORD
device storing data that will be multiplied or divided
Data to multiply or divide by, or first number of device
s2 BCD 4-digit WORD
storing such data
First number of device storing the operation results of
d1 BCD 8-digit 2 Arrays of WORD
multiplication or division operation

6 – 60
Arithmetic operation Instructions Bx, BxP, B/, B/P

Functions BCD 4-digit multiplication and division operations


Bx BCD multiplication (4-digit)
BCD 4-digit data in s1 is multiplied with BCD 4-digit data in s2. The result is stored in d1.

BXP_0E1
BCD 4-digit data designated by s1 and s2 have to range within 0 and 9999.

B/ BCD division (4-digit)


BCD 4-digit data in s1 is divided by BCD 4-digit data in s2. The result is stored in d1.

BXP_0E2
The result of the division is stored in two 16-bit WORD arrays. The lower array stores the quo-
tient (BCD 4-digit) and the upper array stores the remainder (BCD 4-digit).
If d is a bit device, the remainder of the division is not stored.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The s1 or s2 BCD data is outside the 0 to 9999 range. (Error code 4101)
● Division by 0 (Error code 4100)

Programming MELSEC System Q and L series 6 – 61


Bx, BxP, B/, B/P Arithmetic operation Instructions

Program BxP
Example 1
With leading edge from XB, the following program multiplies BCD data at X0 through XF with
BCD data in D8. The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Multiplicand
2 Multiplier
3 Result of multiplication

BMULTMB1, BMULTKB1, BMULTIB1, BXP_0B1

Program B/P
Example 2
The following program divides BCD data 5678 by BCD data 1234. The result is stored in D502
and the remainder is stored in D503. The last program step outputs the quotient in D502 at Y30
through Y3F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 Dividend
2
Divisor
3 Quotient

4 Remainder

BMULTMB2, BMULTKB2, BMULTIB2, BXP_0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 62
Arithmetic operation Instructions DBx, DBxP, DB/, DB/P

6.2.8 DBx, DBxP, DB/, DB/P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1         —
s2         —
d1    — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

D
B
MULME1, DBMULKE1, DBMULIE1

GX Works2

DBMULGE1

Variables Set DataSet Meaning Data Type


Data
Data that will be multiplied or divided, or first number of device storing data that
s1 BCD 8-digit
will be multiplied or divided
s2 Data to multiply or divide by, or first number of device storing such data BCD 8-digit
First number of device storing the operation results of multiplication or division
d1 BCD 16-digit
operation

Programming MELSEC System Q and L series 6 – 63


DBx, DBxP, DB/, DB/P Arithmetic operation Instructions

Functions BCD 8-digit multiplication and division operations


DBx BCD multiplication (8-digit)
BCD 8-digit data in s1 is multiplied with BCD 8-digit data in s2. The result is stored in d1.

DBXP_0E1

If the result in d1 is a bit device, designation is made from the lower bits.
Example:
K1: lower 4 bits (b0 to b3)
K4: lower 16 bits (b0 to b15)
K8: 32 bits (b0 to b31)
BCD 8-digit data designated by s1 and s2 have to range within 0 and 99999999. Undesignated
digits are read as 0 (e.g. 12345 = 00012345).

DB/ BCD division (8-digit)


BCD 8-digit data in s1 is divided by BCD 8-digit data in s2. The result is stored in d1.

DBXP_0E2
The result of the division is stored in two 32-bit WORD arrays. The lower array stores the quo-
tient (BCD 8-digit) and the upper array stores the remainder (BCD 8-digit).
If d is a bit device, the remainder of the division is not stored.

6 – 64
Arithmetic operation Instructions DBx, DBxP, DB/, DB/P

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The s1 or s2 BCD data is outside the 0 to 99999999 range. (Error code 4101)
● Division by 0 (Error code 4100)

Program DBxP
Example 1
The following program multiplies BCD data 68347125 with BCD data 576682. The result is
stored in D502 through D505. The following program step outputs the upper eight digits (D504,
D505) at Y30 through Y4F.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

DBMULMB1, DBMULKB1, DBMULIB1, DBXP0B1

Programming MELSEC System Q and L series 6 – 65


DBx, DBxP, DB/, DB/P Arithmetic operation Instructions

Program DB/P
Example 2
With leading edge from XB, the following program divides BCD data at X20 through X3F by
BCD data in D8 and D9. The result is stored in D765 through D768.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Dividend
2 Divisor
3
Quotient
4 Remainder

DBMULMB2, DBMULKB2, DBMULIB2, DBXP0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 66
Arithmetic operation Instructions E+, E+P, E-, E-P

6.2.9 E+, E+P, E-, E-P

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     
1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn E Other
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
s1 —   —   1)  —
s2 —   —   1)  —
d1 —   —   1) — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

LUSME1, EPLUSKE1, EPLUSIE1E


P

GX Works2

EPLUSGE1

Variables Set Data Meaning Data Type


Addition or subtraction data, or first number of device storing addition or
s
subtraction data
Data to be added to or subtracted from, or first number of device storing such
d
data
Data to be added to or subtracted from, or first number of device storing such Real number
s1
data
Addition or subtraction data, or first number of device storing addition or
s2
subtraction data
d1 First number of device storing addition or subtraction data

NOTE Within the IEC editors please use the IEC commands.

Programming MELSEC System Q and L series 6 – 67


E+, E+P, E-, E-P Arithmetic operation Instructions

Functions Floating point data addition and subtraction operations (single precision)
E+ 32-bit floating point data addition
● Variation 1:
Floating point data in d is added to floating point data in s. The result is stored in d.

1
32-bit floating point data, data type real number
EP_0E1

● Variation 2:
Floating point data in s1 is added to floating point data in s2. The result is stored in d1.

1 32-bit floating point data, data type real number


EP_0E3

Floating point data designated by s, d, s1, s2, and d1 have to range within:
0, ±2-126 ≤ (s, d, s1, s2, d1) < ±2128

E- 32-bit floating point data subtraction


● Variation 1:
Floating point data in s is subtracted from floating point data in d. The result is stored in d.

1
32-bit floating point data, data type real number
EP_0E2

6 – 68
Arithmetic operation Instructions E+, E+P, E-, E-P

● Variation 2:
Floating point data in s2 is subtracted from floating point data in s1. The result is stored in d1.

1 32-bit floating point data, data type real number


EP_0E4

Floating point data designated by s, d, s1, s2, and d1 have to range within:
0, ±2-126 ≤ (s, d, s1, s2, d1) < ±2128

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the addition are not zero and not within
the following range (Error code 4100):
±2-126 ≤ (Contents of designated device) < ±2128
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
● The value of the designated device is –0.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU) (Error code 4100)
NOTE: There are CPU modules that will not result in an operation error if –0 is specified.
Refer to section 3.5.1 for details.
● The result of addition and subtraction exceeds the following range (overflow occurs):
(For the Universal model QCPU, LCPU)
–2128 ≤ (Result of addition and subtraction) ≤ 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ± ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

Programming MELSEC System Q and L series 6 – 69


E+, E+P, E-, E-P Arithmetic operation Instructions

Program E+P (s, d)


Example 1
With leading edge from X20, the following program adds floating point data in D3 and D4 to
floating point data in D10 and D11. The result is stored in D3 and D4.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EPLUSMB1, EPLUSKB1, EPLUSIB1, EP_0B1

Program E-P (s, d)


Example 2
The following program subtracts floating point data in D10 and D11 from floating point data in
D20 and D21. The result is stored in D20 and D21.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EPLUSMB2, EPLUSKB2, EPLUSIB2, EP_0B2

6 – 70
Arithmetic operation Instructions E+, E+P, E-, E-P

Program E+P (s1, s2, d)


Example 3
With leading edge from X20, the following program adds floating point data in D3 and D4 to
floating point data in D10 and D11. The result is stored in R0 and R1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EPLUSMB3, EPLUSKB3, EPLUSIB3, EP_0B3

Program E-P (s1, s2, d)


Example 4
The following program subtracts floating point data in D20 and D21 from floating point data in D10
and D11. The result is stored in D30 and D31.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EPLUSMB4, EPLUSKB4, EPLUSIB4, EP_0B4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 71


ED+, ED+P, ED-, ED-P Arithmetic operation Instructions

6.2.10 ED+, ED+P, ED-, ED-P

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —
s1 —   — — — —  —
s2 —   — — — —  —
d1 —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
ED+/ED-

s d

E
P
P s d
L
U
S
G
E
1

ED+/ED-

s1 s2 d

P s1 s2 d

Variables Set Data Meaning Data Type


Addition or subtraction data, or first number of device storing addition or
s
subtraction data
Data to be added to or subtracted from, or first number of device storing such
d
data
Data to be added to or subtracted from, or first number of device storing such Real number
s1
data
Addition or subtraction data, or first number of device storing addition or
s2
subtraction data
d1 First number of device storing addition or subtraction data

NOTE Within the IEC editors please use the IEC commands.

6 – 72
Arithmetic operation Instructions ED+, ED+P, ED-, ED-P

Functions Floating point data addition and subtraction operations (double precision)
ED+ 64-bit floating point data addition
● Variation 1:
Floating point data in d is added to floating point data in s. The result is stored in d.

d +3 d +2 d +1 d s +3 s +2 s +1 s d +3 d +2 d +1 d

1 1 1

1
64-bit floating point data, data type real number
EP_0E1

● Variation 2:
64-bit floating point data in s1 is added to floating point data in s2. The result is stored in d1.

s1+3 s1+2 s1+1 s1 s2+3 s2+2 s2+1 s2 d1+3 d1+2 d1+1 d1

1 1 1

1
64-bit floating point data, data type real number
EP_0E3

Floating point data designated by s, d, s1, s2, and d1 have to range within:
0, ±2-1022 ≤ (s, d, s1, s2, d1) < ±21024

ED- 64-bit floating point data subtraction


● Variation 1:
Floating point data in s is subtracted from floating point data in d. The result is stored in d.

d +3 d +2 d +1 d s +3 s +2 s +1 s d +3 d +2 d +1 d

1 1 1

1
64-bit floating point data, data type real number

● Variation 2: EP_0E2

Floating point data in s2 is subtracted from floating point data in s1. The result is stored in d1.

s1+3 s1+2 s1+1 s1 s2+3 s2+2 s2+1 s2 d1+3 d1+2 d1+1 d1



1 1 1

1 64-bit floating point data, data type real number


EP_0E4
Floating point data designated by s, d, s1, s2, and d1 have to range within:
0, ±2-1022 ≤ (s, d, s1, s2, d1) < ±21024

Programming MELSEC System Q and L series 6 – 73


ED+, ED+P, ED-, ED-P Arithmetic operation Instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the addition are not zero and not within
the following range:
±2-1022 ≤ (Contents of designated device) < ±21024
(Error code 4140)
● The value of the designated device is –0.
(Error code 4140)
● The result of addition and subtraction exceeds the following range (overflow occurs):
–21024 ≤ (Result of addition and subtraction) ≤ 21024
(Error code 4141)

6 – 74
Arithmetic operation Instructions ED+, ED+P, ED-, ED-P

Program ED+P (s, d)


Example 1
With leading edge from X20, the following program adds 64-bit floating point data in D3 to D6
to 64-bit floating point data in D10 to D13. The result is stored in D3 to D6.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D6 D5 D4 D3 D13 D12 D11 D10 D6 D5 D4 D3


5961.437 12003.200 17964.637

EPLUSMB1, EPLUSKB1, EPLUSIB1, EP_0B1

Program ED-P (s, d)


Example 2
The following program subtracts 64-bit floating point data in D10 to D13 from 64-bit floating
point data in D20 to D23. The result is stored in D20 to D23.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D23 D22 D21 D20 D13 D12 D11 D10 D23 D22 D21 D20
97365.203 76059.797 21305.406

EPLUSMB2, EPLUSKB2, EPLUSIB2, EP_0B2

Programming MELSEC System Q and L series 6 – 75


ED+, ED+P, ED-, ED-P Arithmetic operation Instructions

Program ED+P (s1, s2, d)


Example 3
With leading edge from X20, the following program adds 64-bit floating point data in D3 to D6
to 64-bit floating point data in D10 to D13. The result is stored in R0 to R3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D6 D5 D4 D3 D13 D12 D11 D10 R3 R2 R1 R0


5961.437 12003.200 17964.637

EPLUSMB3, EPLUSKB3, EPLUSIB3, EP_0B3

Program ED-P (s1, s2, d)


Example 4
The following program subtracts 64-bit floating point data in D20 to D23 from 64-bit floating point
data in D10 to D13. The result is stored in D30 to D33.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D13 D12 D11 D10 D23 D22 D21 D20 D33 D32 D31 D30
97365.203 76059.797 21305.406

EPLUSMB4, EPLUSKB4, EPLUSIB4, EP_0B4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 76
Arithmetic operation Instructions Ex, ExP, E/, E/P

6.2.11 Ex, ExP, E/, E/P

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     
1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn E
Bit Word Bit Word U\G
s1 —   —   1)  —
s2 —   —   1)  —
d1 —   —    1) — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ULTME1, EMULTKE1, EMULTIE1E


M

GX Works2

EMULTGE1

Variables Set Data Meaning Data Type


Data that will be multiplied or divided, or first number of device storing data that
s1
will be multiplied or divided
s2 Data to multiply or divide by, or first number of device storing such data Real number
First number of device storing the operation results of multiplication or division
d1
operation

Programming MELSEC System Q and L series 6 – 77


Ex, ExP, E/, E/P Arithmetic operation Instructions

Functions Floating point data multiplication and division operations (single precision)
Ex 32-bit floating point data multiplication
Floating point data in s1 is multiplied with floating point data in s2. The result is stored in d1.

1
32-bit floating point data, data type real number
EXP_0E1

Floating point data designated by s1, s2, and d1 have to range within:
0, ±2-126 ≤ (s1, s2, d1) < ±2128

E/ 64-bit floating point data division


Floating point data in s1 is divided by floating point data in s2. The result is stored in d1.

1
32-bit floating point data, data type real number
EXP_0E2
Floating point data designated by s1, s2, and d1 have to range within:
0, ±2-126 ≤ (s1, s2, d1) < ±2128

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the operation is not zero and not within
the following range:
±2-126 ≤ (Contents of designated device or operation result) < ±2128
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU) (Error code 4100)
● The value of the specified device is –0.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU) (Error code 4100)
NOTE: There are CPU modules that will not result in an operation error if –0 is specified.
Refer to page 3-17 for details.
● Division by 0 (Error code 4100)
● The result of multiplication and division exceeds the following range (overflow occurs):
(For the Universal model QCPU, LCPU)
–2128 ≤ (Result of multiplication and division) ≤ 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ± ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

6 – 78
Arithmetic operation Instructions Ex, ExP, E/, E/P

Program ExP
Example 1
With leading edge from X20, the following program multiplies floating point data in D3 and D4
with floating point data in D10 and D11. The result is stored in R0 and R1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EMULTMB1, EMULTKB1, EMULTIB1, EXP_0B1

Program E/P
Example 2
The following program divides floating point data in D10 an D11 by floating point data in D20
and D21. The result is stored in D30 and D31.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EMULTMB2, EMULTKB2, EMULTIB2, EXP_0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 79


EDx, EDxP, ED/, ED/P Arithmetic operation Instructions

6.2.12 EDx, EDxP, ED/, ED/P

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn E
Bit Word Bit Word U\G U
s1 —   — — — —  —
s2 —   — — — —  —
d1 —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ULTME1, EMULTKE1, EMULTIE1E


M

GX Works2
ED*, ED/

s1 s2 d

E
M
U P s1 s2 d
L
T
G
E
1

Variables Set Data Meaning Data Type


Data that will be multiplied or divided, or first number of device storing data that
s1
will be multiplied or divided
s2 Data to multiply or divide by, or first number of device storing such data Real number
First number of device storing the operation results of multiplication or division
d1
operation

NOTE Within the IEC editors please use the IEC commands.

6 – 80
Arithmetic operation Instructions EDx, EDxP, ED/, ED/P

Functions Floating point data multiplication and division operations (double precision)
EDx 64-bit floating point data multiplication
Floating point data in s1 is multiplied with floating point data in s2. The result is stored in d1.

s1+3 s1+2 s1+1 s1 s2+3 s2+2 s2+1 s2 d1+3 d1+2 d1+1 d1


x
1 1 1

1
64-bit floating point data, data type real number
EXP_0E1
Floating point data designated by s1, s2, and d1 have to range within:
0, ±2-1022 ≤ (s1, s2, d1) < ±21024

ED/ 64-bit floating point data division


Floating point data in s1 is divided by floating point data in s2. The result is stored in d1.

s1+3 s1+2 s1+1 s1 s2+3 s2+2 s2+1 s2 d1+3 d1+2 d1+1 d1


/
1 1 1

1
64-bit floating point data, data type real number
EXP_0E2
Floating point data designated by s1, s2, and d1 have to range within:
0, ±2-1022 ≤ (s1, s2, d1) < ±21024

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the operation is not zero and not within
the following range:
±2-1022 ≤ (Contents of designated device or result of operation) < ±21024
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4140)
● The value of the designated device is –0.
(Error code 4140)
● Division by 0
(Error code 4100)
● The result of multiplication or division exceeds the following range. (The overflow occurs.)
(For the Universal model QCPU, LCPU)
–21024 ≤ (Result of multiplication or division) ≤ 21024
(Error code 4141)

Programming MELSEC System Q and L series 6 – 81


EDx, EDxP, ED/, ED/P Arithmetic operation Instructions

Program EDxP
Example 1
With leading edge from X20, the following program multiplies 64-bit floating point data in D3 to
D6 with 64-bit floating point data in D10 to D13. The result is stored in R0 to R3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D6 D5 D4 D3 D13 D12 D11 D10 R3 R2 R1 R0


36.7896 11.9278 438.8190

EMULTMB1, EMULTKB1, EMULTIB1, EXP_0B1

Program ED/P
Example 2
The following program divides 64-bit floating point data in D10 to D13 by 64-bit floating point
data in D20 to D23. The result is stored in D30 to D33.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D13 D12 D11 D10 D23 D22 D21 D20 D33 D32 D31 D30
52171.39 9.73521 5359.041

EMULTMB2, EMULTKB2, EMULTIB2, EXP_0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 82
Arithmetic operation Instructions BK+, BK+P, BK-, BK-P

6.2.13 BK+, BK+P, BK-, BK-P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PLUME1, BKPLUKE1, BKPLUIE1B


K

GX Works2

BKPLUGE1

Variables Set Data Meaning Data Type


Data to be added to or subtracted from, or first number of device storing such
s1
data
Addition or subtraction data, or first number of device storing addition or
s2 BIN 16-bit
subtraction data
d First number of device storing results of operation
n Number of data blocks

Programming MELSEC System Q and L series 6 – 83


BK+, BK+P, BK-, BK-P Arithmetic operation Instructions

Functions BIN 16-bit data addition and subtraction operations


BK+ BIN 16-bit data block addition
An addition operation instruction for BIN 16-bit data block data consists of the instruction itself,
two designated devices s1 and s2 to be added, a device d to store the result, and the number
of data blocks to be added.
It adds the nth 16-bit block in s1 to the nth 16-bit block in s2, beginning with the first number of
device. The result of each block addition is stored in d.

BKP_0E1
The addition operation is conducted in 16-bit units.
The constant designated by s2 must be BIN 16-bit data ranging from -32768 to 32767.

BKP_0E2
The most significant bit of each block determines, whether data in s1, s2 or d are positive
(bit = 0) or negative (bit = 1).
If the least significant bit of a block is fallen below or the most significant bit of a block is
exceeded, the carry flag is not set.

6 – 84
Arithmetic operation Instructions BK+, BK+P, BK-, BK-P

BK- BIN 16-bit data block subtraction


A subtraction operation instruction for BIN 16-bit data block data consists of the instruction
itself, two designated devices s1 and s2 to be added, a device d to store the result, and the
number of data blocks to be subtracted.
It subtracts the nth 16-bit block in s2 from the nth 16-bit block in s1, beginning with the first
number of device. The result of each block addition is stored in d.

BKP_0E3
The subtraction operation is conducted in 16-bit units.
The constant designated by s2 must be BIN 16-bit data ranging from -32768 to 32767.

BKP_0E4
The most significant bit of each block determines, whether data in s1, s2 or d are positive
(bit = 0) or negative (bit = 1).
If the least significant bit of a block is fallen below or the most significant bit of a block is
exceeded, the carry flag is not set.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks in s1, s2 or d exceeds the relevant device range.
(Error code 4101)
● The device ranges of s1 and s2 overlap.
(Except when the same device is assigned to s1 and d)
(Error code: 4101)
● The device ranges of s2 and d overlap.
(Except when the same device is assigned to s2 and d)
(Error code: 4101)

Programming MELSEC System Q and L series 6 – 85


BK+, BK+P, BK-, BK-P Arithmetic operation Instructions

Program BK+P
Example 1
With leading edge from X20, the following program adds BIN block data beginning from D100
to BIN block data beginning from R0. The result of the operation is stored beginning from D200.
The number of blocks (4) added is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKPLUMB1, BKPLUKB1, BKPLUIB1, BKP_0B1

Program BK-P
Example 2
With leading edge from X1C, the following program subtracts a constant 8765 from BIN block
data beginning from D100. The result of the operation is stored beginning from R0. The number
of data blocks (3) subtracted is designated by a constant K3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKPLUMB2, BKPLUKB2, BKPLUIB2, BKP_0B2

6 – 86
Arithmetic operation Instructions DBK+, DBK+P, DBK-, DBK-P

6.2.14 DBK+, DBK+P, DBK-, DBK-P

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 
1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PLUME1, BKPLUKE1, BKPLUIE1B


K

GX Works2
BK+, BK-

s1 s2 d n

B
K
P P s2 s2 d n
L
U
G
E
1

Variables Set Data Meaning Data Type


Data to be added to or subtracted from, or first number of device storing such
s1
data
Addition or subtraction data, or first number of device storing addition or
s2 BIN 16-bit
subtraction data
d First number of device storing results of operation
n Number of data blocks

NOTE Within the IEC editors please use the IEC commands.

Programming MELSEC System Q and L series 6 – 87


DBK+, DBK+P, DBK-, DBK-P Arithmetic operation Instructions

Functions BIN 32-bit data block addition and subtraction operations


DBK+ BIN 32-bit data block addition
An addition operation instruction for BIN 32-bit data block data consists of the instruction itself,
two designated devices s1 and s2 to be added, a device d to store the result, and the number
of data blocks to be added.
It adds the nth 32-bit block in s1 to the nth 32-bit block in s2, beginning with the first number of
device. The result of each block addition is stored in d.

b31 b0 b31 b0 b31 b0


(s1)+1, s1 -30000 (BIN) (s2)+1, s2 50000 (BIN) d +1, d 20000 (BIN)
(s1)+3, (s1)+2 40000 (BIN) (s2)+3, (s2)+2 20000 (BIN) d +3, d +2 60000 (BIN)
(s1)+5, (s1)+4 -50000 (BIN) n + (s2)+5, (s2)+4 -10000 (BIN) n d +5, d +4 -60000 (BIN) n

(s1)+n 1, (s1)+n 2 60000 (BIN) (s2)+n 1, (s2)+n 2 -20000 (BIN) d +n 1, d +n 2 40000 (BIN)

BKP_0E1
The addition operation is conducted in 32-bit units.
The constant designated by s1 must be BIN 32-bit data ranging from -2147483648 to
2147483647.

b31 b0 b31 b0
(s1) +1, s1 -30000 (BIN) d +1, d 20000 (BIN)
(s1) +3, (s1) +2 40000 (BIN) b31 b0 d +3, d +2 90000 (BIN)
(s1) +5, (s1) +4 -50000 (BIN) n + (s2)+1, s2 50000 (BIN) d +5, d +4 0 (BIN) n

(s1) +n 1, (s1)+n 2 60000 (BIN) d +n 1, d +n 2 110000 (BIN)

BKP_0E2
If the value specified by n is 0, the instruction will be not processed.
The most significant bit of each block determines, whether data in s1, s2 or d are positive
(bit = 0) or negative (bit = 1).
If the least significant bit of a block is fallen below or the most significant bit of a block is
exceeded, the carry flag is not set.

6 – 88
Arithmetic operation Instructions DBK+, DBK+P, DBK-, DBK-P

DBK- BIN 32-bit data block subtraction


A subtraction operation instruction for BIN 32-bit data block data consists of the instruction
itself, two designated devices s1 and s2 to be subtracted, a device d to store the result, and
the number of data blocks to be subtracted.
It subtracts the nth 32-bit block in s2 from the nth 32-bit block in s1, beginning with the first
number of device. The result of each block addition is stored in d.

b31 b0 b31 b0 b31 b0


(s1)+1, S1 -55555 (BIN) (s2)+1, S2 44445 (BIN) d +1, d -1000000 (BIN)
(s1)+3, (s1)+2 33333 (BIN) (s2)+3, (s2)+2 3333 (BIN) d +3, d +2 30000 (BIN)
(s1)+5, (s1)+4 44444 (BIN) n (s2)+5, (s2)+4 -10000 (BIN) n d +5, d +4 54444 (BIN) n

(s1)+n 1, (s1)+n 2 13579 (BIN) (s2)+n 1, (s2)+n 2 12345 (BIN) d +n 1, d +n 2 1234 (BIN)

BKP_0E3
The subtraction operation is conducted in 32-bit units.
The constant designated by s2 must be BIN 32-bit data ranging from –2147483648 to
2147483647.

b31 b0 b31 b0
(s1) +1, s1 -99999 (BIN) d +1, d -109998 (BIN)
(s1) +3, (s1) +2 99999 (BIN) b31 b0 d +3, d +2 90000 (BIN)
(s1) +5, (s1) +4 -59999 (BIN) n (s2)+1, s2 9999 (BIN) d +5, d +4 69998 (BIN) n

(s1) +n 1, (s1)+n 2 79999 (BIN) d +n 1, d +n 2 70000 (BIN)

BKP_0E4
If the value specified by n is 0, the instruction will be not processed.
The most significant bit of each block determines, whether data in s1, s2 or d are positive
(bit = 0) or negative (bit = 1).
If the least significant bit of a block is fallen below or the most significant bit of a block is
exceeded, the carry flag is not set.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● A negative value is specified for n. (Error code 4100)
● The range of the n-point devices starting from the device specified by s1, s2, or d exceeds
the specified device range.
(Error code: 4101)
● The range of the n-point devices starting from the device specified by s1 overlaps with the
range of the n-point devices starting from the device specified by d.
(Except when s1 and d specify the same device.)
(Error code: 4101)
● The range of the n-point devices starting from the device specified by s2 overlaps with the
range of the n-point devices starting from the device specified by d.
(Except when s2 and d specify the same device.)
(Error code: 4101)

Programming MELSEC System Q and L series 6 – 89


DBK+, DBK+P, DBK-, DBK-P Arithmetic operation Instructions

Program DBK+P
Example 1
The following program adds the value data stored at R0 to R5 to the constant, and then stores
the operation result into D30 to D35, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b31 b0 b31 b0
R1,R0 600000 D31,D30 723456
R3,R2 -800000 + 123456 D33,D32 -676544
R5,R4 -123456 D35,D34 0

BKPLUMB1, BKPLUKB1, BKPLUIB1, BKP_0B1

Program DBK-P
Example 2
The following program subtracts the value data stored at D50 to D59 from the value data stored
at D100 to D109, and then stores the operation result into R100 to R109, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b31 b0 b31 b0 b31 b0


D101,D100 12345 D51,D50 11111 R101,R100 1234
D103,D102 54321 D53,D52 -11111 R103,R102 65432
D105,D104 -12345 D55,D54 22222 R105,R104 -34567
D107,D106 -54321 D57,D56 -22222 R107,R106 -32099
D109,D108 99999 D58,D58 33333 R109,R108 66666

BKPLUMB2, BKPLUKB2, BKPLUIB2, BKP_0B2

6 – 90
Arithmetic operation Instructions $+, $+P

6.2.15 $+, $+P

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —
s1 —   — — — —  —
s2 —   — — — —  —
d1 —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

LUSME1, SPLUSKE1, SPLUSIE1S


P

GX Works2

SPLUSGE1

Variables Set Data Meaning Data Type


s Data to be linked, or first number of device storing such data
d First number of device storing results of operation
s1 Data to be linked, or first number of device storing such data Character string
s2 Data to be linked, or first number of device storing such data
d1 First number of device storing results of operation

Programming MELSEC System Q and L series 6 – 91


$+, $+P Arithmetic operation Instructions

Functions Character string linking operations


$+ Character string linking
● Variation 1:
Character string data in s is appended to character data in d. The linked character string is
stored in d.
The linked character string begins with the character at the least significant byte in d and ends
with the code "00H" in s.

SSP_0E1
The code "00H" indicates the end of a character string. When two strings are linked, in the first
string this code is ignored and the "00H" of the second string marks the end of the linked string.

● Variation 2:
Character string data in s2 is appended to character string data in s1. The linked character
string is stored in d1.
The linked character string begins with the character at the least significant byte in s1 and ends
with the code "00H" in s2.

SSP_0E2
The code "00H" indicates the end of a character string. When two strings are linked, in the first
string this code is ignored and the "00H" of the second string marks the end of the linked string.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The linked character string cannot be stored.
(Error code 4100)
● The storage device numbers designated by s, d, s1, s2, and d1 overlap.
(Error code 4101)
● The character string of s, d, s1, s2, and d1 exceeds 16383 characters.
(Error code 4101)

6 – 92
Arithmetic operation Instructions $+, $+P

Program $+P
Example 1
With leading edge from X0, the following program links character string data in D10 through
D12 to the character string "ABCD". The linked character string is stored in D10 through D14.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
"00H" indicates the end of character strings and is stored automatically.
SPLUSMB1, SPLUSKB1, SPLUSIB1, SSP_0B1

Program $+
Example 2
While X0 is set (1), the following program links character string data in D10 through D12 to a
character string "ABCD". The linked character string is stored from D101 through D104.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

1
"00H" indicates the end of character strings and is stored automatically.
SPLUSMB2, SPLUSKB2, SPLUSIB2, SSP_0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 93


INC, INCP, DEC, DECP Arithmetic operation Instructions

6.2.16 INC, INCP, DEC, DECP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

I
N
C__ME1, INC__KE1, INC__IE1

GX Works2

INC_GE1

Variables Set Data Meaning Data Type


d First number of device conducted by INC (add 1) or DEC (subtract 1) operation. BIN 16-bit

6 – 94
Arithmetic operation Instructions INC, INCP, DEC, DECP

Functions BIN 16-bit increment and decrement operations


INC BIN 16-bit increment
Adds 1 to device designated by d (16-bit).

DEC_0E1
If the content of d is 32767, the result after incrementing is -32768.

DEC BIN 16-bit decrement


Subtracts 1 from device designated by d (16-bit).

DEC_0E2
If the content of d is 0, the result after decrementing is -1.
If the content of d is -32768, the result after decrementing is 32767.

Program INCP
Example 1
With leading edge from X8, the following program outputs the actual value of the counter (nom-
inal value = 9999) C0 through C20 (C0 plus Z1) at Y30 through Y3F as BCD data. Z1 is reset
(RST Z1), if Z1 is equal to 21 (LD = K21 Z1) or if the reset input X7 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

INC__MB1, INC__KB1, INC__IB1

Programming MELSEC System Q and L series 6 – 95


INC, INCP, DEC, DECP Arithmetic operation Instructions

Program DECP
Example 2
The following example shows a down counter program. With leading edge from X7, this pro-
gram stores a value 100 in D8. While M38 is not set, data in D8 is decremented by 1 with lead-
ing edge from X8. At D8 = 0, M38 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

INC__MB2, INC__KB2, INC__IB2

6 – 96
Arithmetic operation Instructions DINC, DINCP, DDEC, DDECP

6.2.17 DINC, DINCP, DDEC, DDECP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DINC_ME1, DINC_KE1, DINC_IE1

GX Works2

DINC_GE1

Variables Set Data Meaning Data Type


First number of device conducted by DINC (add 1) or DDEC (subtract 1)
d BIN 32-bit
operation.

Programming MELSEC System Q and L series 6 – 97


DINC, DINCP, DDEC, DDECP Arithmetic operation Instructions

Functions BIN 32-bit increment and decrement operations


DINC BIN 32-bit increment
Adds 1 to device designated by d (32-bit).

DDEC0E1
If the content of d is 2147483647, the result after incrementing is -2147483648.

DDEC BIN 32-bit decrement


Subtracts 1 from device designated by d (16-bit).

DDEC0E2
If the content of d is 0, the result after decrementing is -1.
If the content of d is -2147483647, the result after decrementing is 2147483647.

Program DINCP
Example 1
With leading edge from X0, the following program adds 1 to data in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DINC_MB1, DINC_KB1, DINC_IB1

Program DINCP
Example 2
With leading edge from X0, the following program adds 1 to data at X10 through X27. The
result is stored in D3 and D4.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DINC_MB2, DINC_KB2, DINC_IB2

6 – 98
Arithmetic operation Instructions DINC, DINCP, DDEC, DDECP

Program DDECP
Example 3
With leading edge from X0, the following program subtracts 1 from data in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DINC_MB3, DINC_KB3, DINC_IB3

Program DDECP
Example 4
With leading edge from X0, the following program subtracts 1 from data in X10 through X27.
The result is stored in D3 and D4.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DINC_MB4, DINC_KB4, DINC_IB4

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 99


DINC, DINCP, DDEC, DDECP Arithmetic operation Instructions

6 – 100
Data conversion instructions

6.3 Data conversion instructions


The instructions described in the following section convert different data types.
NOTE Within the IEC editors the IEC commands should be used.

MELSEC Instruction MELSEC Instruction


Conversion in in
MELSEC Editor IEC Editor
BCD BCD_M
BIN (16-/32-bit) BCDP BCDP_M

BCD (4-/8-digit) DBCD DBCD_M
DBCDP DBCDP_M
BIN BIN_M
BCD (4-/8-digit) BINP BINP_M

BIN (16-/32-bit) DBIN DBIN_M
DBINP DBINP_M
FLT FLT_M
BIN (16-/32-bit)
FLTP FLTP_M

Floating point data DFLT DFLT_M
(Single precision)
DFLTP DFLTP_M
FLTD
BIN (16-/32-bit)
FLTPD

Floating point data DFLTD
(Double precision)
DFLTPD
INT_MD
INT
INT_E_MD
INT_P_MD
Floating point data INTP
(Single precision INT_P_E_MD
⇓ DINT_MD
BIN (16-/32-bit) DINT
DINT_E_MD
DINT_P_MD
DINTP
DINT_P_E_MD
INTD
Floating point data
(Double precision) INTPD
⇓ DINTD
BIN (16-/32-bit)
DINTPD
BIN 16-bit DBL DBL_M

BIN 32-bit DBLP DBLP_M

BIN 32-bit WORD WORD_M



BIN 16-bit WORDP WORDP_M

GRY GRY_M
BIN (16-/32-bit) GRYP GRYP_M

GRAY CODE Data DGRY DGRY_M
DGRYP DGRYP_M
GBIN GBIN_M
GRAY CODE Data GBINP GBINP_M

BIN (16-/32-bit) DGBIN DGBIN_M
DGBINP DGBINP_M

Programming MELSEC System Q and L series 6 – 101


Data conversion instructions

MELSEC Instruction MELSEC Instruction


Conversion in in
MELSEC Editor IEC Editor
NEG NEG_M
Sign Reversal NEGP NEGP_M
BIN (16-/32-bit)
(Complement of 2) DNEG DNEG_M
DNEGP DNEGP_M
ENEG ENEG_M

Sign Reversal ENEGP ENEGP_M


Floating point data EDNEG
EDNEGP
BIN Block (16-bit) BKBCD BKBCD_M

BCD Block (4-digit) BKBCDP BKBCDP_M

BCD Block (4-digit) BKBIN BKBIN_M



BIN Block (16-bit) BKBINP BKBINP_M

Floating point data ECON


(Single precision)

Floating point data ECONP
(Double precision)
Floating point data EDCON
(Double precision)

Floating point data EDCONP
(Single precision)

6 – 102
Data conversion instructions BCD, BCDP, DBCD, DBCDP

6.3.1 BCD, BCDP, DBCD, DBCDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BCD__ME1, BCD__KE1, BCD__IE1

GX Works2

BCD__GE1

Variables Set Data Meaning Data Type


s BIN data, or first number of device storing BIN data. BIN 16-/32-bit
d First number of device storing BCD data. BCD 4-/8-digit

Programming MELSEC System Q and L series 6 – 103


BCD, BCDP, DBCD, DBCDP Data conversion instructions

Functions Conversion from BIN data into BCD data


BCD Conversion from BIN 16-bit data into BCD 4-digit data
BIN data in s (0 to 9999) is converted into BCD data. The result is stored in d.
The most significant two bits of BIN data in s must be reset (0) when converted into BCD 4-digit
data.

BCD_0E3

DBCD Conversion from BIN 32-bit data into BCD 8-digit data
BIN data in s (0 to 99999999) is converted into BCD data. The result is stored in d. The most
significant five bits of BIN data in s must be reset (0) when converted to BCD 8-digit data.

DBCD0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● BIN 16-bit data in s exceeds the relevant device range of 0 to 9999.
(Error code 4100)
● BIN 32-bit data in s+1 or s exceed the relevant device range of 0 to 99999999.
(Error code 4100)

6 – 104
Data conversion instructions BCD, BCDP, DBCD, DBCDP

Program BCDP
Example
The following program outputs the current value in C4 (5678) to Y20 through Y2F. The output
module displays the value on the display unit.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Output power supply
2 Output module
BCD__MB1, BCD__KB1, BCD__IB1, BCD_0B1

Programming MELSEC System Q and L series 6 – 105


BIN, BINP, DBIN, DBINP Data conversion instructions

6.3.2 BIN, BINP, DBIN, DBINP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BIN__ME1, BIN__KE1, BIN__IE1

GX Works2

BIN__GE1

Variables Set Data Meaning Data Type


s BCD data, or first number of device storing BCD data. BCD 4-/8-digit
d First number of device storing BIN data. BIN 16-/32-bit

6 – 106
Data conversion instructions BIN, BINP, DBIN, DBINP

Functions Conversion from BCD data into BIN data


BIN Conversion from BCD 4-digit data into BIN 16-bit data
BCD data in s (0 to 9999) is converted into BIN data. The result is stored in d.
The most significant two bits of BIN data in d must be reset (0) when converted from BCD
4-digit it data.

BIN_0E1

DBIN Conversion from BCD 8-digit data into BIN 32-bit data
BCD data in s (0 to 99999999) is converted to BIN data. The result is stored in d.
The most significant five bits of BIN data in d must be reset (0) when converting from BCD
8-digit data.

BIN_0E2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The individual digits in s do not range within 0 to 9. (Error code 4100)
This error can be suppressed by turning SM722 ON. However, the instruction is not executed
regardless of the status of SM722 if the specified value in s is out of range.
For the BINP/DBINP instruction, the next operation will not be performed until the command
(execution condition) is turned from OFF to ON regardless of the presence/absence of an
error.
BIN_AB1, BIN_AB2

Programming MELSEC System Q and L series 6 – 107


BIN, BINP, DBIN, DBINP Data conversion instructions

Program BINP
Example 1
The following program converts BCD data in X10 through X1B into BIN data. The result is
stored in D8.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Input power supply
2
Input module
3 Available inputs

BIN__MB1, BIN__KB1, BIN__IB1, BIN_0B1

6 – 108
Data conversion instructions BIN, BINP, DBIN, DBINP

Program DBINP
Example 2
With leading edge from X8, the following program converts BCD data at X10 through X37 into
BIN data. The result is stored in D0 through D1.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

1 Input power supply


2 Input module
BIN__MB2, BIN__KB2, BIN__IB2, BIN_0B2

NOTE BCD data at X10 through X37 exceeding the relevant device range of 2147483647 cannot be
processed by 32-bit devices! In this case the values in D0 and D1 become negative. For further
datails see section 3.4 "Programming of variables" in the Programming Manual.
This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 109


FLT, FLTP, DFLT, DFLTP Data conversion instructions

6.3.3 FLT, FLTP, DFLT, DFLTP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
1)
d —   —    — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FLT__ME1, FLT__KE1, FLT__IE1

GX Works2

FLT__GE1

Variables Set Data Meaning Data Type


s BIN data, or first number of device storing BIN data. BIN 16-/32-bit
d First number of device storing floating point data. Real number

6 – 110
Data conversion instructions FLT, FLTP, DFLT, DFLTP

Functions Conversion from BIN 16-bit/32-bit data into floating point data (Single precision)
FLT Conversion from BIN 16-bit data into floating point data
BIN 16-bit data in s is converted into 32-bit floating point data. The result is stored in d.

1 32-bit floating point data, data type real number


FLT_0E1

BIN 16-bit data designated by s has to range within -32768 and 32767.

DFLT Conversion from BIN 32-bit data into floating point data
BIN 32-bit data in s is converted into 32-bit floating point data. The result is stored in d.

1
32-bit floating point data, data type real number
FLT_0E2

BIN 32-bit data designated by s and s+1 have to range within -2147483648 and 2147483647.
Due to the fact that floating point data (data type real number) is processed by simple 32-bit
procedures, the number of significant bits is 24 for a binary display, or approx. 7 digits for a dec-
imal display.
The result of the conversion is rounded off at the 25th bit. All higher bits are eliminated. For this
reason, if the resulting integer exceeds a range of -16777216 to 16777215 (BIN 24-bit value),
errors may occur in the conversion.

1 Rounded off
2 Eliminated
FLT_0E3

Programming MELSEC System Q and L series 6 – 111


FLT, FLTP, DFLT, DFLTP Data conversion instructions

Program FLTP
Example 1
The following program converts BIN 16-bit data in D20 into 32-bit floating point data. The result
is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
BIN 16-bit data
2
32-bit floating point data, data type real number
FLT__MB1, FLT__KB1, FLT__IB1, FLT_0B1

Program DFLTP
Example 2
The following program converts BIN 32-bit data in D20 and D21 into 32-bit floating point data.
The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 BIN 32-bit data


2
32-bit floating point data, data type real number
3 Conversion error, because there are 7 significant digits

FLT__MB2, FLT__KB2, FLT__IB2, FLT_0B2

NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 112
Data conversion instructions FLTD, FLTPD, DFLTD, DFLTPD

6.3.4 FLTD, FLTPD, DFLTD, DFLTPD

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — —   —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FLT__ME1, FLT__KE1, FLT__IE1

GX Works2
FLTD/DFLTD

s d

F
L
T
_
G
E
1
P s d

Variables Set Data Meaning Data Type


s BIN data, or first number of device storing BIN data. BIN 16-/32-bit
d First number of device storing floating point data. Real number

Programming MELSEC System Q and L series 6 – 113


FLTD, FLTPD, DFLTD, DFLTPD Data conversion instructions

Functions Conversion from BIN 16-bit/32-bit data into floating point data (Double precision)
FLTD Conversion from BIN 16-bit data into floating point data
BIN 16-bit data in s is converted into 64-bit floating point data. The result is stored in d.

s d+3 d+2 d+1 d


BIN 16-bit

1
64-bit floating point data, data type real number
BIN 16-bit data designated by s has to range within -32768 and 32767.

DFLTD Conversion from BIN 32-bit data into floating point data
BIN 32-bit data in s is converted into 64-bit floating point data. The result is stored in d.

s+1 s d+3 d+2 d+1 d

BIN 32-bit 1

1
64-bit floating point data, data type real number

FLT_0E2
FLT_0E3
Program FLTDP
Example 1
The following program converts BIN 16-bit data in D20 into 64-bit floating point data. The result
is stored in D0 to D3.

MELSEC Instruction List Ladder Diagram

D20 D3 D2 D1 D0
15923 15923

1
BIN 16-bit data
2
64-bit floating point data, data type real number
FLT__MB1, FLT__KB1, FLT__IB1, FLT_0B1

6 – 114
Data conversion instructions FLTD, FLTPD, DFLTD, DFLTPD

Program DFLTDP
Example 2
The following program converts BIN 32-bit data in D20 and D21 into 64-bit floating point data.
The result is stored in D0 to D3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D21 D20 D3 D2 D1 D0
16543521 16543521

1
BIN 32-bit data
2 64-bit floating point data, data type real number
FLT__MB2, FLT__KB2, FLT__IB2, FLT_0B2

NOTE These programs will not run without variable definition in the header of the program organiza-
tion unit (POU). They would cause compiler or checker error messages. For details see section
3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 115


INT, INTP, DINT, DINTP Data conversion instructions

6.3.5 INT, INTP, DINT, DINTP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d        — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

INT__ME1, INT__KE1, INT__IE1

GX Works2

INT__GE1

Variables Set Data Meaning Data Type


s Floating point data, or first number of device storing floating point data. Real number
d First number of device storing BIN data. BIN 16-/32-bit

6 – 116
Data conversion instructions INT, INTP, DINT, DINTP

Functions Conversion from floating point data into BIN 16-bit/32-bit data (Single precision)
INT Conversion from 32-bit floating point data into BIN 16-bit data
32-bit floating point data in s is converted into BIN 16-bit data. The result is stored in d.

1
32-bit floating point data, data type real number
INT_0E1
Floating point data in s and s+1 have to range within -32768 and 32767.
The converted integer value is stored as BIN 16-bit data.
The converted integer value is rounded off at the first digit after the decimal point.

DINT Conversion from 32-bit floating point data into BIN 32-bit data
32-bit floating point data in s is converted to BIN 32-bit data. The result is stored in d.

1 32-bit floating point data, data type real number


INT_0E2
Floating point data in s and s+1 have to range within -2147483648 and 2147483647.
The converted integer value is stored as BIN 32-bit data.
The converted integer value is rounded off at the first digit after the decimal point.

Programming MELSEC System Q and L series 6 – 117


INT, INTP, DINT, DINTP Data conversion instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the addition are not zero and not within
the following range:
2-126 ≤ (Contents of designated device) < 2128
(For the Universal model QCPU, LCPU) (Error code 4140)
● The value of the specified device is –0, unnormalized number, nonnumeric, and ∞.
(For the Universal model QCPU, LCPU) (Error code 4140)
● Performing an INT instruction, floating point data designated by s exceeds the relevant
device range of -32768 to 32767.
● Performing a DINT instruction, floating point data designated by s exceeds the relevant
device range of -2147483648 to 2147483647.

Program INTP
Example 1
The following program converts 32-bit floating point data in D20 and D21 into BIN 16-bit data.
The result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
32-bit floating point data, data type real number
2 BIN 16-bit data
3
No result. Value exceeds relevant device range of INT instruction. Error code is returned.

6 – 118
Data conversion instructions INT, INTP, DINT, DINTP

INT__MB1, INT__KB1, INT__IB1, INT_0B1


Program DINTP
Example 2
The following program converts 32-bit floating point data in D20 and D21 into BIN 32-bit data.
The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
32-bit floating point data, data type real number
2
BIN 32-bit data
3 No result. Value exceeds relevant device range of DINT instruction. Error code is returned.

INT__MB2, INT__KB2, INT__IB2, INT_0B2


NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 119


INTD, INTPD, DINTD, DINTPD Data conversion instructions

6.3.6 INTD, INTPD, DINTD, DINTPD

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — —  — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

INT__ME1, INT__KE1, INT__IE1

GX Works2
INTD/DINTD

s d

IN
T
_
G
E
1
P s d

Variables Set Data Meaning Data Type


s Floating point data, or first number of device storing floating point data. Real number
d First number of device storing BIN data. BIN 16-/32-bit

6 – 120
Data conversion instructions INTD, INTPD, DINTD, DINTPD

Functions Conversion from floating point data into BIN data (Double precision)
INTD Conversion from 64-bit floating point data into BIN 16-bit data
64-bit floating point data in s is converted into BIN 16-bit data. The result is stored in d.

s+3 s+2 s+1 s d


BIN 16-bit

1
64-bit floating point data, data type real number
INT_0E1
Floating point data in s+3, s+2, s+1 and s have to range within -32768 and 32767.
The converted integer value is stored as BIN 16-bit data.
The converted integer value is rounded off at the first digit after the decimal point.

DINTD Conversion from 64-bit floating point data into BIN 32-bit data
64-bit floating point data in s is converted to BIN 32-bit data. The result is stored in d.

s+3 s+2 s+1 s d+1 d

1 BIN 32-bit

1 64-bit floating point data, data type real number


INT_0E2
Floating point data in s+3, s+2, s+1 and s have to range within -2147483648 and 2147483647.
The converted integer value is stored as BIN 32-bit data.
The converted integer value is rounded off at the first digit after the decimal point.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the designated device is not zero and not within the following range:
2-1022 ≤ (Contents of designated device) < 21024
(Error code 4140)
● The value of the specified device is –0. (Error code 4140)
● Performing an INTD instruction, floating point data designated by s exceeds the relevant
device range of -32768 to 32767. (Error code 4100)
● Performing a DINTD instruction, floating point data designated by s exceeds the relevant
device range of -2147483648 to 2147483647. (Error code 4100)

Programming MELSEC System Q and L series 6 – 121


INTD, INTPD, DINTD, DINTPD Data conversion instructions

Program INTDP
Example 1
The following program converts 64-bit floating point data in D20 to D23 into BIN 16-bit data.
The result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D23 D22 D21 D20 D0


25915.6796 25916

1 2
D23 D22 D21 D20
33562.3211
1 3

1
64-bit floating point data, data type real number
2
BIN 16-bit data
3 No result. Value exceeds relevant device range of INTD instruction. Error code is returned.

INT__MB1, INT__KB1, INT__IB1, INT_0B1

Program DINTDP
Example 2
The following program converts 64-bit floating point data in D20 to D23 into BIN 32-bit data.
The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D23 D22 D21 D20 D1 D0


574968.321 574968
1 2
D23 D22 D21 D20
2147483649.22
1 3

1 64-bit floating point data, data type real number


2 BIN 32-bit data
3
No result. Value exceeds relevant device range of DINTD instruction. Error code is returned.

INT__MB2, INT__KB2, INT__IB2, INT_0B2


NOTE These programs will not run without variable definition in the header of the program organiza-
tion unit (POU). They would cause compiler or checker error messages. For details see section
3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 122
Data conversion instructions DBL, DBLP

6.3.7 DBL, DBLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DBL__ME1, DBL__KE1, DBL__IE1

GX Works2

DBL__GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be converted. BIN 16-bit
d First number of device storing converted data. BIN 32-bit

Programming MELSEC System Q and L series 6 – 123


DBL, DBLP Data conversion instructions

Functions Conversion from BIN 16-bit data into BIN 32-bit data
DBL Conversion from BIN 16-bit data into BIN 32-bit data
BIN 16-bit data in s is converted into BIN 32-bit data with sign. The result is stored in d.

DBL_0E1

Program DBLP
Example
With leading edge from X20, the following program converts BIN 16-bit data in D100 into BIN
32-bit data. The result ist stored in R0 and R1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DBL__MB1, DBL__KB1, DBL__IB1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 124
Data conversion instructions WORD, WORDP

6.3.8 WORD, WORDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WORD_ME1, WORD_KE1, WORD_IE1

GX Works2

WORD_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be converted. BIN 32-bit
d First number of device storing converted data. BIN 16-bit

Programming MELSEC System Q and L series 6 – 125


WORD, WORDP Data conversion instructions

Functions Conversion from BIN 32-bit data into BIN 16-bit data
WORD Conversion from BIN 32-bit data into BIN 16-bit data
BIN 32-bit data in s is converted into BIN 16-bit data. The result is stored in d.

WORD0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The BIN data designated by s and s+1 exceed the relevant device range of -32768 to 32767.
(Error code 4100)

Program WORDP
Example
With leading edge from X20, the following program converts BIN 32-bit data in D100 and D101
into BIN 16-bit data. The result is stored in R0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WORD_MB1, WORD_KB1, WORD_IB1, WORD0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 126
Data conversion instructions GRY, GRYP, DGRY, DGRYP

6.3.9 GRY, GRYP, DGRY, DGRYP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GRY__ME1, GRY__KE1, GRY__IE1

GX Works2

GRY__GE1

Variables Set Data Meaning Data Type


s BIN data, or first number of device storing BIN data. BIN 16-/32-bit
Gray code data
d First number of device storing converted Gray code data.
16-/32-bit

Programming MELSEC System Q and L series 6 – 127


GRY, GRYP, DGRY, DGRYP Data conversion instructions

Functions Conversion from BIN data into Gray code data


GRY Conversion from BIN 16-bit data into Gray code data
BIN 16-bit data in s is converted into Gray code data. The result is stored in d.

GRY_0E1

DGRY Conversion from BIN 32-bit data into Gray code data
BIN 32-bit data in s is converted into Gray code data. The result is stored in d.

GRY_0E2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Data in s is negative. (Error code 4100)

6 – 128
Data conversion instructions GRY, GRYP, DGRY, DGRYP

Program GRYP
Example 1
With leading edge from X10, the following program converts BIN 16-bit data in D100 into Gray
code data. The result is stored in D200.

MELSEC Instruction List Ladder Diagram IEC Instruction List

GRY__MB1, GRY__KB1, GRY__IB1

Program DGRYP
Example 2
With leading edge from X1C, the following program converts BIN 32-bit data in D10 and D11
into Gray code data. The result is stored in D100 and D101.

MELSEC Instruction List Ladder Diagram IEC Instruction List

GRY__MB2, GRY__KB2, GRY__IB2

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 129


GBIN, GBINP, DGBIN, DGBINP Data conversion instructions

6.3.10 GBIN, GBINP, DGBIN, DGBINP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GBIN_ME1, GBIN_KE1, GBIN_IE1

GX Works2

GBIN_GE1

Variables Set Data Meaning Data Type


s Gray code data, or first number of device storing Gray code data. Gray code data
16-/32-bit
d First number of device storing converted BIN data. BIN 16-/32-bit

6 – 130
Data conversion instructions GBIN, GBINP, DGBIN, DGBINP

Functions Conversion from Gray code data into BIN data


GBIN Conversion from Gray code data into BIN 16-bit data
Gray code data in s is converted into BIN 16-bit data. The result is stored in d.

GBIN0E1

DGBIN Conversion from Gray code data into BIN 32-bit data
Gray code data in s is converted into BIN 32-bit data. The result is stored in d.

GBIN0E2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Performing a GBIN instruction, data in s exceeds the relevant device range of 0 to 32767.
(Error code 4100)
● Performing a DGBIN instruction, data in s exceeds the relevant device range of 0 to
2147483647. (Error code 4100)

Programming MELSEC System Q and L series 6 – 131


GBIN, GBINP, DGBIN, DGBINP Data conversion instructions

Program GBINP
Example 1
With leading edge from X10, the following program converts Gray code data in D100 into BIN
16-bit data. The result is stored in D200.

MELSEC Instruction List Ladder Diagram IEC Instruction List

GBIN_MB1, GBIN_KB1, GBIN_IB1

Program DGBINP
Example 2
With leading edge from X1C, the following program converts Gray code data in D10 and D11
into BIN 32-bit data. The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

GBIN_MB2, GBIN_KB2, GBIN_IB2

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 132
Data conversion instructions NEG, NEGP, DNEG, DNEGP

6.3.11 NEG, NEGP, DNEG, DNEGP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

NEG__ME1, NEG__KE1, NEG__IE1

GX Works2

NEG__GE1

Variables Set Data Meaning Data Type


d First number of device storing data for the sign reversal. BIN 16-/32-bit

Programming MELSEC System Q and L series 6 – 133


NEG, NEGP, DNEG, DNEGP Data conversion instructions

Functions Complement of 2 of BIN 16- and 32-bit data (sign reversal)


NEG Negation of BIN 16-bit data
The NEG instruction (complement of 2) reverses the sign of BIN 16-bit data. BIN 16-bit data in
d is inverted first and then the value "1" is added. The result is stored in d.

1
Inversion with following addition
NEG_0E1

The function of this instruction is to change a negative sign into a positive one, or to change a
positive sign into a negative one.

DNEG Negation of BIN 32-bit data


The DNEG instruction (complement of 2) reverses the sign of BIN 32-bit data. BIN 32-bit data
in d is inverted first and then the value "1" is added. The result is stored in d.

1 Inversion with following addition


NEG_0E2

6 – 134
Data conversion instructions NEG, NEGP, DNEG, DNEGP

Program NEGP
Example
With leading edge from XA, the following program subtracts data in D10 from data in D20. M3
is set, if D10 is less than D20. If M3 is set, the result in D10 is the absolute value (complement
of 2) and becomes positive.

MELSEC Instruction List Ladder Diagram IEC Instruction List

NEG__MB1, NEG__KB1, NEG__IB1

Programming MELSEC System Q and L series 6 – 135


ENEG, ENEGP Data conversion instructions

6.3.12 ENEG, ENEGP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The serial number (upper five digits) is "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d —   —   1) — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ENEG_ME1, ENEG_KE1, ENEG_IE1

GX Works2

ENEG_GE1

Variables Set Data Meaning Data Type


d First number of device storing floating point data for the sign reversal. Real number

6 – 136
Data conversion instructions ENEG, ENEGP

Functions Sign reversal for floating point data (Single precision)


ENEG Negation of 32-bit floating point data
These instructions negate 32-bit floating point data in d. The result is stored in d.
The function of these instructions is to change a negative sign into a positive one, or a positive
sign into a negative one.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the addition are not zero and not within
the following range:
2-126 ≤ (Contents of designated device) < 2128
(For the Universal model QCPU, LCPU) (Error code 4140)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU) (Error code 4140)

Program ENEGP
Example
With leading edge from X20, the following program negates floating point data in D100 and
D101. The result is stored in D100 and D101.

MELSEC Instruction List Ladder Diagram IEC Instruction List

ENEG_MB1, ENEG_KB1, ENEG_IB1, ENEG0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 137


EDNEG, EDNEGP Data conversion instructions

6.3.13 EDNEG, EDNEGP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ENEG_ME1, ENEG_KE1, ENEG_IE1

GX Works2

EDNEG d
4
EDNEGP d
E
N
E
G
_
G
E
1

Variables Set Data Meaning Data Type


d First number of device storing floating point data for the sign reversal. Real number

6 – 138
Data conversion instructions EDNEG, EDNEGP

Functions Sign reversal for floating point data (Double precision)


EDNEG Negation of 64-bit floating point data
These instructions negate 64-bit floating point data in d. The result is stored in d.
The function of these instructions is to change a negative sign into a positive one, or a positive
sign into a negative one.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The contents of the designated device or the result of the addition are not zero and not within
the following range:
2-1022 ≤ (Contents of designated device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)

Program EDNEGP
Example
With leading edge from X20, the following program negates 64-bit floating point data in D0 to
D3. The result is stored in D0 to D3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D3 D2 D1 D0 D3 D2 D1 D0
1.2345

ENEG_MB1, ENEG_KB1, ENEG_IB1, ENEG0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 139


BKBCD, BKBCDP Data conversion instructions

6.3.14 BKBCD, BKBCDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBCDME1, BKBCDKE1, BKBCDIE1

GX Works2

BKBCDGE1

Variables Set Data Meaning Data Type


s First number of device storing BIN data to be converted. BIN 16-bit
d First number of device storing converted BCD data. BCD 4-digit
n Number of data blocks to be converted. BIN 16-bit

6 – 140
Data conversion instructions BKBCD, BKBCDP

Functions Conversion from BIN block data into BCD block data
BKBCD Conversion from BIN 16-bit block data into BCD 4-digit block data
This instruction converts each nth BIN 16-bit block in s into the nth BCD 4-digit block. Con-
verted data is stored in d.
BIN 16-bit block data in s has to range within 0 and 9999.
The most significant two bits of the BIN 16-bit data blocks in s must be reset (0).

BKBCD0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s and d. (Error code 4101)
● BIN block data in s exceeds the relevant device range of 0 to 9999.
(Error code 4100)
● The storage device numbers designated by s and d overlap.
(Error code 4101)
For details on index qualification refer to section 3.6 of this manual.

Programming MELSEC System Q and L series 6 – 141


BKBCD, BKBCDP Data conversion instructions

Program BKBCDP
Example
With leading edge from X20, the following program converts BIN 16-bit block data in D100 into
BCD 4-digit block data. Converted data is stored in D200. The number of data blocks (3) con-
verted is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBCDMB1, BKBCDKB1, BKBCDIB1, BKBCD0B1

6 – 142
Data conversion instructions BKBIN, BKBINP

6.3.15 BKBIN, BKBINP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBINME1, BKBINKE1, BKBINIE1

GX Works2

BKBINGE1

Variables Set Data Meaning Data Type


s First number of device storing BCD data to be converted. BCD 4-digit
d First number of device storing converted BIN data. BIN 16-bit
n Number of data blocks to be converted. BIN 16-bit

Programming MELSEC System Q and L series 6 – 143


BKBIN, BKBINP Data conversion instructions

Functions Conversion from BCD block data into BIN block data
BKBIN, BKBINP Conversion from BCD 4-digit block data into BIN 16-bit block data
This instruction converts each nth BCD 4-digit block in s into the nth BIN 16-bit block. Con-
verted data is stored in d.
BIN 16-bit block data in s has to range within 0 to 9999.

BKBIN0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s and d. (Error code 4101)
● BCD block data in s exceeds the relevant device range of 0 to 9999.
(Error code 4100)
● The storage device numbers designated by s and d overlap.
(Error code 4101)
For details on index qualification refer to section 3.6 of this manual.

6 – 144
Data conversion instructions BKBIN, BKBINP

Program BKBINP
Example
With leading edge from X20, the following program converts BCD 4-digit block data in D100
into BIN 16-bit block data. Converted data is stored in D200. The number of data blocks (3)
converted is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBINMB1, BKBINKB1, BKBINIB1, BKBIN0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 145


ECON, ECONP Data conversion instructions

6.3.16 ECON, ECONP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — —   —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBINME1, BKBINKE1, BKBINIE1

GX Works2

ECON s d

ECONP s d
B
K
B
IN
G
E
1

Variables Set Data Meaning Data Type


Conversion source data, or head number of the device where
s (Real number (single precision)
conversion source data is stored
d Head number of the device where the converted data is stored (Real number (double precision))

6 – 146
Data conversion instructions ECON, ECONP

Functions Conversion from Single precision to Double precision


ECON Conversion from 32-bit into 64-bit floating point real number
This instruction converts 32-bit floating-point real number specified for s into 64-bit floating-
point real number, and stores the conversion result to the device specified for d.

S +1 S d +3 d +2 d +1 d

1 2

BKBIN0E1
1 32-bit floating-point real number
2
64-bit floating-point real number

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the designated device is not zero and not within the following range:
2-126 ≤ (Value of designated device) < 2128
(Error code 4140)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(Error code 4140)

Program ECON
Example
With leading edge from X0, the following program converts 32-bit floating-point real number of
the devices D10 to D11, into 64-bit floating-point real number. Converted data is stored to the
devices D0 to D3.

Ladder Diagram

BKBINMB1, BKBINKB1, BKBINIB1, BKBIN0B1

Programming MELSEC System Q and L series 6 – 147


EDCON, EDCONP Data conversion instructions

6.3.17 EDCON, EDCONP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — —  — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKBINME1, BKBINKE1, BKBINIE1

GX Works2

EDCON s d

EDCONP s d
B
K
B
IN
G
E
1

Variables Set Data Meaning Data Type


Conversion source data, or head number of the device where
s Real number (double precision)
conversion source data is stored
d Head number of the device where the converted data is stored Real number (single precision))

6 – 148
Data conversion instructions EDCON, EDCONP

Functions Conversion from Double precision to Single precision


EDCON Conversion from 64-bit into 32-bit floating point real number
This instruction converts 64-bit floating-point real number specified for s into 32-bit floating-
point real number, and stores the conversion result to the device specified for d.

s+3 s+2 s+1 s d+1 d

1 2

BKBIN0E1
1
64-bit floating-point real number
2
32-bit floating-point real number

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the designated device is not zero and not within the following range:
2-1022 ≤ (Value of designated device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The conversion result is not within the following range:
–2128 ≤ (Conversion result) ≤ 2128
(Error code 4141)

Program EDCON
Example
With leading edge from X0, the following program converts 64-bit floating-point real number of
the devices D10 to D13, into 32-bit floating-point real number. Converted data is stored to the
devices D0 and D1.

Ladder Diagram

Programming MELSEC System Q and L series 6 – 149


EDCON, EDCONP Data transfer instructions

6.4 Data transfer instructions


These instructions transfer, invert, or exchange data. Refer to the following table for an over-
view of the instructions.

NOTE Transferred data remain stored until they are replaced. Therefore, data even remain stored if the
input condition of the transfer instruction is reset.

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
MOV MOV_M

BIN Data Transfer MOVP MOVP_M


(16-/32-bit) DMOV DMOV_M
DMOVP DMOVP_M
EMOV EMOV_M
Transfer of EMOVP EMOVP_M
Floating Point Data
(16-/32-bit) EDMOV EDMOV_M
EDMOVP EDMOVP_M

Transfer of $MOV STRING_MOV_M


Character String Data $MOVP STRING_MOVP_M
CML CML_M

Inverted BIN Data Transfer CMLP CMLP_M


(16-/32-bit) DCML DCML_M
DCMLP DCMLP_M
BMOV BMOV_M
Block Data Transfer
BMOVP BMOVP_M
FMOV FMOV_M
Block Transfer of FMOVP FMOVP_M
identical Data
(16-/32-bit) DFMOV DFMOV_M
DFMOVP DFMOVP_M
XCH XCH_M

BIN Data Exchange XCHP XCHP_M


(16-/32-bit) DXCH DXCH_M
DXCHP DXCHP_M

BIN Data Exchange BXCH BXCH_M


(16-bit blocks) BXCHP BXCHP_M

Byte Exchange SWAP SWAP_MD


(upper and lower byte) SWAPP SWAP_P_MD

NOTE Within the IEC editors please use the IEC commands.

6 – 150
Data transfer instructions MOV, MOVP, DMOV, DMOVP

6.4.1 MOV, MOVP, DMOV, DMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

MOV__ME1, MOV__KE1, MOV__IE1

GX Works2

MOV__GE1

Variables Set Data Meaning Data Type


s Source data, or first number of device storing data to be transferred.
BIN 16-/32-bit
d First number of destination device to store transferred data.

Programming MELSEC System Q and L series 6 – 151


MOV, MOVP, DMOV, DMOVP Data transfer instructions

Functions BIN 16-bit/32-bit data transfer


MOV BIN 16-bit data transfer
The MOV instruction transfers BIN 16-bit data in s to the device designated by d.

MOV_0E1

DMOV BIN 32-bit data transfer


The DMOV instruction transfers BIN 32-bit data in s to the device designated by d.

MOV_0E2

Program MOVP
Example 1
The following program transfers data at X0 through XB to D8.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MOV__MB1, MOV__KB1, MOV__IB1

Program MOVP
Example 2
With leading edge from X8, the following program transfers the constant 155 as BIN value to
D8.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MOV__MB2, MOV__KB2, MOV__IB2, MOV_0B1

6 – 152
Data transfer instructions MOV, MOVP, DMOV, DMOVP

Program DMOVP
Example 3
The following program transfers data in D0 and D1 to D7 and D8.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MOV__MB3, MOV__KB3, MOV__IB3

Program DMOVP
Example 4
The following program transfers data at X0 through X1F to D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MOV__MB4, MOV__KB4, MOV__IB4

NOTE The program examples 3 and 4 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

Programming MELSEC System Q and L series 6 – 153


EMOV, EMOVP Data transfer instructions

6.4.2 EMOV, EMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
1)
d —   —    — —
1
Available only in multiple Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EMOVME1, EMOVKE1, EMOVIE1

GX Works2

EMOVGE1

Variables Set Data Meaning Data Type


s Floating point data, or first number of device storing data to be transferred.
Real number
d First number of device storing transferred floating point data.

6 – 154
Data transfer instructions EMOV, EMOVP

Functions Floating point data transfer (Single precision)


EMOV 32-bit floating point data transfer
The EMOV instruction transfers 32-bit floating point data in s to the device designated by d.

1
32-bit floating point number, data type real number
EMOV0E1

Program EMOVP
Example 1
The following program transfers 32-bit floating point data in D10 and D11 to D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EMOVMB1, EMOVKB1, EMOVIB1, EMOV0B1

Program EMOVP
Example 2
With leading edge from X8, the following program transfers the real number –1.23 to D10 and
D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EMOVMB2, EMOVKB2, EMOVIB2, EMOV0B2


NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 155


EDMOV, EDMOVP Data transfer instructions

6.4.3 EDMOV, EDMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EMOVME1, EMOVKE1, EMOVIE1

GX Works2
MOV/DMOV.

s d

E
M
O
V
G
E
1
P s d

Variables Set Data Meaning Data Type


s Floating point data, or first number of device storing data to be transferred.
Real number
d First number of device storing transferred floating point data.

6 – 156
Data transfer instructions EDMOV, EDMOVP

Functions Floating point data transfer (Double precision)


EDMOV 64-bit floating point data transfer
The EDMOV instruction transfers 64-bit floating point data in s to the device designated by d.

s+3 s+2 s+1 s d+3 d+2 d+1 d


4.23542 4.23542
1 1

1
64-bit floating point number, data type real number
EMOV0E1

Program EDMOVP
Example 1
The following program transfers 64-bit floating point data in D10 to D13 to D0 to D3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D13 D12 D11 D10 D3 D2 D1 D0


36.475 36.475

EMOVMB1, EMOVKB1, EMOVIB1, EMOV0B1

Program EDMOVP
Example 2
With leading edge from X8, the following program transfers the real number –1.23 to D10 to
D13.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D13 D12 D11 D10

EMOVMB2, EMOVKB2, EMOVIB2, EMOV0B2

NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 157


$MOV, $MOVP Data transfer instructions

6.4.4 $MOV, $MOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SMOV_ME1, SMOV_KE1, SMOV_IE1

GX Works2

SMOV_ME1

Variables Set Data Meaning Data Type


s Character string data, or first number of device storing data to be transferred.
Character string
d First number of device storing transferred character string data.

6 – 158
Data transfer instructions $MOV, $MOVP

Functions Character string data transfer


$MOV Character string data transfer
The $MOV instruction transfers character string data in s to d. The instruction transfers char-
acter string data from the first number of device designated by s up to the number of device
storing the code "00H" (end of string) in one operation.

1
Indicates end of character string
2
1st character
3
nth character
SMOV0E1
The $MOV instruction is even performed without error messages, if the range of devices stor-
ing character string data to be transferred (s through s+n) overlaps with the range of devices
storing transferred data (d through d+n). The $MOV instruction performs as follows, if character
string data in D10 through D13 is transferred to D11 through D14:

SMOV0E2
If the code "00H" is stored at lower bytes of s+n, the characters following at the higher bytes are
omitted. In d+n, the transferred code "00H" will be stored at both, the higher bytes and the lower
bytes:

1 Character is not transferred.


2
"00H" is stored automatically.
SMOV0E3

Programming MELSEC System Q and L series 6 – 159


$MOV, $MOVP Data transfer instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The code "00H" does not exist in character string data designated by s. (Error code 4101)
● Character string data in s cannot be transferred completely to d. (Error code 4101)
● The character string of s exceeds 16383 characters. (Error code 4101)

Program With leading edge from X0, the following program transfers character string data at D10
Example through D12 to D20 through D22.

Ladder Diagram
MELSEC Instruction List

IEC Instruction List

SMOV_MB1, SMOV_KB1, SMOV_IB1, SMOV0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 160
Data transfer instructions CML, CMLP, DCML, DCMLP

6.4.5 CML, CMLP, DCML, DCMLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

CML__ME1, CML__KE1, CML__IE1


GX Works2

Variables Set Data Meaning Data Type


s BIN data, or first number of device storing data to be inverted.
BIN 16-/32-bit
d First number of device storing inverted data.

Programming MELSEC System Q and L series 6 – 161


CML, CMLP, DCML, DCMLP Data transfer instructions

Functions BIN 16-bit/32-bit data inversion


CML BIN 16-bit data inversion
BIN 16-bit data in s is inverted bit by bit. The result is stored in d.

DCML BIN 32-bit data inversion


BIN 32-bit data in s is inverted bit by bit. The result is stored in d.

Program CML
Example 1
While SM402 is set, the following program transfers data at X0 through X7 inverted to D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Undesignated bits are read as 0.
CML__MB1, CML__KB1, CML__IB1, CML_0B1
In this example the number of bits in s is smaller than the number of bits in d.

6 – 162
Data transfer instructions CML, CMLP, DCML, DCMLP

Program CML
Example 2
While SM402 is set, the following program transfers data in M16 through M23 inverted to K3
Y40 (Y40 through Y4F). Y48 through Y4B are all set (1), because they were read as 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Undesignated bits are read as 0.
In this example the number of bits in s is smaller than the number of bits in d.

Program CMLP
Example 3
With leading edge from X3, the following program transfers data in D0 inverted to D16.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CML__MB3, CML__KB3, CML__IB3, CML_0B3

Programming MELSEC System Q and L series 6 – 163


CML, CMLP, DCML, DCMLP Data transfer instructions

Program DCML
Example 4
While SM402 is set, the following program transfers data at X0 through X1F inverted to D0 and
D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Undesignated bits are read as 0.
CML__MB4, CML__KB4, CML__IB4, CML_0B4
In this example the number of bits in s is smaller than the number of bits in d.

Program DCML
Example 5
While SM402 is set, the following program transfers data in M16 through M35 inverted to Y40
and Y57.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 Undesignated bits are read as 0.

In this example the number of bits in s is smaller than the number of bits in d.
CML__MB5, CML__KB5, CML__IB5, CML_0E4

6 – 164
Data transfer instructions CML, CMLP, DCML, DCMLP

Program DCMLP
Example 6
With leading edge from X3, the following program transfers data in D0 and D1 inverted to D16
and D17.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CML__MB6, CML__KB6, CML__IB6, CML_0B6

NOTE The program examples 4 and 6 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

Programming MELSEC System Q and L series 6 – 165


BMOV, BMOVP Data transfer instructions

6.4.6 BMOV, BMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s       — — —
d       — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BMOV_ME1, BMOV_KE1, BMOV_IE1

GX Works2

BMOV_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be transferred.
d First number of device storing transferred data. BIN 16-bit
n Number of data blocks to be transferred.

6 – 166
Data transfer instructions BMOV, BMOVP

Functions BIN block data transfer


BMOV BIN 16-bit block data transfer
The BMOV instruction transfers successive data blocks in a batch. The first number of device
storing block data is designated by s. The number of successive data blocks to be transferred
is determined by n. The data are transferred to the device designated by d onwards.

V0E1B
M
O
A transfer can even be performed without operation errors, if the source and the destination
devices overlap. Transfer to the smaller device number begins from s. Transfer to the larger
device number begins from s+(n-1).
However, as shown in the example below, when transferring data from R to ZR, or from ZR to
R, the range to be transferred (source) and the range of destination must not overlap. Transfer
from R to R, or from ZR to ZR can be performed without any problem.
– ZR transfer range
(specified head No. of ZR) to
(specified head No. of ZR + the number of transfers -1)
– R transfer range
((specified head No. of R + file register block No. 32768) to
(specified head No. of R + file register block No. 32768 + the number of transfers -1))

Example Transfer ranges of ZR and R overlap when transferring 10000 blocks of data from ZR30000
to R10 (block no. 1 of destination).
Die Übertragungsbereiche von ZR und R überlappen sich, wenn 10000 Datenblöcke von
ZR30000 nach R10 (Block-Nr. 1 des Datenziels) übertragen werden.
– ZR transfer range: (30000) to (30000 + 10000 -1) = (30000) to (39999)
– R transfer range: (10 + (1 x 32768)) to (10 + (1 x 32768) + 10000 -1)
= (32778) to (42777)
Therefore the range 32778 to 39999 overlaps and the data is not transferred correctly.

Source Destination
ZR0 R0

Overlapped Block No. 0

ZR30000 R32767
ZR39999 R10
R10009 Block No. 1

Programming MELSEC System Q and L series 6 – 167


BMOV, BMOVP Data transfer instructions

If s is a word device and d is a bit device, the number of bits designated by digit designation for
the bit device will be the object bits for the word device. If K1Y30 is designated by d, the object
bits for the word device s are the lower 4 bits.

V0E2B
M
O
If s and d are bit devices, the number of bits in s and d must equal.
When using a link direct device and an intelligent function module device for s and d, only either
of s or d can be used.
Whether to check a device range during execution of the BMOV instruction can be selected
with the device range check inhibit flag (SM237) (only when the conditions for subset process-
ing are established). While SM237 is ON, whether s to s + (n) -1 and d to d + (n) - 1 are within
the device range or not are not checked.

NOTES SM237 can be used only for the Universal model QCPU whose first 5 digits of serial number is
10012 or higher and for LCPU.
While SM237 is on, do not make the following access.
– The indexing target exceeds the device range.
– The value obtained from "d to d+(n)- 1" is over the boundaries of the device ranges.
– Accessing the file register with file register not set.
– Accessing the area where the multiple CPU high speed transmission area device is not avail-
able (only for the QCPU).

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s and d.
(Error code 4101)

6 – 168
Data transfer instructions BMOV, BMOVP

Program BMOVP
Example 1
With leading edge from SM402, the following program transfers the lower 4 bits of data (b0
through b3) in D66 through D69 to the outputs Y30 through Y3F. The number of blocks (4) to
be transferred is determined by the constant K4.
The bit patterns show the structure of bits before and after the transfer.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are ignored.
BMOV_MB1, BMOV_KB1, BMOV_IB1, BMOV0B1

Program BMOVP
Example 2
With leading edge from SM402, the following program transfers data at X20 through X2F to
D100 through 103. The number of blocks (4) to be transferred is determined by the constant
K4.
The bit patterns show the structure of bits before and after the transfer.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BMOV_MB2, BMOV_KB2, BMOV_IB2, BMOV0B2

Programming MELSEC System Q and L series 6 – 169


FMOV, FMOVP Data transfer instructions

6.4.7 FMOV, FMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d       — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FMOV_ME1, FMOV_KE1, FMOV_IE1

GX Works2

FMOV_ME1

Variables Set Data Meaning Data Type


s First number of device storing data to be transferred.
d First number of device storing transferred data. BIN 16-bit
n Number of data blocks to be transferred.

6 – 170
Data transfer instructions FMOV, FMOVP

Functions Identical BIN block data transfer


FMOV Identical BIN 16-bit block data transfer
The FMOV instruction transfers 16-bit block data in s to d through d+(n-1). Each device of the
data block from d through d+(n-1) stores the value from s.

FMOV0E1
If s is a word device and d is a bit device, the number of bits designated by digit designation for
the bit device will be the object bits for the word device.

1
These bits are ignored.
FMOV0E2
If s and d are bit devices, the number of bits in s and d must equal.
Whether to check a device range during execution of the FMOV instruction can be selected
with the device range check inhibit flag (SM237) (only when the conditions for subset process-
ing are established). While SM237 is ON, whether d to d + (n) - 1 is within the device range or
not is not checked.
NOTES SM237 can be used only for the Universal model QCPU whose first 5 digits of serial number is
10012 or higher and for LCPU.
While SM237 is on, do not make the following access.
– The indexing target exceeds the device range.
– The value obtained from "d to d+(n–1)" is over the boundaries of the device ranges.
– Accessing the file register with file register not set.
– Accessing the area where the multiple CPU high speed transmission area device is not avail-
able (only for the QCPU).

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by d. (Error code 4101)

Programming MELSEC System Q and L series 6 – 171


FMOV, FMOVP Data transfer instructions

Program FMOVP
Example 1
With leading edge from XA, the following program transfers the lower 4 bits of data (b0 through
b3) in D0 to the outputs Y10 through Y23. The number of blocks (5) is determined by the con-
stant K5.
The bit patterns show the structure of bits before and after the transfer.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are ignored.
FMOV_MB1, FMOV_KB1, FMOV_IB1, FMOV0B3

Program FMOVP
Example 2
With leading edge from XA, the following program transfers data at X20 through X23 to D100
through D103. The number of blocks (4) to be transferred is determined by the constant K4.
The bit patterns show the structure of bits before and after the transfer.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are ignored.

6 – 172
Data transfer instructions DFMOV, DFMOVP

6.4.8 DFMOV, DFMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s         —
d       — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FMOV_ME1, FMOV_KE1, FMOV_IE1

GX Works2

DFMOV s d n

DFMOVP s d n
F
M
O
V
_
M
E
1

Variables Set Data Meaning Data Type


s First number of device storing data to be transferred.
d First number of device storing transferred data. BIN 32-bit
n Number of data blocks to be transferred.

Programming MELSEC System Q and L series 6 – 173


DFMOV, DFMOVP Data transfer instructions

Functions Identical BIN 32-bit block data transfer


DFMOV Identical BIN 32-bit block data transfer
The DFMOV instruction transfers 32-bit data in s to d through d+(n-2). Each device of the data
block from d through d+(n-2) stores the value from s.

b31 b0
Transfer 1234567H
b31 b0 d+1 , d
s+1, s 1234567H d+3 , d+2 1234567H
d+5 , d+4 1234567H n

d+n–1 , d+n–2 1234567H

FMOV0E1
If s is a word device and d is a bit device, the number of bits designated by digit designation for
the bit device will be the object bits for the word device.
If K5Y0 is specified by s, the lower 20 bits (five digits) of the word device specified by s will be
the object.

Y1F Y14 Y13 Y0


s+1, s

Ignored 20 bits (five digits) data


b31 b20 b19 b0
0 d+1, d

0 d+3 d+2

Transfer b31 b20 b19 b0


0 d+(2n–1), d+(2n–2)

Filled with 0s 20 bits (five digits) data

FMOV0E2
If d specifies data of a device with digit specification, the amount of data stored in the device
specified by d will be transferred.
If K5Y0 is specified by d, the lower 20 bits of the word device specified by s will be the object.
If both s and d specify data of a device with digit specification, the amount of data specified by
d will be transferred regardless of the number of digits.

b31 b20 b19 b0


s+1, s 3
Amount of data specified digits by d

Transfer 4
d+n d+1 d

Y14n+19 Y14n Y27 Y14 Y13 Y0


4

If the value specified by n is 0, the instruction will be not processed.


Whether to check a device range during the execution of the DFMOV instruction can be
selected with the device range check inhibit flag (SM237). (Only when the conditions of the
subset processing are established).

6 – 174
Data transfer instructions DFMOV, DFMOVP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified by n is negative.
(Error code 4100)
● The number of data blocks determined by n exceeds the storage device numbers designated
by d.
(Error code 4101)

Program DFMOVP
Example
With leading edge from M0, the following program transfers the value of data (Y0 to Y13 (20
bits) into D10 to D17.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Y1F Y14 Y13 Y0


1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Ignored 20 bits (five digits) data

b31 b20 b19 b0


0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D11,D1

Transfer 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D13,D1

0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D15,D1

0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 D17,D1

Filled with 0s 20 bits (five digits) data

FMOV_MB1, FMOV_KB1, FMOV_IB1, FMOV0B3

FMOV_MB2, FMOV_KB2, FMOV_IB2, FMOV0B2

Programming MELSEC System Q and L series 6 – 175


XCH, XCHP, DXCH, DXCHP Data transfer instructions

6.4.9 XCH, XCHP, DXCH, DXCHP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d1        — —
d2        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

XCH__ME1, XCH__KE1, XCH__IE1

GX Works2

XCH__GE1

Variables Set Data Meaning Data Type


d1
First number of device storing data to be exchanged. BIN 16-/32-bit
d2

6 – 176
Data transfer instructions XCH, XCHP, DXCH, DXCHP

Functions BIN data exchange


XCH BIN 16-bit data exchange
The XCH instruction exchanges BIN 16-bit data in d1 and BIN 16-bit data in d2.

XCH_0E1

DXCH BIN 32-bit data exchange


The DXCH instruction exchanges BIN 32-bit data in (d1)+1, d1 and BIN 32-bit data in(d2)+1,
d2.

XCH_0E2

Program XCHP
Example 1
With leading edge from X8, the following program exchanges data in D0 and the actual value
in T0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

XCH__MB1, XCH__KB1, XCH__IB1

Programming MELSEC System Q and L series 6 – 177


XCH, XCHP, DXCH, DXCHP Data transfer instructions

Program XCHP
Example 2
With leading edge from X10, the following program exchanges data in D0 and data in M16
through M31.

MELSEC Instruction List Ladder Diagram IEC Instruction List

XCH__MB2, XCH__KB2, XCH__IB2

Program DXCHP
Example 3
With leading edge from X10, the following program exchanges data in D0 and D1 and data in
M16 through M47.

MELSEC Instruction List Ladder Diagram IEC Instruction List

XCH__MB3, XCH__KB3, XCH__IB3

Program DXCHP
Example 4
With leading edge from M0, the following program exchanges data in D0 and D1 and data in
D9 and D10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

XCH__MB4, XCH__KB4, XCH__IB4

NOTE The program examples 3 and 4 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

6 – 178
Data transfer instructions BXCH, BXCHP

6.4.10 BXCH, BXCHP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d1 —   — — — — — —
d2 —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BXCH_ME1, BXCH_KE1, BXCH_IE1

GX Works2

BXCH_GE1

Variables Set Data Meaning Data Type


d1
First number of device storing data to be exchanged
d2 BIN 16-bit
n Number of exchanges

Programming MELSEC System Q and L series 6 – 179


BXCH, BXCHP Data transfer instructions

Functions BIN block data exchange


BXCH BIN 16-bit block data exchange
The BXCH instruction exchanges BIN 16-bit block data in d1 and BIN 16-bit block data in d2.

BXCH0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by d1 and d2. (Error code 4101)
● The storage device numbers designated by d1and d2 overlap. (Error code 4101)

6 – 180
Data transfer instructions BXCH, BXCHP

Program BXCHP
Example
With leading edge from X1C, the following program exchanges data blocks beginning from
D200 and data blocks beginning from R0. The number of blocks (3) to be exchanged is deter-
mined by the constant K3.
The bit patterns show the structure of bits before and after the transfer.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BXCH_MB1, BXCH_KB1, BXCH_IB1, BXCH0B1

Programming MELSEC System Q and L series 6 – 181


SWAP, SWAPP Data transfer instructions

6.4.11 SWAP, SWAPP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SWAP_ME1, SWAP_KE1, SWAP_IE1

GX Works2

BXCH_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be swapped. BIN 16-bit

6 – 182
Data transfer instructions SWAP, SWAPP

Functions Upper and lower byte exchanges


SWAP Upper and lower byte exchanges
The swap instruction exchanges the upper and lower 8 bits (upper and lower byte) of BIN 16-bit
data in s.

SWAP0E1

Program SWAPP
Example
With leading edge from X10, the following program exchanges the upper and lower 8 bits in
R10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

SWAP_MB1, SWAP_KB1, SWAP_IB1, SWAP0B1

Programming MELSEC System Q and L series 6 – 183


SWAP, SWAPP Data transfer instructions

6 – 184
Program branch instructions

6.5 Program branch instructions


Program branch instructions include a jump destination.

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
Conditional Jump CJ CJ_M
Conditional Jump
from next Scan SCJ SCJ_M

Jump JMP JMP_M


Jump to End of Program GOEND GOEND_M

A jump destination is designated by a pointer P (GX Works2) or a label (GX IEC Developer).
For details on programming a label in GX IEC Developer see the Programming Manual for the
GX IEC Developer.

GX IEC Developer

CJ___IB3, CJ___IB1

GX Works2

CJ___GB1

Programming MELSEC System Q and L series 6 – 185


CJ, SCJ, JMP Program branch instructions

6.5.1 CJ, SCJ, JMP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G P
p — — — — — — — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

J___ME1, CJ___KE1, CJ___IE1C

GX Works2

CJ___GE1

Variables Set Data Meaning Data Type


p Jump destination Pointer/Label

6 – 186
Program branch instructions CJ, SCJ, JMP

Functions Jump instructions


A jump instruction consists of a jump command CJ, SCJ, or JMP (Conditional Jump, JuMP)
and a pointer (or label) P, designating the jump destination.
The pointer (label) number has to range within P(Label)0 and P(Label)4095. A jump destina-
tion P(Label)xx can be freely placed in a program.

CJ Conditional jump
Executes the program specified by the pointer number within the same program file, when the
execution command is ON.
When the execution command is OFF, the program at the next step is executed.

1
Input condition
2
CJ instruction
3 Executed each scan

CJ__0E1

SCJ Conditional jump from next program scan


Executes the program specified by the pointer number within the same program file starting
with the scan immediately after turning from OFF to ON of the execution command.
When the execution command is OFF or turned from ON to OFF, the program at the next step
is executed.

1
Input condition
2 SCJ instruction
3 One scan

4
Executed each scan
CJ__0E2

JMP Jump instruction


The jump instruction executes the part of a program designated by the jump destination within
the same program file without any input condition (unconditional jump).

Programming MELSEC System Q and L series 6 – 187


CJ, SCJ, JMP Program branch instructions

NOTE If a set timer is skipped by a CJ, SCJ, or JMC instruction it will nevertheless keep its timing
accurately.
If an OUT instruction is skipped by a jump instruction, the condition of the output remains un-
changed.
Executing a jump instruction shortens the scan time of a program in relation to the skipped pro-
gram steps (see tables in appendices).
The CJ, SCJ, and JMP instruction can even jump back to a lower jump destination. However, a
program must exit the program loop before the watchdog timer times out (the following program
example exits the loop, when X7 is set).

CJ___AB1
The condition of a device skipped by a jump instruction remains unchanged. This is illustrated
by the following program example:

CJ___AB2
After XB is set, this program jumps to the jump destination Label19. The conditions of the out-
puts Y43 and Y49 even remain unchanged, if XC or XD are set or reset.
The jump destination (e.g. Label9) occupies one program step.

CJ___AB3
The CJ, SCJ, or JMP instruction only jumps to destinations within one single program.
If a jump destination is located within the skip range during a skip operation (operation skipping
parts of a program), program execution proceeds from the first available address following the
jump destination.

6 – 188
Program branch instructions CJ, SCJ, JMP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● A common pointer has been designated. (Error code 4210)
● The jump destination of the jump instruction is not defined in a program (jump destination
or pointer is missing). (Error code 4210)
● The jump destination is located after an END instruction.
(Error code 4210)

Program CJ
Example 1
The following program jumps to the destination Label_3 when X9 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CJ___MB1, CJ___KB1, CJ___IB1

Program SCJ
Example 2
The following program jumps to the destination Label_3 from the next scan when XC is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CJ___MB2, CJ___KB2, CJ___IB2

Programming MELSEC System Q and L series 6 – 189


GOEND Program branch instructions

6.5.2 GOEND

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

G
OENDME1, GOENDKE1, GOENDIE1

GX Works2

GOENDGE1

Variables Set Data Meaning Data Type


— — —

6 – 190
Program branch instructions GOEND

Functions GOEND Jump to the end of a program


The jump destination of the GOEND instruction is the FEND or END instruction of the program.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● A GOEND instruction was executed after a CALL or ECALL instruction and before a RET
instruction. (Error code 4211)
● A GOEND instruction was executed after a FOR instruction and before a NEXT instruction.
(Error code 4200)
● A GOEND instruction was executed during an interrupt program but before an IRET
instruction. (Error code 4221)
● A GOEND instruction was executed between a CHKCIR and a CHKEND instruction.
(Error code 4230)
● A GOEND instruction was executed between an IX and an IXEND instruction.
(Error code 4231)

Program GOEND
Example
The following program jumps to the END instruction when data in D0 is negative.

MELSEC Instruction List Ladder Diagram IEC Instruction List

GOENDMB1, GOENDKB1, GOENDIB1

Programming MELSEC System Q and L series 6 – 191


Program execution control instructions

6.6 Program execution control instructions

Program execution control instructions invoke interrupt routines. The interrupts can be enabled
or disabled individually or via bit patterns.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
Interrupt disabled DI DI_M
Interrupt enabled EI EI_M
Bit pattern of execution conditions of
IMASK IMASK_M
interrupt programs
End of interrupt program IRET IRET_M

6 – 192
Program execution control instructions DI, EI, IMASK

6.6.1 DI, EI, IMASK

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s — 1) 1) — 1) 1) — — —
— — — — — — — — — —
1 IMASK instruction only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DI__ME1, DI__KE1, DI__IE1

GX Works2

DI___GE1

Variables Set Data Meaning Data Type

s Bit pattern storing execution conditions of interrupts or first number of device BIN 16-bit
storing bit pattern.

Programming MELSEC System Q and L series 6 – 193


DI, EI, IMASK Program execution control instructions

Functions Interrupt instructions


An interrupt program is an inserted part of program (designated by an interrupt address Ixx)
that can be invoked by an external interrupt signal. The interrupt program is executed depend-
ing on the EI/DI instruction.
DI Disable interrupt
The DI instruction disables the execution of an interrupt program until an EI instruction is exe-
cuted. The DI state is actice when power is turned ON or when the CPU module is reset.

EI Enable interrupt
The EI instruction enables invoking an interrupt program designated by an interrupt address
Ixx, or enables the execution of an IMASK instruction.
Even though an interrupt condition might be generated between the DI and EI instructions, the
interrupt program is suspended until the entire cycle from DI to EI has been processed. The fol-
lowing diagram illustrates such an execution:

1
Sequence program
2
Interrupt program
DI__0E1

NOTE The GX IEC Developer inserts the FEND instruction automatically. The event Ixx has to be allo-
cated to a task.

6 – 194
Program execution control instructions DI, EI, IMASK

IMASK Bit pattern of execution conditions of interrupt programs


In the bit pattern designated by s a particular interrupt address is allocated to each bit. The
condition of each bit determines whether the allocated interrupt can be executed. If the bit is
reset (0), the interrupt program cannot be executed. If the bit is set (1), the interrupt program
will be executed.

System Q The allocation of bits in s through s+7 to the corresponding interrupt addresses is shown
CPU (Basic below:
Model
QCPU)
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
s I15 I14 I13 I12 I11 I10 I9 I8 I7 I6 I5 I4 I3 I2 I1 I0

s +1 I31 I30 I29 I28 I27 I26 I25 I24 I23 I22 I21 I20 I19 I18 I17 I16

s+2 I47 I46 I45 I44 I43 I42 I41 I40 I39 I38 I37 I36 I35 I34 I33 I32

s+3 I63 I62 I61 I60 I59 I58 I57 I56 I55 I54 I53 I52 I51 I50 I49 I48

s+4 I79 I78 I77 I76 I75 I74 I73 I72 I71 I70 I69 I68 I67 I66 I65 I64

s+5 I95 I94 I93 I92 I91 I90 I89 I88 I87 I86 I85 I84 I83 I82 I81 I80

s+6 I111 I110 I109 I108 I107 I106 I105 I104 I103 I102 I101 I100 I99 I98 I97 I96

s+7 I127 I126 I125 I124 I123 I122 I121 I120 I119 I118 I117 I116 I115 I114 I113 I112

IMASK0E3
When the power supply of the CPU is switched on or when the CPU has been reset, the exe-
cution of interrupt programs I0 through I31, I48 to I127 is enabled.
The bit patterns designated by s through s+2 are stored in the special registers SD715 through
SD717. The bit patterns designated by s+3 through s+7 are stored in the special registers
SD781 through SD785.
The bit patterns are designated as s through s+7 successively although the special registers
are separated (SD715 through SD717 and SD781 through SD785).

Programming MELSEC System Q and L series 6 – 195


DI, EI, IMASK Program execution control instructions

System Q The allocation of bits in s through s+15 to the corresponding interrupt addresses is shown
CPU (other below:
than Basic
Model b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
QCPU) and s I15 I14 I13 I12 I11 I10 I9 I8 I7 I6 I5 I4 I3 I2 I1 I0

L-series s +1 I31 I30 I29 I28 I27 I26 I25 I24 I23 I22 I21 I20 I19 I18 I17 I16
CPU
s+2 I47 I46 I45 I44 I43 I42 I41 I40 I39 I38 I37 I36 I35 I34 I33 I32

s+3 I63 I62 I61 I60 I59 I58 I57 I56 I55 I54 I53 I52 I51 I50 I49 I48

s+4 I79 I78 I77 I76 I75 I74 I73 I72 I71 I70 I69 I68 I67 I66 I65 I64

s+5 I95 I94 I93 I92 I91 I90 I89 I88 I87 I86 I85 I84 I83 I82 I81 I80

s+6 I111 I110 I109 I108 I107 I106 I105 I104 I103 I102 I101 I100 I99 I98 I97 I96

s+7 I127 I126 I125 I124 I123 I122 I121 I120 I119 I118 I117 I116 I115 I114 I113 I112

s+8 I143 I142 I141 I140 I139 I138 I137 I136 I135 I134 I133 I132 I131 I130 I129 I128

s+9 I159 I158 I157 I156 I155 I154 I153 I152 I151 I150 I149 I148 I147 I146 I145 I144

s +10 I175 I174 I173 I172 I171 I170 I169 I168 I167 I166 I165 I164 I163 I162 I161 I160

s + 11 I191 I190 I189 I188 I187 I186 I185 I184 I183 I182 I181 I130 I129 I128 I127 I126

s + 12 I207 I206 I205 I204 I203 I202 I201 I200 I199 I198 I197 I196 I195 I194 I193 I192

s + 13 I223 I222 I221 I220 I219 I218 I217 I216 I215 I214 I213 I212 I211 I210 I209 I208

s + 14 I239 I238 I237 I236 I235 I234 I233 I232 I231 I230 I229 I228 I227 I226 I225 I224

s + 15 I255 I254 I253 I252 I251 I250 I249 I248 I247 I246 I245 I244 I243 I242 I241 I240

IMASK0E2
When the power supply of the CPU is switched on or when the CPU has been reset with the
RUN/STOP switch, the execution of interrupt programs are as follows:
● High Performance model QCPU, Process CPU, and Redundant CPU
Execution of interrupt programs I0 to I31 and I48 to I255 is enabled, and execution of interrupt
programs I32 to I47 is disabled.
● Universal model QCPU and LCPU
Execution of interrupt programs I0 to I31 and I45 to I255 is enabled, and execution of interrupt
programs I32 to I44 is disabled.
The bit patterns designated by s through s+2 are stored in the special registers SD715 through
SD717. The bit patterns designated by s+3 through s+15 are stored in the special registers
SD781 through SD793.
Although the special registers are separated (SD715 through SD717 and SD781 through
SD793), the bit patterns are designated as s through s+15 successively.

6 – 196
Program execution control instructions DI, EI, IMASK

NOTES The interrupt address (interrupt pointer) designating the interrupt program occupies one pro-
gram step.

DI___AB1

With the GX Works2 or with the GX IEC Developer in MELSEC mode the instructions FEND and
IRET have to be programmed by the user.
Alternatively to the MELSEC editor the IEC editor can be used. The interrupt is allocated to a
task and the FEND and IRET instructions are placed automatically by the compiler of the GX IEC
Developer MEDOC (see program example).
For the information on interrupt conditions, link direct devices, refer to the QnUCPU User’s Ma-
nual(Function Explanation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User’s Ma-
nuall(Function Explanation, Program Fundamentals).
During the execution of an interrupt program the DI status is internally set, so that no other in-
terrupt program can be executed simultaneously. Another interrupt program can only be invoked
after setting an EI instruction.
If an EI or DI instruction is placed within an MC instruction, the EI or DI instruction is executed
without regard to the MC instruction.
DI___AB2

Programming MELSEC System Q and L series 6 – 197


DI, EI, IMASK Program execution control instructions

Program EI, DI, IMASK (GX IEC Developer)


Example
The following program enables the execution of an interrupt program, if X0 is set (1). If X0 is
reset (0), the execution of the interrupt program is disabled.
The lower diagram shows the tasks to be programmed in the IEC mode. These tasks invoke
the interrupt programs I1 and I2.
Interrupt_1 (I1) and Interrupt_2 (I2) are interrupt programs. The IRET instruction does not need
to be programmed because it is placed automatically by the compiler of the GX IEC Developer.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

DI___MB1, DI___KB1, DI___IB1, DI___AB3

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 198
Program execution control instructions DI, EI, IMASK

Program EI, DI, IMASK (GX Works2)


Example
In the following program, the execution of an interrupt program is enabled if X0 is set (1). When
X0 is reset (0), the execution of the interrupt program is disabled.
I1 and I3 are interrupt programs.

Ladder Diagram

Instruction List

Programming MELSEC System Q and L series 6 – 199


IRET Program execution control instructions

6.6.2 IRET

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
— — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

RET_ME1, IRET_KE1, IRET_IE1I

GX Works2

IRET_GE1

Variables Set Data Meaning Data Type


— — —

NOTE Within the IEC editors the IRET instruction is placed automatically in the program.

6 – 200
Program execution control instructions IRET

Functions Return from an interrupt program to the main program


IRET End of an interrupt program
The end of an interrupt program is indicated by an IRET instruction.
The main program is returned to after execution of the IRET instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● There is no corresponding interrupt address for the interrupt call.
(Error code 4220)
● If the IRET instruction is placed prior to an interrupt program, the CPU quits processing at
that point. (Error code 4223)
● An END, FEND, GOEND, or STOP instruction was placed between an interrupt call and an
IRET instruction.
● The IRET instruction was executed during the fixed scan execution type program.
(For the Universal model QCPU, LCPU) (Error code 4223)

NOTE The following example shows a programming error!

1
Sequence program
2
Interrupt program
DI__0E2

Program For the application of an IRET instruction in a program refer to the program examples for the
Example EI, DI, and IMASK instructions (refer to section 6.6.1).

Programming MELSEC System Q and L series 6 – 201


Link refresh instructions

6.7 Link refresh instructions


Link refresh instructions refresh data at input/output interfaces. The following table gives an
overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
RFS RFS_M
I/O partial refresh
RFSP RFSP_M

6 – 202
Link refresh instructions RFS, RFSP

6.7.1 RFS, RFSP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s 1) — — — — — — — —
n         —
1 X and Y only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FS_ME1, RFS_KE1, RFS_IE1R

GX Works2

RFS__GE1

Variables Set Data Meaning Data Type


s First number of I/O device to be refreshed Bit
n Number of I/O bits to be refreshed BIN 16-bit

Programming MELSEC System Q and L series 6 – 203


RFS, RFSP Link refresh instructions

Functions I/O partial refresh


RFS Refresh instruction
The RFS instruction refreshes the inputs and outputs of the designated range of I/O devices
during one program scan. It reads data from an external source or writes data to an output
module.
Data is read from an external source or written to an external output module in a batch after
executing an END instruction. Therefore, a pulse signal cannot be output during one program
scan. When the I/O refresh instruction is executed, the inputs (X) or outputs (Y) of the corre-
sponding device numbers are refreshed forcibly midway through program execution. Thus,
even pulse signals can be output.
If direct access inputs/outputs (DX/DY) are used, the inputs (X) and outputs (Y) are refreshed
bit by bit.

RFS__AB1, RFS__AB2
The program example on the left refreshes the input X0 and the output Y20 via an RFS instruc-
tion.
The program example on the right performs the same functions via DX and DY without a
refresh instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of points determined by n exceeds the input/output device range.
(Error code 4101)

Program RFSP
Example
With leading edge from M0, the following program refreshes the inputs X100 through X11F and
the outputs Y200 through Y23F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

RFS__MB1, RFS__KB1, RFS__IB1

6 – 204
Other convenient instructions

6.8 Other convenient instructions


The instructions in the following table support programming of special timers and special
counters, pulse counters and pulse outputs. Also included are instructions for positioning rotary
tables and for building input matrices.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
1-Phase Input
UDCNT1 UDCNT1_M
count-up/-down Counter
2-Phase Input UDCNT2 UDCNT2_M
count-up/-down Counter
Programmable (teaching) Timer TTMR TTMR_M
Special Function Timer STMR STMR_M
Positioning of Rotary Tables ROTC ROTC_M
Ramp Signal RAMP RAMP_M
Pulse Counter SPD SPD_M
Pulse Output with
PLSY PLSY_M
set Number of Outputs
Pulse Width Modulation PWM PWM_M
Building of Input Matrices MTR MTR_M

Programming MELSEC System Q and L series 6 – 205


UDCNT1 Other convenient instructions

6.8.1 UDCNT1

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s 1) — — — — — — — —
d — 2,3) — — — — — — —
n 3) 3) 3)      —
1
X only
2
C only
3
Local devices and the file registers set for individual programs cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

UDCN1ME1, UDCN1KE1, UDCN1IE1

GX Works2

UDCN1GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s+0: Input device number for count input (pulse signal, phase).
Array [1..2] of
s s+1: Set count up or down bit
0 = count up BOOL
1 = count down
d Number of counter performing the UDCNT1 instruction. BIN 16-bit
ANY16
(counter only)
n Setting BIN 16-bit ANY16

6 – 206
Other convenient instructions UDCNT1

Functions 1-phase count-up/-down counter


UDCNT1 Counter instruction
When the input designated by s+0 (array_s [0]) changes from 0 to 1 the current count of the
counter designated by d is updated. Consequently, only leading edges are counted.
The counting direction is determined by the status of the input designated by s+1 (array_s [1]):
– If the input condition is 0, the pulses of the input designated by s+0 (Array_s [0]) are added
to the current count value.
– If the input condition is 1, the pulses of the input designated by s+0 (Array_s [0]) are
subtracted from the current count value.
The count processing performs as follows:
– When counting up, the counter contact designated by d is set (1), if the current count value
is identical to the setting value in n. The counting process continues while the counter contact
is set (see program example).
– When counting down, the counter contact is reset (0), if the current count value is identical
to n-1 (see program example).
– The counter designated by d is a ring counter. If the count reads 32767 and is increased by
1, the counter jumps to -32768. If the count reads -32768 and is decreased by 1, the counter
jumps to 32767. The following diagram illustrates ring counting:

1
Counting up
2
Counting down
UDCNT0E1
The UDCNT1 instruction is started when the execution condition is set and stopped when the
execution condition is reset. If the counter is started once again, it counts on from the value
before it was stopped.
An RST instruction resets the counter designated by d and the according counter contact.

NOTE The counting process of a UDCNT1 instruction is performed during a CPU interrupt (1 ms). For
this reason only pulses with set/reset times over 1 ms can be counted accurately.
The setting value cannot be changed during the counting process (in this case the input desi-
gnated by s+0 (Array_s [0]) is set). In order to change the setting, the input designated by s+0
(Array_s [0]) has to be reset.
Counters designated by a UDCNT1 instruction cannot be used by other instructions at the same
time. In this case they would not return an accurate count.
The UDCNT1 instruction can be used as many as 6 times within all the programs being exe-
cuted. The seventh and the subsequent UDCNT1 instructions are not processed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by s exceeds the range of the corresponding device.
(Error code 4101)

Programming MELSEC System Q and L series 6 – 207


UDCNT1 Other convenient instructions

Program UDCNT1
Example
If X20 is set, the following program designates counter C0 (up/down counter) to count the
number of leading edges from X0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Count
2
Counter contact of counter C0
UDCN1MB1, UDCN1KB1, UDCN1IB1, UDCNT0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 208
Other convenient instructions UDCNT2

6.8.2 UDCNT2

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s 1) — — — — — — — —
d — 2,3) — — — — — — —
n 3) 3) 3)      —
1
X only
2
C only
3
Local devices and the file registers set for individual programs cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

UDCN2ME1, UDCN2KE1, UDCN2IE1

GX Works2

UDCN2GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s+0: Input device number for count input (pulse signal, phase A) Array [1..2] of
s Bit
s+1: Input device number of count input (pulse signal, phase B) BOOL

d Number of counter performing the UDCNT1 instruction BIN 16-bit


ANY16
(counter only)
n Setting BIN 16-bit ANY16

Programming MELSEC System Q and L series 6 – 209


UDCNT2 Other convenient instructions

Functions 2-phase count-up/-down counter


UDCNT2 Counter instruction
The count of the counter designated by d is changed depending on the condition of the two
inputs s+0 (array_s [0]) and s+1 (array_s [1]).
The direction of the count is determined as follows:
– If the input s+0 (array_s[0]) is set (1) and the input s+1 (array_s[1]) changes from 0 to 1 the
current count is increased by 1.
– If the input s+0 (array_s[0]) is set (1) and the input s+1 (array_s[1]) changes from 1 to 0 the
current count is decreased by 1.
– If the input s+0 (array_s[0]) is reset (0) no counting operation is executed.
The count processing performs as follows:
– When counting up, the counter contact designated by d is set (1), if the current count value
is identical to the setting value in n. The counting process continues while the counter contact
is set (see program example).
– When counting down, the counter contact is reset (0), if the current count value is identical
to n-1 (see program example).
– The counter designated by d is a ring counter. If the count reads 32767 and is increased by
1, the counter jumps to -32768. If the count reads -32768 and is decreased by 1, the counter
jumps to 32767. The following diagram illustrates ring counting:

1
Counting up
2
Counting down
UDCNT0E2
The UDCNT2 instruction is started when the execution condition is set and stopped when the
execution condition is reset. If the counter is started once again, it counts on from the value
before it was stopped.
An RST instruction resets the counter designated by d and the according counter contact.

NOTE The counting process of a UDCNT2 instruction is performed during a CPU interrupt (1 ms). For
this reason only pulses with set/reset times over 1 ms can be counted accurately.
The setting value cannot be changed during the counting process (-> the input designated by
s+0 (Array_s [0]) is set). In order to change the setting, the input designated by s+0 (Array_s [0])
has to be reset.
Counters designated by a UDCNT2 instruction cannot be used by other instructions at the same
time. In this case they would not return an accurate count.
The UDCNT2 instruction can be used as many as 5 times within all the programs being exe-
cuted. The sixth and the subsequent UDCNT2 instructions are not processed.

6 – 210
Other convenient instructions UDCNT2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by s exceeds the range of the corresponding device.
(Error code 4101)

Program UDCNT2
Example
If X20 is set, the following program designates counter C0. The count and the count direction
(up/down) depend on the conditions of X0 and X1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

UDCN2MB1, UDCN2KB1, UDCN2IB1, UDCNT0B2

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 211


TTMR Other convenient instructions

6.8.3 TTMR

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
d —   — — — — — —
n —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

TTMR_ME1, TTMR_KE1, TTMR_IE1

GX Works2

TTMR_GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
d+0: Device storing measurement value. Array [1..2] of
d
d+1: For internal use by the CPU. BIN 16-bit ANY16

n Measurement value multiplier ANY16

6 – 212
Other convenient instructions TTMR

Functions Programmable (teaching) Timer


TTMR Timer instruction
A timer programmed via the TTMR instruction measures the time of an input signal in seconds.
The measurement value is multiplied with n and stored in d (array_d [0]+[1]).
With leading edge from the input the devices d+0 (array_d [0]) and d+1 (array_d [1]) are
cleared.
The multipliers designated by n are as follows:
n = 0, multiplier 1
n = 1, multiplier 10
n = 2, multiplier 100
No processing is performed when the value specified by "n" is other than 0 to 2.

NOTE Time measurement is performed during the execution of a TTMR instruction. Applying a JMP in-
struction or a similar instruction to the TTMR instruction causes inaccurate time measurement.
The multiplier n must not be changed during the execution of a TTMR instruction. A change
would cause inaccurate measurement.
The TTMR instruction can also be used in low speed type programs.
The device designated by d+1 (array_d [1]) is used by the CPU. A change would cause inac-
curate measurement.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

Program TTMR
Example
If X0 is set, the following program measures the time in seconds (n = 0, multiplier = 1). The
result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

TTMR_MB1, TTMR_KB1, TTMR_IB1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 213


STMR Other convenient instructions

6.8.4 STMR

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H
Bit Word Bit Word U\G
s — 1) — — — — — — —
n         —
d — — — — — — — — —
1 Can only be used by timer (T) data.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

STMR_ME1, STMR_KE1, STMR_IE1

GX Works2

STMR_GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
BIN 16-bit
s Number of timer ANY16
(timer only)
n Time setting BIN 16-bit ANY16
d+0: OFF delay timer output
d+1: One shot timer output after OFF (Set by trailing edge) Array [1..4] of
d Bit
d+2: One shot timer output after ON (Set by leading edge) BOOL

d+3: ON delay and OFF delay timer output

6 – 214
Other convenient instructions STMR

Functions Special function timer


STMR Timer instruction for low speed timers
The STMR instruction uses outputs designated by d+0 through d+3 (array_d [0] through
array_d [3]) to perform four different timer functions:
● OFF delay timer output (d+0) (array_d [0])
The output designated by d+0 (array_d [0]) is set (1) with leading edge from the execution
condition. With trailing edge from the execution condition and after a period of time
designated by n the output is reset (0) again.
● One shot timer output after OFF (Set by trailing edge, d+1 (array_d [1]))
The output designated by d+1 (array_d [1]) is set (1) with trailing edge from the execution
condition. After a period of time designated by n or with leading edge from the execution
condition the output is reset (0) again.
● One shot timer output after ON (Set by leading edge, d+2 (array_d [2]))
The output designated by d+2 (array_d [2]) is set (1) with leading edge from the execution
condition. After a period of time designated by n or with trailing edge from the execution
condition the output is reset (0) again.
● ON delay and OFF delay timer output (d+3 (Array [3]))
The output designated by d+3 (array_d [3]) is set (1) with trailing edge from the timer coil.
This corresponds to an ON delay time designated by n.
The output d+3 is reset (0) when the amount of time designated by n has passed.

The timer coil of the timer designated by s is set (0) with leading edge from the execution con-
dition and starts measuring the time designated by n.
The timer coil measures time until the measurement value matches the time setting n and then
drops out.
If the execution condition is reset before the time setting n has passed, the timer coil remains
set and time measurement is suspended at that point.
If the execution condition is set again the measurement value is cleared to 0 and time meas-
urement starts again.
The timer contact designated by s is either set by trailing edge from the execution condition and
set timer coil or by trailing edge from the timer coil and set execution condition. The timer con-
tact is reset by trailing edge from the execution condition and reset timer coil. The timer contact
is supplied for CPU internal use only.

Programming MELSEC System Q and L series 6 – 215


STMR Other convenient instructions

1 Execution condition
2
Timer coil designated by s
3
Timer contact designated by s
4 Time setting n

STMR_0E1
Time measurement is performed during the execution of an STMR instruction. Applying a JMP
instruction or a similar instruction to the STMR instruction causes inaccurate time measure-
ment.
The realtime designated by d can be calculated by multiplying the time setting n with the time
unit for low speed timers (default value = 100 ms).
The constant n has to range within 0 and 32767.
The timer designated by s cannot be used by an OUT instruction. If an OUT instruction and an
STMR instruction use the same timer, the STMR instruction cannot be performed accurately.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

6 – 216
Other convenient instructions STMR

Program STMR
Example
If X20 is set, the following program alternately sets the outputs Y0 and Y1 for 1 second each.
The used timer is a 100 ms timer. The time period of 1 second is calculated by multiplying K10
with 100 ms.

MELSEC Instruction List Ladder Diagram IEC Instruction List

STMR_MB1. STMR_KB1, STMR_IB1, STUR_0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 217


ROTC Other convenient instructions

6.8.5 ROTC

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
n1         —
n2         —
d  — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ROTC_ME1, ROTC_KE1, ROTC_IE1

GX Works2

ROTC_ME1

Variables Data Type


Set Data Meaning
MELSEC IEC
s+0: Measurement of table rpm (internal use only)
Array [1..3]
s s+1: Number of position
of ANY16
s+2: Number of sector BIN 16-bit
n1 Number of sectors (divisions) on table (2 to 32767) ANY16
n2 Number of low speed sectors (0 to n1) ANY16
d+0: A-phase input signal
d+1: B-phase input signal
d+2: Zero position detection input signal
d+3: High speed forward output signal (internal use only) Array [1..8]
d Bit
d+4: Low speed forward output signal (internal use only) of Bool

d+5: Stop output signal (internal use only)


d+6: High speed reverse output signal (internal use only)
d+7: Low speed reverse output signal (internal use only)

6 – 218
Other convenient instructions ROTC

Functions Positioning instruction for rotary tables


ROTC Positioning instruction
The ROTC instruction rotates a sector designated by s+2 (array_s [2]) on a table with a spec-
ified number of sectors (divisions) designated by n1 to a specified position designated by s+1
(array_s [1]).
The positions and sectors on the rotary table are numbered counterclockwise.
The value in s+0 (array_s [0]) is internally used by the system to determine which sector is
located where in relation to the zero position. This value must not be changed, otherwise the
table will not be positioned accurately.
The value in n2 determines the number of sectors the table can be rotated by at low speed.
This value must be equal or less than that designated by n1.
The A/B-phase inputs designated by d+0 (array_d [0]) and d+1 (array_d [1]) detect the direction
of the rotation. Both inputs receive pulses. If the A-phase input d+0 (array_d [0]) is set, the
direction of the rotation is determined by the pulse edge of the B-phase input d+1 (array_d [1]):
● If the B-phase is at leading edge at that moment the table rotates clockwise (to the right).
● If the B-phase is at trailing edge at that moment the table rotates counterclockwise (to the
left).
The input designated by d+2 (array_d [2]) detects the zero position. This input is set, if sector 0
reaches position 0. If this input is set during the execution of a ROTC instruction, the value in
s+0 (array_s [0]) is reset. For accurate positioning this value in s+0 (array_s [0]) should be reset
before positioning via the ROTC instruction.
Data in d+3 (array_d [3]) through d+7 (array_d [7]) store output signals for operating the rotary
table. Which output signal is set depends on the current operation result of the ROTC instruc-
tion.
If all operation results were 0 just before executing a ROTC instruction, the outputs designated
by d+3 (array_d [3]) through d+7 (array_d [7]) are reset without positioning the table. After
resetting the execution condition these outputs are reset either.
A ROTC instruction can only be executed once in a program. Repeated application within one
program causes faulty operation of the instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by s or d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

Programming MELSEC System Q and L series 6 – 219


ROTC Other convenient instructions

Program ROTC
Example
In the following program the contacts X0, X1 (incremental encoder), and X2 address the
internal relays for detection of the rotating direction and zero position M0 (var_M0 array [0])
through M2 (var_M0 array [2]). The contact X2 is activated, if sector 0 is located at position 0
(zero position detection).
The rotary table shown below is divided into 10 sectors.
Which item (sector) will be moved to which station (position) has to be specified in D201
(var_D200 array [1]) and D202 (var_D200 array [2]) before the execution of the ROTC instruc-
tion.
Due to the value n1=10 the contact of the counter register outputs 10 pulses each rotation
(division). The value n2=2 specifies the number of low speed divisions.
For example, if register D201 (var_D200 array [1]) stores the value 0 and register D202
(var_D200 [2]) stores the value 3, the rotary table moves item 3 (sector 3) to station 0
(position 0) travelling the shortest distance (clockwise). The sectors 1 through 3 rotate at low
speed.
For an allocation of single registers and internal relays or array elements respectively to the
corresponding functions see the table following the example.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Station 0 (position 0)
2
Station 1 (position 1)
3 Detection switch

ROTC_MB1, ROTC_KB1, ROTC_IB1, ROTC0B1

6 – 220
Other convenient instructions ROTC

Data register Meaning Remark


D200 (var_D200 Array [0]) Counter register
D201 (var_D200 Array [1]) Position of station These values are written to the data
registers D201 (var_D200 array [1]) and
D202 (var_D200 Array [2]) Position of item D202 (var_D200 array [2]) via a MOV
instruction.
M0 (var_M0 Array [0]) A-phase signal The internal relays M0 (var_M0 array [0])
through M2 (var_M0 array [2]) are
M1 (var_M0 Array [1]) B-phase signal
addressed by the inputs X0 through X2
M2 (var_M0 Array [2]) Zero position detection signal (see program example).

M3 (var_M0 Array [3]) High speed forward rotation


After X10 is set the ROTC instruction is
M4 (var_M0 Array [4]) Low speed forward rotation activated and the internal relays M3
(var_M0 array [3]) through M7 (var_M0
M5 (var_M0 Array [5]) Stop signal
array [7]) are assigned specified functions.
M6 (var_M0 Array [6]) High speed reverse rotation After resetting X10 these internal relays
are reset either.
M7 (var_M0 Array [7]) Low speed reverse rotation

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 6 – 221


RAMP Other convenient instructions

6.8.6 RAMP

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1         —
n2         —
d1        — —
n3         —
d2  — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

RAMP_ME1, RAMP_KE1, RAMP_IE1

GX Works2

RAMP_GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
n1 Initial value of operation ANY16
n2 Final value of operation ANY16
(d1)+0: Device storing current value
BIN 16-bit Array [1..2]
d1 (d1)+1: Device storing number of executed moves of ANY16
(internal use only)
n3 Number of moves to be executed ANY16
(d2)+0: Bit to be set after completion Array [1..2]
d2 Bit
(d2)+1: Bit determining storage of operation result of Bool

6 – 222
Other convenient instructions RAMP

Functions Ramp signal


RAMP Instruction for changing the content of a device gradually
A RAMP instruction changes the content in (d1)+0 (array_d1 [0]) gradually from the initial value
designated by n1 to the final value designated by n2.
The number of moves performing the gradual changes is designated by n3.
The number of moves already executed is stored in (d1)+1 (array_d1 [1]) for internal system
use.
When the operation is completed the device designated by (d2)+0 (array_d2 [0]) is set.
The signal condition of the device (d2)+0 (array_d2 [0]) and the content of the device (d1)+0
(array_d1 [0]) depend on the signal condition of the device (d2)+1 (array_d2 [1]):
● If the device (d2)+1 (array_d2 [1]) is not set, the device (d2)+0 (array_d2 [0]) will be reset
during the next scan and the RAMP instruction will begin a new move operation from the
value currently stored in (d1)+0 (array_d1 [0]).
● If the device (d2)+1 (array_d2 [1]) is set, the device (d2)+0 (array_d2 [0]) remains set and
the value in (d1)+0 (array_d1 [0]) is not changed (storage).
If the execution condition is reset during the operation, the content in (d1)+0 (array_d1 [0]) does
not change. If the execution condition is set once again, the RAMP instruction changes the cur-
rent content in (d1)+0 (array_d1 [0]) stored before the reset.
During the processing of the instruction the values in n1 and n2 must not be changed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d1 or d2 exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

NOTE When the digit specification of bit device is made to d1, the digit specification of bit device can
only be used when the specification of digits is "K8".

Programming MELSEC System Q and L series 6 – 223


RAMP Other convenient instructions

Program RAMP
Example
The following program increases the content in D0 within 6 moves from 10 to 100 and stores
the content in D0 when the operation is completed.

MELSEC Instruction List Ladder Diagram IEC Instruction List

RAMP_MB1, RAMP_KB1, RAMP_IB1, RAMP0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

6 – 224
Other convenient instructions SPD

6.8.7 SPD

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
s 1) — —      —
n 2) 2) 2) — — — — — —
d — 2) 2)      —
1
Only X
2
Local devices and the file registers set for individual programs cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SPD_ME1, SPD_KE1, SPD_IE1

GX Works2

SPD_GE1

Variables Set Data Meaning Data Type


s Pulse input signal Bit
n Measurement time (unit: ms)
BIN 16-bit
d First number of device storing measurement result

Programming MELSEC System Q and L series 6 – 225


SPD Other convenient instructions

Functions Pulse density measurement


SPD Pulse density measurement
The SPD instruction counts pulses at the input designated by s for a period of time specified
by n. The result of the measurement is stored in d.

1 Execution condition.
2
The result of the measurement is stored in d.
3
Begin of measurement.
SPD_0E1
While the execution condition is set, the measurement begins again from 0 after the measure-
ment time has passed. In order to stop the SPD measurement the execution condition has to
be reset.
The SPD instruction stores the data from the designated devices in the CPU work area, and
performs the current count operation during a 5 ms system interrupt. For this reason, the
number of times the instruction can be used is limited. The SPD instructions exceeding this
limit are not processed.

NOTES The count processing for pulses used with the SPD instruction is conducted during an interrupt.
Therefore, to count the pulses, it is necessary to provide their ON and OFF time as long as the
interrupt time of the CPU or longer. The interrupt time is 1 ms.
When the High Performance model QCPU or Process CPU is used, the SPD instruction is not
processed if n = 0.
The SPD instruction can be used as many as 6 times within all the programs being executed.
The seventh and the subsequent SPD instructions are not processed.
While the measurement is in execution (while the command input is ON) by the SPD instruction,
the setting value cannot be changed. Turn OFF the command input before changing the setting
value.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

6 – 226
Other convenient instructions SPD

Program SPD
Example
If X10 is set, the following program counts the pulses at X0 during a period of time of 500 ms.
The result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

SPD__MB1, SPD__KB1, SPD__IB1

Programming MELSEC System Q and L series 6 – 227


PLSY Other convenient instructions

6.8.8 PLSY

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
s1         —
s2         —
d 1) — — — — — — — —


1 Y only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PLSY_ME1, PLSY_KE1, PLSY_IE1

GX Works2

PLSY_GE1

Variables Set Data Meaning Data Type


s1 Frequency or device storing pulse frequency setting.
Outputs count or the number of the device storing number of output pulses BIN 16-bit
s2
setting.
d Device storing output destination. Bit

6 – 228
Other convenient instructions PLSY

Functions Pulse output with adjustable number of pulses


PLSY Pulse output instruction
The PLSY instruction outputs a number of pulses specified by s2 at a frequency specified by
s1 to an output designated by d.
The frequency range in s1 can be specified from 1 to 100 Hz. If s1 is other than 1 to 100 Hz,
the PLSY instruction will not be executed.
The number of output pulses in s2 can be specified from 0 to 65535 (0000H to FFFFH). If s2 is
set to "0", pulses are continuously output.
Only outputs corresponding to the output module can be designated by d.
Pulse output begins with leading edge from the execution condition of the PLSY instruction.
During pulse output the execution condition must not be reset. Resetting the execution condi-
tion suspends the pulse output.

NOTE The PLSY instruction stores the data from the designated devices in the CPU work area, and
and counting operation is processed as a system interrupt. The pulses that can be output must
have longer ON and OFF times than the interrupt interval of the CPU module. The interrupt in-
terval of individual modules is 1 ms.
Do not change the argument for the PLSY instruction during pulse output directed by the PLSY
instruction (while the execution command is ON). To change the argument, turn OFF the exe-
cution command.
The PLSY instruction can be used only once in all programs executed by the CPU module. The
second and the subsequent PLSY instructions are not processed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

Program PLSY
Example
If X0 is set, the following program outputs five 10 Hz pulses to Y20.

MELSEC Instruction List Ladder Diagram IEC Instruction List

PLSY_MB1, PLSY_KB1, PLSY_IB1

Programming MELSEC System Q and L series 6 – 229


PWM Other convenient instructions

6.8.9 PWM

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
n1         —
n2         —
d 1) — — — — — — — —


1 Only Y

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PWM_ME1, PWM_KE1, PWM_IE1

GX Works2

PWM_GE1

Variables Set Data Meaning Data Type


n1 ON time or the number of device storing ON time setting.
BIN 16-bit
n2 Frequency or the number of device storing cycle time setting.
d Number of device storing output destination. Bit

6 – 230
Other convenient instructions PWM

Functions Pulse width modulation


PWM Modulation instruction
The PWM instruction outputs pulses at a cycle time specified by n2 and with an ON time speci-
fied by n1 to an output designated by d.

PWM_0E1
The times in n1and n2 can be specified from 1 to 65535 ms. The value set in n1 has to be less
than that in n2.

NOTES The PWM instruction registers the data from the designated devices in the work area of the CPU,
and performs the current output operation during a system interrupt (1 ms).
For this reason, the PWM instruction can only be used once in a program.
The instruction is not processed in the following cases:
– When both n1 and n2 are 0
– When n2 is smaller or equal to n1
– When the PWM instruction is executed twice or more.
Do not change the argument for the PLSY instruction during pulse output directed by the PLSY
instruction (while the execution command is ON). To change the argument, turn OFF the exe-
cution command.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

Program PWM
Example
If X0 is set, the following program outputs pulses at a cycle time of 1 second and with an ON
time of 100 ms to Y20.

MELSEC Instruction List Ladder Diagram IEC Instruction List

PWM_MB1, PWM_KB1, PWM_IB1

Programming MELSEC System Q and L series 6 – 231


MTR Other convenient instructions

6.8.10 MTR

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
s  — — — — — — — —
d1  — — — — — — — —
d2  — — — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

MTR__ME1, MTR__KE1, MTR__IE1

GX Works2

MTR__GE1

Variables Set Data Meaning Data Type


s Initial input device.
d1 Initial output device. Bit
d2 First number of device storing matrix input data.
n Number of input rows. BIN 16-bit

6 – 232
Other convenient instructions MTR

Functions Building an input matrix


MTR Instruction for reading n data rows into an input matrix.
The MTR instruction reads the information of 16 bits (0/1) beginning from the device desig-
nated by s. The number of repetitions (rows) is designated by n. The conditions of read data
are stored in the device designated by d2 onwards. This way, a matrix of 16 bits and n rows is
built.
One row (16 bits) can be read each scan.
The reading process is continuously repeated from the first to the nth row.
Due to the format of the input matrix (16 bits x n rows) the device designated by d2 has to
supply space for 16 bits x n rows either to store the data.
Each row is selected beginning with the output designated by d1. The corresponding output for
each row of 16 bits to be read is set or reset by the system automatically. The number of out-
puts is identical with the number of rows. Thus, each single row can be addressed accurately
by the system
The device numbers designated by s, d1, and d2 must be divisible by 16.
The number of rows n can be designated from 2 to 8.
Note, that the MTR instruction directly operates on current input and output data.
No processing is performed in the following cases:
● The device numbers designated by s, d1, and d2 are not divisible by 16.
● The device designated by s exceeds the current input range.
● The device designated by s exceeds the current output range.
● The matrix space 16 bits x n rows exceeds the relevant device range of d2.
● The value in n does not range within 2 and 8.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device other than the input (X) was specified at s. (Error code 4101)
● The device other than the output (Y) was specified at d1. (Error code 4101)

Programming MELSEC System Q and L series 6 – 233


MTR Other convenient instructions

Program MTR
Example
If X0 is set, the following program reads the inputs X10 through X1F three times and stores the
results in M30 through M77. A matrix is built with 16 bits x 3 rows. The rows are addressed via
the outputs Y20 through Y22.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
1st row
2
2nd row
3
3rd row
MTR_MB1, MTR_KB1, MTR_IB1, MTR_0B1

6 – 234
7 Application Instructions, Part 2
The application instructions, part 2 are specific instructions for several special functions.
The following table shows the division of these functions:

Instruction Meaning
Logical operation instructions Logical AND / OR, logical exclusive OR / exclusive NOR
Rotation instructions 16-bit and 32-bit data right / left rotation
Shift instructions Shift data by bit or word
Bit processing instructions Set, reset, and test bits
Data processing instructions Search, encode, and decode data at specified devices
Disunite and unite data
Structured program instructions Repeated operation, subroutine program calls,
subroutine calls between program files, switching
between main and subprogram parts, micro computer
program calls, index qualification of entire ladders, store
index qualification values in data tables
Data table operation instructions Write to and read data from a data table, delete and
insert data blocks in a data table
Buffer memory access instructions Buffer memory access of special function modules
Display instructions Output ASCII characters to the outputs of a module or to
an LED display
Debugging and failure diagnosis instructions Failure checks, setting and resetting status latch,
sampling trace, program trace
Character string processing instructions Character string (ASCII code) processing
Special function instructions Trigonometrical functions, square root and exponential
calculation with BCD data and floating point data
Data control instructions Upper and lower limit control and storage of checked
data
File register switching instructions Switching between file register blocks and files
Clock instructions Reading/writing of the values of year, month, day, hour,
minute, second, and 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.
Expansion clock instruction Reading of the values of year, month, day, hour, minute,
second, millisecond, and day of the week; addition/
subtraction of the values of hour, minute, second, and
millisecond
Peripheral device instructions Message output and key input on peripheral units
Program instructions Select different program execution modes
Other instructions Reset watchdog timer (WDT), pulse generation, direct
read from indirect access file registers, numerical key
input from keyboard, batch save or recovery of index
registers, reading module information/model name, trace
set/trace reset, writing to and reading from files/standard
ROM, program instructions, data transfer, user message

Programming MELSEC System Q and L series 7–1


Logical operation instructions

7.1 Logical operation instructions

Via the logical operation instructions logical connections such as logical sum or logical product
are programmed.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in MELSEC Editor in IEC Editor
WAND WAND_M, WAND_3_M
WANDP WANDP_M, WANDP_3_M
AND DAND DAND_M, DAND_3_M
(logical product) DANDP DANDP_M, DANDP_3_M
BKAND BKAND_M
BKANDP BKANDP_M
WOR WOR_M, WOR_3_M
WORP WORP_M, WORP_3_M
OR DOR DOR_M, DOR_3_M
(logical sum) DORP DORP_M, DORP_3_M
BKOR BKOR_M
BKORP BKORP_M
WXOR WXOR_M, WXOR_3_M
WXORP WXORP_M, WXORP_3_M
Exclusive OR DXOR DXOR_M, DXOR_3_M
(XOR) DXORP DXORP_M, DXORP_3_M
BKXOR BKXOR_M
BKXORP BKXORP_M
WXNR WXNR_M, WXNR_3_M
WXNRP WXNRP_M, WXNRP_3_M
Exclusive NOR DXNR DXNR_M, DXNR_3_M
(XNR) DXNRP DXNRP_M, DXNRP_3_M
BKXNR BKXNR_M
BKXNRP BKXNRP_M

NOTE Within the IEC editors please use the IEC instructions.

Logical instructions are processed bit by bit as binary data. The two conditions (0 and 1) are
connected and the result of the connection is output to a destination address.

7–2
Logical operation instructions

The following table shows the logical connection results of the conditions 0 and 1. A and B are
input variables and Y is the output variable.

Logical Operation Example


Processing Details
Connection Expression A B Y
0 0 0

Output Y set to 1, only if both inputs A and B are 0 1 0


Logical AND Y=AxB
set to 1. 1 0 0
1 1 1
0 0 0

Output Y set to 1, if at least one of the inputs A or 0 1 1


Logical OR Y=A+B
B is set to 1. 1 0 1
1 1 1
0 0 0
Logical exclusive 0 1 1
Output Y set to 1, if the inputs A and B are
OR Y=AxB+AxB
different, and is set to 0 if A and B are equal. 1 0 1
(XOR)
1 1 0
0 0 1
Logical exclusive 0 1 0
Output Y set to 1, if the inputs A and B are equal,
NOR Y = (A + B) (A + B)
and is set to 0, if A and B are different. 1 0 0
(XNR)
1 1 1

Programming MELSEC System Q and L series 7–3


WAND, WANDP, DAND, DANDP Logical operation instructions

7.1.1 WAND, WANDP, DAND, DANDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
WAND
s         —
d        — —
s1         —
s2         —
d1        — —
DAND
s         —
d        — —
s1         —
s2         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WAND_ME1, WAND_KE1, WAND_IE1

GX Works2

WAND_GE1

Variables Set Data Meaning Data Type


s
Data for logical product, or first number of device storing such data.
d
s1 BIN 16-/32-bit
Data for logical product, or first number of device storing such data.
s2
d1 (for DAND d) First number of device storing result of logical operation.

7–4
Logical operation instructions WAND, WANDP, DAND, DANDP

Functions Logical AND


WAND 16-bit data
The logical AND forms the logical product of two input variables.
● Variation 1:
16-bit data designated by s and d form the logical product bit by bit. The result is output to the
device designated by d.

WAND0E1

● Variation 2:
16-bit data designated by s1 and s2 form the logical product bit by bit. The result is output to
the device designated by d1.

WAND0E2
Bits exceeding the digit designation are set to 0. For example, if the digit designation is speci-
fied by K2, the higher 8 bits (b8 through b15) are processed as 0.

Programming MELSEC System Q and L series 7–5


WAND, WANDP, DAND, DANDP Logical operation instructions

DAND 32-bit data


● Variation 1:
32-bit data designated by s and d form the logical product bit by bit. The result is output to the
device designated by d.

DAND0E1

● Variation 2:
32-bit data designated by s1 and s2 form the logical product bit by bit. The result is output to
the device designated by d.

DAND0E2
After executing the connection, all bits exceeding the digit designation are set to 0.

7–6
Logical operation instructions WAND, WANDP, DAND, DANDP

Program WANDP (s, d)


Example 1
With leading edge from XA, the following program sets the digit of tens (b5-b7) in the BCD
4-digit value in D10 to 0. The result is stored again in D10.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WAND_MB1, WAND_KB1, WAND_IB1, WAND0B1

Program DANDP (s, d)


Example 2
With leading edge from X8, the following program forms the logical product of 32-bit data in
D99 and D100 and 24-bit data at X30 through X47. The result is stored again in D99 and D100.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

1 These bits are set to 0.


WAND_MB2, WAND_KB2, WAND_IB2, DAND0B1

Programming MELSEC System Q and L series 7–7


WAND, WANDP, DAND, DANDP Logical operation instructions

Program WANDP (s1, s2, d1)


Example 3
With leading edge from XA, the following program forms the logical product of data in X10
through X1B and data in D33. The result is stored in D40.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

X1B X8 X7 X3 X10
B10 - X1B 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0
0 WANDP
b15 b8 b7 b0
D33 0 1 0 1 1 1 0 1 1 1 1 1 0 0 0 0

b15 b8 b7 b0
D40 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0

1
These bits are set to 0.
WAND_MB3, WAND_KB3, WAND_IB3, WAND0B2

Program WANDP (s1, s2, d1)


Example 4
With leading edge from X1C, the following program forms the logical product of data in D10
and D20. The result is stored in M0 through M11.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

1 These bits remain unchanged.


WAND_MB4, WAND_KB4, WAND_IB4, WAND0B3

7–8
Logical operation instructions WAND, WANDP, DAND, DANDP

Program DANDP (s1, s2, d)


Example 5
With leading edge from XA, the following program sets the digit of hundreds in the BCD 4-digit
value in D10 and D11 to 0. The result is output at Y10 through Y2B.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits remain unchanged.
WAND_MB5, WAND_KB5, WAND_IB5, DAND0B2

NOTE The program examples 2 and 5 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

Programming MELSEC System Q and L series 7–9


BKAND, BKANDP Logical operation instructions

7.1.2 BKAND, BKANDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKANDME1, BKANDKE1, BKANDIE1

GX Works2

BKANDGE1

Variables Set Data Meaning Data Type

s1 First number of device storing data for logical product.1)

s2 First number of data or first number of device storing data for logical operation.1)
BIN 16-bit
d First number of device storing result of logical operation.1)
n Number of data blocks forming the logical product.
1
The same device number can be specified for s1 and d or s2 and d.

7 – 10
Logical operation instructions BKAND, BKANDP

Functions Forming a logical product with 16-bit data blocks


BKAND Forming a logical product with data blocks
The BKAND instruction forms the logical product beginning with the nth 16-bit data block from
s1 onwards and with the nth 16-bit data block from s2 onwards. The according 16-bit block of
the result is stored beginning from device d onwards. The number of blocks to be processed is
specified by n.

BKAND0E1
The constant in s2 must range within -32768 and 32767.

BKAND0E2

Programming MELSEC System Q and L series 7 – 11


BKAND, BKANDP Logical operation instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s1, s2, or d.
(Error code 4101)
● The device range for n points starting from the device designated by s1 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s1 and d).
(Error code: 4101)
● The device range for n points starting from the device designated by s2 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s2 and d).
(Error code: 4101)

Program BKANDP
Example
With leading edge from X20, the following program forms the logical product of data in registers
D100 through D102 and data in registers R0 through R2. The result is stored in registers D200
through D202. The number of 16-bit data blocks (3) to be processed is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKANDMB1, BKANDKB1, BKANDIB1, BKAND0B1

7 – 12
Logical operation instructions WOR, WORP, DOR, DORP

7.1.3 WOR, WORP, DOR, DORP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
WOR
s         —
d        — —
s1         —
s2         —
d1        — —
DOR
s         —
d        — —
s1         —
s2         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WOR__ME1, WOR__KE1, WOR__IE1

GX Works2

WOR__GE1

Variables Set Data Meaning Data Type


s
Data for logical sum, or first number of device storing such data.
d
s1 BIN 16-/32-bit
Data for logical sum, or first number of device storing such data.
s2
d1 (for DOR d) First number of device storing result of logical operation.

Programming MELSEC System Q and L series 7 – 13


WOR, WORP, DOR, DORP Logical operation instructions

Functions Logical OR
WOR 16-bit data
The logical OR forms the logical sum of two input variables.
● Variation 1:
16-bit data designated by s and d are added bit by bit. The result is output to the device desig-
nated by d.

WOR_0E1

● Variation 2:
16-bit data designated by s1 and s2 are added bit by bit. The result is output to the device des-
ignated by d1.

WOR_0E2
Bits exceeding the digit designation are set to 0. For example, if the digit designation is speci-
fied by K2, the higher 8 bits (b8 through b15) are processed as 0.

7 – 14
Logical operation instructions WOR, WORP, DOR, DORP

DOR 32-bit data


● Variation 1:
32-bit data designated by s and d are added bit by bit. The result is output to the device desig-
nated by d.

DOR_0E1

● Variation 2:
32-bit data designated by s1 and s2 are added bit by bit. The result is output to the device des-
ignated by d.

DOR_0E2
After executing the connection, all bits exceeding the digit designation are set to 0.

Programming MELSEC System Q and L series 7 – 15


WOR, WORP, DOR, DORP Logical operation instructions

Program WORP (s, d)


Example 1
With leading edge from XA, the following program adds data in D10 to data in D20. The result
is stored in D10.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WOR__MB1, WOR__KB1, WOR__IB1, WOR_0B1

Program DORP (s, d)


Example 2
With leading edge from X2B, the following program adds data at the inputs X0 through X1F to
a hexadecimal value FF00FF00. The result is stored in D66 and D67.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WOR__MB2, WOR__KB2, WOR__IB2, WOR_0B1

7 – 16
Logical operation instructions WOR, WORP, DOR, DORP

Program WORP (s1, s2, d1)


Example 3
With leading edge from XA, the following program adds data at the inputs X10 through X1B to
data in D33. The result is output to the outputs Y30 through Y3B.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are set to 0.
2
These bits remain unchanged.
WOR__MB3, WOR__KB3, WOR__IB3, WOR_0B2

Program DORP (s1, s2, d)


Example 4
With leading edge from M8, the following program adds 32-bit data in D0 and D1 to 24-bit data
at the inputs X20 through X37. The result is stored in D23 and D24.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WOR__MB4, WOR__KB4, WOR__IB4, DOR_0B2

NOTE The program examples 2 and 4 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

Programming MELSEC System Q and L series 7 – 17


BKOR, BKORP Logical operation instructions

7.1.4 BKOR, BKORP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKOR_ME1, BKOR_KE1, BKOR_IE1

GX Works2

BKOR_GE1

Variables Set Data Meaning Data Type

s1 First number of device storing data for logical sum.1)

s2 First number of data, or first number of device storing data for logical sum.1)
BIN 16-bit
d First number of device storing result of logical operation.1)
n Number of data blocks forming the logical sum.
1 The same device number can be specified for s1 and d or s2 and d.

7 – 18
Logical operation instructions BKOR, BKORP

Functions Forming a logical sum with 16-bit data blocks


BKOR Forming a logical sum with data blocks
The BKOR instruction forms the logical sum beginning with the nth 16-bit data block from s1
onwards and with the nth 16-bit data block from s2 onwards. The according 16-bit block of the
result is stored beginning from device d onwards. The number of blocks to be processed is
specified by n.

BKOR0E1
The constant in s2 must range within -32768 and 32767.

BKOR0E2

Programming MELSEC System Q and L series 7 – 19


BKOR, BKORP Logical operation instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s1, s2, or d.
(Error code 4101)
● The device range for n points starting from the device designated by s1 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s1 and d).
(Error code: 4101)
● The device range for n points starting from the device designated by s2 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s2 and d).
(Error code: 4101)

Program BKORP
Example
With leading edge from X20, the following program forms the logical sum of data in registers
D100 through D102 and data in registers R0 through R2. The result is stored in registers D200
through D102. The number of 16-bit data blocks (3) to be processed is stored in D0.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

BKOR_MB1, BKOR_KB1, BKOR_IB1, BKOR0B1

7 – 20
Logical operation instructions WXOR, WXORP, DXOR, DXORP

7.1.5 WXOR, WXORP, DXOR, DXORP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
WXOR
s         —
d        — —
s1         —
s2         —
d1        — —
DXOR
        —
       — —
s1         —
s2         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WXOR_ME1, WXOR_KE1, WXOR_IE1

GX Works2

W
X
O
R
_
G
E
1

Variables Set Data Meaning Data Type


s
Data for exclusive OR operation, or first number of device storing such data.
d
s1 BIN 16-/32-bit
Data for exclusive OR operation, or first number of device storing such data.
s2
d1 (for DXOR d) First number of device storing result of logical operation.

Programming MELSEC System Q and L series 7 – 21


WXOR, WXORP, DXOR, DXORP Logical operation instructions

Functions Logical exclusive OR


WXOR 16-bit data
The logical exclusive OR forms the logical sum of two input variables (Y= (AxB)+(AxB)).
● Variation 1:
16-bit data designated by s and d form a logical exclusive OR connection. The result is output
to the device designated by d.

WXOR0E1

● Variation 2:
16-bit data designated by s1 and s2 form a logical exclusive OR connection. The result is out-
put to the device designated by d.

WXOR0E2

Bits exceeding the digit designation are set to 0. For example, if the digit designation is speci-
fied by K2, the higher 8 bits (b8 through b15) are processed as 0.

7 – 22
Logical operation instructions WXOR, WXORP, DXOR, DXORP

DXOR 32-bit data


● Variation 1:
32-bit data designated by s and d form a logical exclusive OR connection. The result is output
to the device designated by d.

DXOR0E1

● Variation 2:
32-bit data designated by s1 and s2 form a logical exclusive OR connection. The result is out-
put to the device designated by d.

DXOR0E2

After executing the connection, all bits exceeding the digit designation are set to 0.

Programming MELSEC System Q and L series 7 – 23


WXOR, WXORP, DXOR, DXORP Logical operation instructions

Program WXORP (s, d)


Example 1
With leading edge from XA, the following program connects data in D10 with data in D20. The
result is stored again in D10.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WXOR_MB1, WXOR_KB1, WXOR_IB1, WXOR0B1

Program DXORP (s, d)


Example 2
With leading edge from X6, the following program compares 32-bit data at the inputs X20
through X3F to the bit pattern in data registers D9 and D10. The result is stored again in D9
and D10. The number of set bits in D9 and D10 is stored in D16.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WXOR_MB2, WXOR_KB2, WXOR_IB2, DXOR0B1

7 – 24
Logical operation instructions WXOR, WXORP, DXOR, DXORP

Program WXORP (s1, s2, d1)


Example 3
With leading edge from X10, the following program forms an exclusive OR connection of input
data X10 through X1B with data in D33. The result is stored in D33 and output to Y30 through
Y3B.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WXOR_MB3, WXOR_KB3, WXOR_IB3, WXOR0B2


1 These bits are set to 0.
2 These bits remain unchanged.

Program DXORP (s1, s2, d)


Example 4
With leading edge from X10, the following program forms an exclusive OR connection of data
in D20 and D21 with data in D30 and D31. The result is stored in D40 and D41.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DXOR_MB4, DXOR_KB4, DXOR_IB4, DXOR0B2

NOTE The program examples 2 and 4 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

Programming MELSEC System Q and L series 7 – 25


BKXOR, BKXORP Logical operation instructions

7.1.6 BKXOR, BKXORP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKXORME1, BKXORKE1, BKXORIE1

GX Works2

BKXORGE1

Variables Set Data Meaning Data Type

s1 First number of device storing data for logical operation.1)

s2 First number of data, or first number of device storing data for logical operation.1)
BIN 16-bit
d First number of device storing result of operation.1)
n Number of data blocks forming the exclusive OR operation.
1 The same device number can be specified for s1 and d or s2 and d.

7 – 26
Logical operation instructions BKXOR, BKXORP

Functions Exclusive OR operations with 16-bit data blocks


BKXOR Exclusive OR operations with data blocks
The BKXOR instruction performs an exclusive OR operation beginning with the nth 16-bit data
block from s1 onwards and with the nth 16-bit data block from s2 onwards. The according 16-
bit block of the result is stored beginning from device d onwards. The number of blocks to be
processed is specified by n.

BKXOR0E1
The constant in s2 must range within -32768 and 32767.

BKXOR0E2

Programming MELSEC System Q and L series 7 – 27


BKXOR, BKXORP Logical operation instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s1, s2, or d. (Error code 4101)
● The device range for n points starting from the device designated by s1 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s1 and d).
(Error code: 4101)
● The device range for n points starting from the device designated by s2 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s2 and d).
(Error code: 4101)

Program BKXORP
Example
With leading edge from X20, the following program performs an exclusive OR operation with
data in registers D100 through D102 and data in registers R0 through R2. The result is stored
in registers D200 through D202. The number of 16-bit data blocks (3) to be processed is stored
in D0.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

BKXORMB1, BKXORKB1, BKXORIB1, BKXOR0B1

7 – 28
Logical operation instructions WXNR, WXNRP, DXNR, DXNRP

7.1.7 WXNR, WXNRP, DXNR, DXNRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
WXNR, WXNRP
s         —
d        — —
s1         —
s2         —
d        — —
DXNR, DXNRP
s         —
d        — —
s1         —
s2         —
d1        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WXNR_ME1, WXNR_KE1, WXNR_IE1

GX Works2

W
X
N
R
_ GE1

Variables Set Data Meaning Data Type


s
Data for exclusive NOR operation, or first number of device storing such data
d
s1
Data for exclusive NOR operation, or first number of device storing such data BIN 16-/32-bit
s2
d (d1 for
WXNRP) First number of device storing result of logical operation

Programming MELSEC System Q and L series 7 – 29


WXNR, WXNRP, DXNR, DXNRP Logical operation instructions

Functions Logical exclusive NOR


WXNR 16-bit data
The logical exclusive NOR forms the logical product of the logical sum of two input variables
(Y= (A+B) x (A+B)).
● Variation 1:
16-bit data designated by s and d form a logical exclusive NOR connection. The result is output
to the device designated by d.

WXNR0E1

● Variation 2:
16-bit data designated by s1 and s2 form a logical exclusive NOR connection. The result is out-
put to the device designated by d.
The WXNRP operation instruction outputs the result to the device designated by d1.

WXNR0E2

Bits exceeding the digit designation are set to 0. For example, if the digit designation is speci-
fied by K2, the higher 8 bits (b8 through b15) are processed as 0.

7 – 30
Logical operation instructions WXNR, WXNRP, DXNR, DXNRP

DXNR 32-bit data


● Variation 1:
32-bit data designated by s and d form a logical exclusive NOR connection. The result is output
to the device designated by d.

DXNR0E1

● Variation 2:
16-bit data designated by s1 and s2 form a logical exclusive NOR connection. The result is out-
put to the device designated by d.

DXNR0E2

After executing the connection, all bits exceeding the digit designation are set to 0.

Programming MELSEC System Q and L series 7 – 31


WXNR, WXNRP, DXNR, DXNRP Logical operation instructions

Program WXNRP (s, d)


Example 1
With leading edge from XC, the following program compares the bit pattern of the 16-bit data
value at the inputs X30 through X3F to the data value in D99. The result of the operation is
stored again in D99. The number of set bits is stored in D7.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WXNR_MB1, WXNR_KB1, WXNR_IB1, WXNR0B1

7 – 32
Logical operation instructions WXNR, WXNRP, DXNR, DXNRP

Program DXNRP (s, d)


Example 2
With leading edge from X6, the following program compares the bit pattern of the 32-bit data
value at the inputs X20 through X3F to data in D16 and D17. The result of the operation is
stored again in D16 and D17. The number of set bits is stored in D18.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WXNR_MB2, WXNR_KB2, WXNR_IB2, DXNR0B1

Program WXNRP (s1, s2, d1)


Example 3
With leading edge from X0, the following program performs an exclusive NOR operation with
16-bit data at the inputs X30 through X3F and data in D99. The result of the operation is stored
in D7.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

WXNR_MB3, WXNR_KB3, WXNR_IB3, WXNR0B2

Programming MELSEC System Q and L series 7 – 33


WXNR, WXNRP, DXNR, DXNRP Logical operation instructions

Program DXNRP (s1, s2, d)


Example 4
With leading edge from X10, the following program performs an exclusive NOR operation with
32-bit data in the registers D20 and D21 and with data in D10 and D11. The result of the oper-
ation is stored in D40 and D41.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WXNR_MB4, WXNR_KB4, WXNR_IB4, DXNR0B2

NOTE The program examples 2 and 4 will not run without variable definition in the header of the pro-
gram organization unit (POU). They would cause compiler or checker error messages. For
details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this
manual.

7 – 34
Logical operation instructions BKXNR, BKXNRP

7.1.8 BKXNR, BKXNRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — —  —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKXNRME1, BKXNRKE1, BKXNRIE1

GX Works2

BKXNRGE1

Variables Set Data Meaning Data Type

s1 First number of device storing data for logical operation1)

s2 First number of data, or first number of device storing data for logical operation1)
BIN 16-bit
d First number of device storing result of logical operation 1)
n Number of data blocks to be processed
1
The same device number can be specified for s1 and d or s2 and d.

Programming MELSEC System Q and L series 7 – 35


BKXNR, BKXNRP Logical operation instructions

Functions Exclusive NOR operations with 16-bit data blocks


BKXNR Exclusive NOR operations with data blocks
The BKXNR instruction performs an exclusive NOR operation beginning with the nth 16-bit
data block from s1 onwards and with the nth 16-bit data block from s2 onwards. The according
16-bit block of the result is stored beginning from device d onwards. The number of blocks to
be processed is specified by n.

BKXNR0E1
The constant in s2 must range within -32768 and 32767.

BKXNR0E2

7 – 36
Logical operation instructions BKXNR, BKXNRP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks determined by n exceeds the storage device numbers designated
by s1, s2, or d. (Error code 4101)
● The device range for n points starting from the device designated by s1 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s1 and d).
(Error code: 4101)
● The device range for n points starting from the device designated by s2 overlaps with the
device range for n points starting from the device designated by d (except when the same
device is specified for s2 and d).
(Error code: 4101)

Program BKXNRP
Example
With leading edge from X20, the following program performs an exclusive NOR operation with
data in registers D100 through D102 and with data in registers R0 through R2. The result of
the operation is stored in the registers D200 through D202. The number of 16-bit blocks (3) to
be processed is stored in D0.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

BKXNRMB1, BKXNRKB1, BKXNRIB1, BKXNR0B1

Programming MELSEC System Q and L series 7 – 37


BKXNR, BKXNRP Data rotation instructions

7.2 Data rotation instructions

The following rotation instructions rotate data stored in devices bit by bit. Data can be rotated
to the right as well as to the left.
Example for a rotation to the right.

ROT_0E1

Rotation instructions can alternatively be applied with or without carry flag. The rotation instruc-
tions are suitable for 16-bit and 32-bit data. In total, 16 different rotation instructions are sup-
plied:

MELSEC Instruction IEC Instruction


Function
in MELSEC Editor in IEC Editor
ROR ROR_M
Data rotation to the right RORP RORP_M
(16-bit) RCR RCR_M
RCRP RCRP_M
ROL ROL_M
Data rotation to the left ROLP ROLP_M
(16-bit) RCL RCL_M
RCLP RCLP_M
DROR DROR_M
Data rotation to the right DRORP DRORP_M
(32-bit) DRCR DRCR_M
DRCRP DRCRP_M
DROL DROL_M
Data rotation to the left DROLP DROLP_M
(32-bit) DRCL DRCL_M
DRCLP DRCLP_M

NOTE Within the IEC editors please use the IEC instructions.

7 – 38
Data rotation instructions ROR, RORP, RCR, RCRP

7.2.1 ROR, RORP, RCR, RCRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ROR__ME1, ROR__KE1, ROR__IE1

GX Works2

ROR__GE1

Variables Set Data Meaning Data Type


d First number of device performing data rotation
BIN 16-bit
n Number of rotations (0 to 15)

Programming MELSEC System Q and L series 7 – 39


ROR, RORP, RCR, RCRP Data rotation instructions

Functions Data rotation to the right (16-bit)


ROR Rotation instruction without carry flag
The ROR instruction rotates data bits in the device designated by d by n bits to the right. The
carry flag (SM700) is not included. It retains the condition of the latest bit rotated from b0 to
b15.

ROR_0E1
1
Rotation by n bits
2
Carry flag SM700

RCR Rotation instruction with carry flag


The RCR instruction rotates data bits in the device designated by d by n bits to the right, includ-
ing the carry flag. The carry flag (SM700) retains the condition of the bit rotated by n bits. The
condition of the carry flag (0 or 1) prior to the rotation is moved to the right within d by n bits
beginning from b15.

RCR_0E1
1 Rotation by n bits
2 Carry flag SM700

NOTE If a bit device is designated by d, the rotation operation is performed with a device supplying the
specified number of digits. The number of digits the bits are rotated by is determined by the
remainder of the following quotient:
Number of rotations n / number of bits
For example, 16 rotations of 12 bits correspond to a rotation by 4 bits, since the remainder of the
quotient 16/12 equals 4. The reason for this is that a bit x in 12 bits after 12-fold rotation again
reaches the same position prior to the rotation.
For this reason, specify a value in the range from 0 to 15 as n.

7 – 40
Data rotation instructions ROR, RORP, RCR, RCRP

Program RORP
Example 1
With leading edge from XC, the following program rotates the contents of D0 by 3 bits to the
right.

MELSEC Instruction List Ladder Diagram IEC Instruction List

ROR__MB1, ROR__KB1, ROR__IB1, ROR_0B1


1 Contents of bits b0–b2 before the rotation
2
Contents of bits b4–b15 before the rotation
3 Contents of bit b3 before the rotation

4 Contents of bit b2 before the rotation

5
Carry flag SM700

Program RCRP
Example 2
With leading edge from XC, the following program rotates the contents of D0 by 3 bits to the
right; the carry flag SM700 is included. The condition of SM700 (0/1) prior to the rotation is
moved to the right by 3 digits.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

ROR__MB2, ROR__KB2, ROR__IB2, RCR_0B1


1
Contents of bits b1 and b0 before the rotation
2 Contents of carry flag before the rotation

3 Contents of bits b4–b15 before the rotation

4
Contents of bit b3 before the rotation
5 Contents of bit b2 before the rotation

6 Carry flag SM700

Programming MELSEC System Q and L series 7 – 41


ROL, ROLP, RCL, RCLP Data rotation instructions

7.2.2 ROL, ROLP, RCL, RCLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ROL__ME1, ROL__KE1, ROL__IE1

GX Works2

ROL__GE1

Variables Set Data Meaning Data Type


d First number of device performing data rotation
BIN 16-bit
n Number of rotations (0 to 15)

7 – 42
Data rotation instructions ROL, ROLP, RCL, RCLP

Functions Data rotation to the left (16-bit)


ROL Rotation instruction without carry flag
The ROL instruction rotates data bits in the device designated by d by n bits to the left. The
carry flag (SM700) is not included. It retains the condition of the latest bit rotated from b0 to
b15.

ROL_0E1
1
Rotation by n bits
2
Carry flag SM700

RCL Rotation instruction with carry flag


The RCL instruction rotates data bits in the device designated by d by n bits to the left, including
the carry flag. The carry flag (SM700) retains the condition of the bit rotated by n bits. The con-
dition of the carry flag (0 or 1) prior to the rotation is moved to the left within d by n bits begin-
ning from b15.

RCL_0E1
1
Rotation by n bits
2
Carry flag SM700

NOTE If a bit device is designated by d, the rotation operation is performed with a device supplying the
specified number of digits. The number of digits the bits are rotated by is determined by the
remainder of the following quotient:
Number of rotations n / number of bits
For example, 16 rotations of 12 bits correspond to a rotation by 4 bits, since the remainder of the
quotient 16/12 equals 4. The reason for this is that a bit x in 12 bits after 12-fold rotation again
reaches the same position prior to the rotation.
For this reason, specify a value in the range from 0 to 15 as n.

Programming MELSEC System Q and L series 7 – 43


ROL, ROLP, RCL, RCLP Data rotation instructions

Program ROLP
Example 1
With leading edge from XC, the following program rotates the contents of D0 by 3 bits to the left.

MELSEC Instruction List Ladder Diagram IEC Instruction List

ROL__MB1, ROL__KB1, ROL__IB1, ROL_0B1


1
Contents of bit b12 before the rotation
2
Contents of bits b11–b0 before the rotation
3 Contents of bits b15–b13 before the rotation

4
Contents of bit b12 before the rotation
5
Carry flag SM700

Program RCLP
Example 2
With leading edge from XC, the following program rotates the contents of D0 by 3 bits to the
left; the carry flag SM700 is included. The condition of SM700 (0/1) prior to the rotation is
moved to the left by 3 digits.

MELSEC Instruction List Ladder Diagram IEC Instruction List

ROL__MB2, ROL__KB2, ROL__IB2, RCL_0B1


1
Contents of bit b12 before the rotation
2
Contents of bits b11–b0 before the rotation
3 Contents of carry flag SM700

4
Contents of bits b14 and b15 before the rotation
5
Contents of carry flag SM700 before the rotation
6
Carry flag SM700

7 – 44
Data rotation instructions DROR, DRORP, DRCR, DRCRP

7.2.3 DROR, DRORP, DRCR, DRCRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DROR_ME1, DROR_KB1, DROR_IE1

GX Works2

DROR_GE1

Variables Set Data Meaning Data Type


d First number of device performing data rotation BIN 32-bit
n Number of rotations (0 to 31) BIN 16-bit

Programming MELSEC System Q and L series 7 – 45


DROR, DRORP, DRCR, DRCRP Data rotation instructions

Functions Data rotation to the right (32-bit)


DROR Rotation instruction without carry flag
The DROR instruction rotates data bits in the device designated by d by n bits to the right. The
carry flag (SM700) is not included. It retains the condition of the latest bit rotated from b0 to
b31.

DROR0E1
1 Rotation by n bits
2
Carry flag SM700

DRCR Rotation instruction with carry flag


The DRCR instruction rotates data bits in the device designated by d by n bits to the right,
including the carry flag. The carry flag (SM700) retains the condition of the bit rotated by n bits.
The condition of the carry flag (0 or 1) prior to the rotation is moved to the right within d (A0,
A1) by n bits beginning from b31.

DRCR0E1
1 Rotation by n bits
2 Carry flag SM700

NOTE If a bit device is designated by d, the rotation operation is performed with a device supplying the
specified number of digits. The number of digits the bits are rotated by is determined by the
remainder of the following quotient:
Number of rotations n / number of bits
For example, 31 rotations of 24 bits correspond to a rotation by 7 bits, since the remainder of the
quotient 31/24 equals 7. The reason for this is that a bit x in 24 bits after 24-fold rotation again
reaches the same position prior to the rotation.
For this reason, specify a value in the range from 0 to 31 as n.

7 – 46
Data rotation instructions DROR, DRORP, DRCR, DRCRP

Program DRORP
Example 1
With leading edge from XC, the following program rotates the contents of D0 and D1 by 4 bits
to the right.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Contents of bits b3-b0 before the rotation
2
Contents of bits b31-b4 before the rotation
3
Contents of bit b3 before the rotation
4
Carry flag SM700
DROR_MB1, DROR_KB1, DROR_IB1, DROR0B1

Program DRCRP
Example 2
With leading edge from XC, the following program rotates the contents of D0 and D1 by 4 bits
to the right; the carry flag SM700 is included. The condition of SM700 (0/1) prior to the rotation
is moved to the right by 4 digits.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Contents of bits b2–b0 before the rotation
2
Contents of carry flag SM700 before the rotation
3
Contents of bits b5–b31 before the rotation
4
Contents of bit b4 before the rotation
5
Contents of bit b3 before the rotation
6 Carry flag SM700

DROR_MB2, DROR_KB2, DROR_IB2, DRCR0B1


NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 47


DROL, DROLP, DRCL, DRCLP Data rotation instructions

7.2.4 DROL, DROLP, DRCL, DRCLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DROL_ME1, DROL_KE1, DROL_IE1

GX Works2

DROL_GE1

Variables Set Data Meaning Data Type


d First number of device performing data rotation BIN 32-bit
n Number of rotations (0 to 31) BIN 16-bit

7 – 48
Data rotation instructions DROL, DROLP, DRCL, DRCLP

Functions Data rotation to the left (32-bit)


DROL Rotation instruction without carry flag
The DROL instruction rotates data bits in the device designated by d by n bits to the left. The
carry flag (SM700) is not included. It retains the condition of the latest bit rotated from b31 to
b0.

DROL0E1
1 Rotation by n bits
2
Carry flag SM700

DRCL Rotation instruction with carry flag


The DRCR instruction rotates data bits in the device designated by d by n bits to the left, includ-
ing the carry flag. The carry flag (SM700) retains the condition of the bit rotated by n bits. The
condition of the carry flag (0 or 1) prior to the rotation is moved to the left within d (A0, A1) by
n bits beginning from b31.

DROL0E1
1 Rotation by n bits
2 Carry flag SM700

NOTE If a bit device is designated by d, the rotation operation is performed with a device supplying the
specified number of digits. The number of digits the bits are rotated by is determined by the
remainder of the following quotient:
Number of rotations n / number of bits
For example, 31 rotations of 24 bits correspond to a rotation by 7 bits, since the remainder of the
quotient 31/24 equals 7. The reason for this is that a bit x in 24 bits after 24-fold rotation again
reaches the same position prior to the rotation.
For this reason, specify a value in the range from 0 to 31 as n.

Programming MELSEC System Q and L series 7 – 49


DROL, DROLP, DRCL, DRCLP Data rotation instructions

Program DROLP
Example 1
With leading edge from XC, the following program rotates the contents of D0 and D1 by 4 bits
to the left.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DROL__MB1, DROL__KB1, DROL__IB1, DROL0B1


1
Contents of bits b27–b0 before the rotation
2 Contents of bits b31–b28 before the rotation

3
Contents of bit b28 before the rotation
4
Carry flag SM700

Program DRCLP
Example 2
With leading edge from XC, the following program rotates the contents of D0 and D1 by 4 bits
to the left; the carry flag (SM700) is included. The condition of SM700 (0/1) prior to the rotation
is moved to the left by 4 digits.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DROL__MB2, DROL__KB2, DROL__IB2, DRCL0B1


1
Contents of bits b27–b0 before the rotation
2
Contents of carry flag before the rotation
3 Contents of bits b31–b29 before the rotation

4 Contents of bit b28 before the rotation

5
Carry flag SM700

NOTE These programs will not run without variable definition in the header of the program organization
unit (POU). They would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 50
Data shift instructions

7.3 Data shift instructions

The shift instructions move data by bits or blocks of data within one data word. Data can be
shifted to the right as well as to the left.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
SFR SFR_M

Shift a 16-bit data word SFRP SFRP_M


by n bits SFL SFL_M
SFLP SFLP_M
BSFR BSFR_M

Shift n bit devices BSFRP BSFRP_M


by 1 bit BSFL BSFL_M
BSFLP BSFLP_M
SFTBR

Shift n bit devices SFTBRP


by n bits SFTBL
SFTBLP
DSFR DSFR_M

Shift n word devices DSFRP DSFRP_M


by one digit DSFL DSFL_M
DSFLP DSFLP_M
SFTWR

Shift n word devices SFTWRP


by n words SFTWL
SFTWLP

NOTE Within the IEC editors please use the IEC instructions.

Programming MELSEC System Q and L series 7 – 51


SFR, SFRP, SFL, SFLP Data shift instructions

7.3.1 SFR, SFRP, SFL, SFLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SFR__ME1, SFR__KE1, SFR__IE1

GX Works2

SFR__GE1

Variables Set Data Meaning Data Type


d First number of device storing data to be shifted
BIN 16-bit
n Number of shiftings (0 to 15)

7 – 52
Data shift instructions SFR, SFRP, SFL, SFLP

Functions Shifting a 16-bit data word by n bits


SFR Shifting to the right
The SFR instruction shifts the 16-bit data word designated by d by n bits to the right.

SFR_0E1
1
These bits are set to 0.
2 Carry flag SM700

The most significant n bits beginning from bit b15 on are set to 0. The nth bit (b(n-1)) to be
shifted is moved to the carry flag (SM700).
For timers and counters, the actual value (count) is shifted. The setting value cannot be shifted.
For bit devices, shifting within a device with a specified number of bits is feasible (see program
example 1).

SFL Shifting to the left


The SFL instruction shifts the 16-bit data word designated by d by n bits to the left.

SFL_0E1
1
These bits are set to 0.
2 Carry flag SM700

The least significant n bits beginning from bit b0 on are set to 0. The nth bit (b(15-n)) to be
shifted is moved to the carry flag (SM700).
For timers and counters, the actual value (count) is shifted. The setting value cannot be shifted.
For bit devices, shifting within a device with a specified number of bits is feasible (see program
example 1).

Programming MELSEC System Q and L series 7 – 53


Data shift instructions

Program SFRP
Example 1
With leading edge from X20, the following program shifts the content of Y10 through Y1B by
the number of bits specified by D0 to the right. The condition of Y13 is stored in the carry flag
(SM700).

MELSEC Instruction List Ladder Diagram IEC Instruction List

SFR__MB1, SFR__KB1, SFR__IB1, SFR_0B1


1
These bits are set to 0.
2 Carry flag SM700

Program SFLP
Example 2
With leading edge from X1C, the following program shifts the content of Y10 through Y18 by 3
bits to the left. The condition of Y15 is stored in the carry flag (SM700).

MELSEC Instruction List Ladder Diagram IEC Instruction List

SFR__MB2, SFR__KB2, SFR__IB2, SFL_0B1


1
These bits are set to 0.
2
Carry flag SM700

7 – 54
Data shift instructions BSFR, BSFRP, BSFL, BSFLP

7.3.2 BSFR, BSFRP, BSFL, BSFLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E
Bit Word Bit Word U\G U
d  — — — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BSFR_ME1, BSFR_KE1, BSFR_IE1

GX Works2

BSFR_GE1

Variables Set Data Meaning Data Type


d First number of device to be shifted Bit
n Number of devices to be shifted BIN 16-bit

Programming MELSEC System Q and L series 7 – 55


BSFR, BSFRP, BSFL, BSFLP Data shift instructions

Functions Shifting n bit devices by 1 bit


BSFR Shifting to the right
The BSFR instruction shifts the contents of specified bit devices by 1 bit to the right. The shift
operation starts from the address of the device designated by d and is proceeded for the
following n addresses.

BSFR0E1
1
This bit is set to 0.
2
Carry flag SM700

BSFL Shifting to the left


The BSFL instruction shifts the contents of specified bit devices by 1 bit to the left. The shift
operation starts from the address of device designated by d and is proceeded for the following
n addresses.

BSFL0E1
1 This bit is set to 0.
2 Carry flag SM700

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n exceeds the available number of bits in the device designated by d.
(Error code 4101)

7 – 56
Data shift instructions BSFR, BSFRP, BSFL, BSFLP

Program BSFRP
Example 1
With leading edge from X8F, the following program shifts data of the internal relays M668
through M676 by one bit to the right. M668 retains the value of M669, M669 that of M670 etc.
The contents of the first device (M668) is written to the carry flag (SM700), and the last device
(M676) retains the value 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BSFR_MB1, BSFR_KB1, BSFR_IB1, BSFR0B1


1 This bit is set to 0.
2 Carry flag SM700

Program BSFLP
Example 2
With leading edge from X4, the following program shifts the contents of the outputs Y60
through Y6F by one device to the left. The contents of the last output (Y6F) is stored in the carry
flag (SM700), and the first output (Y60) is reset to 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BSFR_MB2, BSFR_KB2, BSFR_IB2, BSFL0B1


1 This bit is set to 0.
2
Carry flag SM700

Programming MELSEC System Q and L series 7 – 57


SFTBR, SFTBRP, SFTBL, SFTBLP Data shift instructions

7.3.3 SFTBR, SFTBRP, SFTBL, SFTBLP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
d 1) —  — — — — — —
n1 —        —
n2 —        —
1
Except T, C, ST and S

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BSFR_ME1, BSFR_KE1, BSFR_IE1

GX Works2
SFTBR/SFTBL

d n1 n2

B
S
F
R
_
G
E
1 P n1 n2
d

Variables Set Data Meaning Data Type


d First number of device to be shifted Bit
n1 Number of bits to be shifted
BIN 16-bit
n2 Number of shifts

7 – 58
Data shift instructions SFTBR, SFTBRP, SFTBL, SFTBLP

Functions Shifting n bit devices by n bits


SFTBR Shifting to the right
This instruction shifts the n1 bits data in the devices starting from the device specified by d to
the right by n2 bits.

n1=10, n2=4
n1
n2

d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d


1 1 1 0 1 1 1 1 0 0

d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d 2)


0 0 0 0 1 1 1 0 1 1 1

1)

1
These bits are set to 0.
2
Carry flag SM700
n1 and n2 are specified under the condition that n1 is larger than n2. If the value of n2 is equal
to or larger than the value of n1, the remainder of n2 / n1 (n2 devided by n1) is used for a shift.
This instruction specifies n1 ranged from 1 to 64.
Bits starting from the highest bit to n2th bit are filled with 0s. If the value of n2 is larger than the
value of n1, the remainder of n2 / n1 will be 0.
If the value specified by n1 or n2 is 0, the instruction will be not processed.

SFTBL Shifting to the left


This instruction shifts the n1 bits data in the devices starting from the device specified by to the
left by n2 bits.

n1=10, n2=4
n1
n2

d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d


0 1 1 0 1 1 1 1 0 1

2)
1
d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d
1 1 1 1 0 1 0 0 0 0

1)

1
These bits are set to 0.
2 Carry flag SM700
n1 and n2 are specified under the condition that n1 is larger than n2. If the value of n2 is equal
to or larger than the value of n1, the remainder of n2 / n1 (n2 devided by n1) is used for a shift.
However, if the remainder of n2 / n1 is 0, the instruction will be not processed.
This instruction specifies n1 ranged from 1 to 64.
Bits starting from the highest bit to n2th bit are filled with 0s. If the value of n2 is larger than the
value of n1, the remainder of n2 / n1 will be 0.
If the value specified by n1 or n2 is 0, the instruction will be not processed.

Programming MELSEC System Q and L series 7 – 59


SFTBR, SFTBRP, SFTBL, SFTBLP Data shift instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified by n1 is other than 0 to 64. (Error code 4100)
● The value in n2 is negative. (Error code 4100)
● The value in n1 exceeds the available number of bits in the device designated by d.
(Error code 4101)

Program SFTBRP
Example 1
The following program shifts the data of Y10 to Y17 (8 bits) specified by d to the right by 2 bits
(n2), when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10


1 0 1 1 1 0 0 1

Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10 1)


0 0 1 0 1 1 1 0 0

1
Carry flag SM700

Program SFTBLP
Example 2
The following program shifts the data of Y21 to Y2C (12 bits) specified by d to the left by 5 bits
(n2), when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Y2C Y2B Y2A Y29 Y28 Y27 Y26 Y25 Y24 Y23 Y22 Y21
1 0 1 1 0 1 0 1 1 0 0 1

1)
0 Y2C Y2B Y2A Y29 Y28 Y27 Y26 Y25 Y24 Y23 Y22 Y21
1 0 1 1 0 0 1 0 0 0 0 0

1
Carry flag SM700

7 – 60
Data shift instructions DSFR, DSFRP, DSFL, DSFLP

7.3.4 DSFR, DSFRP, DSFL, DSFLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DSFR_ME1, DSFR_KE1, DSFR_IE1

GX Works2

DSFR_GE1

Variables Set Data Meaning Data Type


d First number of device to be shifted BIN 16-bit
n Number of devices to be shifted BIN 16-bit

Programming MELSEC System Q and L series 7 – 61


DSFR, DSFRP, DSFL, DSFLP Data shift instructions

Functions Shifting n word devices by 1 address


DSFR Shifting to the right
The DSFR instruction shifts the contents of specified word devices by one address to the right.
The shift operation starts from the address designated by d and is proceeded for the following
n addresses.
The contents of the most significant device is reset to 0 after the shifting.
For timers and counters, the actual value (count) is shifted. The setting value cannot be shifted.

DSFR0E1
1
This device is set to 0.

DSFL Shifting to the left


The DSFR instruction shifts the contents of specified word devices by one address to the left.
The shift operation starts from the address designated by d and is proceeded for the following
n addresses.
The contents of the least significant device is reset to 0 after the shifting.
For timers and counters, the actual value (count) is shifted. The setting value cannot be shifted.

DSFL0E1
1
This device is set to 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n exceeds the available number of points in the device designated by d.
(Error code 4101)

7 – 62
Data shift instructions DSFR, DSFRP, DSFL, DSFLP

Program DSFRP
Example 1
With leading edge from XB, the following program shifts data in the data registers D683 through
D689 by one address to the right. D683 retains the value of D684, D684 that of D685 etc. The
contents of the last data register (D689) retains the value 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DSFR_MB1, DSFR_KB1, DSFR_IB1, DSFR0B1


1
This device is set to 0.

Program DSFLP
Example 2
With leading edge from XB, the following program shifts data in the data registers D683 through
D689 by one address to the left. D689 retains the value of D688, D688 that of D687 etc. The
contents of the first data registers (D683) retains the value 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

DSFR_MB2, DSFR_KB2, DSFR_IB2, DSFL0B1


1
This device is set to 0.

Programming MELSEC System Q and L series 7 – 63


SFTWR, SFTWRP, SFTWL, SFTWLP Data shift instructions

7.3.5 SFTWR, SFTWRP, SFTWL, SFTWLP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
d —   — — — — — —
n1 —        —
n2 —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DSFR_ME1, DSFR_KE1, DSFR_IE1

GX Works2
SFTWR/SFTWL

d n1 n2

D
S
F
R
_
G P d n1 n2
E
1

Variables Set Data Meaning Data Type


d First number of device to be shifted BIN 16-bit
n1 Number of words to be shifted
BIN 16-bit
n2 Number of shifts

7 – 64
Data shift instructions SFTWR, SFTWRP, SFTWL, SFTWLP

Functions Shifting n word devices by n words


SFTWR Shifting to the right
This instruction shifts n1 words data in the devices starting from the device specified by d to
the right by n2 words.

n1=9, n2=4
n1
n2

d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d

30FH 1EH 100H 0H 1FFH 10 H 1FH 7FFH 2A H

d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d


0H 0H 0H 0H 30FH 1EH 100H 0H 1FFH

1)

1 Set to 0H
The n2 words data in the devices starting from the highest device are filled with 0s.
If the value specified by n1 or n2 is 0, the instruction will be not processed.
If the value of n2 is equal to or larger than the value of n1, the n1 words data in the devices
starting from the device specified by d will be filled with 0s.

SFTWL Shifting to the left


This instruction shifts the n1 words data in the devices starting from the device specified by d
to the left by n2 words.

n1=9, n2=4
n1
n2

d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d

1FFH 10H 0H 7FFH 3AH 1F H 30 H 0H FFH

d+8 d+7 d+6 d+5 d+4 d+3 d+2 d+1 d

3AH 1F H 30 H 0H FFH 0H 0H 0H 0H

1)

1
Set to 0H
The n2 words data in the devices starting from the lowest device are filled with 0s.
If the value specified by n1 or n2 is 0, the instruction will be not processed.
If the value of n2 is equal to or larger than the value of n1, the n1 words data in the devices
starting from the device specified by d will be filled with 0s.
Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n1 or n2 is negative. (Error code 4100)
● The range of devices specified by n1 exceeds the range of devices specified by d.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 65


SFTWR, SFTWRP, SFTWL, SFTWLP Data shift instructions

Program SFTWRP
Example 1
The following program shifts the 8 words (n1 = 8) data stored in the devices starting from D10
specified by d to the right by 2 words (n2 = 2), when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D17 D16 D15 D14 D13 D12 D11 D10


1FFH 0H 2AH 7FFH 10H 4EH 5FH FFH

D17 D16 D15 D14 D13 D12 D11 D10


1) 0H 0H 1FFH 0H 2AH 7FFH 10H 4EH

1
Set to 0H

Program SFTWLP
Example 2
The following program shifts the 12 words (n1 = 12) data stored in the devices starting from
D21 specified by d to the left by 5 words (n2 = 5), when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D2C D2B D2A D29 D28 D27 D26 D25 D24 D23 D22 D21
FFH EH 5H 0H 2AH FFH 3AH 1H 0H 0H 10 H 7FFH

D2C D2B D2A D29 D28 D27 D26 D25 D24 D23 D22 D21
FFH 3AH 1H 0H 0H 10 H 7FFH 0H 0H 0H 0H 0H 1)

1
Set to 0H

7 – 66
Bit processing instructions SFTWR, SFTWRP, SFTWL, SFTWLP

7.4 Bit processing instructions

The bit processing instructions change the condition (set and reset) of single bits or entire sec-
tions of bits. The condition of bits in data words can as well be tested with the bit processing
instructions.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
BSET BSET_M
BSETP BSETP_M
Set / reset single bits
BRST BRST_M
BRSTP BRSTP_M
TEST TEST_M

Test condition of single bits in TESTP TESTP_M


16-/32-bit data words DTEST DTEST_M
DTESTP DTESTP_M
BKRST BKRST_M
Reset sections of bits in a batch
BKRSTP BKRSTP_M

Programming MELSEC System Q and L series 7 – 67


BSET, BSETP, BRST, BRSTP Bit processing instructions

7.4.1 BSET, BSETP, BRST, BRSTP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BSET_ME1, BSET_KE1, BSET_IE1

GX Works2

BSET_GE1

Variables Set Data Meaning Data Type


d Device storing bits to be set or reset
BIN 16-bit
n Number of bit to be set or reset

7 – 68
Bit processing instructions BSET, BSETP, BRST, BRSTP

Functions Setting / resetting single bits


BSET Setting single bits of a word device
The BSET instruction sets the nth bit of a word device to 1. For n, a value between 0 and 15
(b0 to b15) can be specified. The word device is designated by d. If the value in n exceeds 15,
the BSET instruction is executed within the lower 4 bits (b0 to b3). In the following diagram n
is set to 6, so bit b6 is set.

BSET0E1
1
This bit is set.

BRST Resetting single bits in a word device


The BRST instruction resets the nth bit of a word device to 0. For n, a value between 0 and 15
(b0 to b15) can be specified. The word device is designated by d. If the value in n exceeds 15,
the BRST instruction is executed within the lower 4 bits (b0 to b3). In the following diagram n
is set to 11, so bit b11 is reset.

BRST0E1
1 This bit is reset.

Programming MELSEC System Q and L series 7 – 69


Bit processing instructions

Program BRSTP/BSETP
Example
The following program resets the 8th bit of D8 (b8) to 0 when the input XB is switched OFF,
and sets the 3rd bit of D8 (b3) to 1 when XB is switched ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8 b3 b0
D8 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1

b15 b8 b3 b0
D8 0 0 1 1 0 1 0 0 1 1 1 1 1 0 0 1

BSET_MB1, BSET_KB1, BSET_IB1, BRST0B1

NOTE Single bits in bit devices can be set or reset via a SET or an RST instruction as well. In this case
the bits of the word device must be specified. For example, the bit (b8) in data word D5 is
addressed as D5.8.

7 – 70
Bit processing instructions TEST, TESTP, DTEST, DTESTP

7.4.2 TEST, TESTP, DTEST, DTESTP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1        — —
s2         —
d       — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

TEST_ME1, TEST_KE1, TEST_IE1

GX Works2

TEST_GE1

Variables Set Data Meaning Data Type


s1 Number of device storing bits to be tested Word
s2 Number of bit to be tested Word
d Number of bit device storing condition of tested bit Bit

Programming MELSEC System Q and L series 7 – 71


TEST, TESTP, DTEST, DTESTP Bit processing instructions

Functions Test of single bits in 16- / 32-bit data words


TEST Bit test 16-bit
The TEST instruction checks the condition of a bit s2 in a word device s1. The test result is
stored in a bit device designated by d.
The device designated by d is set, if the tested bit is in condition 1, and reset, if the tested bit
is in condition 0.
The bit specified by s2 can be any bit between b0 and b15 in a 16-bit data word. When 16 or
more is designated at s2, the target is the bit data at the position indicated by the remainder of
s2 / 16. For example, when s2 = 18, the target is the data at b2 since the remainder of 18 / 16
is "2".
In the following diagram s2 is set to 5, so the condition of bit b5 in s1 is tested.

TEST0E1
1
Tested bit

DTEST Bit test 32-bit


The DTEST instruction checks the condition of a bit s2 in a word device s1 and (s1)+1. The
test result is stored in a bit device designated by d.
The device designated by d is set, if the tested bit is in condition 1, and reset, if the tested bit
is in condition 0.
The bit specified by s2 can be any bit between b0 and b31 in a 32-bit data word. When 32 or
more is designated at s2, the target is the bit data at the position indicated by the remainder of
s2 / 32. For example, when s2 = 34, the target is the data at b2 since the remainder of 34 / 16
is "2".
In the following diagram s2 is set to 21, so the condition of bit b21 in s1 is tested.

DTEST0E1
1
Tested bit

7 – 72
Bit processing instructions TEST, TESTP, DTEST, DTESTP

Program TESTP
Example 1
Depending on the test result of the bit (b10) in the 16-bit data word in D0, the following program
either resets or sets relay M0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

TEST_MB1, TEST_KB1, TEST_IB1, TEST0B1


1
Reset M0
2
Set M0

Program DTESTP
Example 2
Depending on the test result of the bit (b19) in the 32-bit data word in W0 and W1, the following
program either resets or sets output Y40.

MELSEC Instruction List Ladder Diagram IEC Instruction List

TEST_MB2, TEST_KB2, TEST_IB2, DTEST0B1


1
Reset Y40
2 Set Y40

Programming MELSEC System Q and L series 7 – 73


TEST, TESTP, DTEST, DTESTP Bit processing instructions

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.
Instead of applying the TEST instruction, a bit to be tested can also be specified as an input con-
tact (see diagram).

TEST_AB1

7 – 74
Bit processing instructions BKRST, BKRSTP

7.4.3 BKRST, BKRSTP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s    — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BKRSTME1, BKRSTKE1, BKRSTIE1

GX Works2

BKRSTGE1

Variables Set Data Meaning Data Type


s First number of device to be reset Bit
n Number of devices to be reset BIN 16-bit

Programming MELSEC System Q and L series 7 – 75


BKRST, BKRSTP Bit processing instructions

Functions Batch reset of bits


BKRST Reset instruction
The BKRST instruction resets n bits in the device designated by s.
For annunciators (F), the number n of annunciators stored in s is reset and the contents of the
registers SD64 through SD79 is cleared according to the reset annunciators. The remaining
data are shifted forward. Moreover, the number of annunciator entries in registers SD64
through SD79 is stored in register SD63.
For timers (T) and counters (C), after the execution of this instruction the setting values of n
timers and counters are reset to 0 and the inputs and outputs are reset.
For all other bit devices the number n of the devices starting from the device designated by s
are reset.
If the according device is already reset, its condition remains unchanged after execution of the
instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n exceeds the number of bits of the devices designated by s.
(Error code 4101)

Program BKRSTP
Example 1
With leading edge from X0, the following program resets the relays M0 through M7.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKRSTMB1, BKRSTKB1, BKRSTIB1, BKRST0B1


1
These bits remain unchanged.

7 – 76
Bit processing instructions BKRST, BKRSTP

Program BKRSTP
Example 2
With leading edge from X20, the following program resets bits from the bit (b2) in D10 to the
bit (b1) in D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

BKRST_MB2, BKRST_KB2, BKRST_IB2, BKRST0B2

Programming MELSEC System Q and L series 7 – 77


BKRST, BKRSTP Bit processing instructions

7 – 78
Data processing instructions

7.5 Data processing instructions


Data processing instructions search data in specified devices, check the number of set bits,
encode and decode data (e.g. for 7-segment displays), disunite and unite data, search maxi-
mum and minimum values, sort data, and calculate the totals of 16-/32-bit BIN data blocks.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
SER SER_M
SERP SERP_M
Search 16-/32-bit data
DSER DSER_M
DSERP DSERP_M
SUM SUM_M

Check data bits SUMP SUMP_M


(16-/32-bit) DSUM DSUM_M
DSUMP DSUMP_M
DECO DECO_M
DECOP DECOP_M
Encode/decode data
ENCO ENCO_M
ENCOP ENCOP_M
SEG SEG_M
7-segment decoding
SEGP SEGP_M
DIS DIS_M

Disunite/unite 16-bit data words DISP DISP_M


(4-bit units) UNI UNI_M
UNIP UNIP_M
NDIS NDIS_M

Disunite/unite 16-bit data values NDISP NDISP_M


(variable bit units) NUNI NUNI_M
NUNIP NUNIP_M
WTOB_MD
WTOB
WTOB_K_MD
WTOB_P_MD
WTOBP
Disunite/unite 16-bit data values WTOB_K_P_MD
(byte units) BTOW_MD
BTOW
BTOW_K_MD
BTOW_P_MD
BTOWP
BTOW_K_P_MD
MAX MAX_M

Search maximum values in MAXP MAXP_M


16-/32-bit data DMAX DMAX_M
DMAXP DMAXP_M
MIN MIN_M

Search minimum values in MINP MINP_M


16-/32-bit data DMIN DMIN_M
DMINP DMINP_M

Programming MELSEC System Q and L series 7 – 79


Data processing instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
SORT SORT_M
Sort 16-/32-bit data
DSORT DSORT_M
WSUM WSUM_M

Calculate totals of WSUMP WSUMP_M


16-/32-bit BIN data blocks DWSUM DWSUM_M
DWSUMP DWSUMP_M
MEAN
MEANP
Calculation of averages
DMEAN
DMEANP

7 – 80
Data processing instructions SER, SERP, DSER, DSERP

7.5.1 SER, SERP, DSER, DSERP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1         —
s2 —   — — — — — —
d —   —    — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SER__ME1, SER__KE1, SER__IE1

GX Works2

SER_GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Data value to be searched, or first number of device storing
s1 ANY16
this value

s2 Data to be searched through, or first number of device storing ANY16/ANY32


such data
Word
First number of device storing result of search Array [1..2] of
d
ANY16/ANY32
n Number of devices to be searched through ANY16

Programming MELSEC System Q and L series 7 – 81


SER, SERP, DSER, DSERP Data processing instructions

Functions Search data


SER / SERP Search 16-bit data
The SER instruction enables searching specified data in a specified search range. The search
operation starts from the first number of device designated by s2. The entry code being
searched for is specified by s1. The digit designation, i.e. the number of devices is specified
by n.
A CPU stores the result of the search in d and d+1 as array_d[1..2] of ANY16.
After finishing the search operation the position of the first device storing the data value is
stored in array_d[1] in d. Array_d[2] in d+1 stores the number of data values matching the entry
code.

3 6
2 7

1 Entry code
2
Start of search
3 Search range (n blocks)

4 Matching data

5
Search results
6 Position of match

7 Number of matches

SER_0E1
If the value in n is less than or equal to 0, the search operation will not be executed.
If no matching data is found, the content of d and d+1 (array_d[1] and array_d[2]) is 0.

7 – 82
Data processing instructions SER, SERP, DSER, DSERP

NOTE Provided the data to be searched through is stored in ascending order, the searching time can
be shortened by setting the special relay SM702.
SM702 ON:
The search range is halved and the size of the entry code determines in what half the code must
be stored. This half is devided once again for another decision. This operation is proceeded until
the matching value is found.

1 Entry code
2
Search range
3
Comparison to entry code
4 Processing sequence

5
Search data
DSER0E2

SM702 OFF:
The data search comparing the entry code to each data value starts from the beginning of the
search range.
If the search range is not sorted in ascending order, there will be no accurate result with SM702
set.

Programming MELSEC System Q and L series 7 – 83


SER, SERP, DSER, DSERP Data processing instructions

DSER / DSERP Search 32-bit data


The DSER instruction enables searching specified data in a specified search range. The
search operation starts from the first number of device designated by s2 (2 x n-devices). The
entry code being searched for is specified by s1 and (s1)+1. The digit designation, i.e. the
number of devices is specified by n.
The result of the search is stored in d and d+1 as array [1..2] of ANY16.
After finishing the search operation the position of the first device storing the data value is
stored in the least significant array_d[1] (d). The most significant array_d[2] (d+1) stores the
number of data values matching the entry code.

6
7

1
Entry code
2 Start of search
3 Search range (2 x n)

4
Matching data
5 Search results

6 Position of match

7
Number of matches
DSER0E1
If the value in n is less than or equal to 0, the search operation will not be executed.
If no matching data is found, the content of d and d+1 is 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The search range designated by n beginning from s2 exceeds the relevant device range.
(Error code 4101)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)
For details on index qualification refer to section 3.6.

7 – 84
Data processing instructions SER, SERP, DSER, DSERP

Program SERP
Example 1
With leading edge from X20, the following program compares data in D100 through D105 to
the data value in D0. The first matching position is stored in W0. The number of matches is
stored in W1.

Ladder Diagram IEC Instruction List


MELSEC Instruction List

2 4
2 5

1
Entry code
2
Search range
3 Search results

4 Position of first match

5
Number of matches
SER__MB1, SER__KB1, SER__IB1, SER_0B1

Programming MELSEC System Q and L series 7 – 85


SER, SERP, DSER, DSERP Data processing instructions

Program DSERP
Example 2
With leading edge from X20, the following program compares data in D100 through D111 to
the data value in D11 and D10. The first matching position is stored in W0. The number of
matches is stored in W1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

2 4
3 5

1
Entry code
2
Search range
3 Search results

4 Position of first match

5
Number of matches
SER__MB2, SER__KB2, SER__IB2, DSER_0B1

NOTE These programs will not run without variable definition in the header of the program organiza-
tion unit (POU). They would cause compiler or checker error messages. For details see section
3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 86
Data processing instructions SUM, SUMP, DSUM, DSUMP

7.5.2 SUM, SUMP, DSUM, DSUMP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SUM__ME1, SUM__KE1, SUM__IE1

GX Works2

SUM_GE1

Variables Set Data Meaning Data Type


s First number of device storing data of which set bits are counted
BIN 16-/32-bit
d First number of device storing number of set bits

Programming MELSEC System Q and L series 7 – 87


SUM, SUMP, DSUM, DSUMP Data processing instructions

Functions Check data bits


SUM 16-bit
The SUM instruction determines the number of bits set in a 16-bit data word. The device range
to be checked is specified by s. The number of set bits is stored in d.

1
Counting set bits
2
Binary coded number of bits (In this example 8 bits are set.)
SUM_0E1

DSUM 32-bit
The DSUM instruction determines the number of bits set in a 32-bit data word. The device
range to be checked is specified by s. The number of set bits is stored in d.

1
Counting set bits
2
Binary coded number of bits (In this example 16 bits are set.)
DSUM0E1

7 – 88
Data processing instructions SUM, SUMP, DSUM, DSUMP

Program SUMP
Example 1
With leading edge from X10, the following program determines the number of set inputs within
X8 through X10. The result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Storing the number of set bits in D0
SUM__MB1, SUM__KB1, SUM__IB1, SUM_0B1

Program DSUMP
Example 2
With leading edge from X10, the following program determines the number of set bits in D100
and D101. The result is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 Storing the number of set bits in D0


SUM__MB2, SUM__KB2, SUM__IB2, DSUM_0B1

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 89


DECO, DECOP Data processing instructions

7.5.3 DECO, DECOP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d    — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DECO_ME1, DECO_KE1, DECO_IE1

GX Works2

DECO_GE1

Variables Set Data Meaning Data Type


s Data to be decoded or device storing such data BIN 16-bit
d First number of device storing decoded value Address
n Number of bits containing coded data BIN 16-bit

7 – 90
Data processing instructions DECO, DECOP

Functions Decoding from 8 to 256 bits


DECO Decoding data
The DECO instruction decodes data in a device specified by s. The binary coded data is
decoded as decimal number. This decimal number (≤ 256) indicates bit x (bx) to be set of a
device specified by d.
The number of device addresses in s containing the coded data is specified by n.



   1
      
       

2
1 Binary value of s: 6
2
Bit b6 in d is set.

The variable n must be set between 1 and 8.


If n = 0, the instruction is not executed and the specified device addresses remain unchanged.
A bit device is processed as single bit and a word device as 16-bit data value.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The variable n is not set between 0 and 8. (Error code 4100)
● The bit x exceeds the relevant device range. (Error code 4101)

Programming MELSEC System Q and L series 7 – 91


DECO, DECOP Data processing instructions

Program DECOP
Example
With leading edge from X20, the following program decodes data at X0 through X2. The result
is stored in M10 through M17. The binary coded number 6 is contained in X0 through X2, so
bit b6 (M16) in M10 through M17 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Binary coded value 6
2
If the binary coded value is specified as 3 bits, 8 bits are occupied.
DECO_MB1, DECO_KB1, DECO_IB1, DECO0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 92
Data processing instructions ENCO, ENCOP

7.5.4 ENCO, ENCOP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s    — — — — — —
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ENCO_ME1, ENCO_KE1, ENCO_IB1

GX Works2

ENCO_GE1

Variables Set Data Meaning Data Type


s Decoded data or device storing such data
d First number of device storing coded data BIN 16-bit
n Number of bits containing coded value

Programming MELSEC System Q and L series 7 – 93


ENCO, ENCOP Data processing instructions

Functions Encoding from 256 to 8 bits


ENCO Encoding data
The ENCO instruction encodes data of a data record of up to 256 bits to a binary 8-bit data
sequence. The initial number of device storing data to be encoded is specified by s. The bit x
specified by s indicates the decimal value that will be stored binary encoded in d. The number
of bits in d containing the encoded data is specified by n.

& % $ # " !  
I          1

@    2

1 Bit b6 In s is set.
2 Binary value of d: 6

The variable n must be set between 1 and 8.


If n = 0, the instruction is not executed and the specified device addresses remain unchanged.
A bit device is processed as single bit and a word device as 16-bit data value.
If more than one bit is set processing starts with the highest bit.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The variable n is not set between 0 and 8. (Error code 4100)
● All data 2n bits from s are "0". (Error code = 4100)
● The range 2n bits from s exceeds the range of the relevant device. (Error code 4101)

7 – 94
Data processing instructions ENCO, ENCOP

Program ENCOP
Example
With leading edge from X20, the following program reads data in M10 through M17 and stores
it binary encoded in D8.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
If the encoded value is stored in 3 bits in d, 8 bits are occupied in s.
2
Binary encoded number 3 for set bit 3 (M13)
ENCO_MB1, ENCO_KB1, ENCO_IB1, ENCO0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 95


SEG, SEGP Data processing instructions

7.5.5 SEG, SEGP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SEG__ME1, SEG__ME1, SEG__IE1

GX Works2

SEG_GE1

Variables Set Data Meaning Data Type


s Data to be decoded, or first number of device storing such data
BIN 16-bit
d First number of device storing 7-segment data

7 – 96
Data processing instructions SEG, SEGP

Functions 7-Segment decoding


SEG / SEGP Decoding a 4-digit binary value
The SEG instruction converts a 4-digit binary value into 7-segment code in order to display the
values 0 to F. The data value or the initial number of data to be encoded is specified by s. The
7-segment data is stored in d.
If the encoded 7-segment data are output to bit devices, the initial device number and the digit
designation must always be specified in d. If a word device is specified by d, only the device
number is required.
Storage of data in several bit devices or in a word device applies to the following scheme:

1
Bit device
2 Word device
3 8 bits

4
These bits are always reset to 0.
5 7-segment data

SEG_0E1

Programming MELSEC System Q and L series 7 – 97


SEG, SEGP Data processing instructions

7-segment data
The following table contains an overview of 7-segment data in relation to the bit pattern of the
source data. The first bit (b0) of 7-segment data either represents the status of the first bit
device or the status of the least significant bit in a word device respectively.

s d
Assignment of Segments Display
HEX Bit Pattern B7 B6 B5 B4 B3 B2 B1 B0

0 0000 0 0 1 1 1 1 1 1 0
1 0001 0 0 0 0 0 1 1 0 I
2 0010 0 1 0 1 1 0 1 1 2
3 0011
b0
0 1 0 0 1 1 1 1 3
4 0100 0 1 1 0 0 1 1 0 4
5 0101 b5
b1 0 1 1 0 1 1 0 1 5
b6
6 0110 0 1 1 1 1 1 0 1 6
7 0111 b4
b2
0 0 1 0 0 1 1 1 7
8 1000 0 1 1 1 1 1 1 1 8
9 1001 b3 0 1 1 0 1 1 1 1 9
A 1010 0 1 1 1 0 1 1 1 A
B 1011 0 1 1 1 1 1 0 0 B
C 1100 0 0 1 1 1 0 0 1 C
D 1101 0 1 0 1 1 1 1 0 D
E 1110 0 1 1 1 1 0 0 1 E
F 1111 0 1 1 1 0 0 0 1 F

7 – 98
Data processing instructions SEG, SEGP

Program SEGP
Example
With leading edge from X0, the following program outputs the condition of inputs XC through
XF as 7-segment code to the outputs Y38 through Y3F. The conditions of outputs Y38 through
Y3F are maintained until they are overwritten with new data.

MELSEC Instruction List Ladder Diagram IEC Instruction List

SEG__MB1, SEG__KB1, SEG__IB1, SEG_0B1

Programming MELSEC System Q and L series 7 – 99


DIS, DISP Data processing instructions

7.5.6 DIS, DISP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DIS__ME1, DIS__KE1, DIS__IE1

GX Works2

DIS__GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be disunited
d First number of device storing disunited data
BIN 16-bit
Number of 4-bit groupings to be disunited.
n
No processing for n = 0.

7 – 100
Data processing instructions DIS, DISP

Functions Disuniting 16-bit data


DIS Disuniting 16-bit data values
The DIS instruction disunites a 16-bit data value to groupings of 4 bits and stores their condi-
tions successively in up to 4 destination devices. For this instruction, the data value to be dis-
united in s, the number of 4-bit groupings in n, and the first number of destination device in d
must be specified. Further 4-bit groupings are stored in d+n.

1
These bits are reset to 0.
2 Storage area
DIS_0E1
The upper 12 bits of the destination devices beginning from device number in d, are reset to 0.
The variable n can be set from 1 to 4 (corresponding 4 to 16 bits).
For n = 0 no operation is executed and the specified number of device remains unchanged.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n is not set between 0 and 4.
(Error code 4100)
● The storage range d specified by n exceeds the relevant device range.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 101


DIS, DISP Data processing instructions

Program DISP
Example
With leading edge from X0, the following program disunites the 16-bit data value in D0 and
stores the bit pattern in groupings of 4 bits in series in D10 through D13.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are reset to 0.
2
Storage area
DIS__MB1, DIS__KB1, DIS__IB1, DIS_0B1

7 – 102
Data processing instructions UNI, UNIP

7.5.7 UNI, UNIP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

UNI__ME1, UNI__KE1, UNI__IE1

GX Works2

UNI_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be united
d First number of device storing united data
BIN 16-bit
Number of 4-bit groupings to be united.
n
No processing for n = 0.

Programming MELSEC System Q and L series 7 – 103


UNI, UNIP Data processing instructions

Functions Uniting 16-bit data


UNI Uniting 16-bit data values
The UNI instruction separates each 4 lowest bits of up to four 16-bit data values and unites
their conditions in one 16-bit data value. For this instruction, the first number of device storing
the data values in s to be united, the number of successive devices n, and the destination
address in d must be specified.

1
These bits are ignored.
2 4-bit groupings to be stored in d
UNI_0E1
The lower 4 bits of the source devices beginning from device number in d, are reset to 0.
The variable n can be set from 1 to 4.
For n = 0 no operation is executed and the specified number of device remains unchanged.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n is not set within 0 and 4.
(Error code 4100)
● The storage range s specified by n exceeds the relevant device range.
(Error code 4101)

7 – 104
Data processing instructions UNI, UNIP

Program UNIP
Example
With leading edge from X0, the following program unites each lowest 4 bits (b0 through b3) of
data registers D0 through D2 successively to one 16-bit data value (the highest 4 digits are "0")
in D10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
4-bit groupings to be stored in D10
UNI__MB1, UNI__KB1, UNI__IB1, UNI_0B1

Programming MELSEC System Q and L series 7 – 105


NDIS, NDISP, NUNI, NUNIP Data processing instructions

7.5.8 NDIS, NDISP, NUNI, NUNIP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
d —   — — — — — —
s2 —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

NDIS_ME1, NDIS_KE1, NDIS_IE1

GX Works2

NDIS_GE1

Variables Set Data Meaning Data Type


s1 First number of device storing data to be disunited/united
d First number of device storing disunited/united data BIN 16-bit
s2 Number of bits to be disunited/united in bit groupings

7 – 106
Data processing instructions NDIS, NDISP, NUNI, NUNIP

Functions Disuniting or uniting of data in random bit groupings


NDIS Disuniting data
The NDIS instruction disunites data in devices specified from s1 on to bit groupings with a
number of bits specified by s2. The disunited bit groupings are stored separately in the device
specified by d onwards.

1
Size of bit grouping
2
The 0 indicates the end of processing.
NDIS0E1
The size of bit groupings specified by s2 can be set within 1 and 16 bits.
Values in s2 are processed from the first device address in s2 on and up to the address with
the entry 0.
Do not overlap the device range for data to be dissociated (s1 to end range of s1) with the
device range which stores the dissociated data (d to end range of d). If overlapped, the correct
operation result may not be obtained.
Do not specify the same device number for s1, s2, and d. In this case the operation does not
work correctly.

Programming MELSEC System Q and L series 7 – 107


NDIS, NDISP, NUNI, NUNIP Data processing instructions

NUNI Uniting data


The NUNI instruction separates bit groupings of a size specified by s2 from devices specified
by s1 and unites these bit groupings in one data value. The bit groupings are stored
successively from the device specified by d on.

1
Size of bit groupings
2
The 0 indicates the end of processing.
NUNI0E1
The size of bit groupings specified by s2 can be set within 1 and 16 bits.
Values in s2 are processed from the first device address in s2 on and up to the address with
the entry 0.
Do not overlap the device range for data to be linked (s1 to end range of s1) with the device
range which stores the linked data (d to end range of d). If overlapped, the correct operation
result may not be obtained.
Do not overlap the device numbers to be designated at s1, s2, and d. In this case the operation
does not work correctly.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The bit groupings of a size specified by s2 in the devices specified by s1 or d exceed the
relevant storage device range.
(Error code 4101)
● The size of bit groupings specified by s2 exceeds the valid range of 1 to 16 bits.
(Error code 4100)

7 – 108
Data processing instructions NDIS, NDISP, NUNI, NUNIP

Program NDISP
Example 1
The following program separates the bit groupings b0 to b3 (4), b4 to b6 (3), and b7 to b12 (6)
from D0 and stores each single bit grouping beginning from bit grouping b0 to b3 in D10
through D12.
The values in brackets indicate the size of bit groupings in D20 through D22. D23 must store
the value 0 (see functions).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are ignored.
2 These bits are reset to 0.
NDIS_MB1, NDIS_KB1, NDIS_IB1, NDIS0B1

Programming MELSEC System Q and L series 7 – 109


NDIS, NDISP, NUNI, NUNIP Data processing instructions

Program NUNIP
Example 2
The following program separates the bit groupings b0 to b3 (4), b0 to b2 (3), and b0 to b5 (6)
from D10 through D12 and stores the bit groupings successively in D0 beginning from bit
grouping b0 to b3.
The values in brackets indicate the size of bit groupings in D20 through D22. D23 must store
the value 0 (see functions).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bits are ignored.
2 These bits are reset to 0.
NDIS_MB2, NDIS_KB2, NDIS_IB2, NUNI0B1

7 – 110
Data processing instructions WTOB, WTOBP, BTOW, BTOWP

7.5.9 WTOB, WTOBP, BTOW, BTOWP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WTOB_ME1, WTOB_KE1, WTOB_IE1

GX Works2

WOB_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be disunited/united in byte units
d First number of device storing disunited/inited bytes BIN 16-bit
n Number of byte units to be disunited/united

Programming MELSEC System Q and L series 7 – 111


WTOB, WTOBP, BTOW, BTOWP Data processing instructions

Functions Disuniting and uniting data in byte units


WTOB Disuniting data
The WTOB instruction disunites a 16-bit data value to byte units and stores their conditions
successively in destination devices. For this instruction the data values in s to be disunited, the
number of byte units in n, and the first number of destination device in d must be specified.
Further byte units are stored in d+n. For storage only the lowest bytes of the devices specified
by d are used.

1
Highest bytes
2
Lowest bytes
3
Data of the according lowest bytes
4 Data of the according highest bytes

WTOB0E1
For example, if n = 5, 5 bytes are disunited from the device specified by s through s+2 and
stored successively in the lowest bytes of the devices specified by d through d+4.

1 These bytes are ignored.


WTOB0E2
The number of byte units specified by n automatically determines the range of 16-bit data in s
and the storage range of the byte units in d.
If n = 0, the instruction is not executed and the specified device addresses remain unchanged.
The highest bytes in the devices specified by d are set to the value "00H".

1 These bytes are set to "00H".


WTOB0E3

7 – 112
Data processing instructions WTOB, WTOBP, BTOW, BTOWP

BTOW Uniting data


The BTOW instruction separates any lowest bytes of 16-bit data values and stores their condi-
tions in 16-bit data values. For this instruction, the initial number of data value in s to be united,
the number of byte units n, and destination device in d must be specified.

1 These bytes are ignored.


2
Data of 1st through nth byte
3
Data of 2nd, 4th, and nth byte
4 Data of 1st, 3rd, and (n-1)th byte

BTOW0E1
For example, if n = 5, the 5 lowest bytes are disunited from the device specified by s through
s+4 and stored successively in the devices specified by d through d+2.

1
This byte is set to "00H".
BTOW0E2
The number of byte units specified by n automatically determines the range of byte data in s
and the storage range of the byte data in d.
If n = 0, the instruction is not executed and the specified device addresses remain unchanged.
The highest bytes in the devices specified by s are ignored on processing.
The operation is even processed correctly in cases where the storage ranges of s through s+n
and d through d+n overlap. The following diagram shows a case where the lowest bytes are
separated from D11 through D16 and stored again succcessively in D12 through D14.

BTOW0E3

Programming MELSEC System Q and L series 7 – 113


WTOB, WTOBP, BTOW, BTOWP Data processing instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of byte units specified by n, that are stored in the device specified by s, exceeds
the relevant storage device range.
(Error code 4101)
● The number of byte units specified by n, that are stored in the device specified by d, exceeds
the relevant storage device range.
(Error code 4101)

Program WTOBP
Example 1
With leading edge from X0, the following program separates 6 bytes in D10 through D12 suc-
cessively and stores these bytes in the lowest bytes in D20 through D25.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WTOB_MB1, WTOB_KB1, WTOB_IB1, WTOB0B1

7 – 114
Data processing instructions WTOB, WTOBP, BTOW, BTOWP

Program BTOWP
Example 2
With leading edge from X0, the following program separates the 6 lowest bytes in registers D20
through D25 and unites these bytes successively in D10 through D12.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
These bytes are ignored.
WTOB_MB2, WTOB_KB2, WTOB_IB2, BTOW0B1

Programming MELSEC System Q and L series 7 – 115


MAX, MAXP, DMAX, DMAXP Data processing instructions

7.5.10 MAX, MAXP, DMAX, DMAXP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

MAX__ME1, MAX__KE1, MAX__IE1

GX Works2

MAX__GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be searched through for maximum values
BIN 16-/32-bit
d First number of device storing search result
n Number of data blocks to be searched through BIN 16-bit

7 – 116
Data processing instructions MAX, MAXP, DMAX, DMAXP

Functions Searching maximum values in 16-/32-bit data


MAX Searching maximum values in 16-bit data
The MAX instruction searches for maximum values in 16-bit data blocks. The number of data
blocks to be searched through is specified by n. The greatest value found in s through s+(n-1)
is stored in d.
The first position in s through s+(n-1) where the maximum value is found is counted beginning
from s = 1 and stored in d+1. The number of existing identical maximum values is stored in d+2.

1 Found maximum value


2 First position the value has been found at
3
Number of identical maximum values
MAX_0E1

DMAX Searching maximum values in 32-bit data


The DMAX instruction searches for maximum values in 32-bit data blocks. The number of data
blocks to be searched through is specified by n. The greatest value found in s through s+(n-1)
is stored in d.
The first position in s through s+(n-1) where the maximum value is found is counted beginning
from s = 1 and stored in d+2. The number of existing identical maximum values is stored in d+3.

1
Found maximum value
2
First position the value has been found at
3 Number of identical maximum values

DMAX_0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks specified by n stored in the devices specified by s exceeds the
relevant storage device range.
(Error code 4101)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 117


MAX, MAXP, DMAX, DMAXP Data processing instructions

Program MAXP
Example 1
With leading edge from X1C, the following program subtracts data in R0 through R3 from data
in D100 through D103 and stores the result in D150 through D153. The number of 16-bit data
blocks (4) is specified in D0.
In the following step, as well with leading edge from X1C, the registers D150 through D153 are
searched through for the maximum value. The value found is stored in D200, its position is
stored in D201, and the number of identical maximum values is stored in D202.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MAX__MB1, MAX__KB1, MAX__IB1, MAX_0B1

Program DMAXP
Example 2
With leading edge from X20, the following program searches for the maximum value of 32-bit
data in D100 and D101. The position of the value is stored in D102, the number of identical
maximum values is stored in D103.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MAX__MB2, MAX__KB2, MAX__IB2, DMAX_0B1

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 118
Data processing instructions MIN, MINP, DMIN, DMINP

7.5.11 MIN, MINP, DMIN, DMINP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

MIN__ME1, MIN__KE1, MIN__IE1

GX Works2

MIN__GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be searched through for minimum values
BIN 16-/32-bit
d First number of device storing search result
n Number of data blocks to be searched through BIN 16-bit

Programming MELSEC System Q and L series 7 – 119


MIN, MINP, DMIN, DMINP Data processing instructions

Functions Searching minimum values in 16-/32-bit data


MIN Searching minimum values in 16-bit data
The MIN instruction searches for minimum values in 16-bit data blocks. The number of data
blocks to be searched through is specified by n. The smallest value found in s through s+(n-1)
is stored in d.
The first position in s through s+(n-1) where the minimum value is found is counted beginning
from s = 1 and stored in d+1. The number of existing identical minimum values is stored in d+2.

1 Found minimum value


2 First position the value has been found at
3
Number of identical minimum values
MIN_0E1

DMIN Searching minimum values in 32-bit data


The DMIN instruction searches for minimum values in 32-bit data blocks. The number of data
blocks to be searched through is specified by n. The smallest value found in s through s+(n-1)
is stored in d and d+1.
The first position in s through s+(n-1) where the minimum value is found is stored in d+2. The
number of existing identical minimum values is stored in d+3.

1
Found minimum value
2
First position the value has been found at
3
Number of identical minimum values
DMIN_0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of data blocks specified by n stored in the devices specified by s exceeds the
relevant storage device range.
(Error code 4101)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 120
Data processing instructions MIN, MINP, DMIN, DMINP

Program MINP
Example 1
With leading edge from X1C, the following program adds data in D100 through D103 to data in
R0 through R3 and stores the result in D150 through D153. The number of 16-bit data blocks
(4) is specified in D0.
In the following step, as well with leading edge from X1C, the registers D150 through D153 is
searched through for the minimum value. The value found is stored in D200, its position is
stored in D201, and the number of identical minimum values is stored in D202.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MIN__MB1, MIN__KB1, MIN__IB1, MIN_0B1

Program DMINP
Example 2
With leading edge from X20, the following program searches for the minimum value of 32-bit
data in D0 through D7 and stores the value in D100 and D101. The position of the value is
stored in D102, the number of identical minimum values is stored in D103.

MELSEC Instruction List Ladder Diagram IEC Instruction List

MIN__MB2, MIN__KB2, MIN__IB2, DMIN_0B1

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 121


SORT, DSORT Data processing instructions

7.5.12 SORT, DSORT

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —
n         —
s2         —
d1  — — — — — — — —
d2 —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

SORT_ME1, SORT_KE1, SORT_IE1

GX Works2

SORT_GE1

Variables Set Data Meaning Data Type


s1 First number of device storing data to be sorted BIN 16-/32-bit
n Number of data blocks to be sorted BIN 16-bit
s2 Number of data blocks to be compared each sort operation BIN 16-bit
d1 Number of bit to be set after finishing sort operation Bit
d2 For system use only BIN 16-bit

7 – 122
Data processing instructions SORT, DSORT

Functions Sorting 16-/32-bit data


SORT Sorting 16-bit data
The SORT instruction sorts 16-bit data specified by s1 in ascending or descending order. The
number of data to be sorted is specified by n.
The sorting order is set via the special relay SM703:
– SM703 OFF: Ascending order
– SM703 ON: Descending order

1
Data to be sorted
2
Data sorted in ascending order (SM703 = OFF)
3
Data sorted in descending order (SM703 = ON)
SORT_0E1
For finishing the SORT instruction several scans are required. The number of required scans
can be calculated by the division of the maximum number of scans by the number of 16-bit data
specified in s2, to be compared each scan (decimal fractions are rounded up). Increasing the
number of 16-bit data specified in s2 reduces the number of required scans for sorting but
increases the processing time per scan.
The required number of sorting scans until finishing the sort operation is calculated via the fol-
lowing equation:
Required number of sorting scans = ((n) x (n-1)) / (2 x (s2))
For example, for n = 10 and s2 = 1 the result is 45 sort scans until finishing the sort operation.
For n = 10 and s2 = 2 the result is 22.5. Rounded up, 23 sort scans are required.
The bit specified in d1 is reset during the sort operation and will be set again when the sort
operation is finished. This bit remains set and must be reset by appropriate programming.
The devices specified in d2 and (d2)+1 are used for internal system processing during the sort
operation. So, these devices must not be changed by programming.
If the value in n is changed during the operation, the operation is processed with the currently
set number of 16-bit data.
By resetting the execution condition, the operation will be terminated. Upon setting the execu-
tion condition again, the sort operation will be restarted.
To execute another sort operation immediately after the completion of the previous sort, turn
OFF the execution command once, then turn it ON.

Programming MELSEC System Q and L series 7 – 123


SORT, DSORT Data processing instructions

DSORT Sorting 32-bit data


The DSORT instruction sorts 32-data specified by s1 in ascending or descending order. The
number of data to be sorted is specified by n.
The sorting order is set via the special relay SM703:
– SM703 OFF: Ascending order
– SM703 ON: Descending order

1 Data to be sorted
2
Data sorted in ascending order (SM703 = OFF)
3
Data sorted in descending order (SM703 = ON)
DSORT0E1
For finishing the DSORT instruction several scans are required. The number of required scans
can be calculated by the division of the maximum number of scans by the number of 32-bit data
specified in s2, to be compared each scan (decimal fractions are rounded up). Increasing the
number of 32-bit data specified in s2 reduces the number of required scans for sorting but
increases the processing time per scan.
The required number of sorting scans until finishing the sort operation is calculated via the fol-
lowing equation:
Required number of sorting scans = ((n) x (n-1)) / (2 x (s2))
For example, for n = 10 and s2 = 1 the result is 45 sort scans until finishing the sort operation.
For n = 10 and s2 = 2 the result is 22.5. Rounded up, 23 sort scans are required.
The bit specified in d1 is reset during the sort operation and will be set again when the sort
operation is finished. This bit remains set and must be reset by appropriate programming.
The devices specified in d2 and (d2)+1 are used for internal system processing during the sort
operation. So, these devices must not be changed by programming.
If the value in n is changed during the operation, the operation is processed with the currently
set number of 32-bit data.
By resetting the execution condition, the operation will be terminated. Upon setting the execu-
tion condition again, the sort operation will be restarted.
To execute another sort operation immediately after the completion of the previous sort, turn
OFF the execution command once, then turn it ON.

7 – 124
Data processing instructions SORT, DSORT

Operation In the following cases an operation occurs, the error flag (SM0) turns ON, and an error code is
Errors stored into SD0.
● The range specified by n (SORT, SORTP) or 2 x n (DSORT, DSORTP) in the device specified
by s1 exceeds the relevant storage device range.
(Error code 4101)
● s2 is 0 or is a negative value.
(Error code: 4100)
● The device range of the (n/2 x n) points starting from the device designated by s1 overlaps
with the device range of the 2 points starting from the device designated by d2.
(Error code: 4101)

Program SORT
Example
While X3 is set, the following program sorts 16-bit data in D1 through D4. In a first step with
leading edge from X2, the values 35, -10, 500, and -124 are written to the registers D1 through
D4. Then sorting starts. The sorting order is determined via X0 (set SM703) and X1 (reset
SM703). After finishing the sort operation the output Y10 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

SORT_MB1, SORT_KB1, SORT_IB1

Programming MELSEC System Q and L series 7 – 125


WSUM, WSUMP Data processing instructions

7.5.13 WSUM, WSUMP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d        — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

WSUM_ME1, WSUM_KE1, WSUM_IE1

GX Works2

WSUM_GE1

Variables Set Data Meaning Data Type


s First number of device storing data to be added BIN 16-bit
d First number of device storing result BIN 32-bit
n Number of data blocks to be added BIN 16-bit

7 – 126
Data processing instructions WSUM, WSUMP

Functions Calculating totals of 16-bit BIN data blocks


WSUM Calculation of totals
The WSUM instruction calculates the total of 16-bit data blocks in the device specified by s.
The number of data blocks to be summed up is specified by n. The result is stored in the device
specified by d.

WSUM0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The range specified by n in the device specified by s exceeds the relevant storage device
range.
(Error code 4101)

Program WSUMP
Example
With leading edge from X1C, the following program adds BIN 16-bit data blocks in D10 through
D14 and stores the result in D100 and D101.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WSUM_MB1, WSUM_KB1, WSUM_IB1, WSUM0B1

Programming MELSEC System Q and L series 7 – 127


DWSUM, DWSUMP Data processing instructions

7.5.14 DWSUM, DWSUMP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d    — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DWSUMME1, DWSUMKE1, DWSUMIE1

GX Works2

DWSUMGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s First number of device storing data to be added BIN 32-bit ANY32
Array [1..4] of
d First number of device storing result BIN 64-bit
ANY16
n Number of data blocks to be added BIN 16-bit ANY16

7 – 128
Data processing instructions DWSUM, DWSUMP

Functions Calculating totals of 32-bit BIN data blocks


DWSUM Calculation of totals
The DWSUM instruction calculates the total of 32-bit data blocks in the device specified by s.
The number of data blocks to be summed up is specified by n. The result is stored in array[1]
through array[4] in the device specified by d.

DWSUM0E1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The range specified by n in the device specified by s exceeds the relevant storage device
range.
(Error code 4101)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program DWSUMP
Example
With leading edge from X20, the following program adds 32-bit BIN data blocks in D100
through D107 and stores the result in D10 through D13.

MELSEC Instruction List Ladder Diagram IEC Instruction List

WSUM_MB2, WSUM_KB2, WSUM_IB2, DWSUM0B1

NOTE This program will not run without variable definition in the header of the program organization
unit (POU). It would cause compiler or checker error messages. For details see section 3.5.2
"Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 129


MEAN, MEANP, DMEAN, DMEANP Data processing instructions

7.5.15 MEAN, MEANP, DMEAN, DMEANP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
MEAN/DMEAN
4
s d n

P s d n
6

Variables Set Data Meaning Data Type


s First number of device storing data to be averaged
BIN 16/32-bit
d First number of device storing result
Number of data or number of devices where the number of data are stored
n BIN 16-bit
(Setting range: 1 to 32767)

7 – 130
Data processing instructions

Functions Calculating averages of 16/32-bit BIN data


MEAN Calculation of averages (16-bit data)
This instruction calculates the mean of 16-bit BIN data in n-point devices starting from the
device specified by s. The result is stored in the device specified by d.

s
Average value d
s+1
s+2 n

s+(n–1)

If the value calculated is not integer, this instruction will drop the number of decimal places.
If the value specified by n is 0, the instruction will be not processed.

DMEAN Calculation of averages (32-bit data)


This instruction calculates the mean of 32-bit BIN data in n-point devices starting from the
device specified by s. The result is stored in the device specified by d.

s +1, s Average value d +1, d


s +3, s +2
n

s +2n 1, s +2n 2

If the value calculated is not integer, this instruction will drop the number of decimal places.
If the value specified by n is 0, the instruction will be not processed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified by n is other than 0 to 32767.
(Error code 4100)
● The range of the n-point devices starting from the device specified by s exceeds the range
of the devices specified by d.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 131


MEAN, MEANP, DMEAN, DMEANP Data processing instructions

Program MEAN
Example 1
The following program stores the average value of 16-bit data stored from D0 to D2 into D10,
when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0 105 (BIN)
D1 555 (BIN) D10 550 (BIN)
D2 990 (BIN)

Program DMEAN
Example 2
The following program stores the average value of 32-bit data stored from D0 to D5 into D10
and D11, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D1,D0 623541 (BIN)


D3,D2 4753647 (BIN) D11,D10 2101176 (BIN)
D5,D4 926342 (BIN)

7 – 132
Structured program instructions

7.6 Structured program instructions


Structured program instructions call programs and parts of programs or switch over between
them. In addition, instructions for index qualification and program repetitions (loops) are sup-
plied.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
FOR FOR_M
NEXT NEXT_M
Repetition instructions
BREAK BREAK_MD
BREAKP BREAK_P_MD
CALL CALL_M
CALLP CALLP_M
Subroutine program calls RET RET_M
FCALL FCALL_MD
FCALLP FCALL_P_MD
ECALL ECALL_M
ECALLP ECALLP_M
Subroutine calls between
program files EFCALL EFCALL_M
(only possible with GX Works2)
EFCALLP EFCALLP_M
XCALL
COM COM_M
Select refresh CCOM
CCOMP
IX IX_MD
Index qualification of entire ladders
IXEND IXEND_MD

Designation of qualification values in IXDEV IXDEV_M


index qualification of entire ladders IXSET IXSET_M

Programming MELSEC System Q and L series 7 – 133


FOR, NEXT Structured program instructions

7.6.1 FOR, NEXT

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FOR__ME1, FOR__KE1, FOR__IE1

GX Works2

FOR_GE1

Variables Set Data Meaning Data Type


n Number of repetitions of the FOR/NEXT loops (from 1 to 32767) BIN 16-bit

7 – 134
Structured program instructions FOR, NEXT

Functions FOR/NEXT loop instruction


FOR/NEXT Loop instruction
The FOR/NEXT loop repeats single program sequences without setting an input condition. The
program sequence located between the FOR and the NEXT command is repeated for n times.
After executing the FOR/NEXT loop for n times, the next program step following the NEXT com-
mand is executed.
The variable n can be specified from 1 to 32767. If n is less than or equal to 0, it is processed
as 1. Thus, the FOR/NEXT loop will be executed at least once.
If a program sequence between the FOR/NEXT loop is not intended to be executed, it can be
skipped by a jump instruction (CJ or SCJ).
In total, up to 16 levels of FOR/NEXT loops can be nested up. The following diagram illustrates
the principle of nesting:

FOR__AB1

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The END/FEND or GOEND instruction is executed after a FOR instruction and before the
NEXT instruction.
(Error code 4200)
● The NEXT instruction is executed before the FOR instruction.
(Error code 4201)
● A STOP instruction is programmed within a FOR/NEXT loop.
(Error code 4200)
● The maximum number of nesting levels is exceeded.
(Error code 4202)

Programming MELSEC System Q and L series 7 – 135


FOR, NEXT Structured program instructions

NOTES In order to terminate the execution of a FOR/NEXT loop before it is finished, a BREAK instruction
must be programmed.
Apply the EGP/EGF instruction, to connect a switch condition to the FOR/NEXT instruction.
Branching into a FOR to NEXT loop using a JMP or other branch instruction from the outside of
the FOR to NEXT loop is not possible.

Program The following program processes the program sequence between FOR and NEXT for four
Example times, if X8 is OFF. The FOR/NEXT loop is skipped, if X8 is ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

FOR__MB1, FOR__KB1, FOR__IB1

7 – 136
Structured program instructions BREAK, BREAKP

7.6.2 BREAK, BREAKP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G P
d        — —
p — — — — — — — — 

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List
(IEC Instruction)

BREAKME1, BREAKKE1, BREAKIE1

GX Works2

BREAKGE1

Variables Set Data Meaning Data Type


d Device storing the remaining number of FOR/NEXT loops BIN 16-bit
Destination address (Pointer/Label) to be jumped to after executing the BREAK
p Pointer/label
instruction

Programming MELSEC System Q and L series 7 – 137


BREAK, BREAKP Structured program instructions

Functions Terminating a FOR/NEXT loop


BREAK Terminating the FOR/NEXT execution
The BREAK instruction terminates a FOR/NEXT loop execution and jumps to the pointer/label
specified by p. Only a pointer within the same program file can be assigned to Pn. If a pointer
of the other program file is used, an operation error will be returned.

BREAKAB1

The number of remaining FOR/NEXT loops to be executed is stored in the device specified
by d. Note that the remaining number includes the operation when the BREAK instruction is
executed.
The BREAK instruction can only be applied during the execution of a FOR/NEXT loop.
The BREAK instruction can only be applied to one nesting level. For several nesting levels the
appropriate number of BREAK instructions must be executed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The BREAK instruction was executed without a FOR/NEXT loop.
(Error code 4203)
● The jump destination for the pointer designated by Pn does not exist.
(Error code: 4210)
● The pointer of another program file is designated for Pn.
(Error code: 4210)

7 – 138
Structured program instructions BREAK, BREAKP

Program BREAKP
Example
The following program terminates the execution in the 30th FOR/NEXT loop and jumps to the
program part specified with label_0. The number of remaining FOR/NEXT loops (70) is stored
in D1.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

BREAKMB1, BREAKKB1, BREAKIB1

Programming MELSEC System Q and L series 7 – 139


CALL, CALLP Structured program instructions

7.6.3 CALL, CALLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H
Bit Word Bit Word U\G P
p —   — — — — — 

s1
– 1)        —
s5
1
Annunciators (F) cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

CALL_ME1, CALL_KE1

GX Works2

CALL_GE1

Variables Set Data Meaning Data Type


pn Address number (pointer/label) of subroutine program Pointer/label
bits,
s1 to s5 Number of the device to be passed as an argument to a subroutine program BIN 16-bit,
BIN 32-bit

NOTE The CALL instruction should not be used with the IEC editor because the subroutine structure
is generated bx the GX IEC Developer.

7 – 140
Structured program instructions CALL, CALLP

Functions Calling a subroutine program


CALL Subroutine program call
The CALL instruction calls a subroutine program specified by a pointer Pxx in the GX Works2
or by a label in the GX IEC Developer, respectively. The pointer (label) addresses range from
P(label)0 to P(label)4095. Refer to the notes on programming pointer (label) addresses for the
jump instructions (CJ, SCJ, JMP).
CALL0E1
1
Main routine program
2
Subroutine program

When function devices (FX, FY, FD) are used by a subroutine program, specify a device with
s1 to s5 corresponding to the function device. The contents to the devices specified by s1 to
s5 are as indicated below.

Prior to execution of the subroutine program, bit data is transmitted to FX, and word data is
transmitted to FD.
After the execution of the subroutine program, the contents of FY and FD are transmitted to the
corresponding devices.
The processing units for the function devices are as follows:
● FX, FY: Bits
● FD: 4-word units
The size of the data to be dealt with will differ depending on the device specified in the argu-
ment. The device specified as a function device should be secured for the data size. An error
will occur if it cannot be secured for the data size.

Function devices Device Data Size Remark

FX Bit device 1 point



FY When bit designation is made for word device 1 bit

When digit designation of a bit device is used 1) 4 words The data size varies depen-
FD ding on the instruction to be
Word device 4 words used.

1 An error will not occur even when the device number specified by s1 to s5 is not a multiple of 16 at the
digit designation of the bit device.

Programming MELSEC System Q and L series 7 – 141


CALL, CALLP Structured program instructions

X0
CALL P0 M0 D0 D30

Occupies from D30 to D33 (Transfer to FD2).


Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).

s1 to s5 can be used with the CALL (P) instruction.


The number of function devices to be used by a subroutine program must be identical to the
number of arguments in the CALL (P) instruction.
Also, the types of the function device and CALL (P) argument used should be identical.
Device numbers specified by the CALL (P) instruction should not overlap. If they do overlap, it
will not be possible to obtain accurate calculations.
The device used in the argument of the CALL (P) instruction should not be used in a subroutine
program. If used, it will not be possible to obtain accurate calculations. (Refer to the following
program example.)
When the device, either timer or counter, is used in the argument of the CALL(P) instruction,
only the current value is transmitted/received.

7 – 142
Structured program instructions CALL, CALLP

Incorrect operation example


The following example shows the operation performed when D0 is specified for FD0 in the sub-
routine program and D1 is used in the subroutine program.

Operation performed after subroutine program execution

Before the execution Immediately after At the time of After the


of subroutine the execution of subroutine program execution of RET
program CALL instruction execution instruction

D0 0 D0 0 D0 0 D0 33 *2
D1 10 D1 10 D1 110 *1 D1 110 *3
D2 100 D2 100 D2 100 D2 100 *2
Transfer Transfer
D3 1000 D3 1000 D3 1000 D3 1000 *2

Indefinite 0 33 *1 Indefinite
Indefinite 10 1 *1 Indefinite
FD0 FD0 FD0 FD0
Indefinite 100 100 Indefinite
Indefinite 1000 1000 Indefinite

1
Stores the execution result of the subroutine program.
2
Replaced by the value of the function device.
3
D1 does not reflect the value of the function device.

Programming MELSEC System Q and L series 7 – 143


CALL, CALLP Structured program instructions

Correct operation example


The following example shows the operation performed when D0 is specified for FD0 in the sub-
routine program and D4 is used in the subroutine program.

Operation performed after subroutine program execution

Before the execution Immediately after At the time of After the


of subroutine the execution of subroutine program execution of RET
program CALL instruction execution instruction

D0 0 D0 0 D0 0 D0 33 *2
D1 10 D1 10 D1 10 D1 1 *2
D2 100 Transfer D2 100 D2 100 D2 100 *2
D3 1000 D3 1000 D3 1000 Transfer D3 1000 *2
D4 0 D4 0 D4 100 *1 D4 100

Indefinite 0 33 *1 Indefinite
Indefinite 10 1 *1 Indefinite
FD0 FD0 FD0 FD0
Indefinite 100 100 Indefinite
Indefinite 1000 1000 Indefinite

1 Stores the execution result of the subroutine program.


2
Replaced by the value of the function device.

The CALL instruction calls a subroutine program specified by pointer (label) addresses. In
total, up to 16 subprogram nesting levels can be addressed.

CALL P0 P0 P10 P20

CALL P10 CALL P20

FEND RET RET RET

END

Devices that were set during the execution of a subroutine program remain set, even if the rou-
tine is not executed any longer. In order to reset these devices the FCALL instruction has to be
applied.

7 – 144
Structured program instructions CALL, CALLP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified for the argument cannot be secured for the data size. (Error code 4101)
● After execution of a CALL instruction an END, FEND, GOEND, or STOP instruction is
executed, without a prior RET instruction. (Error code 4211)
● A RET instruction is executed before a CALL instruction.
(Error code 4212)
● More than 16 nesting levels are executed.
(Error code 4213)
● There is no subroutine program stored at the specified pointer/label.
(Error code 4210)

Program CALL
Example
While X20 is set, the following program executes the subroutine program at pointer/label P_0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CALL_MB1, CALL_KB1

NOTES In MELSEC-mode, the FEND, END, and RET instructions have to be programmed by the user.
After the program organization unit has been processed no further one will be executed because
it would follow the FEND instruction.
Alternatively to this programming, the IEC editor can be used. In that case the FEND instruction
would be set by the compiler of the GX IEC Developer automatically.

Programming MELSEC System Q and L series 7 – 145


RET Structured program instructions

7.6.4 RET

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

RET__ME1, RET__KE1

GX Works2

RET__GE1

Variables Set Data Meaning Data Type


— — —

7 – 146
Structured program instructions RET

Functions End of subroutine program


RET Return to main program
The RET instruction marks the end of a subroutine program. The program jumps back to the
program step, that is specified after the CALL, FCALL, ECALL, EFCALL or XCALL instruction.

RET_0E1
1
Main routine program
2
Subroutine program

NOTE In the MELSEC-mode the FEND, END, and RET instructions have to be programmed by the
user. After the program organization unit has been processed no further one will be executed
because it would follow the FEND instruction.
Alternatively to this programming, the IEC editor can be used. In that case the FEND instruction
would be set by the compiler of the GX IEC Developer automatically.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● After execution of a CALL(P), FCALL(P), ECALL(P), EFCALL(P) or XCALL instruction an
END, FEND, GOEND, or STOP instruction is executed, without a prior RET instruction.
(Error code 4211)
● An RET instruction is executed before a CALL(P), FCALL(P), ECALL(P), EFCALL(P) or
XCALL instruction.
(Error code 4212)

Programming MELSEC System Q and L series 7 – 147


FCALL, FCALLP Structured program instructions

7.6.5 FCALL, FCALLP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H
Bit Word Bit Word U\G P
pn — — — — — — — — 

s1
– 1)        —
s5
1
Annunciators (F) cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FCALLME1, FCALLKE1

GX Works2

FCALLGE1

Variables Set Data Meaning Data Type


pn Address number (pointer/label) of subroutine program Pointer/label
Bit
s1 to s5 Number of the device to be passed as an argument to a subroutine program BIN16-bit
BIN 32-bit

NOTE These instructions are not available in GX IEC Developer.

7 – 148
Structured program instructions FCALL, FCALLP

Functions Resetting outputs in subroutine programs


FCALL Resetting outputs (in conjunction with CALL instruction)
The FCALL instruction can execute subroutine programs designated by a pointer within the
same program file, and subroutine programs designated by common pointers.
On resetting the execution condition for the FCALL instruction, the contacts and coils in the
subroutine program specified in p (pointer/label) are treated as if the execution condition of the
according instruction was not set.

FCALL0E1
1
Main routine program
2
Subroutine program

The condition of coils and contacts after execution of the FCALL instruction or the respective
condition of coils and contacts with the according execution condition not set is listed below:

Instruction Condition of contacts and coils


All contacts and coils,
OUT instruction
designated by the OUT instruction are reset.
SET instruction
RST instruction
All contacts and coils,
SFT instruction designated by these instructions
remain their condition.
Basic instructions
Application instructions
PLS instruction All contacts and coils,
designated by these instructions adopt a condition as if
Instructions generating an output pulse the execution conditions of the instructions were not set.
Setting values of low- and high-speed timers The setting values are reset to 0.
Setting values of retentive timers
The setting values remain set.
Setting values of counters

The FCALL instruction is used in conjunction with a CALL instruction.


The following diagrams show a program, applying the CALL and FCALL instructions. The dia-
grams on the right show the signal condition of several contacts designated by several several
instructions. The diagram on the top right shows the contact conditions without applying an
FCALL instruction. The diagram on the bottom right shows the contact conditions applying an
FCALL instruction.
If only the CALL instruction is applied, the conditions of contacts and coils designated in a sub-
routine program are remained after resetting the execution condition of the CALL instruction
(see diagram on top right).
If the FCALL instruction is applied, the conditions of contacts and coils designated in a subrou-
tine program are reset after resetting the execution condition of the FCALL instruction (see dia-
gram on bottom right). The same applies to coils and contacts designated by an OUT or PLS
instruction, or by a pulse generating instruction.

Programming MELSEC System Q and L series 7 – 149


FCALL, FCALLP Structured program instructions

1
Forced OFF by FCALL instruction
FCALLAB1, FCALL0E2, FCALL0E3
When function devices (FX, FY, FD) are used by a subroutine program, specify a device with
s1 to s5 corresponding to the function device. The contents to the devices specified by s1 to
s5 are as indicated below.

Prior to execution of the subroutine program, bit data is transmitted to FX, and word data is
transmitted to FD.
After the execution of the subroutine program, the contents of FY and FD are transmitted to the
corresponding devices.
The processing units for the function devices are as follows:
● FX, FY: Bits
● FD : 4-word units
The size of the data to be dealt with will differ depending on the device specified in the argu-
ment. The device specified as a function device should be secured for the data size. An error
will occur if it cannot be secured for the data size.

7 – 150
Structured program instructions FCALL, FCALLP

Function Devices Device Data Size Remark

FX Bit device 1 point



FY When bit designation is made for word device 1 bit
The upper 2 words of FD
When digit designation of a bit device is used 1) 4 words become 0
FD
Word device 4 words —

1
An error will not occur even when the device number specified by s1 to s5 is not a multiple of 16 at the
digit designation of the bit device.

X0
FCALL P0 M0 D0 D30

Occupies from D30 to D33 (Transfer to FD2).


Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).

s1 to s5 can be used with the FCALL (P) instruction.


Up to 16 nesting levels are possible with the FCALL(P) instruction. However, this 16 levels is
the total number of levels in the CALL(P), FCALL(P), ECALL(P), EFCALL(P), and XCALL
instructions.

CALL P0

FCALL P0 P0 P10 P20

CALL P10 CALL P20


FCALL P10 FCALL P20

FEND RET RET RET

END

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified for the argument cannot be secured for the data size.
(Error code 4101)
● After execution of an FCALL instruction an END, FEND, GOEND, or STOP instruction is
executed, without a prior RET instruction.
(Error code 4211)
● A RET instruction is executed before an FCALL instruction.
(Error code 4212)
● More than 16 nesting levels are executed.
(Error code 4213)
● There is no subroutine program stored at the specified pointer/label.
(Error code 4210)

Programming MELSEC System Q and L series 7 – 151


FCALL, FCALLP Structured program instructions

Program FCALL
Example
While X20 is set, the following program executes the subroutine program at pointer address
(label) P_0. If X20 is reset, the FCALL instruction resets the output Y11 as well (1).

MELSEC Instruction List Ladder Diagram IEC Instruction List

FCALLMB1, FCALLKB1, FCALL0B1

7 – 152
Structured program instructions ECALL, ECALLP

7.6.6 ECALL, ECALLP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $
Bit Word Bit Word U\G P

n 1) —   — — — —  —

pn — — — — — — — — 

s1
– 2)       — —
s5
1 File name
2
Annunciators (F) cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ECALLME1, ECALLKE1

GX Works2

ECALLGE1

Variables Set Data Meaning Data Type


File name Name of progarm file containing the subroutine program Character string
pn Address number (pointer/label) of subroutine program Pointer/label
Bit
s1 to s5 Device number that passes to subroutine BIN16-bit
BIN 32-bit

NOTE These instructions are not available in GX IEC Developer.

Programming MELSEC System Q and L series 7 – 153


ECALL, ECALLP Structured program instructions

Functions Calling a subroutine program in a program file


ECALL Subroutine program call
The ECALL instruction calls a subroutine program specified by pointer address (label) in a pro-
gram file specified by a file name. The pointer address (label) ranges from P(label)0 to
P(label)4095. Refer to the notes on programming pointer (label) addresses for the jump
instructions (CJ, SCJ, JMP).

ECALL0E1
1 Main routine program (file name: "MAIN")
2 Subroutine program (file name: "ABC")

Only files stored in internal memory (drive 0) can be specified by the file name.
When calling program files no file extension is required. (Only ".QPG" files will be acted on.)
When function devices (FX, FY, FD) are used by a sub-routine program, specify a device with
s1 through s5 corresponding to the function device. The contents to the devices specified by
s1 to s5 are as indicated below.

[MAIN]

[ABC]

Prior to execution of the sub-routine program, bit data is transmitted to FX, and word data is
transmitted to FD.
After the execution of the sub-routine program, the contents of FY and FD are transmitted to
the corresponding device.

7 – 154
Structured program instructions ECALL, ECALLP

The processing units for the function devices are as follows:


● FX, FY: Bits
● FD : 4-word units
The size of the data to be dealt with will differ depending on the device specified in the argu-
ment. The device specified as a function device should be secured for the data size. An error
will occur if it cannot be secured for the data size.
Function Devices Device Data Size Remark

FX Bit device 1 point



FY When bit designation is made for word device 1 bit

When digit designation of a bit device is used 1) 4 words The data size varies
FD depending on the
Word device 4 words instruction to be used.
1 An error will not occur even when the device number specified by s1 to s5 is not a multiple of 16 at the
digit designation of the bit device.

X0
ECALL "A-LINE" P0 M0 D0 D30

Occupies from D30 to D33 (Transfer to FD2).


Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).

s1 to s5 can be used with the ECALL instruction.


The device used in the argument of the ECALL instruction should not be used in a subroutine
program. If used, it will not be possible to obtain accurate calculations. (Refer to the following
program example.)

Programming MELSEC System Q and L series 7 – 155


ECALL, ECALLP Structured program instructions

Incorrect operation example


The following example shows the operation performed when D0 is specified for FD0 in the sub-
routine program and D1 is used in the subroutine program.

Operation performed after subroutine program execution

Before the execution Immediately after At the time of After the


of subroutine the execution of subroutine program execution of RET
program ECALL instruction execution instruction

D0 0 D0 0 D0 0 D0 33 *2
D1 10 D1 10 D1 110 *1 D1 110 *3
D2 100 D2 100 D2 100 Transfer D2 100 *2
Transfer
D3 1000 D3 1000 D3 1000 D3 1000 *2

Indefinite 0 33 *1 Indefinite
Indefinite 10 1 *1 Indefinite
FD0 FD0 FD0 FD0
Indefinite 100 100 Indefinite
Indefinite 1000 1000 Indefinite

1
Stores the execution result of the subroutine program.
2
Replaced by the value of the function device.
3 D1 does not reflect the value of the function device.

7 – 156
Structured program instructions ECALL, ECALLP

Correct operation example


The following example shows the operation performed when D0 is specified for FD0 in the sub-
routine program and D4 is used in the subroutine program.

[MAIN]

[ABC]

Operation performed after subroutine program execution

Before the execution Immediately after At the time of After the


of subroutine the execution of subroutine program execution of RET
program ECALL instruction execution instruction

D0 0 D0 0 D0 0 D0 33 *2
D1 10 D1 10 D1 10 D1 1 *2
D2 100 Transfer
Transfer D2 100 D2 100 D2 100 *2
D3 1000 D3 1000 D3 1000 D3 1000 *2
D4 0 D4 0 D4 100 *1 D4 100

Indefinite 0 33 *1 Indefinite
Indefinite 10 1 *1 Indefinite
FD0 FD0 FD0 FD0
Indefinite 100 100 Indefinite
Indefinite 1000 1000 Indefinite

1
Stores the execution result of the subroutine program.
2
Replaced by the value of the function device.

Programming MELSEC System Q and L series 7 – 157


ECALL, ECALLP Structured program instructions

The devices specified in s1 through s5 must not overlap. If they do overlap, it will not be possi-
ble to obtain accurate calculations.
Up to 16 levels of nesting can be used with the ECALL(P) instruction. However, this 16 levels
is the total number of levels in the CALL(P), FCALL(P), ECALL(P), EFCALL(P), and XCALL
instructions.

ECALL "ABC" P0 P0 P10 P20

ECALL "DEF" P10 ECALL "GHI" P20

FEND RET RET RET

END

Devices which are turned ON within subroutine programs will be latched even if the subroutine
program is not executed. Devices turned ON during the execution of a subroutine program can
be turned OFF by the EFCALL(P) instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified for the argument cannot be secured for the data size.
(Error code 4101)
● After execution of an ECALL instruction an END, FEND, GOEND, or STOP instruction is
executed, without a prior RET instruction.
(Error code 4211)
● An RET instruction is executed before an ECALL instruction.
(Error code 4212)
● More than 16 nesting levels are executed.
(Error code 4213)
● There is no subroutine program stored at the specified pointer/label.
(Error code 4210)
● The specified program file does not exist.
(Error code 4210)
● The specified program file cannot be executed.
(Error code 2411)

Program ECALL
Example
While X20 is set, the following program executes the subroutine program at pointer/label P_0
in the program file "ABC".

MELSEC Instruction List Ladder Diagram IEC Instruction List

ECALLMB1, ECALLKB1, ECALLIB1

7 – 158
Structured program instructions EFCALL, EFCALLP

7.6.7 EFCALL, EFCALLP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn
Bit Word Bit Word U\G P

n1) —   — — — —  —

pn — — — — — — — — 

s1
– 2)       — —
s5
1 File name
2
Annunciators (F) cannot be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EFCALME1, EFCALKE1

GX Works2

EFCALGE1

Variables Set Data Meaning Data Type


file name Name of program file containing the subroutine program Character string
pn Address number (pointer/label) of subroutine program Pointer/label
Bit
s1 to s5 Device number that passes to subroutine BIN16-bit
BIN 32-bit

NOTE These instructions are not available in GX IEC Developer.

Programming MELSEC System Q and L series 7 – 159


EFCALL, EFCALLP Structured program instructions

Functions Resetting outputs in subroutine programs in program files


EFCALL Resetting outputs (in conjunction with ECALL)
On resetting the execution condition for the EFCALL instruction, the contacts and coils in the
subroutine program specified in p (pointer/label) are treated as if the execution condition of the
according instruction was not set.
The EFCALL instruction executes subroutine programs, that are located within a different pro-
gram file from that one calling them.
The condition of coils and contacts after execution of the EFCALL instruction or the respective
condition of coils and contacts with the according execution condition not set is listed below:

Instruction Condition of contacts and coils


All contacts and coils,
OUT instruction
designated by the OUT instruction are reset.
SET instruction
RST instruction
All contacts and coils,
SFT instruction designated by these instructions
remain their condition.
Basic instructions
Application instructions
PLS instruction All contacts and coils,
designated by these instructions adopt a condition as if
Instructions generating an output pulse the execution conditions of the instructions were not set.
Setting values of low- and high-speed timers The setting values are reset to 0.
Setting values of retentive timers
The setting values remain set.
Setting values of counters

The EFCALL instruction is used in conjunction with an ECALL instruction.


If the EFCALL(P) instruction is used in conjunction with the ECALL(P) instruction, non-execu-
tion processing of a subroutine program is performed when the execution command is turned
OFF, enabling forcible turning OFF of the OUT instruction and the PLS instruction (including P
instructions).
In case the EFCALL(P) instruction is not used in conjunction with the ECALL(P) instruction,
non-execution processing of a subroutine program is not performed even if the execution com-
mand is turned OFF. Therefore, output status of the individual coil instructions remains
unchanged.

7 – 160
Structured program instructions EFCALL, EFCALLP

When EFCALL instruction is used

[File Name: ABC.QPG]

When EFCALL instruction is not used

[File Name: ABC.QPG]

EFCALAB1, EFCALAB2
Only the file name of a program file stored in the drive 0 (program memory/internal RAM) can
be designated for a file name.
It is not necessary to designate the extension (".QPG") with the file name. (Only ".QPG" files
will be acted on.)
When function devices (FX, FY, FD) are used by a sub-routine program, specify a device with
s1 through s5 corresponding to the function device (see following figure).

[ABC]

Programming MELSEC System Q and L series 7 – 161


EFCALL, EFCALLP Structured program instructions

Prior to execution of the sub-routine program, bit data is transmitted to FX, and word data is
transmitted to FD.
After the execution of the sub-routine, the contents of FY and FD are transmitted to the corre-
sponding device.
The processing units for the function devices are as follows:
● FX, FY: Bits
● FD : 4-word units
The size of the data to be dealt with will differ depending on the device specified in the argu-
ment. The device specified as a function device should be secured for the data size. An error
will occur if it cannot be secured for the data size.
Function Devices Device Data Size Remark

FX Bit device 1 point



FY When bit designation is made for word device 1 bit
The upper 2 words of FD
When digit designation of a bit device is used 1) 4 words become 0
FD
Word device 4 words —
1
An error will not occur even when the device number specified by s1 to s5 is not a multiple of 16 at the
digit designation of the bit device.

X0
EFCALL "ABC" P0 M0 D0 D30

Occupies from D30 to D33 (Transfer to FD2).


Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).

s1 to s5 can be used with the EFCALL (P) instruction.


The number of function devices used by sub-routine programs must be identical to the number
of devices handed over by the EFCALL(P) instruction in s1 through s5. The function devices
must be identical to the types of devices handed over by the EFCALL(P) instruction.
The EFCALL(P) instruction calls a subroutine program specified via the pointer address (label).
In total up to 16 nesting levels can be programmed. However, this 16 levels is the total number
of levels in the CALL(P), FCALL(P), ECALL(P), EFCALL(P) and XCALL instructions.

ECALL "ABC" P0

EFCALL "ABC" P0 P0 P10 P20

ECALL "DEF" P10 ECALL "GHI" P20


EFCALL"DEF" P10 EFCALL "GHI" P20
FEND
RET RET RET
END

7 – 162
Structured program instructions EFCALL, EFCALLP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified for the argument cannot be secured for the data size.
(Error code 4101)
● After execution of an EFCALL instruction an END, FEND, GOEND, or STOP instruction is
executed, without a prior RET instruction.
(Error code 4211)
● An RET instruction is executed before an EFCALL instruction.
(Error code 4212)
● More than 16 nesting levels are executed.
(Error code 4213)
● There is no subroutine program stored at the specified pointer/label.
(Error code 4210)
● The specified program file does not exist.
(Error code 4210)
● The specified program file cannot be executed.
(Error code 2411)

Program EFCALL
Example
While X20 is set, the following program executes the subroutine program at pointer address
(label) P_0 in the program file "ABC". If X20 is reset, the EFCALL instruction resets the output
Y11 as well (1).

MELSEC Instruction List Ladder Diagram IEC Instruction List

EFCALMB1, EFCALKB1, EFCALIB1

Programming MELSEC System Q and L series 7 – 163


XCALL Structured program instructions

7.6.8 XCALL

CPU High
Basic Process Redundant Universal LCPU
Performance
 1)     

1 Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H
Bit Word Bit Word U\G P
pn — — — — — — — — 

s1
–  1)        —
s5
1 Annunciators (F) cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

E
F
C
A
L
M
E
1
,
E
F
C
A
1L
K
E

GX Works2

XCALL Pn s1 to s5

EFCALGE1

Variables Set Data Meaning Data Type


pn Address number (pointer/label) of subroutine program Pointer/label
Bit
s1 to s5 Device number that passes to subroutine BIN16-bit
BIN 32-bit

7 – 164
Structured program instructions XCALL

Functions Subroutine program call


XCALL Subroutine program call
XCALL instruction executes the subroutine program and performs non-execution processing
of the subroutine program.
● Execution of subroutine program:
Executes each coil instruction according to ON/OFF status of the condition contacts.
● Non-execution of subroutine program:
Performs the same processing for each coil instruction as when the condition contacts are
OFF status. The operation results for the individual coil instructions following non-execution
processing will be as follows, regardless of the ON/OFF status of the individual contacts:

Instruction Condition of contacts and coils


All contacts and coils, designated by the OUT instruction
OUT instruction
are reset.
SET instruction
RST instruction
All contacts and coils, designated by these instructions
SFT instruction
remain their condition.
Basic instructions
Application instructions
PLS instruction All contacts and coils, designated by these instructions
adopt a condition as if the execution conditions of the
Instructions generating an output pulse instructions were not set.
Setting values of low- and high-speed timers The setting values are reset to 0.
Setting values of retentive timers
The setting values remain set.
Setting values of counters

Programming MELSEC System Q and L series 7 – 165


XCALL Structured program instructions

Operation of XCALL instruction varies according to the CPU module type. The following pro-
gram example shows the operation of XCALL instruction for each CPU module.

Subroutine program (P1) call by


XCALL instruction

P1 subroutine program

ON/OFF timing of X0

(1) Turning X0 ON (3) Turning X0 OFF


(OFF 씮 ON) (2) During X0 is ON 1 (ON 씮 OFF)

:
EFCALAB1, EFCALAB2
1
Time during X0 is ON (2) does not include the time when turning X0 ON (1).

CPU module Operation of XCALL instruction


 Process CPU 1 When X0 is turned ON: Without process (Do not execute subroutine
(serial No. of first 5 digits : program of "P1".)
07031 or lower)
2 During X0 is ON: Execute subroutine program of "P1".
 High performance model QCPU
(serial No. of first 5 digits: 3 When X0 is turned OFF: Perform "Non-execution processing" of subroutine
06081 or lower) program of "P1".

1 Using SM734 (XCALL instruction executing condition designation) to select


operation when X0 is turned ON.
 High performance model QCPU
(serial No. of first 5 digits: When SM734 is OFF: Without process (Do not execute subroutine
06082 or higher) program of "P1".)
 Process CPU When SM734 is ON: Execute subroutine program of "P1".
(serial No. of first 5 digits : 2 During X0 is ON: Execute subroutine program of "P1".
07032 or higher)
3 When X0 is turned OFF: Perform "Non-execution processing" of subroutine
program of "P1".
 Redundant CPU 1 When X0 is turned ON: Execute subroutine program of "P1".
 Basic model QCPU 2 During X0 is ON: Execute subroutine program of "P1".
 Universal model QCPU 3 When X0 is turned OFF: Perform "Non-execution processing" of subroutine
 LCPU program of "P1".

When function devices (FX, FY, FD) are used by a subroutine program, specify a device with
s1 through s5 corresponding to the function device. The contents to the devices specified by
s1 to s5 to are as indicated below.

7 – 166
Structured program instructions XCALL

Prior to execution of the sub-routine program, bit data is transmitted to FX, and word data is
transmitted to FD.
After the execution of the subroutine, the contents of FY and FD are transmitted to the corre-
sponding device.
The processing units for the function devices are as follows:
● FX, FY: Bits
● FD : 4-word units
The size of the data to be dealt with will differ depending on the device specified in the argu-
ment. The device specified as a function device should be secured for the data size. An error
will occur if it cannot be secured for the data size.
Function Devices Device Data Size Remark

FX Bit device 1 point



FY When bit designation is made for word device 1 bit

When digit designation of a bit device is used 1) 4 words The data size varies
FD depending on the
Word device 4 words instruction to be used.
1 An error will not occur even when the device number specified by s1 to s5 is not a multiple of 16 at the
digit designation of the bit device.

X0
XCALL P0 M0 D0 D30

Occupies from D30 to D33 (Transfer to FD2).


Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).

s1 to s5 can be used with the XCALL instruction.


The number of function devices used by sub-routine programs must be identical to the number
of devices handed over by the XCALL instruction in s1 through s5. The function devices must
be identical to the types of devices handed over by the XCALL instruction.
Device numbers specified in the argument of the XCALL instruction should not overlap. If they
do overlap, it will not be possible to obtain accurate calculations.
In total up to 16 nesting levels can be programmed. However, this 16 levels is the total number
of levels in the CALL(P), FCALL(P), ECALL(P), EFCALL(P) and XCALL instructions.

XCALL P0 X0 P0 P20

XCALL P10 X10 XCALL P20 X20

FEND RET RET RET

END

Programming MELSEC System Q and L series 7 – 167


XCALL Structured program instructions

The device used for the argument of the XCALL instruction must not be used in a subroutine
program. If used, it will not be possible to perform correct calculations. (Refer to the following
program example.)
The processing to be executed when D1 is used in a subroutine program with D0 designated
for FD0 in a subroutine program is shown below.

Operation performed after subroutine program execution

Before the execution Immediately after At the time of After the


of subroutine the execution of subroutine program execution of RET
program XCALL instruction execution instruction

D0 0 D0 0 D0 0 D0 1 *2
D1 10 D1 10 D1 110 *1 D1 10 *2
D2 100 D2 100 D2 100 Transfer D2 100 *2
Transfer
D3 1000 D3 1000 D3 1000 D3 1000 *2

Indefinite 0 1 *1 Indefinite
Indefinite 10 10 Indefinite
FD0 FD0 FD0 FD0
Indefinite 100 100 Indefinite
Indefinite 1000 1000 Indefinite

1
Stores the execution result of the subroutine program.
2
Replaced by the value of the function device.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified for the argument cannot be secured for the data size.
(Error code 4101)
● After execution of an XCALL instruction an END, FEND, GOEND, or STOP instruction is
executed, without a prior RET instruction.
(Error code 4211)
● An RET instruction is executed before an XCALL instruction.
(Error code 4212)
● More than 16 nesting levels are executed.
(Error code 4213)
● There is no subroutine program stored at the specified pointer/label.
(Error code 4210)

7 – 168
Structured program instructions XCALL

Program XCALL
Example
The following program executes a subroutine program with argument when X20 is turned ON.
EFCALMB1, EFCALKB1, EFCALIB1

MELSEC Instruction List Ladder Diagram

IEC Instruction List

Programming MELSEC System Q and L series 7 – 169


COM (Refresh) Structured program instructions

7.6.9 COM (Refresh)

CPU High
Basic Process Redundant Universal LCPU
Performance
 1)  2)  3) 4) 4) 4)

1 Basic model QCPU of serial No. 04121 or lower


2
High Performance model QCPU of serial No. 04011 or lower
3
Process CPU of serial No. 07031 or lower
4 Refer to next section 7.6.10 for the COM instruction of these modules

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

7 – 170
Structured program instructions COM (Refresh)

Functions Refresh instruction


COM Refresh instruction for link and interface data
A COM instruction is used to speed up data communication with a remote I/O station. If the
scan time of a master station is longer than that of a local station, a COM instruction enables
correct processing of received input and output data.
The executed function of the COM instruction depends on the operation condition of the special
relay SM775:
● If SM775 is not set (0):
Performs auto refresh and communication with a peripheral device. 1, 2)
● If SM775 is set (1): Performs communication with peripheral device only. 1)
1
The following processing is performed in communication with peripheral device:
• Monitor processing of other stations
• Read processing by the serial communications module of the buffer memory of another intelligent
function module
2 The auto refresh includes the following processing:

• Refresh of MELSECNET/H
• CC-Link refresh
• Auto refresh of intelligent function modules.

On execution of a COM instruction the CPU temporarily interrupts the sequence program, per-
forms general data processing (END processing), as well as auto refresh of intelligent function
modules (including link refreshes). However, the low speed cyclic refresh of MELSECNET/H is
not performed.

1
COM instruction
2 General data processing/ auto refresh (including link refresh) of intelligent function module

A COM instruction may be used any number of times in the sequence program. In this respect,
note that the sequence program scan time is increased by the time taken for communication
with peripheral device and the auto refresh (including the link refresh) of the intelligent function
modules.

NOTE The COM instruction cannot be used in the following programs:


 Low-speed execution type programs
 Interrupt programs
 Fixed scan execution type programs

Programming MELSEC System Q and L series 7 – 171


COM (Refresh) Structured program instructions

Data communication using the COM instruction


The upper diagram shows data communication events without a COM instruction.
The lower diagram shows data communication events using a COM instruction.

1
Master station program
2
Data communication
3
Local station program
4 Remote I/O station, I/O refresh

Data communication between links is speeded up in the sequence program of the master
station via the COM instruction, because the number of communication events with the remote
I/O station increases.
Data may not be received properly as shown above, if the scan time of the local station
sequence program is longer than that of the master station. In this case, secure data commu-
nication is achieved with the COM instruction applied in the sequence program of the local sta-
tion.
If a COM instruction is programmed in the sequence program of a local station, a link refresh
is performed every time the local station receives the master station command between the
following instructions:
– Step 0 and COM instruction
– COM instruction and COM instruction
– COM instruction and END instruction

If the link scan time of the link is longer than the sequence program scan time of the master
station, data communication cannot be speeded up even if a COM instruction was pro-
grammed in the master station.

1
Sequence program of the master station
2
Link scan time in the slave station

7 – 172
Structured program instructions COM (Selective Refresh)

7.6.10 COM (Selective Refresh)

CPU High
Basic Process Redundant Universal LCPU
Performance
 1)  2)  3)   

1 Basic model QCPU: The first five digits of the serial No. are "04122" or higher.
2
High Performance model QCPU: The first five digits of the serial No. are "04012" or higher.
3
Process CPU: The first five digits of the serial No. are "07032" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

COM__GE1

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 7 – 173


COM (Selective Refresh) Structured program instructions

Functions Select refresh instruction


COM Select refresh instruction
When the COM instruction is executed, the following refresh operations can be performed.
Refresh items QCPU LCPU
I/O refresh  

CC-Link refresh  

CC-Link IE controller network refresh  —


CC-Link IE field network refresh  —
MELSECNET/H refresh  —
Auto refresh of intelligent function modules  

Auto refresh using QCPU standard area of multiple CPU system  —


Reading input/output data of all modules other than the multiple CPU system group  —
Auto refresh using the multiple CPU high speed transmission area of multiple CPU
 —
system
Communication with display unit — 

Service process (communication with peripheral device)  

NOTE The following processing is performed in communication with peripheral device.


 Monitor processing of other station
 Read of another intelligent function module buffer memory by the serial communication mo-
dule

Select refresh items using SD778 and SM775


With SM775 ON, whether to execute a refresh or not can be designated by each bit of SD778
as shown below:
● For QCPU
Bit of SD778 Executed Not executed
b0 to b6 1 0
b15 0 1

Example (see figure below):


To make only the send/receive processing with the remote I/O station faster, designate
MELSECNET/H refresh only. Set only bits b2 and b15 of SD778 to 1 (SD778: 8004H).

b15 b14 to b6 b5 b4 b3 b2 b1 b0
SD778 1/0 0 1/0 1/0 1/0 1/0 1/0 1/0 1/0
I/O refresh
CC-Link refresh
CC-Link IE controller network, MELSECNET/H refresh
Auto refresh of intelligent function module
Auto refresh using QCPU standard area of multiple CPU
system
Reading inputs/outputs from the outside of the multiple
CPU system group
Auto refresh using the multiple CPU high speed
transmission area of multiple CPU system
CC-Link IE field network refresh
Communication with peripheral devices

7 – 174
Structured program instructions COM (Selective Refresh)

NOTE Refresh between the multiple CPUs by the COM instruction is performed under the following
condition.
 Receiving operation from other CPUs : When b4 of SD778 (auto refresh in the CPU shared
memory) is 1.
 Sending operation from host CPU : When b15 of SD778 (communication with peripheral de-
vice is executed/not executed) is 0.
● For LCPU
Bit of SD778 Executed Not executed
b0 to b3, b14 1 0
b15 0 1

Example (see figure below):


To speed up processing of the display unit only, specify communication with the display unit
only. Write "1" to bits b14 and b15 of SD778 (SD778: C000H).

b15 b14 b13 to b4 b3 b2 b1 b0


SD778 1/0 1/0 0 1/0 0 1/0 1/0
I/O refresh
CC-Link refresh

Auto refresh of intelligent function module

Communication with display unit


Communication with peripheral devices

● Turning OFF SM775 refreshes all refresh items except I/O refresh.
● With SM775 turned to ON, select refresh items by SD778.
The following table shows the refresh items that can be designated by turning SM775 ON/OFF
and with SD778.
QCPU LCPU
Refresh items When SM775 When SM775 When SM775 When SM775
is OFF is ON is OFF is ON
I/O refresh Not executed Not executed Execution/
non-execution
CC-Link refresh Executed selectable
CC-Link IE controller network refresh — —
CC-Link IE field network refresh — —
MELSECNET/H refresh — —
Execution/ Execution/
Auto refresh of intelligent function modules non-execution Executed non-execution
Executed selectable selectable
Auto refresh using QCPU standard area of multiple
— —
CPU system
Reading input/output data of all modules other than
— —
the multiple CPU system group
Auto refresh using the multiple CPU high speed
— —
transmission area of multiple CPU system
Communication with display unit — —
Execution/
Execution/ Executed non-execution
Service process (communication with peripheral
Executed non-execution selectable
device)
selectable

Programming MELSEC System Q and L series 7 – 175


COM (Selective Refresh) Structured program instructions

Upon the execution of the COM instruction, the CPU module suspends the processing of the
sequence program, and refreshes the designated refresh item.

Execution of COM Execution of COM


instruction instruction

0 END 0 END 0

Refreshes the designated Refreshes the designated


refresh items refresh items

A COM instruction may be used any number of times in the sequence program. However, note
that the sequence program scan time will be lengthened by the time taken for refresh time of
the communication with peripheral devices and refresh item that are selected in SD778.
Only with the Universal model QCPU and LCPU, interruption is enabled during the execution
of the COM instruction. However, note that the data can be separated if the refresh data is used
by an interrupt program etc.
With the Built-in Ethernet port QCPU and LCPU, processing time may be increased if the serv-
ice process was executed by the COM instruction while the built-in Ethernet ports are in Ether-
net connection.

NOTES The COM instruction cannot be used in the following programs:


 Low-speed execution type programs
 Interrupt programs
 Fixed scan execution type programs
For the redundant CPU, there are restrictions on use of the COM instruction. Refer to the fol-
lowing manual for details: QnPRHCPU User's Manual (Redundant System).

7 – 176
Structured program instructions CCOM, CCOMP

7.6.11 CCOM, CCOMP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

CCOM
4
CCOMP

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 7 – 177


CCOM, CCOMP Structured program instructions

Functions Select refresh instruction


CCOM Refresh instruction for link and interface data
Refer to section 7.6.10 for function details.

Operation When the CCOM(P) instruction is executed in the QnUD(H)CPU whose serial number (first five
Errors digits) is "10101" or lower, an error occurs.
(Error code 4100)

Program CCOMP
Example
Turning on M0 enables the program to execute the select refresh, while turning off M0 disables
the program to execute the select refresh.

MELSEC Instruction List Ladder Diagram IEC Instruction List

EFCALMB1, EFCALKB1, EFCALIB1

7 – 178
Structured program instructions IX, IXEND

7.6.12 IX, IXEND

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

IX___ME1, IX___KE1, IX___IE1

GX Works2

IX___GE1

Variables Set Data Meaning Data Type


s First number of device storing data for index qualification BIN 16-bit

Programming MELSEC System Q and L series 7 – 179


IX, IXEND Structured program instructions

Functions Index qualification of entire program parts


IX, IXEND Index qualification instruction
The instructions IX and IXEND are supported only in MELSEC mode in the GX IEC Developer.
The IX and IXEND instructions perform index qualification on those devices in the program part
located between the IX and IXEND instructions.
On index qualification, decimal values from an index table (s) are added to the device numbers.
This new address in hexadecimal format becomes the valid address for further processing.
Each device specified in s is assigned a specific type of device, on which the addition is
applied. The following diagrams illustrate index qualification:

IX___AB3, IX___AB4, IX___AB1, IX___AB2, IX__0E1


The value in D100 (8) is added to the timer address TS495. The new address is TS49D.
The value in D101 (5) is added to the counter address CS270. The new address is CS275.
The value in D102 (2) is added to the addresses of the inputs X1 and X19. The new addresses
are X3 and X1B.
The value in D103 (10) is added to the addresses of the outputs Y24 and Y40. The new
addresses are Y2E and Y4A.
The value in D104 (16) is added to the addresses of the internal relays M6 and M62. The new
addresses are M16 and M72.
The value in D106 (16) is added to the address of the link relay B20. The new address is B30.
The value in D108 (1) is added to the register address D0. The new address is D1.

7 – 180
Structured program instructions IX, IXEND

PLS, PLF, and pulsed instructions that are executed once only on set input condition, cannot
be addressed by index qualification via the IX/IXEND instruction
In cases where the new address, resulted from the addition exceeds the relevant address
range, the instruction cannot be processed accurately.
If the IX and IXEND instructions are executed during a change between program sequences
in the online mode (modifying in RUN mode) the instruction cannot be processed neither.
The values added to the addresses of word devices of which each bit can be accessed are
stored as binary data. The initial addresses of the devices these values are specified for are
stored in s.
In a program, between the IX and the IXEND instruction no index qualification can be per-
formed.
When a program is expanded, the indexed addresses of devices in a program part located
between the IX and the IXEND instruction are transformed to addresses using index registers
(Zn). The assignment of indexed addresses to the corresponding index registers is shown
below:

Index Index
s Device s Device
Register Register
Qualification value of Qualification value of
s Z0 s+8 data register (D) Z8
timer (T)
Qualification value of Qualification value of
s+1 Z1 s+9 link register (W) Z9
counter (C)
Qualification value of Qualification value of
s+2 Z2 s+10 file register (R) Z10
input (X)
Qualification value of Qualification value of
s+3 Z3 s+11 buffer register I/O (U) Z11
output (Y)
Qualification value of Qualification value of
s+4 Z4 s+12 buffer register (G) Z12
internal relay (M)

Qualification value of Qualification value of


s+5 Z5 s+13 network numbers of Z13
latch relay (L) link devices with direct access (J)
Qualification value of Qualification value of
s+6 Z6 s+14 file register (ZR) Z14
link relay (B)
Qualification value of Qualification value of
s+7 Z7 s+15 pointer (label) Z15
edge relay (V)

The index registers Z10 to Z15 are not available for the Q00JCPU, Q00CPU, and Q01CPU.

Programming MELSEC System Q and L series 7 – 181


IX, IXEND Structured program instructions

Depending on the programming software used the user has to add the index registers in the
sequence program between the IX and the IXEND instructions manually.
Example GX Works2

Program without index registers

Expanded programm with index registers

The index registers used between the IX and the IXEND instructions (Z0 to Z15) do not affect
the index registers used by other instructions elsewhere in the program.

NOTES When using the IX and IXEND instructions in both a normal sequence program and an interrupt
sequence program, establish an interlock to avoid simultaneous execution. The interlock
assumes the area between the IX and IXEND instructions in the normal sequence program as
DI, disabling the interruption.
The IXDEV and IXSET instructions can be used to specify modification values. Refer to section
7.6.13 for details.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The IX and IXEND instructions are not programmed in conjunction.
(Error code 4231)
● After execution of the IX instruction an END, FEND, GOEND or STOP instruction is executed
before the IXEND instruction is executed.
(Error code 4231)

7 – 182
Structured program instructions IX, IXEND

Program IX, IXEND


Example
The following program processes the program loop between IX and IXEND for 10 times. With
each loop the device numbers programmed within the loop are increased by 1. The table below
shows the registers containing the values of the corresponding devices to be added. In addition
the changes in the device numbers for the 1st, 2nd, and 10th loop are shown.

MELSEC Instruction List

IX___MB1

Device Number Change / Loop


D Device
1. 2. 3. 10.
D100 Qualification value of timer (T) T3 T4 T5 TC
D101 Qualification value of counter (C) C4 C5 C6 CD
D102 Qualification value of input (X) X10 X11 X12 X19
D103 Qualification value of output (Y) Y30 Y31 Y32 Y39
Qualification value of
D104 M0 M1 M2 M9
internal relay (M)
Qualification value of
D106 B0 B1 B2 B9
link relay (B)
D0 D1 D2 D9
Qualification values of
D108 D10 D11 D12 D19
data registers (D)
D40 D41 D42 D49

Programming MELSEC System Q and L series 7 – 183


IXDEV, IXSET Structured program instructions

7.6.13 IXDEV, IXSET

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G P
p — — — — — — — — 

d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

IXDEVME1, IXDEVKE1

GX Works2

IXDEVGE1

Variables Set Data Meaning Data Type


p First number of device (pointer/label only) storing data for index qualification Pointer/label
d First number of device storing indexed addresses of devices BIN 16-bit

7 – 184
Structured program instructions IXDEV, IXSET

Functions Storing indexed device numbers in an index qualification table


IXDEV/IXSET Instruction for writing to an index table
The instructions IXDEV and IXSET are supported in the GX Works2 or in MELSEC mode in
the GX IEC Developer only.
The IXDEV and IXSET instructions read the addresses of the devices in the offset designation
area and write these offset numbers to an index table in the device designated by d.
Refer to the instructions IX and IXEND (section 7.6.12) for the assignment of device types to
their corresponding registers.
If a device type is not assigned in the offset designation the value 0 is stored in the index table.
The single bits of word devices are processed as dummy contact, i.e. only the address of a
single bit can be read and written to the intex table. In order to address the dummy the corres-
ponding bit is specified. Bit 0 (b0) in data register D0 is addressed D0.0. For bit designation in
a 16-bit data word the hexadecimal values 0 through F are used.

Reading in the offset values applies as follows:


● Reading in the devices: T, C, X, Y, M, L, V, B
The offset value indicated  is read in and written to the corresponding registers.
● Reading the devices: D.XX, W.XX, R.XX1), U\G.XX1), ZR.XX1)
The offset value indicated  is read in and written to the corresponding registers.
The value indicated XX serves as variable for the bit designation.
1 Not
possible for Q00JCPU, Q00CPU, and Q01CPU
● Reading in the devices: J/B1), J/W1), J/X1), J/Y1)
The offset value indicated  is read in and written to the corresponding registers.
If no offset value is to be written for the device following J/, this value is to be set to 0.
1 Not possible for Q00JCPU, Q00CPU, and Q01CPU
● On programming the IXSET instruction the offset value of the device P is designated
directly via address (pointer/label).

If in the offset designation area two identical device types are specified, the offset value of the
latter device is valid.
The IXDEV and IXSET instructions have to be programmed in conjunction.
The offset value of the device ZR.XX may range from 0 to 32767. The offset value is the
remainder of the quotient of the device number divided by 32767, and is written to the corres-
ponding register.
For the dummy contacts in the offset designation area only LD and AND instructions are valid.
All other instructions are ignored.

Programming MELSEC System Q and L series 7 – 185


IXDEV, IXSET Structured program instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The IXDEV and IXSET instructions are not programmed in conjunction.
(Error code 4231)

Program IXDEV, IXSET


Example
The following program changes the modification values for input (X), output (Y), data register
(D) and pointer (P).
When using a basic model QCPU, the devices R, U/G, J, ZR and P cannot be used.

Ladder diagram

Index modification ladder


1)

Index modification
table

D0 4 T
0 C
5 X
3 Y
0 M
0 L
0 B
0 V
8 D
0 W
0

0
D15 0 P

IXDEVMB1, IXDEV0B1
1
Refer to the instructions IX and IXEND (section 7.6.12) for the assignment of device types to their
corresponding registers.

7 – 186
Data table operation instructions

7.7 Data table operation instructions


The operation instructions for data tables write and read data to and from a data table. Current
data are written to the table and read out in a different order for further processing. In addition,
these instructions enable deleting and inserting specific data blocks.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
FIFW FIFW_M
Write data to a data table
FIFWP FIFWP_M

Read data entered first FIFR FIFR_M


from data table FIFRP FIFRP_M

Read data entered last FPOP FPOP_M


from data table FPOPP FPOPP_M

Delete specified data blocks FDEL FDEL_M


from data table FDELP FDELP_M

Insert specified data blocks FINS FINS_M


in data table FINSP FINSP_M

Programming MELSEC System Q and L series 7 – 187


FIFW, FIFWP Data table operation instructions

7.7.1 FIFW, FIFWP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FIFW_ME1, FIFW_KE1, FIFW_IE1

GX Works2

FIFW_GE1

Variables Set Data Meaning Data Type


s Data to be written to the data table or devices storing such data
BIN 16-bit
d First number of data table

7 – 188
Data table operation instructions FIFW, FIFWP

Functions Writing data to a data table


FIFW Instruction for data entry
The FIFW instruction writes data in a sequence specified by s to a data table. This table is
specified by the address range in d and conducts data in the sequence of their entry. In the first
address of the data range in d the total number of data records contained in the table is stored.
Therefore, the value at this address is the position pointer for data to be recorded in the table.
On each execution of the FIFW instruction this value is increased by 1. Thus, following data are
recorded from the address d+1.

1
Data table
2
Position pointer
3
Data table range
FIFW0E1
Prior to the first FIFW instruction the contents of the device specified in d have to be cleared.
The number of data records to be recorded and the address range of the data table have to be
controlled on programming by the user.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data table range of the FIFO table exceeds the relevant storage device range when
executing the FIFW instruction.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 189


FIFW, FIFWP Data table operation instructions

Program FIFWP
Example 1
The following program specifies the storage range of the data table via the data registers R0
through R5. The initital address of the storage range (R0) contains the position pointer, indicat-
ing the number of stored data records. With leading edge from X10, data in D0 are stored at
the next available storage position of the data table (R5).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2
Position pointer
3 Data table range

FIFW_MB1, FIFW_KB1, FIFW_IB1, FIFW0B1

7 – 190
Data table operation instructions FIFW, FIFWP

Program FIFWP
Example 2
The following program specifies the storage range of the data table via the data registers D38
through D44. The initital address of the storage range (D38) contains the position pointer, indi-
cating the number of stored data records. With leading edge from X1B, data at the inputs X20
through X2F are stored at the next available storage position of the data table (D44). The data
table specified here stores at maximum 6 data records. Therefore, Y60 is programmed as a
limiter of the FIFW instruction. The output is set, if the contents of D38 are greater than or equal
to 6.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2
Position pointer
3
Data table range
4
Highest available storage address
FIFW_MB2, FIFW_KB2, FIFW_IB2, FIFW0B2

Programming MELSEC System Q and L series 7 – 191


FIFR, FIFRP Data table operation instructions

7.7.2 FIFR, FIFRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
s        —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FIFR_ME1, FIFR_KE1, FIFR_IE1

GX Works2

FIFR_GE1

Variables Set Data Meaning Data Type


s First number of device storing read out data
BIN 16-bit
d First number of data table

7 – 192
Data table operation instructions FIFR, FIFRP

Reading data entered first from a data table


Functions
FIFR Instruction for reading data entered first
The FIFR instruction reads data from a data table and stores them in a specified storage range.
Reading the data begins with the first address d+1 after the position pointer. The data is trans-
ferred to the storage range specified by s.
The data in the data table are moved successively to the beginning of the table in order of their
entry. All preceding data are cleared. After reading out, the value of the position pointer (first
address in d) is decreased by 1.

1 Data table
2
Position pointer
3
This register is reset to 0
FIFR0E1

NOTE Make sure this instruction is not executed, while d (position pointer) contains the value 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● An FIFR instruction is executed while the position pointer contains the value 0.
(Error code 4100)
● The device table range exceeds the corresponding device range when executing the FIFR
instruction.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 193


FIFR, FIFRP Data table operation instructions

Program FIFRP
Example 1
With leading edge from X10, the following program reads the data value in R1 (first entered
value) of the data table from R0 through R7 and stores the value in the register D0. At the
beginning the value of the position pointer is 5 and after the execution 4. The preceding com-
parison operation avoids the execution of the FIFR instruction, if the position pointer (R0) con-
tains the value 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2
Position pointer
3
Data table range
FIFR_MB1, FIFR_KB1, FIFR_IB1, FIFR0B1

7 – 194
Data table operation instructions FIFR, FIFRP

Program FIFRP
Example 2
With leading edge from X1C, the following program writes a value from D0 to the data table
from D38 through D43. If the value of the position pointer is 5, the first value of the FIFO table
is read and passed on to R0. This process is repeated with every leading edge from X1C.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2
Position pointer
3
Data table range
FIFR_MB2, FIFR_KB2, FIFR_IB2, FIFR0B2

Programming MELSEC System Q and L series 7 – 195


FPOP, FPOPP Data table operation instructions

7.7.3 FPOP, FPOPP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
s        — —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FPOPME1, FPOPKE1, FPOPIE1

GX Works2

FPOPGE1

Variables Set Data Meaning Data Type


s First number of device storing read data
BIN 16-bit
d First number of data table

7 – 196
Data table operation instructions FPOP, FPOPP

Functions Reading data entered last from a data table


FPOP Instruction for reading data entered last
The FPOP instruction reads data from a data table and stores them in a specified storage
range. Reading the data begins with the last address d+n in the data table. The data is trans-
ferred to the storage range specified by s.
The read address in the data table is reset to 0. After reading out, the value of the position
pointer (first address in d) is decreased by 1.

1
Data table
2
Position pointer
3
This register is reset to 0
FPOP0E1

NOTE Make sure this instruction is not executed, while d (position pointer) contains the value 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● An FPOP instruction is executed while the position pointer contains the value 0.
(Error code 4100)
● The data table range exceeds the corresponding device range when executing the FPOP
instruction.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 197


FPOP, FPOPP Data table operation instructions

Program FPOPP
Example 1
With leading edge from X10, the following program reads the data value in R5 (value entered
last) of the data table from R0 through R7 and stores the value in the register D0. At the begin-
ning the value of the position pointer is 5 and after the execution 4. The preceding comparison
operation avoids the execution of the FPOPP instruction, if the position pointer (R0) contains
the value 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2
This register is reset to 0
FPOPMB1, FPOPKB1, FPOPIB1, FPOP0B1

7 – 198
Data table operation instructions FPOP, FPOPP

Program FPOPP
Example 2
With leading edge from X1C, the following program writes a value from D0 to the data table
from D38 through D43. If the value of the position pointer is 5, with leading edge from X1D the
value in register D43 is read and passed on to R0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Data table
2 Leading edge from X1C
3
Leading edge from X1D
4 Position pointer

5 Current address range of data table

FPOPMB2, FPOPKB2, FPOPIB2, FPOP0B2

Programming MELSEC System Q and L series 7 – 199


FDEL, FDELP, FINS, FINSP Data table operation instructions

7.7.4 FDEL, FDELP, FINS, FINSP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s        — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FDEL_ME, FDEL_KE1, FDEL_IE1

GX Works2

FDEL_GE1

Variables Set Data Meaning Data Type


Data to be inserted into the data table at a specified address or device storing
such data.
s
First number of device storing data to be deleted from a data table at a specified
address. BIN 16-bit
d First number of data table
n Number of address where data is to be inserted or deleted

7 – 200
Data table operation instructions FDEL, FDELP, FINS, FINSP

Functions Deleting and inserting specified data blocks in a data table


FDEL Deleting specified data blocks
The FDEL instruction deletes the nth data block after the postion pointer from a data table
specified by d and stores this value in a device specified in s.
The data in the data table are shifted together after deletion of one data block. After reading,
the value of the position pointer (first address in d) is decreased by 1.

1 Data table
2
For n=3 the data block d+3 is deleted.
3
This register is reset to 0

FDEL0E1
FINS/FINSP Inserting specified data blocks
The FINS instruction inserts a 16-bit data block specified by s at the nth position after the posi-
tion pointer into the data table specified by d.
The data blocks following the inserting position are shifted on by one address. After inserting,
the value of the position pointer (first address in d) is increased by 1.

1
Data table
2 Position pointer
3 For n=2 the data block is inserted at d+2

FINS0E1

Programming MELSEC System Q and L series 7 – 201


FDEL, FDELP, FINS, FINSP Data table operation instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The nth position from d is larger than the data storage number at the execution of the FDEL
instruction.
(Error code 4101)
● The inserting position in d specified by n via the FINS instruction exceeds the address range
of existing data blocks plus 1.
(Error code 4101)
● The value of n exceeds the device range of the table d.
(Error code 4101)
● The FDEL or FINS instruction was executed when n = 0.
(Error code 4100)
● The FDEL was executed when the value of d was 0.
(Error code 4100)
● The data table range exceeds the corresponding device range when the FDEL or FINS
instruction is executed.
(Error code 4101)

Program FDELP
Example 1
When X10 goes ON, the data from the 2nd position (R2) of the data table ranging from R0 to
R7 will be deleted and the data stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 1
R0 5 R0 5
R1 -123 2 R1 -123
R2 4444 R2 3210
R3 3210 R3 1234
R4 1234 R4 5432
R5 5432 R5 0
R6 0 R6 0
R7 0 R7 0

D0 4444

1
Data table
2 Leading edge of X10

7 – 202
Data table operation instructions FDEL, FDELP, FINS, FINSP

Program FINSP
Example 2
The following program inserts the data at D0 at the 3rd position of the data table ranging from
R0 to R7 when X10 goes ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 1
R0 4 R0 4
R1 1234 2 R1 1234
R2 4444 R2 4444
R3 -123 R3 -3210
R4 5000 R4 -123
R5 0 R5 5000
R6 0 R6 0
R7 0 R7 0

D0 -3210

1
Data table
2
Leading edge of X10
FDELMB2, FDELKB2, FDELIB2, FINS0B1

Programming MELSEC System Q and L series 7 – 203


FDEL, FDELP, FINS, FINSP Data table operation instructions

7 – 204
Buffer memory access instructions

7.8 Buffer memory access instructions


The following instructions access the buffer memory of special function modules. These
instructions enable the CPU to exchange data with the according modules.
The following table gives an overview of the instructions:

MELSEC instruction MELSEC instruction


Function in in
MELSEC Editor IEC Editor
FROM FROM_M

Reading data from a FROMP FROMP_M


special function module DFRO DFRO_M
DFROP DFROP_M
TO TO_M

Writing data to a TOP TOP_M


special function module DTO DTO_M
DTOP DTOP_M

Programming MELSEC System Q and L series 7 – 207


FROM, FROMP, DFRO, DFROP Buffer memory access instructions

7.8.1 FROM, FROMP, DFRO, DFROP

CPU High
Basic Process Redundant Universal LCPU
Performance
     1) 

1 Other than Q00UJCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
n1         

n2         —
d    — — — — — —
n3         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

FROM_ME1, FROM_IE1, FROM_KE1

GX Works2

FROM_GE1

Variables Set Data Meaning Data Type


n1 Head address of special function module on base unit BIN 16-bit
n2 First number of memory address area for data to be read BIN 16-bit
d First number of memory address area of the CPU to be written to BIN 16/32-bit
n3 Number of data words to be read BIN 16-bit

7 – 208
Buffer memory access instructions FROM, FROMP, DFRO, DFROP

Functions Reading 1-word and 2-word data from a special function module
FROM Reading 1-word data (16-bit)
The FROM instruction reads 1-word data from the buffer memory of a special function module
and stores it in a specified memory address area of the CPU. The first address of data to be
read is specified by n2, the number of data words is specified by n3, and the head address of
the special function module, resulting from the position of the module on the base unit is spec-
ified by n1. The memory address area of the CPU storing the data is specified by d.

1 2
0 - n2
s
n3 n3

1
Buffer memory of special function module
2
Memory of the CPU

FROM0E1
NOTE The FROM instruction can also be used to read data from shared memory of another station in
a multi CPU system. Refer to section 9.2.1 for more details.

DFRO Reading 2-word data (32-bit)


The DFRO instruction reads 2-word data from the buffer memory of a special function module.
The first address of data to be read is specified by n2, the number of data words (2-multiple)
is specified by n3, and the head address of the special function module is specified by n1. The
memory address area of the CPU storing the data is specified by d.

1 2
d
n2
n3 n3
(n3 x 2) (n3 x 2)
n3 n3

1 Buffer memory of special function module


2 Memory of the CPU
DFRO_0E1

NOTE Data read from special function modules is also possible with the use of a special function mod-
ule device. In this case the devices are specified as U\G (U (Headadress of the special func-
tion module)/G (Buffer memory adress)).
For the special function module device, refer to the QnUCPU User's Manual (Function Expla-
nation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Expla-
nation, Program Fundamentals).

Programming MELSEC System Q and L series 7 – 209


FROM, FROMP, DFRO, DFROP Buffer memory access instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● No signals have been exchanged with the special function module at the execution of the
instruction.
(Error code 1412)
● An error has occured in the special function module at the the execution of the instruction.
(Error code 1402)
● The I/O number specified by n1 is not a special function module.
(Error code 2110)
● The number of data words specified in n3 (2 x n3 for DFRO) exceeds the storage range of
the device specified by d.
(Error code 4101)
● The address specified by n2 is outside the buffer memory range.
(Error code 4101)

Program FROMP
Example 1
With leading edge from X0, the following program reads the digital values of channel CH1 from
address 10 of the buffer memory of an Q68ADV module. The memory address area of the
module is 040 through 05F. The read data is stored in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

FROM_MB1, FROM_KB1, FROM_IB1

Program DFROP
Example 2
With leading edge from X0, the following program reads the x-axis data at the addresses 602
and 603 in the buffer memory of an QD75P4 module. The memory address area of the module
is 040 through 05F. The read data is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

FROM_MB2, FROM_KB2, FROM_IB2


NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 210
Buffer memory access instructions FROM, FROMP, DFRO, DFROP

NOTES The value of n1 is specified by the upper 3 digits of hexadecimal 4-digit representation of the
head I/O number of the slot in which an intelligent function module is mounted.

QCPU System Q
MELSEC

Q68 QY41
1) CPU QX10 QX10 QX10 QX10 QY10 QY10
ADV P

0000H 0010H 0020H 0030H 0040H 0050H 0070H 0080H 2)

3)

LCPU
LCPU

(L26CPU-BT)

1) CPU 4) 5) LX40 LX40 LX40 LX40 L60 LY10 LY10 LY10


C6 C6 C6 C6 AD4 R2 R2 R2

0000H 0010H 0030H 0040H 0050H 0060H 0070H 0090H 00A0H 00B0H 2)

6)

1
Power supply module
2 Head I/O number configured in the I/O assignment setting
3 Head address of special function module: 0040H --> n1 = K4 or H4

4 Built-in I/0

5
Built-in CC-Link
6 Head address of special function module: 0060H --> n1 = K6 or H6

QCPU and LCPU establish the automatic interlock of the FROM/DFRO instructions.

Programming MELSEC System Q and L series 7 – 211


TO, TOP, DTO, DTOP Buffer memory access instructions

7.8.2 TO, TOP, DTO, DTOP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
n1         

n2         —
s    — — — —  —
n3         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

TO___ME1, TO___KE1, TO___IE1

GX Works2

TO___GE1

Variables Set Data Meaning Data Type


Head address of special function module on base unit.
n1 Specified with the upper three digits when the head I/O number is expressed in
4 hexadecimal digits. BIN 16-bit
n2 First number of memory address area to be written to

s Data to be written or first number of memory address area of the CPU storing BIN 16-/32-bit
data to be written
n3 Number of data words to be written BIN 16-bit

7 – 212
Buffer memory access instructions TO, TOP, DTO, DTOP

Functions Writing 1-word and 2-word data to the buffer memory of a special function module
TO Writing 1-word data (16-bit)
The TO instruction writes 1-word data from the memory of the CPU to the buffer memory of a
special function module. The first address of the memory area data is to be written to is spec-
ified by n2, the number of data words is specified by n3, and the address of the special function
module, resulting from the position of the module on the base unit is specified by n1. The first
address of the memory address area the data is to be read from is specified by s.

1 2
0 - n2
s
n3 n3

1 Memory of the CPU


2 Buffer memory of special function module
TO_0E1
When a constant is designated to s, the instruction writes the same data (value designated to
s) to the area of n3 points starting from the specified buffer memory address. s can be desig-
nated in the following range: -32768 to 32767 or 0H to FFFFH.
Following figure shows an example when the constant 5 is designated to s.

2)
1) 0
s 5
n2 5
5 3)
5

1 CPU module
2
Buffer memory of special function module
3
n3 words (same data is written)

Programming MELSEC System Q and L series 7 – 213


TO, TOP, DTO, DTOP Buffer memory access instructions

DTO Writing 2-word data (32-bit)


The DTO instruction writes 2-word data from the memory of the CPU to the buffer memory of
a special function module. The first address of the memory area data is to be written to is spec-
ified by n2, the number of data words (2-multiple) is specified by n3, and the address of the
special function module is specified by n1. The first address of the memory address area the
data is to be read from is specified by s.

1 2
0 - n2

n3 n3
s (n3 x 2) (n3 x 2)
n3 n3

1
Memory of the CPU
2 Buffer memory of special function module
DTO_0E1
When a constant is designated to s, the instruction writes the same data (value designated to
s) to the area of n3 x 2 points starting from the specified buffer memory address. s can be des-
ignated in the following range: -2147483648 to 2147483647 or 0H to FFFFFFFFH.
Following figure shows an example when the constant 70000 is designated to s.

2)
1)
0
S 70000
n2
70000
n2+1
70000 3)

70000

1
CPU module
2
Buffer memory of special function module
3
n3 x 2 words (same data is written)

NOTE Data read from intelligent function modules is also possible with the use of a special function
module device. In this case the devices are specified as U\G (U (Headadress of the special
function module)/G (Buffer memory adress)).
For the special function module device, refer to the QnUCPU User's Manual (Function Expla-
nation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Expla-
nation, Program Fundamentals).

7 – 214
Buffer memory access instructions TO, TOP, DTO, DTOP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● No signals have been exchanged with the special function module at the execution of the
instruction.
(Error code 1412)
● An error has occured in the special function module at the execution of the instruction.
(Error code 1402)
● The I/O number specified by n1 is not a special function module.
(Error code 2110)
● The number of data words specified by n3 (2 x n3 for DTO) exceeds the storage range of
the device specified by d.
(Error code 4101)
● The address specified by n2 is outside the buffer memory range.
(Error code 4101)

Program TOP
Example 1
With leading edge from X0, the following program sets the channels CH1 and CH2 on an
Q68AD module to execute A/D conversion. The special function module is at address 040
through 05F. The value 3 is written to the buffer memory at address 0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

TO___MB1, TO___KB1, TO___IB1

Program DTOP
Example 2
With leading edge from X0, the following program resets the x-data values at the buffer mem-
ory addresses 41 and 42 of a QD75P4 module to 0. The special function module is at address
040 through 05F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

TO___MB2, TO___KB2, TO___IB2

NOTE The program example 2 will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 215


TO, TOP, DTO, DTOP Buffer memory access instructions

NOTE The value of n1 is specified by the upper 3 digits of hexadecimal 4-digit representation of the
head I/O number of the slot in which an intelligent function module is mounted.

QCPU System Q
MELSEC

Q68 QY41
1) CPU QX10 QX10 QX10 QX10 QY10 QY10
ADV P

0000H 0010H 0020H 0030H 0040H 0050H 0070H 0080H 2)

3)

LCPU
LCPU

(L26CPU-BT)

1) CPU 4) 5) LX40 LX40 LX40 LX40 L60 LY10 LY10 LY10


C6 C6 C6 C6 AD4 R2 R2 R2

0000H 0010H 0030H 0040H 0050H 0060H 0070H 0090H 00A0H 00B0H 2)

6)

1
Power supply module
2 Head I/O number configured in the I/O assignment setting
3 Head address of special function module: 0040H --> n1 = K4 or H4

4 Built-in I/0

5
Built-in CC-Link
6 Head address of special function module: 0060H --> n1 = K6 or H6

QCPU and LCPU establish the automatic interlock of the TO/DTO instructions.

7 – 216
Display instructions

7.9 Display instructions

The CPU modules of the MELSEC System Q and the L series supply several instructions that
output ASCII characters at the outputs of an output module or on a LED display on the front
panel of suitable CPU modules.

MELSEC instruction MELSEC instruction


Function in in
MELSEC Editor IEC Editor
PR PR_M
ASCII character output
PRC PRC_M
Clear display LEDR LEDR_M

The LED display complies to the following priority:


1. Display of self diagnostics error
2. Display of CHK instruction
3. Display of number of annunciator F
4. BATTERY ERROR

If one of the first three displays is indicated, the execution of a display instruction does not
change the current reading.

Programming MELSEC System Q and L series 7 – 217


PR Display instructions

7.9.1 PR

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —  2)  2) — — —   —
d  1) — — — — —  — —
1 Y only
2
Local devices and the file registers set for individual programs cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PR___ME1, PR___KE1, PR___IE1

GX Works2

PR___GE1

Variables Set Data Meaning Data Type


s First number of device storing ASCII code Character string
d Head address of output module for ASCII code output Bit

7 – 218
Display instructions PR

Functions Output to a peripheral device


PR Output of an ASCII character string
The PR instruction supplies two functions. Its function depends on the status of special relay
SM701.
● SM701 set (1) (function 1)
Output of an ASCII character string of 16 characters to an output module. The character string,
divided into twice 8 characters, is read from the address area s and output to the outputs spec-
ified by d.

1
Device storing ASCII code
2
Sequence program
3
Flag indicating that PR instruction is in progress (used as interlock)
4
Start of output
5
Outputs Y
6
Output of ASCII code
7
Output of strobe signal
8
Printer or display device
● SM701 not set (0) (function 2) PR_0E1

Output of ASCII character string data up to the character code "00H" in hexadecimal format
from the address area s to the outputs specified by d.

1
Device storing ASCII code
2
Sequence program
3
Flag indicating that PR instruction is in progress (used as interlock)
4
Start of output
5
End of character string (end of transmission)
6
Outputs Y
7
Output of ASCII code
8
Output of strobe signal
9
Printer or display device
PR_0E2

Programming MELSEC System Q and L series 7 – 219


PR Display instructions

If the content of the devices storing ASCII code is overwritten during the output, the current
data is output.
Following the execution of the PR instruction, the PR instruction execution flag (d+9 device)
remains ON until the completion of the transmission of the designated number of characters.
For the execution of a PRC instruction an output module with 10 successive binary outputs is
needed. The address area begins at the output number specified by d. The 10 output
addresses of the output module are processed independently from an I/O refresh after the END
instruction in the program sequence.
Output signals from the output module are transmitted at the rate of 30 ms per character. Thus,
processing n characters takes n x 30 ms. The output transmission is controlled via 10 ms inter-
rupts, so the sequence program is processed continuously.

Execution of sequence program PR instruction processing

Data output

ON
OFF
Strobe signal

10 ms 10 ms 10 ms 10 ms 10 ms

30 ms

In addition to the ASCII code a strobe signal (ON = 10 ms, OFF = 20 ms) is output at address
Y= d+8.
The PR and PRC instructions can be executed multiple times. Yet, an interlock should be
established via the PR instruction execution flag (output device Y= d+9) so the PR and PRC
instructions are not executed simultaneously.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● There is no 00H code within the range of the device specified by s when SM701 is OFF.
(Error code 4101)

7 – 220
Display instructions PR

Program PR
Example
With leading edge from X0, the following program converts the character string "ABCDEFGH-
IJKLMNOP" into ASCII code and stores it in data registers D0 through D7. After setting X3 ON,
the ASCII code in D0 through D7 is output to the outputs Y14 through Y1D.

MELSEC Instruction List IEC Instruction List

Ladder Diagram

PR___MB1, PR___IB1, PR___KB1

Programming MELSEC System Q and L series 7 – 221


PR Display instructions

The following timing charts illustrate the processing of the program:

1
Storage of character string "ABCDEFGH" in D0 through D3
2
Storage of character string "IJKLMNOP" in D4 through D7
3 ASCII code

4
Strobe signal
5 PR instruction execution flag

6 Processing the PR instruction (period = 480 ms)

PR___AB1, PR_0E1, PR_0E2

NOTES If SM701 is not set, the value "00H" has to be written to register D8. Without this character code
an operation error would occur in the program example above.
This program example will not run without variable definition in the header of the program organ-
ization unit (POU). It would cause compiler or checker error messages. For details see section
3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 222
Display instructions PRC

7.9.2 PRC

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $
Bit Word Bit Word U\G P, I, J, U
s       — — 

d 1) — — — — — — — —


1
Y only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

PRC__ME1, PRC__KE1, PRC__IE1

GX Works2

PRC__GE1

Variables Set Data Meaning Data Type


s First number of device storing comment to be output BIN 16-bit
d Head address of output module for comment output Bit

Programming MELSEC System Q and L series 7 – 223


PRC Display instructions

Functions Output to a peripheral device


PRC Output of a comment
The PRC instruction outputs a comment (in ASCII code) of a device designated by s to an out-
put module designated by d.
The output of either 16 or 32 characters can be chosen. The choice is specified via special relay
SM701.
● If SM701 is set (1), 16 characters are output.
● If SM701 is not set (0), 32 characters are output.

1
Comment (ASCII code) from X1 onwards
2
Start of output
3 Outputs Y

4
Sequence program
5
PR instruction execution flag (used as interlock)
6
Output of ASCII code
7
Output of strobe signal
8
Printer or display device
PRC__AB1, PRC0E1

7 – 224
Display instructions PRC

The processing of the PRC instruction is shown in the following timing chart:

A B C N O
Y30 - Y37 Preprocessing 41H 42H 43H 4EH 4FH
30ms
ON

PRC OFF

ON
OFF
1 Y38
10 10 10
ms msms
ON
2 Y39 OFF

3
ON

4 SM721 OFF

ON 5

6 SM 720 OFF

7 8

1
Strobe signal
2 PRC instruction execution flag
3
Processing time (16 x 30 ms = 480 ms) for the PRC instruction
4 File access in process flag

5 The PRC instruction cannot be executed again

6 File access completion flag

7
No other instruction can be executed
8 Instructions other than PRC, SP.FREAD, SP.FWRITE, PLOAD, PUNLOAD and PSWAPP can be

executed
PRC0E3
There are 10 binary outputs of a digital output module assigned. The address area begins at
the output address Y specified by d.
Output signals from the output module are transmitted at the rate of 30 ms per character. Thus,
processing n characters takes n x 30 ms. The output transmission is controlled via 10 ms inter-
rupts, so the sequence program is processed continuously.

Execution of sequence program PR instruction processing

Data output

ON
OFF
Strobe signal

10 ms 10 ms 10 ms 10 ms 10 ms

30 ms

Programming MELSEC System Q and L series 7 – 225


PRC Display instructions

In addition to the ASCII code a strobe signal (ON = 10 ms, OFF = 20 ms) is output at address
Y= d+8.
During the output of 16 characters of ASCII code, the PRC instruction execution flag d+9 is set
ON. Thus, the output Y at address d+9 is set as long as the PRC instruction is executed. The
PR and PRC instructions can be executed multiple times. Yet, an interlock should be established
via the PRC instruction execution flag (output device Y= d+9) so the PR and PRC instructions
are not executed simultaneously.
If the address area s does not contain data, the instruction is not executed.
The PRC instruction can only access comments already stored in the PLC. For conversion
from alphanumeric data into ASCII code an ASC instruction has to be applied.
After the execution of the PRC instruction is finished, SM720 turns ON for one scan. SM721
turns ON during the execution of the PRC instruction. The PRC instruction cannot be executed
when SM721 is already ON. If an attempt is made, the processing will not be performed.

NOTES The PRC instruction can only access comments stored in a memory card. The PRC instruction
can not access comments stored in the internal memory.
The comment file accessed by the PRC instruction is set at the "PC File Setting" in the Param-
eter mode. The output of a comment file with the PRC instruction is not possible if no comment
file has been set.
Do not execute the PRC instruction during an interrupt program. Otherwise, malfunction may
result.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The PRC instruction is executed while a comment is written during RUN.
(Error code 4100)

Program PRC
Example
If X0 is set ON, the following program sets output Y35 ON and outputs the comment at Y35 in
ASCII code simultaneously at the outputs Y60 through Y69. After setting X3 ON, Y35 is reset
OFF.

MELSEC Instruction List Ladder Diagram IEC Instruction List

PRC__MB1, PRC__KE1, PRC__IE1

7 – 226
Display instructions LEDR

7.9.3 LEDR

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 7 – 227


LEDR Display instructions

Functions Resetting annunciators and error displays


LEDR Reset instruction
The LEDR instruction resets annunciators that were set automatically when an operation error
occured.
Operation of the LEDR instruction with an annunciator set during self-diagnosis:
If during self-diagnosis an error occurs that does not affect the accurate operation of the CPU,
the execution of a LEDR instruction clears the "ERROR" LED or the error display on the CPU.
In addition, SM0, SM1 and SD0 at the user program have to be reset, because they are not
reset automatically by the LEDR instruction. Further steps required to reset the annunciator
are not executed neither.

Operation of the LEDR instruction on occurence of a battery error:


If the LEDR instruction is executed after a battery replacement, the "BAT. ARM/BAT." LED on
the front panel of the CPU and the error display on the CPU are cleared. At the same time,
SM51 is reset automatically.

Operation of the LEDR instruction with an annunciator F set on a CPU without LED
display:
After execution of the LEDR instruction the following operations are executed:
– The "USER" LED on the front panel of the CPU flickers and then turns off.
– The annunciator F stored in SD62 and SD64 are reset and the annunciators stored in SD65
through SD79 are shifted for further processing.
– The new number of annunciator F shifted to SD64 is written to SD62.
– The accumulator of the annunciator in SD63 is decremented by 1. If SD63 is already at 0,
this value remains unchanged.

Before execution After execution

1 Number of stored annunciators


2
F number storage area

7 – 228
Display instructions LEDR

Operation of the LEDR instruction with an annunciator F set on a CPU with LED display:
After execution of the LEDR instruction, the following operations are executed:
– The annunciator displayed on the LED display of the CPU is cleared.
– The "USER" LED on the front panel of the CPU flickers and then turns off.
– The annunciators F stored in SD62 and SD64 are cleared and the annunciators stored in
SD65 through SD79 are shifted for further processing.
– The new number of annunciator F shifted to SD64 is written to SD62.
– The accumulator of the annunciator in SD63 is decremented by 1. If SD63 is already at 0,
this value remains unchanged.
– The current number of annunciator stored in SD62 is displayed. If SD63 is already at 0, there
is nothing displayed.

Before execution After execution

1
Since SD63 is at value 0, no annunciator is displayed on the LED display.
2
Number of stored annunciators

Program LEDR
Example
If X9 is set and the value in register SD63 is not equal to 0, the following program executes a
LEDR instruction.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 229


LEDR Display instructions

NOTE The defaults for the error item numbers set in special register SD207 to SD209 and the order of
priority is shown in the table below:
Factor
Order of number
Description Remark QCPU LCPU
priority (Hexadeci-
mal)
AC DOWN Power supply cut  
Redundant base unit power supply
1 1 SINGLE PS.DOWN 
voltage drop
SINGLE PS.ERROR Redundant power supply module fault 
UNIT VERFY ERR. I/O module verify error 
FUSE BREAK OFF Blown fuse 

2 2 SP. UNIT ERROR Special function module verify error 


Special function module verification
SP. UNIT DOWN error 
Special function module error
OPERATION ERROR Operation error  
LINK PARA ERROR Link parameter error 
SFCP OPE. ERROR SFC instruction operation error 
3 3
SFCP EXE. ERROR SFC program execution error 
REMOTE PASS.FAIL Remote password error 
SNTP OPE.ERROR SNTP error 
ICM.OPE ERROR Memory card operation error  
FILE OPE ERROR File assess error  
EXTEND INST.
Extend instruction error 
ERROR
OPE. MODE DIFF. Operation status, switch mismatch 
Current mode-time function execution
4 4 CAN'T EXE.MODE 
disabled
TRK.TRANS.ERR. Tracking data transmission error
TRK.SIZE ERROR Tracking capacity excess error 
TRK.DISCONNECT Tracking cable not connected, failure
Flash ROM access count exceeded
FLASH ROM ERROR 
error
Constant scan setting time over error  
5 5 PRG.TIME OVER Low speed execution monitoring time

over error
6 6 CHK instruction Error detected with CHK instruction  
7 7 Annunciator —  
8 8 LED instruction —  
9 9 BATTERY ERR. Battery error  
10 A Clock data —  
CAN'T SWITCH System switching error 
11 B STANDBY SYS.DOWN Standby system not started/stop error 
EM.COPY EXE. Memory copy function executed 
12 C DISPLAY ERROR Display unit error 

Error or event occurs



Error or event does not occur

If the highest priority is given to the annunciator, it can be reset with priority by the LEDR instruc-
tion. (Basic model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU)

7 – 230
Failure diagnosis and debugging

7.10 Failure diagnosis and debugging

These instructions are for failure diagnosis and debugging support failure checks.
The following table gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
CHKST CHKST_M
CHK CHK_M
Failure check
CHKCIR CHKCIR_M
CHKEND CHKEND_MD

NOTE Please check, whether these functions are available and supported by your version of the GX
IEC Developer.

Programming MELSEC System Q and L series 7 – 231


CHKST, CHK Failure diagnosis and debugging

7.10.1 CHKST, CHK

CPU High
Basic Process Redundant Universal LCPU
Performance
  

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

CHKSTME1, CHKSTKE1, CHKSTIE

GX Works2

CHKSTGE1

Variables Set Data Meaning Data Type


— — —

7 – 232
Failure diagnosis and debugging CHKST, CHK

Functions Failure check for bidirectional operations


CHKST Start instruction for the CHK instruction
The CHKST instruction starts the execution of the CHK instruction. If the execution condition
for the CHKST instruction is not set (0), the program step following the CHK instruction will be
executed.
With the execution condition for the CHKST instruction set (1), the CHK instruction is executed.
In the ladder diagram below these instructions are programmed.

MELSEC Instruction List Ladder Diagram IEC Instruction List

C
H
K
S
CHKSTME2, CHKSTKE2, CHKSTIE2

CHK Failure check instruction


The CHK instruction with some CPU types (and depending on the control mode) supports
failure check operations for contact circuits with limit switches that monitor bidirectional move-
ment. Once an error occurs within such a circuit, the special relay SM80 is set and the corres-
ponding error code is stored in special register SD80.
The error code is stored as BCD 4-digit data value in special register SD80. The upper 3-digits
store the contact number of the corresponding contact (here contact 62) and the lower digit
stores the number of the failure check circuit (coil number 1 to 6; here coil number 3).

SM80 OFF SM80 ON


2 3
SD80 0 0 0 0 SD80 0 6 2 3

1
Contact 62; coil number 3 (during failure check)
2
Before failure check
3
After failure check
CHK_0E3

The input contacts programmed prior to the CHK instruction do not serve as execution con-
dition for the CHK instruction but as specification of the check conditions.

Programming MELSEC System Q and L series 7 – 233


CHKST, CHK Failure diagnosis and debugging

In the following, the failure check programming via the CHK instruction is illustrated with a con-
crete example. The following illustration shows a conveyor belt that moves from the left to the
right travel limit. The corresponding travel limits are detected via limit switches (X0 and X1).
The start contact for advance movement is X4 and for retract movement is X5.

1 Advance movement
2 Retract movement
3
Advance command
4 Retract command

SWITHCES_0E2

7 – 234
Failure diagnosis and debugging CHKST, CHK

The diagrams below show a sample program for the operation and failure check of the con-
veyor belt shown above.
During error free operation the program jumps to the program step following the CHK instruc-
tion. With leading edge from X4, the conveyor belt is advanced, and Y0 is set for failure check.
With leading edge from X5, the conveyor belt is retracted, and Y0 is reset.
The timer T0 watches the duty cycle time. If the duty cycle time is exceeded the CHKST instruc-
tion is set via the contact TS0. In the next program step the CHK instruction is executed, and
the error code is stored in the special register SD80.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

CHKSTMB1, CHKSTKB1, CHKSTIB1

Programming MELSEC System Q and L series 7 – 235


CHKST, CHK Failure diagnosis and debugging

The operations of the CHK instruction can be illustrated through the following ladder diagrams,
of which the functions are similar to the execution of the CHK instruction.
The contact numbers of the limit switches for advance movement X and retract movement
X+1 have to be designated successively. The number of the advance limit switch X must
be less than the number of the retract limit switch X+1. The contact number of the advance
limit switch is assigned to an output Y with the same address. According to the program
example, this output is set during advance movement and reset during retract movement.
For better comprehensibility of the program example above, the contacts X0 (X), X1 (X+1)
and Y0 (Y) are applied directly for specification of the coil number. Depending on the program
they can be replaced by any other number.

NOTE The outputs Y  are treated as internal relays and cannot be output to external devices.

The following diagrams concerning the CHK instructions and the 6 generated failure check cir-
cuits (error conditions) are arranged in pairs.

In the following, the CHK instructions are illustrated. The contact indicated X serves as vari-
able for maximum 150 contacts (150 conveyor belts or similar applications).

CHKA_AB1, CHKQ_AB1
Failure check circuit 1 (coil number 1):
Both limit switches respond to the advance movement of the conveyor belt.

CHKA_AB2, CHKQ_AB2
Failure check circuit 2 (coil number 2):
Both limit switches respond to the retract movement of the conveyor belt.

CHKA_AB3, CHKQ_AB3

7 – 236
Failure diagnosis and debugging CHKST, CHK

Failure check circuit 3 (coil number 3):


Advance command for set advance limit switch.

CHKA_AB4, CHKQ_AB4

Failure check circuit 4 (coil number 4):


Retract command for set retract limit switch.

CHKA_AB5, CHKQ_AB5

Failure check circuit 5 (coil number 5):


Advance command for reset retract limit switch.

CHKA_AB6, CHKQ_AB6

Failure check circuit 6 (coil number 6):


Retract command for reset advance limit switch.

CHKQ_AB7

Programming MELSEC System Q and L series 7 – 237


CHKST, CHK Failure diagnosis and debugging

The CHK instruction can designate a maximum of 150 contact numbers for advance limit
switches. For the designation of contact numbers any contact number of the retract limit switch
is skipped.

CHKSTAB2
The relay SM80 and the special register SD80 have to be reset after execution of the CHK
instruction because they retain their condition after being set. If they are not reset prior to
another CHK instruction, the instruction cannot be executed.
The CHKST instruction has to be programmed prior to the CHK instruction. An error will be
returned if an instruction other than the LD, LDI, AND or ANI instruction is used between the
CHK instruction and the CHKST instruction.
The CHK instruction can be programmed in any program step of the sequence program. The
CHK instruction can be used up to two times in all program files being executed. In a single
program file a CHK instruction may be used only once.
The coil numbers have to be programmed via a LD or AND instruction prior to the CHK instruc-
tion. Other input instructions are not supported. If an LDI or ANI instruction is programmed, the
failure check of the CHK instruction cannot be executed. The contact numbers designated for
the failure check however can be designated via the LDI and ANI instructions. In the diagram
below the switch with the number X9 is ignored because it is an NC contact (normally closed).

CHKSTAB3
The failure detection method depends on the status of the special relay SM710 as follows.
● SM710 is reset (0):
The failure check is performed in coil number (failure check circuit) sequence from contact
1(limit switch) to contact n (limit switch).
The first contact is checked from coil number 1 through coil number 6. Then the next contact
is checked from coil number 1 through coil number 6. The operation is completed after the
nth contact is checked from coil number 1 through coil number 6.
● SM710 ist set (1):
The failure check is performed in contact number (limit switch) sequence from coil 1 (failure
check circuit) through coil 6 (failure check circuit).
The first coil is checked from contact number 1 through contact number n. Then the next
coil is checked from contact number 1 through contact number n. The operation is completed
after the 6th coil is checked from contact number 1 through contact number n.

If more than one failure is detected, the number of the first failure detected is stored. Further
detected failures are ignored.
The CHK instruction cannot be used by a low speed execution type program. If a low speed
execution type program has been set in a program file containing the CHK instruction, an oper-
ation error will be returned, and the CPU module operation will be suspended.

7 – 238
Failure diagnosis and debugging CHKST, CHK

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Two failure check input contacts within one failure check circuit are connected in parallel.
(Error code 4235)
● There is an NOP instruction.
(Error code 4235)
● More than 150 input devices are specified.
(Error code 4235)
● A CHKST instruction is not followed by a CHK instruction.
(Error code 4235)
● A CHK instruction is executed without a prior CHKST instruction.
(Error code 4235)
● The CHKST and CHK instruction are used in a low speed execution type program.
(Error code 4235)
● There is an instruction other than the LD, LDI, AND or ANI instruction between the CHK
instruction and the CHKST instruction.
(Error code 4235)
● The CHK instruction is used at three places or more in all of programs being executed.
(Error code 4235)
● The CHK instruction is used at two places or more in a single program.
(Error code 4235)

Programming MELSEC System Q and L series 7 – 239


CHKCIR, CHKEND Failure diagnosis and debugging

7.10.2 CHKCIR, CHKEND

CPU High
Basic Process Redundant Universal LCPU
Performance
  

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

CHKCIME1, CHKCIKE1, CHKCIIE1

GX Works2

CHKCIGE1

Variables Set Data Meaning Data Type


— — —

7 – 240
Failure diagnosis and debugging CHKCIR, CHKEND

Functions Generating check circuits for the CHK instruction


CHKCIR, CHKEND Start and end instructions for a program part with generated
check circuits
The CHKCIR and CHKEND instructions alter check circuits for the CHK instruction. Any
required check format can be generated. The actual failure check is performed via the CHKST
and CHK instructions.
The failure check is executed via the error check circuits programmed between the CHK and
the CHKEND instruction.

NOTE If the check circuit format for the CHK instruction was altered via the CHKCIR and CHKEND
instructions, connected peripheral devices have to be started up in "General Mode", and a pro-
gram expansion has to be performed.

From the error check circuits between the CHKCIR and CHKEND instructions altered error
check circuits are generated through index qualification. The error check circuits programmed
between these instructions can be assigned 9 annunciators (F1 - F9). Index qualification is per-
formed through the addition of contact numbers designated prior to the CHK instruction and
contact numbers of the error check circuits. For example, the contact X10 in the error check
circuits shown below will be assigned X12 and X18 in the index qualified check circuits due to
the contacts X2 and X8, programmed prior to the CHK instruction.
The error check algorithm depends on the status of the special relay SM710 as follows:
● SM710 is reset (0):
First in this case, each contact number in the error check circuit programmed between the
CHKCIR and CHKEND instruction is index qualified with the first contact number designated
prior to the CHK instruction. Then, each programmed check circuit is index qualified again
with the second contact number designated prior to the CHK instruction. This operation is
completed as for any programmed check circuit with assigned annunciator (F) a total of new
check circuits equivalent to the number of input contacts of the CHK instruction exists.

CHKCIAB1, PFEIL0E1, CHKCIAB2

Programming MELSEC System Q and L series 7 – 241


CHKCIR, CHKEND Failure diagnosis and debugging

● SM710 is set (1):


First in this case, the first programmed error check circuit with assigned annunciator is index
qualified with all contact numbers programmed prior to the CHK instruction. Then, the
following check circuit is index qualified with all contact numbers programmed prior to the
CHK instruction. This operation is completed as for any programmed check circuit with
assigned annunciator (F) a total of new check circuits equivalent to the number of input
contacts of the CHK instruction exists.

CHKCIAB3, PFEIL0E1, CHKCIAB4

During error check of the index qualified error check circuits, the outputs (F) that can only be
set via the OUT F instruction are checked for their status. If an output (F) is set, the special
relay SM80 is set. The error code consisting of contact number and error check circuit (F1 to
F9) is stored in special register SD80 in BCD data format.
The error check circuits between the CHKCIR and CHKEND instruction can be programmed
with the following instructions.
● Contacts:
LD, LDI, AND, ANI, OR, ORI, ANB, ORB, MPS, MPP, MRD, comparison operation instruc-
tions.
● Coils:
OUT F

The inputs X and outputs Y have to be programmed as devices for the contacts.
Only annunciators (F) can be programmed as outputs of error check circuits. The error check
circuits can be specified any random designation from F0 on, since these outputs are pro-
cessed as dummy contacts. For this reason, no errors occur with annunciators (F) overlapping.
The status of annunciators (F) can even be checked accurately, if one annunciator (F) is pro-
grammed twice beyond the CHK instruction, because both of these annunciator functions are
processed separately.
Since the status (0/1) of annunciators (F) applied by the CHK instruction is not updated, the
annunciators even remain reset, if they are monitored by a peripheral device.

7 – 242
Failure diagnosis and debugging CHKCIR, CHKEND

The error check circuits programmed between the CHKCIR and CHKEND instructions can be
created with maximum 256 program steps (contact branches) and 9 outputs (annunciators F1
to F9) addressed by OUT F instructions.
The error check circuits between the CHKCIR and CHKEND instructions are designated from
top error check circuit 1 (F0) to bottom error check circuit 9 (F8).

CHKCIAB5

The CHKCIR and CHKEND instructions can be programmed at any program step of the
sequence program. In total, these instructions may only exist twice in all program files to be
executed and once within one program file.
The CHKCIR and CHKEND instructions cannot be applied in low-speed programs, otherwise
an operation error occurs and the CPU terminates processing.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The CHKCIR and CHKEND instructions appear more than twice in all program files.
(Error code 4235)
● The CHKCIR and CHKEND instructions appear more than once within one program file.
(Error code 4235)
● The CHKEND instruction is not executed after the CHKCIR instruction.
(Error code 4230)
● The CHKEND instruction is executed without a preceding CHKCIR instruction.
(Error code 4230)
● The CHKCIR and CHKEND instructions are programmed in a low-speed program.
(Error code 4235)
● 10 or more annunciators (F) (error check circuits) are addressed.
(Error code 4235)
● The created error check circuits contain more than 256 program steps (contact branches).
(Error code 4235)
● The error check circuits contain invalid devices.
(Error code 4235)
● The error check circuits contain devices already index qualified.
(Error code 4235)

Programming MELSEC System Q and L series 7 – 243


CHKCIR, CHKEND Failure diagnosis and debugging

Program CHKCIR, CHKEND


Example
The following program creates index qualified error check circuits. The operations of this pro-
gram are illustrated under the topic "functions". In addition, the MELSEC and IEC instruction
lists are shown below.

MELSEC Instruction List Ladder Diagram IEC Instruction List

CHKCIRMB1, CHKCIRKB1, CHKCIRIB1

7 – 244
Character string processing instructions

7.11 Character string processing instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
BINDA_MD
BINDA BINDA _K_MD
BINDA_S_MD
BINDA_P_MD
BINDAP BINDA_K_P_MD
Conversion of BINDA_P_S_MD
16-/32-bit binary data into
decimal values in ASCII code DBINDA_MD
DBINDA DBINDA_K_P_MD
DBINDA_P_S_MD
DBINDA_P_MD
DBINDAP DBINDA_K_P_MD
DBINDA_P_S_MD
BINHA_MD
BINHA BINHA_K_MD
BINHA_S_MD
BINHA_P_MD
BINHAP BINHA_K_P_MD
Conversion of BINHA_P_S_MD
BIN 16-/32-bit binary data into
ASCII code DBINHA_MD
DBINHA DBINHA_K_MD
DBINHA_S_MD
DBINHA_P_MD
DBINHAP DBINHA_K_P_MD
DBINHA_P_S_MD
BCDDA_MD
BCDDA BCDDA_K_MD
BCDDA_S_MD
BCDDA_P_MD
BCDDAP BCDDA_K_P_MD
Conversion of BCDDA_P_S_MD
4-/8-digit BCD data into
ASCII code DBCDDA_MD
DBCDDA DBCDDA_K_MD
DBCDDA_S_MD
DBCDDA_P_MD
DBCDDAP DBCDDA_K_P_MD
DBCDDA_P_S_MD

Programming MELSEC System Q and L series 7 – 245


Character string processing instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
DABIN_MD
DABIN
DABIN_S_MD
DABIN_P_MD
DABINP
Conversion of DABIN_P_S_MD
decimal ASCII data into
BIN 16-/32-bit binary data DDABIN_MD
DDABIN
DDABIN_S_MD
DDABIN_P_MD
DDABINP
DDABIN_P_S_MD
HABIN_MD
HABIN
HABIN_S_MD
HABIN_P_MD
HABINP
Conversion of HABIN_P_S_MD
hexadecimal ASCII data into
BIN 16-/32-bit binary data DHABIN_MD
DHABIN
DHABIN_S_MD
DHABIN_P_MD
DHABINP
DHABIN_P_S_MD
DABCD_MD
DABCD
DABCD_S_MD
DABCD_P_MD
DABCDP
Conversion of DABCD_P_S_MD
decimal ASCII data into
4-/8-digit BCD data DDABCD_MD
DDABCD
DDABCD_S_MD
DDABCD_P_MD
DDABCDP
DDABCD_P_S_MD
COMRD_MD
COMRD
COMRD_S_MD
Read-out of comment data
COMRD_P_MD
COMRDP
COMRD_P_S_MD
LEN_E
LEN LEN_MD
Detection of character string length
LEN_S_MD
LENP LEN_P_S_MD
STR_MD
STR STR_K_MD
STR_S_MD
STR_P_MD
STRP STR_K_P_MD
Conversion of STR_P_S_MD
BIN 16-/32-bit binary data into
character string data DSTR_MD
DSTR DSTR_K_MD
DSTR_S_MD
DSTR_P_MD
DSTRP DSTR_K_P_MD
DSTR_P_S_MD

7 – 246
Character string processing instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
VAL_MD
VAL
VAL_S_MD
VAL_P_MD
VALP
Conversion of character string data VAL_P_S_MD
into BIN 16-/32-bit binary data DVAL_MD
DVAL
DVAL_S_MD
DVAL_P_MD
DVALP
DVAL_P_S_MD

Conversion of floating point data into ESTR ESTR_M


character string data ESTRP ESTRP_M

Conversion of character string data EVAL EVAL_M


into decimal floating point data EVALP EVALP_M
ASC_MD
ASC ASC_K_MD

Conversion of alphanumerical charac- ASC_S_MD


ter strings into ASCII code ASC_P_MD
ASCP ASC_P_S_MD
ASC_K_P_MD
HEX_MD
HEX HEX_K_MD

Conversion of hexadecimal HEX_S_MD


ASCII values into binary values HEX_P_MD
HEXP HEX_K_P_MD
HEX_P_S_MD

Extraction of character string data RIGHT RIGHT_M


(right part of character string) RIGHTP RIGHTP_M

Extraction of character string data LEFT LEFT_M


(left part of character string) LEFTP LEFTP_M

Random extraction of parts from cha- MIDR MIDR_M


racter strings MIDRP MIDRP_M
Selecting and moving parts of MIDW MIDW_M
character strings into a
character string MIDWP MIDWP_M
INSTR INSTR_M
INSTRP INSTRP_M
STRINS
Search for character strings
STRINSP
STRDEL
STRDELP

Floating point data conversion with EMOD EMOD_M


BCD representation EMODP EMODP_M

BCD data conversion with decimal EREXP EREXP_M


floating point format EREXPP EREXPP_M

Programming MELSEC System Q and L series 7 – 247


BINDA, BINDAP, DBINDA, DBINDAP Character string processing instructions

7.11.1 BINDA, BINDAP, DBINDA, DBINDAP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BINDAME1, BINDAKE1, BINDAIE1

GX Works2

BINDAGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s Binary data to be converted into ASCII format BIN 16-/32-bit ANY16/32
Array [1..4]/
Character
d First number of device storing the conversion result [1..6] of
string
ANY16

7 – 248
Character string processing instructions BINDA, BINDAP, DBINDA, DBINDAP

Functions Conversion of 16-/32-bit binary data into decimal values in ASCII code
BINDA Conversion of 16-bit binary data
The BINDA instruction converts a 16-bit binary value specified by s into a decimal value in
ASCII code and stores it in the device specified in d (Array_d[1]) through d+3 (Array_d[4]).

b15 b8b7 b0
d 2
b15 b0
s d+1 3
d+2 4
1 d+3 0 5

1 16-bit binary data


2
Digit of tenthousands in ASCII code/ sign character
3
Digit of hundreds in ASCII code/ digit of thousands in ASCII code
4 Digit of ones in ASCII code/ digit of tens in ASCII code

5
With the relay SM701 not set
BINDA0E1
The value specified by s is stored as decimal value in ASCII code beginning from d (Array_d[1])
through d+3 (Array_d[4]).

b15 b8b7 b0
d 31H (1) 2DH(-)
b15 b0
d+1 33H (3) 32H (2)
s - 1 2 3 4 5
d+2 35H (5) 34H (4)
1 d+3 00H

BINDA0E2
1
Binary value

The 16-bit binary value may range from -32768 to 32767.


The results of the conversion operations are stored in d as follows:
– If the 16-bit binary value is positive, the sign character is stored as "20H".
– If the 16-bit binary value is negative, the sign character is stored as "2DH".

The stored sign character "20H" replaces the preceding zeroes.


For the value 00325 for example the zeroes of the digits of tenthousands and thousands are
replaced by "20H" so that only the actually required digits are stored.
The storage of data in the device specified by d+3 (Array_d[4]) depends on the status of the
relay SM701:
● If the relay is not set, a zero "00H" is stored in the area d+3 (Array_d[4]).
● If the relay is set, the value in d+3 (Array_d[4]) remains unchanged.

Programming MELSEC System Q and L series 7 – 249


BINDA, BINDAP, DBINDA, DBINDAP Character string processing instructions

DBINDA Conversion of 32-bit binary data


The DBINDA instruction converts 32-bit binary data specified by s and s+1 into a decimal value
in ASCII code and stores it in the device specified in d (Array_d[1]) through d+5 (Array_d[6]).

b15 b8b7 b0
d 4
d+1 5
s+1 s
d+2 6
1 2
d+3 7
3 d+4 8
d+5 9
10

1
Upper 16 bits
2
Lower 16 bits
3
32-bit binary data
4
Sign character/ digit of billions in ASCII code
5
Digit of ten millions/ digit of one hundred millions in ASCII code
6
Digit of one hundred thousands/ digit of millions in ASCII code
7
Digit of thousands/ digit of ten thousands in ASCII code
8 Digit of tens/ digit of hundreds in ASCII code

9 0 or 20H/ digit of ones in ASCII code

10
With the relay SM701 not set (0)/ with the relay SM701 set (20H)
DBINDA0E1

The value specified by s and s+1 is stored beginning from d (Array_d[1]) through d+5
(Array_d[6]) as decimal value in ASCII code.

b15 b8b7 b0
d 20 H 2D H (-)
s+1 d+1 31 H (1) 20 H
d+2 33 H (3) 32 H (2)
-12 3 4 5 6 7 8
d+3 35 H (5) 34 H (4)
d+4 37 H (7) 36 H (6)
d+5 0/20 H 38 H (8)

DBINDA0E2
The 32-bit binary value specified by s may range from -2147483648 to 2147483647.
The results of the conversion operation are stored in d (Array_d[1]) through d+5 (Array_d[6])
as follows:
– If the binary value is positive, the sign character is stored as "20H".
– If the binary value is negative, the sign character is stored as "2DH".

The stored sign character "20H" replaces the preceding zeroes.


For the value 0012034560 for example the zeroes of the digits of billions and hundred millions
are replaced by "20H" so that only the actually required digits are stored.
The storage of data in the upper 8 bits of the device specified by d+5 (Array_d[6]) depends on
the status of the relay SM701:
● If this relay is not set, a zero "00H" is stored in the area d+5 (Array_d[6]).
● If this relay is set, a space character (20H) is stored in the area d+5 (Array_d[6).

7 – 250
Character string processing instructions BINDA, BINDAP, DBINDA, DBINDAP

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program BINDAP
Example 1
The following program outputs the value of the 16-bit binary data in W0 as decimal value in
ASCII code via the BINDAP instruction. The PR instruction outputs the characters at Y40
through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b8b7 b0
D0 20 H 20 H
W0 PR
D1 31 H 35 H (5) Y40 – Y48
5126
D2 36 H 32 H “ 5126“
1
D3 00 H 2

1 Binary value
2
Output
BINDAMB1, BINDAKB1, BINDAIB1, DBINDA0B1

Programming MELSEC System Q and L series 7 – 251


BINDA, BINDAP, DBINDA, DBINDAP Character string processing instructions

Program DBINDAP
Example 2
The following program outputs the value of the 32-bit binary data in W10 and W11 as decimal
value in ASCII code via the DBINDAP instruction. The PR instruction outputs the characters at
Y40 through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b8b7 b0
D0 20 H 2D H (-)
W11 W10 D1 20 H 20 H
D2 38 H (8) 33 H (3) PR
- 3 8 4 2 5 6 3 Y40 – Y48
D3 32 H (2) 34 H (4)
1 “ 3842563“
D4 36 H (6) 35 H (5) 2
D5 00 H 33 H (3)

1 Output
2
Binary value
BINDAMB2, BINDAKB2, BINDAIE2, DBIND0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 252
Character string processing instructions BINHA, BINHAP, DBINHA, DBINHAP

7.11.2 BINHA, BINHAP, DBINHA, DBINHAP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BINHAME1, BINHAKE1, BINHAIE1

GX Works2

BINHAGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s Binary data to be converted into ASCII format BIN 16-/32-bit ANY16/32
Array [1..3]/
Character
d First number of device storing the conversion result [1..5] of
string
ANY16

Programming MELSEC System Q and L series 7 – 253


BINHA, BINHAP, DBINHA, DBINHAP Character string processing instructions

Functions Conversion of 16-/32-bit binary data into hexadecimal values in ASCII code
BINHA Conversion of 16-bit binary data
The BINHA instruction converts 16-bit binary data specified by s into a hexadecimal value in
ASCII code and stores it in the devices specified by d (Array_d[1]) through d+2 (Array_d[3]).

b15 b8b7 b0
b15 b0 d 2
s d+1 3
d+2 0 4
1

1
16-bit binary data
2
ASCII code of the 3rd digit/ ASCII code of the 4th digit
3 ASCII code of the 1st digit/ ASCII code of the 2nd digit

4
With the relay SM701 not set
BINHA0E1

The value specified by s is stored in ASCII code in d (Array_d[1]) through d+2 (Array_d[3]).

b15 b8b7 b0
d 32 H (2) 30 H (0)
b15 b0
d+1 36 H (6) 41 H (A)
s 02A6H
d+2 00 2
1

1
16-bit binary data
2
With the relay SM701 not set
BINHA0E2

The 16-bit binary data specified by s may range from 0H to FFFFH.


The conversion result is stored as 4-digit hexadecimal value in d (Array_d[1]) through d+2
(Array_d[3]).
If one of the digits is 0, this digit is processed as value 0 (zeroes are not suppressed).
The storage of the data in the device specified by d+2 (Array_d[3]) depends on the status of
the relay SM701 as follows:
● If this relay is not set, a zero "00H" is stored in the area d+2 (Array_d[3]).
● If this relay is set, the value in d+2 (Array_d[3]) remains unchanged.

7 – 254
Character string processing instructions BINHA, BINHAP, DBINHA, DBINHAP

DBINHA Conversion of 32-bit binary data


The DBINHA instruction converts 32-bit binary data specified by s and s+1 into a hexadecimal
value in ASCII code and stores it in the devices specified by d (Array_d[1]) through d+4
(Array_d[5]).

b15 b8b7 b0
d 4
s+1 s d+1 5
d+2 6
1 2
d+3 7
3 d+4 0 8

1 Upper 8 bits
2
Lower 8 bits
3
32-bit binary data
4 ASCII code of the 7th digit/ ASCII code of the 8th digit

5
ASCII code of the 5th digit/ ASCII code of the 6th digit
6
ASCII code of the 3th digit/ ASCII code of the 4th digit
7 ASCII code of the 1st digit/ ASCII code of the 2nd digit

8 With the relay SM701 not set

DBINH0E1

The value "03AC625EH" specified in s and s+1 is stored in d as follows:

b15 b8b7 b0
d 33 H (3) 30 H (0)
s+1 d+1 43 H (C) 41 H (A)
d+2 32 H (2) 36 H (6)
03AC 625EH
d+3 45 H (E) 35 H (5)
1 d+4 00 H

1
BIN 32-bit data
DBINH0E2

The 32-bit binary value specified by s and s+1 may range from 0H to FFFFFFFFH.
The conversion result is stored as 8-digit hexadecimal value in d (Array_d[1]) through d+4
(Array_d[5]).
If one of the digits is 0, this digit is processed as value 0 (zeroes are not suppressed).
The storage of the data in the device specified by d+4 (Array_d[5]) depends on the status of
the relay SM701 as follows:
● If this relay is not set, a zero "00H" is stored in the area d+4 (Array_d[5]).
● If this relay is set, the value in d+4 (Array_d[5]) remains unchanged.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 255


BINHA, BINHAP, DBINHA, DBINHAP Character string processing instructions

Program BINHAP
Example 1
The following program outputs the value of the 16-bit binary data in W0 as decimal value in
ASCII code via the BINHAP instruction. The PR instruction outputs the characters at Y40
through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b8b7 b0
W0 D0 43 H (C) 39 H (9)
PR
9C06H D1 36 H (6) 30 H (0) Y40 – Y48
1 D2 00
“9C06”
2

1
Output
2
Binary data
BINHAMB1, BINHAKB1, BINHAIB1, DBINH0B1

7 – 256
Character string processing instructions BINHA, BINHAP, DBINHA, DBINHAP

Program DBINHAP
Example 2
The following program outputs the value of the 32-bit binary data in W10 and W11 via the
DBINHAP instruction as decimal value in ASCII code. The PR instruction outputs the characters
at Y40 through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b8b7 b0
D0 42 H (B) 37 H (7)
W11 W10 D1 43 H (C) 33 H (3) PR
7 B 3 C 5 8 1 FH D2 38 H (8) 35 H (5) Y40 – Y48
D3 46 H (F) 31 H (1)
1 “7B3C581F”
D4 00 H 2

1
Output
2 Binary value
BINHAMB2, BINHAKB2, BINHAIB2, DBINHA0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 257


BCDDA, BCDDAP, DBCDDA, DBCDDAP Character string processing instructions

7.11.3 BCDDA, BCDDAP, DBCDDA, DBCDDAP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

BCDDAME1, BCDDAKE1, BCDDAIE1

GX Works2

BCDDAGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
s BCD data to be converted into ASCII format Word ANY16/32
Array [1..3]/
Character
d FIrst number of device storing the conversion result [1..5] of
string
ANY16

7 – 258
Character string processing instructions BCDDA, BCDDAP, DBCDDA, DBCDDAP

Functions Conversion of 4-/ 8-digit BCD data into ASCII code


BCDDA Conversion of 4-digit BCD data
The BCDDA instruction converts 4-digit BCD data specified by s into the ASCII format and
stores it in the devices specified by d (Array_d[1]) through d+2 (Array_d[3]).

b15 b7b8 b0
b15 b12 b11 b8 b7 b4b3 b0 d 6
s d+1 7
d+2 0
1 2 3 4
5

1 Digit of thousands
2
Digit of hundreds
3
Digit of tens
4 Digit of ones

5
With the relay SM701 not set
6
ASCII code of the 3rd digit/ ASCII code of the 4th digit
7 ASCII code of the 1st digit/ ASCII code of the 2nd digit

BCDDA0E1

The value 9105 specified in s is stored in d as follows:

b15 b8b7 b0
b15 b12 b11 b8b7 b4b3 b0 d 31 H (1) 39 H (9)
9 1 0 5 d+1 35 H (5) 30 H (0)
d+2 00 H

BCDDA0E2
The BCD value specified in s may range from 0 to 9999.
The conversion result is stored in d (Array_d[1]) through d+2 (Array_d[3]).
If one of the digits is 0, this digit is processed as "30H" (zeroes are not suppressed).
The storage of the data in the device specified by d+2 (Array_d[3]) depends on the status of
the relay SM701 as follows:
● If this relay is not set, a zero "00H" is stored in the area d+2 (Array_d[3]).
● If this relay is set, the value in d+2 (Array_d[3]) remains unchanged.

Programming MELSEC System Q and L series 7 – 259


BCDDA, BCDDAP, DBCDDA, DBCDDAP Character string processing instructions

DBCDDA Conversion of 8-digit BCD data


The DBCDDA instruction converts 8-digit BCD data specified by s and s+1 into the ASCII for-
mat and stores it in the devices specified by d (Array_d[1]) through d+4 (Array_d[5]).

b15 b7b8 b0
s+1 s d 9
b31 b16 b15 b0 d+1 10
d+2 11
2 3 4 5 6 7 8 d+3 12
1
0 13

1
Digit of ten millions
2
Digit of millions
3
Digits of hundred thousands
4
Digit of ten thousands
5
Digit of thousands
6
Digit of hundreds
7
Digit of tens
8 Digit of ones

9 ASCII code of the 7th digit/ ASCII code of the 8th digit

10
ASCII code of the 5th digit/ ASCII code of the 6th digit
11ASCII code of the 3rd digit/ ASCII code of the 4th digit

12ASCII code of the 1st digit/ ASCII code of the 2nd digit

13
With the relay SM701 not set
DBCDDA0E1

The value 01234056 specified in s and s+1 is stored in d as follows:

b15 b7b8 b0
d 31 H (1) 30 H (0)
b31 b16 b15 b0 d+1 33 H (3) 32 H (2)
0 1 2 3 4 0 5 6 d+2 30 H (0) 34 H (4)
d+3 36 H (6) 35 H (5)
s+1 s
d+4 00 H

DBCDDA0E2

The BCD value specified by s and s+1 may range from 0 to 99999999.
The conversion result is stored in d (Array_d[1]) through d+4 (Array_d[5]).
If one of the digits is 0, this digit is processed as "30H" (zeroes are not suppressed).
The storage of the data in the device specified by d+4 (Array_d[5]) depends on the status of
the relay SM701:
● If this relay is not set, a zero "00H" is stored in the area d+4 (Array_d[5]).
● If this relay is set, the value in d+4 (Array_d[5]) remains unchanged.

7 – 260
Character string processing instructions BCDDA, BCDDAP, DBCDDA, DBCDDAP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The BCD data in s exceed the range of 0 to 9999 during the execution of the BCDDA
instruction.
(Error code 4100)
● The BCD data in s exceed the range of 0 to 99999999 during the execution of the DBCDDA
instruction.
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program BCDDAP
Example 1
The following program outputs the value of the 4-digit BCD data in W0 as decimal value in
ASCII code via the BCDDAP instruction. The PR instruction outputs the characters at Y40
through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b7b8 b0
W0 D0 32 H (2) 31 H (1) PR
1 2 9 5 D1 35 H (5) 39 H (9) Y 40 – Y48
D2 00 H “1295”

BCDDAMB1, BCDDAKB1, BCDDAIB1, DBCDDA0B1

Programming MELSEC System Q and L series 7 – 261


BCDDA, BCDDAP, DBCDDA, DBCDDAP Character string processing instructions

Program DBCDDAP
Example 2
The following program outputs the value of the 8-digit BCD data in W10 and W11 as decimal
value in ASCII code via the PR instruction. The PR instruction outputs the characters at Y40
through Y48.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b7b8 b0
D0 35 H (5) 33 H (3)
W11 W10 D1 37 H (7) 34 H (4) PR
3 5 4 7 8 3 5 2 D2 33 H (3) 38 H (8) Y40 – Y48
D3 32 H (2) 35 H (5)
“35478352”
D4 00 H

DBCDDA0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 262
Character string processing instructions DABIN, DABINP, DDABIN, DDABINP

7.11.4 DABIN, DABINP, DDABIN, DDABINP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d        — —

GX IEC
Ladder Diagram IEC Instruction List
Developer MELSEC Instruction List

DABINME1, DABINKE1, DABINIE1

GX Works2

DABINGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Array [1..3]/
Character
s Storage area storing the ASCII data to be converted [1..6] of
string
ANY16
d Storage area storing the conversion result BIN 16-/32-bit ANY16/32

Programming MELSEC System Q and L series 7 – 263


DABIN, DABINP, DDABIN, DDABINP Character string processing instructions

Functions Conversion of decimal ASCII data into BIN 16-/32-bit binary data
DABIN Conversion of BIN 16-bit binary data
The DABIN instruction converts the decimal ASCII data specified in the area s (Array_s[1])
through s+2 (Array_s[3]) into the BIN 16-bit format and stores it in the devices specified by d.

b15 b8b7 b0
s 1 b15 b0
s+1 2 d
s+2 3 4

1 ASCII code of the digit of ten thousands/ sign character


2
ASCII code of the digit of hundreds/ ASCII code of the digit of thousands
3
ASCII code of the digit of ones/ ASCII code of the digit of tens
4 BIN 16-bit binary data

DABIN0E1

The value specified in the area s (Array_s[1]) through s+2 (Array_s[3]) is stored in d as -25018
as follows:

b15 b8b7 b0
s 32 H (2) 2DH (-) b15 b0
s+1 31 H (1) 35 H (5) d - 2 5 1 0 8
s+2 38 H (8) 30 H (0)

DABIN0E2
The ASCII value specified by s (Array_s[1]) through s+2 (Array_s[3]) may range from -32768
to 32767.
The sign character is stored as "20H" if the binary value is positive. For a negative result the
sign character "2DH" is stored.
Each stored digit of the ASCII code may range from "30H" to "39H".
If a digit contains the value "20H" or "00H", this value will be overwritten automatically with the
value "30H".

7 – 264
Character string processing instructions DABIN, DABINP, DDABIN, DDABINP

DDABIN Conversion into BIN 32-bit data


The DDABIN instruction converts the decimal ASCII data specified in the area s (Array_s[1])
through s+5 (Array_s[6]) into the BIN 32-bit format and stores it in the devices specified by d
and d+1.

b15 b8b7 b0
s 4
s+1 5 d+1 d
6 b31 b16 b15 b0
s+2
3 2
s+3 7
s+4 8 1
s+5 9

1 BIN 32-bit binary data


2
Lower 16-bit
3
Upper 16-bit
4 ASCII code of the digit of billions / sign character

5
ASCII code of the digit of ten millions / ASCII code of the digit of hundred millions
6
ASCII code of the digit of hundred thousands / ASCII code of the digit of millions
7 ASCII code of the digit of thousands / ASCII code of the digit of ten thousands

8 ASCII code of the digit of tens / ASCII code of the digit of hundreds

9
Is ignored / ASCII code of the digit of tens
DDABI0E1

The value specified in the area s (Array_s[1]) through s+5 (Array_s[6]) is stored in d as
-1234543210 as follows:

b15 b8b7 b0
s 31H (1) 2DH (-)
s+1 33 H (3) 32 H (2)
35 H (5) 34 H (4) d+1 d
s+2
-12345 43210
s+3 33H (3) 34 H (4)
s+4 31H (1) 32 H (2)
s+5 30 H (0)

DDABI0E2
The ASCII value specified in s (Array_s[1]) through s+5 (Array_s[6]) may range from
-2147483648 to 2147483647.
The sign character is stored as "20H" if the binary value is positive. For a negative result the
sign character "2DH" is stored.
Each stored digit of the ASCII code may range from "30H" to "39H".
If a digit contains the value "20H" or "00H", this value will be overwritten automatically with the
value "30H".

Programming MELSEC System Q and L series 7 – 265


DABIN, DABINP, DDABIN, DDABINP Character string processing instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The sign character stored in the lower 16 bits of the device s (Array_s[1]) contains a value
different from "30H" to "39H, "20H" or "00H".
(Error code 4100)
● The ASCII code stored in the area s (Array_s[1]) through s+5 (Array_s[6]) contains values
different from "30H" to "39H, "20H" to "00H".
(Error code 4100)
● The ASCII code stored in the area s (Array_s[1]) through s+5 (Array_s[6]) exceeds the
following range of values:
For the DABIN instruction -32768 to 32767
For the DDABIN instruction -2147483648 to 2147483647.
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program DABINP
Example 1
The following program converts the five-digit decimal ASCII value in D20 (var_D20 Array [0])
through D22 (var_D20 Array [2]) into a binary value and stores it in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D20 20 H 2DH (-) D0
D21 32 H (2) 20 H - 276
1
D22 36 H (6) 37 H (7) 2
“ 276“

1
Is read as -00276
2
Binary value
DABINMB1, DABINKB1, DABINIB1, DDABI0B1

7 – 266
Character string processing instructions DABIN, DABINP, DDABIN, DDABINP

Program DDABINP
Example 2
The following program converts the ten-digit decimal ASCII value in D20 (var_D20 Array [0])
through D25 (var_D20 Array [5]) into a binary value and stores it in D10 and D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D20 20 H 20 H
D21 20 H 20 H
D11 D10
D22 39 H (9) 33 H (3)
D23 38 H (8) 36 H (6) 3 9 6 8 3 7 0
1
37 H (7) 33 H (3) 2
D24
D25 30 H (0)
“ 3968370“

1
Is read as +0003968370
2
Binary value
DABINMB2, DABINKB2, DABINIB2, DDABI0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 267


HABIN, HABINP, DHABIN, DHABINP Character string processing instructions

7.11.5 HABIN, HABINP, DHABIN, DHABINP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

HABINGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
ANY32/Array
Character
s Storage area storing the ASCII data to be converted [1..4] of
string
ANY16
d Storage area storing the conversion result BIN 16-/32-bit ANY16/32

7 – 268
Character string processing instructions HABIN, HABINP, DHABIN, DHABINP

Functions Conversion of hexadecimal ASCII data into BIN 16-/32-bit binary data
HABIN Conversion into BIN 16-bit data
The HABIN instruction converts the hexadecimal ASCII data in the device specified by s and
s+1 into the BIN 16-bit binary format and stores it in the devices specified by d.

b15 b8b7 b0
s 1 b15 b0
s+1 2 d
3

1
ASCII code for the 3rd digit/ ASCII code for the 4th digit
2
ASCII code for the 1st digit/ ASCII code for the 2nd digit
3
BIN 16-bit binary data
HABIN0E1

The value "5A8DH" specified in s through s+1 is stored in d after being processed as follows:

b15 b8b7 b0
s b15 b0
41H (A) 35H (5)
d 5A8D H
s+1 44 H (D) 38H (8)

HABIN0E2
The ASCII value specifed in s through s+1 may range from 0000H to FFFFH.
Each stored digit of the ASCII code may range from "30H" to "39H" and from "41H" to "46H".

Programming MELSEC System Q and L series 7 – 269


HABIN, HABINP, DHABIN, DHABINP Character string processing instructions

DHABIN Conversion into BIN 32-bit data


The DHABIN instruction converts the hexadecimal ASCII data specified in the area
s (Array_s[1]) through s+3 (Array_s[4]) into the BIN 32-bit format and stores it in the devices
specified by d and d+1.

b15 b8b7 b0
s 1 d+1 d
b31 b16 b15 b0
s+1 2
5 6
s+2 3
s+3 4 7

1
ASCII code of the 7th digit / ASCII code of the 8th digit
2
ASCII code of the 5th digit / ASCII code of the 6th digit
3 ASCII code of the 3rd digit / ASCII code of the 4th digit

4
ASCII code of the 1st digit / ASCII code of the 2nd digit
5
Upper 16 bits
6 Lower 16 bits

7 BIN 32-bit binary data

DHABI0E1

The value "5CB807E1" specified in s (Array_s[1]) through s+3 (Array_s[4]) is stored in d and
d+1 after being processed as follows:

b15 b8b7 b0
s 43 H (C) 35 H (5) d+1 d
b31 b16 b15 b0
s+1 38 H (8) 42 H (B)
5 C B 8H 0 7 E 1H
37 H (7) 30 H (0)
31 H (1) 45 H (E)

DHABI0E2
The ASCII value specified in s (Array_s[1]) through s+3 (Array_s[4]) may range from
00000000H and FFFFFFFFH.
Each stored digit of the ASCII code may range from "30H" to "39H" and from "41H" to "46H".

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The ASCII code stored in the area s (Array_s[1]) through s+3 (Array_s[4]) exceeds the
relevant range of "30H" to "39H" and from "41H" to "46H".
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 270
Character string processing instructions HABIN, HABINP, DHABIN, DHABINP

Program HABINP
Example 1
The following program converts the 4-digit ASCII value in D20 (var_D20 Array [0]) through D21
(var_D20 Array [1]) into a binary value and stores it in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0 D0
D20 36 H (6) 41 H (A)
- 22977
D21 46 H (F) 33 H (3)
“A63F”

HABINMB1, HABINKB1, HABINIB1, DHABI0B1

Program DHABINP
Example 2
The following program converts the 8-digit ASCII value in D20 (var_D20 Array [0]) through D23
(var_D20 Array [3]) into a binary value and stores it in D10 and D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D20 46H (F) 34 H (4)
D11 D10
D21 32H (2) 44 H (D)
13391 97264
D22 37H (7) 38 H (8)
D23 30 H (0) 35 H (5)
“4FD28750”

HABINMB2, HABINKB2, HABINIB2, DHABI0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 271


DABCD, DABCDP, DDABCD, DDABCDP Character string processing instructions

7.11.6 DABCD, DABCDP, DDABCD, DDABCDP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

DABCDME1, DABCDKE1, DABCDIE1

GX Works2

DABCDGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
ANY32/
ASCII data to be converted or first number of the devices where the Character
s Array [1..4] of
ASCII data is stored string
ANY16
4-/8-digit
d Storage area storing the conversion result ANY16/ 32
BCD data

7 – 272
Character string processing instructions DABCD, DABCDP, DDABCD, DDABCDP

Functions Conversion of decimal ASCII data into 4-/8-digit BCD data


DABCD Conversion into 4-digit BCD data
The DABCD instruction converts the decimal ASCII data in s and s+1 into the 4-digit BCD data
format and stores it in the devices specified by d.

b15 b7b8 b0
s b15 b12 b11 b8b7 b4b3 b0
1
d
s+1 2
3 4 5 6

1 ASCII code of the digit of hundreds / ASCII code of the digit of thousands
2
ASCII code of the digit of ones / ASCII code of the digit of tens
3
Digit of thousands
4 Digit of hundreds

5
Digit of tens
6
Digit of ones
DABCD0E1

The value 8765 specified in s and s+1 is stored in d as follows:

b15 b7b8 b0
s b15 b12b11 b8b7 b4 b3 b0
37 H (7) 38 H (8)
d 8 7 6 5
s+1 35 H (5) 36 H (6)

DABCD0E2
The ASCII value specified in s through s+1 may range from 0 to 9999.
Each stored digit of the ASCII code may range from "30H" to "39H".
If a digit contains the value "20H" or "00H", this value will be overwritten automatically with the
value "30H".

Programming MELSEC System Q and L series 7 – 273


DABCD, DABCDP, DDABCD, DDABCDP Character string processing instructions

DDABCD Conversion into 8-digit BCD data


The DDABCD instruction converts the ASCII data specified in the area s (Array_s[1]) through
s+3 (Array_s[4]) into the 8-digit BCD format and stores it in the devices specified in d and d+1.

b15 b7b8 b0
s 1 d+1 d
s+1 2 b31 b16 b15 b0
s+2 3
s+3 4
5 6 7 8 9 10 11 12

1
ASCII code of the digit of millions / ASCII code of the digit of ten millions
2
ASCII code of the digit of ten thousands / ASCII code of the digit of hundred thousands
3
ASCII code of the digit of hundreds / ASCII code of the digit of thousands
4
ASCII code of the digit of ones / ASCII code of the digit of tens
5
Digit of ten millions
6
Digit of millions
7
Digit of hundred thousands
8 Digit of ten thousands

9 Digit of thousands

10
Digit of hundreds
11Digit of tens

12Digit of ones

DDABC0E1

The value 87654321 specified in s (Array_s[1]) through s+3 (Array_s[4]) is stored in d and d+1
as follows:

b15 b8b7 b0
s 37 H (7) 38 H (8)
s+1 35 H (5) 36 H (6) b31 b16 b15 b0
s+2 33 H (3) 34 H (4) 8 7 6 5 4 3 2 1
s+3 31 H (1) 32 H (2)
d+1 d

DDABC0E2
The ASCII value specified in s (Array_s[1]) through s+3 (Array_s[4]) may range from 0 to
99999999.
Each stored digit of the ASCII code may range from "30H" to "39H".
If a digit contains the value "20H" or "00H", this value will be overwritten automatically with the
value "30H".

7 – 274
Character string processing instructions DABCD, DABCDP, DDABCD, DDABCDP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● There are characters within the data at s (Array_s[1]) to s+3 (Array_s[4]) that are outside
the range from "30H" to "39H".
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program DABCDP
Example 1
The following program converts the ASCII value in D20 (var_D20 Array [0]) through D21
(var_D20 Array [1]) into a 4-digit BCD value and outputs it at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b7b8 b0
Y4F Y40
D20 34H (4) 20 H
0 4 9 4
D21 34H (4) 39 H (9)

DABCDMB1, DABCDKB1, DABCDIB1, DDABC0B1


Program DDABCDP
Example 2
The following program converts the ASCII value in D20 (var_D20 [0]) through D23 (var_D20
[3]) into an 8-digit BCD value, stores the result in D10 and D11, and outputs it at Y40 through
Y5F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b7b8 b0
D20 34 H (4) 20 H
D11 DMOV Y5F
D10 Y50Y4F Y40
D21 37 H (7) 39 H (9)
0 4 9 7 2 9 4 9 0 4 9 7 2 9 4 9
D22 39 H (9) 32 H (2)
D23 39 H (9) 34 H (4)

DABCDMB2, DABCDKB2, DABCDIB2, DDABC0B2

Programming MELSEC System Q and L series 7 – 275


COMRD, COMRDP Character string processing instructions

7.11.7 COMRD, COMRDP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) BL\S, BL\TR,
Bit Word Bit Word U\G BL, P, I, J, U
s       — — 

d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

COMRDME1, COMRDKE1, COMRDIE1

GX Works2

COMRDGE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Device
s First number of device storing comment data to be read ANY16
number
Character Array [1..8] of
d First number of device to store read comment data
string ANY16

7 – 276
Character string processing instructions COMRD, COMRDP

Functions Reading device comment data


COMRD Read instruction
The COMRD instruction reads comment data from the device specified by s and stores it as
ASCII code in the area d (Array_d[1]) through d+7 (Array_d[8]).

b15 b7b8 b0
d 2
d+1 3
s d+2 4
d+3 5
8
1
6
7
00 H

1
Comment data
2 ASCII code of the 2nd character / ASCII code of the 1st character
3
ASCII code of the 4th character / ASCII code of the 3rd character
4
ASCII code of the 6th character / ASCII code of the 5th character
5 ASCII code of the 8th character / ASCII code of the 7th character

6 ASCII code of the 30th character / ASCII code of the 29th character

7
ASCII code of the 32th character / ASCII code of the 31th character
8 Stores at maximum 32 characters.

COMRD0E1

For example, the comment data stored in s with the character string "NO.1 LINE START" will
be stored from d (Array_d[1]) on, as follows:

b15 b7b8 b0
d F H (0) 4E H (N)
d+1 31 H (1) 2E H (.)
d+2 4C H (L) 20 H
NO.1 LINE START d+3 4E H (N) 49 H (I)
d+4 20 H 45 H (E)
d+5 54 H (T) 53 H (S)
d+6 52 H (R) 41 H (A)
d+7 00 H 54 H (T)

COMRD0E2
The address area of the devices specified by s must be located within the address area for
comment data.
If no comment is specified by s, the characters are converted into blank characters.
A comment must not exceed the maximum length of 32 characters.
The content of the byte following the last character depends on the status of the special relay
SM701 as follows:
● If SM701 is not set, a zero is stored
● If SM701 is set, no changes are made.
SM720 is set for one scan after the execution of the COMRD instruction has been finished.
SM721 is ON during the execution of the COMRD instruction. If SM721 is already set, when
the COMRD instruction is started, no processing will be performed.

Programming MELSEC System Q and L series 7 – 277


COMRD, COMRDP Character string processing instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The comment is not registered to the device number specified by s.
(Error code 4100)
● The device number specified by d is not a word device.
(Error code 4101)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

NOTE The device comment used in the COMRD(P) instruction uses a comment file stored in a memory
card and the standard ROM. Comment files stored in the program memory cannot be used.
Set the comment file used for the COMRD(P) instruction in "PLC file setting" in the PLC para-
meter dialog box. If the comment file to be used is not set in the PLC file setting, device com-
ments cannot be output with the COMRD(P) instruction.
When a comment file is set in the "PLC File" tab of the PLC Parameter dialog box, but the file
does not exist at power-on or reset, "FILESET ERROR" (error code: 2400) will occur.
The COMRD(P) instruction cannot be executed during the interrupt program. No operation if
executed.
The processing of the COMRD (P) completes after several scans.
Two or more file comments cannot be accessed simultaneously.
The starting signal (command) of the COMRD(P) instruction is disabled when it is turned ON be-
fore an other COMRD(P) instruction is completed (while SM721 is ON). Execute the
COMRD(P)/PRC instruction when SM721 is OFF.
The following instructions cannot be executed simultaneously because they use SM721 in com-
mon:
ON during ON for one scan after the executi- ON after the execution of the instruction is
Instruction execution on of the instruction is complete complete with error
SP.FREAD
Bit designated by instruction Bit designated by instruction + next Bit
SP.FWRITE
SM721
PRC
SM720 —
COMRD

For the LCPU, when a comment file stored on an SD memory card is used, this instruction can-
not be executed while SM606 (SD memory card forced disable instruction) is ON. Even if the in-
struction is attempted to be executed, the command will be ignored.

7 – 278
Character string processing instructions COMRD, COMRDP

Program COMRDP
Example
With leading edge from X1C, the following program stores a comment specified in D100, as
ASCII code in W0 (var_W0 Array [0]) through W7 (var_W0 Array [7]).

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
W0 4C H 41 H
W1 4E H 49 H
W2 20 H 45 H
ALINE TARGET W3 41 H 54 H
W4 57 H 52 H
W5 54 H 55 H
W6 20 H 20 H
W7 00 H

COMRDMB1, COMRDKB1, COMRDIB1, COMRD0B1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 279


LEN, LENP Character string processing instructions

7.11.8 LEN, LENP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

LEN_ME1, LEN_KE1, LEN_IE1


GX Works2

LEN_GE1

Variables Set Data Meaning Data Type


Character string or first number of device storing a character string of which the
s Character string
length is to be detected
d Address area storing the detected length of the character string BIN 16-bit

7 – 280
Character string processing instructions LEN, LENP

Functions Detecting the length of character strings


LEN Length detection
The length instruction detects the length of a character string specified in s and stores the
result in the device specified by d.

b15 b8b7 b0
s 1
s+1 2
b15 b0
s+2 3
d
6
s+n 00 H n 4

1
2nd character / 1st character
2
4th character / 3rd character
3 6th character / 5th character

4
nth character
5
End of character string
6 Length of character string

LEN__0E1

For example, the character string "ABCDEFGHI" stored in s is stored in d as "9" as follows:

b15 b8b7 b0
s 42 H (B) 41 H (A)
s+1 44 H (D) 43 H (C) “ABCDEFGHI“ b15 b0
s+2 46 H (F) 45 H (E) d 9
s+3 48 H (H) 47 H (G)
s+4 00 H 49 H (I)

LEN__0E2
The character string stored in s is being processed until the character code "00H" is read.
The result is stored in d.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The character code "00H" is missing in the last byte in s.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 281


LEN, LENP Character string processing instructions

Program LENP
Example
The following program processes the character string stored in D0, detects its length and out-
puts the character string as 4-digit BCD data at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D0 49 H (I) 4D H (M)
D1 53 H (S) 54 H (T) D10 Y4F Y40
D2 42 H (B) 55 H (U) 10 0 0 1 0
D3 53 H (S) 49 H (I) BCD
D4 49 H (I) 48 H (H)
D5 41 H (A) 00 H 1
D6 43 H (C) 42 H (B)

1
Characters following the character code "00H" are omitted
(only the length of the character string "MITSUBISHI" is detected)
LEN_MB1, LEN_KB1, LEN_IB1, LEN__0B1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 282
Character string processing instructions STR, STRP, DSTR, DSTRP

7.11.9 STR, STRP, DSTR, DSTRP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)
     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1        — —
s2         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

STR_ME1, STR_KE1, STR_IE1

GX Works2

STR__GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
First number of device storing the number of digits of the numerical
s1 BIN 16-bit ANY32
value to be converted
s2 Binary data to be converted BIN 16-/32-bit ANY16/32
Array [1..5]/
Character
d First number of device storing the converted character string [1..6] of
string
ANY16

Programming MELSEC System Q and L series 7 – 283


STR, STRP, DSTR, DSTRP Character string processing instructions

Functions Conversion of BIN 16-/32-bit binary data into character strings


STR Conversion of BIN 16-bit binary data
The STR instruction adds a decimal point to the BIN 16-bit binary value in the device specified
by s2 to the digit specified by the devices s1 and (s1)+1, converts the data into a character
string, and stores it in the area of the devices specified by d (Array_d[1]) through d+4
(Array_d[5]).

1
s1 b8b7
(s1)+1 b15 b0
2
d 6

d+1 7

3 d+2 8 10

d+3 9
s2
4 D0 H
d+4

1
Total of all digits
2 Decimal places
3 Sign

4
Binary value
5 End of character string indication, automatically placed.

6 ASCII code for the (total number of digits -1)th digit / ASCII code of the sign

7
ASCII code for the (total number of digits -3)th digit / ASCII code for the (total number of digits -2)th digit
8 ASCII code for the (total number of digits -5)th digit / ASCII code for the (total number of digits -4)th digit

9 ASCII code for the (total number of digits -7)th digit / ASCII code for the (total number of digits -6)th digit

10
Total of all digits
STR__0E1

s1 5
(s1)+1 1
b15 b8b7 b0
d 31 H (1) 2D H
- 1 2 . 3 d+1 2E H (.) 32 H
d+2 00 H 33 H

s2 - 1 2 3

STR__0E2
The number of digits that can be stored in the device specified by s1 ranges from 2 to 8.
The number of decimal places that can be stored in the devices specified by (s1)+1 ranges
from 0 to 5 and must not exceed the number of digits minus 3.
The BIN 16-bit data that can be stored in the device specified by s2 must range from -32768
to 32767.
After the conversion into a character string, the string is stored in the devices specified by d
(Array_d[1]) through d+4 (Array_d[5]) as follows:
– A positive sign of the binary data is stored as ASCII character "20H" (blank).
– A negative sign of the binary data is stored as ASCII character "2DH" ("minus"- character).

7 – 284
Character string processing instructions STR, STRP, DSTR, DSTRP

If the number of decimal places is greater than zero, the decimal point "2EH" (.) is placed
automatically before the first digit specified.

1
6 1 Total of all digits
2
2 2 Number of decimal places
1 2 . 3 4 3
Binary value
1234 3 5 4
Decimal point placed automatically
4 5
Decimal places
STR__0B1

If the number of decimal places equals zero, the decimal point character "2DH" (.) is not placed.
If the number of decimal places is greater than the number of digits of the binary value, the
missing digits are replaced by zeroes, the binary value is shifted to the right, and the decimal
point is placed accordingly (0.).

1
6 1 Total of all digits
2Number of decimal places
3 2
0 .0 1 2 3Binary value
1 2 3 4
Zeroes and decimal point placed automati-
4
cally
STR__0B2

If the number of digits, sign and decimal point included, is greater than the number of digits in
the binary value, the missing digits between sign and numerical value are replaced by "20H"
(blanks) automatically.

1Total
of all digits
8 1 2Number
of decimal places
1 2
- 1 2 .3 3
Binary value
- 1 2 3 3 4 4Blank characters placed automatically.

STR__0B3

At the end of the converted character string the character code "00H" is stored automatically.

Programming MELSEC System Q and L series 7 – 285


STR, STRP, DSTR, DSTRP Character string processing instructions

DSTR Conversion of BIN 32-bit data


The DSTR instruction adds a decimal point to the BIN 32-bit binary value in the device speci-
fied by s2 and (s2)+1 to the digit specified by the devices s1 and (s1)+1, converts the data into
a character string, and stores it in the area of the devices specified by d (Array_d[1]) through
d+5 (Array_d[6]).

1
s1
(s1)+1
2 b15 b8b7 b0
d 8

d+1 9
3 d+2 10
(s2)+1 s2
14
b31 b16 b15 b0 d+3 11
4 5
d+4 12
6
d+5 00 H 13

1
Total of all digits
2
Decimal places
3
Sign
4 Upper 16 Bit

5
Lower 16 Bit
6
Binary value
7 End of character string indication, automatically placed.

8
ASCII code for the (total number of digits -1)th digit / ASCII code of the sign
9
ASCII code for the (total number of digits -3)th digit / ASCII code for the (total number of digits -2)th digit
10ASCII code for the (total number of digits -5)th digit / ASCII code for the (total number of digits -4)th digit

11
ASCII code for the (total number of digits -7)th digit / ASCII code for the (total number of digits -6)th digit
12
ASCII code for the (total number of digits -9)th digit / ASCII code for the (total number of digits -8)th digit
13End of character string indication / ASCII code for the (total number of digits -10)th digit

14
Total of all digits
DSTR0E1

s1 8
(s1)+1 3 b15 b8b7 b0
d 36 H (6) 2D H (-)
d+1 34 H (4) 35 H (5)
- 6 5 4 . 3 2 1 d+2 33 H (3) 2E H (.)
d+3 31 H (1) 32 H (32)
(s2)+1 s2
d+4 00 H
-6 5 4 3 2 1

DSTR0E2
The number of digits that can be stored in the device specified by s1 ranges from 2 to 13.
The number of decimal places that can be stored in the devices specified by (s1)+1 ranges
from 0 to 10 and must not exceed the number of digits minus 3.
The BIN 32-bit data that can be stored in the device specified by s2 and (s2)+1 must range
from -2147483648 and 32147483647.

7 – 286
Character string processing instructions STR, STRP, DSTR, DSTRP

After the conversion into a character string, the string is stored in the devices specified by
d (Array_d[1]) to d+5 (Array_d[6]) as follows:
– A positive sign of the binary data is stored as ASCII character "20H" (blank).
– A negative sign of the binary data is stored as ASCII character "2DH" ("minus"- character).
If the number of decimal places is greater than zero, the decimal point "2EH" (.) is placed
automatically before the first digit specified.

1
10 1 Total of all digits
2Number of decimal places
3 2
12345.678 3
1234 5678 3
Binary value
5 4
Decimal point placed automatically
4 5Decimal places

DSTR0E3

If the number of decimal places equals zero, the decimal point character "2DH" (.) is not placed.
If the number of decimal places is greater than the number of digits of the binary value, the
missing digits are replaced by zeroes, the binary value is shifted to the right, and the decimal
point is placed accordingly (0.).

1Totalof all digits


13 1
10 2 2
Decimal places
0 .0 0 0 00 5 4 3 2 1
3Binary value
5 4 321 3
4Zeroes and decimal point placed
4 automatically
DSTR0E4

If the number of digits, sign and decimal point included, is greater than the number of digits in
the binary value, the missing digits between sign and numerical value are replaced by "20H"
(blanks) automatically.

1
13 1 Total of all digits
2 . 2 2Number of decimal places
- 5432.10
3
- 5 4 3210 3 Binary value
4
Blank characters placed automatically.
4 DSTR0E5

At the end of the converted character string the character code "00H" is stored automatically.

Programming MELSEC System Q and L series 7 – 287


STR, STRP, DSTR, DSTRP Character string processing instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of digits stored in s1 exceeds the range of values specified below:
(Error code 4100)
Range of values for the STR instruction: ........ 2 to 8
Range of values for the DSTR instruction: ..... 2 to 13
● The number of decimal places stored in (s1)+1 exceeds the range of values specified below:
(Error code 4100)
Range of values for the STR instruction: ........ 0 to 5
Range of values for the DSTR instruction: ..... 0 to 10
● The values stored in s1 and (s1)+1 do not correspond to the following relation:
The total of all digits minus 3 is greater than or equal to the number of decimal places.
(Error code 4100)
● The number of digits stored in s1 and (s1)+1 is less than the digits of the binary values in
s2 and (s2)+1.
(Error code 4100)
● The area storing the character string specified from d (Array_d[1]) onwards exceeds the relevant
device range.
(Error code 4100)

Program STRP
Example 1
With leading edge from X0, the following program converts the binary value specified by D10
corresponding to the number of digits specified in D0 and D1. The result is stored in the area
from D20 (var_D20 Array [1]) through D23 (var_D20 Array [4]).

MELSEC Instruction List Ladder Diagram

IEC Instruction List

b15 b8b7 b0
D10 12672 D20 31 H (1) 20 H
D21 36 H (6) 32 H (2)
D0 6 D22 32 H (2) 37H (7)
D1 0 D23 00 H “ 12672“

STR_MB, STR_KB, STR_IB, DSTR0B1

7 – 288
Character string processing instructions STR, STRP, DSTR, DSTRP

Program DSTRP
Example 2
With leading edge from X0, the following program converts the binary value specified in D10
and D11corresponding to the number of digits specified in D0 and D1. The result is stored in
the area from D20 (var_D20 Array [1]) through D26 (var_D20 Array [7]).

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D12 D11 b15 b8b7 b0


12345678 D30 30 H (0) 20 H

D31 30 H (0) 2E H (.)


D0 12 “ 0.012345678“
D32 32 H (2) 31 H (1)
D1 9 (4)
D33 34 H 33 H (3)
D34 36 H (6) 35 H (5)
D35 38 H (8) 37 H (7)
D36 00 H

DSTR_MB1, DSTR_KB1, DSTR_IB1, DSTR0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 289


VAL, VALP, DVAL, DVALP Character string processing instructions

7.11.10 VAL, VALP, DVAL, DVALP

CPU High
Basic Performance Process Redundant Universal LCPU

 1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
Index
(System, User) File Direct J\ Function Register Constant Other
Register Module $
Bit Word Bit Word U\G Zn

s —   — — — —  —
d1    — — — — — —
d2        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

VAL_ME1, VAL_KE1, VAL_IE1

GX Works2

VAL__GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Array [1..5]/
Character string or first number of device storing the character string Character
s [1..7] of
of the binary data to be converted string
ANY16
First number of device storing the number of digits of the binary data
d1 BIN 16-bit ANY32
after conversion
d2 Initial number of device storing the converted binary data BIN 16-/32-bit ANY16/32

7 – 290
Character string processing instructions VAL, VALP, DVAL, DVALP

Functions Conversion of character strings into BIN 16-/32-bit binary data


VAL Conversion into BIN 16-bit binary data
The VAL instruction converts the character strings stored in the area s (Array_s[1]) through s+4
(Array_s[5]) into BIN 16-bit data. The number of digits and the binary value are stored in d1,
(d1)+1, and d2.
For the conversion into the BIN 16-bit data format all data in the area s (Array_s[1]) through
s+4 (Array_s[5]) is recognized as character string up to the character code "00H".

d1 10
(d1)+1 11
b15 b8b7 b0
s 1
s+1 2
s+2 3 - . d2 12
s+3 4
s+4 H
6 7 8 9
13

5
VAL_0E1
1 ASCII code for the 1st character / ASCII code for the sign
2
ASCII code for the 3rd character / ASCII code for the 2nd character
3 ASCII code for the 5th character / ASCII code for the 4th character

4 ASCII code for the 7th character / ASCII code for the 6th character

5
Indicates the end of the character string
6 Sign character

7 1st character

8
2nd character
9 7th character

10Total of all digits

11Number of decimal places

12
Integer value, the decimal point is not processed
13BIN 16-bit

The character string "-123.45" in the area s (Array_s[1]) through s+4 (Array_s[5]) is to be con-
verted. The result will be stored in d1, (d1)+1 and d2 as follows:

d1 7
(d1)+1 2
b15 b8b7 b0
s 31 H (1) 2D H (-)
s+1 33 H (3) 32 H (2)
- 1 2 3 . 4 5 d2 - 1 2 3 4 5
s+2 34 H (4) 2E H (.)
s+3 00 H 35 H (5)

VAL_0E2
The number of all characters stored in s (Array_s[1]) through s+4 (Array_s[5]) may range from
2 to 8.

Programming MELSEC System Q and L series 7 – 291


VAL, VALP, DVAL, DVALP Character string processing instructions

The number of possible decimal places stored in the area s (Array_s[1]) through s+4
(Array_s[5]) may range from 0 to 5. In general the number of decimal places must not exceed
the total of all digits minus 3.
The numerical value of a character string to be converted with the decimal point ignored must
range from -32768 to 32767. The numerical value of the ASCII character string with the sign
character and decimal point ignored must range from "30H" to "39H".
A positive sign of the binary data is stored as ASCII character "20H" (blank).
A negative sign of the binary data is stored as ASCII character "2DH" ("minus"- character).
The ASCII character "2EH" is stored as decimal point.
The total of all digits stored in d1, (d1)+1, and d2 contains all characters that represent the
numerical value as well as the sign character d1 and the decimal places (d1)+1.
In the binary data stored in d2 after the conversion the decimal point is ignored.
If the characters "20H" (blank) or "30H" (zero) are stored between character sign and first
numerical value, these are ignored for the conversion.

2 8 7 7
123.45 3 2 0 .0 0 1 2 8 4

1 4 -12345 9 12
5 6

VAL_0E3
1
These characters are not processed
2 Total of all digits

3 Number of decimal places

4
Binary value
5 Sign character

6 These characters are not processed

7
Total of all digits
8 Number of decimal places

9
Binary value

7 – 292
Character string processing instructions VAL, VALP, DVAL, DVALP

DVAL Conversion into BIN 32-bit data


The DVAL instruction converts the character strings stored in s (Array_s[1]) through s+6
(Array_s[7]) into BIN 32-bit data. The number of digits and the binary value are stored in d1,
(d1)+1, d2 and (d2)+1.
For the conversion into the BIN 32-bit binary format all data in the area s (Array_s[1]) through
s+6 (Array_s[7]) up to the character code "00H" are recognized as character string.

d1 13
b15 b8b7 b0
(d1)+1 14
s 1
s+1 2
s+2 3 (d2)+1 d2
s+3 4 - 15
s+4 5
s+5 6 9 10 11 12 16
s+6 H 7

DVAL0E1
1 ASCII code for the 1st character / ASCII code for the sign character
2
ASCII code for the 3rd character / ASCII code for the 2nd character
3 ASCII code for the 5th character / ASCII code for the 4th character

4 ASCII code for the 7th character / ASCII code for the 6th character

5
ASCII code for the 9th character / ASCII code for the 8th character
6 ASCII code for the 11th character / ASCII code for the 10th character

7 ASCII code for the zero character / ASCII code for the 12th character

8
Indicates the end of the character string
9 Sign character

101st character

11
2nd character
1212th character

13Total of all digits

14
Number of decimal places
15Integer value, the decimal point is not processed

16BIN 32-bit

d1 10
b15 b8b7 b0
(-) (d1)+1 3
s 31 H (1) 2D H
s+1 33 H (3) 32 H (2)
s+2 35 H (5) 34 H (4)
s+3 36 H (6) 2E H (.) - 1 2 3 4 5 . 6 7 8 -1 2 3 4 5 6 7 8
s+4 38 H (8) 37 H (7) (d2)+1 d2
s+5 H

DVAL0E2
The total of all characters stored in s (Array_s[1]) through s+6 (Array_s[7]) may range from 2
to 13.

Programming MELSEC System Q and L series 7 – 293


VAL, VALP, DVAL, DVALP Character string processing instructions

The number of possible decimal places stored in the area s (Array_s[1]) through s+6
(Array_s[7]) may range from 0 to 10. In general the number of decimal places must not exceed
the total of all digits minus 3.
The numerical value of a character string to be converted with the decimal point ignored must
range from -2147483648 to 2147483647. The numerical value of the ASCII character string
with the sign character and decimal point ignored must range from "30H" to "39H".
A positive sign of the binary data is stored as ASCII character "20H" (blank).
A negative sign of the binary data is stored as ASCII character "2DH" ("minus"- character).
The ASCII character "2EH" is stored as decimal point.
The total of all digits stored in d1, (d1)+1, d2, and (d2)+1 contains all characters that represent
the numerical value as well as the sign character d1 and the decimal places (d1)+1.
In the binary data stored in d2 and (d2)+1 after the conversion the decimal point is ignored.
If the characters "20H" (blank) or "30H" (zero) are stored between character sign and first
numerical value, these are ignored for the conversion.

1
These characters are not processed
2
Total of all digits
2 12 3
3 2 Number of decimal places
6543. 21 4 BIN 32-bit binary value
4 -654 321 DVAL0E3
1

1
Sign character
2 These characters are not processed
3 11
3 Total of all digits
0. 0 0 0 5 4 3 2 1 4 8
4
Number of decimal places
5 5 4 3 2 1 5 BIN 32-bit binary value
1 2
DVAL0E4

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The total of all digits stored from s (Array_s[1]) onwards exceeds the range of values from
2 to 8 (VAL) or 2 to 13 (DVAL) respectively. (Error code 4101)
● The number of decimal places stored in (d1)+1 exceeds the range of values from 0 to 5
(VAL) or 0 to 10 (DVAL) respectively. (Error code 4100)
● The total of all digits minus 3 is greater than or equal to the number of decimal places.
(Error code 4100)
● An ASCII code other than "20H" or "2DH" were stored for the character sign.
(Error code 4100).
● An ASCII code other than from "30H" to "39H", or "2EH" were stored as a digit for one of the
individual numbers. (Error code 4100)
● More than one decimal point is stored in one value. (Error code 4100)
● The binary value exceeds the range of values from -32768 to 32767 (VAL) or -2147483648
to 2147483647 (DVAL) after the conversion. (Error code 4100)
● The ASCII character "00H" is placed to the wrong digit. (Error code 4100)

7 – 294
Character string processing instructions VAL, VALP, DVAL, DVALP

Program VALP
Example 1
With leading edge from X0, the following program converts the character string stored in the
area D20 (var_ D20 Array [1]) through D23 (var_ D20 Array [4]) into an integer value, converts
this value into a BIN 16-bit binary value, and stores it in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D20 31 H (1) 2D H (-) D0 -1654
D21 2E H (.) 36 H (6)
(5) D10 6
D22 34 H (4) 35 H
D23 D11 2
H

VAL_MB1, VAL_KB1, VAL_IB1, DVAL0B1


Program DVALP
Example 2
With leading edge from X0, the following program converts the character string stored in the
area D20 (var_ D20 Array [1]) through D24 (var_ D20 Array [5]) into an integer value, converts
this value into a BIN 32-bit value, and stores it in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0 D1 D0
D20 37 H (7) 20 H 7 9 1 0 0 6 1 1
D21 31 H (1) 39 H (9)
D22 30 (0) (0) D10 6
H 30 H
36 (6) 2E H (.) D11 2
D23 H
D24 31 H (1) 31 H (1)
D25 H

VAL_MB2, VAL_KB2, VAL_IB2, DVAL0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 295


ESTR, ESTRP Character string processing instructions

7.11.11 ESTR, ESTRP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)
     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Constant
Register Other
Register Module Zn E
Bit Word Bit Word U\G
s1 —   —    1)  —
s2 —   — — — — — —
d —   — — — — — —
1 Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

ESTRME1, ESTRKE1, ESTRIE1

GX Works2

ESTR_GE1

Variables Data type


Set Data Meaning
MELSEC IEC
Floating point data to be converted or initial number of device storing
s1 Real number Real number
such data
First number of device storing the data format of the numeric data to Array [1..3] of
s2 BIN 16-bit
be converted ANY16
Character Character
d First number of device storing the converted data
string string

7 – 296
Character string processing instructions ESTR, ESTRP

Functions Conversion of floating point data into character string data


ESTR Conversion of floating point data
The ESTR instruction converts the floating point data (real numbers) in s1 and (s1)+1 into
character string data. The data format of the character string is specified in s2 (Array_s2[1])
through (s2)+2 (Array_s2[3]). The result is stored from d onwards.
The data format after the conversion depends on the data format in s2 (Array_s2[1]) through
(s2)+2 (Array_s2[3]).

s2 1 1
4 Data format (decimal format "0"/
(s2)+1 2
(s2)+2 3
exponential format "1")
2Total of all digits

3Number of decimal places

ESTR_0E1

s2 1
(s2)+1 2
(s2)+2 3 b15 b8b7 b0
d1 7
(d1)+1 8
. (d1)+2 9
(d1)+3 10
4 (d1)+4 00 H
(s1)+1 s1
6

1
Data format (decimal format "0" / exponential format "1")
2
Total of all digits
3 Number of decimal places

4
Sign character
5
Floating point data (real number)
6 End of character string, placed automatically

7
ASCII code for the (total number of digits -1)th digit / ASCII code of the sign
8
ASCII code for the (total number of digits -3)th digit / ASCII code for the (total number of digits -2)th digit
9 ASCII code for the (total number of digits -5)th digit / ASCII code for the (total number of digits -4)th digit

10
ASCII code for the (total number of digits -7)th digit / ASCII code for the (total number of digits -6)th digit
ESTR0E2

Programming MELSEC System Q and L series 7 – 297


ESTR, ESTRP Character string processing instructions

Decimal format
The real number -1.23456 is converted into a character string with a total of 8 digits (3 decimal
places included). The result is stored from d onwards.

s2 0
(s2)+1 8
b15 b8b7 b0
(s2)+2 3 d1 20 H 2D H (-)
(d1)+1 31 H (1) 20 H
(d1)+2 32 H (2) 2E H (.)
1 . 2 3 4
(d1)+3 34 H (4) 33 H (3)
(d1)+4 00 H
1
(s1)+1 s1
-1.2 3 4 5 6 3

1
Sign character
2
Floating point number (real number)
3
End of character string, automatically placed
ESTR0E3

The total number of all digits of the number in (s2)+1 (Array_s2[2]) to be converted is
represented as follows:
– If the number of decimal places is zero, the total number of digits is >= 2.
– If the number of the decimal places is a different value, the total number of all digits is 3 plus
the number of decimal places.
The number of decimal places that has to be specified must range within 0 and 7. In general,
the number of decimal places must be less than or equal to the total number of all digits
minus 3.
After the conversion the character string in d is stored as follows:
– A positive sign of the floating point data is stored as ASCII character "20H" (blank).
– A negative sign of the floating point data is stored as ASCII character "2DH" ("minus"-
character).
In cases where the actual number of decimal places of the floating point data exceeds the
specified number of decimal places, the surplus digits are cut off.

1Data format (decimal format "0"/


s2 0 1 exponential format "1")
2
(s2)+1 8 2 4 Total of all digits
(s2)+2 3 3 3Number of decimal places
- 1 . 2 3 456
4
6 Total of all digits
(s1)+1 s1 5
5Number of decimal places
-1.2 3 4 5 6
6These digits are cut off

ESTR0E4
If the number of decimal places is specified a value different from zero, the decimal point "2EH"
(.) is placed automatically in the specified digit.
If the number of decimal places is specified zero the decimal point "2EH" (.) is not placed.

7 – 298
Character string processing instructions ESTR, ESTRP

s2 4
(s2)+1 5 3
(s2)+2 6 1
Number of decimal places
- 1 . 2 3
2
(s1)+1 s1
Decimal point is placed and stored
1
automatically
-1.2 3 4 5 6 2 3
Total of all digits
ESTR0E5

If the total number of digits, excluding the sign, the decimal point and the decimal fraction part,
is greater than the integer part of the 32-bit floating point type real number data, "20H (space)"
will be stored between the sign and the integer part.

s2 0
(s2)+1 8 1
(s2)+2 2
- 1 . 2 3
(s1)+1 s1 3 1
2 Total of all digits
-1.2 3 4 5 6
2
Blanks "20H" are stored
3
Number of decimal places
ESTR0E6

The character code "00H" is stored automaticallly at the end of the character string.

Programming MELSEC System Q and L series 7 – 299


ESTR, ESTRP Character string processing instructions

Exponential format

s2 1 b15 b8b7 b0
(s2)+1 2
d1 9
(s2)+2 3
(d1)+1 10

. E (d1)+2 11

5 (d1)+3 12
7
(s1)+1 s1 (d1)+4 13

6 (d1)+5 14
4 (d1)+6 00 H

1
Data format (Exponential format) (1)
2
Total number of all digits
3
Number of decimal places
4
Floating point number (real number)
5
Sign of the integer value
6 The "E" is placed automatically

7
Sign of the exponent
8 End of character string indication, placed automatically

9 ASCII code for the (total number of digits -1)th digit / ASCII code of the sign

10ASCII code for the (total number of digits -3)th digit / ASCII code for the (total number of digits -2)th digit

11
ASCII code for the (total number of digits -5)th digit / ASCII code for the (total number of digits -4)th digit
12ASCII code for the (total number of digits -7)th digit / ASCII code for the (total number of digits -6)th digit

13Sign of the exponent/ 45H (E)

14
ASCII code for the (total number of digits -11)th digit (exponent)/ASCII code for the (total number of
digits -10)th digit (exponent)
ESTR0E7

7 – 300
Character string processing instructions ESTR, ESTRP

Example The real number -12.34567 is to be represented in exponential notation. The total number of
all digits is 12. The number of decimal digits is specified 4. The result is stored from d1
onwards.

s2 1
(s2)+1 12
(s2)+2 4 b15 b8b7 b0
d1 20 H 2D H (-)
(d1)+1 2E H (.) 31 H (1)
- 1 . 2 3 4 5 E + 0 1 (d1)+2 33 H (3) 32 H (2)
(d1)+3 35 H (5) 34 H (4)
2 3 (d1)+4 2C H (+) 45 H (E)
(s1)+1 s1 (d1)+5 31 H (1) 30 H (0)
(d1)+6 00 H
-1 2 . 3 4 5 6 7

1 4

1
Floating point number (real number)
2
Sign of the integer value
3
Sign of the exponent
4
End of character string indication, placed automatically
ESTR0E8
The total number of all digits of the number in (s2)+1 (Array_s2[2]) to be converted is
represented as follows:
– If the number of decimal places is zero, the total number of digits is >= 2.
– If the number of the decimal places is a different value, the total number of all digits is 7 plus
the number of decimal places.
The number of decimal places that has to be specified must range within 0 and 7. In general,
the number of decimal places must be less than or equal to the total number of all digits
minus 7.
After the conversion the character string in d is stored as follows:
– A positive sign of the floating point data is stored as ASCII character "20H" (blank).
– A negative sign of the floating point data is stored as ASCII character "2DH" ("minus"-
character).
The integer range is fixed to 2 digits. If the integer range contains one digit only, a blank in
ASCII code is placed and stored between the sign character and the integer digit.

s2 1 1
(s2)+1 12
(s2)+2 4
- 1 . 2 3 4 5 E + 0 1
(s1)+1 s1
-1 2 . 3 4 5 6 7 2 1
Total of all digits (12)
2
Becomes a blank
ESTR0E9

Programming MELSEC System Q and L series 7 – 301


ESTR, ESTRP Character string processing instructions

If the floating point value of the decimal range is longer than the relevant storage range, the
digits that cannot be stored are cut off.

s2 1 1
(s2)+1 12
(s2)+2 4
- 1 . 2 3 4 5 6 7 E + 0 1
(s1)+1 s1 2 3
-1 2 . 3 4 5 6 7

1 Total of all digits (12)


2
Number of digits in the decimal range (4)
3 These digits are cut off

ESTR0E10
If the number of decimal places is specified a value different from zero, the decimal point "2EH"
(.) is placed automatically in the specified digit.

s2 1 1
(s2)+1 12
(s2)+2 4
- 1 . 2 3 4 5 E + 0 1
1
(s1)+1 s1 3 Total of all digits (12)
-1 2 . 3 4 5 6 7 2
2 Is placed automatically
3 Number of digits in the decimal range (4)

ESTR0E11

If the number of decimal places is specified zero the decimal point "2EH" (.) is not placed.
The ASCII code "2CH" (+) is placed and stored for a positive exponent.
The ASCII code "2DH" (-) is placed and stored for a negative exponent.
The exponential range is fixed to 2 digits. If the exponential range contains one digit only, the
ASCII code "30H" (0) is placed and stored between the exponent sign and the exponent.

s2 1 1
(s2)+1 12 2
(s2)+2 4
- 1 . 2 3 4 5 E + 0 1
(s1)+1 s1 1 Total of all digits (12)
-1 2 . 3 4 5 6 7 3 2
Is fixed to 2 digits
3
Is set to zero automatically
ESTR0E12

The character code "00H" is stored automaticallly at the end of the character string.

7 – 302
Character string processing instructions ESTR, ESTRP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The devices specified in s1 and (s1)+1 are not within the following range:
0, + 2-126 < s1 < + 2 128.
(Error code 4100)
● The format in s2 (Array_s2[1]) is neither 0 nor 1.
(Error code 4100)
● The total number of digits in (s2)+1 (Array_s2[2]) exceeds the range of values:
(Error code 4100)

For the decimal format


The number of decimal places is zero (total number of digits > 2).
The number of decimal places is different from zero
(total number of digits > (number of decimal places + 3)).

For the exponential format


The number of decimal places is zero (total number of digits > 2).
The number of decimal places is different from zero
(total number of digits > (number of decimal places + 7)).
● The number of digits in (s2)+2 (Array_s2[3]), forming the decimal part exceeds the range of
values:
(Error code 4100)

For the decimal format


The number of digits forming the decimal part is less than or equal to the total number of
digits minus 3.

For the exponential format


The number of digits forming the decimal part is less than or equal to the total number of
digits minus 7.
● The value whose total digits exceeds "24" is specified.
(Error code 4100)
● The storage range in d exceeds the relevant storage device range.
(Error code 4101)
● The device specified by s2 exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU.)
(Error code 4101)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

Programming MELSEC System Q and L series 7 – 303


ESTR, ESTRP Character string processing instructions

Program ESTRP
Example 1
With leading edge from X0, the following program converts a floating point value (real number)
specified by the devices R0 and R1 into the format specified by R10 (var_R10 Array [1])
through R12 (var_R10 Array [3]) and stores the result in D0 through D3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
R10 0 20 H
D0 20 H
R11 7 1
D1 2E H (.) 30 H (0)
R12 3 0 . 3 2 7 D2 32 H (2) 33 H (3)
D3 00 H 37 H (7)
R1 R0 2 3
0 .0 3 2 7 4 5 7
4

1 Total number of digits


2
Blanks
3 Number of decimal places

4 Is stored automatically

ESTRMB1, ESTRKB1, ESTRI1, ESTR0B1

7 – 304
Character string processing instructions ESTR, ESTRP

Program ESTRP
Example 2
With leading edge from X0, the following program converts a floating point value (real number)
specified by D0 and D1 into the format specified by R10 (var_R10 Array [1]) through R12
(var_R10 Array [3]) and stores the result in D10 through D16.

MELSEC Instruction List Ladder Diagram IEC Instruction List

R10 1 1
R11 12 2 4
R12 4 3 3 . 2 7 4 5 E - 0 2

R1 R0 5 6
0 .0 3 2 7 4 5 7 8 b15 b8b7 b0
D10 20 H 20 H
D11 2E H (.) 33 H (3)
D12 37 H (7) 32 H (2)
D13 35 H (5) 34 H (4)
D14 2D H (-) 45 H (E)
D15 32 H (2) 30 H (0)
D16 00 H

1
Data format (Exponential representation) (1)
2
Total number of all digits
3 Number of decimal places

4 Total number of all digits

5
Blanks
6 Number of decimal places in the decimal part

7 Is stored automatically

ESTRMB2, ESTRKB2, ESTRIB2, ESTR0B2

Programming MELSEC System Q and L series 7 – 305


EVAL, EVALP Character string processing instructions

7.11.12 EVAL, EVALP

CPU High
Basic Process Redundant Universal LCPU
Performance
1)
     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Constant
Register Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —
d —   — 1) 1) — — —
1 Available on Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EVAL_ME1, EVAL_KE1, EVAL_IE1

GX Works2

EVAL_GE1

Variables Set Data Meaning Data Type


Character string data to be converted into a floating point number (data type
s Character string
REAL) or initial number of device storing such data
First number of device storing the converted decimal floating point number (data
d REAL
type REAL)

7 – 306
Character string processing instructions EVAL, EVALP

Functions Conversion of character string data into decimal floating point data
EVAL Conversion of character strings
The EVAL instruction converts the character string in s through s+4 into a decimal floating point
number (real number). The result is stored in d.
The characer string can be converted into decimal floating point format as well as into the expo-
nential format.
1 Decimal floating point data
b15 b8b7 b0 (data type REAL)
s 2 2 ASCII code of the 1st character/
s+1 3 d+1 d ASCII code of sign character
s+2 4 3 ASCII code of the 3rd character/
s+3 5
1 ASCII code of the 2nd character
s+4 H 4 ASCII code of the 5th character/

ASCII code of the 4th character


5 ASCII code of the 7th character/
6
ASCII code of the 6th character
6 Indicates the end of character string
EVAL0E1

Decimal format

b15 b8b7 b0
s 31 H (1) 2D H (-)
s+1 30 H (0) 2E H (.) d+1 d
s+2 38 H (8) 37 H (7) -1. 0 7 8 1 2
s+3 32 H (2) 31 H (1)
1
s+4 H

- 1 . 0 7 8 1 2
1
Decimal floating point data (real number)
EVAL0E2

Exponential format

b15 b8b7 b0
s 20 H 2D H (-)
s+1 2E H (.) 31 H (1)
s+2 32 H (2) 33 H (3) d+1 d
s+3 31 H (1) 30 H (0) -1.3 2 0 1 E+10
s+4 2C H (+) 45 H (E)
s+5 (0) (1) 1
30 H 31 H
s+6 H

- 1 . 3 2 0 1E + 1 0

1
Decimal floating point data (data type REAL)
EVAL0E3

Programming MELSEC System Q and L series 7 – 307


EVAL, EVALP Character string processing instructions

In the example below, six digits (without sign, decimal point, and exponent digits of the result)
of the character string from s onwards are converted into a decimal floating point number. The
digits from the 7th digit on are cut off from the result.

Decimal format

b15 b8b7 b0
s 20 H 2D H (-)
s+1 31 H (1) 20 H
s+2 33 H (3) 2E H (.) d+1 d
s+3 31 H (1) 30 H (0) -1. 3 0 1 5 6
s+4 36 H (6) 35 H (5)
s+5 31 H (1) 38 H (8) 2
s+6 00 H 32 H (2)

- 1 . 9 0 1 5 6 8 1 2

1
These digits are omitted
2 Decimal floating point data (data type REAL)

EVAL0E4

Exponential format

b15 b8b7 b0
s 20 H 2D H (-)
s+1 2E H (-) 31 H (1)
s+2 35 H (5) 33 H (3) d+1 d
s+3 33 H (3) 30 H (0) -1 . 3 5 0 3 4 E -2
s+4 31 H (1) 34 H (4)
s+5 45 H (E) 32 H (2) 2
s+6 30 H (0) 2D H (-)
s+7 00H 32 H (2)

- 1 . 3 5 0 3 4 1 2 E - 0 2

1
These digits are omitted
2
Decimal floating point data (data type REAL)
EVAL0E5

7 – 308
Character string processing instructions EVAL, EVALP

Leading blanks (ASCII code "20H") or zeroes (ASCII code "30H") in the character string from s
onwards are ignored by the conversion, except for the initial zero (e.g. 0.123).

b15 b8b7 b0
s 20 H 2D H (-) d+1 d
s+1 31 H(1) 30 H (0) 1 . 2 3 1
s+2 32 H(2) 2E H (.)
2
s+3 31 H(1) 33 H (3)
s+4 H

0 1 . 2 3 1

1 These characters are ignored by the conversion


2 Decimal floating point data (data type REAL)
EVALOE6
If the ASCII code "30H" (zero) is placed between the character "E" and the character string for
the exponential format, this character is ignored by the conversion.

b15 b8b7 b0
20 H 2D H (-)
2E H (.) 31 H (1)
34 H (4) 30 H (0) d+1 d
33 H (3) 35 H (5) - 1 . 0 4 5 3 E +3
2C H (+) 45 H (E)
2
33 H (3) 30 H (0)
H

- 1 . 0 4 5 3 E + 0 3

1
These characters are ignored by the conversion
2
Decimal floating point data (data type REAL)
EVAL0E7
A character string to be converted may contain a maximum of 24 characters.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The digits prior to the decimal point or the decimal places contain characters exceeding the
range of values from "30H" (0) to "39H" (9).
(Error code 4100)
● The character "2EH" is used more than once within the character string. (Error code 4100)
● The exponent part contains characters different from "45H (E), 2BH (+)" or "45H (E), 2DH (-)"
or contains more than one exponent portion.
(Error code 4100)
● Data after conversion is not within the following range:
0, + 2-126 < (data after conversion) < + 2 128
(Error code 4100)
● The end of string indicator "00H" exceeds the relevant storage device range.
(Error code 4100)
● The number of characters in the string is 0 or greater than 24.
(Error code 4100)

Programming MELSEC System Q and L series 7 – 309


EVAL, EVALP Character string processing instructions

Program EVALP
Example 1
With leading edge from X20, the following program converts the character string specified in
R0 through R5 into a decimal floating point number (real number) and stores the result in D0
and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
R0 20 H 2D H (-)
R1 31 H (1) 30 H (0)
D1 D0
R2 32 H (2) 2E H (.)
-1. 2 3 4 5 2
R3 34 H (4) 33 H (3)
R4 32 H (2) 35 H (5)
R5 00 H 31 H (1)

- 0 1 . 2 3 4 5 2 1

1 2

1
This digit is not processed
2
This number is cut off
EVALMB1, EVALKB1, EVALIB1, EVAL0B1

7 – 310
Character string processing instructions EVAL, EVALP

Program EVALP
Example 2
With leading edge from X20, the following program converts the character string specified in
D10 through D16 into a floating point number (data type REAL) and stores the result in D100
and D101.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D10 20 H 20 H
D11 2E H 31 H
D101 D100
D12 33 H 32 H
- 1 . 2 3 4 5 E -2
D13 35 H 34 H
D14 2D H 45 H
D15 32 H 30 H
D16 00 H

1 . 2 3 4 5 E - 0 2

1 1

1
These digits are not processed
EVALMB2, EVALKB2, EVALIB2, EVAL0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 311


ASC, ASCP Character string processing instructions

7.11.13 ASC, ASCP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Constant
Register Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

NOTE The ASC and the ASCP instructions do not work with the IEC editors. The only way to program
these instructions is by using the MELSEC instruction list.
Remedy: Move the hexadecimal ASCII format direct into the target registers.
,,
ASC__ME1, ASC__KE1, ASC_IE1

GX Works2

ASC__GE1

Variables Set Data Meaning Data Type


Head number of the devices where BIN data to be converted to a character
s BIN 16-bit
string is stored
d First number of device storing converted character string Character string
n Number of characters to be stored BIN 16-bit

7 – 312
Character string processing instructions ASC, ASCP

Functions Conversion of BIN 16-bit data into ASCII code


ASC/ASCP Conversion instruction
The ASCII instruction converts the 16-bit binary data stored from s onwards into the hexa-
decimal ASCII format and stores the result considering the number of characters specified by
n from d onwards.

b15 b12b11 b8b7 b4b3 b0 b15 b8b7 b0


s 1 d 5
s+1 2 d+1 6
d+2 7
d+3 8 10
3

4 9

1
First digit / second digit / third digit / fourth digit
2
First digit / second digit / third digit / fourth digit
3
First digit / second digit / third digit / fourth digit
4
Binary data
5
ASCII code of the 1st digit / ASCII code of the 2nd digit
6
ASCII code of the 3rd digit / ASCII code of the 4th digit
7 ASCII code of the 5th digit / ASCII code of the 6th digit

8
ASCII code of the 7th digit / ASCII code of the 8th digit
9
ASCII code of the 9th digit / ASCII code of the 10th digit
10Number of digits specified in n

ASC_0E1

b15 b12b11 b8b7 b4b3 b0 b15 b8b7 b0


s 1H 2H 3H 4H d 33 H (3) 34 H (4)
s+1 5H 6H 7H 8H d+1 31 H (1) 32 H (2)
s+2 FH EH DH CH d+2 37 H (7) 38 H (8)
s+3 AH 9H BH 6H d+3 35 H (5) 36 H (6)
d+4 44 H (D) 43 H (C)
d+5 46 H (F) 45 H (E)
d+6 42 H (B) 36 H (6)
d+7 00 H 39 H (9)

ASC_0E2
The number of characters specified in n determines the ranges of values of the devices speci-
fied from s and d onwards. The devices specified from s onwards contain the binary data to be
converted. The converted character string is stored in the devices specified from d onwards.
The program is even processed accurately and without an error message, if the storage area
of the binary data to be converted overlaps with that of the converted ASCII data.

b15 b12b11 b8b7 b4b3 b0 b15 b8b7 b0


D10 4H 3H 2H 1H D10 32 H 31 H
D11 8H 7H 6H 5H D11 34 H 33 H
D12 AH 9H D12 36 H 35 H
D13 38 H 37 H
D14 41H 39 H

ASC_0E3

Programming MELSEC System Q and L series 7 – 313


ASC, ASCP Character string processing instructions

If n specifies an odd number of characters, the ASCII character "00H" is placed automatically
into the upper 8 bits of the highest address of the area, storing the character string.

b15 b12b11 b8b7 b4b3 b0 b15 b8b7 b0


s 1 A 2 B s 32 H (2) 42 H (B)
s+1 B s+1 31 H(1) 41 H (A)
s+2 00 H 38 H (8)

ASC_0E4
If the number of characters specified by n is zero, the program will not be executed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of characters specified by n and therefore the required number of registers from
s onwards exceeds the relevant storage device range.
(Error code 4101)
● The number of characters specified by n and therefore the required number of registers from
d onwards exceeds the relevant storage device range.
(Error code 4101)

Program ASCP
Example
With leading edge from X0, the following program reads in the binary data stored in D0 as hexa-
decimal values and converts it into a character string. The result is stored in D10 through D14.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b12b11 b8b7 b4b3 b0 b15 b8b7 b0


D0 CH 7H 2H 9H D10 32 H (2) 39 H (9)
D1 0H 5H AH FH D11 43 H (C) 37 H (7)
D2 0H 0H 2H 2H D12 41H (A) 46 H (F)
D13 30 H (0) 35 H (5)
D14 32 H (2) 32 H (2)

ASC_0B1

7 – 314
Character string processing instructions HEX, HEXP

7.11.14 HEX, HEXP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
Index
(System, User) File Direct J\ Function Register Constant Other
Register Module K, H (16#)
Bit Word Bit Word U\G Zn

s —   — — — — — —
d —   — — — — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

HEX_ME1, HEX_KE1, HEX_IE1

GX Works2

HEX__GE1

Variables Set Data Meaning Data Type


s First number of device storing character string to be converted Character string
d First address of area storing the converted binary data
BIN 16-bit
n Number of characters to be converted

Programming MELSEC System Q and L series 7 – 315


HEX, HEXP Character string processing instructions

Functions Conversion of hexadecimal ASCII values into binary values


HEX Conversion of hexadecimal ASCII values
The HEX instruction converts the hexadecimal ASCII characters from s onwards into binary
values. The result is stored from d onwards.

b15 b8b7 b0 b15 b12b11 b8b7 b4b3 b0


s 4 d 1
s+1 5 d+1 2
s+2 6
n s+3 7

1
4th digit / 3rd digit / 2nd digit / 1st digit
2
Binary data
3 ASCII code of the 2nd digit / ASCII code of the 1st digit

4
ASCII code of the 4th digit / ASCII code of the 3rd digit
5
ASCII code of the 2nd digit / ASCII code of the 1st digit
6 ASCII code of the 4th digit / ASCII code of the 3rd digit

HEX_0E1

The number of characters in n is 9.

b15 b8b7 b0
s 33 H (3) 34 H (4)
s+1 31 H (1) 32 H (2) b15 b12b11 b8b7 b4b3 b0
2 s+2 42 H (B) 36 H (6) d 1H 2H 3H 4H
s+3 41 H (A) 39 H (9) d+1 AH 9H BH 6H
s+4 38 H (8) 45 H (E) d+2 0 H 0 H 0H EH

1 Since the character string contains 9 characters, the "38H" is not changed or moved.
2 n=9
HEX_0E2
The number of characters specified in n determines the range of values of the character string
from s and of the binary data from d onwards automatically.

Although the range of values of the ASCII code to be converted and that of the converted
binary values overlap, this instruction processes the data accurately.

b15 b8b7 b0 b15 b12b11 b8b7 b4b3 b0


D10 32 H 39 H D11 CH 7H 2 H 9 H

D11 43 H 37 H D12 0H 5H AH F H
D12 41 H 46 H D13 0H 0H 2 H 2 H

D13 30 H 35 H

D14 32 H 32 H

HEX_0E3

7 – 316
Character string processing instructions HEX, HEXP

If the number of characters in n is not divisible by 4, a zero is written after the specified number
of characters automatically to the highest registers storing the converted binary values.

b15 b8b7 b0 b15 b12b11 b8b7 b4b3 b0


s 32 H (2) 42 H (B) d 1 A 2 B
s+1 31 H (1) 41H (A) d+1 0 0 0 8
s+2 43 H (C) 38 H (8)
1

1
The value zero is stored automatically
HEX_0E4
If the number of characters in n is zero, the conversion will not be executed.
The ASCII code from s onwards may range from "30H" through "39H" and from "41H" through
"46H".

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The devices specified from s onwards contain characters exceeding the ranges from "30H"
through "39H", or from "41H" to "46H".
(Error code 4100)
● The number of characters specified by n and therefore the required number of registers from
s onwards exceeds the relevant storage device range.
(Error code 4101)
● The number of characters specified by n and therefore the required number of registers from
d onwards exceeds the relevant storage device range.
(Error code 4101)
● The value n is negative.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 317


HEX, HEXP Character string processing instructions

Program HEXP
Example
With leading edge from X0, the following program converts the character string "6B52A71379"
stored in D0 through D4 into binary data. The result is stored in D10 through D14.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0 b15 b12b11 b8b7 b4b3 b0


D0 42 H (B) 36 H (6) 2 H 5H BH 6H
D1 32 H (2) 35 H (5) 3 H 1H 7H AH
D2 37 H (7) 41 H (A) 0 0H 9H 7H
D3 33 H (3) 31 H (1)
D4 39 H (9) 37 H (7)

HEX_MB1, HEX_KB1, HEX_IB1 HEX_0B1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 318
Character string processing instructions RIGHT, RIGHTP, LEFT, LEFTP

7.11.15 RIGHT, RIGHTP, LEFT, LEFTP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special Constant
(System, User) File Direct J\ Function Index
Register Other
Register Module Zn K, H
Bit Word Bit Word U\G (16#) $

s —   — — — — —  —
d —   — — — — — — —
n         — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

RIGHTME1, RIGHTKE1, RIGHTIE1

GX Works2

RIGHTGE1

Variables Device Meaning Data Type


s First number of device storing the character string
First number of device area storing the determined characters of the character Character string
d
string
n Number of characters stored on the left or on the right BIN 16-bit

Programming MELSEC System Q and L series 7 – 319


RIGHT, RIGHTP, LEFT, LEFTP Character string processing instructions

Functions Extraction of character string data from the right or from the left
RIGHT Extract character string data from the right
The RIGHT instruction stores n characters from the right side of the character string (end of
character string) from s onwards. The characters are stored from d onwards.

b15 b8b7 b0
s b15 b8b7 b0
1
d 7
s+1 2
d+1 8

3
4 9
00 H 10

5
00 H 6

1 ASCII code of the 2nd characters / ASCII code of the 1st chracter
2
ASCII code of the 4th character / ASCII code of the 3rd character
3
ASCII code of the last character minus n+2 / ASCII code of the last character minus n+1
4 ASCII code of the last character minus n+4 / ASCII code of the last character minus n+3

5
ASCII code of the last character minus 1 / ASCII code of the last character minus 2
6
"00H" / ASCII code of the last character
7 ASCII code of the last character minus n+2 / ASCII code of the last character minus n+1

8 ASCII code of the last character minus n+4 / ASCII code of the last character minus n+3

9
ASCII code of the last character minus 1 / ASCII code of the last character minus 2
10 "00H" / ASCII code of the last character

RIGH0E1

– With n = 5

b15 b8b7 b0
s b15 b8b7 b0
42 H (B) 41 H (A)
d 32 H (2) 31 H (1)
s+1 44 H (D) 43 H (C)
d+1 34 H (4) 33 H (3)
s+2 46 H (F) 45 H (E)
d+2 00 H 35 H (5)
s+3 32 H (2) 31 H (1)
s+4 34 H (4) 33 H (3) “1 2 3 4 5“
s+5 00 H 35 H (5) 1
“A B C D E F 1 2 3 4 5”

1 ASCII code for the 5th character


RIGH0E2
If the number of characters in n is zero, the character code "00H" is stored from d onward.

7 – 320
Character string processing instructions RIGHT, RIGHTP, LEFT, LEFTP

LEFT Extract character string data from the left


The LEFT instruction stores n characters from the left side of the character string (beginning
of character string) from s onwards. The characters are stored from d onwards.

b15 b8b7 b0
s b15 b8b7 b0
1
d 7
s+1 2
d+1 8

3
4 9
00 H 10

5
00 H 6

1
ASCII code of the 2nd character / ASCII code of the 1st character
2
ASCII code of the 4th character / ASCII code of the 3rd character
3
ASCII code of the character n-1 / ASCII code of the character n-2
4
ASCII code of the character n+1 / ASCII code of the nth character
5
"00H" / ASCII code of the last character
6
ASCII code of the 2nd character / ASCII code of the 1st character
7
ASCII code of the 4th character / ASCII code of the 3rd character
8 ASCII code of the character n-1 / ASCII code of the character n- 2

9 "00H" / ASCII code of the nth character

LEFT0E1
– With n=7

b15 b8b7 b0
b15 b8b7 b0
s 42 H (B) 41 H (A)
d 42 H (B) 41H (A)
s+1 44 H (D) 43 H (C)
d+1 44 H (D) 43 H (C)
s+2 46 H (F) 45 H (E)
d+2 46 H (F) 45 H (E)
s+3 32 H (2) 31 H (1)
H

d+3 00 H 31H (1)


s+4 34 H (4) 33 H (3)
s+5 00 H 35 H (5) 1 “A B C D E F 1“
“A B C D E F 1 2 3 4 5”

1
ASCII code of the 7th character
LEFT0E2

If the number of characters in n is zero, the character code "00H" is stored from d onwards.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in n exceeds the number of existing characters stored from s onwards.
(Error code 4101)
● The area specified by n exceeds the relevant device range of the device specified by d.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 321


RIGHT, RIGHTP, LEFT, LEFTP Character string processing instructions

Program RIGHTP
Example 1
With leading edge from X0, the following program extracts 4 characters of the data from the
right side of the character string stored in R0 through R4 and stores it in D0 through D2.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
b15 b8b7 b0
R0 41 H (A) 42 H (B)
D0 45 H (E) 30 H (0)
R1 31 H (1) 32 H (2)
R2 D1 41H (A) 45 H (F)
45 H (E) 30 H (0)
D2 00 H
R3 41 H (A) 46 H (F)
“DEFA“
R4 00 H
“BA210EFA” 1

1
ASCII code of the 4th character
RIGHTMB1, RIGHTKB1, RIGHTIB1, RIGH0B1

Program LEFTP
Example 2
With leading edge from X1C, the following program extracts the number of characters specified
in D0 from the left side of the character string specified in D100 through D104. The result is
stored in R10 through R13.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
b15 b8b7 b0
D100 51 H (Q) 53 H (S)
R10 51 H 53 H
D101 4E H (N) 4F H (O)
R11 4E H 4F H
D102 44 H (D) 48 H (H)
R12 44 H 48 H
D103 42 H (B) 41 H
D104 R13 00 H
00 H
“SQONHD”
“SQONHDAB”
1 D0 6

1 ASCII code of the 6th character


LEFTMB2, LEFTKB2, LEFTIB2, LEFT0B1

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 322
Character string processing instructions MIDR, MIDRP, MIDW, MIDWP

7.11.16 MIDR, MIDRP, MIDW, MIDWP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special Index
(System, User) File Direct J\ Function Constant
Register Module Register $ Other
Bit Word Bit Word Zn
U\G
s1 —   — — — —  —
d —   — — — — — —
s2        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

MIDR_ME1, MIDR_KE1, MIDR_IE1

GX Works2

MIDR_GE1

Variables Data Type


Set Data Meaning
MELSEC IEC
Character string or first number of device storing character string
s1 Character Character
data
string string
d First number of device storing the operation result
First number of device storing the 1st character and the number of
characters. Array [1..2] of
s2 BIN 16-bit
(s2)+0: Position of the 1st character ANY16
(s2)+1: Number of characters

Programming MELSEC System Q and L series 7 – 323


MIDR, MIDRP, MIDW, MIDWP Character string processing instructions

Functions Storing and moving parts of character strings


MIDR Storing specified parts of character strings
The MIDR instruction stores a part specified from s onwards of the character string stored
from d onwards.
The first character of part to be stored is specified in s2 (Array_s[1]) and is counted beginning
from the left part of the character string (lower byte of s1).
The length of the part to be stored is specified in s2+1 (Array_s[2]).

b15 b8b7 b0
s1 42 H (B) 41 H (A) b15 b8b7 b0
(s1)+1 44 H (D) 43 H (C) d 46 H (F) 45 H (E)
(s1)+2 46 H (F) 45 H (E) d+1 48 H (H) 47 H (G)
(s1)+3 48 H (H) 47 H (G) 1 d+2 00 H 49 H (I)
(s1)+4 4A H (J) 49 H (I) “EFGHI”
(s1)+5 D0 H 4B H (K) 2
“ABCDEFGHIJK”

s2 5
(s2)+1 5

1
Position of the 1st character (s2), 5th character of the character string
2
Position of the last character to be stored
MIDR0E1

No operation is processed, if the number of characters in (s2)+1 (Array_s[2]) is zero.


If the value "–1" is stored in (s2)+1 (Array_s2[2]), the characters from s2 (Array_s2[1]) onwards
are stored.

b15 b8b7 b0
b15 b8b7 b0
d 46 H (F) 45 H (E)
s1 42 H (B) 41 H (A)
d+1 48 H (H) 47 H (G)
(s1)+1 44 H (D) 43 H (C)
d+2 4A H (J) 49 H (I)
(s1)+2 46 H (F) 45 H (E)
00 H 4B H (K)
(s1)+3 48 H (H) 47 H (G)
(s1)+4 4A H (J) 49 (I) 1
H
(s1)+5 00 H 4B H (K)
“ABCDEFGHIJK”

s2 5
(s2)+1 -1

1
Position of the 1st character (s2), 5th character of the character string
MIDR0E2

7 – 324
Character string processing instructions MIDR, MIDRP, MIDW, MIDWP

MIDW Moving parts of character string to a defined area


The MIDW instruction stores a part of specified length of the character string stored from s1
onwards in the area specified in d and d+1.
The first address of the storage area in d through d+n is specified in s2 (Array_s2[1]) and is
counted beginning from the left part of the character string (lower byte of d).
The length of the part of string to be stored is specified in s2+1 (Array_s2[2]).

MIDW0E1

No operation is processed, if the number of characters in (s2)+1 (Array_s2[2]) is zero.


If the number of characters specified in (s2)+1 (Array_s2[2]) exceeds the storage area speci-
fied from d onwards, the remaining characters are cut off. In the following diagram the charac-
ters "35H" through "37H" are not stored.

MIDW0E2

Programming MELSEC System Q and L series 7 – 325


MIDR, MIDRP, MIDW, MIDWP Character string processing instructions

If the value -1 is stored in (s2)+1 (Array_s2[2]), the characters are stored from s1 onwards.

b15 b8b7 b0 b15 b8b7 b0


s1 31 H (1) 30 H (0) d (B)
42 H (B) 41 H
(s1)+1 33 H (3) 32 H (2) d+1 44 H 43 H
(s1)+2 35 H (5) 34 H (4) d+2 46 H 45 H
(s1)+3 00 H d+3 48 H 47 H
“012345” d+4 4A H 49 H
d+5 00 H 48 H
s2 2 “ABCDEFGHIJK”
1
(s2)+1 -1 2 b15 b8b7 b0
d 35 H 41 H
d+1 32 H 31 H
d+2 34 H 33 H
d+3 48 H 35 H
d+4 4A H 49 H
d+5 00 H 48 H
”A012345HIJK”

MIDW0E3

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
For the MIDR instruction
● The initital device number of the characters to be stored specified in s2 (Array_s2[1]) exceeds
the range from s1 to (s1)+n.
(Error code 4101)
● The initital device number of the characters to be stored specified in (s2)+1 (Array_s2[2])
exceeds the range from d to d+n.
(Error code 4101)
● The s2+0 value is 0.
(Error code 4101)
● "00H" does not exist in the specified devices that follow the device specified for s1.
(Error code 4101)

For the MIDW instruction


● The initital device number of the characters to be stored specified in (s2) (Array_s2[1])
exceeds the range from d to d+n.
(Error code 4101)
● The initital device number of the characters to be stored specified in (s2)+1 (Array_s2[2])
exceeds the storage range in s1 through (s1)+n.
(Error code 4101)
● The s2+0 value is 0.
(Error code 4101)
● "00H" does not exist in the specified devices that follow the device specified for s1.
(Error code 4101)

7 – 326
Character string processing instructions MIDR, MIDRP, MIDW, MIDWP

Program MIDRP
Example 1
With leading edge from X0, the following program stores characters in D0 through D2 from a
character string in D10 through D13. The number of characters to be stored is specified in R1
(var_R0 Array [2]). The starting position within the source string is specified in R0 (var_R0
Array [1]).

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D10 41 H (A) 42 H (B) b15 b8b7 b0
D11 31 H (1) 32 H (2) 31 H (1) 32 H (2)
D12 46 H (E) 33 H (3) 46 H (E) 33 H (3)
D13 00 H 45 H (D) 00 H
“213E”
“BA213ED”

R0 3
R1 4

MIDR_MB1, MIDR_KB1, MIDR_IB1, MIDW0B1

Programming MELSEC System Q and L series 7 – 327


MIDR, MIDRP, MIDW, MIDWP Character string processing instructions

Program MIDWP
Example 2
With leading edge from X1C, the following program stores characters in D100 through D104
from the beginning of a character string in D0 through D3. The number of characters to be
stored is specified in R1 (var_R0 Array [2]). The starting position where the characters are
stored is specified by R0 (var_R0 Array [1]).

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0 b15 b8b7 b0


D0 31 H (3) 32 H (2) D100 53 H (S) 55 H (U)
D1 45 H (E) 46 H (F) D101 59 H (Y) 43 H (C)
D2 33 H (3) 30 H (0) D102 31 H (1) 5A H (Z)
D3 00 H D103 42 H (B) 30 H (0)
“21FE03” D104 00 H
“USCYZ10B“
R0 3
R1 4
b15 b8b7 b0
D100 53 H (S) 55 H (U)
D101 31 H (1) 32 H (2)
D102 45 H (E) 46 H (F)
D103 42 H (B) 30 H (0)
D104 00 H
“US21FE0B”

MIDRMB2, MIDRKB2, MIDRIB2, MIDW0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 328
Character string processing instructions INSTR, INSTRP

7.11.17 INSTR, INSTRP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special Constant
(System, User) File Direct J\ Function Index
Register Other
Register Module Zn K, H
Bit Word Bit Word U\G (16#) $

s1 —   — — — — —  —
s2 —   — — — — —  —
d        — — —
n         — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

INSTRME1, INSTRKE1, INSTRIE1

GX Works2

INSTRGE1

Variables Set Data Meaning Data Type


Character string to be searched for or first number of device storing the character
s1
string to be searched for
Character string
Character string in which a search is performed or first number of device storing
s2
the character string data to be searched through
d Initial number of device storing the search result
BIN 16-bit
n Initial position where data is searched

Programming MELSEC System Q and L series 7 – 329


INSTR, INSTRP Character string processing instructions

Functions Search for character strings


INSTR Search for character strings
The INSTR instruction searches the character string specified in s1 through (s1)+n within the
character string data specified by s2 through (s2)+n.
The search begins with the character specified in n.
The first matching character is stored in d. The character is counted beginning from the left part
of the character string (lower byte of s2).
– For n=3

b15 b8b7 b0 b15 b8b7 b0


s2 42 H (B) 41 H (A) s1 46 H (F) 45 H (E)
(s2)+1 44 H (D) 43 H (C) 1 (s1)+1 48 H (H) 47 H (E)
(s2)+2 46 H (F) 45 H (E) 2 (s1)+2 00 H
(s2)+3 48 H (H) 47 H (G) “EFGHIJK”
(s2)+4 4A H (J) 49 H (I)
(s2)+5 D0 H 4B H (K)
“ABCDEFGHIJK”

d 5 3

1 The search starts from the 3rd character


2
First character of the searched character string
3 Search result

INST0E1
If no matching character string is found, a zero is stored in d.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The initial search position stored in n exceeds the range of (s2) through (s2)+n.
(Error code 4100)
● 00H (NULL) does not exist within the corresponding device range after the device designated
by s1, s2.
(Error code 4100)
● The value of n is negative number or “0”.
(Error code 4100)

7 – 330
Character string processing instructions INSTR, INSTRP

Program INSTRP
Example 1
With leading edge from X0, the following program searches in R0 onwards beginning with the
5th character for the character string specified in D0 through D2. The result (0) is stored in
D100.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
b15 b8b7 b0
R0 49 H (I) 43 H (C) 1 D0 49 H (I) 43 H (C)
R1 33 H (3) 32 H (2)
2 D1 33 H (3) 32 H (2)
R2 32 H (2) 31 H (1)
D2 00 H
R3 49 H (I) 43 H (C)
R4 00 H 4D H (M) “C123”
“C12312CIM”

D100 0

1
This area is not searched through.
2
The search begins with the 5th character.
INSTRMB1, INSTRKB1, INSTRIE2, INST0B1

Programming MELSEC System Q and L series 7 – 331


INSTR, INSTRP Character string processing instructions

Program INSTRP
Example 2
With leading edge from X0, the following program searches in D0 onwards beginning with the
3rd character for the character string "AB". The search result (5) is stored in D100.

MELSEC Instruction List Ladder Diagram IEC Instruction List

b15 b8b7 b0
D0 32 H (2) 31 H (1)
D1 34 H (4) 33 H (3) 1 D100 5
D2 42 H (B) 41 H (A) 2
D3 36 H (6) 35 H (5)
D4 42 H (B) 41 H (A)
D5 00 H
“1234AB56AB”

1
The search begins with the 3rd character.
2
The searched character string begins at the 5th character.
INSTRMB2, INSTRKB2, INSTRIB2, INST0B2

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 332
Character string processing instructions STRINS, STRINSP

7.11.18 STRINS, STRINSP

CPU High
Basic Performance Process Redundant Universal LCPU

 1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special Index Constant
(System, User) File Direct J\ Function
Register Module Register Other
Bit Word Bit Word Zn K, H $
U\G (16#)
s —   — — — — —  —
d —   — — — — — — —
n —        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

STRINS s d n 4

STRINSP d n
6
s

Variables Set Data Meaning Data Type


s First number of device storing the character string to be inserted Character string
d Initial number of device storing the insert character strings Character string
Initial position where data is inserted.
n BIN 16-bit
(Setting range: 1 <= n <= 16383)

Programming MELSEC System Q and L series 7 – 333


STRINS, STRINSP Character string processing instructions

Functions Insertion of character strings


STRINS Insertion of character strings
This instruction inserts the character string data specified by s to the nth device (insert position)
from the initial character string data stored in the devices specified by d.

– For n=3

b15 b8b7 b0
s 31 H (1) 30 H (0) b15 b8b7 b0
s +1 33 H (3) 32 H (2) d 42 H (B) 41H (A)
s +2 00 H 34 H (4) d +1 ( s )
31 H (1) 30H (0)
1) d +2 33 H (3) 32H (2) ( s +1)
d +3 43 H (C) 34H (4) ( s +2)
b15 b8b7 b0
d d +4 45 H (E) 44H (D)
42 H (B) 41H (A)
d +1 2) d +5 47 H (G) 46H (F)
44 H (D) 43H (C)
d +2 d +6 00 H 48H (H)
46 H (F) 45H (E)
d +3 d +7 66 H (f) 65H (e)
48 H (H) 47H (G)
d +4 00 H 3)
d +5 62 H (b) 61H (a)
d +6 64 H (d) 63H (c)
d +7 66 H (f) 65H (e)

1 Shifts the third character and up by the number of characters specified by s to the left and inserts the
character string data specified by s
2
Third character insertion position
3
The character data stored after d+4 will be written over in accordance with the number of characters
to be inserted.

This instruction stores the NULL code (00H) into the device (1 word) that positions in d after
the last device where the character string data are stored, if the character string (s+d) value is
even after the insertion.
This instruction stores the NULL code (00H) into the last device (high 8 bits) in d where the
character string data are stored, if the character string (s+d) value is odd after the insertion.
This instruction links the device, where the character string data are stored, specified by s with
the last device specified by d, if n is specified by the number of devices specified by d plus one.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of characters in the devices specified by s, d, or the devices specified by (s+d)
after the insertion exceeds 16383 characters. (Error code 4100)
● The value specified by n is not within the specified range (1 < n < 16383).
(Error code 4100)
● The value specified by n exceeds the number of the devices specified by d plus one.
(Error code 4100)
● The devices, that store character strings, specified by s overlaps with even one of the devices
specified by d. (Error code 4101)
● The range of the devices specified by (s+d) in which character strings data have been
inserted exceeds the specified device range. (Error code 4101)
● The NULL code (00H) does not exist within the specified device range after the device
specified by s or d. (Error code 4101)
● The range of the devices specified by (s+d) in which character strings data have been
inserted overlaps with the range of the devices specified by s that store the character string
data. (Error code 4101)

7 – 334
Character string processing instructions STRINS, STRINSP

Program STRINS
Example 1
With leading edge from M0, the following program inserts the character string data stored in
the devices D0 and up to the fourth device from the initial character string data stored in D20
and up.

MELSEC Instruction List Ladder Diagram IEC Instruction List

3)

D0 38 H (8) 35 H (5) D20 52 H (R) 50H (P)


D1 00 H 34 H (4) D21 47 H (G) 4FH (O)
D22 41 H (A) 52H (R)
1) 584
D23 41 H (A) 4DH (M)
D24 43 H (C) 42H (B)
D25 00 H 44H (D)

4) PROGRAMABCD
2)
5)

6)

D20 52 H (R) 50H (P)


D21 35 H (5) 4FH (O)
D22 34 H (4) 38H (8)
D23 52 H (R) 47H (G)
D24 4DH (M) 41H (A)
D25 42 H (B) 41H (A)
D26 44 H (D) 43H (C)
D27 00 H

4) PRO584GRAMABCD

1
D0 character string
2
D20 character string inserted between"O"and"G"
3 Before insertion

4 D20 character string

5
Fourth character from the left (Insert position)
6
After insertion

Programming MELSEC System Q and L series 7 – 335


STRDEL, STRDELP Character string processing instructions

7.11.19 STRDEL, STRDELP

CPU High
Basic Performance Process Redundant Universal LCPU

1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special Index
(System, User) File Direct J\ Function Constant
Register Module Register K, H$ Other
Bit Word Bit Word Zn
U\G
d —   — — — — — —
n1 —        —
n2 —        —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

STRDEL d n1 n2 4

STRDELP n1 n2
6
d

Variables Set Data Meaning Data Type


d First number of device storing the character strings to be deleted Character string
Deletion start position.
n1
(Setting range: 1 < n1 < 16383)
BIN 16-bit
Number of characters to be deleted.
n2
(Setting range: 1 < n2 < 16384 – n1)

7 – 336
Character string processing instructions STRDEL, STRDELP

Functions Deletion of character strings


STRDEL Deletion of character strings
This instruction deletes n2 character string data specified by d starting from the device (delete
position) specified by n1.
– For n1 = 3 (device position of character string data to be deleted)
and n2 = 5 (number of characters to be deleted)

3) 4)
b15 b8b7 b0 b15 b8b7 b0 b15 b8b7 b0
d 42 H (B) 41H (A) d 42 H (B) 41H (A) d 42 H (B) 41H (A)
d +1 44 H (D) 43H (C) d +1 d +1 49 H (I) 48H (H)
d +2 46 H (F) 45H (E) d +2 d +2 4BH (K) 4AH (J)
d +3 48 H (H) 47H (G) 2) d +3 48 H (H) d +3 00 H 4CH (L)
d +4 4AH (J) 49H (I) d +4 4AH (J) 49H (I) d +4 00 H
d +5 4CH (L) 4BH (K) d +5 4CH (L) 4BH (K) d +5 00 H
d +6 00 H d +6 00 H d +6 00 H
d +7 31 H (1) 30H (0) d +7 31 H (1) 30H (0) d +7 31 H (1) 30H (0)
d +8 33 H (3) 32H (2) d +8 33 H (3) 32H (2) d +8 33 H (3) 32H (2)
d +9 35 H (5) 34H (4) 1) d +9 35 H (5) 34H (4) d +9 35 H (5) 34H (4)

5)

1
n1th character to be deleted
2
Deletes n2 characters from the n1th device and up
3 Shifts the n1+n2th characters and up, which are stored after the devices whose characters were

deleted, by n2 characters to the left


4 Stores the NULL code (00H) into the empty devices after shifting

5
Characters of the devices other than the shifted devices do not change.

This instruction stores the NULL code (00H) into the device (1 word) that positions after the last
device where the character string data are stored, if the character string specified by d is even,
after the characters are deleted.
This instruction stores the NULL code (00H) into the last device (high 8 bits) where the charac-
ter string data are stored, if the character string specified by d is odd, after the characters are
deleted.
This instruction shifts the characters stored in the devices positioned after the deleted devices
by n2 characters to the left - and then stores the NULL code (00H) into the empty device.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of characters in the devices specified by d exceeds 16383.
(Error code 4100)
● The value specified by n1 is not within the specified range (1 < n1 < 16383).
(Error code 4100)
● The value specified by n1 exceeds the number of characters in the devices specified by d.
(Error code 4100)
● The value specified by n2 exceeds the number of characters in the devices starting from
n1th to the last devices position.
(Error code 4100)
● The value specified by n2 is negative.
(Error code 4100)

Programming MELSEC System Q and L series 7 – 337


STRDEL, STRDELP Character string processing instructions

Program STRDEL
Example
With leading edge from M0, the following program deletes the seven characters starting with
the fourth character in the character string data stored in the devices from D0 onward.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0 52 H (R) 50H (P) D0 52 H (R) 50H (P) D0 52 H (R) 50H (P)


D1 47 H (G) 4FH (O) D1 47 H (G) 4FH (O) D1 44H (D) 4FH (O)
D2 41 H (A) 52H (R) D2 41 H (A) 52H (R) D2 00 H
D3 41 H (A) 4DH (M) D3 41 H (A) 4DH (M)
43 H (C) 42H (B) 43 H (C) 42H (B)
1) PROD
D4 D4
D5 00 H 44H (D) D5 00 H 44H (D)

1) PROGRAMABCD 1) PROGRAMABCD

2) 3)

1
D0 character string
2
Fourth character to be deleted
3 Seven characters to be deleted

7 – 338
Character string processing instructions EMOD, EMODP

7.11.20 EMOD, EMODP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special Index Constant
(System, User) File Direct J\ Function
Register Module Register Other
Bit Word Bit Word Zn K, H E
U\G (16#)
s1 —   —    1) —  —
s2         — —
d1 —   — — — — — — —
1 Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EMOD_ME1, EMOD_KE1, EMOD_IE1

GX Works2

EMOD_GE1

Variables Set Data Meaning Data Type


Floating point data (data type REAL) or first number of device storing the floating
s1 REAL
point data
Number of digits the floating point is moved to the right or first number of device
s2
storing such data BIN 16-bit
d1 First number of device storing the floating point number in BCD data format

Programming MELSEC System Q and L series 7 – 339


EMOD, EMODP Character string processing instructions

Functions Conversion of floating point number into the BCD format


EMOD Conversion into the BCD format
The EMOD instruction calculates the BCD format from the floating point number (real number)
in s1 and (s1)+1 considering the decimal point shift to the right specified in s2. The result is
stored in d1 through (d1)+4.
1
Floating point data (data type REAL)
2Shift of the decimal point to the right
3
(s1)+1 s1 d1 Sign bit (0 = positive / 1 = negative)
3
4
d1+1 7 BCD digits
4 7 5 Exponent sign (0 = positive / 1 = negative)
d1+2
1
6
s2 d1+3 5 BCD exponent (Value range 0 to 38)
d1+4 6 7
2 Floating point number in BCD data format

EMOD0E1

The following diagrams show conversion examples.

(s1)+1 s1 d1 0
3 .2 5 4 27 8 d1+1
3254278 H
1 d1+2
d1+3 1
s2 3 1
d1+4 3
1
Floating point data (data type REAL)
EMOD0E2

(s1)+1 s1 d1 1
-0 . 0 3 5 4 2 7 6 8 d1+1
3542768 H
d1+2
s2 d1+3 1
4
d1+4 4

EMOD0E3

(s1)+1 s1 d1 0
1 . 5 4 3 2 1 E+2 d1+1
H154321
d1+2
s2 3 d1+3 0
d1+4 0

EMOD0E4

7 – 340
Character string processing instructions EMOD, EMODP

The floating point number in s1 and (s1)+1 is rounded up to 7 digits and stored in (d1)+1 and
(d1)+2.

(s1)+1 s1 d1 0
1. 2 3 4 5 6 7 8 9 d1+1
1234568H
d1+2
s2 d1+3 1 123456789
3
d1+4 5 1

1234568

1
Rounded up
EMOD0E5

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of digits of the decimal point shift (s2) exceeds the range of 0 to 7.
(Error code 4100)
● The value entered in d1 through (d1)+4 exceeds the relevant storage device area.
(Error code 4101)
● The 32-bit floating point real number specified in s1 is not zero and not within the following
range:
2-126 < (s1) < 2 128
(Error code 4100)
● The device specified by d1 exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

Programming MELSEC System Q and L series 7 – 341


EMOD, EMODP Character string processing instructions

Program EMOD
Example
While X0 is set, the following program converts the floating point data (data type REAL) spec-
ified in D0 and D1 considering the decimal point shift specified in R10. The result is stored in
D100 through D104.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D1 D0 0
D100
1 .2 3 4 5 6 7 8 9 D101
1234568 H
D102
D103 1
R10 3
D104 5

EMODMB1, EMODKB1, EMODIB1, EMOD0B1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 342
Character string processing instructions EREXP, EREXPP

7.11.21 EREXP, EREXPP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
Index
(System, User) File Direct J\ Function Register Constant Other
Register Module K, H (16#)
Bit Word Bit Word U\G Zn

s1 —   — — — — — —
s2         —
d1 —   —    1) — —
1
Available only in multiple Universal model QCPU and LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

EREXPME1, EREXPKE1, EREXPIE1

GX Works2

EREXPGE1

Variables Set Data Meaning Data Type


s1 First number of device storing floating point data in BCD data format
BIN 16-bit
s2 Specification of decimal places or device storing such data
d1 Device storing floating point data (data type REAL) REAL

Programming MELSEC System Q and L series 7 – 343


EREXP, EREXPP Character string processing instructions

Functions Conversion of floating point data into the decimal format


EREXP Conversion into the decimal format
The EREXP instruction calculates the decimal format of the floating point data (real number)
from the floating point data in BCD format in s1 through (s1)+4, considering the decimal places
specified in s2. The result is stored in d1 and (d1)+1.

s1 2
(d1)+1 d1
(s1)+1
3
1 (s1)+2
(s1)+3 4 7
(s1)+4 5

s2 6

1
Floating point data in BCD data format
2
Sign bit (0 = positive / 1 = negative)
3
7 BCD digits
4
Exponent sign (0 = positive / 1 = negative)
5
BCD exponent (value range 0 to 38)
6
Number of decimal places (value range 0 to 7)
7 Floating point data (real number)

EREX0E1

The sign in s1 and the sign of the exponent in (s1)+3 is set to 0 for a positive value. For a
negative value the sign bit is 1.
The value of the BCD exponent (s1)+4 may range from 0 to 7.
The decimal places in s2 may range from 0 to 7.

s1 1 (d1)+1 d
(s1)+1
3215423 H -3. 2 1 5 4 2 3 E+2
(s1)+2
(s1)+3 0
(s1)+4 2

s2 6

EREX0E2

7 – 344
Character string processing instructions EREXP, EREXPP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The sign designation in s1 is not 0 or 1.
(Error code 4100)
● The BCD data in (s1)+1 and (s1)+2 contains more than 8 digits.
(Error code 4100)
● The exponent sign in (s1)+3 is not 0 or 1.
(Error code 4100)
● The exponent data in (s1)+4 exceeds the range from 0 to 38.
(Error code 4100)
● The number of decimal places in s2 exceeds the range of 0 to 7.
(Error code 4101)
● The device specified by s1 exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Program EREXPP
Example
With leading edge from X0, the following program calculates the floating point value (real num-
ber) in decimal format from the floating point value in BCD format specified in D0 through D4
considering the decimal places specified in D10. The result is stored in D100 and D101.
EREXPMB1, EREXKB1, EREXIB1

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0 1
D1 4567H D101 D100
D2 1234567H 1)
0123H 1. 2 3 4 5 6 7
D3 1
D4 3

D10 3

1
BCD 7 digits

Programming MELSEC System Q and L series 7 – 345


EREXP, EREXPP Character string processing instructions

7 – 346
Special functions

7.12 Special functions

Function MELSEC Instruction MELSEC Instruction


in MELSEC Editor in IEC Editor
SIN_MD
SIN
Single precision SIN_E_MD
(32-bit floating-point
number) SIN_P_MD
SINP
SIN_P_E_MD
Sine calculation
SIND
Double precision
(64-bit floating-point
number)
SINDP

COS_MD
COS
Single precision COS_E_MD
(32-bit floating-point
number) COS_P_MD
COSP
COS_P_E_MD
Cosine calculation
COSD
Double precision
(64-bit floating-point
number)
COSDP

TAN_MD
TAN
Single precision TAN_E_MD
(32-bit floating-point
number) TAN_P_MD
TANP
TAN_P_E_MD
Tangent calculation
TAND
Double precision
(64-bit floating-point
number)
TANDP

ASIN_MD
ASIN
Single precision ASIN_E_MD
(32-bit floating-point
number) ASIN_P_MD
ASINP
ASIN_P_E_MD
Arcus sine calculation
ASIND
Double precision
(64-bit floating-point
number)
ASINDP

ACOS_MD
ACOS
Single precision ACOS_E_MD
(32-bit floating-point
number) ACOS_P_MD
ACOSP
ACOS_P_E_MD
Arcus cosine calculation
ACOSD
Double precision
(64-bit floating-point
number)
ACOSDP

Programming MELSEC System Q and L series 7 – 347


Special functions

MELSEC Instruction MELSEC Instruction


Function in MELSEC Editor in IEC Editor
ATAN_MD
ATAN
Single precision ATAN_E_MD
(32-bit floating-point
number) ATAN_P_MD
ATANP
ATAN_P_E_MD
Arcus tangent calculation
ATAND
Double precision
(64-bit floating-point
number)
ATANDP

RAD_MD
RAD
Single precision RAD_E_MD
(32-bit floating-point
number) RAD_P_MD
RADP
Conversion from degrees RAD_P_E_MD
into radian
RADD
Double precision
(64-bit floating-point
number)
RADDP

DEG_MD
DEG
Single precision DEG_E_MD
(32-bit floating-point
number) DEG_P_MD
DEGP
Conversion from radian into DEG_P_E_MD
degree
DEGD
Double precision
(64-bit floating-point
number)
DEGDP

POW
Single precision
(32-bit floating-point
number)
POWP
Exponentiation
POWD
Double precision
(64-bit floating-point
number)
POWDP

SQR_MD
SQR
Single precision SQR_E_MD
(32-bit floating-point
number) SQR_P_MD
SQRP
SQR_P_E_MD
Square root
SQRD
Double precision
(64-bit floating-point
number)
SQRDP

7 – 348
Special functions

MELSEC Instruction MELSEC Instruction


Function in MELSEC Editor in IEC Editor
EXP_MD
EXP
Single precision EXP_E_MD
(32-bit floating-point
number) EXP_P_MD
EXPP
Floating point value as EXP_P_E_MD
exponent of e
EXPD
Double precision
(64-bit floating-point
number)
EXPDP

LOG_MD
LOG
Single precision LOG_E_MD
(32-bit floating-point
number) LOG_P_MD
LOGP
Logarithm (natural) LOG_P_E_MD
calculation
LOGD
Double precision
(64-bit floating-point
number)
LOGDP

LOG10
Single precision
(32-bit floating-point
number)
LOG10P
Common logarithm
LOG10D
Double precision
(64-bit floating-point
number)
LOG10DP

RND RND_M
Randomize value
RNDP RNDP_M
SRND SRND_M
Update random values
SRNDP SRNDP_M
BSQR_MD
BSQR
Square root calculation from BSQR_K_MD
4-digit BCD data BSQR_P_MD
BSQRP
BSQR_K_P_MD
BDSQR_MD
BDSQR
Square root calculation from BDSQR_K_MD
8-digit BCD data BDSQR_P_MD
BDSQRP
BDSQR_K_P_MD
BSIN_MD
BSIN
BSIN_K_MD
Sine calculation from BCD data
BSIN_P_MD
BSINP
BSIN_K_P_MD
BCOS_MD
BCOS
BCOS_K_MD
Cosine calculation from BCD data
BCOS_P_MD
BCOSP
BCOS_K_P_MD

Programming MELSEC System Q and L series 7 – 349


Special functions

MELSEC Instruction MELSEC Instruction


Function in MELSEC Editor in IEC Editor
BTAN_MD
BTAN
BTAN_K_MD
Tangent calculation from BCD data
BTAN_P_MD
BTANP
BTAN_K_P_MD
BASIN BASIN_MD
Arcus sine calculation from BCD data
BASINP BASIN_P_MD

Arcus cosine calculation BACOS BACOS_MD


from BCD data BACOSP BACOS_P_MD

Arcus tangent calculation BATAN BATAN_MD


from BCD data BATANP BATAN_P_MD

NOTE Within the IEC editors please use the IEC instructions.

7 – 350
Special functions SIN, SINP

7.12.1 SIN, SINP

CPU High
Basic Performance Process Redundant Universal LCPU

 1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —    1)  —
1)
d —   —    — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Angle data for the SIN (sine) instruction or first number of the devices storing
s
such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 351


SIN, SINP Special functions

Functions Sine calculation from floating-point values (Single precision)


SIN Sine calculation
The SIN instruction calculates the sine value from angle data in s and s+1. The result is stored
in d and d+1.

s+1 s d+1 d
SIN

1 1

1 32-bit floating point value (real number)

The angle in s and s+1 must be specified in radian measure (degrees x π/180). The conversion
from degrees into radian is described in the sections on the RAD and DEG instructions.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is –0.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU) (Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (overflow occurs):
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 352
Special functions SIN, SINP

Program SIN
Example
The following program calculates the sine value from the 4-digit BCD angle specification in X20
through X2F. The result is stored as 32-bit floating-point value (real number) in D0 and D1.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2 b15 b0
0 15 0 150
1 BIN 3
4 FLT

D21 D20 6 D11 D10 7 D1 D0


150 2 .6 1 7 99 3 0 .5 0 0 0 0 0 0 6
5 RAD 5 SIN 5

1
BCD value
2
Conversion into the BIN format
3
BIN value
4
Conversion into the floating-point format
5
32-bit floating point value (real number)
6
Conversion into the radian measure
7
Calculation of the sine value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 353


SIND, SINDP Special functions

7.12.2 SIND, SINDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

SIND s d

SINDP s d

Variables Set Data Meaning Data Type


Angle data for the SIND (sine) instruction or first number of the devices storing
s
such data Real number
d First number of device storing the operation result

7 – 354
Special functions SIND, SINDP

Functions Sine calculation from floating-point values (Double precision)


SIND Sine calculation
The SIND instruction calculates the sine value from angle data specified by s. The result is
stored into the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
SIN ( )

1) 1)

1 64-bit floating-point value (real number)

The angle in s must be specified in radian measure (degrees x π/180).


The conversion from degrees into radian is described in the sections on the RADD and DEGD
instructions.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (Operation results in an overflow):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 355


SIND, SINDP Special functions

Program SIND
Example
The following program calculates the sine value from the 4-digit BCD angle specification in X20
through X2F. The result is stored as 64-bit floating-point value (real number) in D0 to D3.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2) b15 b0 4) D23 D22 D21 D20
0 1 5 0 150 150
1) BIN 3) FLTD 5)
6)
RADD

D13 D12 D11 D10 7) D3 D2 D1 D0


2.617994 0.500000
5) SIND 5)

1
BCD value
2
Conversion into the BIN format
3
BIN value
4
Conversion into the floating-point format
5
64-bit floating-point value (real number)
6
Conversion into the radian measure
7
Calculation of the sine value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 356
Special functions COS, COSP

7.12.3 COS, COSP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Angle data for the COS (cosine) instruction or first number of the devices storing
s
such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 357


COS, COSP Special functions

Functions Cosine calculation from floating-point values (Single precision)


COS Cosine calculation
The COS instruction calculates the cosine value from angle data in s and s+1. The result is
stored in d and d+1.

s+1 s d+1 d
COS

1 1

1 32-bit floating point value (real number)

The angle in s and s+1 must be specified in radian measure (degrees x π/180). The conversion
from degrees into radian is described in the sections on the RAD and DEG instructions.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is –0.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (overflow occurs):
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 358
Special functions COS, COSP

Program COS
Example
The following program calculates the cosine value from the 4-digit BCD angle specification in
X20 through X2F. The result is stored as 32-bit floating-point value (real number) in D0 and D1.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2 b15 b0
0 0 6 0 60
1 BIN 3
4 FLT

D21 D20 6 D11 D10 7 D1 D0


60 1 .0 4 7 1 9 7 0 .4 9 9 9 9 9 9 7 0
5 5 5
RAD COS

1
BCD value
2 Conversion into the BIN format
3
Binary value
4
Conversion into the floating-point format
5 32-bit floating point value (real number)

6
Conversion into the radian measure
7
Calculation of the cosine value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 359


COSD, COSDP Special functions

7.12.4 COSD, COSDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

COSD s d

COSDP s d

Variables Set Data Meaning Data Type


Angle data for the COSD (cosine) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result

7 – 360
Special functions COSD, COSDP

Functions Cosine calculation from floating-point values (Double precision)


COSD Cosine calculation
The COSD instruction calculates the cosine value from angle data specified by s. The result is
stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
COS ( )

1) 1)

1 64-bit floating-point value (real number)

The angle in s must be specified in radian measure (degrees x π/180).


The conversion from degrees into radian is described in the sections on the RADD and DEGD
instructions.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result)< 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 361


COSD, COSDP Special functions

Program COSD
Example
The following program calculates the cosine value from the 4-digit BCD angle specification in
X20 through X2F. The result is stored as 64-bit floating-point value (real number) in D0 to D3.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2) b15 b0 4) D23 D22 D21 D20
0 0 60 60 60
1) BIN 3) FLTD 5)
6)
RADD

D13 D12 D11 D10 7) D3 D2 D1 D0


1.047198 0.500000
5) COSD 5)

1
BCD value
2
Conversion into the BIN format
3
Binary value
4
Conversion into the floating-point format
5
64-bit floating-point value (real number)
6
Conversion into the radian measure
7
Calculation of the cosine value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 362
Special functions TAN, TANP

7.12.5 TAN, TANP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Angle data for the TAN (tangent) instruction or first number of the devices storing
s
such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 363


TAN, TANP Special functions

Functions Tangent calculation from floating-point values (Single precision)


TAN Tangent calculation
The TAN instruction calculates the tangent value from angle data in s and s+1. The result is
stored in d and d+1.

s+1 s d+1 d
TAN

1 1

1 32-bit floating point value (real number)

The angle in s and s+1 must be specified in radian measure (degrees x π/180). The conversion
from degrees into radian is described in the sections on the RAD and DEG instructions.
If the angle in s and s+1 retains the values π/2 rad or (3/2)xπ rad, an error message is returned
from the radian measure calculation.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The operation result is not zero and not within the range from +2-126 to +2128.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
● The value of the specified device is –0.
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (overflow occurs):
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 364
Special functions TAN, TANP

Program TAN
Example
The following program calculates the tangent value from the 4-digit BCD angle specification in
X20 through X2F. The result is stored as 32-bit floating-point value (real number) in D0 and D1.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2 b15 b0
0 13 5 135
1 3
BIN
4 FLT

D21 D20 6 D11 D10 7 D1 D0


135 2.35 6194 -1 . 0 0 0 0 0 1
5 RAD 5 TAN 5

1
BCD value
2
Conversion into the BIN format
3
Binary value
4
Conversion into the floating-point format
5
32-bit floating point value (real number)
6
Conversion into the radian measure
7
Calculation of the tangent value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 365


TAND, TANDP Special functions

7.12.6 TAND, TANDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

TAND s d

TANDP s d

Variables Set Data Meaning Data Type


Angle data for the TAND (tangent) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result.

7 – 366
Special functions TAND, TANDP

Functions Tangent calculation from floating-point values (Double precision)


TAND Tangent calculation
The TAND instruction calculates the tangent value from angle data specified by s. The result
is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
TAN ( )

1) 1)

1 64-bit floating-point value (real number)

The angle in s must be specified in radian measure (degrees x π/180). The conversion from
degrees into radian is described in the sections on the RADD and DEGD instructions.
If the angle in s retains the values π/2 rad or (3/2)xπ rad, an error message is returned from
the radian measure calculation.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 367


TAND, TANDP Special functions

Program TAND
Example
The following program calculates the tangent value from the 4-digit BCD angle specification in
X20 through X2F. The result is stored as 64-bit floating-point value (real number) in D0 to D3.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D30
X2F X20 2) b15 b0 4) D23 D22 D21 D20
0 1 3 5 135 135
1) BIN 3) FLTD 5)
6)
RADD

D13 D12 D11 D10 7) D3 D2 D1 D0


2.356194 –1.000000
5) TAND 5)

1
BCD value
2
Conversion into the BIN format
3
Binary value
4
Conversion into the floating-point format
5
64-bit floating-point value (real number)
6
Conversion into the radian measure
7
Calculation of the tangent value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 368
Special functions ASIN, ASINP

7.12.7 ASIN, ASINP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   —   1)  —
1)
d —   —    — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


SIN value for the ASIN (arcus sine) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 369


ASIN, ASINP Special functions

Functions Arcus sine calculation of floating-point values (Single precision)


ASIN Arcus sine calculation
The ASIN instruction calculates the angle from the sine value in s and s+1. The result is stored
in d and d+1.

s+1 s d+1 d
-1
SIN

1 1

1 32-bit floating point value (real number)

The sine value in s and s+1 may range within the value range of -1 to 1.
The angle (operation result) at d is stored in radian measure (degrees x π/180). The conver-
sion from degrees into radian is described in the sections on the RAD and DEG instructions.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in s and s+1 exceeds the value range of -1 to 1. (Error code 4100)
● The contents of the specified device is not zero and not within the range from +2-126 to +2128.
(For the Universal model QCPU, LCPU) (Error code 4100)
● The value of the specified device is –0.
(For the High Performance model QCPU, Process CPU, Redundant CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (Operation results in an overflow)
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 370
Special functions ASIN, ASINP

Program ASIN
Example
The following program calculates the arcus sine value from the 32-bit floating-point data (real
number) in D0 and D1. The resulting angle in radian measure is output at Y40 through Y4F as
4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D1 D0 2 D11 D10
0 .5 0.5235988
1 3
ASIN
4 DEG

D30
D21 D20 b15 b0 Y4F Y40
6 8
30 30 0 0 3 0
5 7 9
INT BCD

1
32-bit floating point value (real number)
2
Arcus sine calculation
3
32-bit floating point value (real number)
4
Conversion of the angle measures
5
32-bit floating point value (real number)
6
Conversion into the BIN format
7
Binary value
8 Conversion into the BCD format

9
BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 371


ASIND, ASINDP Special functions

7.12.8 ASIND, ASINDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

ASIND s d

ASINDP s d

Variables Set Data Meaning Data Type


SIN value for the ASIND (arcus sine) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result

7 – 372
Special functions ASIND, ASINDP

Functions Arcus sine calculation of floating-point values (Double precision)


ASIND Arcus sine calculation
The ASIND instruction calculates the angle from the sine value specified by s. The result is
stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
SIN –1 ( )

1) 1)

1 64-bit floating-point value (real number)

The sine value in s may range within the value range of -1 to 1.


The angle (operation result) in d is stored in radian measure (degrees x π/180). The conversion
from degrees into radian is described in the sections on the RADD and DEGD instructions.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The value specified by s is within the double-precision floating-point range and outside the
range of -1.0 to 1.0. (Error code 4100)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 373


ASIND, ASINDP Special functions

Program ASIND
Example
The following program calculates the arcus sine value from the 64-bit floating-point data (real
number) in D0 to D3. The resulting angle in radian measure is output at Y40 through Y4F as
4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D3 D2 D1 D0 2) D13 D12 D11 D10


0.5 0.5235988
1) ASIND 1)
3)
DEGD

D30
D23 D22 D21 D20 4) b15 b0 6) Y4F Y40
30 30 0 0 3 0
1) INTD 5) BCD 7)

1
64-bit floating-point value (real number)
2
Arcus sine calculation
3
Conversion of the angle measures
4
Conversion into the BIN format
5
Binary value
6
Conversion into the BCD format
7
BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 374
Special functions ACOS, ACOSP

7.12.9 ACOS, ACOSP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   —   1)  —
1)
d —   —    — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


COS value for the ACOS (arcus cosine) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 375


ACOS, ACOSP Special functions

Functions Arcus cosine calculation of floating-point values (Single precision)


ACOS Arcus cosine calculation
The ACOS instruction calculates the angle from the cosine value in s and s+1. The result is
stored in d and d+1.

s+1 s d+1 d
-1
COS

1 1

1 32-bit floating point value (real number)

The cosine value in s and s+1 may range within the value range of -1 to 1.
The angle (operation result) at d is stored in radian measure (degrees x π/180). The conver-
sion from degrees into radian is described in the sections on the RAD and DEG instructions.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in s and s+1 exceeds the value range of -1 to 1. (Error code 4100)
● The contents of the specified device or the operation result is not zero and not within the
range from +2-126 to +2128.
(For the Universal model QCPU, LCPU)
(Error code 4100)
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (operation results in an overflow)
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 376
Special functions ACOS, ACOSP

Program ACOS
Example
The following program calculates the arcus cosine value from the 32-bit floating-point data (real
number) in D0 and D1. The resulting angle in radian measure is output at Y40 through Y4F as
4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D1 D0 2 D11 D10
0 .5 1 . 0 4 7 1 9 8
1 3
ACOS
4 DEG

D30
D21 D20 6 b15 b0 8 Y4F Y40
60 60 0 0 6 0
5 7 BCD 9
INT

1 32-bit floating point value (real number)


2
Arcus cosine calculation
3
32-bit floating point value (real number)
4 Conversion of the angle measures

5
32-bit floating point value (real number)
6
Conversion into the BIN format
7
Binary value
8
Conversion into the BCD format
9 BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 377


ACOSD, ACOSDP Special functions

7.12.10 ACOSD, ACOSDP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

ACOSD s d

ACOSDP s d

Variables Set Data Meaning Data Type


COS value for the ACOSD (arcus cosine) instruction or first number of the
s
devices storing such data Real number
d First number of device storing the operation result

7 – 378
Special functions ACOSD, ACOSDP

Functions Arcus cosine calculation of floating-point values (Double precision)


ACOSD Arcus cosine calculation
The ACOSD instruction calculates the angle from the cosine value specified by s. The result is
stored in the devices specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
COS –1 ( )

1) 1)

1 64-bit floating-point value (real number)

The cosine value in s may range within the value range of -1 to 1.


The angle (operation result) at d is stored in radian measure (degrees x π/180). The conver-
sion from degrees into radian is described in the sections on the RADD and DEGD instructions.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The value specified by s is within the double-precision floating-point range and outside the
range of -1.0 to 1.0.
(Error code 4100)
● The result exceeds the following range (Operation results in an overflow):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 379


ACOSD, ACOSDP Special functions

Program ACOSD
Example
The following program calculates the arcus cosine value from the 64-bit floating-point data (real
number) in D0 to D3. The resulting angle in radian measure is output at Y40 through Y4F as
4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D3 D2 D1 D0 2) D13 D12 D11 D10


0.5 1.047198
1) ACOSD 1)
3)
DEGD

D30
D23 D22 D21 D20 4) b15 b0 6) Y4F Y40
60 60 0 0 6 0
1) INTD 5) BCD 7)

1 64-bit floating-point value (real number)


2
Arcus cosine calculation
3
Conversion of the angle measures
4 Conversion into the BIN format

5
Binary value
6
Conversion into the BCD format
7
BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 380
Special functions ATAN, ATANP

7.12.11 ATAN, ATANP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   —   1)  —
1)
d —   —    — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


TAN value for the ATAN (arcus tangent) instruction or first number of the devices
s
storing such data Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 381


ATAN, ATANP Special functions

Functions Arcus tangent calculation of floating-point values (Single precision)


ATAN Arcus tangent calculation
The ATAN instruction calculates the angle from the tangent value in s and s+1. The result is
stored in d and d+1.

s+1 s d+1 d
-1
TAN

1 1

1 32-bit floating point value (real number)

The angle (operation result) at d is stored in radian measure (degrees x π/180). The conver-
sion from degrees into radian is described in the sections on the RAD and DEG instructions.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The contents of the specified device or the operation result is not zero and not within the
range from +2-126 to +2128.
(For the Universal model QCPU, LCPU)
(Error code 4100)
● The value of the specified device is –0.
(For the High Performance model QCPU, Process CPU, Redundant CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (Operation results in an overflow)
(For the Universal model QCPU, LCPU)
–2128 < (Operation result) < 2128
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 382
Special functions ATAN, ATANP

Program ATAN
Example
The following program calculates the arcus tangent value from the 32-bit floating-point data
(real number) in D0 and D1. The resulting angle in radian measure is output at Y40 through
Y4F as 4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D1 D0 2 D11 D10
1 0 .7 8 5 3 9 8
1 3
ATAN
4 DEG

D30
D21 D20 6 b15 b0 8 Y4F Y40
45 45 0 0 4 5
5 7 BCD 9
INT

1
32-bit floating point value (real number)
2
Arcus tangent calculation
3 32-bit floating point value (real number)

4
Conversion of the angle measures
5
32-bit floating point value (real number)
6 Conversion into the BIN format

7
Binary value
8
Conversion into the BCD format
9 BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 383


ATAND, ATANDP Special functions

7.12.12 ATAND, ATANDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

ATAND s d

ATANDP s d

Variables Set Data Meaning Data Type


TAN value for the ATAND (arcus tangent) instruction or first number of the
s
devices storing such data Real number
d First number of device storing the operation result

7 – 384
Special functions ATAND, ATANDP

Functions Arcus tangent calculation of floating-point values (Double precision)


ATAND Arcus tangent calculation
The ATAND instruction calculates the angle from the tangent value specified by s. The result is
stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
TAN –1 ( )

1) 1)

1 64-bit floating-point value (real number)

The angle (operation result) at d is stored radian measure (degrees x π/180). The conversion
from degrees into radian is described in the sections on the RADD and DEGD instructions.
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 385


ATAND, ATANDP Special functions

Program ATAND
Example
The following program calculates the arcus tangent value from the 64-bit floating-point data
(real number) in D0 to D3. The resulting angle in radian measure is output at Y40 through Y4F
as 4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D3 D2 D1 D0 2) D13 D12 D11 D10


1 0.785398
1) ATAND 1)
3)
DEGD

D30
D23 D22 D21 D20 4) b15 b0 6) Y4F Y40
45 45 0 0 4 5
1) INTD 5) BCD 7)

1
64-bit floating-point value (real number)
2
Arcus tangent calculation
3 Conversion of the angle measures

4
Conversion into the BIN format
5
Binary value
6 Conversion into the BCD format

7
BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 386
Special functions RAD, RADP

7.12.13 RAD, RADP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Angle to be converted to radian units or first number of the devices storing such
s
data Real number
d First number of device storing conversion result

Programming MELSEC System Q and L series 7 – 387


RAD, RADP Special functions

Functions Conversion from degrees into radian as floating-point value (Single precision)
RAD Conversion from degrees into radian
The RAD instruction calculates the radian value (rad) from the degree value (°) in s and s+1.
The result is stored in d and d+1.

s+1 s d+1 d
°
rad

1 1

1 32-bit floating point value (real number)

The conversion from degrees into radiant applies to the following equation:
Radian value = degree value x π / 180

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The contents of the specified device or the operation result is not zero and not within the
range from +2-126 to +2128.
(For the Universal model QCPU, LCPU)
(Error code 4100)
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (operation results in an overflow):
–2128 < (Operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 388
Special functions RAD, RADP

Program RAD
Example
The following program calculates the radian value from the degree value of the 4-digit BCD
value in X20 through X2F. The result is stored in D20 and D21 as 32-bit floating-point value.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0
X2F X20 1 b15 b0 2 D11 D10 3 D21 D20
01 2 0 120 120 2 . 0 9 4 3 9 5 ...
4 BIN 5 FLT 6 RAD 7

1
Conversion into the BIN format
2
Conversion into the floating-point format
3
Conversion into radian measure
4
BCD value
5 Binary value

6
32-bit floating point value (real number)
7
32-bit floating point value (real number)

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 389


RADD, RADDP Special functions

7.12.14 RADD, RADDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

RADD s d

RADDP s d

Variables Set Data Meaning Data Type


Angle to be converted to radian units or first number of the devices storing such
s
data Real number
d First number of device storing conversion result

7 – 390
Special functions RADD, RADDP

Functions Conversion from degrees into radian as floating-point value (Double precision)
RADD Conversion from degrees into radian
The RADD instruction calculates the radian value (rad) from the degree value (°) specified by
s. The result is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
( )° ( ) rad

1) 1)

1 64-bit floating-point value (real number)

The conversion from degrees into radiant applies to the following equation:
Radian value = degree value x π / 180
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (Operation results in an overflow):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 391


RADD, RADDP Special functions

Program RADD
Example
The following program calculates the radian value from the degree value of the 4-digit BCD
value in X20 through X2F. The result is stored in D20 to D23 as 64-bit floating-point value.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0
X2F X20 2) b15 b0 4) D13 D12 D11 D10 5) D23 D22 D21 D20
0 1 2 0 120 120 2.094395···
1) BIN 3) FLTD RADD 6)

1
BCD value
2
Conversion into the BIN format
3 Binary value

4 Conversion into the floating-point format

5
Conversion into radian measure
6 64-bit floating-point value (real number)

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 392
Special functions DEG, DEGP

7.12.15 DEG, DEGP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Radian angle to be converted to degrees or first number of the devices storing
s
such data Real number
d First number of device storing conversion result

Programming MELSEC System Q and L series 7 – 393


DEG, DEGP Special functions

Functions Conversion from radian in floating-point format into degrees (Single precision)
DEG Conversion from radian into degrees
The DEG instruction calculates the degree value (°) from the radian value (rad) in s and s+1.
The result is stored in d and d+1.

s+1 s d+1 d
°
rad

1 1

1 32-bit floating point value (real number)

The conversion from radian into degrees applies to the following equation:
Degree value = radian value x 180 / π

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (overflow occurs):
–2128 < (Operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 394
Special functions DEG, DEGP

Program DEG
Example
The following program calculates the degree value from the radian value stored in D20 and D21
as 32-bit floating-point value. The result is stored in Y40 to Y4F as BCD value.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0
D21 D20 D11 D10
1 2 b15 b0 3 Y4F Y40
1 .4 3 5 7 9 2 8 2 .2 6 4 8 2 82 0 0 8 2
4 5 6 7
DEG BIN BCD

1
Conversion into degrees
2
Conversion into the BIN format
3 Conversion into the BCD format

4 32-bit floating point value (real number)

5
32-bit floating point value (real number)
6 Binary value

7 BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 395


DEGD, DEGDP Special functions

7.12.16 DEGD, DEGDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

DEGD s d

DEGDP s d

Variables Set Data Meaning Data Type


Radian angle to be converted to degrees or first number of the devices storing
s
such data Real number
d First number of device storing conversion result

7 – 396
Special functions DEGD, DEGDP

Functions Conversion from radian in floating-point format into degrees (Double precision)
DEGD Conversion from radian into degrees
The DEGD instruction calculates the degree value (°) from the radian value (rad) specified by
s. The result is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
( ) rad ( )°

1) 1)

1 64-bit floating-point value (real number)

The conversion from radian into degrees applies to the following equation:
Degree value = radian value x 180 / π
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2-1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 397


DEGD, DEGDP Special functions

Program DEGD
Example
The following program calculates the degree value from the radian value stored in D20 to D23
as 64-bit floating point value. The result is stored in Y40 to Y4F as BCD value.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0
D23 D22 D21 D20 2) D13 D12 D11 D10 3) b15 b0 5) Y4F Y40
1.435792 82.26482 82 0 0 8 2
1) DEGD 1) INTD 4) BCD 6)

1
64-bit floating-point value (real number)
2
Conversion to angle
3
Conversion into the BIN format
4 Binary value

5
Conversion into the BCD format
6
BCD value

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 398
Special functions POW, POWP

7.12.17 POW, POWP

CPU High
Basic Performance Process Redundant Universal LCPU

1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s1 —   —    1) —
1)
s2 —   —     —
d —   —    — —
1
Available only for real number

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

POW s1 s2 d

POWP s1 s2 d

Variables Set Data Meaning Data Type


s1 Exponentiation recipient data or first number of the devices storing such data
s2 Exponentiation data or first number of the devices storing such data Real number
d First number of device storing operation result

Programming MELSEC System Q and L series 7 – 399


POW, POWP Special functions

Functions Exponentiation operation on floating-point data (Single precision)


POW Exponentiation operation
The POW instruction raises the 32-bit floating-point data type real number specified by s1 to
the number nth power specified by s2, and then stores the operation result into the device
specified by d.

1)
s2 +1 s2

s1 +1 s1 d +1 d

2)

s1 +1 s1 s1 +1 s1 s1 +1 s1 s1 +1 s1

s1 +1 s1 s2 +1 s2

3) 4)

1
Exponentiation data
2 Exponentiation recipient data
3
32-bit floating-point value (real number)
4 32-bit floating-point value (real number)

The instruction raises 3) to the power of 4).


The following shows the values to be specified by and stored into s1 or s2:
0, + 2–126 < (Set values (Storage values)) < + 2128.
If the value resulted from the operation is –0 or an underflow occurs, the result will be pro-
cessed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The values specified by s1 or s2 are not zero and not within the following range:
2–126 < (Specified value (storage values)) < 2128
(Error code 4140)
● The value of s1 or s2 is –0.
(Error code 4140)
● The result exceeds the following range:
–2126 < (Operation result) < 2126
(Error code 4141)

7 – 400
Special functions POW, POWP

Program POW
Example
The following program raises the 32-bit floating-point data type real number data specified by
D0 and D1 to the data specified by (D10 and D11)th power, when X10 is turned on. The oper-
ation result is stored into D20 and D21.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D11 D10
1.2
D1 D0 1) D21 D20
0.22 0.163

1
Exponentiation operation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 401


POWD, POWDP Special functions

7.12.18 POWD, POWDP

CPU High
Basic Performance Process Redundant Universal LCPU

1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s1 —   —   — 1) —
1)
s2 —   —   —  —
d —   —   — — —
1
Available only for real number

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

POWD s1 s2 d

POWDP s1 s2 d

Variables Set Data Meaning Data Type


s1 Exponentiation recipient data or first number of the devices storing such data
s2 Exponentiation data or first number of the devices storing such data Real number
d First number of device storing operation result

7 – 402
Special functions POWD, POWDP

Functions Exponentiation operation on floating-point data (Double precision)


POWD Exponentiation operation

The POW instruction raises the 64-bit floating-point data type real number specified by s1 to
the number nth power specified by s2, and then stores the operation result into the device
specified by d.

1)
S2 +3 S2 +2 S2 +1 S2

S1 +3 S1 +2 S1 +1 S1 d +3 d +2 d +1 d

2)

S1 +3 S1 +2 S1 +1 S1 S1 +3 S1 +2 S1 +1 S1 S1 +3 S1 +2 S1 +1 S1

S1 +3 S1 +2 S1 +1 S1 S2 +3 S2 +2 S2 +1 S2

3) 4)

1
Exponentiation data
2
Exponentiation recipient data
3
64-bit floating-point value (real number)
4
64-bit floating-point value (real number)
The instruction raises the real number 3) to the power of 4).
The following shows the values to be specified by and stored into s1 or s2:
0, 2–1022 < (Set values (storage values)) < 21024.
If the value resulted from the operation is –0 or an underflow occurs, the result will be pro-
cessed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Error code is stored into SD0.
● The values specified by s1 or s2 are not zero and not within the following range:
2–1022 < (Specified value (storage values)) < 21024
(Error code 4140)
● The value of s1 or s2 is –0.
(Error code 4140)
● The result exceeds the following range:
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 403


POWD, POWDP Special functions

Program POWD
Example
The following program raises the 64-bit floating-point data type real number data specified by
D200 to D203 to the number nth specified by (D0 to D3) power, when X10 is turned on. The
operation result is stored into D100 to D103.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D3 D2 D1 D0
3
D203 D202 D201 D200 1) D103 D102 D101 D100

15.6 3796.416

5
Exponentiation operation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 404
Special functions SQR, SQRP

7.12.19 SQR, SQRP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Data of which the square root is obtained or first number of the devices storing
s
such data Real number
d First number of device storing the calculation result

Programming MELSEC System Q and L series 7 – 405


SQR, SQRP Special functions

Functions Square root calculation of floating-point values (Single precision)


SQR Square root calculation
The SQR instruction calculates the square root of the 32-bit floating-point value in s and s+1.
The result is stored in d and d+1.

s+1 s d+1 d

1 1

1 32-bit floating point value (real number)

Only positive values may be stored in s and s+1.


(Negative values cannot be processed).

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value entered in s is negative. (Error code 4100)
● The contents of the specified device or the operation result is not zero and not within the
range from +2-126 to +2128.
(For the Universal model QCPU, LCPU)
(Error code 4140)
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (Operation results in an overflow):
–2128 < (Operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 406
Special functions SQR, SQRP

Program SQR
Example
The following program calculates the square root of the 4-digit BCD value in X20 through X2F.
The result is stored in D0 and D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D20
X2F X20 1 b15 b0 2 D11 D10 3 D1 D0
0 6 5 0 650 650 2 5 .4 9 5 1
4 BIN 5 FLT 6 SQR 7

1
Conversion into the BIN format
2
Conversion into the floating-point format
3
Square root calculation
4
BCD value
5 Binary value

6
32-bit floating point value (real number)
7
32-bit floating point value (real number)

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 407


SQRD, SQRDP Special functions

7.12.20 SQRD, SQRDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
SQRD s d

SQRDP s d

Variables Set Data Meaning Data Type


Data of which the square root is obtained or first number of the devices storing
s
such data Real number
d First number of device storing the calculation result

7 – 408
Special functions SQRD, SQRDP

Functions Square root calculation of floating-point values (Double precision)


SQRD Square root calculation
The SQRD instruction calculates the square root of the 64-bit floating-point value specified by
s. The result is stored in the device specified in d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
( )

1) 1)

1 64-bit floating-point value (real number)

Only positive values may be stored in s.


(Negative values cannot be processed).
When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value entered in s is negative. (Error code 4100)
● The value of the specified device is not zero and not within the following range:
2–1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 409


SQRD, SQRDP Special functions

Program SQRD
Example
While X0 is set, the following program calculates the square root of the 4-digit BCD value in
X20 through X2F. The result is stored in D0 to D3.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D20
X2F X20 2) b15 b0 4) D13 D12 D11 D10 5) D3 D2 D1 D0
0 6 5 0 650 650 25.4951
1) BIN 3) FLTD SQRD 6)

1
BCD value
2
Conversion into the BIN format
3
Binary value
4
Conversion into the floating-point format
5 Square root calculation

6
64-bit floating-point value (real number)

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 410
Special functions EXP, EXPP

7.12.21 EXP, EXPP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s Value for the EXP instruction or first number of device storing such data
Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 411


EXP, EXPP Special functions

Functions Floating point values as exponent of the base e (Single precision)


EXP Exponent of e
The EXP instruction calculates the corresponding exponent to the base e from the 32-bit float-
ing-point value in s and s+1. The result is stored in d and d+1.

s+1 s d+1 d
e
1 1

1 32-bit floating point value (real number)

The calculation is based on the Euler´s constant: "e = 2.718281828".

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The operation result is outside the range shown below:
2-126 < (Operation result) < 2128 for the High Performance model QCPU and
2-126 < (Operation result) < 2128 for the Basic Model QCPU, Process CPU, Redundant
CPU
(Error code 4100)
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if –0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (overflow occurs):
–2128 < (Operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 412
Special functions EXP, EXPP

Program EXP
Example
The following program calculates the result of the exponential function to the base e with the
2-digit BCD value at X20 through X27. The result is stored in D0 and D1 in 32-bit floating-point
format.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D20
X27 X20 1 b15 b0 2 D11 D10 3 D1 D0
1 3 13 13 4 4 2 4 1 3 .4
4 BIN 5 FLT 6 EXP 7

1
Conversion into the BIN format
2
Conversion into the floating-point format
3 Exponential calculation

4 BCD value

5
Binary value
6
32-bit floating point value (real number)
7 32-bit floating point value (real number)

NOTES The operation result will be under 2129 if the BCD value of X20 to X27 is less than 89, from the
calculation ln 2129 = 89.4.
Because setting a value of over 89 will return an operation error, M0 is turned ON in this example
if a value of over 89 has been set to avoid the error.
Conversion from natural logarithm to common logarithm:
In the CPU module, calculation is made using a natural logarithm.
To obtain a common logarithm value, enter in s a common logarithm value divided by 0.43429:
10x = ex/0.43429.
This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 413


EXPD, EXPDP Special functions

7.12.22 EXPD, EXPDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
EXPD s d

EXPDP s d

Variables Set Data Meaning Data Type


s Value for the EXPD instruction or first number of device storing such data
Real number
d First number of device storing the operation result

7 – 414
Special functions EXPD, EXPDP

Functions Floating point values as exponent of the base e (Double precision)


EXPD Exponent of e
The EXPD instruction calculates the corresponding exponent to the base e from the 64-bit
floating-point value specified by s. The result is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
e ( ) ( )

1) 1)

1 64-bit floating-point value (real number)

The calculation is based on the Euler´s constant: "e = 2.718281828".


When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value of the specified device is not zero and not within the following range:
2–1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 415


EXPD, EXPDP Special functions

Program EXPD
Example
The following program calculates the result of the exponential function to the base e with the
2-digit BCD value at X20 through X31. The result is stored in D0 to D3 in 64-bit floating-point
format.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D20
X31 X20 2) b15 b0 4) D13 D12 D11 D10 6) D3 D2 D1 D0
0 1 3 13 13 442413.4
1) BIN 3) FLTD 5) EXPD 5)

1
BCD value
2
Conversion into the BIN format
3 Binary value

4 Conversion into the floating-point format

5
64-bit floating-point value (real number)
6
Exponential calculation

NOTES The operation result will be under 21024 if the BCD value of X20 to X31 is less than 709, from the
calculation ln 21024 = 709.7832.
Because setting a value of over 709 will return an operation error, M0 is turned ON in this ex-
ample if a value of over 709 has been set to avoid the error.
Conversion from natural logarithm to common logarithm:
In the CPU module, calculation is made using a natural logarithm.
To obtain a common logarithm value, enter in s a common logarithm value divided by 0.43429:
10x = ex/0.43429.
This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 416
Special functions LOG, LOGP

7.12.23 LOG, LOGP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn E
Bit Word Bit Word U\G
s —   —   1)  —
d —   —   1) — —
1
Applicable for the Universal model QCPU, LCPU

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s Value for the LOG instruction or first number of device storing such data
Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 417


LOG, LOGP Special functions

Functions Logarithm (ln) calculation from floating-point values (Single precision)


LOG Logarithm (ln) calculation
The LOG instruction calculates the natural logarithm from the 32-bit floating-point number in s
and s+1. The result is stored in d and d+1.

s+1 s d+1 d
log

1 1

1 32-bit floating point value (real number)

Only positive values can be specified in s and s+1. Negative values cannot be calculated.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified in s is negative. (Error code 4100)
● The value specified in s is 0. (Error code 4100)
● The contents of the specified device or the operation result are not zero and not within the
following range:
2-126 <= (Contents of device or operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4100)
● The value of the specified device is –0.
(For the Basic Model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
(Error code 4100)
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to section 3.5.1.
● The result exceeds the following range (operation results in an overflow):
–2128 < (Operation result) < 2128
(For the Universal model QCPU, LCPU)
(Error code 4141)
● The value of the specified device is –0, unnormalized number, nonnumeric, or ∞.
(For the Universal model QCPU, LCPU)
(Error code 4140)

7 – 418
Special functions LOG, LOGP

Program LOG
Example
The following program calculates the natural logarithm from the value 10. The result is stored
in D30 and D31.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D50
b15 b0 1 D41 D40 2 D31 D30
10 10 10 2 .3 0 2 5 8 5
MOV 3 FLT 4 LOG 5

1
Conversion into the floating-point format
2
Logarithm calculation
3 Binary value

4 32-bit floating point value (real number)

5
32-bit floating point value (real number)

NOTES The LOG instruction calculates the natural logarithm (base e). The following formula converts
the natural logarithm to normal logarithm (base 10):
log10 X = 0.43429 x logeX
Universal model QCPU and LCPU can also calculate the normal logarithm (base 10) (refer to
section 7.12.25 "LOG10, LOG10P" and section 7.12.26 "LOG10D, LOG10DP").

This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 419


LOGD, LOGDP Special functions

7.12.24 LOGD, LOGDP

CPU High
Basic Performance Process Redundant Universal LCPU

 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

LOGD s d

LOGDP s d

Variables Set Data Meaning Data Type


s Value for the LOGD instruction or first number of device storing such data
Real number
d First number of device storing the operation result

7 – 420
Special functions LOGD, LOGDP

Functions Logarithm (ln) calculation from floating-point values (Double precision)


LOGD Logarithm (ln) calculation
The LOGD instruction calculates the natural logarithm from the 64-bit floating-point number
specified by s taking (e) as a base. The result is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
log ( ) ( )

1) 1)

1 64-bit floating-point value (real number)

Only positive values can be specified by s. Negative values cannot be calculated.


When the operation results in -0 or an underflow, the result is processed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified in s is negative. (Error code 4100)
● The value specified in s is 0. (Error code 4100)
● The value of the specified device is not zero ro not within the following range:
2–1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 421


LOGD, LOGDP Special functions

Program LOGD
Example
The following program calculates the natural logarithm from the value 10 set by D50. The result
is stored in D30 to D33.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D50
b15 b0 2) D43 D42 D41 D40 4) D33 D32 D31 D30
10 10 10 2.302585
MOV 1) FLTD 3) LOGD 3)

1
Binary value
2
Conversion into the floating-point format
3 64-bit floating-point value (real number)

4 Logarithm calculation

NOTES The LOGD instruction calculates the natural logarithm (base e). The following formula converts
the natural logarithm to normal logarithm (base 10):
log10 X = 0.43429 x logeX
Universal model QCPU and LCPU can also calculate the normal logarithm (base 10) (refer to
section 7.12.25 "LOG10, LOG10P" and section 7.12.26 "LOG10D, LOG10DP").

This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 422
Special functions LOG10, LOG10P

7.12.25 LOG10, LOG10P

CPU High
Basic Performance Process Redundant Universal LCPU

1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn E Other
Bit Word Bit Word U\G
s —   —   — 1) —
d —   —   — — —
1
Available only for real number

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

LOG10 s d

LOG10P s d

Variables Set Data Meaning Data Type


s Value for the LOG10 instruction or first number of device storing such data
Real number
d First number of device storing the operation result

Programming MELSEC System Q and L series 7 – 423


LOG10, LOG10P Special functions

Functions Common logarithm calculation from floating-point values (Single precision)


LOG10 Common logarithm calculation
The LOG10 instruction calculates the common logarithm (base 10) from the 32-bit floating-
point number in s and s+1. The result is stored in d and d+1.

s+1 s d+1 d
log 10 ( ) ( )
1) 1)

1 32-bit floating point value (real number)

Only positive values can be specified in s and s+1. Negative values cannot be calculated.
If the value resulted from the operation is –0 or an underflow occurs, the result will be pro-
cessed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified in s is negative. (Error code 4100)
● The value specified in s is 0. (Error code 4100)
● The value of the specified device is not zero and not within the following range:
2–126 < (Value of specified device) < 2128
(Error code 4140)
● The value specified in s is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–2128 < (Operation result) < 2128
(Error code 4141)

7 – 424
Special functions LOG10, LOG10P

Program LOG10
Example
The following program obtains the value for common logarithm of the 32-bit floating-point data
type real number specified by D600 and D601, when M0 is turned on. The result is stored into
D123 and D124.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D601 D600 D124 D123

log 10 2.806 0.448088

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 425


LOG10D, LOG10DP Special functions

7.12.26 LOG10D, LOG10DP

CPU High
Basic Performance Process Redundant Universal LCPU

1) 

1
QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.
QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s —   — — — — 1) —
d —   — — — — — —
1
Available only for real number

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

LOG10D s d

LOG10DP s d

Variables Set Data Meaning Data Type


s Value for the LOG10D instruction or first number of device storing such data
Real number
d First number of device storing the operation result

7 – 426
Special functions LOG10D, LOG10DP

Functions Common logarithm calculation from floating-point values (Double precision)


LOG10D Common logarithm calculation
The LOG10D instruction calculates the common logarithm (base 10) from the 64-bit floating-
point number specified by s. The result is stored in the device specified by d.

s +3 s +2 s +1 s d +3 d +2 d +1 d
log10 ( ) ( )

1) 1)

1 64-bit floating-point value (real number)

Only positive values can be specified in s. Negative values cannot be calculated.


If the value resulted from the operation is –0 or an underflow occurs, the result will be pro-
cessed as 0.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value specified in s is negative. (Error code 4100)
● The value specified in s is 0. (Error code 4100)
● The value of the specified device is not zero and not within the following range:
2–1022 < (Value of specified device) < 21024
(Error code 4140)
● The value of the specified device is –0.
(Error code 4140)
● The result exceeds the following range (overflow occurs):
–21024 < (Operation result) < 21024
(Error code 4141)

Programming MELSEC System Q and L series 7 – 427


LOG10D, LOG10DP Special functions

Program LOG10D
Example
The following program obtains the value for common logarithm of the 64-bit floating-point data
type real number specified by D600 to D603, when M0 is turned on. The result is stored into
D123 to D126.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D603 D602 D601 D600 D126 D125 D124 D123


log 10 2.806 0.448088

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 428
Special functions RND, RNDP, SRND, SRNDP

7.12.27 RND, RNDP, SRND, SRNDP

CPU High
Basic Performance Process Redundant Universal LCPU

1)     

1
Basic model QCPU: The upper five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H, 16#
Bit Word Bit Word U\G
for RND, RNDP
d  — —
for SRND, SRNDP
s   —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


d First number of device storing the randomized value
BIN 16-bit
s Random value series or first number of device storing such data

Programming MELSEC System Q and L series 7 – 429


RND, RNDP, SRND, SRNDP Special functions

Functions Randomizing values and series update


RND Randomizing values
The RND instruction generates a random value ranging from 0 to 32767 and stores it in d.

SRND Updating series of random values


The SRND instruction updates the series of random values stored in s.

Program RND
Example 1
While X10 is set, the following program stores the generated random value in D100.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program SRND
Example 2
While X10 is set, the following program updates the series of random values in D0.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 430
Special functions BSQR, BSQRP, BDSQR, BDSQRP

7.12.28 BSQR, BSQRP, BDSQR, BDSQRP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s   —
d  — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


BCD
s Data for the square root calculation or number of device storing such data
4-/ 8-digit
d First number of device storing the calculation result BCD 4-digit

Programming MELSEC System Q and L series 7 – 431


BSQR, BSQRP, BDSQR, BDSQRP Special functions

Functions Square root calculation from 4-digit or 8-digit BCD data


BSQR Square root calculation from 4-digit BCD data
The BSQR instruction calculates the square root of s and stores the result in d and d+1.

d d+1
s = .
1 2
1
Integer part
2
Decimal places

The data in s must be a BCD value with at maximum 4 digits. The value range from 0 to 9999
must not be exceeded.
The calculation result stored in d and d+1 must not exceed the value range from 0 to 9999.
The result is calculated with a 5-digit accuracy and rounded to a 4-digit value.

BDSQR Square root calculation from 8-digit BCD data


The BDSQR instruction calculates the square root of s and s+1 and stores the result in d and
d+1.

d d+1
s+1 s =
1
2 3 Two-word data
1 2Integer
part
3Decimal places

The data in s and s+1 must be a BCD value with at maximum 8 digits. The value range from 0
to 99999999 must not be exceeded.
The calculation result stored in d and d+1 must not exceed the value range from 0 to 9999.
The result is calculated with a 5-digit accuracy and rounded up to a 4-digit value.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data stored in s (s+1) is no BCD data.
(Error code 4100)

7 – 432
Special functions BSQR, BSQRP, BDSQR, BDSQRP

Program BSQR
Example 1
The following program calculates the square root of the BCD value 1325 and outputs the inte-
ger part of the result as 4-digit BCD value at Y50 through Y5F. The decimal places are output
as 4-digit BCD value at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D0 1 D1 Y5F Y50
1325 H 1 3 2 5 0 0 3 6 0 0 3 5
MOV BCD BCD MOV BCD
BSQR D2 Y4F Y40
4 0 0 5 4 0 0 5
BCD MOV BCD

1 Square root calculation

Programming MELSEC System Q and L series 7 – 433


BSQR, BSQRP, BDSQR, BDSQRP Special functions

Program BDSQR
Example 2
The following program calculates the square root of the BCD value 74625813 and outputs the
integer part of the result as 4-digit BCD value at Y50 through Y5F. The decimal places are out-
put as 4-digit BCD value at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

D1 D0 1 D2 Y5F Y50
74625813
7 4 6 2 5 8 1 3 8 6 3 8 8 6 3 8
BCD
DMOV BCD BCD MOV BCD
BDSQR D3 Y4F Y40
6 2 3 3 6 2 3 3
BCD MOV BCD

1
Square root calculation

NOTE These program examples will not run without variable definition in the header of the program
organization unit (POU). They would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 434
Special functions BSIN, BSINP

7.12.29 BSIN, BSINP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Data of which the BSIN (sine) value is obtained or the number of the device
s 4-digit
storing such data
BCD value
d First number of device storing the calculation result

Programming MELSEC System Q and L series 7 – 435


BSIN, BSINP Special functions

Functions Sine calculation from BCD data


BSIN Sine calculation
The BSIN instruction calculates the sine value from the angle data in s. The sign character of
the result is stored in d. The value of the result is stored in d+1 and d+2.

d d+1 d+2
SIN(s) =
1
1 2 3 Sign bit
2
Integer part
3
Decimal places

The value s must be a BCD value ranging from 0° to 360°.


The sign of the result in d is 0 for a positive value and 1 for a negative value.
The result in d+1 and d+2 may range from -1.000 to 1.000 in BCD format.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s is no BCD data. (Error code 4100)
● The data specified in s exceeds the value range from 0° to 360°. (Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 436
Special functions BSIN, BSINP

Program BSIN
Example
The following program calculates the sine value of the 3-digit BCD value at X20 through X2B.
If the value at X20 through X2B exceeds 360 (degrees), it will be corrected to suit the required
value range of 0° to 360°.
The sign is output at Y60. The integer part is output at Y50 through Y53 as 1-digit BCD value.
The decimal places are output at Y40 through Y4F as 4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

X2B X20 D10


5 9 0 0 0 1 1
BCD B/ BCD
D11 1 D20
0 2 3 0 0 0 0 1 Y60
BCD BSIN BCD OUT
D21 X53 X50
0 0 0 0 0
BCD MOV BCD
D22 X4F X40
7 6 6 0 7 6 6 0
BCD MOV BCD

1
Sine calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 437


BCOS, BCOSP Special functions

7.12.30 BCOS, BCOSP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Data of which the BCOS (cosine) value is obtained or the number of the device
s 4-digit
storing such data
BCD value
d First number of device storing the calculation result

7 – 438
Special functions BCOS, BCOSP

Functions Cosine calculation from BCD data


BCOS Cosine calculation
The BCOS instruction calculates the cosine value from the angle data in s. The sign character
of the result is stored in d. The value of the result is stored in d+1 and d+2.

d d+1 d+2
COS(s) =
1 2 3 1
Sign bit
2
Integer part
3
Decimal places

The value s must be a BCD value ranging from 0° to 360°.


The sign of the result in d is 0 for a positive value and 1 for a negative value.
The result in d+1 and d+2 may range from -1.000 to 1.000 in BCD format.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s is no BCD data.
(Error code 4100)
● The data specified in s exceeds the value range from 0° to 360°.
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 439


BCOS, BCOSP Special functions

Program BCOS
Example
The following program calculates the cosine value of the 3-digit BCD value at X20 through X2B.
If the value at X20 through X2B exceeds 360 (degrees), it will be corrected to suit the required
value range of 0° to 360°.
The sign is output at Y60. The integer part is output at Y50 through Y53 as 1-digit BCD value.
The decimal places are output at Y40 through Y4F as 4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

X2B X20 D10


4 3 0 0 00 1
BCD BCD
B/
D11 1 D20
0 0 7 0 0 0 0 0 Y60
BCD BCD OUT
BCOS
D21 Y53 Y50
0 0 0 0 0
BCD MOV BCD
D22 Y4F Y40
3 4 2 0 3 4 20
BCD MOV BCD

1
Cosine calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 440
Special functions BTAN, BTANP

7.12.31 BTAN, BTANP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Data of which the BTAN (tangent) value is obtained or the number of the device
s 4-digit
storing such data
BCD value
d First number of device storing the calculation result

Programming MELSEC System Q and L series 7 – 441


BTAN, BTANP Special functions

Functions Tangent calculation from BCD data


BTAN Tangent calculation
The BTAN instruction calculates the tangent value from the angle data in s. The sign character
of the result is stored in d. The value of the result is stored in d+1 and d+2.

d d+1 d+2
TAN(s) = .
1 2 1
3 Sign bit
2
Integer part
3
Decimal places

The value s must be a BCD value ranging from 0° to 360°.


The sign of the result in d is 0 for a positive value and 1 for a negative value.
The result in d+1 and d+2 may range from -57.2901 to 57.2902 in BCD format.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s is no BCD data.
(Error code 4100)
● The data specified in s exceeds the value range from 0° to 360°.
(Error code 4100)
● The value in s is 90° or 270°.
(Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 442
Special functions BTAN, BTANP

Program BTAN
Example
The following program calculates the tangent value of the 3-digit BCD value at X20 through
X2B. If the value at X20 through X2B exceeds 360 (degrees), it will be corrected to suit the
required value range of 0° to 360°.
The sign is output at Y60. The integer part is output at Y50 through Y53 as 1-digit BCD value.
The decimal places are output at Y40 through Y4F as 4-digit BCD value.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

X2B X20 D10


3 9 0 0 00 1
BCD BCD
B/
D11 1 D20
0 0 3 0 0 0 0 0 Y60
BCD BCD OUT
BTAN
D21 Y53 Y50
0 0 0 0 0
BCD MOV BCD
D22 Y4F Y40
5 7 7 4 5 7 7 4
BCD MOV BCD

1
Tangent calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 443


BASIN, BASINP Special functions

7.12.32 BASIN, BASINP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s Number of device storing the sine value for the BASIN instruction (arcus sine) 4-digit
d First number of device storing the calculation result BCD value

7 – 444
Special functions BASIN, BASINP

Functions Arcus sine calculation from BCD data


BASIN Arcus sine calculation
The BASIN instruction calculates the angle data from the sine value in s, s+1, and s+2. The
result is stored in d.

-1 s s+1 s+2
SIN = ( . ) =d
1 2 3 1
Sign bit
2
Integer part
3
Decimal places

The sign of the result in s is 0 for a positive value and 1 for a negative value.
The integer part prior to the decimal point and the decimal places must be BCD values ranging
from 0 to 1.0000.
The value or the result in d must be a BCD value ranging from 0° to 90° or from 270° to 360°.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s through s+2 is no BCD data.
(Error code 4100)
● The data specified in s through s+2 exceeds the value range from -1.0000 to 1.0000.
(Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU.)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 445


BASIN, BASINP Special functions

Program BASIN
Example
The following program calculates the arcus sine value from the sign bit at X0 (positive when X0
is OFF, and negative when X0 is ON), the 1-digit BCD integer part at X30 through X33, and the
decimal places of the 4-digit BCD value at X20 through X2F. The resulting angle value is output
in 4-digit BCD format at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

X0 0 0 0 0
BCD
X33 X30 1 Y4F Y40
0 0 0 0 0 0 0 2 8
MOV BCD BASIN BCD
X2F X20
4 75 3 4 7 5 3
BCD MOV BCD

1
Arcus sine calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 446
Special functions BACOS, BACOSP

7.12.33 BACOS, BACOSP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H, (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Number of device storing the cosine value for the BACOS instruction (arcus
s 4-digit
cosine)
BCD value
d First number of device storing the calculation result

Programming MELSEC System Q and L series 7 – 447


BACOS, BACOSP Special functions

Functions Arcus cosine calculation from BCD data


BACOS Arcus cosine calculation
The BACOS instruction calculates the angle data from the cosine value in s, s+1, and s+2. The
result is stored in d.

s s+1 s+2
-1
COS = ( . ) =d
1 2 3 1
Sign bit
2
Integer part
3
Decimal places

The sign of the result in s is 0 for a positive value and 1 for a negative value.
The integer part prior to the decimal point and the decimal places must be BCD values ranging
from 0 to 1.0000.
The value or the result in d must be a BCD value ranging from 0° to 180.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s through s+2 is no BCD data.
(Error code 4100)
● The data specified in s through s+2 exceeds the value range from -1.000 to 1.000.
(Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 448
Special functions BACOS, BACOSP

Program BACOS
Example
The following program calculates the arcus cosine value from the sign bit at X0 (positive when
X0 is OFF and negative when X0 is ON), the 1-digit BCD integer part at X30 through X33, and
the decimal places of the 4-digit BCD value at X20 through X2F. The resulting angle value is
output in 4-digit BCD format at Y40 through Y4F.

MELSEC Instruction List


Ladder Diagram

IEC Instruction List

X2B X20 D10


4 3 0 0 00 1
BCD B/ BCD
D11 1 D20
0 0 7 0 0 0 0 0 Y60
BCD BACOS BCD OUT
D21 Y53 Y50
0 0 0 0 0
BCD MOV BCD
D22 Y4F Y40
3 4 2 0 3 4 20
BCD MOV BCD

1 Arcus cosine calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 449


BATAN, BATANP Special functions

7.12.34 BATAN, BATANP

CPU High
Basic Performance Process Redundant Universal LCPU

    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s —   — — — — — —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Number of device storing the tangent value for the BATAN instruction
s 4-digit
(arcus tangent)
BCD value
d First number of device storing the calculation result

7 – 450
Special functions BATAN, BATANP

Functions Arcus tangent calculation from BCD data


BATAN Arcus tangent calculation
The BATAN calculates the angle data from the tangent value in s, s+1, and s+2. The result is
stored in d.

-1 s s+1 s+2
TAN = ( . ) =d
1 2 3 1
Sign bit
2
Integer part
3
Decimal places

The sign bit of the result in s is 0 for a positive value and 1 for a negative value.
The integer part prior to the decimal point and the decimal places must be BCD values ranging
from 0 to 9999.9999.
The value of the result in d must be a BCD value ranging from 0° to 90° or 270° or from 270°
and 360°.
The calculation result will be rounded from the 5th digit on.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data specified in s through s+2 is no BCD data. (Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 451


BATAN, BATANP Special functions

Program BATAN
Example
The following program calculates the arcus tangent value from the sign bit at X0 (positive when
X0 is OFF and negative when X0 is ON), the 4-digit BCD integer part at X20 through X2F, and
the decimal places of the 4-digit BCD value at X30 through X3F.
The resulting angle value is output in 4-digit BCD format at Y40 through Y4F.

MELSEC Instruction List Ladder Diagram IEC Instruction List

D0
X0 0 0 00
BCD
X2F X20 D1 Y4F Y40
0 0 0 1 0 0 0 1 0 0 5 2
BCD MOV BCD BATAN BCD
X3F X30 D2
2 6 54 26 5 4
BCD MOV BCD

1
Arcus tangent calculation

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 452
Data control instructions

7.13 Data control instructions


The data control instructions include input and output devices. The 16-bit and 32-bit data of the
input devices are output to the output devices via parameters controlling the upper and lower
limits, the dead band, the zone or after execution of a scaling operation.

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
LIMIT LIMIT_MD

Upper and lower limit controls for LIMITP LIMIT_P_MD


BIN 16-/32-bit data DLIMIT DLIMIT_MD
DLIMITP DLIMIT_P_MD
BAND BAND_MD

Dead band controls for BANDP BAND_P_MD


BIN 16-/32-bit data DBAND DBAND_MD
DBANDP DBAND_P_MD
ZONE ZONE_MD

Zone control for ZONEP ZONE_P_MD


BIN 16-/32-bit data DZONE DZONE_MD
DZONEP DZONE_P_MD
SCL

Scaling SCLP
(Point-by point coordinate data) DSCL
DSCLP
SCL2

Scaling SCL2P
(X or Y coordinate data) DSCL2
DSCL2P

NOTE Within the IEC editors please use the IEC instructions.

Programming MELSEC System Q and L series 7 – 453


LIMIT, LIMITP, DLIMIT, DLIMITP Data control instructions

7.13.1 LIMIT, LIMITP, DLIMIT, DLIMITP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1         —
s2         —
s3         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s1 Lower limit value (minimum output threshold value)
s2 Upper limit value (maximum output threshold value)
BIN 16/32-bit
s3 Input value to be limited
d First number of device storing limited output value

7 – 454
Data control instructions LIMIT, LIMITP, DLIMIT, DLIMITP

Functions Limitation of output values for BIN 16-bit and BIN 32-bit data
LIMIT Limitation instruction for BIN 16-bit data
The LIMIT instruction controls whether data in the device specified by s3 ranges within the
lower limits specified by s1 and the upper limits specified by s2. Depending on the control oper-
ation result the values are stored as follows in the device specified by d:
● If the data value in s3 is less than the lower limit value in s1, the lower limit value is stored in d.
● If the data value in s3 is greater than the upper limit value in s2, the upper limit value is
stored in d.
● If the data value in s3 ranges within the lower and the upper limit value, the data value is
stored in d.

1 3

2 4
6

1 Output value
2
Input value
3
Output value (d)
4 Input value (s3)

5 Upper limit value (s2)

6
Lower limit value (s1)

The values specified by s1, s2, and s3 have to range within -32768 and 32767.
If only the upper limit value is to be checked, the lower limit value in s1 has to be set to -32768.
If only the lower limit value is to be checked, the upper limit value in s2 has to be set to 32767.

Programming MELSEC System Q and L series 7 – 455


LIMIT, LIMITP, DLIMIT, DLIMITP Data control instructions

DLIMIT Limitation instruction for BIN 32-bit data


The DLIMIT instruction controls whether data in the devices specified by s3 and (s3)+1 range
within the lower limits specified by s1 and (s1)+1 and the upper limits specified by s2 and
(s2)+1. Depending on the control operation result the values are stored as follows in the device
specified by d and d+1:
● If the data value in s3 and (s3)+1 is less than the lower limit value in s1and (s1)+1, the lower
limit value is stored in d and d+1.
● If the data value in s3 and (s3)+1 is greater than the upper limit value in s2 and (s2)+1, the
upper limit value is stored in d and d+1.
● If the data value in s3 and (s3)+1 ranges within the lower and the upper limit value, the data
value is stored in d and d+1.

1 3

2 4
6

1
Output value
2
Input value
3
Output value (d+1, d)
4 Input value ((s3)+1, s3)

5
Upper limit value ((s2)+1, s2)
6
Lower limit value ((s1)+1, s1)

The values specified by s1 and (s1)+1, s2 and (s2)+1, and s3 and (s3)+1 have to range within
-2147483648 and 2147483647.
If only the upper limit value is to be checked, the lower limit value in s1 and (s1)+1 has to be
set to -2147483648.
If only the lower limit value is to be checked, the upper limit value in s2 and (s2)+1 has to be
set to 2147483647.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in s1 ((s1)+1) is greater than that in s2 ((s2)+1).
(Error code 4100)

7 – 456
Data control instructions LIMIT, LIMITP, DLIMIT, DLIMITP

Program LIMITP
Example 1
With leading edge from X0, the following program controls whether BCD data at X20 through
X2F ranges between the lower limit of 500 and the upper limit of 5000. The result of the control
operation is stored in D1.
– If the value in D0 is greater than 5000, the value 5000 is stored in D1.
– If the value in D0 is less than 500, the value 500 is stored in D1.
– If the value ranges within 500 and 5000, the data value is stored in D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program DLIMIT
Example 2
With leading edge from X0, the following program controls whether BCD data at X20 through
X3F ranges within the lower limit of 10000 and the upper limit of 1000000. The result of the
control operation is stored in D10 and D11.
– If the value in D0 and D1 is greater than 1000000, the value 1000000 is stored in D10 and
D11.
– If the value in D0 and D1 is less than 10000, the value 10000 is stored in D10 and D11.
– If the value ranges within 10000 and 1000000, the data value is stored in D10 and D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 457


BAND, BANDP, DBAND, DBANDP Data control instructions

7.13.2 BAND, BANDP, DBAND, DBANDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1         —
s2         —
s3         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s1 Lower limit value of dead band (output value = 0)
s2 Upper limit value of dead band (output value = 0)
BIN 16/32-bit
s3 Input value to be controlled via dead band control
d First number of device storing subtraction result of input value minus limit value

7 – 458
Data control instructions BAND, BANDP, DBAND, DBANDP

Functions BIN 16-bit and 32-bit dead band control


BAND Dead band control of BIN 16-bit data
The BAND instruction subtracts a lower and an upper limit value from a BIN 16-bit value in a
device specified by s3. The lower limit value is specified by s1; the upper limit value is specified
by s2. The result is stored depending on the input value in the device specified by d as follows:
● If the data value in s3 is less than the lower limit value in s1, the result of the subtraction s3-
s1 is stored in the device specified by d.
● If the data value in s3 is greater than the upper limit value in s2, the result of the subtraction
s3-s2 is stored in the device specified by d.
● If the data value in s3 ranges within the limit values, the value 0 is stored in the device
specified by d.

1 3

2 4
7
6

1 Output value
2
Input value
3
Output value (d)
4 Input value (s3)

5 Lower limit value (s1)

6
Output value = 0
7 Upper limit value (s2)

The values in s1, s2, and s3 have to range within -32768 and 32767.
If the subtraction result leaves the relevant device range of -32768 and 32767 the output value
is controlled as follows:
● If the value -32768 is fallen below, the remaining subtraction is proceeded beginning from
32767. For example, if s3 stores the value -32768 and the value 10 in s1 is subtracted, the
result is
-32768 - 10 = 8000H - AH = 7FF6H = 32758.
● If the value 32767 is exceeded, the remaining subtraction is proceeded beginning from
-32768.

Programming MELSEC System Q and L series 7 – 459


BAND, BANDP, DBAND, DBANDP Data control instructions

DBAND Dead band control of BIN 32-bit data


The DBAND instruction subtracts a lower and an upper limit value from a BIN 32-bit value in a
device specified by s3 and (s3)+1. The lower limit value is specified by s1 and (s1)+1; the upper
limit value is specified by s2 and (s2)+1. The result is stored depending on the input value in
the device specified by d and d+1 as follows:
● If the data value in s3 and (s3)+1 is less than the lower limit value in s1 and (s1)+1, the result
of the subtraction s3, (s3)+1 - s1, (s1)+1 is stored in the device specified by d and d+1.
● If the data value in s3 and (s3)+1 is greater than the upper limit value in s2 and (s2)+1, the
result of the subtraction s3, (s3)+1 - s2, (s2)+1 is stored in the device specified by d and d+1.
● If the data value in s3 and (s3)+1 ranges within the limit values, the value 0 is stored in the
device specified by d and d+1.

1
Output value
2
Input value
3
Output value (d+1, d)
4 Input value ((s3)+1, s3)

5
Lower limit value ((s1)+1, s1)
6
Output value = 0
7 Upper limit value ((s2)+1, s2)

The values in s1 and (s1)+1, s2 and (s2)+1, and s3 and (s3)+1 have to range within
-2147483648 and 2147483647.
If the subtraction result leaves the relevant device range of -2147483648 and 2147483647 the
output value is controlled as follows:
● If the value -2147483648 is fallen below, the remaining subtraction is proceeded beginning
from 2147483647. For example, if s3 and (s3)+1 store the value -2147483648 and the value
1000 in s1 is subtracted, the result is
-2147483648 - 1000 = 80000000H - 3E8H = 7FFFFC18H = 2147482648.
● If the value 2147483647 is exceeded, the remaining subtraction is proceeded beginning
from -2147483648.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The value in s1 ((s1)+1) is greater than that in s2 ((s2)+1).
(Error code 4100)

7 – 460
Data control instructions BAND, BANDP, DBAND, DBANDP

Program BANDP
Example 1
With leading edge from X0, the following program subtracts the lower limit value -1000 and the
upper limit value 1000 from the BCD data at X20 through X2F. The result is stored in D1.
– If the value in D0 is greater than 1000, the value D0 - 1000 is stored in D1.
– If the value in D0 is less than -1000, the value D0 - (-1000) is stored in D1.
– If the value in D0 ranges within -1000 and 1000, the value 0 is stored in D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program DBANDP
Example 2
With leading edge from X0, the following program subtracts the lower limit value -10000 and
the upper limit value 10000 from the BCD data at X20 through X3F. The result is stored in D10
and D11.
– If the value in D0 and D1 is greater than 10000, the value D0, D1 - 1000 is stored in D10
and D11.
– If the value in D0 and D1 is less than -10000, the value D0, D1 - (-10000) is stored in D10
and D11.
– If the value in D0 and D1 ranges within -10000 and 1000, the value 0 is stored in D10 and
D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 461


ZONE, ZONEP, DZONE, DZONEP Data control instructions

7.13.3 ZONE, ZONEP, DZONE, DZONEP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1         —
s2         —
s3         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s1 Negative zone control value to be added to the input value
s2 Positive zone control value to be added to the input value
BIN 16/32-Bit
s3 Input value to be controlled via zone control
d First number of device storing total of input value and zone control value

7 – 462
Data control instructions ZONE, ZONEP, DZONE, DZONEP

Functions BIN 16-bit and 32-bit zone control


ZONE Zone control of BIN 16-bit data
The ZONE instruction adds a negative and a positive control value to a BIN 16-bit value in a
device specified by s3. The negative control value is stored in s1; the positive control value is
stored in s2. The result is stored depending on the input value in the device specified by d as
follows:
● If the data value in s3 is less than 0, the result of the addition s3 + s1 is stored in the device
specified by d.
● If the data value in s3 is greater than 0, the result of the addition s3 + s2 is stored in the
device specified by d.
● If the data value in s3 is equal to 0, the value 0 is stored in the device specified by d.

1
Output value
2
Input value
3 Output value (d)

4 Input value (s3)

5
Upper (positive) zone control value (s2)
6 Input value = 0

7 Lower (negative) zone control value (s1)

The values in s1, s2, and s3 have to range within -32768 and 32767.
If the addition result leaves the relevant device range of -32768 and 32767, the output value is
controlled as follows:
● If the value -32768 is fallen below, the remaining addition is proceeded beginning from
32767. For example, if s3 stores the value -32768 and the value -100 in s1 is added, the
result is
-32768 + (-100) = 8000H + FF9CH = 7F9CH = 32668.
● If the value 32767 is exceeded, the remaining addition is proceeded beginning from -32768.

Programming MELSEC System Q and L series 7 – 463


ZONE, ZONEP, DZONE, DZONEP Data control instructions

DZONE Zone control of BIN 32-bit data


The DZONE instruction adds a negative and a positive control value to a BIN 32-bit value in a
device specified by s3 and (s3)+1. The negative control value is stored in s1 and (s1)+1; the
positive control value is stored in s2 and (s2)+1. The result is stored depending on the input
value in the device specified by d and d+1 as follows:
● If the data value in s3 and (s3)+1 is less than 0, the result of the addition s3, (s3)+1 + s1,
(s1)+1 is stored in the device specified by d and d+1.
● If the data value in s3 and (s3)+1 is greater than 0, the result of the addition s3, (s3)+1 +
s2, (s2)+1 is stored in the device specified by d+1.
● If the data value in s3 and (s3)+1 is equal to 0, the value 0 is stored in the device specified
by d and d+1.

1
Output value
2
Input value
3
Output value (d+1, d)
4 Input value ((s3)+1, s3)

5
Upper (positive) zone control value ((s2)+1, s2)
6
Input value = 0
7 Lower (negative) zone control value ((s1)+1, s1)

The values in s1 and (s1)+1, s2 and (s2)+1, and s3 and (s3)+1 have to range within
-2147483648 and 2147483647.
If the addition result leaves the relevant device range of -2147483648 and 2147483647 the out-
put value is controlled as follows:
● If the value -2147483648 is fallen below, the remaining addition is proceeded beginning from
2147483647. For example, if s3 and (s3)+1 store the value -2147483648 and the value -1000
in s1 is added, the result is
-2147483648 + (-1000) = 80000000H + FFFFFC18H = 7FFFFC18H = 2147482648.
● If the value 2147483647 is exceeded, the remaining addition is proceeded beginning from
-2147483648.

7 – 464
Data control instructions ZONE, ZONEP, DZONE, DZONEP

Program ZONEP
Example 1
With leading edge from X0, the following program adds the negative zone control value -100
and the positive zone control value 100 to BCD data at X20 through X2F. The result is stored
in D1.
– If the value in D0 is greater than 0, the value D0 + 100 is stored in D1.
– If the value in D0 is less than 0, the value D0 + (-100) is stored in D1.
– If the value D0 is equal to 0, the value 0 is stored in D1.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program DZONEP
Example 2
With leading edge from X0, the following program adds the negative zone control value -10000
and the positive zone control value 10000 to BCD data at X20 through X3F. The result is stored
in D10 and D11.
– If the value in D0 and D1 is greater than 0, the value D0, D1 + 10000 is stored in D10 and D11.
– If the value in D0 and D1 is less than 0, the value D0, D1 + (-10000) is stored in D10 and D11.
– If the value D0 and D1 is equal to 0, the value 0 is stored in D10 and D11.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 465


SCL, SCLP, DSCL, DSCLP Data control instructions

7.13.4 SCL, SCLP, DSCL, DSCLP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s1 —        —
s2 —   — — — — — —
d —       — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

SCL s1 s2 d

Variables Set Data Meaning Data Type


Input values for scaling or first number of the device where input values are
s1
stored
s2 First number of the devices where scaling conversion data are stored BIN 16/32-Bit
First number of of the devices where output values depending on scaling are
d
stored

7 – 466
Data control instructions SCL, SCLP, DSCL, DSCLP

Functions Scaling (Point-by-point coordinate data)


SCL Scaling of BIN 16-bit data
This instruction executes scaling for the scaling conversion data (16-bit data units) specified by
s2 with the input value specified by s1, and then stores the operation result into the devices
specified by d.
The scaling conversion is executed based on the scaling conversion data stored in the device
specified by s2 and up (see following table).
Setting Item Device Assignment
Number of coordinate points s2
X coordinate (s2)+1
Point 1
Y coordinate (s2)+2
X coordinate (s2)+3
Point 2
Y coordinate (s2)+4
...
X coordinate (s2)+(2n–1)
Point n 1)
Y coordinate (s2)+2n
1
n indicates the number of coordinates specified by s2.

3)
4)
1) d
5)

6)
2)

X
7) s1

8) 9) 8)

1
Output value (d)
2
Point 1
3
Point 2
4
Point 3
5
Point n–1
6
Point n
7
Input value (s1)
8
Operation error
9
Operable range

If the value does not result in an integer, this instruction rounds the value to the whole number.
Set the X coordinate of the scaling conversion data in ascending order.
Set the input value s1 within the range of the scaling conversion data (within the range of s2
devices).
If some specified points have same X coordinates, the Y coordinate data of the highest point
number will be output.
Specify the number of coordinate points of scaling conversion data from 1 to 32767.

Programming MELSEC System Q and L series 7 – 467


SCL, SCLP, DSCL, DSCLP Data control instructions

DSCL Scaling of BIN 32-bit data


This instruction executes scaling for the scaling conversion data (32-bit data units) specified by
s2 with the input value specified by s1, and then stores the operation result into the devices
specified by d.
The scaling conversion is executed based on the scaling conversion data stored in the device
specified by s2 and up (see following table).

Setting Item Device Assignment


Number of coordinate points (s2)+1, (s2)
X coordinate (s2)+3, (s2)+2
Point 1
Y coordinate (s2)+5, (s2)+4
X coordinate (s2)+7, (s2)+6
Point 2
Y coordinate (s2)+9, (s2)+8
...
X coordinate (s2)+(4n–1), (s2)+(4n–2)
Point n 1)
Y coordinate (s2)+(4n+1), (s2)+4n

1 n indicates the number of coordinates specified by s2.

7) 8) 7)

6) s1
X

4)

1) d 5)

2)
3)

1 Output value (d)


2
Point 1
3
Point 2
4 Point n–1

5
Point n
6
Input value (s1)
7 Operation error

8 Operable range

If the value does not result in an integer, this instruction rounds the value to the whole number.
Set the X coordinate of the scaling conversion data in ascending order.
Set the input value s1 within the range of the scaling conversion data (within the range of s2
and ((s2)+1) devices).
If some specified points have same X coordinates, the Y coordinate data of the highest point
number will be output.
Specify the number of coordinate points of scaling conversion data from 1 to 32767.

7 – 468
Data control instructions SCL, SCLP, DSCL, DSCLP

NOTE There are two searching methods that depend on whether SM750 is on or off.

SM750 Searching method Range of number of searches


OFF (0) Sequential search 1 <= Number of times <= 32767
ON (1) Binary search 1 <= Number of times <= 15

When the scaling conversion data are set in ascending order, the searching methods change
from one to the other depending on the SM750 status. Therefore, the processing speed also
changes. The number of searches determines the processing speed. Fewer number of serches
make the processing run faster.
 If the data processing speed with the sequential search rises:
If the number of coordinates is highest and the input value s1 is within the coordinate range
from 1 to 15 point, the number of sequential searches will be 15 or smaller. Therefore, the
data processing speed with the sequential search will rise.
 If the data processing speed with the binary search rises:
If the maximum number of searches is 15 and the input value s1 is out of the coordinate ran-
ge, 16 or over, the number of binary searches will be equal to the number of sequential num-
bers or smaller. Therefore, the data processing speed with the binary search will rise.

Number of sequential searches=32767


Number of binary searches=15
Number of coordinate points: The processing speed with binary search rises
32767 since the number of binary searches is smaller
than the number of sequential searches.

s1 s1
Number of sequential searches=1
Number of binary searches=15
The processing speed with sequential searches rises
since the number of binary searches is larger than the
number of sequential searches.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The X coordinates of the scaling conversion data positioned before the point specified by
s1 are not set in ascending order. (However, this error is not detected when SM750 is on.)
(Error code 4100)
● The input value specified by s1 is out of the range of the scaling conversion data set.
(Error code 4100)
● The number of X and Y coordinates of the device specified by s2 is out of the range from 1
to 32767.
(Error code 4100)

Programming MELSEC System Q and L series 7 – 469


SCL, SCLP, DSCL, DSCLP Data control instructions

Program SCLP
Example
The following program executes scaling for the scaling conversion data of which the devices
specified at D100 and up are set with the input value specified at D0. The result is stored in
D20.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

Setting
Setting Item Device
Contents
Number of coordinate points D100 K5
Y
X coordinate D101 K5 Point 5
Point 1
Y coordinate D102 K13 (25, 22)

Point 2
X coordinate D103 K10
Point 2 Point 1 (10, 15) Point 3
Y coordinate D104 K15 (5, 13) (17, 13)

D20=11
X coordinate D105 K17 Output
Point 3 value
Y coordinate D106 K13 (20, 8)
Point 4
X coordinate D107 K20
Point 4
Y coordinate D108 K8 X
D0=18
X coordinate D109 K25 Input value
Point 5
Y coordinate D110 K22

7 – 470
Data control instructions SCL2, SCL2P, DSCL2, DSCL2P

7.13.5 SCL2, SCL2P, DSCL2, DSCL2P

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s1 —        —
s2 —   — — — — — —
d —       — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
instruction symbol SCL2/DSCL2

s1 s2 d

P s1 s2 d

Variables Set Data Meaning Data Type


Input values for scaling or first number of the device where input values are
s1
stored
s2 First number of the devices where scaling conversion data are stored BIN 16/32-bit
First number of of the devices where output values depending on scaling are
d
stored

Programming MELSEC System Q and L series 7 – 471


SCL2, SCL2P, DSCL2, DSCL2P Data control instructions

Functions Scaling (Point-by-point coordinate data)


SCL2 Scaling of BIN 16-bit data
This instruction executes scaling for the scaling conversion data (16-bit data units) specified by
s2 with the input value specified by s1, and then stores the operation result into the devices
specified by d.
The scaling conversion is executed based on the scaling conversion data stored in the device
specified by s2 and up (see following table).
Setting Item Device Assignment
Number of coordinate points s2
Point 1 (s2)+1
Point 2 (s2)+2
X coordinate
... ...
1) (s2)+n
Point n
Point 1 (s2)+(n+1)
Point 2 (s2)+(n+2)
Y coordinate
... ...

Point n 1) (s2)+2n
1
n indicates the number of coordinates specified by s2.

3)
4)
1) d
5)

6)
2)

X
7) s1

8) 9) 8)

1
Output value (d)
2 Point 1
3
Point 2
4
Point 3
5 Point n–1

6
Point n
7
Input value (s1)
8 Operation error

9
Operable range

If the value does not result in an integer, this instruction rounds the value to the whole number.
Set the X coordinate of the scaling conversion data in ascending order.
Set the input value s1 within the range of the scaling conversion data (within the range of s2
devices).
If some specified points have same X coordinates, the Y coordinate data of the highest point
number will be output.
Specify the number of coordinate points of scaling conversion data from 1 to 32767.

7 – 472
Data control instructions SCL2, SCL2P, DSCL2, DSCL2P

DSCL2 Scaling of BIN 32-bit data


This instruction executes scaling for the scaling conversion data (32-bit data units) specified by
s2 with the input value specified by s1, and then stores the operation result into the devices
specified by d.
The scaling conversion is executed based on the scaling conversion data stored in the device
specified by s2 and up (see following table).
Setting Item Device Assignment
Number of coordinate points (s2)+1, (s2)
Point 1 (s2)+3, (s2)+2
Point 2 (s2)+5, (s2)+4
X coordinate
... ...
1) (s2)+(2n+1), (s2)+(2n)
Point n
Point 1 (s2)+(2n+3), (s2)+(2n+2)
Point 2 (s2)+(2n+5), (s2)+(2n+4)
Y coordinate
... ...

Point n 1) (s2)+(4n+1), (s2)+4n


1
n indicates the number of coordinates specified by s2

7) 8) 7)

6) s1
X

4)

1) d 5)

2)
3)

1
Output value (d)
2 Point 1
3
Point 2
4
Point n–1
5 Point n

6
Input value (s1)
7
Operation error
8 Operable range

If the value does not result in an integer, this instruction rounds the value to the whole number.
Set the X coordinate of the scaling conversion data in ascending order.
Set the input value s1 within the range of the scaling conversion data (within the range of s2
and ((s2)+1) devices).
If some specified points have same X coordinates, the Y coordinate data of the highest point
number will be output.
Specify the number of coordinate points of scaling conversion data from 1 to 32767.

Programming MELSEC System Q and L series 7 – 473


SCL2, SCL2P, DSCL2, DSCL2P Data control instructions

NOTE When the scaling conversion data are set in ascending order, the searching methods change
from one to the other depending on the SM750 status. Therefore, the processing speed also
changes. The number of searches determines the processing speed. Fewer number of serches
make the processing run faster.
For details refer to section 7.13.4.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The X coordinates are not set in ascending order.
(Error code 4100)
● The input value specified by s1 is out of the range of the scaling conversion data set.
(Error code 4100)
● The number of X and Y coordinates of the device specified by s2 is out of the range from 1
to 32767.
(Error code 4100)

Program SCL2P
Example
The following program executes scaling for the scaling conversion data of which the devices
specified at D100 and up are set with the input value specified at D0. The result is stored in
D20.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Setting
Setting Item Device Contents
Number of coordinate points D110 K5
Y
Point 1 D111 K7
X coordinate

Point 2 D112 K13 D0=11


Input value
Point 3 D113 K15 X
Point 2
Point 4 D114 K18 (13, -7) Point 4
(18, -11)
Point 5 D115 K20 Point 3
D200=-9
(15, -9) Point 5
Point 1 D116 K-14 Output
value (20, -13)
Y coordinate

Point 1
Point 2 D117 K-7 (7, -14)

Point 3 D118 K-15


Point 4 D119 K-11
Point 5 D120 K-18

7 – 474
File register switching instructions

7.14 File register switching instructions

The switching instructions enable switching between file register blocks and between file
names in file registers.
The table below gives an overview of the instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
RSET_MD
RSET
RSET_K_MD
Setting file register blocks
RSET_P_MD
RSETP
RSET_K_P_MD
QDRSET QDRSET_M
Setting file register files
QDRSETP QDRSET_P_MD
QCDSET QCDSET_M
Setting comment files
QCDSET QCDSET_P_MD

Programming MELSEC System Q and L series 7 – 475


RSET, RSETP File register switching instructions

7.14.1 RSET, RSETP

CPU High
Basic Process Redundant Universal LCPU
Performance
    1) 

1 Universal model QCPU: Other than Q00UJCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


s Number of file register block or first number of device storing this number BIN 16-bit

7 – 476
File register switching instructions RSET, RSETP

Functions Setting file register blocks


RSET Switch instruction for file register blocks
The RSET instruction switches from a file register block being in use by a program to a file reg-
ister block with the number specified by s. After switching over, the sequence program
exclusively accesses file registers (R0–R32767) in the specified block.

3
2

R0 4 R0 5 R0 6

R32767 R32767 R32767

1 Processing with file register access


2
File used by program
3
Number of file register block (s)
4 Block 0

5 Block 1

6
Block n

NOTE When a file register (R) is refreshed and the block No. of the file register is switched with the
RSET instruction, follow restrictions. For restrictions on file registers, refer to section 3.13.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The block number specified by s does not exist.
(Error code 4100)
● There are no file registers in the block specified by s.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 477


RSET, RSETP File register switching instructions

Program RSETP
Example
The following program compares the file register R0 in register block 0 to the file register R0 in
register block 1. The file register blocks 0 and 1 are addressed via the RSET instruction. Both
file registers R0 are read via the MOV instruction.
If the value in R0 (block 0) is equal to the value in R0 (block 1), the output Y40 is set.
If the value in R0 (block 0) is less than the value in R0 (block 1), the output Y41 is set.
If the value in R0 (block 0) is greater than the value in R0 (block 1), the output Y42 is set.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Block 0
2 Block 1
3 Y41 is set because D0 is less than D1.

7 – 478
File register switching instructions QDRSET, QDRSETP

7.14.2 QDRSET, QDRSETP

CPU High
Basic Process Redundant Universal LCPU
Performance
   1)

1 Universal model QCPU: Other than Q00UJCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn $
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Drive number and file name of file register file to be switched to or first number of
s Character string
device storing such data

Programming MELSEC System Q and L series 7 – 479


QDRSET, QDRSETP File register switching instructions

Functions Setting file register files


QDRSET Switch instruction for file register files
The QDRSET instruction switches from a file register file being in use by a program to a file
register file specified by s. After switching over, the sequence program exclusively accesses
file registers (R0–R32767) in block 0 of the specified file register file. The file register blocks
are selected via the RSET instruction.

1
Processing with file register access
2
Setting the drive and file(s)
3
Drive 1, file A
4
Drive 1, file B
5 Drive 1, file C

6
Drive 2, file A
7
Drive 3, file A
8 Drive 4, file A

In total, 4 drives can be assigned (1–4). The drive number 0 cannot be assigned; this range is
reserved for internal memory. Note that available drives vary depending on the CPU module
used. Refer to the manual of the CPU module and check the drives that can be specified.
The extension .QDR is not needed to be entered for file specification.
A file name setting can be cleared by specifying the NULL character (00H) for the file name.
File register files selected by the QDRSET instruction are given priority even if a drive number
and file name were specified by the parameters.

NOTES If the file name is changed with the QDRSET instruction, the file name returns to the name spe-
cified by the parameter when the CPU module is switched from STOP to RUN. To maintain the
file name even after the CPU mode is changed from STOP to RUN, execute the QDRSET in-
struction with the SM402 special relay, which turns ON during one scan when the CPU enters
from STOP to RUN mode.
For refreshing a file register, do not change the file name of the file register with the QDRSET
instruction. For restrictions on file registers, refer to section 3.13.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The file register file does not exist on the drive specified by s.
(Error code 2410)

7 – 480
File register switching instructions QDRSET, QDRSETP

Program QDRSET/QDRSETP
Example
With leading edge from X0, the following program switches to the file register file ABC.QDR on
drive 1. While X1 is set, the file register file DEF.QDR on drive 3 is accessed.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 481


QCDSET, QCDSETP File register switching instructions

7.14.3 QCDSET, QCDSETP

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Drive number and file name of comment file to be switched to or first number of
s Character string
device storing such data

7 – 482
File register switching instructions QCDSET, QCDSETP

Functions Setting comment files


QCDSET Switch instruction for comment files
The QCDSET instruction switches from a comment file being in use by a program to a com-
ment file specified by s. After switching over, the sequence program exclusively accesses com-
ment data of the specified comment file.

1
Processing with comment data access
2
Setting the drive and comment file (s)
3 Drive 1, file A

4
Drive 1, file B
5 Drive 1, file C

6 Drive 2, file A

7
Drive 3, file A
8 Drive 4, file A

In total, 4 drives can be assigned (1–4). The drive number 0 cannot be assigned; this range is
reserved for internal memory. Note that available drives vary depending on the CPU module
used. Refer to the manual of the CPU module and check the drives that can be specified.
The extension .QCD is not needed to be entered for file specification.
A file name setting can be cleared by specifying the NULL character (00H) for the file name.
Comment files selected by the QCDSET instruction are given priority even if a drive number
and file name were specified by the parameters.

NOTE If the file name is changed with the QCDSET instruction, the file name returns to the name spe-
cified by the parameter when the CPU module is switched from STOP to RUN.
To maintain the file name even after the CPU mode is changed from STOP to RUN, execute the
QCDSET instruction with the SM402 special relay, which turns ON during one scan when the
CPU enters from STOP to RUN mode.

Programming MELSEC System Q and L series 7 – 483


QCDSET, QCDSETP File register switching instructions

NOTES This instruction will not be executed even when the execution command of this instruction is ON
while SM721 (file access in execution) is ON for the Universal model QCPU and LCPU.
Execute this instruction when SM721 is OFF.
For the LCPU, when drive 2 (SD memory card) is specified as the drive number, this instruction
cannot be executed while SM606 (SD memory card forced disable instruction) is ON. Even if the
instruction is attempted to be executed, the command will be ignored.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The comment file does not exist on the drive specified by s.
(Error code 2410)

Program QCDSET/QCDSETP
Example
With leading edge from X0, the following program switches to the comment file ABC.QCD on
drive 1. While X1 is set, the comment file DEF.QCD on drive 3 is accessed.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 484
Clock instructions

7.15 Clock instructions


The clock instructions read and write, add and subtract, change and compare the data format
of clock data of the internal CPU clock.
The table below gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
DATERD DATERD_MD
Reading clock data
DATERDP DATERD_P_MD
DATEWR DATEWR_MD
Writing clock data
DATEWRP DATEWR_P_MD
DATE+ DATEPLUS_M
Adding clock data
DATE+P DATEPLUSP_M
DATE- DATEMINUS_M
Subtracting clock data
DATE-P DATEMINUSP_M

Changing clock data format from SECOND SECOND_M


hh:mm:ss to seconds SECONDP SECONDP_M

Changing clock data format from HOUR HOUR_M


seconds to hh:mm:ss HOURP HOURP_M
LDDT=
ANDDT=
ORDT=
LDDT<>
ANDDT<>
ORDT<>
LDDT>
ANDDT>
ORDT>
Date comparison
LDDT<=
ANDDT<=
ORDT<=
LDDT<
ANDDT<
ORDT<
LDDT>=
ANDDT>=
ORDT>=

PProgramming MELSEC System Q and L series 7 – 485


Clock instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
LDTM=
ANDTM=
ORTM=
LDTM<>
ANDTM<>
ORTM<>
LDTM>
ANDTM>
ORTM>
Clock comparison
LDTM<=
ANDTM<=
ORTM<=
LDTM<
ANDTM<
ORTM<
LDTM>=
ANDTM>=
ORTM>=

NOTE The expansion clock instructions described in section 7.16 can process the milliseconds of the
internal CPU clock as well.

7 – 486
Clock instructions DATERD, DATERDP

7.15.1 DATERD, DATERDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
Array [0..6] of
d First number of device storing clock data being read BIN 16-bit
ANY16

Programming MELSEC System Q and L series 7 – 487


DATERD, DATERDP Clock instructions

Functions Reading clock data


DATERD Read instruction
The DATERD instruction reads year, month, day, hour, minute, second, and weekday from the
clock element of the CPU module and stores the clock data in binary format in the devices
specified by d+0 (Array_d[0]) through d+6 (Array_d[6]). The assignment of registers to clock
data is illustrated below:
d+0, Array_d[0] = year (1)
d+1, Array_d[1] = month (January = 1, December = 12) (2)
d+2, Array_d[2] = day (3)
d+3, Array_d[3] = hour (24 hour format) (4)
d+4, Array_d[4] = minute (5)
d+5, Array_d[5] = second (6)
d+6, Array_d[6] = day of the week (7)

The clock element is indicated as 8.

The following table contains the value range of clock data in d+0 (Array_d[0]) through d+6
(Array_d[6]):

Day of the
Clock data Year Month Day Hour Minute Second
week
Input range 1980–2079 1–12 1–31 0–23 0–59 0–59 0–6
Devices d+0 d+1 d+2 d+3 d+4 d+5 d+6
(Array_d[0]) (Array_d[1]) (Array_d[2]) (Array_d[3]) (Array_d[4]) (Array_d[5]) (Array_d[6])

The "year" is stored as four-digit indication.


The day of the week stored in d+6 (Array_d[6]) is indicated from 0 to 6. The table below shows
the assignment of weekdays:

Weekday Sunday Monday Tuesday Wednesday Thursday Friday Saturday


Storage value 0 1 2 3 4 5 6

Leap years are calculated automatically by the CPU clock.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 488
Clock instructions DATERD, DATERDP

Program DATERD
Example
The following program reads clock data from the internal CPU clock and outputs it in BCD for-
mat at the outputs as follows:
Y70 - Y7F = year Y68 - Y6F = month
Y60 - Y67 = day Y58 - Y5F = hour
Y50 - Y57 = minute Y48 - Y4F = second
Y44 - Y47 = day of the week

Clock data Year Month Day Hour Minute Second Day of the
week
Devices D0 D1 D2 D3 D4 D5 D6

Instruction List Ladder Diagram

BCD
Y7F-------Y78 Y77-------70
2 0 0 0

D0 2000
Y6F-------Y68 Y67-------Y60
D1 12
1 D2 24
1 2 2 4 3
2000, 12, 24, 12 : 57 : 39, Sunday D3 12
Y5F-------Y58 Y57-------Y50
D4 57
1 2 5 7 4
D5 39
D6 0
Y4F-------Y48 Y47-------Y40

BIN 3 9 0 5

1 Clock data
2 Year
3
Month, day
4 Hour, minute

5 Second, day of the week

Programming MELSEC System Q and L series 7 – 489


DATEWR, DATEWRP Clock instructions

7.15.2 DATEWR, DATEWRP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
s —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
First number of device storing the data to be written to the internal Array [0..6] of
s BIN 16-bit
CPU clock ANY16

7 – 490
Clock instructions DATEWR, DATEWRP

Functions Writing clock data


DATEWR Write instruction
The DATEWR instruction writes clock data of year, month, day, hour, minute, second, and
weekday stored in the devices specified by s+0 (Array_s[0]) through s+6 (Array_s[6]) to the
internal CPU clock. The clock data are stored in binary format. The assignment of registers to
clock data is illustrated below:
s+0, Array_s[0] = year (1)
s+1, Array_s[1] = month (January = 1, December = 12) (2)
s+2, Array_s[2] = day (3)
s+3, Array_s[3] = hour (24 hour format, 0 to 23 hours) (4)
s+4, Array_s[4] = minute (5)
s+5, Array_s[5] = second (6)
s+6, Array_s[6] = day of the week (7)

The clock element is indicated as 8.

The following table contains the value range of clock data in s+0 (Array_s[0]) through s+6
(Array_s[6]):

Day of the
Clock data Year Month Day Hour Minute Second
week
Input range 1980–2079 1–12 1–31 0–23 0–59 0–59 0–6
Devices s+0 s+1 s+2 s+3 s+4 s+5 s+6
(Array_s[0]) (Array_s[1]) (Array_s[2]) (Array_s[3]) (Array_s[4]) (Array_s[5]) (Array_s[6])
f

The "year" is designated as four-digit indication.


The weekday stored in s+6 (Array_s[6]) is indicated from 0 to 6. The table below shows the
assignment of weekdays:

Weekday Sunday Monday Tuesday Wednesday Thursday Friday Saturday


Storage value 0 1 2 3 4 5 6

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data specified in s+0 (Array_s[0]) through s+6 (Array_s[6]) exceed the relevant
value range.
(Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 491


DATEWR, DATEWRP Clock instructions

Program DATEWRP
Example
With leading edge from X40, the following program writes the clock data in binary format at the
inputs to the internal CPU clock. The inputs are assigned to the clock data as follows:
X30 - X3F = year X18 - X1F = hour
X28 - X2F = month X10 - X17= minute
X20 - X27 = day X8 - XF = second

Day of the
Clock data Year Month Day Hour Minute Second week
Devices D0 D1 D2 D3 D4 D5 D6

Instruction List Ladder Diagram

BIN
X3F-------X38 X37-------X30

1 2 0 0 0

D0 2000
X2F-------X28 X27-------x20
D1 12
2 1 2 2 4
D2 24 5
D3 12 2000, 12, 24, 12 : 57 : 39, Sunday
X1F-------X18 X17-------X10
D4 57
3 1 2 5 7
D5 39
D6 0
XF-------X8 X7-------X4
BIN
4 3 9 0

1 Year
2 Month, day
3
Hour, minute
4 Second, day of the week

5
Clock data

7 – 492
Clock instructions DATE+, DATE+P

7.15.3 DATE+, DATE+P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices UsableDevices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
s1 Clock data to be added to
Array [0..2] of
s2 Clock data to be added BIN 16-bit
ANY16
d First number of device storing the clock data of the operation result

Programming MELSEC System Q and L series 7 – 493


DATE+, DATE+P Clock instructions

Functions Adding clock data


DATE+ Addition instruction
The DATE+ instruction adds the clock data stored in the devices specified from s2 on to the
clock data stored in the devices specified from s1 on. The clock data of the operation result is
stored in the devices specified from d.
The following table contains the value range of clock data in (s1)+0 through (s1)+2 (Array_s1[0]
through Array_s1[2]), (s2)+0 through (s2)+2 (Array_s2[0] through Array_s2[2]), and d+0
through d+2 (Array_d[0] through Array_d[2]):

Day of the
Clock Data Year Month Day Hour Minute Second
week
Input range — — — 0–23 0–59 0–59 —
Devices s1+0 s1+1 s1+2
— — — —
(Array_s1[0]) (Array_s1[1]) (Array_s1[2])
Devices s2+0 s2+1 s2+2
— — — —
(Array_s2[0]) (Array_s2[1]) (Array_s2[2])
Devices d+0 d+1 d+2
— — — —
(Array_d[0]) (Array_d[1]) (Array_d[2])

1
Hour
2
Minute
3 Second

In the following diagram to the clock data


6 hours, 32 minutes, 40 seconds ((s1)+0 through (s1)+2, (Array_s1[0] through Array_s1[2]))
the clock data
7 hours, 48 minutes, 10 seconds ((s2)+0 through (s2)+2, (Array_s2[0] through Array_s2[2]))
is added. The result
14 hours, 20 minutes, 50 seconds is stored in d+0 through d+2 (Array_d[0] through Array_d[2]).

1 Hour
2
Minute
3 Second

7 – 494
Clock instructions DATE+, DATE+P

If the addition result of clock data exceeds 24 hours, 24 hours are subtracted automatically to
achieve a correct time value.
The following diagram illustrates the addition of
14 hours, 20 minutes, and 30 seconds
to 20 hours, 20 minutes, and 20 seconds.
The result would be 34 hours, 40 minutes, and 50 seconds.
Since this result is not a correct time format, after the subtraction of 24 hours, the correct result
is 10 hours, 40 minutes, and 50 seconds (10:40:50 the next day).

1 Hour
2
Minute
3 Second

NOTE Refer to section 7.15.2 "DATEWR, DATEWRP" for further information on that topic.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data in (s1)+0 through (s1)+2 (Array_s1[0] through Array_s1[2]) and (s2)+0
through (s2)+2 (Array_s2[0] through Array_s2[2]) exceed the input range.
(Error code 4100)
● The device specified by s1, s2 or d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 495


DATE+, DATE+P Clock instructions

Program DATE+P
Example
With leading edge from X20, the following program reads the clock data from the internal CPU
clock via the DATERDP instruction and stores it in the registers D0 through D6 (see first dia-
gram after the program example below).
The DATE+P instruction adds one hour (D10, D11, D12) to the read data. The result is stored
in D100 through D102 (see second diagram after the program example below).

Day of the
Clock Data Year Month Day Hour Minute Second week
Devices D0 D1 D2 D3 D4 D5 D6
(var_D0[0]) (var_D0[1]) (var_D0[2]) (var_D0[3]) (var_D0[4]) (var_D0[5]) (var_D0[6])
Devices D20 D21 D22
— — — —
(var_D20[0]) (var_D20[1]) (var_D20[2])
Devices D10 D11 D12
— — — —
(var_D10[0]) (var_D10[1]) (var_D10[2])
Devices D100 D101 D102
— — — —
(var_D100[0]) (var_D100[1]) (var_D100[2])

MELSEC Instruction List Ladder Diagram

IEC Instruction List

NOTE This program example will not run without variable definition in the header of the program or-
ganization unit (POU). It would cause compiler or checker error messages. For details see sec-
tion 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 496
Clock instructions DATE+, DATE+P

The diagram below illustrates reading clock data via the DATERDP instruction.

1 Clock element
2
Year
3
Month (January = 1, December = 12)
4 Day

5
Hour (24-hour format)
6
Minute
7 Second

8
Day of the week
9
Clock data

The diagram below illustrates the addition via the DATE+P instruction.

1
Hour
2
Minute
3
Second

Programming MELSEC System Q and L series 7 – 497


DATE-, DATE-P Clock instructions

7.15.4 DATE-, DATE-P

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G DY
s1 —   — — — — — —
s2 —   — — — — — —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


s1 First number of device storing clock data to be subtracted from
s2 First number of device storing clock data to be subtracted BIN 16-bit
d First number of device storing the clock data of the subtraction result

7 – 498
Clock instructions DATE-, DATE-P

Functions Subtracting clock data


DATE- Subtraction instruction
The DATE instruction subtracts clock data stored in the device specified from s2 on from the
clock data in the device specified from s1 on. The clock data of the operation result is stored
in the device specified from d on.
The following table shows the input ranges of clock data stored in (s1)+0 through (s1)+2
(Array_s1[0] through Array_s1[2]), (s2)+0 through (s2)+2 (Array_s2[0] through Array_s2[2])
and d+0 through d+2 (Array_d[0] through Array_d[2]).

Day of the
Clock Data Year Month Day Hour Minute Second
week
Input range — — — 0–23 0–59 0–59 —
Devices s1+0 s1+1 s1+2
— — — —
(Array_s1[0]) (Array_s1[1]) (Array_s1[2])
Devices s2+0 s2+1 s2+2
— — — —
(Array_s2[0]) (Array_s2[1]) (Array_s2[2])
Devices d+0 d+1 d+2
— — — —
(Array_d[0]) (Array_d[1]) (Array_d[2])

1
Hour
2
Minute
3
Second

The following diagram illustrates the subtraction of 3 hours, 50 minutes, and 10 seconds
((s2)+0 through (s2)+2, (Array_s2[0] through Array_s2[2])) from 10 hours, 40 minutes, and 20
((s1)+0 through (s1)+2, (Array_s1[0] through Array_s1[2]) ). The result, 6 hours, 50 minutes,
and 10 seconds is stored in d+0 through d+2 (Array_d[0] through Array_d[2]).

1
Hour
2
Minute
3
Second

Programming MELSEC System Q and L series 7 – 499


DATE-, DATE-P Clock instructions

If the subtraction result of clock data becomes negative, 24 hours are added automatically to
achieve a correct time value.
The following diagram illustrates the subtraction of
10 hours, 42 minutes, and 12 seconds
from 4 hours, 50 minutes, and 32 seconds.
The result would be -6 hours, 8 minutes, and 20 seconds.
Since this result is not a correct time format, after the addition of 24 hours, the correct result is
18 hours, 8 minutes, and 20 seconds (18:08:20 the day before).

1 Hour
2
Minute
3 Second

NOTE Refer to section 7.15.2 "DATEWR, DATEWRP" for further information on that topic.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data in (s1)+0 through (s1)+2 (Array_s1[0] through Array_s1[2]) and (s2)+0
through (s2)+2 (Array_s2[0] through Array_s2[2]) exceed the input range.
(Error code 4100)
● The device specified by s1 or s2 or d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

7 – 500
Clock instructions DATE-, DATE-P

Program DATE-P
Example
With leading edge from X1C, the following program reads the clock data from the internal CPU
clock via the DATERDP instruction and stores it in the registers D100 through D106 (see first
diagram after the program example below).
The DATE-P instruction subtracts 10 hours (D10), 40 minutes (D11) and 10 seconds (D12)
from the read data. To the negative subtraction result, -8 hours, 41 minutes and 10 seconds is
added 24 hours automatically. The correct result, 16 hours, 41 minutes and 10 seconds
(16:41:10 the day before) is stored in R10 through R12 (see second diagram after the program
example below).

Day of the
Clock Data Year Month Day Hour Minute Second week
Devices D100 D101 D102 D103 D104 D105 D106
(var_D100[0]) (var_D100[1]) (var_D100[2]) (var_D100[3]) (var_D100[4]) (var_D100[5]) (var_D100[6])
Devices D1000 D1001 D1002
— — — —
(var_D1000[0]) (var_D1000[1]) (var_D1000[2])
Devices D10 D11 D12
— — — —
(var_D10[0]) (var_D10[1]) (var_D10[2])
Devices R10 R11 R12
— — — —
(var_R10[0]) (var_R10[1]) (var_R10[2])

MELSEC Instruction List Ladder Diagram

IEC Instruction List

NOTE This program example will not run without variable definition in the header of the program or-
ganization unit (POU). It would cause compiler or checker error messages. For details see sec-
tion 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 7 – 501


DATE-, DATE-P Clock instructions

The diagram below illustrates reading clock data via the DATERDP instruction.

1 Clock element
2
Year
3
Month (January = 1, December = 12)
4 Day

5
Hour (24-hour format)
6
Minute
7 Second

8
Day of the week
9
Clock data

The diagram below illustrates the subtraction via the DATE-P instruction.

1
Hour
2
Minute
3
Second

7 – 502
Clock instructions SECOND, SECONDP, HOUR, HOURP

7.15.5 SECOND, SECONDP, HOUR, HOURP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
SECOND
s —   — — — — — —
d        — —
HOUR
s         —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
SECOND
Array [0..2] of
s Hours, minutes, seconds BIN ANY16
16-/32-bit
d Seconds ANY32
HOUR
s Seconds ANY32
BIN
16-/32-bit Array [0..2] of
d Hours, minutes, seconds
ANY16

Programming MELSEC System Q and L series 7 – 503


SECOND, SECONDP, HOUR, HOURP Clock instructions

Functions Changing the clock data format


SECOND Changing time format from hh:mm:ss to seconds
The SECOND instruction changes the clock data in the devices s+0 through s+2 (Array_s[0])
through (Array_s[2]) from the time format hh:mm:ss to the format seconds only. The result is
stored in the devices specified by d and d+1 (Array_d[0]) through (Array_d[1]).
The following table shows the input ranges of clock data stored in s+0 through s+2 (Array_s[0])
through (Array_s[2]):

Clock Data Year Month Day Hour Minute Second Day of the
week
Input range — — — 0–23 0–59 0–59 —
Devices s+0 s+1 s+2
— — — —
(Array_s[0]) (Array_s[1]) (Array_s[2])
Devices d+0
(Array_d[0])
— — — — — through —
d+1
(Array_d[1])

d+1 d
s 1
s+1 2 4
1
s+2 3 Hour
2Minute

3Second

4
Time value in seconds

The following diagram shows the conversion of 4 hours, 29 minutes, and 31 seconds into
16171 seconds.

d+1 d
s 4 1
s+1 29 2 16171 4
1
s+2 31 3 Hour
2
Minute
3
Second
4
Time value in seconds

7 – 504
Clock instructions SECOND, SECONDP, HOUR, HOURP

HOUR Changing time format from seconds to hh:mm:ss


The HOUR instruction changes the clock data in the devices s+0 through s+1 (Array_s[0])
through (Array_s[1]) from the time format seconds only to the format hh:mm:ss.
The following table shows the input ranges of clock data to be stored in d+0 through d+2
(Array_d[0]) through (Array_d[2]):

Day of the
Clock Data Year Month Day Hour Minute Second
week
Input range — — — 0 - 23 0 - 59 0 - 59 —
Devices d+0 d+1 d+2
— — — —
(Array_d[0]) (Array_d[1]) (Array_d[2])
Devices s+0
(Array_s[0])
— — — — — through —
s+1
(Array_s[1]

s+1 s
d 2
1 d+1 3
d+2 4 1Time
value in seconds
2
Hour
3
Minute
4Second

The following diagram shows the conversion of 45325 seconds into 12 hours, 35 minutes, and
25 seconds.

s+1 s
d 12 2
1 45325 d+1 35 3
d+2 25 4 1
Time value in seconds
2Hour

3Minute

4
Second

Programming MELSEC System Q and L series 7 – 505


SECOND, SECONDP, HOUR, HOURP Clock instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data in s+0 (Array_s[0]) through s+2 (Array_s[2]) for the SECOND instruction or
in s+0 and s+1 for the HOUR instruction exceed the input range.
(Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU.)
(Error code 4101)

Program SECONDP
Example 1
With leading edge from X20, the following program reads clock data from the internal CPU
clock via the DATERDP instruction and stores it in the registers D10 through D16 (see first dia-
gram after the program example below).
The hours, minutes, and seconds of clock data are converted into seconds only via the
SECONDP instruction. The result is stored in D100 and D101 (see second diagram after the
program example below).

Day of the
Clock Data Year Month Day Hour Minute Second week
Devices D10 D11 D12 D13 D14 D15 D16
(var_D10[0]) (var_D10[1]) (var_D10[2]) (var_D10[3]) (var_D10[4]) (var_D10[5]) (var_D10[6])
Devices D20 D21 D22
— — — —
(var_D20[0]) (var_D20[1]) (var_D20[2])
Devices D100
(var_D10[0])
— — — — — to —
D101
(var_D10[1])

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 506
Clock instructions SECOND, SECONDP, HOUR, HOURP

The diagram below illustrates reading clock data via the DATERDP instruction.

1 D10 95 2
D11 4 3
D12 20 4
D13 20 5
D14 21 6 9
D15 23 7
D16 5 8

1 Clock element
2
Year
3
Month (January = 1, December = 12)
4 Day

5
Hour (24-hour format)
6
Minute
7 Second

8
Day of the week
9
Clock data

The diagram below illustrates the conversion into seconds via the SECONDP instruction.

D13 20 1 4
D14 21 2 D101, D100 73283
D15 23 3

1
Hour
2
Minute
3
Second
4
Converted seconds

Programming MELSEC System Q and L series 7 – 507


SECOND, SECONDP, HOUR, HOURP Clock instructions

Program HOURP
Example 2
With leading edge from X20, the following program converts the seconds stored in D0 and D1
into hours, minutes, and seconds. The result is stored in D100 through D102.

Day of the
Clock Data Year Month Day Hour Minute Second week
Devices D0 D1 D2
— — — —
(var_D0[1]) (var_D0[2]) (var_D0[3])
Devices D100
(var_D100[0])
— — — — — to —
D101
(var_D100[1])

MELSEC Instruction List Ladder Diagram IEC Instruction List

1 D100 11 2
D1, D0 40000 D101 6 3
D102 40 4

1 Value to be converted into seconds


2
Hour
3 Minute

4 Second

NOTE These program examples will not run without variable definition in the header of the program or-
ganization unit (POU). It would cause compiler or checker error messages. For details see sec-
tion 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

7 – 508
Clock instructions DT=, DT<>, DT>, DT<=, DT<, DT>=

7.15.6 DT=, DT<>, DT>, DT<=, DT<, DT>=

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
n —        

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2
DT=/DT<>/DT</DT<=/DT>/DT>=

LD s1 s2 n

AND s1 s2 n

OR
s1 s2 n

Variables Set Data Meaning Data Type


s1
First number of device storing the data to be compared
s2 BIN 16-bit
n Value of the data to be compared or the number of the stored data to be compared

Programming MELSEC System Q and L series 7 – 509


DT=, DT<>, DT>, DT<=, DT<, DT>= Clock instructions

Functions Date comparison


DT=, DT<>, DT>, DT<=, DT<, DT>= Date comparison
This instruction compares the date data specified by s1 with those specified by s2, or the date
data specified by s1 with current date data. Setting n determines the data to be compared.

● Comparison of given date data


This instruction treats the date data specified by s1 and s2 as a normally open contact, and
then compares the data in accordance with the value of n.

Data range Data range


(s1) Year 1980–2079 (s2) Year 1980–2079

(s1)+1 Month 1–12


Comparison
operator
(s2)+1 Month 1–12 ⇒ Comparison
operation result

(s1)+2 Day 1–31 (s2)+2 Day 1–31

● Comparison of current date data


This instruction treats the date data specified by s1 and the current date data as a normally
open contact, and then compares the data in accordance with the value of n. Date data
specified by s2 is treated as dummy data, and is ignored.

Data range
(s1) Year 1980–2079

(s1)+1 Month 1–12


Comparison
operator
Current date ⇒ Comparison
operation result

(s1)+2 Day 1–31

NOTE When either s1 or s2 corresponds to any of the following conditions in comparing given or current
date data with given date data, an operation error (error code 4101) or a malfunction may occur.
 The range of the devices to be used for the index modification is specified over the range of
the device specified by s1 or s2.
 File registers are specified by by s1 or s2 without a register set.

This instruction sets BIN values for each item.


This instruction sets the year of four digits selected from 1980 to 2079 with the BIN value spec-
ified by s1 or s2.
This instruction sets the month selected from 1 to 12 (January to December) with the BIN value
specified by s1+1 or s2+1.
This instruction sets the day selected from 1 to 31 (1st to 31st) for with the BIN value specified
by s1+2 or s2+2.

7 – 510
Clock instructions DT=, DT<>, DT>, DT<=, DT<, DT>=

This instruction specifies the following values at n so that the data to be compared can be spec-
ified.
The bit configuration specified at n is as follows.

This instruction specifies 0 at bits b3 to b14.


The instruction will be non-conductive status
without specifying 0 regardless of the operation
result.

b15 b14 b3 b2 b1 b0
0/1 0 0/1 0/1 0/1

Day
If this instruction specifies 1 (on) at bit b15, the Month
instruction compares s1 with the current date in
Year
accordance with the bit condition specified at bit b0
to b2.

● Date data to be compared (from bit 0 to bit 2)


0: Does not compare specified date data (year/month/day).
1: Compares specified date data (year/month/day).
● Operation data to be compared (bit 15)
0: Compares the date data specified by s1 with the date data specified by s2.
1: Compares the date data specified by s1 with the current date data.
Ignores the date data specified by s2.
● The following table shows processing details.
n value for com- n value for com-
parison of speci- parison of speci-
fied date data fied date data Date to be Processing details
compared
with given date with current date
data data
0001H 8001H Day Comparison of days (s1+2)
0002H 8002H Month Comparison of months (s1+1)
0003H 8003H Month, day Comparison of months (s1+1) and days (s1+2)
0004H 8004H Year Comparison of years (s1)
0005H 8005H Year, day Comparison of years (s1) and days (s1+2)
0006H 8006H Year, month Comparison of years (s1) and months (s1+1)
Comparison of years (s1),
0007H 8007H Year, month, day
months (s1+1) and days (s1+2)
Other than 0001H to 0007H, No comparison of years (s1), months (s1+1) and
8001H to 8007H No objects
days (s1+2) (Non-conductive)

If the data stored in the devices to be compared are not recognized as date data, SM709 will
be turned on after the instruction execution and no-conductive status will be made. Even if they
are not recognized as date data but the range of the devices is within the setting range, SM709
will not be turned on.
Moreover, if the range of devices specified by s1 to s1+2 or s2 to s2+2 exceeds the range of
specified devices, SM709 will be turned on after the instruction execution and no-conductive
status will be made.
Once SM709 is turned on, on-status will be retained till when the CPU modules are reset or
powered off. Therefore, turn off SM709 if necessary.

Programming MELSEC System Q and L series 7 – 511


DT=, DT<>, DT>, DT<=, DT<, DT>= Clock instructions

The following table shows the comparison operation results for each instruction:

Comparison Operation Results


Instruction Symbol
1 0
= s1 = s2 s1 ≠ s2
<> s1 ≠ s2 s1 = s2
> s1 > s2 s1 ≤ s2
<= s1 ≤ s2 s1 > s2
< s1 < s2 s1 ≥ s2
>= s1 ≥ s2 s1 < s2

● The following figure shows the comparison example of dates:

A B C

2006/1/1 2007/1/1 2008/1/1 2009/1/1


(2006/9/22) (2007/6/23) (2008/8/8)

The following table shows the conductive states resulting from performing the comparison
operation of the dates A, B, and C shown above. Even if the objects to be compared are
under the same condition, the comparison operation results vary depending on the objects
selected.
Comparison Condition
Comparison Objects
A<B B<C A<C
Day 
Month 
Month, day 
Year   
Year, day   
Year, month   
Year, month, day   
No objects

Conductive

Non-conductive
● Even if the dates to be compared do not exist practically, this instruction executes the
comparison operation for the objects with the settable dates in accordance with the following
condition.
– Date A: 2006/02/30 (This date is settable, though it does not exist.)
– Date B: 2007/03/29
– Date C: 2008/02/31 (This date is settable, though it does not exist.)
Comparison Condition
Comparison Objects
A<B B<C A<C
Day 
Month
Month, day  
Year   
Year, day   
Year, month   
Year, month, day   
No objects

Conductive

Non-conductive

7 – 512
Clock instructions DT=, DT<>, DT>, DT<=, DT<, DT>=

Program LDDT=
Example 1
The following program compares the data stored in D0 with the data (year, month, and day)
stored in D10, and turns Y33 ON when the data stored in D0 meet the data stored in D10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program ANDDT<>
Example 2
The following program compares the data stored in D0 with the current date data (year and
month), and turns Y33 ON when the data stored in D0 do not meet the current date data, when
M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program ANDDT>
Example 3
The following program compares the data stored in D0 with the data (year and day) stored in
D10, and turns Y33 ON when the data value stored in D10 is smaller than the data value stored
in D0, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program ORDT<=
Example 4
The following program compares the data stored in D0 with the current date data (year), and
turns Y33 ON when the value of the current date data is the data value stored in D0 or larger.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 513


TM=, TM<>, TM>, TM<=, TM<, TM>= Clock instructions

7.15.7 TM=, TM<>, TM>, TM<=, TM<, TM>=

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 QnU(D)(H)CPU: The serial number (first five digits) is "10102" or higher.


QnUDE(H)CPU: The serial number (first five digits) is "10102" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
n —        

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2
TM=/TM<>/TM</TM<=/TM>/TM>=
LD s1 s2 n

AND s1 s2 n

OR
s1 s2 n

Variables Set Data Meaning Data Type


s1
First number of device storing the data to be compared
s2 BIN 16-bit
n Value of the data to be compared or the number of the stored data to be compared

7 – 514
Clock instructions TM=, TM<>, TM>, TM<=, TM<, TM>=

Functions Clock comparison


TM=, TM<>, TM>, TM<=, TM<, TM>= Clock comparison
This instruction compares the clock data specified by s1 with those specified by s2, or the clock
data specified by s1 with current time data. Setting n determines the data to be compared.
● Comparison of given clock data
This instruction treats the clock data specified by s1 and s2 as a normally open contact, and
then compares the data in accordance with the value of n.

Data range Data range


(s1) Hour 0–23 (s2) Hour 0–23

(s1)+1 Minute 0–59


Comparison
operator
(s2)+1 Minute 0–59 ⇒ Comparison
operation result

(s1)+2 Second 0–59 (s2)+2 Second 0–59

● Comparison of current time data


This instruction treats the clock data specified by s1 and the current time data as a normally
open contact, and then compares the data in accordance with the value of n.
Time data specified by s2 is treated as dummy data, and is ignored.

Data range
(s1) Hour 0–23

(s1)+1 Minute 0–59


Comparison
operator
Current time ⇒ Comparison
operation result

(s1)+2 Second 0–59

NOTE When either s1 or s2 corresponds to any of the following conditions in comparing given or current
time data with given clock data, an operation error (error code 4101) or a malfunction may occur.
 The range of the devices to be used for the index modification is specified over the range of
the device specified by s1 or s2.
 File registers are specified by by s1 or s2 without a register set.

This instruction sets BIN values for each item.


This instruction sets the time selected from 0 to 23 (midnight to 23 o’clock) with the BIN value
specified by s1 or s2 (uses 24-hour clock).
This instruction sets the minute selected from 0 to 59 with the BIN value specified by s1+1 or
s2+1.
This instruction sets the second selected from 0 to 59 for with the BIN value specified by s1+2
or s2+2.

Programming MELSEC System Q and L series 7 – 515


TM=, TM<>, TM>, TM<=, TM<, TM>= Clock instructions

This instruction specifies the following values at n so that the data to be compared can be spec-
ified.
The bit configuration specified at n is as follows.

This instruction specifies 0 at bits from b3 to b14.


The instruction will be non-conductive status
without specifying 0 regardless of the operation
result.

b15 b14 b3 b2 b1 b0
0/1 0 0/1 0/1 0/1

Second
If this instruction specifies 1 (ON) at bit b15 the Minute
instruction compares s1 with the current time in
Hour
accordance with the bit condition specified at bits
b0 to b2.

● Clock data to be compared (from bit 0 to bit 2)


0: Does not compare specified clock data (hour/minute/second).
1: Compares specified clock data (hour/minute/second).
● Operation data to be compared (bit 15)
0: Compares the clock data specified by s1 with the clock data specified by s2.
1: Compares the clock data specified by s1 with the current time data.
Ignores the clock data specified by s2.
● The following table shows processing details.
n value for com- n value for com-
parison of speci- parison of speci-
fied clock data fied clock data Time to be Processing details
compared
with given clock with current time
data data
0001H 8001H Second Comparison of seconds (s1+2)
0002H 8002H Minute Comparison of minutes (s1+1)
0003H 8003H Minute, second Comparison of minutes (s1+1) and seconds (s1+2)
0004H 8004H Hour Comparison of hours (s1)
0005H 8005H Hour, second Comparison of hours (s1) and seconds (s1+2)
0006H 8006H Hour, minute Comparison of hours (s1) and minutes (s1+1)
Hour, minute, Comparison of hours (s1),
0007H 8007H
second minutes (s1+1) and seconds (s1+2)
Other than 0001H to 0007H, No comparison of hours (s1), minutes (s1+1) and
8001H to 8007H No objects
seconds (s1+2) (Non-conductive)

If the data stored in the devices to be compared are not recognized as clock data, SM709 will
be turned on after the instruction execution and no-conductive status will be made.
Moreover, if the range of devices specified by s1 to s1+2 or s2 to s2+2 exceeds the range of
specified devices, SM709 will be turned on after the instruction execution and no-conductive
status will be made.
Once SM709 is turned on, on-status will be retained until the CPU modules are reset or pow-
ered off. Therefore, turn off SM709 if necessary.

7 – 516
Clock instructions TM=, TM<>, TM>, TM<=, TM<, TM>=

The following table shows the comparison operation results for each instruction.

Comparison Operation Results


Instruction Symbol
1 0
= s1 = s2 s1 ≠ s2
<> s1 ≠ s2 s1 = s2
> s1 > s2 s1 ≤ s2
<= s1 ≤ s2 s1 > s2
< s1 < s2 s1 ≥ s2
>= s1 ≥ s2 s1 < s2

● The following figure shows the comparison example of time.

A B C

0:00 6:00 N00n 18:00 0:00


4:50:55 14:08:58 22:47:05

The following table shows the conductive states resulting from performing the comparison
operation of the clock data A, B, and C shown above. Even if the objects to be compared
are under the same condition, the comparison operation results vary depending on the
objects selected.
Comparison Condition
Comparison Objects
A<B B<C A<C
Second 

Minute 

Minute, second 

Hour   

Hour, second   

Hour, minute   

Hour, minute, second   

No objects

Conductive

Non-conductive

Program LDTM=
Example 1
The following program compares the data stored in D0 with the data (hour, minute, and second)
stored in D10, and turns Y33 ON when the data stored in D0 meet the data stored in D10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 517


TM=, TM<>, TM>, TM<=, TM<, TM>= Clock instructions

Program ANDTM<>
Example 2
The following program compares the data stored in D0 with the current time data (hour and
minute), and turns Y33 ON when the data stored in D0 do not meet the current date data, when
M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program ANDTM>
Example 3
The following program compares the data stored in D0 with the data (hour and second) stored
in D10, and turns Y33 ON when the data value stored in D10 is smaller than the data value
stored in D0, when M0 is turned on.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program ORTM<=
Example 4
The following program compares the data stored in D0 with the current time data (hour), and
turns Y33 ON when the value of the current time data is the data value stored in D0 or larger.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 518
Expansion clock instructions TM=, TM<>, TM>, TM<=, TM<, TM>=

7.16 Expansion clock instructions


The expansion clock instructions read, add and subtract the clock data of the internal CPU
clock. In contrast to the instructions described in section 7.15 these instructions can process
milliseconds as well.
The table below gives an overview of these instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
S.DATERD
Reading clock data
SP.DATERD
S.DATE+
Adding clock data
SP.DATE+
S.DATE-
Subtracting clock data
SP.DATE-

Programming MELSEC System Q and L series 7 – 519


S.DATERD, SP.DATERP Expansion clock instructions

7.16.1 S.DATERD, SP.DATERP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 1) 1)  

1 High performance model QCPU, Process CPU, Redundant CPU:


The serial number (first five digits) is "07032" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2
S.DATERD d

SP.DATERD d

Variables Data Type


Set Data Meaning
MELSEC IEC
Array [0..7] of
d First number of device storing clock data being read BIN 16-bit
ANY16

7 – 520
Expansion clock instructions S.DATERD, SP.DATERP

Functions Reading expansion clock data


S.DATERD Read instruction
The S.DATERD instruction reads year, month, day, hour, minute, second, weekday, and milli-
second from the clock element of the CPU module and stores the clock data in binary format
in the devices specified by d+0 (Array_d[0]) through d+7 (Array_d[7]). The assignment of reg-
isters to clock data is illustrated below:
d+0, Array_d[0] = year (1)
d+1, Array_d[1] = month (January = 1, December = 12) (2)
d+2, Array_d[2] = day (3)
d+3, Array_d[3] = hour (24 hour format) (4)
d+4, Array_d[4] = minute (5)
d+5, Array_d[5] = second (6)
d+6, Array_d[6] = day of the week (7)
d+7, Array_d[7] = millisecond (8)

d 1
d+1 2
d+2 3

Clock element ⇒ d+3


d+4
4
5
d+5 6
d+6 7
d+7 8

The following table contains the value range of clock data in d+0 through d+7 (Array_d[0])
through (Array_d[7]):

Day of the
Clock data Year Month Day Hour Minute Second Millisecond
week
Input range 1980–2079 1–12 1–31 0–23 0–59 0–59 0–6 0–999
Devices d+0 d+1 d+2 d+3 d+4 d+5 d+6 d+7
(Array_d[0]) (Array_d[1]) (Array_d[2]) (Array_d[3]) (Array_d[4]) (Array_d[5]) (Array_d[6]) (Array_d[7])

The "year" is stored as four-digit indication.


The day of the week stored in d+6 (Array_d[6]) is indicated from 0 to 6. The table below shows
the assignment of weekdays:

Weekday Sunday Monday Tuesday Wednesday Thursday Friday Saturday


Storage value 0 1 2 3 4 5 6

Leap years are calculated automatically by the CPU clock.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

Programming MELSEC System Q and L series 7 – 521


S.DATERD, SP.DATERP Expansion clock instructions

Program SP.DATERD
Example
The following program reads clock data from the internal CPU clock and outputs it in BCD for-
mat at the outputs as follows:
Y70 - Y7F = year Y68 - Y6F = month
Y60 - Y67 = day Y58 - Y5F = hour
Y50 - Y57 = minute Y48 - Y4F = second
Y44 - Y47 = day of the week Y38 - Y43 = millisecond

Clock data Year Month Day Hour Minute Second Day of the Millisecond
week
Devices D0 D1 D2 D3 D4 D5 D6 D7

Instruction List Ladder Diagram

BCD Y7F Y70


2 0 0 5 2)

D0 2005
Y6F Y68 Y67 Y60
D1 12
1) 1 2 2 4 3)
D2 24
2005, 12, 24 12:57:39 Sunday 530 D3 12
Y5F Y58 Y57 Y50
D4 57
1 2 5 7 4)
D5 39
D6 0
Y4F Y48 Y47 Y44
D7 530
3 9 0 5)
BIN
Y43 Y38
5 3 0 6)

1 Clock data
2 Year
3
Month, day
4 Hour, minute

5 Second, day of the week

6
Millisecond

7 – 522
Expansion clock instructions S.DATERD, SP.DATERP

NOTES This instruction reads clock data and stores those to a specified device even if a wrong clock
data is set to the CPU module (example: Feb. 30th). When setting clock data with the DATEWR
instruction or witha programming tool, make sure to set a correct data.
Time error of reading a clock data of millisecond is a maximum of 2 ms. (Difference between the
data memorized by clock element inside of the CPU module and the data read by this function.)
Specifying digit for the bit device can be used only when the following two conditions are met:
 Digit specification: K4
 Head of device: multiple of 16
When the above conditions are not met, INSTRCT CODE ERR. (Error code 4004) will occur.

Programming MELSEC System Q and L series 7 – 523


S.DATE+, SP.DATE+ Expansion clock instructions

7.16.2 S.DATE+, SP.DATE+

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 1) 1)  

1 High performance model QCPU, Process CPU, Redundant CPU:


The serial number (first five digits) is "07032" or higher.

Devices UsableDevices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

4
S.DATE+ s1 s2 d

SP.DATE+ s1 s2 d

Variables Data Type


Set Data Meaning
MELSEC IEC
s1 Clock data to be added to
Array [0..4] of
s2 Clock data to be added BIN 16-bit
ANY16
d First number of device storing the clock data of the operation result

7 – 524
Expansion clock instructions S.DATE+, SP.DATE+

Functions Adding expansion clock data


S.DATE+ Addition instruction
The S.DATE+ instruction adds the clock data stored in the devices specified from s2 on to the
clock data stored in the devices specified from s1 on. The clock data of the operation result is
stored in the devices specified from d.
The following table contains the value range of clock data in (s1)+0 through (s1)+4 (Array_s1[0]
through Array_s1[4]), (s2)+0 through (s2)+4 (Array_s2[0] through Array_s2[4]), and d+0
through d+4 (Array_d[0] through Array_d[4]):

Day of the
Clock Data Year Month Day Hour Minute Second Millisecond
week
Input range — — — 0–23 0–59 0–59 — 0–999
Devices (s1)+0 (s1)+1 (s1)+2 (s1)+4
— — — —
(Array_s1[0]) (Array_s1[1]) (Array_s1[2]) (Array_s1[4])
Devices (s2)+0 (s2)+1 (s2)+2 (s2)+4
— — — —
(Array_s2[0]) (Array_s2[1]) (Array_s2[2]) (Array_s2[4])
Devices d+0 d+1 d+2 d+4
— — — —
(Array_d[0]) (Array_d[1]) (Array_d[2]) (Array_d[4])

s1 Hour s2 Hour d Hour


(s1)+1 Minute (s2)+1 Minute d+1 Minute
(s1)+2 Second + (s2)+2 Second d+2 Second
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond (s2)+4 Millisecond d+4 Millisecond

For example, adding the time 7:48:10:500 to 6:32:40:875 would result in the following opera-
tion:

s1 Hour: 6 s2 Hour: 7 d Hour: 14


(s1)+1 Minute: 32 (s2)+1 Minute: 48 d+1 Minute: 20
(s1)+2 Second: 40 + (s2)+2 Second: 10 d+2 Second: 51
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond: 875 (s2)+4 Millisecond: 500 d+4 Millisecond: 375

If the addition result of clock data exceeds 24 hours, 24 hours are subtracted automatically to
achieve a correct time value.
For example, when the time 20:20:20:500 is added to 14:20:30:875, the result is not
34:40:51:375, but 10:40:51:375.

s1 Hour: 14 s2 Hour: 20 d Hour: 10


(s1)+1 Minute: 20 (s2)+1 Minute: 20 d+1 Minute: 40
(s1)+2 Second: 30 + (s2)+2 Second: 20 d+2 Second: 51
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond: 875 (s2)+4 Millisecond: 500 d+4 Millisecond: 375

Programming MELSEC System Q and L series 7 – 525


S.DATE+, SP.DATE+ Expansion clock instructions

NOTE Devices s1+3, s2+3, and d+3 are not used for operation.
A clock data read by the S(P).DATERD instruction can be directly added.

d Hour
d+1 Minute
d+2 Second

d+3 Day of week



d+4 Millisecond

When the clock data is read by the S(P).DATERD instruction, day of week is inserted between
"second" and "millisecond". If the S(P).DATE+ instruction is used to add the clock data, the data
can be directly used for addition since it does not perform the calculation for the day of a week.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data in s1 and s2 exceed the input range.
(Error code 4100)
● The device specified by s1, s2 or d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

NOTE Specifying digit for the bit device can be used only when the following two conditions are met:
 Digit specification: K4
 Head of device: multiple of 16
When the above conditions are not met, INSTRCT CODE ERR. (Error code 4004) will occur.

7 – 526
Expansion clock instructions S.DATE+, SP.DATE+

Program SP.DATE+P
Example
With leading edge from X20, the following program adds 1 hour to the clock data read from the
clock element, and stores the results into the area starting from D100.

Instruction List Ladder Diagram

Time data read operation by SP.DATERD instruction

Clock element ⇒ D0
D1
05
5
Year
Month
D2 17 Day

}
D3 10 Hour
D4 23 Minute Time data
D5 41 Second
D6 2 Day of week

100 Millisecond } Time data

Addition by SP.DATE+ instruction

D3 Hour: 10 D10 Hour: 1 D100 Hour: 11


D4 Minute: 23 D11 Minute: 0 D101 Minute: 23
D5 Second: 41 + D12 Second: 0 D102 Second: 41
D6 2 (Tuesday) D13 — D103 —
D7 Millisecond: 100 D14 Millisecond: 0 D104 Millisecond: 100

Programming MELSEC System Q and L series 7 – 527


S.DATE-, SP.DATE- Expansion clock instructions

7.16.3 S.DATE-, SP.DATE-

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 1) 1)  

1 High performance model QCPU, Process CPU, Redundant CPU with serial number (first five digits) of
"07032" or higher

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Register Module Zn Constant Other
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

4
S.DATE– s1 s2 d

SP.DATE– s1 s2 d

6
Variables Data Type
Set Data Meaning
MELSEC IEC
s1 First number of device storing clock data to be subtracted from
Array [0..4]
s2 First number of device storing clock data to be subtracted BIN 16-bit
of ANY16
d First number of device storing the clock data of the subtraction result

7 – 528
Expansion clock instructions S.DATE-, SP.DATE-

Functions Subtracting expansion clock data


S.DATE- Subtraction instruction
The S.DATE instruction subtracts clock data stored in the device specified from s2 on from the
clock data in the device specified from s1 on. The clock data of the operation result is stored
in the device specified from d on.
The following table shows the input ranges of clock data stored in (s1)+0 through (s1)+4
(Array_s1[0] through Array_s1[4]), (s2)+0 through (s2)+4 (Array_s2[0] through Array_s2[4])
and d+0 through d+4 (Array_d[0] thsrough Array_d[4]) .

Clock Day of the


Year Month Day Hour Minute Second Millisecond
Data week
Input range — — — 0–23 0–59 0–59 — 0–999
Devices s1+0 s1+1 s1+2 s1+4
— — — —
(Array_s1[0]) (Array_s1[1]) (Array_s1[2]) (Array_s1[4])
Devices s2+0 s2+1 s2+2 s2+4
— — — —
(Array_s2[0]) (Array_s2[1]) (Array_s2[2]) (Array_s2[4])
Devices d+0 d+1 d+2 d+4
— — — —
(Array_d[0]) (Array_d[1]) (Array_d[2]) (Array_d[4])

s1 Hour s2 Hour d Hour


(s1)+1 Minute (s2)+1 Minute d+1 Minute
(s1)+2 Second – (s2)+2 Second d+2 Second
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond (s2)+4 Millisecond d+4 Millisecond

For example, subtracting the clock time 3:50:10:500 from 10:40:20:875 would result in the fol-
lowing operation:

s1 Hour: 10 s2 Hour: 3 d Hour: 6


(s1)+1 Minute: 40 (s2)+1 Minute: 50 d+1 Minute: 50
(s1)+2 Second: 20 – (s2)+2 Second: 10 d+2 Second: 10
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond: 875 (s2)+4 Millisecond: 500 d+4 Millisecond: 375

Programming MELSEC System Q and L series 7 – 529


S.DATE-, SP.DATE- Expansion clock instructions

If the subtraction result of clock data becomes negative, 24 hours are added automatically to
achieve a correct time value.
For example, when the clock time 10:42:12:500 is subtracted from 4:50:32:875, the result is
not -6:8:20:375, but 18:8:20:375.

s1 Hour: 4 s2 Hour: 10 d Hour: 18


(s1)+1 Minute: 50 (s2)+1 Minute: 42 d+1 Minute: 8
(s1)+2 Second: 32 – (s2)+2 Second: 12 d+2 Second: 20
(s1)+3 — (s2)+3 — d+3 —
(s1)+4 Millisecond: 875 (s2)+4 Millisecond: 500 d+4 Millisecond: 375

NOTE Devices (s1)+3, (s2)+3, and d+3 are not used for operation.
A clock data read by the S(P).DATERD instruction can be directly subtracted.

d Hour
d+1 Minute
d+2 Second

d+3 Day of week



d+4 Millisecond

When the clock data is read by the S(P).DATERD instruction, day of week is inserted between
"second" and "millisecond". If the S(P).DATE– instruction is used to read the clock data, the data
can be directly used for subtraction since it does not perform the calculation for the day of a
week.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The clock data in (s1)+0 through (s1)+4 ((Array_s1[0] through Array_s1[4])) and (s2)+0
through (s2)+4 ((Array_s2[0] through Array_s2[4])) exceed the input range.
(Error code 4100)
● The device specified by s1, s2 or d exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU)
(Error code 4101)

NOTE Specifying digit for the bit device can be used only when the following two conditions are met:
 Digit specification: K4
 Head of device: multiple of 16
When the above conditions are not met, INSTRCT CODE ERR. (Error code 4004) will occur.

7 – 530
Expansion clock instructions S.DATE-, SP.DATE-

Program SP.DATE–
Example
With leading edge from X1C, the following program subtracts the time data stored in the area
starting from D10 from the clock data read from the clock element, and stores the results into
the area starting from D100.

Instruction List Ladder Diagram

1)

2)

1
Reads out the clock element data to D0 or later.
2 Sets the time to D10 or later.

Time data read operation by SP.DATERD instruction

Clock element ⇒ D0
D1
05
2
Year
Month
D2 23 Day

}
D3 8 Hour
D4 42 Minute Time data
D5 1 Second
D6 3 Day of week

997 Millisecond } Time data

Subtraction by SP.DATE– instruction

D3 Hour: 8 D10 Hour: 10 D100 Hour: 22


D4 Minute: 42 D11 Minute: 40 D101 Minute: 1
D5 Second: 1 – D12 Second: 10 D102 Second: 51
D6 3 (Wednesday) D13 — D103 —
D7 Millisecond: 997 D14 Millisecond: 500 D104 Millisecond: 497
8:42:1:997 – 10:40:10:500 = –2:1:51:497
(+24) = 22:1:51:497

Programming MELSEC System Q and L series 7 – 531


S.DATE-, SP.DATE- Program control instructions

7.17 Program control instructions


The program control instructions toggle different program operation modes and check the pro-
gram execution status. The table below gives an overview of the instructions:

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor

Switching programs into PSTOP PSTOP_M


stand-by mode PSTOPP PSTOPP_M

Switching programs into POFF POFF_M


stand-by mode and reset of outputs POFFP POFFP_M

Switching programs into PSCAN PSCAN_M


scan execution mode PSCANP PSCANP_M

Switching programs into PLOW PLOW_M


low-speed execution mode PLOWP PLOWP_M
LDPCHK
Checking the program ANDPCHK
execution status
CRPCHK

NOTE Please check, whether these functions are available and supported by your version of the GX
IEC Developer.

Processing when the execution type is converted with the program control instruction is as fol-
lows:

Execution type Executed Instruction


before change PSCAN PSTOP POFF PLOW
Output turned OFF in
No change
Becomes stand-by next scan. Becomes
Scan execution type – remains scan type
type. stand-by type from the
execution. Becomes low speed
next scan after that.
execution type.
Initial execution type Becomes scan No change-remains
Ignored
Stand-by type execution type. stand-by type

Low speed execution Low speed execution


type execution is Low speed execution type execution is
stopped, becomes type execution is stopped, and output is No change
Low speed execution
scan execution type stopped, becomes turned OFF in the next – remains low speed
type
from the next scan. stand-by type from the scan. Becomes stand- execution type.
(Execution from step next scan. by type from the next
0) scan after that.
Output turned OFF in
Fixed scan execution Becomes scan Becomes stand-by next scan. Becomes Becomes low speed
type execution type. type. stand-by type from the execution type.
next scan after that.

NOTE Once the fixed scan execution type program is changed to another execution type, it cannot be
returned to the fixed scan execution type.

7 – 532
Program control instructions S.DATE-, SP.DATE-

As program execution type conversions by PSCAN and PSTOP instructions occur at the END
processing, such conversions are impossible during program execution.
When different execution types have been set for the same program in the same scan, the exe-
cution type will be that specified by the execution switching command that was executed last.

END processing END processing END processing

Execution GHI "ABC" GHI GHI *1 DEF *1 GHI


program name
PSTO executes "ABC" Converts "DEF" into the scan execution type
PSCAN executes "DEF" program and "ABC" to the stand-by type program

1 The order of "GHI" and "DEF" program execution is determined by the program settings parameters.

Switching from the fixed scan execution type program to the execution type program is per-
formed in the following timing.
● For the Universal model QCPU, LCPU
The execution type is changed when the execution of the fixed scan execution type is stopped
at the END processing after the program control instruction execution.
● Basic model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU
The execution of the fixed scan execution type is stopped at the execution of the program
control instruction, and the execution type is changed at the END processing.

When the POFF instruction is executed, the output is turned OFF at the next scan, and the exe-
cution type will be the stand-by type at the second next scan and later.
If executed prior to the output OFF processing, the program control instruction is ignored.

Programming MELSEC System Q and L series 7 – 533


PSTOP, PSTOPP Program control instructions

7.17.1 PSTOP, PSTOPP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


File name of program file to be set into stand-by mode or first number of device
s Character string
storing such data

7 – 534
Program control instructions PSTOP, PSTOPP

Functions Setting a program into the stand-by mode


PSTOP Switch instruction for the stand-by mode
The PSTOP instruction sets the program specified by the device in s into the stand-by mode.
In this mode the program is only executed if requested.
Only program files stored in the internal memory (drive 0) can be set into the stand-by mode.
The stand-by mode is only entered after END processing.
The PSTOP instruction is even given priority if the execution mode is specified via parameters.
The file extension .QPG is not needed to be entered for file specification since the type of file
is recognized automatically.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified program file does not exist.
(Error code 2410)
● The program type of the file name specified by s is an SFC program.
(Error code 2412)
● The file name storage destination device of s exceeds the range of the corresponding device.
(Error code 4101)

Program PSTOPP
Example
With leading edge from X0, the following program sets a program named "ABC" into the stand-
by mode.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 535


POFF, POFFP Program control instructions

7.17.2 POFF, POFFP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


First number of device storing file name of program file to be set into stand-by
s Character string
mode including reset of outputs

7 – 536
Program control instructions POFF, POFFP

Functions Setting a program into the stand-by mode including reset of the outputs
POFF Switch instruction for the stand-by mode with reset outputs
The POFF instruction sets the program specified by the device in s into the stand-by mode and
resets the outputs addressed by the program.
● Scan execution type:
Turns OFF outputs at the next scan (Non-execution processing). Programs are set as the
stand-by type after the subsequent scan.
● Low speed execution type:
Stops the execution of the low speed execution type program and turns OFF outputs at the
next scan. Programs are set as the stand-by type after the subsequent scan.
Only program files stored in the internal memory (drive 0) can be set into the stand-by mode.
The POFF instruction is even given priority if the execution mode is specified via parameters.
The file extension .QPG is not needed to be entered for file specification since the type of file
is recognized automatically.

NOTE Non-execution processing is identical to the processing that is conducted when the condition
contacts for the individual coil instructions are in the OFF state.
The operation results for the individual coil instructions following non-execution processing will
be as follows, regardless of the ON/OFF status of the individual contacts:

Instruction Condition of contacts and coils


All contacts and coils, designated by the OUT instruction
OUT instruction
are reset.
SET instruction
RST instruction
All contacts and coils, designated by these instructions
SFT instruction
remain their condition.
Basic instructions
Application instructions
PLS instruction All contacts and coils, designated by these instructions
adopt a condition as if the execution conditions of the
Instructions generating an output pulse instructions were not set.
Setting values of low- and high-speed timers The setting values are reset to 0.
Setting values of retentive timers
The setting values remain set.
Setting values of counters

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified program file does not exist.
(Error code 2410)
● The file name storage destination device of s exceeds the range of the corresponding device.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 537


POFF, POFFP Program control instructions

Program POFFP
Example
With leading edge from X0, the following program sets a program named "ABC" into the stand-
by mode. First in this mode all outputs, addressed by the program "ABC" are reset to the same
status as if the execution conditions for the instructions addressing them were not set. Then
the program "ABC" enters the stand-by mode.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 538
Program control instructions PSCAN, PSCANP

7.17.3 PSCAN, PSCANP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


File name of program file to be set into scan execution mode or first number of
s Character string
device storing such data

Programming MELSEC System Q and L series 7 – 539


PSCAN, PSCANP Program control instructions

Functions Setting a program into the scan execution mode


PSCAN Switch instruction for the scan execution mode
The PSCAN instruction sets the program specified by the device in s into the scan execution
mode. In this mode the program is only executed once during one program scan.
Only program files stored in the internal memory (drive 0) can be set into the scan execution
mode.
The scan execution mode is only entered after END processing.
The PSCAN instruction is even given priority if the execution mode is specified via parameters.
The file extension .QPG is not needed to be entered for file specification since the type of file
is recognized automatically.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified program file does not exist.
(Error code 2410)
● The file name storage destination device of s exceeds the range of the corresponding device.
(Error code 4101)
● The specified file name is an SFC program, and the SFC program for the other file name
has been already started. (Dual activation error of the SFC program)
(For the Universal model QCPU, LCPU: Error code 4131)
(For the High Performance model QCPU, Process CPU, Redundant CPU: Error code 2504)

Program PSCANP
Example
With leading edge from X0, the following program sets a program named "ABC" into the scan
execution mode.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 540
Program control instructions PLOW, PLOWP

7.17.4 PLOW, PLOWP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


File name of program file to be set into low-speed execution mode or first number
s Character string
of device storing such data

Programming MELSEC System Q and L series 7 – 541


PLOW, PLOWP Program control instructions

Functions Setting a program into the low-speed execution mode


PLOW Switch instruction for the low-speed execution mode
The PLOW instruction sets the program specified by the device in s into the low-speed execu-
tion mode. In this mode the program is only executed at low processing speed.
Only program files stored in the internal memory (drive 0) can be set into the scan execution
mode.
The low-speed execution mode is only entered after END processing.
The PLOW instruction is even given priority if the execution mode is specified via parameters.
The file extension .QPG is not needed to be entered for file specification since the type of file
is recognized automatically.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified program file does not exist.
(Error code 2410)
● The program file contains a CHK instruction.
(Error code 4235)

Program PLOWP
Example
With leading edge from X0, the following program sets a program named "ABC" into the low-
speed execution mode.

MELSEC Instruction List Ladder Diagram IEC Instruction List

7 – 542
Program control instructions PCHK

7.17.5 PCHK

CPU High
Basic Process Redundant Universal LCPU
Performance
  

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s — — — — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2
LDPCHK PCHK s

ANDPCHK PCHK s

ORPCHK

PCHK s

Variables Set Data Meaning Data Type


s File name of the program whose execution status will be checked Character string

Programming MELSEC System Q and L series 7 – 543


PCHK Program control instructions

Functions Program execution status check instruction


PCHK Check instruction for the program execution status
Checks whether the program of the specified file name is in execution or not (non-execution).
The instruction is in conduction when the program of the specified file name is in execution,
and the instruction is in non-conduction when the program is in non-execution.
Specify the file name without an extension (.QPG). For example, specify "ABC" when the file
name is ABC.QPG.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified program file does not exist.
(Error code 2410)

Program PCHK
Example
Program that keeps Y10 ON when the program file "ABC.QPG" is being executed.

PCHK "ABC" Y10

Execution

Non-execution

Non-execution indicates that the program execution type is a stand-by type.


Execution indicates that the program execution type is one of the following:
– a scan execution type (including during output OFF (during non-execution processing))
– a low speed execution type or
– a fixed scan execution type.

7 – 544
Program control instructions PCHK

NOTE The PCHK instruction is in conduction when the program of the specified file name (target pro-
gram) is in execution, and the instruction is in non-conduction when the program is in non-exe-
cution.
When the target program is set to non-execution (stand-by type) with the POFF instruction, the
PCHK instruction is in conduction while the non-execution processing of the target program is
being performed. At the END processing of the scan where the non-execution processing is
completed, the target program is put into non-execution (stand-by type), and the PCHK instruc-
tion is brought into non-conduction.
Therefore, note that if the PCHK instruction is executed for the program where the non-execution
processing has been completed by the POFF instruction, the PCHK instruction may be brought
into conduction.
The following chart shows the operation performed when program A executes the POFF in-
struction of program B and program C executes the PCHK instruction of program B with the pro-
grams being executed in order of program A, program B and program C.

Program B execution type change


(Scan execution type to stand-by type)

END processing END processing END processing

Scan Scan Scan Scan


execution execution execution execution
Program A
Scan Scan
execution execution
Program B
Scan Scan Scan
execution execution execution
Program C
POFF instruction is Non-execution
executed for program B processing is performed.
Continuity
PCHK B
Non-continuity

Programming MELSEC System Q and L series 7 – 545


Other convenient instructions

7.18 Other convenient instructions

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
WDT WDT_M
Reset watchdog timer
WDTP WDTP_M
Preset number of execution scans DUTY DUTY_M
Time check TIMCHK TIMCHK_M
ZRRDB ZRRDB_M
Direct read of one byte
ZRRDBP ZRRDBP_M
ZRWRB ZRWRB_M
Direct write of one byte
ZRWRBP ZRWRBP_M
ADRSET ADRSET_M
Store device for indirect designation
ADRSETP ADRSETP_M
Numerical key input from keyboard KEY KEY_MD

Batch save of ZPUSH ZPUSH_M


index register contents ZPUSHP ZPUSHP_M

Batch recovery of ZPOP ZPOP_M


index register contents ZPOPP ZPOPP_M
UNIRD UNIRD_M
Reading module information
UNIRDP UNIRDP_M
TYPERD
Reading module model name
TYPERDP
Trace set TRACE TRACE_M
Trace reset TRACER TRACER_M
Writing data to a designated file SP.FWRITE
Reading data from a designated file SP.FREAD
Writing data to standard ROM SP.DEVST
S.DEVLD
Reading data from standard ROM
SP.DEVLD
Loading program from memory PLOADP PLOADP_M
Unloading program from program
memory PUNLOADP PUNLOADP_M

Load and unload PSWAPP PSWAPP_M

Highspeed block transfer of file RBMOV RBMOV_M


register RBMOVP RBMOVP_M
User message UMSG UMSG_M

NOTE The instructions ADRSET and ADRSETP are not supported by the GX IEC Developer.

7 – 546
Other convenient instructions WDT, WDTP

7.18.1 WDT, WDTP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register
Constant Other
Register Module Zn
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


— — —

Programming MELSEC System Q and L series 7 – 547


WDT, WDTP Other convenient instructions

Resetting the watchdog timer


Functions
WDT Reset
The WDT instruction resets the watchdog timer (WDT) during execution of a sequence pro-
gram.
The WDT instruction is only needed, if the program scan time of a sequence program from pro-
gram step 0 up to the END/FEND instruction exceeds the default time setting of the WDT under
certain conditions. If the default time setting of the WDT is exceeded any program scan the
parameter setting of the WDT has to be adjusted accordingly.
The setting value of the WDT has to be adjusted so that neither the time period t1 (step 0 to
WDT instruction) nor t2 (WDT and END/FEND instructions) exceed the WDT setting value.

1Step 0

The WDT instruction can be set any number of times within one program scan. Nevertheless,
for programming remind that the outputs are not reset (0) at once.
The values of the program scan time stored in the registers are not cleared via the WDT
instruction. Therefore, the stored values may be greater than the WDT values set through
parameters.

7 – 548
Other convenient instructions DUTY

7.18.2 DUTY

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1         

n2         

d 1) — — — — — — — —
1 SM420 through SM424 and SM430 through SM434

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


n1 Number of scans the special relays are set
BIN 16-bit
n2 Number of scans the special relays are reset
d Address of special relay SM420–SM424 and SM430–SM434) Bit

Programming MELSEC System Q and L series 7 – 549


DUTY Other convenient instructions

Functions Presetting the number of execution scans of a device


DUTY Preset execution scans
The DUTY instruction turns the devices specified by d (SM420 through SM424 and SM430
through SM434) ON for the number of program scans specified by n1 and OFF for the number
of program scans specified by n2. The according special relay serves as input condition for fol-
lowing operations.

1
Number of program scans with execution
2 Number of program scans without execution

Programs being executed once per program scan apply the relays SM420 through SM424.
Low-speed execution programs apply the relays SM430 through SM434.
At the beginning of the execution (initializing) the relays (SM420 through SM424 and SM430
through SM434) are reset.
If the value in n1 = 0, the relays remain reset.
If the value in n2 = 0 and the value in n1 is greater than 0, the relays will be and remain set.
The values in n1, n2, and d are set when the DUTY instruction is invoked. The scan pulse
(relay) is set ON or OFF when the END instruction is reached.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by d is not from SM420 to SM424 or SM430 to SM434.
(Error code 4101)
● The values in n1 and n2 are less than 0.
(Error code 4100)

7 – 550
Other convenient instructions DUTY

Program DUTY
Example
With leading edge from X0, the following program sets SM420 for one program scan and resets
it for 3 program scans. This operations are repeated as long as the program is executed (see
NOTE below).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
One program scan ON
2
Three program scans OFF

NOTE After the execution condition is reset (X0 = OFF) the output of scan pulse of the DUTY instruction
and the cyclic setting / resetting of the specified relay are proceeded. In order to stop the con-
tinued output of scan pulses the following program part has to be inserted.

Programming MELSEC System Q and L series 7 – 551


TIMCHK Other convenient instructions

7.18.3 TIMCHK

CPU High
Basic Process Redundant Universal LCPU
Performance
1)     

1 Basic model QCPU: The first five digits of the serial No. are "04122" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2         —
d  — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

TIMCHK s1 s2 d

Variables Set Data Meaning Data Type


s1 Device where the measured current value will be stored
BIN 16-bit
s2 Set value or device where the set value of measurement is stored
d Device to be turned ON at time-out Bit

7 – 552
Other convenient instructions TIMCHK

Functions Time check instruction


TIMCHK Time check instruction
Measures the ON time of the device used as a condition, and turns ON the device specified by
d if the condition device remains ON for longer than the time set to the device specified by s2.
The current value of the device specified by s1 is cleared to 0 and the device specified by d is
turned OFF at the leading edge of the execution command.
The current value of the device designated by s1 and the ON status of the device designated
by d are retained after the execution command turns OFF.
Set the set value of measurement in units of 100 ms.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device that cannot be specified has been specified.
(Error code 4100)

Program TIMCHK
Example
Program where the ON time of X0 is set to 5 s, the current value storage device to D0, and the
device that will turn ON at time-out to Y10.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 553


ZRRDB, ZRRDBP Other convenient instructions

7.18.4 ZRRDB, ZRRDBP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n         —
d        — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


n Serial byte number for file register to be read BIN 32-bit
d Number of device storing the read byte BIN 16-bit

7 – 554
Other convenient instructions ZRRDB, ZRRDBP

Functions Direct read of one byte from a file register


ZRRDB Read one byte
The ZRRDB instruction reads one byte specified by n via the serial byte number from a file reg-
ister. The byte number does not specify a block address. The byte is stored in the lower byte
of the device specified by d. The upper byte in the device specified by d stores the value "00H".

ZR0
2
ZR32767
ZR32768
3
b15 b8b7 b0
n 1 d 00H
ZR65535 5
ZR65536
4

1
Serial byte number
2
File register area for block 0
3 File register area for block 1

4
File register area for block 2
5 Read byte

The assignment of file register numbers to the according serial byte numbers is shown below:

1
Storage area for even byte numbers (here: address 0 through address 5006)
2
Storage area for odd byte numbers (here: address 1 through address 5007)

Programming MELSEC System Q and L series 7 – 555


ZRRDB, ZRRDBP Other convenient instructions

If the byte number 23560 is specified, the lower byte of the file register ZR11780 is read.

1 Address
2
Storage

If the byte number 43257 is specified, the lower byte of the file register ZR21628 is read.

1
Address
2
Storage

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of device (serial byte address) exceeds the relevant storage device range.
(Error code 4101)

7 – 556
Other convenient instructions ZRRDB, ZRRDBP

Program ZRRDBP
Example
With leading edge from X0, the following program reads the lower byte of file registers R16000
(byte number 32000) and the upper byte of the file register R16003 (byte number 32007). The
bytes are stored in D100 and D101.

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Serial byte number 32000 (lower byte in file register R16000)
2
Serial byte number 32007 (upper byte in file register R16003)

Programming MELSEC System Q and L series 7 – 557


ZRWRB, ZRWRBP Other convenient instructions

7.18.5 ZRWRB, ZRWRBP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n         —
s         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


n Serial byte number in file register to be written to BIN 32-bit
s Device storing data to be written BIN 16-bit

7 – 558
Other convenient instructions ZRWRB, ZRWRBP

Functions Direct write of one byte to a file register


ZRWRB Write one byte
The ZRRDB instruction writes the contents of the lower byte in the device specified by s to the
file register specified by n via serial byte number. The byte number in s does not specify a block
address. The upper byte of the device in s is ignored.

1
Serial byte number
2
Address
3 File register area for block 0

4
File register area for block 1
5 File register area for block 2

6 Write data

7
This byte is ignored
8 Byte to be written

The assignment of file register numbers to the according serial byte numbers is shown below:

1 Storage area for even byte numbers (here: address 0 through address 5006)
2 Storage area for odd byte numbers (here: address 1 through address 5007)

Programming MELSEC System Q and L series 7 – 559


ZRWRB, ZRWRBP Other convenient instructions

If the byte number 22340 is specified, the lower byte of the device specified by s is written to
the lower byte of the file register ZR11170.

1 Address
2
Write byte
3 This byte is ignored.

If the byte number 43257 is specified, the lower byte of the device specified by s is written to
the upper byte of the file register ZR21628.

1
Address
2
Write byte
3
This byte is ignored.

Operation In the following case an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The number of device (serial byte number) specified by n exceeds the relevant storage
device range.
(Error code 4101)

7 – 560
Other convenient instructions ZRWRB, ZRWRBP

Program ZRWRBP
Example
With leading edge from X0, the following program writes the contents of the lower bytes of the
registers D100 and D101 to the lower byte of the file register R16000 (byte number 32000) and
to the upper byte of the file register R16003 (byte number 32007).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Serial byte number 32000 (lower byte of file register R16000)
2
Serial byte number 32007 (upper byte of file register R16003)
3 These bytes are ignored.

Programming MELSEC System Q and L series 7 – 561


ADRSET, ADRSETP Other convenient instructions

7.18.6 ADRSET, ADRSETP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s    — — — — — —
d    — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

NOTE The instructions ADRSET and ADRSETP are not supported by the GX IEC Developer.

GX Works2

Variables Set Data Meaning Data Type


s Number of device for indirect address read Device name
d Number of device that will store the indirect address of the device designated by s BIN 32-bit

7 – 562
Other convenient instructions ADRSET, ADRSETP

Functions Indirect address read operations


ADRSET Stores the indirect adress
Stores the indirect adress of the device designated by s at d and d + 1. The adress stored at
the device designated by d is used when reading of an indirect device adress is performed by
the sequence program. A bit device designation cannot be made at s.

The indirect adress of D0 is stored at D100


and D101.

The data stored at W0 is stored at D0 by


indirect setting.
(The device which contains the indirect
adress is prefixed by „@“)

Programming MELSEC System Q and L series 7 – 563


KEY Other convenient instructions

7.18.7 KEY

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s 1) — — — — — — — —
n         —
d1 —   — — — — — —
d2       — — —
1
X only

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
Array [0..8] of
s First number of devices (X), receiving numerical key input Bit
BOOL
n Number of digits to be input BIN 16-bit ANY16
Array [0..2] of
d1 First number of device storing numerical key input BIN 16-bit
ANY16
d2 Number of bit device to be set after completion of key input Bit BOOL

7 – 564
Other convenient instructions KEY

Functions Numerical key input


KEY Input instruction
The KEY instruction supports the key input of the ASCII characters 0 (30H) through 9 (39H) and
A (41H) through F (46H) at the inputs specified by s+0 (Array_s[0]) through s+7 (Array_s[7]).
The values entered at the inputs are encoded in hexadecimal format and stored in the devices
specified by (d1)+0 (Array_d1[0]) through (d1)+2 (Array_d1[2]). The number of characters to
be input is specified by n.

2
n 1
S
S+1
S+2
S+3 "0" (30H) - "9" (39H)
b15--b12 b11----b8 b7-----b4 b3-----b0 S+4 "A" (41H) - "F" (46H)
d1 3 S+5
S+6
(d1)+1 5 4 S+7
(d1)+2 S+8 8
7 6

1
Number of values to be entered
2
Input module
3
Number of entered values
4 8th entered character

5 5th entered character

6
4th entered character
7 1st entered character

8 Strobe signal

In the following diagram n is specified 5 and the values 1 (31H) through 5 (35H) are entered at
the inputs X10 through X18 of the input module.

1
Input module
2
Strobe signal

Programming MELSEC System Q and L series 7 – 565


KEY Other convenient instructions

The ASCII characters entered at the inputs (X) specified in s+0 (Array_s[0]) through s+7
(Array_s[7]) are encoded in 8-bit binary format as illustrated below:

1 Input module

After the input of an ASCII character at s+0 (Array_s[0]) through s+7 (Array_s[7]) the strobe
signal (s+8, Array_s[8]) is set, to link the input data internally. The time period the strobe signal
remains set or reset must exceed one program scan time to ensure accurate linking of input
data.

1 Execution condition for the KEY instruction


2
Set for more than one program scan
3
Reset for more than one program scan
4 Strobe signal (s+8, Array_s[8])

5 ASCII input data (s+0 through s+7, Array_s[0] through Array_s[7])

6
Reading "1"
7 Reading "2"

8
Reading "3"
9
Reading "4"

The KEY instruction can only be executed with the execution condition set. The execution con-
dition must remain set until the input of the number of characters specified by n is completed.

7 – 566
Other convenient instructions KEY

The number of entered values is stored in (d1)+0 (Array_d[0]). The entered ASCII characters
are actually stored in the devices specified in (d1)+1 (Array_d[1]) and (d1)+2 (Array_d[2]) and
(d1)+2 (Array_d[2]) as hexadecimal binary values; i.e. there are 4 bits per character supplied.
The hexadecimal binary values of the characters 0H through FH range from "0000" through
"1111".

1
Execution condition for the KEY instruction
2
Strobe signal (s+8, Array_s[8])
3
ASCII input data (s+0 through s+7, Array_s[0] through Array_s[7])

The number of characters to be entered specified by n must range within 1 and 8.


If the specified number of characters or the character code "00H" are entered, the linking of the
input data is completed and the device specified by d2 is set. The following diagrams illustrate
these operations. For n 5 is specified.
In the following diagram the input is completed after 5 characters. In the next but one diagram
the input is completed after the character code "00H".

1 Execution condition for the KEY instruction


2 Strobe signal (s+8, Array_s[8])
3
ASCII input data (s+0 through s+7, Array_s[0] through Array_s[7])
4 Input of characters completed (the device specified by d2 is set)

Programming MELSEC System Q and L series 7 – 567


KEY Other convenient instructions

1
Execution condition for the KEY instruction
2
Strobe signal (s+8, Array_s[8])
3 ASCII input data (s+0 through s+7, Array_s[0] through Array_s[7])

4
Input of characters completed (the device specified by d2 is set)

Prior to a new input of characters the contents of the devices specified in (d1)+0 (Array_d[0])
through (d1)+2 (Array_d[2]) have to be cleared and the device specified by d2 has to be reset;
otherwise a new input of characters is not possible.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The device specified by s is not an input (X).
(Error code 4100)
● The number of characters specified by n does not range within 1 and 8.
(Error code 4100)

7 – 568
Other convenient instructions KEY

Program KEY
Example
The following program enables key input of up to 5 numerical values via the inputs X20
(var_X20[0]) through X27 (var_X20[7]).
The values are stored in the registers D1 (var_D0[1]) and D2 (var_D0[2]) binary coded in hex-
adecimal format. The number of values already entered is stored in D0 (var_D0[0]).
Prior to the execution of the KEY instruction the registers D0 (var_D0[0]) through D2
(var_D0[2]) are cleared and the number of input values (5) is stored. After execution of the KEY
instruction the relay M10 (input completed) is reset. The strobe signal is supplied at the inputs
X28 (var_X20[8]).

MELSEC Instruction List Ladder Diagram IEC Instruction List

1
Numerical key pad
2 Input module
3
Strobe signal

Programming MELSEC System Q and L series 7 – 569


ZPUSH, ZPUSHP, ZPOP, ZPOPP Other convenient instructions

7.18.8 ZPUSH, ZPUSHP, ZPOP, ZPOPP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

, GX Works2

Variables Set Data Meaning Data Type


d First number of device storing index register contents BIN 16-bit

7 – 570
Other convenient instructions ZPUSH, ZPUSHP, ZPOP, ZPOPP

Functions Batch save and batch recovery of index register contents


ZPUSH Batch save of index register contents
The ZPUSH instruction saves the contents of the following index registers in the devices spec-
ified from d on. (When contents of an index register are saved, d+0 (the number of saves made)
is increased by 1.)
● Basic model QCPU: Z0 to Z9
● High Performance model QCPU/Process CPU/Redundant CPU: Z0 to Z15
● Universal model QCPU/LCPU: Z0 to Z19
These data can be recovered via the ZPOP instruction. The instruction can be applied to dif-
ferent nestings that are included in ZPUSH / ZPOP loop.
On execution of the instructions in different nestings each execution of the ZPUSH instruction
requires an area of 18 registers with 16 bits in the devices specified from d on. Therefore, for
the execution of the ZPUSH instruction the according amount of storage area has to be avail-
able.
The following diagrams illustrate the organization of the storage area from d on:
● When using a Basic model QCPU

d+0 1
d+1 Z0
d+2 Z1

3
d+10 Z9
d+11
2 1
Number of saved register contents
d+15
2Five
d+16 Z0 data words (internal system use)
d+17 Z1 4 3
First nesting level (15 data words max.)
4
Second nesting level

● When using a High Performance model QCPU/Process CPU/Redundant CPU

d+0 1
d+1 Z0
d+2 Z1

3
d+16 Z15
d+17
2 1
Number of saved register contents
d+18
2
d+19 Z0 Two data words (internal system use)
d+20 Z1 4 3
First nesting level (18 data words max.)
4
Second nesting level

Programming MELSEC System Q and L series 7 – 571


ZPUSH, ZPUSHP, ZPOP, ZPOPP Other convenient instructions

● When using Universal model QCPU/LCPU

d+0 1
d+1 Z0
d+2 Z1

3
d+20 Z19
d+21
2 1Number of saved register contents
d+22
2Two data words (internal system use)
d+23 Z0
d+24 Z1 4 3
First nesting level (22 data words max.)
4Second nesting level

ZPOP Batch recovery of index register contents


The ZPOP instruction recovers the contents saved in the area starting from the device desig-
nated by d to the index register.
When the saved content is read out to the index register, d+ 0 (the number of saves made) is
decreased by 1.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The storage area specified from d on exceeds the relevant storage device range.
(Error code 4101)
● The content of the device specified in d+0 (number of saved registers is 0 in the ZPOP(P)
instruction.).
(Error code 4100)

7 – 572
Other convenient instructions ZPUSH, ZPUSHP, ZPOP, ZPOPP

Program ZPUSH/ZPOP
Example
The following program saves the contents of the index register to the fields following D0 before
calling the subroutine following P0 that uses the index register.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 7 – 573


UNIRD, UNIRDP Other convenient instructions

7.18.9 UNIRD, UNIRDP

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n1    — — — —  —
d —   — — — — — —
n2    — — — —  —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

, GX Works2

Variables Device Meaning Data Type


Value obtained by dividing the head I/0 number of the module from which module
n1 BIN 16-Bit
information is read by 16 (0 to FFH)
d Head number of the device which stores module information Device name
n2 Number of points of read data (0 to 256) BIN 16-Bit

7 – 574
Other convenient instructions UNIRD, UNIRDP

Functions Reading module information


UNIRD Read instruction
The UNIRD instruction reads the module information starting at the head I/O address, which
is specified by n1 and stores the data at the address which is specified by d. The number of
points is specified by n2. The value for n1 is calculated by dividing the head I/O number of the
module by 16.
With the UNIRD instruction it is possible to read the statuses of the actually installed modules
instead of the module type designated by I/0 assignment.

NOTE The value of n1 is consists of the higher three digits of the head I/O number of the slot from
which the module information is read. The head I/O number is expressed in 4 digits in hexa-
decimal notation.

QCPU System Q
MELSEC

Q68 QY41
1) CPU QX10 QX10 QX10 QX10 QY10 QY10
ADV P

0000H 0010H 0020H 0030H 0040H 0050H 0070H 0080H 2)

3)

LCPU
LCPU

(L26CPU-BT)

1) CPU 4) 5) LX40 LX40 LX40 LX40 L60 LY10 LY10 LY10


C6 C6 C6 C6 AD4 R2 R2 R2

0000H 0010H 0030H 0040H 0050H 0060H 0070H 0090H 00A0H 00B0H 2)

6)

1 Power supply module


2 Head I/O number configured in the I/O assignment setting
3
Head address in n1: K4 or H4
4 Built-in I/0

5 Built-in CC-Link

6
Head address in n1: K6 or H6

Programming MELSEC System Q and L series 7 – 575


UNIRD, UNIRDP Other convenient instructions

The details of the module information are described as follows:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
Individual module information

Meaning
Bit Item
QCPU LCPU
0 000: 16 001: 32
010: 48 011: 64
1 Number of I/O points
100: 128 101: 256
2 110: 512 111: 1024
3 000: Input module 000: Input module
001: Output module 001: Output module
4 Module type
010: l/O mixed module 011: Intelligent function module
5 011: Intelligent function module 111: CPU Built-in I/O
External power supply
1: External power supply is connected
6 status Fixed to 0
0: External power supply is not connected
(For future expansion)
1: Blown fuse
7 Fuse status Fixed to 0
0: Normal, no blown fuse
1: Module information on the extension base
Online module unit is tried to be read during online
replacement status/ module change or from the CPU module
8 of standby system in the redundant Fixed to 0
execution from the
standby system system.1)
0: Other than above
Light/medium
9 1: Light/medium error has occurred 0: Normal
error status
10 00: No module error 01: Light error
Module error status
11 10: Medium error 11: Serious error

12 Module standby status 1: Normal 0: Module error occurred


13 Vacant Fixed to 0
1: The module is an A-series module
14 A-/Q-Module Fixed to 0
0: The module is a System Q module
Module installation
15 1: Modules are installed 0: No modules are installed
status
1
The Universal model QCPU used in the multiple CPU system is turned ON during the online module
change of the module controlled by the other CPU.

7 – 576
Other convenient instructions UNIRD, UNIRDP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● High Performance model QCPU, Process CPU, Redundant CPU and Universal model
QCPU, L26CPU-BT:
When n1 is other than 0 to FFH. (Error code 4100)
When n2 is other than 0 to 256. (Error code 4100)
When a total of n1 and n2 is greater than 256. (Error code 4100)
● Q00/Q01CPU/L02CPU:
When n1 is other than 0 to 3FH. (Error code 4100)
When n2 is other than 0 to 64. (Error code 4100)
When a total of n1 and n2 is greater than 64. (Error code 4100)
● Q00JCPU:
When n1 is other than 0 to FH. (Error code 4100)
When n2 is other than 0 to 16. (Error code 4100)
When n1 and n2 is greater than 16. (Error code 4100)
● MELSEC System Q CPU/LCPU:
When the number of points specified by n2 for the devices specified in (d) and up is outside
the range of that device.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 577


UNIRD, UNIRDP Other convenient instructions

Program UNIRD
Example
The following program stores the informations of the modules with the head I/O numbers 10H
through 20H to D0 and D1, when X10 is turned ON.

Instruction List Ladder Diagram

Device

X/Y 0 Module information D0

X/Y 10 Module information D1

X/Y 20 Module information

~ ~
~ ~

X/Y FE0 Module information

X/Y FF0 Module information

In this program example the module information is stored in D0 and D1. Readout results can be:
● For a 32-point intelligent function module of the System Q. With a 48- or 64-point module
the same contents as stored in D1 is stored in D2 or D2 and D3 respectively.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D0

32-point module

Intelligent function module

No external power supply connected

No blown-fuse error existing


Execution other than during online module change or from
the standby system
No module error occurred

Module ready status

Vacant

Module of MELSEC System Q

Module installed

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

D1

All bits are "0" since D0 stores the information

Module is installed at latter 16 points of the 32-point module

7 – 578
Other convenient instructions UNIRD, UNIRDP

● Module information for a vacant slot

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D0

All bits are "0" for a vacant slot.

● Performing online module replacement

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

D0

Performing online module replacement

● Module information on the extension base unit is tried to be read from the standby system
of the redundant system in separate mode:

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

D0

Execution from the standby system

● L series 32-point intelligent function module

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D0

32-point module
Intelligent function module
(Vacant)
(Vacant)
(Vacant)
No module errors

Module preparation complete


(Vacant)
(Vacant)
Module connected
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

D1

All bits are "0" since D0 stores the information

Module is installed at latter 16 points of the 32-point module

Programming MELSEC System Q and L series 7 – 579


TYPERD, TYPERDP Other convenient instructions

7.18.10 TYPERD, TYPERDP

CPU High
Basic Process Redundant Universal LCPU
Performance
 1) 

1 Universal model QCPU: The serial number (first five digits) is "11043" or higher.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n —   — — — —  —
d —   — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

, GX Works2 3
TYPERD n d

4
TYPERDP n d

Variables Device Meaning Setting range Data Type


0 to FFH,
Value obtained by dividing the head I/0 number of the module
3E0H to 3E3H
n from which module information is read by 16. BIN 16-Bit
(Universal model
Set by user.
QCPU only)
d+0: Execution result of the instruction Within each BIN 16-Bit
d
d+1 to d+9: Module model name device range Character string

7 – 580
Other convenient instructions TYPERD, TYPERDP

Functions Reading module model name


TYPERD Read module model name
The TYPERD instruction reads the module information starting at the head I/O address, which
is specified by n and stores the data at the address which is specified by d.
The following table shows which modules support the instruction:
Instruction Supported
Modules
QCPU LCPU
CPU module  

Input module  

Output module  

I/O combined module 

Intelligent function module  

GOT (bus connection) 

Supported

Not supported

Specify the start I/O number of a module whose model name is to be read by "n" as follows: •
Specify the value obtained by dividing the start I/O number of the target module by 16.

Universal model QCPU

Q68 QY41
1) CPU QX10 QX10 QX10 QX10 ADV P QY10 QY10

3E00H 0000H 0010H 0020H 0030H 0040H 0050H 0070H 0080H 4)

3)

2)

LCPU (L26CPU-BT)

1) CPU 5) 6) LX40 LX40 LX40 LX40 L60A LY10 LY10 LY10


C6 C6 C6 C6 D4 R2 R2 R2

0000H 0010H 0030H 0040H 0050H 0060H 0070H 0090H 00A0H 00B0H 4)

8)

7)

1
Power supply module
2
When the target module is a CPU module itself, specify the start I/O number by H3E0
3
Specify the start I/O number by K3 or H3
4
Head I/O number configured in the I/O assignment setting
5
Built-in I/0
6
Built-in CC-Link
7 Specify H3E0 to read the module name of the CPU module

8
Specify the start I/O number by K6 or H6

Programming MELSEC System Q and L series 7 – 581


TYPERD, TYPERDP Other convenient instructions

NOTE On the LCPU, if the built-in I/O or first I/O on the built-in CC-Link is specified, then the model
name of the CPU module is read.

● When the target module occupies two slots


The start I/O number to be specified may differ from that of the mounted module. For the
start I/O number, refer to the manual of each module.
Specify the value obtained by dividing the start I/O number of the target module by 16.
Example: QJ71GP21S-SX
Specify a value to which 0010H, start I/O number of the mounted module, is added.

1) CPU QJ71G P21S-SX 2) 2) 2) 2) 2) 2)

3E00H 0000H 0010H 0030H 0040H 0050H 0060H 0070H 0080H 4)

3)

1
Power supply module
2
Empty
3
Specify the start I/O number by K1 or H1
4 Start I/O number configured in the I/O assignment setting

● When the target module is a CPU module in multiple CPU systems


Specify the value obtained by dividing the start I/O number of the target CPU module by 16.

Q20UDH Q20UDH Q20UDH QY41 Q68 QY41


1) CPU QY10 QY10
CPU CPU CPU P ADV P

3E00H 3E10H 3E20H 3E30H 0000H 0010H 0020H 0030H 0040H 3)

2)

1
Power supply module
2
Specify the start I/O number by H3E3
3
Start I/O number configured in the I/O assignment setting
Or, the model name can be read by specifying the start I/O number of a module controlled
by another CPU.

7 – 582
Other convenient instructions TYPERD, TYPERDP

d+0 stores the execution result of the instruction and d+1 to d+9 store the module model name.
A value stored in d is as follows:
● When the model name has been read from the target module (example: QJ71GP21-SX)

modul

bit 15 to 8 7 to 0
(indicating that the model name that has been
d+0 0 Stores 0 read from the target module is stored)

d+1 4AH (J) 51H (Q)


d+2 31H (1) 37H (7)
Nine words are used

d+3 50H (P) 47H (G) Stores the model name that has been read from
d+4 31H (1) 32H (2) the target module (stored in ASCII)

d+5 53H (S) 2DH (-)


d+6 00H 58H (X)
d+7 00H 00H
Stores 00H as the 12th to 18th character of the
d+8 00H 00H <--------
model name.
d+9 00H 00H

The following table shows the examples of model names stored in d+1 to d+9.
Target Module Stored Model Name
CPU module Q06UDEHCPU
Intelligent function module QJ71GP21-SX
GOT GOT1000

● When the model name has not been written to the target module (example: QX40)

bit 15 to 8 7 to 0
(indicating that the character string (module
d+0 1 Stores 1
type and number of points) is stored)
d+1 4AH (N) 49H (I)
d+2 55H (U) 50H (P) Stores the character string consisting of module
type and number of points
Nine words are used

d+3 5FH (_) 54H (T) (stored in ASCII)


d+4 36H (6) 31H (1)
d+5 00H 00H
d+6 00H 00H
Stores 00H as the 9th to 18th character of the
d+7 00H 00H <--------
model name.
d+8 00H 00H
d+9 00H 00H

Programming MELSEC System Q and L series 7 – 583


TYPERD, TYPERDP Other convenient instructions

The following table shows the examples of character strings stored in d+1 to d+9.

Target Module Stored character string 1)


Input module INPUT_16
Output module OUTPUT_32
I/O combined module MIXED_64
Intelligent function module (includes the QI60 and GOT) INTELLIGENT_128

1 The character strings consist of a string indicating the module type (for example: INPUT for the Input
module) and a string indicating the number of I/O-points (16, 32, 48, 64, 128, 256, 512, 1024).

● Others
– The specified slot is empty or the target module is during online module change.
– The specified value (n) is not the start I/O number.
– The specified value (n) is within the allowable setting range, but cannot be set in the I/O
assignment setting screen of the PLC parameter dialog box.

bit 15 to 8 7 to 0
d+0 –1 Stores –1 (indicating that model name is not stored)
d+1 00H 00H
d+2 00H 00H
Nine words are used

d+3 00H 00H


d+4 00H 00H
d+5 00H 00H <-------- Stores 00H
d+6 00H 00H
d+7 00H 00H
d+8 00H 00H
d+9 00H 00H

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The target module cannot be communicated due to a failure.
(Error code 2110)
● Devices by 10 words starting from the device specified by d exceed the device range.
(Error code 4101)
● The specified value n is not within the range from 00H to FFH and from 3E0 to 3E3H.
(Universal model QCPU)
(Error code 4101)
● The specified value n is not within the range from 00H to FFH and is not 3E0H.
(LCPU)
(Error code 4101)

7 – 584
Other convenient instructions TYPERD, TYPERDP

Program TYPERD
Example
The following program stores the model name of a module having the start I/O number 0020H
in the area starting from the device specified by when X0 is turned on.

Instruction List Ladder Diagram

Programming MELSEC System Q and L series 7 – 585


TRACE, TRACER Other convenient instructions

7.18.11 TRACE, TRACER

CPU High
Basic Process Redundant Universal LCPU
Performance
   1) 

1 Other than Q00UJCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Set data Meaning Data Type


— —s —

7 – 586
Other convenient instructions TRACE, TRACER

Functions Trace set and trace reset


TRACE Trace set
The TRACE instruction stores the trace data designated by a peripheral device in the trace file
in the memory card by the designated number when SM800, SM801, and SM802 turn ON.
When the TRACE instruction is executed, SM803 turns ON. The sampling is repeated by the
specified number of sampling trace after the TRACE instruction, then, data is latched and the
trace is stopped.
The sampling is stopped if SM801 goes OFF during the trace execution.
After the TRACE instruction is executed and the trace is completed, SM805 turn ON.
During the execution of the TRACE instruction, other TRACE instructions are ignored. After the
TRACE instruction is executed, the TRACE instruction is enabled again.

TRACER Trace reset


The TRACER instruction resets the TRACE instruction and the flags SM803 through SM805.
After the TRACER instruction is executed, the TRACE instruction is enabled again.

NOTE Please refer to the QnUCPU User's Manual (Function Explanation, Program Fundamentals) or
Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explanation, Program Fundamentals) for
more informations about trace.
Please refer to the operating manuals for the GX Works2 and GX IEC Developer for the exe-
cution of the trace with peripheral devices.

Program TRACE, TRACER (GX Works2)


Example
The following program executes the TRACE instruction when X0 is turned ON. When X1 is tur-
ned ON, the TRACE instruction is reset by the TRACER instruction.

Instruction List Ladder diagram

Programming MELSEC System Q and L series 7 – 587


SP.FWRITE Other convenient instructions

7.18.12 SP.FWRITE

CPU High
Basic Process Redundant Universal LCPU
Performance
   1) 

1 Other than Q00UJCPU/Q00UCPU/Q01UCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s0    — — — —  —
d0 —   — — — — — —
s1 —   — — — — — —
s2 —   — — — — — 
1) 1) 1)
d1    — — — — — —
1
Local devices and the devices designated for individual programs cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

7 – 588
Other convenient instructions SP.FWRITE

Variables Setting Data


Set data Meaning Set By
Range Type
u0 Dummy (not used) — —
BIN 16-bit
s0 Drive designation. 2 User
Head number of the device storing the control data.
The following control data is required.
Setting
Set data Item Meaning/Set Data Set By
Range
Specifies the execution type:
0000H: Write binary data 0000H
(d0) Execution type User
0100H: Write data after conversion 0100H
into CSV format
(d0)+1 (Reserved) Used by system — System
Contains the number of actually
Writing result
written data. The unit for the value
(d0)+2 (Number of writ- — System
is determined by word/byte unit
ten data)
designation.
(d0)+3 Not used — — —
Sets the location in the file to start
writing when binary data is
selected (d0 = 0000H).
00000000H:
From the beginning of the file

00000001H to FFFFFFFEH:
From the specified address.
The unit for the value is
determined by word/byte unit
designation.
d0 BIN 16-bit
FFFFFFFFH:
Add to the ending of the file.

(d0)+4 00000000H
Location in file When data writing after CSV for- to User
(d0)+5 mat conversion is selected FFFFFFFFH
(d0 = 0100H):
For the High Performance model
QCPU with serial number „01111“
or lower (first 5 digits), always set
the beginning of the file
(00000000H).
For the High Performance model
QCPU with serial number „01112“
or higher (first 5 digits)/Process
CPU/Redundant CPU/Universal
model QCPU set the file position.
00000000H to FFFFFFFEH:
From the beginning of the file.
FFFFFFFFH:
Add to the ending of the file.
Sets the number of columns to
write data in CSV format.
Number of 0: No column setting.
(d0)+6 0 to 65535 User
columns Data is shown in a single row.
> 0: Data is shown in the specified
number of columns
Word/Byte 0: Word
(d0)+7 0, 1 User
designation 1: Byte

Programming MELSEC System Q and L series 7 – 589


SP.FWRITE Other convenient instructions

Variables Setting Data


Set data Meaning Range Set By Type
Head number of the device storing a file name.
Setting
Set data Item Meaning/Set Data Set By
Range
The file name consists of up to
8 characters + period + extension
(for example: ABD.BIN). The
s1 extension can be omitted. In this BIN 16-bit
case, the period („.“) can also be
(s1)+1 to Character
File name omitted. User
(s1)+n string
When more than 8 characters are
used, the extension is ignored
regardless of its presence. The
Extension „BIN“ or „CSV“ is
assigned automatically.
Head number of the device storing the data.
Setting
Set data Ietm Meaning/Set Data Set By
Range
Sets the number of data to be writ-
s2 ten (in units of words). This number 1 to 480 BIN 16-bit
Number of data to
(s2) should be designated in the unit of 1)
be written
words even when byte is selected 1 to 32767 User
in (d0)+7.
(s2)+1 to 0000H to
Data to be written Data requested to be written.
(s2)+n FFFFH
Bit device that goes ON after the execution of the SP.FWRITE instruction.
When an error occurs, (d1)+1 goes ON.

Set data Item Meaning/Set Data Setting Set By


Range
Indicates the completion of the
SP.FWRITE instruction.
d1 (d1) Completion signal — Bit
ON: Completed
OFF: Not completed
Indicates whether the SP.FWRITE System
instruction is normally completed
Error completion
(d1)+1 or abnormally completed. —
signal
ON: Error completion
OFF: Normal completion
1 Indicates the range applicable only for the Universal model QCPU and LCPU.

NOTES  For QCPU: Only the ATA card drive (2) can be set as s0 (drive designation).
Note that when the Flash card is loaded, the SP.FWRITE instruction cannot be used to per-
form writing. The SRAM card, standard RAM or standard ROM drive cannot be set.

For LCPU: Only the SD memory card drive (2) can be set as s0 (drive designation).
 The data written in CSV format is expressed as decimal value by the programming software.
For example, the character „A“ (41H) is written as 65. The available range is from -32768 to
32767.
 For binary write, the word-specified file position setting range is 00000000H to 7FFFFFFFH
and FFFFFFFFH.
 For the LCPU, this instruction cannot be executed while SM606 (SD memory card forced
disable instruction) is ON. Even if the instruction is attempted to be executed, the command
will be ignored.

7 – 590
Other convenient instructions SP.FWRITE

Functions Writing data to a designated file


SP.FWRITE Write data
The SP.WRITE instruction writes a specified number of data to the designated file. The user
can select whether to write data as binary data without any conversion or to convert binary data
into CSV-format data before writing it. (For QCPU, writing is only supported for ATA cards. For
LCPU, it is only supported for SD memory cards.)
The completion signal bit device (d1)+0 automatically turns ON after the completion of the
instruction is detected and the END instruction is executed. The bit device turns OFF at the
execution of the END instruction in the next scan. This bit device can be used as the execution
completion flag for the SP.FWRITE instruction.
When the SP.FWRITE instruction is completed abnormally, the error completion device (d1)+1
turns ON/OFF in synchronization with the execution completion flag (d1)+0. This bit device can
be used as error completion flag for the SP.FWRITE instruction.
SM721 is on during the execution of the instruction. The SP.FWRITE instruction cannot be star-
ted while SM721 is ON. If an attempt is made, no processing is performed. When an error is
detected prior to the execution of the instruction (before SM721 goes ON), the execution com-
pletion device [(d1)+0], the error completion device [(d1)+1] and SM721 do not turn ON.
The unit for the number of data to be written [(s2)+0] is „word“, regardless of the setting in
(d0)+7 (word/byte designation).
The following shows the method for writing binary data when No. of request write data and file
position are specified.

Control data

D0+0 H0000 Execution type


D0+1 - (Not used)
D0+2 K3 N0. of actually written data
D0+3 - (Not used)
Do+4 K1
D0+5 Location to start writing in the file

D0+6 - Number of columns


D0+7 K0 Word/byte designation
File data (in units of byte)
Number of data K3 H00
D1+0
H00
D1+1 H33 22 H22
H33
Data to be written D1+2 H55 44 H44
H55
D1+3 H77 66 H66
H77
H00
H00
H00

Programming MELSEC System Q and L series 7 – 591


SP.FWRITE Other convenient instructions

Writing of binary data


If the extension of the object file is omitted, „.BIN“ is added as an extension. When the desi-
gnated file does not exist, a new file is created and the data is added and saved from the begin-
ning of the file. The attributes of this new file are set using archive attributes.
When the size of the data exceeds that of the existing area in the file during the writing, the
excess data is added at the end of the file.
An error occurs if the designated location in the file is larger than the file size:
● The High Performance model QCPU with the serial number "01111" or lower (first 5 digits)
will issue an error code.
● The High Performance model QCPU with the serial number "01112" or higher (first 5 digits)/
Process CPU/Redundant CPU/Universal model QCPU/LCPU will not write any data and
will complete the instruction without an error message.
When the medium runs out of free space when data is added/saved, an error occurs. In such
a case, the data that is sucessfully added/saved remains in the medium. The error completion
is indicated after as much data as possible is added/saved.

Writing of data after CSV format conversion


If the extension of the object file is omitted, „.CSV“ is added as an extension.
When an existing file is designated and:
– the High Performance model QCPU with the serial number "01111" or lower (first 5 digits)
is used, all the contents of the file is deleted and the designated data is saved starting from
the beginning of the file.
– the High Performance model QCPU with the serial number "01112" or higher (first 5 digits)/
Process CPU/Redundant CPU/Universal model QCPU or LCPU is used, the module will
react depending of the value written in (d0)+4 and (d0)+5:
When other than FFFFFFFFH is specified in (d0)+4 and (d0)+5, the file contents will be
deleted and the data will be stored from the beginning of the file.
When FFFFFFFFH is specified in (d0)+4 and (d0)+5, the data is added to the end of the file.
When the designated file does not exist, a new file is created and the data is added/saved from
the beginning of the file. The attributes of this new file are set using archive attributes. An error
occurs when the medium runs out of free space when data is added/saved. In such a case, the
data that is sucessfully added/saved remains in the medium. The error completion is indicated
after as much data as possible is added/saved.
When the designated number of columns is „0“, the data is stored as single-row data in a CSV-
format file. The figure on the following page indicates such a case:

7 – 592
Other convenient instructions SP.FWRITE

D10 H0100 Execution type


D11 - Reserved

D12 K0
D13 - Not used
D14 K0
D15 K0
D16 K0 Number of columns

D17 K0 Word/byte designation (“word” is selected)

D20 H4241 File name:


D21 H4443 "ABCDE"
D22 H0045

Number of data to be written


D099 K7
D100 K0
D101 K10
D102 K20
D103 K30
D104 K40 Data to be written

D105 K50
D106 K100

Data to be written into the file

0 , 10 , 20 , 30 , 40 , -50 , 100 CR LF

Data to be read by EXCEL

A B C D E F G
1 0 10 20 30 40 -50 100

Programming MELSEC System Q and L series 7 – 593


SP.FWRITE Other convenient instructions

When data is written after CSV format conversion and the designated number of columns is
other than „0“, the data is stored as table data with the specified number of columns in a CSV
format file. The following figure shows an example:

D10 H0100 Execution type


D11 K0 Reserved
Number of actually written data (at normal completion, this value is the same
D12 K0
as the value for “Number of data to be written”)
D13 K0 Not used
D14 K0
D15 K0
D16 K3 Number of columns
D17 K0 Word/byte designation (“word” is selected)

D20 H4241 File name:


D21 H4443 "ABCD"
D22 H0000

Number of data to be written


D099 K7
D100 K0
D101 K10
D102 K20
D103 K30
D104 K40 Data to be written
D105 K-50
D106 K100

0 , 10 , 20 CR LF Data to be written into the file


30 , 40 , -50 CR LF
100 CR LF

Data to be read by EXCEL

A B C
1 0 10 20
2 30 40 -50
3 100

7 – 594
Other convenient instructions SP.FWRITE

The following two figures are showing examples of writing data with the following CPU modu-
les:
– High Performance model QCPU with serial number „01112“ and higher (first 5 digits)/
Process CPU/Redundant CPU/Universal model QCPU
– LCPU

Settings::
CSV format, 4 columns, Word data, Location in file: 0H (a new file is created)

Column 1 Column 2 Column 3 Column 4

Number of
K6 D0
write points
K1 D1
Starting row 1 , 2 , 3 , 4 CR LF K2 D2
K3 D3
K4 D4
K5 D5
3 , 4 CR LF
K6 D6
K5 D7
Unless the “number of write points” is set to a integral multiple of
“Number of columns”, the last row will not be filled completly. K7 D8
K8 D9
K9 D10
K10 D11
K11 D12
K12 D13

Settings::
CSV format, 3 columns, Word data, Location in file: FFFFFFFFH (add data to the end of the file)
If, in the addition mode, the number of columns is changed from that in previous write, the column numbers will be shifted..

K6 D0
Column 1 Column 2 Column 3 Column 4 K1 D1
1 , 2 , 3 , 4 CR LF K2 D2
K3 D3
K4 D4
Since the last row is always ended K5 D5
with „CR LF“, addition normally 3 , 4 CR LF
starts at the beginning of a new row. K6 D6
Number of
K8 D7
write points
K7 D8
Starting row 7 , 8 , 9 CR LF K8 D9
K9 D10
K10 D11

10 , 11 , 12 CR LF K11 D12
K12 D13
K13 D14
Unless the “number of write points”
is set to a integral multiple of K14 D15
“Number of columns”, the last 13 , 14 CR LF
row will not be filled completly.

NOTE Do not execute the SP.FWRITE instruction in an interrupt program.

Programming MELSEC System Q and L series 7 – 595


SP.FWRITE Other convenient instructions

Method for calculating the file size (total number of bytes) when a CSV format file is
written to the ATA card
Total number of bytes = Total bytes excluding final line + bytes of final line
Number of bytes on a line = number of columns1) + 1 + total bytes of all data values on line2)
1
For all lines but the final line, this is the specified number of columns. The number of columns on the
final line depends on the number of columns specified via the amount of data written. It is calculated as
follows.
(1) The number of lines excluding the final line is calculated.
Number of lines excluding final line = Amount of data in write request
+ number of columns (remainders discarded)
(2) The number of columns in the final line is calculated.
Number of columns in final line = Amount of data in write request
- number of lines excluding final line
* number of columns)
2 The number of bytes for each data value is calculated as shown below.

Sign of Data Value Bytes per Data Value Byte Count Range Examples
1 to 5 (word specified) 12345: 5 bytes
Positive Number of digits
1 to 3 (byte specified) 67: 2 bytes
2 to 6 (word specified) -12345: 6 bytes
Negative Number of digits + 1
2 to 4 (byte specified) -67: 3 bytes

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The drive specified by s0 contains a medium other than an ATA card.
(for QCPU) (Error code 4100)
● The drive specified by s0 contains a medium other than the SD Memory card.
(for LCPU) (Error code 4100)
● Values specified in the areas for control data are out of the setting range.
(Error code 4100)
● The value „number of data to be written“ in (s2)+0 is out of the setting range, or is larger
than the data stored in the area beginning with (s2)+1.
(Error code 4101)
● Free space in the ATA card is insufficient.
(for QCPU) (Error code 4100)
● Free space in the SD Memory card is insufficient.
(for LCPU) (Error code 4100)
● No free space is found when an attempt is made to create a new file. (Error code 4100)
● An invalid device is designated. (Error code 4004)
● Access error occurred in the ATA card.
(for QCPU) (Error code 4100)
● Access error occurred in the SD Memory card.
(for LCPU) (Error code 4100)
● An unusable value is set for a file name (s1). (Error code 4100)
● The attribute of a file name (s1) is "read only". (Error code 4100)
● The device specified by d0 or d1 exceeds the range of the corresponding device.
(For the Universal model QCPU, LCPU) (Error code 4101)

7 – 596
Other convenient instructions SP.FWRITE

Program SP.FWRITE (GX Works2)


Example 1
In the following program example, four bytes of binary data (00H, 01H, 02H, and 03H) are added
to file „ABCD.BIN“ when X10 turn ON. The memory card is inserted in drive 2.
Beginning with D0, eight points are reserved for control data.

1)

2)

3)

4)

5)

6)

7)

1
Setting of the execution/completion type (In this example: binary data)
2
Setting of the location in the file (In this example: data is added)
3
Setting of the file name, the extension „.BIN“ is added automatically.
4 Number of data to be written.

5 The data (00H, 01H, 02H, and 03H) is moved to the control data area.

6
Normal completion display
7
Error completion display

Programming MELSEC System Q and L series 7 – 597


SP.FWRITE Other convenient instructions

Program SP.FWRITE (GX Works2)


Example 2
When X10 is turned ON, the following program creates a file named „ABCD.CSV“ in the
memory card inserted to drive 2. Then, four bytes of data (00H, 01H, 02H and 03H) are written
as two-column table data in CSV format. Control data is stored from D0 onward (8 points).

1)

2)

3)

4)

5)

6)

7)

8)

0 , 1 , CR LF
, , Contents of the file to be written
2 3 CR LF

Data to be read by EXCEL

A B
1 0 1
2 2 3

1
Setting of the execution/completion type (In this example: CSV format)
2
Setting of the number of columns
3
Sets the data type specified
4 Setting of the file name, the extension „.CSV“ is added automatically.

5 Number of data to be written.

6
The data (00H, 01H, 02H, and 03H) is moved to the control data area.
7
Normal completion display
8 Error completion display

7 – 598
Other convenient instructions SP.FREAD

7.18.13 SP.FREAD

CPU High
Basic Process Redundant Universal LCPU
Performance
   1) 

1 Other than Q00UJCPU/Q00UCPU/Q01UCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special Constant
(System, User) File Direct J\ Function Index Register
Other
Register Module Zn K, H
Bit Word Bit Word U\G (16#) $

s0    — — — —  — —
d0 —   — — — — — — —
s1 —   — — — — — — —
d1 —   — — — — —  —
d2 1) 1) 1) — — — — — — —
1
Local devices and the devices designated for individual programs cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Programming MELSEC System Q and L series 7 – 599


SP.FREAD Other convenient instructions

Variables Setting Data


Set data Meaning Set By
Range Type
u0 Dummy (not used) — —
BIN 16-bit
s0 Drive designation 2 User
Head number of the device storing the control data.
The following control data is required.
Setting
Set data Item Meaning/Set Data Set By
Range
Specifies the execution type:
0000H: Read binary data 0000H
(d0) Execution type User
0100H: Read data after conversion 0100H
into CSV format
(d0)+1 (Reserved) Used by system — System
Sets the number of data to be read
(in units of words). This number 1 to 480
Number of data to
(d0)+2 should be designated in the unit of 1) User
be read
words even when byte is selected 1 to 32767
in (d0)+7.
(d0)+3 Not used — — —
Sets the location in the file to start
reading when binary data is
selected (d0 = 0000H).

00000000H:
From the beginning of the file
00000001H to FFFFFFFCH:
From the specified address.
The unit for the value is
determined by word/byte unit
designation.
FFFFFFFDH:
Setting disabled
d0 BIN 16-bit
When data reading after CSV
format conversion is selected
(d0)+4 (d0 = 0100H): 00000000H
Location in file For the High Performance model to User
(d0)+5
QCPU with serial number "01111" FFFFFFFFH
or lower (first 5 digits), always set
the beginning of the file
(00000000H).
For the High Performance model
QCPU with serial number "01112"
or higher (first 5 digits) / Process
CPU / Redundant CPU / Universal
model QCPU/LCPU set the file
position.
00000000H:
From the beginning of the file.
00000001H: to FFFFFFFEH:
From the specified address.
FFFFFFFFH:
Read continues, starting at the
previous read position
Sets the number of columns for the
data to be read.
0: No column setting.
Number of col- Data is considered to be in a
(d0)+6 0 to 65535 User
umns single row.
> 0: Data is considered to be a table
with the specified number of
columns
Word/Byte desig- 0: Word
(d0)+7 0, 1 User
nation 1: Byte

7 – 600
Other convenient instructions SP.FREAD

Variables Setting Data


Set data Meaning Range Set By Type
Head number of the device storing a file name.
Setting
Set data Item Meaning/Set Data Set By
Range
The file name consists of up to
8 characters + period + extension
(for example: ABD.BIN). The
s1 extension can be omitted. In this BIN 16-bit
case, the period („.“) can also be
(s1) to Character-
File name omitted. User
(s1)+n string
When more than 8 characters are
used, the extension is ignored
regardless of its presence. The
Extension „BIN“ or „CSV“ is
assigned automatically.
Head number of the device storing the data.
Setting
Set data Item Meaning/Set Data Set By
Range
Contains the number of actually
d1 Reading result BIN 16-bit
read data. The unit for the value is
(d1) (Number of read —
determined by word/byte unit des-
data) System
ignation.
(d1)+1 to
Data to be read Data requested to be read —
(d1)+n
Bit device that goes ON after the execution of the SP.FREAD instruction. When an error
occurs, (d1)+1 goes ON.
Setting
Set data Item Meaning/Set Data Range Set By

Indicates the completion of the


processing.
d2 (d2) Completion signal — Bit
ON: Completed
OFF: Not completed
Indicates whether the processing System
is normally completed or abnor-
Error completion
(d2)+1 mally completed. —
signal
ON: Error completion
OFF: Normal completion
1
Indicates the range applicable only for the Universal model QCPU and LCPU.

NOTE  For QCPU: Only the ATA card drive (2) can be set as s0 (drive designation).
Note that when the Flash card is loaded, the SP.FREAD instruction cannot be used to per-
form reading. The SRAM card, standard RAM or standard ROM drive cannot be set.

For LCPU: Only the SD memory card drive (2) can be set as s0 (drive designation).
 The data written in CSV format is expressed as decimal value by the programming software.
For example, the character „A“ (41H) is written as 65. The available range is from -32768 to
32767.
 For binary read, the word-specified file position setting range is 00000000H to 7FFFFFFFH.
 For the LCPU, this instruction cannot be executed while SM606 (SD memory card forced
disable instruction) is ON. Even if the instruction is attempted to be executed, the command
will be ignored.

Programming MELSEC System Q and L series 7 – 601


SP.FREAD Other convenient instructions

Functions Reading data from a designated file


SP.FREAD Read data
The SP.FREAD instruction reads a specified number of data from a designated file. The user
can select whether to read data as binary data without any conversion or to convert data from
the CSV-format into binary data before reading it. (For QCPU, reading is only supported for ATA
cards. For LCPU, it is only supported for SD memory cards.)
The completion signal bit device (d2)+0 automatically turns ON after the completion of the
instruction is detected and the END instruction is executed. The bit device turns OFF at the
execution of the END instruction in the next scan. This bit device can be used as the execution
completion flag for the SP.FREAD instruction.
When the SP.FREAD instruction is completed abnormally, the error completion device (d2)+1
turns ON/OFF in synchronization with the execution completion flag (d2)+0. This bit device can
be used as error completion flag for the SP.FREAD instruction.
SM721 is on during the execution of the SP.FREAD instruction. The SP.FREAD instruction can-
not be started while SM721 is ON. If an attempt is made, no processing is performed. When
an error is detected prior to the execution of the instruction (before SM721 goes ON), the exe-
cution completion device [(d2)+0], the error completion device [(d2)+1] and SM721 do not turn
ON.
The unit for the number of data to be read [(d0)+0] is „word“, regardless of the setting in (d0)+7
(word/byte designation).
The following figure illustrates the reading of binary data:

Control data

D0+0 H0000 Execution type (binary data)


D0+1 - Reserved
D0+2 K3 Number of data to be read
D0+3 - Not used
D0+4 K1
Location to start reading in the file
D0+5

D0+6 -
Number of columns
D0+7 K0 Word/byte designation

Data device File data (in units of byte)

D1+0 K3 H00
H11
Number of
actually D1+1 H33 22 H22
read data H33

Read data D1+2 H55 44 H44


H55
D1+3 H77 66 H66
H77
H88
H99
HAA

7 – 602
Other convenient instructions SP.FREAD

Reading of binary data


If the extension of the object file is omitted, „.BIN“ is added as an extension. When the desi-
gnated file does not exist, an error ocurs.
An error occurs if the designated location in the file is larger than the file size:
● The High Performance model QCPU with serial number "01111" or lower (first 5 digits) will
issue an error code.
● The High Performance model QCPU with serial number "01112" or higher (first 5 digits),
Process CPU, Redundant CPU, Universal model QCPU or LCPU will not read any data and
will complete the instruction without an error message.

Reading of data after CSV format conversion


The elements in the CSV-format file (cells for EXCEL) are read row by row. The numerical
values and character strings are converted into binary data and stored in the device. If the
extension of the file is omitted, „.CSV“ is added as an extension.
The reading starts at the specified position of the file. The number of elements to read is set in
the control data with (d0)+2.
When the designated file does not exist, an error occurs.
– When the last data of the file is reached before the specified number of data has been read,
a High Performance model QCPU with serial number "01111" or lower (first 5 digits) will
issue an error code.
– A High Performance model QCPU with serial number "01112" or higher (first 5 digits),
Process CPU, Redundant CPU, Universal model QCPU or LCPU will read the data that can
be read.
When the specified number of columns is „0“, the data is read by ignoring the rows in a CSV-
format file. The figure on the following page shows the handling of data in such a case.

Programming MELSEC System Q and L series 7 – 603


SP.FREAD Other convenient instructions

Data created by EXCEL

A B C
1 Main/sub item Measured value
2 1 3
3 Temperature -21

, , Measured value CR LF
Length , 1 , 3 CR LF
Temperature , -21 , CR LF

Instruction for reading the data

FREAD U0 K2 D10 D20 D99 M0

Device storing the read data


Device storing the file name
Device storing the control data
Control data

D10 H0100 Execution type

D11 - Reserved

D12 K9 Number of data to be read

D13 - Not used

D14 K0

D15 K0

D16 K0 Number of columns

D17 K0 Word/byte designation

D20 H4241 File name:

D21 H4443 "ABCD"

D22 H0000

Number of read data


D099 K9 Number of data actually read

Main/sub item D100 K0 Since this is not a numerical value, “0” is stored.

Data between , and , D101 K0 ““ Since this is not a numerical value, “0” is stored.

Measured value D102 K0 “Measured value” Since this is not a numerical value, “0” is stored.

Length D103 K0 “Length” Since this is not a numerical value, “0” is stored.

Read data 1 D104 K1 1 The numerical value is converted and stored.

3 D105 K3 3 The numerical value is converted and stored.

Temperature D106 K0 “ Temperature” Since this is not a numerical value, “0” is stored.

K-21 D107 K-21 -21 The numerical value is converted and stored.

Data between , and CR D108 K0 ““ Since this is not a numerical value, “0” is stored.

7 – 604
Other convenient instructions SP.FREAD

If the number of columns varies in each row, the data is also read by ignoring the rows. (EXCEL
does not create such files. This happens when a user modifies a CSV file.)

Main/sub item , , Measured value , Unit CR LF


Length CR LF
Temperature , -21 , CR LF Elements being outside of the designated
columns are ignored

Instruction for reading the data

FREAD U0 K2 D10 D20 D99 M0

Device storing the read data


Device storing the file name
Device storing the control data

Control data

D10 H0100 Execution type

D11 - Reserved

D12 K6 Number of data to be read

D13 - Not used

D14 K0

D15 K0

D16 K2 Number of columns

D17 K0 Word/byte designation

D20 H4241 File name:

D21 H4443 "ABCD"

D22 H0000

Number of read data


D099 K6 Number of actually read data

Main/sub item D100 K0 “Main/sub item” Since this is not a numerical value, “0” is stored.

Data between , and , D101 K0 ““ Since this is not a numerical value, “0” is stored.

Length D102 K0 “Length” Since this is not a numerical value, “0” is stored.
Read data
No data D103 K0 No data Since no element exists here, “0” is stored.

Temperature D104 K0 “Temperature” Since this is not a numerical value, “0” is stored.

K-21 D105 K-21 -21 The numerical value is converted and stored.

Programming MELSEC System Q and L series 7 – 605


SP.FREAD Other convenient instructions

When data is read after CSV format conversion and the designated number of columns is other
than „0“, the data is expected to be in a table with the specified number of columns. The ele-
ments being outside the specified columns are ignored.
The following figure illustrates such a case:

Data created by EXCEL

A B C
1 Main/sub item Measured value
2 Length 1 3
3 Temperature -21

Data saved in CSV format

Main/sub item , , Measured value CR LF

Length , 1 , 3 CR LF
Temperature , -21 , CR LF
Elements being outside of designated
columns are ignored .

Instruction for reading the data

FREAD U0 K2 D10 D20 D99 M0

Device storing the read data


Device storing the file name
Device storing the control data

Control data

D10 H0100 Execution type

D11 - Reserved

D12 K6 Number of data to be read

D13 - Not used

D14 K0

D15 K0

D16 K2 Number of columns

D17 K0 Word/byte designation

D20 H4241 File name:

D21 H4443 "ABCD"

D22 H0000

Number of read data


D099 K6 Number of data actually read

Main/sub item D100 K0 “Main/sub item” Since this is not a numerical value, “0” is stored.

Data between , and , D101 K0 ““ Since this is not a numerical value, “0” is stored.

Length D102 K0 “Length” Since this is not a numerical value, “0” is stored.
Read data
1 D103 K0 1 The numerical value is converted and stored.

Temperature D104 K0 "Temperature” Since this is not a numerical value, “0” is stored.

K-21 D105 K-21 -21 The numerical value is converted and stored.

7 – 606
Other convenient instructions SP.FREAD

If the number of columns varies in each row, the elements ouside of the designated columns
are ignored and „0“ is added to the places where elements do not exist.
If the number of rows in the file is less than specified by (d0)+2 (Number of data to be read) „0“
is added to the places where rows do not exist.

Main/sub item , , Measured value , Einheit CR LF


Length CR LF
Temperature , -21 , CR LF
Elements being outside of the designated
columns are ignored

Instruction for reading the data

FREAD U0 K2 D10 D20 D99 M0

Device storing the read data


Device storing the file name
Device storing the control data
Control data

D10 H0100 Execution type

D11 -

D12 K6 Number of data to be read

D13 - Not used

D14 K0

D15 K0

D16 K2 Number of columns

D17 K0 Word/byte designation

D20 H4241 File name:

D21 H4443 "ABCD"

D22 H0000

Number of read data


D099 K6 Number of data actually read

Main/sub item D100 K0 “Main/sub item” Since this is not a numerical value, “0” is stored.

Data between , and , D101 K0 ““ Since this is not a numerical value, “0” is stored.

Length D102 K0 “Length” Since this is not a numerical value, “0” is stored.
Read data
No data D103 K0 No data Since no element exists, “0” is stored.

Temperature D104 K0 “Temperature” Since this is not a numerical value, “0” is stored.

K-21 D105 K-21 -21 The numerical value is converted and stored.

Programming MELSEC System Q and L series 7 – 607


SP.FREAD Other convenient instructions

The following figures are to illustrate the case, when data is read separately several times from
the same file (continuation mode) using following CPU modules:
– High Performance model QCPU with serial number "01112" or higher (first 5 digits), Process
CPU, Redundant CPU or Universal model QCPU
– LCPU

Settings:
CSV format, 4 columns, word data, start of reading: at 2nd row, reading of 6 words and storing the data from D0 onwards

Column 1 Column 2 Column 3 Column 4

Row 1 1 , 2 , 3 , 4 CR LF K6 D0 Number of read data


K5 D1
K6 D2
Starting row. 5 , 6 , 7 , 8 CR LF K7 D3
K8 D4
K9 D5
Row 3 9 , 10 , 11 , 12 CR LF K10 D6
K8 D7
K7 D8
K8 D9
Row 4 13 , 14 , 15 , 16 CR LF K9 D10
K10 D11
K11 D12
Row 5 17 , 18 , 19 , 20 CR LF K12 D13

Settings:
CSV format, 4 columns, word data, start of reading: continue (FFFFFFFFH),
5 words are read and the data will be stored from D7 onward

K6 D0
K5 D1
Column 1 Column 2 Column 3 Column 4
K6 D2
Row 1 1 , 2 , 3 , 4 CR LF K7 D3
K8 D4
K9 D5
Row 2 5 , 6 , 7 , 8 CR LF K10 D6
K5 D7 Number of read data
Reading starts here K11 D8
K12 D9
Row 3 9 , 10 , 11 , 12 CR LF K13 D10
K14 D11
K15 D12
Row 4 13 , 14 , 15 , 16 CR LF K12 D13

Starting position for next reading

Row 5 17 , 18 , 19 , 20 CR LF

When read is performed in the continuation mode, the settings for data format, number of co-
lumns and word/byte designation must not differ from the settings for the previous reading.
During reading in the continuation mode the execution of other SP.FREAD or SP.FWRITE in-
structions must be disabled.

7 – 608
Other convenient instructions SP.FREAD

When data is read after CSV format conversion, numerical values are read and converted as
follows:

Word Device
Numerical Values in CSV Format
Without Sign With Sign
-32768 32768 -32768
| | |
-1 65535 -1
0 0 0
1 1 1
| | |
32767 32767 32767
32768 32768 -32768
| | |
65535 65535 -1

Numerical values which are out of range and elements other than numerical values in the
object CSV file are converted into „0“.

NOTE Do not execute the SP.FREAD instruction in an interrupt program.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The drive specified by s0 contains a medium other than an ATA card.
(for QCPU) (Error code 4100)
● The drive specified by s0 contains a medium other than the SD Memory card.
(for LCPU) (Error code 4100)
● Values specified in the areas for control data are out of the setting range (excluding d0+2).
(Error code 4100)
● The value „number of data to be read“ [(d0)+0] is out of the setting range.
(Error code 4101)
● An invalid device is designated. (Error code 4004)
● The file name specified by s1 does not exist in the designated drive. (Error code 2410)
● Size of read data exceeds the size of the reading device. (Error code 4101)
● When binary data is read, the number of data in the file is less than the size designated by
the number of data to read [(d0)+2].
(for High Performance model QCPU with serial number '01111' or lower (first 5 digits))
(Error code 4100)
● Access error occurred in the ATA card.
(for QCPU) (Error code 4100)
● Access error occurred in the SD Memory card.
(for LCPU) (Error code 4100)
● The device specified by d0 or d2 exceeds the range of the corresponding device.
(for Universal model QCPU, LCPU) (Error code 4101)

Programming MELSEC System Q and L series 7 – 609


SP.FREAD Other convenient instructions

Program SP.FREAD
Example 1
When X10 is turned ON, four bytes of binary data are read from the beginning of the file
„ABCD.BIN“. The file „ABCD.BIN“ is stored at a memory card which is inserted in drive 2.
From D0 onward, eight points are reserved for control data.
100 bytes are reserved from D20 for the read data.

1)

2)

3)

4)

5)

6)

1
Setting of the execution/completion type
2 Setting of the number of data to read
3
Head address in the file (start reading at the beginning of the file)
4
Transfer of the file name to the control data
5 Normal completion display

6
Error completion display

7 – 610
Other convenient instructions SP.FREAD

Program SP.FREAD
Example 2
The following program reads data from the file „ABCD.CSV“, which is stored at the memory
card in drive 2 when X10 is turned ON. The contents of the file is two-column table data in CSV
format. The file contains numerical values only.
From D0 onward, eight points are reserved for control data.
For the read data, 100 bytes are reserved from D20.

1)

2)

3)

4)

5)

6)

1
Setting of the execution/completion type (CSV format for this example)
2
Setting of the number of data to read
3 Setting of the number of columns

4
Transfer of the file name to the control data
5
Normal completion display
6 Error completion display

Programming MELSEC System Q and L series 7 – 611


SP.DEVST Other convenient instructions

7.18.14 SP.DEVST

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n1 —   — — — —  —
s —   — — — — — —
n2 —   — — — —  —
1) 1)
d  —  — — — — — —
1
Devices assigned as local devices can not be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

SP.DEVST n1 s n2 d

Variables Set data Meaning Data Type


n1 Write offset of the device data storage file (specified in units of 16-bit words) BIN 32-bit
s Head device number written to the standard ROM Device name
n2 The number of write points BIN 16-bit
d+0: Completion device
d bits
d+1: Error completion device

7 – 612
Other convenient instructions SP.DEVST

Functions Writing data to Standard ROM


SP.DEVST Write data
Writes device data for the number of points specified at n2 of the device s to the write offset,
which is specified for n1, of the device data storage file in the standard ROM. n1 is the offset
from the head of device data storage file and specified by word offset (in units of 16-bit words).

Standard ROM

Write offset (n1) Device data


Head device storage file
number (s) Write offset of device
data storage file

Write
16-bit
offset
Number of +0
(n2) points +1
+2

Since the device data write position completion device (d+0) in the standard ROM automati-
cally turns ON at execution of the END instruction, which detects the completion of this instruc-
tion, and turns OFF with the END instruction of next scan, it is used as an execution completion
flag of this instruction.
When this instruction is completed in error, the error completion device (d+1) turns ON/ OFF
at the same timing with the completion device (d+0). This device is used as an error completion
flag of this instruction.
SM721 turns ON during execution of this instruction. When SM721 has already turned ON, this
instruction can not be executed (if executed, no processing is performed). When an error is
detected at execution of this instruction, the completion device (d+0), error completion device
(d+1) and SM721 do not turn ON.

NOTE The value written to the standard ROM is the value at execution of this instruction.
The standard ROM write count index (SD687 and SD688) is increased by the execution of the
SP.DEVST instruction. If the standard ROM write count index exceeds hundred thousand
times, FLASH ROM ERROR (error code 1610) occurs.
To prevent the number of ROM writes from increasing due to executing instruction carelessly,
set the specification of writing to standard ROM instruction count (SD695) to restrict the num-
ber of writes a day. Exceeding the number of writes (the default values are 36 times.) set cau-
ses OPERATION ERROR (error code 4113).

Programming MELSEC System Q and L series 7 – 613


SP.DEVST Other convenient instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The write offset specified at n1 is out of the device data storage file range.
(Error code 4100)
● The number of n2 points from the write offset specified at n1 is out of the device data storage
file range.
(Error code 4100)
● The range for the number of n2 points from the device s exceeds the corresponding device.
(Error code 4141)
● The device data storage file is not set at "PLC file" of PLC parameter.
(Error code 2410)
● The device specified by d exceeds the range of the corresponding device.
(Error code 4101)

Program SP.DEVST
Example
The following program writes the ten points of data from D100 to the device data storage file in
the standard ROM when M0 turns ON.

Ladder diagram

7 – 614
Other convenient instructions S.DEVLD, SP.DEVLD

7.18.15 S.DEVLD, SP.DEVLD

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constants
Register Module Zn E Other
Bit Word Bit Word U\G
n1 —   — — — —  —
d —   — — — — — —
n2 —   — — — —  —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

S.DEVLD n1 d n2

Variables Set data Meaning Data Type


n1 Read offset of the device data storage file (specified in units of 16-bit words) BIN 32-bit
d Head device number read from the standard ROM Device name
n2 Number of reading points. BIN 16-bit

Programming MELSEC System Q and L series 7 – 615


S.DEVLD, SP.DEVLD Other convenient instructions

Functions Read data from Standard ROM


SP.DEVLD Read data
Reads device data for the number of points specified at n2 from the read offset, which is spe-
cified for n1, of the device data storage file in the standard ROM, and stores the data to the
device specified for d. n1 is the offset from the head of device data storage file and specified
by word offset (in units of 16-bit words).

Standard ROM

Device data
Head device Read offset (n1) storage file
number (d) Read offset of device
data storage file

Read
16-bit
offset
Number of +0
points (n2) +1
+2

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The address specified at n1 is out of the standard ROM range.
(Error code 4100)
● The number of n2 points from the address specified at n1 is out of the standard ROM range.
(Error code 4100)
● The range for the number of n2 points from the device d exceeds the corresponding device.
(Error code 4101)
● The device data storage file is not set at "PLC file" of PLC parameter.
(Error code 2410)

Program SP.DEVLD
Example
The program which reads the ten points of data from D100 from the device data storage file in
the standard ROM when M0 turns ON.

Instruction List Ladder diagram

7 – 616
Other convenient instructions PLOADP

7.18.16 PLOADP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —
1)
d  — — — — — — — —
1
Local devices cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set data Meaning Data Type


Drive number storing the program to be loaded, character string data of the file
s BIN 16-bit
name, or head number of the device storing the character string data
d Device turned ON for 1 scan after completion of the instruction bits

NOTE The file system is not supported by the GX IEC Developer.

Programming MELSEC System Q and L series 7 – 617


PLOADP Other convenient instructions

Functions Loading of a program from a memory card


PLOADP Load program
The PLOADP instruction moves a program which is stored in a memory card or standard mem-
ory to the internal memory (drive 0) and places the program in the standby status. The memory
card can be inserted in drive 1, 2 or 4. Drive 0 must have continuous free space.
The lowest program number in the CPU which is vacant is used as the program number of the
added program. The program numbers can be checked with the programming tool by reading
the program list. A program number for the added program can be specified by storing a num-
ber in SD720.
The following example assumes that "MAIN6" is added by the PLOADP instruction.
When the program numbers have been set consecutively, the new program is added at the end
of the preset program numbers. When programs No. 1 to 5 have been set, the new program is
added as program No. 6.

Program No. Name Program No. Name


1 MAIN1 1 MAIN1
2 MAIN2 Adds "MAIN6" by the 2 MAIN2
3 MAIN3 PLOADP instruction.
3 MAIN3
4 MAIN4 4 MAIN4
5 MAIN5 5 MAIN5
6 MAIN6 Added at the end.

When there are multiple open program numbers, the program designated by the PLOADP
instruction is added to the lowest number among them to be added. (The open program num-
bers are made when programs are deleted by the PUNLOADP instruction.) When programs
No. 2 and 4 are open, the new program is added as program No. 2.

Program No. Name Program No. Name


1 MAIN1 1 MAIN1
2 Adds "MAIN6" by the 2 MAIN6 Added to the smallest
empty program
3 MAIN3 PLOADP instruction.
3 MAIN3 number .
4 4
5 MAIN5 5 MAIN5

It is unnecessary to designate the extension „.QPG“ to the file name.


The bit device specified by d goes ON during the END processing of the scan where the
PLOADP instruction is completed. The bit device goes OFF during the next END processing.
The program instructions PLOADP, PUNLOADP and PSWAPP cannot be used simulta-
neously. If two or more instructions are executed, the instruction issued later will not be exe-
cuted. Establish interlocks to avoid such a case.
The PLOADP instruction cannot be executed during an interrupt progam.
To execute the program that was transferred to the program memory with the PLOADP instruc-
tion, the PSCAN instruction must be executed.

7 – 618
Other convenient instructions PLOADP

The PLC file settings of the loaded program are set as follows:
● File usage for each program: All usage of the file register, device initial value, comment, and
local device of the loaded program is set at „Use PLC file setting“.
However, if „Use local device“ is designated in the PLC file setting and programs are loaded,
an error occurs every time the number of executed programs exceeds the number of
parameter-set programs.
To use local devices in the loaded program, register a dummy file in the parameter, delete
the dummy file with the PUNLOADP instruction, then load the program with the PLOADP
instruction.
● I/O refresh setting:
The I/O refresh setting for the loaded program is „Disabled“ for both input and output.
Writing during RUN is not executed during the execution of the PLOADP instruction, but ece-
cuted after the instruction is completed. Conversely, the PUNLOADP instruction is not exe-
cuted during the writing during RUN, but executed after the writing during RUN is completed.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The file name does not exist at the drive number specified by s.
(Error code 2410)
● The drive number specified by s is invalid.
(Error code 4100)
● There is not enough memory to load the specified program in drive 0.
(Error code 2413)
● The number of programs shown below are already registered in the program memory.
(Error code 4101)
● The program number stored in SD720 is already used, or larger than the largest program
number shown below.
(Error code 4101)
Type of CPU Program Memory (Number of files) Largest Program Number
Q02(H) 28 28
Q06H 60 60
Q12H
Q25H 124 124
Q12PH
Q25PH

● A program file which has the same name as the program file to be loaded already exists.
(Error code 2410)
● The file size of the local devices cannot be reserved.
(Error code 2401)

Programming MELSEC System Q and L series 7 – 619


PLOADP Other convenient instructions

Program PLOADP
Example
When M0 is ON in the following program, the program „ABCD.QPG“ is transferred from drive
4 to drive 0 and placed in standby status.

Instruction List Ladder Diagram

7 – 620
Other convenient instructions PUNLOADP

7.18.17 PUNLOADP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s —   — — — —  —
1)
d  — — — — — — — —
1
Local devices cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set data Meaning Data type


Character string data of the program file name to be unloaded, or head number
s BIN 16-bit
of the device storing the character string data
d Device turned ON for 1 scan after completion of the instruction Bit

NOTE The file system is not supported by the GX IEC Developer.

Programming MELSEC System Q and L series 7 – 621


PUNLOADP Other convenient instructions

Functions Unloading of a program from program memory


PUNLOADP Unload program
The PUNLOADP instruction is used to delete a standby program stored in the program
memory (drive 0). The standby program being executed by the PSCAN instruction cannot be
deleted.
The program No. deleted by the PUNLOADP instruction is made "Empty". In the following
example program MAIN2 (program No. 2) is deleted.

Program No. Name Program No. Name


1 MAIN1 1 MAIN1
2 MAIN2 Deletes "MAIN2" by the 2 MAIN2 is deleted.
3 MAIN3 PUNLOADP instruction
3 MAIN3
4 MAIN4 4 MAIN4
5 MAIN5 5 MAIN5

It is unnecessary to designate the extension „.QPG“ to the file name.


The bit device specified by d goes ON during the END processing of the scan where the PUN-
LOADP instruction is completed. The bit device goes OFF during the next END processing.
The program instructions PLOADP, PUNLOADP and PSWAPP cannot be used simulta-
neously. If two or more instructions are executed, the instruction issued later will not be exe-
cuted. Establish interlocks to avoid such a case.
If the power supply for the CPU is switched OFF and than turned ON again, or the CPU module
is reset after the program deletion, the following operation is performed.
● When boot setting has been made in the PLC parameter dialog box, the program where the
boot setting has been made is transferred to the program memory. When the program
deleted by the PUNLOADP instruction is not to be executed, delete the corresponding
program name from the boot setting and program setting of the PLC parameter dialog box.
● When boot setting has not been made in the PLC parameter dialog box, "FILE SET ERROR
(error code 2400)" occurs.
When the program deleted by the PUNLOADP instruction is not to be executed, delete the
corresponding program name from the program setting of the PLC parameter dialog box.
When the program deleted by the PUNLOADP instruction is to be executed again, write the
corresponding program to the CPU module.
The PUNLOADP instruction cannot be executed during a interrupt progam.
The program to be deleted from the program memory with the PUNLOADP instruction should
be placed in standby status with the PSTOP instruction before.
Writing during RUN is not executed during the execution of the PUNLOADP instruction, but
ececuted after the instruction is completed. Conversely, the PUNLOADP instruction is not exe-
cuted during the writing during RUN, but executed after the writing during RUN is completed.

7 – 622
Other convenient instructions PUNLOADP

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The file name specified by s does not exist.
(Error code 2410)
● The program designated by s is not in standby status or is being executed.
(Error code 4101)
● The program specified by s is the only one in the program memory.
(Error code 4101)

Program PUNLOADP (GX Works2)


Example
The following program deletes the program „ABCD.QPG“ stored in drive 0 from the memory
when M0 turns from OFF to ON.

Instruction List Ladder Diagram

Programming MELSEC System Q and L series 7 – 623


PSWAPP Other convenient instructions

7.18.18 PSWAPP

CPU High
Basic Process Redundant Universal LCPU
Performance
 

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn $ Other
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — —  

d 1) — — — — — — — —
1
Local devices cannot be used.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set data Meaning Data Type


Character string data of the program file name to be unloaded, or head number
s1 BIN 16-bit
of the device storing the character string data
Drive number storing the program to be loaded, character string data of the file
s2 BIN 16-bit
name, or head number of the device storing the character string data
d Device turned ON for 1 scan after completion of the instruction Bit

NOTE The file system is not supported by the GX IEC Developer.

7 – 624
Other convenient instructions PSWAPP

Functions Unloading of a program from program memory and loading of a program


PSWAPP Unload program and load program
The PSWAPP instruction deletes (unloads) a standby program from the program memory
(drive 0). The program to be deleted is specified by s1. The program set as the "scan execution
type" with the PSCAN instruction or the program set as the "low speed execution type" with the
PLOW instruction cannot be deleted. After the deletion, a program stored in drive 1, 2, or 4 is
transferred ro the program memory and placed in standby status. This program is specified by
s2. The program memory drive 0 must have continuous free space before loading the program.
The program number of the deleted program is used for the loaded program.
It is unnecessary to designate the extension „.QPG“ to the file name.
The bit device specified by d goes ON during the END processing of the scan where the
PSWAPP instruction is completed. The bit device goes OFF during the next END processing.
The program instructions PLOADP, PUNLOADP and PSWAPP cannot be used simulta-
neously. If two or more instructions are executed, the instruction issued later will not be exe-
cuted.
Establish interlocks to avoid such a case.
If the power supply for the CPU is switched OFF and than turned ON again, or the CPU module
is reset after the program swap, the following operation is performed.
● When boot setting has been made in the PLC parameter dialog box, the program where the
boot setting has been made is transferred to the program memory.
When the program replaced by the PSWAPP instruction is to be executed, change the boot
setting and program setting of the PLC parameter dialog box for the corresponding prgram
name.
● When boot setting has not been made in the PLC parameter dialog box, "FILE SET ERROR
(error code 2400)" occurs.
When the program replaced by the PSWAPP instruction is to be executed, change the
program setting of the PLC parameter dialog box for the corresponding program name.
To execute the program set in the program setting of the PLC parameter dialog box, write
the corresponding program to the CPU module again.
The PSWAPP instruction cannot be executed during a interrupt progam.
The PLC file settings of the loaded program are set as follows:
● All usage of the file register, device initial value, comment, and local device of the swapped
program is set to „Use PLC file setting“.
● The I/O refresh setting for the swapped program is „Disabled“ for both input and output.
Writing during RUN is not executed during the execution of the PSWAPP instruction, but ece-
cuted after the instruction is completed. Conversely, the PSWAPP instruction is not executed
during the writing during RUN, but executed after the writing during RUN is completed.

Programming MELSEC System Q and L series 7 – 625


PSWAPP Other convenient instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The drive number or the file specified by s1 or s2 does not exist. (Error code 2410)
● The drive number specified by s1 is invalid. (Error code 4100)
● There is not enough capacity in the program memory (drive 0) to load the specified program.
(Error code 2413)
● The program designated by s1 is not in standby status or is being executed.
(Error code 4101)

Program PSWAPP (GX Works2)


Example
When M0 turns from OFF to ON in the following program example, the progam „EFGH.QPG“
is deleted from the program memory. Than the program „ABCD.QPG“ is loaded from drive 4,
stored in the program memory, and placed in standby status.

Instruction List

Ladder Diagram

7 – 626
Other convenient instructions RBMOV, RBMOVP

7.18.19 RBMOV, RBMOVP

CPU High
Basic Process Redundant Universal LCPU
Performance
   1)

1 Universal model QCPU: Other than Q00UJCPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s       — — —
d       — — —
n         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set data Meaning Data type


s Head number of the device storing the data to be transferred
d Head number of the destination device BIN 16-bit
n Number of data to be transferred

Programming MELSEC System Q and L series 7 – 627


RBMOV, RBMOVP Other convenient instructions

Functions High-speed block transfer of file register


RBMOV/RBMOVP Block transfer
The RBMOV instruction batch transfers „n“ points of 16-bit data starting from the device spe-
cified by s to the area of „n“ points starting from the device specified by d.

The transfer is possible even if there is an overlap between the source and destination devices.
For the transmission to the smaller devices, the data is transferred from s. For the transmission
to the larger device number, the data is transferred from s+(n-1).
However, as shown in the example below, when transferring data from R to ZR, or from ZR to
R, the range to be transferred (source) and the range of destination must not overlap.
– ZR transfer range:
((specified head No. of ZR) to
(specified head No. of ZR + the number of transfers -1))
– R transfer range:
((specified head No. of R + file register block No. x 32768) to
(specified head No. of R + file register block No. x 32768 + the number of transfers -1))
Example: Transfer ranges of ZR and R overlap when transferring 10000 points of data from ZR30000
(source) to R10 (block No.1 of the destination).
– ZR transfer range: (30000) to (30000+10000-1) = (30000) to (39999)
– R transfer range: (10+ (1 x 32768)) to (10+(1 x 32768) +10000-1)
= (32778) to (42777)
Therefore, the range 32778 to 39999 overlaps and data are not transferred correctly.

Source of transfer Destination of transfer


ZR0 R0

Overlapped Block No. 0

ZR30000 R32767
ZR39999 R10

R10009 Block No. 1

7 – 628
Other convenient instructions RBMOV, RBMOVP

If s is a word device and d is a bit device, the object for the word device will be the number of
bits designated by the bit devive digit designation. For example, when „K1Y30“ is specified by
d, the lower four bits of the word device specified by s are the object.

If bit devices are specified by s and d, the number of digits must be the same for s and d.

Programming MELSEC System Q and L series 7 – 629


RBMOV, RBMOVP Other convenient instructions

NOTE The RBMOV and the RBMOVP instructions are useful to batch transfer a large quantity of file
register data with the QnHCPU/QnPHCPU/QnPRHCPU. With the QnUCPU, this instruction is
similar to the BMOV instruction.
The comparision of processing speed between RBMOV and BMOV instructions is as follows:
 Transfer from file registers to internal devices/internal devices to file registers
Target 1 Word 1000 Words 10000 Words
memory
CPU Instruction where File
Register is Min. Max. Min. Max. Min. Max.
stored
Standard RAM 20.0 µs 91.0 µs 775.0 µs
RBMOV SRAM card 22.0 µs 305.0 µs 2900.0 µs
QnHCPU Flash card 1) 22.5 µs 405.0 µs 3950.0 µs
QnPHCPU
QnPRHCPU Standard RAM 7.5 µs 76.2 µs 720.0 µs
BMOV SRAM card 384.0 µs 3900.0 µs
8.0 µs
1) 418.0 µs 4250.0 µs
Flash card
Standard RAM 45.5 µs 215.0 µs 1850.0 µs
RBMOV SRAM card
49.5 µs 540.0 µs 5150.0 µs
Flash card 1)
QnCPU
Standard RAM 17.5 µs 177.0 µs 1700.0 µs
BMOV SRAM card 500.0 µs 5050.0 µs
18.0 µs
1) 572.0 µs 5800.0 µs
Flash card
Standard RAM 12.2 µs 34.9 µs 121.5 µs 145.1 µs 1111.5 µs 1135.1 µs
2) — — — — — —
RBMOV SRAM card
2) — — — — — —
Q00UCPU Flash card
Q01UCPU Standard RAM 7.3 µs 13.8 µs 116.5 µs 124.2 µs 1106.5 µs 1114.2 µs
2) — — — — — —
BMOV SRAM card

Flash card 2) — — — — — —
Standard RAM 9.4 µs 31.3 µs 118.5 µs 141.3 µs 1108.5 µs 1131.3 µs
RBMOV SRAM card 9.4 µs 31.4 µs 178.5 µs 201.3 µs 1708.5 µs 1731.3 µs
1) 9.4 µs 32.1 µs 278.5 µs 301.3 µs 2708.5 µs 2731.3 µs
Flash card
Q02UCPU
Standard RAM 5.0 µs 11.6 µs 114.5 µs 122.3 µs 1104.5 µs 1112.3 µs
BMOV SRAM card 5.1 µs 11.7 µs 174.5 µs 182.3 µs 1704.5 µs 1712.3 µs
1) 5.0 µs 11.6 µs 274.5 µs 282.3 µs 2704.5 µs 2712.3 µs
Flash card
Standard RAM 11.3 µs 16.8 µs 120.7 µs 127.1 µs 1110.7 µs 1117.1 µs
RBMOV SRAM card 11.2 µs 16.7 µs 180.7 µs 187.1 µs 1710.7 µs 1717.1 µs
1) 11.3 µs 16.8 µs 280.7 µs 287.1 µs 2710.7 µs 2717.1 µs
Flash card
Q03UD(E)CPU
Standard RAM 4.8 µs 6.6 µs 114.7 µs 117.1 µs 1104.7 µs 1107.1 µs
BMOV SRAM card 4.8 µs 6.6 µs 147.7 µs 177.1 µs 1704.7 µs 1707.1 µs
1) 4.8 µs 6.5 µs 274.7 µs 277.1 µs 2704.7 µs 2707.1 µs
Flash card
Standard RAM 9.2 µs 15.1 µs 61.0 µs 68.6 µs 531.0 µs 538.6 µs
Q04UD(E)HCPU
Q06UD(E)HCPU RBMOV SRAM card 9.4 µs 15.6 µs 165.0 µs 172.6 µs 1576.0 µs 1583.6 µs
Q10UD(E)HCPU 1)
Q13UD(E)HCPU Flash card 9.4 µs 15.7 µs 260.0 µs 267.6 µs 2526.0 µs 2533.6 µs
Q20UD(E)HCPU Standard RAM 4.1 µs 5.6 µs 56.0 µs 58.6 µs 526.0 µs 528.6 µs
Q26UD(E)HCPU
Q50UDEHCPU BMOV SRAM card 4.5 µs 6.1 µs 160.0 µs 162.6 µs 1571.0 µs 1573.6 µs
Q100UDEHCPU 1)
Flash card 4.3 µs 6.2 µs 255.0 µs 257.6 µs 2521.0 µs 2523.6 µs

1
When file registers are stored in the Flash card, no processing is performed for transfer from internal
devices to file registers.
2
Unusable for the Q00UCPU and Q01UCPU.

7 – 630
Other convenient instructions RBMOV, RBMOVP

 Transfer from file registers to file registers


Target 1 Word 1000 Words 10000 Words
memory
CPU Instruction where File
Register is Min. Max. Min. Max. Min. Max.
stored
Standard RAM 20.0 µs 91.0 µs 775.0 µs
RBMOV
QnHCPU SRAM card 22.5 µs 545.0 µs 5300.0 µs
QnPHCPU
QnPRHCPU Standard RAM 7.5 µs 77.0 µs 720.0 µs
BMOV
SRAM card 8.5 µs 692.0 µs 7050.0 µs
Standard RAM 45.5 µs 215.0 µs 1850.0 µs
RBMOV
SRAM card 50.0 µs 870.0 µs 8350.0 µs
QnCPU
Standard RAM 17.5 µs 179.0 µs 1700.0 µs
BMOV
SRAM card 18.5 µs 839.0 µs 8600.0 µs
Standard RAM 12.6 µs 35.3 µs 232.5 µs 256.1 µs 2211.5 µs 2235.1 µs
RBMOV
Q00UCPU SRAM card 1) — — — — — —
Q01UCPU Standard RAM 7.7 µs 14.2 µs 227.5 µs 234.2 µs 2206.5 µs 2214.2 µs
BMOV
1) — — — — — —
SRAM card
Standard RAM 9.6 µs 31.5 µs 228.5 µs 252.3 µs 2208.5 µs 2231.3 µs
RBMOV
SRAM card 9.6 µs 31.5 µs 378.5 µs 401.3 µs 3708.5 µs 3731.3 µs
Q02UCPU
Standard RAM 5.2 µs 11.8 µs 224.5 µs 232.3 µs 2204.5 µs 2212.3 µs
BMOV
SRAM card 5.2 µs 11.8 µs 374.5 µs 382.3 µs 3704.5 µs 3712.3 µs
Standard RAM 11.2 µs 16.7 µs 230.7 µs 237.1 µs 2210.7 µs 2217.1 µs
RBMOV
SRAM card 11.6 µs 16.7 µs 380.7 µs 387.1 µs 3710.7 µs 3717.1 µs
Q03UD(E)CPU
Standard RAM 4.9 µs 6.7 µs 224.7 µs 227.1 µs 2204.7 µs 2207.1 µs
BMOV
SRAM card 5.2 µs 6.7 µs 374.7 µs 377.1 µs 3704.7 µs 3707.1 µs
Q04UD(E)HCPU Standard RAM 9.3 µs 15.5 µs 118.0 µs 124.6 µs 1102.0 µs 1107.6 µs
Q06UD(E)HCPU RBMOV
SRAM card 9.7 µs 15.5 µs 365.0 µs 371.6 µs 3571.0 µs 3578.6 µs
Q10UD(E)HCPU
Q13UD(E)HCPU Standard RAM 4.3 µs 6.2 µs 113.0 µs 115.6 µs 1096.0 µs 1098.6 µs
Q20UD(E)HCPU
Q26UD(E)HCPU BMOV
Q50UDEHCPU SRAM card 4.5 µs 6.1 µs 360.0 µs 362.6 µs 3566.0 µs 3568.6 µs
Q100UDEHCPU
1 Unusable for the Q00UCPU and Q01UCPU.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● The device range of „n“ points starting from s or d exceeds the available device.
(Error code 4101)
● The file register is not designated for both s and d.
(Error code 4101)

Programming MELSEC System Q and L series 7 – 631


RBMOV, RBMOVP Other convenient instructions

Program RBMOVP
Example 1
The following program transfers the lower four bits (b0 through b3) of data in D66 through D69
to the outputs Y30 through Y3F with the rising edge of SM402. The number of data (4 blocks)
is specified by n.
The bit patterns show the structure of bits before and after the transfer.

Instruction List

Ladder Diagram

1
These bits are ignored.

7 – 632
Other convenient instructions RBMOV, RBMOVP

Program RBMOVP
Example 2
With leading edge from SM402, the following program transfers data at X20 through X2F to
D100 through D103. The number of blocks (4) to be transferred is determined by the constant
K4.
The bit patterns show the structure of bits before and after the transfer.

Instruction List

Ladder Diagram

Programming MELSEC System Q and L series 7 – 633


UMSG Other convenient instructions

7.18.20 UMSG

CPU High
Basic Process Redundant Universal LCPU
Performance


Devices Usable Devices


Internal Devices Indirect MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register specifi- Module Zn $ Other
Bit Word cations Bit Word U\G
s —    — — — — 1) —
1
Only strings can be used

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2
UMSG s

Variables Set data Meaning Data Type


String to display on display unit, or lead number (string) of device storing string to
s —
display

7 – 634
Other convenient instructions UMSG

Functions User message


UMSG User message
The string data specified by s is displayed as a user message in the display unit.
The string specified directly by s (surrounded by double quotation marks (")) or the string from
the device number specified by s until the device number storing "00H" is displayed.

b15 b8 b7 b0
s 2nd char 1st char
s +1 4th char 3rd char
User message
s +2 6th char 5th char
Process A complete
s +3 8th char 7th char
s +4 10th char 9th char
Run UMSG
instruction
Message appears
00H on display unit

Indicates end
of string

Strings of up to 128 single-byte characters can be displayed in the display unit.


The user message is displayed when the UMSG instruction command is rising.
If the string is changed while the command is on, then the modified user message will appear
in the display unit.
The string specified by the UMSG instruction is displayed upon END processing. If two or more
UMSG instructions are executed, then the last UMSG instruction executed before the END is
valid. If two or more programs are running, then the last UMSG instruction to be executed is
valid.
This instruction is not processed if it is run when no display unit is mounted.
If the "ESC" key on the display unit is pressed while a user message is being displayed, the
displayed message will disappear. To display the message again, execute "User Message"
from the menu screen on the display unit.
If a NULL code (00H) is specified as the argument to this instruction, then any message cur-
rently being displayed will disappear. The procedure for specifying a NULL code (00H) in the
instruction parameter is as follows:

Specifying a NULL code (00H)

See the MELSEC-L CPU Module User's Manual (Function Explanation, Program Fundamen-
tals) for details about the display unit.

Programming MELSEC System Q and L series 7 – 635


UMSG Other convenient instructions

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error code
Errors is stored into SD0.
● When there is no NULL code (00H) within the range of the target device following the device
number specified by s.
(Error code 4101)
● When more than 128 single-byte characters are specified in the s string.
(Error code 4100)

Program UMSG
Example 1
This program displays the string stored after D10 on the display unit, when X10 is set to "on".

Instruction List Ladder Diagram

b15 b8 b7 b0
D10 4CH (i) 69H (L)
D11 6EH (e) 65H (n)
D12 2DH (A) 41H (-) User message
D13 20H (w) 77H ( )
Line-A working
D14 6FH (r) 72H (o)
D15 6BH (i) 69H (k)
Run UMSG
D16 6EH (g) 67H (n) instruction
D17 00H

Program UMSG
Example 2
This program displays "Line-A Working" on the display unit when M0 is set to "on".

Instruction List Ladder Diagram

"Line-A Working"

b15 b8 b7 b0
60H 82H
89H 83H
43H 83H
"Line-A working"

User message
93H 83H
40H 81H Line-A working
5EH 89H
5DH 93H Run UMSG
86H 92H instruction
0000 H

7 – 636
Other convenient instructions UMSG

Program UMSG
Example 3
This program displays "Line-B stop" on the display unit when X10 is set to "on", and clears the
message when X10 is set to "off".

Instruction List Ladder Diagram

"Line-B stop"

X10 set to "ON" X10 set to "OFF"

User message
Line-B stop

Programming MELSEC System Q and L series 7 – 637


UMSG Other convenient instructions

7 – 638
Categories of instructions

8 Data Link Instructions


8.1 Categories of instructions
The following table gives an overview of the data link instructions:

Category Meaning
Network refresh instructions Instructions for data refresh operations in network modules.
Read/Write routing information Read and write routing parameters (network number and station
number of relay station, station number of routing station).

8.2 Data refresh instructions


The following instructions refresh data in network modules. The following table gives an over-
view of the instructions:

MELSEC-Instruction MELSEC-Instruction
Function in in
MELSEC-Editor IEC-Editor
S.ZCOM
SP.ZCOM
Instructions for Network refresh
S.ZCOM
SP.ZCOM

The ZCOM instruction is used to perform refresh at any timing during execution of a sequence
program.
The targets of refresh performed by the ZCOM instruction are indicated below.
● Refresh of CC-Link IE (when refresh parameters are set) (QCPU only)
● Refresh of MELSECNET/H (when refresh parameters are set) (QCPU only)
● Auto refresh of CC-Link (when refresh device is set)
● Auto refresh of intelligent function module (when auto refresh is set)

NOTE In this section, instruction names are abbreviated as follows if not specified particularly:
S(P).ZCOM ==> ZCOM.

Programming MELSEC System Q and L series 8–1


S.ZCOM, SP.ZCOM Data refresh instructions

8.2.1 S.ZCOM, SP.ZCOM

CPU High
Basic Process Redundant Universal LCPU
Performance
     

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
— — — — — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


Jn Network number for host station (QCPU only).
BIN 16-bit
Un Head I/O number of host station network.

8–2
Data refresh instructions S.ZCOM, SP.ZCOM

Functions Network data refresh


S.ZCOM Data refresh in network modules
On execution of the ZCOM instruction the CPU suspends processing the sequence program
and refreshes the data in the network modules specified by Jn and Un.
(Specification cannot be made via Jn for LCPU.)

1
Execution of the ZCOM instruction
2
Data refresh
The ZCOM instruction does not perform the following processing.
● Communication processing between CPU module and programming tool
● Monitor processing of other station
● Read processing of buffer memory of other intelligent function module by serial communi-
cation module.
● Low-speed cyclic data transmission of MELSECNET/H

PLC to PLC network (Controller network in CC-Link IE controller network) (QCPU only)
In cases where the scan time of the sequence program of the host station exceeds the scan
time of the other stations, the ZCOM instruction ensures that the data from the other station is
incorporated properly.
The following figure shows an example for data communication without applying the ZCOM
instruction:

1 Program of the control station


2
Program scan of the linked station
3
Program of the normal station

The following figure shows an example for data communication applying the ZCOM instruction:

1
Program of the control station
2
Program scan of the linked station
3
Program of the normal station

For details of the transmission delay time on the PLC to PLC network (Controller network in
CC-Link IE controller network), refer to the corresponding manuals of the network modules.

Programming MELSEC System Q and L series 8–3


S.ZCOM, SP.ZCOM Data refresh instructions

In cases where the scan time of the object station exceeds the scan time of the sequence pro-
gram, the ZCOM instruction does not improve data communication.

END

1) 0 ZCOM END 0 ZCOM END 0 ZCOM 0 ZCOM END

2)

1 Sequence program
2
Scan time of the object station

Remote I/O network (QCPU only)


The link refresh of the remote master station is performed by the "END processing" of the CPU
module. Since link scan is performed at completion of link refresh, link scan 'synchronizes' with
the program of the CPU module.
When the ZCOM instruction is used at the remote master station, link refresh is performed at
the point of ZCOM instruction execution, and link scan is performed at completion of link
refresh. Hence, use of the ZCOM instruction at the remote master station speeds up send/
receive processing to/from the remote I/O station.
The following figure shows an example for data communication without applying the ZCOM
instruction:

1) 0 END 0 END 0 END 0


Link refresh

2)
Link refresh
3)

I/O refresh
4)
Auto refresh
5)

1
Program of the remote master station
2
Link scan
3
Remote I/O station network refresh
4
I/O module
5
Intelligent function module

8–4
Data refresh instructions S.ZCOM, SP.ZCOM

The following figure shows an example for data communication applying the ZCOM instruction:

ZCOM ZCOM ZCOM

1) 0 END 0 END 0 END 0

Link
2)
refresh

Link refresh
3)

I/O refresh
4)

Auto refresh
5)

1
Program of the remote master station
2 Link scan
3
Remote I/O station network refresh
4
I/O module
5
Intelligent function module

The ZCOM instruction may be executed any times within a sequence program. However, note
that each execution increases the scan time of the sequence program by the execution time of
the data refresh.
Designating "Un" in the argument enables the access not only to network modules but also to
intelligent function modules. In this case, the automatic refresh is performed for the buffer
memory of the intelligent function module (replaces the FROM/TO instructions).
Only with the Universal model QCPU and LCPU, interruption of processing is enabled during
the execution of the ZCOM instruction. However, when refresh data are used in an interrupted
program, the data can split.

NOTES The ZCOM instruction cannot be used in a fixed cycle execution type program or interrupt pro-
gram.
The Redundant CPU has restrictions on use of the ZCOM instruction. Refer to the manual of the
redundant system for details.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The specified network number is not connected to the host station.
(Error code 4102)
● The module for the specified I/O number is not a network unit or link unit.
(Basic model QCPU, High Performance model QCPU, Process CPU, and Redundant CPU)
(Error code 2111)
● The module for the specified I/O number is not a network unit or link unit.
(Universal model QCPU, LCPU)
(Error code 4102)

Programming MELSEC System Q and L series 8–5


S.ZCOM, SP.ZCOM Data refresh instructions

NOTE To conduct only communication with peripheral device, use the COM instruction.

Program S.ZCOM
Example 1
While X0 is set, the following program refreshes data in the network module with the network
number 6.

Ladder Diagram

Program S.ZCOM
Example 2
While X0 is set, the following program refreshes data in the network module at the I/O numbers
X/Y30 through X/Y4F.

Ladder Diagram

8–6
Reading and writing routing information

8.3 Reading and writing routing information


These instructions read and write routing information. The routing parameters comprise net-
work and station number of the relay station and the station number of the routing station.

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
S.RTREAD RTREAD_M
Read routing information
SP.RTREAD RTREADP_M
S.RTWRITE RTWRITE_M
Write routing information
SP.RTWRITE RTWRITEP_M

NOTE In this section, instruction names are abbreviated as follows if not specified particularly:
 S(P).RTREAD ==> RTREAD
 S(P).RTWRITE ==> RTWRITE

Programming MELSEC System Q and L series 8–7


S.RTREAD, SP.RTREAD Reading and writing routing information

8.3.1 S.RTREAD, SP.RTREAD

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n    — — — —  —
d —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
n Destination network of transmission (1 to 239). BIN 16-bit ANY16
Device Array [0..2] of
d First number of device storing read routing information.
number ANY16

8–8
Reading and writing routing information S.RTREAD, SP.RTREAD

Functions Reading routing information


S.RTREAD Read instruction
The S.RTREAD instruction reads the routing information from the destination network speci-
fied by n. The routing information is stored in routing parameters. The read routing information
is stored from d+0 (Array_d[0]) onwards.
If no data is specified for the transmission the value 0 is written to the devices specified from d
on (Array_d[0] through Array_d[2]).
The figure below shows the contents specified from d+0 (Array_d[0]) on:

1 Network number of relay station


2
Station number of relay station
(see table below for range)
3
Dummy

Network type Specification range for relay station number


MELSECNET/H 1 to 64
CC-Link IE controller network 1 to 120
 Master station: Fixed at 125. (The fixed value is stored.)
CC-Link IE field network  Local station: 1 to 120 (A station number is stored.)

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data value specified for n does not range within 1 and 239. (Error code 4100)
● The device specified by d exceeds the range of the corresponding device.
(For the Universal model QCPU only) (Error code 4101)

Program S.RTREAD
Example
While X0 is set, the following program reads the routing information from the network specified
by D0.

Ladder Diagram

Operation Content of routing parameter settings


Transfer Relay station no.
D0 1 destination network
Relay network no.
no.

D1 10 1 10 3
D2 3 2 10 2
D3 Dummy 3 10 1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

Programming MELSEC System Q and L series 8–9


S.RTWRITE, SP.RTWRITE Reading and writing routing information

8.3.2 S.RTWRITE, SP.RTWRITE

CPU High
Basic Process Redundant Universal LCPU
Performance
   

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n    — — — —  —
s —   — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Data Type


Set Data Meaning
MELSEC IEC
n Destination network of transmission (1 to 239). BIN 16-bit ANY16
Device Array [0...2]
s First number of device storing routing information to be written.
number of ANY16

8 – 10
Reading and writing routing information S.RTWRITE, SP.RTWRITE

Functions Writing routing information


S.RTWRITE Write instruction
The S.RTWRITE instruction writes the routing information to the destination network specified
by n. The routing information is stored in routing parameters. The read routing information is
stored from s+0 (Array_s[0]) onwards.
If data for the destination network is set in the routing parameters, it is used to refresh the data
stored from s+0 (Array_s[0]) on.
If all data in s or later (s+0 to s+2) is 0, the data for the transfer destination network number
specified by n is deleted from the routing parameters.
The figure below shows the contents specified from s+0 (Array_d[0]) on:

1 Network number of relay station


2
Station number of relay station
(see table below for range)
3
DUMMY

Network type Specification range for relay station number


MELSECNET/H 1 to 64
CC-Link IE controller network 1 to 120
 Master station: Fixed at 125. (The fixed value is stored.)
CC-Link IE field network
 Local station: 1 to 120 (A station number is stored.)

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● The data value specified for n does not range within 1 and 239. (Error code 4100)
● The data specified by s exceed the relevant ranges. (Error code 4100)
● When the total number of routing information registered in the routing parameter of the
network parameters and routing information registered with the RTWRITE instruction
exceeds 64. (Error code 4100)
● The device specified by s exceeds the range of the corresponding device.
(For the Universal model QCPU only.) (Error code 4101)

Programming MELSEC System Q and L series 8 – 11


S.RTWRITE, SP.RTWRITE Reading and writing routing information

Program S.RTWRITE
Example
While X0 is set, the following program writes the routing information stored in D1 through D3
as routing parameters to the network specified by D0.

Ladder Diagram

Operation Content of routing parameter settings


D0 1 Transfer Relay network no. Relay station no.
destination network
no.

D1 20 1 20 1
D2 3 2 10 2
D3 Dummy 3 10 1

NOTE This program example will not run without variable definition in the header of the program
organization unit (POU). It would cause compiler or checker error messages. For details see
section 3.5.2 "Addressing of arrays and registers in the GX IEC Developer" of this manual.

8 – 12
9 Multiple CPU Dedicated Instructions
Following instructions are available for use in a multi-CPU system:

MELSEC-Instruction MELSEC-Instruction
Function in in
MELSEC-Editor IEC-Editor
S.TO TO_S_M
SP.TO TO_SP_M

Write to CPU shared memory of host TO


station TOP
DTO
DTOP
FROM FROM_M

Read from CPU shared memory of FROMP FROMP_M


another station DFRO
DFROP

Programming MELSEC System Q and L series 9–1


Writing to the CPU shared memory of host CPU

9.1 Writing to the CPU shared memory of host CPU


The S.TO or TO instruction is used to write to the CPU shared memory of the host station in
the multiple CPU system.
The following table indicates the usability of the S.TO and TO instructions.

CPU Module Type Name S.TO Instruction TO Instruction


Q00JCPU — —
Basic model QCPU
Q00CPU, Q01CPU  

Q02CPU, Q02HCPU,
High Performance model
Q06HCPU, Q12HCPU,  —
QCPU
Q25HCPU
Q02PHCPU, Q06PHCPU,
Process CPU  —
Q12PHCPU, Q25PHCPU
Redundant CPU Q12PRHCPU, Q25PRHCPU — —
Q00UJCPU — —
Q00UCPU, Q01UCPU,
Q02UCPU, Q03UDCPU,
Q04UDHCPU, Q06UDHCPU,
Q10UDHCPU, Q13UDHCPU,
Q20UDHCPU, Q26UDHCPU,
Universal model QCPU Q03UDECPU, Q04UDEHCPU,
Q06UDEHCPU,  
Q10UDEHCPU,
Q13UDEHCPU,
Q20UDEHCPU,
Q26UDEHCPU,
Q50UDEHCPU,
Q100UDEHCPU
LCPU L02CPU, L26CPU-BT — —

 Usable
— Not usable

Operation of S.TO instruction


The S.TO instruction can write data to the CPU shared memory of the host CPU module.
The following figure shows the processing performed when the S.TO instruction is executed in
CPU No. 1.

Intelligent function
CPU No.1 CPU No. 2 module

Device Data CPU Device CPU Buffer


memory write shared memory shared memory
memory memory

[ SP.TO H3E0 n2 n3 n4 d ]

Designation of CPU shared memory in CPU No. 1

9–2
Writing to the CPU shared memory of host CPU

Operation of the TO instruction


The TO instruction can write device memory data to the following memories.
● CPU shared memory of host CPU module
● Buffer memory of intelligent function module
The following figure shows the processing performed when the TO instruction is executed in
CPU No. 1.

Intelligent function
CPU No.1 CPU No. 2 module

Device Data CPU Device CPU Buffer


memory write shared memory shared memory
memory memory

Writes data

[ TO H3E0 n2 s n3 ]

Designation of CPU shared memory in CPU No. 1

[ TO H0 n2 s n3 ]

Designation of intelligent function module

NOTE Both of the S.TO and TO instructions can be used for the Basic model QCPU (Q00CPU or
Q01CPU) and Universal model QCPU to write data to the CPU shared memory. However, use
of the TO instruction is recommended, since use of S.TO instruction increases the number of
steps and processing time.
Refer to section 7.8.2 when writing to the buffer memory of the intelligent function module by the
TO instruction.

Programming MELSEC System Q and L series 9–3


S.TO, SP.TO Writing to the CPU shared memory of host CPU

9.1.1 S.TO, SP.TO

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 2)  

1 Basic model QCPU:The first 5 digits of serial No is "04122" or higher.


2
High performance model QCPU: Function version B or later.

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1 —   — — — —  —
n2 —   — — — —  —
n3 —   — — — — — —
n4 —   — — — —  —
d    — — — — — —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

Variables Set Data Meaning Data Type


n1 Head I/O number of the host CPU
First number of CPU shared memory address area to be written to
 Basic model QCPU: 0 to 511
n2
 High Performance model QCPU, Process CPU, Universal model QCPU:
0 to 4095
BIN16-bit
n3 First number of device area storing data to be written.
Number of data to be written
 Basic model QCPU: 1 to 320
n4
 High Performance model QCPU, Process CPU: 1 to 256
 Universal model QCPU: 1 to 2048
d Bit device which is turned ON for one scan after the instruction is executed Bit

9–4
Writing to the CPU shared memory of host CPU S.TO, SP.TO

Functions Writing data to the CPU shared memory


S.TO/SP.TO Write data
The S.TO instruction writes data to the user’s area in the shared memory of the CPU which is
executing the S.TO instruction (host station). The destination adress in the shared memory is
entered in n2. The data is taken from a device area in the same CPU, starting from the number
specified in n3. The number of data words is specified in n4.
The S.TO instruction cannot be used for writing data directly to another CPU in a multi-CPU
system.

Device memory of Shared memory of


host station host station

n3 n2

n4

● CPU shared memory address of the Basic model QCPU

CPU shared memory

0 (0H) Host CPU operation information area


Writing of data by the user
96 (60H) System area
is prohibited for this area
192 (C0H) Host CPU refresh area 1)

User‘s free area Writing is allowed in this


area
511 (1FFH)

1
Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.

Programming MELSEC System Q and L series 9–5


S.TO, SP.TO Writing to the CPU shared memory of host CPU

● CPU shared memory address of the High Performance model QCPU, Process CPU and
Universal model QCPU (Data cannot be written to the multiple CPU high speed transmission
area of the Universal model QCPU with the S(P).TO instruction)

CPU shared memory

0 (0H) Host CPU operation information area


Writing of data by the user
512 (200H) System area
is prohibited for this area
2048 (800H) Host CPU refresh area 1)

User‘s free area Writing is allowed in this


area
4095
(0FFFH)

1 Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.

When the number of write points is entered in n4 as „0“, processing of the instruction is not
performed and the completion device, specified in d, does not turn on, either.
Only one S.TO instruction may be executed in one scan by each CPU. However, automatic
handshaking makes sure that only the instruction called first will be processed, if two or more
S.TO instructions are enabled simultaneously.
The number of data that can be written varies depending on the target CPU module.
CPU Module Number of Write Points
Basic model CPU 1–320
High Performance model QCPU, Process CPU 1–256
Universal model QCPU 1–2048

The head I/O number of the CPU is determined by the slot in which the CPU module is loaded.
Only the first 3 digits of the head I/O number are entered in n1.
Slot of the base unit CPU 0 1 2
Number of the CPU in multi-CPU system 1 2 3 4
Head I/O number 3E00 3E10 3E20 3E30
Contents of n1 3E0 3E1 3E2 3E3

NOTE Writing data to CPU shared memory can be performed using the intelligent function module de-
vice.
For intelligent function module device, refer to the QnUCPU User's Manual (Function Explana-
tion, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explana-
tion, Program Fundamentals).

9–6
Writing to the CPU shared memory of host CPU S.TO, SP.TO

Operation In the following cases an operation error occurs, the error flag is set, and the corresponding error
Errors code is stored in SD0:
● When the specified data is outside the following range. (Error code 4101)
– The number of write points specified in n4 is outside the specified range of the setting data.
– The beginning of the CPU shared memory specified in n2 is larger than the CPU shared
memory adress range.
– The beginning of the CPU shared memory specified in n2 plus the number of write points
specified in n4 exceeds the CPU shared memory adress range.
– The first device number (n3) where the data to be written is stored plus the number of
write points specified in n4 exceeds the device range.
● When the host CPU operation information area, system area or host CPU refresh area is
specified to the CPU shared memory address (n2) of the write destination
(High Performance model QCPU, Process CPU) (Error code 4101)
(Basic model QCPU, Universal model QCPU) (Error code 4111)
● The value stored in n1 is not the head I/O-number of the CPU performing the S.TO
instruction.
(High Performance model QCPU, Process CPU) (Error code 2107)
(Basic model QCPU, Universal model QCPU) (Error code 4112)
● No CPU module is installed at the position specified by the head I/O number of the CPU
module. (Error code 2110)
● The number stored in n1 is other than a correct head I/O number (3E0H, 3E1H, 3E2H or
3E3H). (Error code 4100)
● The specified instruction is improper. (Error code 4002)
● The specified number of devices is wrong. (Error code 4003)
● An unusable device was specified. (Error code 4002)

Program SP.TO
Example
The data stored in CPU1 in the data registers D0 to D9 is written into the shared memory of
the same CPU, beginning at adress Adresse 800H when X0 turns ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Programming MELSEC System Q and L series 9–7


TO, TOP, DTO, DTOP Writing to the CPU shared memory of host CPU

9.1.2 TO, TOP, DTO, DTOP

CPU High
Basic Process Redundant Universal LCPU
Performance
1) 

1 Q00CPU/Q01CPU whose first 5 digits of the serial No. is "04122" or higher

Devices Usable Devices


Internal Devices MELSECNET/H Special
Other
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
n1         

n2         —
s    — — — —  —
n3         —

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

TO/DTO n1 n2 s n3

Variables Set Data Meaning Data Type


Head I/O number of the host CPU
n1  Basic model QCPU: 3E0H
 Universal model QCPU: 3E0H to 3E3H
First number of CPU shared memory address area to be written to
n2  Basic model QCPU: 192 to 511
 Universal model QCPU: 2048 to 4095, 10000 to 243351) BIN16-bit

s Data to be written or first number of device area storing data to be written.


Number of data to be written
n3  Basic model QCPU: TO(P): 1 to 320, DTO(P) : 1 to 160
 Universal model QCPU: TO(P): 1 to 143361), DTO(P) : 1 to 71681)
1
The setting range varies depending on the auto refresh setting range of the multiple CPU high speed
transmission function.

9–8
Writing to the CPU shared memory of host CPU TO, TOP, DTO, DTOP

Functions Writing data to the host station CPU shared memory


TO/TOP Write data
Writes device data of words s to n3 to the CPU shared memory address specified by n2 of the
host CPU module or later address.

Device memory of Shared memory of


host station host station

s n2

n3

When a constant is designated to s, the instruction writes the same data (value designated to
s) to the area of n3 words starting from the specified CPU shared memory.
Following figure shows an example when the constant 5 is designated to s.

2)
1) 0
s 5
n2 5
5 3)
5

1 Constant
2
CPU shared memory of host CPU (n1)
3
n3 words (same data is written)

The head I/O number of the CPU is determined by the slot in which the CPU module is loaded.
Only the first 3 digits of the head I/O number are entered in n1.
Slot of the base unit CPU 0 1 2
Number of the CPU in multi-CPU system 1 2 3 4
Head I/O number 3E00 3E10 3E20 3E30
Contents of n1 3E0 3E1 3E2 3E3

NOTE Writing data to CPU shared memory can be performed using the intelligent function module
device.
For intelligent function module device, refer to the QnUCPU User's Manual (Function Explana-
tion, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explana-
tion, Program Fundamentals).

Programming MELSEC System Q and L series 9–9


TO, TOP, DTO, DTOP Writing to the CPU shared memory of host CPU

● CPU shared memory address of the Basic model QCPU

CPU shared memory

0 (0H) Host CPU operation information area


Writing of data by the user
96 (60H) System area
is prohibited for this area
192 (C0H) Host CPU refresh area 1)

User‘s free area Writing is allowed in this


area
511 (1FFH)

1 Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.

● CPU shared memory address of the Universal model QCPU

CPU shared memory

0 (0H) Host CPU operation information area


Writing of data by the user
512 (200H) System area
is prohibited for this area
2048 (800H) Host CPU refresh area 1)

User‘s free area Writing is allowed in this


area
4096 (1000H)
10000 (2710H) Unusable

Multiple CPU Writing is allowed in this


high speed transmission area 2) area

24335 (5F0FH)

1
Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.
2 Data cannot be written to the multiple CPU high speed transmission area with the Q02UCPU

When the number of write points in n3 is „0“, processing of the instruction is not performed.
The number of data that can be written varies depending on the target CPU module.
CPU Module Number of Write Points
Basic model CPU 1–320
Universal model QCPU 1–14336

9 – 10
Writing to the CPU shared memory of host CPU TO, TOP, DTO, DTOP

DTO/DTOP Write data


Writes device data of words s to (n3x2) to the CPU shared memory address specified by n2 of
the host CPU module or later address.

Device memory of Shared memory of


host station host station

s n2

n3x2

When a constant is designated to s, the instruction writes the same data (value designated to
s) to the area of n3x2 words starting from the specified CPU shared memory.
Following figure shows an example when the constant 5 is designated to s.

2)
1) 0
s 5
n2 5
5 3)
5

1
Constant
2
CPU shared memory of host CPU (n1)
3 n3x2 words (same data is written)

When the number of write points in n3 is „0“, processing of the instruction is not performed.
The number of data that can be written varies depending on the target CPU module.
CPU Module Number of Write Points
Basic model CPU 1–160
Universal model QCPU 1–7168

NOTE Writing data to CPU shared memory can be performed using the intelligent function module de-
vice.
For intelligent function module device, refer to the QnUCPU User's Manual (Function Explana-
tion, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function Explana-
tion, Program Fundamentals).

Programming MELSEC System Q and L series 9 – 11


TO, TOP, DTO, DTOP Writing to the CPU shared memory of host CPU

Operation In the following cases an operation error occurs, the error flag is set, and the corresponding error
Errors code is stored in SD0:
● When the specified data is outside the following range.
(Error code 4101)
– The number of write points specified in n3 is outside the specified range of the setting data.
– The beginning of the CPU shared memory specified in n2 plus the number of write points
specified in n3 exceeds the CPU shared memory adress range.
– The first device number (s) where the data to be written is stored plus the number of write
points specified in n3 exceeds the device range.
– When the head of CPU shared memory address (n2) of the write destination host CPU is
outside the write permitted area.
● When the head of CPU shared memory address (n2) of the write destination host CPU is
an invalid value. (Error code 4111)
● The value stored in n1 is not the head I/O-number of the host CPU. (Exclude the case when
the multiple CPU high speed transmisson area of other CPU is used.)
(Error code 4112)
● No CPU module is installed at the position specified by the head I/O number of the CPU
module.
(Error code 2110)

Program TOP
Example 1
The following program stores 10 points of data from D0 into address 10000 of the CPU shared
memory of CPU No. 1 when X0 is turned ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program DTOP
Example 2
The following program stores 20 points of data from D0 into address 10000 of the CPU shared
memory of CPU No. 4 when X0 is turned ON.

MELSEC Instruction List Ladder Diagram IEC Instruction List

9 – 12
Read from CPU shared memory of another station

9.2 Read from CPU shared memory of another station


The FROM/FROMP/DFRO/DFROP instructions of Multiple CPU system can read from the fol-
lowing memories:
● Buffer memory of intelligent function module
● CPU shared memory of other CPU module
● CPU shared memory of host CPU module (applicable for the Basic model QCPU and
Universal model QCPU)
The following figure shows the processing performed when the FROM(P) instruction is exe-
cuted in CPU No. 1.

Intelligent function
CPU No.1 CPU No. 2 module

Device Data CPU Device CPU Buffer


memory read 1) shared memory shared memory
memory memory

Reads data

[ FROM H3E1 n1 n2 d n3]

Designation of CPU shared memory in CPU No. 2

[ FROM H3E0 n1 n2 d n3]

Designation of CPU shared memory in CPU No. 1

[ FROM H0 n1 n2 d n3]

Designation of intelligent function module


1
Applicable for the Basic model QCPU and Universal model QCPU

NOTE Refer to section 7.8.1 for reading the buffer memory of the intelligent function module with the
FROM/DFRO instruction.

Programming MELSEC System Q and L series 9 – 13


FROM, FROMP, DFRO, DFROP Read from CPU shared memory of another station

9.2.1 FROM, FROMP, DFRO, DFROP

CPU High
Basic Performance Process Redundant Universal LCPU
1) 2)
   

1
Basic model QCPU:The first 5 digits of serial No is "04122" or higher.
2
High performance model QCPU: Function version B or later.

Devices Usable Devices


Internal Devices MELSECNET/H Special Other
(System, User) File Direkt J\ Function Index Register Constant
Register Module Zn K, H (16#)
Bit Word Bit Word U\G U
n1 —        

n2 —        —
d —   — — — — — —
n3 —        —

GX IEC
1

Developer MELSEC Instruction List Ladder Diagram IEC Instruction List ,

GX Works2

Variables Set Data Meaning Data type


Head I/O adress of the CPU which stores the data to be read
 Basic model QCPU: 3E0H to 3E2H
n1
 High Performance model QCPU, Process CPU, Universal model QCPU:
3E0H to 3E3H
First address of data to be read in CPU shared memory
 Basic model QCPU: 0 to 512
n2
 High Performance model QCPU, Process CPU: 0 to 4095
BIN 16 bit
 Universal model QCPU: 0 to 4095, 10000 to 243351)
d First number of memory address area where the read data will be stored
Number of data words to read
 Basic model QCPU: FROM(P): 1 to 512, DFRO(P): 1 to 256
n3
 High Performance model QCPU, Process CPU: FROM(P): 1 to 4096
 Universal model QCPU: FROM(P): 1 to 143361), DFRO(P) : 1 to 71681)
1 The setting range varies depending on the auto refresh setting range of the multiple CPU high speed
transmission function.

9 – 14
Read from CPU shared memory of another station FROM, FROMP, DFRO, DFROP

Functions Reading from shared memory of another CPU


FROM/FROMP Read word data
In a multi-CPU system the FROM instruction is used to read word data from the user’s free area
of the shared memory of another CPU. The head adress of this CPU is specified in n1. Enter
the number of words to be read in n3. The starting adress in the shared memory of the other
CPU is specified in n2. The data will be stored in the CPU which executes the FROM instruction
starting from the device specified in d.

Device memory Shared memory of the


CPU specified in n1

d n2

n3
Reads the data
of n3 words

The head I/O number of the CPU is determined by the slot in which the CPU module is loaded.
Only the first 3 digits of the head I/O number are entered in n1.
Slot of the base unit CPU 0 1 2
Number of the CPU in multi-CPU system 1 2 3 4
Head I/O number 3E00 3E10 3E20 3E30
Contents of n1 3E0 3E1 3E2 3E3

● CPU shared memory address of the Basic model QCPU

CPU shared memory

0(0H) Host CPU operation information area


96(60H) System area
192(C0H) Host CPU refresh area 1)
Reading is allowed in this
area
User‘s free area

511(1FFH)

1 Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.

Programming MELSEC System Q and L series 9 – 15


FROM, FROMP, DFRO, DFROP Read from CPU shared memory of another station

● CPU shared memory address of the High Performance model QCPU and Process CPU

CPU shared memory

0 (0H) Host CPU operation information area


512 (200H) System area
2048 (800H) Host CPU refresh area 1)
Reading is allowed in this
area
User‘s free area

4095 (0FFFH)

1 Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.

● CPU shared memory address of the Universal model QCPU

CPU shared memory

0 (0H) Host CPU operation information area


512 (200H) System area
2048 (800H) Host CPU refresh area 1)
Reading is allowed in this
area
User‘s free area

4096 (1000H)
10000 (2710H) Unusable

Multiple CPU Reading is allowed in this


high speed transmission area 2)
area

24335 (5F0FH)

1
Usable as a user free area when auto refresh setting is not made. In addition, even when auto refresh
setting is made, the auto refresh send range or later is usable as a user free area.
2
Data cannot be read from the multiple CPU high speed transmission area with the Q02UCPU

Processing of the instruction is not performed when the number of read data is entered in n3
as „0“.
The number of data that can be read varies depending on the target CPU module.
CPU Module Number of Read Points
Basic model CPU 1–512
Universal model QCPU 1–14336

9 – 16
Read from CPU shared memory of another station FROM, FROMP, DFRO, DFROP

DFROM/DFROMP Read word data


Reads the data of (n3×2) words from the CPU shared memory address designated by n2 of
the CPU module designated by n1, and stores that data into the area starting from the device
designated by d.

Device memory Shared memory of the


CPU specified in n1

d n2

n3
Reads the data
of (n3x2)
words

Processing of the instruction is not performed when the number of read data is entered in n3
as „0“.
The number of data that can be read varies depending on the target CPU module.
CPU Module Number of Read Points
Basic model CPU 1–256
Universal model QCPU 1–7168

NOTES Reading data from CPU shared memory can be performed using the intelligent function module
device. (For intelligent function module device, refer to the QnUCPU User's Manual (Function
Explanation, Program Fundamentals) or Qn(H)/QnPH/QnPRHCPU User's Manual (Function
Explanation, Program Fundamentals).)
The QCPU provides automatic interlocks for the FROM and TO instructions.

Programming MELSEC System Q and L series 9 – 17


FROM, FROMP, DFRO, DFROP Read from CPU shared memory of another station

Operation In the following cases an operation error occurs, the error flag (SM0) is set, and the correspon-
Errors ding error code is stored in SD0:
● When the specified data is outside the following range.
(Error code 4101)
– The beginning of the CPU shared memory adress (n2) from where read will be performed
is greater than the CPU shared memory range.
– The in n2 specified beginning of the CPU shared memory plus the number of read points
(n3) exceeds the CPU shared memory range.
– The read data storage device number (d) plus the number of read points (n3) is greater
than the specified device range.
● No CPU module exists in the position specified with the head I/O number in n1.
(Error code 2110)
● When the head of CPU shared memory address (n2) which performs reading is an invalid
value. (Error code 4101)

Program FROM
Example 1
When XO is set, 10 datawords are read from the shared memory of CPU No. 2, starting from
address 800H. The data is stored in the data registers D0 to D9 of the CPU processing the
FROM instruction.

MELSEC Instruction List Ladder Diagram IEC Instruction List

Program DFROP
Example 2
When XO is set, 20 datawords are read from the shared memory of CPU No. 4, starting from
address 10000. The data is stored in the area starting from D0 of the CPU processing the in-
struction.

MELSEC Instruction List Ladder Diagram IEC Instruction List

9 – 18
Overview

10 Multiple CPU Device Write/Read


Instructions
Dedicated Instructions for Multiple CPU high-speed transmission

MELSEC-Instruction MELSEC-Instruction
Function in in
MELSEC-Editor IEC-Editor
D.DDWR
Writing devices to another CPU
DP.DDWR
D.DDRD
Reading devices from another CPU
DP.DDRD

10.1 Overview
The multiple CPU high-speed transmission dedicated instruction directs the Universal model
QCPU to write/read device data to/from another Universal model QCPU.
The following shows an operation when CPU No. 1 writes device data to CPU No. 2 with the
multiple CPU high-speed transmission dedicated instruction.

CPU No. 1 CPU No. 2


User program

DP.DDWR U3E1 D0 D100 D200 M0

D0 D0

D100

D200
Writing

NOTE The multiple CPU high-speed transmission dedicated instruction in either host CPU or another
CPU (target CPU module of instruction) is available only for the following CPU modules.
 Q03UDCPU, Q04UDHCPU, Q06UDHCPU
The first five digits of serial number is 10012 or higher.
 Q10UDHCPU, Q13UDHCPU, Q20UDHCPU, Q26UDHCPU
 QnUDE(H)CPU

Programming MELSEC System Q and L series 10 – 1


Overview

Parameter setting and system configuration to execute the multiple CPU high-speed
transmission dedicated instruction
The multiple CPU high-speed transmission dedicated instruction can be executed in the follo-
wing parameter setting and system configuration.
● CPU No. 1 is a QnUD(H)CPU or QnUDE(H)CPU.
● The multiple CPU high speed main base unit (Q3DB) is used.
● "Use multiple CPU high speed transmission" is selected in the Multiple CPU settings screen
of PLC parameter.

Writable/readable devices
The following table shows the devices that can be written to/read from the Universal model
QCPU in another CPU with the multiple CPU high-speed transmission dedicated instruction.

Setting of Target
Category Type Device Name Remarks
Device
Requirements for the setting
 Digits are specified by 16 bits
Internal user Bit device X, Y, M, L, B, F, SB (4 digits).
device  The start bit device is multiples of
16(10H).
Word device T, ST, C, D, W, SW  —
Requirements for the setting
 Digits are specified by 16 bits
Internal system Bit device SM (4 digits).
device  The start bit device is multiples of
16(10H).
Word device SD  —
File register Word device R, ZR  —

Settable

Settable with conditions

NOTE SB, SW, SM, and SD include system information area. Take care not to destroy the system in-
formation when writing data to the devices above with the D.DDWR/DP.DDWR instruction of the
multiple CPU high-speed transmission dedicated instruction.

10 – 2
Overview

Specification method of a device and writable/readable device range


There are two methods for specifying a device in another CPU: device specification and string
specification. They differ in writable/readable device range to another CPU.
● Device specification
The device specification is a method to directly specify a device in another CPU to be written/
read.

Program for device specification with the DP.DDWR instruction

X0
DP.DDWR H3E1 D0 D100 D200 M0

Directly specifies D200,


a device in another CPU to be written.

In the device specification, data can be written/read within the device range of host CPU.
For example, when data register in host CPU is 12k points and data register in another CPU
is 16k points, data can be written/read by 12k points from the start of the data register in
another CPU.

Writable/readable device range in device specification


Host CPU Another CPU
D0 D0

Data register Data register


(12k points) (16k Diagram
points) Writable/readable
Ladder

D12287 D12287
D12288
Not writable/
not readable
D16383

Programming MELSEC System Q and L series 10 – 3


Overview

● String specification
The string specification is a method to specify a device in another CPU to be written/ read
by character string.

Program for string specification with the DP.DDWR instruction



    

Specifies D200, a device in


another CPU to be written by
character string.

In the string specification, data can be written to/read from all device ranges of another CPU.
For example, when data register in host CPU is 12k points and data register in another CPU
is 16k points, data can be written/read by 16k points from the start of the data register in
another CPU.

Writable/readable device range in string specification


Host CPU Another CPU
D0 D0

Data register Data register


to (12k points) to (16k points)
Writable/readable

D12287

D16383

NOTE The following explains precautions for string specification.


 The number of characters that can be specified is 32.
 Whether "0" is appended at the start of the device number or not, the devices are processed
as the same.
For example, both "D1" and "D0001" are processed as "D1".
 Whether a device is specified by upper case character or lower-case character, they are
processed as the same.
For example, both "D1" and "d1" are processed as "D1".
 If a device not existing in another CPU is specified by a character string, the instruction will
be completed abnormally.

10 – 4
Overview

Managing the multiple CPU high speed transmission area


The multiple CPU high speed transmission area is managed by blocks in units of 16 words.
The following table shows the number of blocks that can be used in each CPU.

System Area 1)
Number of CPU Modules
1k Points 2k Points
2 46 110
3 22 54
4 14 35

1
For setting of the system area, refer to the QCPU User's Manual (Multiple CPU System).

The following shows configuration of the multiple CPU high speed transmission area when the
multiple CPU system is configured with three CPU modules and the system area size is 1k
word.

Multiple CPU high speed transmission area in...

...CPU No. 1 ...CPU No. 2 ...CPU No. 3

Area to be sent from CPU No.1 to CPU No.s 2 and 3

22 Receive 22
blocks Send area area blocks
22 22
blocks Send area Receive
area blocks

Area to be sent from CPU No. 2 to CPU No.s 1 and 3


22 Receive 22
blocks Send area blocks
area

Receive 22
Send area blocks
area

Area to be sent from CPU No. 3 to CPU No.s 1 and 2

22 Receive 22
blocks Send area blocks
area
22 Receive 22
blocks area Send area blocks

Programming MELSEC System Q and L series 10 – 5


Overview

The number of blocks used for the instruction


The number of blocks used for the instruction depends on the number of write points.
The following table shows the number of blocks used for the instruction.

Number of Write/Read Points


Specified by the Instruction D.DDWR/DP.DDWR Instruction D.DDRD/DP.DDRD Instruction

1–4 1
5–20 2
21–36 3
37–52 4 1
53–68 5
69–84 6
85–100 7

Concurrent execution of multiple CPU high-speed transmission dedicated instructions


For the Universal model QCPU, the multiple CPU high-speed transmission dedicated instruc-
tions can be concurrently executed within the range satisfying the following formula.
Number of blocks that can be used in each CPU
>=
Total number of blocks used for the instructions concurrently executed

When the number of blocks used for the multiple CPU high-speed transmission dedicated in-
structions exceeds the total number of blocks in the multiple CPU high speed transmission
area, the instruction will not be executed in the scan (no processing) but executed at the next
scan.
Note that the instruction will be completed abnormally when the number of empty blocks in the
multiple CPU high speed transmission area is less than the setting values of SD796 to SD799
(maximum number of used blocks for multiple CPU high-speed transmission dedicated instruc-
tion setting) at the execution of the instruction.
The following table shows execution possibility of the multiple CPU high-speed transmission
dedicated instructions when the number of empty blocks in the multiple CPU high speed trans-
mission area is less than the number of blocks used for the multiple CPU high-speed transmis-
sion dedicated instructions or the setting values of SD796 to SD799.

Magnitude relation between SD Magnitude relation between the number of blocks used for the
setting value and the number of instructions (N1) 1) and the number of empty relation blocks (N2) 2)
empty blocks N1 <= N2 N1 > N2
Setting values from SD796–SD799
<= Executed Not executed (no processing)
Number of empty blocks 2)
Setting values from SD796–SD799
> Completed abnormally
Number of empty blocks 2)

1
The number of blocks used for the multiple CPU high-speed transmission dedicated instruction.
2
The number of empty blocks in the multiple CPU high-speed transmission area.

10 – 6
Overview

Interlock when using multiple CPU high-speed transmission dedicated instruction


Special relays SM796 to SM799 („No. of set blocks cannot be secured“) can be used as an
interlock for the multiple CPU high-speed transmission dedicated instruction.
When executing the multiple CPU high-speed transmission dedicated instructions concurrent-
ly, use SM796 to SM799 as an interlock for the instructions.

NOTE When using special relays SM796 to SM799, set the maximum number of blocks for the in-
struction used for each CPU to special registers SD796 to SD799. (For example, when the ma-
ximum number of blocks for the multiple CPU high-speed transmission dedicated instruction to
be executed to CPU No.3 is 5, set 5 to SD798.)
When the number of empty blocks in the multiple CPU high speed transmission area becomes
equal to or less than the number of blocks set at SD796 to SD799, the corresponding special re-
lay (SM796 to SM799) turns on.

CPU No. 1 CPU No. 2


3) 3)
7
1) SM Send area Receive area
797
(1 2) (1 2)
DP.DDWR H3E1
During use
7
2)

4)
Turns on when the number of empty blocks is
less than the number of blocks used for the
DP.DDWR instruction.
(Instruction is not executed). Insufficient for writing a request from the
DP.DDWR instruction.

CPU No. 1 Empty area of request blocks in send area increased CPU No. 2
3) 3)

1) SM Send area Receive area


797
(1 2) (1 2)
DP.DDWR H3E1
During use
2)
5)

Turns off as empty blocks by the number of


blocks used for the DP.DDWR instruction
became available.
(The DP.DDWR instruction can be executed.)
The request from the DP.DDWR instruction can be written.

1
Execution command
2 Number of request blocks: 4
3
Multiple CPU high speed transmission area
4 Number of empty blocks: 2

5 Number of empty blocks: 8

Programming MELSEC System Q and L series 10 – 7


Overview

Program Program example when SM796 to SM799 are used as an interlock


Example
The following shows a program that executes the D.DDWR instruction to CPU No. 2 at the rise
of X0, and executes the D.DDWR instruction to CPU No. 3 at the rise of X1.

Maximum number of used blocks for multiple CPU high speed transmission dedicated instructions
and No. of write points
SM402
0 MOV K7 SD797
Turn-on for Max. no. of
one scan used blocks
after RUN (CPU No. 2)

MOV K7 SD798
Max. no. of
used blocks
(CPU No. 3)

SM402
8 MOV K100 D1
Turn-on for No. of write
one scan points to
after RUN CPU No. 2

MOV K100 D3
No. of write
points to
CPU No. 3
The DDWR instruction is executed to CPU No. 2 at the rise of X0
X0
11 SET M0
Execution command of the DDWR instruction to CPU No. 2 During
execution of
the DDWR
instruction to
M0 SM797 CPU No. 2
14 D.DDWRH3E1 D0 ZR0 ZR0 M1
During No. of used Control Source of Destination Completion
execution of block data data in CPU No. 2 device
the DDWR information CPU No. 2
instruction to CPU No. 2
CPU No. 2
RST M0
During
execution of
the DDWR
instruction to
The DDWR instruction is executed to CPU No. 3 at the rise of X1 CPU No. 2

X1
29 SET M3
Execution command of the DDWR instruction to CPU No. 3 During
execution of
the DDWR
instruction to
M3 SM798 CPU No. 3
32 D.DDWRH3E2 D2 ZR1000 ZR1000 M4
During No. of used Control Source of Destination Completion
execution of block data data in CPU No. 3 device
the DDWR information CPU No. 3
instruction to CPU No. 3
CPU No. 3
RST M3
During
execution of
the DDWR
instruction to
CPU No. 3

10 – 8
Overview

Program Program example when the multiple CPU high-speed transmission dedicated instructions are
Example executed to CPU modules by turns
When the multiple CPU high-speed transmission dedicated instructions are executed to Uni-
versal model QCPUs by turns, release an interlock to prevent the concurrent execution. Use
the cyclic transmission area device (from U3E\G10000) as an interlock.
The following shows a program example when the multiple CPU high-speed transmission de-
dicated instructions are executed at CPU No.s 1 and 2 by turns.
Program example when the multiple CPU high-speed transmission dedicated instruction is
executed at CPU No. 1:

SM402
MOV K7 SD797
Turn-on for Max. no. of
one scan used blocks
after RUN (CPU No. 2)

X0
SET M0
Write command During execution of
the DDWR instruction
U3E0\G10000.0 is turned on while CPU No.1 is executing the DP.DDWR
instruction.

M0 U3E1\G10000.0 SM797 U3E0\


SET G10000.0
During CPU No.2 is Number of CPU No.1 is
execution of during used blocks during
the DDWR execution of information execution of the
instruction the instruction (CPU No.2) instruction

MOV K100 D1
No. of write
points

DP.DDWR H3E1 D0 ZR100 ZR100 M1


Control Completion
data device

RST M0
During execution of
the DDWR instruction
U3E0\G10000.0 is turned OFF while CPU No.1 is executing the DP.DDWR
instruction.

M1 U3E0\
RST G10000.0
Completion CPU No.1 is
device during
execution of the
instruction

Programming MELSEC System Q and L series 10 – 9


Overview

Program Program example when the multiple CPU high-speed transmission dedicated instruction is
Example executed at CPU No. 2:

SM402
MOV K1 SD796
Turn-on for Max. no. of
one scan used blocks
after RUN (CPU No. 1)

X20
SET M0
During execution of
Read instruction the DDRD instruction
U3E1\G10000.0 is turned on while CPU No. 2 is executing the DP.DDRD instruction.

M0 U3E0\G10000.0 SM796 U3E1\


SET G10000.0
During CPU No. 1 is Number of CPU No. 2 is
execution of during used blocks during
the DDWR execution of information execution of the
instruction the instruction (CPU No. 1) instruction

MOV K50 D1
No. of read
points

DP.DDRD H3E0 D0 D1000 D1000 M1


Control Completion
data device

RST M0
During execution of
the DDRD instruction
U3E1\G10000.0 is turned off at the completion of the DP.DDRD instruction.

M1 U3E1\
RST G10000.0
Completion CPU No. 2 is
device during execution n
of the instruction

Program Program example when data exceeding 100 words are written/read with the multiple CPU
Example high-speed transmission dedicated instruction
The maximum number of write/read points that can be processed with the multiple CPU high-
speed transmission dedicated instruction is 100 words. Data exceeding 100 words can be writ-
ten/read by executing the multiple CPU high-speed transmission dedicated instruction at seve-
ral times.
The following shows a program example using the D.DDWR/DP.DDWR instruction of the mul-
tiple CPU high-speed transmission dedicated instruction. The similar program can be used
when using the D.DDRD/DP.DDRD instruction of the multiple CPU high-speed transmission
dedicated instruction.

10 – 10
Overview

Program Program example when one D.DDWR/DP.DDWR instruction is executed


Example
The following shows a program example that writes ZR0 to ZR999 (1000 points) in CPU No. 1
to ZR0 to ZR999 in CPU No. 2 with the D.DDWR instruction.
In the following program example, the next D.DDWR instruction is executed after the comple-
tion device of the D.DDWR instruction (M2) turns on so that only one D.DDWR instruction may
be executed.

The maximum number of used blocks for multiple CPU high speed
transmission dedicated instruction setting is set to CPU No. 2

SM402
0 MOV K7 SD797
Turn-on for Max. no. of
one scan used blocks
after RUN (CPU No. 2)

MOV K100 D1
No. of write
points

Data writing is started at the rise of the write command (X0)

X0 M0
37 RST Z2
Write During
command writing

SET M0
During writing
M0
68 SET M1
During During
writing execution of
the DDWR
instruction
M4
Execution request of the
next DDWR instruction

The DDWR instruction is executed


M1 SM797
71 D.DDWR H3E1 D0 ZR0Z2 ZR0Z2 M2
During No. of used Control Source/write Write Completion
execution of blocks data destination device
the DDWR information
instruction (CPU No. 2)
RST M1
During execution of
the DDWR instruction
When the DDWR instruction is completed abnormally, the annunciator is turned on and data writing is stopped
M2 M3
98 SET F0
Completion Error
device completion
device
RST M0
During writing

Next data writing is requested at nomal completion of the DDWR instruction


M2 M3
134 + K100 Z2
Completion Error
device completion
device
< Z2 K1000 PLS M4
Execution request of the
next DDWR instruction
= Z2 K1000 RST M0
During writing

173 END

Programming MELSEC System Q and L series 10 – 11


Overview

Program Program example when the D.DDWR/DP.DDWR instructions are executed concurrently
Example
The following shows a program example that writes ZR0 to ZR999 (1000 points) in CPU No. 1
to ZR0 to ZR999 in CPU No. 2 with the D.DDWR instruction. As shown on the program examp-
le, multiple CPU device write/read instructions can be executed concurrently.
When reading/writing devices with the multiple CPU high-speed transmission dedicated in-
structions concurrently, the more the total number of blocks in the multiple CPU high speed
transmission area (send area), the more the time taken to complete reading/writing with the
multiple CPU high-speed transmission dedicated instruction can be shortened.

The maximum number of used blocks for multiple CPU high speed
transmission dedicated instruction setting is set to CPU No. 2

SM402
0 MOV K7 SD797
Max. no. of used
Turn-on for blocks (CPU No. 2)
one scan
after RUN MOV K100 D1
No. of write
points 1
MOV K100 D3
Data writing is started at the rise of the write command (X0) No. of write
points 2
X0 M0
39 RST Z2
Write During
command writing
SET M0
During writing
First DDWR instruction, Second DDWR instruction
M0
70 SET M1
During During execution
writing of the DDWR
instruction 1
M7
SET M2
Execution request of the next DDWR instruction During execution
of the DDWR
instruction 2
The first DDWR instruction is executed
M1 SM797
94 D.DDWR H3E1 D0 ZR0Z2 ZR0Z2 M3
During execu- No. of used blocks Control source/write Write Completion
tion of the information data 1 destination device 1
DDWR instr. 1 (CPU No. 2) RST M1
The second DDWR instruction is executed During execution
of the DDWR
M2 SM797 instruction 1
126 D.DDWR H3E1 D2 ZR100Z2 ZR100Z2 M5
During execu- No. of used blocks Control source/write Write Completion
tion of the information data 2 destination device 2
DDWR instr. 2 (CPU No. 2)
RST M2
During execution of the DDWR instruction 2
When the DDWR instruction is completed abnomally, the annunciator is turned on and data writing is stopped
M3 M4
158 SET F0
Completion Error DDWR instruction
device 1 completion error display
device 1
M5 M6
RST M0
Completion Error
device 2 completion During writing
device 2
Next data writing is requested at nomal completion of the second DDWR instruction
M5 M6
197 + K200 Z2
Completion Error
device 2 completion PLS M7
device 2 < Z2 K1000
Execution request of the
next DDWR instruction
= Z2 K1000 RST M0
During writing
241 END

10 – 12
Multiple CPU high-speed transmission instructions D.DDWR, DP.DDWR

10.2 Multiple CPU high-speed transmission instructions


10.2.1 D.DDWR, DP.DDWR

CPU High
Basic Process Redundant Universal LCPU
Performance

1)
1
Q03UDCPU, Q04UDHCPU, Q06UDHCPU: first 5 digits of serial number is 10012 or higher
QnUDE(H)CPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) Direct J\ Index
File Function Constant
Register Module Register K, H (16#) Other
Bit 5) Bit Word Zn
Word U\G

n 1) —   — — — — — —
2) 3) 4)
s1 —  — — — — — —

s2 2) —   — — — — — —

d1 2) —   — — — — — —
2) 6) 4)
d2  —  — — — — — —
1 Index modification cannot be made to setting data n.
2
Index modification cannot be made to setting data from s1 to d2.
3
Local devices cannot be used.
4 File registers cannot be used per program.

5 FD @ (indirect specification) cannot be used.

6
FX and FY cannot be used.

GX IEC
Developer
MELSEC Instruction Ladder Diagram IEC Instruction List

GX Works2

D.DDWR n s1 s2 d1 d2

DP.DDWR n s1 s2 d1 d2

Programming MELSEC System Q and L series 10 – 13


D.DDWR, DP.DDWR Multiple CPU high-speed transmission instructions

Variables Set Setting


Meaning Set By Data Type
data Range
The result of dividing the start I/O number of another CPU by 16
CPU No. 1: 3E0H,
n CPU No. 2: 3E1H, — — BIN 16-bit
CPU No. 3: 3E2H,
CPU No. 4: 3E3H
Start device of the host CPU that stores control data

Set data Item Meaning/Set Data Setting Set By


Range
An execution result upon comple-
tion of the instruction is stored.
s1  0000H: Device name
(s1)+0 Completion status No errors (normal completion) — System
 Other than 0000H:
Error code (error completion)
Number of write Set the number of write points in
(s1)+1 1–100 User
points units of words.
s2 Start device of the host CPU that stores data to be written Device name

Device 1)
d1 Start device of another CPU that stores write data
Character string 2,3)
d2 Completion device Bit
1 By specifying a file register (R, ZR), data can be written to devices in another CPU, outside the range
of host CPU.
2 By specifying the start device by " ", devices can be written to devices in another CPU, outside the

range of host CPU.


3 Indexed devices cannot be specified (e.g. D0Z0).

10 – 14
Multiple CPU high-speed transmission instructions D.DDWR, DP.DDWR

Functions Writing devices to another CPU


D.DDWR/DP.DDWR Write instruction
In a multiple CPU system, data stored in a device specified by host CPU (s2) or later is stored
by the number of write points specified by ((s1)+1) into a device specified by another CPU (n)
(d1) or later.

Start device no. of Start device no. of sto-


storage location for Host CPU Another CPU (n) rage location where wri-
write data (s2) (requests writing) (to be written to) te data are stored (d1)

Number of
write points
((s1)+1)

Whether to complete the D.DDWR/DP.DDWR instruction normally can be checked by the com-
pletion device ((d2)+0) and completion status display device ((d2)+1).
● Completion device ((d2)+0)
Turns on at END processing in the scan where the instruction has been completed, and
turns off at the next END processing.
● Completion status display device ((d2)+1)
This device turns on/off depending on the status upon completion of the instruction.

Normal completion: Off

Error completion: Turns on at END processing in the scan where the instruction has been
completed, and turns off at the next END processing
(At error completion, an error code is stored at control data ((s1)+0): Completion status).
The number of blocks used for the instruction depends on the number of write points (refer to
section 10.1). The following table shows the number of blocks used for the instruction:

Number of write points Number of blocks used by


specified by the the D.DDWR/DP.DDWR
instruction instruction
1–4 1
5–20 2
21–36 3
37–52 4
53–68 5
69–84 6
85–100 7

The instruction will be completed abnormally when there are no empty blocks in the multiple
CPU high speed transmission area.
Set the number of blocks used for the instruction at special registers (SD796 to SD799), and
use the special relays (SM796 to SM799)as an interlock prevent error completion (refer to sec-
tion 10.1).

Programming MELSEC System Q and L series 10 – 15


D.DDWR, DP.DDWR Multiple CPU high-speed transmission instructions

NOTES Digit specification of bit device is possible for n, s2, and d1. Note that when the digit specifica-
tion of bit device is made to s2 or d1, the following conditions must be met.
 Digits are specified by 16 bits (4 digits).
 The start bit device is multiples of 16 (10H).
Execute this instruction after checking that the write target CPU is powered on. Not doing so
may end up no processing.
If changing a range of the device specified at setting data between after execution of the
instruction and turn-on of the completion device, data to be stored by system (completion sta-
tus, completion device) cannot be stored normally.
SB, SW, SM, and SD include system information area. Take care not to destroy the system
information when writing data to the devices above with the D.DDWR/DP.DDWR instruction of
the multiple CPU high-speed transmission dedicated instruction.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Specified another CPU is wrong or the multiple CPU high-speed transmission dedicated
instruction cannot be used in the setting.
(Error code 4350)
– A reserved CPU has been specified.
– Unmounted CPU has been specified.
– The value in n (the start I/O number of the other CPU divided by 16) is out of the range
of 3E0H to 3E3H.
– The instruction was executed without setting "Use multiple CPU high speed transmissi-
on".
– The instruction was executed with the Q02UCPU.
– Host CPU has been specified.
– The CPU where the instruction cannot be executed has been specified.
● The instruction cannot be executed with the CPU.
(Error code 4351)
The other CPU does not support this instruction.
● The number of devices is wrong. (Error code 4352)
● A device that cannot be used for the instruction has been specified. (Error code 4353)
● A device has been specified by the character string that cannot be used. (Error code 4354)
● The number of write points ((s1)+1)) is other than 1 to 100. (Error code 4355)

10 – 16
Multiple CPU high-speed transmission instructions D.DDWR, DP.DDWR

In any of the following cases, the instruction is completed abnormally, and an error code is
stored into a device specified at completion status storage device ((s1)+0)).
● The request of the instruction to the target CPU is more than the acceptable value (no empty
blocks exist in the multiple CPU high speed transmission area).
(Error code 0010H)
● A device for another CPU specified at s2 cannot be used at another CPU, or is out of device
range.
(Error code 1001H)
● The number of write points set with the D.DDWR/DP.DDWR instruction is 0.
(Error code 1080H)
● The response of the instruction from another CPU cannot be returned (no empty blocks
exist in the multiple CPU high speed transmission area). (Error code 1003H)

Program DP.DDWR
Example
This program stores data by 10 words starting from D0 in host CPU into W10 or later in CPU
No. 2 when X0 turns on.

Ladder diagram

Programming MELSEC System Q and L series 10 – 17


D.DDRD, DP.DDRD Multiple CPU high-speed transmission instructions

10.2.2 D.DDRD, DP.DDRD

CPU High
Basic Process Redundant Universal LCPU
Performance

1)
1
Q03UDCPU, Q04UDHCPU, Q06UDHCPU: first 5 digits of serial number is 10012 or higher
QnUDE(H)CPU

Devices Usable Devices


Internal Devices MELSECNET/H Special
(System, User) Direct J\ Index
File Function Register Constant Other
Register Module K, H (16#)
Bit 5) Bit Word U\G Zn
Word

n 1) —   — — — — — —

s1 2) — 3) 4) — — — — — —

s2 2) —   — — — — — —

d1 2) —   — — — — — —
2) 6) 4)
d2  —  — — — — — —
1
Index modification cannot be made to setting data n.
2
Index modification cannot be made to setting data from s1 to d2.
3 Local devices cannot be used.

4 File registers cannot be used per program.

5
FD @ (indirect specification) cannot be used.
6 FX and FY cannot be used.

GX IEC
Developer
MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

D.DDRD n s1 s2 d1 d2

DP.DDRD n s1 s2 d1 d2

10 – 18
Multiple CPU high-speed transmission instructions D.DDRD, DP.DDRD

Variables Set Setting


Meaning Set By Data Type
data Range
The result of dividing the start I/O number of another CPU by 16
CPU No. 1: 3E0H,
n CPU No. 2: 3E1H, — — BIN 16-bit
CPU No. 3: 3E2H,
CPU No. 4: 3E3H
Start device of the host CPU that stores control data

Set data Item Meaning/Set Data Setting Set By


Range
An execution result upon comple-
tion of the instruction is stored.
s1  0000H: Device name
(s1)+0 Completion status No errors (normal completion) — System
 Other than 0000H:
Error code (error completion)
Number of read Set the number of read points in
(s1)+1 1–100 User
points units of words.
s2 Start device of the another CPU that stores data to be read Device name

Device 1)
d1 Start device of host CPU that stores read data
Character string 2,3)
d2 Completion device Bit
1 By specifying a file register (R, ZR), data can be read to devices in another CPU, outside the range of
host CPU.
2 By specifying the start device by " ", devices can be read to devices in another CPU, outside the range

of host CPU.
3 Indexed devices cannot be specified (e.g. D0Z0).

Programming MELSEC System Q and L series 10 – 19


D.DDRD, DP.DDRD Multiple CPU high-speed transmission instructions

Functions Reading devices from another CPU


D.DDRD/DP.DDRDR Read instruction
In multiple CPU system, data stored in a device specified by another CPU (n) (s2) or later is
stored by the number of read points specified by ((s1)+1) into a device specified by host CPU
(d1) or later.

Start device no. of Start device no. of storage


storage location for Host CPU Another CPU (n) location where read data
read data (d1) (requests reading) (to be read) have been stored (s2)

Number of
read points
((s1)+1)

Whether to complete the D.DDRD/DP.DDRD instruction normally can be checked by the com-
pletion device ((d2)+0) and completion status display device ((d2)+1).
● END processing in scan data that CPU completed the instruction turns on the device ((d2)+0)
and the next END processing turns off the device.
● This device ((d2)+1) turns on/off depending on the status upon completion of the instruction.

Normal completion: Off

Error completion: Turns on at END processing in the scan where the instruction has been
completed, and turns off at the next END processing. (At error completion, an error code is
stored at control data ((s1)+0): Completion status).
The number of blocks used for the instruction is independent of the number of read points (refer
to section 10.1). The following table shows the number of blocks used for the instruction:

Number of read points Number of blocks used by


specified by the the D.DDRD/DP.DDRD
instruction instruction
1–100 1

The instruction will be completed abnormally when there are no empty blocks in the multiple
CPU high speed transmission area.
Set the number of blocks used for the instruction at special registers (SD796 to SD799), and
use the special relays (SM796 to SM799) as an interlock prevent error completion (refer to sec-
tion 10.1).

10 – 20
Multiple CPU high-speed transmission instructions D.DDRD, DP.DDRD

NOTES Digit specification of bit device is possible for n, s2, and d1. Note that when the digit specifica-
tion of bit device is made to s2 or d1, the following conditions must be met.
 Digits are specified by 16 bits (4 digits).
 The start bit device is multiples of 16 (10H).
Execute this instruction after checking that the read target CPU is powered on. Not doing so
may end up no processing.
If changing a range of the device specified at setting data between after execution of the
instruction and turn-on of the completion device, data to be stored by system (completion sta-
tus, completion device) cannot be stored normally.

Operation In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
Errors code is stored into SD0.
● Specified another CPU is wrong or the multiple CPU high-speed transmission dedicated
instruction cannot be used in the setting.
(Error code 4350)
– A reserved CPU has been specified.
– Unmounted CPU has been specified.
– The value in n (the start I/O number of the other CPU divided by 16) is out of the range
of 3E0H to 3E3H.
– The instruction was executed without setting "Use multiple CPU high speed transmissi-
on".
– The instruction was executed with the Q02UCPU.
– Host CPU has been specified.
– A CPU where the instruction cannot be executed has been specified.
● The instruction cannot be executed with the CPU.
(Error code 4351)
The other CPU does not support this instruction.
● The number of devices is wrong. (Error code 4352)
● A device that cannot be used for the instruction has been specified. (Error code 4353)
● A device has been specified by the character string that cannot be used. (Error code 4354)
● The number of read points ((s1)+1)) is other than 1 to 100. (Error code 4355)
In any of the following cases, the instruction is completed abnormally, and an error code is
stored into a device specified at completion status storage device ((s1)+0).
● The request of the instruction to the target CPU is more than the acceptable value (no empty
blocks exist in the multiple CPU high speed transmission area).
(Error code 0010H)
● A device for another CPU specified at s2 cannot be used at another CPU, or is out of device
range.
(Error code 1001H)
● The number of read points set with the D.DDRD/DP.DDRD instruction is 0.
(Error code 1081H)
● The response of the instruction from another CPU cannot be returned (no empty blocks
exist in the multiple CPU high speed transmission area).
(Error code 1003H)

Programming MELSEC System Q and L series 10 – 21


D.DDRD, DP.DDRD Multiple CPU high-speed transmission instructions

Program DP.DDRD
Example
This program stores data by 10 words starting from D0 in host CPU No. 2 into W10 or later in
host CPU when X0 turns on.

Ladder diagram

MELSEC Instruction List

10 – 22
Instruction for a redundant system

11 Instructions for MELSEC System Q


11.1 Instruction for a redundant system
Switches between the control system and standby system at the END processing of the scan
executed with the SP.CONTSW instruction.
MELSEC-Instruction MELSEC-Instruction
Function in in
MELSEC-Editor IEC-Editor
System switching SP.CONTSW CONTSW_SP_M

NOTE For more information of a redundant system refer to the User‘s manuals of the redundant CPU
modules Q12PRHCPU and Q25PRHCPU.

Programming MELSEC System Q and L series 11 – 1


SP.CONTSW Instruction for a redundant system

11.1.1 SP.CONTSW

CPU High
Basic Process Redundant Universal LCPU
Performance


Devices Devices
Internal Devices MELSECNET/H Special
(System, User) File Direct J\ Function Index Register Constant
Register Module Zn K, H Other
Bit Word Bit Word U\G
s —   — — — —  —
1) 1)
d    — — — — — —
1
The bit specification for the word device is available.

GX IEC
Developer MELSEC Instruction List Ladder Diagram IEC Instruction List

GX Works2

SP.CONTSW s d

Variables Set Data Meaning Data Type


s Value other than 0 and used to identify the processing that issued the system
BIN 16-bit
switching request
d Error completion device number Bit

11 – 2
Instruction for a redundant system SP.CONTSW

Functions System switching instruction


SP.CONTSW System switching instruction
Switches between the control system and standby system at the END processing of the scan
executed with the SP.CONTSW instruction.
When using the SP.CONTSW instruction for system switching, the "manual switching enable
flag (SM1592)" must have been turned ON (enabled) in advance.
s is provided to identify the processing block of the program where system switching occurred
when multiple SP.CONTSW instructions are used. At s, specify a value within the ranges -
32768 to -1 and 1 to 32767 (1H to FFFFH).
The s value specified for the SP.CONTSW instruction is stored into the "system switching
instruction argument (SD6)" of the error common information when the system switching is nor-
mally completed. The s value specified for the SP.CONTSW instruction can be confirmed in the
error common information of the PLC diagnostics dialog box on the programming tool. When
multiple SP.CONTSW instructions are executed during the same scan, the argument of the
SP.CONTSW instruction executed first is stored into the system switching instruction argument
(SD6).
When system switching is normally completed, the value specified for the SP.CONTSW
instruction is stored into the "system switching instruction argument (SD1602)" of the new con-
trol system CPU module. The new control system CPU module means the CPU module that
was switched from the standby system to the control system by the SP.CONTSW instruction.
By reading the SD1602 value from the new control system CPU module, which the
SP.CONTSW instruction was used for system switching can be confirmed.
The error completion device is turned ON by the control system CPU module when system
switching by the SP.CONTSW instruction was unsuccessful.
● When OPERATION ERROR is detected due to any of the following reasons at the execution
of the SP.CONTSW instruction, the error completion device is turned ON during the
instruction execution.
– 0 is specified at s of the executed SP.CONTSW instruction.
– The "manual switching enable flag (SM1592)" is OFF.
– The SP.CONTSW instruction was executed by the standby system in the separate mode.
– The SP.CONTSW instruction was executed in the debug mode.
● If systems could not be switched due to any of the reasons given in the following table, the
error completion device turns ON when system switching is executed in the END processing.
When the error completion device was turned ON due to unsuccessful system switching,
16 is stored into the "Reason(s) for system switching (SD1588)" and the reason No. of the
following table is stored into the "Reason(s) for system switching failure (SD1589)".
Reason No. Reasons for System Switching Failure
0 Normally completed
1 Tracking cable is disconnected or faulty.
Hardware fault, power-off, reset or watchdog timer error occurred in the standby
2
system.
3 Watchdog timer error occurred in the control system.
4 Preparations being made for tracking transfer.
5 Communication time-out.
6 Stop error occurred in the standby system. (Excluding watchdog timer error)
7 Operating status different between the control system and standby system.
8 Memory copy being executed from the control system to the standby system.
9 Write during RUN being executed.
10 Network fault detected by the standby system.

Programming MELSEC System Q and L series 11 – 3


SP.CONTSW Instruction for a redundant system

Use a user program or a programming tool to turn OFF the error completion bit that has turned
ON.

If normal system switching is performed by the execution of the SP.CONTSW instruction with
the error completion device ON, the error completion device of the new standby system CPU
module is also turned OFF. When system switching is performed due to a factor other than the
SP.CONTSW instruction, however, the error completion device is not turned OFF.

Operation In the following cases an operation error occurs, the error flag (SM0) is turned ON and an error
Errors code is stored into SD0:
● The value specified at s is 0 at execution of the SP.CONTSW instruction.
(Error code: 4100)
● The manual switching enable flag (SM1592) is OFF (disable) at execution of the
SP.CONTSW instruction.
(Error code: 4120)
● The SP.CONTSW instruction was executed by the standby system CPU module in the
separate mode.
(Error code: 4121)
● The SP.CONTSW instruction was executed in the debug mode.
(Error code: 4121)
If system switching was unsuccessful, the error flag (SM0) is turned ON and the error code
6220 is stored into SD0.
● The tracking cable is disconnected or faulty.
● Hardware fault, power-off, reset or watchdog timer error occurred in the standby system.
● Watchdog timer error occurred in the control system.
● Preparations are being made for tracking transfer.
● Communication time-out occurred.
● Stop error, excluding watchdog timer error, occurred in the standby system.
● The operating status differs between the control system and standby system.
● Memory copy is being executed from the control system to the standby system.
● Write during RUN is being executed.
● Network fault was detected by the standby system.

11 – 4
Instruction for a redundant system SP.CONTSW

Program SP.CONTSW
Example
The following program executes system switching on the leading edge of the system switching
command (M100).
If the system switching command (M100) remains ON, the SP.CONTSW instruction is also exe-
cuted by the new control system CPU module after system switching. Therefore, M101 is
added to the execution conditions as a consecutive switching prevention flag.

MELSEC Instruction List Ladder Diagram

IEC Instruction List

Programming MELSEC System Q and L series 11 – 5


SP.CONTSW Instruction for a redundant system

11 – 6
12 Instructions for Special Function
Modules

Instructions Function
Reading of received data in an interrupt program;
Instructions for serial communication modules Reading, registration or deletion of user frames;
Transmission of data using user frames
Reading or writing of data from and to the buffer memory of a
Instructions for PROFIBUS/DP interface modules
PROFIBUS/DP interface module
Writing and reading of data to and from fixed buffer;
Instructions for ETHERNET interface modules Opening and closing of connections, Clearing of error codes;
Re-initialization of the ETHERNET interface module
Instructions for MELSECNET/H Setting of stations for duplex network
Parameter setting,
Setting of automatic refresh parameters
Reading of data from the buffer memory of an station connected
to CC-Link or from the PLC CPU of this station;
Instructions for CC-Link
Writing of data to the buffer memory of an station connected to
CC-Link or to the PLC CPU of this station;
Reading and writing from and to the automatic updated buffer
memory

Programming MELSEC System Q and L series 12 – 1


Instructions for serial communication modules

12.1 Instructions for serial communication modules

MELSEC Instruction MELSEC Instruction


Function
in MELSEC Editor in IEC Editor
Reading of received data from a
Z.BUFRCVS BUFRCVS_M
QJ71C24 in an interrupt program
G.GETE GETE_M
Reading of user registered frames
GP.GETE GETEP_M

Registration or deletion of user G.PUTE PUTE_M


registered frames GP.PUTE PUTEP_M
G.PRR PRR_M
Transmission of user frames
GP.PRR PRRP_M

12 – 2
Instructions for serial communication modules BUFRCVS

12.1.1 BUFRCVS

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the serial communication module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“)
User BIN 16-bit
Reception channel number
s1 1: Channel 1 (CH1) 1 or 2
2: Channel 2 (CH2)
Head number of the devices that stores received data
Contents is
Set Data Meaning Description Range
stored by
Length of the received data
d1 (d1)+0 Data length The unit (bytes or words) is set in Address
the parameters.
In this area the data read from the — System
(d1)+1
receive area of the buffer memory
to Received data
is stored sequencely in ascending
(d1)+n
order.

Programming MELSEC System Q and L series 12 – 3


BUFRCVS Instructions for serial communication modules

Functions Reading of received data from the QJ71C24


BUFRCVS Data read
The BUFRCVS instruction reads data sent from an external device to the communication mod-
ule QJ71C24 from the buffer memory of the QJ71C24 and stores the data in the CPU module.
The BUFRCVS instruction can identify the address of the reception area in the buffer memory
and read relative receive data to the area designated with d1.
When the data transfer is completed, the reception data read request (X3/XA) or the reception
abnormal detection signal (X4/XB) is turned off automatically. It is not necessary to turn on the
reception data completion signal (Y1/Y8) when received data is read by the BUFRCVS instruc-
tion.
The BUFRCVS instruction is used by an interrupt program and its processing is completed in
one scan. The following figure shows the timing when the BUFRCVS instruction is being exe-
cuted:

Scan
Sequence END processing
program

Interrupt program

BUFRCVS Execution
instruction

Data reception Data storage

NOTES When received data is read with a BUFRCVS instruction in an interrupt program, the data of the
same interface can not be read again in the main program. Thus the BUFRCVS instruction can-
not used together with the following instructions:
- the INPUT instruction
- the BIDIN instruction
- the FROM instruction in combination with input/output signals of the communication module
The BUFRCVS and the CSET instruction cannot be executed at the same time.
The area specified with d1 in the PLC CPU must be large enough to store all data sent from the
external device. If this area is to small, the data that can not be stored, is lost.

Operation When the BUFRCVS instruction is completed abnormally, the error flag SM0 is set, and an error
Errors code is stored in SD0. For more information about the error codes please refer to the following
manuals:
● When the error code is 4FFFH or less, please refer to chapter 13 of this manual for error
diagnostics.
● When the error code is 7000H or higher, please refer to the user’s manual of the serial
communication module QJ71C24.
If an error occurs during data reception (indicated by the input signals X4 and XB), the error
code is written to the buffer memory addresses 258H and 268H of the communication module
and can be used for diagnostics.

12 – 4
Instructions for serial communication modules BUFRCVS

Program BUFRCVS
Example
The following program reads the data received via channel 1 of a QJ71C24 with the head
address X/Y0 and stores the data from D200 onward. Only channel 1 issues an interrupt.
When data is received, the interrupt program 50 (I50) is processed. The internal relays M100
and M101 are used as interface with the main program. If data was received correctly, M100 is
set. When an error occurs during reception of the data, M101 is set. Both relays are reset in
the main program.

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

Programming MELSEC System Q and L series 12 – 5


GETE, GETEP Instructions for serial communication modules

12.1.2 GETE, GETEP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 6
Instructions for serial communication modules GETE, GETEP

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the serial communication module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)
Head number of the devices that store control data

Set Data Meaning Description Range Contents is


stored by
(s1)+0 Dummy Used by the system 0 —
Indicates whether an error has
occured during execution of the
instruction:
(s1)+1 Read result 0000H: No error System
s1 Any value other than 0000H: An BIN 16-bit
error has occured and the stored
value is an error code.
1000 to
(s1)+2 Frame number Number of the user frame 1199
Max. number of bytes of the user User
Number of bytes
frame that can be stored in the 1 to 80
to read
(s1)+3 area specified by s2
Number of read Number of bytes of the user frame
1 to 80 System
bytes that has been read
User
s2 Head number of the devices that store the read data Address
System
Bit device which is set for one scan after completion of the GETE instruction. (d)+1 indicates
an abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range
stored by
Indicates the completion of the
d Instruction GETE instruction Bit
(d)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the GETE instruction.
(d)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 7


GETE, GETEP Instructions for serial communication modules

Functions Reading of user registered frames


GETE Data read
The GETE instruction reads data from a user frame in a serial communication module and
stores the data in the PLC CPU. The head address of the communication module is specified
with Un.

PLC CPU Communication module

User frame
b15 b8 b7 b0
(S2)+0 B A A
Read
+1 D C B
+2 F E C Number of bytes
D to read
E
F

During GETE instruction execution, another GETE or PUTE instruction cannot be executed. If
an attempt is made to execute a GETE or PUTE instruction during execution of a GETE instruc-
tion, the system waits until the execution of the instruction already being processed is com-
pleted.
Whether the execution of the GETE instruction has been finished can be checked with the
devices (d)+0 and (d)+1:
● The bit device (d)+0 turns ON at the END processing of the scan in which the GETE
instruction has been completed and turns OFF at the next END processing.
● The bit device (d)+1 indicates an error during execution of the GETE instruction. When the
instruction is completed normal, this device stays OFF. When an error occurs during
execution of the GETE instruction, (d)+1 turns ON at the END processing of the scan in
which the GETE instruction has been completed and turns OFF at the next END processing.
The following figure shows the timing when the GETE instruction is being executed:

END processing END processing END processing END processing


Sequence
program flow
Start Completion of the GETE instruction

GETE instruction

Instruction
Bit device (d)+0 completed

Error
Bit device (d)+1
One scan

Operation When an error occurs during execution of the GETE instruction, the bit device (d)+1 is set and
Errors an error code is written to (s1)+1. For more information about the error codes please refer to
the following manuals:
● When the error code is 4FFFH or less, refer to chapter 13 of this manual for error diagnostics.
● When the error code is 7000H or higher, you will find more information in the user’s manual
of the serial communication module.

12 – 8
Instructions for serial communication modules GETE, GETEP

Program GETE
Example
The following program reads data of the user frame with the number 3E8H from a QJ71C24
and stores the data in the QCPU from data register D4 onward. The communication module
occupies the input/output signals from X/Y80 to X/Y9F.
● IEC editors

Ladder Diagram (GX IEC Developer)

Change read request to a pulse

Reset of dummy (s1)+0

The number of the user frame is stored in (s1)+1.

The maximum number of bytes is 80.

The area where the read data will be stored is cleared.

Reading of the user frame

At this position, write the instructions that should be executed when the GETE
instruction has been completed normally.

At this position, write the instructions that should be executed when the GETE
instruction has been completed abnormally.

IEC Instruction List

The devices and instructions used are explained in the


above ladder diagram.

An instruction at his position will be executed when the GETE instruction has been completed normally.

An instruction at this position will be executed when the GETE instruction has been completed with an error.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 9


GETE, GETEP Instructions for serial communication modules

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the GETE instruction
has been completed normally.

At this position, write the instructions that should be executed when the GETE instruction
has been completed not normally.

MELSEC Instruction List

An instruction at this position will be executed when the GETE instruction has been completed normally

An instruction at this position will be executed when the GETE instruction has been completed with an error.

12 – 10
Instructions for serial communication modules PUTE, PUTEP

12.1.3 PUTE, PUTEP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Contents is Data


Set Data Meaning Range
stored by Type
Head I/O address of the serial communication module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)

Programming MELSEC System Q and L series 12 – 11


PUTE, PUTEP Instructions for serial communication modules

Variables Contents is Data


Set Data Meaning Range stored by Type
Head number of the devices that store control data
Contents is
Set Data Meaning Description Range
stored by
Designate whether to register or to
Selection: delete the user frame specified by
(s1)+0 Register or delete (s1)+2: 1 or 3 User
user frame  1: Register
 3: Delete
Indicates whether an error has
occured during execution of the
s1 instruction: BIN 16-bit
Register/delete
(s1)+1 0000H: No error — System
result
Any value other than 0000H: An
error has occured and the stored
value is an error code.
Number of the user frame to regis- 1000 to
(s1)+2 Frame No. 1199
ter or to delete
Number of bytes of the user frame
to be registered. Please set also a User
Number of bytes
(s1)+3 value between 1 and 80 as dummy 1 to 80
to register
when deleting a user frame
[(s1)+0 = 3].
s2 Head number of the devices that store the data to be registered. User Address
Bit device which is set for one scan after completion of the PUTE instruction. (d)+1 indicates
an abnormal completion of the instruction.
Contents is
Operand Meaning Description Range stored by
Indicates the completion of the
d Instruction PUTE instruction Bit
(d)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the PUTE instruction
(d)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

12 – 12
Instructions for serial communication modules PUTE, PUTEP

Functions Registration or deletion of user frames


PUTE Register or delete user frames
The PUTE instruction is used to register or delete user frames in a serial communication mod-
ule. The head address of the serial communication module is specified with Un.
Registering a user frame
When registering a user frame, write „1“ to the device designated with (s1)+0. Data from the
devices starting with the device designated by s2 will be registered in accordance with the con-
trol data.
Since each device can store two bytes of data, the number of necessary devices equals half
the number of data bytes.
If for instance six bytes are to be registered in a user frame, two additional devices must be
reserved after s2:

PLC CPU Communication module

b15 b8 b7 b0
User frame
(S2)+0 B A Register A
+1 D C B
+2 F E C Number of bytes
D to be registered
E
F

Deletion of a user frame


To delete the user frame, whose number is written in (s1)+2, write „3“ to the device designated
with (s1)+0.
Although the number of bytes [(s1)+3] and the area specified with s2 are not used during dele-
tion, these settings are required for the PUTE instruction format. Write any value between 1
and 80 to the device designated by (s1)+3 and choose a dummy for s2.
Operation conditions
During execution of a PUTE instruction, it is not possible to execute another PUTE or GETE
instruction. If an attempt is made to execute one of these instructions when a PUTE instruction
is already being executed, the system waits until the execution of the instruction already being
processed is completed.
Whether the execution of the PUTE instruction has been finished or not can be checked with
the devices (d)+0 and (d)+1:
● The bit device (d)+0 turns ON with the END processing of the scan in which the PUTE
instruction has been completed and turns OFF at the next END processing.
● The bit device (d)+1 indicates an error during execution of the PUTE instruction. When the
instruction is completed normal, this device stays OFF. When an error occurs during
execution of the PUTE instruction, (d)+1 turns ON at the END processing of the scan in
which the PUTE instruction has been completed and turns OFF at the next END processing.

Programming MELSEC System Q and L series 12 – 13


PUTE, PUTEP Instructions for serial communication modules

The following figure shows the timing for the PUTE instruction:

END processing END processing END processing END processing


Sequence
program
Start Completion of registration/deletion

PUTE instruction

Registration/
deletion request

Instruction
completed

Instruction completed Error


with error

One scan

Operation When an error occurs during execution of the PUTE instruction, the bit device (d)+1 is set and
Error an error code is written to (s1)+1. For more information about the error codes please refer to
the following manuals:
● When the error code is 4FFFH or less, please refer to chapter 13 of this manual for error
diagnostics.
● When the error code is 7000H or higher, please refer to the user’s manual of the serial
communication module.

12 – 14
Instructions for serial communication modules PUTE, PUTEP

Program PUTE
Example
The following program registers data to the user frame with the number 3E8H. A QJ71C24 is
used as communication module. It occupies the input/output signals from X/Y80 to X/Y9F.
NOTE When using the IEC editors it is neccessary to define the variables in the header of the program
organization unit (POU). Without variable definition it would cause compiler or checker error
messages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC De-
veloper" of this manual.
● IEC editors

Ladder Diagram (GX IEC Developer)

The request to register a user frame is converted to a


pulse

Setting of „Registration“ to (s1)+0

The number of the user frame is written to (s1)+1

10 bytes are registered

The data to be registered is written to the area starting with D4.

Write enable of the flash EPROM

Register user frame

At this position, write the instructions that should be executed when the PUTE
instruction has been completed normally.

At this position, write the instructions that should be executed when the PUTE
instruction has been completed with an error.

Programming MELSEC System Q and L series 12 – 15


PUTE, PUTEP Instructions for serial communication modules

IEC Instruction List

For an explanation of the devices and instructions used


please see the ladder diagram on the previous page.

An instruction at this position will be executed when the PUTE instruction has been completed normally.

An instruction at this position will be executed when the PUTE instruction has been completed with an error.

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous pages.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the PUTE instruction
has been completed normally.

At this position, write the instructions that should be executed when the PUTE instruction
has been completed with an error.

12 – 16
Instructions for serial communication modules PUTE, PUTEP

MELSEC Instruction List

An instruction at this position will be executed when the PUTE instruction has been completed normally.

At this position, write the instructions that should be executed when the PUTE instruction has been completed
with an error.

Programming MELSEC System Q and L series 12 – 17


PRR, PRRP Instructions for serial communication modules

12.1.4 PRR, PRRP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 18
Instructions for serial communication modules PRR, PRRP

Variables Contents is Data


Set Data Meaning Range
stored by Type
Head I/O address of the serial communication module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)
Head number of the devices that store control data.
Contents is
Set Data Meaning Description Range
stored by
Designation of the channel used to
Transmission transmit data
(s)+0 1 or 2 User
channel 1: Channel 1 (CH1)
2: Channel 2 (CH2)
Indicates whether an error has
occured during execution of the
instruction:
Transmission
(s)+1 0000H: No error — System
result
s Any value other than 0000H: An Address
error has occured and the stored
value is an error code.
Designate whether or not to add
CR/LF to the transmission data
(s)+2 Addition of CR/LF 0 or 1
0: Do not add CR/LF
1: Add CR/LF
Pointer to the first address of the User
Transmission
(s)+3 device area which stores the data 1 to 100
pointer
to be transmitted.
Number of user Designation of the number of user
(s)+4 1 to 100
frames frames to be transmitted.
Bit device which is set for one scan after completion of the PRR instruction. (d)+1 indicates an
abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range
stored by
Indicates the completion of the
d Instruction PRR instruction Bit
(d)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the PRR instruction
(d)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 19


PRR, PRRP Instructions for serial communication modules

Functions Transmission of user frames


PRR Transmit user frames
The PRR instruction transmits data using user frames to the communication module desig-
nated by Un. Information about the processing of the instruction are stored from the device
designated by s. The contents of the user frames has to be set in the communication module
before the PRR instruction is executed.
While a PRR instruction is being executed the following instructions cannot be executed for the
same channel of the commnication module:
OUTPUT instruction, ONDEMAND instruction, BIDOUT instruction and other PRR instruc-
tions.
If an attempt is made to execute any of the above instructions while an PRR instruction is being
executed, the system waits until the PRR instruction already being executed is completed.
Whether the execution of the PRR instruction has been finished can be checked with the
devices (d)+0 and (d)+1:
● The bit device (d)+0 turns ON with the END processing of the scan in which the PRR
instruction has been completed and turns OFF at the next END processing.
● The bit device (d)+1 indicates an error during execution of the PRR instruction. When the
instruction is completed normal, this device stays OFF. When an error occurs during the
execution of the PRR instruction, (d)+1 turns ON at the END processing of the scan in which
the PRR instruction has been completed and turns OFF at the next END processing.

The following figure shows the timing for the PRR instruction:

END processing END processing END processing END processing


Sequence
program
Start Completion of the transmission
by the PRR instruction
PRR instruction

Instruction
Bit device (d)+0 completed

Error
Bit device (d)+1
One scan

Operation When an error occurs during execution of the PUTE instruction, the bit device (d)+1 is set and
Error an error code is written to (s1)+1. For more information about the error codes please refer to
the following manuals:
● When the error code is 4FFFH or less, please refer to chapter 13 of this manual for error
diagnostics.
● When the error code is 7000H or higher, please refer to the user’s manual of the serial
communication module.

12 – 20
Instructions for serial communication modules PRR, PRRP

Program PRR
Example
The program for this example transmits data and the first five user frames. The communication
module QJ71C24 is used. It occupies the input/output signals from X/Y80 to X/Y9F. The follow-
ing data registers are used in the program:
Data register Contents Meaning
D0 0004H Number of bytes to send
D1 3412H
Data to be send
D2 AB56H
D5 03F2H
D6 03F3H
D7 8001H
Numbers of the user frames
D8 8000H
D9 041BH
D10 0000H
D11 0001H (s)+0 Interface: CH1
0000H or
D12 (s)+1 Transmission result
error code
D13 0000H (s)+2 CR/LF is not added
D14 0001H (s)+3 Transmission pointer
D15 0005H (s)+4 Number of data frames to transmit

Programming MELSEC System Q and L series 12 – 21


PRR, PRRP Instructions for serial communication modules

NOTE When using the IEC editors it is neccessary to define the variables in the header of the program
organization unit (POU). Without variable definition it would cause compiler or checker error
messages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC De-
veloper" of this manual.
● IEC editors
Ladder Diagram of the GX IEC Developer (part 1)

The request to transmit data is converted to a pulse.

The data to be send is specified.

The numbers of the user frames are stored in D5 to D9.

The user frame numbers are written to the buffer


memory of the communication module.

12 – 22
Instructions for serial communication modules PRR, PRRP

Ladder Diagram of the GX IEC Developer (continued)

Interface (channel) 1

The transmission result is cleared.

CR/LF is not added

Setting of the pointer

Setting of number of user frames

Transmit data

At this position, write the instructions that should be executed when the PRR
instruction has been completed normally.

At this position, write the instructions that should be executed when the PRR
instruction has been completed with an error.

IEC Instruction List

For an explanation of the devices and instructions used


please see the above ladder diagram.

An instruction at this position will be executed when the PRR instruction has been completed normally.

An instruction at this position will be executed when the processing of the PRR instruction has been completed with
an error.

Programming MELSEC System Q and L series 12 – 23


PRR, PRRP Instructions for serial communication modules

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the PRR instruction
has been completed normally.

At this position, write the instructions that should be executed when the PRR instruction
has been completed with an error.

12 – 24
Instructions for serial communication modules PRR, PRRP

MELSEC Instruction List

An instruction at this position will be executed when the PRR instruction has been completed normally.

At this position, write the instructions that should be executed when the PRR instruction has been completed
with an error.

Programming MELSEC System Q and L series 12 – 25


Instructions for PROFIBUS/DP interface modules

12.2 Instructions for PROFIBUS/DP interface modules

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
Reading of data from the buffer G.BBLKRD BBLKRD_M
memory of a PROFIBUS/DP interface
module GP.BBLKRD BBLKRDP_M

Writing of data to the buffer memory G.BBLKWR BBLKWR_M


of a PROFIBUS/DP interface module GP.BBLKWR BBLKWRP_M

12 – 26
Instructions for PROFIBUS/DP interface modules BBLKRD, BBLKRDP

12.2.1 BBLKRD, BBLKRDP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1 —   — — — —  —
d —   — — — — — —
n2 —   — — — —  —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Set Data Meaning Data Type


Un Head I/O number of the PROFIBUS interface module on the base unit
Head address of the buffer memory of the PROFIBUS interface module from BIN 16-bit
n1
where the reading of the data is started.
d Head address of the device area in the PLC CPU where the read data is stored Device name
n2 Number of data to read BIN 16-bit

Programming MELSEC System Q and L series 12 – 27


BBLKRD, BBLKRDP Instructions for PROFIBUS/DP interface modules

Functions Reading of data from the buffer memory of a PROFIBUS interface module
BBLKRD / BBLKRDP Reading of data
The BBLKRD instruction is used to read data from the buffer memory of the PROFIBUS inter-
face modules QJ71PB92D and QJ71PB93D. While reading, data separation is prevented.
The QJ71PB93 must be prepared for the BBLKRD instruction by setting of the output signal
Y0A. When the PROFIBUS module in turn sets the input signal X0A, the BBLKRD instruction
can be executed. The output signal Y0A must be reset when the reading of the buffer memory
is completed.
Allowable ranges and designation of the devices:
● Un (Head I/O address of the PROFIBUS interface module): 0 to FFH
(Only the upper two digits of the 3-digit-address are used. E. g. the head address X/Y100
is set as 10H.)
● n1 (Head address in the buffer memory): The specified address must be exist.
● d (Head address of the target area): The designated device must be exist.
● n2 (Number of data to read)
For a QJ71PB92D: 1 to 960 words (1 to 3C0H)
For a QJ71PB93D: 1 to 122 words (1 to 7AH)

NOTES Only a single BBLKRD instruction can be executed in one scan.


The BBLKRD and the BBLKWR instruction (section 12.2.2) are working independently.
The transmision delay time increases when the BBLKRD instruction is used.
The BBLKRD instruction is not executed when the output module has not been set in the data
module setting in the master station parameter.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When a value that exceeds the specificable range is set for the set data. (Error code: 4101)
● By the addition of the head address of the buffer memory designated by n1 and the number
of data to be read designated by n2 the size of the buffer memory is exceeded.
(Error code: 4101)
● The number of data to be read (designated by n2) is larger than the available device area
starting with the head address designated by d. (Error code: 4101)

12 – 28
Instructions for PROFIBUS/DP interface modules BBLKRD, BBLKRDP

Program BBLKRDP
Example
When the relay M10 is set, 122 words of data are read from the buffer memory of the PROFI-
BUS interface module with the head I/O address X/Y0. The reading is started at the buffer
memory address 0 while the storage of the data is started from register D0 onward.

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

Programming MELSEC System Q and L series 12 – 29


BBLKWR, BBLKWRP Instructions for PROFIBUS/DP interface modules

12.2.2 BBLKWR, BBLKWRP

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1 —   — — — —  —
s —   — — — — — —
n2 —   — — — —  —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Set Data Meaning Data Type


Un Head I/O number of the PROFIBUS interface module on the base unit
Head address of the buffer memory of the PROFIBUS interface module from BIN 16-bit
n1
where the writing of the data is started.
Head address of the device area in the PLC CPU where the data is stored that is
s Device name
to be send to the PROFIBUS interface module.
n2 Number of data to be send to the PROFIBUS interface module BIN 16-bit

12 – 30
Instructions for PROFIBUS/DP interface modules BBLKWR, BBLKWRP

Functions Writing of data to the buffer memory of a PROFIBUS interface module


BBLKWR / BBLKWRP Writing of data
The BBLKWR instruction writes data to the buffer memory of the PROFIBUS interface modules
QJ71PB92D and QJ71PB93D. Data separation is prevented during the write operation.
The QJ71PB93 must be prepared for the BBLKWR instruction by setting of the output signal
Y0B. When the PROFIBUS module in turn sets the input signal X0B, the BBLKWR instruction
can be executed. After completion of the writing to the buffer memory the output signal Y0B
must be reset.
Allowable ranges and designation of the devices:
● Un (Head I/O address of the PROFIBUS interface module): 0 to FFH
(Only the upper two digits of the 3-digit-address are used. E. g. the head address X/Y100
is set as 10H.)
● n1 (Head address in the buffer memory): The specified address must be exist.
The head address for the QJ71PB93 has an offset of 100H. Thus, 100H must be subtracted
from the desired head address when designating n1. For example the head address 100H
is specified as „0H“ and the head address 120H is specified as „20H“.
● d (Head address of the source area): The designated device must be exist.
● n2 (Number of data to write)
For a QJ71PB92D: 1 to 960 words (1 to 3C0H)
For a QJ71PB93D: 1 to 122 words (1 to 7AH)

NOTES Only a single BBLKWR instruction can be executed in one scan.


The BBLKRD and the BBLKWR instruction (section 12.2.1) are working independently.
The transmision delay time increases when the BBLKWR instruction is used.
The BBLKRD instruction is not executed when the input module has not been set in the data
module setting in the master station parameter.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When a value that exceeds the specificable range is set for the set data. (Error code: 4101)
● By the addition of the head address of the buffer memory designated by n1 and the number
of data to write (designated by n2) the size of the buffer memory is exceeded.
(Error code: 4101)
● The number of data to be write (designated by n2) is larger than the available device area
starting with the head address designated by d. (Error code: 4101)

Programming MELSEC System Q and L series 12 – 31


BBLKWR, BBLKWRP Instructions for PROFIBUS/DP interface modules

Program BBLKWRP
Example
After the relay M10 is set, the contents of the data registers D0 to D121 (122 words) is written
to the input area of the PROFIBUS/DP slave module QJ71PB93D. The input area starts at the
buffer memory address 100H. Please note that the head address designated by n1 is specified
with „0H“ in this case. The head I/O number of the PROFIBUS/DP slave module is X/Y0.

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

12 – 32
Instructions for ETHERNET interface modules

12.3 Instructions for ETHERNET interface modules

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor

Reading of received data from fixed ZP.BUFRCV BUFRCV_M


buffers Z.BUFRCVS BUFRCVS_M
Sending of data to fixed buffers ZP.BUFSND BUFSND_M
Opening of a connection ZP.OPEN OPEN_M
Closing of a connection ZP.CLOSE CLOSE_M
Clearing of error information ZP.ERRCLR ERRCLR_M
Reading of error information ZP.ERRRD ERRRD_M
Reinitialization of a ETHERNET
ZP.UINI UINI_M
interface module

Programming MELSEC System Q and L series 12 – 33


BUFRCV Instructions for ETHERNET interface modules

12.3.1 BUFRCV

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
d1 —   — — — — — —
d2    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 34
Instructions for ETHERNET interface modules BUFRCV

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“) User BIN 16-bit

s1 Connection number 1 to 16
Head number of the devices where control data for execution of this instruction is stored.

Set Data Meaning Description Range Contents is


stored by
(s2)+0 System area Used by the system
Indicates whether an error has
occured during execution of the
s2 instruction: BIN 16-bit
0000H: No error
Execution result Any value other than 0000H: An — System
(s2)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
Head number of the device area where the received data is stored.

Set Data Meaning Description Range Contents is


stored by
With procedure (binary data):
1 to 1017
Number of words read from the words
fixed buffer
With procedure (ASCII data):
d1 Length of the 1 to 508 BIN 16-bit
(d1)+0 Number of words read from the
received data words
fixed buffer
System
Without procedure (binary data):
Number of bytes read from the 1 to 2016
bytes
fixed buffer
In this area the data read from the
(d1)+1 to
Received data fixed buffer is stored sequentially in —
(d1)+n
ascending order.
Bit device which is set for one scan after completion of the BUFRCV instruction. (d)+1
indicates an abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
d2 Instruction BUFRCV instruction Bit
(d2)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the BUFRCV instruction
(d2)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 35


BUFRCV Instructions for ETHERNET interface modules

Functions Reading of received data from fixed buffer (Execution of the instruction in the main
program)
BUFRCV Data read
With the BUFRCV instruction, Data sent by an external Station to an ETHERNET interface
module via fixed buffer communication can be read from the ETHERNET module and stored
in the PLC CPU. The BUFRCV instruction is executed in the main program, whereas the
BUFRCVS instruction is used in an interrupt program. Where the data should be stored is
specified with d1:

PLC CPU ETHERNET module


d1
Fixed buffer
Data length Number 1

Data
BUFRCV
Number n

Data Number 16

Whether the execution of the BUFRCV instruction has been finished can be checked with the
devices (d2)+0 and (d2)+1:
● The bit device (d2)+0 turns ON with the END processing of the scan in which the BUFRCV
instruction has been completed and turns OFF at the next END processing.
● The bit device (d2)+1 indicates an error during execution of the BUFRCV instruction. When
the instruction is completed normal, this device stays OFF. When an error occurs during the
execution of the BUFRCV instruction, (d2)+1 turns ON at the END processing of the scan
in which the BUFRCV instruction has been completed and turns OFF at the next END
processing.
The timing for the PRR instruction is shown in the following figure:

Sequence program Scan END Scan END Scan END

BUFRCV instruction Execution of the instruction

Bit device (d2)+0

Bit device (d2)+1 In case of an error

Data receive

The BUFRCV instruction can be executed when the ETHERNET interface module indicates
that data has been received. One bit is reserved in the buffer memory address 5005H for each
of the 16 possible connections and is set when data has been received.
NOTE It is not possible to read received data of the same connection with the BUFRCV instruction in
the main programm and the BUFRCVS instruction in an interrupt program.
Operation When the BUFRCV instruction is completed abnormally, the bit device (d2)+1 is set, and an er-
Error ror code is stored in (s2)+1. For more information about the error codes please refer to the fol-
lowing manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 36
Instructions for ETHERNET interface modules BUFRCV

Program BUFRCV
Example
The following program reads received data from the fixed buffer for connection number 1. The
input/output points X/Y0 to X/Y1F are occupied by the ETHERNET module.
● IEC editors (This program example is shown on the next page for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Reading of the connection status


(M0 = 1: Opening of connection 1 completed)

Reading of the opening request

Reading of the fixed buffer receiving status


(M40 = 1: Data has been received via connection 1)

Changing of reading request to a pulse


(X19 = 1: Start up of the module has been completed)

Reading of received data

At this position, write the instructions that should be executed when the BUFRCV
instruction has been completed normally.

At this position, write the instructions that should be executed when the
execution of the BUFRCV instruction has been resulted in an error.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above ladder diagram

At this position, write the instructions that should be executed when the BUFRCV
instruction has been completed normally.

At this position, write the instructions that should be executed when the execution
of the BUFRCV instruction has been resulted in an error.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 37


BUFRCV Instructions for ETHERNET interface modules

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the
BUFRCV instruction has been completed normally.

At this position, write the instructions that should be executed when the
execution of the BUFRCV instruction has been resulted in an error.

MELSEC Instruction List

At this position, write the instructions that should be executed when the BUFRCV
instruction has been completed normally.

At this position, write the instructions that should be executed when the execution
of the BUFRCV instruction has been resulted in an error.

12 – 38
Instructions for ETHERNET interface modules BUFRCVS

12.3.2 BUFRCVS

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — —  —
d1 —   — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“) User BIN 16-bit

s1 Connection number 1 to 16
Head number of the device area where the received data is stored.
Contents is
Set Data Meaning Description Range stored by
1 to 1017
With procedure (binary data):)
Length of the words
received data
d1 (d1)+0 (Number of word With procedure (ASCII data): 1 to 508 BIN 16-bit
words
or bytes read from
the fixed buffer) 1 to 2016 System
Without procedure (binary data): bytes
(d1)+1 In this area the data read from the
to Received data fixed buffer is stored sequentially in —
(d1)+n ascending order.

Programming MELSEC System Q and L series 12 – 39


BUFRCVS Instructions for ETHERNET interface modules

Functions Reading of received data from fixed buffer (Execution of the instruction in an interrupt
program)
BUFRCVS Data read
With the BUFRCVS instruction, Data sent by an external Station to an ETHERNET interface
module via fixed buffer communication can be read from the ETHERNET module and stored
in the PLC CPU. The BUFRCVS instruction is executed in an interrupt program, whereas the
BUFRCV instruction is used in the main program. Where the data should be stored is specified
with d1:

PLCCPU ETHERNET module


d1
Fixed buffer
Data length Number 1

Data
BUFRCVS
Number n

Data Number 16

The processing of the BUFRCVS instruction is completed within one scan. The following figure
shows the timing of the BUFRCVS instruction:

Scan
Processig of the
Sequence END instruction
program
Interrupt program

BUFRCVS Execution
instruction

Data receiving Data storage

In order to read receive data with an interrupt program, it is necessary to perform both the inter-
rupt settings and interrupt pointer settings with parameter settings of GX (IEC) Developer.

NOTES It is not possible to read received data of the same connection with the BUFRCV instruction in
the main programm and the BUFRCVS instruction in an interrupt program.
The BUFRCVS instruction can also used for an serial communication module QJ71C24 (see
chapter 11.1.1).

Operation When the BUFRCV instruction is completed abnormally, the error flag SM0 is set, and an error
Error code is stored in SD0. For more information about the error codes please refer to the following
manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 40
Instructions for ETHERNET interface modules BUFRCVS

Program BUFRCVS
Example
The following program reads received data from the fixed buffer for connection number 2. The
head I/O number of the ETHERNET module is X/Y0.

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

Programming MELSEC System Q and L series 12 – 41


BUFSND Instructions for ETHERNET interface modules

12.3.3 BUFSND

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
s3 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 42
Instructions for ETHERNET interface modules BUFSND

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“) User BIN 16-bit

s1 Connection number 1 to 16
Head number of the devices where control data for execution of this instruction is stored.

Set Data Meaning Description Range Contents is


stored by
(s2)+0 System area Used by the system
Indicates whether an error has
occured during execution of the
s2 instruction: BIN 16-bit
0000H: No error
Execution result Any value other than 0000H: An — System
(s2)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
Head number of the devices where the send data is stored.

Set Data Meaning Description Range Contents is


stored by
Designation of the amount of data
that is to be transferred to the fixed 1 to 1017
buffer when a procedure (binary words
data) is used for communication.
Designation of the amount of data
s3 that is to be transferred to the fixed 1 to 508 BIN 16-bit
Length of the data words
(s3)+0 buffer when a procedure (ASCII
to be send
data) is used for communication. User
Designation of the amount of data
that is to be transferred to the fixed
buffer when a non procedure 1 to 2046
bytes
protokoll (binary data) is used for
communication.
(s3)+1 to The data stored in this are is send
Data to be send —
(s3)+n to the ETHERNET module.
Bit device which is set for one scan after completion of the BUFSND instruction. (d)+1
indicates an abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
d1 Instruction BUFSND instruction Bit
(d1)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the BUFSND instruction
(d1)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 43


BUFSND Instructions for ETHERNET interface modules

Functions Sending of data to fixed buffer


BUFSND Data send
Data which is to be send through fixed buffer communication to an external device connected
to an ETHERNET interface module is send to this module by the BUFSND instruction in
advance. The data is stored in the PLC CPU from the device designated by (s3)+1 onward:

PLC CPU ETHERNET module


Fixed buffer
(s3) Data length No. 1
Send data
BUFSND
No. n External device

Send data No. 16

Whether the execution of the BUFSND instruction has been finished can be checked with the
devices (d)+0 and (d)+1:
● The bit device (d)+0 turns ON at the END processing of the scan in which the BUFSND
instruction has been completed and turns OFF at the next END processing.
● The bit device (d)+1 indicates an error during execution of the BUFSND instruction. When
the instruction is completed normal, this device stays OFF. When an error occurs during
execution of the BUFSND instruction, (d)+1 turns ON at the END processing of the scan in
which the BUFSND instruction has been completed and turns OFF at the next END
processing.
The following figure shows the timing when the BUFSND instruction is being executed:

END processing END processing END processing END processing


Sequence
program
Start Completion of the BUFSND
instruction
BUFSND
instruction

Instruction
Bit device (d1)+0 completed

Error
Bit device (d1)+1
One scan

The BUFSND instruction is executed when the command for this instruction switches from off
to on.

Operation When the BUFRCV instruction is completed abnormally, the bit device (d1)+1 is set, and an er-
Error ror code is stored in (s2)+1. For more information about the error codes please refer to the fol-
lowing manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 44
Instructions for ETHERNET interface modules BUFSND

Program BUFSND
Example
The following program writes data to the fixed buffer for connection 1. The head I/O number of
the ETHERNET module is X/Y0.
● IEC editors (On the next page the same program example is shown for the MELSEC
instruction list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Pulse forming
(X19 = 1: Start up of the module has been completed
sucessfully; M0 = 1: Opening of connection 1 com-
pleted)

6 words will be send

Registration of send data

The data is send to the buffer memory of the


ETHERNET module.

At this position, write the instructions that should be executed when the BUFSND
instruction has been completed normally.

At this position, write the instructions that should be processed when the execution
of the BUFSND instruction has been resulted in an error.

IEC Instruction List

TFor an explanation of the devices and instructions


used please see the above ladder diagram.

At this position, write the instructions that should be executed when the BUFSND
instruction has been completed normally.

At this position, write the instructions that should be processed when the execution
of the BUFSND instruction has been resulted in an error.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 45


BUFSND Instructions for ETHERNET interface modules

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the
BUFSND instruction has been completed normally.

At this position, write the instructions that should be processed when the
execution of the BUFSND instruction has been resulted in an error.

MELSEC Instruction List

At this position, write the instructions that should be executed when the BUFSND
instruction has been completed normally.

At this position, write the instructions that should be processed when the execution
of the BUFSND instruction has been resulted in an error.

12 – 46
Instructions for ETHERNET interface modules OPEN

12.3.4 OPEN

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Contents is Data


Set Data Meaning Range
stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“) User BIN 16-bit

s1 Connection number 1 to 16

Programming MELSEC System Q and L series 12 – 47


OPEN Instructions for ETHERNET interface modules

Variables Contents is Data


Set Data Meaning Range stored by Type
Head number of the devices where control data for the execution of this instruction is stored.
Contents is
Set Data Meaning Description Range
stored by
Designate which settings are used
to open the connection:
Source of the  0000H: The connection will be 0000H
opened with the settings made in
(s2)+0 parameter GX (IEC) Developer. or User
settings 8000H
 8000H: The connection will be
opened with the settings stored
in the devices (s2)+2 to (s2)+9.
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result Any value other than 0000H: An
(s2)+1 error has occured. The stored — System
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
The bits of this device are used to
make settings for the connection:
 Bit 0: Usage of fixed buffers
0: The buffer is used for
transmission, fixed buffer
s2 communication is not BIN 16-bit
executed
1: The buffer is used for
receiving
 Bit 1: Destination existence con-
firmation
0: No confirm
1: Confirm
 Bit 7: Pairing open setting
0: No pairs
1: Pairs Please see
Application  Bit 8: Communication method the describ-
(s2)+2 (protocol) User
setting area tion on the
0: TCP/IP left.
1: UDP/IP
 Bit 9: Fixed buffer communica-
tion
0: With procedure
1: Without procedure
 Bit 13: Issue an interrupt when
receiving fixed buffer
0: No interrupt
1: An Interrupt is issued
 Bits 14 and 15: Active or passive
opening
Bit 15/14 = 00: Active open or
UDP/IP
Bit 15/14 = 10: Unpassive open
Bit 15/14 = 11: Full passive open

12 – 48
Instructions for ETHERNET interface modules OPEN

Variables Contents is Data


Set Data Meaning Range stored by Type
Set Data Meaning Description
408H
to
Port No. of the 1388H
Designate the port No. of the
(s2)+3 ETHERNET
ETHERNET interface module. 138BH
module
to
FFFEH
IP address of the external device to
communicate with. 1H
(s2)+4 Destination IP
When the IP address FFFFFFFFH to
(s2)+5 address FFFFFFFFH
is set, data is exchanged with
s2 simultaneous broadcast.
User BIN 16-bit
Port No. of the external device to 401H
Destination Port
(s2)+6 communicate with. to
No. FFFFH
(FFFFH = Simultaneous broadcast)
When the external device supports
the ARP function set either
(s2)+7 Destination 000000000000H or Please see
the describ-
to ETHERNET FFFFFFFFFFFFH.When the
tion on the
(s2)+9 address external device support does not left.
support the ARP function set the
destination ETHERNET address.
Bit device which is set for one scan after completion of the OPEN instruction. (d)+1 indicates
an abnormal completion of the instruction.

Set Data Meaning Description Range Contents is


stored by
Indicates the completion of the
d1 Instruction OPEN instruction Bit
(d1)+0 —
completed ON: Instruction completed
OFF: Instruction not completed
System
Indicates the abnormal completion
Instruction
of the OPEN instruction
(d1)+1 completed with —
ON: Abnormal completion
error
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 49


OPEN Instructions for ETHERNET interface modules

Functions Opening of a connection


OPEN Open connection
This instruction performs the open processing for a connection specified by s1 for the module
designated by Un.
Whether the execution of the OPEN instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the OPEN
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the OPEN instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the OPEN instruction, (d1)+1 turns ON at the END processing of the
scan in which the OPEN instruction has been completed and turns OFF at the next END
processing.
The following figure shows the timing when the OPEN instruction is being executed:

END processing END processing END processing END processing


Sequence
program
Start Completion of the OPEN
instruction
OPEN instruction

Instruction
Bit device (d1)+0 completed

Error
Bit device (d1)+1
One scan

The OPEN instruction is executed when the command for this instruction switches from off to
on.

NOTE Never execute the open/close processing using input/output signals and the OPEN or CLOSE
dedicated instructions simultaneously for the same connection. It will result in malfunctions.

Operation When an error occurs during the processing of the OPEN instruction, the bit device (d1)+1 is
Error set, and an error code is stored in (s2)+1. For more information about the error codes please refer
to the following manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 50
Instructions for ETHERNET interface modules OPEN

Program OPEN
Example
The following program active opens the connection number 1 for TCP/IP communication. The
head I/O address of the is X/Y0.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● Ladder Diagram (GX IEC Developer)


For the following example it is neccesary to set the parameters with the GX (IEC) Developer
in advance. Another example where the settings are made with the OPEN instruction is
shown on the next page.

Setting of the parameters is done using the GX Works2 or the GX IEC Developer

1
Reading of the connection status (M0 = 1: Opening of connection 1 has been completed)
2 Reading of the open request (M20 = 1: Opening of connection 1 is requested)
3 The signal to open the connection is converted to a pulse.
4
The source for the parameters is set (0000H = External setting).
5 Opening of connection 1
6 M150 is set when the opening of the connection has been completed without an error.
7
M151 is set when an error has occured during the opening of the connection.

Programming MELSEC System Q and L series 12 – 51


OPEN Instructions for ETHERNET interface modules

The settings for the connection are stored in the devices designated by (s2)+2 to (s2)+9

10

11

1
Reading of the connection status (M0 = 1: Opening of connection 1 has been completed)
2 Reading of the open request (M20 = 1: Opening of connection 1 is requested)
3 The signal to open the connection is converted to a pulse.

4
The source for the parameters is set (8000H = Parameters are stored in (s2)+2 to (s2)+9))
5
The application setting is stored in (s2)+2.
6 The port No. of the ETHERNET module is written to (s2)+3.

7
The IP address (10.97.85.223) of the external device is stored in (s2)+4 and (s2)+5.
8 In (s2)+6 the port No. of the external device is stored.

9 Opening of connection 1

10
M150 is set when the opening of the connection has been completed without an error.
11 M151 is set when an error has occured during the opening of the connection.

12 – 52
Instructions for ETHERNET interface modules OPEN

● IEC Instruction List

Setting of the parameters is done using the GX Works2 or the GX IEC Developer

1
2

4
9

10

11

The settings for the connection are stored in the devices designated by (s2)+2 to (s2)+9

1
2
3

4
5
6
7
8
9

10

11

1 Reading of the connection status (M0 = 1: Opening of connection 1 has been completed)
2
Reading of the open request (M20 = 1: Opening of connection 1 is requested)
3 The signal to open the connection is converted to a pulse.

4 The source for the parameters is set (0000H = External, 8000H = Devices (s2)+2 to(s2)+9))

5
The application setting is stored in (s2)+2.
6 The port No. of the ETHERNET module is written to (s2)+3

7 The IP address (10.97.85.223) of the external device is stored in (s2)+4 and (s2)+5.

8
In (s2)+6 the port No. of the external device is stored.
9 Opening of connection 1

10 M150 is set when the opening of the connection has been completed without an error.

11
M151 is set when an error has occured during the opening of the connection.

Programming MELSEC System Q and L series 12 – 53


OPEN Instructions for ETHERNET interface modules

● Ladder Diagram (GX Works2)

Setting of the parameters is done using the GX Works2 or the GX IEC Developer

10

11

The settings for the connection are stored in the devices designated by (s2)+2 to (s2)+9

10

11

1
Reading of the connection status (M0 = 1: Opening of connection 1 has been completed)
2
Reading of the open request (M20 = 1: Opening of connection 1 is requested)
3
The signal to open the connection is converted to a pulse.
4
The source for the parameters is set (0000H = External, 8000H = Devices (s2)+2 to(s2)+9))
5
The application setting is stored in (s2)+2.
6
The port No. of the ETHERNET module is written to (s2)+3
7
The IP address (10.97.85.223) of the external device is stored in (s2)+4 and (s2)+5.
8
In (s2)+6 the port No. of the external device is stored.
9
Opening of connection 1
10 M150 is set when the opening of the connection has been completed without an error.

11
M151 is set when an error has occured during the opening of the connection.

12 – 54
Instructions for ETHERNET interface modules OPEN

● MELSEC Instruction List

Setting of the parameters is done using the GX Works2 or the GX IEC Developer

1
2

4
9

10

11

The settings for the connection are stored in the devices designated by (s2)+2 to (s2)+9

1
2
3

4
5
6
7
8
9

10

11

1
Reading of the connection status (M0 = 1: Opening of connection 1 has been completed)
2
Reading of the open request (M20 = 1: Opening of connection 1 is requested)
3
The signal to open the connection is converted to a pulse.
4 The source for the parameters is set (0000H = External, 8000H = Devices (s2)+2 to(s2)+9))

5
The application setting is stored in (s2)+2.
6
The port No. of the ETHERNET module is written to (s2)+3
7 The IP address (10.97.85.223) of the external device is stored in (s2)+4 and (s2)+5.

8 In (s2)+6 the port No. of the external device is stored.

9
Opening of connection 1
10
M150 is set when the opening of the connection has been completed without an error.
11 M151 is set when an error has occured during the opening of the connection.

Programming MELSEC System Q and L series 12 – 55


CLOSE Instructions for ETHERNET interface modules

12.3.5 CLOSE

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — —  —
s2 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 56
Instructions for ETHERNET interface modules CLOSE

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH
number, e. g. the head address X/Y100 is set as „U10“) User BIN 16-bit

s1 Number of the connection 1 to 16


Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
(s2)+0 System area Used by the system
Indicates whether an error has
occured during execution of the
s2 instruction: BIN 16-bit
0000H: No error
Execution result Any value other than 0000H: An — System
(s2)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
Bit device which is set for one scan after completion of the CLOSE instruction. (d)+1 indicates
an abnormal completion of the instruction
Contents is
Set Data Meaning Description Range
stored by
Indicates the completion of the
Instruction CLOSE instruction
d1 (d1)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d1)+1 completed with CLOSE instruction —
error ON: Abnormal completion
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 57


CLOSE Instructions for ETHERNET interface modules

Functions Closing of a connection


CLOSE Close connection
This instruction closes the connection specified by s1 for the module designated by Un (dis-
connecting connections).
Whether the execution of the CLOSE instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the CLOSE
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the CLOSE instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the CLOSE instruction, (d1)+1 turns ON at the END processing of the
scan in which the CLOSE instruction has been completed and turns OFF at the next END
processing.
The timing for the CLOSE instruction is shown in the following figure:

END processing END processing END processing END processing


Sequence
program
Start Completion of the CLOSE instruction

CLOSE instruction

Instruction
Bit device (d1)+0 completed

Error
Bit device (d1)+1
One scan

The CLOSE instruction is executed when the command for this instruction switches from off to
on.

NOTE Never execute the open/close processing using input/output signals and the OPEN or CLOSE
dedicated instructions simultaneously for the same connection. It will result in malfunctions.

Operation When an error occurs during the processing of the CLOSE instruction, the bit device (d1)+1 is
Error set, and an error code is stored in (s2)+1. For more information about the error codes please refer
to the following manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 58
Instructions for ETHERNET interface modules CLOSE

Program CLOSE
Example
The following program closes the connection number 1 of the ETHERNET module with the
head I/O address X/Y0.
● IEC editors (On the next page the same program example is shown for the MELSEC
instruction list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

A pulse is formed when the connection 1 is closed by


the external device
(M0 = 1: Connection 1 established)

A pulse is formed when the connection 1 is closed by


the external device and the connection was opend with
an OPEN instruction.
(M150 = OPEN instruction completed)

The close request from the local station is changed to


a pulse
(M123 = Close connection 1)

Closing of connection 1

M210 = Closing of connection 1 is performed

M202 = CLOSE instruction completed without error

M203 = CLOSE instruction completed with error

After the completion of the CLOSE instruction M210


is reset.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above ladder diagram.

Programming MELSEC System Q and L series 12 – 59


CLOSE Instructions for ETHERNET interface modules

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.
● MELSEC instruction list and ladder diagram of the GX Works2
For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

MELSEC Instruction List

12 – 60
Instructions for ETHERNET interface modules ERRCLR

12.3.6 ERRCLR

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 61


ERRCLR Instructions for ETHERNET interface modules

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)
Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
(s1)+0 System area Used by the system
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result Any value other than 0000H: An — System
(s1)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.

s1 0000H BIN 16-bit


Depending on the entered value an 0001H
error code stored in the buffer to
0016H
memory is cleared and the „ERR.“
Error information 0100H
(s1)+2 LED of the ETHERNET module is
to be cleared 0101H
switched off.
Please refer to the description on 0102H
the next page. User
0103H
FFFFH
Choose between clearing of an
error code and switching off of the 0000H
(s1)+3 Function „ERR.“ LED. or
Please refer to the description on FFFFH
the next page.
(s1)+4
to System area Used by the system — System
(s1)+7
Bit device which is set for one scan after completion of the ERRCLR instruction. (d)+1
indicates an abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction ERRCLR instruction
d1 (d1)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d1)+1 completed with ERRCLR instruction —
error ON: Abnormal completion
OFF: Normal completion

12 – 62
Instructions for ETHERNET interface modules ERRCLR

Functions Clearing of errorcode and turning off the „ERR.“ LED


ERRCLR Clearing operation
The ERRCLR instruction clears an error code stored in the buffer memory of the ETHERNET
interface module. When the „ERR.“ LED at the front side of the module is lit, this indicator is
turned off after processing of the ERRCLR instruction as well. This instruction also clears the
areas in the buffer memory where the communication status is stored.
Which area of the buffer memory is cleared depends on the contents of the devices designated
by (s1)+2 and (s1)+3:
Contents of
Error or communication status area Action that will be performed
(s1)+2 (s2)+3
 The buffer memory address 69H is
Initial error 0000H cleared.
 The „ERR.“ LED is switched off.
0001H
to 0000H  The buffer memory address where
an errorcode for the faulty connec-
0016H tion is stored is cleared (7CH,
Error when opening an connection
(Number 86H...).
of the con-
 The „ERR.“ LED is switched off.
nection)

Error log 0100H  The error log (addresses E3H to


174H) is cleared.
 The buffer memory addresses from
Status of the protocols 0101H 178H to 1FFH are cleared.
 The buffer memory addresses from
Communication status E-mail receive status 0102H
FFFFH 5871H to 5B38H are cleared.

E-mail send status 0103H  The buffer memory addresses from


5B39H to 5CA0H are cleared.
 All above mentioned buffer memory
All stored error codes or communication status areas are cleared.
FFFFH
areas
 The „ERR.“ LED is switched off.

Whether the execution of the ERRCLR instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the ERRCLR
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the ERRCLR instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the ERRCLR instruction, (d1)+1 turns ON at the END processing of the
scan in which the ERRCLR instruction has been completed and turns OFF at the next END
processing.
The timing when executing the ERRCLR instruction is shown below:

END processing END processing END processing END processing


Sequence
program
Start Completion of the ERRCLR instruction
ERRCLR
instruction

Instruction
Bit device (d1)+0 completed

Error
Bit device (d1)+1
One scan

Operation When an error occurs during the processing of the ERRCLR instruction, the bit device (d1)+1
Error is set, and an error code is stored in (s1)+1. For more information about the error codes please

Programming MELSEC System Q and L series 12 – 63


ERRCLR Instructions for ETHERNET interface modules

refer to the following manuals:


● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

12 – 64
Instructions for ETHERNET interface modules ERRCLR

Program ERRCLR
Example
The following program is used to clear the error code issued for connection 1. The ETHERNET
module occupies the inputs and outputs from X/Y0.
● IEC editors (On the next page this program example is shown for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Clearing of the error code for connection 1 (1H is


entered in (s1)+2)

Selection of the function: Clearing of the error code


and turning off the „ERR.“ LED (Moving of 0H to (s1)+3)

The signal to start the ERRCLR instruction is set.

Execution of the ERRCLR instruction

When the ERRCLR instruction has been completed


normally the data register D100 is cleared. In D100 the
error code of the ERRCLR instruction is stored.

When an error has occured during execution of the


ERRCLR instruction the error code ist moved from
(s1)+1 (register D1) to D100.

The start signal for the ERRCLR instruction is reset.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above ladder diagram.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 65


ERRCLR Instructions for ETHERNET interface modules

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

MELSEC Instruction List

12 – 66
Instructions for ETHERNET interface modules ERRRD

12.3.7 ERRRD

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 67


ERRRD Instructions for ETHERNET interface modules

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)
Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
(s1)+0 System are Used by the system
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result Any value other than 0000H: An — System
(s1)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
Depending on the entered value an
s1 error code stored in the buffer BIN 16-bit
memory is read:
 0000H: Initial error code which is 0000H
Error code to be entered in the buffer memory 0001H
(s1)+2
read address 69H. to
 0001H to 0016H: Error code for 0016H User
the connection with this number
(Buffer memory address 7CH,
86H ...)
Reading of the last issued error
(s1)+3 Function 0000H
code
Stores the error code read from the
ETHERNET module
(s1)+4 Read error code — System
0000H = No error
Other than 0000H: error code
(s1)+5
to System area Used by the system — System
(s1)+7
Bit device which is set for one scan after completion of the ERRRD instruction.
(d)+1 indicates an abnormal completion of the instruction.
Contents is
Set Data Meaning Description Range
stored by
Indicates the completion of the
Instruction ERRRD instruction
d1 (d1)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d1)+1 completed with ERRRD instruction —
error ON: Abnormal completion
OFF: Normal completion

12 – 68
Instructions for ETHERNET interface modules ERRRD

Functions Reading of an error code from an ETHERNET module


ERRRD Read error code
This instruction reads error code which is stored in the buffer memory of the ETHERNET inter-
face module with the head I/O number designated by „Un“.
The device designated by (s1)+2 stores information about the buffer memory address to read
from.
Whether the execution of the ERRRD instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the ERRRD
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the ERRRD instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the ERRRD instruction, (d1)+1 turns ON at the END processing of the
scan in which the ERRRD instruction has been completed and turns OFF at the next END
processing.
The following figure shows the timing when the ERRRD instruction is being executed:

END processing END processing END processing END processing


Sequence
program
Start Completion of the ERRRD instruction
ERRRD-
instruction

Instruction
Bit device (d1)+0 completed

Error
Bit device (d1)+1
One scan

Operation When an error occurs during the processing of the ERRRD instruction, the bit device (d1)+1 is
Error set, and an error code is stored in (s1)+1. For more information about the error codes please refer
to the following manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please refer to the user’s manual of the ETHERNET
interface module.

Programming MELSEC System Q and L series 12 – 69


ERRRD Instructions for ETHERNET interface modules

Program ERRRD
Example
The following program reads the error code which is issued if the opening of connection 1 has
failed. The ETHERNET module has the head I/O address X/Y0.
● IEC editors (On the next page this program example is shown for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Reading of the error code for connection 1 (1H is


moved to (s1)+2)

Setting of the function: Reading of the last error code


(0H is stored in (s1)+3)

The start signal for the ERRRD instruction is set.

The ERRRD instruction is executed when M1 changes


from off to on.

When the ERRRD instruction has been completed


normally the data register D101 is cleared. In D101 the
error code of the ERRCLR instruction is stored.

When an error has occured during execution of the


ERRCLR instruction the error code ist moved from
(s1)+1 (register D1) to D101.

The start signal for the ERRRD instruction is reset.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above ladder diagram.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

12 – 70
Instructions for ETHERNET interface modules ERRRD

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

MELSEC Instruction List

Programming MELSEC System Q and L series 12 – 71


UINI Instructions for ETHERNET interface modules

12.3.8 UINI

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
d1    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 72
Instructions for ETHERNET interface modules UINI

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the ETHERNET interface module
„Un“ (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as „U10“)
Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
(s1)+0 System area Used by the system
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result Any value other than 0000H: An — System
(s1)+1 error has occured. The stored
of the instruction
value is an error code which is
explained either in the user’s man-
ual of the ETHERNET interface
module or in chapter 13 of this
manual.
The bits 0 and 1 of this word device
are used to specify the parameters
to be changed:
 Bit 0: Change of the IP address
of the local station (The new
address is entered in (s1)+3 and
(s1)+4.)
0: The IP address is not changed 0000H
(s1)+2 Target of change 1: Change the IP address to
0003H
 Bit 1: Change of the operation
settings (Enter the new settings
in (s1)+5.)
0: Settings are not changed
s1 1: The Settings are changed BIN 16-bit
Make sure to set all other bits (b2
to b15) to „0“.

(s1)+3 IP address of the 00000001H


New IP address of the local station to
(s1)+4 locale station FFFFFFFEH
The bits of this word device specify
the operation settings: User
 Bit 1: Communication data code
setting
0: Communication in binary code
1: Communication in ASCII code
 Bit 5: Send frame setting
0: ETHERNET frame
1: IEEE802.3 frame
 Bit 6: Enable/disable writing of
program when the CPU is in
Operation RUN mode
(s1)+5 —
settings
0: Writing disabled
1: Writing enabled
 Bit 8: Initial time setting
0: Do not wait for open
(Communication is impossible
when the CPU is stopped.)
1: Always wait for open
(Communication is possible
when the CPU is stopped.)
All other bits of this device must be
reset (to „0“).

Programming MELSEC System Q and L series 12 – 73


UINI Instructions for ETHERNET interface modules

Variables Contents is Data


Set Data Meaning Range stored by Type
Bit device which is set for one scan after completion of the UINI instruction. (d)+1 indicates
that an error has occured during execution of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction UINI instruction
d1 (d1)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the UINI
(d1)+1 completed with instruction —
error ON: Abnormal completion
OFF: Normal completion

NOTE When performing re-initial processing of the ETHERNET module only, i.e., without changing the
local station IP address and operation settings, the control data should be specified so that the
value (0H) is stored in (s1)+2, the specification of target of change, before executing the UINI in-
struction.
The ETHERNET module clears external device address information that it has been maintaining
and performs re-initial processing in order to allow data communication to restart. (The initial
normal completion signal (X19) is on.)

Functions Re-initial processing of an ETHERNET interface module


UINI Start re-initialization
The UINI instruction performs the re-initial processing of the ETHERNET module specified with Un.
Whether the execution of the UINI instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the UINI
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the UINI instruction. When the
instruction has been completed normal, this device stays OFF. When an error occurs during
execution of the UINI instruction, (d1)+1 turns ON at the END processing of the scan in
which the UINI instruction has been completed and turns OFF at the next END processing.
The following figure shows the timing when the UINI instruction is being executed:

Sequence END END END


Scan processing Scan processing Scan processing
program

Execution of the UINI instruction


UINI instruction

Bit device (d1)+0 Instruction completed

Bit device (d1)+1 Set when an error occurs

Request for Initialization


re-initialization of the module

12 – 74
Instructions for ETHERNET interface modules UINI

NOTES Please keep the following points in mind when reinitializing an ETHERNET module. (Failure to
do so may cause errors in the data communication with the external devices.)
- Be sure to end all current data communication with external devices and close all connections
before performing a re-initial process.
- Do not mix a re-initial processing done by writing directly into buffer memory, for instance by
using a TO instruction, with a re-initial processing via UINI instruction.
Also, do not request another re-initial processing while an UINI instruction is already being
executed.
- Be sure to reset external devices if the IP address of the ETHERNET module has been
changed. (If an external device maintains the ETHERNET address of a device with which it
communicates, the communication may not be continued after the IP address of the
ETHERNET module has been changed.)

Operation When an error occurs during the processing of the UINI instruction, the bit device (d1)+1 is set,
Error and an error code is stored in (s1)+1. For more information about the error codes please refer to
the following manuals:
● When the error code is 4FFFH or less, you will find more information in chapter 13 of this
manual.
● When the error code is C001H or higher, please see the user’s manual of the ETHERNET
interface module.

Programming MELSEC System Q and L series 12 – 75


UINI Instructions for ETHERNET interface modules

Program UINI
Example
For the ETHERNET module with the head I/O address X/Y0 (Range from X/Y0 to X/Y1F) a
re-initial process is performed.
NOTES Only the connections 1 and 2 are used for this program example. When other connections are
used the corresponding signals must be used.
For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● Ladder Diagram (GX IEC Developer)

Reading of the connection status


(M0 = 1: Opening of connection 1 completed
M1 = 1: Opening of connection 2 completed)

M123 = 1: Re-inital request


M2500 = Start of the re-inital process

X19 =1: Initial normal completion signal


Selection of changes (The operation settings
are changed.)

The current operation settings are read.

Enable writing in RUN mode

Re-initalization of the ETHERNET module

M260 = 1: Initial completion signal

Processing when the UINI instruction has


been executed without an error.

Processing when the execution of the UINI


instruction has been resulted in an error.

The start signal for the re-initialization is


reset.

M260 will be set when the re-inital processing


was sucessfull.

12 – 76
Instructions for ETHERNET interface modules UINI

● IEC Instruction List and MELSEC Instruction List


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

IEC Instruction List MELSEC Instruction List

● Ladder Diagram (GX Works2)


The devices and instructions used are explained with the program example for the ladder
diagram of the GX IEC Developer shown on the previous page.

Programming MELSEC System Q and L series 12 – 77


Instructions for MELSECNET/H

12.4 Instructions for MELSECNET/H

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
Setting of stations for duplex network J.PAIRSET PAIRSET_M

12 – 78
Instructions for MELSECNET/H PAIRSET

12.4.1 PAIRSET

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
s1 —   — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Variables Set Data Befehlswert Data Type


Jn Number of the network (1 to 239)
Head address of the device area where the settings for pairing are stored. BIN 16-bit
s1 File register (R, ZR) or the devices T, ST, C, D and W set in latch range can be
used. When file registers are used, a memory card is required.

Programming MELSEC System Q and L series 12 – 79


PAIRSET Instructions for MELSECNET/H

Functions Pairing setting of stations


PAIRSET Pairing setting instruction
This instruction specifies which station numbers are paired (duplexed). It is required to set up
on the control station.
Structure of the device area storing the settings
● The setting of the stations in the devices designated by s1 cannot be done in a sequence
program. It is necessary to load them in the PLC CPU by peripheral devices in advance.
● Four words are used regardless of the number of stations connected.
● It is only possible to pair two stations with neighbouring station numbers. For pairing, set in
s1 the bit designating the station with the higher number.
● Each bit in the devices designated by (s1)+0 to (s1)+3 stands for a station number between
1 and 64:

Bits
Set Data
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
(s1)+0 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
(s1)+1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
(s1)+2 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
(s1)+3 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49

NOTES The pairing setting instruction is valid only on control stations. Any settings on normal stations
are voided.
If in a redundant system consisting of Q4ARCPUs the control systems network module fails to
data-link due to cable connection breakage, switching from control system to standby system is
done only when pairing setting has been performed.

Program PAIRSET
Example
Pairing is performed for the stations 1 and 2 as well as for the stations 4 and 5 of a redundant
system:

1 Mp1 (Control system) Pair 1 Ns2 (Standby system) 1 Ns3

A61RP AJ71 AS92R Q4RCPU A6RAF Q4RCPU AS92R AJ71 A61RP QnACPU AJ71
QLP21 QLP21 QLP21

Network No. 1

QnACPU AJ71 A61RP AJ71 AS92R Q4RCPU A6RAF Q4RCPU AS92R AJ71 A61RP
QLP21 QLP21 QLP21

1 Ns6 1 Ns5 (Standby system) Pair 1 Ns4 (Control system)

12 – 80
Instructions for MELSECNET/H PAIRSET

The settings are stored in the data registers D0 to D3. Bit 1 (b1) of D0 is set for the pairing of
the stations 1 and 2 whereas b4 is set for the pairing of the stations 4 and 5:

Bits
Set Data
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
D1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
D2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
D3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 81


Instructions for CC-Link

12.5 Instructions for CC-Link

MELSEC Instruction MELSEC Instruction


Function in in
MELSEC Editor IEC Editor
G.RLPA RLPA_MD
Parameter setting for a CC-Link network (A series)
GP.RLPA RLPA_P_MD

Parameter setting for a CC-Link network and start of G.RLPASET RLPASET_MD


the data link (System Q) GP.RLPASET RLPASET_P_MD
G.RRPA RRPA_MD
Setting of automatic refresh parameters (A series)
G.RRPA RRPA_P_MD

Reading from the buffer memory of an intelligent G.RIRD RIRD_MD


device station or the device memory of the PLC CPU GP.RIRD RIRD_P_MD

Writing to the buffer memory of an intelligent device G.RIWT RIWT_MD


station or the device memory of the PLC CPU GP.RIWT RIWT_P_MD

Reading from the buffer memory of an intelligent G.RIRCV RIRCV_MD


device station (with handshake) GP.RIRCV RIRCV_P_MD

Writing to the buffer memory of an intelligent device G.RISEND RISEND_MD


station (with handshake) GP.RISEND RISEND_P_MD
G.RITO RITO_MD
Write to the automatic updated buffer memory
GP.RITO RITO_P_MD
G.RIFR RIFR_MD
Read from the automatic updated buffer memory
GP.RIFR RIFR_P_MD

12 – 82
Instructions for CC-Link RLPASET

12.5.1 RLPASET

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
s3 —   — — — — — —
s4 —   — — — — — —
s5 —   — — — — — —
d    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 83


RLPASET Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the CC-Link master module (Only the upper
Un two digits of an address expressed as a 3-digit number are 0 to FEH User BIN 16-bit
entered, e. g. the head address X/Y100 is set as 10H)
Head number of the devices where control data for the execution of this instruction is stored.

Set Data Meaning Description Range Contents is


stored by
Indicates whether an error has
occured during execution of the
Execution result instruction:
(s1)+0 — System
of the instruction 0000H: No error
Any value other than 0000H: Error
code
The first four bits are used to spec-
ify whether the settings made in s2
to s5 are valid or invalid:
Bit 0 = 1:Slave station settings (s2)
Bit 1 = 1:Reserved station specifi-
cations (s3)
Validation of the Bit 2 = 1:Error invalid station
(s1)+1 0 to F
settings specifications (s4)
Bit 3 = 1:Send, receive and auto-
matic refresh buffer
assignment data (s5)
For the settings marked as invalid
the default parameters will be
applied.

s1 Number of Set the number of connected slave Address


(s1)+2 connected stations (including the reserved 1 to 64
modules stations)
Set the number of retries to a com-
(s1)+3 Number of retries 1 to 7
munication faulty station.
User
Set the number of slave modules
Number of auto-
which after a failure can be
(s1)+4 matic return mod- 1 to 10
returned automatically to the link
ules
within one link scan.
Specifies the data link status when
Operation specifi- a master station PLC CPU error
cation when the occurs.
(s1)+5 0 or 1
PLC CPU has
0: Stop
stopped
1: Continue
Choose betwen the synchronous
and the asynchrous mode
0: The data link is synchronous to
Scan mode speci- the scan of the sequence
(s1)+6 0 or 1
fication program
1: The data link is asynchronous
to the scan of the sequence
program.
Delay time
(s1)+7 Link scan intervall (Unit: 50 µs) 0 to 100
setting

12 – 84
Instructions for CC-Link RLPASET

Variables Contents is Data


Set Data Meaning Range stored by Type
Head device of the area where slave station settings are stored.
Contents is
Set Data Meaning Description
stored by
Settings for
(s2)+0
station No. 1
Settings for
(s2)+1
s2 station No. 2 Address
See the table at page 93
• • Make the settings for as much modules as are
User
• • specified in (s1)+2 as number of connected
modules.
Settings for
(s2)+62
station No. 63
Settings for
(s2)+63
station No. 64
Head device of the area where specifications for reserved stations are stored.
Perform the setting for all stations up to the largest station number set in s2.
Contents is
Set Data Meaning Description
stored by
Setting for station
(s3)+0
No.’s 1 – 16 Specify a reserved station by setting the bit for
s3 the corresponding station number (see the table Address
Setting for station at page 93).
(s3)+1
No.’s 17 – 32 Specify only the head station number of a
User
Setting for station module that occupies 2 or more stations.
(s3)+2
No.’s 33 – 48
No station is reserved in the default parameter
Setting for station setting.
(s3)+3
No.’s 49 – 64
Head device of the area where specifications for error invalid stations are stored.
Perform the setting for all stations up to the largest station number set in s2.
Contents is
Set Data Meaning Description stored by
Setting for station When the error of a station should be ignored,
(s4)+0
No.’s 1 – 16 set the bit for the corresponding station number
(see the table at page 93). Specify only the head
s4 Setting for station station number of a module that occupies 2 or Address
(s4)+1
No.’s 17 – 32 more stations.
Setting for station The reserved station number is given the higher User
(s4)+2 priority if both error invalid station and reserved
No.’s 33 – 48
station specifications are made for the same
station.
Setting for station
(s4)+3 No error invalid station is set in the default
No.’s 49 – 64
parameter setting.

Programming MELSEC System Q and L series 12 – 85


RLPASET Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head device of the area where settings for the buffer memory size are stored.
Perform the settings for stations specified in s2 as local stations and intelligent device
stations. Start with the smallest station number.

Set Data Meaning Description Range Contents is


stored by
0H:
No buffer
40H to
Send buffer Specify the buffer size needed for 1000H
(s5)+0 communication between the mas- (64 to
size
ter station and local stations or 4096 words)
intelligent device stations. Default set-
The maximum size of the send and ting: 40H
receive buffer together is 4096
words (1000H). 0H:
For the sending/receiving buffer No buffer
First module

size, specify a number 7 words 40H to


Receive larger than the size actually 1000H
(s5)+1
buffer size required for communication. (64 to
4096 words)
Default set-
s5 ting: 40H Address
Number of points of the automatic
refresh buffer used for communica- 0H:
No buffer User
tion between the master station
Automatic and local stations or intelligent 80H to
(s5)+2 refresh buffer device stations. 1000H
(128 to
size The size of the automatic updating 4096 words)
buffer must be equal to the size
Default set-
necessary for the individual intelli- ting: 80H
gent device station.
• • • • •
• • • • •
Send buffer
Twenty sixth module

(s5)+75
size
Receive
(s5)+76
buffer size The same as for the 1st module.
Automatic
(s5)+77 refresh buffer
size
Bit device which is set for one scan after completion of the RLPASET instruction. (d)+1
indicates that an error has occured during execution of the instruction.

Set Data Meaning Description Range Contents is


stored by
Indicates the completion of the
Instruction RLPASET instruction
d (d)+0 0 or 1 Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d)+1 completed with RLPASET instruction 0 or 1
error ON: Abnormal completion
OFF: Normal completion

12 – 86
Instructions for CC-Link RLPASET

Slave station settings


For each station a word device ((s2)+0 to (s2)+63) is reserved which contains settings for this
station:
Meaning Description Range

b15 b12 b11 b8 b7 b0


Station type Occupied stations Station number

0: Remote I/O station Set the number of the station


in the range from 1 to 64.
1: Remote device station
b0 to b7:
2: Intelligent device station 1 – 64
(including local stations and (01H – 40H)
Settings for 1 standby master station) b8 to b11:
to 64 modules 1–4
Number of stations occupied by the slave station: b12 to b15:
0–2
1: 1 station are occupied
2: 2 stations are occupied
3: 3 stations are occupied
4: 4 stations are occupied

The default parameter settings for (s2)+0 to (s2)+63 are „0101H“ to „0140H“. (Station number
1 to 64, one station occupied, remote I/O station)

Designation of the station number in s3 and s4


Each bit of the four word devices used for s3 and s4 represents one station:
Bit
Set Data
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
(s3)+0
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
(s4)+0
(s3)+1
32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
(s4)+1
(s3)+2
48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
(s4)+2
(s3)+3
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
(s4)+3

The numbers 1 to 64 in the table indicate a station number. When a bit is set the corresponding
station is selected.

Programming MELSEC System Q and L series 12 – 87


RLPASET Instructions for CC-Link

Functions Parameter setting for a CC-Link Network and start of the data link
RLPASET Parameter setting instruction

PLC CPU Master module

RLPASET Network
parameter

1.

Device 2.
memory
4. Execution result

3. Start of the data link

1. The network parameters stored in (s1) to (s5) are send to master module of the CC-Link
designated by Un using the RLPASET instruction.
2. The received settings are checked by the master module.
3. If the settings are correct, the data link is started.
4. The device specified by (d) is set.
It is only possible to execute one RLPASET instruction at a time.

Number of required devices


The following numbers of devices are required for the RLPASET instruction:
● s1: 8 word devices
● s2: 64 word devices
● s3: 4 word devices
● s4: 4 word devices
● s5: 78 word devices
Please note the required areas for (s1) to (s5) during programming.
An example:
Four slave stations are connected to a master module. In the Q02CPU mounted in the PLC of
the master station the data link registers D0 to D12287 are available. If D12284 is designated
as head device for (s2) because there are only four slave stations, the execution of the RLPA-
SET instruction will result in an error with the code 4101. This is because the PLC CPU always
checks the range for 64 stations (D12284 to D12347 in this example) and in this case the avail-
able range is exceeded.

12 – 88
Instructions for CC-Link RLPASET

Whether the execution of the RLPASET instruction has been finished can be checked with the
devices (d1)+0 and (d1)+1:
● The bit device (d1)+0 turns ON at the END processing of the scan in which the RLPASET
instruction has been completed and turns OFF at the next END processing.
● The bit device (d1)+1 indicates an error during execution of the RLPASET instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the UINI instruction, (d1)+1 turns ON at the END processing of the scan
in which the RLPASET instruction has been completed and turns OFF at the next END
processing.
The following figure shows the timing when the RLPASET instruction is executed and all sta-
tions are normal:

END END END END END END END


processing processing processing processing processing processing processing
Sequence program

Refresh stop Refresh start


Data link stop Data link start

Completion of the RLPASET instruction


Host data link status
(X01)

Refresh instruction
(SB03)

Data link stop


(SB02)

Data link is stopped


(SB45)

Start signal for the


RLPASET
instruction
Instruction completed
[(d)+0]

Instruction completed
with error [(d)+1]
One scan

The timing for the RLPASET instruction in the case of a faulty station is shown below:

END END END END END END END


processing processing processing processing processing processing processing
Sequence program

Refresh stop Refresh start


Data link stop System processing Data link start

Completion of the
Host data link status RLPASET instruction
(X01)

Refresh instruction
(SB03)

Data link stop


(SB02)

Data link is stopped


(SB45)

Start signal for the


RLPASET
instruction
Instruction completed
[(d)+0]

Instruction completed
with error [(d)+1]
One scan
Return to system

Programming MELSEC System Q and L series 12 – 89


RLPASET Instructions for CC-Link

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module designated by (Un) is not a special function module. (error code: 2112)
● When an attempt was made to execute an unsupported instruction. (error code: 4002)
● When the number of devices in the instruction is incorrect. (error code: 4003)
● When the instruction specifies a device that cannot be used. (error code: 4004)
● When the instruction contains data that cannot be used. (error code: 4100)
● When the number of points for data used in the instruction exceeds the available range, or
storage data and constants of a device specified by the instruction exceeds the available
range (including dummy devices). (error code: 4101)

12 – 90
Instructions for CC-Link RLPASET

Program RLPASET
Example
This program transfers the network parameter to the master station occupying the head I/O
number X/Y000. The CC-Link network consists of three slave stations:

Station No. 1

Master station Local station


(X/Y00 to 1F) (occupies Station No. 2 Station No. 3
1 station)
Remote I/O station Remote I/O station
(occupies 1 station) (occupies 1 station)
Set as error Set as reserved station
invalid station.

The devices designated by (s1) to (s5) are holding the following values:
Allocated
Parameter Setting Set value
device
(s1)+1 Validation of the settings All settings are valid. 15 D1
(s1)+2 Number of connected modules 3 slave modules 3 D2
(s1)+3 Number of retries 3 times 3 D3
Control data
for the (s1)+4 Number of automatic return modules 1 module 1 D4
execution of
the instruction (s1)+5 Operation specification when the Stop 0 D5
PLC CPU has stopped
(s1)+6 Scan mode specification Asynchonous 0 D6
(s1)+7 Delay time setting 0 µs 0 D7
Local station,
(s2)+0 Settings for the first station occupies 1 station, 2101H D10
Station No. 1
Remote I/O station,
Settings for
(s2)+1 Settings for the second station occupies 1 station, 102H D11
slave stations
Station No. 2
Remote I/O station,
(s2)+2 Settings for the third station occupies 1 station, 103H D12
Station No. 3
(s3)+0 4 D80

Reserved (s3)+1 Station No. 3 is 0 D81


Selection of reserved stations
stations (s3)+2 reserved (bit 2 is set) 0 D82
(s3)+3 0 D83
(s4)+0 2 D90

Error invalid (s4)+1 Station No. 2 0 D91


Specification of error invalid stations
stations (s4)+2 (bit 1 is set) 0 D92
(s4)+3 0 D93
Send buffer of the first local station
(s5)+0 100 words 64H D100
(Station No. 1)
Receive buffer of the first local station
Buffer sizes (s5)+1 100 words 64H D101
(Station No. 1)
Automatic refresh buffer of the first
(s5)+2 Not used 0H D102
local station (Station No. 1)

The contents of the data registers D1 to D102 must be set according to the above table before
the RLPA instruction is called.

Programming MELSEC System Q and L series 12 – 91


RLPASET Instructions for CC-Link

● IEC editors (On the next page this program example is shown for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Reading of SB0040 to SB01FF

Reading of SW0040 to SW01FF

M300 starts the setting of the parameters.


(SM402 is on for one scan after the CPU has been
switched to RUN.
SB6E = 1: Data link is stopped)

The required settings are moved to the devices used for (s1) to (s5).

Parameter setting

The start signal for the parameter setting is reset.

Refresh of data after the parameter setting.

At this position, write the instructions that should be executed when the RLPASET instruction
has been completed normally.

At this position, write the instructions that should be executed when the RLPASET instruction
has been completed with an error.

12 – 92
Instructions for CC-Link RLPASET

IEC Instruction List

For an explanation of the devices and instructions used


please see the program example on the previous page.

The required settings are written to the devices designated by (s1)


to (s5) using MOV instructions.

An instruction at this position will be executed when the RLPASET instruction has been completed normally.

An instruction at this position will be executed when the processing of the RLPASET instruction has been completed
with an error.

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

Programming MELSEC System Q and L series 12 – 93


RLPASET Instructions for CC-Link

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer.

Ladder Diagram (GX Works2)

The required settings are written to the devices designated by (s1) to (s5)
using MOV instructions.

At this position, write the instructions that should be executed when the RLPASET
instruction has been completed normally.

At this position, write the instructions that should be executed when the RLPASET
instruction has been completed with an error.

MELSEC Instruction List

The required settings are written to the devices designated by


(s1) to (s5) using MOV instructions.

An instruction at this position will be executed when the RLPASET instruction has been completed normally.

An instruction at this position will be executed when the processing of the RLPASET instruction has been
completed with an error.

12 – 94
Instructions for CC-Link RIRD

12.5.2 RIRD

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d1 —   — — — — — —
d2    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 95


RIRD Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the CC-Link master/local module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as 10H)
Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result
(s)+0 Any value other than 0000H: An — System
of the instruction
error has occured. The stored
value is an error code which is
explained in the user’s manual of
the CC-Link module.
Staton number of the remote
(s)+1 Station number 0 to 64
station, where data is read from
 For a A/Q series master module
with software version A to H
Set „0004H“ to access the buffer 0004H
Acces code memory of an intelligent device or
station. 2004H
Set „2004H“ to access the buffer
memory of a local station.
 For a A/Q series master module Higher byte:
(s)+2 with software version J or see the table
higher or a module of System Q below
s BIN 16-bit
A device code is stored in the
Device code and upper 8 bits of this device.
access code The access code which, specifies Lower byte:
whether to access the buffer 04H
memory of a CC-Link module or
05H
(04H) or a CPU device (05H), is
entered in the lower 8 bits. User
 For a A/Q series master module
with software version A to H
Head address of the buffer
memory Depends on
(s)+3 Head address the
 For a A/Q series master module accessed
with software version J or station
higher or a module of System Q
Head address of the buffer
memory or first device number
Specify the number of data
(unit:words) to read-out.
This number depends on the type
of CPU module mounted in the 1 to 480
Number of points
(s)+4 station where the data is read
to read 1 to 32
from:
AnU, QnA series, System Q:
max. 480 words
All other CPUs: max. 32 words
d1 Head address of the area where the read data is stored User BIN 16-bit

12 – 96
Instructions for CC-Link RIRD

Variables Contents is Data


Set Data Meaning Range stored by Type
Bit device which is set for one scan after completion of the RIRD instruction. (d2)+1 indicates
that an error has occured during execution of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction RIRD instruction
d2 (d2)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the RIRD
(d2)+1 completed with instruction —
error ON: Abnormal completion
OFF: Normal completion

From software version J of the master module two codes (both stored in s+2) are used to spec-
ify the data to read: The access code selects whether access is made to the buffer memory
of a CC-Link module or the device memory in the CPU module. With the device code the area
of the buffer memory or the device is designated:
● Access to the buffer memory of a CC-Link module (Access code: 04H)
Access to Device code
Buffer memory in an intelligent device station 00H
Random access buffer 20H
Remote inputs 21H
Remote outputs 22H
Buffer memory in a master or local station
Remote register 24H
Link special relays 63H
Link special register 64H

Programming MELSEC System Q and L series 12 – 97


RIRD Instructions for CC-Link

● Access to the device memory of a CPU module (Access code: 05H)


Devices not indicated in the following table are not accessible. To access a bit device, specify
„0“ or a multiple of „16“ as head device. Otherwise an error will occur.
Device Device type
Unit Device code
Name Symbol Bit Word
Inputs X  00H
Hexadeci-
Outputs Y  mal 02H
Internal relays M  03H
Decimal
Latch relays L  83H
Link relays B  Hex. 23H
Timer (contact)  09H
Timer (coil) T  0AH
Timer (present value)  0CH
Decimal
Retentive Timer (contact)  89H
Retentive Timer (coil) ST  8AH
Retentive Timer (present value)  8CH
Counter (contact)  11H
Counter (coil) C  12H
Decimal
Counter (present value)  14H
Data register D  04H
Link register W  Hex. 24H
File register R  Decimal 84H
Special link relay SB  63H
Hexadeci-
Special link register SW  mal 64H
Special relay SM  43H
Decimal
Special register SD  44H

12 – 98
Instructions for CC-Link RIRD

Functions Read from buffer memory of intelligent device station or from device memory of PLC CPU
RIRD Data read
The RIRD instruction reads data from the buffer memory of an intelligent device connected to
the CC-Link. When a master module with a software version from J onward or a CC-Link mod-
ule of the MELSEC System Q is used, it is also possible to access the PLC CPU device mem-
ory of another station connected to the CC-Link network.
The head address of the buffer memory or the head device is designated by (s)+3. The station
number of the other station is designated by (s)+1. This station is connected to the master/local
station specified at Un. The read data is stored in the CPU which executes the RIRD instruction
to the devices starting from d1. The number of data to read is designated by (s)+4.
● Accessing the buffer memory of an CC-Link module

PLC CPU Master/local station (Un) Station designated by (s)+1

RIRD
instruction Request
(s)+3
CC-Link Buffer
memory
d1 Data from
Read buffer memory
data

● Accessing the device memory in the PLC CPU of another station on CC-Link

Master/local
SPS-CPU Station (Un) Station (s)+1 PLC CPU

Request
RIRD

CC-Link
(s)+3
Device
Data from the memory
d1 device memory
Read
Data

Whether the execution of the RIRD instruction has been finished can be checked with the
devices (d2)+0 and (d2)+1:
● The bit device (d2)+0 turns ON at the END processing of the scan in which the RIRD
instruction has been completed and turns OFF at the next END processing.
● The bit device (d2)+1 indicates an error during execution of the RIRD instruction. When the
instruction has been completed normal, this device stays OFF. When an error occurs during
execution of the RIRD instruction, (d2)+1 turns ON at the END processing of the scan in
which the RIRD instruction has been completed and turns OFF at the next END processing.

Programming MELSEC System Q and L series 12 – 99


RIRD Instructions for CC-Link

The following figure shows the timing when the RIRD instruction is being executed:

END processing END processing END processing END processing


Sequence
program flow
Start Completion of the RIRD instruction

RIRD instruction

Instruction
Bit device (d2)+0 completed

Error
Bit device (d2)+1

One scan

It is possible to execute RIRD instructions for multiple stations at the same time, but it is not
possible to access the same intelligent device station or local station simultaneously from more
than one station.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the area designated by s contains data that cannot be used. (Error code: 4100)
● When the number of data set to be used exceeds the allowable range. (Error code: 4101)
● When the storage data or constants of the device specified with the instruction exceeds the
allowable range. (Error code: 4101)

12 – 100
Instructions for CC-Link RIRD

Program RIRD
Example
The following program is executed in the PLC CPU of the master station. When the input X0 is
set the contents of 10 buffer memory addresses is read from the intelligent device station with
the station number, starting with the buffer memory address 100H. The read data is stored in
the PLC CPU from data register D0 onward. The head I/O number of the master module of CC-
Link is X/Y40.
● IEC editors (On the next page this program example is shown for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

The station number is written to (s)+1

To access the buffer memory of an intelligent


device station the code 4H is written to (s)+2.

The head address of the buffer memory is stored


in (s)+3.

Number of words to read

Read instruction

M100 is set to indicate that data is being read.

At this position, write the instructions that should be executed when the RIRD instruction
has been completed normally.

At this position, write the instructions that should be executed when the RIRD instruction
has been completed with an error.

When the reading of data has been completed M100


is reset.

IEC Instruction List

For an explanation of the devices and instructions used


please see the above program example.

An instruction at this position will be executed when the RIRD instruction has been completed normally.

An instruction at this position will be executed when the RIRD instruction has been completed annormally.

Programming MELSEC System Q and L series 12 – 101


RIRD Instructions for CC-Link

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the
RIRD instruction has been completed normally.

At this position, write the instructions that should be executed when the
RIRD instruction has been completed with an error.

MELSEC Instruction List

An instruction at this position will be executed when the RIRD instruction has been completed normally.

An instruction at this position will be executed when the RIRD instruction has been completed annormally.

12 – 102
Instructions for CC-Link RIWT

12.5.3 RIWT

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s —   — — — — — —
d1 —   — — — — — —
d2    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 103


RIWT Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the CC-Link master/local module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as 10H)
Head number of the devices where control data for the execution of this instruction is stored

Set Data Meaning Description Range Contents is


stored by
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result
(s)+0 Any value other than 0000H: An — System
of the instruction
error has occured. The stored
value is an error code which is
explained in the user’s manual of
the CC-Link module.
Station number of the remote
(s)+1 Station number 0 to 64
station, where data is written to.
 For a A/Q series master module
with software version A to H
Set „0004H“ to write to the buffer 0004H
Access code memory of an intelligent device or
station. 2004H
Set „2004H“ to write to the buffer
memory of a local station.
 For a A/Q series master module Higher byte:
(s)+2 with software version J or see the table
s higher or a module of System Q below BIN 16-bit
A device code is stored in the
Device code and upper 8 bits of this device.
access code The access code, which specifies
whether to access the buffer Lower byte:
memory of a CC-Link module 04H or 05H
(04H) or a CPU device (05H), is
entered in the lower 8 bits. User

 For a A/Q series master module


with software version A to H
Head address of the buffer
memory Depends
(s)+3 Head address on the
 For a A/Q series master module accessed
with software version J or station
higher or a module of System Q
Head address of the buffer
memory or head device
Specify the number of data
(unit:words) to write.
This number depends on the type
of CPU module mounted in the 1 to 480
(s)+4 Datenlänge
station where the data is written to: 1 to 10
AnU, QnA series, System Q:
max. 480 words
All other CPUs: max. 32 words
d1 Head address of the area where the write data is stored User BIN 16-bit

12 – 104
Instructions for CC-Link RIWT

Variables Contents is Data


Set Data Meaning Range stored by Type
Bit device which is set for one scan after completion of the RIWT instruction. (d2)+1 indicates
that an error has occured during execution of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction RIWT instruction
d2 (d2)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the RIWT
(d2)+1 completed with instruction —
error ON: Abnormal completion
OFF: Normal completion

From software version J of the master module two codes (both stored in (d1)+2) are used to
specify the target for the data: The access code selects whether data is written to the buffer
memory of a CC-Link module or the device memory in the CPU module. With the device code
the area of the buffer memory or the devices, which will be overwritten, is designated:
● Access to the buffer memory of a CC-Link module (Access code: 04H)
Access to Device code
Buffer memory in an intelligent device station 00H
Random access buffer 20H
Remote inputs 21H
Remote outputs 22H
Buffer memory in a master or local station
Remote register 24H
Link special relays 63H
Link special register 64H

Programming MELSEC System Q and L series 12 – 105


RIWT Instructions for CC-Link

● Access to the device memory of a CPU module (Access code: 05H)


Devices not indicated in the following table are not accessible. To access a bit device, specify
„0“ or a multiple of „16“ as head device. Otherwise an error will occur.
Device Device type
Unit Device code
Name Symbol Bit Word
Inputs X  00H
Hexadeci-
Outputs Y  mal 02H
Internal relays M  03H
Decimal
Latch relays L  83H
Link relays B  Hex. 23H
Timer (contact)  09H
Timer (coil) T  0AH
Timer (present value)  0CH
Decimal
Retentive Timer (contact)  89H
Retentive Timer (coil) ST  8AH
Retentive Timer (present value)  8CH
Counter (contact)  11H
Counter (coil) C  12H
Decimal
Counter (present value)  14H
Data register D  04H
Link register W  Hex. 24H
File register R  Decimal 84H
Special link relay SB  63H
Hexadeci-
Special link register SW  mal 64H
Special relay SM  43H
Decimal
Special register SD  44H

12 – 106
Instructions for CC-Link RIWT

Functions Write to buffer memory of intelligent device station or to device memory of PLC CPU
RIWT Data write
The RIWT instruction writes data to the buffer memory of an intelligent device connected to the
CC-Link. When a master module with a software version from J onward or a CC-Link module
of the MELSEC System Q is used, it is also possible to write to the PLC CPU device memory
of another station connected to the CC-Link network.
The station number of the other station is designated by (s)+1. This station is connected to the
master/local station specified at Un. Where the write data are is stored is designated by d1. At
(s)+2 a code is stored which specifies whether to write to a buffer memory or to the device
memory of a CPU module. The head address of the buffer memory or the head device is des-
ignated by (s)+3. The number of data to write is designated by (s)+4.
● Accessing the buffer memory of an CC-Link module

PLC CPU Master station (Un) Station specified in (s)+1

RIWT
instruction
Writing of data
(s)+3
CC-Link Buffer
memory
d1
Stored
data

● Accessing the device memory in the PLC CPU of another station on CC-Link

Master/local
PLC CPU Station (Un) Station (s)+1 PLC CPU

RIWT

Writing of data (s)+3


Devices
d1 CC-Link
Stored
data (s)+4

Whether the execution of the RIWT instruction has been finished can be checked with the
devices (d2)+0 and (d2)+1:
● The bit device (d2)+0 turns ON at the END processing of the scan in which the RIWT
instruction has been completed and turns OFF at the next END processing.
● The bit device (d2)+1 indicates an error during execution of the RIWT instruction. When the
instruction has been completed normal, this device stays OFF, but when an error occurs
during execution of the RIWT instruction, (d2)+1 turns ON at the END processing of the
scan in which the RIWT instruction has been completed and turns OFF at the next END
processing.

Programming MELSEC System Q and L series 12 – 107


RIWT Instructions for CC-Link

The following figure shows the timing when the RIWT instruction is being executed:

END processing END processing END processing END processing


Sequence
program flow
Start Completion of the RIWT instruction

RIWT instruction

Instruction
Bit device (d2)+0 completed

Error
Bit device (d2)+1

One scan

Please note, that it’s possible to execute RIWT instructions for multiple stations at the same
time, but the same intelligent device station or local station cannot be accessed simultaneously
from more than one station.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the area designated by s contains data that cannot be used. (Error code: 4100)
● When the number of data set to be used exceeds the allowable range. (Error code: 4101)
● When the storage data or constants of the device specified with the instruction exceeds the
allowable range. (Error code: 4101)

12 – 108
Instructions for CC-Link RIWT

Program RIWT
Example
The following program is processed in the PLC CPU of the master station. When the input X0
is set, the contents of the data registers D0 to D9 is moved to the intelligent device station
number 1 and stored to the buffer memory addresses 100H to 109H. The head I/O number of
the master module of CC-Link is X/Y40.
● IEC editors
(On the next page this program example is shown for the MELSEC instruction list and the
ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

The station number is written to (s)+1

To access the buffer memory of an intelligent


device station the code 4H is written to (s)+2.

The head address of the buffer memory is


stored in (s)+3.

Number of points to write

Writing to the buffer memory

M100 is set to indicate that data is being written.

At this position, write the instructions that should be executed when the RIWT instruction
has been completed normally.

At this position, write the instructions that should be executed when the RIWT instruction
has been completed with an error.

When the writing has been completed M100 is reset.

IEC Instruction List

For an explanation of the devices and instructions used


please see the above program example.

An instruction at this position will be executed when the RIWT instruction has been completed normally.

An instruction at this position will be executed when the RIWT instruction has been completed annormally.

Programming MELSEC System Q and L series 12 – 109


RIWT Instructions for CC-Link

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the
RIWT instruction has been completed normally.

At this position, write the instructions that should be executed when the
RIWT instruction has been completed with an error.

MELSEC Instruction List

An instruction at this position will be executed when the RIWT instruction has been completed normally.

An instruction at this position will be executed when the RIWT instruction has been completed annormally.

12 – 110
Instructions for CC-Link RIRCV

12.5.4 RIRCV

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s1 —   — — — — — —
d1 —   — — — — — —
d2    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 111


RIRCV Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the CC-Link master module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as 10H)
Head number of the devices where control data for the execution of this instruction is stored.

Set Data Meaning Description Range Contents is


stored by
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result
(s1)+0 Any value other than 0000H: An — System
of the instruction
error has occured. The stored
value is an error code which is
explained in the user’s manual of
the CC-Link module.
Station number of the intelligent
(s1)+1 Station number device station where data is read 0 to 64
s1 from BIN 16-bit

Enter the value „0004H“ (Read


(s1)+2 Access code from the buffer memory of an 0004H
intelligent device station.)

Head address in the buffer Depends on


the
(s1)+3 Head address memory (Address of the first data User
accessed
to read) station
Specify how much data (in the unit
„words“) should be read from the
intelligent device station. Set a
Number of points
(s1)+4 value within the intelligent device 1 to 480
to read
station buffer memory capacity and
the parameter-set receiving buffer
area of the master station.
Link devices used for handshaking
Contents is
Set Data Meaning Description Range stored by
 Higher byte
0
Remote output Set the upper 8 bits to „0“.
(s2)+0 (RY) for data  Lower byte
request Specify a remote output (RY) of 0 to 127
the intelligent device station

Remote register  Higher byte 0 to 15


Specify a remote register (RWr) or FF
(RWr) used as (When FF is
s2 error code of the intelligent device station, in set, no BIN 16-bit
storage device which the same error code as in number is
(s2)+1 (s1)+0 will be stored.
Remote input specified.) User
(RX) used as
completion  Lower byte
Specify a remote input (RX) of 0 to 127
device. the intelligent device station
Specify, how the completion of the
reading process should be
indicated:
(s2)+2 Completion mode 0: Using 1 device (RXn) 0 or 1
1: Using 2 devices (RXn, RXn+1)
(RXn+1 will be set at abnormal
completion.)
d1 Head address of the devices where the read data is to be stored. User BIN 16-bit

12 – 112
Instructions for CC-Link RIRCV

Variables Contents is Data


Set Data Meaning Range stored by Type
Bit device which is set for one scan after completion of the RIRCV instruction.
(d2)+1 indicates that an error has occured during execution of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction RIRCV instruction
d2 (d2)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d2)+1 completed with RIRCV instruction —
error ON: Abnormal completion
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 113


RIRCV Instructions for CC-Link

Functions Reading of data from the buffer memory of an intelligent device station (with handshake)
RIRCV Data read (with handshake)
The execution of a RIRCV instruction is only possible in the PLC CPU of the master station.
This instruction is used to read data from the buffer memory on an intelligent device station.
The data exchange is controlled by handshaking devices:

Master Station
station (s1)+1

PLC CPU Master module


Intelligent device station
1.

RIRCV RX Buffer memory


RY 1.

RX
Receive 2. RY
Device buffer
memory
3.

1. The buffer memory address specified by (s1)+3 of the station specified by (s1)+1 is
accessed. The devices specified in s2 are used for the handshake.
2. The contents of the number of buffer memory addresses specified in (s1)+4 is read to the
receive buffer of the master module.
3. The read data is stored in the PLC CPU to the devices starting with the one specified in d1.
After that, the bit device specified in (d2)+0 is set for one scan.
Whether the execution of the RIRCV instruction has been finished can be checked with the
devices (d2)+0 and (d2)+1:
● The bit device (d2)+0 turns ON at the END processing of the scan in which the RIRCV
instruction has been completed and turns OFF at the next END processing.
● The bit device (d2)+1 indicates an error during execution of the RIRCV instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the RIRCV instruction, (d2)+1 turns ON at the END processing of the
scan in which the RIRCV instruction has been completed and turns OFF at the next END
processing.

12 – 114
Instructions for CC-Link RIRCV

The following figure shows the timing when the RIRCV instruction is being executed:

END processing END processing


Sequence END processing END processing
program flow
Completion of the RIRCV instruction
Start

RIRCV instruction

Bit device (d2)+0 Instruction


completed

Bit device (d2)+1 Error


One scan

RYn

RXn

Although it’s possible to execute RIRCV instructions for multiple intelligent device stations at
the same time, it’s not possible to access the same intelligent device station simultaneously
from more than one station.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the area designated by s contains data that cannot be used. (Error code: 4100)
● When the number of data set to be used exceeds the allowable range. (Error code: 4101)
● When the storage data or constants of the device specified with the instruction exceeds the
allowable range. (Error code: 4101)

Programming MELSEC System Q and L series 12 – 115


RIRCV Instructions for CC-Link

Program RIRCV
Example
The following program is executed in the PLC CPU of the master station. When M1 is set, the
contents of 11 buffer memory addresses is read from the intelligent device station with the sta-
tion number 63. Reading starts at the buffer memory address 400H. The data will be stored in
the CPU module from data register D40 onward. To the master module of CC-Link the head
I/O number X/Y00 is assigned. The remote devices RX2, RY2 and RWr2 are used for hand-
shake. The completion of the reading is indicated by two devices. ((s2)+2 is set to „1“.)
● IEC editors
(On the next page this program example is shown for the MELSEC instruction list and the
ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Read from station number 63 (63 -> (s1)+1)

The access code 4H for access to the buffer memory


of an intelligent device station is stored in (s1)+2.

In (s)+3 the head address in the buffer memory (400H)


is stored.

Read 11 buffer memory addresses

RY2 is entered as handshake device in (s2)+1

RWr2 and RX2 are set as handshake devices


in (s2)+2

Two devices are used to indicate the completion of the


reading.

Reading of the buffer memory

At this position, write the instructions that should be executed when the RIRCV instruction
has been completed normally.

At this position, write the instructions that should be executed when the RIRCV instruction
has been completed with an error.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above program example.

An instruction at this position will be executed when the RIRCV instruction has been completed normally.

An instruction at this position will be executed when the RIRCV instruction has been completed annormally

12 – 116
Instructions for CC-Link RIRCV

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the RIRCV instruction
has been completed normally.

At this position, write the instructions that should be executed when the RIRCV instruction
has been completed with an error.

MELSEC Instruction List

An instruction at this position will be executed when the RIRCV instruction has been completed normally.

An instruction at this position will be executed when the RIRCV instruction has been completed annormally.

Programming MELSEC System Q and L series 12 – 117


RIRCV Instructions for CC-Link

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

MELSEC Instruction List

For further information about the programming of


dedicated instructions using the MELSEC editors
please refer to chapter 3.3 of this manual.

12 – 118
Instructions for CC-Link RISEND

12.5.5 RISEND

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
s1 —   — — — — — —
s2 —   — — — — — —
d1 —   — — — — — —
d2    — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

Programming MELSEC System Q and L series 12 – 119


RISEND Instructions for CC-Link

Variables Contents is Data


Set Data Meaning Range stored by Type
Head I/O address of the CC-Link master module
Un (The upper two digits of an address expressed as a 3-digit 0 to FEH User BIN 16-bit
number, e. g. the head address X/Y100 is set as 10H)
Head number of the devices where control data for the execution of this instruction is stored.

Set Data Meaning Description Range Contents is


stored by
Indicates whether an error has
occured during execution of the
instruction:
0000H: No error
Execution result
(s1)+0 Any value other than 0000H: An — System
of the instruction
error has occured. The stored
value is an error code which is
explained in the user’s manual of
the CC-Link module.
s1 Station number of the intelligent BIN 16-bit
(s1)+1 Station number device station where the data is 0 to 64
send to
Enter the value „0004H“ (Write to
(s1)+2 Access code the buffer memory of an intelligent 0004H
device station.)
User
Head address in the buffer Depends on
the
(s1)+3 Head address memory (First address where data
accessed
is written to) station
Specify how much data (in the unit
Number of points
(s1)+4 „words“) should be written to the 1 to 480
to write
intelligent device station.
Link devices used for handshaking
Contents is
Set Data Meaning Description Range
stored by
 Higher byte 0
Remote output Set the upper 8 bits to „0“.
(RY) to request
(s2)+0  Lower byte
the sending of
data Specify a remote output (RY) of 0 to 127
the intelligent device station

Remote register  Higher byte 0 to 15


Specify a remote register (RWr) or FF
(RWr) used as (When FF is
s2 error code of the intelligent device station, in set, no BIN 16-bit
storage device which the same error code as in number is
(s2)+1 (s1)+0 will be stored.
Remote input specified.) User
(RX) used as
completion  Lower byte
Specify a remote input (RX) of 0 to 127
device. the intelligent device station
Specify, how the completion of the
reading process should be
indicated:
(s2)+2 Completion mode 0: Using 1 device (RXn) 0 or 1
1: Using 2 devices (RXn, RXn+1)
(RXn+1 will be set at abnormal
completion.)
First address of the area where the data for the intelligent device station is
d1 User BIN 16-bit
stored

12 – 120
Instructions for CC-Link RISEND

Variables Contents is Data


Set Data Meaning Range stored by Type
Bit device which is set for one scan after completion of the RIRCV instruction.
(d2)+1 indicates that an error has occured during execution of the instruction.
Contents is
Set Data Meaning Description Range stored by
Indicates the completion of the
Instruction RISEND instruction
d2 (d2)+0 — Bit
completed ON: Instruction completed
OFF: Instruction not completed
Indicates that an error has occured System
Instruction during the processing of the
(d2)+1 completed with RIRCV instruction —
error ON: Abnormal completion
OFF: Normal completion

Programming MELSEC System Q and L series 12 – 121


RISEND Instructions for CC-Link

Functions Write (with handshake) to the buffer memory of an intelligent decive station
RISEND Sending of data (with handshake)
The RIRCV instruction can only be performed in the PLC CPU of the master station and is used
to write data to the buffer memory on an intelligent device station. The data exchange is con-
trolled by handshaking devices:

Master Station
station (s1)+1

PLC CPU Master module


Intelligent device station

RISEND RX Buffer memory


RY 2.

1. 2. RX
Send 3. RY
Device buffer
memory
4.

1. The data for the intelligent device station is moved to the send buffer of the master station.
2. The data is written to the buffer memory address specified by (s1)+3 of the station specified
by (s1)+1. The devices specified in s2 are used for the handshake.
3. A write complete response is send to the master station.
4. The device specified in (d2)+0 is set.
Whether the execution of the RISEND instruction has been finished can be checked with the
devices (d2)+0 and (d2)+1:
● The bit device (d2)+0 turns ON at the END processing of the scan in which the RISEND
instruction has been completed and turns OFF at the next END processing.
● The bit device (d2)+1 indicates an error during execution of the RISEND instruction. When
the instruction has been completed normal, this device stays OFF. When an error occurs
during execution of the RISEND instruction, (d2)+1 turns ON at the END processing of the
scan in which the RISEND instruction has been completed and turns OFF at the next END
processing.

12 – 122
Instructions for CC-Link RISEND

The following figure shows the timing when the RIRCV instruction is being executed:

END processing END processing


Sequence END processing END processing
program flow
Completion of the RISEND instruction
Start

RIRCV instruction

Bit device (d2)+0 Instruction


completed

Bit device (d2)+1 Error


One scan

RYn

RXn

Although it’s possible to execute RISEND instructions for multiple intelligent device stations at
the same time, it’s not possible to access the same intelligent device station simultaneously
from more than one station.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the area designated by s contains data that cannot be used. (Error code: 4100)
● When the number of data set to be used exceeds the allowable range. (Error code: 4101)
● When the storage data or constants of the device specified with the instruction exceeds the
allowable range. (Error code: 4101)

Programming MELSEC System Q and L series 12 – 123


RISEND Instructions for CC-Link

Program RISEND
Example
The following program, which is executed in the PLC CPU of the master station, writes 1 word
of data to the buffer memory address 111H of the intelligent device station with the station
number 63. To the master module of CC-Link, the head I/O number X/Y000 is assigned. The
devices RX4, RY4 and RWr4 are used for handshaking. The completion of the reading is indi-
cated by two devices. ((s2)+2 is set to „1“.)
● IEC editors (On the next page this program example is shown for the MELSEC instruction
list and the ladder diagram of the GX Works2.)

Ladder Diagram (GX IEC Developer)

Write to station number 63 (63 -> (s1)+1)

The access code 4H for access to the buffer memory


of an intelligent device station is stored in (s1)+2

The head address in the buffer memory (111H) is


stored to (s)+3.

Write to only buffer memory address

RY4 is entered as handshake device in (s2)+1

RWr1 and RX4 are set as handshake devices


in (s2)+2

Two devices are used to indicate the completion of the


reading.

The value „11“ is stored in D10. The contents of D10


is moved to the buffer memory address 111H.

Write to buffer memory

At this position, write the instructions that should be executed when the RISEND instruction
has been completed normally.

At this position, write the instructions that should be executed when the RISEND instruction
has been completed with an error.

IEC Instruction List

For an explanation of the devices and instructions


used please see the above program example.

An instruction at this position will be executed when the RISEND instruction has been completed normally.

An instruction at this position will be executed when the RISEND instruction has been completed annormally

12 – 124
Instructions for CC-Link RISEND

NOTE For the IEC editors it is neccessary to define the variables in the header of the program organ-
ization unit (POU). Without variable definition it would cause compiler or checker error mes-
sages. For details see section 3.5.2 "Addressing of arrays and registers in the GX IEC Devel-
oper" of this manual.

● MELSEC instruction list and ladder diagram of the GX Works2


For explanation of the devices and instructions used please see the program example for
the ladder diagram of the GX IEC Developer on the previous page.

Ladder Diagram (GX Works2)

At this position, write the instructions that should be executed when the RISEND instruction
has been completed normally.

At this position, write the instructions that should be executed when the RISEND instruction
has been completed with an error.

MELSEC Instruction List

An instruction at this position will be executed when the RISEND instruction has been completed normally.

An instruction at this position will be executed when the RISEND instruction has been completed annormally.

Programming MELSEC System Q and L series 12 – 125


RITO Instructions for CC-Link

12.5.6 RITO

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants Other
Register Module Zn K, H (16#)
Bit Word Bit Word U\G
n1    — — — —  —
n2    — — — —  —
d —   — — — — — —
n3    — — — —  —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 126
Instructions for CC-Link RITO

Variables Contents is Data


Set Data Meaning Range
stored by Type
Head I/O address of the CC-Link master module
(Only the upper two digits of an address expressed as a 3-digit
Un 0 to FEH
number are specified, e. g. the head address X/Y100 is set
as 10H)
Write destination
 Specify the station number of the intelligent device station 1 to 64
n1 where data is written to. or
 Specify „FFH“ when data is to be moved to the random access FFH
buffer. BIN 16-bit
The offset value of the automatic updated buffer of the intelligent
device station specified by the master station or the random User
access buffer. Between 0
The head address to write to is designated relative to the head and the
n2 max. value
address of the automatic updated buffer. set in the
An example: To write data to the address 356H of the buffer parameters.
memory, which starts at address 350H, the value 6H must be
specified at n2.
Within the
d First address of the area where the write data is stored. range of the Address
specified
device
n3 Number of points to write (unit: words) 1 to 4096 BIN 16-bit

Programming MELSEC System Q and L series 12 – 127


RITO Instructions for CC-Link

Functions Write to automatic updating buffer memory


RITO Data write
The RITO instruction moves data from the device memory of the PLC CPU to the automatic
updating buffer memory in the master station. The data is than transferred to another station
on CC-Link.
The data is specified by the head address (d) and the number of words (n3). The destination
in the master-station is designated by n1 (equals the station number of the station where the
data is finally send to) and n2 (head address of the automatic updating buffer memory in the
master station). The head I/O number of the master station is specified in Un.
The function of the RITO instruction is explained in the following figure:

Master Destination
station station (n1)

PLC CPU Master module


Intelligent device station

RITO Buffer memory

Automatic
Automatic updated
updated
buffer
buffer memory
memory
Devices n2
(d) Transferred when
data is updated

The RITO instruction cannot be executed at more than one station for the same intelligent
device station.
Up to 4096 words may be written by the RITO instruction.
The assignment of the automatic updated buffers is performed using the „station information
settings“ of the network parameters of the GX Works2 or GX IEC Developer.
Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the station number specified at n1 does not exist. (Error code: 4100)
● When the number of words to write specified in n3 is outside of the setting range.
(Error code: 4100)

12 – 128
Instructions for CC-Link RITO

Program RITO
Example
When the input X0 is set, the contents of 10 data registers (D0 to D10) is moved to the auto-
matic updated buffer memory for the station set to station number 1 in the master module. This
buffer begins at the address 300H. The data is stored from address 400H onward (offset = 100).

PLC CPU Master-Modul Intelligent device station


Head I/O number: X/Y040 (Station number 1)

Device memory Automatic updated Buffer memory


buffer

300H
Automatic
updated
buffer memory

5FFH

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

Programming MELSEC System Q and L series 12 – 129


RIFR Instructions for CC-Link

12.5.7 RIFR

CPU High
Basic Process Redundant Universal LCPU
Performance
    

Devices Usable Devices


MELSEC Q
Internal Devices MELSECNET/H Special
(System, User) File- Direct J\ Function Index Register Constants
Register Module Zn K, H (16#) Other
Bit Word Bit Word U\G
n1    — — — —  —
n2    — — — —  —
n3    — — — —  —
d —   — — — — — —

GX IEC MELSEC Instruction List Ladder Diagram IEC Instruction List


Developer

GX Works2

12 – 130
Instructions for CC-Link RIFR

Variables Contents is Data


Set Data Meaning Range
stored by Type
Head I/O address of the CC-Link master module
(Only the upper two digits of an address expressed as a 3-digit
Un 0 to FEH
number are specified, e. g. the head address X/Y100 is set
as 10H)
Source of the data
 Specify the station number of the intelligent device station 1 to 64
n1 where data is read from. or
 Specify „FFH“, when data is to be read from the random access FFH
buffer.
BIN 16-bit
The offset value of the automatic updated buffer of the intelligent
device station specified by the master station or the random User
access buffer. Between 0
The head address for the data to read is designated relative to and the
n2 max. value
the head address of the automatic updated buffer. set in the
An example: When reading should start at the address 356H of parameters
the buffer memory, which starts at address 350H, the value 6H
must be specified at n2.
n3 Number of points to read (unit: words) 1 to 4096
Within the
d First address of the area where the read data will be stored. range of the Address
specified
device

Programming MELSEC System Q and L series 12 – 131


RIFR Instructions for CC-Link

Functions Read from to automatic updating buffer memory


RIFR Data read
The RIFR instruction moves data from the automatic updating buffer memory in the master sta-
tion to the device memory of the PLC CPU. The storage area for this data is specified by the
head address (d) and the number of words (n3). The source of the data is designated by the
station number entered in n1 and the offset for the automatic updating buffer memory of the
master station (n2). The head I/O number of the master station is specified in Un.
The function of the RIFR instruction is explained in the following figure:

Master Station
station (n1)

PLC CPU Master module


Intelligent device station

RIFR Buffer memory

Automatic Automatic
updated
updated buffer memory
buffer

Devices n2
(d) Transferred when
data is updated

The RIFR instruction cannot be executed at more than one station for the same intelligent
device station.
Up to 4096 words may be read by the RIFR instruction.
The assignment of the automatic updated buffers is performed using the „station information
settings“ of the network parameters of the GX Works2 or GX IEC Developer.

Operation In the following cases an operation error occurs, the error flag SM0 is set, and an error code is
Error stored in SD0:
● When the module specified by Un is not an intelligent function module or a special function
module. (Error code: 2112)
● When an attempt was made to execute an unsupported instruction. (Error code: 4002)
● When the number of devices in the instruction is incorrect. (Error code: 4003)
● When the instruction specifies a device that cannot be used. (Error code: 4004)
● When the station number specified at n1 does not exist. (Error code: 4100)
● When the number of words to read specified in n3 is outside of the setting range.
(Error code: 4100)

12 – 132
Instructions for CC-Link RIFR

Program RIFR
Example
When the input X0 is set, the following program reads the contents of 10 points of the automatic
updated buffer set to station number 1 in the master module and stores this data in the PLC
CPU to D0 and the successive registers. The automatic updated buffer begins at the address
300H. Reading starts at the address 400H (offset = 100). The master module of CC-Link is allo-
cated to the I/O numbers X/Y040 to X/Y41F.

PLC CPU Master module Intelligent device station


Head I/O number: X/Y040 (Station number 1)

Device memory Automatic updated buffer Buffer memory

300H
Automatic
updated
buffer memory

5FFH

MELSEC Instruction List Ladder Diagram (GX IEC Developer)

IEC Instruction List

Ladder Diagram (GX Works2)

Programming MELSEC System Q and L series 12 – 133


RIFR Instructions for CC-Link

12 – 134
Error Codes Error code list

13 Error Codes
13.1 Error code list
If an error occurs when the PLC is turned ON, set into RUN mode, or during operation, the self-
diagnostic functions of the CPU returns an error (LED indication or message on LED display)
and store the error information in special relays (SM) and special registers (SD).
When an error occurs at communication request from a programming tool, intelligent function
module, or network system to the CPU module, the CPU module returns the error code (4000H
to 4FFFH) to the request source.
This section describes errors that may occur in the CPU module and corrective actions for the
errors.

13.1.1 How to read the error code list

The following describes how to read section 13.2 "Error code list (1000 to 1999)" to section
13.8 "Error code list (7000 to 10000)". The list contains errors in QCPU and LCPU.
● Error code, common information, and individual information
The error code is stored in SD0. The common information is stored in SD5 to SD15. The
individual information is stored in SD16 to SD26.
● Corresponding CPU
– QCPU: All the System Q series CPU modules
– Q00J/Q00/Q01: Basic model QCPU
– Qn(H): High Performance model QCPU
– QnPH: Process CPU
– QnPRH: Redundant CPU
– QnU: Universal model QCPU
– Q00UJ/Q00U/Q01U: Q00UJCPU, Q00UCPU, and Q01UCPU
– LCPU: All the L series CPU modules
– CPU module model: Only the specified model (Example: Q02UCPU, L26CPU-BT)

Programming MELSEC System Q and L series 13 – 1


Error code list Error Codes

13.1.2 Types of error codes

There are two types of errors: errors detected by the self-diagnostic function of the CPU mod-
ule and errors detected during communication with the CPU module.
The relation between the error detection pattern, error detection location and error code is
shown in the following table.

Error detection pattern Error detection location Error code Reference


Detection by the self 1000 to 1299 1)
diagnostics function of CPU module Sections 13.2 to 13.8
CPU module 1300 to 10000 2)
CPU module 4000H to 4FFFH Section 13.9
Serial communication 7000H to 7FFFH
module
CC-Link module B000H to BFFFH
(including built-in CC-Link
function module)
Detection at ETHERNET module C000H to CFFFH
communication with CPU (including built-in Ethernet Manual of corresponding
module function module) module
CC-Link IE field network D000H to DFFFH
module
CC-Link IE controller E000H to EFFFH
network
MELSECNET/H network F000H to FFFFH
module
1 Major error: Errors that may cause the CPU module to stop the operation, e.g. RAM error.
2
Minor or moderate error: Errors that may allow the CPU module to continue the operation,
e.g., battery error
or
Errors that may cause the CPU module to stop the operation, e.g., WDT error.
For determination of the error level (i.e. whether the operation can be continued or stopped) refer to column
"CPU status" in the error code lists of sections 13.2 to 13.8).

13.1.3 Clearing an error

An error can be cleared as far as the CPU module continues its operation regardless of the
error.
1. Remove the error cause.
2. Store the error code to be cleared in SD50.
3. Turn on SM50.
4. The error is cleared.
When the error in the CPU module is cleared, the special relay and special register or LEDs
relating to the error return to the status before the error. If the same error occurs after clearing
the error, the error will be registered to the error history again.
When multiple annunciators are detected, only the first annunciator detected can be cleared.
For details on clearing errors, refer to the following manual:
User's manual (Function Explanation, Program Fundamentals) for the CPU module used

13 – 2
Error Codes Error code list (1000 to 1999)

13.2 Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop QCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
1000
CPU UNIT DOWN LCPU
Runaway or failure of CPU module
– Malfunctioning due to noise or other reason
– Hardware fault
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop QCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
– Universal model QCPU only:
Accessed to outlying devices with the device – Universal model QCPU only:
range checks disabled (SM237 = 1). This Check the devices specified by BMOV, FMOV,
error occurs only when BMOV, FMOV, and and DFMOV instructions and correct the
DFMOV instructions are executed. device settings.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
1001 Always
CPU UNIT DOWN – Take noise reduction measures. LCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
– Accessed to outlying devices with the device
range checks disabled (SM237 = 1). This – Check the devices specified by BMOV, FMOV,
error occurs only when BMOV, FMOV, and and DFMOV instructions and correct the
DFMOV instructions are executed. device settings.
 Collateral information
 Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop QCPU
1002 Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
1003 Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
1004  Diagnostic Timing
Always
CPU UNIT DOWN LCPU
1002 Runaway or failure of CPU module
– Malfunctioning due to noise or other reason
– Hardware fault
1003  Collateral information
 Common Information: —
 Individual Information: Failure information
1004  Diagnostic Timing
Always

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 3


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop QCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
MAIN CPU DOWN – Before performing boot operation by the Qn(H)
Boot operation was performed in the transfer parameter, select "Clear program memory" to QnPH
destination without formatting. clear the program memory.
QnPRH
 Collateral information
1005  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power-on
CPU UNIT DOWN – Take noise reduction measures. LCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
MAIN CPU DOWN OFF Flicker STOP QCPU
Runaway or failure of CPU module
– Malfunctioning due to noise or other reason
– Hardware fault
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
1006
CPU UNIT DOWN LCPU
Runaway or failure of CPU module
– Malfunctioning due to noise or other reason
– Hardware fault
 Collateral information
 Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop Qn(H)
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the QnPH
1007 – Malfunctioning due to noise or other reason same error is displayed again, this suggests a QnPRH
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
1008  Individual Information: —
 Diagnostic Timing
Always

Tab. 13-1: Error code list (1000 to 1999)

13 – 4
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
MAIN CPU DOWN – Correct the voltage waveform applied to the OFF Flicker Stop Q00J/Q00/Q01
– The voltage waveform that is outside the spe- power supply module. (Function
cification is applied to the power supply – Reset the CPU module and RUN it again. If the version is B or
module, and an error is detected. same error is detected again, it is considered later)
– A failure is detected on the power supply that the power supply module, CPU module, Qn(H) (first 5
module, CPU module, main base unit, exten- main base unit, extension base unit or exten- digits of serial
sion base unit or extension cable. sion cable is faulty. Replace the defective No. is 04101 or
– When using the redundant base unit, the component. higher)
redundant power supply module failure in Contact your local Mitsubishi representative.
QnPH
both systems and/or the redundant base unit
failure are detected. QnPRH
 Collateral information QnU
 Common Information: —
 Individual Information: —
1009
 Diagnostic Timing
Always
CPU UNIT DOWN – Correct the voltage waveform applied to the OFF Flicker Stop LCPU
– A failure is detected on the power supply power supply module.
module or CPU module. – Reset the CPU module and run it again. If the
– The voltage waveform that is outside the same error code is displayed again, the cause
specification is applied to the power supply is a hardware failure of the power supply
module, and an error is detected. module or CPU module.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
END NOT EXECUTE – Take noise reduction measures. OFF Flicker Stop QCPU
Entire program was executed without the execu- – Reset the CPU module and RUN it again. If the LCPU
tion of an END instruction. same error is displayed again, this suggests a
– When the END instruction is executed it is CPU module hardware fault.
read as another instruction code, e.g. due to Contact your local Mitsubishi representative.
noise.
1010 – The END instruction has been changed to
another instruction code somehow.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
SFCP. END ERROR – Take noise reduction measures. OFF Flicker Stop Q00J/Q00/Q01
– The SFC program cannot be normally termi- – Reset the CPU module and RUN it again. If the (Function
nated due to noise or any similar cause. same error is displayed again, this suggests a version is B or
– The SFC program cannot be normally termi- CPU module hardware fault. later)
nated for any other reason. Contact your local Mitsubishi representative. QnPH
1020  Collateral information QnU
 Common Information: — LCPU
 Individual Information: —
 Diagnostic Timing
When SFC program is executed
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop QnU
Runaway or failure of CPU module. – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
1035
CPU UNIT DOWN LCPU
Runaway or failure of CPU module
– Malfunctioning due to noise or other reason
– Hardware fault
 Collateral information
 Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 5


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
MAIN CPU DOWN – Take noise reduction measures. OFF Flicker Stop Q50UDEHCPU
Runaway or failure of CPU module – Reset the CPU module and RUN it again. If the Q100UDEHCPU
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
Contact your local Mitsubishi representative.
1036  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
CPU UNIT DOWN – Take noise reduction measures. OFF Flicker Stop LCPU
1040 Runaway or failure of CPU module (built-in I/O) – Reset the CPU module and RUN it again. If the
– Malfunctioning due to noise or other reason same error is displayed again, this suggests a
– Hardware fault CPU module hardware fault.
1041 Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: Failure information
1042  Diagnostic Timing
Always
RAM ERROR – Take noise reduction measures. OFF Flicker Stop QCPU
The sequence program storing program memory – Reset the CPU module and RUN it again. If the LCPU
in the CPU module is faulty. same error is displayed again, this suggests a
 Collateral information CPU module hardware fault.
Contact your local Mitsubishi representative.
1101  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At Reset/ When an END instruction
executed
RAM ERROR OFF Flicker Stop QCPU
– The work area RAM in the CPU module is LCPU
faulty.
– The standard RAM and extended RAM in the
CPU module are faulty.
1102  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At Reset/ When an END instruction
executed
RAM ERROR – Take noise reduction measures. OFF Flicker Stop QCPU
The device memory in the CPU module is faulty. – When indexing is performed, check the value LCPU
 Collateral information of index register to see if it is within the device
 Common Information: — range.
 Individual Information: — – Reset the CPU module and RUN it again. If the
same error is displayed again, this suggests a
 Diagnostic Timing CPU module hardware fault.
At power ON/ At reset Contact your local Mitsubishi representative.
RAM ERROR Qn(H) (first 5
– The device memory in the CPU module is digits of serial
1103 faulty. No. is 08032 or
– The device out of range is accessed due to higher)
indexing, and the device for system is over- QnPH (first 5
written. digits of serial
 Collateral information No. is 08032 or
 Common Information: — higher)
 Individual Information: — QnPRH (first 5
digits of serial
 Diagnostic Timing No. is 09012 or
At power ON/ At reset/When an END instruction higher)
executed
RAM ERROR – Take noise reduction measures. OFF Flicker Stop Q00J/Q00/Q01
The address RAM in the CPU module is faulty. – Reset the CPU module and RUN it again. If the Qn(H)
 Collateral information same error is displayed again, this suggests a QnPH
1104  Common Information: — CPU module hardware fault.
Contact your local Mitsubishi representative. QnPRH
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-1: Error code list (1000 to 1999)

13 – 6
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
RAM ERROR – Take noise reduction measures. OFF Flicker Stop Q00J
The CPU memory in the CPU module is faulty. – Reset the CPU module and RUN it again. If the Q00
 Collateral information same error is displayed again, this suggests a Q01
 Common Information: — CPU module hardware fault. Contact your
local Mitsubishi representative. QnU
 Individual Information: —
 Diagnostic Timing
AT POWER ON/ AT RESET
1105 RAM ERROR Qn(H) (first 5
The CPU shared memory in the CPU module is digits of serial
faulty. No. is 04101 or
 Collateral information higher)
 Common Information: — QnPH
 Individual Information: — QnPRH
 Diagnostic Timing QnU
At power ON/ At reset
RAM ERROR – Check the battery to see if it is dead or not. If OFF Flicker Stop Qn(H)
– The program memory in the CPU module is dead, replace the battery. QnPH (first 5
faulty. – Take noise reduction measures. digits of serial
 Collateral information – Format the program memory, write all files to No. is 07032 or
1106  Common Information: — the PLC, then reset the CPU module and RUN higher)
it again. QnPRH
 Individual Information: — If the same error is displayed again, this sug-
 Diagnostic Timing gests a CPU module hardware fault. Contact
STOP –> RUN/When an END instruction exe- your local Mitsubishi representative.
cuted
RAM ERROR This suggests a CPU module hardware fault. OFF Flicker Stop QnPRH
1107 The work area RAM in the CPU module is faulty. Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: — Qn(H) (first 5
digits of serial
1108  Diagnostic Timing No. is 08032 or
At power ON/ At reset higher)
RAM ERROR QnPH (first 5
The work area RAM in the CPU module is faulty. digits of serial
 Collateral information No. is 08032 or
 Common Information: — higher)
1109
 Individual Information: — QnPRH (first 5
digits of serial
 Diagnostic Timing No. is 09012 or
Always higher)
TRK. CIR. ERROR This suggests a CPU module hardware fault. OFF Flicker Stop QnPRH
A fault was detected by the initial check of the Contact your local Mitsubishi representative.
tracking hardware.
 Collateral information
1110  Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
TRK. CIR. ERROR
A tracking hardware fault was detected.
 Collateral information
1111  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
TRK. CIR. ERROR – Start after checking that the tracking cable is OFF Flicker Stop QnPRH
A tracking hardware fault was detected during connected. If the same error is displayed
running. again, the cause is the hardware fault of the
– The tracking cable was disconnected and tracking cable or CPU module.
1112 reinserted without the standby system being Contact your local Mitsubishi representative.
powered off or reset. – Confirm the redundant system startup proce-
– The tracking cable is not secured by the con- dure, and execute a startup again. For details,
nector fixing screws. refer to the manual of the redundant system.
– The error occurred at a startup since the
redundant system startup procedure was not
followed.
 Collateral information
1113  Common Information: —
 Individual Information: —
 Diagnostic Timing
During running

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 7


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
TRK. CIR. ERROR This suggests a CPU module hardware fault. OFF Flicker Stop QnPRH
A fault was detected by the initial check of the Contact your local Mitsubishi representative.
tracking hardware.
 Collateral information
1115  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
TRK. CIR. ERROR – Start after checking that the tracking cable is OFF Flicker Stop QnPRH
A tracking hardware fault was detected during connected. If the same error is displayed
running. again, the cause is the hardware fault of the
– The tracking cable was disconnected and tracking cable or CPU module.
reinserted without the standby system being Contact your local Mitsubishi representative.
powered off or reset. – Confirm the redundant system startup proce-
– The tracking cable is not secured by the con- dure, and execute a startup again. For details,
nector fixing screws. refer to the manual of the redundant system.
1116 – The error occurred at a startup since the
redundant system startup procedure was not
followed.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
During running
RAM ERROR – Take noise reduction measures. OFF Flicker Stop QnU (except
The memory of the CPU module in the Multiple – Reset the CPU module and RUN it again. If the Q00UJ-, Q00U-,
CPU high speed transmission area is faulty. same error is displayed again, this suggests a Q01U- and
 Collateral information CPU module hardware fault. Q02UCPU)
1150 Contact your local Mitsubishi representative.
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
RAM ERROR – Take noise reduction measures. OFF Flicker Stop QCPU
The program memory in the CPU module is – Format the program memory, write all files to LCPU
overwritten. the PLC, then reset the CPU module, and RUN
 Collateral information it again.
1160  Common Information: —
If the same error is displayed again, this sug-
gests a CPU module hardware fault.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing
At program execution
RAM ERROR – Take noise reduction measures.
The data of the device memory built in the CPU If the same error is displayed again, this sug-
module is overwritten. gests a CPU module hardware fault.
Contact your local Mitsubishi representative.
 Collateral information
1161  Common Information: —
 Individual Information: —
 Diagnostic Timing
At program execution
RAM ERROR – Take noise reduction measures. OFF Flicker Stop QnU
Data in the program memory of the CPU module – For GX Works2, select "Transfer cache mem-
were overwritten. ory to program memory" in the Options dialog
 Collateral information box.
1163  Common Information: — – Format the program memory, write all files to
the CPU module, and run it again.
 Individual Information: — If the same error code is displayed again, the
 Diagnostic Timing cause is a hardware failure of the CPU mod-
When instruction executed ule.
Contact your local Mitsubishi representative.

Tab. 13-1: Error code list (1000 to 1999)

13 – 8
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
RAM ERROR Take noise reduction measures. OFF Flicker Stop Q10UD(E)H-,
The destruction of the data stored in the stand- If the same error is displayed again, this sug- Q13UD(E)H-,
ard RAM is detected. gests a CPU module hardware fault. Q20UD(E)H-,
 Collateral information Contact your local Mitsubishi representative. Q26UD(E)H-
1164 CPU
 Common Information: — L26CPU-BT
 Individual Information: —
 Diagnostic Timing
When instruction executed
RAM ERROR Q50UDEHCPU
The internal memory in the CPU module is faulty. Q100UDEHCPU
 Collateral information
1166  Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
RAM ERROR LCPU
The RAM of the CPU module (built-in I/O) is
faulty.
 Collateral information
1170  Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
At power ON/ At reset
RAM ERROR Take noise reduction measures. OFF Flicker Stop
The RAM of the CPU module (built-in I/O) is If the same error is displayed again, this sug-
faulty. gests a CPU module hardware fault.
 Collateral information Contact your local Mitsubishi representative.
1171  Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
Always
RAM ERROR Take noise reduction measures. OFF Flicker Stop LCPU
The RAM of the CPU module (built-in I/O) is If the same error is displayed again, this sug-
faulty. gests a CPU module hardware fault.
 Collateral information Contact your local Mitsubishi representative.
1172  Common Information: —
 Individual Information: Failure information
 Diagnostic Timing
At power ON/ At reset
OPE. CIRCUIT ERR. This suggests a CPU module hardware fault. OFF Flicker Stop QCPU
The operation circuit for index modification in Contact your local Mitsubishi representative. LCPU
the CPU module does not operate normally.
 Collateral information
1200  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
OPE. CIRCUIT ERR.
The hardware (logic) in the CPU module does
not operate normally.
 Collateral information
1201  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
OPE. CIRCUIT ERR.
The operation circuit for sequence processing in
the CPU module does not operate normally.
 Collateral information
1202  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 9


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
OPE. CIRCUIT ERR. This suggests a CPU module hardware fault. OFF Flicker Stop QnPRH
The operation circuit for index modification in Contact your local Mitsubishi representative.
the CPU module does not operate normally.
 Collateral information
1203  Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
OPE. CIRCUIT ERR.
The hardware (logic) in the CPU module does
not operate normally.
 Collateral information
1204  Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
OPE. CIRCUIT ERR.
The operation circuit for sequence processing in
the CPU module does not operate normally.
 Collateral information
1205  Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
FUSE BREAK OFF – Check FUSE LED of the output modules and OFF/ON Flicker/ Stop/ Qn(H)
There is an output module with a blown fuse. replace the module whose LED is lit. ON Continue QnPH
 Collateral information (The module with a blown fuse can also be (CPU oper- QnPRH
ation can
 Common Information: identified using the programming tool. Check QnU
Module No.(Slot No.); For Remote I/O net- be set in
the special registers SD1300 to SD1331 to the param-
work: Network No./Station No. see if the bit corresponding to the module is eters at
 Individual Information: — "1".)
error
 Diagnostic Timing – When a GOT is bus-connected to the main occur-
1300 Always base unit or extension base unit, check the rence)
connection status of the extension cable and
the earth status of the GOT.
Check ERR. LED of the output modules and Q00J/Q00/Q01
replace the module whose LED is lit.
(The module with a blown fuse can also be iden-
tified using the programming tool. Check the
special registers SD130 to SD137 to see if the bit
corresponding to the module is "1".)
I/O INT ERROR Any of the mounted modules is experiencing a OFF Flicker Stop QCPU
An interruption has occurred although there is hardware fault. Therefore, check the mounted
no interrupt module. modules and change the faulty module.
 Collateral information Contact your local Mitsubishi representative.
 Common Information: –
 Individual Information: —
 Diagnostic Timing
During interrupt
1310
I/O INT ERROR Reset the CPU module and RUN it again. If the LCPU
An interruption has occurred although there is same error is displayed again, the cause is a
no interrupt module. hardware failure of the CPU module, I/O module,
 Collateral information intelligent function module, or END cover.
 Common Information: – Contact your local Mitsubishi representative.
 Individual Information: —
 Diagnostic Timing
During interrupt

Tab. 13-1: Error code list (1000 to 1999)

13 – 10
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
I/O INT ERROR Take action so that an interrupt will not be issued OFF Flicker Stop Q00J/Q00/Q01
An interrupt request from other than the inter- from other than the interrupt module. (Function
rupt module was detected. version is B or
 Collateral information later)
 Common Information: — QnU
 Individual Information: —
 Diagnostic Timing
During interrupt
I/O INT ERROR – Correct the interrupt pointer setting in the Q00J/Q00/Q01
An interrupt request from the module where PLC system setting of the PLC parameter dia- (Version A)
interrupt pointer setting has not been made in log box. QnPRH
the PLC parameter dialog box was detected. – Take measures so that an interrupt is not QnU
 Collateral information issued from the module where the interrupt
pointer setting in the PLC system setting of
 Common Information: — the PLC parameter dialog box has not been
 Individual Information: — made.
 Diagnostic Timing Correct the interrupt setting of the network
During interrupt parameter.
1311
Correct the interrupt setting of the intelligent
function module buffer memory.
Correct the basic program of the QD51.
– Correct the interrupt pointer setting in the LCPU
PLC System tab of the PLC Parameter dialog
box.
– Take measures not to issue an interruption
from the modules where the interrupt pointer
setting is not configured in the PLC System
tab of the PLC Parameter dialog box.
– Correct the Interrupt Setting of the network
parameter.
– Correct the interrupt setting of the intelligent
function module buffer memory.
– Reset the CPU module and RUN it again. If the
same error is displayed again, the cause is a
hardware failure of the CPU module, I/O mod-
ule, intelligent function module, or END cover.
Contact your local Mitsubishi representative.
LAN CTRL.DOWN This suggests a CPU module hardware fault. OFF Flicker Stop QnU (with Built-
The H/W self-diagnostics detected a LAN con- Contact your local Mitsubishi representative. in Ethernet
1320 troller failure. port)
 Collateral information LCPU
 Common Information: —
 Individual Information: —
1321  Diagnostic Timing
At power ON/ At reset

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 11


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
SP. UNIT DOWN – When the unsupported module is mounted, OFF/ON Flicker/ Stop/ QCPU
– There was no response from the intelligent remove it. ON Continue
function module/special function module in – When the corresponding module is sup- (can be
the initial processing. ported, this suggests a hardware fault of the selected for
– The size of the buffer memory of the intelli- intelligent function module/special function each intelli-
gent function module/special function module module, CPU module and/or base unit. gent func-
is invalid. Contact your local Mitsubishi representative. tion module
– An unsupported module is mounted. by the
parame-
 Collateral information ters)
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset/When intelligent function
module is accessed
1401 SP. UNIT DOWN Reset the CPU module and RUN it again. If the LCPU
– There was no response from the intelligent same error is displayed again, the cause is a
function module in the initial processing. hardware failure of the CPU module, I/O module,
– The size of the buffer memory of the intelli- intelligent function module, or END cover.
gent function module is invalid. Contact your local Mitsubishi representative.
– There was no response from the intelligent
function module.
– The start I/O No. of the targeted intelligent
function module is stored as a common infor-
mation upon error.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset/When intelligent function
module is accessed
SP. UNIT DOWN This suggests a hardware fault of the intelligent OFF/ON Flicker/ Stop/ QCPU
The intelligent function module/special function function module/special function module, CPU ON Continue
module was accessed in the program, but there module and/or base unit. (can be
was no response. Contact your local Mitsubishi representative. selected for
 Collateral information each intelli-
gent func-
 Common Information: Module No. (Slot No.) tion module
 Individual Information: Program error loca- by the
tion parame-
 Diagnostic Timing ters)
When an intelligent function module access
1402 instruction is executed
SP. UNIT DOWN Reset the CPU module and RUN it again. If the LCPU
The intelligent function module was accessed in same error is displayed again, the cause is a
the program, but there was no response. hardware failure of the CPU module, I/O module,
 Collateral information intelligent function module, or END cover.
 Common Information: Module No. (Slot No.) Contact your local Mitsubishi representative.
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When an intelligent function module access
instruction is executed

Tab. 13-1: Error code list (1000 to 1999)

13 – 12
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
SP. UNIT DOWN – When the unsupported module is mounted, OFF/ON Flicker/ Stop/ QCPU
An unsupported module is mounted. remove it. ON Continue
 Collateral information – When the corresponding module is sup- (can be
ported, this suggests a hardware fault of the selected for
 Common Information: Module No. (Slot No.)
intelligent function module/special function each intelli-
 Individual Information: — module, CPU module and/or base unit. gent func-
 Diagnostic Timing Contact your local Mitsubishi representative. tion module
When an END instruction is executed Contact your local Mitsubishi representative. by the
SP. UNIT DOWN parame-
The CPU module, base module and/or the intelli- ters)
– There was no response from the intelligent gent function module/special function module
function module/special function module that was accessed is experiencing a hardware
when the END instruction is executed. fault.
– An error is detected at the intelligent function Contact your local Mitsubishi representative.
module/special function module.
– The I/O module (intelligent function module/
special function module) is nearly removed,
completely removed, or mounted during run-
ning.
 Collateral information
1403  Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
Always
SP. UNIT DOWN Reset the CPU module and RUN it again. If the LCPU
– There was no response from the intelligent same error is displayed again, the cause is a
function module when the END instruction is hardware failure of the CPU module, I/O module,
executed. intelligent function module, or END cover.
– An error is detected at the intelligent function Contact your local Mitsubishi representative.
module.
– The I/O module (intelligent function module/
special function module) is nearly removed,
completely removed, or mounted during run-
ning.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
Always
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QCPU
When performing a parameter I/O allocation the same error is displayed again, the intelligent
intelligent function module/special function function module/special function module, CPU
module could not be accessed during initial module or base unit is faulty.
communications. Contact your local Mitsubishi representative.
(On error occurring, the head I/O number of the
corresponding intelligent function module/spe-
1411 cial function module is stored in the common
information.)
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QCPU
The FROM/TO instruction is not executable, due same error is displayed again, the intelligent
to a control bus error with the intelligent function function module/special function module, CPU
module/special function module. module or base unit is faulty.
(On error occurring, the program error location Contact your local Mitsubishi representative.
is stored in the individual information.)
1412  Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: Program error loca-
tion
 Diagnostic Timing
During execution of FROM/TO instruction set

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 13


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
CONTROL-BUS ERR. – Remove the CPU module incompatible with OFF Flicker Stop Q00J/Q00/Q01
In a multiple CPU system, a CPU module incom- the multiple CPU system from the main base (Function
patible with the multiple CPU system is unit, or replace the CPU module with a CPU version is B or
mounted. module compatible with the multiple CPU later)
system.
 Collateral information Qn(H)
– The intelligent function module, CPU module (Function
 Common Information: — or base unit is faulty. version is B or
 Individual Information: — Contact your local Mitsubishi representative. later)
 Diagnostic Timing QnPH
Always
CONTROL-BUS ERR. – Reset the CPU module and RUN it again. If the QCPU
1413 – Self-diagnostic error in the system bus same error is displayed again, the intelligent
– Self-diagnostic error in the CPU module function module, CPU module or base unit is
faulty.
– In a multiple CPU system, the control CPU Contact your local Mitsubishi representative.
setting of other CPUs, configured in the I/O
Assignment tab of the PLC Parameter dialog – Reconfigure the control CPU setting of other
box, differs from that of CPU No.1. CPUs so that it can be the same as that of
CPU No.1.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
CONTROL-BUS ERR. – Remove the CPU module incompatible with OFF Flicker Stop Q00J/Q00/Q01
– Fault of a loaded module was detected. the multiple CPU system from the main base (Function
– In a multiple CPU system, a CPU module unit, or replace the CPU module with a CPU version is B or
incompatible with the multiple CPU system is module compatible with the multiple CPU later)
mounted. system. Qn(H)
– Reset the CPU module and RUN it again. If the (Function
 Collateral information same error is displayed again, the intelligent
 Common Information: Module No. (Slot No.) version is B or
function module, CPU module or base unit is later)
 Individual Information: — faulty.
QnPH
 Diagnostic Timing Contact your local Mitsubishi representative.
1414 QnU
Always
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the Q00J/Q00/Q01
An error is detected on the system bus. same error is displayed again, the intelligent (Function
 Collateral information function module, CPU module or base unit is version is B or
faulty. later)
 Common Information: Module No. (Slot No.)
 Individual Information: — Contact your local Mitsubishi representative. Qn(H)
 Diagnostic Timing QnPH
Always QnPRH
QnU
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop Q00J/Q00/Q01
Fault of the main or extension base unit was same error is displayed again, the intelligent Qn(H)
detected. function module, CPU module or base unit is (Function
 Collateral information faulty. version is B or
 Common Information: Module No. (Slot No.) Contact your local Mitsubishi representative. later)
 Individual Information: — QnPH
 Diagnostic Timing QnPRH
When an END instruction executed QnU
1415 CONTROL-BUS ERR. Qn(H) (first 5
Fault of the main or extension base unit was digits of serial
detected. No. is 08032 or
 Collateral information higher)
 Common Information: Module No. (Slot No.) QnPH (first 5
digits of serial
 Individual Information: —
No. is 08032 or
 Diagnostic Timing higher)
At power ON/ At reset/When an END instruction
executed

Tab. 13-1: Error code list (1000 to 1999)

13 – 14
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop Qn(H)
System bus fault was detected at power-on or same error is displayed again, the intelligent (Function
reset. function module, CPU module or base unit is version is B or
 Collateral information faulty. later)
 Common Information: Module No. (Slot No.) Contact your local Mitsubishi representative. QnPH
 Individual Information: — QnU
 Diagnostic Timing
At power ON/ At reset
1416
CONTROL-BUS ERR. Q00/Q01
In a multiple CPU system, a bus fault was (Function
detected at power-on or reset. version is B or
 Collateral information later)
 Common Information: Module No. (Slot No.) QnU
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QnPRH
A reset signal error was detected on the system same error is displayed again, the intelligent
bus. function module, CPU module or base unit is
 Collateral information faulty.
1417  Common Information: — Contact your local Mitsubishi representative.
 Individual Information: —
 Diagnostic Timing
Always
CONTROL-BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QnPRH (first 5
In the redundant system, at power-on/reset or same error is displayed again, the CPU module, digits of serial
switching system, the control system cannot the Q6WRB, or hardware of extension cable is No. is 09012 or
access the extension base unit since it failed to faulty. higher)
acquire the access right. Contact your local Mitsubishi representative.
1418  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset/At Switching execution

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 15


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
MULTI-C.BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QnU (except
The error of host CPU is detected in the Multiple same error is displayed again, the CPU module Q00UJ-, Q00U-,
CPU high speed bus. has hardware failure. Q01U- and
 Collateral information Contact your local Mitsubishi representative. Q02UCPU)
1430  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI-C.BUS ERR. – Take noise reduction measures.
The communication error with other CPU is – Reset the CPU module and RUN it again. If the
detected in the Multiple CPU high speed bus. same error is displayed again, the CPU mod-
 Collateral information ule has hardware failure.
1431  Common Information: Module No. (CPU No.) Contact your local Mitsubishi representative.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI-C.BUS ERR. Reset the CPU module and RUN it again. If the
The communication time out with other CPU is same error is displayed again, the CPU module
detected in the Multiple CPU high speed bus. has hardware failure.
 Collateral information Contact your local Mitsubishi representative.
1432  Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI-C.BUS ERR. – Take noise reduction measures.
1433 The communication error with other CPU is – Check the main base unit mounting status of
detected in the Multiple CPU high speed bus. the CPU module.
 Collateral information – Reset the CPU module and RUN it again. If the
1434  Common Information: Module No. (CPU No.) same error is displayed again, the CPU mod-
ule has hardware failure.
 Individual Information: — Contact your local Mitsubishi representative.
1435  Diagnostic Timing
Always
MULTI-C.BUS ERR. Reset the CPU module and RUN it again. If the
The error of the Multiple CPU high speed main same error is displayed again, the CPU module
1436
base unit is detected. (The error of the Multiple has hardware failure.
CPU high speed bus is detected.) Contact your local Mitsubishi representative.
 Collateral information – Take noise reduction measures.
 Common Information: — – Check the main base unit mounting status of
 Individual Information: — the CPU module.
1437  Diagnostic Timing – Reset the CPU module and RUN it again. If the
At power ON/ At reset same error is displayed again, the CPU mod-
ule has hardware failure.
Contact your local Mitsubishi representative.
MULTI-C.BUS ERR. Reset the CPU module and RUN it again. If the OFF Flicker Stop QnU (except
An error of the multiple CPU high speed main same error is displayed again, the CPU module Q00UJ-, Q00U-,
base unit was detected. (An error of the multiple has hardware failure. Q01U- and
CPU high speed bus was detected.) Contact your local Mitsubishi representative. Q02UCPU)
1439  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
AC DOWN Check the power supply. ON OFF Continue QCPU
A momentary power supply interruption has LCPU
occurred.
 Collateral information
1500  Common Information: —
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-1: Error code list (1000 to 1999)

13 – 16
Error Codes Error code list (1000 to 1999)

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
SINGLE PS. DOWN Check the power supplied to the redundant ON ON Continue Qn(H) (first 5
The power supply voltage of either of redundant power supply modules mounted on the redun- digits of serial
power supply modules on the redundant base dant base unit. No. is 04101 or
unit dropped. higher)
 Collateral information QnPH (first 5
1510 digits of serial
 Common Information: Base No. / Nr. des
Netzteils No. is 04101 or
higher)
 Individual Information: —
QnPRH
 Diagnostic Timing
Always QnU (except
Q00UJ-, Q00U-
SINGLE PS. ERROR Hardware fault of the redundant power supply and Q01UCPU)
On the redundant base unit, a damaged redun- module.
dant power supply module was detected. Contact your local Mitsubishi representative.
 Collateral information
1520  Common Information: Base No. / Nr. des
Netzteils
 Individual Information: —
 Diagnostic Timing
Always
BATTERY ERROR – Change the battery. ON OFF Continue QCPU
– The battery voltage in the CPU module has – If the battery is for program memory, stand- LCPU
dropped below stipulated level. ard RAM or for the back-up power function,
– The lead connector of the CPU module battery install a lead connector.
is not connected. – Check the lead connector of the CPU module
– The lead connector of the CPU module battery for looseness. Firmly engage the connector if
1600 is not securely engaged. it is loose.
 Collateral information
 Common Information: Drive Name NOTE:
When this error occurs, the BAT. LED of the CPU
 Individual Information: —
module is lit too.
 Diagnostic Timing
Always
BATTERY ERROR Change the battery. Qn(H)
Voltage of the battery on memory card has QnPH
dropped below stipulated level. NOTE: QnPRH
 Collateral information When this error occurs, the BAT. LED of the CPU
QnU (except
1601  Common Information: Drive Name module is lit too. Q00UJCPU,
 Individual Information: — Q00UCPU, and
 Diagnostic Timing Q01UCPU)
Always
FLASH ROM ERROR] Change the CPU module. ON ON Continue QnU
The number of writing to flash ROM (standard LCPU
ROM and system securement area) exceeds
100,000 times.
(Number of writings = 100,000 times max.)
1610  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
When writing to ROM

Tab. 13-1: Error code list (1000 to 1999)

Programming MELSEC System Q and L series 13 – 17


Error code list (1000 to 1999) Error Codes

Error LED Status CPU Correspond-


Error Contents and Cause Corrective Action
code RUN ERR. Status ing CPU
BUS TIMEOUT ERROR Reset the CPU module and RUN it again. If the OFF Flicker STOP LCPU
An error was detected on the system bus. same error is displayed again, the cause is a
– Self-diagnosis error of the system bus hardware failure of the CPU module, I/O module,
– Self-diagnosis error of the CPU module intelligent function module, or END cover.
1700  Collateral information Contact your local Mitsubishi representative.
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
UNIT BUS ERROR
– An error was detected on the system bus.
– An error was detected in the connected mod-
ule.
1710  Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
Always
END COVER ERROR – Replace the END cover
A failure was detected on the END cover. – Reset the CPU module and RUN it again. If the
 Collateral information same error is displayed again, the cause is a
 Common Information: — hardware failure of the CPU module, intelli-
1720 gent function module, or END cover.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing
At power-ON/At reset/When an END instruction
executed
SYSTEM RST ERROR
An error was detected on the system bus.
 Collateral information
1730  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power-ON/At reset

Tab. 13-1: Error code list (1000 to 1999)

13 – 18
Error Codes Error code list (2000 to 2999)

13.3 Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
UNIT VERFIY ERR. Replace the CPU module incompatible with the OFF/ON Flicker/ Stop/ Qn(H)
In a multiple CPU system, a CPU module incom- multiple CPU system with a CPU module com- ON Continue (Function
patible with the multiple CPU system is patible with the multiple CPU system. (can be set version is B or
mounted. in the later)
 Collateral information parameters QnPH
at error
 Common Information: occur-
Module No. (Slot No.); For Remote I/O net- rence)
work: Network No./Station No.
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
UNIT VERFIY ERR. – Read the error common information at the Q00J/Q00/Q01
The I/O module status is different from the I/O programming tool, and check and/or change
module information at power ON. the module that corresponds to the numerical
I/O module (or intelligent function module) is not value (module number) there.
installed properly or installed on the base unit. – Alternatively, monitor special registers SD150
to SD157 using the programming tool, and
 Collateral information check and replace the module where the bit of
2000  Common Information: its data is "1".
Module No. (Slot No.); For Remote I/O net-
work: Network No./Station No.
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
UNIT VERFIY ERR. – Read the error common information at the Qn(H)
The I/O module status is different from the I/O programming tool, and check and/or change QnPH
module information at power ON. the module that corresponds to the numerical
value (module number) there. QnPRH
I/O module (or intelligent function module/spe- QnU
cial function module) not installed properly or – Alternatively, monitor special registers
installed on the base unit. SD1400 to SD1431 using the programming
tool and change the output module whose bit
 Collateral information has a value of "1".
 Common Information: – When a GOT is bus-connected to the main
Module No. (Slot No.); For Remote I/O net- base unit or extension base unit, check the
work: Network No./Station No. connection status of the extension cable and
 Individual Information: — the grounding status of the GOT.
 Diagnostic Timing
When an END instruction executed
UNIT VERFIY ERR. During operation, do not mount a module on the OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
During operation, a module was mounted on the slot where the empty setting of the CPU module ON Continue (Function
slot where the empty setting of the CPU module was made. (can be set version is B or
was made. in the later)
 Collateral information parameters QnU
2001 at error
 Common Information: Module No. (CPU No.) occur-
 Individual Information: — rence)
 Diagnostic Timing
When an END instruction executed
BASE LAY ERROR – Use the allowable number of extension base OFF Flicker Stop Q00J/Q00/Q01
– More than applicable number of extension units or less. (Function
base units have been used. – Power on the Progammable Controller and version is B or
– When a GOT was bus-connected, the CPU GOT again. later)
module was reset while the power of the GOT QnPRH
2010 was OFF. Q00UJ-, Q00U-,
 Collateral information Q01U- and
 Common Information: Base No. Q02UCPU)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
BASE LAY ERROR Do not use the QA1S6B, QA6B and OFF Flicker Stop Q00J/Q00/Q01
The QA1S6B, QA6B or QA6ADP+A5B/ QA6ADP+A5B/A6B as the base unit. (Function
A6B was used as the base unit. version is B or
later)
 Collateral information
2011 QnPH
 Common Information: Base No.
 Individual Information: — QnPRH
 Diagnostic Timing QnU
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 19


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
BASE LAY ERROR – Remove a bus connection cable for GOT con- OFF Flicker Stop QnPRH
– The GOT is bus-connected to the main base nection connected to the main base unit. (first 5 digits of
unit of the redundant system. – Use the Q6WRB (fixed to the extension serial No. is
The following errors are detected in the CPU stage No.1) 09012 or
redundant system compatible with the extension – Use the CPU module compatible with the higher)
base unit. extension base unit for the other system.
– The base unit other than the Q6WRB is con- – Do not use the Q5B, QA1S6B, QA6B or
nected to the extension stage No.1. QA6ADP+A5 B/A6B for the base unit.
– The base unit is connected to any one of the – Use the main base unit which has the same
extension stages No.2 to No.7, although the number of slots.
Q6WRB does not exist in the extension – Hardware failure of the Q6WRB.
stage No.1. Contact your local Mitsubishi representative.
2012 – The other system CPU module is incompati-
ble with the extension base unit.
– The Q5B, QA1S6B, QA6B or
QA6ADP+A5B/A6B is connected.
– The number of slots of the main base unit for
both systems is different.
– Information of the Q6WRB cannot be read
correctly.
 Collateral information
 Common Information: Base No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
BASE LAY ERROR Hardware failure of the Q6WRB.
Stage number of the Q6WRB is recognized as Contact your local Mitsubishi representative.
other than extension stage No.1 in the redundant
system.
2013  Collateral information
 Common Information: Base No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
EXT.CABLE ERR.] Check to see if the extension cable between the
The following errors are detected in the redun- main base unit and the Q6WRB is connected
dant system. correctly.
– At power-on/reset, the standby system has If not, connect it after turning OFF the main base
detected the error in the path between the unit where the extension cable will be connected.
control system and the Q6WRB. If the cable is connected correctly, hardware of
– The standby system has detected the error in the CPU module, Q6WRB, or extension cable
2020 the path between the host system CPU and is faulty.
the Q6WRB at END processing. Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset/When an END instruction
executed
NO END COVER – Attach an END cover OFF Flicker STOP LCPU
No end cover. – Reset the CPU module and RUN it again. If the
 Collateral information same error is displayed again, the cause is a
2030  Common Information: — hardware failure of the CPU module, I/O mod-
ule, intelligent function module, or END cover.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing
At power ON/ At reset
NO END COVER
No end cover.
 Collateral information
2031  Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed

Tab. 13-2: Error code list (2000 to 2999)

13 – 20
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
UNIT BAD CONNECT – Read common information of the error using OFF Flicker STOP LCPU
– The I/O module status is different from that the programming tool to identify the numeric
obtained at power-on. value (module No.). Check the module corre-
– The I/O module (including the intelligent func- sponding to the value and replace it as neces-
tion module) is nearly disconnected or is sary.
completely disconnected during running. – Monitor SD1400 to SD1431 using the pro-
gramming tool to identify the module of
2040  Collateral information which data bit is "1". Check the module and
 Common Information: Module No. (Slot No.) replace it as necessary.
 Individual Information: — – Reset the CPU module and RUN it again. If the
 Diagnostic Timing same error is displayed again, the cause is a
Always hardware failure of the CPU module, I/O mod-
ule, intelligent function module, or END cover.
Contact your local Mitsubishi representative.
SP. UNIT LAY ERR. Make setting again to match the PLC parameter OFF Flicker Stop Qn(H)
The slot to which the QI60 is mounted is set to I/O assignment with the actual loading status. (Function
other than Inteli (intelligent function module) or version is B or
Interrupt (interrupt module) in the I/O assign- later)
ment of PLC parameter. QnPH
 Collateral information QnPRH
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Make the PLC parameter’s I/O assignment Qn(H)
Wrong I/O assignment setting of PLC parameter: setting again so it is consistent with the actual QnPH
– In the I/O assignment setting of PLC parame- status of the intelligent function module and
the CPU module. QnPRH
ter, Inteli (intelligent function module) was
allocated to an I/O module or vice versa. – Delete the switch setting in the I/O assign- QnU
– In the I/O assignment setting of PLC parame- ment setting of the PLC parameter.
ter, a module other than CPU (or nothing) was
allocated to the location of a CPU module or
vice versa.
– In the I/O assignment setting of the PLC
parameter, switch setting was made to the
module that has no switch setting.
– In the I/O assignment setting of the PLC
parameter dialog box, the number of points
assigned to the intelligent function module is
2100 less than the number of points of the
mounted module.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Reset the parameter I/O allocation setting to con- Q00J/Q00/Q01
Wrong I/O assignment setting of PLC parameter: form to the actual status of the intelligent func-
– In the I/O assignment setting of PLC parame- tion module and the CPU module.
ter, Inteli (intelligent function module) was
allocated to an I/O module or vice versa.
– In the I/O assignment setting of PLC parame-
ter, a module other than CPU (or nothing) was
allocated to the location of a CPU module or
vice versa.
– In the I/O assignment setting of the PLC
parameter dialog box, the number of points
assigned to the intelligent function module is
less than the number of points of the
mounted module.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 21


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. – Set the parameter again in the I/O Assignment OFF Flicker Stop LCPU
Wrong I/O assignment setting of PLC parameter: tab of the PLC Parameter dialog box accord-
– In the I/O assignment setting of PLC parame- ing to the CPU module mounted.
ter, an intelligent function module was allo- – Delete the switch setting.
cated to an I/O module or vice versa. – Reset the CPU module and RUN it again. If the
– In the I/O assignment setting of the PLC same error is displayed again, the cause is a
parameter dialog box, the number of points hardware failure of the CPU module, I/O mod-
2100 assigned to the intelligent function module is ule, intelligent function module, or END cover.
less than the number of points of the Contact your local Mitsubishi representative.
mounted module.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Reduce the A series special function modules OFF Flicker Stop Qn(H)
13 or more A-series special function modules (except the A1SI61) that can make an interrupt
(except for the A1SI61) that can initiate an inter- start to the CPU module to 12 or less.
rupt to the CPU module have been installed.
2101  Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Keep the number of A1SD51S to six or fewer. OFF Flicker Stop Qn(H)
Seven or more A1SD51S have been installed.
 Collateral information
2102  Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Reduce the number of QI60/A1SD51S mod- OFF Flicker Stop Qn(H)
– Two or more QI60/A1SD51S modules are ules mounted in the single CPU system to (Function
mounted in a single CPU system. one. version is B or
– Two or more QI60/A1SD51S modules are set – Change the number of QI60/A1SD51S mod- later)
to the same control CPU in a multiple CPU ules set to the same control CPU to only one QnPH
system. in the multiple CPU system.
– Two or more A1SD51S modules are loaded in – Reduce the number of A1SD51S modules to
a multiple CPU system. only one in the multiple CPU system. When
using an interrupt module with each QCPU in
 Collateral information a multiple CPU system, replace it with the
 Common Information: Module No. (Slot No.) QI60. (Use one A1SI61 module + max. three
 Individual Information: — QI60 modules or only the QI60 modules.)
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Install only one QI60, A1SD51S module. OFF Flicker Stop Qn(H)
Two or more QI60, A1SD51S interrupt modules QnPRH
have been mounted.
 Collateral information
 Common Information: Module No. (Slot No.)
2103  Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Install only one QI60 module. OFF Flicker Stop Q00J/Q00/Q01
Two or more QI60 modules are mounted. (first 5 digits of
 Collateral information serial No. is
04101 or
 Common Information: Module No. (Slot No.)
higher)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Install only one QI60 module. OFF Flicker Stop Q00J/Q00/Q01
Two or more QI60 modules where interrupt – Make interrupt pointer setting to the second (Function
pointer setting has not been made are mounted. QI60 module and later. version is B or
 Collateral information later)
 Common Information: Module No. (Slot No.) QnU
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

13 – 22
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. – Reduce the number of MELSECNET/H or CC- OFF Flicker Stop Q00UJ
– Two or more MELSECNET/H and CC-Link IE Link IE controller network modules to one.
controller network modules are mounted. – Reduce the number of Ethernet modules to
– Two or more Ethernet modules are mounted. one.
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Reduce the number of MELSECNET/H or CC- OFF Flicker Stop Q00U/Q01U
– Two or more MELSECNET/H and CC-Link IE Link IE controller network modules to one in
controller network modules are mounted in the entire system.
the entire system. – Reduce the number of Ethernet modules to
– Two or more Ethernet modules are mounted one in the entire system.
in the entire system.
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Reduce the MELSECNET/H and CC-Link IE OFF Flicker Stop Q02U
– Three or more MELSECNET/H and CC-Link IE controller network modules up to two or less
controller network modules in total are in the entire system.
mounted in the entire system. – Reduce the Ethernet interface modules up to
– Three or more Ethernet interface modules are two or less in the entire system.
mounted in the entire system.
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
2106 SP. UNIT LAY ERR. – Reduce the MELSECNET/H and CC-Link IE OFF Flicker Stop QnU (except
– Five or more MELSECNET/H and CC-Link IE controller network modules up to four or less Q00UJ-, Q00U-,
controller network modules in total are in the entire system. Q01U and,
mounted in the entire system. – Reduce the Ethernet interface modules up to Q02UCPU)
– Five or more Ethernet interface modules are four or less in the entire system.
mounted in the entire system.
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Reduce the CC-Link IE controller network OFF Flicker Stop Qn(H) (first 5
– Three or more CC-Link IE controller network modules up to two or less in the entire sys- digits of serial
modules are mounted in the entire system. tem. No. is 10042 or
– Five or more MELSECNET/H and CC-Link IE – Reduce the total number of the MELSECNET/ higher)
controller network modules in total are H and CC-Link IE controller network modules QnPH (first 5
mounted in the entire system. up to four or less in the entire system. digits of serial
 Collateral information No. is 10042 or
 Common Information: Module No. higher)
 Individual Information: — QnPRH (first 5
digits of serial
 Diagnostic Timing No. is 10042 or
At power ON/ At reset higher)
SP. UNIT LAY ERR. – Reduce the number of MELSECNET/H mod- OFF Flicker Stop Qn(H)
– Five or more MELSECNET/H modules have ules to four or less. QnPH
been installed. – Reduce the number of Ethernet modules to QnPRH
– Five or more Ethernet interface modules have four or less.
been installed.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 23


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. – Reduce the MELSECNET/H modules to one. OFF Flicker Stop Q00J/Q00/Q01
– Two or more MELSECNET/H modules were – Reduce the Ethernet modules to one.
installed. – Reduce the CC-Link modules to two or less.
– Two or more Ethernet modules were installed.
– Three or more CC-Link modules were
installed.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
2106 At power ON/ At reset
SP. UNIT LAY ERR. – Check the network number and station OFF Flicker Stop Q00J/Q00/Q01
– The same network number or same station number. Qn(H)
number is duplicated in the MELSECNET/H QnPH
network system. QnPRH
 Collateral information
 Common Information: Module No.
(Steckplatz)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Make the PLC parameter’s I/O assignment set- OFF Flicker Stop QCPU
The start X/Y set in the PLC parameter’s I/O ting again so it is consistent with the actual sta-
assignment settings is overlapped with the one tus of the intelligent function module/special
for another module. function modules.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
2107
SP. UNIT LAY ERR. – Configure the start X/Y again in the I/O LCPU
The start X/Y set in the PLC parameter’s I/O Assignment tab of the PLC Parameter dialog
assignment settings is overlapped with the one box according to the intelligent function mod-
for another module. ule and I/O modules connected.
 Collateral information – Reset the CPU module and RUN it again. If the
same error is displayed again, the cause is a
 Common Information: Module No. (Slot No.) hardware failure of the CPU module, I/O mod-
 Individual Information: — ule, intelligent function module, or END cover.
 Diagnostic Timing Contact your local Mitsubishi representative.
At power ON/ At reset
SP. UNIT LAY ERR. Replace the network module for the A2USCPU or OFF Flicker Stop Qn(H)
 Network module A1SJ71LP21, A1SJ71BR11, the network module for the Q2ASCPU with the
A1SJ71AP21, A1SJ71AR21, or A1SJ71AT21B MELSECNET/H module.
dedicated for the A2USCPU has been
installed.
 Network module A1SJ71QLP21 or
2108 A1SJ71QBR11 dedicated for the Q2ASCPU
has been installed.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

13 – 24
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP UNIT ERROR – Read the individual information of the error OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
– The location designated by the FROM/TO using the programming tool, check the ON Continue Qn(H)
instruction set is not the intelligent function FROM/TO instruction that corresponds to that (can be set (Function
module/special function module. numerical value (program error location), and in the version is B or
– The module that does not include buffer correct when necessary. parameters later)
memory has been specified by the FROM/TO – The intelligent function module/special func- at error QnPH
instruction. tion module that was accessed is experienc- occur-
ing a hardware fault. Therefore, change the rence) QnPRH
– The intelligent function module/special func-
tion module, Network module being accessed faulty module. Alternatively, contact your local QnU
is faulty. Mitsubishi representative.
– Station not loaded was specified using the
instruction whose target was the CPU share
memory.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: Program error loca-
tion
2110  Diagnostic Timing
When instruction executed
SP UNIT ERROR – Read the individual information of the error LCPU
– The location designated by the FROM/TO using the programming tool, check the
instruction set is not the intelligent function FROM/TO instruction that corresponds to that
module. numerical value (program error location), and
– The module that does not include buffer correct when necessary.
memory has been specified by the FROM/TO – Reset the CPU module and RUN it again. If the
instruction. same error is displayed again, the cause is a
– The intelligent function module being hardware failure of the CPU module, I/O mod-
accessed is faulty. ule, intelligent function module, or END cover.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed
SP UNIT ERROR – Read the individual information of the error OFF/ON Flicker/ Stop/ QCPU
– The location designated by a link direct device using the programming tool, check the ON Continue
(J\) is not a network module. FROM/TO instruction that corresponds to that (can be set
numerical value (program error location), and in the
– The I/O module (intelligent function module/ correct when necessary.
special function module) was nearly removed, parameters
completely removed, or mounted during run- – The intelligent function module/special func- at error
ning. tion module that was accessed is experienc- occur-
2111 ing a hardware fault. Therefore, change the rence)
 Collateral information faulty module. Alternatively, contact your local
 Common Information: Module No. (Slot No.) Mitsubishi representative.
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed.
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ QCPU
– The module other than intelligent function using the programming tool, and check the intel- ON Continue
module/special function module is specified ligent function module /special function module (can be set
by the intelligent function module/special dedicated instruction (network instruction) that in the
function module dedicated instruction. Or, it is corresponds to the value (program error part) to parameters
not the corresponding intelligent function make modification. at error
module/special function module. occur-
– There is no network No. specified by the net- rence)
work dedicated instruction. Or the relay target
network does not exist.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: Program error loca-
tion
2112
 Diagnostic Timing
When instruction executed/STOP → RUN
SP UNIT ERROR – Read the individual information of the error LCPU
– The module other than intelligent function using the programming tool to identify the
module is specified by the intelligent function numeric value (program error location).
module dedicated instruction. Or, it is not the Check the intelligent function module dedi-
corresponding intelligent function module. cated instruction corresponding to the value
and correct it as necessary.
 Collateral information
– Reset the CPU module and RUN it again. If the
 Common Information: Module No. (Slot No.) same error is displayed again, the cause is a
 Individual Information: Program error loca- hardware failure of the CPU module, I/O mod-
tion ule, intelligent function module, or END cover.
 Diagnostic Timing Contact your local Mitsubishi representative.
When instruction executed/STOP → RUN

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 25


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Qn(H)
The module other than network module is speci- using the programming tool, and check the intel- ON Continue QnPH
fied by the network dedicated instruction. ligent function module /special function module (can be set
 Collateral information dedicated instruction (network instruction) that in the
corresponds to the value (program error part) to parameters
2113  Common Information: FFFFH (fixed) at error
 Individual Information: Program error loca- make modification.
occur-
tion rence)
 Diagnostic Timing
When instruction executed/STOP → RUN
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
An instruction, which on execution specifies using the programming tool, check the program ON Continue (Function
other stations, has been used for specifying the corresponding that value (program error loca- version is B or
host CPU. (An instruction that does not allow the tion), and make correction. later)
host CPU to be specified). Qn(H)
2114  Collateral information (Function
 Common Information: Module No. (Slot No.) version is B or
later)
 Individual Information: Program error loca-
tion QnPH
 Diagnostic Timing QnU
When instruction executed/STOP → RUN
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
An instruction, which on execution specifies the using the programming tool, check the program ON Continue (Function
host CPU, has been used for specifying other corresponding that value (program error loca- version is B or
CPUs. (An instruction that does not allow other tion), and make correction. later)
stations to be specified). Qn(H)
2115  Collateral information (Function
 Common Information: Module No. (Slot No.) version is B or
later)
 Individual Information: Program error loca-
tion QnPH
 Diagnostic Timing
When instruction executed/STOP → RUN
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
– An instruction that does not allow the intelli- using the programming tool, check the program ON Continue (Function
gent function module under the control of corresponding that value (program error loca- version is B or
another CPU to be specified is being used for tion), and make correction. later)
a similar task. Qn(H)
– Instruction was executed for the A or QnA (Function
2116 module under control of another CPU. version is B or
 Collateral information later)
 Common Information: Module No. (Slot No.) QnPH
 Individual Information: Program error loca- QnU
tion
 Diagnostic Timing
When instruction executed/STOP → RUN
SP UNIT ERROR Read the individual information of the error OFF/ON Flicker/ Stop/
A CPU module that cannot be specified in the using the programming tool, check the program ON Continue
instruction dedicated to the multiple CPU system corresponding that value (program error loca-
was specified. tion), and make correction.
 Collateral information
2117
 Common Information: Module No. (Slot No.)
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed/STOP → RUN
SP UNIT ERROR – When performing the online module change OFF/ON Flicker/ Stop/ Qn(H)
When the online module change setting is set to in a multiple CPU system, correct the pro- ON Continue (Function
be "enabled" in the PLC parameter in a multiple gram so that access will not be made to the version is B or
CPU system, intelligent function module control- intelligent function module controlled by the later)
other CPU. QnPH
led by other CPU using the FROM instruction/
– When accessing the intelligent function mod-
intelligent function module device (U\G) is
ule controlled by the other CPU in a multiple QnU (except
2118 specified. CPU system, set the online module change Q00UJ-, Q00U-,
 Collateral information setting to be "disabled" by parameter. Q01U and
 Common Information: Module No. (Slot No.) Q02UCPU)
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed

Tab. 13-2: Error code list (2000 to 2999)

13 – 26
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. Check the location of the base unit. OFF Flicker Stop Q00J/Q00/Q01
The locations of an extension base unit is (Version A)
improper. Qn(H)
 Collateral information QnPH
2120  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Check the loading position of the CPU module OFF Flicker Stop Qn(H)
The CPU module is installed to other than the and reinstall it at the correct slot. QnPH
CPU slot and slots 0 to 2.
 Collateral information
2121  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. OFF Flicker Stop Qn(H)
The QA1S6B/QA6B or QA6ADP+A5B/ QnPH
A6B are used for the main base unit. QnPRH
 Collateral information
2122 Replace the main base unit with a usable one.
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 27


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. – Remove the module mounted on the 65th slot OFF Flicker Stop Qn(H)
– A module is mounted on the 65th slot or later or later slot. QnPH
slot. – Remove the module mounted on the slot QnPRH
– A module is mounted on the slot whose whose number is greater than the number of
slots specified at [Slots] in [Standard setting] QnU (except
number is greater than the number of slots
specified at [Slots] in [Standard setting] of of the base setting. Q00UJ-, Q00U-,
the base setting. – Remove the module mounted on the slot Q01U and
whose number of I/O points exceeds 4096 Q02UCPU)
– A module is mounted on the slot whose
number of I/O points exceeds 4096 points. points.
– A module is mounted on the slot whose – Replace the module with the one whose
number of I/O points strides 4096 points. number of occupied points does not exceed
4096 points.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Remove the module mounted on after the OFF Flicker Stop Q00UJ
– A module is mounted on after the 25th slot 25th (or after the 17th slot for the Q00U/Q01U
(or after the 17th slot for the Q00UJCPU). Q00UJCPU).
– A module is mounted on the slot whose – Remove the module mounted on the slot
number is later than the one set in the "Base whose number is later than the one set in the
setting" on the I/O assignment tab of PLC "Base setting" on the I/O assignment tab of
parameter in theprogramming tool. PLC parameter in the programming tool.
– A module is mounted on the slot for which I/O – Remove the module mounted on the slot for
points greater than 1024 (greater than 256 for which I/O points greater than 1024 (greater
the Q00UJCPU) is assigned. than 256 for the Q00UJCPU) is assigned.
– A module is mounted on the slot for which I/O – Replace the end module with the one whose
points is assigned from less than 1024 to number of occupied points is within 1024
greater than 1024 (from less than 256 to (within 256 for the Q00UJCPU).
greater than 256 for the Q00UJCPU).
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
2124
SP. UNIT LAY ERR. – Remove the module mounted on the 37th slot OFF Flicker Stop Q02U
– A module is mounted on the 37th slot or later or later slot.
slot. – Remove the module mounted on the slot
– A module is mounted on the slot whose whose number is greater than the number of
number is greater than the number of slots slots specified at [Slots] in [Standard setting]
specified at [Slots] in [Standard setting] of of the base setting.
the base setting. – Remove the module mounted on the slot
– A module is mounted on the slot whose whose number of I/O points exceeds 2048
number of I/O points exceeds 2048 points. points.
– A module is mounted on the slot whose – Replace the module with the one whose
number of I/O points strides 2048 points number of occupied points does not exceed
2048 points.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Remove the module mounted on the 25th slot OFF Flicker Stop Q00J
– A module is mounted on the 25th slot or later or later slot. (The 17th slot or later slot for the Q00/Q01
slot. (The 17th slot or later slot for the Q00JCPU.)
Q00JCPU.) – Remove the module mounted on the slot
– A module is mounted on the slot whose whose number is greater than the number of
number is greater than the number of slots slots specified at [Slots] in [Standard setting]
specified at [Slots] in [Standard setting] of of the base setting.
the base setting. – Remove the module mounted on the slot
– A module is mounted on the slot whose whose number of I/O points exceeds 1024
number of I/O points exceeds 1024 points. points. (256 points for the Q00J.)
(256 points for the Q00JCPU.) – Replace the module with the one whose
– A module is mounted on the slot whose number of occupied points does not exceed
number of I/O points strides 1024 points. 1024 points. (256 points for the Q00J.) über-
(256 points for the Q00JCPU.) schreitet, gegen eines mit weniger E/As
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

13 – 28
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. UNIT LAY ERR. – Reduce the number of connectable modules OFF Flicker Stop L26CPU-BT
– The number of connectable modules has to 10.
exceeded 10. – Remove the module whose number of points
– A module is installed exceeding the I/O points exceeds 4096 points.
of 4096. – Replace the module installed to at end with
– A module is installed crossing the I/O points the one whose number of occupied points
of 4096. does not exceed 4096 points.
 Collateral information – Reset the CPU module and RUN it again. If the
same error is displayed again, the cause is a
 Common Information: — hardware failure of the CPU module, I/O mod-
 Individual Information: — ule, intelligent function module, or END cover.
 Diagnostic Timing Contact your local Mitsubishi representative.
At power ON/ At reset
2124
SP. UNIT LAY ERR. – Reduce the number of connectable modules L02CPU
– The number of connectable modules has to 10.
exceeded 10. – Remove the module whose number of points
– A module is installed exceeding the I/O points exceeds 1024 points.
of 1024. – Replace the module installed to at end with
– A module is installed crossing the I/O points the one whose number of occupied points
of 1024. does not exceed 1024 points.
 Collateral information – Reset the CPU module and RUN it again. If the
same error is displayed again, the cause is a
 Common Information: — hardware failure of the CPU module, I/O mod-
 Individual Information: — ule, intelligent function module, or END cover.
 Diagnostic Timing Contact your local Mitsubishi representative.
At power ON/ At reset
SP. UNIT LAY ERR. – Install a usable module OFF Flicker Stop QCPU
– A module which the QCPU cannot recognise The intelligent function module/special func-
has been installed. tion module is experiencing a hardware fault.
– There was no response from the intelligent Contact your local Mitsubishi representative.
function module/special function module.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
2125
SP. UNIT LAY ERR. – Connect an applicable module. LCPU
– A module which the LCPU cannot recognise – Reset the CPU module and RUN it again. If the
has been connected. same error is displayed again, the cause is a
– There was no response from the intelligent hardware failure of the CPU module, I/O mod-
function module. ule, intelligent function module, or END cover.
Contact your local Mitsubishi representative.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. – Mount modules on the available slots so that OFF Flicker Stop Qn(H)
CPU module locations in a multiple CPU system the empty slots will be located on the right- (Function
are either of the following. hand side of the CPU module. version is B or
– There are empty slots between the QCPU and – Remove the module mounted on the left-hand later)
QCPU/motion controller. side of the High performance model QCPU/ QnPH
– A module other than the High performance Process CPU, and mount the High perform-
model QCPU/Process CPU (including the ance model QCPU/Process CPU on the empty
motion controller) is mounted on the left- slot. Mount the motion CPU on the right-hand
2126 side of the High performance model QCPU/
hand side of the High performance model
QCPU/Process CPU. Process CPU.
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information:
 Diagnostic Timing
At power ON/ At reset
SP. UNIT LAY ERR. Remove the unusable module from the extension OFF Flicker Stop QnPRH (first 5
An unusable module is mounted on the exten- base unit. digits of serial
sion base unit in the redundant system. No. is 09012 or
 Collateral information later)
2128  Common Information: Module No.
 Individual Information:
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 29


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP.UNIT VER. ERR. – Change the intelligent function module for the OFF Flicker Stop Q00J/Q00/Q01
In a multiple CPU system, the control CPU of the one compatible with the multiple CPU system. QnPH
intelligent function module incompatible with the – Change the setting of the control CPU of the QnU (except
multiple CPU system is set to other than CPU intelligent function module incompatible with Q00UJCPU)
No.1. the multiple CPU system to CPU No.1.
2150  Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset/At writing to proguramma-
ble controller
SP. UNIT LAY ERR. Use a module compatible with the redundant OFF Flicker Stop QnPRH
Either of the following modules incompatible system.
with the redundant system has been mounted in
a redundant system.
 CC-Link IE controller network modules
 MELSECNET/H modules
2151  Ethernet modules
 Collateral information
 Common Information: Module No. (Slot No.)
 Individual Information:
 Diagnostic Timing
At power ON/ At reset/At writing to proguramma-
ble controller
SYSTEM LAY ERR. – Disconnect the module that cannot be recog- OFF Flicker Stop LCPU
 A module which the LCPU cannot recognize is nized.
connected. – Reset the CPU module and RUN it again. If the
 Collateral information same error is displayed again, the cause is a
2170  Common Information: —
hardware failure of the CPU module, I/O mod-
ule, intelligent function module, or END cover.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing
At power ON/ At reset
MISSING PARA. – Check and correct the valid parameter drive OFF Flicker Stop Qn(H)
There is no parameter file in the drive specified settings made by the DIP switches. QnPH
as valid parameter drive by the DIP switches. – Set the parameter file to the drive specified as QnPRH
 Collateral information valid parameter drive by the DIP switches.
 Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
MISSING PARA. – Set the parameter file to the program mem- Q00J/Q00/Q01
There is no parameter file at the program mem- ory.
ory.
 Collateral information
2200  Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
MISSING PARA. – Set a parameter file in a drive to be valid. QnU
Parameter file does not exist in all drives where
parameters will be valid.
 Collateral information
 Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
MISSING PARA. – Write parameter files to the program memory OFF Flicker Stop LCPU
There is no parameter file in the program mem- of the CPU module.
ory. – Cancel the SD memory card forced disable
– When using a parameter file in an SD memory instruction.
card, the SD memory card is being disabled
by SM606 (SD memory card forced disable
2200 instruction).
 Collateral information
 Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-2: Error code list (2000 to 2999)

13 – 30
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
BOOT ERROR Check the boot setting. OFF Flicker Stop Q00J/Q00/Q01
The contents of the boot file are incorrect. (Function
 Collateral information version is B or
later)
 Common Information: Drive name
2210 Qn(H)
 Individual Information: —
 Diagnostic Timing QnPH
At power ON/ At reset QnPRH
QnU
BOOT ERROR – Reboot. OFF Flicker Stop Qn(H)
File formatting is failed at a boot. – CPU module hardware fault. QnPRH
 Collateral information Contact your local Mitsubishi representative. QnU
2211  Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
BOOT ERROR – Check the setting of the password 32 for the OFF Flicker Stop LCPU
The file was booted from the SD memory card to transfer source file and destination files.
the program memory or standard ROM but it – Delete the boot setting from the parameter file
was not booted to the CPU module due to either of the SD memory card.
of the following reasons.
– The passwords for the password 32 do not
match between transfer source file and desti-
nation file.
2213 – The password 32 is not configured for the
transfer source file while it is configured for
the destination file.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
RESTORE ERROR – Set the number of device points at the time of OFF Flicker Stop QnU
The device information (number of points) back- backup to the device point setting in [PLC LCPU
uped by the device data backup function is differ- parameter]. Then, turn ON from OFF power
ent from the number of device points of the PLC supply, or reset the CPU and cancel reset.
parameter. – Delete the backuped data, and turn ON from
After this error occurred, perform restore per OFF power supply, or reset the CPU and can-
cel reset.
power-on/reset until the number of device points
2220 is identical to the number of device points in the
PLC parameter, or until the backup data is
deleted.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
RESTORE ERROR Reset the CPU module and run it again. OFF Flicker Stop QnU
The device information backuped by the device LCPU
data backup function is incomplete. (Turning
power supply OFF or reset is suspected.)
Do not return the data when this error occurs.
Also, delete the incomplete device information at
2221 the time of this error occurrence.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
RESTORE ERROR Execute a restore for the CPU module whose OFF Flicker Stop QnU (first five
The model name of the restoration destination name is same as the backup source CPU mod- digits of the
CPU module is different from the one of the ule. serial number is
backup source CPU module. 04101 or
 Collateral information higher)
2225
 Common Information: — LCPU
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 31


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
RESTORE ERROR – Execute a restore of other backup data OFF Flicker Stop QnU (first five
– The backup data file is destroyed. (The con- because the backup data may be destructed. digits of the
tent of the file is different from the check – Set the write protect switch of the SRAM card serial number is
code.) to off (write enabled). 04101 or
– Reading the backup data from the SRAM higher)
memory card is not successfully completed.
– Since the write protect switch of the SRAM
card is set to on (write inhibited), the checked
"Restore for the first time only" setting cannot
be performed.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
2226
RESTORE ERROR – Restore with any other backup data because OFF Flicker Stop LCPU
– The backup data file is destroyed. (The con- the backup data may have been corrupted.
tent of the file is different from the check – Set the write protect switch of the SD memory
code.) card to off (write-enabled).
– Reading the backup data from the SD mem-
ory card is not successfully completed.
– Since the write protect switch of the SD card
is set to on (write prohibited), the checked
"Restore for the first time only" setting cannot
be performed.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
RESTORE ERROR Execute a restore for the other CPU module too OFF Flicker Stop QnU (first five
Writing the backup data to the restoration desti- because the CPU module may be damaged. digits of the
nation drive is not successfully completed. serial number is
 Collateral information 04101 or
2227 higher)
 Common Information: —
LCPU
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
ICM. OPE. ERROR – Turn on SM609 (Memory card remove/insert OFF/ON Flicker/ Stop/ Qn(H)
– A memory card was removed without turning enable flag) and then remove the memory ON Continue QnPH
on SM609 (Memory card remove/insert ena- card. (can be set
in the QnPRH
ble flag). – Check that SM600 (Memory card usable
flags) is off and then remove the memory parameters QnU (except
– A memory card was removed while SM600
(Memory card usable flags) is on. card. at error Q00UJ-, Q00U-
occur- and Q01UCPU)
 Collateral information
rence)
 Common Information: Drive name
 Individual Information: —
2300  Diagnostic Timing
When memory card is inserted or removed
ICM. OPE. ERROR – Turn off the SD memory card lock switch first LCPU
– A memory card was removed without turning and then remove the memory card.
off the SD memory card lock switch.
 Collateral information
 Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
When memory card is inserted or removed

Tab. 13-2: Error code list (2000 to 2999)

13 – 32
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
ICM. OPE. ERROR – Format memory card. OFF/ON Flicker/ Stop/ Qn(H)
– The memory card has not been formatted. – Reformat memory card. ON Continue QnPH
– Memory card format status is incorrect. – If the memory card is a flash card, write data (can be set QnPRH
in the
 Collateral information to the flash card in any of the following meth-
parameters QnU (except
ods.:
 Common Information: Drive name 1)Write program memory to the ROM at error Q00UJ-, Q00U-
 Individual Information: — 2)Write data to the CPU module (flash ROM occur- and Q01UCPU)
 Diagnostic Timing 3) Back up data to the flash card rence) LCPU
When memory card is inserted or removed. 4)Write image data to an external device, such
as a memory card writer.
– If the same error code is displayed again, the
cause is a failure of the memory card.
Contact your local Mitsubishi representative.
ICM. OPE. ERROR – Write the QCPU file to the Flash card Qn(H)
– The QCPU file does not exist in the Flash card. QnPH
2301  Collateral information QnPRH
 Common Information: Drive name QnU (except
 Individual Information: — Q00UJ-, Q00U-
 Diagnostic Timing and Q01UCPU)
When memory card is inserted or removed.
ICM. OPE. ERROR – Format SRAM card after changing battery of QnU (except
– SRAM card failure is detected. (It occurs SRAM card. Q00UJ-, Q00U-
when automatic format is not set.) – Write a parameter, which sets the file register and Q01UCPU)
– Writing parameters was performed during at "Not available", in CPU, and then perform
setting file registers. the operation.
 Collateral information
 Common Information: Drive name
 Individual Information: —
 Diagnostic Timing
When memory card is inserted or removed.
ICM. OPE. ERROR – Format memory card. OFF/ON Flicker/ Stop/ Qn(H)
– A memory card that cannot be used with the – Reformat memory card. ON Continue QnPH
CPU module has been installed. – Check memory card. (can be set QnPRH
 Collateral information in the
2302 parameters QnU (except
 Common Information: Drive name at error Q00UJ-, Q00U-
 Individual Information: — occur- and Q01UCPU)
 Diagnostic Timing rence)
When memory card is inserted or removed.

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 33


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
FILE SET ERROR – Execute automatic write to standard ROM on OFF Flicker Stop Qn(H)
Automatic write to standard ROM was per- the CPU module which is compatible with (Function
formed on the CPU module that is incompatible automatic write to standard ROM. version is B or
with automatic write to standard ROM. – Using a programming tool, perform write of later)
(Memory card where automatic write to standard parameters and programs to standard ROM. QnPH
ROM was selected in the boot file was fitted and – Change the memory card for the one where QnPRH
the parameter enable drive was set to the mem- automatic write to standard ROM has not
ory card.) been set, and perform boot operation from
the memory card.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller
FILE SET ERROR – Read the individual information of the error QCPU
The file designated at the PLC file settings in the using a programming tool, check to be sure
parameters cannot be found. that the parameter drive name and file name
correspond to the numerical values there
2400  Collateral information (parameter number), and correct.
 Common Information: File name/Drive name – Create a file created using parameters, and
 Individual Information: Parameter No. load it to the CPU module.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller/STOP → RUN
FILE SET ERROR – Read the individual information of the error LCPU
– The file specified with a parameter does not using the programming tool to identify the
exist. numeric value (parameter No.). Check the
– When using a file in an SD memory card, the drive name and file name of the parameter
SD memory card is being disabled by SM606 corresponding to the value, and correct it as
(SD memory card forced disable instruction). necessary. Create the specified file and write it
to the CPU module.
 Collateral information – Cancel the SD memory card forced disable
 Common Information: File name/Drive name instruction.
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller/STOP → RUN

Tab. 13-2: Error code list (2000 to 2999)

13 – 34
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
FILE SET ERROR – Check and correct the parameters (boot set- OFF Flicker Stop Qn(H)
Program memory capacity was exceeded by per- ting). (Function
forming boot operation or automatic write to – Delete unnecessary files in the program mem- version is B or
standard ROM. ory. later)
 Collateral information – Choose "Clear program memory" for boot in QnPH
 Common Information: File name/Drive name the parameter so that boot is started after the QnPRH
program memory is cleared.
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller
FILE SET ERROR QnU
Program memory capacity was exceeded by per- LCPU
forming boot operation.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller
FILE SET ERROR – Read the individual information of the error OFF Flicker Stop QCPU
The file specified by parameters cannot be cre- using a programming tool, check to be sure LCPU
ated. that the parameter drive name and file name
2401 correspond to the numerical values there
 Collateral information (parameter number), and correct.
 Common Information: File name/Drive name – Check the space remaining in the memory
 Individual Information: Parameter No. card.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller
FILE SET ERROR Secure the empty capacity of the standard ROM. OFF Flicker Stop QnU
– Although setting is made to use the device LCPU
data storage file, there is no empty capacity
required for creating the device data storage
file in the standard ROM.
– When the latch data backup function (to
standard ROM) is used, there is no empty
capacity required for storing backup data in
standard ROM. (The parameter number
"FFFFH" is displayed for the error individual
information.)
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/ At reset/At writing to programma-
ble controller/STOP → RUN
FILE SET ERROR – Correct the size for the file register file in the OFF Flicker Stop QnU
– When the extended data register and PLC File tab of the PLC Parameter dialog box. LCPU
extended link register are configured in the – Correct the setting for the File Register
File Register Extended Setting in the Device Extended Setting in the Device tab of the PLC
tab of the PLC Parameter dialog box, the size Parameter dialog box.
of the file register file is smaller than that
2406 specified in the PLC File tab.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
STOP → RUN
FILE OPE. ERROR – Read the individual information of the error OFF/ON Flicker/ Stop/ Qn(H)
– The specified program does not exist in the using a programming tool, check to be sure ON Continue QnPH
program memory. that the program corresponds to the numeri- (can be set
cal values there (program location), and cor- QnPRH
This error may occur when the ECALL, in the
EFCALL, PSTOP, PSCAN, POFF or PLOW rect. parameters QnU
instruction is executed. – Create a file created using parameters, and at error LCPU
– The specified file does not exist. load it to the CPU module. occur-
2410 rence)
 Collateral information – In case a specified file does not exist, write
the file to a target memory and/or check the
 Common Information: File name/Drive name file specified with the instruction again.
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 35


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
FILE OPE. ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Qn(H)
– The file is one which cannot be specified by using a programming tool, check to be sure that ON Continue QnPH
the sequence program (such as comment the program corresponds to the numerical val- (can be set QnPRH
file). ues there (program location), and correct. in the
parameters QnU
– The specified program exists in the program
memory, but has not been registered in the at error LCPU
program setting of the Parameter dialog box. occur-
This error may occur when the ECALL, rence)
2411 EFCALL, PSTOP, PSCAN or POFF instruction
is executed.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Program error loca-
tion
 Diagnostic Timing
When instruction executed
FILE OPE. ERROR Read the individual information of the error OFF/ON Flicker/ Stop/ Qn(H)
The SFC program file is one that cannot be des- using a programming tool, check to be sure that ON Continue QnPH
ignated by the sequence program. the program corresponds to the numerical val- (can be set
in the QnPRH
 Collateral information ues there (program location), and correct.
QnU
parameters
2412  Common Information: File name/Drive name at error LCPU
 Individual Information: Program error loca- occur-
tion rence)
 Diagnostic Timing
When instruction executed
FILE OPE. ERROR – Read the individual information of the error OFF/ON Flicker/ Stop/ Qn(H)
Check to ensure that the designated file has not using a programming tool, check to be sure ON Continue QnPH
been write protected. that the program corresponds to the numeri- (can be set
cal values there (program location), and cor- in the QnPRH
 Collateral information rect. parameters
2413  Common Information: File name/Drive name – Check to ensure that the designated file has at error
 Individual Information: Program error loca- not been write protected. occur-
tion rence)
 Diagnostic Timing
When instruction executed
CAN’T EXE. PRG. – Read the common information of the error OFF Flicker Stop QCPU
– There is a program file that uses a device that using a programming tool, check to be sure LCPU
is out of the range set in the PLC parameter that the parameter device allocation setting
device setting. and the program file device allocation corre-
– After the PLC parameter setting is changed, spond to the numerical values there (file
only the parameter is written into the PLC. name), and correct if necessary.
– Although an SFC program exists, the step – Whenever a device setting is changed, write
relay points is set to “0” in the Device tab of both the parameter and program file to the
the PLC Parameter dialog box. CPU module.
– To use the SFC program, set the step relay
 Collateral information points to 8 k.
 Common Information: File name/Drive name
 Individual Information: —
2500
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T EXE. PRG. When the index modification of the PLC parame- OFF Flicker Stop QnU
After the index modification of the PLC parame- ter is changed, batch-write the parameter and LCPU
ter is changed, only the parameter is written to program file into the PLC.
the PLC.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-2: Error code list (2000 to 2999)

13 – 36
Error Codes Error code list (2000 to 2999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CAN’T EXE. PRG. – Edit the PLC parameter program setting to OFF Flicker Stop Qn(H)
There are multiple program files although "none" "yes". QnPH
has been set at the PLC parameter program set- – Alternatively, delete unneeded programs. QnPRH
tings. QnU
 Collateral information
LCPU
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
2501
CAN’T EXE. PRG. – Delete unnecessary program files. OFF Flicker Stop Q00J/Q00/Q01
– There are three or more program files. – Match the program name with the program
– The program name differs from the program contents.
contents.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T EXE. PRG. Check whether the program version is ***.QPG, OFF Flicker Stop QCPU
– The program file is incorrect. and check the file contents to be sure they are for LCPU
– Alternatively, the file contents are not those of a sequence program.
a sequence program.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
2502 CAN’T EXE. PRG. Create a program using GX Developer, GX IEC OFF Flicker Stop QnPRH
The program file is not the one for the redundant Developer or PX Developer for which the PLC
CPU. type has been set to the redundant CPU
– Alternatively, the file contents are not those of (Q12PRH/Q25PRH), and write it to the CPU
a sequence program. module.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T EXE. PRG. – Check program configuration. OFF Flicker Stop QCPU
There are no program files at all. – Check parameters and program configuration. LCPU
 Collateral information
2503  Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T EXE. PRG. – Check program configuration. OFF Flicker Stop Qn(H)
Two or more SFC normal programs or control – Check parameters and program configuration. QnPH
programs have been designated. QnPRH
 Collateral information QnU
 Common Information: File name/Drive name LCPU
 Individual Information: —
 Diagnostic Timing
2504 At power ON/At reset/STOP → RUN
CAN’T EXE. PRG. Reduce the SFC programs to one. OFF Flicker Stop Q00J/Q00/Q01
There are two or more SFC programs. (Function
 Collateral information version is B or
later)
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-2: Error code list (2000 to 2999)

Programming MELSEC System Q and L series 13 – 37


Error code list (2000 to 2999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
REMOTE PASS.FAIL Check for illegal accesses. If any illegal access is ON ON Continue QnU with Built-
The count of remote password mismatches identified, take actions such as disabling com- in Ethernet port
reached the upper limit. munication of the connection. LCPU
 Collateral information If no illegal access is identified, clear the error
 Common Information: — and perform the following. (Clearing the error
also clears the count of remote password mis-
 Individual Information: —
matches.)
2700  Diagnostic Timing – Check if the remote password sent is correct.
Always – Check if the remote password has been
locked.
– Check if concurrent access was made from
multiple devices to one connection by UDP.
– Check if the upper limit of the remote pass-
word mismatch count is too low.
SNTP OPE.ERROR – Check if the time setting function is set up OFF/ON Flicker/ Stop/
Time setting failed when the programmable con- correctly. ON Continue
troller was powered ON or reset. – Check if the specified SNTP server is operat-
 Collateral information ing normally, or if any failure has occurred on
2710  Common Information: —
the network connected to the specified SNTP
server computer.
 Individual Information: —
 Diagnostic Timing
When time setting function is executed.
DISPLAY ERROR – Do not detach the display unit during opera- ON ON Continue LCPU
The display unit was attached or detached while tion.
the CPU module is on. – Ensure that the display unit is securely
 Collateral information attached to the CPU module.
2900  Common Information: — – Reset the CPU module and run it again. If the
same error is displayed again, the CPU mod-
 Individual Information: — ule or display unit is faulty.
 Diagnostic Timing Contact your local Mitsubishi representative.
Always
DISPLAY ERROR
A failure was detected in the display unit (in an
initial processing).
 Collateral information
2901  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
DISPLAY ERROR – Ensure that the display unit is securely
A failure was detected in the display unit (during attached to the CPU module.
operation). – Reset the CPU module and run it again. If the
 Collateral information same error is displayed again, the CPU mod-
2902 ule or display unit is faulty.
 Common Information: — Contact your local Mitsubishi representative.
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-2: Error code list (2000 to 2999)

13 – 38
Error Codes Error code list (3000 to 3999)

13.4 Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR – Specify the head I/O number of the intelligent OFF Flicker Stop Qn(H)
In a multiple CPU system, the intelligent function function module under control of the host (Function
module under control of another CPU is speci- CPU. version is B or
fied in the interrupt pointer setting of the PLC – Delete the interrupt pointer setting of the later)
parameter. parameter. QnPH
 Collateral information QnU
 Common Information: File name/Drive name (except
 Individual Information: Parameter No. Q00UJCPU)
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR – Read the individual information of the error QCPU
The PLC parameter settings for timer time limit using the programming tool, check the
setting, the RUN-PAUSE contact, the common parameter item corresponding to the numeri-
pointer number, general data processing, cal value (parameter No.), and correct it.
number of empty slots, system interrupt set- – Rewrite corrected parameters to the CPU
tings, baud rate setting, and service processing module, reload the CPU power supply and/or
reset the module.
setting are outside the range that can be used by
the CPU module. – If the same error occurs, it is thought to be a
hardware error.
 Collateral information Contact your local Mitsubishi representative.
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR QnPH
In a program memory check, the check capacity QnPRH (first 5
has not been set within the range applicable for digits of serial
3000 the CPU module. No. is 07032 or
 Collateral information higher)
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR QCPU
The parameter settings in the error individual
information (special register SD16) are illegal.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR QnU (except
The ATA card is set to the memory card slot Q00UJ-, Q00U-
when the specified drive for the file register is set and Q01UCPU)
to "memory card (ROM)" and [Use the following
file] or [Use the same file name as the program]
(either one is allowed) is set in the PLC file set-
ting.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 39


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR – Read the individual information of the error OFF Flicker Stop LCPU
Any of the values for the Timer Limit Setting, using the programming tool, check the
RUNPAUSE Contacts, Common Pointer No., parameter item corresponding to the numeri-
Points Occupied by Empty Slot, System Interrupt cal value (parameter No.), and correct it.
Setting, or Service Processing Setting option – If the same error occurs, the cause is a failure
configured in the PLC Parameter dialog box are of the program memory of the CPU module,
standard RAM, or SD memory card.
3000 outside the range of the CPU module. Contact your local Mitsubishi representative.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR – Read the individual information of the error OFF Flicker Stop QCPU
The parameter settings are corrupted. using the programming tool, check the LCPU
 Collateral information parameter item corresponding to the numeri-
cal value (parameter No.), and correct it.
 Common Information: File name/Drive name
3001 – Rewrite corrected parameters to the CPU
 Individual Information: Parameter No. module, reload the CPU power supply and/or
 Diagnostic Timing reset the module.
At power ON/At reset/STOP → RUN/At writing to – If the same error occurs, it is thought to be a
programmable controller hardware error.
Contact your local Mitsubishi representative.
PARAMETER ERROR – Read the individual information of the error OFF Flicker Stop Qn(H)
When "Use the following file" is selected for the using the programming tool, check the QnPH
file register in the PLC file setting of the PLC parameter item corresponding to the numeri-
cal value (parameter No.), and correct it. QnPRH
parameter dialog box, the specified file does not
exist although the file register capacity has been – Rewrite corrected parameters to the CPU
set. module, reload the CPU power supply and/or
reset the module.
 Collateral information
– If the same error occurs, it is thought to be a
 Common Information: File name/Drive name hardware error.
 Individual Information: Parameter No. Contact your local Mitsubishi representative.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR QnU (except
When "Use the following file" is set for the file Q00UJCPU)
register in the PLC file setting of the PLC param- LCPU
eter dialog box and the capacity of file register is
not set, the file register file does not exist in the
3002 specified target memory.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR QnU
When "Use the following file" is set for the device LCPU
data storage file in [PLC file] of [PLC parameter],
and [Capacity] is not set, the device data storage
file does not exist in the target memory.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

13 – 40
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR Change the file register file for the one refreshen- OFF Flicker Stop Qn(H)
The automatic refresh range of the multiple CPU abled in the whole range. (Function
system exceeded the file register capacity. version is B or
 Collateral information later)
 Common Information: File name/Drive name QnPH
 Individual Information: Parameter No. QnU
 Diagnostic Timing (except
Q00UJCPU)
When an END instruction executed
3003 PARAMETER ERROR – Read the individual information of the error QCPU
The number of devices set at the PLC parameter using the programming tool, check the LCPU
device settings exceeds the possible CPU mod- parameter item corresponding to the numeri-
ule range. cal value (parameter No.), and correct it.
 Collateral information – If the error is still generated following the cor-
rection of the parameter settings, the possible
 Common Information: File name/Drive name cause is the memory error of the CPU mod-
 Individual Information: Parameter No. ule's program memory or the memory card.
 Diagnostic Timing Contact your local Mitsubishi representative.
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Check whether the parameter file version is OFF Flicker Stop QCPU
The parameter file is incorrect. Alternatively, the ***.QPA, and check the file contents to be sure LCPU
contents of the file are not parameters. they are parameters.
 Collateral information
3004  Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR – Read the individual information of the error OFF Flicker Stop Qn(H) (first 5
The contents of the parameter are damaged. using the programming tool, check the digits of serial
 Collateral information parameter item corresponding to the numeri- No. is 09012 or
cal value (parameter No.), and correct it. higher)
 Common Information: File name/Drive name
– Write the modified parameter items to the QnPH (first 5
 Individual Information: Parameter No. CPU module again, and power-on the Pro- digits of serial
3005  Diagnostic Timing grammable Controller or reset the CPU mod- No. is 10042 or
At power ON/At reset/STOP → RUN ule. higher)
– When the same error occurs again, the hard- QnPRH (first 5
ware is faulty.
Contact your local Mitsubishi representative. digits of serial
No. is 10042 or
higher)
PARAMETER ERROR – Delete the setting of the Q02CPU's high speed OFF Flicker Stop Qn(H) (first 5
– The high speed interrupt is set in a Q02CPU. interrupt. To use high speed interrupts, digits of serial
– The high speed interrupt is set in a multiple change the CPU module to one of the Q02H/ No. is 04012 or
CPU system. Q06H/Q12H/Q25HCPU. higher)
– The high speed interrupt is set for a not appli- – To use a multiple CPU system, delete the set-
cable base unit. ting of the high-speed interrupt. To use high
speed interrupts, change the system to a sin-
– No module is installed at the I/O address des- gle CPU system.
3006 ignated by the high speed interrupt.
– Use applicable base units.
 Collateral information – Re-examine the I/O address designated by the
 Common Information: File name/Drive name high speed interrupt setting.
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
MISSING PARA. Create parameters using the programming tool, OFF Flicker Stop QnPRH
The parameter file in the drive specified as valid and write them to the drive specified as valid
parameter drive by the DIP switches is inapplica- parameter drive by the DIP switches.
ble for the CPU module.
 Collateral information
3007  Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 41


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR Re-set the parameter I/O assignment to control OFF Flicker Stop Qn(H)
In a multiple CPU system, the modules for AnS, them under one CPU module. Change the (Function
A, Q2AS and QnA have been set to multiple con- parameters of all CPUs in the multiple CPU sys- version is B or
trol CPUs. tem. later)
 Collateral information
3009  Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Match the number of (CPU modules in multiple OFF Flicker Stop Qn(H)
The parameter-set number of CPU modules dif- CPU setting) - (CPUs set as empty in I/O assign- (Function
fers from the actual number in a multiple CPU ment) with that of actually mounted CPU mod- version is B or
system. ules. later)
 Collateral information QnPH
3010  Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Match the multiple CPU setting or control CPU OFF Flicker Stop Q00/Q01
Multiple CPU setting or control CPU setting dif- setting in the PLC parameter with that of the ref- (Function
fers from that of the reference CPU settings in a erence CPU (CPU No. 1) settings. version is B or
multiple CPU system. later)
 Collateral information Qn(H)
3012  Common Information: File name/Drive name (Function
version is B or
 Individual Information: Parameter No. later)
 Diagnostic Timing QnU
At power ON/At reset/STOP → RUN/At writing to
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

13 – 42
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR Check the following in the multiple CPU auto OFF Flicker Stop Qn(H)
In a multiple CPU system, the multiple CPU auto refresh setting and make correction. (Function
refresh setting is any of the following: – When specifying the bit device, specify 0 or a version is B or
– When a bit device is specified as a refresh multiple of 16 for the refresh starting device. later)
device, a number other than a multiple of 16 – Specify the device that may be specified for QnPH
is specified for the refresh-starting device. the refresh device.
– The device specified is other than the one that – Set the number of send points to an even
may be specified. number.
– The number of send points is an odd number.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Check the following in the multiple CPU auto Q00/Q01
In a multiple CPU system, the multiple CPU auto refresh setting and make correction. (Function
refresh setting is any of the following: – The total number of transmission points is version is B or
– The total number of transmission points is within the maximum number of refresh later)
greater than the maximum number of refresh points.
points.
 Collateral information
 Common Information: File name/Drive name
3013
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Check the following in the multiple CPU auto QnU
In a multiple CPU system, the multiple CPU auto refresh setting and make correction. (except Q00UJ)
refresh setting is any of the following: – Specify the device that may be specified for
– The device specified is other than the one that the refresh device.
may be specified. – Set the number of send points to an even
– The number of send points is an odd number. number.
– The total number of send points is greater – Set the total number of send points within the
than the maximum number of refresh points. range of the maximum number of refresh
– The setting of the refresh range crosses over points.
the boundary between the internal user device – Set the refresh range so that it does not cross
and the extended data register (D) or over the boundary between the internal user
extended link register (W). device and the extended data register (D) or
– No device is set in the host CPU send range. extended link register (W).
– For the send range of the host CPU, refresh
 Collateral information target device must be specified. If a send
 Common Information: File name/Drive name range is not necessary, delete the applicable
 Individual Information: Parameter No. send range.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR – Match the online module change parameter OFF Flicker Stop Qn(H)
– In a multiple CPU system, the online module with that of the reference CPU 1. QnPH
change parameter (multiple CPU system – If the CPU module that does not support QnU (except
parameter) settings differ from those of the online module change is mounted, replace it Q00UJ-, Q00U-,
reference CPU 1. with the CPU module that supports online Q01U- and
– In a multiple CPU system, the online module module change.
Q02UCPU)
change setting is enabled although the CPU
module mounted does not support online
module change.
3014 – In a multiple CPU system, online module
change parameter was corrected and then it
was written to the CPU module.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 43


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PARAMETER ERROR Read the individual information of the error OFF Flicker Stop QnU (except
In a multiple CPU system configuration, the CPU using the programming tool, check the parame- Q00UJ-, Q00U-,
verified is different from the one set in the ter item corresponding to the numerical value Q01U- and
parameter setting. (parameter No./CPU No.) and parameter of tar- Q02UCPU)
 Collateral information get CPU, and correct them.
3015  Common Information: File name/Drive name
 Individual Information:
Parameter No./CPU No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
PARAMETER ERROR Delete the CPU module incompatible with multi- OFF Flicker Stop QnU (except
The CPU module incompatible with multiple CPU ple CPU synchronized boot-up from the setting. Q00UJ-, Q00U-,
synchronized boot-up is set as the target for the Q01U- and
synchronized boot-up in the [Multiple CPU syn- Q02UCPU)
chronous startup setting].
 Collateral information
3016
 Common Information: File name/Drive name
 Individual Information:
Parameter No./CPU No.
 Diagnostic Timing
At power ON/At reset/At writing to programma-
ble controller
PARAMETER ERROR With the programming tool, write [PLC parame- OFF Flicker Stop Qn(H) (first 5
The parameter file is damaged. ter/Network parameter/Remote password] to a digits of serial
 Collateral information valid drive then reload the power supply for sys- No. is 07032 or
tem and/or reset the CPU module. If the same higher)
3040  Common Information: —
 Individual Information: — error occurs, it is thought to be a hardware error. QnPH (first 5
Contact your local Mitsubishi representative. digits of serial
 Diagnostic Timing No. is 07032 or
At power ON/At reset higher)
PARAMETER ERROR With the programming tool, write [Intelligent OFF Flicker Stop QnPRH (first 5
Parameter file of intelligent function module is function module parameter] to a valid drive then digits of serial
damaged. reload the power supply for system and/or reset No. is 07032 or
 Collateral information the CPU module. If the same error occurs, it is higher)
3041  Common Information: — thought to be a hardware error.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing
At power ON/At reset
PARAMETER ERROR – With the programming tool, write [PLC OFF Flicker Stop
The system file that stored the remote password parameter/Network parameter/Remote pass-
setting information is damaged. word] to a valid drive then reload the power
supply for system and/or reset the CPU mod-
 Collateral information ule. If the same error occurs, it is thought to
 Common Information: — be a hardware error.
 Individual Information: — Contact your local Mitsubishi representative.
 Diagnostic Timing – When a valid drive for parameter is set to
3042 At power ON/At reset other than [program memory], set the param-
eter file (PARAM) at the boot file setting to be
able to transmit to the program memory.
With the programming tool, write [PLC
parameter/Network parameter/Remote pass-
word] to a valid drive then reload the power
supply for system and/or reset the CPU mod-
ule. If the same error occurs, it is thought to
be a hardware error.
Contact your local Mitsubishi representative.

Tab. 13-3: Error code list (3000 to 3999)

13 – 44
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR – Delete the network parameter of the CC-Link OFF Flicker Stop Qn(H) (first 5
In a multiple CPU system, the CC-Link IE con- IE controller network module controlled by digits of serial
troller network module controlled by another another CPU. No. is 09012 or
CPU is specified as the head I/O number of the – Change the setting to the head I/O number of higher)
CC-Link IE controller network module. the CC-Link IE controller network module QnPH (first 5
controlled by host CPU. digits of serial
 Collateral information
 Common Information: File name/Drive name No. is 10042 or
higher)
 Individual Information: Parameter No.
QnU
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Reset the CPU module. OFF Flicker Stop Qn(H) (first 5
The network parameter of the CC-Link IE control- digits of serial
ler network operating as the normal station is No. is 09012 or
overwritten to the control station. higher)
Or, the network parameter of the CC-Link IE con- QnPH (first 5
troller network operating as the control station is digits of serial
overwritten to the normal station. No. is 10042 or
(The network parameter is updated on the mod- higher)
ule by resetting.) QnPRH (first 5
 Collateral information digits of serial
 Common Information: File name/Drive name No. is 10042 or
higher)
 Individual Information: Parameter No.
QnU
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Check the network parameters and actual OFF Flicker Stop
– The number of modules actually mounted is mounting status, and if they differ, make them
different from that is set in Network parame- match.
ter for CC-Link IE controller network. When network parameters are modified, write
– The head I/O number of the actually mounted them to the CPU module.
module is different from the one set in the – Check the setting of extension base unit stage
network parameter of the CC-Link IE control- number.
ler network. – Check the connection status of extension
– Data cannot be handled in the parameter base unit and extension cables. When the
existing. GOT is busconnected to the main base unit or
3100 – The network type of CC-Link IE controller net- extension base unit, also check its connection
work is overwritten during power-on. (When status.
changing the network type, switch RESET to If the error occurs even after the above checks,
RUN.) the possible cause is a hardware fault.
 Collateral information Contact your local Mitsubishi representative.
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR OFF Flicker Stop
– The CC-Link IE controller network module is
specified for the head I/O number of network
parameter in the MELSECNET/H.
– The MELSECNET/H module is specified for
the head I/O number of network parameter in
the CC-Link IE controller network.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR OFF Flicker Stop
– Although the CC-Link IE controller network
module is mounted, network parameter for
the CCLink IE controller network module is
not set.
– Although the CC-Link IE controller network
and MELSECNET/H modules are mounted,
network parameter for the MELSECNET/H
module is not set.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 45


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR – Delete the MELSECNET/H network parameter OFF Flicker Stop Q00/Q01
In a multiple CPU system, the MELSECNET/H of the MELSECNET/H under control of (Function
under control of another CPU is specified as the another CPU. version is B or
head I/O number in the network setting parame- – Change the setting to the head I/O number of later)
ter of the MELSECNET/H. the MELSECNET/H under control of the host Qn(H)
CPU. (Function
 Collateral information
 Common Information: File name/Drive name version is B or
later)
 Individual Information: Parameter No.
QnPH
 Diagnostic Timing
QnU (except
At power ON/At reset/STOP → RUN Q00UJCPU)
LINK PARA. ERROR Reset the CPU module. OFF Flicker Stop Qn(H)
The network parameter of the MELSECNET/H (Function
operating as the normal station is overwritten to version is B or
the control station. later)
Or, the network parameter of the MELSECNET/H QnPH
operating as the control station is overwritten to QnPRH
the normal station. (The network parameter is QnU
updated on the module by resetting.)
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
3100
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Check the network parameters and actual OFF Flicker Stop QCPU
– The number of modules actually mounted is mounting status, and if they differ, make them
different from that is set in Network parame- match.
ter for MELSECNET/H. When network parameters are modified, write
– The head I/O number of actually installed them to the CPU module.
modules is different from that designated in – Check the setting of extension base unit stage
the network parameter of MELSECNET/H. number.
– Some data in the parameters cannot be han- – Check the connection status of extension
dled. base unit and extension cables. When the
– The network type of MELSECNET/H is over- GOT is busconnected to the main base unit or
written during power-on. (When changing the extension base unit, also check its connection
network type, switch RESET to RUN.) status.
– The mode switch of MELSECNET/H module If the error occurs even after the above checks,
(for module with first 5 digits of serial No. is the possible cause is a hardware fault.
"07032" or higher) is outside the range. Contact your local Mitsubishi representative.
 Collateral information – Set the mode switch of MELSECNET/H mod-
ule (for module with first 5 digits of serial No.
 Common Information: File name/Drive name is "07032" or higher) within the range.
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

13 – 46
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR Change the file register file for the one that ena- OFF Flicker Stop Qn(H)
The link refresh range exceeded the file register bles entire range refresh. (Function
capacity. version is B or
 Collateral information later)
 Common Information: File name/Drive name QnPH
 Individual Information: Parameter No. QnPRH
 Diagnostic Timing QnU (except
When an END instruction executed Q00UJCPU)
LINK PARA. ERROR Correct the type or station number of the OFF Flicker Stop Qn(H)
– When the station number of the MELSECNET/ MELSECNET/H module in the network parameter (Function
H module is 0, the PLC-to-PLC network to meet the used system. version is B or
parameter has been set. later)
– When the station number of the MELSECNET/ QnPH
H module is other than 0, the remote master QnPRH
parameter setting has been made.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Check the network parameters and actual OFF Flicker Stop Qn(H) (first 5
The refresh parameter for the CC-Link IE control- mounting status, and if they differ, make them digits of serial
ler network is outside the range. match. No. is 09012 or
When network parameters are modified, write higher)
 Collateral information them to the CPU module.
 Common Information: File name/Drive name QnPH (first 5
– Check the setting of extension base unit stage digits of serial
 Individual Information: Parameter No. number. No. is 10042 or
 Diagnostic Timing – Check the connection status of extension higher)
At power ON/At reset/STOP → RUN base unit and extension cables. When the QnPRH (first 5
GOT is busconnected to the main base unit or
extension base unit, also check its connection digits of serial
status. No. is 10042 or
higher)
If the error occurs even after the above checks,
the possible cause is a hardware fault. QnU
LINK PARA. ERROR Contact your local Mitsubishi representative. OFF Flicker Stop QCPU
– The network No. specified by a network
3101 parameter is different from that of the actually
mounted network.
– The head I/O No. specified by a network
parameter is different from that of the actually
mounted I/O unit.
– The network class specified by a network
parameter is different from that of the actually
mounted network.
– The network refresh parameter of the
MELSECNET/H, MELSECNET/10 is out of the
specified area.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Use a module that supports a multi-remote I/O OFF Flicker Stop QnPH
A multi-remote I/O network was configured network.
using a module that does not support a multi-
remote I/O network.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Set the system A of the MELSECNET/H OFF Flicker Stop QnPRH
– The system A of the MELSECNET/H remote remote master station to Station No. 0.
master station has been set to other than Sta- – Set the system B of the MELSECNET/H
tion No. 0. remote master station to any of Station No. 1
– The system B of the MELSECNET/H remote to 64.
master station has been set to Station No. 0.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 47


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR Set the refresh parameter of the MELSECNET/H OFF Flicker Stop Qn(H) (first 5
Since the number of points of the B/W device set in accordance with the number of points of B/W digits of serial
in [Device] of the PLC parameter is lower than devices set in [Device] of the PLC parameter. No. is 09012 or
the number of B/W refresh device points when higher)
parameters of the MELSECNET/H are not set, the QnPH (first 5
refresh between the CPU module and the digits of serial
MELSECNET/H cannot be performed. No. is 09012 or
higher)
Number of B/W refresh device points when QnPRH (first 5
parameters of the MELSECNET/H are not set: digits of serial
– 1 network module mounted No. is 09012 or
B: 8192; W: 8192 higher)
– 2 network modules mounted QnU
B: 8192 (4096x2); W: 8192 (4096x2)
– 3 network modules mounted
B: 6144 (2048x3); W: 6144 (2048x3)
– 4 network modules mounted
3101
B: 8192 (2048x4); W: 8192 (2048x4)
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Set the network refresh range so that it does not OFF Flicker Stop QnU
The setting of the network refresh range crosses cross over the boundary between the internal
over the boundary between the internal user user device and the extended data register (D) or
device and the extended data register (D) or extended link register (W).
extended link register (W).
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Correct and write the network parameters. OFF Flicker Stop Qn(H) (first 5
A CC-Link IE controller network parameter error – If the error occurs after correction, it suggests digits of serial
was detected. a hardware fault. No. is 09012 or
 Collateral information Contact your local Mitsubishi representative. higher)
 Common Information: File name/Drive name QnPH (first 5
digits of serial
 Individual Information: Parameter No.
No. is 10042 or
 Diagnostic Timing higher)
At power ON/At reset/STOP → RUN QnPRH (first 5
digits of serial
No. is 10042 or
higher)
QnU
LINK PARA. ERROR OFF Flicker Stop QCPU
The network module detected a network parame-
ter error.
3102  Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Refer to the troubleshooting of the network mod- OFF Flicker Stop QnPRH
The station No. specified in pairing setting are ule, and if the error is due to incorrect pairing
not correct. setting, reexamine the pairing setting of the net-
– The stations are not numbered consecutively. work parameter.
– Pairing setting has not been made for the CPU
module at the normal station.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

13 – 48
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR Mount the CC-Link IE controller network module OFF Flicker Stop QnU
The CC-Link IE controller network module whose whose first 5 digits of serial No. is "09042" or
first 5 digits of serial No. is "09041" or lower is higher.
mounted.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Set the same network type (CC IE Control Ext. OFF Flicker Stop QnU
– Different network types are set between the Mode/Normal Mode) for the control station
control station and the normal station (CC IE and the normal station.
Control Ext. Mode/Normal Mode). – Do not use the parameter in which “CC IE
– The parameter in which “CC IE Control Ext. Control Ext. Mode” is set for “Network Type”
Mode” is set for “Network Type” was trans- for the CPU module that does not support the
ferred to the CPU module that does not sup- send points expansion function.
port the send points expansion function. Or, use the CPU module and the CC-Link IE
– The parameter in which “CC IE Control Ext. controller network module that support the
Mode” is set was backed up to a memory card send points expansion function in the same
or GOT and then restored to the CPU module network.
that does not support the send points expan-
sion function.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Set group cyclic function in function version D or OFF Flicker Stop QnU (first 5
Group cyclic function in CC-Link IE controller later of CC-Link IE controller network. digits of serial
3102 network that does not correspond to group No. is 10042 or
cyclic function is set. higher)
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Examine the pairing setting for the network OFF Flicker Stop Q00J/Q00/Q01
Pairing setting in CC-Link IE controller network parameter in the control staion. Qn(H) (first 5
modules installed in CPUs except for redundant digits of serial
CPUs was performed. No. is 10042 or
 Collateral information higher)
 Common Information: File name/Drive name QnPH (first 5
 Individual Information: Parameter No. digits of serial
No. is 10042 or
 Diagnostic Timing higher)
At power ON/At reset/STOP → RUN
QnU (first 5
digits of serial
No. is 10042 or
higher)
LINK PARA. ERROR Correct the network range assignments for the OFF Flicker Stop Q00J/Q00/Q01
– LB/LW own station send range at LB/LW4000 network parameter in the control station.
or later was set.
– LB/LW setting (2) was performed.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 49


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR – Delete the Ethernet network parameter of OFF Flicker Stop Q00/Q01
In a multiple CPU system, Ethernet interface Ethernet interface module under control of (Function
module under control of another station is speci- another station. version is B or
fied to the start I/O number of the Ethernet net- – Change the setting to the start I/O number of later)
work parameter. Ethernet interface module under control of the Qn(H)
host station. (Function
 Collateral information
 Common Information: File name/Drive name version is B or
later)
 Individual Information: Parameter No.
QnPH
 Diagnostic Timing
QnU (except
At power ON/At reset/STOP → RUN Q00UJCPU)
LINK PARA. ERROR – Correct and write the network parameters. OFF Flicker Stop QCPU
– Although the number of modules has been set If the error occurs after correction, it suggests
to one or a greater number in the Ethernet a hardware fault.
module count parameter setting, the number Contact your local Mitsubishi representative.
of actually mounted module is zero.
– The start I/O No. of the Ethernet network
parameter differs from the I/O No. of the actu-
3103 ally mounted module.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Correct and write the network parameters. OFF Flicker Stop QnPRH (first 5
– Ethernet module whose network type is set to If the error occurs after correction, it suggests digits of serial
"Ethernet (main base)" is mounted on the a hardware fault. No. is 09012 or
extension base unit in the redundant system. Contact your local Mitsubishi representative. higher)
– Ethernet module whose network type is set to
"Ethernet (extension base)" is mounted on the
main base unit in the redundant system.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Correct and write the network parameters. OFF Flicker Stop QCPU
– The Ethernet, MELSECNET/H and MELSEC- If the error occurs after correction, it suggests
NET/10 use the same network number. a hardware fault.
– The network number, station number or Contact your local Mitsubishi representative.
group number set in the network parameter is
out of range.
– The specified I/O number is outside the range
3104 of the used CPU module.
– The Ethernet-specific parameter setting is not
normal.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

13 – 50
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR – Delete the CC-Link network parameter of the OFF Flicker Stop Q00/Q01
In a multiple CPU system, the CC-Link module CC-Link module under control of another sta- (Function
under control of another station is specified as tion. version is B or
the head I/O number of the CC-Link network – Change the setting to the start I/O number of later)
parameter. the CC-Link module under control of the host Qn(H)
station. (Function
 Collateral information
 Common Information: File name/Drive name version is B or
later)
 Individual Information: Parameter No.
QnPH
 Diagnostic Timing
QnU (except
At power ON/At reset/STOP → RUN Q00UJCPU)
LINK PARA. ERROR – Correct and write the network parameters. OFF Flicker Stop QCPU
– Though the number of CC-Link modules set in If the error occurs after correction, it suggests L02CPU
the network parameters is one or more, the a hardware fault.
number of actually mounted modules is zero. Contact your local Mitsubishi representative.
– The start I/O number in the common parame-
ters is different from that of the actually
mounted module.
– The station type of the CC-Link module count
setting parameters is different from that of the
actually mounted station.
 Collateral information
 Common Information: File name//Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR OFF Flicker Stop L26CPU-BT
3105 – Although two or more CC-Link modules were
configured in the Network Parameter dialog
box, only one CC-Link modules are installed
in the system. The start I/O number of the
common parameter specified in the Network
Parameter dialog box does not correspond to
the system.
– The station type specified in the Network
Parameter dialog box for CC-Link does not
correspond to the system.
 Collateral information
 Common Information: File name//Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR OFF Flicker Stop QnPRH (first 5
– CC-Link module whose station type is set to digits of serial
"master station (compatible with redundant No. is 09012 or
function)" is mounted on the extension base higher)
unit in the redundant system.
– CC-Link module whose station type is set to
"master station (extension base)" is mounted
on the main base unit in the redundant sys-
tem.
 Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 51


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
LINK PARA. ERROR Change the file register file for the one refreshen- OFF Flicker Stop Qn(H)
The CC-Link link refresh range exceeded the file abled in the whole range. (Function
register capacity. version is B or
 Collateral information later)
 Common Information: File name/Drive name QnPH
 Individual Information: Parameter No. QnPRH
 Diagnostic Timing QnU
When an END instruction executed LCPU
LINK PARA. ERROR Check the parameter setting. QCPU
The network refresh parameter for CC-Link is out LCPU
of range.
 Collateral information
 Common Information: File name
3106
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Set the network refresh range so that it does not QnU
The setting of the network refresh range crosses cross over the boundary between the internal LCPU
over the boundary between the internal user user device and the extended data register (D) or
device and the extended data register (D) or extended link register (W).
extended link register (W).
 Collateral information
 Common Information: File name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR Check the parameter setting. OFF Flicker Stop QCPU
– The CC-Link parameter setting is incorrect. LCPU
– The set mode is not allowed for the version of
the mounted CC-Link module.
3107  Collateral information
 Common Information: File name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN
LINK PARA. ERROR – Check the parameter setting. OFF Flicker Stop QnU
– When the CC-Link IE field network is used, the – Configure "Network Parameter" and "Switch (first five digits
network number set in "Network Parameter" Setting", and then write network parameters of the serial
and "Switch Setting" is duplicated. and the switch setting to the module. number is
– No "Network Parameter" and "Switch Setting" "12012" or
are configured, or the CC-Link IE field network higher)
3150 module with an incorrect switch setting is
mounted.
 Collateral information
 Common Information: File name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset
SFC PARA. ERROR Read the common information of the error using OFF Flicker Stop Q00J/Q00/Q01
The parameter setting is illegal. the programming tool, check error step corre- (Function
Though Block 0 was set to "Automatic start" in sponding to its numerical value (program error version is B or
the SFC setting of the PLC parameter dialog box, location), and correct the problem. later)
Block 0 does not exist. QnPH
3200  Collateral information QnPRH
 Common Information: File name QnU
 Individual Information: Parameter No. LCPU
 Diagnostic Timing
STOP → RUN
SFC PARA. ERROR OFF Flicker Stop Qn(H)
The block parameter setting is illegal. QnPH
 Collateral information QnPRH
3201  Common Information: File name
 Individual Information: Parameter No.
 Diagnostic Timing
STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

13 – 52
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SFC PARA. ERROR Read the individual information of the error OFF Flicker Stop Qn(H)
The number of step relays specified in the device using the programming tool, check error step QnPH
setting of the PLC parameter dialog box is less corresponding to its numerical value (program QnPRH
than that used in the program. error location), and correct the problem.
3202  Collateral information
 Common Information: File name
 Individual Information: Parameter No.
 Diagnostic Timing
STOP → RUN
SFC PARA. ERROR Read the individual information of the error OFF Flicker Stop Qn(H)
The execution type of the SFC program specified using the programming tool, check error step QnPH
in the program setting of the PLC parameter dia- corresponding to its numerical value (program QnPRH
log box is other than scan execution. error location), and correct the problem.
QnU
 Collateral information
LCPU
 Common Information: File name
3203
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset/STOP → RUN (The diag-
nostic timing of CPU modules except for Univer-
sal QCPU can be performed only when switching
the CPU modules to run.)
SP. PARA. ERROR Check the parameter setting. OFF Flicker Stop QCPU
The start I/O number in the intelligent function LCPU
module parameter set on GX Configurator differs
from the actual I/O number.
 Collateral information
3300  Common Information: File name
 Individual Information: Parameter No. (gained
by dividing the head I/O number of parameter
in the intelligent function module set by GX
Configurator by 10H)
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 53


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SP. PARA. ERROR – Change the file register file for the one which OFF Flicker Stop Q00J/Q00/Q01
– The refresh setting of the intelligent function allows refresh in the whole range. Qn(H)
module exceeded the file register capacity. – Check the parameter setting. (Function
– The intelligent function module set in GX Con- version is B or
figurator differs from the actually mounted later)
module. QnPH
 Collateral information QnPRH
 Common Information: File name QnU
 Individual Information: Parameter No. (gained LCPU
by dividing the head I/O number of parameter
in the intelligent function module set by GX
Configurator by 10H)
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
SP. PARA. ERROR – Check the parameter setting. OFF Flicker Stop QCPU
The intelligent function module's refresh param- – Check the auto refresh setting. LCPU
eter setting is outside the available range.
 Collateral information
 Common Information: File name
3301  Individual Information: Parameter No. (gained
by dividing the head I/O number of parameter
in the intelligent function module set by GX
Configurator by 10H)
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
SP. PARA. ERROR Set the refresh parameter range so that it does OFF Flicker Stop QnU
The setting of the refresh parameter range not cross over the boundary between the internal LCPU
crosses over the boundary between the internal user device and the extended data register (D) or
user device and the extended data register (D) or extended link register (W).
extended link register (W).
 Collateral information
 Common Information: File name
 Individual Information: Parameter No. (gained
by dividing the head I/O number of parameter
in the intelligent function module set by GX
Configurator by 10H)
 Diagnostic Timing
At power ON/At reset/STOP → RUN/At writing to
programmable controller
SP. PARA. ERROR Check the parameter setting. OFF Flicker Stop QCPU
The intelligent function module's refresh param- LCPU
eter are abnormal.
 Collateral information
 Common Information: File name
3302  Individual Information: Parameter No. (gained
by dividing the head I/O number of parameter
in the intelligent function module set by GX
Configurator by 10H)
 Diagnostic Timing
At writing to programmable controller
SP. PARA. ERROR – Delete the automatic refresh setting or other OFF Flicker Stop Q00J/Q00/Q01
In a multiple CPU system, the automatic refresh parameter setting of the intelligent function (Function
setting or other parameter setting was made to module under control of another CPU. version is B or
the intelligent function module under control of – Change the setting to the automatic refresh later)
another station. setting or other parameter setting of the intel- Qn(H)
ligent function module under control of the (Function
3303  Collateral information host CPU.
 Common Information: File name/Drive name version is B or
later)
 Individual Information: Parameter No.
QnPH
 Diagnostic Timing
QnU (except
At power ON/At reset/STOP → RUN/At writing to Q00UJCPU)
programmable controller

Tab. 13-3: Error code list (3000 to 3999)

13 – 54
Error Codes Error code list (3000 to 3999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
REMOTE PASS. ERROR Change the head I/O number of the target mod- OFF Flicker Stop Qn(H)
The head I/O number of the target module of the ule to be within the 0H to 0FF0H range. (Function
remote password is set to other than 0H to version is B or
0FF0H. later)
 Collateral information QnPH
 Common Information: — QnPRH
 Individual Information: — QnU (first 5
 Diagnostic Timing digits of serial
No. is 09012 or
At power ON/At reset/STOP → RUN
higher)
LCPU
REMOTE PASS. ERROR Change the head I/O number of the target mod- Q02U
The head I/O number of the target module of the ule to be within the 0H to 07E0H range.
remote password is set to other than 0H to
07E0H.
3400  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
REMOTE PASS. ERROR Change the head I/O number of the target mod- Q00J/Q00/Q01
The head I/O number of the target module of the ule of the remote password for the number (Function
remote password is outside the following range: within the following range: version is B or
 Q00JCPU: 0H to 1E0H – Q00JCPU: 0H to 1E0H later)
 Q00CPU/Q01CPU: 0H to 3E0H – Q00CPU/Q01CPU: 0H to 3E0H
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

Programming MELSEC System Q and L series 13 – 55


Error code list (3000 to 3999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
REMOTE PASS. ERROR Mount serial communication module, modem OFF Flicker Stop Qn(H)
Position specified as the head I/O number of the interface module or Ethernet module of function (Function
remote password file is incorrect due to one of version B or later in the position specified in the version is B or
the following reasons: head I/O No. of the remote password file. later)
– Module is not loaded. QnPH
– Other than a the intelligent function module (I/ QnPRH
O module) QnU
– Intelligent function module other than serial
communication module, modem interface
module or Ethernet module
– Serial communication module or Ethernet
module of function version A
– The intelligent function module where remote
password is available is not mounted.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
REMOTE PASS. ERROR In a position specified with a start I/O number of OFF Flicker Stop LCPU
Position specified as the head I/O number of the the remote password, install the intelligent func-
remote password file is incorrect due to one of tion module where the remote password is avail-
the following reasons: able.
– No module
– The intelligent function module installed is
other than a serial communication module.
 Collateral information
 Common Information: —
3401
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
REMOTE PASS. ERROR Mount serial communication module, modem OFF Flicker Stop Q00J/Q00/Q01
Any of the following modules is not mounted on interface module or Ethernet module of function (Function
the slot specified for the head I/O number of the version B or later in the position specified in the version is B or
remote password: head I/O No. of the remote password file. later)
– Serial communication module of function ver-
sion B or later
– Ethernet module of function version B or later
– Modem interface module of function version
B or later
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
REMOTE PASS. ERROR – Change it for the Ethernet module of function OFF Flicker Stop Qn(H)
Serial communication module, modem interface version B or later connected by the host CPU. (Function
module or Ethernet module of function version B – Delete the remote password setting. version is B or
or later controlled by another CPU was specified later)
in a multiple CPU system. QnPH
 Collateral information QnU (except
 Common Information: — Q00UJCPU)
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-3: Error code list (3000 to 3999)

13 – 56
Error Codes Error code list (4000 to 4999)

13.5 Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
INSTRCT CODE. ERR. Read the common information of the error using OFF Flicker Stop QCPU
– The program contains an instruction code the programming tool, check error step corre- LCPU
that cannot be decoded. sponding to its numerical value (program error
– An unusable instruction is included in the pro- location), and correct the problem.
gram.
4000  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN/
When instruction executed
INSTRCT CODE. ERR. Read the common information of the error using OFF Flicker Stop Q00J/Q00/Q01
The program contains a dedicated instruction for the programming tool, check error step corre- (Function
SFC although it is not an SFC program. sponding to its numerical value (program error version is B or
 Collateral information location), and correct the problem. later)
4001  Common Information: Program error location Qn(H)
 Individual Information: — QnPH
 Diagnostic Timing QnPRH
At power ON/At reset/STOP → RUN/ QnU
When instruction executed LCPU
INSTRCT CODE. ERR. Read the common information of the error using OFF Flicker Stop QCPU
– The name of dedicated instruction specified the programming tool, check error step corre- LCPU
by the program is incorrect. sponding to its numerical value (program error
– The dedicated instruction specified by the location), and correct the problem.
program cannot be executed by the specified
module.
4002  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN/
When instruction executed
INSTRCT CODE. ERR. Read the common information of the error using OFF Flicker Stop QCPU
The number of devices for the dedicated instruc- the programming tool, check error step corre- LCPU
tion specified by the program is incorrect. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4003  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN/
When instruction executed
INSTRCT CODE. ERR. Read the common information of the error using OFF Flicker Stop QCPU
The device which cannot be used by the dedi- the programming tool, check error step corre- LCPU
cated instruction specified by the program is sponding to its numerical value (program error
specified. location), and correct the problem.
 Collateral information
4004  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN/
When instruction executed
MISSING END INS. Read the common information of the error using OFF Flicker Stop QCPU
There is no END (FEND) instruction in the pro- the programming tool, check error step corre- LCPU
gram. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4010  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 57


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CAN’T SET (P) Read the common information of the error using OFF Flicker Stop Qn(H)
– The total points of the pointers used in the the programming tool, check error step corre- QnPH
program exceeded 4096 points. sponding to its numerical value (program error QnPRH
– The total points of the local pointers used in location), and correct the problem. QnU
the program exceeded the start number of the
common pointer. LCPU
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
4020
CAN’T SET (P) Q00UJ/Q00U/
– The total points of the pointers used in the Q01U
program exceeded 512 points.
– The total points of the local pointers used in
the program exceeded the start number of the
common pointer.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T SET (P) Read the common information of the error using OFF Flicker Stop QCPU
– The common pointer Nos. assigned to files the programming tool, check error step corre- LCPU
overlap. sponding to its numerical value (program error
– The local pointer Nos. assigned to files over- location), and correct the problem.
lap.
4021  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T SET (I) Read the common information of the error using OFF Flicker Stop QCPU
The allocation pointer Nos. assigned by files the programming tool, check error step corre- LCPU
overlap. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4030  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ QCPU
The instruction cannot process the contained the programming tool, check error step corre- ON Continue LCPU
data. sponding to its numerical value (program error (can be set
 Collateral information location), and correct the problem. in the
parameters
 Common Information: Program error location at error
 Individual Information: — occur-
 Diagnostic Timing rence)
When instruction executed
OPERATION ERROR – Take noise reduction measures. Qn(H)
Access error of ATA card or SD memory card – Reset and restart the CPU module. QnPH
occurs by SP.FREAD/SP.FWRITE instructions. When the same error is displayed again, the QnPRH
 Collateral information ATA card or SD memory card has hardware
QnU (except
4100  Common Information: Program error location
failure.
Contact your local Mitsubishi representative. Q00UJ-, Q00U-
 Individual Information: — and Q01UCPU)
 Diagnostic Timing
When instruction executed
OPERATION ERROR – Stop the file accessed with other functions to QnU (except
The file being accessed by other functions was execute SP.FWRITE instruction. Q00UJ-, Q00U-
accessed with SP.FWRITE instruction. – Stop the access with other functions and the and Q01UCPU)
 Collateral information SP.FWRITE instruction execution at the same LCPU
time.
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 58
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ QCPU
– The number of setting data dealt with the the programming tool, check error step corre- ON Continue LCPU
instruction exceeds the applicable range. sponding to its numerical value (program error (can be set
– The storage data and constant of the device location), and correct the problem. in the
specified by the instruction exceeds the appli- parameters
cable range. at error
– When writing to the host CPU shared mem- occur-
ory, the write prohibited area is specified for rence)
the write destination address.
– The range of storage data of the device speci-
fied by the instruction is duplicated.
– The device specified by the instruction
exceeds the range of the number of device
points.
– The interrupt pointer No. specified by the
instruction exceeds the applicable range.
– A link direct device, intelligent function mod-
ule device, or cyclic transmission area device
are specified for both (s) and (d) with the
BMOV instruction.
– There are no link direct devices (J\).
 Collateral information
 Common Information: Program error location
 Individual Information: —
4101  Diagnostic Timing
When instruction executed
OPERATION ERROR QnU (except
– The storage data of file register specified by Q00UJCPU)
the instruction exceeds the applicable range. LCPU
– Or, file register is not set.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR QnU
Block data that crosses over the boundary LCPU
between the internal user device and the
extended data register (D) or extended link regis-
ter is specified (including 32-bit binary, real
number (single precision, double precision),
indirect address, and control data).
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 59


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
OPERATION ERROR – Delete from the program the link direct device OFF/ON Flicker/ Stop/ Q00/Q01
In a multiple CPU system, the link direct device which specifies the network module under ON Continue (Function
(J\), was specified for the network module control of another CPU. (can be set version is B or
under control of another station. – Using the link direct device (J\), specify in the later)
the network module under control of the host parameters Qn(H)
 Collateral information
CPU. at error (Function
 Common Information: Program error location occur- version is B or
 Individual Information: — rence) later)
 Diagnostic Timing QnPH
When instruction executed QnU (except
Q00UJCPU)
OPERATION ERROR Read the common information of the error using QCPU
– The network No. or station No. specified for the programming tool, check error step corre-
the dedicated instruction is wrong. sponding to its numerical value (program error
– The link direct device (J\) setting is incor- location), and correct the problem.
rect.
– The module No./ network No./number of
character strings exceeds the range that can
be specified.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
4102
When instruction executed
OPERATION ERROR LCPU
– The module number specified with a dedi-
cated instruction is incorrect.
– The module number, network number, or the
number of character strings specified with a
dedicated instruction exceeded the allowable
range.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using QnU
The specification of character string (" ") speci- the programming tool, check error step corre- LCPU
fied by dedicated instruction cannot be used for sponding to its numerical value (program error
the character string. location), and correct the problem.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ Q00J/Q00/Q01
The configuration of the PID dedicated instruc- the programming tool, check error step corre- ON Continue (Function
tion is incorrect. sponding to its numerical value (program error (can be set version is B or
 Collateral information location), and correct the problem. in the later)
4103 parameters Qn(H)
 Common Information: Program error location at error
 Individual Information: — QnPRH
occur-
 Diagnostic Timing rence) QnU
When instruction executed LCPU
OPERATION ERROR – Delete the program memory check setting. OFF/ON Flicker/ Stop/ QnPH (first 5
PLOADP/PUNLOADP/PSWAPP instructions were – When using the program memory check, ON Continue digits of serial
executed while setting program memory check. delete PLOADP/PUNLOADP/PSWAPP instruc- (can be set No. is 07032 or
 Collateral information tions. in the higher)
4105 parameters
 Common Information: Program error location at error
 Individual Information: — occur-
 Diagnostic Timing rence)
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 60
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
OPERATION ERROR Using the multiple CPU dedicated instruction OFF/ON Flicker/ Stop/ Q00/Q01
33 or more multiple CPU dedicated instructions completion bit, provide interlocks to prevent one ON Continue (Function
were executed from one CPU module. CPU module from executing 33 or more multiple (can be set version is B or
 Collateral information CPU dedicated instructions. in the later)
parameters Qn(H)
 Common Information: Program error location at error
4107 (Function
 Individual Information: — occur- version is B or
 Diagnostic Timing rence) later)
When instruction executed QnPH
Q00U/Q01U/
Q02U
OPERATION ERROR Delete the high-speed interrupt setting. When OFF/ON Flicker/ Stop/ Qn(H) (first 5
With high speed interrupt setting PR, PRC, using high-speed interrupt, delete the PR, PRC, ON Continue digits of serial
UDCNT1, UDCNT2, PLSY or PWM instruction is UDCNT1, UDCNT2, PLSY and PWM instructions. (can be set No. is 04012 or
executed. in the higher)
 Collateral information parameters
4109 at error
 Common Information: Program error location occur-
 Individual Information: — rence)
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ Q00/Q01
An attempt was made to perform write/read to/ the programming tool, check error step corre- ON Continue (Function
from the CPU shared memory write/read disa- sponding to its numerical value (program error (can be set version is B or
bled area of the host station CPU module with location), and correct the problem. in the later)
the instruction. parameters QnU
4111 at error
 Collateral information occur-
 Common Information: Program error location rence)
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ Q00/Q01
A CPU module that cannot be specified with the the programming tool, check error step corre- ON Continue (Function
multiple CPU dedicated instruction was speci- sponding to its numerical value (program error (can be set version is B or
fied. location), and correct the problem. in the later)
 Collateral information parameters QnU (except
4112 at error
 Common Information: Program error location Q00UJCPU)
occur-
 Individual Information: — rence)
 Diagnostic Timing
When instruction executed
OPERATION ERROR – Check that the number of execution of the OFF/ON Flicker/ Stop/ QnU
– When the SP.DEVST instruction is executed, SP.DEVST instruction is proper. ON Continue LCPU
the number of writing to the standard ROM of – Execute the SP.DEVST instruction again the (can be set
the day exceeds the value specified by SD695. following day or later day. Or, arrange the in the
– A value outside the specified range is set to value of SD695. parameters
SD695. – Correct the value of SD695 so that it does not at error
4113 occur-
 Collateral information exceed the range.
rence)
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR – Enable the built-in I/O function with parame- OFF/ON Flicker/ Stop/ LCPU
A built-in I/O instruction that is disabled with a ters. ON Continue
parameter was executed. – Prohibit executions of a built-in I/O instruc-
 Collateral information tion that is disabled with a parameter.
4116  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR To execute control system switching by the SP. OFF/ON Flicker/ Stop/ QnPRH
Since the manual system switching enable flag CONTSW instruction, turn ON the manual sys- ON Continue
(special register SM1592) is OFF, manual system tem switching enable flag (special register (can be set
switching cannot be executed by the control sys- SM1592). in the
tem switching instruction (SP. CONTSW). parameters
4120  Collateral information at error
occur-
 Common Information: Program error location rence)
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 61


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
OPERATION ERROR – Reexamine the interlock signal for the OFF/ON Flicker/ Stop/ QnPRH
– In the separate mode, the control system SP.CONTSW instruction, and make sure that ON Continue
switching instruction (SP. CONTSW) was exe- the SP.CONTSW instruction is executed in the (can be set
cuted in the standby system CPU module. control system only. (Since the SP. CONTSW in the
– In the debug mode, the control system instruction cannot be executed in the standby parameters
switching instruction (SP. CONTSW) was exe- system, it is recommended to provide an at error
4121 cuted. interlock using the operation mode signal or occur-
like. Refer to the manual of the redundant sys- rence)
 Collateral information tem).
 Common Information: Program error location – As the SP. CONTSW instruction cannot be
 Individual Information: — executed in the debug mode, reexamine the
 Diagnostic Timing interlock signal related to the operation mode.
When instruction executed
OPERATION ERROR – Delete the dedicated instruction for the mod- OFF/ON Flicker/ Stop/ QnPRH (first 5
– The dedicated instruction was executed to the ule mounted on the extension base unit. ON Continue digits of serial
module mounted on the extension base unit – Delete the instruction for accessing the intelli- (can be set No. is 09012 or
in the redundant system. gent function module mounted on the exten- in the higher)
– The instruction for accessing the intelligent sion base unit from the standby system. parameters
function module mounted on the extension at error
base unit from the standby system at separate occur-
4122 rence)
mode was executed.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
OPERATION ERROR Target comment file has to be other than the OFF/ON Flicker/ Stop/ Qn(H) (first 5
Instructions to read SFC step comment comment file in ATA card. ON Continue digits of serial
(S(P).SFCSCOMR) and SFC transition condition (can be set No. is 07012 or
comment (S(P).SFCTCOMR) are executed for in the higher)
the comment file in ATA card. parameters QnPH (first 5
4130 at error digits of serial
 Collateral information
occur- No. is 07032 or
 Common Information: Program error location rence) higher)
 Individual Information: —
QnPRH
 Diagnostic Timing
When instruction executed
OPERATION ERROR – Check the SFC program specified by the OFF/ON Flicker/ Stop/ QnU
The SFC program is started up by an instruction instruction. ON Continue LCPU
while another SFC program has not yet been – Or, check the executing status of the SFC pro- (can be set
completed. gram. in the
 Collateral information parameters
4131 at error
 Common Information: Program error location occur-
 Individual Information: — rence)
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ QnU
Operation with non-allowed input data ("-0", the programming tool, check error step corre- ON Continue LCPU
unnormalized number, nonnumeric, ) is per- sponding to its numerical value (program error (can be set
formed. location), and correct the problem. in the
parameters
4140  Collateral information at error
 Common Information: Program error location occur-
 Individual Information: — rence)
 Diagnostic Timing
When instruction executed
OPERATION ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ QnU
Overflow occurs at operation. the programming tool, check error step corre- ON Continue LCPU
 Collateral information sponding to its numerical value (program error (can be set
in the
4141  Common Information: Program error location location), and correct the problem.
parameters
 Individual Information: — at error
 Diagnostic Timing occur-
When instruction executed rence)
FOR NEXT ERROR Read the common information of the error using OFF Flicker Stop QCPU
No NEXT instruction was executed following the the programming tool, check error step corre- LCPU
execution of a FOR instruction. sponding to its numerical value (program error
Alternatively, there are fewer NEXT instructions location), and correct the problem.
than FOR instructions.
4200  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 62
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
FOR NEXT ERROR Read the common information of the error using OFF Flicker Stop QCPU
A NEXT instruction was executed although no the programming tool, check error step corre- LCPU
FOR instruction has been executed. sponding to its numerical value (program error
Alternatively, there are more NEXT instructions location), and correct the problem.
than FOR instructions.
4201  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
FOR NEXT ERROR Keep nesting levels at 16 or under. OFF Flicker Stop QCPU
More than 16 nesting levels are programmed. LCPU
 Collateral information
4202  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
FOR NEXT ERROR Read the common information of the error using OFF Flicker Stop QCPU
A BREAK instruction was executed although no the programming tool, check error step corre- LCPU
FOR instruction has been executed prior to that. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4203  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (P) Read the common information of the error using OFF Flicker Stop QCPU
The CALL instruction is executed, but there is no the programming tool, check error step corre- LCPU
subroutine at the specified pointer. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4210  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (P) Read the common information of the error using OFF Flicker Stop QCPU
There was no RET instruction in the executed the programming tool, check error step corre- LCPU
subroutine program. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4211  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (P) Read the common information of the error using OFF Flicker Stop QCPU
The RET instruction exists before the FEND the programming tool, check error step corre- LCPU
instruction of the main routine program. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4212  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (P) Keep nesting levels at 16 or under. OFF Flicker Stop QCPU
More than 16 nesting levels are programmed. LCPU
 Collateral information
4213  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (I) Read the common information of the error using OFF Flicker Stop QCPU
Though an interrupt input occurred, the corre- the programming tool, check error step corre- LCPU
sponding interrupt pointer does not exist. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4220  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 63


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CAN’T EXECUTE (I) Read the common information of the error using OFF Flicker Stop QCPU
An IRET instruction does not exist in the exe- the programming tool, check error step corre- LCPU
cuted interrupt program. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4221  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (I) Read the common information of the error using OFF Flicker Stop QCPU
The IRET instruction exists before the FEND the programming tool, check error step corre- LCPU
instruction of the main routine program. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
4223 CAN’T EXECUTE (I)
– The IRET instruction was executed in the fixed
scan execution type program.
– The STOP instruction was executed in the
fixed scan execution type program.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
CAN’T EXECUTE (I) Delete the setting of interrupt pointer for the OFF Flicker Stop QnPRH (first 5
The interrupt pointer for the module mounted on module mounted on the extension base unit, digits of serial
the extension base unit is set in the redundant since it cannot be used. No. is 09012 or
system. higher)
4225  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
INST. FORMAT ERR Read the common information of the error using OFF Flicker Stop Qn(H)
The number of CHK and CHKEND instructions is the programming tool, check error step corre- QnPH
not equal. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4230  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
INST. FORMAT ERR Read the common information of the error using OFF Flicker Stop QCPU
The number of IX and IXEND instructions is not the programming tool, check error step corre-
equal. sponding to its numerical value (program error
 Collateral information location), and correct the problem.
4231  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
INST. FORMAT ERR Read the common information of the error using OFF Flicker Stop Qn(H)
The configuration of the check conditions for the the programming tool, check error step corre- QnPH
CHK instruction is incorrect. sponding to its numerical value (program error
Alternatively, a CHK instruction has been used in location), and correct the problem.
a low speed execution type program.
4235  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 64
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
– The multiple CPU high-speed transmission the programming tool, check error step corre- Q00UJ-, Q00U-,
dedicated instruction used in the program sponding to its numerical value (program error Q01U- and
specifies the wrong CPU module. Or, the set- location), and correct the problem. Q02UCPU)
ting in the CPU module is incompatible with
the multiple CPU high-speed transmission
dedicated instruction.
– The reserved CPU is specified.
– The uninstalled CPU is specified.
– The head I/O number of the target CPU/16
(n1) is outside the range of 3EH to 3E3H.
– The CPU module where the instruction cannot
4350 be executed is specified.
– The instruction is executed in a single CPU
system.
– The host CPU is specified.
– The instruction is executed without setting the
"Use multiple CPU high speed communica-
tion".
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
– The multiple CPU high-speed transmission the programming tool, check error step corre- Q00UJ-, Q00U-,
dedicated instruction specified by the pro- sponding to its numerical value (program error Q01U- and
gram cannot be executed to the specified tar- location), and correct the problem. Q02UCPU)
get CPU module.
– The instruction name is wrong.
4351 – The instruction unsupported by the target
CPU module is specified.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
The number of devices for the multiple CPU the programming tool, check error step corre- Q00UJ-, Q00U-,
highspeed transmission dedicated instruction sponding to its numerical value (program error Q01U- and
specified by the program is wrong. location), and correct the problem. Q02UCPU)
4352  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
The device which cannot be used for the multiple the programming tool, check error step corre- Q00UJ-, Q00U-,
CPU high-speed transmission dedicated instruc- sponding to its numerical value (program error Q01U- and
tion specified by the program is specified. location), and correct the problem. Q02UCPU)
4353  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
The character string which cannot be handled by the programming tool, check error step corre- Q00UJ-, Q00U-,
the multiple CPU high-speed transmission dedi- sponding to its numerical value (program error Q01U- and
cated instruction is specified. location), and correct the problem. Q02UCPU)
4354  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 65


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
MULTI-COM.ERROR Read the common information of the error using OFF Flicker Stop QnU (except
The number of read/write data (number of the programming tool, check error step corre- Q00UJ-, Q00U-,
request/receive data) for the multiple CPU high- sponding to its numerical value (program error Q01U- and
speed transmission dedicated instruction speci- location), and correct the problem. Q02UCPU)
fied by the program is not valid.
4355  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
SFCP. CODE ERROR Write the program to the CPU module again OFF Flicker Stop Qn(H)
No SFCP or SFCPEND instruction in SFC pro- using the programming tool. QnPH
gram. QnPRH
 Collateral information
4400  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
STOP → RUN
CAN’T SET (BL) Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
The block number designated by the SFC pro- using the programming tool. (Function
gram exceeds the range. version is B or
 Collateral information later)
4410  Common Information: Program error location Qn(H)
 Individual Information: — QnPRH
 Diagnostic Timing QnU
At power ON/At reset/STOP → RUN
CAN’T SET (BL) Write the program to the CPU module again OFF Flicker Stop
Block number designations overlap in SFC pro- using the programming tool.
gram.
 Collateral information
4411  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T SET (S) Write the program to the CPU module again OFF Flicker Stop
A step number designated in an SFC program using the programming tool.
exceeds the range.
 Collateral information
4420  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
CAN’T SET (S) Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
Total number of steps in all SFC programs using the programming tool. (Function
exceed the maximum. version is B or
 Collateral information later)
 Common Information: Program error location Qn(H)
 Individual Information: — QnPRH
4421  Diagnostic Timing QnU
At power ON/At reset/STOP → RUN LCPU
Increase the total number of step relays in the QnU (first five
Device tab of the PLC Parameter dialog box. digits of the
serial number is
12052 or
higher)
CAN’T SET (S) Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
Step number designations overlap in SFC pro- using the programming tool. (Function
gram. version is B or
 Collateral information later)
4422  Common Information: Program error location Qn(H)
 Individual Information: — QnPRH
 Diagnostic Timing QnU
At power ON/At reset/STOP → RUN LCPU

Tab. 13-4: Error code list (4000 to 4999)

13 – 66
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CAN’T SET (S) Correct the total number of step relays so that it OFF Flicker Stop Q00J/Q00/Q01
The total number of (maximum step No.+1) of does not exceed the total number of (maximum (Function
each block exceeds the total number of step step No.+1) of each block. version is B or
relays. later)
 Collateral information QnU
4423  Common Information: Program error location LCPU
 Individual Information: — Increase the total number of step relays in the QnU (first five
 Diagnostic Timing Device tab of the PLC Parameter dialog box. digits of the
At power ON/At reset/STOP → RUN serial number is
12052 or
higher)
SFC EXE. ERROR – Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
The SFC program cannot be executed. using the programming tool. (Function
– The data of the block data setting is illegal. – After correcting the setting of the SFC data version is B or
– The SFC data device of the block data setting device, write it to the CPU module. later)
is beyond the device setting range set in the – After correcting the device setting range set in QnU
4430 PLC parameter. the PLC parameter, write it to the CPU mod- LCPU
 Collateral information ule.
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
STOP → RUN
SFC EXE. ERROR Write the program to the CPU module again OFF Flicker Stop
The SFC program cannot be executed. using the programming tool.
– The block parameter setting is abnormal.
 Collateral information
4431
 Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
SFC EXE. ERROR Write the program to the CPU module again OFF Flicker Stop
The SFC program cannot be executed. using the programming tool.
The structure of the SFC program is illegal.
 Collateral information
4432  Common Information: File name/Drive name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/STOP → RUN
SFCP. FORMAT ERR. Write the program to the CPU module again OFF Flicker Stop Qn(H)
The numbers of BLOCK and BEND instructions in using the programming tool. QnPH
an SFC program are not equal. QnPRH
 Collateral information
4500  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
STOP → RUN
SFCP. FORMAT ERR. Write the program to the CPU module again OFF Flicker Stop Qn(H)
The configuration of the STEP* to TRAN* to using the programming tool. QnPH
TSET to SEND instructions in the SFC program is QnPRH
incorrect. LCPU
4501  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
STOP → RUN
SFCP. FORMAT ERR. Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
The structure of the SFC program is illegal. using the programming tool. (Function
STEPI* instruction does not exist in the block of version is B or
the SFC program. later)
4502  Collateral information Qn(H)
 Common Information: Program error location QnPRH
 Individual Information: — QnU
 Diagnostic Timing LCPU
STOP → RUN

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 67


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SFCP. FORMAT ERR. – Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
The structure of the SFC program is illegal: using the programming tool. (Function
– The step specified in the TSET instruction – Read the common information of the error version is B or
does not exist. using the programming tool, check error step later)
– In jump transition, the host step number was corresponding to its numerical value (pro- Qn(H)
specified as the destination step number. gram error location), and correct the problem.
QnPRH
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
4503 STOP → RUN
SFCP. FORMAT ERR. QnU
The structure of the SFC program is illegal: LCPU
– The step specified in the TSET instruction
does not exist.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When SFC program is executed
SFCP. FORMAT ERR. Write the program to the CPU module again OFF Flicker Stop Q00J/Q00/Q01
The structure of the SFC program is illegal. using the programming tool. (Function
The step specified in the TAND instruction does version is B or
not exist. later)
4504  Collateral information Qn(H)
 Common Information: Program error location QnPRH
 Individual Information: — QnU
 Diagnostic Timing LCPU
When SFC program is executed
SFCP. FORMAT ERR. Read the common information of the error using OFF Flicker Stop Q00J/Q00/Q01
The structure of the SFC program is illegal. the programming tool, check error step corre- (Function
In the operation output of a step, the SET Sn/ sponding to its numerical value (program error version is B or
BLmSn or RST Sn/BLmSn instruction was speci- location), and correct the problem. later)
fied for the host step. QnU
4505  Collateral information LCPU
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction is executed
SFCP. FORMAT ERR. Read the common information of the error using OFF Flicker Stop
The structure of the SFC program is illegal. the programming tool, check error step corre-
In a reset step, the host step number was speci- sponding to its numerical value (program error
fied as the destination step. location), and correct the problem.
4506  Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction is executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 68
Error Codes Error code list (4000 to 4999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
SFCP. OPE. ERROR Read the common information of the error using OFF/ON Flicker/ Stop/ Qn(H)
The SFC program contains data that cannot be the programming tool, check error step corre- ON Continue QnPH
processed. sponding to its numerical value (program error (can be set QnPRH
 Collateral information location), and correct the problem. in the
4600 parameters
 Common Information: Program error location at error
 Individual Information: — occur-
 Diagnostic Timing rence)
When instruction executed
SFCP. OPE. ERROR Read the common information of the error using OFF/ON Flicker/ Stop/
Exceeds device range that can be designated by the programming tool, check error step corre- ON Continue
the SFC program. sponding to its numerical value (program error (can be set
 Collateral information location), and correct the problem. in the
4601 parameters
 Common Information: Program error location at error
 Individual Information: — occur-
 Diagnostic Timing rence)
When instruction executed
SFCP. OPE. ERROR Read the common information of the error using OFF/ON Flicker/ Stop/
The START instruction in an SFC program is pre- the programming tool, check error step corre- ON Continue
ceded by an END instruction. sponding to its numerical value (program error (can be set
 Collateral information location), and correct the problem. in the
4602 parameters
 Common Information: Program error location at error
 Individual Information: — occur-
 Diagnostic Timing rence)
When instruction executed
SFCP. EXE. ERROR Read the common information of the error using ON ON Continue Qn(H)
the programming tool, check error step corre-
The active step information at presumptive start QnPH
of the SFC program is incorrect. sponding to its numerical value (program error QnPRH
 Collateral information location), and correct the problem.
4610  Common Information: Program error location The program is automatically subjected to an ini-
 Individual Information: — tial start.
 Diagnostic Timing
STOP → RUN
SFCP. EXE. ERROR Read the common information of the error using ON ON Continue Qn(H)
Key-switch was reset during RUN when pre- the programming tool, check error step corre- QnPH
sumptive start was designated for SFC program. sponding to its numerical value (program error QnPRH
 Collateral information location), and correct the problem.
4611  Common Information: Program error location The program is automatically subjected to an ini-
 Individual Information: — tial start.
 Diagnostic Timing
STOP → RUN
BLOCK EXE. ERROR Read the common information of the error using OFF Flicker Stop Qn(H)
Startup was executed at a block in the SFC pro- the programming tool, check error step corre- QnPH
gram that was already started up. sponding to its numerical value (program error QnPRH
 Collateral information location), and correct the problem.
QnU (first five
4620  Common Information: Program error location digits of the
 Individual Information: — serial number is
 Diagnostic Timing 12052 or
When instruction executed higher)
BLOCK EXE. ERROR – Read the common information of the error OFF Flicker Stop Q00J/Q00/Q01
Startup was attempted at a block that does not using the programming tool, check error step (Function
exist in the SFC program. corresponding to its numerical value (pro- version is B or
gram error location), and correct the problem. later)
 Collateral information
– Turn ON if the special relay SM321 is OFF. Qn(H)
4621  Common Information: Program error location
 Individual Information: — QnPH
 Diagnostic Timing QnPRH
When instruction executed QnU
LCPU
STEP EXE. ERROR Read the common information of the error using OFF Flicker Stop Qn(H)
Startup was executed at a block in the SFC pro- the programming tool, check error step corre- QnPH
gram that was already started up. sponding to its numerical value (program error QnPRH
 Collateral information location), and correct the problem.
4630  Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

Programming MELSEC System Q and L series 13 – 69


Error code list (4000 to 4999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
STEP EXE. ERROR – Read the common information of the error OFF Flicker Stop Q00J/Q00/Q01
– Startup was attempted at the step that does using the programming tool, check error step (Function
not exist in the SFC program. corresponding to its numerical value (pro- version is B or
Or, the step that does not exist in the SFC pro- gram error location), and correct the problem. later)
gram was specified for end. – Turn ON special relay SM321 if it is OFF. Qn(H)
– Forced transition was executed based on the QnPH
transition condition that does not exist in the
SFC program. QnPRH
4631 Or, the transition condition for forced transi- QnU
tion that does not exist in the SFC program LCPU
was cancelled.
 Collateral information
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
STEP EXE. ERROR Read the common information of the error using OFF Flicker Stop Qn(H)
There were too many simultaneous active steps the programming tool, check error step corre- QnPH
in blocks that can be designated by the SFC pro- sponding to its numerical value (program error QnPRH
gram. location), and correct the problem.
QnU
4632  Collateral information
LCPU
 Common Information: Program error location
 Individual Information: —
 Diagnostic Timing
When instruction executed
STEP EXE. ERROR Read the common information of the error using OFF Flicker Stop Qn(H)
There were too many simultaneous active steps the programming tool, check error step corre- QnPH
in all blocks that can be designated. sponding to its numerical value (program error QnPRH
 Collateral information location), and correct the problem.
QnU
4633  Common Information: Program error location LCPU
 Individual Information: —
 Diagnostic Timing
When instruction executed

Tab. 13-4: Error code list (4000 to 4999)

13 – 70
Error Codes Error code list (5000 to 5999)

13.6 Error code list (5000 to 5999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
WDT ERROR – Read the individual information of the error OFF Flicker Stop Qn(H)
The scan time of the initial execution type pro- from the programming tool, check its value QnPH
gram exceeded the initial execution monitoring (time), and shorten the scan time.
QnPRH
time specified in the PLC RAS setting of the PLC – Change the initial execution monitoring time QnU
parameter. or the WDT value in the PLC RAS setting of
 Collateral information the PLC parameter. LCPU
– Resolve the endless loop caused by jump
 Common Information: Time (value set) transition.
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always
WDT ERROR – Since power-off of the standby system OFF Flicker Stop QnPRH
5000 – The power supply of the standby system is increases the control system scan time, reset
turned OFF. the WDT value, taking the increase of the con-
– The tracking cable is disconnected or con- trol system scan time into consideration.
nected without turning off or resetting the – When the tracking cable is disconnected dur-
standby system. ing operation, securely connect it and restart
– The tracking cable is not secured by the con- the CPU module. If the same error is dis-
nector fixing screws. played again, the tracking cable or CPU mod-
ule has a hardware fault.
 Collateral information Contact your local Mitsubishi representative.
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always
WDT ERROR – Read the individual information of the error OFF Flicker Stop QCPU
The scan time of the program exceeded the WDT from the programming tool, check its value LCPU
value specified in the PLC RAS setting of the PLC (time), and shorten the scan time.
parameter. – Change the initial execution monitoring time
 Collateral information or the WDT value in the PLC RAS setting of
the PLC parameter.
 Common Information: Time (value set)
– Resolve the endless loop caused by jump
 Individual Information: Time (value actually transition.
measured)
 Diagnostic Timing
Always
WDT ERROR – Since power-off of the standby system OFF Flicker Stop QnPRH
5001 – The power supply of the standby system is increases the control system scan time, reset
turned OFF. the WDT value, taking the increase of the con-
– The tracking cable is disconnected or con- trol system scan time into consideration.
nected without turning off or resetting the – When the tracking cable is disconnected dur-
standby system. ing operation, securely connect it and restart
– The tracking cable is not secured by the con- the CPU module. If the same error is dis-
nector fixing screws. played again, the tracking cable or CPU mod-
ule has a hardware fault.
 Collateral information Contact your local Mitsubishi representative.
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always

Tab. 13-5: Error code list (5000 to 5999)

Programming MELSEC System Q and L series 13 – 71


Error code list (5000 to 5999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
PRG. TIME OVER – Review the constant scan setting time. ON ON Continue Qn(H)
The program scan time exceeded the constant – Review the constant scan setting time and QnPH
scan setting time specified in the PLC RAS set- low speed program execution time in the PLC QnPRH
ting of the PLC parameter. parameter so that the excess time of constant
scan can be fully secured. QnU
 Collateral information
LCPU
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always
PRG. TIME OVER Qn(H)
The low speed program execution time specified QnPH
in the PLC RAS setting of the PLC parameter QnPRH
exceeded the excess time of the constant scan.
 Collateral information
5010
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always
PRG. TIME OVER – Review the constant scan setting time in the Q00J/Q00/Q01
The program scan time exceeded the constant PLC parameter so that the excess time of con-
scan setting time specified in the PLC RAS set- stant scan can be fully secured.
ting of the PLC parameter.
 Collateral information
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always
PRG. TIME OVER – Read the individual information of the error ON ON Continue Qn(H)
The scan time of the low speed execution type using the programming tool, check the QnPH
program exceeded the low speed execution numerical value (time) there, and shorten
watch time specified in the PLC RAS setting of scan time if necessary.
the PLC parameter dialog box. – Change the low speed execution watch time in
the PLC RAS setting of the PLC parameter
5011  Collateral information dialog box.
 Common Information: Time (value set)
 Individual Information: Time (value actually
measured)
 Diagnostic Timing
Always

Tab. 13-5: Error code list (5000 to 5999)

13 – 72
Error Codes Error code list (6000 to 6999)

13.7 Error code list (6000 to 6999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
FILE DIFF. – Match the programs and parameters of the OFF Flicker Stop QnPRH
In a redundant system, the control system and control system and standby system.
standby system do not have the same programs – Verify the systems by either of the following
and parameters. procedures 1), 2) to clarify the differences
The file type detected as different between the between the files of the two systems, then
two systems can be checked by the file name of correct a wrong file, and execute "Write to
PLC" again.
the error common information.
1) After reading the programs/parameters of
System A using a programming tool, verify
– The program is different. them with those of System B.
(File name = ********.QPG)
2) Verify the programs/parameters saved in
– The PLC parameters/network parameters/ the offline environment with those written
redundant parameters are different. to the CPU modules of both systems.
(File name = PARAM.QPA)
– When the capacity of each write destination
– The remote password is different. within the CPU for online change of multiple
(File name = PARAM.QPA) program blocks is different between the two
– The intelligent function module parameters systems, take corrective action 1) or 2).
are different. 1) Using the memory copy from control sys-
6000 (File name = IPARAM.QPA) tem to standby system, copy the program
– The device initial values are different. memory from the control system to the
(File name = ********.QDI) standby system.
– The capacity of each write destination within 2) Format the CPU module program memo-
the CPU for online pchange of multiple pro- ries of both systems. (For the capacity of
gram blocks is different. each write destination within the CPU for
(File name = MBOC.QMB) online change of multiple program blocks,
(This can be detected from the standby sys- set the same value to both systems.)
tem of the redundant system.)
 Collateral information
 Common Information: File name
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/At changing to backup mode/At completion
of write during RUN/At Switching execution/At
switching both systems into RUN
FILE DIFF. Match the valid parameter drive settings (SW2, OFF Flicker Stop QnPRH
In a redundant system, the valid parameter drive SW3) by the DIP switches of the control system
settings (SW2, SW3) made by the DIP switches and standby system.
are not the same.
 Collateral information
6001  Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/At operation mode change
OPE. MODE DIFF. Synchronise the operation statuses of the con- ON ON Continue QnPRH
The operational status of the control system and trol system and standby system.
standby system in the redundant system is not
the same.
(This can be detected from the standby system
6010 of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
OPE. MODE DIFF. Set the RUN/STOP switches of the control sys- OFF Flicker Stop QnPRH
At power ON/reset, the RUN/STOP switch set- tem and standby system to the same setting.
tings of the control system and standby system
are not the same in a redundant system. (This
can be detected from the control system or
6020 standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset

Tab. 13-6: Error code list (6000 to 6999)

Programming MELSEC System Q and L series 13 – 73


Error code list (6000 to 6999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
UNIT LAY. DIFF. – Match the module configurations of the con- OFF Flicker Stop QnPRH
– In a redundant system, the module configura- trol system and standby system.
tion differs between the control system and – In the redundant setting of the network
standby system. parameter dialog box, match the mode setting
– The network module mode setting differs of System B to that of System A.
between the two systems.
(This can be detected from the control system or
6030 standby system of the redundant system.)
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/At operation mode change
UNIT LAY. DIFF. Match the model names of the control system OFF Flicker Stop QnPRH
In a redundant system, the CPU module model and standby system.
name differs between the control system and
standby system.
(This can be detected from the standby system
of the redundant system.)
6035  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/At operation mode change
UNIT LAY. DIFF. Check the network cables of the MELSECNET/H OFF Flicker Stop QnPRH
A difference in the remote I/O configuration of multiplexed remote I/O network for disconnec-
the MELSECNET/H multiplexed remote I/O net- tion.
work between the control system and standby
system of a redundant system was detected.
(This can be detected from the control system or
6036 standby system of the redundant system.)
 Collateral information
 Common Information: Module No.
 Individual Information: —
 Diagnostic Timing
Always
CARD TYPE DIFF. Match the memory card installation statuses OFF Flicker Stop QnPRH
In a redundant system, the memory card instal- (installed/not installed) of the control system and
lation status (installed/not installed) differs standby system.
between the control system and standby system.
6040  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
CARD TYPE DIFF. Match the memory card types of the control sys- OFF Flicker Stop QnPRH
In a redundant system, the memory card type tem and standby system.
differs between the control system and standby
system.
6041  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
CAN'T EXE. MODE. Execute the function in the debug mode or oper- ON ON Continue QnPRH
The function inexecutable in the debug mode or ation mode (backup/separate mode).
operation mode (backup/separate mode) was
executed.
(This can be detected from the control system or
6050 standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-6: Error code list (6000 to 6999)

13 – 74
Error Codes Error code list (6000 to 6999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CPU MODE DIFF. Match the operation modes of the control sys- OFF Flicker Stop QnPRH
In a redundant system, the operation mode tem and standby system.
(backup/separate) differs between the control
system and standby system.
(This can be detected from the standby system
of the redundant system.)
6060  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/
CPU MODE DIFF. Match the operation modes of the control sys- OFF Flicker Stop QnPRH
In a redundant system, the operation mode tem and standby system.
(backup/separate) differs between the control
system and standby system.
(This can be detected from the standby system
6061 of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
CPU MODE DIFF. Power the CPU module (System B) which OFF Flicker Stop QnPRH
Both System A and B are in the same system sta- resulted in a stop error, OFF and then ON.
tus (control system).
(This can be detected from the system B of the
redundant system.)
6062  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset/At tracking cable connec-
tion/
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– An error (e.g. retry limit exceeded) occurred the error still occurs, this indicates the CPU
in tracking data transmission. module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
6100 redundant system startup procedure was not
followed.
 Collateral information
 Common Information: Tracking transmission
data classification
 Individual Information: —
 Diagnostic Timing
Always
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– A timeout error occurred in tracking (data the error still occurs, this indicates the CPU
transmission). module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
redundant system startup procedure was not
followed.
6101
(This can be detected from the control system or
standby system of the redundant system.)
 Collateral information
 Common Information: Tracking transmission
data classification
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-6: Error code list (6000 to 6999)

Programming MELSEC System Q and L series 13 – 75


Error code list (6000 to 6999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
A data sum value error occurred in tracking (data the error still occurs, this indicates the CPU
reception). module or tracking cable is faulty.
(This can be detected from the control system or Contact your local Mitsubishi representative.
standby system of the redundant system.) – Confirm the redundant system startup proce-
6102 dure, and execute a startup again.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– A data error (other than sum value error) the error still occurs, this indicates the CPU
occurred in tracking (data reception). module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
redundant system startup procedure was not
6103 followed.
(This can be detected from the control system or
standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– An error (e.g. retry limit exceeded) occurred the error still occurs, this indicates the CPU
in tracking (data transmission). module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
redundant system startup procedure was not
6105 followed.
(This can be detected from the control system
or standby system of the redundant system.)
 Collateral information
 Common Information: Tracking transmission
data classification
 Individual Information: —
 Diagnostic Timing
Always
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– A timeout error occurred in tracking (data the error still occurs, this indicates the CPU
transmission). module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
redundant system startup procedure was not
followed.
6106
(This can be detected from the control system or
standby system of the redundant system.)
 Collateral information
 Common Information: Tracking transmission
data classification
 Individual Information: —
 Diagnostic Timing
Always
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
A data sum value error occurred in tracking (data the error still occurs, this indicates the CPU
reception). module or tracking cable is faulty.
(This can be detected from the control system or Contact your local Mitsubishi representative.
standby system of the redundant system.) – Confirm the redundant system startup proce-
6107 dure, and execute a startup again.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-6: Error code list (6000 to 6999)

13 – 76
Error Codes Error code list (6000 to 6999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
TRK. TRANS. ERR. – Check the CPU module or tracking cable. If ON ON Continue QnPRH
– A data error (other than sum value error) the error still occurs, this indicates the CPU
occurred in tracking (data reception). module or tracking cable is faulty.
(This error may be caused by tracking cable Contact your local Mitsubishi representative.
removal or other system power-off (including – Confirm the redundant system startup proce-
reset).) dure, and execute a startup again.
– The error occurred at a startup since the
redundant system startup procedure was not
6108 followed.
(This can be detected from the control system or
standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
TRK. SIZE ERROR Reexamine the tracking capacity. ON ON Continue QnPRH
The tracking capacity exceeded the allowed
range.
(This can be detected from the control system or
standby system of the redundant system.)
6110  Collateral information
 Common Information: Tracking capacity
excess error factor
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
TRK. SIZE ERROR Switch to the file registers of which capacity is ON ON Continue QnPRH
The control system does not have enough file greater than the file registers specified in the
register capacity for the file registers specified in tracking settings.
the tracking settings.
(This can be detected from the control system or
6111 standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
TRK. SIZE ERROR Switch to the file registers of which capacity is ON ON Continue QnPRH
File registers greater than those of the standby greater than the file registers specified in the
system were tracked and transmitted from the tracking settings.
control system.
(This can be detected from the standby system
6112 of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
When an END instruction executed
TRK. CABLE ERR. Make a start after connecting the tracking cable. OFF Flicker Stop QnPRH
– A start was made without the tracking cable If the same error still occurs, this indicates the
being connected. tracking cable or CPU module side tracking
– A start was made with the tracking cable transmission hardware is faulty.
faulty. Contact your local Mitsubishi representative.
– As the tracking hardware on the CPU module
side was faulty, communication with the other
system could not be made via the tracking
6120 cable.
(This can be detected from the control system or
standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset

Tab. 13-6: Error code list (6000 to 6999)

Programming MELSEC System Q and L series 13 – 77


Error code list (6000 to 6999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
TRK. DISCONNECT – If the tracking cable was removed, connect ON ON Continue QnPRH
– The tracking cable was removed. the tracking cable to the connectors of the
– The tracking cable became faulty while the CPU modules of the two systems.
CPU module is running. – When the error is not resolved after connect-
– The CPU module side tracking hardware ing the tracking cable to the connectors of the
became faulty. CPU modules of the two systems and reset-
ting the error, the tracking cable or CPU mod-
6130 (This can be detected from the control system or ule side tracking hardware is faulty.
standby system of the redundant system.) Contact your local Mitsubishi representative.
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always
TRK.INIT. ERROR – Power the corresponding CPU module OFF OFF Flicker Stop QnPRH
– The other system did not respond during ini- and then ON again, or reset it and then unre-
tial communication at power ON/reset. set. If the same error still occurs, this indi-
– The error occurred at a startup since the cates the CPU module is faulty.
redundant system startup procedure was not Contact your local Mitsubishi representative.
followed. – Confirm the redundant system startup proce-
(This can be detected from the control system or dure, and execute a startup again.
6140
standby system of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
CONTROL EXE. — ON OFF No error QnPRH
The standby system has been switched to the
control system in a redundant system. (Detected
by the CPU that was switched from the standby
system to the control system).
Since this error code does not indicate the error
information of the CPU module but indicates its
status, the error code and error information are
not stored into SD0 to SD26, but are stored into
6200 the error log every system switching. (Check the
error information by reading the error log using
the programming tool.)
 Collateral information
 Common Information: Reason(s) for system
switching
 Individual Information: —
 Diagnostic Timing
Always
STANDBY — ON OFF No error QnPRH
The control system has been switched to the
standby system in a redundant system.
(Detected by the CPU that was switched from the
standby system to the control system).
Since this error code does not indicate the error
information of the CPU module but indicates its
status, the error code and error information are
not stored into SD0 to SD26, but are stored into
6210 the error log every system switching. (Check the
error information by reading the error log using
the programming tool.)
 Collateral information
 Common Information: Reason(s) for system
switching
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-6: Error code list (6000 to 6999)

13 – 78
Error Codes Error code list (6000 to 6999)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CAN'T SWITCH – Check the status of the standby system and ON ON No error QnPRH
System switching cannot be executed due to resolve the error.
standby system error/ tracking cable error/ – Complete the online module change.
online module change in execution at separate
mode.
Causes for switching system at control system
are as follows:
– System switching by SP. CONTSW instruction
6220 – System switching request from network mod-
ule
 Collateral information
 Common Information: Reason(s) for system
switching
 Individual Information: Reason(s) for system
switching failure
 Diagnostic Timing
At switching execution
STANDBY SYS. DOWN – Check whether the standby system is on or ON ON Continue QnPRH
Any of the following errors was detected in the not, and if it is not on, power it on.
backup mode. – Check whether the standby system has been
– The standby system has not started up in the reset or not, and if it has been reset, unreset
redundant system. it.
– The standby system has developed a stop – Check whether the standby system has devel-
error in the redundant system. oped a stop error or not, and if it has devel-
– The CPU module in the debug mode was con- oped the error, remove the error factor and
6300 nected to the operating control system. restart it.
(This can be detected from the control system of – When the CPU module in the debug mode
was connected to the control system operat-
the redundant system.) ing in the backup mode, make connection so
 Collateral information that the control system and standby system
 Common Information: — are combined correctly.
 Individual Information: —
 Diagnostic Timing
Always
CONTROL SYS. DOWN – The standby system exists but the control OFF Flicker Stop QnPRH
Any of the following errors was detected in the system does not exist.
backup mode. – Check whether the system other than the
– The control system has not started up in the standby system is on or not, and if it is not
redundant system. on, power it on.
– The control system has developed a stop – Check whether the system other than the
error in the redundant system. standby system has been reset or not, and if it
– The CPU module in the debug mode was con- is has been reset, unreset it.
nected to the operating standby system. – Check whether the system other than the
– The error occurred at a startup since the standby system has developed a stop error or
6310 not, and if has developed the error, remove
redundant system startup procedure was not
followed. the error factor, set the control system and
standby system to the same operating status,
(This can be detected from the standby system and restart.
of the redundant system.) – When the CPU module in the debug mode
 Collateral information was connected to the control system operat-
 Common Information: — ing in the backup mode, make connection so
 Individual Information: — that the control system and control system
are combined correctly.
 Diagnostic Timing
– Confirm the redundant system startup proce-
Always dure, and execute a startup again.
6311 CONTROL SYS. DOWN – Replace the tracking cable. OFF Flicker Stop QnPRH
– As consistency check data have not been If the same error still occurs, this indicates
transmitted from the control system in a the CPU module is faulty.
redundant system, the other system cannot Contact your local Mitsubishi representative.
start as a standby system. – Confirm the redundant system startup proce-
– The error occurred at a startup since the dure, and execute a startup again.
redundant system startup procedure was not
followed.
6312 (This can be detected from the standby system
of the redundant system.)
 Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At power ON/At reset

Tab. 13-6: Error code list (6000 to 6999)

Programming MELSEC System Q and L series 13 – 79


Error code list (6000 to 6999) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CONTROL SYS. DOWN Restart the system after checking that the con- OFF Flicker Stop QnPRH (first
The control system detected the error of the sys- nection between base unit and the system con- five digits of the
tem configuration and informed the standby sys- figuration (type/number/parameter of module) serial number
tem (host system) in the redundant system. are correct. of the CPU
 Collateral information module is
6313 09102 or
 Common Information: — higher)
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
PRG. MEM. CLEAR After the memory copy from control system to OFF Flicker Stop QnPRH
The memory copy from control system to standby system is completed, switch power OFF
standby system was executed, and the program and then ON, or make a reset.
memory was cleared.
 Collateral information
6400  Common Information: —
 Individual Information: —
 Diagnostic Timing
At execution of the memory copy from control
system to standby system
MEM.COPY EXE] After the memory copy from control system to ON ON Continue QnPRH
The memory copy from control system to standby system is completed, switch power OFF
standby system was executed. and then ON, or make a reset.
(This can be detected from the control system of
the redundant system.)
6410  Collateral information
 Common Information: —
 Individual Information: —
 Diagnostic Timing
At execution of the memory copy from control
system to standby system
TRK. PARA. ERROR Read the individual information of the error OFF Flicker Stop QnPRH
The file register file specified in the tracking set- using the programming tool, and check and cor-
ting of the PLC parameter dialog box does not rect the drive name and file name.
exist. Create the specified file.
6500  Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset
TRK. PARA. ERROR Read the individual information of the error OFF Flicker Stop QnPRH
The file register range specified in the device using the programming tool, and increase the
detail setting of the tracking setting of the PLC file register capacity.
parameter dialog box exceeded the specified file
register file capacity.
6501  Collateral information
 Common Information: File name/Drive name
 Individual Information: Parameter No.
 Diagnostic Timing
At power ON/At reset

Tab. 13-6: Error code list (6000 to 6999)

13 – 80
Error Codes Error code list (7000 to 10000)

13.8 Error code list (7000 to 10000)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
MULTI CPU DOWN – Read the individual information of the error OFF Flicker Stop Q00/Q01
– In the operating mode of a multiple CPU sys- using the programming tool, identify the error (Function
tem, a CPU error occurred at the CPU where of the CPU module, and remove the error. version is B or
"All station stop by stop error of CPU " was – Remove the CPU module incompatible with later)
selected. the multiple CPU system from the main base Qn(H)
– In a multiple CPU system, a CPU module unit. (Function
incompatible with the multiple CPU system – Check the mounting status of CPU modules version is B or
was mounted. other than CPU No.1 and whether the CPU later)
– CPU modules other than CPU No.1 were modules were reset. QnPH
removed from the base unit in operation, or
reset. QnU (except
Q00UJCPU)
 Collateral information
 Common Information: Module No. (CPU No.)
7000  Individual Information: —
 Diagnostic Timing
Always
MULTI CPU DOWN Read the individual information of the error
In a multiple CPU system, CPU other than CPU using the programming tool, identify the error of
No.1 cannot be started up due to stop error of the CPU module, and remove the error.
the CPU No.1 at power-on, which occurs to CPU
No.2 to No.4.
 Collateral information
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
MULTI CPU DOWN – Reset the CPU module and RUN it again. If the OFF Flicker Stop Q00/Q01
– There is no response from the target CPU same error is displayed again, this suggests (Function
module in a multiple CPU system during ini- the hardware fault of any of the CPU modules. version is B or
tial communication. Contact your local Mitsubishi representative.) later)
– In a multiple CPU system, a CPU module – Remove the CPU module incompatible with Qn(H)
incompatible with the multiple CPU system the multiple CPU system from the main base (Function
was mounted. unit. version is B or
Or, replace the CPU module incompatible with
 Collateral information the multiple CPU system with the compatible
later)
 Common Information: Module No. (CPU No.) one. QnPH
 Individual Information: —
7002  Diagnostic Timing
At power ON/ At reset
MULTI CPU DOWN Reset the CPU module and RUN it again. If the QnU (except
There is no response from the target CPU mod- same error is displayed again, this suggests the Q00UJCPU)
ule in a multiple CPU system during initial com- hardware fault of any of the CPU modules.
munication. Contact your local Mitsubishi representative.
 Collateral information
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI CPU DOWN Reset the CPU module and RUN it again. If the OFF Flicker Stop Q00/Q01
There is no response from the target CPU mod- same error is displayed again, this suggests the (Function
ule in a multiple CPU system at initial communi- hardware fault of any of the CPU modules. version is B or
cation stage. Contact your local Mitsubishi representative. later)
7003  Collateral information Qn(H)
 Common Information: Module No. (CPU No.) (Function
version is B or
 Individual Information: — later)
 Diagnostic Timing QnPH
At power ON/ At reset
MULTI CPU DOWN – Check the system configuration to see if mod- OFF Flicker Stop Q00/Q01
In a multiple CPU system, a data error occurred ules are mounted in excess of the number of (Function
in communication between the CPU modules. I/O points. version is B or
 Collateral information – When there are no problems in the system later)
7004  Common Information: Module No. (CPU No.)
configuration, this indicates the CPU module Qn(H)
hardware is faulty. (Function
 Individual Information: — Contact your local Mitsubishi representative. version is B or
 Diagnostic Timing later)
Always

Tab. 13-7: Error code list (7000 to 10000)

Programming MELSEC System Q and L series 13 – 81


Error code list (7000 to 10000) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
MULTI EXE. ERROR – Read the individual information of the error OFF Flicker Stop Q00/Q01
– In a multiple CPU system, a faulty CPU mod- using the programming tool, and replace the (Function
ule was mounted. faulty CPU module. version is B or
– In a multiple CPU system, a CPU module – Replace the CPU module with the one com- later)
incompatible with the multiple CPU system patible with the multiple CPU system. Qn(H)
was mounted. (The CPU module compatible – Do not reset any of the No. 2 to 4 CPU mod- (Function
with the multiple CPU system was used to ules. version is B or
detect an error.) – Reset CPU No. 1 and restart the multiple CPU later)
– In a multiple CPU system, any of the CPU No. system. QnPH
2 to 4 was reset with power ON. (The CPU
whose reset state was cancelled was used to QnU (except
detect an error.) Q00UJCPU)
 Collateral information
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI EXE. ERROR Change the version of the PC CPU module-com- Q00/Q01
The PC CPU module-compatible software pack- patible software package (PPC-DRV-01) to 1.07 (Function
age (PPC-DRV-01) whose version is 1.06 or ear- or later. version is B or
lier is used in a multiple CPU system. later)
 Collateral information
 Common Information: Module No. (CPU No.)
7010  Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI EXE. ERROR Replace the Q172(H)CPU(N) and Qn(H) (first 5
The Q172(H)CPU(N) or Q173(H)CPU(N) is Q173(H)CPU(N) with the Motion CPU compati- digits of serial
mounted on the multiple CPU high-speed main ble with the multiple CPU high-speed main base No. is 09082 or
base unit (Q3DB). unit. higher)
(This may result in a module failure.) QnPH (first 5
 Collateral information digits of serial
No. is 09082 or
 Common Information: Module No. (CPU No.)
higher)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI EXE. ERROR Check the QCPU and Motion CPU that can be Qn(H) (first 5
The Universal model QCPU (except Q02UCPU) used in a multiple CPU system, and change the digits of serial
and Q172(H)CPU(N) are mounted on the same system configuration. No. is 09082 or
base unit. higher)
(This may result in a module failure.) QnPH (first 5
 Collateral information digits of serial
 Common Information: Module No. (CPU No.) No. is 09082 or
higher)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI EXE. ERROR Correct the settings. OFF Flicker Stop Q00/Q01
Either of the following settings was made in a (Function
multiple CPU system. version is B or
– Multiple CPU automatic refresh setting was later)
made for the inapplicable CPU module. QnU (except
– "I/O sharing when using multiple CPUs" set- Q00UJCPU)
7011 ting was made for the inapplicable CPU mod-
ule.
 Collateral information
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-7: Error code list (7000 to 10000)

13 – 82
Error Codes Error code list (7000 to 10000)

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
MULTI EXE. ERROR – Change the system configuration to meet the OFF Flicker Stop QnU (except
The system configuration for using the Multiple conditions for using the Multiple CPU high Q00UJ-, Q00U-,
CPU high speed transmission function is not speed transmission function. Q01U- and
met. – Set the send range of CPU, that does not cor- Q02UCPU)
– The QnUCPU is not used for the CPU No.1. respond to multiple CPU compatible area, at 0
point, when performing automatic refreshing
– The Multiple CPU high speed main base unit in multiple CPU compatible area.
Q3BD is not used.
– Points other than 0 is set to the send range
for the CPU module incompatible with the
7011 multiple CPU high speed transmission func-
tion.
– Points other than 0 is set to the send range
for the CPU module incompatible with the
multiple CPU.
 Collateral information
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI EXE. ERROR – Check the QCPU and Motion CPU that can be OFF Flicker Stop QnU
The Q172(H)CPU(N) or Q173(H)CPU(N) is used in a multiple CPU system, and change
mounted to the CPU slot or slots 0 to 2. the system configuration.
(The module may break down.) – Remove the Motion CPU incompatible with
 Collateral information the multiple CPU system.
7013
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
MULTI CPU ERROR Read the individual information of the error ON ON Continue Q00/Q01
In the operating mode of a multiple CPU system, using the programming tool, check the error of (Function
an error occurred in the CPU where "system the CPU module resulting in CPU module fault, version is B or
stop" was not selected. and remove the error. later)
(The CPU module where no error occurred was Qn(H)
7020 used to detect an error.) (Function
 Collateral information version is B or
later)
 Common Information: Module No. (CPU No.)
 Individual Information: — QnPH
 Diagnostic Timing QnU (except
Q00UJCPU)
Always
CPU LAY. ERROR – Set the same value to the number of CPU OFF Flicker Stop Q00J/Q00/Q01
An assignment error occurred in the CPU- modules specified in the multiple CPU setting (Function
mountable slot (CPU slot, I/O slot 0, 1) in excess of the PLC parameter dialog box and the version is B or
of the number of mounted CPU modules (including later)
CPU (empty)). QnU
number of CPU modules specified in the multiple
CPU setting of the PLC parameter dialog box. – Make the type specified in the I/O assignment
7030 setting of the PLC parameter dialog box con-
 Collateral information sistent with the CPU module configuration.
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
CPU LAY. ERROR – Set the same value to the number of CPU OFF Flicker Stop Q00J/Q00/Q01
An assignment error occurred within the range modules specified in the multiple CPU setting (Function
of the number of CPUs specified in the multiple of the PLC parameter dialog box and the version is B or
CPU setting of the PLC parameter dialog box. number of mounted CPU modules (including later)
CPU (empty)).
7031  Collateral information QnU
– Make the type specified in the I/O assignment
 Common Information: Module No. (CPU No.) setting of the PLC parameter dialog box con-
 Individual Information: — sistent with the CPU module configuration.
 Diagnostic Timing
At power ON/ At reset
CPU LAY. ERROR Configure a system so that the number of OFF Flicker Stop Q00/Q01
The number of CPU modules mounted in a multi- mountable modules of each CPU module does (Function
ple CPU system is wrong. not exceed the maximum number of mountable version is B or
 Collateral information modules specified in the specification. later)
7032  Common Information: Module No. (CPU No.) QnU (except
Q00UJCPU)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset

Tab. 13-7: Error code list (7000 to 10000)

Programming MELSEC System Q and L series 13 – 83


Error code list (7000 to 10000) Error Codes

Error LED status CPU Correspond-


Error contents and cause Corrective action
code RUN ERR. status ing CPU
CPU LAY. ERROR Mount the CPU module on the applicable slot. OFF Flicker Stop Q00J/Q00/Q01
The CPU module has been mounted on the inap- (Function
plicable slot. version is B or
 Collateral information later)
7035  Common Information: Module No. (CPU No.) QnPRH
 Individual Information: — QnU
 Diagnostic Timing
At power ON/ At reset
CPU LAY. ERROR – Mount the mounting slot of the CPU module OFF Flicker Stop QnU (except
The host CPU No. set by the multiple CPU setting correctly. Q00UJ-, Q00U-,
and the host CPU No. determined by the mount- – Correct the host CPU No. set by the multiple Q01U- and
ing position of the CPU module are not the same. CPU setting to the CPU No. determined by the Q02UCPU)
 Collateral information mounting position of the CPU module.
7036
 Common Information: Module No. (CPU No.)
 Individual Information: —
 Diagnostic Timing
At power ON/ At reset
INCORRECT FILE Write the file shown as SD17 to SD22 of individ- OFF Flicker Stop QnU
The error of stored file (enabled parameter file) is ual information to the drive shown as SD16(L) of LCPU
detected. individual information, and turn ON from OFF the
 Collateral information power supply of the CPU module or cancel the
 Common Information: — reset.
8031 If the same error is displayed again, this indi-
 Individual Information: File diagnostic infor-
mation cates the CPU module hardware is faulty.
 Diagnostic Timing Contact your local Mitsubishi representative.
At power ON/ At reset/STOP → RUN/
At writing to programmable controller
F**** Read the individual information of the error ON ON/OFF Continue QCPU
Annunciator (F) was set ON. using the programming tool, and check the pro- USER LCPU
(The "****" portion of the error message indi- gram corresponding to the numerical value LED:
cates an annunciator number.) (annunciator number). ON
9000  Collateral information
 Common Information: Program error location
 Individual Information: Annunciator number
 Diagnostic Timing
When instruction executed
<CHK> ERR ***_*** Read the individual information of the error ON OFF Continue Qn(H)
Error detected by the CHK instruction. using the programming tool, and check the pro- USER QnPH
 Collateral information gram corresponding to the numerical value LED: QnPRH
9010  Common Information: Program error location (error number). ON
 Individual Information: Error number
 Diagnostic Timing
When instruction executed
BOOT OK Use the DIP switches to set the valid parameter OFF Flicker Stop Qn(H)
Storage of data onto ROM was completed nor- drive to the standard ROM. Then, switch power (Function
mally in automatic write to standard ROM. on again, and perform boot operation from the version is B or
(BOOT LED also flickers.) standard ROM. later)
9020  Collateral information QnPH
 Common Information: — QnPRH
 Individual Information: —
 Diagnostic Timing
At power ON/At reset
CONT.UNIT ERROR Check the details of the generated error by con- OFF Flicker Continue Qn(H)
In the multiple CPU system, an error occurred in necting to the corresponding CPU module. (Function
the CPU module other than the Process CPU/ version is B or
High performance model QCPU. later)
10000  Collateral information QnPH
 Common Information: —
 Individual Information: —
 Diagnostic Timing
Always

Tab. 13-7: Error code list (7000 to 10000)

13 – 84
Error Codes Error codes returned to request source

13.9 Error codes returned to request source


If an error occurs at communication request from a programming tool, intelligent function mod-
ule, or network system, the CPU module returns an error code to the request source.
This error code is not stored in SD0 because the error is not the one detected by the selfdiag-
nostic function of the CPU module.
When the request source is a programming tool, a message and an error code are displayed
on the programming tool. When the request source is an intelligent function module or network
system, the CPU module returns an error code corresponding to the requested processing.

Error code Error Item Error Details Corrective Action


 Connect the serial communication cable
4000H Serial communication sum check error correctly.
 Take noise reduction measures.
4001H  Check the command data of the MC protocol,
etc.
Unsupported request was executed.
4002H  Check the CPU module model name selected in
the programming tool.

4003H Command for which a global request cannot be


Check the command data of the MC protocol, etc.
performed was executed.
Any operation for the CPU module is prohibited by
the system protect function provided against the  Set the system protect switch of the CPU
4004H Common error module to OFF.
following events.
 Perform operation again after the CPU module
 The system protect switch is ON. has completed starting.
 The CPU module is starting.
The volume of data handled according to the
4005H Check the command data of the MC protocol, etc.
specified request is too large.
 Check with the external device maker for the
4006H support condition.
Serial communication could not be initialized.
 Check the CPU module model name selected in
the programming tool.
The CPU module is BUSY. After the free time has passed, reexecute the
4008H
(The buffer is not vacant). request.

4010H Since the CPU module is running, the request


contents cannot be executed. Execute after setting the CPU module to STOP
CPU mode error
Since the CPU module is not in a STOP status, the status.
4013H
request contents cannot be executed.
 Check the specified drive memory status.
4021H
The specified drive memory does not exist or there  After backing up the data in the CPU module,
is an error. execute programmable controller memory
format.

4022H The file with the specified file name or file No. does
Check the specified file name and file No.
not exist.

4023H The file name and file No. of the specified file do not
Delete the file and then recreate the file.
match.
4024H The specified file cannot be handled by a user. Do not access the specified file.

4025H The specified file is processing the request from Complete the current processing and then send the
another programming tool. request again.
CPU file related error
Any of the file password, drive keyword, or file Specify any of the file password, drive keyword, or
4026H password 32 set in advance to the target drive file password 32 set in advance to the target drive
(memory) must be specified. (memory) and then access.
The specified range is larger than the file size Check the specified range and access within that
4027H
range. range.
4028H The same file already exists. Reexecute after changing the file name.
Revise the specified file contents. Or reexecute
4029H The specified file capacity cannot be obtained. after cleaning up and reorganizing the specified
drive memory.
After backing up the data in the CPU module,
402AH The specified file is abnormal.
execute programmable controller memory format.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 85


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


Execute again after setting the CPU module to the
402BH The request contents cannot be executed in the STOP status. Execute programmable controller
specified drive memory. memory arrangement to increase the continuous
CPU file related error free space of the drive (memory).

402CH The requested operation cannot be executed


Execute again after a while.
currently.
4030H The specified device name cannot be handled. Check the specified device name.
 Check the specified device No.
4031H The specified device No. is outside the range.  Check the device assignment parameters of the
CPU module.
There is a mistake in the specified device
qualification. The unusable device name (TS, TC,  Check the specified device qualification
4032H SS, SC, CS, CC) must be specified in MC protocol method.
random reading, random writing (word), monitor  Check the specified device name.
CPU device specified error
registration and monitor command.
Writing cannot be done because the specified Do not write the data in the specified device, and do
4033H
device is for system use. not turn on or off.
Since the completion device for the target station
CPU module cannot be turned ON by the SREAD
Cannot be executed since the completion device for
4034H instruction/ SWRITE instruction, execute again
the dedicated instruction cannot be turned ON.
after setting the operating status of the target
station CPU module to the RUN status.
Check whether the specified module is the
4040H The request contents cannot be executed in the
intelligent function module having the buffer
specified intelligent function module.
memory.
Check the header address and access number of
4041H The access range exceeds the buffer memory range
points and access using a range that exists in the
of the specified intelligent function module.
intelligent function module.
Intelligent function module  Check that the specified intelligent function
4042H specification error The specified intelligent function module cannot be module is operating normally.
accessed.  Check the specified module for a hardware
fault.
The intelligent function module does not exist in Check the I/O No. of the specified intelligent
4043H
the specified position. function module.

4044H A control bus error occurred during access to the Check the specified intelligent function module and
intelligent function module. other modules and base units for a hardware fault.
The request contents cannot be executed because
4050H Turn off the memory card write protect switch.
the memory card write protect switch is on.
Check the following and take countermeasures.
4051H The specified device memory cannot be accessed.  Is the memory one that can be used?
 Is the specified drive memory correctly installed?

4052H The specified file attribute is read only so the data Do not write data in the specified file. Or change the
Protect error cannot be written. file attribute.
Check the specified drive memory. Or reexecute
4053H An error occurred when writing data to the
write after changing the corresponding drive
specified drive memory.
memory.
An error occurred when deleting the data in the Check the specified drive memory. Or re-erase after
4054H
specified drive memory. replacing the corresponding drive memory.

Tab. 13-8: Error codes returned to request source

13 – 86
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


 Finish the operation of another programming
The online debug function (such as online change, tool and then execute the function.
4060H sampling trace, and monitoring condition setting)  If the operation of another programming tool is
and the data logging function are being executed on hold, resume with that programming tool to
with another programming tool. complete the operation, and then execute the
function again.
 Register an online debug function (such as
online change, sampling trace, and monitoring
condition setting) and then establish a
4061H Communication of the online debug function was communication.
unsuccessful.  Execute again after checking the
communication route such as the
communication cable.

4063H The registered number of locked files exceeded the Finish the file access from another programming
maximum value. tool, and then execute again.
 Check the settings for the online debug
Settings for the online debug function (such as function (such as online change, sampling
trace, and monitoring condition setting) and
4064H online change, sampling trace, and monitoring data logging function.
condition setting) and for the data logging function
 Execute again after checking the
are incorrect. communication route such as the
Online registration error
communication cable.
Check the device assignment parameters of the
The device allocation information differs from the
4065H CPU module or the device assignment of the
parameter.
request data.
 Correct the drive keyword of the specified
drive.
The specified drive keyword, file password, or file
4066H  Correct the file password of the specified file.
password 32 is incorrect.
 Correct the file password 32 of the specified
file.
 Check the system area capacity of the user
setting specified for programmable controller
memory format.
4067H Monitor communication was unsuccessful.
 Execute again after checking the
communication route such as the
communication cable.

4068H Operation is disabled because it is being performed Finish the operation of another programming tool
with another programming tool. and then execute again.
The drive (memory) number that cannot be Check the specified drive and specify the correct
406AH
handled (other than 0 to 4) was specified. drive.
Read the program from the CPU module to match it
The program not yet corrected and the one
4070H Circuit inquiry error with that of the programming tool, and then
corrected by online program change are different.
execute online change again.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 87


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


4080H Request data error Check the request data that has been specified.
4081H The sort subject cannot be detected. Check the data to be searched.
Complete the processing for a request from
4082H The specified command is executing and therefore
another programming tool and then execute the
cannot be executed.
command again.
An attempt was made to perform operation for the
4083H Register the program to the parameters.
program not registered to the parameters.
4084H The specified pointer P, I did not exist. Check the pointer P, I in the specified data.

4085H Pointer P, I cannot be specified because the Specify pointer P, I after registering the program to
program is not specified in the parameter. be executed in the parameter.
Check the pointer No. to be added and make
4086H Pointer P, I has already been added.
correction.

4087H Check the specified pointer P, I and make a


Trying to specify too many pointer P, I.
correction.
 The specified step number is not at the head of  Check and correct the specified step No.
4088H the instruction.  Read the program from the CPU module to
 Contents of the program is different from those match it with that of the programming tool, and
stored in the CPU module. then execute online change again.
 Check the specified program file contents.
An attempt was made to insert/delete the END
4089H
instruction by online program change.  Write the program after setting the CPU
module to the STOP status.
Other errors  Check the capacity of the specified program
408AH The file capacity was exceeded by the write during file.
Run.  Write the program after setting the CPU
module to the STOP status.
 Reexecute after the CPU module is in a status
408BH where the mode request can be executed.
The remote request cannot be executed.
 For remote operation, set the parameter to
"Enable remote reset".
An attempt was made to remote-start the program, The program including the CHK instruction cannot
408CH which uses the CHK instruction, as a low speed be executed at low speed. Execute again after
program. checking the program.
 Check whether the model of the used CPU
module is correct or not.
 The program where online change was
408DH The instruction code that cannot be handled exists. attempted includes the instruction that cannot
be handled by the CPU module specified for the
project. Check the program and delete the
instruction.
 Write the program after setting the CPU
module to the STOP status.
 The starting position of online program change
408EH The write step is illegal. is not specified with the correct program step
No. Check whether the programming tool
supports the model and version of the CPU
module that is specified for the project.
40A0H A block No. outside the range was specified. Check the setting contents and make a correction.

40A1H A number of blocks that exceeds the range was Check the number of settings and make a
specified. correction.
40A2H A step No. that is outside the range was specified. Check the setting contents and make a correction.
Check the number of settings and make a
40A3H Step range limit exceeded
SFC device specification error correction.

40A4H The specified sequence step No. is outside the


Check the setting contents and make a correction.
range.
Check the number of settings and make a
40A5H The specified device is outside the range.
correction.
The block specification pattern and step
40A6H Check the setting contents and make a correction.
specification pattern were wrong.

40B0H The drive (memory) specified in SFC file operation


Check the setting contents and make a correction.
is wrong.
The SFC program specified in SFC file operation Check the specified file name and make a
40B1H
does not exist. correction.

40B2H The program specified in SFC file operation is not Check the specified file name and make a
SFC file related error an SFC program. correction.
Using online program change of SFC, an attempt
was made to execute rewrite operation of the "SFC
dedicated instruction", such as the "STEP start Write the program after setting the CPU module to
40B3H
instruction or transition start instruction", that the STOP status.
shows an SFC chart. (SFC dedicated instruction
cannot be written during RUN.)

Tab. 13-8: Error codes returned to request source

13 – 88
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


4100H CPU module hardware fault Change the CPU module.
Serial communication connection was executed for
4101H Check the CPU module series.
a different CPU module series.

4102H An attempt was made to erase the Flash ROM Execute again after setting the CPU module to the
during use of the file register. STOP status.
Execute online program change again, or write the
The instruction written during RUN is wrong or
4103H program after setting the CPU module to the STOP
illegal.
status.
4105H CPU module internal memory hardware fault Change the CPU module.
The command cannot be executed since the CPU
4106H Execute the operation again after the CPU module
module is performing system initialization
has started.
processing.
Other errors
An attempt was made to perform the operation of a
4107H Do not execute the function unsupported by the
function unavailable for the target CPU module
target CPU module.
model name.
Execute device monitor/test again. Before
4108H Operation cannot be made normally by device
execution, check that access is not made to the
monitor/test.
access prohibited area.
The specified operation cannot be executed since
4109H Execute the request again after deregistering the
the monitoring, set the condition for other
monitoring condition on the same screen.
application in same computer, is in execution.

410AH The specified command cannot be executed Execute the request again after the online program
because of online program change. change.
The registration of monitoring condition was Execute the registration of monitoring condition
410BH
canceled because of online program change. again after the online program change.
Since the CPU module is in a stop error status, it Execute the request again after resetting the CPU
4110H
cannot execute the request. module.
CPU module error The requested operation cannot be performed
4111H Execute the request again after the other CPU
since the other CPU modules have not yet started
modules have started.
in the multiple CPU system.

4121H Execute again after checking the specified drive


The specified drive (memory) or file does not exist.
(memory) or file.
Execute again after checking the specified drive
4122H The specified drive (memory) or file does not exist.
(memory) or file.
Execute programmable controller memory format
to make the drive (memory) normal. In the case of
4123H The specified drive (memory) is abnormal.
the Flash ROM, check the data to be written to the
Flash ROM, and write them to the Flash ROM.
Execute programmable controller memory format
4124H to make the drive (memory) normal. In the case of
The specified drive (memory) is abnormal.
the Flash ROM, check the data to be written to the
Flash ROM, and write them to the Flash ROM.

4125H The specified drive (memory) or file is performing


Execute again after a while.
processing.
The specified drive (memory) or file is performing
4126H Execute again after a while.
processing.
4127H File password mismatch Execute again after checking the file password.
4128H File password mismatch with copy destination Execute again after checking the file password.
File-related errors
4129H Cannot be executed since the specified drive Execute again after changing the target drive
(memory) is ROM. (memory).

412AH Cannot be executed since the specified drive Execute again after changing the target drive
(memory) is ROM. (memory).
Execute again after changing the write inhibit
412BH The specified drive (memory) is write-inhibited.
condition or drive (memory).

412CH Execute again after changing the write inhibit


The specified drive (memory) is write-inhibited.
condition or drive (memory).
The specified drive (memory) does not have Execute again after increasing the free space of the
412DH
enough free space. drive (memory).
The specified drive (memory) does not have Execute again after increasing the free space of the
412EH
enough free space. drive (memory).

412FH The drive (memory) capacity differs between the Execute again after checking the drive (memory)
drive (memory) copy destination and copy source. copy destination and copy source.
The drive (memory) type differs between the drive Execute again after checking the drive (memory)
4130H
(memory) copy destination and copy source. copy destination and copy source.
The file name of the file copy destination is the
4131H Execute again after checking the file names.
same as that of the copy source.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 89


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


4132H The specified number of files does not exist. Execute again after checking the specified data.
Execute again after increasing the free space of the
4133H The specified drive (memory) has no free space.
drive (memory).
4134H The attribute specification data of the file is wrong. Execute again after checking the specified data.
The date/time data of the peripheral device Execute again after checking the clock setting of the
4135H
(personal computer) is beyond the range. peripheral device (personal computer).

4136H Execute again after checking the specified file


The specified file already exists.
name.
Execute again after changing the condition of the
4137H The specified file is read-only.
specified file.
Simultaneously accessible files exceeded the
4138H Execute again after decreasing file operations.
maximum.
File-related errors The size of the specified file has exceeded that of Execute again after checking the size of the
4139H
the existing file. specified file.
The specified file has exceeded the already existing Execute again after checking the size of the
413AH
file size. specified file.
The same file was simultaneously accessed from
413BH Execute again after a while.
different programming tools.
413CH The specified file is write-inhibited. Execute again after changing the file condition.
Execute again after increasing the capacity of the
413DH The specified file capacity cannot be secured.
specified drive (memory).

413EH Operation is disabled for the specified drive Execute again after changing the target drive
(memory). (memory).

413FH Execute again after changing the specified drive


The file is inhibited from write to the standard RAM.
(memory).
Operation was executed for the intelligent function
Execute the operation again from the control CPU
414AH module of the non-control group in the multiple
Intelligent function module of the target module.
CPU system.
specification error
The I/O address of the specified CPU module is Execute again after checking the I/O address of the
414CH
wrong. specified CPU module.

4150H An attempt was made to format the drive protected Do not format the target drive (memory) as it
by the system. cannot be formatted.
File-related errors
An attempt was made to delete the file protected by
4151H Do not delete the target file as it cannot be deleted.
the system.
The registered number of forced inputs/outputs
4160H Deregister the unused forced inputs/outputs.
exceeded the maximum value.
Execute again after securing the area that enables
4165H The multiple-block online change system file does
multiple-block online change at the time of
not exist.
programmable controller memory format.
Due to unsuccessful online change (files)
previously occurred for some reason (example:
Online change (files) is disabled because it is being
4166H communication failure), the processing is kept
executed from the same source.
incomplete. Forcibly perform another online
change (files).
Due to unsuccessful online change (files) from
another source previously occurred for some
reason (example: communication failure), the
Online change (files) is disabled because it is being
4167H processing is kept incomplete. If online change
performed from another source.
Online registration error (files) is not being performed by any other
programming tool, forcibly perform another online
change (files).
Deregister the device test with executing condition
The registered number of device test with executing in CPU module, or decrease the number of
4168H
condition exceeds 32. registering device test with executing condition at
one time.
Deregister the device test with executing condition
The device test with executing condition has never
4169H after checking the registered number of device test
been registered.
with executing condition in CPU module.
Check whether the specified executing conditions
The specified executing condition does not exist.
416AH (program, step No. operation timing, device name)
(Device test with executing condition)
in deregistering are registered.

416BH The specified program is SFC program. (Device test Check the specifying program name in de/
with executing condition) registering the device test with executing condition.

Tab. 13-8: Error codes returned to request source

13 – 90
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


Check the specified remote password, then execute
4170H The password is wrong. the lock/unlock processing of the remote password
again.

4171H The port for communication use is at remote Execute communication after unlocking the remote
password locking status. password processing.
 Stop transmitting from several modules
simultaneously when setting a remote
password and using User Datagram Protocol
4174H Requested for a wrong module to unlock remote (UDP) in MELSOFT connection.
password.  The MELSOFT connection can be used with
Transmission Control protocol (TCP) when
setting a remote password.
 Do not specify the direct connection when
Communication error occurred in direct using other connection setting.
4176H  Do not turn off the CPU power during
connection. communication, reset the power, and plug out
the cable in direct connection.
 File operation is disabled because the File
Transfer Protocol (FTP) function is in
operation.
Retry after the operation for FTP function is
4178H  Online operation requiring a file access is completed.
performed with a programming tool while the
File Transfer Protocol (FTP) function is in
operation.
 Ensure that the power supply module and the
CPU module are properly installed to the base
unit.
 Ensure that the operating environment for the
system is met the general specifications of the
CPU module.
4180H Ethernet I/F Error System error.(The setting data in OS is abnormal.)
 Check whether the power capacity is sufficient.
 Reset the CPU module. If the same error code
is displayed again, the cause is a hardware
failure of the CPU module. Please consult your
local Mitsubishi representative, explaining a
detailed description of the problem.
 Check the receiving module operation.
 Check the status of the lines, such as cables,
hubs and routes, connected to receiving
modules.
 Some line packets may be engaged. Retry to
communicate a little while later.
 The receiving module may have no free space
Transmission to the receiving modules is in receive area (TCP window size is small).
4181H
unsuccessful. Check whether the receiving module processes
receive data, or whether the CPU module does
not send unnecessary data.
 Check whether the settings of the subnet mask
pattern and the default router IP address of the
CPU module and the receiving modules are
correct, or whether the class of the IP address
is correct.
 Check the receiving module operation.
Communication with receiving modules caused a  Check the status of the lines such as a cable, a
4182H hub and a route to receiving modules.
time-out error.
 Some line packets may be engaged. Retry to
communicate a little while later.
 Check the receiving module operation.
4183H Communication with receiving modules was  Check the status of the lines such as cables,
interrupted. hubs and routes connected to receiving
modules.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 91


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


 Communication processing buffer has run out
of space due to consecutive reception of  For MC protocol, send a request after receiving
request messages using the MC protocol. a response to the previous request.
 Communication processing buffer has ran out  For socket communication, enable received
4184H of space because received data read is not data read.
performed or cannot keep up with the volume.
 Communication processing is disabled due to  For socket communication, decrease the
insufficient space in the communication number of data sent from the target device.
processing buffer.
 For MC protocol, keep the connection until a
 Connection to the target device is disconnected response is sent.
before sending a response using the MC  Keep the connection until a sequence of
4185H protocol. communication is completed.
 Connection to the target device is disconnected  Other error such as 4184H may be the cause. If
during communication. any other error has occurred, take corrective
action of that error.
System error
4186H
(The argument data in OS is abnormal.)
System error
4187H
(The wait processing in OS is abnormal.)
4188H System error (The data length in OS is abnormal.)
System error
4189H
(The protocol information in OS is abnormal.)

418AH System error (The address data of communicating


module in OS is abnormal.)

418BH System error (The protocol information in OS is


Ethernet I/F Error abnormal.)
System error (The protocol specification
418CH
processing in OS is abnormal.)
 Check whether the power supply module and
418DH System error (The typed data in OS is abnormal.) the CPU module are properly installed to the
System error (The expedited data processing in OS base unit.
418EH
is abnormal.)  Check whether the operating environment for
the system satisfies the general specifications
418FH System error (The protocol information in OS is of the CPU module.
4190H abnormal.)  Check whether the power capacity is sufficient.
System error (The address data of communicating  Reset the CPU module. If the same error code
4191H is displayed again, the cause is a hardware
module in OS is abnormal.) failure of the CPU module. Please consult your
System error (The host module address processing local Mitsubishi representative, explaining a
4192H detailed description of the problem.
in OS is abnormal.)
4193H System error (The transmission processing in OS
to
4196H is abnormal.)
4197H System error (The connection processing in OS is
4198H abnormal.)

4199H System error (The connection termination


processing is abnormal.)
System error (The connection processing in OS is
419AH
abnormal.)

419BH System error (The connection termination


processing is abnormal.)
419CH System error (The processing order in OS is
419DH abnormal.)

Tab. 13-8: Error codes returned to request source

13 – 92
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


 Check the receiving module operation.
Connection to the module was unsuccessful or  Check the status of the lines such as a cable, a
419EH hub and a route to receiving modules
interrupted.
 Retry to connect a little while later, if the error
occurred in communication.
 Check whether the power supply module and
the CPU module are properly installed to the
base unit.
 Check whether the operating environment for
the system is met the general specifications of
the CPU module.
System error (The I/O control processing is
419FH  Check whether the power capacity is sufficient.
Ethernet I/F Error abnormal.)
 Reset the CPU module.
 If the same error code is displayed again, the
cause is a hardware failure of the CPU module.
Please consult your local Mitsubishi
representative, explaining a detailed description
of the problem.
 Retry after a while
Data cannot be sent since the target device has no  Check the behavior of the target device.
41A0H free space in receive area (TCP window size is  Check whether the target device is processing
data receiving.
zero).
 Check whether any unnecessary data are being
sent from the CPU module side.
The port number setting for the CPU module is
41A1H
incorrect.
Correct the port number.
The port number setting for the target device is
41A2H
invalid.
 For TCP/IP, the same Host station port No. is  Specify a port number that is not duplicated
specified as MC protocol. with that of MC protocol.
 For TCP/IP, a connection with the same host
41A3H
station No. and the same destination port No.  Correct both or either of the port numbers of
are already specified to one communication the CPU module and target device to avoid
target. duplication.

 For UDP/IP, the same Host station port No. is  Specify a port number that is not duplicated
specified as MC protocol. with that of MC protocol.
41A4H
 For UDP/IP, the specified host station No. is  Correct the port number of the CPU module to
duplicated. avoid duplication.
Ethernet I/F socket The IP address setting of the target device for Correct the IP address. Specify A, B, or C for the
41A5H communication error OPEN processing is invalid. class.
 Check the behavior of the target device.
 Check OPEN processing of the target device.
Connection was not established in OPEN  Correct the port number of the CPU module
41A6H and the IP address, port number, and open
processing for TCP connection. processing method of the target device.
 Check whether the cables are securely
connected.
 Correct the data length.
Data length is out of permissible range (2046 bytes  If the data is longer than the range, split the
for the Built-in Ethernet port QCPU whose serial data and send them.
41A8H  When the data length is 2047 to 10238 bytes,
number (first five digits) is "12051" or lower and
use the Built-in Ethernet port QCPU whose
10238 bytes for "12052" or higher) serial number (first five digits) is "12052" or
higher.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 93


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


 Review the IP address and Ethernet address of
the target device.
 Check whether the target device has the ARP
function. If not, communicate with the one that
has the ARP function.
41ABH Failed to send data due to resend timeout in TCP.  Check the behavior of the target device.
 The line may be congested with packets.
Resend data after a while.
 Check whether the cables are securely
connected.
 The target device cannot be found.  Check the behavior of the target device.
 The TCP connection is disconnected by the  Check whether the cables are securely
41ACH target device. connected.
 The Fullpassive device rejects the  Check whether the target IP address setting of
communication and the TCP connection is the Fullpassive device and the IP address of the
disconnected. Active device are matched.
 Check whether the cables are securely
Ethernet I/F socket connected.
communication error  Check the line status by PING test from the
Data cannot be send due to no connection or target device.
41ADH
disconnection of the cable.  Check the CPU module for error by conducting
a self-diagnostic test (resetting the CPU
module).
 Send data again.
 Specify the connection No. within 1 to 16.
41B4H The connection number setting is invalid.  Check whether "Socket communication" is
selected for "Open system" parameter.
The specified connection has already completed Perform CLOSE processing and then OPEN
41B6H
OPEN processing. processing.

41B7H The specified connection has not completed OPEN


Reexecute after OPEN processing is completed.
processing.
 Contents of control data is not correct.  Correct the contents of the control data.
41B9H  Open instruction was executed through open  Configure the open settings parameters or
settings parameter even though parameters are execute the OPEN instruction through control
not set for "Open settings". data.
The file information data may be corrupted. After
The format information data of the specified drive
41C1H backing up the data in the CPU module, execute
(memory) is abnormal.
programmable controller memory format.
41C2H File open specification data for file access is wrong. Execute again after checking the specification data.
Simultaneously accessible files exceeded the
41C3H Execute again after decreasing file operations.
maximum.
Simultaneously accessible files exceeded the
41C4H Execute again after decreasing file operations.
maximum.
41C5H The specified file does not exist. Execute again after checking the file.
Execute again after checking the file or drive
41C7H The specified file or drive (memory) does not exist.
(memory).
Execute again after checking the size of the
specified file. If the error recurs after re-execution,
The size of the specified file has exceeded that of
41C8H the file information data may be corrupted. After
the existing file.
backing up the data in the CPU module, execute
programmable controller memory format.
File-related errors Access to the file sector was unsuccessful. The
41C9H After backing up the data in the CPU module,
format information data of the target drive
execute programmable controller memory format.
(memory) is abnormal.
Access to the file sector was unsuccessful. The
41CAH After backing up the data in the CPU module,
format information data of the target drive
execute programmable controller memory format.
(memory) is abnormal.
41CBH The file name is specified in a wrong method. Execute again after checking the file name.
Execute again after checking the name of the file
41CCH The specified file or subdirectory does not exist.
and subdirectory.
41CDH Access to the file is inhibited by the system. Do not access the specified file.
The file cannot be written because the specified file The specified file is write-protected. Execute again
41CEH
is read-only. after checking the attribute.

41CFH The specified drive (memory) has been used Execute again after checking the drive (memory)
exceeding the capacity. capacity.
The specified drive (memory) has no free space. Or  Execute again after increasing the free space of
the drive (memory).
41D0H the number of files in the directory of the specified
 Execute again after deleting file(s) in the drive
drive (memory) has exceeded the maximum. (memory).

Tab. 13-8: Error codes returned to request source

13 – 94
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


 Execute again after checking the file name. If
 The file name is specified in a wrong method. the error recurs after re-execution, the file
information data may be corrupted. After
41D1H  The SD memory card is being disabled by backing up the data in the CPU module, format
SM606 (SD memory card forced disable the CPU module memory.
instruction).
 Cancel the SD memory card forced disable
instruction.
Execute again after checking the size of the
specified file. If the error recurs after re-execution,
41D4H The size of the specified file has exceeded that of
the file information data may be corrupted. After
the existing file.
backing up the data in the CPU module, execute
programmable controller memory format.

41D5H Forcibly execute the request, or execute after


The file of the same name exists.
changing the file name.
The file information data may be corrupted. After
41D6H The format information data of the specified drive
backing up the data in the CPU module, execute
(memory) is abnormal.
programmable controller memory format.
The file information data may be corrupted. After
41D7H The format information data of the specified drive
backing up the data in the CPU module, execute
(memory) is abnormal.
programmable controller memory format.
41D8H The specified file is being accessed. Execute again after a while.

41DFH Execute again after canceling the write protect of


The specified drive (memory) is write-protected.
the specified drive (memory).
 Execute again after checking whether the
41E0H The specified drive (memory) is abnormal or does memory card has been installed.
not exist.  After backing up the data, execute
programmable controller memory format.
File-related errors  After backing up the data, execute write to PLC
(Flash ROM).
41E1H Access to the flash ROM was unsuccessful.  Execute again after checking whether the
specified drive is the Flash ROM card and
whether the memory card size is correct.
 Execute again after checking whether the
memory card has been installed.
41E4H Access to the memory card was unsuccessful.  Execute again after replacing the memory card.
 After backing up the data, execute
programmable controller memory format.
The file information data may be corrupted. After
41E7H The format information data of the specified drive
backing up the data in the CPU module, execute
(memory) is abnormal.
programmable controller memory format.
The file information data may be corrupted. After
41E8H The format information data of the specified drive
backing up the data in the CPU module, execute
(memory) is abnormal.
programmable controller memory format.
41E9H The specified file is being accessed. Execute again after some time.
41EBH The file name is specified in a wrong method. Execute again after checking the file name.
The file information data may have been corrupted.
41ECH The file system of the specified drive (memory) is
After backing up the data in the CPU module,
logically corrupted.
execute programmable controller memory format.
The specified drive (memory) does not have
Execute again after deleting unnecessary files or
continuous free space. (The free space for file is
41EDH executing programmable controller memory
sufficient but the continuous free space is
arrangement.
insufficient.)
Creation of power failure backup for the specified Execute again after checking whether the memory
41EFH
drive (memory) was unsuccessful. card has been installed.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 95


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


41F0H The power failure backup data of the specified drive Execute again after checking whether the memory
(memory) are corrupted. card has been installed.
The power failure backup for the specified drive Execute again after checking whether the memory
41F1H
(memory) has a repair command. card has been installed.
Execute again after checking the specified drive
Operation cannot be performed since the specified
41F2H (memory). When performing operation for the
drive (memory) is Flash ROM.
Flash ROM, use write to PLC (Flash ROM).
Specify a smaller value for the file size when
41F3H File size is larger than 4Gbyte-2byte. creating a file or changing the file size. Alternatively,
divide the file so that each file size is smaller.
Since the operation prohibited by the system is
41F4H Since the operation is prohibited by the system, the
performed, the requested processing cannot be
file operation is not performed.
performed.
PLC write to the program memory or transfer to the
The data is being accessed from another backup memory is in execution. Access the data
41F8H
programming tool. again after checking that the above-mentioned
function has been completed.
File-related errors
Another device data saving was executed during
The data is being accessed from another
41F9H execution. Access the data again after the current
programming tool.
one is completed.
Program was written beyond the area where the Execute again after reducing either the already
41FAH
program can be executed. written program or newly written program.

41FBH The specified file is already being manipulated from Execute again after the currently performed
the programming tool. operation is completed.
An attempt was made to erase the drive (memory) The specified drive (memory) is being used and
41FCH
being used. cannot be erased.
41FDH There are no data written to the Flash ROM. Write a file by executing write to PLC (Flash ROM).
 The memory card has not been inserted.
 Or the SD memory card lock switch is not slid  Insert or re-insert the memory card.
41FEH down.  Slide the SD memory card lock switch down.
 The SD memory card is being disabled by  Cancel the SD memory card forced disable
SM606 (SD memory card forced disable instruction.
instruction).
41FFH The memory card type differs. Check the memory card type.

Tab. 13-8: Error codes returned to request source

13 – 96
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


The requested processing cannot be performed Do not send the request where this error occurred.
4200H because online module change is disabled by Alternatively, enable online module change by
parameter setting. parameter setting and send the request again.
The requested processing cannot be performed Do not send the request where this error occurred.
4201H because online module change is enabled by Alternatively, disable online module change by
parameter setting. parameter setting and send the request again.
The requested processing cannot be performed Make a request again after completion of the online
4202H
since an online module change is being performed. module change.
Take following procedures to replace the module
mounted on the main base unit.
The module mounted on the main base unit cannot
 Switch the system where the target module to be
4203H be replaced online since the extension base unit is replaced is mounted to the standby system.
mounted.  Turn OFF power supply of the standby system.
 Replace the target module.
Change the connection destination to the control
The specified module of the extension base unit
4204H system and perform the online module change
cannot be replaced online since it is connected to
again. (This corrective action can be made to the
the standby system.
module mounted on the extension base unit only.)

4210H When making a request, specify the head I/O


The specified head I/O number is outside the range.
number of the module that will be changed online.
4211H An online module change request is abnormal. Check the command used to make a request.
Make a request again after completion of the online
An online module change is already being made for
4212H module change, or continue after changing the
other equipment.
connection path.

4213H The specified head I/O number differs from the one When making a request, specify the head I/O
Online module change-related
registered for online module change. number of the module being changed online.
error
4214H The specified module differs from the one changed Make a request again after mounting the module
online. that is the same as the one changed online.
When making a request, specify the head I/O
4215H number of the module that will be changed online,
The specified module does not exist.
or make a request again after mounting the
module.
4216H The specified module is faulty. Make a request again after changing the module.
4217H There is no response from the specified module. Continue the online module changing operation.
Do not make a request where an error occurred, or
4218H The specified module is incompatible with online
make a request again to the module compatible
module change.
with online module change.
The specified module is mounted on the extension Do not make a request to any modules mounted on
4219H base unit of the type that requires no power supply the extension base unit of the type that requires no
module. power supply module and the main base unit.
Make a request to the CPU module that controls the
421AH The specified module is not in a control group.
specified module.
An error occurred in the setting of the initial setting Resume processing after checking the contents of
421BH
parameter of the intelligent function module. the intelligent function module buffer memory.

421CH Cannot be executed as the parameter file has been Operation cannot be performed. Operation is
rewritten. interrupted.
Connect the programming tool to the new control
421DH System switching occurs during the online module system to check the status of the online module
change. change. According to the status of online module
change, take procedures for it.
The tracking cable may be faulty or the standby
The information of the online module change system may have an error.
cannot be sent to the standby system. When the  Check the mounting status of the tracking cable
421EH system switching occurs during the online module or replace the tracking cable.
change, the online module change may not be  Check the status of the standby system. When a
continued. stop error was detected by the standby system,
Online module change-related perform troubleshooting.
error
 Set the connection destination of a
The module mounted on the extension base unit programming tool to the present control
421FH cannot be replaced online when the connection system.
destination is set to the standby system in the  Perform the online module change to the
separate mode. module mounted on the extension base unit
again.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 97


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


Any of the following unsupported operations was
executed for the standby system.
4240H  Operation mode change Execute the operation again after changing the
 System switching transfer setup to the control system.
 Memory copy from control system to standby
system
Communication cannot be made since the standby
Request communication after powering on the
system has been powered off or reset or is in a
4241H standby system or setting its Reset switch to the
user watchdog timer error or CPU module
neutral position.
hardware fault status.
Communication with the standby system cannot be
4242H Execute again after checking the tracking cable for
made since the tracking cable is faulty or
disconnection or changing it for a normal one.
disconnected.
The command cannot be executed since the Execute again after removing the stop error of the
4243H
standby system is in stop error. standby system.
The command cannot be executed since the Execute again after placing the standby system in
4244H operation status differs from that of the standby the same operation status (RUN/STOP) as the
system. control system.
Check that the other system CPU module has
4245H Redundant system-related error Other system CPU module status error normally started up and that the tracking cable is
connected.
The command cannot be executed since operation
mode (separate/backup) change or system Execute again after the operation mode change or
4246H
(control/standby system) switching is being system switching being executed is completed.
executed.
Execute again after memory copy from control
system to standby system is completed. Check the
following and take corrective action.
 Is SM1596 of the control system or standby
Memory copy from control system to standby system ON? (ON: Memory copy being executed)
4247H Execute again after SM1596 has turned OFF
system is already being executed.
since it is turned OFF by the system on
completion of memory copy.
 Is SM1597 of the control system ON? (ON:
Memory copy completed) Execute again after
turning OFF SM1597 of the control system
 Communication was made during system
switching.  Execute again after system switching.
4248H  The system specified in the transfer setup  After checking whether the specified system
(request destination module I/O number) does exists or not, restart communication.
not exist.

Tab. 13-8: Error codes returned to request source

13 – 98
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


 Normally start the system as the redundant
The redundant system is not established. (Control system. (Make communication again after
4249H establishing the system.)
system/standby system or System A/ System B not
 Execute again after changing the transfer setup
yet definite) (request destination module I/O number) to "No
settings have been made" (03FFH).
The command that could not be processed was
Execute again after changing the transfer setup
executed when the transfer setup (request
424AH (request destination module I/O number) to "No
destination module I/O number) is Control system/
settings have been made" (03FFH).
Standby system/System A/System B.
The command cannot be executed since system Manual system switching is inhibited by the manual
424BH switching is inhibited by the manual system system switching enable flag (SM1592). Execute
switching enable flag (SM1592). again after turning ON SM1592.
The specified command cannot be executed during Execute again after the online program change
424CH
online program change operation. operation is finished.
 Execute again after changing to the backup
mode.
The transfer setup or function unavailable for the
424DH  Execute again after changing the transfer setup
debug mode was used. (request destination module I/O number) to
System A or control system.

424EH The control system/standby system specifying This function cannot be executed since it is not
method is not supported. supported.
Although system switching was executed from the
System switching was executed by the other programming tool, system switching was executed
424FH condition during execution of system switching by first by the other condition. Check the system for
the programming tool. any problem and execute the operation again as
Redundant system-related error necessary.
Execute communication again after changing the
tracking cable. If the same error recurs after the
4250H Sum check error occurred in tracking tracking cable is changed, the cause is the
communication. hardware fault of the CPU module. (Please consult
your local Mitsubishi representative, explaining a
detailed description of the problem.)
The command cannot be executed in the separate
4251H Execute again after changing to the backup mode.
mode.
By monitoring SD1690 (other system network
System switching was not executed since an error module No. that issued system switching request),
4252H occurred in the redundant system compatible identify the faulty redundant-compatible intelligent
network module of the standby system. module of the standby system, then remove the
module fault, and execute again.
Since a communication error or system switching
occurred during execution of online program
change to the control system CPU module, online
program change redundant tracking was
Since a communication error or system switching suspended. Execute online program change again
occurred during online program change to the after confirming that communication with the
4253H control system CPU module, online program control system CPU module and standby system
change to the standby CPU module cannot be CPU module can be normally made. If it takes time
executed. for the communication between the programming
tool and either the control system CPU module or
standby system CPU module, change the value in
SD1710 (standby system online start waiting time)
so that errors may be avoided.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 99


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


The tracking cable may not be connected correctly,
or the tracking communication hardware of the
The command cannot be executed since an error CPU module may be faulty. Check the connection
4254H was detected in the tracking communication status of the tracking cable. If the condition is not
hardware. restored to normal after the cable connection status
is corrected, the possible cause is the hardware
fault of the CPU module.
Tracking communication is being prepared when it
4255H The command cannot be executed since tracking
is connected. Execute the operation again after a
communication is being prepared.
while (about 1 second).
The tracking cable may not be connected correctly,
or the tracking communication hardware of the
CPU module may be faulty. Check the connection
4256H The command cannot be executed since a time-out
status of the tracking cable. If the condition is not
error occurred in tracking communication.
restored to normal after the cable connection status
is corrected, the possible cause is the hardware
fault of the CPU module.
The command cannot be executed since the host
Execute again after checking the host system
4257H system CPU module is in a watchdog timer error or
status.
CPU module hardware fault status.
Redundant system-related error
Execute again after completing the operation mode
change by changing the status from STOP to RUN
4258H Operation mode being changed (from backup mode
using the RUN/ STOP switch of the CPU module
to separate mode)
whose RUN LED is flickering or by remote
operation.
Operation mode is being changed with another Execute again in the same communication route as
4259H programming tool in the communication route the one where the operation mode change was
different from the one currently used. executed.
Although the communication was made via the
intelligent function module mounted on the
Change the combination of the connection
extension base unit, the combination of the
425BH destination specification and the command to the
connection destination specification (Redundant
supported combination.
CPU specification) and the command is
unsupported.
System switching cannot be made since the
425CH Switch systems after the online module change has
module mounted on the extension base unit is
been completed.
being replaced online.
Operation mode cannot be changed since the
425DH Change the operation mode after the online module
module mounted on the extension base unit is
change has been completed.
being replaced online.

Tab. 13-8: Error codes returned to request source

13 – 100
Error Codes Error codes returned to request source

Error code Error Item Error Details Corrective Action


Register the data logging to the memory where a
Data logging is being performed (logging, saving
4270H data logging is being performed. Alternatively, stop
the logging data, completing, on hold, or in error)
the data logging being performed and register
with a different memory.
again.
The specified data logging is already being Stop the data logging. Alternatively, write, delete, or
4271H performed (logging, saving the logging data, register to the setting number where no data
completing, on hold, or in error). logging is being performed.
Change the trigger condition. Alternatively, stop the
The trigger logging with "Device" specified as a
trigger logging being performed (logging, saving
trigger condition is being performed (logging,
4272H the logging data, completing, on hold, or in error)
saving the logging data, completing, on hold, or in
with "Device" specified as the trigger condition, and
error).
then register.
The data logging function cannot be executed
4273H Hold the sampling trace to register the data
because the sampling trace function is being
Data logging logging.
performed.
(To check logging status, use Trigger loggings have registered exceeding the  Increase the capacity of the data logging buffer.
LCPU Logging Configuration Tool.
4274H number of trigger loggings collectable in the data  Reduce the number of records set for the
For operation, refer to the logging buffer. trigger logging.
MELSEC LCPU Module User's
Manual (Data Logging Function) After the auto logging, replace the SD memory card
4275H Auto logging is being performed.
and execute again.
The specified command cannot be executed
because the data logging function is being Stop the data logging and then execute the
4276H
performed (i.e. logging, saving the logging data, command.
completing, on hold, or in error).
The number of stored files has exceeded the value Delete files or change the storage destination and
4277H
set in advance. then register.
The number of stored files has reached to the
The number of stored files has reached to the
4278H maximum of FFFFFFFFH. Delete files or change the
maximum.
storage destination and then register.
 Write the common settings to the target
memory.
427AH Common setting file does not exist.
 Register the data logging to the memory where
the common settings are stored.
A data logging is being performed (logging in
Stop the data logging destined for the same
427BH execution, logging data are being saved,
storage and then register. Alternatively, change the
completing, on hold, or in error) in the same file
storage destination of the file and then register.
storage destination.
Ensure that the CPU module change function
The processing is being executed from the same (backup/ restoration) with SD memory card is not
4330H
source. being performed from the same source, and then
execute again.
The specified command cannot be executed
Finish the CPU module change function (backup/
4332H because the CPU module change function (backup/
restoration) with SD memory card, and then
restoration) with SD memory card is being
execute again.
performed.

4333H Complete the preparation for backup and then


Not ready for backup.
execute again.
Maintenance Insert a memory card with a backup file stored and
4334H Backup file does not exist.
then execute again.

4335H The specified function cannot be executed because Complete the latch data backup function and then
latch data are being backed up. execute again.
The specified function cannot be executed because
4336H Disconnect all FTP connections to the CPU module
a FTP client is being FTP-connected to the CPU
and then execute again.
module via the built-in Ethernet port.

4337H Power off and then on or reset the CPU module and
Module error collection file does not exist.
then execute again.
Readout of module error collection data has been
Retry the operation. Increase the number of
4338H failed when opening the screen to display the data
module error collections to be stored.
or when updating the data.
Readout of module error collection data was failed
Enable the module error collection function by
4339H because the function is disabled by parameter
parameter settings and then execute again.
settings.

Tab. 13-8: Error codes returned to request source

Programming MELSEC System Q and L series 13 – 101


Error codes returned to request source Error Codes

Error code Error Item Error Details Corrective Action


4400H The file protected by a password 32 has been Configure a correct password, authorize it, and
opened without using the password. then access.
 Password authorization for the file password  Configure a correct password for reading,
32 has failed in accessing when it is required authorize it, and then access.
4401H for reading.  Access the file with the method that is
 The password format for the password 32 is applicable to the file password 32.
incorrect.
 Password authorization for the file password  Configure a correct password for writing,
32 has failed in accessing when it is required authorize it, and then access.
4402H for writing.  Access the file with the method that is
Security  The password format for the password 32 is applicable to the file password 32.
incorrect.
Both passwords for reading and for writing that are
4403H Configure a correct password for both reading and
set upon Create, Change, Delete, or Disable do not
for writing, authorize them, and then access.
match the previous ones.
 Format the drive including the target file by
formatting the CPU module memory.
A file error was detected before or after performing
4404H
Create, Change, or Delete.  Write the target file to the CPU module again,
and then register or cancel the file password 32
again.
 Access to the specified station cannot be made  Set to the related stations the routing
since the routing parameters are not set to the parameters for access to the specified station.
start source CPU module and/or relay CPU  Retry after a while, or start communication
module. after confirming that the system for data
 For routing via a multiple CPU system, the routing has started.
4A00H control CPU of the network module for data  In a redundant system configuration, connect
routing has not started. the tracking cable, start System A/System B
 When System A/System B is not yet identified normally, and then restart communication.
in a redundant system configuration,
Link-related error communication was made with the other
station via the network module.
The network of the No. set to the routing Check and correct the routing parameters set to the
4A01H
parameters does not exist. related stations.
 Check the network module/link module for an
4A02H error or offline status.
Access to the specified station cannot be made.
 Check to see if the network number/PC number
setting has no mistake.
4A03H A request for network test was issued. Check the request data of the MC protocol, etc.
 Take corrective action after checking the error
that occurred at the specified access
An error occurred in the access destination or relay destination or the relay station to the accessed
4B00H station.
station, or the specified transfer setup (request
 Check the transfer setup (request destination
destination module I/O number) is illegal. module I/O number or programmable
controller number) in the request data of the
MC protocol, etc.
The target is not the No. 1 CPU of the multiple CPU Execute the request for the No. 1 CPU of the
4B01H
Target-related error system. multiple CPU system.
Perform operation for the module that can execute
4B02H The request is not addressed to the CPU module.
the specified function.
 The specified route is not supported by the
4B03H specified CPU module version. Check whether the specified route is supported or
 The communication target CPU module is not not.
mounted.
The specified transfer setup (request destination In the target setup, an illegal value is set as the
4B04H
module I/O number) is not supported. head I/O number of the target module.
The specified device is unavailable for the motion
4C00H Check the request data contents.
CPU or outside the device range.

4C08H There are a total of 33 or more DDWR and DDRD Execute again after reducing the number of DDWR
Multiple CPU-related error
requests. and DDRD requests to be executed simultaneously.
The specification of the requested CPU module No.
4C09H Check the request data contents.
is illegal.

Tab. 13-8: Error codes returned to request source

13 – 102
Appendix A Definition of the processing times

A Appendix A
A.1 Definition of the processing times
The operation processing time is the total of the following:
● Total of each instruction processing time.
● The END processing time. This time consists of the time to execute the END instruction, the
MELSECNET related refresh time, the processing time for the communication with periphe-
ral devices, and the time for serial communication.
● Processing time for the function that increases the scan time

Refer to the following manual(s) for the END processing time, I/O refresh time, and processing
time for the function that increases the scan time.
● QnUCPU User's Manual (Functions Explanation, Program Fundamentals)
● Qn(H)/QnPH/QnPRHCPU User's Manual (Functions Explanation, Program Fundamentals)
● MELSEC-L CPU Module User's Manual (Functions Explanation, Program Fundamentals)

Programming MELSEC System Q and L series A–1


Processing times for MELSEC System Q CPUs Appendix A

A.2 Processing times for MELSEC System Q CPUs

The tables on the following pages contain the processing times of all instructions.
The according processing times depend on the values of source and destination data. The va-
lues contained in the following tables should therefore be taken as a set of general guidelines
to processing time rather than as being strictly accurate.
When the instruction is not executed the processing time is calculated as follows:

Type of CPU Processing time when the instruction is not executed (μs)
Q00JCPU 0.20 x (Number of steps for each instruction + 1)
Q00CPU 0.16 x (Number of steps for each instruction + 1)
Q01CPU 0.10 x (Number of steps for each instruction + 1)
Q02CPU) 0.079 x (Number of steps for each instruction + 1)
Q02HCPU
Q06HCPU
Q12HCPU
Q25HCPU
Q02PHCPU
0.034 x (Number of steps for each instruction + 1)
Q06PHCPU
Q12PHCPU
Q25PHCPU
Q12PRHCPU
Q25PRHCPU

A–2
Appendix A Processing times for MELSEC System Q CPUs

A.2.1 Table of Processing Times

Following tables show the processing time for the instructions of Basic Model QCPU, High Per-
formance Model QCPU/Process CPU/Redundant CPU.

NOTE When using a file register (ZR), module access device (Un\G, U3En\G0 to G511 (for Basic
model QCPU) resp. U3En\G0 to G4095 (for High Performance Model QCPU/Process CPU/
Redundant CPU), and link direct device (Jn\), add the processing time shown in tables A-12
(for Basic model QCPU) and A-14 (other CPU modules) to that of the instruction.

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
LD
LDI e.g. X0 0.20 0.16 0.10
AND
0.079 0.034 0.034 0.034
ANI
OR e.g. D0.0 0.30 0.24 0.15
ORI
LDP
LDF
ANDP
0.30 0.24 0.15 0.158 0.068 0.068 0.068
ANDF
ORP
ORF
ANB
ORB
MPS 0.20 0.16 0.10 0.079 0.034 0.034 0.034
MRD
MPP
not executed
INV 0.20 0.16 0.10 0.079 0.034 0.034 0.034
executed
MEP not executed
0.30 0.24 0.15 0.173 0.073 0.073 0.073
MEF executed
not changed
EGP 0.20 0.16 0.10
changed (OFF/ON or ON/OFF)
0.158 0.068 0.068 0.068
not changed 17 9.5 9.4
EGF
changed (OFF/ON or ON/OFF) 18 14 14
excl. F, T not changed
0.20 0.16 0.10
and C changed (OFF/ON or ON/OFF)
0.158 0.068 0.068 0.068
not changed
D0.0 0.40 0.32 0.20
changed (OFF/ON or ON/OFF)
when OFF 24 20 19 2.8 1.2 1.2 1.2
F displayed 260 210 200 162 69.7 69.7 69.7
when ON
display completed 205 165 155 126 54 54 54
not executed
after time out 1.1 0.88 0.55
T 0.63 0.27 0.27 0.27
OUT executed K
added
D 1.2 0.96 0.60
not executed
after time out 1.1 0.88 0.55
C 0.63 0.27 0.27 0.27
executed K
added
D 1.2 0.96 0.6
not executed
after time out 1.1 0.88 0.55
T 0.63 0.27 0.27 0.27
executed K
added
D 1.2 0.96 0.6

Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A–3


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
all devic- not executed
es exept not changed 0.20 0.16 0.10
F and executed
D0.0 changed
0.158 0.068 0.068 0.068
not executed
SET D0.0 not changed 0.40 0.32 0.20
executed
changed
not executed 0.50 0.44 0.25 0.47 0.20 0.20 0.20
F displayed 255 205 195 161 69 69 69
executed
display completed 195 160 150 0.47 0.20 0.20 0.20
All devic- not executed
es exept not changed
the ones 0.20 0.16 0.10 0.158 0.068 0.068 0.068
listed be- executed
changed
low
not executed
D0.0 not changed 0.40 0.32 0.20 0.158 0.068 0.068 0.068
executed
changed
not executed
SM 0.20 0.16 0.10 0.158 0.068 0.068 0.068
executed
not executed 0.48 0.44 0.25 0.47 0.20 0.20 0.20
RST
F displayed 75 69 65 90 38 38 38
executed
display completed 43 35 33 0.47 0.20 0.20 0.20
not executed 0.80 0.64 0.40
T, C 0.63 0.27 0.27 0.27
executed 1.0 0.80 0.50
not executed 0.40 0.32 0.20
D 0.24 0.10 0.10 0.10
executed 0.60 0.48 0.30
not executed 0.50 0.40 0.25 0.47 0.20 0.20 0.20
Z
executed 9.4 7.9 7.4 4.3 1.9 1.9 1.9
not executed - 0.32 0.20
R 0.40 0.17 0.17 0.17
executed - 0.48 0.30
PLS 12 9.5 9.2 1.0 0.44 0.44 0.44
PLF 11 9.5 8.9 1.0 0.44 0.44 0.44
not executed 0.68 0.40 0.25
FF Y 0.47 0.20 0.20 0.20
executed 7.5 6.2 5.7
not executed 0.50 0.40 0.25 0.47 0.20 0.20 0.20
DELTA DY0
executed 26 21 21 5.9 2.6 2.6 2.6
not executed 0.48 0.40 0.25 0.47 0.20 0.20 0.20
DELTAP DY0
executed 58 45 43 5.9 2.6 2.6 2.6
SFT not executed 0.50 0.34 0.25 0.47 0.20 0.20 0.20
SFTP executed 12 8.7 8.3 1.66 0.71 0.71 0.71
M0.0 0.40 0.32 0.20
MC 0.24 0.10 0.10 0.10
D0.0 3.3 2.9 2.8
MCR 0.20 0.16 0.10 0.079 0.034 0.034 0.034
error check executed 660 530 480 348 150 150 500
FEND without error check:
END - Battery check 660 530 480 359 150 150 500
- Blown fuse check
- Verification of I/O module
NOP 0.20 0.16 0.10 0.079 0.034 0.034 0.034
NOPLF
0.20 0.16 0.10 0.79 0.034 0.034 0.034
PAGE
continuity
LD= 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A–4
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
continuity
LD<> 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND<> continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR<> continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
continuity
LD> 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND> continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR> continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
continuity
LD<= 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND<= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR<= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
continuity
LD< 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND< continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR< continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
continuity
LD>= 0.80 0.64 0.40 0.24 0.10 0.10 0.10
no continuity
not executed 0.70 0.56 0.35
AND>= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
not executed 0.70 0.56 0.35
OR>= continuity 0.24 0.10 0.10 0.10
executed 0.80 0.64 0.40
no continuity
continuity 0.55 0.24 0.24 0.24
LDD= 1.0 0.80 0.50
no continuity 0.39 0.17 0.17 0.17
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD= continuity 0.55 0.24 0.24 0.24
executed 1.0 0.80 0.50
no continuity 0.39 0.17 0.17 0.17
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD= continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
continuity
LDD<> 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD<> continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD<> continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
continuity
LDD> 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity

Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A–5


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD> continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD> continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
continuity
LDD<= 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD<= continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD<= continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
continuity
LDD< 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD< continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD< continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
continuity
LDD>= 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ANDD>= continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
not executed 0.80 0.64 0.40 0.39 0.17 0.17 0.17
ORD>= continuity
executed 1.0 0.80 0.50 0.55 0.24 0.24 0.24
no continuity
93 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
14.9 6.4
LDE= 1) 93 40
continuity — — — — —
14.9 6.4
double precision
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
93 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE= 1) not executed — — — — — — —
93 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
1
The Qn/QnH changes in processing time depending on the serial No. of the CPU module.
Top : The first 5 digits of the serial No. are "05031" or lower
Bottom: The first 5 digits of the serial No. are "05032" or higher
For the condition to be satisfied when the instruction is not executed, there is no differentiation between the top and bottom.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

A–6
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
not executed — — — 0.55 0.24 0.24 0.24
93 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE= 1) not executed — — — 0.55 0.24 — —
93 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
92 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
14.9 6.4
LDE<> 1) 92 40
continuity — — — — —
14.9 6.4
double precision
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
93 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE<> 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
93 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE<> 1) not executed — — — 0.55 0.24 — —
93 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
92 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
LDE> 1) 14.9 6.4
92 40
continuity — — — — —
double precision 14.9 6.4
no continuity — — — 92 40 — —
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
93 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE> 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
1
The Qn/QnH changes in processing time depending on the serial No. of the CPU module.
Top : The first 5 digits of the serial No. are "05031" or lower
Bottom: The first 5 digits of the serial No. are "05032" or higher
For the condition to be satisfied when the instruction is not executed, there is no differentiation between the top and bottom.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A–7


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
not executed — — — 0.55 0.24 0.24 0.24
93 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE> 1) not executed — — — 0.55 0.24 — —
93 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
93 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
14.9 6.4
LDE<= 1) 93 40
continuity — — — — —
14.9 6.4
double precision
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE<= 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE<= 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
92 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
1)
14.9 6.4
LDE< 92 40
continuity — — — — —
14.9 6.4
double precision
92 40
no continuity — — — — —
14.9 6.4
1 The Qn/QnH changes in processing time depending on the serial No. of the CPU module.
Top : The first 5 digits of the serial No. are "05031" or lower
Bottom: The first 5 digits of the serial No. are "05032" or higher
For the condition to be satisfied when the instruction is not executed, there is no differentiation between the top and bottom.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

A–8
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE< 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
93 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE< 1) not executed — — — 0.55 0.24 — —
93 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
93 40
continuity — — — 6.4 6.4
14.9 6.4
single precision
92 40
no continuity — — — 6.4 6.4
14.9 6.4
LDE>= 1) 93 40
continuity — — — — —
14.9 6.4
double precision
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ANDE>= 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
not executed — — — 0.55 0.24 0.24 0.24
92 40
continuity — — — 6.4 6.4
single precision 14.9 6.4
executed
92 40
no continuity — — — 6.4 6.4
14.9 6.4
ORE>= 1) not executed — — — 0.55 0.24 — —
92 40
continuity — — — — —
double precision 14.9 6.4
executed
92 40
no continuity — — — — —
14.9 6.4
continuity — — — 38 16 16 16
LD$=
no continuity — — — 34 15 15 15
not executed — — — 0.56 0.23 0.23 0.23
AND$= continuity — — — 39 17 17 17
executed
no continuity — — — 32 14 14 14
1 The Qn/QnH changes in processing time depending on the serial No. of the CPU module.
Top : The first 5 digits of the serial No. are "05031" or lower
Bottom: The first 5 digits of the serial No. are "05032" or higher
For the condition to be satisfied when the instruction is not executed, there is no differentiation between the top and bottom.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A–9


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
not executed — — — 0.56 0.24 0.24 0.24
OR$= continuity — — — 40 17 17 17
executed
no continuity — — — 33 14 14 14
continuity — — — 32 14 14 14
LD$<>
no continuity — — — 40 17 17 17
not executed — — — 0.56 0.23 0.23 0.23
AND$<> continuity — — — 33 14 14 14
executed
no continuity — — — 39 17 17 17
not executed — — — 0.56 0.24 0.24 0.24
OR$<> continuity — — — 32 14 14 14
executed
no continuity — — — 39 17 17 17
continuity — — — 32 14 14 14
LD$>
no continuity — — — 40 17 17 17
not executed — — — 0.56 0.23 0.23 0.23
AND$> continuity — — — 33 14 14 14
executed
no continuity — — — 39 17 17 17
not executed — — — 0.56 0.24 0.24 0.24
OR$> continuity — — — 32 14 14 14
executed
no continuity — — — 39 17 17 17
continuity — — — 40 17 17 17
LD$<=
no continuity — — — 32 14 14 14
not executed — — — 0.56 0.23 0.23 0.23
AND$<= continuity — — — 39 17 17 17
executed
no continuity — — — 32 14 14 14
not executed — — — 0.56 0.24 0.24 0.24
OR$<= continuity — — — 40 17 17 17
executed
no continuity — — — 33 14 14 14
continuity — — — 32 14 14 14
LD$<
no continuity — — — 40 17 17 17
not executed — — — 0.56 0.23 0.23 0.23
AND$< continuity — — — 32 14 14 14
executed
no continuity — — — 39 16 16 16
not executed — — — 0.56 0.24 0.24 0.24
OR$< continuity — — — 32 14 14 14
executed
no continuity — — — 39 16 16 16
continuity — — — 40 17 17 17
LD$>=
no continuity — — — 32 14 14 14
not executed — — — 0.56 0.23 0.23 0.23
AND$>= continuity — — — 39 16 16 16
executed
no continuity — — — 32 14 14 14
not executed — — — 0.56 0.24 0.24 0.24
OR$>= continuity — — — 39 17 17 17
executed
no continuity — — — 32 14 14 14
BKCMP= n=1 130 105 97 48 21 21 21
BKCMP=P n = 96 205 175 165 142 61 61 61
BKCMP<> n=1 130 105 98 48 21 21 21
BKCMP<>P n = 96 210 180 165 150 65 65 65
BKCMP> n=1 130 105 97 48 21 21 21
BKCMP>P n = 96 210 180 165 142 61 61 61
BKCMP>= n=1 130 105 98 48 21 21 21
BKCMP>=P n = 96 205 175 165 150 65 65 65
BKCMP< n=1 130 105 98 48 21 21 21
BKCMP<P n = 96 210 180 165 158 68 68 68
BKCMP<= n=1 130 105 97 48 21 21 21
BKCMP<=P n = 96 205 175 165 150 65 65 65
1
The Qn/QnH changes in processing time depending on the serial No. of the CPU module.
Top : The first 5 digits of the serial No. are "05031" or lower
Bottom: The first 5 digits of the serial No. are "05032" or higher
For the condition to be satisfied when the instruction is not executed, there is no differentiation between the top and bottom.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 10
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
+ (s, d)
executed 1.0 0.80 0.50 0.39 0.17 0.17 0.17
+P (s, d)
+ (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
+P (s1, s2, d)
- (s, d)
executed 1.0 0.80 0.50 0.39 0.17 0.17 0.17
-P (s, d)
- (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
-P (s1, s2, d)
D+ (s, d)
executed 1.3 1.04 0.65 0.71 0.31 0.31 0.31
D+P (s, d)
D+ (s1, s2, d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
D+P (s1, s2, d)
D- (s, d)
executed 1.3 1.04 0.65 0.71 0.30 0.30 0.30
D-P (s, d)
D- (s1, s2, d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
D-P (s1, s2, d)
x (s1,s2,d)
executed 1.1 0.88 0.55 0.47 0.20 0.20 0.20
xP (s1,s2,d)
/ (s1,s2,d)
19 16 15 2.7 1.2 1.2 1.2
/P (s1,s2,d)
Dx (s1,s2,d)
41 34 31 7.9 3.4 3.4 3.4
DxP (s1,s2,d)
D/ (s1,s2,d)
28 23 21 14 6.1 6.1 6.1
D/P (s1,s2,d)
B+ (s, d)
34 28 26 2.2 1.0 1.0 1.0
B+P (s, d)
B+ (s1, s2, d)
47 39 37 5.0 2.2 2.2 2.2
B+P (s1, s2, d)
B- (s, d)
34 28 26 2.0 0.9 0.9 0.9
B-P (s, d)
B- (s1,s2,d)
48 40 38 4.9 2.1 2.1 2.1
B-P (s1,s2,d)
DB+ (s, d)
58 48 44 12 5.0 5.0 5.0
DB+P (s, d)
DB+ (s1,s2,d)
60 49 46 12 5.3 5.3 5.3
DB+P (s1,s2,d)
DB- (s, d)
59 48 45 11 4.8 4.8 4.8
DB-P (s, d)
DB- (s1,s2,d)
60 51 45 12 5.2 5.2 5.2
DB-P (s1,s2,d)
Bx (s1, s2, d)
42 35 33 3.7 1.6 1.6 1.6
BxP (s1, s2, d)
B/ (s1, s2, d)
48 40 37 3.8 1.6 1.6 1.6
B/P (s1, s2, d)
DBx (s1, s2, d)
140 120 110 24 10 10 10
DBxP (s1, s2, d)
DB/ (s1, s2, d)
83 69 65 27 12 12 12
DB/P (s1,s2,d)
s = 0, d = 0
single precision — — — 1.8 0.78 0.78 0.78
E+ (s, d) s = 2127, d = 2127
E+P (s, d) s = 0, d = 0
double precision — — — 203 87 — —
s = 2127, d = 2127
s1 = 0, s2 = 0
single precision — — — 2.4 1.1 1.1 1.1
E+ (s1, s2, d) s1 = 2127, s2 = 2127
E+P (s1, s2, d) s = 0, d = 0
double precision — — — 209 90 — —
s = 2127, d = 2127

Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 11


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
s = 0, d = 0
single precision — — — 1.8 0.78 0.78 0.78
E- (s, d) s = 2127, d = 2127
E-P (s, d) s = 0, d = 0
double precision — — — 202 87 — —
s = 2127, d = 2127
s1 = 0, s2 = 0
single precision — — — 2.4 1.1 1.1 1.1
E- (s1, s2, d) s1 = 2127, s2 = 2127
E-P (s1, s2, d) s = 0, d = 0
double precision — — — 210 90 — —
s = 2127, d = 2127
s1 = 0, s2= 0
single precision — — — 2.4 1.1 1.1 1.1
Ex (s1, s2, d) s1 = 2127, s2 = 2127
ExP (s1, s2, d) s = 0, d = 0
double precision — — — 222 96 — —
s = 2127, d = 2127
s1 = 0, s2 = 1
single precision — — — 12 5.2 5.2 5.2
E/ (s1, s2, d) s1 = 2127, s2 = -2126
E/P (s1, s2, d) s = 0, d = 0
double precision — — — 369 159 — —
s1 = 2127, s2 = -2126
$+ (s, d)
— — — 68 29 29 29
$+P (s, d)
$+ (s1, s2, d)
— — — 81 35 35 35
$+P (s1, s2, d)
INC
0.70 0.56 0.35 0.32 0.14 0.14 0.14
INCP
DINC
0.90 0.72 0.45 0.47 0.20 0.20 0.20
DINCP
DEC
0.70 0.56 0.35 0.32 0.14 0.14 0.14
DECP
DDEC
0.90 0.72 0.45 0.47 0.20 0.20 0.20
DDECP
BCD
20 16 15 1.1 0.48 0.48 0.48
BCDP
DBCD
26 21 20 3.2 1.4 1.4 1.4
DBCDP
BIN
19 16 15 1.0 0.44 0.44 0.44
BINP
DBIN
22 18 17 1.9 0.82 0.82 0.82
DBINP
s=0
single precision — — — 3.2 1.4 1.4 1.4
INT s = 32766.5
INTP s=0
double precision — — — 22 9.3 — —
s = 32766.5
s=0
single precision — — — 2.5 1.1 1.1 1.1
DINT s = 1234567890.3
DINTP s=0
double precision — — — 24 10 — —
s = 1234567890.3
s=0
single precision — — — 2.1 0.92 0.92 0.92
FLT s = 7FFFH
FLTP s=0
double precision — — — 22 9.6 — —
s = 7FFFH
s=0
single precision — — — 2.1 0.88 0.88 0.88
DFLT s = 7FFFFFFFH
DFLTP s=0
double precision — — — 26 11 — —
s = 7FFFFFFFH
DBL
19 16 15 4.5 1.9 1.9 1.9
DBLP
WORD
23 19 17 4.7 2.0 2.0 2.0
WORDP

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 12
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
GRY
19 16 15 4.7 2.0 2.0 2.0
GRYP
DGRY
23 19 17 5.3 2.3 2.3 2.3
DGRYP
GBIN
52 42 40 18 7.7 7.7 7.7
GBINP
DGBIN
110 88 84 32 14 14 14
DGBINP
NEG
16 13 12 3.6 1.6 1.6 1.6
NEGP
DNEG
19 17 15 4.3 1.8 1.8 1.8
DNEGP
ENEG
— — — 3.9 1.7 1.7 1.7
ENEGP
BKBCD n=1 78 63 57 38 17 17 17
(s, d, n)
BKBCDP n = 96 315 275 250 99 43 43 43
(s, d, n)
BKBIN (s, d, n) n=1 74 61 57 38 17 17 17
BKBINP (s, d, n) n = 96 285 255 230 99 43 43 43
MOV s = D0, d = D1 0.70 0.56 0.35 0.24 0.10 0.10 0.10
MOVP s = D0, d = J1/W1 155 130 120 140 2) 60 2) 60 2) 60 2)
DMOV s = D0, d = D1 0.90 0.72 0.45 0.47 0.20 0.20 0.20
DMOVP s = D0, d = J1/W1 165 135 120 147 2) 64 2) 64 2) 64 2)
EMOV
— — — 0.63 0.27 0.27 0.27
EMOVP
$MOV 0 characters (basic model) 46 38 35
40 17 17 17
$MOVP 32 characters (basic model) 98 80 73
CML
0.70 0.56 0.35 0.40 0.17 0.17 0.17
CMLP
DCML
0.90 0.72 0.45 0.55 0.24 0.24 0.24
DCMLP
BMOV (s, d, n) n=1 27 21 20 17 7.1 7.1 7.1
BMOVP (s, d, n) n = 96 72 62 53 32 14 14 14
FMOV (s, d, n) n=1 23 19 17 6.7 2.9 2.9 2.9
FMOVP (s, d, n) n = 96 48 41 36 14 6.1 6.1 6.1
XCH
7.6 6.3 5.7 1.3 0.54 0.54 0.54
XCHP
DXCH
9.5 8.0 7.1 1.3 0.54 0.54 0.54
DXCHP
BXCH (d1, d2, n) n=1 62 51 48 31 13 13 13
BXCHP (d1, d2, n) n = 96 165 140 125 84 36 36 36
SWAP
17 14 13 3.7 1.6 1.6 1.6
SWAPP
CJ 10 8.5 8.1 3.2 1.4 1.4 1.4
SCJ 10 8.5 8.1 3.2 1.4 1.4 1.4
JMP 11 8.5 8.1 3.2 1.4 1.4 1.4
GOEND 3.3 2.9 2.8 0.39 0.34 0.34 0.34
EI 14 11 11 1.3 0.54 0.54 0.54
DI 13 12 11 0.95 0.41 0.41 0.41
IMASK 41 34 35 11 4.6 4.6 4.6
IRET 205 170 155 1.6 0.68 0.68 0.68
s= X, n = 1 55 46 43
6.7 4.7 4.7 4.7
RFS s = Y, n = 1 54 45 41
RFSP s = X, n = 96 79 64 59
19 13 13 13
s = Y, n =96 73 61 56
2 Processing time when Q312B is used.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 13


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
UDCNT1 — — — 15 6.5 6.5 —
UDCNT2 — — — 16 6.8 6.8 —
TTMR — — — 10 4.4 4.4 —
STMR — — — 20 7.1 7.1 —
ROTC — — — 26 11 11 —
RAMP — — — 18 7.7 7.7 —
SPD — — — 19 8.3 8.3 —
PLSY — — — 10 4.5 4.5 —
PWM — — — 9.1 3.9 3.9 —
MTR — — — 11 4.9 4.9 —
WAND (s, d)
executed 1.0 0.80 0.50 0.39 0.17 0.17 0.17
WANDP (s, d)
WAND (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
WANDP (s1, s2, d)
DAND (s, d)
executed 1.3 1.04 0.65 0.71 0.31 0.31 0.31
DANDP (s, d)
DAND (s1, s2, d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
DANDP (s1, s2, d)
BKAND n=1 110 87 79 36 16 16 16
(s1, s2, d, n)
BKANDP n = 96 185 155 140 74 32 32 32
(s1, s2, d, n)
WOR (s, d)
executed 1.0 0.80 0.50 0.40 0.17 0.17 0.17
WOR (s, d)
WOR (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
WORP (s1, s2, d)
DOR (s, d)
executed 1.3 1.04 0.65 0.71 0.31 0.31 0.31
DORP (s, d)
DOR (s1, s2, d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
DORP (s1, s2, d)
BKOR (s1, s2, d, n) n=1 110 87 81 36 16 16 16
BKORP (s1, s2, d, n) n = 96 185 155 140 74 32 32 32
WXOR (s, d)
executed 1.0 0.80 0.50 0.39 0.17 0.17 0.17
WXORP (s, d)
WXOR (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
WXORP (s1, s2, d)
DXOR (s, d)
executed 1.3 1.04 0.65 0.71 0.31 0.31 0.31
DXORP (s, d)
DXOR (s1, s2, d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
DXORP (s1, s2, d)
BKXOR n=1 110 87 81 36 16 16 16
(s1, s2, d, n)
BKXORP n = 96 183 155 140 74 32 32 32
(s1, s2, d, n)
WXNR (s, d)
executed 1.0 0.80 0.50 0.40 0.17 0.17 0.17
WXNRP (s, d)
WXNR (s1, s2, d)
executed 1.2 0.96 0.60 0.47 0.20 0.20 0.20
WXNRP (s1, s2, d)
DXNR (s, d)
executed 1.3 1.04 0.65 0.71 0.31 0.31 0.31
DXNRP (s, d)
DXNR (s1,s2,d)
executed 1.5 1.2 0.75 0.79 0.34 0.34 0.34
DXNRP (s1,s2,d)
BKXNR n=1 110 87 82 36 16 16 16
(s1, s2, d, n)
BKXNR n = 96 185 155 140 74 32 32 32
(s1, s2, d, n)
ROR n=1 13 11 9.7 2.0 0.85 0.85 0.85
(d, n) RORP
n = 15 13 11 9.7 2.0 0.85 0.85 0.85
(d, n)

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 14
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
RCR (d, n) n=1 15 12 12 1.6 0.68 0.68 0.68
RCRP (d, n) n = 15 15 13 12 1.6 0.68 0.68 0.68
ROL (d, n) n=1 13 11 10 2.0 0.85 0.85 0.85
ROLP (d, n) n = 15 13 11 10 2.0 0.85 0.85 0.85
RCL (d, n) n=1 15 13 12 1.6 0.68 0.68 0.68
RCLP (d, n) n = 15 16 13 12 1.6 0.68 0.68 0.68
DROR (d, n) n=1 15 12 12 3.9 1.7 1.7 1.7
DRORP (d, n) n = 31 15 13 12 4.0 1.7 1.7 1.7
DRCR (d, n) n=1 17 14 14 4.3 1.8 1.8 1.8
DRCRP (d, n) n = 31 18 16 15 4.3 1.9 1.9 1.9
DROL (d, n) n=1 14 13 12 3.9 1.7 1.7 1.7
DROLP (d, n) n = 31 14 13 12 4.0 1.7 1.7 1.7
DRCL (d, n) n=1 18 15 14 4.3 1.8 1.8 1.8
DRCLP (d, n) n = 31 20 17 16 4.3 1.9 1.9 1.9
SFR (d, n) n=1 13 10 9.7 1.7 0.75 0.75 0.75
SFRP (d, n) n = 15 13 11 9.5 2.0 0.85 0.85 0.85
SFL (d, n) n=1 12 10 9.5 1.7 0.75 0.75 0.75
SFLP (d, n) n = 15 12 9.8 9.5 2.0 0.85 0.85 0.85
BSFR (d, n) n=1 42 35 33 20 8.6 8.6 8.6
BSFRP (d, n) n = 96 69 58 54 24 10 10 10
BSFL (d, n) n=1 41 34 32 20 8.5 8.5 8.5
BSFLP (d, n) n = 96 63 53 50 23 10 10 10
DSFR (d, n) n=1 19 16 15 1.3 0.58 0.58 0.58
DSFRP (d, n) n = 96 71 61 53 25 11 11 11
DSFL (d, n) n=1 19 16 15 1.3 0.58 0.58 0.58
DSFLP (d, n) n = 96 70 60 52 26 11 11 11
BSET (d, n) n=1 27 22 20 7.6 3.3 3.3 3.3
BSETP (d, n) n = 15 27 22 20 7.6 3.3 3.3 3.3
BRST (d, n) n=1 27 22 21 7.6 3.3 3.3 3.3
BRSTP (d, n) n = 15 27 22 21 7.6 3.3 3.3 3.3
TEST (s1, s2, d)
35 30 27 8.2 3.5 3.5 3.5
TESTP (s1, s2, d)
DTEST (s1, s2, d)
37 31 28 9.2 3.9 3.9 3.9
DTESTP (s1, s2, d)
BKRST (s, n) n=1 49 41 38 18 7.8 7.8 7.8
BKRST (s, n) n = 96 64 54 50 19 8.2 8.2 8.2
match 56 54 42 22 9.6 9.6 9.6
n=1
SER (s1, s2, d, n) no match 56 54 42 21 8.9 8.9 8.9
SERP (s1, s2, d, n) match 280 240 220 115 49 49 49
n = 96
no match 280 240 220 133 57 57 57
match 71 67 53 23 9.9 9.9 9.9
n=1
DSER (s1, s2, d, n) no match 71 67 54 23 9.7 9.7 9.7
DSERP (s1, s2, d, n) match 495 415 375 142 61 61 61
n = 96
no match 500 415 375 132 57 57 57
SUM s=0 32 26 25
3.9 1.7 1.7 1.7
SUMP s = FFFFH 27 22 21
DSUM s=0 54 44 42 4.7 2.0 2.0 2.0
DSUMP s = FFFFFFFFH 54 44 42 12 5.0 5.0 5.0
DECO (s, d, n) n=2 60 50 46 20 8.6 8.6 8.6
DECOP (s, d, n) n=8 80 65 61 27 12 12 12
M1 = ON 66 55 51 21 9.1 9.1 9.1
n=2
ENCO (s, d, n) M4 = ON 66 54 51 21 9.1 9.1 9.1
ENCOP (s, d, n) M1 = ON 90 76 71 28 12 12 12
n=8
M256 = ON 76 74 71 26 11 11 11
SEG
8.0 6.8 6.1 1.3 0.54 0.54 0.54
SEGP

Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 15


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
DIS (s, d, n) n=1 47 39 36 18 7.7 7.7 7.7
DISP (s, d, n) n=4 53 43 40 19 8.3 8.3 8.3
UNI (s, d, n) n=1 54 44 41 21 8.9 8.9 8.9
UNIP (s, d, n) n=4 60 49 46 23 9.7 9.7 9.7
NDIS (s1, d, s2)
92 76 38 41 18 18 18
NDISP (s1, d, s2)
NUNI (s1, d, s2)
47 39 36 42 18 18 18
NUNIP (s1, d, s2)
WTOB (s, d, n) n=1 56 46 42 47 20 20 20
WTOBP (s, d, n) n = 96 190 155 145 99 43 43 43
BTOW (s, d, n) n=1 56 46 42 45 19 19 19
BTOWP (s, d, n) n = 96 190 155 145 89 38 38 38
MAX (s, d, n) n=1 48 40 36 17 7.1 7.1 7.1
MAXP (s, d, n) n = 96 300 240 235 136 59 59 59
MIN (s, d, n) n=1 48 40 36 17 7.1 7.1 7.1
MINP (s, d, n) n = 96 300 240 235 159 69 69 69
DMAX (s, d, n) n=1 52 43 39 27 12 12 12
DMAXP (s, d, n) n = 96 600 490 460 181 78 78 78
DMIN (s, d, n) n=1 52 43 39 27 12 12 12
DMINP (s, d, n) n = 96 585 475 445 112 48 48 48
SORT n=1 66 55 50 16 7.1 7.1 7.1
(s1, n, s2, d1, d2) n = 96 105 86 80 14 6.2 6.2 6.2
DSORT n=1 98 57 52 17 7.1 7.1 7.1
(s1, n, s2, d1, d2) n = 96 115 96 88 16 6.8 6.8 6.8
WSUM (s, d, n) n=1 52 43 40 16.4 7.1 7.1 7.1
WSUMP (s, d, n) n = 96 175 140 135 68.4 29.5 29.5 29.5
DWSUM (s, d, n) n=1 61 51 46 18.9 8.2 8.2 8.2
DWSUMP (s, d, n) n = 96 515 420 395 130.4 56.1 56.1 56.1
FOR n=0 11 8.9 8.1 2.3 1.0 1.0 1.0
NEXT 8.8 7.3 6.8 3.3 1.4 1.4 1.4
BREAK
37 30 28 11 4.6 4.6 4.6
BREAKP
CALL (pn) internal file pointer 2.1 0.88 0.88 0.88
17 14 13
CALLP (pn) common file pointer 33 14 14 14
CALL
(pn s1 to s5)
245 200 190 135 58 58 58
CALLP
(pn s1 to s5)
Return to origin program 16 13 12 2.9 1.3 1.3 1.3
RET
Return to other program —— — — 20 8.5 8.5 8.5
FCALL (pn) internal file pointer 3.6 1.6 1.6 1.6
29 24 22
FCALLP (pn) Common file pointer 20 8.7 8.7 8.7
FCALL
(pn s1 to s5)
250 205 190 134 57 57 57
FCALLP
(pn s1 to s5)
ECALL (pn)
— — — 77 33 33 33
ECALL P (pn)
ECALL
(pn s1 to s5)
— — — 162 70 70 70
ECALLP
(pn s1 to s5)
EFCALL (pn)
— — — 78 34 34 34
EFCALLP (pn)
EFCALL
(pn s1 to s5)
— — — 200 86 86 86
EFCALLP
(pn s to s5)
COM 110 77 72 55 16 16 16
IX 65 54 51 12 5.2 5.2 5.2

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 16
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
IXEND 30 26 25 4.7 2.0 2.0 2.0
number of contacts: 1 145 120 110 48 21 21 21
IXDEV
number of contacts: 14 770 630 585 93 40 40 40
number of contacts: 1 145 120 110 48 21 21 21
IXSET
number of contacts: 14 770 630 585 93 40 40 40
FIFW number of data points: 1
36 32 28 11 4.5 4.5 4.5
FIFWP number of data points: 96
FIFR number of data points: 1 45 41 36 13 5.6 5.6 5.6
FIFRP number of data points: 96 93 82 70 32 14 14 14
FPOP number of data points: 1
40 37 32 16 7.0 7.0 7.0
FPOPP number of data points: 96
FINS number of data points: 1 53 44 38 20 8.4 8.4 8.4
FINSP number of data points: 96 100 89 76 36 15 15 15
FDEL number of data points: 1 60 50 43 19 7.5 7.5 7.5
FDELP number of data points: 96 110 95 82 39 15 15 15
FROM n3 = 1 125 105 93 47 4) 22 4) 22 4) 224)
(n1, n2, d, n3)
FROMP n3 = 1000 740 695 685 47 6 4) 437 4) 437 4) 437 4)
(n1, n2, d, n3 3))
DFRO n3 = 1 130 110 100 51 4) 24 4) 24 4) 24 4)
(n1, n2, d, n3)
DFROP n3 = 500 745 695 675 478 4) 437 4) 437 4) 4374)
(n1, n2, d, n3 3))
TO n3 = 1 120 105 92 48 4) 20 4) 20 4) 20 4)
(n1, n2, d, n3)
TOP n3 = 1000 735 680 645 479 4) 412 4) 412 4) 412 4)
(n1, n2, d, n3 3))
DTO n3 = 1 130 110 99 50 4) 23 4) 23 4) 23 4)
(n1, n2, d, n3)
DTOP n3 = 500 740 680 640 457 4) 416 4) 416 4) 416 4)
(n1, n2, d, n3 3))
1 character 33 11 11
SM701 ON
PR 32 character — — — 48 18 18 —
SM701 OFF 21 7.8 7.8
PRC — — — 181 16 16 —
displayed
LED — — — — — — —
display completed
displayed
LEDC — — — — — — —
display completed
no display → no display 0.40 0.17 0.17 0.17
LEDR — — —
Execute LED instruction → no display 103 44 44 44
CHKST — — — 5.8 2.5 2.5 2.5
1 input contact no error at contact 1 24 10 10 10
CHK
no error at contact 150 — — — 1676 721 721 721
(error check) 150 input contacts
no error at contact 1 88 38 38 38
CHKCIR 10 failure check circuits — — — 5.8 2.5 2.5 2.5
all internal devices
SLT file registers 8 kByte — — — — — — —
completion of SLT instruction
SLTR — — — — — — —
Start
STRA — — — — — — —
completion of STRA instruction
STRAR — — — — — — —
PTRA — — — — — — —
PTRAR — — — — — — —
3
The FROM/TO instruction differs in processing time according to the number of slots and the loaded modules. (The CPU also differs
in processing time according to the extension base type.)
4
Processing times when the Q312B is used to execute the instruction for the QJ71C24 in slot 0.
Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 17


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
PTRAEXE instruction execution
— — — — — — —
PTRAEXEP program trace
BINDA s=1 15 6.7 6.7 6.7
— — —
BINDAP s = -32768 24 10 10 10
DBINDA s=1 43 18 18 18
— — —
DBINDAP s = -2147483648 86 37 37 37
BINHA s=1 18 7.7 7.7 7.7
— — —
BINHAP s = FFFFH 19 8.2 8.2 8.2
DBINHA s=1 23 10 10 10
— — —
DBINHAP s = FFFFFFFFH 24 10 10 10
BCDDA s=1 23 9.8 9.8 9.8
— — —
BCDDAP s = 9999 21 8.9 8.9 8.9
DBCDDA s=1 22 9.5 9.5 9.5
— — —
DBCDDAP s = 99999999 29 13 13 13
DABIN s=1 57 25 25 25
— — —
DABINP s = -32768 58 25 25 25
DDABIN s=1 92 40 40 40
— — —
DDABINP s = -2147483648 106 46 46 46
HABIN s=1 13 5.8 5.8 5.8
— — —
HABINP s = FFFFH 15 6.4 6.4 6.4
DHABIN s=1 22 9.5 9.5 9.5
— — —
DHABINP s = FFFFFFFFH 25 11 11 11
DABCD s=1 16 6.9 6.9 6.9
— — —
DABCDP s = 9999 17 7.2 7.2 7.2
DDABCD s=1 25 11 11 11
— — —
DDABCDP s = 99999999 29 13 13 13
COMRD
— — — 40 17 17 17
COMRDP
LEN 1 character 18 8.0 8.0 8.0
— — —
LENP 96 characters 86 37 37 37
STR
— — — 53 23 23 23
STRP
DSTR
— — — 123 53 53 53
DSTRP
VAL
— — — 95 41 41 41
VALP
DVAL
— — — 166 72 72 72
DVALP
ESTR
— — — 564 243 243 243
ESTRP
EVAL floating-point format 100 43 43 43
— — —
EVALP exponential format 127 55 55 55
ASC (s, d, n) n=1 64 28 28 28
— — —
ASCP (s, d, n) n = 96 289 125 125 125
HEX (s, d, n) n=1 60 26 26 26
— — —
HEXP (s, d, n) n = 96 343 148 148 148
RIGHT n=1 49 21 21 21
(s, d, n)
— — —
RIGHTP n = 96 131 56 56 56
(s, d, n)
LEFT (s, d, n) n=1 — — — 50 21 21 21
LEFTP (s, d, n) n = 96 — — — 131 56 56 56
MIDR
— — — 53 23 23 23
MIDRP
MIDW
— — — 128 55 55 55
MIDWP
no match 58 25 25 25
INSTR
first — — — 55 24 24 24
INSTRP match
finals 58 25 25 25

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 18
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
EMOD
— — — 527 227 227 227
EMODP
EREXP
— — — 1656 713 713 713
EREXPP
SIN single precision 115 50 50 50
— — —
SINP double precision 1945 837 — —
COS single precision 122 53 53 53
— — —
COSP double precision 2618 1127 — —
TAN single precision 123 53 53 53
— — —
TANP double precision 2618 1127 — —
ASIN single precision 111 48 48 48
— — —
ASINP double precision 2491 1072 — —
ACOS single precision 115 49 49 49
— — —
ACOSP double precision 2367 1019 — —
ATAN single precision 157 68 68 68
— — —
ATANP double precision 3140 1352 — —
RAD single precision 17 7.2 7.2 7.2
— — —
RADP double precision 24 10 — —
DEG single precision 17 7.2 7.2 7.2
— — —
DEGP double precision 23 9.9 — —
SQR single precision 28 12 12 12
— — —
SQRP double precision 1812 780 — —
s = -10
single precision 129 56 56 56
EXP s=1
— — —
EXPP s = -10
double precision 2386 1026 — —
s=1
s=1
single precision 113 49 49 49
LOG s = 10
— — —
LOGP s=1
double precision 2146 924 — —
s = 10
RND
— — — 3.9 1.7 1.7 1.7
RNDP
SRND
— — — 3.5 1.5 1.5 1.5
SRNDP
BSQR s=0 6.2 2.7 2.7 2.7
— — —
BSQRP s = 9999 38 16 16 16
BDSQR s=0 6.2 2.7 2.7 2.7
— — —
BDSQRP s = 99999999 38 16 16 16
BSIN
— — — 12 5.1 5.1 5.1
BSINP
BCOS
— — — 12 5.2 5.2 5.2
BCOSP
BTAN
— — — 12 5.2 5.2 5.2
BTANP
BASIN
— — — 20 8.7 8.7 8.7
BASINP
BACOS
— — — 21 9.0 9.0 9.0
BACOSP
BATAN
— — — 22 9.6 9.6 9.6
BATANP
LIMIT
34 28 26 10 4.3 4.3 4.3
LIMITP
DLIMIT
41 34 30 11 4.7 4.7 4.7
DLIMITP
BAND
33 28 25 9.8 4.2 4.2 4.2
BANDP
DBAND
40 34 30 11 4.9 4.9 4.9
DBANDP
Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 19


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
ZONE
31 25 24 9.1 3.9 3.9 3.9
ZONEP
DZONE
37 29 28 11 4.6 4.6 4.6
DZONEP
RSET
— 18 16 6.8 2.9 2.9 2.9
RSETP
QDRSET
— — — 205 88 88 88
QDRSETP
QCDSET
— — — 147 63 63 63
QCDSETP
DATERD
30 25 23 13 5.5 5.5 5.5
DATERDP
DATEWR
69 57 54 15 6.4 6.4 6.4
DATEWRP
DATE+ no digit increase 47 39 36 13 5.4 5.4 5.4
DATE+P digit increase 50 42 38 13 5.4 5.4 5.4
DATE- no digit increase 47 40 36 12 5.2 5.2 5.2
DATE-P digit increase 50 42 38 12 5.2 5.2 5.2
SECOND
28 24 22 10 4.5 4.5 4.5
SECONDP
HOUR
38 32 29 12 5.2 5.2 5.2
HOURP
1 character
MSG — — — 3.0 1.3 1.3 1.3
32 characters
initial time 20 8.6 8.6 8.6
PKEY — — —
no acceptance 19 8.2 8.2 8.2
PSTOP
— — — 79 34 34 34
PSTOPP
POFF
— — — 79 34 34 34
POFFP
PSCAN
— — — 75 32 32 32
PSCANP
PLOW
— — — 80 34 34 34
PLOWP
WDT
18 15 14 5.9 2.6 2.6 2.6
WDTP
DUTY 41 36 32 9.3 4.0 4.0 4.0
ZRRDB
— 24 22 7.9 3.4 3.4 3.4
ZRRDBP
ZRWRB
— 27 24 9.4 4.0 4.0 4.0
ZRWRBP
ADRSET
23 19 18 4.9 2.1 2.1 2.1
ADRSETP
KEY — — — 17 7.3 7.3 —
ZPUSH
38 33 30 11 4.7 4.7 4.7
ZPUSHP
ZPOP
37 31 29 5.1 2.2 2.2 2.2
ZPOPP
EPROMWR
— — — — — — —
EPROMWRP
ZCOM 105 82 80 691 289 289 289
READ — — — 554 — — —
SREAD — — — 588 — — —
WRITE — — — 582 — — —
SWRITE — — — 625 — — —
SEND — — — — — — —
RECV — — — — — — —
REQ — — — — — — —
ZNFR — — — — — — —

Tab. A-9: Processing times for QCPU (except Universal model CPU)

A – 20
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Processing
Instruction (Device) Basic model High Performance Process Redund.
Q00J Q00 Q01 Qn QnH QnPH QnPRH
ZNTO — — — — — — —
— — — — — — —
ZNRD
— — — — — — —
— — — — — — —
ZNWR
— — — — — — —
RFRP — — — — — — —
RTOP — — — — — — —
UNIRD n=1 96 80 74
79 34 34 34
UNIRDP n = 16 440 370 340
Start 176 76 76 76
TRACE — — —
completion of the TRACE instruction 6.3 2.7 2.7 2.7
TRACER — — — 19 8.2 8.2 8.2
SP.FWRITE — — — 84 36 36 36
SP.FREAD — — — 82 35 35 35
PLOADP — — — 58 25 25 —
PUNLOADP — — — 272 117 117 —
PSWAPP — — — 308 133 133 —
1 point 45.5 20 20 20
When standard RAM is used — — —
1000 points 215 91 91 91
RBMOV
1 point 49.5 22 22 22
When SRAM card is used — — —
1000 points 540 305 305 305

Tab. A-9: Processing times for QCPU (except Universal model CPU)

Programming MELSEC System Q and L series A – 21


Processing times for MELSEC System Q CPUs Appendix A

A.2.2 Instructions executable by the product with the first 5 digits of the serial
No. "04122" or higher (Basic model QCPU)

Processing time (μs)


Instruction Condition (Device)
Q00J Q00 Q01
continuity 43.0 35.5 33
LDE = single precision
no continuity 46.0 38.0 35.5
not executed 1.5 1.2 1.0
ANDE = single precision continuity 35.5 29.5 26.5
executed
no continuity 42.0 35.0 32.5
not executed 1.5 1.2 1.0
ORE = single precision continuity 42.0 35.0 32.5
executed
no continuity 37.0 31.0 28.5
continuity 46.0 38.0 35.5
LDE < > single precision
no continuity 43.5 36.0 33.0
not executed 1.5 1.2 1.0
ANDE < > single precision continuity 38.5 31.5 29.0
executed
no continuity 39.5 33.0 30.5
not executed 1.5 1.2 1.0
ORE < > single precision continuity 45.0 37.5 35.0
executed
no continuity 34.5 29.0 26.5
continuity 46.0 37.5 35.5
LDE > single precision
no continuity 46.0 38.5 35.0
not executed 1.5 1.2 1.0
ANDE > single precision continuity 38.5 32.0 29.0
executed
no continuity 42.0 35.0 32.5
not executed 1.5 1.2 1.0
ORE > single precision continuity 45.0 37.5 34.5
executed
no continuity 37.0 31.0 29.0
continuity 45.5 37.5 35.0
LDE < = single precision
no continuity 46.5 38.5 35.5
not executed 1.5 1.2 1.0
ANDE < = single precision continuity 38.5 31.5 29.0
executed
no continuity 42.5 35.5 32.5
not executed 1.5 1.2 1.0
ORE < = single precision continuity 45.0 37.5 34.5
executed
no continuity 37.5 31.5 28.5
continuity 45.5 37.5 35
LDE < single precision
no continuity 46.5 38.5 35.5
not executed 1.5 1.2 1.0
ANDE < single precision continuity 38.0 31.5 29.0
executed
no continuity 42.5 35.5 32.5
not executed 1.5 1.2 1.0
ORE < single precision continuity 45.0 37.5 34.5
executed
no continuity 37.5 31.5 29
continuity 45.5 38.0 35.5
LDE > = single precision
no continuity 46.5 38.0 35.0
not executed 1.5 1.2 1.0
ANDE > = single precision continuity 38.5 32.0 29.0
executed
no continuity 42.5 35.5 32.5
not executed 1.5 1.2 1.0
ORE > = single precision continuity 45.0 38.5 34.5
executed
no continuity 37.5 31.0 28.5

Tab. A-10:Processing times for Basic model QCPU with serial no. 04122... or higher

A – 22
Appendix A Processing times for MELSEC System Q CPUs

Processing time (μs)


Instruction Condition (Device)
Q00J Q00 Q01
E+ (s, d) s = 0, d = 0 29.5 25.0 23.0
single precision
E+P (s, d) s = 2127 , d = 2127 65.5 60.5 49.5
E+ (s1, s2, d) s1 = 0, s2 = 0 31.0 27.0 24.0
single precision
E+P (s1, s2, d) s1 = 2127 , s2 = 2127 66.5 56.0 51.0
E - (s, d) s = 0, d = 0 29.5 25.0 23.0
single precision
E -P (s, d) s=2 ,d=2127 127 48.5 41.0 37.5
E - (s1, s2, d) s1 = 0, s2 = 0 31.0 27.0 24.0
single precision
E -P (s1, s2, d) s1 = 2127 , s2 = 2127 50.5 42.5 38.5
E* (s1, s2, d) s1 = 0, s2 = 0 30.0 25.5 23.0
single precision
E*P (s1, s2, d) 127
s1 = 2 , s2 = 2 127 65.5 55.0 49.5
E/ (s1, s2, d) s1 = 0, s2 = 0 30.0 26.0 23.0
single precision
E/P (s1, s2, d) s1 = 2127 , s2 = –2126 69.5 57.5 53.0
INT s=0 21.5 18.5 16.0
single precision
INTP s = 32766.5 38.0 32.0 29.5
DINT s=0 23.0 19.5 17.5
single precision
DINTP s = 1234567890.3 42.0 35.5 32.0
FLT s=0 22.5 19.5 17.0
single precision
FLTP s = 7FFFH 26.5 23.0 20.0
DFLT s=0 23.0 20.0 17.5
single precision
DFLTP s = 7FFFFFFFH 26.0 23.5 19.5
ENEG s=0 20.5 17.0 15.5
ENEGP s = E - 1.0 31.5 26.0 24.0
EMOV
–– 1.5 1.2 1.0
EMOVP
ESTR
–– 604.0 686.0 831.0
ESTRP
EVAL decimal point format all 2-digit specification 138.0 148.0 196.0
EVALP exponent format all 6-digit specification 164.0 177.0 214.0
SIN
single precision 204.0 173.0 157.0
SINP
COS
single precision 187.0 158.0 144.0
COSP
TAN
single precision 224.0 190.0 173.0
TANP
RAD
single precision 51.0 43.0 39.0
RADP
DEG
single precision 51.0 43.0 39.0
DEGP
SQR
single precision 60.0 51.0 46.5
SQRP
EXP s = - 10 306.0 259.0 235.0
single precision
EXPP s=1 306.0 259.0 235.0
LOG s=1 73.0 61.5 56.0
single precision
LOGP s = 10 301.0 255.0 232.0
RND
–– 12.5 11.0 10.0
RNDP
SRND
–– 13.5 12.0 11.0
SRNDP

Tab. A-10:Processing times for Basic model QCPU with serial no. 04122... or higher

Programming MELSEC System Q and L series A – 23


Processing times for MELSEC System Q CPUs Appendix A

Processing time (μs)


Instruction Condition/Number of Points Processed
Q00J Q00 Q01
Refresh range: 2k words
With auto refresh of CPU shared
memory (0.5k words assigned equally to –– 920 880
COM 1) all CPUs)
Without auto refresh of CPU
–– –– 150 135
shared memory
Read from CPU shared memory of n3 = 1 –– 100 90
host CPU n3 = 320 –– 440 420
FROM
Read from CPU shared memory of n3 = 1 –– 110 105
another CPU n3 = 320 –– 305 290
Write to CPU shared memory of n3 = 1 –– 100 95
TO host CPU n3 = 320 –– 440 425
Write to CPU shared memory of n4 = 1 –– 205 195
S.TO host CPU n4 = 320 –– 545 525
1
If the processing overlaps those of the other CPUs in a multiple CPU system, the processing time increases by a
maximum of the following time.
For a system which consists of a base unit only:
Instruction processing time increase [µs] = 4 x 0,54 x (number of points processed) x (number of CPU modules)

For a system which consists of a base unit and extension base units:
Instruction processing time increase [µs] = 4 x 1,30 x (number od points processed) x (number of CPU modules)
Tab. A-11: Processing times for Basic model QCPU with serial no. 04122... or higher

A – 24
Appendix A Processing times for MELSEC System Q CPUs

A.2.3 Table of the time to be added (Basic model QCPU)

When using a file register (ZR), module access device (Un\G and U3En\G0 to G511), and
link direct device (Jn\), add the processing time shown in the following table to that of the
instruction.

Processing time (μs)


Device Name Data Device Specification Location
Q00J Q00 Q01
Source –– 34 32
Bit
Destination –– 23 22
Source –– 13 12
File register (ZR) Word
Destination –– 9 8
Source –– 14 13
Double word
Destination –– 10 9
Source 99 82 77
Bit
Destination 167 137 129
Module access device Source 74 61 58
Word
(Un\G , U3En\G0 to G511) Destination 72 60 56
Source 76 63 59
Double word
Destination 92 75 71
Source 178 147 137
Bit
Destination 303 248 233
Source 154 126 118
Link direct device (Jn\ ) Word
Destination 153 125 117
Source 155 127 119
Double word
Destination 163 133 125

Tab. A-12: Processing time to be added (Basic model QCPU)

Programming MELSEC System Q and L series A – 25


Processing times for MELSEC System Q CPUs Appendix A

A.2.4 Instructions availabe from function version B (High Performance model


QCPU/Process CPU/Redundant CPU)

Processing time (μs)


Processing
Instruction (Device) High Performance Process Redund.
Qn QnH QnPH QnPRH
Refresh range = 2 k words
(0.5 k words for each CPU) 720 660 660 —
With automatic refresh of
COM 1) CPU shared memory Refresh range = 4 k words 860 730 730 —
(1 k words for each CPU
Without automatic refresh of CPU shared memory 43 20 20 20
Read from shared memory n3 = 1 59 29 29 —
of another CPU n3 = 1000 530 500 500 —
main base unit 51 24 24 —
n3 = 1 extension base
FROM 1) unit
54 27 27 —
Read from buffer memory of
a special function module 2) main base unit 540 480 480 —
n3 = 1000 extension base 1100 1050 1050 —
unit
n3 = 1 ("TO" instruction)
Writing to CPU shared 74 33 33 —
S.TO n4 = 1 ("S.TO" instruction)
memory of host CPU
n2 = 256 126 54 54 —
S(P).DATERD 3) Reading data of the expansion clock 25 11 11 11
S(P).DATE+ 3) Expansion clock data addition operation 38 17 17 17
S(P).DATE– 3) Expansion clock data subtraction operation 38 17 17 17
1 If
the processing overlaps those of the other CPUs in a multiple CPU system, the processing time increases by a
maximum of the following time.
For a system which consists of a base unit only:
Instruction processing time increase [µs] = 0,54 x (number of points processed) x (number of CPU modules)

For a system which consists of a base unit and extension base units:
Instruction processing time increase [µs] = 1,30 x (number of points processed) x (number of CPU modules)

2
The instruction processing time for special function modules under control of the CPU which is executing the
instruction is identical to the instruction processing time for special function modules under control of another
CPU of the multi-CPU system.
3
Products with the first 5 digits of the serial No. "07032" or higher are applicable.
Tab. A-13: Instructions for CPU modules availabe from function version B

A – 26
Appendix A Processing times for MELSEC System Q CPUs

A.2.5 Table of the time to be added


(High Performance model QCPU/Process CPU/Redundant CPU)

When using a file register (ZR), module access device (Un\G and U3En\G0 to G4096), and
link direct device (Jn\), add the processing time shown in the following table to that of the
instruction.

Device Specification Processing time (μs)


Device Name Data
Location Qn QnH QnPH QnPRH
Source 5.56 2.40 2.40 2.40
Bit
Destination 4.44 1.91 1.91 1.91
When standard Source 2.60 1.12 1.12 1.12
Word
RAM is used Destination 3.76 1.62 1.62 1.62
Source 2.83 1.22 1.22 1.22
Double word
Destination 4.00 1.72 1.72 1.72
File register (ZR)
Source 5.22 2.25 2.25 2.25
Bit
Destination 4.09 1.76 1.76 1.76
When SRAM card
is used (Q2MEM- Source 2.25 0.97 0.97 0.97
Word
1MBS, Q2MEM- Destination 3.42 1.47 1.47 1.47
2MBS)
Source 2.49 1.07 1.07 1.07
Double word
Destination 3.65 1.57 1.57 1.57
Source 35.56 15.31 15.31 15.31
Bit
Destination 65.08 28.01 28.01 28.01
Module access device Source 32.76 14.10 14.10 14.10
Word
(Un\G, U3En\G0 to G4095) Destination 28.84 12.41 12.41 12.41
Source 32.99 14.20 14.20 14.20
Double word
Destination 29.07 12.51 12.51 12.51
Source 75.67 32.57 32.57 32.57
Bit
Destination 138.65 59.67 59.67 59.67
Source 72.73 31.30 31.30 31.30
Link direct device (Jn\ ) Word
Destination 137.32 59.10 59.10 59.10
Source 72.96 31.40 31.40 31.40
Double word
Destination 137.55 59.20 59.20 59.20

Tab. A-14: Processing time to be added (High Performance model QCPU/Process CPU/
Redundant CPU)

A.2.6 Redundant system instruction

Processing time (μs)


Instruction Condition (Device)
Qn QnH QnPH QnPRH
SP.CONTSW — — — 9.6

Tab. A-15: Processing time (instruction SP.CONTSW)

Programming MELSEC System Q and L series A – 27


Operation Processing Time of Universal Model QCPU Appendix A

A.3 Operation Processing Time of Universal Model QCPU


NOTES  The processing time shown in section A.3.1 applies when the device used in an instruction
meets the device condition for subset processing (for device condition triggering subset pro-
cessing, refer to section 3.8.1).
 When using a file register (R, ZR), extended data register (D), extended link register (W), and
module access device (U3En\G10000 and the subsequent devices), add the processing
time shown in tables A-18 and A-19 to that of the instruction.
 When using an F, T(ST), C device with an OUT/SET/RST instruction, add the processing
time for each instruction, with reference to the adding time in tables A-20 and A-21.
 Since the processing time of an instruction varies depending on that of the cache function,
both the minimum and maximum values are described in the table.

A.3.1 Subset instruction processing time

● Q00UJCPU, Q00UCPU, Q01UCPU and Q02UCPU


Processing time (μs)
Processing
Instruction Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
(Device)
Min. Max. Min. Max. Min. Max. Min. Max.
LD
LDI
AND
ANI
OR
ORI
executed 0.120 0.080 0.060 0.040
LDP
LDF
ANDP
ANDF
ORP
ORF
LDPI
executed 0.360 0.240 0.180 0.120
LDFI
ANDPI
ANDFI
executed 0.480 0.320 0.240 0.160
ORPI
ORFI
not changed
OUT 0.120 0.080 0.060 0.040
changed
not executed
SET RST not changed 0.120 0.080 0.060 0.040
executed
changed
continuity
LD= 0.360 0.240 0.180 0.120
no continuity
not executed
AND= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR= continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LD<> 0.360 0.240 0.180 0.120
no continuity

Tab. A-16: Processing times for Universal model QCPU (1)

A – 28
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed
AND<> continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR<> continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LD> 0.360 0.240 0.180 0.120
no continuity
not executed
AND> continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR> continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LD<= 0.360 0.240 0.180 0.120
no continuity
not executed
AND<= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR<= continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LD< 0.360 0.240 0.180 0.120
no continuity
not executed
AND< continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR< continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LD>= 0.360 0.240 0.180 0.120
no continuity
not executed
AND>= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
OR>= continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD= 0.360 0.240 0.180 0.120
no continuity
not executed
ANDD= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD= continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD<> 0.360 0.240 0.180 0.120
no continuity

Tab. A-16: Processing times for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 29


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed
ANDD<> continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD<> continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD> 0.360 0.240 0.180 0.120
no continuity
not executed
ANDD> continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD> continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD<= 0.360 0.240 0.180 0.120
no continuity
not executed
ANDD<= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD<= continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD< 0.360 0.240 0.180 0.120
no continuity
not executed
ANDD< continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD< continuity 0.360 0.240 0.180 0.120
executed
no continuity
continuity
LDD>= 0.360 0.240 0.180 0.120
no continuity
not executed
ANDD>= continuity 0.360 0.240 0.180 0.120
executed
no continuity
not executed
ORD>= continuity 0.360 0.240 0.180 0.120
executed
no continuity
+ (s, d) executed 0.360 0.240 0.180 0.120
+ (s1, s2, d) executed 0.480 0.320 0.240 0.160
- (s, d) executed 0.360 0.240 0.180 0.120
- (s1, s2, d) executed 0.480 0.320 0.240 0.160
d + (s, d) executed 0.360 0.240 0.180 0.120
d + (s1, s2, d) executed 0.480 0.320 0.240 0.160
d - (s, d) executed 0.360 0.240 0.180 0.120
d - (s1, s2, d) executed 0.480 0.320 0.240 0.160
* (s1, s2, d) executed 0.420 0.300 0.240 0.180
/ (s1, s2, d) executed 0.520 0.400 0.340 0.280
d * (s1, s2, d) executed 0.500 0.380 0.320 0.260
d/ (s1, s2, d) executed 0.640 0.520 0.460 0.400

Tab. A-16: Processing times for Universal model QCPU (1)

A – 30
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
B + (s, d) executed 3.100 12.300 3.100 12.300 3.100 12.300 3.300 8.300
B + (s1, s2, d) executed 5.900 13.500 5.900 13.500 5.900 13.500 4.600 6.200
B - (s, d) executed 3.150 12.300 3.150 12.300 3.150 12.300 3.300 9.000
B - (s1, s2, d) executed 5.950 13.600 5.950 13.600 5.950 13.600 4.600 8.200
B * (s1, s2, d) executed 3.700 12.100 3.700 12.100 3.700 12.100 4.000 8.200
B/ (s1, s2, d) executed 4.000 14.000 4.000 14.000 4.000 14.000 4.200 12.400
s = 0, d = 0 0.420 0.300 0.240 0.180
E + (s, d) single precision
s = 2127, d = 2127 0.420 0.300 0.240 0.180
s1 = 0, s2 = 0 0.540 0.380 0.300 0.220
E + (s1, s2, d) single precision
s1 = 2127, s2 = 2127 0.540 0.380 0.300 0.220
s = 0, d = 0 0.420 0.300 0.240 0.180
E - (s, d) single precision
127 127 0.420 0.300 0.240 0.180
s=2 ,d=2
s1 = 0, s2 = 0 0.540 0.380 0.300 0.220
E - (s1, s2, d) single precision
s1 = 2127, s2 = 2127 0.540 0.380 0.300 0.220
s1 = 0, s2 = 0 0.420 0.300 0.240 0.180
E * (s1, s2, d) single precision
127 127 0.420 0.300 0.240 0.180
s1 = 2 , s2 = 2
E/ (s1, s2, d) single precision s1 = 2127, s2 = 2127 4.900 18.900 4.900 18.900 4.900 18.900 5.100 14.100
INC executed 0.240 0.160 0.120 0.080
DINC executed 0.240 0.160 0.120 0.080
DEC executed 0.240 0.160 0.120 0.080
DDEC executed 0.240 0.160 0.120 0.080
BCD executed 0.320 0.240 0.200 0.160
DBCD executed 0.400 0.320 0.280 0.240
BIN executed 0.260 0.180 0.140 0.100
DBIN executed 0.260 0.180 0.140 0.100
s=0 0.300 0.220 0.180 0.140
FLT single precision
s = 7FFFH 0.300 0.220 0.180 0.140
s=0 0.300 0.220 0.180 0.140
DFLT single precision
s = 7FFFFFFFH 0.300 0.220 0.180 0.140
s=0 0.300 0.220 0.180 0.140
INT single precision
s = 32766.5 0.300 0.220 0.180 0.140
s= 0 0.300 0.220 0.180 0.140
DINT single precision
s= 1234567890.3 0.300 0.220 0.180 0.140
MOV –– 0.240 0.160 0.120 0.080
DMOV –– 0.240 0.160 0.120 0.080
EMOV –– 0.240 0.160 0.120 0.080
CML –– 0.240 0.160 0.120 0.080
DCML –– 0.240 0.160 0.120 0.080
n=1 4.200 4.600 4.200 4.600 4.200 4.600 4.100 4.500
SM237= ON
n=96 4.850 5.150 4.850 5.150 4.850 5.150 4.700 5.100
BMOV
n=1 6.800 11.300 6.800 11.300 6.800 11.300 6.300 8.900
SM237= OFF
n=96 7.450 11.900 7.450 11.900 7.450 11.900 5.900 9.500
n=1 4.100 4.600 4.100 4.600 4.100 4.600 4.100 4.600
SM=237 =ON
n=96 4.800 5.200 4.800 5.200 4.800 5.200 4.800 5.200
FMOV
n=1 4.600 8.250 4.600 8.250 4.600 8.250 4.600 7.900
SM237= OFF
n=96 6.150 10.600 6.150 10.600 6.150 10.600 5.300 8.500
XCH –– 2.250 8.100 2.250 8.100 2.250 8.100 2.500 6.000
DXCH –– 2.400 8.200 2.400 8.200 2.400 8.200 2.800 7.900

Tab. A-16: Processing times for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 31


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 2.700 2.800 2.700 2.800 2.700 2.800 2.350 2.450
SM237= ON
n=96 6.500 6.800 6.500 6.800 6.500 6.800 5.950 6.000
DFMOV
n=1 4.000 8.150 4.000 8.150 4.000 8.150 3.000 6.950
SM237= OFF
n=96 8.000 12.200 8.000 12.200 8.000 12.200 6.600 10.600
CJ –– 3.500 10.100 3.500 10.100 3.500 10.100 1.900 10.100
SCJ –– 3.500 10.100 3.500 10.100 3.500 10.100 1.900 10.100
JMP –– 3,500 10,100 3,500 10,100 3,500 10,100 1,900 10,100
WAND (s, d) executed 0.360 0.240 0.180 0.120
WAND (s1, s2, d) executed 0.480 0.320 0.240 0.160
DAND (s, d) executed 0.360 0.240 0.180 0.120
DAND (s1, s2, d) executed 0.480 0.320 0.240 0.160
WOR (s, d) executed 0.360 0.240 0.180 0.120
WOR (s1, s2, d) executed 0.480 0.320 0.240 0.160
DOR (s, d) executed 0.360 0.240 0.180 0.120
DOR (s1, s2, d) executed 0.480 0.320 0.240 0.160
WXOR (s, d) executed 0.360 0.240 0.180 0.120
WXOR (s1, s2, d) executed 0.480 0.320 0.240 0.160
DXOR (s, d) executed 0.360 0.240 0.180 0.120
DXOR (s1, s2, d) executed 0.480 0.320 0.240 0.160
WXNR (s, d) executed 0.360 0.240 0.180 0.120
WXNR (s1, s2, d) executed 0.480 0.320 0.240 0.160
DXNR (s, d) executed 0.360 0.240 0.180 0.120
DXNR (s1, s2, d) executed 0.480 0.320 0.240 0.160
n=1 2.250 10.800 2.250 10.800 2.250 10.800 2.300 7.800
ROR (d, n)
n = 15 2.250 10.800 2.350 10.800 2.350 10.800 2.400 7.800
n=1 2.250 10.800 2.250 10.800 2.250 10.800 2.300 3.900
RCR (d, n)
n = 15 2.250 10.800 2.250 10.800 2.250 10.800 2.400 4.100
n=1 2.250 10.800 2.350 10.800 2.350 10.800 2.500 4.600
ROL (d, n)
n = 15 2.250 10.800 2.350 10.800 2.350 10.800 2.400 4.600
n=1 2.250 11.500 2.300 11.500 2.300 11.500 2.400 7.500
RCL (d, n)
n = 15 2.250 11.500 2.300 11.500 2.300 11.500 2.500 7.500
n=1 2.350 11.500 2.350 11.500 2.350 11.500 2.400 10.300
DROR (d, n)
n = 31 2.350 11.500 2.350 11.500 2.350 11.500 2.500 10.300
n=1 2.350 13.300 2.350 13.300 2.350 13.300 2.500 12.700
DRCR (d, n)
n = 31 2.350 14.900 2.350 14.900 2.350 14.900 2.500 12.700
n=1 2.350 10.800 2.350 10.800 2.350 10.800 2.500 11.800
DROL (d, n)
n = 31 2.350 10.800 2.350 10.800 2.350 10.800 2.500 11.800
n=1 2.350 13.300 2.350 13.300 2.350 13.300 2.500 5.100
DRCL (d, n)
n = 31 2.350 13.300 2.350 13.300 2.350 13.300 2.500 5.100
n=1 2.350 9.900 2.350 9.900 2.350 9.900 2.400 6.100
SFR (d, n)
n = 15 2.350 9.900 2.350 9.900 2.350 9.900 2.300 5.700
n=1 2.350 9.850 2.350 9.850 2.350 9.850 2.400 4.300
SFL (d, n)
n = 15 2.350 9.850 2.350 9.850 2.350 9.850 2.400 4.300
n=1 3.250 15.500 3.250 15.500 3.250 15.500 3.300 12.000
DSFR (d, n)
n = 96 32.600 45.000 32.600 45.000 32.600 45.000 32.600 42.200
n=1 3.200 15.500 3.200 15.500 3.200 15.500 3.300 8.200
DSFL (d, n)
n = 96 32.600 45.100 32.600 45.100 32.600 45.100 32.600 37.700
s=0 3.100 8.950 3.100 8.950 3.100 8.950 3.400 6.700
SUM
s = FFFFH 3.000 8.850 3.000 8.850 3.000 8.850 3.500 6.700
SEG executed 2.100 7.700 2.100 7.700 2.100 7.700 2.100 5.900

Tab. A-16: Processing times for Universal model QCPU (1)

A – 32
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
FOR –– 1.500 7.500 1.500 7.500 1.500 7.500 1.200 6.300
Internal file pointer 4.800 5.400 4.800 5.400 4.800 5.400 2.700 4.800
CALL pn
Common pointer 7.100 30.500 7.100 30.500 7.100 30.500 4.400 5.700
CALL pn s1 to s5 –– 50.200 62.000 50.200 62.000 50.200 62.000 28.700 42.600

Tab. A-16: Processing times for Universal model QCPU (1)

NOTE For the instructions for which a leading edge instruction (P) is not described, the processing
time is the same as an ON execution instruction.
Example: MOVP instruction, WANDP instruction etc.

● Q03UD(E)HCPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q10UD(E)HCPU, Q13UD(E)HCPU,


Q20UD(E)HCPU, Q26UD(E)HCPU, Q50UDEHCPU, and Q100UDEHCPU
Processing time (μs)
Processing Q10/Q13/Q20/
Instruction (Device) Q03UD(E) Q04/Q06UD(E)H Q26UD(E)H Q50/Q100UDEH

Min. Max. Min. Max. Min. Max. Min. Max.


LD
LDI
AND
ANI
OR
ORI
executed 0.020 0.0095 0.0095 0.0095
LDP
LDF
ANDP
ANDF
ORP
ORF
LDPI
executed 0.060 0.0285 0.0285 0.0285
LDFI

ANDPI
ANDFI
executed 0.080 0.038 0.038 0.038
ORPI
ORFI

changed
OUT 0.020 0.0095 0.0095 0.0095
not changed
SET
not executed 0.020 0.0095 0.0095 0.0095
RST
continuity
LD= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
AND= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LD<> 0.060 0.0285 0.0285 0.0285
no continuity

Tab. A-17: Processing times for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 33


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
(Device) Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed
AND<> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR<> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LD> 0.060 0.0285 0.0285 0.0285
no continuity
not executed
AND> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LD<= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
AND<= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR<= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LD< 0.060 0.0285 0.0285 0.0285
no continuity
not executed
AND< continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR< continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LD>= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
AND>= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
OR>= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
ANDD= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD<> 0.060 0.0285 0.0285 0.0285
no continuity

Tab. A-17: Processing times for Universal model QCPU (2)

A – 34
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
(Device) Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed
ANDD<> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD<> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD> 0.060 0.0285 0.0285 0.0285
no continuity
not executed
ANDD> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD> continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD<= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
ANDD<= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD<= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD< 0.060 0.0285 0.0285 0.0285
no continuity
not executed
ANDD< continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD< continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
continuity
LDD>= 0.060 0.0285 0.0285 0.0285
no continuity
not executed
ANDD>= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
not executed
ORD>= continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity
+ (s, d) executed 0.060 0.0285 0.0285 0.0285
+ (s1, s2, d) executed 0.080 0.038 0.038 0.038
- (s, d) executed 0.060 0.0285 0.0285 0.0285
– (s1, s2, d) executed 0.080 0.038 0.038 0.038
d + (s, d) executed 0.060 0.0285 0.0285 0.0285
d + (s1, s2, d) executed 0.080 0.038 0.038 0.038
d - (s, d) executed 0.060 0.0285 0.0285 0.0285
d - (s1, s2, d) executed 0.080 0.038 0.038 0.038
* (s1, s2, d) executed 0.120 0.057 0.057 0.057
/ (s1, s2, d) executed 0.220 0.110 0.110 0.110
d * (s1, s2, d) executed 0.200 0.095 0.095 0.095
d/ (s1, s2, d) executed 0.340 0.170 0.170 0.170

Tab. A-17: Processing times for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 35


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
(Device) Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
B + (s, d) executed 3.300 5.500 3.000 4.100 3.000 4.100 3.000 4.100
B + (s1, s2, d) executed 4.600 6.200 4.200 5.900 4.200 5.900 4.200 5.900
B -(s, d) executed 3.300 4.400 2.900 3.800 2.900 3.800 2.900 3.800
B - (s1, s2, d) executed 4.600 6.300 4.200 4.600 4.200 4.600 4.200 4.600
B * (s1, s2, d) executed 4.000 4.800 3.400 4.800 3.400 4.800 3.400 4.800
B/ (s1, s2, d) executed 4.200 5.700 3.700 5.200 3.700 5.200 3.700 5.200
s = 0, d = 0 0.120 0.057 0.057 0.057
E + (s, d) single precision
127 127 0.120 0.057 0.057 0.057
s=2 ,d=2
s1 = 0, s2 = 0 0.140 0.0665 0.0665 0.0665
E + (s1, s2, d) single precision
s1 = 2127, s2 = 2127 0.140 0.0665 0.0665 0.0665
s = 0, d = 0 0.120 0.057 0.057 0.057
E - (s, d) single precision
s = 2127, d = 2127 0.120 0.057 0.057 0.057
s1 = 0, s2 = 0 0.140 0.0665 0.0665 0.0665
E - (s1, s2, d) single precision
s1 = 2127, s2 = 2127 0.140 0.0665 0.0665 0.0665
s1 = 0, s2 = 0 0.120 0.057 0.057 0.057
E * (s1, s2, d) single precision
s1 = 2127 127
, s2 = 2 0.120 0.057 0.057 0.057
E/ (s1, s2, d) single precision s1 = 2127, s2 = 2127 4.500 5.600 3.900 4.900 0.285 0.285
INC executed 0.040 0.019 0.019 0.019
DINC executed 0.040 0.019 0.019 0.019
DEC executed 0.040 0.019 0.019 0.019
DDEC executed 0.040 0.019 0.019 0.019
BCD executed 0.120 0.057 0.057 0.057
DBCD executed 0.200 0.095 0.095 0.095
BIN executed 0.060 0.0285 0.0285 0.0285
DBIN executed 0.060 0.0285 0.0285 0.0285
FLT s=0 0.100 0.0475 0.0475 0.0475
single precision
s = 7FFFH 0.100 0.0475 0.0475 0.0475
s=0 0.100 0.0475 0.0475 0.0475
DFLT single precision
s = 7FFFFFFFH 0.100 0.0475 0.0475 0.0475
s=0 0.100 0.0475 0.0475 0.0475
INT single precision
s = 32766.5 0.100 0.0475 0.0475 0.0475
s=0 0.100 0.0475 0.0475 0.0475
DINT single precision
s = 1234567890.3 0.100 0.0475 0.0475 0.0475
MOV –– 0.040 0.019 0.019 0.019
DMOV –– 0.040 0.019 0.019 0.019
EMOV –– 0.040 0.019 0.019 0.019
CML –– 0.040 0.019 0.019 0.019
DCML –– 0.040 0.019 0.019 0.019

Tab. A-17: Processing times for Universal model QCPU (2)

A – 36
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
(Device) Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
6.300 8.200 5.400 7.000 5.400 7.000 5.400 7.000
SM237=OFF 1) 8.200 10.600 3.900 5.100 3.900 5.100 3.900 5.100
n=1
BMOV 1) 6.000 7.800 2.900 3.700 2.900 3.700 2.900 3.700
SM237=ON
SM237=OFF 1) 9.300 11.900 4.400 5.700 4.400 5.700 4.400 5.700
n = 96
SM237=ON 1) 7.100 9.100 3.400 4.300 3.400 4.300 3.400 4.300
5.300 5.900 4.200 4.800 4.200 4.800 4.200 4.800
1) 7.000 8.000 3.400 3.800 3.400 3.800 3.400 3.800
SM237=OFF
n=1
FMOV SM237=ON 1) 5.900 6.800 2.800 3.200 2.800 3.200 2.800 3.200
SM237=OFF 1) 7.400 12.200 3.600 5.800 3.600 5.800 3.600 5.800
n = 96
SM237=ON 1) 6.300 11.000 3.000 5.200 3.000 5.200 3.000 5.200
XCH –– 2.500 2.900 1.800 2.300 1.800 2.300 1.800 2.300
DXCH –– 2.800 3.700 2.100 2.900 2.100 2.900 2.100 2.900
SM237=OFF 2.600 3.750 2.250 3.150 2.250 3.150 2.250 3.150
n=1
SM237=ON 2.050 2.250 1.750 1.750 1.750 1.750 1.750 1.750
DFMOV 2)
SM237=OFF 5.850 7.350 4.200 5.500 4.200 5.500 5.380 7.440
n = 96
SM237=ON 5.300 6.000 3.650 4.150 3.650 4.150 4.700 5.500
CJ –– 1.800 2.800 1.400 2.400 1.400 2.400 1.400 2.400
SCJ –– 1.800 2.800 1.400 2.400 1.400 2.400 1.400 2.400
JMP –– 1.800 2.800 1.100 2.400 1.100 2.400 1.100 2.400
WAND (s, d) executed 0.060 0.0285 0.0285 0.0285
WAND (s1, s2, d) executed 0.080 0.038 0.038 0.038
DAND (s, d) executed 0.060 0.0285 0.0285 0.0285
DAND (s1, s2, d) executed 0.080 0.038 0.038 0.038
WOR (s, d) executed 0.060 0.0285 0.0285 0.0285
WOR (s1, s2, d) executed 0.080 0.038 0.038 0.038
DOR (s, d) executed 0.060 0.0285 0.0285 0.0285
DOR (s1, s2, d) executed 0.080 0.038 0.038 0.038
WXOR (s, d) executed 0.060 0.0285 0.0285 0.0285
WXOR (s1, s2, d) executed 0.080 0.038 0.038 0.038
DXOR (s, d) executed 0.060 0.0285 0.0285 0.0285
DXOR (s1, s2, d) executed 0.080 0.038 0.038 0.038
WXNR (s, d) executed 0.060 0.0285 0.0285 0.0285
WXNR (s1, s2, d) executed 0.080 0.038 0.038 0.038
DXNR (s, d) executed 0.060 0.0285 0.0285 0.0285
DXNR (s1, s2, d) executed 0.080 0.038 0.038 0.038
n=1 2.300 3.100 1.700 2.500 1.700 2.500 1.700 2.500
ROR (d, n)
n = 15 2.400 3.100 1.800 2.500 1.800 2.500 1.800 2.500
n=1 2.300 3.900 1.700 3.200 1.700 3.200 1.700 3.200
RCR (d, n)
n = 15 2.400 4.100 1.700 3.200 1.700 3.200 1.700 3.200
n=1 2.400 3.300 1.800 3.200 1.800 3.200 1.800 3.200
ROL (d, n)
n = 15 2.400 3.300 1.800 3.200 1.800 3.200 1.800 3.200
n=1 2.400 2.700 1.800 2.100 1.800 2.100 1.800 2.100
RCL (d, n)
n = 15 2.400 2.800 1.800 2.200 1.800 2.200 1.800 2.200
1
Can be used only for the Q03UDCPU, Q04UDHCPU and Q06UDHCPU whose first 5 digits of serial number is “10012” or higher.
2
Can be used only for the Q03UD(E)CPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q13UD(E)HCPU and Q26UD(E)HCPU whose first 5 digits
of serial number is “10012” or higher.
Tab. A-17: Processing times for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 37


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
(Device) Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 2.400 3.400 1.900 2.700 1.900 2.700 1.900 2.700
DROR (d, n)
n = 31 2.500 3.400 1.900 2.700 1.900 2.700 1.900 2.700
n=1 2.500 4.800 1.900 4.200 1.900 4.200 1.900 4.200
DRCR (d, n)
n = 31 2.500 4.900 1.900 4.200 1.900 4.200 1.900 4.200
n=1 2.500 3.900 1.800 3.200 1.800 3.200 1.800 3.200
DROL (d, n)
n = 31 2.500 3.900 1.800 3.300 1.800 3.300 1.800 3.300
n=1 2.500 4.800 1.900 3.800 1.900 3.800 1.900 3.800
DRCL (d, n)
n = 31 2.500 4.600 1.900 3.800 1.900 3.800 1.900 3.800
n=1 2.400 3.900 1.700 2.600 1.700 2.600 1.700 2.600
SFR (d, n)
n = 15 2.300 3.900 1.800 2.600 1.800 2.600 1.800 2.600
n=1 2.400 4.300 1.800 2.700 1.800 2.700 1.800 2.700
SFL (d, n)
n = 15 2.400 4.300 1.800 2.700 1.800 2.700 1.800 2.700
n=1 2.700 4.800 2.200 4.300 2.200 4.300 2.200 4.300
DSFR (d, n)
n = 96 32.600 35.900 23.900 26.100 23.900 26.100 23.900 26.100
n=1 2.700 4.600 2.100 4.000 2.100 4.000 2.100 4.000
DSFL (d, n)
n = 96 32.600 35.300 23.700 25.800 23.700 25.800 23.700 25.800
s=0 3.400 4.300 2.900 3.600 2.900 3.600 2.900 3.600
SUM
s = FFFFH 3.500 4.200 2.900 3.600 2.900 3.600 2.900 3.600
SEG executed 2.100 2.800 1.500 2.100 1.500 2.100 1.500 2.100
FOR –– 1.200 2.400 0.870 2.100 0.870 2.100 0.870 2.100
Intern file pointer 2.600 4.000 2.300 3.600 2.300 3.600 2.300 3.600
CALL pn
Common pointer 4.000 5.300 3.200 4.900 3.200 4.900 3.200 4.900
CALL pn s1 to s5 –– 28.700 33.400 26.100 29.300 26.100 29.300 26.100 29.300

Tab. A-17: Processing times for Universal model QCPU (2)

NOTE For the instructions for which a leading edge instruction (P) is not described, the processing
time is the same as an ON execution instruction.
Example: MOVP instruction, WANDP instruction etc.

A – 38
Appendix A Operation Processing Time of Universal Model QCPU

Table of the time to be added when file register, extended data register, extended link
register and module access device are used
● Q00UJCPU, Q00UCPU, Q01UCPU and Q02UCPU
Device Processing time (μs)
Device Name Data Specification
Location Q00UJ Q00U Q01U Q02U
Source 0.100 0.100 0.100 0.100
Bit
Destination 0.220 0.220 0.220 0.220
When standard RAM is Source 0.100 0.100 0.100 0.100
Word
used Destination 0.100 0.100 0.100 0.100
Source 0.200 0.200 0.200 0.200
Double word
Destination 0.200 0.200 0.200 0.200
Source –– –– –– 0.220
Bit
Destination –– –– –– 0.420
When SRAM card is used Source –– –– –– 0.220
File register (R) (Q2MEM-1MBS, Q2MEM- Word
2MBS) Destination –– –– –– 0.180
Source –– –– –– 0.440
Double word
Destination –– –– –– 0.380
Source –– –– –– 0.160
Bit
Destination –– –– –– 0.320
When SRAM card is used Source –– –– –– 0.160
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination –– –– –– 0.140
Source –– –– –– 0.320
Double word
Destination –– –– –– 0.300
Source 0.220 0.180 0.160 0.140
Bit
Destination 0.280 0.320 0.300 0.280
When standard RAM is Source 0.220 0.180 0.160 0.140
Word
used Destination 0.220 0.180 0.160 0.140
Source 0.320 0.280 0.260 0.240
Double word
Destination 0.320 0.280 0.260 0.240
Source –– –– –– 0.260
Bit
Destination –– –– –– 0.480
File register (ZR), When SRAM card is used Source –– –– –– 0.260
Extended data register (D), (Q2MEM-1MBS, Q2MEM- Word
Extended link register (W) 2MBS) Destination –– –– –– 0.220
Source –– –– –– 0.480
Double word
Destination –– –– –– 0.420
Source –– –– –– 0.200
Bit
Destination –– –– –– 0.380
When SRAM card is used Source –– –– –– 0.200
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination –– –– –– 0.180
Source –– –– –– 0.360
Double word
Destination –– –– –– 0.340
Source –– –– –– ––
Bit
Destination –– –– –– ––
Module access device Source –– –– –– ––
(Multiple CPU high speed transmission area) Word
(U3En\G10000) Destination –– –– –– ––
Source –– –– –– ––
Double word
Destination –– –– –– ––

Tab. A-18: Processing times to be added for subset instructions for Universal model CPU (1)

Programming MELSEC System Q and L series A – 39


Operation Processing Time of Universal Model QCPU Appendix A

● Q03UD(E)CPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q10UD(E)HCPU,


Q13UDE(H)CPU,Q20UD(E)HCPU, Q26UD(E)HCPU, Q50UDEHCPU and
Q100UDEHCPU
Processing time (μs)
Device
Device Name Data Specification Q04/ Q10/Q13/ Q50/
Location Q03UD(E) Q20/
Q06UD(E)H Q26UD(E)H Q100UDEH

Source 0.100 0.048 0.048 0.048


Bit
Destination 0.100 0.038 0.038 0.038
Source 0.100 0.048 0.048 0.048
When standard RAM is used Word
Destination 0.100 0.038 0.038 0.038
Source 0.200 0.095 0.095 0.095
Double word
Destination 0.200 0.086 0.086 0.086
Source 0.220 0.200 0.200 0.200
Bit
Destination 0.180 0.162 0.162 0.162
When SRAM card is used Source 0.220 0.200 0.200 0.200
File register (R) (Q2MEM-1MBS, Q2MEM- Word
2MBS) Destination 0.180 0.162 0.162 0.162
Source 0.440 0.399 0.399 0.399
Double word
Destination 0.380 0.361 0.361 0.361
Source 0.160 0.152 0.152 0.152
Bit
Destination 0.140 0.133 0.133 0.133
When SRAM card is used Source 0.160 0.152 0.152 0.152
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination 0.140 0.133 0.133 0.133
Source 0.320 0.304 0.304 0.304
Double word
Destination 0.300 0.295 0.295 0.295
Source 0.120 0.057 0.057 0.057
Bit
Destination 0.120 0.048 0.048 0.048
Source 0.120 0.057 0.057 0.057
When standard RAM is used Word
Destination 0.120 0.048 0.048 0.048
Source 0.220 0.105 0.105 0.105
Double word
Destination 0.220 0.095 0.095 0.095
Source 0.240 0.209 0.209 0.209
Bit
Destination 0.200 0.171 0.171 0.171
File register (ZR), When SRAM card is used Source 0.240 0.209 0.209 0.209
Extended data register (D), (Q2MEM-1MBS, Q2MEM- Word
Extended link register (W) 2MBS) Destination 0.200 0.171 0.171 0.171
Source 0.460 0.409 0.409 0.409
Double word
Destination 0.400 0.371 0.371 0.371
Source 0.180 0.162 0.162 0.162
Bit
Destination 0.160 0.143 0.143 0.143
When SRAM card is used Source 0.180 0.162 0.162 0.162
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination 0.160 0.143 0.143 0.143
Source 0.340 0.314 0.314 0.314
Double word
Destination 0.320 0.304 0.304 0.304
Source 0.220 0.181 0.181 0.181
Bit
Destination 0.140 0.105 0.105 0.105
Module access device Source 0.220 0.181 0.181 0.181
Word
(Multiple CPU high speed transmission area) (U3En\G10000) Destination 0.140 0.105 0.105 0.105
Source 0.500 0.437 0.437 0.437
Double word
Destination 0.340 0.285 0.285 0.285

Tab. A-19: Processing times to be added for subset instructions for Universal model CPU (2)

A – 40
Appendix A Operation Processing Time of Universal Model QCPU

Table of the time to be added when F/T(ST)/C device is used in OUT/SET/RST instruction
● Q00UJCPU, Q00UCPU, Q01UCPU and Q02UCPU
Processing time (μs)
Instruction Name Device Name Condition
Q00UJ Q00U Q01U Q02U
not executed 2.900 2.900 2.900 2.100
F when displayed 116.000 116.000 116.000 68.800
executed
display completed 116.000 116.000 116.000 61.600
OUT
not executed 0.360 0.240 0.180 0.120
T(ST), C after time up 0.360 0.240 0.180 0.120
executed
when added 0.360 0.240 0.180 0.120
not executed 0.120 0.080 0.006 0.004
SET F when displayed 116.000 116.000 116.000 68.600
executed
display completed 116.000 116.000 116.000 65.700
not executed 0.120 0.080 0.006 0.004
F when displayed 55.800 55.800 55.800 26.500
executed
RST display completed 29.200 29.200 29.200 21.600
not executed 0.360 0.240 0.180 0.120
T(ST), C
executed 0.360 0.240 0.180 0.120

Tab. A-20: Processing times to be added for Universal model CPU and OUT/SET/RST instructions (1)

● Q03UD(E)CPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q10UD(E)HCPU,


Q13UDE(H)CPU,Q20UD(E)HCPU, Q26UD(E)HCPU, Q50UDEHCPU and
Q100UDEHCPU

Processing time (μs)


Instruction Name Device Name Condition Q10/Q13/
Q04/ Q50/
Q03UD(E) Q06UD(E)H Q20/ Q100UDEH
Q26UD(E)H
not executed 1.940 1.570 1.570 1.570
F when displayed 39.930 38.090 38.090 38.090
executed
display completed 39.750 37.980 37.980 37.980
OUT
not executed 0.060 0.030 0.030 0.030
T(ST), C after time up 0.060 0.030 0.030 0.030
executed
when added 0.000 0.000 0.000 0.000
not executed 42.900 40.600 40.600 40.600
SET F when displayed 39.270 37.900 37.900 37.900
executed
display completed 0.000 0.000 0.000 0.000
not executed 45.260 36.600 36.600 36.600
F when displayed 19.020 16.190 16.190 16.190
executed
RST display completed 0.060 0.030 0.030 0.030
not executed 0.060 0.030 0.030 0.030
T(ST), C
executed 1.940 1.570 1.570 1.570

Tab. A-21: Processing times to be added for Universal model CPU and OUT/SET/RST instructions (2)

Programming MELSEC System Q and L series A – 41


Operation Processing Time of Universal Model QCPU Appendix A

A.3.2 Processing time of instructions other than subset instruction

NOTES  The processing time shown in tables A-22 and A-23 applies when the device used in an in-
struction does not meet the device condition for subset processing (For device condition that
does not trigger subset processing, refer to section 3.8.1).
 For instructions not shown in the following table, refer to tables A-16 and A-17 in section A.3.1.
 When using a file register (R, ZR), extended data register (D), extended link register (W), mo-
dule access device (Un\G and U3En\G0 to G4095), and link direct device (Jn\), add the
processing time shown in tables A-24 and A-25 to that of the instruction.
 Since the processing time of an instruction varies depending on that of the cache function,
both the minimum and maximum values are described in the table.

● Q00UJCPU, Q00UCPU, Q01UCPU and Q02UCPU


Processing time (μs)
Instruction Processing Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
(Device)
Min. Max. Min. Max. Min. Max. Min. Max.
ANB
ORB
MPS –– 0.120 0.080 0.060 0.040
MRD
MPP
not executed
INV 0.120 0.080 0.060 0.040
executed
MEP not executed
0.120 0.080 0.060 0.040
MEF executed
EGP not executed
0.120 0.080 0.060 0.040
EGF executed
PLS –– 1.800 1.900 1.800 1.900 1.800 1.900 1.300 1.600
PLF –– 1.800 1.900 1.800 1.900 1.800 1.900 1.600 1.700
not executed 0.240 0.160 0.120 0.080
FF
executed 1.700 1.800 1.700 1.800 1.700 1.800 1.200 1.500
not executed 0.240 0.160 0.120 0.080
DELTA
executed 4.000 14.700 4.000 14.700 4.000 14.700 2.800 3.600
not executed 0.240 0.160 0.120 0.800
SFT
executed 1.800 12.600 1.800 12.600 1.800 12.600 1.600 6.600
MC –– 0.240 0.160 0.120 0.080
MCR –– 0.120 0.080 0.060 0.040
FEND Error check performed 250.000 250.000 250.000 250.000 250.000 250.000 175.000 252.000
END No error check performed 250.000 250.000 250.000 250.000 250.000 250.000 175.000 221.000
NOP
NOPLF –– 0.120 0.080 0.060 0.040
PAGE
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 10.100
LDE= single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 10.100
not executed 0.360 0.240 0.180 0.120
ANDE= single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.200 12.500
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.400 11.900
not executed 0.360 0.240 0.180 0.120
ORE= single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.600 10.800
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.500 9.800
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 7.700
LDE< > single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.600 8.200

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 42
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.360 0.240 0.180 0.120
ANDE< > single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.300 14.200
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.400 14.200
not executed 0.360 0.240 0.180 0.120
ORE< > single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.600 6.700
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.400 6.600
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 13.700
LDE> single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.600 13.700
not executed 0.360 0.240 0.180 0.120
ANDE> single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.300 8.100
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.200 8.100
not executed 0.360 0.240 0.180 0.120
ORE> single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.600 8.500
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.400 8.100
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 11.100
LDE<= single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 9.600
not executed 0.360 0.240 0.180 0.120
ANDE<= single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.100 7.800
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.400 8.200
not executed 0.360 0.240 0.180 0.120
ORE<= single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.500 10.300
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.400 9.800
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 11.500
LDE< single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 10.900
not executed 0.360 0.240 0.180 0.120
ANDE< single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.300 9.200
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.400 9.400
not executed 0.360 0.240 0.180 0.120
ORE< single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.600 10.400
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.400 9.800
continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 12.200
?LDE>= single precision
no continuity 4.400 20.900 4.400 20.900 4.400 20.900 4.700 11.800
not executed 0.360 0.240 0.180 0.120
ANDE>= single precision executed continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.100 6.700
no continuity 4.200 19.600 4.200 19.600 4.200 19.600 4.400 7.000
not executed 0.360 0.240 0.180 0.120
ORE>= single precision executed continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.600 14.000
no continuity 4.200 17.400 4.200 17.400 4.200 17.400 4.500 14.300
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 21.000
LDED= precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 5.100 21.900
not executed 0.360 0.240 0.180 0.120
double continuity 4.500 34.700 4.500 34.700 4.500 34.700 3.800 17.800
ANDED= precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.100 18.100
not executed 0.360 0.240 0.180 0.120
double
ORED= precision continuity 4.700 33.200 4.700 33.200 4.700 33.200 4.100 23.800
executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 4.900 25.500
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 5.100 23.500
LDED<> precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 22.600

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 43


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.360 0.240 0.180 0.120
double
ANDED<> continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.000 18.800
precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.000 18.700
not executed 0.360 0.240 0.180 0.120
double continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 25.200
ORED<> precision executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 4.100 23.400
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 5.100 25.100
LDED> precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 23.400
not executed 0.360 0.240 0.180 0.120
double
ANDED> continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.000 19.500
precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.100 19.700
not executed 0.360 0.240 0.180 0.120
double
ORED> precision continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 24.200
executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 4.900 25.800
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 22.500
LDED<= precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 13.500
not executed 0.360 0.240 0.180 0.120
double
ANDED<= continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.000 19.600
precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.100 19.700
not executed 0.360 0.240 0.180 0.120
double
ORED<= precision continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 26.300
executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 25.200
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 5.100 25.000
LDED< precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 24.100
not executed 0.360 0.240 0.180 0.120
double
ANDED< continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.000 19.400
precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.100 19.700
not executed 0.360 0.240 0.180 0.120
double
ORED< precision continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 25.100
executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 25.100
double continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.200 13.100
LDED>= precision no continuity 4.700 37.400 4.700 37.400 4.700 37.400 4.300 13.100
not executed 0.360 0.240 0.180 0.120
double continuity 4.500 34.700 4.500 34.700 4.500 34.700 3.900 19.500
ANDED>= precision executed
no continuity 4.500 34.700 4.500 34.700 4.500 34.700 4.100 19.800
not executed 0.360 0.240 0.180 0.120
double
ORED>= precision continuity 4.700 33.200 4.700 33.200 4.700 33.200 5.000 25.100
executed
no continuity 4.700 33.200 4.700 33.200 4.700 33.200 4.200 18.500
continuity 8.300 38.500 8.300 38.500 8.300 38.500 5.500 14.900
LD$=
no continuity 8.300 38.500 8.300 38.500 8.300 38.500 5.500 15.600
not executed 0.360 0.240 0.180 0.120
AND$= continuity 7.200 37.300 7.200 37.300 7.200 37.300 5.200 13.800
executed
no continuity 7.200 37.300 7.200 37.300 7.200 37.300 5.300 14.500
not executed 0.360 0.240 0.180 0.120
OR$= continuity 7.500 36.600 7.500 36.600 7.500 36.600 5.500 14.900
executed
no continuity 7.500 36.600 7.500 36.600 7.500 36.600 5.300 14.600
continuity 8.300 39.300 8.300 39.300 8.300 39.300 5.600 15.200
LD$< >
no continuity 8.300 39.300 8.300 39.300 8.300 39.300 5.600 15.400

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 44
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.360 0.240 0.180
AND$< > continuity 8.000 38.200 8.000 38.200 8.000 38.200 4.300 21.500
executed
no continuity 8.000 38.200 8.000 38.200 8.000 38.200 4.500 23.400
not executed 0.360 0.240 0.180
OR$< > continuity 8.300 37.300 8.300 37.300 8.300 37.300 5.400 17.700
executed
no continuity 8.300 37.300 8.300 37.300 8.300 37.300 5.300 19.400
continuity 8.300 41.600 8.300 41.600 8.300 41.600 6.400 19.200
LD$>
no continuity 8.300 41.600 8.300 41.600 8.300 41.600 5.600 20.100
not executed 0.360 0.240 0.180
AND$> continuity 8.000 38.100 8.000 38.100 8.000 38.100 4.500 15.400
executed
no continuity 8.000 38.100 8.000 38.100 8.000 38.100 4.600 15.300
not executed 0.360 0.240 0.180
OR$> continuity 8.200 35.700 8.200 35.700 8.200 35.700 5.400 20.000
executed
no continuity 8.200 35.700 8.200 35.700 8.200 35.700 5.400 22.100
continuity 8.300 39.200 8.300 39.200 8.300 39.200 5.800 12.800
LD$<=
no continuity 8.300 39.200 8.300 39.200 8.300 39.200 6.300 13.900
not executed 0.360 0.240 0.180
AND$<= continuity 7.100 36.500 7.100 36.500 7.100 36.500 6.000 16.000
executed
no continuity 7.100 36.500 7.100 36.500 7.100 36.500 6.100 16.200
not executed 0.360 0.240 0.180
OR$<= continuity 7.400 35.600 7.400 35.600 7.400 35.600 4.700 14.600
executed
no continuity 7.400 35.600 7.400 35.600 7.400 35.600 4.600 14.400
continuity 7.400 40.000 7.400 40.000 7.400 40.000 4.800 17.000
LD$<
no continuity 7.400 40.000 7.400 40.000 7.400 40.000 5.500 18.000
not executed 0.360 0.240 0.180
AND$< continuity 8.000 37.300 8.000 37.300 8.000 37.300 5.900 13.400
executed
no continuity 8.000 37.300 8.000 37.300 8.000 37.300 6.200 14.500
not executed 0.360 0.240 0.180
OR$< continuity 8.300 35.600 8.300 35.600 8.300 35.600 6.200 18.700
executed
no continuity 8.300 35.600 8.300 35.600 8.300 35.600 5.400 19.700
continuity 7.400 38.300 7.400 38.300 7.400 38.300 4.800 10.000
LD$>=
no continuity 7.400 38.300 7.400 38.300 7.400 38.300 5.500 11.200
not executed 0.360 0.240 0.180
AND$>= continuity 7.200 37.300 7.200 37.300 7.200 37.300 4.400 21.600
executed
no continuity 7.200 37.300 7.200 37.300 7.200 37.300 4.500 21.800
not executed 0.360 0.240 0.180
OR$>= continuity 8.200 36.400 8.200 36.400 8.200 36.400 5.400 15.400
executed
no continuity 8.200 36.400 8.200 36.400 8.200 36.400 5.300 15.300
BKCMP = n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.200 22.600
(s1, s2, d, n) n = 96 64.500 85.500 64.500 85.500 64.500 85.500 57.400 72.500
BKCMP<> n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.200 22.500
(s1, s2, d, n) n = 96 66.600 87.500 66.600 87.500 66.600 87.500 59.500 74.500
BKCMP> n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.200 23.100
(s1, s2, d, n) n = 96 66.600 87.500 66.600 87.500 66.600 87.500 59.500 74.400
BKCMP<= n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.200 22.500
(s1, s2, d, n) n = 96 64.500 85.500 64.500 85.500 64.500 85.500 57.400 72.400
BKCMP< n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.300 23.000
(s1, s2, d, n) n = 96 66.600 87.500 66.600 87.500 66.600 87.500 59.500 74.500
BKCMP>= n=1 15.300 36.100 15.300 36.100 15.300 36.100 8.200 22.500
(s1, s2, d, n) n = 96 64.500 85.500 64.500 85.500 64.500 85.500 57.400 72.400

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 45


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
DBKCMP = n=1 15.800 36.300 15.800 36.300 15.800 36.300 9.350 29.000
(s1, s2, d, n) n = 96 64.900 85.700 64.900 85.700 64.900 85.700 60.700 78.400
DBKCMP<> n=1 15.700 36.300 15.700 36.300 15.700 36.300 9.350 28.900
(s1, s2, d, n) n = 96 67.000 87.700 67.000 87.700 67.000 87.700 62.500 80.300
DBKCMP> n=1 15.800 36.300 15.800 36.300 15.800 36.300 9.350 29.000
(s1, s2, d, n) n = 96 67.000 87.700 67.000 87.700 67.000 87.700 62.600 80.300
DBKCMP<= n=1 15.700 36.300 15.700 36.300 15.700 36.300 9.350 29.000
(s1, s2, d, n) n = 96 64.800 85.700 64.800 85.700 64.800 85.700 60.800 78.400
DBKCMP< n=1 15.800 36.300 15.800 36.300 15.800 36.300 9.350 29.000
(s1, s2, d, n) n = 96 67.000 87.700 67.000 87.700 67.000 87.700 62.700 80.400
DBKCMP>= n=1 15.700 36.300 15.700 36.300 15.700 36.300 9.300 29.000
(s1, s2, d, n) n = 96 64.800 85.700 64.800 85.700 64.800 85.700 60.700 78.400
DB + (s, d) executed 5.750 13.300 5.750 13.300 5.750 13.300 4.900 7.500
DB + (s1, s2, d) executed 5.650 13.200 5.650 13.200 5.650 13.200 5.200 11.000
DB - (s, d) executed 5.750 12.700 5.750 12.700 5.750 12.700 4.900 10.200
DB - (s1, s2, d) executed 5.650 12.600 5.650 12.600 5.650 12.600 5.200 8.600
DB * (s1, s2, d) executed 8.750 40.200 8.750 40.200 8.750 40.200 8.300 22.200
DB/ (s1, s2, d) executed 5.750 21.500 5.750 21.500 5.750 21.500 6.100 19.200
double s = 0, d = 0 4.500 26.700 4.500 26.700 4.500 26.700 4.800 16.800
ED + (s, d) precision s = 21023 , d = 21023 5.800 32.900 5.800 32.900 5.800 32.900 4.800 16.800
double s1 = 0, s2 = 0 5.450 35.400 5.450 35.400 5.450 35.400 7.100 20.100
ED + (s1, s2, d) precision 1023 , s2 = 21023
s1 = 2 6.750 41.400 6.750 41.400 6.750 41.400 7.100 20.100
double s = 0, d = 0 5.200 25.900 5.200 25.900 5.200 25.900 5.000 17.300
ED - (s, d) precision s = 21023 , d = 21023 6.000 27.700 6.000 27.700 6.000 27.700 5.000 17.300
double s1 = 0, s2 = 0 5.550 32.900 5.550 32.900 5.550 32.900 6.000 16.300
ED - (s1, s2, d) precision 1023 , s2 = 21023
s1 = 2 5.750 33.900 5.750 33.900 5.750 33.900 6.000 16.300
double s1 = 0, s2 = 0 5.550 34.400 5.550 34.400 5.550 34.400 10.500 22.300
ED * (s1, s2, d) precision s1 = 21023 , s2 = 21023 5.950 39.100 5.950 39.100 5.950 39.100 10.500 22.300
double
ED / (s1, s2, d) precision s1 = 21023 , s2 = 21023 8.050 44.200 8.050 44.200 8.050 44.200 7.500 27.200
n=1 13.500 28.500 13.500 28.500 13.500 28.500 12.100 19.700
BK + (s1, s2, d, n)
n = 96 63.100 78.200 63.100 78.200 63.100 78.200 61.700 69.300
n=1 13.500 28.500 13.500 28.500 13.500 28.500 12.100 20.600
BK - (s1, s2, d, n)
n = 96 63.100 78.200 63.100 78.200 63.100 78.200 61.700 70.200
DBK + n=1 10.100 24.200 10.100 24.200 10.100 24.200 7.050 19.200
(s1, s2, d, n) n = 96 59.800 73.900 59.800 73.900 59.800 73.900 59.400 68.900
DBK - n=1 10.100 24.200 10.100 24.200 10.100 24.200 7.050 19.900
(s1, s2, d, n) n = 96 59.800 73.900 59.800 73.900 59.800 73.900 59.400 69.600
$ + (s, d) –– 15.400 64.300 15.400 64.300 15.400 64.300 14.400 34.000
$ + (s1, s2, d) –– 19.700 71.000 19.700 71.000 19.700 71.000 9.200 22.900
double s=0 3.100 19.600 3.100 19.600 3.100 19.600 4.000 8.900
FLTD precision s = 7FFFH 3.350 19.900 3.350 19.900 3.350 19.900 3.400 9.000
double s = 7FFFH 3.200 20.400 3.200 20.400 3.200 20.400 4.100 10.800
DFLTD precision s = 7FFFH 3.450 20.500 3.450 20.500 3.450 20.500 3.600 10.800
double s = 7FFFH 3.200 22.900 3.200 22.900 3.200 22.900 3.500 9.300
INTD precision s = 7FFFH 4.100 34.300 4.100 34.300 4.100 34.300 5.100 19.500
double s = 7FFFH 3.200 23.000 3.200 23.000 3.200 23.000 2.600 6.800
DINTD precision s = 7FFFH 4.050 33.500 4.050 33.500 4.050 33.500 3.400 11.700
DBL executed 3.300 5.900 3.300 5.900 3.300 5.900 2.700 3.800
WORD executed 3.000 7.250 3.000 7.250 3.000 7.250 2.900 7.000
GRY executed 3.350 7.500 3.350 7.500 3.350 7.500 2.700 6.100

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 46
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
DGRY executed 3.000 7.200 3.000 7.200 3.000 7.200 2.900 4.600
GBIN executed 4.600 9.700 4.600 9.700 4.600 9.700 4.000 8.200
DGBIN executed 5.550 10.700 5.550 10.700 5.550 10.700 5.500 8.000
NEG executed 3.300 6.850 3.300 6.850 3.300 6.850 2.400 4.100
DNEG executed 3.050 5.700 3.050 5.700 3.050 5.700 2.500 4.300
Floating point = 0 3.100 7.350 3.100 7.350 3.100 7.350 2.500 3.400
ENEG
Floating point = -1.0 3.350 11.700 3.350 11.700 3.350 11.700 2.700 4.500
Floating point = 0 3.000 21.200 3.000 21.200 3.000 21.200 2.200 3.500
EDNEG
Floating point = -1.0 3.100 22.900 3.100 22.900 3.100 22.900 2.400 3.500
n=1 8.700 27.600 8.700 27.600 8.700 27.600 9.700 22.000
BKBCD (s, d, n)
n = 96 84.200 104.000 84.200 104.000 84.200 104.000 74.200 86.500
n=1 8.450 28.100 8.450 28.100 8.450 28.100 8.900 16.300
BKBIN (s, d, n)
n = 96 56.100 75.800 56.100 75.800 56.100 75.800 58.500 65.100
ECON –– 3.100 21.300 3.100 21.300 3.100 21.300 4.300 6.800
EDCON –– 5.050 24.000 5.050 24.000 5.050 24.000 2.800 5.400
EDMOV –– 2.900 22.900 2.900 22.900 2.900 22.900 3.200 7.800
Character string to be transferred = 0 6.250 30.100 6.250 30.100 6.250 30.100 4.500 13.900
$MOV
Character string to be transferred = 32 15.500 39.300 15.500 39.300 15.500 39.300 15.400 17.500
n=1 8.400 20.900 8.400 20.900 8.400 20.900 8.700 15.200
BXCH (d1, d2, n)
n = 96 67.100 79.900 67.100 79.900 67.100 79.900 67.200 74.000
SWAP –– 3.300 3.550 3.300 3.550 3.300 3.550 2.400 2.700
GOEND –– 0.550 0.550 0.550
DI –– 2.800 8.400 2.800 8.400 2.800 8.400 1.800 2.200
EI –– 4.300 12.300 4.300 12.300 4.300 12.300 3.100 3.800
IMASK –– 12.900 40.600 12.900 40.600 12.900 40.600 9.800 25.000
IRET –– 1.000 1.000 1.000
n=1 7.500 26.500 7.500 26.500 7.500 26.500 4.300 16.100
RSF X n
n = 96 11.400 30.400 11.400 30.400 11.400 30.400 11.400 23.700
n=1 7.300 26.300 7.300 26.300 7.300 26.300 3.800 10.000
RSF Y n
n = 96 10.900 29.900 10.900 29.900 10.900 29.900 8.500 15.200
UDCNT1 –– 1.500 7.100 1.500 7.100 1.500 7.100 1.000 2.000
UDCNT2 –– 1.500 6.300 1.500 6.300 1.500 6.300 1.000 4.000
TTMR –– 5.300 20.900 5.300 20.900 5.300 20.900 3.900 6.100
STMR –– 8.900 49.800 8.900 49.800 8.900 49.800 7.200 30.000
ROTC –– 52.300 52.600 52.300 52.600 52.300 52.600 15.200 16.100
RAMP –– 7.400 30.900 7.400 30.900 7.400 30.900 5.900 18.300
SPD –– 1.500 6.300 1.500 6.300 1.500 6.300 1.000 2.800
PLSY –– 6.400 7.100 6.400 7.100 6.400 7.100 3.500 4.700
PWM –– 3.900 4.600 3.900 4.600 3.900 4.600 3.400 3.400
MTR –– 10.100 61.400 10.100 61.400 10.100 61.400 20.500 28.400
BKAND n=1 13.600 28.500 13.600 28.500 13.600 28.500 12.100 20.100
(s1, s2, d, n) n = 96 63.200 78.200 63.200 78.200 63.200 78.200 57.400 63.200
BKOR n=1 13.500 28.500 13.500 28.500 13.500 28.500 7.700 13.200
(s1, s2, d, n) n = 96 63.100 78.200 63.100 78.200 63.100 78.200 57.400 62.800
BKXOR n=1 13.600 28.300 13.600 28.300 13.600 28.300 7.800 13.200
(s1, s2, d, n) n = 96 63.100 78.000 63.100 78.000 63.100 78.000 57.300 62.800
BKXNR n=1 13.500 28.300 13.500 28.300 13.500 28.300 7.800 14.100
(s1, s2, d, n) n = 96 63.100 78.000 63.100 78.000 63.100 78.000 57.400 62.900
n=1 5.050 21.100 5.050 21.100 5.050 21.100 3.700 6.300
BSFR (d, n)
n = 96 9.000 34.800 9.000 34.800 9.000 34.800 10.200 12.800

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 47


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 4.800 19.100 4.800 19.100 4.800 19.100 4.500 8.900
BSFL (d, n)
n = 96 8.550 34.300 8.550 34.300 8.550 34.300 10.100 14.300
n1 = 16 / n2 = 1 10.300 46.500 10.300 46.500 10.300 46.500 8.800 43.400
SFTBR (n1, n2, d)
n1 = 16 / n2 = 15 10.300 46.400 10.300 46.400 10.300 46.400 8.750 43.400
n1 = 16 / n2 = 1 10.500 49.800 10.500 49.800 10.500 49.800 8.050 45.100
SFTBL (n1, n2, d)
n1 = 16 / n2 = 15 10.500 49.800 10.500 49.800 10.500 49.800 8.050 45.100
SFTWR n1 = 16 / n2 = 1 7.950 24.000 7.950 24.000 7.950 24.000 6.500 22.800
(n1, n2, d) n1 = 16 / n2 = 15 7.950 24.100 7.950 24.100 7.950 24.100 6.500 22.800
n1 = 16 / n2 = 1 8.700 23.600 8.700 23.600 8.700 23.600 7.350 23.600
SFTWL (n1, n2, d)
n1 = 16 / n2 = 15 8.650 23.700 8.650 23.700 8.650 23.700 7.300 23.700
n=1 4.550 4.750 4.550 4.750 4.550 4.750 3.000 3.400
BSET (d, n)
n = 15 4.550 4.750 4.550 4.750 4.550 4.750 3.000 3.500
n=1 4.600 4.750 4.600 4.750 4.600 4.750 3.000 3.400
BRST (d, n)
n = 15 4.600 4.750 4.600 4.750 4.600 4.750 3.000 3.400
TEST executed 7.250 13.200 7.250 13.200 7.250 13.200 4.400 6.900
DTEST executed 6.950 12.900 6.950 12.900 6.950 12.900 4.500 7.000
n=1 7.350 11.600 7.350 11.600 7.350 11.600 4.300 5.200
BKRST (d, n)
n = 96 10.100 22.600 10.100 22.600 10.100 22.600 6.500 13.200
All match 6.650 6.800 6.650 6.800 6.650 6.800 5.000 5.300
n=1
None match 6.650 6.800 6.650 6.800 6.650 6.800 5.000 5.300
SER (s1, s2, d, n)
All match 34.000 42.300 34.000 42.300 34.000 42.300 32.300 35.900
n = 96
None match 34.000 42.300 34.000 42.300 34.000 42.300 32.400 35.900
All match 8.000 16.300 8.000 16.300 8.000 16.300 6.800 10.200
n=1
DSER None match 8.000 16.300 8.000 16.300 8.000 16.300 6.800 10.200
(s1, s2, d, n) All match 54.100 62.600 54.100 62.600 54.100 62.600 52.800 56.300
n = 96
None match 54.100 62.600 54.100 62.600 54.100 62.600 52.800 56.300
s=0 4.100 4.200 4.100 4.200 4.100 4.200 3.700 4.100
DSUM (s, d)
s = FFFFFFFFH 4.100 4.200 4.100 4.200 4.100 4.200 3.800 4.100
n=2 8.850 23.000 8.850 23.000 8.850 23.000 6.000 16.400
DECO (s, d, n)
n=8 13.600 36.600 13.600 36.600 13.600 36.600 8.100 15.200
M1 = ON 7.650 11.900 7.650 11.900 7.650 11.900 5.300 6.300
n=2
M4 = ON 7.500 11.700 7.500 11.700 7.500 11.700 5.200 6.200
ENCO (s, d, n)
M1 = ON 14.600 27.800 14.600 27.800 14.600 27.800 10.400 17.900
n=8
M256 = ON 10.600 23.700 10.600 23.700 10.600 23.700 5.700 13.300
n=1 6.500 14.800 6.500 14.800 6.500 14.800 5.000 10.900
DIS (s, d, n)
n=4 6.900 15.200 6.900 15.200 6.900 15.200 5.400 11.300
n=1 6.800 15.100 6.800 15.100 6.800 15.100 5.500 8.900
UNI (s, d, n)
n=4 7.500 15.900 7.500 15.900 7.500 15.900 6.200 9.600
NDIS executed 4.750 18.700 4.750 18.700 4.750 18.700 11.000 16.300
NUNI executed 4.750 18.700 4.750 18.700 4.750 18.700 10.600 16.000
n=1 6.600 14.900 6.600 14.900 6.600 14.900 5.000 6.500
WTOB (s, d, n)
n = 96 37.700 46.100 37.700 46.100 37.700 46.100 36.000 38.400
n=1 7.350 15.600 7.350 15.600 7.350 15.600 5.100 6.100
BTOW (s, d, n)
n = 96 32.100 40.500 32.100 40.500 32.100 40.500 29.900 32.000
n=1 8.250 24.900 8.250 24.900 8.250 24.900 4.300 6.900
MAX (s, d, n)
n = 96 34.200 51.600 34.200 51.600 34.200 51.600 32.000 34.300
n=1 8.250 24.800 8.250 24.800 8.250 24.800 4.400 6.800
MIN (s, d, n)
n = 96 34.200 51.600 34.200 51.600 34.200 51.600 30.300 34.800
n=1 6.800 34.900 6.800 34.900 6.800 34.900 4.800 14.200
DMAX (s, d, n)
n = 96 60.300 89.200 60.300 89.200 60.300 89.200 56.400 68.000

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 48
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 7.600 35.700 7.600 35.700 7.600 35.700 4.800 9.300
DMIN (s, d, n)
n = 96 59.400 90.000 59.400 90.000 59.400 90.000 55.400 62.800
SORT (s1, s2, d1, n=1 10.100 28.900 10.100 28.900 10.100 28.900 6.200 12.200
d2, n) n = 96 52.100 92.400 52.100 92.400 52.100 92.400 6.200 13.100
DSORT (s1, s2, n=1 9.300 29.000 9.300 29.000 9.300 29.000 6.200 10.500
d1, d2, n) n = 96 43.600 89.600 43.600 89.600 43.600 89.600 6.100 10.500
n=1 6.700 15.000 6.700 15.000 6.700 15.000 4.800 6.200
WSUM (s, d, n)
n = 96 28.900 37.100 28.900 37.100 28.900 37.100 26.900 28.700
n=1 8.600 26.800 8.600 26.800 8.600 26.800 5.500 7.000
DWSUM (s, d, n)
n = 96 56.200 74.700 56.200 74.700 56.200 74.700 53.000 56.300
n=1 5.850 19.800 5.850 19.800 5.850 19.800 4.300 17.300
MEAN (s, d, n)
n = 96 17.300 38.200 17.300 38.200 17.300 38.200 16.000 35.500
n=1 6.900 23.300 6.900 23.300 6.900 23.300 5.750 21.900
DMEAN (s, d, n)
n = 96 29.400 49.900 29.400 49.900 29.400 49.900 29.200 48.600
NEXT –– 1.000 1.100 1.000 1.100 1.000 1.100 0.980 1.400
BREAK –– 4.700 25.000 4.700 25.000 4.700 25.000 21.300 17.900
Return to original program 4.100 19.500 4.100 19.500 4.100 19.500 2.000 3.000
RET
Return to other program 4.700 16.700 4.700 16.700 4.700 16.700 2.300 4.900
Internal file pointer 5.400 5.400 5.400 5.400 5.400 5.400 3.300 5.300
FCALL pn
Common pointer 7.600 30.500 7.600 30.500 7.600 30.500 4.900 6.600
FCALL pn s1 to s5 –– 50.400 62.700 50.400 62.700 50.400 62.700 19.800 23.700
ECALL * pn
–– 105.000 214.000 105.000 214.000 105.000 214.000 75.700 134.000
*: Program name
ECALL * pn s1 to
s5 –– 164.000 271.000 164.000 271.000 164.000 271.000 109.000 173.000
*: Program name
EFCALL * pn
–– 105.000 214.000 105.000 214.000 105.000 214.000 76.200 134.000
*: Program name
EFCALL * pn s1 to
s5 –– 164.000 271.000 164.000 271.000 164.000 271.000 90.500 170.000
*: Program name
XCALL –– 5.100 6.700 5.100 6.700 5.100 6.700 3.800 6.400
When selecting I/O refresh only 18.100 89.100 18.100 89.100 18.100 89.100 12.800 79.000
When selecting CC-Link refresh only (master station side) 33.300 132.000 33.300 132.000 33.300 132.000 24.900 119.000
When selecting CC-Link refresh only (local station side) 33.300 132.000 33.300 132.000 33.300 132.000 24.900 119.000
• When selecting MELSECNET/ H refresh only
(Control station side)
78.600 231.000 78.600 231.000 78.600 231.000 54.000 212.000
• When selecting CC-Link IE refresh only
(Control station/ Master station side)
• When selecting MELSECNET/ H refresh only
COM (Normal station side)
78.600 231.000 78.600 231.000 78.600 231.000 54.000 212.000
• When selecting CC-Link IE refresh only
CCOM (Normal station/ Local station side)
When selecting intelli auto refresh only 18.100 89.000 18.100 89.000 18.100 89.000 12.800 79.000
When selecting I/O outside the group only (Input only) 15.700 71.600 15.700 71.600 15.700 71.600 8.600 76.500
When selecting I/O outside the group only (Output only) 40.200 152.000 40.200 152.000 40.200 152.000 26.300 135.000
When selecting I/O outside the group only (Both I/O) 45.800 153.000 45.800 153.000 45.800 153.000 26.100 135.000
When selecting refresh of multiple CPU high speed transmission area
–– –– –– –– –– –– –– ––
only
When selecting communication with peripheral device 18.200 89.000 18.200 89.000 18.200 89.000 7.250 54.300
Number of data points = 0 6.100 14.200 6.100 14.200 6.100 14.200 3.700 10.100
FIFW
Number of data points = 96 6.100 14.200 6.100 14.200 6.100 14.200 3.800 5.200
Number of data points = 0 7.500 15.600 7.500 15.600 7.500 15.600 4.400 5.800
FIFR
Number of data points = 96 37.000 45.000 37.000 45.000 37.000 45.000 33.500 35.200

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 49


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
Number of data points = 0 7.600 15.600 7.600 15.600 7.600 15.600 4.400 10.800
FPOP
Number of data points = 96 7.600 15.600 7.600 15.600 7.600 15.600 4.400 10.800
Number of data points = 0 6.900 15.000 6.900 15.000 6.900 15.000 5.000 10.700
FINS
Number of data points = 96 36.600 44.700 36.600 44.700 36.600 44.700 4.400 10.900
Number of data points = 0 8.000 16.100 8.000 16.100 8.000 16.100 4.900 11.300
FDEL
Number of data points = 96 37.300 45.500 37.300 45.500 37.300 45.500 34.200 35.900
FROM n3 = 1 17.400 74.700 17.400 74.700 17.400 74.700 12.100 71.300
(d, n1, n2, n3) n3 = 1000 406.000 498.500 406.000 498.500 406.000 498.500 402.600 495.100
DFRO n3 = 1 19.600 85.600 19.600 85.600 19.600 85.600 14.600 81.800
(d, n1, n2, n3) n3 = 500 406.000 498.500 406.000 498.500 406.000 498.500 402.600 495.100
n3 = 1 16.400 69.600 16.400 69.600 16.400 69.600 11.700 63.400
TO (s, n1, n2, n3)
n3 = 1000 381.300 471.200 381.300 471.200 381.300 471.200 375.900 464.300
DTO n3 = 1 18.600 85.100 18.600 85.100 18.600 85.100 14.200 78.500
(s, n1, n2, n3) n3 = 500 381.300 471.200 381.300 471.200 381.300 471.200 375.900 464.300
No display ==> no display 1.500 7.100 1.500 7.100 1.500 7.100 5.100 5.100
LEDR
LED instruction execution ==> no display 38.900 109.000 38.900 109.000 38.900 109.000 35.700 89.200
s=1 5.600 13.900 5.600 13.900 5.600 13.900 4.900 6.500
BINDA (s, d)
s = -32768 7.800 16.200 7.800 16.200 7.800 16.200 7.200 8.700
s=1 6.200 14.500 6.200 14.500 6.200 14.500 5.700 7.100
DBINDA (s, d)
s = -2147483648 11.000 19.200 11.000 19.200 11.000 19.200 10.400 12.200
s=1 5.050 13.400 5.050 13.400 5.050 13.400 4.400 5.900
BINHA (s, d)
s = FFFFH 5.050 13.400 5.050 13.400 5.050 13.400 4.400 5.800
s=1 5.600 13.900 5.600 13.900 5.600 13.900 5.200 6.700
DBINHA (s, d)
s = FFFFFFFFH 5.600 13.900 5.600 13.900 5.600 13.900 5.100 6.500
s=1 4.850 13.200 4.850 13.200 4.850 13.200 4.300 5.800
BCDDA (s, d)
s = 9999 5.300 13.600 5.300 13.600 5.300 13.600 4.700 6.100
s=1 5.300 13.600 5.300 13.600 5.300 13.600 4.800 6.300
DBCDDA (s, d)
s = 99999999 6.200 14.500 6.200 14.500 6.200 14.500 5.600 7.100
s=1 7.000 18.500 7.000 18.500 7.000 18.500 6.500 9.000
DABIN (s, d)
s = -32768 6.950 18.500 6.950 18.500 6.950 18.500 6.300 8.900
s=1 9.450 21.000 9.450 21.000 9.450 21.000 9.400 12.000
DDABIN (s, d)
s = -2147483648 9.450 21.000 9.450 21.000 9.450 21.000 9.100 11.600
s=1 5.650 17.100 5.650 17.100 5.650 17.100 4.900 7.500
HABIN (s, d)
s = FFFFH 5.750 17.300 5.750 17.300 5.750 17.300 5.100 8.100
s=1 6.800 18.200 6.800 18.200 6.800 18.200 6.000 8.500
DHABIN(s, d)
s = FFFFFFFFH 7.100 18.600 7.100 18.600 7.100 18.600 6.300 8.900
s=1 5.650 17.200 5.650 17.200 5.650 17.200 5.000 7.500
DABCD (s, d)
s = 9999 5.700 17.200 5.700 17.200 5.700 17.200 5.000 7.500
s=1 6.850 18.300 6.850 18.300 6.850 18.300 6.200 8.800
DDABCD (s, d)
s = 99999999 6.850 18.300 6.850 18.300 6.850 18.300 6.200 8.800
COMRD –– 185.000 188.000 185.000 188.000 185.000 188.000 97.300 97.400
1 character 4.700 16.200 4.700 16.200 4.700 16.200 4.100 6.600
LEN
96 characters 20.600 32.900 20.600 32.900 20.600 32.900 19.800 22.400
STR –– 9.800 36.500 9.800 36.500 9.800 36.500 6.900 14.400
DSTR –– 12.100 40.400 12.100 40.400 12.100 40.400 10.200 20.800
VAL –– 12.200 40.900 12.200 40.900 12.200 40.900 9.800 23.900
DVAL –– 19.400 45.600 19.400 45.600 19.400 45.600 14.000 33.100
ESTR –– 29.700 87.800 29.700 87.800 29.700 87.800 22.100 52.400
Decimal point format all 2-digit specification 23.900 70.400 23.900 70.400 23.900 70.400 23.300 36.500
EVAL
Exponent format all 6-digit specification 23.700 70.300 23.700 70.300 23.700 70.300 23.300 36.400

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 50
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 10.200 41.800 10.200 41.800 10.200 41.800 5.600 19.700
ASC (s, d, n)
n = 96 31.900 66.600 31.900 66.600 31.900 66.600 30.200 44.700
n=1 8.600 43.400 8.600 43.400 8.600 43.400 7.500 23.100
HEX (s, d, n)
n = 96 77.100 115.000 77.100 115.000 77.100 115.000 37.500 53.300
n=1 10.900 29.600 10.900 29.600 10.900 29.600 7.600 11.400
RIGHT (s, d, n)
n = 96 41.400 60.300 41.400 60.300 41.400 60.300 36.300 46.000
n=1 10.600 29.300 10.600 29.300 10.600 29.300 6.500 16.100
LEFT (s, d, n)
n = 96 41.300 60.200 41.300 60.200 41.300 60.200 36.200 46.200
MIDR –– 11.700 30.600 11.700 30.600 11.700 30.600 9.500 19.100
MIDW –– 12.400 24.000 12.400 24.000 12.400 24.000 10.300 18.200
No match 22.000 38.200 22.000 38.200 22.000 38.200 19.300 29.000
INSTR Head 13.300 29.600 13.300 29.600 13.300 29.600 10.300 20.000
Match
End 21.900 38.100 21.900 38.100 21.900 38.100 51.100 60.800
EMOD –– 11.600 24.000 11.600 24.000 11.600 24.000 10.300 15.300
EREXP –– 19.700 28.000 19.700 28.000 19.700 28.000 19.300 22.300
s = 128 / d = 40 / n = 1 47.000 102.000 47.000 102.000 47.000 102.000 44.300 96.700
STRINS (s, d, n)
s = 128 / d = 40 / n = 48 70.100 134.000 70.100 134.000 70.100 134.000 58.800 112.000
s = 128 / d = 40 / n = 1 46.400 93.600 46.400 93.600 46.400 93.600 39.000 78.100
STRDEL (s, d, n)
s = 128 / d = 40 / n = 48 44.500 70.600 44.500 70.600 44.500 70.600 36.000 69.200
SIN single precision 6.400 13.900 6.400 13.900 6.400 13.900 4.500 9.900
COS single precision 6.100 13.500 6.100 13.500 6.100 13.500 4.300 8.200
TAN single precision 8.300 15.000 8.300 15.000 8.300 15.000 5.100 7.200
ASIN single precision 7.300 15.600 7.300 15.600 7.300 15.600 6.100 13.700
ACOS single precision 8.100 16.500 8.100 16.500 8.100 16.500 6.800 11.100
ATAN single precision 5.350 12.000 5.350 12.000 5.350 12.000 4.000 6.900
SIND double precision 13.400 51.300 13.400 51.300 13.400 51.300 9.600 26.000
COSD double precision 14.700 51.700 14.700 51.700 14.700 51.700 10.000 26.900
TAND double precision 17.400 54.400 17.400 54.400 17.400 54.400 11.400 25.300
ASIND double precision 22.600 60.300 22.600 60.300 22.600 60.300 12.100 30.800
ACOSD double precision 19.700 60.000 19.700 60.000 19.700 60.000 11.700 28.000
ATAND double precision 15.000 51.800 15.000 51.800 15.000 51.800 9.700 22.000
RAD single precision 3.200 10.300 3.200 10.300 3.200 10.300 2.500 4.800
RADD double precision 5.200 43.100 5.200 43.100 5.200 43.100 4.100 16.400
DEG single precision 3.200 11.500 3.200 11.500 3.200 11.500 2.500 4.700
DEGD double precision 5.150 43.800 5.150 43.800 5.150 43.800 5.000 18.100
SQR single precision 3.900 12.300 3.900 12.300 3.900 12.300 3.500 9.300
SQRD double precision 7.000 45.700 7.000 45.700 7.000 45.700 5.700 25.400
s = -10 6.350 13.800 6.350 13.800 6.350 13.800 4.000 13.000
EXP (s, d) single precision
s=1 6.350 13.800 6.350 13.800 6.350 13.800 4.000 13.000
double s = -10 15.800 52.700 15.800 52.700 15.800 52.700 8.800 27.600
EXPD (s, d) precision s=1 15.400 52.500 15.400 52.500 15.400 52.500 8.500 27.300
s=1 5.800 14.900 5.800 14.900 5.800 14.900 4.100 8.100
LOG (s, d) single precision
s = 10 7.450 16.500 7.450 16.500 7.450 16.500 6.200 10.300
double s=1 11.000 48.900 11.000 48.900 11.000 48.900 9.500 28.300
LOGD (s, d) precision s = 10 12.600 51.300 12.600 51.300 12.600 51.300 11.100 29.900
RND –– 1.950 5.450 1.950 5.450 1.950 5.450 1.200 2.300
SRND –– 2.750 4.550 2.750 4.550 2.750 4.550 1.400 2.400
s=0 2.500 6.800 2.500 6.800 2.500 6.800 1.800 3.300
BSQR (s, d)
s = 9999 6.400 15.500 6.400 15.500 6.400 15.500 5.100 8.800

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 51


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
s=0 2.600 6.050 2.600 6.050 2.600 6.050 1.900 3.700
BDSQR (s, d)
s = 99999999 8.450 17.600 8.450 17.600 8.450 17.600 7.500 10.900
BSIN –– 11.500 32.800 11.500 32.800 11.500 32.800 8.700 20.200
BCOS –– 10.400 32.500 10.400 32.500 10.400 32.500 7.800 14.400
BTAN –– 12.100 33.700 12.100 33.700 12.100 33.700 9.000 17.000
BASIN –– 13.300 32.800 13.300 32.800 13.300 32.800 12.200 15.100
BACOS –– 13.400 33.700 13.400 33.700 13.400 33.700 13.100 14.900
BATAN –– 12.600 31.400 12.600 31.400 12.600 31.400 11.400 15.700
s1 = 12.3 E + 5;
POW (s1, s2, d) single precision s2 = 3.45 E + 0 12.200 22.100 12.200 22.100 12.200 22.100 8.950 19.500
double s1 = 12.3 E + 5; 27.300 61.000 27.300 61.000 27.300 61.000 19.400 55.200
POWD (s1, s2, d) precision s2 = 3.45 E + 0
LOG10 single precision 8.200 16.500 8.200 16.500 8.200 16.500 5.950 14.800
LOG10D double precision 15.100 48.000 15.100 48.000 15.100 48.000 12.400 46.500
LIMIT –– 5.350 5.500 5.350 5.500 5.350 5.500 5.200 5.400
DLIMIT –– 6.000 6.150 6.000 6.150 6.000 6.150 5.700 5.900
BAND –– 5.450 12.400 5.450 12.400 5.450 12.400 5.400 6.300
DBAND –– 6.050 11.900 6.050 11.900 6.050 11.900 5.800 6.900
ZONE –– 6.250 10.700 6.250 10.700 6.250 10.700 5.200 11.100
DZONE –– 6.000 11.900 6.000 11.900 6.000 11.900 5.700 10.800
Point No. 1 < s1 < Point No. 2 14.900 50.100 14.900 50.100 14.900 50.100 14.700 48.000
SM750 = ON
Point No. 9 < s1 < Point No. 10 15.800 50.900 15.800 50.900 15.800 50.900 19.600 50.400
SCL (s1, s2, d)
Point No. 1 < s1 < Point No. 2 13.900 53.100 13.900 53.100 13.900 53.100 13.700 51.000
SM750 = OFF
Point No. 9 < s1 < Point No. 10 16.600 56.600 16.600 56.600 16.600 56.600 20.400 56.200
Point No. 1 < s1 < Point No. 2 13.400 52.400 13.400 52.400 13.400 52.400 12.800 50.300
SM750 = ON
Point No. 9 < s1 < Point No. 10 14.200 54.100 14.200 54.100 14.200 54.100 17.300 53.500
DSCL (s1, s2, d)
Point No. 1 < s1 < Point No. 2 12.300 53.200 12.300 53.200 12.300 53.200 11.500 51.100
SM750 = OFF
Point No. 9 < s1 < Point No. 10 15.000 57.600 15.000 57.600 15.000 57.600 18.100 57.100
Point No. 1 < s1 < Point No. 2 14.200 53.300 14.200 53.300 14.200 53.300 13.200 51.200
SM750 = ON
Point No. 9 < s1 < Point No. 10 14.900 55.000 14.900 55.000 14.900 55.000 18.000 54.500
SCL2 (s1, s2, d)
Point No. 1 < s1 < Point No. 2 15.000 53.500 15.000 53.500 15.000 53.500 14.000 51.300
SM750 = OFF
Point No. 9 < s1 < Point No. 10 16.300 56.400 16.300 56.400 16.300 56.400 19.300 55.800
Point No. 1 < s1 < Point No. 2 13.400 52.700 13.400 52.700 13.400 52.700 13.100 50.500
SM750 = ON
Point No. 9 < s1 < Point No. 10 14.200 54.300 14.200 54.300 14.200 54.300 18.100 53.700
DSCL2 (s1, s2, d)
Point No. 1 < s1 < Point No. 2 12.300 53.200 12.300 53.200 12.300 53.200 12.100 51.000
SM750 = OFF
Point No. 9 < s1 < Point No. 10 15.000 57.600 15.000 57.600 15.000 57.600 18.900 57.100
Standard RAM 6.800 26.900 6.800 26.900 6.800 26.900 3.000 16.400
RSET
SRAM card –– –– –– –– –– –– 3.000 16.400
SRAM card to standard RAM –– –– –– –– –– –– 230.000 327.000
QDRSET 1.066.0
Standard RAM to SRAM card –– –– –– –– –– –– 997.000 00
SRAM card to standard ROM –– –– –– –– –– –– 525.000 690.000
QCDSET
Standard ROM to SRAM card –– –– –– –– –– –– 490.000 655.000
DATERD –– 5.600 27.800 5.600 27.800 5.600 27.800 5.100 14.700
DATEWR –– 7.800 42.100 7.800 42.100 7.800 42.100 7.100 23.000
No digit increase 14.200 41.200 14.200 41.200 14.200 41.200 6.500 13.100
DATE +
Digit increase 14.200 41.200 14.200 41.200 14.200 41.200 5.700 21.200
No digit increase 15.100 41.200 15.100 41.200 15.100 41.200 6.500 11.500
DATE -
Digit increase 15.100 41.200 15.100 41.200 15.100 41.200 5.700 17.200
SECOND –– 5.800 20.500 5.800 20.500 5.800 20.500 2.600 5.900
HOUR –– 6.200 22.500 6.200 22.500 6.200 22.500 3.000 5.300

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 52
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 8.200 25.500
LDDT =
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
ANDDT= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
ORDT= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
LDDT <>
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
ANDDT<> specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
ORDT<> specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
LDDT>
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 8.200 25.500 7.200 23.400
ANDDT> specified date no continuity 8.200 25.500 8.200 25.500 8.200 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 8.200 25.500 7.400 23.300
ORDT> specified date no continuity 8.200 25.500 8.200 25.500 8.200 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
LDDT<=
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 53


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
ANDDT<= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
ORDT<= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
LDDT<
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
ANDDT< specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
ORDT< specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.400
LDDT>=
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
ANDDT>= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.200 23.400
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.200
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
ORDT>= specified date no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.400 23.300
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current date no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM=
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 54
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
ORTM= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM<>
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM<> specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
ORTM<> specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM>
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM> specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
ORTM> specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM<=
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM<= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
ORTM<= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

Programming MELSEC System Q and L series A – 55


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM<
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM< specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
ORTM< specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.200
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.000
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.300 23.300
LDTM>=
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ANDTM>= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.600 21.900
not executed 0.480 0.320 0.240 0.160
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
ORTM>= specified time no continuity 8.200 25.500 8.200 25.500 6.500 25.500 7.000 23.000
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
current time no continuity 6.500 23.100 6.500 23.100 6.500 23.100 5.900 22.100
S.DATERD –– 9.250 51.000 9.250 51.000 9.250 51.000 7.500 23.400
No digit increase 16.800 75.400 16.800 75.400 16.800 75.400 9.100 23.400
S.DATE +
Digit increase 16.800 75.400 16.800 75.400 16.800 75.400 8.900 22.200
No digit increase 17.600 75.300 17.600 75.300 17.600 75.300 9.000 22.200
S.DATE -
Digit increase 16.900 75.300 16.900 75.300 16.900 75.300 9.800 22.100
PSTOP –– 82.200 199.000 82.200 199.000 82.200 199.000 61.400 84.500
POFF –– 82.600 198.000 82.600 198.000 82.600 198.000 121.000 246.000
PSCAN –– 83.600 200.000 83.600 200.000 83.600 200.000 126.000 232.000
WDT –– 2.900 12.000 2.900 12.000 2.900 12.000 1.300 3.000
DUTY –– 7.700 27.500 7.700 27.500 7.700 27.500 4.900 24.300
TIMCHK –– 5.350 24.500 5.350 24.500 5.350 24.500 7.400 23.300
File register of standard RAM 4.100 4.200 4.100 4.200 4.100 4.200 2.400 2.600
ZRRDB
File register of SRAM card –– –– –– –– –– –– 2.500 2.800
File register of standard RAM 5.400 5.500 5.400 5.500 5.400 5.500 3.100 3.300
ZRWRB
File register of SRAM card –– –– –– –– –– –– 3.300 3.600
ADRSET –– 2.400 6.650 2.400 6.650 2.400 6.650 4.200 4.900
ZPUSH –– 9.200 20.500 9.200 20.500 9.200 20.500 6.900 14.000
ZPOP –– 9.000 15.500 9.000 15.500 9.000 15.500 7.500 12.500

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

A – 56
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Processing
Instruction (Device) Q00UJCPU Q00UCPU Q01UJCPU Q02UJCPU
Min. Max. Min. Max. Min. Max. Min. Max.
When mounting CC-Link module (master station side) 29.400 91.700 29.400 91.700 29.400 91.700 20.600 55.000
When mounting CC-Link module (local station side) 29.500 91.600 29.500 91.600 29.500 91.600 20.600 66.100
S.ZCOM When MELSECNET/H module or CC-Link IE module is mounted
(Control station/Master station side) 79.900 214.000 79.900 214.000 79.900 214.000 102.000 180.000
When MELSECNET/H module or CC-Link IE module is mounted 79.900 214.000 79.900 214.000 79.900 214.000 55.600 168.100
(Normal station/Local station side)
S.RTREAD –– 9.200 57.700 9.200 57.700 9.200 57.700 6.700 33.500
S.RTWRITE –– 10.900 67.100 10.900 67.100 10.900 67.100 8.300 26.000
n2 = 1 6.000 33.100 6.000 33.100 6.000 33.100 4.000 29.100
UNIRD (n1, d, n2)
n2 = 16 16.500 43.600 16.500 43.600 16.500 43.600 12.500 37.600
TYPERD 48.50 141.30 43.50 139.90 43.40 139.80 32.40 134.20
TRACE Start 174.000 174.000 174.000 174.000 174.000 174.000 96.600 103.000
TRACER –– 5.100 15.500 5.100 15.500 5.100 15.500 3.800 13.600
When standard 1 point –– –– 12.200 34.900 12.200 34.900 9.400 31.300
RAM is used 1000 points –– –– 121.500 145.100 121.500 145.100 118.500 141.300
RBMOV (s, d, n)
When SRAM 1 point –– –– –– –– –– –– 9.400 31.400
card is used 1000 points –– –– –– –– –– –– 178.500 201.300
SP.FWRITE –– –– –– –– –– –– –– 9.200 12.100
SP.FREAD –– –– –– –– –– –– –– 489.000 544.000
SP.DEVST –– –– –– –– –– –– –– 87.000 144.000
S.DEVLD –– –– –– –– –– –– –– 127.000 140.000
S.TO Writing to host n4 = 1 64.600 78.100 64.600 78.100 64.600 78.100 64.600 78.100
CPU shared
(n1, n2, n3, n4, d) memory n4 = 320 115.000 126.000 115.000 126.000 115.000 126.000 154.000 126.000
Writing to host n3 = 1 12.700 62.200 12.700 62.200 12.700 62.200 8.300 58.200
TO (n1, n2, s, n3) CPU shared
memory n3 = 320 63.500 112.300 63.500 112.300 63.500 112.300 56.200 107.800

DTO Writing to host n3 = 1 13.500 62.300 13.500 62.300 13.500 62.300 8.600 58.300
CPU shared
(n1, n2, s, n3) memory n3 = 320 112.900 160.800 112.900 160.800 112.900 160.800 106.800 157.300
Reading from n3 = 1 12.100 58.700 12.100 58.700 12.100 58.700 8.400 52.600
host CPU
shared n3 = 320 56.000 101.700 56.000 101.700 56.000 101.700 51.700 96.600
FROM memory
(n1, n2, d, n3) Reading from n3 = 1 24.400 82.900 24.400 82.900 24.400 82.900 16.600 37.000
other CPU n3 = 320 152.000 243.000 152.000 243.000 152.000 243.000 153.000 185.000
shared
memory n3 = 1000 418.000 518.000 418.000 518.000 418.000 518.000 432.000 485.000
Reading from n3 = 1 12.100 58.700 12.100 58.700 12.100 58.700 8.800 53.400
host CPU
shared n3 = 320 97.400 143.700 97.400 143.700 97.400 143.700 94.900 139.600
DFRO memory
(n1, n2, d, n3) Reading from n3 = 1 24.800 94.200 24.800 94.200 24.800 94.200 16.600 47.300
other CPU n3 = 320 276.000 367.000 276.000 367.000 276.000 367.000 278.000 339.000
shared
memory n3 = 1000 799.000 892.000 799.000 892.000 799.000 892.000 841.000 892.000

Tab. A-22: Processing times for instructions other than subset instructions for Universal model QCPU (1)

NOTE For the instructions for which a leading edge instruction (P) is not described, the processing
time is the same as an ON execution instruction.
Example: WORDP instruction, TOP instruction etc.

Programming MELSEC System Q and L series A – 57


Operation Processing Time of Universal Model QCPU Appendix A

● Q03UD(E)JCPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q10UD(E)HCPU, Q13UD(E)HCPU,


Q20UD(E)HCPU, Q26UD(E)HCPU, Q50UDEHCPU, and Q100UDEHCPU

Processing time (μs)


Q10/Q13/Q20/
Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q26UD(E)H Q50/Q100UDEH
Min. Max. Min. Max. Min. Max. Min. Max.
ANB
ORB
MPS –– 0.020 0.0095 0.0095 0.0095
MRD
MPP
not executed
INV 0.020 0.0095 0.0095 0.0095
executed
MEP not executed
0.020 0.0095 0.0095 0.0095
MEF executed
EGP not executed
0.020 0.0095 0.0095 0.0095
EGF executed
PLS –– 1.300 1.600 0.890 1.100 0.890 1.100 0.890 1.100
PLF –– 1.500 1.600 0.940 1.200 0.940 1.200 0.940 1.200
not executed 0.040 0.0185 0.0185 0.0185
FF
executed 1.200 1.500 0.790 0.910 0.790 0.910 0.790 0.910
not executed 0.040 0.0185 0.0185 0.0185
DELTA
executed 2.800 3.600 2.400 3.200 2.400 3.200 2.400 3.200
not executed 0.040 0.0185 0.0185 0.0185
SFT
executed 1.600 3.300 1.100 2.700 1.100 2.700 1.100 2.700
MC –– 0.040 0.0185 0.0185 0.0185
MCR –– 0.040 0.0185 0.0185 0.0185
FEND error check performed 108.000 130.000 75.800 89.300 75.800 89.300 75.800 89.300
END no error check performed 107.000 124.000 75.800 89.800 75.800 89.800 75.800 89.800
NOP
NOPLF –– 0.020 0.0095 0.0095 0.0095
PAGE
continuity 3.700 4.700 3.300 4.300 3.300 4.300 3.300 4.300
LDE= single precision
no continuity 3.800 5.000 3.400 4.500 3.400 4.500 3.400 4.500
not executed
ANDE= single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.300 5.800 3.000 5.100 3.000 5.100 3.000 5.100
not executed 3.500 5.600 3.000 5.200 3.000 5.200 3.000 5.200
ORE= single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.600 4.500 3.200 4.200
continuity 3.500 4.800 3.200 4.300
LDE< > single precision
no continuity 4.000 4.700 3.600 4.200 0.0285 0.0285
not executed 3.900 4.500 3.500 4.000
ANDE< > single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.300 5.100 3.000 4.800
not executednot executed 3.500 5.000 3.100 4.600
ORE< > single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.600 6.000 3.300 5.500
continuity 3.500 5.800 3.100 5.300
LDE> single precision
no continuity 3.800 5.000 3.300 4.600 0.0285 0.0285
not executed 3.700 4.900 3.300 4.400
ANDE> single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.500 4.700 3.100 4.200

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 58
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 3.600 4.500 3.100 4.000
ORE> single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.600 5.100 3.300 4.600
continuity 3.500 4.800 3.200 4.500
LDE<= single precision
no continuity 3.800 5.600 3.400 5.200 0.0285 0.0285
not executed 3.800 5.600 3.400 5.100
ANDE<= single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.200 4.600 2.800 4.200
not executed 3.500 5.000 3.100 4.500
ORE<= single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.700 5.800 3.400 5.400
continuity 3.800 5.700 3.300 5.300
LDE< single precision
no continuity 4.000 5.400 3.500 4.900 0.0285 0.0285
not executed 4.000 5.200 3.500 4.900
ANDE< single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.400 4.600 3.000 4.200
not executed 3.500 4.900 3.100 4.400
ORE< single precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.600 5.200 3.300 4.900
continuity 3.800 6.000 3.300 5.500 0.0285 0.0285
LDE>= single precision
no continuity 3.800 5.900 3.400 5.400
not executed 0.060 0.0285 0.0285 0.0285 0.0285
ANDE>= single precision continuity 3.200 4.800 2.900 4.600
executed
no continuity 3.500 5.400 3.100 5.100
not executed 0.060 0.0285 0.0285 0.0285 0.0285
ORE>= single precision continuity 3.600 5.200 3.300 4.700
executed
no continuity 3.500 5.200 3.200 4.700
continuity 4.100 7.700 3.500 7.200 3.500 7.200 3.500 7.200
LDED= double precision
no continuity 4.300 8.100 3.800 7.400 3.800 7.400 3.800 7.400
not executed
ANDED= double precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.600 7.600 3.200 7.000 3.200 7.000 3.200 7.000
not executed 3.900 7.700 3.400 7.400 3.400 7.400 3.400 7.400
ORED= double precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.800 8.800 3.400 8.300 3.400 8.300 3.400 8.300
continuity 4.000 9.300 3.700 8.800 3.700 8.800 3.700 8.800
LDED<> double precision
no continuity 4.400 8.200 3.900 7.700 3.900 7.700 3.900 7.700
not executed 4.100 7.900 3.500 7.500 3.500 7.500 3.500 7.500
ANDED<> double precision continuity
executed
no continuity 0.060 0.0285 0.0285 0.0285
not executed 3.800 7.600 3.300 7.200 3.300 7.200 3.300 7.200
ORED<> double precision continuity 3.800 7.700 3.400 7.300 3.400 7.300 3.400 7.300
executed
no continuity 0.060 0.0285 0.0285 0.0285
continuity 4.100 9.300 3.700 8.900 3.700 8.900 3.700 8.900
LDED> double precision
no continuity 3.800 8.900 3.400 8.400 3.400 8.400 3.400 8.400
not executed 4.300 8.100 3.800 7.500 3.800 7.500 3.800 7.500
ANDED> double precision continuity 4.100 7.800 3.500 7.200 3.500 7.200 3.500 7.200
executed
no continuity

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 59


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.060 0.0285 0.0285 0.0285
ORED> double precision continuity 3.800 7.700 3.300 7.300 3.300 7.300 3.300 7.300
executed
no continuity 4.000 7.900 3.500 7.500 3.500 7.500 3.500 7.500
continuity 0.060 0.0285 0.0285 0.0285
LDED<= double precision
no continuity 4.100 9.300 3.700 8.800 3.700 8.800 3.700 8.800
not executed 4.100 9.300 3.700 8.800 3.700 8.800 3.700 8.800
ANDED<= double precision continuity 4.000 8.000 3.500 7.400 3.500 7.400 3.500 7.400
executed
no continuity 4.100 9.400 3.600 8.800 3.600 8.800 3.600 8.800
not executed
ORED<= double precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.800 7.700 3.300 7.200 3.300 7.200 3.300 7.200
continuity 4.300 8.300 3.800 7.600 3.800 7.600 3.800 7.600
LDED< double precision
no continuity 3.700 7.900 3.500 7.400 3.500 7.400 3.500 7.400
not executed
ANDED< double precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 3.800 7.800 3.300 7.300 3.300 7.300 3.300 7.300
not executed 3.900 7.900 3.400 3.900 3.400 3.900 3.400 3.900
ORED< double precision continuity 0.060 0.0285 0.0285 0.0285
executed
no continuity 4.100 9.600 3.700 9.200 3.700 9.200 3.700 9.200
continuity 4.000 9.600 3.700 9.200 3.700 9.200 3.700 9.200
LDED>= double precision
no continuity 4.100 9.600 3.600 9.000 3.600 9.000 3.600 9.000
not executed 4.100 9.600 3.600 8.900 3.600 8.900 3.600 8.900
ANDED>= double precision continuity
executed
no continuity 0.060 0.0285 0.0285 0.0285
not executed 3.800 7.900 3.400 7.400 3.400 7.400 3.400 7.400
ORED>= double precision continuity 3.900 8.100 3.400 7.500 3.400 7.500 3.400 7.500
executed
no continuity 0.060 0.0285 0.0285 0.0285
continuity 4.100 9.600 3.700 9.200 3.700 9.200 3.700 9.200
LD$=
no continuity 4.000 7.200 3.600 6.600 3.600 6.600 3.600 6.600
not executed 5.300 8.900 4.700 8.100 4.700 8.100 4.700 8.100
AND$= continuity 4.700 9.000 4.200 8.200 4.200 8.200 4.200 8.200
executed
no continuity 0.060 0.0285 0.0285 0.0285
not executed 4.400 6.800 3.900 6.400 3.900 6.400 3.900 6.400
OR$= continuity 4.500 6.700 4.000 6.300 4.000 6.300 4.000 6.300
executed
no continuity 0.060 0.0285 0.0285 0.0285
continuity 5.100 8.200 4.200 7.600 4.200 7.600 4.200 7.600
LD$< >
no continuity 5.000 8.100 4.000 7.200 4.000 7.200 4.000 7.200
not executed 4.800 8.100 4.300 7.500 4.300 7.500 4.300 7.500
AND$< > continuity 4.700 8.400 4.200 7.800 4.200 7.800 4.200 7.800
executed
no continuity 0.060 0.0285 0.0285 0.0285
not executed 4.300 5.500 4.100 5.100 4.100 5.100 4.100 5.100
OR$< > continuity 4.500 5.900 4.400 5.400 4.400 5.400 4.400 5.400
executed
no continuity 0.060 0.0285 0.0285 0.0285
continuity 5.200 7.300 4.100 6.700 4.100 6.700 4.100 6.700
LD$>
no continuity 5.100 7.200 4.100 6.700 4.100 6.700 4.100 6.700
not executed 4.800 7.200 4.300 6.700 4.300 6.700 4.300 6.700
AND$> continuity 4.800 7.700 4.200 7.100 4.200 7.100 4.200 7.100
executed
no continuity 0.060 0.0285 0.0285 0.0285

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 60
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 4.500 7.100 4.000 6.700 4.000 6.700 4.000 6.700
OR$> continuity 4.600 7.600 4.300 7.000 4.300 7.000 4.300 7.000
executed
no continuity 0.060 0.0285 0.0285 0.0285
continuity 5.100 6.800 4.300 6.200 4.300 6.200 4.300 6.200
LD$<=
no continuity 5.200 7.200 4.300 6.600 4.300 6.600 4.300 6.600
not executed 5.000 6.300 4.400 5.700 4.400 5.700 4.400 5.700
AND$<= continuity 4.800 6.400 4.200 5.800 4.200 5.800 4.200 5.800
executed
no continuity 0.060 0.0285 0.0285 0.0285
not executed 0.060 0.0285 0.0285 0.0285
OR$<= continuity 4.700 7.700 4.400 7.200 4.400 7.200 4.400 7.200
executed
no continuity 4.600 7.600 4.400 7.100 4.400 7.100 4.400 7.100
continuity 4.800 8.100 4.500 7.500 4.500 7.500 4.500 7.500
LD$<
no continuity 5.000 8.300 4.500 7.900 4.500 7.900 4.500 7.900
not executed 0.060 0.0285 0.0285 0.0285
AND$< continuity 4.500 7.100 4.000 6.600 4.000 6.600 4.000 6.600
executed
no continuity 4.900 7.500 4.400 7.100 4.400 7.100 4.400 7.100
not executed 0.060 0.0285 0.0285 0.0285
OR$< continuity 5.100 7.800 4.100 7.200 4.100 7.200 4.100 7.200
executed
no continuity 5.000 8.100 4.100 7.600 4.100 7.600 4.100 7.600
continuity 4.800 6.700 4.500 6.200 4.500 6.200 4.500 6.200
LD$>=
no continuity 5.000 6.700 4.400 6.300 4.400 6.300 4.400 6.300
not executed 0.060 0.0285 0.0285 0.0285
AND$>= continuity 4.400 6.800 4.100 6.300 4.100 6.300 4.100 6.300
executed
no continuity 4.500 7.000 4.200 6.600 4.200 6.600 4.200 6.600
not executed 0.060 0.0285 0.0285 0.0285
OR$>= continuity 5.400 6.600 4.100 5.800 4.100 5.800 4.100 5.800
executed
no continuity 5.300 6.300 4.100 5.700 4.100 5.700 4.100 5.700
BKCMP = n=1 8.200 10.700 7.500 10.000 7.500 10.000 7.500 10.000
(s1, s2, d, n) n = 96 57.400 61.800 46.400 48.700 46.400 48.700 46.400 48.700
BKCMP<> n=1 8.200 10.700 7.500 10.000 7.500 10.000 7.500 10.000
(s1, s2, d, n) n = 96 59.500 63.300 45.600 50.400 45.600 50.400 45.600 50.400
BKCMP> n=1 8.200 10.800 7.500 10.100 7.500 10.100 7.500 10.100
(s1, s2, d, n) n = 96 59.500 63.400 47.700 50.500 47.700 50.500 47.700 50.500
BKCMP<= n=1 8.200 10.600 7.500 10.000 7.500 10.000 7.500 10.000
(s1, s2, d, n) n = 96 57.400 61.700 46.400 49.000 46.400 49.000 46.400 49.000
BKCMP< n=1 8.300 10.600 7.500 10.000 7.500 10.000 7.500 10.000
(s1, s2, d, n) n = 96 59.500 63.600 47.600 50.500 47.600 50.500 47.600 50.500
BKCMP>= n=1 8.200 10.900 7.500 10.000 7.500 10.000 7.500 10.000
(s1, s2, d, n) n = 96 57.400 62.000 46.400 48.900 46.400 48.900 46.400 48.900
DBKCMP = n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800
DBKCMP<> n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800
DBKCMP> n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800
DBKCMP<= n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800
DBKCMP< n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 61


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
DBKCMP>= n=1 9.250 14.000 8.600 13.000 8.600 13.000 8.600 13.000
(s1, s2, d, n) n = 96 60.700 67.500 47.900 52.800 47.900 52.800 47.900 52.800
DB + (s, d) executed 4.900 7.000 4.600 6.400 4.600 6.400 4.600 6.400
DB + (s1, s2, d) executed 5.200 7.300 4.800 6.700 4.800 6.700 4.800 6.700
DB - (s, d) executed 4.900 6.600 4.700 6.000 4.700 6.000 4.700 6.000
DB - (s1, s2, d) executed 5.200 7.500 4.800 6.600 4.800 6.600 4.800 6.600
DB * (s1, s2, d) executed 8.300 12.100 8.100 11.600 8.100 11.600 8.100 11.600
DB/ (s1, s2, d) executed 6.100 9.100 5.800 8.800 5.800 8.800 5.800 8.800
s = 0, d = 0 4.800 8.000 4.300 7.200 4.300 7.200 4.300 7.200
ED + (s, d) double precision
s = 21023 , d = 21023 4.800 8.000 4.300 7.200 4.300 7.200 4.300 7.200
s1 = 0, s2 = 0 5.500 9.800 4.800 9.200 4.800 9.200 4.800 9.200
ED + (s1, s2, d) double precision
1023 1023 5.500 9.800 4.800 9.200 4.800 9.200 4.800 9.200
s1 = 2 , s2 = 2
s = 0, d = 0 5.000 8.200 4.400 7.500 4.400 7.500 4.400 7.500
ED - (s, d) double precision
s = 21023 , d = 21023 5.000 8.200 4.400 7.500 4.400 7.500 4.400 7.500
s1 = 0, s2 = 0 4.400 8.100 3.800 7.500 3.800 7.500 3.800 7.500
ED - (s1, s2, d) double precision
1023 1023 4.400 8.100 3.800 7.500 3.800 7.500 3.800 7.500
s1 = 2 , s2 = 2
s1 = 0, s2 = 0 5.800 9.500 5.100 8.800 5.100 8.800 5.100 8.800
ED * (s1, s2, d) double precision
s1 = 21023 , s2 = 21023 5.800 9.500 5.100 8.800 5.100 8.800 5.100 8.800
ED / (s1, s2, d) double precision s1 = 21023 , s2 = 21023 6.600 10.600 5.900 10.000 5.900 10.000 5.900 10.000
n=1 9.100 11.200 8.500 10.600 8.500 10.600 8.500 10.600
BK + (s1, s2, d, n)
n = 96 60.700 62.900 44.600 47.000 44.600 47.000 44.600 47.000
n=1 9.700 12.000 8.900 11.300 8.900 11.300 8.900 11.300
BK - (s1, s2, d, n)
n = 96 61.300 63.600 45.600 47.900 45.600 47.900 45.600 47.900
DBK + n=1 7.000 10.700 6.450 9.950 6.450 9.950 6.450 9.950
(s1, s2, d, n) n = 96 59.400 63.100 43.700 47.500 43.700 47.500 43.700 47.500
DBK - n=1 7.000 10.700 6.450 9.950 6.450 9.950 6.450 9.950
(s1, s2, d, n) n = 96 59.400 63.100 43.700 47.500 43.700 47.500 43.700 47.500
$ + (s, d) –– 8.800 14.600 8.100 13.900 8.100 13.900 8.100 13.900
$ + (s1, s2, d) –– 7.300 11.100 6.500 10.300 6.500 10.300 6.500 10.300
s=0 2.300 5.000 1.800 4.700 1.800 4.700 1.800 4.700
FLTD double precision
s = 7FFFH 2.500 5.200 2.200 4.800 2.200 4.800 2.200 4.800
s=0 2.400 5.200 2.000 4.900 2.000 4.900 2.000 4.900
DFLTD double precision
s = 7FFFFFFFH 2.700 5.400 2.300 5.100 2.300 5.100 2.300 5.100
s=0 2.700 4.100 2.200 4.100 2.200 4.100 2.200 4.100
INTD double precision
s = 32766.5 3.700 5.900 3.200 5.600 3.200 5.600 3.200 5.600
s=0 2.600 3.900 2.200 3.400 2.200 3.400 2.200 3.400
DINTD double precision
s = 1234567890.3 3.400 5.600 3.000 5.100 3.000 5.100 3.000 5.100
DBL executed 2.700 3.400 2.300 2.700 2.300 2.700 2.300 2.700
WORD executed 2.900 4.300 2.600 3.600 2.600 3.600 2.600 3.600
GRY executed 2.700 3.900 2.300 3.400 2.300 3.400 2.300 3.400
DGRY executed 2.900 3.500 2.500 3.000 2.500 3.000 2.500 3.000
GBIN executed 4.000 4.800 3.800 4.300 3.800 4.300 3.800 4.300
DGBIN executed 5.500 6.100 5.000 5.900 5.000 5.900 5.000 5.900
NEG executed 2.400 3.900 2.000 3.300 2.000 3.300 2.000 3.300
DNEG executed 2.500 3.700 2.500 3.300 2.500 3.300 2.500 3.300
Floating point = 0 2.500 3.300 2.300 2.800 2.300 2.800 2.300 2.800
ENEG
Floating point = -1.0 2.700 4.500 2.500 3.900 2.500 3.900 2.500 3.900
Floating point = 0 2.200 3.500 1.800 3.100 1.800 3.100 1.800 3.100
EDNEG
Floating point = -1.0 2.400 3.500 1.900 3.000 1.900 3.000 1.900 3.000

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 62
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 6.600 8.900 5.900 8.200 5.900 8.200 5.900 8.200
BKBCD (s, d, n)
n = 96 71.300 74.100 61.000 63.400 61.000 63.400 61.000 63.400
n=1 6.500 9.800 5.600 9.300 5.600 9.300 5.600 9.300
BKBIN (s, d, n)
n = 96 56.300 59.500 49.200 52.500 49.200 52.500 49.200 52.500
ECON –– 2.600 5.400 2.100 4.500 2.100 4.500 2.100 4.500
EDCON –– 2.800 5.400 2.500 5.400 2.500 5.400 2.500 5.400
EDMOV –– 2.300 5.500 1.700 5.000 1.700 5.000 1.700 5.000
Character string to be transferred = 0 4.000 6.300 3.400 5.600 3.400 5.600 3.400 5.600
$MOV
Character string to be transferred = 32 14.600 16.500 11.400 13.300 11.400 13.300 11.400 13.300
n=1 6.200 7.900 5.500 7.300 5.500 7.300 5.500 7.300
BXCH (d1, d2, n)
n = 96 67.000 68.800 47.300 49.300 47.300 49.300 47.300 49.300
SWAP –– 2.400 2.700 1.900 2.200 1.900 2.200 1.900 2.200
GOEND –– 0.500 0.500 0.500 0.500
DI –– 1.800 2.200 1.500 1.800 1.500 1.800 1.500 1.800
EI –– 3.100 3.800 3.000 3.300 3.000 3.300 3.000 3.300
IMASK –– 9.800 13.300 7.200 10.500 7.200 10.500 7.200 10.500
IRET –– 1.000 1.000 1.000 1.000
n=1 4.200 5.900 3.700 5.600 3.700 5.600 3.700 5.600
RSF X n
n = 96 11.400 13.800 10.700 12.400 10.700 12.400 10.700 12.400
n=1 3.800 4.800 3.400 4.800 3.400 4.800 3.400 4.800
RSF Y n
n = 96 8.500 9.500 8.100 8.900 8.100 8.900 8.100 8.900
UDCNT1 –– 0.900 1.500 0.500 0.983 0.500 0.983 0.500 0.983
UDCNT2 –– 0.900 1.700 0.600 1.300 0.600 1.300 0.600 1.300
TTMR –– 3.900 6.100 3.400 5.400 3.400 5.400 3.400 5.400
STMR –– 6.800 13.500 5.800 12.500 5.800 12.500 5.800 12.500
ROTC –– 9.000 10.500 8.000 9.400 8.000 9.400 8.000 9.400
RAMP –– 5.900 8.800 5.200 8.400 5.200 8.400 5.200 8.400
SPD –– 0.900 1.900 0.500 1.400 0.500 1.400 0.500 1.400
PLSY –– 1.900 2.200 1.500 1.800 1.500 1.800 1.500 1.800
PWM –– 1.200 1.600 0.900 1.200 0.900 1.200 0.900 1.200
MTR –– 10.400 19.800 9.400 10.000 9.400 10.000 9.400 10.000
n=1 9.000 11.700 8.300 11.000 8.300 11.000 8.300 11.000
BKAND (s1, s2, d, n)
n = 96 57.400 63.100 43.800 47.300 43.800 47.300 43.800 47.300
n=1 7.700 10.000 7.700 9.500 7.700 9.500 7.700 9.500
BKOR (s1, s2, d, n)
n = 96 57.400 61.900 44.300 45.800 44.300 45.800 44.300 45.800
n=1 7.800 10.100 7.300 9.200 7.300 9.200 7.300 9.200
BKXOR (s1, s2, d, n)
n = 96 57.300 61.500 43.800 45.800 43.800 45.800 43.800 45.800
n=1 7.800 9.600 7.600 8.900 7.600 8.900 7.600 8.900
BKXNR (s1, s2, d, n)
n = 96 57.400 61.400 43.900 45.300 43.900 45.300 43.900 45.300
n=1 3.700 5.400 3.200 4.800 3.200 4.800 3.200 4.800
BSFR (d, n)
n = 96 6.900 9.000 5.800 7.700 5.800 7.700 5.800 7.700
n=1 4.100 5.900 3.400 5.100 3.400 5.100 3.400 5.100
BSFL (d, n)
n = 96 7.100 9.100 6.000 7.900 6.000 7.900 6.000 7.900
n1 = 16 / n2 = 1 7.950 17.500 7.600 16.900 7.600 16.900 7.600 16.900
SFTBR (d, n1, n2)
n1 = 16 / n2 = 15 7.950 17.500 7.550 16.900 7.550 16.900 7.550 16.900
n1 = 16 / n2 = 1 7.950 17.900 7.500 17.400 7.500 17.400 7.500 17.400
SFTBL (d, n1, n2)
n1 = 16 / n2 = 15 7.900 17.800 7.500 17.300 7.500 17.300 7.500 17.300
n1 = 16 / n2 = 1 5.950 10.600 4.600 8.700 4.600 8.700 4.600 8.700
SFTWR (d, n1, n2)
n1 = 16 / n2 = 15 5.900 10.600 4.600 8.700 4.600 8.700 4.600 8.700

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 63


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
n1 = 16 / n2 = 1 5.950 10.700 4.550 8.700 4.550 8.700 4.550 8.700
SFTWL (d, n1, n2)
n1 = 16 / n2 = 15 5.950 10.700 4.600 8.800 4.600 8.800 4.600 8.800
n=1 3.000 3.400 2.500 2.800 2.500 2.800 2.500 2.800
BSET (d, n)
n = 15 3.000 3.500 2.500 2.800 2.500 2.800 2.500 2.800
n=1 3.000 3.400 2.600 2.800 2.600 2.800 2.600 2.800
BRST (d, n)
n = 15 3.000 3.400 2.500 2.800 2.500 2.800 2.500 2.800
TEST executed 4.400 5.300 3.700 4.700 3.700 4.700 3.700 4.700
DTEST executed 4.500 5.400 3.900 4.800 3.900 4.800 3.900 4.800
n=1 4.300 4.600 3.700 4.100 3.700 4.100 3.700 4.100
BKRST (d, n)
n = 96 6.000 6.800 5.100 6.000 5.100 6.000 5.100 6.000
All match 4.900 5.300 4.200 4.600 4.200 4.600 4.200 4.600
n=1
None match 5.000 5.300 4.200 4.600 4.200 4.600 4.200 4.600
SER (s1, s2, d, n)
All match 32.300 32.900 25.900 26.300 25.900 26.300 25.900 26.300
n = 96
None match 32.400 32.900 25.900 26.300 25.900 26.300 25.900 26.300
All match 6.100 6.500 5.400 5.700 5.400 5.700 5.400 5.700
n=1
None match 6.200 6.600 5.500 5.900 5.500 5.900 5.500 5.900
DSER (s1, s2, d, n)
All match 52.800 54.200 41.200 41.800 41.200 41.800 41.200 41.800
n = 96
None match 52.800 54.200 41.200 41.800 41.200 41.800 41.200 41.800
s=0 3.700 4.100 3.300 3.600 3.300 3.600 3.300 3.600
DSUM (s, d)
s = FFFFFFFFH 3.800 4.100 3.200 3.700 3.200 3.700 3.200 3.700
n=2 6.000 7.500 5.300 6.900 5.300 6.900 5.300 6.900
DECO (s, d, n)
n=8 8.100 9.300 6.800 7.800 6.800 7.800 6.800 7.800
M1 = ON 5.300 5.700 4.700 5.100 4.700 5.100 4.700 5.100
n=2
M4 = ON 5.200 5.700 4.600 5.000 4.600 5.000 4.600 5.000
ENCO (s, d, n)
M1 = ON 10.400 11.400 9.000 10.000 9.000 10.000 9.000 10.000
n=8
M256 = ON 5.700 6.800 5.100 6.100 5.100 6.100 5.100 6.100
n=1 4.400 5.300 3.800 4.600 3.800 4.600 3.800 4.600
DIS (s, d, n)
n=4 4.800 5.700 4.000 5.000 4.000 5.000 4.000 5.000
n=1 5.000 5.300 3.500 4.800 3.500 4.800 3.500 4.800
UNI (s, d, n)
n=4 5.600 6.000 4.000 5.100 4.000 5.100 4.000 5.100
NDIS executed 11.000 13.100 11.000 13.200 11.000 13.200 11.000 13.200
NUNI executed 10.600 12.700 7.300 13.200 7.300 13.200 7.300 13.200
n=1 5.000 6.500 4.400 5.800 4.400 5.800 4.400 5.800
WTOB (s, d, n)
n = 96 36.000 38.400 28.200 29.300 28.200 29.300 28.200 29.300
n=1 5.100 6.100 4.600 5.500 4.600 5.500 4.600 5.500
BTOW (s, d, n)
n = 96 29.900 32.000 22.800 23.800 22.800 23.800 22.800 23.800
n=1 4.300 6.900 4.000 6.100 4.000 6.100 4.000 6.100
MAX (s, d, n)
n = 96 31.200 33.500 24.700 27.000 24.700 27.000 24.700 27.000
n=1 4.400 6.800 4.000 6.000 4.000 6.000 4.000 6.000
MIN (s, d, n)
n = 96 30.300 34.800 26.500 28.300 26.500 28.300 26.500 28.300
n=1 4.800 9.100 4.800 8.100 4.800 8.100 4.800 8.100
DMAX (s, d, n)
n = 96 56.400 62.200 47.100 49.600 47.100 49.600 47.100 49.600
n=1 4.800 6.800 4.300 5.900 4.300 5.900 4.300 5.900
DMIN (s, d, n)
n = 96 55.400 60.200 45.400 47.400 45.400 47.400 45.400 47.400
SORT n=1 6.200 9.300 5.600 8.800 5.600 8.800 5.600 8.800
(s1, n, s2, d1, d2) n = 96 6.200 9.400 5.600 8.600 5.600 8.600 5.600 8.600
DSORT n=1 6.200 9.300 5.600 8.200 5.600 8.200 5.600 8.200
(s1, n, s2, d1, d2) n = 96 6.100 9.100 5.600 8.400 5.600 8.400 5.600 8.400
n=1 4.800 6.200 4.200 5.500 4.200 5.500 4.200 5.500
WSUM (s, d, n)
n = 96 26.900 28.700 21.300 22.300 21.300 22.300 21.300 22.300

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 64
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
n=1 5.500 7.000 4.800 6.100 4.800 6.100 4.800 6.100
DWSUM (s, d, n)
n = 96 53.000 56.300 42.700 44.000 42.700 44.000 42.700 44.000
n=1 4.300 8.650 3.900 7.800 3.900 7.800 3.900 7.800
MEAN (s, d, n)
n = 96 16.000 21.400 12.900 18.000 12.900 18.000 12.900 18.000
n=1 5.700 10.600 5.300 9.950 5.300 9.950 5.300 9.950
DMEAN (s, d, n)
n = 96 29.200 35.200 23.000 28.800 23.000 28.800 23.000 28.800
NEXT –– 0.940 1.400 0.770 1.200 0.770 1.200 0.770 1.200
BREAK –– 10.400 5.500 9.100 5.000 9.100 5.000 9.100 5.000
Return to original program 2.000 3.000 1.600 2.600 1.600 2.600 1.600 2.600
RET
Return to other program 2.300 3.700 2.000 3.100 2.000 3.100 2.000 3.100
Internal file pointer 3.100 4.400 2.700 3.600 2.700 3.600 2.700 3.600
FCALL pn
Common pointer 4.000 5.700 3.600 5.100 3.600 5.100 3.600 5.100
FCALL pn s1 to s5 –– 19.300 21.500 16.500 18.600 16.500 18.600 16.500 18.600
ECALL * pn
–– 70.300 82.300 65.900 77.600 65.900 77.600 65.900 77.600
*: Program name

ECALL * pn s1 to s5
–– 101.000 114.000 91.800 105.000 91.800 105.000 91.800 105.000
*: Program name

EFCALL * pn
–– 70.700 82.800 66.200 78.100 66.200 78.100 66.200 78.100
*: Program name

EFCALL * pn s1 to s5
–– 86.500 107.000 78.800 91.600 78.800 91.600 78.800 91.600
*: Program name
XCALL –– 3.800 5.700 3.700 5.200 3.700 5.200 3.700 5.200
When selecting I/O refresh only 12.800 29.100 12.400 28.600 12.400 28.600 12.400 28.600
When selecting CC-Link refresh only (master station side) 16.000 39.500 15.500 39.100 15.500 39.100 15.500 39.100
When selecting CC-Link refresh only (local station side) 16.100 39.500 15.500 39.100 15.500 39.100 15.500 39.100
• When selecting MELSECNET/ H refresh only
(Control station side) 34.700 70.400 34.400 69.800 34.400 69.800 34.400 69.800
• When selecting CC-Link IE refresh only
(Control station/ Master station side)
• When selecting MELSECNET/ H refresh only
(Normal station side)
COM • When selecting CC-Link IE refresh only 34.700 70.400 34.400 69.800 34.400 69.800 34.400 69.800
CCOM (Normal station/ Local station side)
When selecting intelli auto refresh only 12.800 33.200 12.800 33.200 12.800 33.200 12.800 33.200
When selecting I/O outside the group only (Input only) 7.900 21.100 7.700 20.700 7.700 20.700 7.700 20.700
When selecting I/O outside the group only (Output only) 16.900 44.800 16.500 44.200 16.500 44.200 16.500 44.200
When selecting I/O outside the group only (Both I/O) 22.600 52.600 22.400 52.600 22.400 52.600 22.400 52.600
When selecting refresh of multiple CPU high speed transmission
area only 13.000 33.800 12.700 33.200 12.700 33.200 12.700 33.200
When selecting communication with peripheral device 7.250 18.800 7.100 18.500 7.100 18.500 7.100 18.500
Number of data points = 0 3.700 5.300 3.200 4.600 3.200 4.600 3.200 4.600
FIFW
Number of data points = 96 3.800 4.400 3.300 3.800 3.300 3.800 3.300 3.800
Number of data points = 01 4.300 5.000 3.800 4.400 3.800 4.400 3.800 4.400
FIFR
Number of data points = 96 33.500 35.500 24.800 25.700 24.800 25.700 24.800 25.700
Number of data points = 01 4.300 5.900 3.800 5.300 3.800 5.300 3.800 5.300
FPOP
Number of data points = 96 4.300 5.900 3.700 5.400 3.700 5.400 3.700 5.400
Number of data points = 0 4.800 5.900 3.700 5.300 3.700 5.300 3.700 5.300
FINS
Number of data points = 96 4.300 5.900 3.700 5.300 3.700 5.300 3.700 5.300
Number of data points = 01 4.900 6.500 4.200 5.800 4.200 5.800 4.200 5.800
FDEL
Number of data points = 96 34.200 35.900 25.400 25.900 25.400 25.900 25.400 25.900
n3 = 1 10.800 24.100 10.700 23.600 10.700 23.600 10.700 23.600
FROM (n1, n2, d, n3)
n3 = 1000 392.600 413.300 390.900 410.200 390.900 410.200 390.900 410.200

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 65


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
n3 = 1 13.600 27.700 12.600 26.700 12.600 26.700 12.600 26.700
DFRO (n1, n2, d, n3)
n3 = 500 392.600 413.300 390.900 410.200 390.900 410.200 390.900 410.200
n3 = 1 10.200 21.900 9.600 21.300 9.600 21.300 9.600 21.300
TO (n1, n2, s, n3)
n3 = 1000 373.700 394.100 372.500 390.800 372.500 390.800 372.500 390.800
n3 = 1 13.000 26.700 12.000 25.700 12.000 25.700 12.000 25.700
DTO (n1, n2, s, n3)
n3 = 500 373.700 394.100 372.500 390.800 372.500 390.800 372.500 390.800
No display ==> no display 2.400 2.600 1.900 2.000 1.900 2.000 1.900 2.000
LEDR
LED instruction execution ==> no display 28.100 39.400 24.400 35.800 24.400 35.800 24.400 35.800
s=1 4.900 6.500 4.300 5.600 4.300 5.600 4.300 5.600
BINDA (s, d)
s = -32768 7.200 8.700 6.500 8.000 6.500 8.000 6.500 8.000
s=1 5.700 7.100 4.900 6.300 4.900 6.300 4.900 6.300
DBINDA (s, d)
s = -2147483648 10.400 12.000 9.600 11.000 9.600 11.000 9.600 11.000
s=1 4.400 5.900 3.800 5.200 3.800 5.200 3.800 5.200
BINHA(s, d)
s = FFFFH 4.400 5.800 3.700 5.200 3.700 5.200 3.700 5.200
s=1 5.200 6.700 4.600 6.000 4.600 6.000 4.600 6.000
DBINHA (s, d)
s = FFFFFFFFH 5.100 6.500 4.600 6.000 4.600 6.000 4.600 6.000
s=1 4.300 5.800 3.600 5.000 3.600 5.000 3.600 5.000
BCDDA (s, d)
s = 9999 4.700 6.100 4.100 5.400 4.100 5.400 4.100 5.400
s=1 4.800 6.300 4.000 5.500 4.000 5.500 4.000 5.500
DBCDDA(s, d)
s = 99999999 5.600 7.100 4.900 6.300 4.900 6.300 4.900 6.300
s=1 6.500 8.500 5.800 7.800 5.800 7.800 5.800 7.800
DABIN (s, d)
s = -32768 6.300 8.300 5.600 7.700 5.600 7.700 5.600 7.700
s=1 9.400 11.500 8.500 10.500 8.500 10.500 8.500 10.500
DDABIN (s, d)
s = -2147483648 9.100 11.200 8.100 10.200 8.100 10.200 8.100 10.200
s=1 4.900 7.100 4.400 6.400 4.400 6.400 4.400 6.400
HABIN (s, d)
s = FFFFH 5.100 7.300 4.600 6.500 4.600 6.500 4.600 6.500
s=1 6.000 8.100 5.300 7.300 5.300 7.300 5.300 7.300
DHABIN (s, d)
s = FFFFFFFFH 6.300 8.500 5.600 7.700 5.600 7.700 5.600 7.700
s=1 5.000 7.100 4.400 6.300 4.400 6.300 4.400 6.300
DABCD (s, d)
s = 9999 5.000 7.100 4.300 6.300 4.300 6.300 4.300 6.300
s=1 6.200 8.300 5.500 7.400 5.500 7.400 5.500 7.400
DDABCD (s, d)
s = 99999999 6.200 8.300 5.500 7.500 5.500 7.500 5.500 7.500
COMRD –– 51.600 52.400 50.900 51.200 50.900 51.200 50.900 51.200
1 character 4.100 6.200 3.600 5.500 3.600 5.500 3.600 5.500
LEN
96 characters 19.800 22.200 16.800 18.700 16.800 18.700 16.800 18.700
STR –– 6.900 11.100 6.600 10.400 6.600 10.400 6.600 10.400
DSTR –– 10.200 12.500 9.600 11.500 9.600 11.500 9.600 11.500
VAL –– 9.800 14.200 8.900 13.000 8.900 13.000 8.900 13.000
DVAL –– 14.000 18.700 12.700 16.800 12.700 16.800 12.700 16.800
ESTR –– 18.700 24.100 17.900 23.100 17.900 23.100 17.900 23.100
Decimal point format all 2-digit specification 23.300 30.400 22.800 29.000 22.800 29.000 22.800 29.000
EVAL
Exponent format all 6-digit specification 23.300 30.500 22.500 29.000 22.500 29.000 22.500 29.000
n=1 5.600 9.000 5.400 8.300 5.400 8.300 5.400 8.300
ASC (s, d, n)
n = 96 28.700 32.100 25.200 28.400 25.200 28.400 25.200 28.400
n=1 6.000 9.700 5.400 9.000 5.400 9.000 5.400 9.000
HEX (s, d, n)
n = 96 35.600 39.800 31.300 35.000 31.300 35.000 31.300 35.000
n=1 7.600 9.400 7.300 6.600 7.300 6.600 7.300 6.600
RIGHT (s, d, n)
n = 96 36.300 40.000 29.200 31.600 29.200 31.600 29.200 31.600
n=1 6.500 8.900 5.900 8.200 5.900 8.200 5.900 8.200
LEFT (s, d, n)
n = 96 36.200 39.700 29.200 31.500 29.200 31.500 29.200 31.500

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 66
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
MIDR –– 9.500 12.100 8.100 10.300 8.100 10.300 8.100 10.300
MIDW –– 10.300 12.000 8.800 10.200 8.800 10.200 8.800 10.200
No match 19.300 21.800 16.600 18.400 16.600 18.400 16.600 18.400
INSTR Head 10.300 12.800 9.100 10.900 9.100 10.900 9.100 10.900
Match
End 51.100 54.200 42.700 44.900 42.700 44.900 42.700 44.900
EMOD –– 10.300 11.800 9.600 11.000 9.600 11.000 9.600 11.000
EREXP –– 19.300 21.000 18.800 20.100 18.800 20.100 18.800 20.100
s = 128 / d = 40 / n = 1 41.100 54.200 35.300 47.600 35.300 47.600 35.300 47.600
STRINS (s, d, n)
s = 128 / d = 40 / n = 48 56.700 81.400 48.600 61.700 48.600 61.700 48.600 61.700
s = 128 / d = 40 / n = 1 39.000 49.500 34.800 44.600 34.800 44.600 34.800 44.600
STRDEL (s, d, n)
s = 128 / d = 40 / n = 48 36.000 45.200 29.200 38.100 29.200 38.100 29.200 38.100
SIN single precision 4.500 6.200 4.100 5.700 4.100 5.700 4.100 5.700
COS single precision 4.300 6.000 4.000 5.600 4.000 5.600 4.000 5.600
TAN single precision 5.100 7.200 5.100 6.700 5.100 6.700 5.100 6.700
ASIN single precision 6.100 8.900 5.900 8.500 5.900 8.500 5.900 8.500
ACOS single precision 6.800 9.300 6.700 8.900 6.700 8.900 6.700 8.900
ATAN single precision 4.000 6.500 3.900 6.000 3.900 6.000 3.900 6.000
SIND double precision 8.800 14.300 8.500 13.800 8.500 13.800 8.500 13.800
COSD double precision 9.300 15.100 8.800 14.600 8.800 14.600 8.800 14.600
TAND double precision 11.200 16.900 10.800 16.500 10.800 16.500 10.800 16.500
ASIND double precision 12.000 17.100 11.600 16.600 11.600 16.600 11.600 16.600
ACOSD double precision 11.700 16.500 11.200 16.200 11.200 16.200 11.200 16.200
ATAND double precision 9.500 14.200 9.100 13.800 9.100 13.800 9.100 13.800
RAD single precision 2.500 4.800 2.100 4.300 2.100 4.300 2.100 4.300
RADD double precision 4.000 9.600 3.600 9.200 3.600 9.200 3.600 9.200
DEG single precision 2.500 4.700 2.200 4.400 2.200 4.400 2.200 4.400
DEGD double precision 4.300 9.000 3.800 9.000 3.800 9.000 3.800 9.000
SQR single precision 3.000 4.600 2.600 4.300 2.600 4.300 2.600 4.300
SQRD double precision 5.600 11.500 5.200 11.000 5.200 11.000 5.200 11.000
Decimal point format all 2-digit specification 23.300 30.400 22.800 29.000 22.800 29.000 22.800 29.000
EVAL
Exponent format all 6-digit specification 23.300 30.500 22.500 29.000 22.500 29.000 22.500 29.000
n=1 5.600 9.000 5.400 8.300 5.400 8.300 5.400 8.300
ASC (s, d, n)
n = 96 28.700 32.100 25.200 28.400 25.200 28.400 25.200 28.400
n=1 6.000 9.700 5.400 9.000 5.400 9.000 5.400 9.000
HEX (s, d, n)
n = 96 35.600 39.800 31.300 35.000 31.300 35.000 31.300 35.000
n=1 7.600 9.400 7.300 6.600 7.300 6.600 7.300 6.600
RIGHT (s, d, n)
n = 96 36.300 40.000 29.200 31.600 29.200 31.600 29.200 31.600
n=1 6.500 8.900 5.900 8.200 5.900 8.200 5.900 8.200
LEFT (s, d, n)
n = 96 36.200 39.700 29.200 31.500 29.200 31.500 29.200 31.500
MIDR –– 9.500 12.100 8.100 10.300 8.100 10.300 8.100 10.300
MIDW –– 10.300 12.000 8.800 10.200 8.800 10.200 8.800 10.200
No match 19.300 21.800 16.600 18.400 16.600 18.400 16.600 18.400
INSTR Head 10.300 12.800 9.100 10.900 9.100 10.900 9.100 10.900
Match
End 51.100 54.200 42.700 44.900 42.700 44.900 42.700 44.900
EMOD –– 10.300 11.800 9.600 11.000 9.600 11.000 9.600 11.000
EREXP –– 19.300 21.000 18.800 20.100 18.800 20.100 18.800 20.100
s = 128 / d = 40 / n = 1 41.100 54.200 35.300 47.600 35.300 47.600 35.300 47.600
STRINS (s, d, n)
s = 128 / d = 40 / n = 48 56.700 81.400 48.600 61.700 48.600 61.700 48.600 61.700
s = 128 / d = 40 / n = 1 39.000 49.500 34.800 44.600 34.800 44.600 34.800 44.600
STRDEL (s, d, n)
s = 128 / d = 40 / n = 48 36.000 45.200 29.200 38.100 29.200 38.100 29.200 38.100

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 67


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
SIN single precision 4.500 6.200 4.100 5.700 4.100 5.700 4.100 5.700
COS single precision 4.300 6.000 4.000 5.600 4.000 5.600 4.000 5.600
TAN single precision 5.100 7.200 5.100 6.700 5.100 6.700 5.100 6.700
ASIN single precision 6.100 8.900 5.900 8.500 5.900 8.500 5.900 8.500
ACOS single precision 6.800 9.300 6.700 8.900 6.700 8.900 6.700 8.900
ATAN single precision 4.000 6.500 3.900 6.000 3.900 6.000 3.900 6.000
SIND double precision 8.800 14.300 8.500 13.800 8.500 13.800 8.500 13.800
COSD double precision 9.300 15.100 8.800 14.600 8.800 14.600 8.800 14.600
TAND double precision 11.200 16.900 10.800 16.500 10.800 16.500 10.800 16.500
ASIND double precision 12.000 17.100 11.600 16.600 11.600 16.600 11.600 16.600
ACOSD double precision 11.700 16.500 11.200 16.200 11.200 16.200 11.200 16.200
ATAND double precision 9.500 14.200 9.100 13.800 9.100 13.800 9.100 13.800
RAD single precision 2.500 4.800 2.100 4.300 2.100 4.300 2.100 4.300
RADD double precision 4.000 9.600 3.600 9.200 3.600 9.200 3.600 9.200
DEG single precision 2.500 4.700 2.200 4.400 2.200 4.400 2.200 4.400
DEGD double precision 4.300 9.000 3.800 9.000 3.800 9.000 3.800 9.000
SQR single precision 3.000 4.600 2.600 4.300 2.600 4.300 2.600 4.300
SQRD double precision 5.600 11.500 5.200 11.000 5.200 11.000 5.200 11.000
s = -10 4.000 6.100 3.800 5.500 3.800 5.500 3.800 5.500
EXP (s, d) single precision
s=1 4.000 6.100 3.800 5.600 3.800 5.600 3.800 5.600
s = -10 8.700 13.900 8.200 13.500 8.200 13.500 8.200 13.500
EXPD (s, d) double precision
s=1 8.400 13.600 8.000 13.200 8.000 13.200 8.000 13.200
s=1 4.100 6.900 3.800 6.400 3.800 6.400 3.800 6.400
LOG (s, d) single precision
s = 10 5.600 8.200 5.200 7.700 5.200 7.700 5.200 7.700
s=1 8.100 13.000 7.700 12.500 7.700 12.500 7.700 12.500
LOGD (s, d) double precision
s = 10 9.700 14.800 9.200 14.300 9.200 14.300 9.200 14.300
RND –– 1.200 2.300 0.800 1.800 0.800 1.800 0.800 1.800
SRND –– 1.400 2.400 1.100 2.000 1.100 2.000 1.100 2.000
s=0 1.800 3.300 1.600 2.800 1.600 2.800 1.600 2.800
BSQR (s, d)
s = 9999 5.100 8.800 5.100 8.000 5.100 8.000 5.100 8.000
s=0 1.900 3.400 1.500 3.000 1.500 3.000 1.500 3.000
BDSQR (s, d)
s = 99999999 7.500 10.200 7.500 9.900 7.500 9.900 7.500 9.900
BSIN –– 8.600 15.100 8.100 14.500 8.100 14.500 8.100 14.500
BCOS –– 7.800 14.400 7.800 13.700 7.800 13.700 7.800 13.700
BTAN –– 9.000 13.800 9.000 13.300 9.000 13.300 9.000 13.300
BASIN –– 10.600 13.400 10.100 12.800 10.100 12.800 10.100 12.800
BACOS –– 11.600 14.400 11.100 14.100 11.100 14.100 11.100 14.100
BATAN –– 9.800 11.700 9.100 10.900 9.100 10.900 9.100 10.900
single precision s1 = 12.3 E + 5;
POW (s1, s2, d) s2 = 3.45 E + 0 8,750 11.400 8.400 10.900 8.400 10.900 8.400 10.900
POWD (s1, s2, d) double precision s1 = 12.3 E + 5;
LOG10 single precision
18.600 27.200 18.200 26.500 18.200 26.500 18.200 26.500
LOG10D double precision
LIMIT –– 5.900 8.550 5.700 8.050 5.700 8.050 5.700 8.050
DLIMIT –– 11.500 19.400 11.100 18.600 11.100 18.600 11.100 18.600
BAND –– 2.800 3.100 2.400 2.700 2.400 2.700 2.400 2.700
DBAND –– 3.200 3.500 2.800 3.000 2.800 3.000 2.800 3.000
ZONE –– 3.000 4.300 2.700 3.800 2.700 3.800 2.700 3.800
DZONE –– 3.600 5.100 3.300 4.600 3.300 4.600 3.300 4.600

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 68
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
Point No. 1 < s1 < Point No. 2 13.200 23.600 12.300 22.500 12.300 22.500 12.300 22.500
SM750 = ON
Point No. 9 < s1 < Point No. 10 13.300 23.600 12.600 22.700 12.600 22.700 12.600 22.700
SCL (s1, s2, d)
Point No. 1 < s1 < Point No. 2 12.000 23.100 11.400 22.200 11.400 22.200 11.400 22.200
SM750 = OFF
Point No. 9 < s1 < Point No. 10 14.100 25.300 12.800 23.900 12.800 23.900 12.800 23.900
Point No. 1 < s1 < Point No. 2 12.800 23.800 11.900 23.000 11.900 23.000 11.900 23.000
SM750 = ON
Point No. 9 < s1 < Point No. 10 12.900 23.900 12.100 23.000 12.100 23.000 12.100 23.000
DSCL (s1, s2, d)
Point No. 1 < s1 < Point No. 2 11.500 22.400 10.900 21.500 10.900 21.500 10.900 21.500
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.800 24.900 12.700 23.600 12.700 23.600 12.700 23.600
Point No. 1 < s1 < Point No. 2 12.700 24.200 11.900 23.300 11.900 23.300 11.900 23.300
SM750 = ON
Point No. 9 < s1 < Point No. 10 12.900 24.600 12.100 23.300 12.100 23.300 12.100 23.300
SCL2 (s1, s2, d)
Point No. 1 < s1 < Point No. 2 12.300 23.400 11.500 22.600 11.500 22.600 11.500 22.600
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.700 25.000 12.600 23.900 12.600 23.900 12.600 23.900
Point No. 1 < s1 < Point No. 2 12.600 23.800 11.800 22.900 11.800 22.900 11.800 22.900
SM750 = ON
Point No. 9 < s1 < Point No. 10 13.000 23.900 12.200 22.800 12.200 22.800 12.200 22.800
DSCL2 (s1, s2, d)
Point No. 1 < s1 < Point No. 2 11.500 22.400 11.000 21.400 11.000 21.400 11.000 21.400
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.900 24.900 12.800 23.600 12.800 23.600 12.800 23.600
Standard RAM 3.000 6.300 2.700 5.900 2.700 5.900 2.700 5.900
RSET
SRAM card 3.000 6.400 2.600 5.800 2.600 5.800 2.600 5.800
SRAM card to standard RAM 120.000 134.000 115.000 134.000 115.000 134.000 115.000 134.000
QDRSET
Standard RAM to SRAM card 533.000 560.000 520.000 553.000 520.000 553.000 520.000 553.000
SRAM card to standard ROM 306.000 346.000 305.000 346.000 305.000 346.000 305.000 346.000
QCDSET
Standard ROM to SRAM card 311.000 342.000 300.000 334.000 300.000 334.000 300.000 334.000
DATERD –– 3.200 5.000 2.500 4.200 2.500 4.200 2.500 4.200
DATEWR –– 4.900 9.700 4.100 8.900 4.100 8.900 4.100 8.900
No digit increase 5.100 8.000 4.700 6.600 4.700 6.600 4.700 6.600
DATE +
Digit increase 5.700 8.000 4.600 6.500 4.600 6.500 4.600 6.500
No digit increase 5.800 8.500 4.600 7.000 4.600 7.000 4.600 7.000
DATE -
Digit increase 5.700 7.400 4.600 6.500 4.600 6.500 4.600 6.500
SECOND –– 2.600 3.900 2.200 3.400 2.200 3.400 2.200 3.400
HOUR –– 2.900 4.800 2.400 4.300 2.400 4.300 2.400 4.300
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT =
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT= specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT= specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT <>
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 69


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT<> specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT<> specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT>
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT> specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT> specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT<=
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT<= specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT<= specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT<
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT< specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 70
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT< specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.400 11.400 6.800 10.900 6.800 10.900 6.800 10.900
specified date no continuity 7.400 11.600 6.800 10.900 6.800 10.900 6.800 10.900
LDDT>=
Comparison of continuity 5.900 10.000 5.500 9.700 5.500 9.700 5.500 9.700
current date no continuity 5.900 10.100 5.500 9.700 5.500 9.700 5.500 9.700
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
ANDDT>= specified date no continuity 7.200 11.400 6.500 10.700 6.500 10.700 6.500 10.700
Comparison of continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
current date no continuity 5.700 9.900 5.300 9.300 5.300 9.300 5.300 9.300
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
ORDT>= specified date no continuity 7.400 11.500 6.700 10.800 6.700 10.800 6.700 10.800
Comparison of continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
current date no continuity 5.900 10.000 5.400 9.600 5.400 9.600 5.400 9.600
Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM=
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
ANDTM= specified clock no continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
Comparison of continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
current clock no continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
ORTM= specified clock no continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
Comparison of
current clock continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500

Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM<>
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
ANDTM<> specified clock no continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
Comparison of continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
current clock no continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
ORTM<> specified clock no continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
Comparison of continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
current clock no continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 71


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM>
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
ANDTM> specified clock no continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
Comparison of continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
current clock no continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
ORTM> specified clock no continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
Comparison of continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
current clock no continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM<>
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
ANDTM<> specified clock no continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
Comparison of continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
current clock no continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
ORTM<> specified clock no continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
Comparison of continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
current clock no continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM>
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
ANDTM> specified clock no continuity 7.000 11.500 6.300 10.800 6.300 10.800 6.300 10.800
Comparison of continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
current clock no continuity 5.500 9.900 5.100 9.500 5.100 9.500 5.100 9.500
not executed 0.008 0.038 0.038 0.038
Comparison of continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
ORTM> specified clock no continuity 7.300 11.500 6.600 10.800 6.600 10.800 6.600 10.800
Comparison of continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
current clock no continuity 5.900 9.900 5.300 9.500 5.300 9.500 5.300 9.500
Comparison of continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
specified clock no continuity 7.300 11.500 6.700 10.800 6.700 10.800 6.700 10.800
LDTM<
Comparison of continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500
current clock no continuity 5.800 9.900 5.400 9.500 5.400 9.500 5.400 9.500

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 72
Appendix A Operation Processing Time of Universal Model QCPU

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
not executed 0.480 0.320 0.240 0.240
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 6.500 25.500
ANDTM< specified clock no continuity 8.200 25.500 8.200 25.500 6.500 25.500 6.500 25.500
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 6.500 23.100
current clock no continuity 6.500 23.100 6.500 23.100 6.500 23.100 6.500 23.100
not executed 0.480 0.320 0.240 0.240
Comparison of continuity 8.200 25.500 8.200 25.500 6.500 25.500 6.500 25.500
ORTM< specified clock no continuity 8.200 25.500 8.200 25.500 6.500 25.500 6.500 25.500
Comparison of continuity 6.500 23.100 6.500 23.100 6.500 23.100 6.500 23.100
current clock no continuity 6.500 23.100 6.500 23.100 6.500 23.100 6.500 23.100
S.DATERD –– 9.250 51.000 9.250 51.000 9.250 51.000 9.250 51.000
No digit increase 16.800 75.400 16.800 75.400 16.800 75.400 16.800 75.400
S.DATE +
Digit increase 16.800 75.400 16.800 75.400 16.800 75.400 16.800 75.400
No digit increase 17.600 75.300 17.600 75.300 17.600 75.300 17.600 75.300
S.DATE -
Digit increase 16.900 75.300 16.900 75.300 16.900 75.300 16.900 75.300
PSTOP –– 82.200 199.000 82.200 199.000 82.200 199.000 82.200 199.000
POFF –– 82.600 198.000 82.600 198.000 82.600 198.000 82.600 198.000
PSCAN –– 83.600 200.000 83.600 200.000 83.600 200.000 83.600 200.000
WDT –– 2.900 12.000 2.900 12.000 2.900 12.000 2.900 12.000
DUTY –– 7.700 27.500 7.700 27.500 7.700 27.500 7.700 27.500
TIMCHK –– 5.350 24.500 5.350 24.500 5.350 24.500 5.350 24.500
File register of standard RAM 4.100 4.200 4.100 4.200 4.100 4.200 4.100 4.200
ZRRDB
File register of SRAM card –– –– –– –– –– –– –– ––
File register of standard RAM 5.400 5.500 5.400 5.500 5.400 5.500 5.400 5.500
ZRWRB
File register of SRAM card –– –– –– –– –– –– –– ––
ADRSET –– 2.400 6.650 2.400 6.650 2.400 6.650 2.400 6.650
ZPUSH –– 9.200 20.500 9.200 20.500 9.200 20.500 9.200 20.500
ZPOP –– 9.000 15.500 9.000 15.500 9.000 15.500 9.000 15.500
When mounting CC-Link module (Master station side) 19.600 26.500 19.300 26.000 19.300 26.000 19.300 26.000
When mounting CC-Link module (Local station side) 19.600 26.500 19.100 26.200 19.100 26.200 19.100 26.200
S.ZCOM When mounting MELSECNET/H module, CC-Link IE module
53.500 73.500 53.000 72.700 53.000 72.700 53.000 72.700
(Control station side)
When mounting MELSECNET/H module, CC-Link IE module
(Normal station side) 29.800 41.200 29.800 40.600 29.800 40.600 29.800 40.600

S.RTREAD –– 5.900 11.000 5.400 10.500 5.400 10.500 5.400 10.500


S.RTWRITE –– 6.700 11.100 6.000 10.400 6.000 10.400 6.000 10.400
n2 = 1 4.000 8.400 3.700 8.000 3.700 8.000 3.700 8.000
UNIRD (n1, d, n2)
n2 = 16 12.500 17.000 12.200 16.600 12.200 16.600 12.200 16.600
TYPERD 29.800 53.000 29.500 52.300 29.500 52.300 29.500 52.300
TRACE Start 46.600 48.300 43.800 44.700 43.800 44.700 43.800 44.700
TRACER –– 3.300 6.800 2.600 6.000 2.600 6.000 2.600 6.000
When standard RAM 1 point 11.300 16.800 9.200 15.100 9.200 15.100 9.200 15.100
is used 1000 points 120.700 127.100 61.000 68.600 61.000 68.600 61.000 68.600
RBMOV (s, d, n)
When SRAM card is 1 point 11.200 16.700 9.400 15.600 9.400 15.600 9.400 15.600
used 1000 points 180.700 187.100 165.000 172.600 165.000 172.600 165.000 172.600
SP.FWRITE –– 6.700 11.100 6.000 10.400 6.000 10.400 6.000 10.400
SP.FREAD –– 5.900 11.000 5.400 10.500 5.400 10.500 5.400 10.500
SP.DEVST –– 4.500 36.500 4.000 34.500 4.000 34.500 4.000 34.500
S.DEVLD –– 11.000 17.800 10.000 17.000 10.000 17.000 10.000 17.000
S.TO Writing to host CPU n4 = 1 34.700 34.900 33.500 34.400 33.500 34.400 33.500 34.400
(n1, n2, n3, n4, d) shared memory n4 = 320 85.900 87.600 75.200 75.500 75.200 75.500 75.200 75.500

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

Programming MELSEC System Q and L series A – 73


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Instruction Processing (Device) Q03UD(E) Q04/Q06UD(E)H Q10/Q13/Q20/ Q50/Q100UDEH
Q26UD(E)H
Min. Max. Min. Max. Min. Max. Min. Max.
Writing to host CPU n3 = 1 4.700 23.800 5.200 23.300 5.200 23.300 5.200 23.300
TO (n1, n2, s, n3) shared memory n3 = 320 57.500 76.200 47.100 64.500 47.100 64.500 47.100 64.500
Writing to host CPU n3 = 1 5.300 23.800 5.800 23.300 5.800 23.300 5.800 23.300
DTO (n1, n2, s, n3) shared memory n3 = 320 111.300 128.400 91.500 108.500 91.500 108.500 91.500 108.500
Reading from host n3 = 1 5.000 23.800 4.300 23.300 4.300 23.300 4.300 23.300
CPU shared memory n3 = 320 51.400 65.600 44.400 60.700 44.400 60.700 44.400 60.700
FROM (n1, n2, d, n3) n3 = 1 11.600 17.700 10.600 13.900 10.600 13.900 10.600 13.900
Reading from other n3 = 320 142.000 160.000 142.000 149.000 142.000 149.000 142.000 149.000
CPU shared memory
n3 = 1000 431.000 463.000 422.000 448.000 422.000 448.000 422.000 448.000
Reading from host n3 = 1 5.200 23.800 5.600 23.300 5.600 23.300 5.600 23.300
CPU shared memory n3 = 320 96.400 113.200 83.600 100.800 83.600 100.800 83.600 100.800
DFRO (n1, n2, d, n3) n3 = 1 12.900 20.800 12.200 17.100 12.200 17.100 12.200 17.100
Reading from other
n3 = 320 277.000 299.000 274.000 291.000 274.000 291.000 274.000 291.000
CPU shared memory
n3 = 1000 838.000 860.000 835.000 857.000 835.000 857.000 835.000 857.000
n=1 34.700 34.900 33.500 34.400 33.500 34.400 33.500 34.400
D.DDWR
n=16 85.900 87.600 75.200 75.500 75.200 75.500 75.200 75.500
(n, s1, s2, d1, d2)
Writes devices to n=96 5.600 10.200 3.300 9.900 3.300 9.900 3.300 9.900
another CPU n=1 36.700 42.400 34.300 39.200 34.300 39.200 34.300 39.200
DP.DDWR
n=16 5.000 12.100 3.100 10.500 3.100 10.500 3.100 10.500
(n, s1, s2, d1, d2)
n=96 59.100 66.800 55.300 65.100 55.300 65.100 55.300 65.100
n=1 3.300 12.700 2.400 9.600 2.400 9.600 2.400 9.600
D.DDRD
n=16 50.900 64.400 45.200 48.200 45.200 48.200 45.200 48.200
(n, s1, s2, d1, d2)
Reads devices from n=96 11.600 17.700 10.600 13.900 10.600 13.900 10.600 13.900
another CPU n=1 142.000 160.000 142.000 149.000 142.000 149.000 142.000 149.000
DP.DDRD
n=16 431.000 463.000 422.000 448.000 422.000 448.000 422.000 448.000
(n, s1, s2, d1, d2)
n=96 6.700 12.600 2.800 9.900 2.800 9.900 2.800 9.900

Tab. A-23: Processing times for instructions other than subset instructions for Universal model QCPU (2)

A – 74
Appendix A Operation Processing Time of Universal Model QCPU

Table of the time to be added when file register, extended data register, extended link
register, module access device, and link direct device are used
● Q03UD(E) Q00UJCPU, Q00UCPU, Q01UCPU and Q02UCPU
Device Processing time (μs)
Device Name Data Specification
Location Q00UJ Q00U Q01U Q02U
Source 0.100 0.100 0.100 0.100
Bit
Destination 0.100 0.100 0.100 0.100
When standard RAM is Source 0.100 0.100 0.100 0.100
Word
used Destination 0.100 0.100 0.100 0.100
Source 0.100 0.100 0.100 0.200
Double word
Destination 0.100 0.100 0.100 0.200
Source –– –– –– 0.220
Bit
Destination –– –– –– 0.180
When SRAM card is used Source –– –– –– 0.220
File register (R) (Q2MEM-1MBS, Q2MEM- Word
2MBS) Destination –– –– –– 0.180
Source –– –– –– 0.440
Double word
Destination –– –– –– 0.380
Source –– –– –– 0.160
Bit
Destination –– –– –– 0.140
When SRAM card is used Source –– –– –– 0.160
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination –– –– –– 0.140
Source –– –– –– 0.320
Double word
Destination –– –– –– 0.300
Source 0.120 0.120 0.120 0.120
Bit
Destination 0.120 0.120 0.120 0.120
When standard RAM is Source 0.120 0.120 0.120 0.120
Word
used Destination 0.120 0.120 0.120 0.120
Source 0.120 0.120 0.120 0.220
Double word
Destination 0.120 0.120 0.120 0.220
Source –– –– –– 0.240
Bit
Destination –– –– –– 0.200
File register (ZR), When SRAM card is used Source –– –– –– 0.240
Extended data register (D), (Q2MEM-1MBS, Q2MEM- Word
Extended link register (W) 2MBS) Destination –– –– –– 0.200
Source –– –– –– 0.460
Double word
Destination –– –– –– 0.400
Source –– –– –– 0.180
Bit
Destination –– –– –– 0.160
When SRAM card is used Source –– –– –– 0.180
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination –– –– –– 0.160
Source –– –– –– 0.340
Double word
Destination –– –– –– 0.320
Source –– –– –– 12.000
Bit
Destination –– –– –– 17.300
Module access device Source –– –– –– 9.700
(Multiple CPU high speed transmission area) Word
(U3En\G10000) Destination –– –– –– 33.000
Source –– –– –– 24.200
Double word
Destination –– –– –– 34.800

Tab. A-24: Processing times to be added for instructions other than subset instructions for Universal model
CPU (1)

Programming MELSEC System Q and L series A – 75


Operation Processing Time of Universal Model QCPU Appendix A

Device Processing time (μs)


Device Name Data Specification
Location Q00UJ Q00U Q01U Q02U
Source –– –– –– 32.900
Bit
Destination –– –– –– 67.300
Source –– –– –– 37.200
Link direct device (Jn\) Word
Destination –– –– –– 37.000
Source –– –– –– 39.500
Double word
Destination –– –– –– 41.900

Tab. A-24: Processing times to be added for instructions other than subset instructions for Universal model
CPU (1)

A – 76
Appendix A Operation Processing Time of Universal Model QCPU

● Q03UD(E)CPU, Q04UD(E)HCPU, Q06UD(E)HCPU, Q10UD(E)HCPU, Q13UDE(H)CPU,


Q20UD(E)HCPU, Q26UD(E)HCPU, Q50UDEHCPU and Q100UDEHCPU
Processing time (μs)
Device
Device Name Data Specification Q04/ Q10/Q13/ Q50/
Location Q03UD(E) Q20/
Q06UD(E)H Q26UD(E)H Q100UDEH

Source 0.100 0.048 0.048 0.048


Bit
Destination 0.100 0.038 0.038 0.038
Source 0.100 0.048 0.048 0.048
When standard RAM is used Word
Destination 0.100 0.038 0.038 0.038
Source 0.200 0.095 0.095 0.095
Double word
Destination 0.200 0.086 0.086 0.086
Source 0.220 0.200 0.200 0.200
Bit
Destination 0.180 0.162 0.162 0.162
When SRAM card is used Source 0.220 0.200 0.200 0.200
File register (R) (Q2MEM-1MBS, Q2MEM- Word
2MBS) Destination 0.180 0.162 0.162 0.162
Source 0.440 0.399 0.399 0.399
Double word
Destination 0.380 0.361 0.361 0.361
Source 0.160 0.152 0.152 0.152
Bit
Destination 0.140 0.133 0.133 0.133
When SRAM card is used Source 0.160 0.152 0.152 0.152
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination 0.140 0.133 0.133 0.133
Source 0.320 0.304 0.304 0.304
Double word
Destination 0.300 0.295 0.295 0.295
Source 0.120 0.057 0.057 0.057
Bit
Destination 0.120 0.048 0.048 0.048
Source 0.120 0.057 0.057 0.057
When standard RAM is used Word
Destination 0.120 0.048 0.048 0.048
Source 0.220 0.105 0.105 0.105
Double word
Destination 0.220 0.095 0.095 0.095
Source 0.240 0.209 0.209 0.209
Bit
Destination 0.200 0.171 0.171 0.171
File register (ZR), When SRAM card is used Source 0.240 0.209 0.209 0.209
Extended data register (D), (Q2MEM-1MBS, Q2MEM- Word
Extended link register (W) 2MBS) Destination 0.200 0.171 0.171 0.171
Source 0.460 0.409 0.409 0.409
Double word
Destination 0.400 0.371 0.371 0.371
Source 0.180 0.162 0.162 0.162
Bit
Destination 0.160 0.143 0.143 0.143
When SRAM card is used Source 0.180 0.162 0.162 0.162
(Q3MEM-4MBS, Q3MEM- Word
8MBS) Destination 0.160 0.143 0.143 0.143
Source 0.340 0.314 0.314 0.314
Double word
Destination 0.320 0.304 0.304 0.304
Source 11.700 11.200 11.200 11.200
Bit
Destination 15.400 15.300 15.300 15.300
Module access device Source 9.460 9.410 9.410 9.410
Word
(Un\G, U3En\G0 to G4095) Destination 19.000 19.000 19.000 19.000
Source 11.000 10.900 10.900 10.900
Double word
Destination 18.800 18.700 18.700 18.700

Tab. A-25: Processing times to be added for instructions other than subset instructions for Universal model
CPU (2)

Programming MELSEC System Q and L series A – 77


Operation Processing Time of Universal Model QCPU Appendix A

Processing time (μs)


Device
Device Name Data Specification Q04/ Q10/Q13/ Q50/
Location Q03UD(E) Q20/
Q06UD(E)H Q26UD(E)H Q100UDEH

Source 32.700 31.300 31.300 31.300


Bit
Destination 52.300 29.900 29.900 29.900
Source 28.500 17.300 17.300 17.300
Link direct device (Jn\) Word
Destination 27.500 14.700 14.700 14.700
Source 30.300 18.100 18.100 18.100
Double word
Destination 30.600 15.700 15.700 15.700

Tab. A-25: Processing times to be added for instructions other than subset instructions for Universal model
CPU (2)

A – 78
Appendix A Operation Processing Time of LCPU

A.4 Operation Processing Time of LCPU


NOTE  The processing time shown in section A.4.1 applies when the device used in an instruction
meets the device condition for subset processing (for device condition triggering subset pro-
cessing, refer to section 3.8.1).
 When using a file register (R, ZR), extended data register (D), and extended link register (W),
add the processing time shown in table A-27 to that of the instruction.
 When using an F, T(ST) or C device with an OUT/SET/RST instruction, add the processing
time for each instruction, with reference to the adding time in table A-28.
 Since the processing time of an instruction varies depending on that of the cache function,
both the minimum and maximum values are described in the table.

A.4.1 Subset instruction processing time

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
LD
LDI
AND
ANI
OR
ORI
executed 0.040 0.0095
LDP
LDF
ANDP
ANDF
ORP
ORF
LDPI
executed 0.120 0.0285
LDFI
ANDPI
ANDFI
executed 0.160 0.038
ORPI
ORFI
not changed
OUT 0.040 0.0095
changed
not changed
OUT H 0.040 0.0095
changed
not executed
SET
not changed 0.040 0.0095
RST executed
changed
continuity
LD= 0.120 0.0285
no continuity
not executed
AND= continuity 0.120 0.0285
executed
no continuity
not executed
OR= continuity 0.120 0.0285
executed
no continuity

Tab. A-26: Subset instruction processing time for LCPU

Programming MELSEC System Q and L series A – 79


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
continuity
LD<> 0.120 0.0285
no continuity
not executed
AND<> continuity 0.120 0.0285
executed
no continuity
not executed
OR<> continuity 0.120 0.0285
executed
no continuity
continuity
LD> 0.120 0.0285
no continuity
not executed
AND> continuity 0.120 0.0285
executed
no continuity
not executed
OR> continuity 0.120 0.0285
executed
no continuity
continuity
LD<= 0.120 0.0285
no continuity
not executed
AND<= continuity 0.120 0.0285
executed
no continuity
not executed
OR<= continuity 0.120 0.0285
executed
no continuity
continuity
LD< 0.120 0.0285
no continuity
not executed
AND< continuity 0.120 0.0285
executed
no continuity
not executed
OR< continuity 0.120 0.0285
executed
no continuity
continuity
LD>= 0.120 0.0285
no continuity
not executed
AND>= continuity 0.120 0.0285
executed
no continuity
not executed
OR>= continuity 0.120 0.0285
executed
no continuity
continuity
LDD= 0.120 0.0285
no continuity
not executed
ANDD= continuity 0.120 0.0285
executed
no continuity
not executed
ORD= continuity 0.120 0.0285
executed
no continuity
continuity
LDD<> 0.120 0.0285
no continuity

Tab. A-26: Subset instruction processing time for LCPU

A – 80
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
not executed
ANDD<> continuity 0.120 0.0285
executed
no continuity
not executed
ORD<> continuity 0.120 0.0285
executed
no continuity
continuity
LDD> 0.120 0.0285
no continuity
not executed
ANDD> continuity 0.120 0.0285
executed
no continuity
not executed
ORD> continuity 0.120 0.0285
executed
no continuity
continuity
LDD<= 0.120 0.0285
no continuity
not executed
ANDD<= continuity 0.120 0.0285
executed
no continuity
not executed
ORD<= continuity 0.120 0.0285
executed
no continuity
continuity
LDD< 0.120 0.0285
no continuity
not executed
ANDD< continuity 0.120 0.0285
executed
no continuity
not executed
ORD< continuity 0.120 0.0285
executed
no continuity
continuity
LDD>= 0.120 0.0285
no continuity
not executed
ANDD>= continuity 0.120 0.0285
executed
no continuity
not executed
ORD>= continuity 0.120 0.0285
executed
no continuity
+ (s, d) executed 0.120 0.0285
+ (s1, s2, d) executed 0.160 0.038
- (s, d) executed 0.120 0.0285
- (s1, s2, d) executed 0.160 0.038
d + (s, d) executed 0.120 0.0285
d + (s1, s2, d) executed 0.160 0.038
d - (s, d) executed 0.120 0.0285
d - (s1, s2, d) executed 0.160 0.038
* (s1, s2, d) executed 0.180 0.057
/ (s1, s2, d) executed 0.280 0.105
d * (s1, s2, d) executed 0.260 0.095
d/ (s1, s2, d) executed 0.400 0.162

Tab. A-26: Subset instruction processing time for LCPU

Programming MELSEC System Q and L series A – 81


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
B + (s, d) executed 3.100 6.800 2.900 4.100
B + (s1, s2, d) executed 4.800 8.900 4.200 5.900
B - (s, d) executed 3.100 6.800 2.900 4.100
B - (s1, s2, d) executed 4.800 8.900 4.200 4.600
B * (s1, s2, d) executed 3.900 7.400 3.400 4.800
B/ (s1, s2, d) executed 3.900 8.500 3.700 5.200
s = 0, d = 0 0.180 0.057
E + (s, d) single precision
s = 2127 , d = 2127 0.180 0.057
s1= 0, s2 = 0 0.220 0.0665
E + (s1, s2, d) single precision
s1 = 2127 , s2 = 2127 0.220 0.0665
s = 0, d = 0 0.180 0.057
E - (s, d) single precision
127 127 0.180 0.057
s=2 ,d=2
s1= 0, s2 = 0 0.220 0.0665
E - (s1, s2, d) single precision
s1 = 2127 , s2 = 2127 0.220 0.0665
s1= 0, s2 = 0 0.180 0.057
E * (s1, s2, d) single precision
127 127 0.180 0.057
s1 = 2 , s2 = 2
E/ (s1, s2, d) single precision s1 = 2127 , s2 = 2127 3.900 8.500 0.285
INC executed 0.080 0.019
DINC executed 0.080 0.019
DEC executed 0.080 0.019
DDEC executed 0.080 0.019
BCD executed 0.160 0.057
DBCD executed 0.240 0.095
BIN executed 0.100 0.0285
DBIN executed 0.100 0.0285
s=0 0.100 0.0475
FLT single precision
s = 7FFFH 0.140 0.0475
s=0 0.140 0.0475
DFLT single precision
s = 7FFFFFFFH 0.140 0.0475
s=0 0.140 0.0475
INT single precision
s = 32766.5 0.140 0.0475
s=0 0.140 0.0475
DINT single precision
s = 1234567890.3 0.140 0.0475
MOV – 0.080 0.019
DMOV – 0.080 0.019
EMOV – 0.080 0.019
CML – 0.080 0.019
DCML – 0.080 0.019
n=1 3.600 4.100 2.900 3.200
SM237=ON
n=96 4.500 4.700 3.400 3.700
BMOV
n=1 5.000 7.400 4.200 5.500
SM237= OFF
n=96 6.000 7.900 4.700 6.000
n=1 5.900 6.800 2.800 3.200
SM237=ON
n=96 6.300 11.000 3.000 5.200
FMOV
n=1 7.000 8.000 3.400 3.800
SM237=OFF
n=96 5.200 6.900 3.600 5.800
XCH – 2.100 4.100 1.800 2.300
DXCH – 2.200 4.200 2.100 2.900

Tab. A-26: Subset instruction processing time for LCPU

A – 82
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
n=1 2.000 3.200 1.750 1.750
SM237=ON
n=96 5.600 6.100 3.650 4.150
DFMOV
n=1 2.900 4.600 2.250 3.150
SM237= OFF
n=96 6.100 8.200 4.200 5.500
CJ – 2.100 2.900 1.100 2.400
SCJ – 2.100 2.900 1.100 2.400
JMP – 2.100 2.900 1.100 2.400
WAND (s, d) executed 0.120 0.0285
WAND (s1, s2, d) executed 0.160 0.038
DAND (s, d) executed 0.120 0.0285
DAND (s1, s2, d) executed 0.160 0.038
WOR (s, d) executed 0.120 0.0285
WOR (s1, s2, d) executed 0.160 0.038
DOR (s, d) executed 0.120 0.0285
DOR (s1, s2, d) executed 0.160 0.038
WXOR (s, d) executed 0.120 0.0285
WXOR (s1, s2, d) executed 0.160 0.038
DXOR (s, d) executed 0.120 0.0285
DXOR (s1, s2, d) executed 0.160 0.038
WXNR (s, d) executed 0.120 0.0285
WXNR (s1, s2, d) executed 0.160 0.038
DXNR (s, d) executed 0.120 0.0285
DXNR (s1, s2, d) executed 0.160 0.038
n=1 2.200 4.900 1.700 2.500
ROR (d, n)
n = 15 2.200 4.900 1.700 2.500
n=1 2.100 4.800 1.700 3.200
RCR (d, n)
n = 15 2.100 4.800 1.700 3.200
n=1 2.100 4.800 1.800 3.200
ROL (d, n)
n = 15 2.100 4.800 1.800 3.200
n=1 2.100 5.200 1.800 2.200
RCL (d, n)
n = 15 2.100 5.200 1.800 2.200
n=1 2.200 5.200 1.900 2.700
DROR (d, n)
n = 31 2.200 5.200 1.900 2.700
n=1 2.200 5.900 1.900 4.200
DRCR (d, n)
n = 31 2.200 5.900 1.900 4.200
n=1 2.200 4.900 1.800 3.300
DROL (d, n)
n = 31 2.200 4.900 1.800 3.300
n=1 2.200 5.900 1.900 3.800
DRCL (d, n)
n = 31 2.200 5.900 1.900 3.800
n=1 2.200 4.600 1.700 2.600
SFR (d, n)
n = 15 2.200 4.600 1.700 2.600
n=1 2.200 4.600 1.800 2.700
SFL (d, n)
n = 15 2.200 4.600 1.800 2.700
n=1 2.200 6.100 2.200 4.300
DSFR (d, n)
n = 96 33.400 38.100 23.900 26.100
n=1 2.200 6.100 2.100 4.000
DSFL (d, n)
n = 96 33.500 38.000 23.700 25.800
s=0 3.000 4.800 2.900 3.600
SUM
s = FFFFH 3.000 4.900 2.900 3.600
SEG executed 1.700 3.600 1.500 2.100

Tab. A-26: Subset instruction processing time for LCPU

Programming MELSEC System Q and L series A – 83


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
FOR – 1.300 3.200 0.870 2.100
Internal file pointer 2.600 4.000 2.300 3.600
CALL pn
Common pointer 4.600 13.500 3.200 4.900
CALL pn s1 to s5 – 31.200 36.000 26.100 29.300

Tab. A-26: Subset instruction processing time for LCPU

NOTE For the instructions for which a leading edge instruction (P) is not described, the processing
time is the same as an ON execution instruction.
Example: MOVP instruction, WANDP instruction etc.

Table of the time to be added when file register, extended data register, and extended
link register are used
Device Specification Processing time (μs)
Device Name Data
Location L02CPU L26CPU-BT
Source 0.100 0.048
Bit
Destination 0.220 0.038
Source 0.100 0.048
File register (R) When standard RAM is used Word
Destination 0.100 0.038
Source 0.200 0.095
Double word
Destination 0.200 0.086
Source 0.140 0.057
Bit
Destination 0.280 0.048
File register (ZR), Source 0.140 0.057
Extended data register (D), When standard RAM is used Word
Extended link register (W) Destination 0.140 0.048
Source 0.240 0.105
Double word
Destination 0.240 0.095

Tab. A-27: Processing times to be added for instructions other than subset instruction for
LCPU

A – 84
Appendix A Operation Processing Time of LCPU

Table of the time to be added when F/T(ST)/C device is used in OUT/SET/RST instruction
Processing time (μs)
Instruction Name Device Name Condition
L02CPU L26CPU-BT
not executed 2.000 1.570
F when displayed 53.100 38.090
executed
display completed 53.000 37.980
OUT
not executed 0.120 0.030
T(ST), C when displayed 0.120 0.030
executed
display completed 0.120 0.030
not executed 0.040 0.010
SET F when displayed 52.000 40.600
executed
display completed 43.600 37.900
not executed 0.040 0.010
F when displayed 45.700 36.600
executed
RST display completed 19.000 16.190
not executed 0.120 0.030
T(ST), C
executed 0.120 0.030

Tab. A-28: Processing times to be added for LCPU and OUT/SET/RST instructions

Programming MELSEC System Q and L series A – 85


Operation Processing Time of LCPU Appendix A

A.4.2 Processing time of instructions other than subset instruction

NOTE  The processing time shown in table A-29 applies when the device used in an instruction does
not meet the device condition for subset processing (for device condition that does not trigger
subset processing, refer to section 3.8.1).
 For instructions not shown in the following table, refer to table A-26 in section A.4.1.
 When using a file register (R, ZR), extended data register (D), extended link register (W), and
module access device (Un/G), add the processing time shown in table A-30 to that of the
instruction.
 Since the processing time of an instruction varies depending on that of the cache function,
both the minimum and maximum values are described in the table.

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
ANB
ORB
MPS — 0.040 0.0095
MRD
MPP
not executed
INV 0.040 0.0095
executed
MEP not executed
0.040 0.0095
MEF executed
EGP not executed
0.040 0.0095
EGF executed
PLS – 1.600 1.700 0.890 1.200
PLF –s 1.600 1.700 0.890 1.200
not executed 0.080 0.0185
FF
executed 1.500 1.500 0.790 0.910
not executed 0.080 0.0185
DELTA
executed 2.700 6.800 2.400 3.200
not executed 0.080 0.0185
SFT
executed 1.700 4.300 1.100 2.700
MC – 0.080 0.0185
MCR – 0.040 0.0185
FEND eror check performed 170.000 210.000 130.000 170.000
END no error check performed 170.000 210.000 130.000 170.000
STOP – — —
NOP
NOPLF – 0.040 0.0095
PAGE
continuity 3.900 10.000 0.0285
LDE= single precision
no continuity 3.900 10.000
0.0285
not executed 0.120
ANDE= single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE= single precision continuity 3.500 8.500 0.0285
executed
no continuity 3.500 8.500 0.0285

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 86
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
continuity 3.900 10.000 0.0285
LDE< > single precision
no continuity 3.900 10.000 0.0285
not executed 0.120 0.0285
ANDE< > single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE< > single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
continuity 3.900 10.000 0.0285
LDE> single precision
no continuity 3.900 10.000 0.0285
not executed 0.120 0.0285
ANDE> single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE> single precision continuity 3.500 8.500 0.0285
executed
no continuity 3.500 8.500 0.0285
continuity 3.900 10.000 0.0285
LDE<= single precision
no continuity 3.900 10.000 0.0285
not executed 0.120 0.0285
ANDE<= single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE<= single precision continuity 3.500 8.500 0.0285
executed
no continuity 3.500 8.500 0.0285
continuity 3.900 10.000 0.0285
LDE< single precision
no continuity 3.900 10.000 0.0285
not executed 0.120 0.0285
ANDE< single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE< single precision continuity 3.500 8.500 0.0285
executed
no continuity 3.500 8.500 0.0285
continuity 3.900 10.000 0.0285
LDE>= single precision
no continuity 3.900 10.000 0.0285
not executed 0.120 0.0285
ANDE>= single precision continuity 3.400 9.300 0.0285
executed
no continuity 3.400 9.300 0.0285
not executed 0.120 0.0285
ORE>= single precision continuity 3.500 8.500 0.0285
executed
no continuity 3.500 8.500 0.0285
continuity 4.800 16.000 3.500 9.000
LDED= double precision
no continuity 4.800 16.000 3.500 9.000
not executed 0.120 0.0285
ANDED= double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED= double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 4.800 16.000 3.500 9.000
LDED<> double precision
no continuity 4.800 16.000 3.500 9.000

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 87


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
not executed 0.120 0.0285
ANDED<> double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED<> double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 4.800 16.000 3.500 9.000
LDED> double precision
no continuity 4.800 16.000 3.500 9.000
not executed 0.120 0.0285
ANDED> double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED> double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 4.800 16.000 3.500 9.000
LDED<= double precision
no continuity 4.800 16.000 3.500 9.000
not executed 0.120 0.0285
ANDED<= double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED<= double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 4.800 16.000 3.500 9.000
LDED< double precision
no continuity 4.800 16.000 3.500 9.000
not executed 0.120 0.0285
ANDED< double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED< double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 4.800 16.000 3.500 9.000
LDED>= double precision
no continuity 4.800 16.000 3.500 9.000
not executed 0.120 0.0285
ANDED>= double precision continuity 4.400 15.100 3.200 7.500
executed
no continuity 4.400 15.100 3.200 7.500
not executed 0.120 0.0285
ORED>= double precision continuity 4.500 14.900 3.400 9.200
executed
no continuity 4.500 14.900 3.400 9.200
continuity 5.600 17.100 4.200 8.200
LD$=
no continuity 5.600 17.100 4.200 8.200
not executed 0.120 0.0285
AND$= continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$= continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
continuity 5.600 17.100 4.200 8.200
LD$< >
no continuity 5.600 17.100 4.200 8.200

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 88
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
not executed 0.120 0.0285
AND$< > continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$< > continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
continuity 5.600 17.100 4.200 8.200
LD$>
no continuity 5.600 17.100 4.200 8.200
not executed 0.120 0.0285
AND$> continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$> continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
continuity 5.600 17.100 4.200 8.200
LD$<=
no continuity 5.600 17.100 4.200 8.200
not executed 0.120 0.0285
AND$<= continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$<= continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
continuity 5.600 17.100 4.200 8.200
LD$<
no continuity 5.600 17.100 4.200 8.200
not executed 0.120 0.0285
AND$< continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$< continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
continuity 5.600 17.100 4.200 8.200
LD$>=
no continuity 5.600 17.100 4.200 8.200
not executed 0.120 0.0285
AND$>= continuity 5.300 16.400 3.900 7.300
executed
no continuity 5.300 16.400 3.900 7.300
not executed 0.120 0.0285
OR$>= continuity 5.200 15.700 4.000 7.600
executed
no continuity 5.200 15.700 4.000 7.600
BKCMP = n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500
BKCMP<> n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500
BKCMP> n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500
BKCMP<= n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500
BKCMP< n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500
BKCMP>= n=1 9.200 15.600 7.500 10.100
(s1, s2, d, n) n = 96 60.700 69.100 45.600 50.500

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 89


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
DBKCMP = n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DBKCMP<> n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DBKCMP> n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DBKCMP<= n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DBKCMP< n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DBKCMP>= n=1 9.700 16.400 8.600 13.000
(s1, s2, d, n) n = 96 61.200 69.900 47.900 52.800
DB + (s, d) executed 4.800 8.400 4.600 6.400
DB + (s1, s2, d) executed 5.100 8.700 4.800 6.700
DB - (s, d) executed 4.800 8.400 4.600 6.400
DB - (s1, s2, d) executed 5.100 8.700 4.800 6.700
DB * (s1, s2, d) executed 8.700 18.900 8.100 11.600
DB/ (s1, s2, d) executed 6.100 9.100 5.800 8.800
s = 0, d = 0 4.800 8.000 4.300 7.200
ED + (s, d) double precision
s = 21023, d = 21023 5.400 14.900 4.300 7.200
s1 = 0, s2 = 0 5.500 9.800 4.800 9.200
ED + (s1, s2, d) double precision
1023, d = 21023 6.100 17.800 4.800 9.200
s=2
s = 0, d = 0 4.400 10.800 4.400 7.500
ED - (s, d) double precision
s = 21023, d = 21023 5.400 15.500 4.400 7.500
s1 = 0, s2 = 0 4.700 13.900 3.800 7.500
ED - (s1, s2, d) double precision
1023, d = 21023 5.700 17.200 3.800 7.500
s=2
s1 = 0, s2 = 0 5.800 9.500 5.100 8.800
ED * (s1, s2, d) double precision
s = 21023, d = 21023 5.900 17.600 5.100 8.800
ED / (s1, s2, d) double precision s = 21023, d = 21023 7.300 18.700 5.900 10.000
BK + n=1 9.100 11.200 8.500 10.600
(s1, s2, d, n) n = 96 60.500 66.200 44.600 47.900
BK - n=1 9.700 12.000 8.900 11.300
(s1, s2, d, n) n = 96 60.500 66.200 44.600 47.900
DBK + n=1 7.500 12.400 6.450 9.950
(s1, s2, d, n) n = 96 59.900 65.200 43.700 47.500
DBK - n=1 7.500 12.400 6.450 9.950
(s1, s2, d, n) n = 96 59.900 65.200 43.700 47.500
$+sd – 11.200 24.700 8.100 13.900
$ + (s1, s2, d) – 7.900 16.600 6.500 10.300
s=0 2.800 9.400 1.800 4.700
FLTD double precision
s = 7FFFH 3.300 9.600 2.200 4.800
s=0 2.900 9.100 2.000 4.900
DFLTD double precision
s = 7FFFFFFFH 3.400 9.300 2.300 5.100
s=0 3.500 8.700 2.200 4.100
INTD double precision
s = 32766.5 4.100 12.900 3.200 5.600
s=0 3.200 9.500 2.200 3.400
DINTD double precision
s = 1234567890.3 4.100 13.400 3.000 5.100
DBL executed 2.500 4.400 2.300 2.700
WORD executed 2.800 3.900 2.600 3.600
GRY executed 2.700 4.300 2.300 3.000

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 90
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
DGRY executed 2.700 4.300 2.300 3.000
GBIN executed 4.000 6.400 3.800 4.300
DGBIN executed 5.000 6.900 5.000 5.900
NEG executed 2.100 4.400 2.000 3.300
DNEG executed 2.500 3.700 2.500 3.300
Floating point = 0 2.500 3.300 2.300 2.800
ENEG
Floating point = -1.0 2.800 5.600 2.500 3.900
Floating point = 0 3.000 8.800 1.800 3.100
EDNEG
Floating point = -1.0 2.700 9.400 1.900 3.000
n=1 6.000 13.400 5.900 8.200
BKBCD (s, d, n)
n = 96 83.300 91.400 61.000 63.400
n=1 6.500 9.800 5.600 9.300
BKBIN (s, d, n)
n = 96 55.400 62.900 49.200 52.500
ECON – 3.000 9.800 2.100 4.500
EDCON – 3.300 10.300 2.500 5.400
EDMOV – 2.700 8.500 1.700 5.000
Character string to be transferred = 0 4.400 12.300 3.400 5.600
$MOV
Character string to be transferred = 32 14.000 21.900 11.400 13.300
n=1 6.200 7.900 5.500 7.300
BXCH
n = 96 67.300 71.400 47.300 49.300
SWAP – 2.400 2.700 1.900 2.200
GOEND – 0.700 0.500
DI – 2.100 4.000 1.500 1.800
EI – 3.600 6.300 3.000 3.300
IMASK – 11.800 20.500 7.200 10.500
IRET – 1.400 1.000
n=1 5.900 12.500 3.700 5.600
RSF X n
n = 96 12.900 19.300 10.700 12.400
n=1 5.100 11.500 3.400 4.800
RSF Y n
n = 96 8.600 15.300 8.100 8.900
UDCNT1 – 6.200 16.400 5.100 12.300
UDCNT2 – 6.300 16.800 5.400 12.500
TTMR – 4.500 9.500 3.400 5.400
STMR – 7.800 21.400 5.800 12.500
ROTC – 20.900 21.500 8.000 9.400
RAMP – 6.700 14.600 5.200 8.400
SPD – 5.400 14.800 4.900 11.200
PLSY – 10.500 10.500 7.900 7.900
PWM – 10.100 10.100 7.500 7.500
MTR – 14.700 25.100 9.400 10.000
BKAND n=1 9.000 11.700 8.300 11.000
(s1, s2, d, n) n = 96 60.600 66.400 43.800 47.300
BKOR n=1 7.900 14.000 7.700 9.500
(s1, s2, d, n) n = 96 60.700 66.500 44.300 45.800
BKXOR n=1 8.800 13.800 7.300 9.200
(s1, s2, d, n) n = 96 61.300 66.300 43.800 45.800
BKXNR n=1 8.400 13.900 7.600 8.900
(s1, s2, d, n) n = 96 60.900 66.700 43.900 45.300
n=1 3.600 9.500 3.200 4.800
BSFR (d, n)
n = 96 6.500 15.900 5.800 7.700

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 91


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
n=1 3.600 9.300 3.400 5.100
BSFL (d, n)
n = 96 6.300 15.800 6.000 7.900
SFTBR n1 = 16 / n2 = 1 8.100 21.000 7.500 17.400
(n1, n2, d) n1 = 16 / n2 = 15 8.100 22.100 7.500 17.300
SFTBL n1 = 16 / n2 = 1 8.100 21.000 7.500 17.400
(n1, n2, d) n1 = 16 / n2 = 15 8.100 22.100 7.500 17.300
SFTWR n1 = 16 / n2 = 1 6.200 13.100 4.500 8.700
(n1, n2, d) n1 = 16 / n2 = 15 6.100 13.100 4.600 8.800
SFTWL n1 = 16 / n2 = 1 6.200 13.100 4.500 8.700
(n1, n2, d) n1 = 16 / n2 = 15 6.100 13.100 4.600 8.800
n=1 2.800 3.100 2.500 2.800
BSET (d, n)
n = 15 2.800 3.100 2.500 2.800
n=1 2.800 3.100 2.500 2.800
BRST (d, n)
n = 15 2.800 3.100 2.500 2.800
TEST executed 4.700 6.100 3.700 4.800
DTEST executed 4.700 6.100 3.700 4.800
n=1 4.300 5.700 3.700 4.100
BKRST (s, n)
n = 96 6.200 10.000 5.100 6.000
all match 4.800 5.300 4.200 4.600
n=1
none match 4.700 5.300 4.200 4.600
SER (s1, s2, d, n)
all match 33.200 35.900 25.900 26.300
n = 96
none match 33.200 35.900 25.900 26.300
all match 6.500 9.000 5.400 5.700
n=1
DSER none match 6.500 9.000 5.500 5.900
(s1, s2, d, n) all match 54.800 57.500 41.200 41.800
n = 96
none match 54.700 57.500 41.200 41.800
s=0 3.400 3.700 3.200 3.700
DSUMS (s, d)
s = FFFFFFFFH 3.400 3.700 3.200 3.700
n=2 6.000 10.700 5.300 6.900
DECO (s, d, n)
n=8 9.500 16.700 6.800 7.800
M1 = ON 5.400 6.900 4.700 5.100
n=2
M4 = ON 5.300 6.600 4.600 5.000
ENCO (s, d, n)
M1 = ON 10.700 14.000 9.000 10.000
n=8
M256 = ON 7.000 11.100 5.100 6.100
n=1 4.600 7.000 3.800 4.600
DIS (s, d, n)
n=4 4.900 7.300 4.000 5.000
n=1 5.000 7.300 3.500 4.800
UNI (s, d, n)
n=4 5.700 8.300 4.000 5.100
NDIS executed 11.200 15.200 11.000 13.200
NUNI executed 10.600 12.700 7.300 13.200
n=1 5.400 8.100 4.400 5.800
WTOB (s, d, n)
n = 96 38.400 40.900 28.200 29.300
n=1 5.300 8.200 4.600 5.500
BTOW (s, d, n)
n = 96 31.700 34.200 22.800 23.800
n=1 5.400 11.900 4.000 6.100
MAX (s, d, n)
n = 96 34.200 41.100 24.700 27.000
n=1 6.100 12.000 4.000 6.000
MIN (s, d, n)
n = 96 32.900 39.300 26.500 28.300
n=1 6.000 14.800 4.800 8.100
DMAX (s, d, n)
n = 96 61.100 69.500 47.100 49.600

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 92
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
n=1 6.000 14.800 4.300 5.900
DMIN (s, d, n)
n = 96 57.000 67.000 45.400 47.400
SORT n=1 6.800 13.700 5.600 8.800
(s1, n, s2, d1, d2) n = 96 34.400 48.600 27.200 31.800
DSORT n=1 6.800 14.300 5.600 8.200
(s1, n, s2, d1, d2) n = 96 41.800 57.500 33.200 39.000
n=1 5.000 7.300 4.200 5.500
WSUM (s, d, n)
n = 96 28.100 30.700 21.300 22.300
n=1 6.100 11.300 4.800 6.100
DWSUM (s, d, n)
n = 96 56.200 62.100 42.700 44.000
n=1 4.400 10.400 3.900 7.800
MEAN (s, d, n)
n = 96 16.100 24.500 12.900 18.000
n=1 6.000 12.500 5.300 9.950
DMEAN (s, d, n)
n = 96 34.000 42.000 23.000 28.800
NEXT – 0.940 1.400 0.770 1.200
BREAK – 3.500 10.200 3.100 7.600
Return to original program 2.900 8.800 1.600 2.600
RET
Return to other program 3.200 10.500 2.000 3.100
Internal file pointer 3.600 3.800 2.700 3.600
FCALL Pn
Common pointer 5.300 13.500 3.600 5.100
FCALL pn s1 to s5 – 20.900 30.300 16.500 18.600
ECALL * pn
– 72.700 109.000 65.900 77.600
*: Program name
ECALL * pn s1 to
s5 – 101.400 141.400 91.800 105.000
*: Program name
EFCALL * pn
– 72.800 109.600 66.200 78.100
*: Program name
EFCALL * pn s1
to s5 – 101.900 141.500 78.800 91.600
*: Program name
XCALL – 5.200 14.600 3.700 5.200
When selecting I/O refresh only 8.400 14.600 12.600 17.200
When selecting CC-Link refresh only (Master station side) 10.500 29.400 10.100 22.000
COM When selecting CC-Link refresh only (Local station side) 10.500 29.400 10.100 22.000
CCOM When selecting intelli auto refresh only 7.900 14.400 7.400 11.900
When selecting communications with display unit 29.700 79.900 26.800 60.700
When selecting communication with peripheral device 9.500 32.800 9.200 25.200
Number of data points = 0 4.200 6.700 3.200 4.600
FIFW
Number of data points = 96 4.400 6.800 3.300 3.800
Number of data points = 0 5.100 7.400 3.800 4.400
FIFR
Number of data points = 96 36.100 38.800 24.800 25.700
Number of data points = 0 4.900 7.500 3.800 5.300
FPOP
Number of data points = 96 5.000 7.500 3.700 5.400
Number of data points = 0 5.400 7.500 3.700 5.300
FINS
Number of data points = 96 5.000 7.400 3.700 5.300
Number of data points = 0 5.700 8.300 4.200 5.800
FDEL
Number of data points = 96 36.900 39.300 25.400 25.900
FROM n3 = 1 11.600 31.000 10.700 23.600
(n1, n2, d, n3) n3 = 1000 403.900 432.900 390.900 410.200
DFRO n3 = 1 13.300 35.400 12.600 26.700
(n1, n2, d, n3) n3 = 500 405.000 434.600 390.900 410.200

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 93


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
TO n3 = 1 11.200 28.400 9.600 21.300
(n1, n2, s, n3) n3 = 1000 381.500 410.900 372.500 390.800
DTO n3 = 1 12.500 33.900 12.000 25.700
(n1, n2, s, n3) n3 = 500 379.800 410.400 372.500 390.800
No display --> no display 2.400 2.600 1.900 2.000
LEDR
LED instruction execution --> no display 32.700 50.600 24.400 35.800
s=1 5.000 7.300 4.300 5.600
BINDA (s, d)
s = -32768 7.400 9.800 6.500 8.000
s=1 5.600 8.300 4.900 6.300
DBINDA (s, d)
s = -2147483648 10.500 12.900 9.600 11.000
s=1 4.500 6.900 3.700 5.200
BINHA (s, d)
s = FFFFH 4.500 6.900 3.700 5.200
s=1 5.000 7.600 4.600 6.000
DBINHA (s, d)
s = FFFFFFFFH 5.000 7.600 4.600 6.000
s=1 4.300 6.700 3.600 5.000
BCDDA (s, d)
s = 9999 4.800 7.100 4.100 5.400
s=1 4.900 7.200 4.000 5.500
DBCDDA (s, d)
s = 99999999 5.700 8.300 4.900 6.300
s=1 5.800 10.100 5.600 7.800
DABIN (s, d)
s = -32768 5.800 10.100 5.600 7.800
s=1 8.300 12.600 8.100 10.500
DDABIN (s, d)
s = -2147483648 8.300 12.600 8.100 10.500
s=1 4.500 8.800 4.400 6.500
HABIN (s, d)
s = FFFFH 4.500 8.800 4.400 6.500
s=1 5.500 10.000 5.300 7.700
DHABIN (s, d)
s = FFFFFFFFH 5.500 10.000 5.300 7.700
s=1 4.500 8.700 4.300 6.300
DABCD (s, d)
s = 9999 4.500 8.700 4.300 6.300
s=1 5.500 9.800 5.500 7.500
DDABCD (s, d)
s = 99999999 5.500 9.800 5.500 7.500
COMRD – 65.700 65.700 50.900 51.200
1 character 3.900 7.800 3.600 5.500
LEN
96 characters 19.700 23.900 16.800 18.700
STR – 7.500 16.700 6.600 10.400
DSTR – 10.200 19.700 9.600 11.500
VAL – 9.800 19.900 8.900 13.000
DVAL – 12.700 23.900 12.700 16.800
ESTR – 21.200 43.400 17.900 23.100
Decimal point format all 2-digit specification 28.300 41.000 22.500 29.00
EVAL
Exponent format all 6-digit specification 28.300 41.000 22.500 29.00
n=1 6.200 17.100 5.400 8.300
ASC (s, d, n)
n = 96 30.300 42.100 25.200 28.400
n=1 5.400 16.000 5.400 9.000
HEX (s, d, n)
n = 96 42.400 54.900 31.300 35.000
n=1 7.400 13.900 7.300 6.600
RIGHT (s, d, n)
n = 96 39.300 45.800 29.200 31.600
n=1 6.900 13.400 5.900 8.200
LEFT (s, d, n)
n = 96 39.300 45.800 29.200 31.500
MIDR – 10.200 16.500 8.100 10.300
MIDW – 10.700 14.900 8.800 10.200

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 94
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
No match 20.000 25.600 16.600 18.400
INSTR Head 11.000 16.500 9.100 10.900
Match
End 53.900 60.000 42.700 44.900
EMOD – 11.200 15.100 9.600 11.000
EREXP – 20.400 22.900 18.800 20.100
s = 128 / d = 40 / n = 1 45.300 63.400 35.300 47.600
STRINS (s, d, n)
s = 128 / d = 40 / n = 48 63.200 81.900 48.600 61.700
s = 128 / d = 40 / n = 1 39.000 53.500 34.800 44.600
STRDEL (s, d, n)
s = 128 / d = 40 / n = 48 40.800 50.400 29.200 38.100
SIN single precision 5.000 8.400 4.100 5.700
COS single precision 5.200 8.000 4.000 5.600
TAN single precision 6.100 9.200 5.100 6.700
ASIN single precision 6.900 10.900 5.900 8.500
ACOS single precision 7.800 11.000 6.700 8.900
ATAN single precision 4.700 7.300 3.900 6.000
SIND double precision 9.400 22.300 8.500 13.800
COSD double precision 10.000 22.300 8.800 14.600
TAND double precision 12.200 24.900 10.800 16.500
ASIND double precision 12.800 25.900 11.600 16.600
ACOSD double precision 12.600 25.900 11.200 16.200
ATAND double precision 10.500 22.900 9.100 13.800
RAD single precision 3.000 6.400 2.100 4.300
RADD double precision 5.200 16.900 3.600 9.200
DEG single precision 2.900 6.600 2.200 4.400
DEGD double precision 5.200 16.800 3.800 9.000
SQR single precision 3.600 7.200 2.600 4.300
SQRD double precision 6.200 19.100 5.200 11.000
s = -10 4.700 7.500 3.800 5.600
EXP (s, d) single precision
s=1 4.700 7.500 3.800 5.600
s = -10 9.300 22.100 8.000 13.500
EXPD (s, d) double precision
s=1 9.300 22.100 8.000 13.500
s=1 4.700 8.800 3.800 6.400
LOG (s, d) single precision
s = 10 6.300 10.400 5.200 7.700
s=1 8.600 21.100 7.700 12.500
LOGD (s, d) double precision
s = 10 10.200 23.000 9.200 14.300
RND – 1.500 2.500 0.800 1.800
SRND – 1.800 2.900 1.100 2.000
s=0 2.700 4.400 1.500 3.000
BSQR (s, d)
s = 9999 6.100 12.500 5.100 8.000
s=0 2.700 4.400 1.500 3.000
BDSQR (s, d)
s = 99999999 8.500 15.200 7.500 9.900
BSIN – 9.500 21.500 8.100 14.500
BCOS – 9.500 21.400 7.800 13.700
BTAN – 10.400 22.600 9.000 13.300
BASIN – 11.800 23.600 10.100 12.800
BACOS – 13.100 23.700 11.100 14.100
BATAN – 11.100 21.500 9.100 10.900
POW
single precision s1 = 12.3E+5; s2 = 3.45E+0 9.600 13.300 8.400 10.900
(s1, s2, d)
POWD
double precision s1 = 12.3E+5; s2 = 3.45E+0 18.900 30.600 18.200 26.500
(s1, s2, d)

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 95


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
LOG10 single precision 6.000 9.600 5.700 8.050
LOG10D double precision 11.900 22.900 11.100 18.600
LIMIT – 4.000 4.000 2.400 2.700
DLIMIT – 4.400 4.400 2.800 3.000
BAND – 4.500 6.600 2.700 3.800
DBAND – 4.800 6.900 3.300 4.600
ZONE – 4.200 6.100 2.600 4.300
DZONE – 4.700 6.900 3.000 4.600
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT =
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT= specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT= specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT <>
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT<> specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT<> specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT>
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT> specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT> specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 96
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT<=
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT<= specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT<= specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT<
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT< specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT< specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600
Comparison of continuity 7.700 14.200 6.800 10.900
specified date no continuity 7.700 14.200 6.800 10.900
LDDT>=
Comparison of continuity 6.400 12.800 5.500 9.700
current date no continuity 6.400 12.800 5.500 9.700
not executed 0.160 0.038
Comparison of continuity 7.300 14.000 6.500 10.700
ANDDT>= specified date no continuity 7.300 14.000 6.500 10.700
Comparison of continuity 6.100 12.700 5.300 9.300
current date no continuity 6.100 12.700 5.300 9.300
not executed 0.160 0.038
Comparison of continuity 7.400 14.400 6.700 10.800
ORDT>= specified date no continuity 7.400 14.400 6.700 10.800
Comparison of continuity 6.000 12.800 5.400 9.600
current date no continuity 6.000 12.800 5.400 9.600
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM=
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 97


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM= specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM= specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM<>
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM<> specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM<> specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM>
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM> specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM> specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM<=
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM<= specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

A – 98
Appendix A Operation Processing Time of LCPU

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM<= specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM<
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM< specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM< specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Comparison of continuity 7.600 14.000 6.700 10.800
specified time no continuity 7.600 14.000 6.700 10.800
LDTM>=
Comparison of continuity 6.200 12.700 5.400 9.500
current time no continuity 6.200 12.700 5.400 9.500
not executed 0.160 0.038
Comparison of continuity 7.200 13.900 6.300 10.800
ANDTM>= specified time no continuity 7.200 13.900 6.300 10.800
Comparison of continuity 5.900 12.500 5.100 9.500
current time no continuity 5.900 12.500 5.100 9.500
not executed 0.160 0.038
Comparison of continuity 7.300 14.100 6.600 10.800
ORTM>= specified time no continuity 7.300 14.100 6.600 10.800
Comparison of continuity 6.000 12.700 5.300 9.500
current time no continuity 6.000 12.700 5.300 9.500
Point No. 1 < s1 < Point No. 2 12.500 29.200 11.900 23.000
SM750 = ON
SCL Point No. 9 < s1 < Point No. 10 13.200 29.100 12.100 23.000
(s1, s2, d) Point No. 1 < s1 < Point No. 2 12.100 28.900 10.900 22.200
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.900 30.900 12.700 23.900
Point No. 1 < s1 < Point No. 2 12.500 29.200 11.900 23.000
SM750 = ON
DSCL Point No. 9 < s1 < Point No. 10 13.200 29.100 12.100 23.000
(s1, s2, d) Point No. 1 < s1 < Point No. 2 12.100 28.900 10.900 22.200
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.900 30.900 12.700 23.900
Point No. 1 < s1 < Point No. 2 13.400 29.700 11.800 23.300
SM750 = ON
SCL2 Point No. 9 < s1 < Point No. 10 12.900 29.500 12.100 23.300
(s1, s2, d) Point No. 1 < s1 < Point No. 2 12.200 29.100 11.000 22.600
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.900 30.700 12.600 23.900
Point No. 1 < s1 < Point No. 2 13.400 29.700 11.800 23.300
SM750 = ON
DSCL2 Point No. 9 < s1 < Point No. 10 12.900 29.500 12.100 23.300
(s1, s2, d) Point No. 1 < s1 < Point No. 2 12.200 29.100 11.000 22.600
SM750 = OFF
Point No. 9 < s1 < Point No. 10 13.900 30.700 12.600 23.900
RSET Standard RAM 3.500 11.100 2.700 5.900

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

Programming MELSEC System Q and L series A – 99


Operation Processing Time of LCPU Appendix A

Processing time (μs)


Instruction Condition (Device) L02CPU L26CPU-BT
Min. Max. Min. Max.
No digit increase 9.000 17.900 4.600 7.000
DATE -
Digit increase 10.000 19.200 4.600 6.500
SECOND – 4.600 9.800 2.200 3.400
HOUR – 4.600 10.300 2.400 4.300
SD memory card to standard ROM 690.800 736.470 1.146.900 1.179.500
QCDSET
Standard ROM to SD memory card 6.981.400 7.232.070 5.613.900 5.653.500
DATERD – 4.600 11.200 2.500 4.200
DATEWR – 6.500 19.300 4.100 8.900
No digit increase 10.000 19.400 4.700 6.600
DATE +
Digit increase 9.900 19.700 4.600 6.500
S.DATERD – 7.800 22.500 4.800 7.100
No digit increase 15.100 34.100 7.400 10.000
S.DATE +
Digit increase 15.000 34.100 7.400 10.000
No digit increase 13.700 33.600 7.400 10.300
S.DATE -
Digit increase 13.700 33.600 7.500 10.200
PSTOP – 67.600 104.100 56.600 79.800
POFF – 66.800 103.600 57.200 79.800
PSCAN – 67.900 104.800 60.100 79.900
WDT – 1.600 4.800 1.100 2.400
DUTY – 4.900 10.100 4.800 9.600
TIMCHK – 4.100 9.100 3.500 4.700
ZRRDB File register of standard RAM 2.900 3.300 1.800 2.100
ZRWRB File register of standard RAM 3.600 3.800 2.400 2.700
ADRSET – 2.200 4.800 2.100 2.600
ZPUSH – 8.000 12.000 5.800 7.500
ZPOP – 8.200 10.900 5.800 6.400
When mounting CC-Link module (Master station side) 23.700 48.500 19.300 26.000
S.ZCOM
When mounting CC-Link module (Local station side) 23.700 48.500 19.100 26.200
UNIRD n2 = 1 5.000 14.100 3.700 8.000
(n1, d, n2) n2 = 16 13.600 22.600 12.200 16.600
TYPERD – 32.100 67.600 29.500 52.500
TRACE Start 58.100 58.100 43.800 44.700
TRACER – 6.100 6.100 4.500 4.500
Number of displayed characters = 1 7.300 17.000 7.000 13.500
UMSG
Number of displayed characters = 32 16.500 26.300 14.300 21.300
SP.FWRITE – 81.000 81.800 63.500 64.100
SP.FREAD – 81.100 81.700 61.600 62.500
SP.DEVST – 50.100 50.100 39.400 39.400
S.DEVLD – 12.000 27.600 10.000 17.000

Tab. A-29: Processing times for instructions other than subset instructions for LCPU

NOTE For the instructions for which a leading edge instruction (P) is not described, the processing
time is the same as an ON execution instruction.
Example: MOVP instruction, WANDP instruction etc.

A – 100
Appendix A Operation Processing Time of LCPU

Table of the time to be added when file register, extended data register, extended link
register, and module access device are used
Device Specification Processing time (μs)
Device Name Data
Location L02CPU L26CPU-BT
Source 0.100 0.048
Bit
Destination 0.220 0.038
Source 0.100 0.048
File register (R) When standard RAM is used Word
Destination 0.100 0.038
Source 0.200 0.095
Double word
Destination 0.200 0.086
Source 0.140 0.057
Bit
Destination 0.280 0.048
File register (ZR), Source 0.140 0.057
Extended data register (D), When standard RAM is used Word
Extended link register (W) Destination 0.140 0.048
Source 0.240 0.105
Double word
Destination 0.240 0.095
Source 11.700 11.200
Bit
Destination 15.400 15.300
Source 9.460 9.410
Module access device (Un\G) Word
Destination 19.000 19.000
Source 11.000 10.900
Double word
Destination 18.800 18.700

Tab. A-30: Processing times to be added for instructions other than subset instructions for
LCPU

Programming MELSEC System Q and L series A – 101


Comparison of the CPUs Appendix A

A.5 Comparison of the CPUs


The following table contains the characteristics, i.e. available devices, processing modes, spe-
cial relays, etc. of the different CPUs (QCPU, LCPU, A-series CPUs).

A.5.1 Available devices

QCPU LCPU A series

Qn, QnH,
Device
Q00J, Q00, Q01 Q00UJ, Q00U, QnPH, QnPRH, L02CPU, AnU AnA AnN
Q01U, Q02U QnUD(E), L26CPU-BT
QnUD(E)H

Q00J: 256 Q00UJ: 256 L02CPU: A2U : 512 A2A : 512 A1N: 256
Number of Q00U: 1024 1024 A2U-S1: 1024 A2N: 512
Q00: 1024 4096 A2A-S1:1024
inputs/outputs 9) Q01: 1024
Q01U: 1024 L26CPU-BT: A3U: 2048
A3A: 2048
A2N-S: 1024
Q02U: 2048 4096 A4U : 4096 A3N: 2048
Same with I/O devices points of each
Number of I/O device points 8) 2048 1) 8192 1) 8192 1) 8192 1) 8192
CPU

Internal relays 8192 1) 8192 1) 8192 1) 8192 1)


Total 2048
Latch relays 2048 1) 8192 1) 8192 1) 8192 1) Total 8192 Total 8192
Sequence pro-
gram — — —
Step
relays
SFC 2048 6) 8192 8192 8192 —
1)
Annunciators 1024 2048 1) 2048 1) 2048 1) 2048 2048 256

Edge triggered relays 1024 1) 2048 1) 2048 1) 2048 1) —

Link relays 2048 1) 8192 1) 8192 1) 8192 1 8192 4096 1024

Special link relays 1024 2048 1) 2048 1) 2048 1) 56 56 56

Timers 1) 1) 1) 1)
512 2048 2048 2048
Total 2048 Total 2048 Total 256
Retentive Timers 0 1) 0 1) 0 1) 0 1)

Counters 512 1) 1024 1) 1024 1) 1024 1 1024 1024 256

Data registers 1) 1) 1) 12288 1) 8192 6144 1024


11136 12288 12288

Link registers 2048 1) 8192 1) 8192 1) 8192 1) 8192 4096 1024

Special link Registers 1024 1) 2048 1) 2048 1) 2048 1) 56 56 56

16 16
Function inputs —
(FX0 to FXF) 7) (FX0 to FXF) 7)
16 16
Function output —
(FX0 to FXF) 7) (FY0 to FYF) 7)
Special relays 1000 2048 2048 2048 256 256 256
5 5
Function registers —
(FD0 to FD4) (FD0 to FD15)
Special registers 1000 2048 2048 2048 256 256 256
Direct access Designated by J\ — —
link devices
Direct access Designated by
special devices Designated by U\G U\G —

Tab. A-31: Device comparison

A – 102
Appendix A Comparison of the CPUs

QCPU LCPU A series

Device Qn, QnH,


Q00UJ, Q00U, QnPH, QnPRH, L02CPU,
Q00J, Q00, Q01 Q01U, Q02U QnUD(E), L26CPU-BT AnU AnA AnN
QnUD(E)H
Other than Universal model QCPU:
10 16 (Z0 to Z15) 7 7
Z 20 (Z0 to Z19) (Z, Z1 to Z6) (Z, Z1 to Z6) 1 (Z)
Index (Z0 to Z15) Universal model QCPU:
registers 20 (Z0 to Z19)
7 7
V 2) — —
(V, V1 to V6) (V, V1 to V6)
1 (V)

32768 per block 32768 per block 32768 per block 8192 per block 8192 per block 8192 per block
File registers
(R0 to R32767) 5) (R0 to R32767) 10) (R0 to R32767) (R0 to R8191) (R0 to R8191) (R0 to R8191)

Accumulators 3) — — 2 2 2

Nesting 15 15 15 15 8 8 8
Pointer 300 512 4096 4096 256 256 256
Interrupt pointers 128 256 48 256 32 32 32

SFC blocks 126 6) 320 320 320 —

SFC transition devices — 512 512 512 —


Decimal constants K-2147483648 to K2147483647
Hexadecimal constants H0 to HFFFFFFFF

Real number constants 6) E1.17549-38 to E3.40282+38 —

Character strings „QnA CPU“, „ABCD“ 4) —

Tab. A-31: Device comparison


1
The number of device points can be changed via parameters.
2
CPU uses V for the edge relay.
3 Instructions using accumulators with the AnN, AnA, and AnU CPUs have different formats than those with the

QCPUs.
4 Can only be used by the $MOV instruction with the Q00JCPU, Q00CPU and Q01CPU.

5 The Q00JCPU does not have file registers.

6
Applicable to products with the first 5 digits of the serial number 04122 or higher (Q00JCPU, Q00CPU, and Q01CPU).
7
Each 5 points of FX0 to FX4 and FY0 to FY4 can be used on the programs.
8 The number of points that can be used on the programs

9
The number of accessible points to actual I/O modules
10
The Q00UJCPU does not have file registers.

Programming MELSEC System Q and L series A – 103


Comparison of the CPUs Appendix A

A.5.2 I/O control modes

Type of CPU
I/O control mode
QCPU LCPU AnUCPU AnACPU AnNCPU

Refresh mode     2)

Partial refresh
    
instructions

Direct Dedicated
— —   —
input/output instructions1)
mode
Direct access inputs   — — —

Direct access outputs   — — —

Direct mode — — — — 2)

Tab. A-32: I/O Control mode


1
The DOUT, DSET, and SRST instructions are dedicated instructions for direct access outputs. There are no dedicated
instructions for direct access inputs.
2 With the AnN CPU refresh mode and direct mode are switched over via DIP switch.

A.5.3 Data types

Set Data QCPU LCPU AnUCPU AnACPU AnNCPU

Bit device     

Bit Data  
Word device (Bit designation re- (Bit designation re- — — —
quired) quired)

    
Bit device (Digit designation (Digit designation (Digit designa- (Digit designa- (Digit designa-
16-bit
required) required) tion required) tion required) tion required)
word data
Word device     

    
Bit device (Digit designation (Digit designation (Digit designa- (Digit designa- (Digit designa-
32-bit
required) required) tion required) tion required) tion required)
word data
Word device     

Real number data 1) 1)   —

Character string data 2) 2) — — —

Tab. A-33: Data that can be used by instructions


1
Applicable to products with the first 5 digits of the serial number 04122 or higher (Q00JCPU, Q00CPU, and Q01CPU).
2 Character string data can be used in the Q00JCPU, Q00CPU and Q01CPU in combination with the $MOV instruction
only.

NOTE Refer to section 3.5 for detailed information on data types.

A – 104
Appendix A Comparison of the CPUs

A.5.4 Timer comparison

Timer functions

Name Function QCPU/LCPU AnUCPU 1) AnACPU 1) AnNCPU 1)

100 ms (default)
Change of measurement unit at the
Measurement unit parameter is enabled. Fixed at 100 ms
QCPU/LCPU 1 to 1000 ms
(1 ms unit)

K100 K100
Designation method T0 T0

TIMER_M Setting value


Low-speed timer (regular/dedicated designation and  2)   
timers) timer start

Programming TIMER_VALUE_M
Setting value
(GX IEC (dedicated timers
designation  2)   
Developer) only)

TIMER_START_M
(dedicated timers Timer start  2)   
only)

Programming
Setting value designation and timer start OUT Tn Setting value OUT Tn Setting value
(GX Works2)

10 ms (default)
Change of measurement unit at
the parameter is enabled.
Measurement unit QnUCPU/LCPU: Fixed at 100 ms
0.01 to 100ms (0.01 ms unit)
QCPU(Other than QnUCPU):
0.1 to 100 ms (0.1 ms unit)
High-speed timer
High speed timer specification
K100
H K100 T200
Designation method T0

High speed timer setting: High speed timer setting: Conducted at parameters
Conducted by sequence program

TIMER_M Setting value


(regular/dedicated designation and  2)   
timers) timer start

Programming TIMER_VALUE_M
Setting value
(GX IEC (dedicated timers  2)   
designation
High-speed timer Developer) only)

TIMER_START_M
(dedicated timers Timer start  2)   
only)

Programming
Setting value designation and timer start OUT Tn Setting value OUT Tn Setting value
(GX Works2)

Tab. A-34: Timer comparison

Programming MELSEC System Q and L series A – 105


Comparison of the CPUs Appendix A

Name Function QCPU/LCPU AnUCPU 1) AnACPU 1) AnNCPU 1)

Same measurement unit as low


Measurement unit Fixed at 100 ms
speed timer

K100 K100
Designation method ST0 T0

TIMER_H_M Setting value


(regular/dedicated designation and  2)   
Retentive
timers) timer start
low-speed timer
Programming TIMER_VALUE_M
Setting value
(GX IEC (dedicated timers
designation  2)   
Developer) only)

TIMER_START_M
(dedicated timers Timer start  2)   
only)

Programming
Setting value designation and timer start OUT Tn Setting value OUT Tn Setting value
(GX Works2)

Same measurement unit as high


Measurement unit —
speed timer

High speed timer specification

H K100
Designation method ST0 —

High speed timer setting:


Conducted by sequence program

TIMER_H_M Setting value


Retentive (regular/dedicated designation and  2) — — —
High-speed timer timers) timer start

Programming TIMER_VALUE_M
Setting value
(GX IEC (dedicated timers
designation  2) — — —
Developer) only)

TIMER_START_M
(dedicated timers Timer start  2) — — —
only)

Programming
Setting value designation and timer start OUTH STn Set value — — —
(GX Works2
Setting range for setting value 1 to 32767 1 to 32767
Processing of setting value 0 ON momentarily No maximum (does not time out)

Contact Enabled (Z0 and Z1 usable only) Capable Not capable

Coil Enabled (Z0 and Z1 usable only) Not capable Not capable
Index
qualification Setting value Enabled (Z0 to Z15 are usable) 1) Not capable Not capable

Current value Enabled (Z0 to Z15 are usable) 1) Capable Capable

Update processing for current value


At OUT Tn instruction execution After END processing
Contact ON/OFF processing

Tab. A-34: Timer comparison


1 The initial number for the different timers must be specified in the GX IEC Developer
in the dialogbox “PLC Parameter - T/C Range“
2
GX IEC Developer does not support LCPU
3 The Q00J/Q00/Q01CPU can use Z0 to Z9.

The Universal model QCPU/LCPU can use Z0 to Z19.

A – 106
Appendix A Comparison of the CPUs

Timer function blocks in the GX IEC Developer

Type of CPU
Name Function block
QCPU LCPU AnU AnA AnN

10 ms timer  —   

100 ms timer  —   

retentive timer  —   

Low-speed timer  — — — —

High-speed timer  — — — —

retentive
 — — — —
High-speed timer

Timer function blocks (legend)

Term in function block Meaning Indication of Indication of


regular timers retentive timers

Coil Coil Execution condition for timer process TC STC

Preset Setting value — TValue TValue

Valueln Initial value Default: 0 — —

ValueOut Actual value — TN STN

Status Contact Output contact is switched after time TS STS

Assign the function block to the instance label specified in the header and assign the input and
output variables.

Programming MELSEC System Q and L series A – 107


Comparison of the CPUs Appendix A

NOTE Cautions on using timers


During the execution of the OUT T  instruction, the present value of the timers is updated and
the contact is switched ON or OFF. If the present value of the timer is larger than or equal to the
set value when the timer coil is turned ON, the contact of that timer is turned ON.
In a program, in which the operation of a timer is started by another timer, the instruction for the
timer which is started later must be processed first. For example, if the contact of T1 activates
the coil of T2, the instruction for T2 must placed in the program before the instruction for T1.
By doing so, it is prevented that all timer contact are turned ON at the same scan. This can hap-
pen if the instruction for a timer, which starts another timer is processed first and the setting value
for high speed timers is smaller than the scan time or the setting value for slow speed timers is
„1“.

Example

For timers T0 to T2, the program is created in the order the timer operates later.
T1 K1
T2 T2 timer starts measurement from the next scan after turning the contact of T1 ON.

T0 K1
T1 T1 timer starts measurement from the next scan after turning the contact of T0 ON.

X0 K1
T0 T0 timer starts measurement when X0 is turned ON.

For timers T0 to T2, the program is created in the order of timer operation.
X0 K1
T0 T0 timer starts measurement when X0 is turned ON.

T0 K1
T1

Contacts of T1 and T2 timers are turned ON when contact of T0 is turned ON.


T1 K1
T2

A – 108
Appendix A Comparison of the CPUs

A.5.5 Comparison of counters

Type of CPU
Function
QCPU/LCPU AnU AnA AnN

Setting value
Counter_M designation and  2)   
counter start
Programming
(GX IEC Developer) Setting value
Counter_Start_M
designation  2)   

Counter_Value_M Counter start  2)   

Setting value
Programming
(GX Works2)
OUT Cn Set value designation and  2)   
counter start

K100 K100
Designation method C0 C0

Enabled
Contact Capable Not capable
(Z0 and Z1 usable only)

Enabled Not capable Not capable


Index Coil (Z0 and Z1 usable only)
qualification
Setting value Not capable Not capable Not capable

Current value Enabled (Z0 to Z15 are usable) 1) Capable Capable

Update processing for current value


At OUT Cn instruction execution After END processing
Contact ON/OFF processing

Tab. A-35: Counter functions


1
GX IEC Developer does not support LCPU
2
The Q00J/Q00/Q01CPU can use Z0 to Z9.
The Universal model QCPU/LCPU can use Z0 to Z19.

Programming MELSEC System Q and L series A – 109


Comparison of the CPUs Appendix A

Counter function blocks

Type of CPU
Name Function blocks
QCPU LCPU AnU AnA AnN

Counter — —   

Tab. A-36: Counter function blocks

Term in function block Meaning Indication of counter

Coil Coil Execution condition for counter CC

Preset Setting value CValue

Valueln Initial value Default: 0 —

ValueOut Current value CN

Output contact is switched after the function


Status Contact CS
block is processed.

Tab. A-37: Counter function blocks (legend)

A.5.6 Comparison of display instructions

Instruction QCPU/LCPU AnUCPU AnACPU AnNCPU

When SM701is OFF: Output continued until 00H When M9049 is OFF: Output continued
1) encountered until 00H encountered
PR
When SM701 is ON: 16 characters output When M9049 is ON: 16 characters output

When SM701 is OFF: 32 character comment output


PRC 1) 16-character comment output
When SM701 is ON: Upper 16 characters output

Tab. A-38: Comparison of display instructions


1
These instructions are not available for a Q00JCPU, Q00CPU or Q01CPU.

A – 110
Appendix A Comparison of the CPUs

A.5.7 QCPU, LCPU instructions whose designation format has been changed

Since QCPU, LCPU do not use accumulators (A0, A1), the format of the AnU, AnA, and AnN
CPU instructions that use accumulators has changed.

QCPU/LCPU AnU CPU / AnA CPU / AnN CPU


Function
Instruction format Remark Instruction format Remark

ROR (d, n) D: Rotation data ROR (n) Rotation data is set at A0


16-bit rotation to right
D: Rotation data Rotation data is set at A0
RCR (d, n) RCR (n)
The carry flag uses SM700 Carry flag uses M9012

ROL (d, n) D: Rotation data ROL (n) Rotation data is set at A0


16-bit rotation to left
D: Rotation data Rotation data is set at A0
RCL (d, n) RCL (n)
The carry flag uses SM700 Carry flag uses M9012

Rotation data is set at A0


DROR (d, n) D: Rotation data DROR (n)
and A1
32-bit rotation to right
Rotation data is set at A0
D: Rotation data
DRCR (d, n) DRCR (n) and A1
The carry flag uses SM700
Carry flag uses M9012

Rotation data is set at A0


DROL (d, n) D: Rotation data DROL (n)
and A1
32-bit rotation to left
Rotation data is set at A0
D: Rotation data
DRCL (d, n) DRCL (n) and A1
The carry flag uses SM700
Carry flag uses M9012

Search results are stored at the Search results stored at A0


16-bit data search SER (s1, s2, d, n) SER (s1, s2, n)
d and d+1 devices and A1

Search results stored at A0


Search results are stored at the
32-bit data search DSER (s1, s2, d, n) DSER (s1, s2, n) and A1
d and d+1 devices
Carry flag uses M9012

Check results are stored at the


16-bit data bit check SUM (s, d) SUM (s) Check results stored at A0
d device

Check results are stored at the


32-bit data bit check DSUM (s, d) DSUM (s) Check results stored at A0
d device

Partial refresh RFS (s, n) Added dedicated instruction SEG (d, n) Only when M9052 is ON

8 character ASCII conversion $MOV ((character string), d) ASC ((character string), d)

Carry flag set SET (SM700) No dedicated instruction STC

Carry flag reset RST (SM700) No dedicated instruction CLC

P255: END instruction


Jump to END instruction GOEND Added dedicated instruction CJ (P255)
designation

CHKST CJ (Pn)
CHK instruction 1) CHK
Added CHKST instruction
CHK (P254)

Tab. A-39: Instructions whose expression has changed


1
These instructions are not available for a Q00JCPU, Q00CPU or Q01CPU.

Programming MELSEC System Q and L series A – 111


Comparison of the CPUs Appendix A

A.5.8 AnACPU and AnUCPU dedicated instructions

Method of expression of dedicated instructions


Dedicated instructions based on the LEDA, LEDB, LEDC, SUB, and LEDR instructions, that
are used with the AnACPU or AnUCPU have been changed for the same format as the basic
instructions and the application instructions for the QCPU, LCPU.
The instructions that cannot be converted due to the absence of the corresponding instructions
in the QCPU, LCPU are converted into OUT SM1255/OUT SM999 (for the Q00J/Q00/
Q01CPU).
The instructions that have been converted into OUT SM1255/OUT SM999 should be replaced
by other instructions or deleted.

QCPU AnUCPU/AnACPU

LEDA(B) (instruction name)


LEDC/SUB (s)
Instruction name (s, d, n) LEDC/SUB (d)
LEDC/SUB (n)
LEDR

Tab. A-40: Method of expression of dedicated instruction

Dedicated instructions whose names have been changed


Dedicated instructions for the AnUCPU or AnACPU which have the same instruction name as
is used for basic instructions and application instructions have undergone name changes in the
QCPU, LCPU.

Function QCPU/LCPU AnUCPU/AnACPU

Floating point addition E+ ADD

Floating point subtraction E– SUB

Floating point multiplication Ex MUL

Floating point division E/ DIV

Data dissociation NDIS DIS

Data association NUNI UNI

Updating check patterns CHKCIR 1), CHKEND 1) CHK, CHKEND

Tab. A-41: Dedicated instructions with changed names


1
Not available on Q00J/Q00/Q01CPU/Universal model QCPU/LCPU.

A – 112
Appendix A Table of special relays

A.6 Table of special relays


Special relays (SM) are internal relays the application of which is fixed in the PLC. Therefore,
they cannot be used like other internal relays in a sequence program. However, some of them
can be set ON or OFF in order to control the CPU.
The table below describes the meanings of the headings in the following tables:

Item Meaning
Number Indicates the number of the special relay.
Name Indicates the name of the special relay.
Meaning Contains the function of the special relay in brief.
Description Contains a detailed description of the special relay.
Indicates whether the special relay is set by the system or the user.
<Set by>
S : Set by the system
U : Set by the user (using a program, programming tool, GOT,
or test operation from other external devices)
S/U : Set by the system or user

Is indicated only if the setting is done by the system.


Set by
<if set>
(if set)
END processing : Set during END processing
Initial : Set during initial processing (Power ON, STOP->RUN)
Status change : Set after status change
Error : Set after error
Instruction execution : Set during instruction execution
Request : Set for user request (through SM, etc.)
When system is switched : Set when the system is switched
(between the control system and the standby system)
Indicates special relay M9 corresponding to the ACPU (Change and notation when contents changed.
ACPU M9 Incompatible with the Q00J/Q00/Q01 and QnPRH.)
Items indicated as "New“ were newly added to the QCPU or LCPU.
Indicates the corresponding CPU:
• QCPU: All the System Q CPU modules
• Q00J/Q00/Q01: Basic model QCPU
• Qn(H): High Performance model QCPU
• QnPH: Process CPU
Valid for:
• QnPRH: Redundant CPU
• QnU: Universal model QCPU
• Q00UJ/Q00U/Q01U: Q00UJCPU, Q00UCPU, and Q01UCPU
• LCPU: All the L series CPU modules
• CPU module model: Only the specified model (Example: Q02UCPU, L26CPU-BT)

For detailed information on the following topic refer to the manuals:


● Networks → Manuals for each network module
● SFC → Programming Manual (SFC)

NOTE Do not change the values of special relay set by system using a program or by test operation.
Doing so may result in system down or communication failure.

Programming MELSEC System Q and L series A – 113


Table of special relays Appendix A

A.6.1 Diagnostic information

Number Name Meaning Description Set by ACPU Valid for:


(if set) M9
 ON if diagnosis results show error occurrence
Qn(H)
(Also turns on if an error is detected by an
annunciator or the CHK instruction.) QnPH
 Stays ON subsequently even if normal operations
QnPRH
restored.
Diagnostic OFF: No error S
SM0 New Q00J/
errors ON: Error  This relay turns on if an error is detected by (Error)
Q00/
diagnostics. (Also turns on if an error is detected by
an annunciator.) Q01
 This relay remains on even after the system returns QnU
to normal.
LCPU
 Comes ON when an error occurs as a result of self-
Qn(H)
diagnosis. (Remains OFF if an error is detected by
an annunciator or the CHK instruction.) QnPH
 Stays ON subsequently even if normal operations
QnPRH
OFF: No self-diagnosis restored.
Self-diagnostic S
SM1 errors M9008 Q00J/
error  This relay turns on if an error is detected by self- (Error)
ON: Self-diagnosis Q00/
diagnostics. (Remains off if an error is detected by
an annunciator.) Q01
 This relay remains on even after the system returns QnU
to normal.
LCPU
OFF: No error common
Error common information When SM0 is ON, ON if there is error common informa- S
SM5 New
information ON: Error common tion. (Error)
information
QCPU
OFF: No error individual
Error individual information When SM0 is ON, ON if there is error individual informa- S LCPU
SM16 New
information ON: Error individual tion. (Error)
information
SM50 Error reset OFF → ON: Error reset Conducts error reset operation. U New
Qn(H)
ON if battery voltage at CPU or memory card drops
below rated value. QnPH
Stays ON subsequently even after normal operation is M9007 QnPRH
restored. QnU
OFF: Normal Synchronous with BAT. ALARM LED. S
SM51 Battery low latch LCPU
ON: Battery low (Error)
ON if battery voltage at CPU drops below rated value.
Q00J/
Stays ON subsequently even after normal operation is
New Q00/
restored.
Q01
Synchronous with ERR. LED.
OFF: Normal Same as SM51, but goes OFF subsequently when bat- S QCPU
SM52 Battery low M9006
ON: Battery low tery voltage returns to normal. (Error) LCPU
Comes ON when a AC power supply module is used and
a momentary power interruption not exceeding 20 ms
QCPU
has occured; reset by turning the power OFF then ON
again.
OFF: AC/DC DOWN not Comes ON when a AC power supply module is used and
AC/DC DOWN detected a momentary power interruption not exceeding 10 ms S
SM53 M9005 LCPU
detection ON: AC/DC DOWN has occured; reset by turning the power OFF then ON (Error)
detected again.
Comes ON when a DC power supply module is used and
a momentary power interruption not exceeding 10 ms Q CPU
has occured; reset by turning the power OFF then ON LCPU
again.
ON when operation error is generated. Q CPU
OFF: Normal S
SM56 Operation errors Stays ON subsequently even if normal operation is M9011
ON: Operation error (Error) LCPU
restored.

Tab. A-42: Special relays (1): Diagnostic information

A – 114
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
Comes ON even if there is only one output module with
OFF: Normal a blown fuse and remains ON even after return to nor-
Blown fuse S
SM60 ON: Module with blown mal. M9000 QCPU
detection (Error)
fuse Blown fuse state is checked even for remote I/O station
output modules.
Comes ON if there is a discrepancy between the actual
I/O modules and the registered information when the
I/O module OFF: Normal power is turned on. S
SM61 M9002
Verification error ON: Error Remains ON even after return to normal. (Error)
I/O module verification is also conducted for remote I/O Q CPU
station modules. LCPU
S
Annunciator OFF: Not detected
SM62 Goes ON if at least one annunciator F goes ON. (Instruction M9009
detection ON: Detected
execution)

Goes ON if error is detected by CHK instruction. S Qn(H)


OFF: Not detected
SM80 CHK detection Stays ON subsequently even after normal operation is (Instruction QnPH
ON: Detected New
restored. execution) QnPRH
SM84 Error clear OFF → ON: Error clear Turns on to clear an error set to SD84 and SD85. LCPU
SM90 Corresponds to SD90 M9108
SM91 Corresponds to SD91 M9109
SM92 Corresponds to SD92 M9110
Startup of OFF: Not startet
SM93 Corresponds to SD93 Goes ON when meas- M9111
watchdog timer (watchdog timer
urement of step transi- Qn(H)
SM94 for step transi- reset) Corresponds to SD94 U M9112
tion watchdog timer is
tion QnPH
SM95 Corresponds to SD95 commenced. M9113
(Enabled only ON: Started QnPRH
Resets watchdog timer
SM96 when SFC pro- (watchdog timer Corresponds to SD96 M9114
when it goes OFF.
gram exists) started)
SM97 Corresponds to SD97
SM98 Corresponds to SD98 New
SM99 Corresponds to SD99
OFF: Serial
communication is Q00/Q01
Serial communi- Indicates whether the serial communication function in
not in use S Q00UJ/
SM100 cation function the serial communication setting parameter is selected New
ON: Serial (power on or reset) Q00U/Q01U
in use or not.
communication is Q02U 2)
used

OFF: Protocol for Q00/Q01


Indicates whether the device that is communicating via
programming Q00UJ/
Communication the RS232 interface is using the protocol for progam- S
devices Q00U/Q01U
SM101 protocol status ming devices or the MC protocol. (RS232 New
ON: MC protocol Q02U 2)
flag communication)
Communication with
Always off (communication with a programming tool) LCPU
programming tool
Turns ON when an abnormal protocol was used to make
OFF: No error communication in the serial communication function. S
SM110 Protocol error
ON: Error Remains ON if the protocol is restored to normal there- (Error)
after.
Turns ON when the mode used to make communication
was different from the setting in the serial communica-
Communication OFF: No error S
SM111 tion function.
status ON: Error (Error)
Remains ON if the mode is restored to normal thereaf-
ter. Q00/Q01
Q00UJ/
ON: Clear When turned ON, the special relays SM110 and SM111 New
Clear error infor- Q00U/Q01U
SM112 special relays and are reset and the contents of the diagnostic special reg- U
mation
registers isters SD110 and SD111 is cleared. Q02U 2)

OFF: No error Turns ON when an overrun error (to much data) occured S
SM113 Overrun error
ON: Error during the serial communication. (Error)
OFF: No error Turns ON when a parity error occured during the serial S
SM114 Parity error
ON: Error communication. (Error)
OFF: No error Turns ON when a framing error occured during the S
SM115 Framing error
ON: Error serial communication. (Error)

Tab. A-42: Special relays (1): Diagnostic information

Programming MELSEC System Q and L series A – 115


Table of special relays Appendix A

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
 Turns on when data are written to the program
Program mem- cache memory.
ory batch trans-
OFF: Completed  Turns off when program memory batch transfer is S QnU 1)
SM165 ON: Not being executed completed. New
fer execution (Status change) LCPU
or Not completed  Remains on when data written to the program cache
status memory are not batchtransferred to the program
memory.

Tab. A-42: Special relays (1): Diagnostic information


1 The relevant modules are as follows:
• The Universal model QCPU whose serial number (first five digits) is "10012" or higher.
• Q13UDHCPU, Q26UDHCPU
2 The module whose first 5 digits of serial No. is "10102" or higher.

A – 116
Appendix A Table of special relays

A.6.2 System information

ACPU
Number Name Meaning Description Set by (if set) Valid for:
M9
Qn(H)
QnPH
At change from OFF to ON, the LEDs corresponding to
SM202 LED off command OFF → ON: LED off U New QnPRH
the individual bits at SD202 go off.
QnU
LCPU
S
SM203 STOP contact STOP state Goes ON at STOP state. M9042
(Status change) Q CPU
S LCPU
SM204 PAUSE contact PAUSE state Goes ON at PAUSE state. M9041
(Status change)
OFF: PAUSE disabled PAUSE state is entered if this relay is ON when the Q CPU
SM206 PAUSE enable coil U M9040
ON: PAUSE enabled remote PAUSE contact goes ON. LCPU
When this relay goes from OFF to ON, clock data being
Clock data set OFF: Ignored stored from SD210 through SD213 after execution of
SM210 U M9025
request ON: Set request END instruction for changed scan is written to the clock Q CPU
device.
LCPU
OFF: No error ON when error is generated in clock data (SD210 S
SM211 Clock data error M9026
ON: Error through SD213) value and OFF if no error is detected. (Request)
Clock data read OFF: Ignored When this relay is ON, clock data is read to SD210 Q CPU
SM213 U M9028
request ON: Read request through SD213 as BCD values. LCPU
OFF: CPU No.1
Turns on when an access to CPU No.1 from another
preparation
CPU becomes possible after power-on or reset opera-
CPU No.1 prepara- uncompleted
SM220 tion. This relay is used as an interlock for accessing QCPU
tion completed ON: CPU No.1
CPU No.1 when the multiple CPU synchronous setting
preparation
is set to asynchronous.
completed
OFF: CPU No.2
Turns on when an access to CPU No.2 from another
preparation
CPU becomes possible after power-on or reset opera-
CPU No.2 prepara- uncompleted
SM221 tion. This relay is used as an interlock for accessing
tion completed ON: CPU No.2
CPU No.2 when the multiple CPU synchronous setting
preparation
is set to asynchronous. S
completed
(When status QnU 7)
OFF: CPU No.3 changed)
Turns on when an access to CPU No.3 from another
preparation
CPU becomes possible after power-on or reset opera-
CPU No.3 prepara- uncompleted
SM222 tion. This relay is used as an interlock for accessing
tion completed ON: CPU No.3
CPU No.3 when the multiple CPU synchronous setting
preparation
is set to asynchronous.
completed
New
OFF: CPU No.4
Turns on when an access to CPU No.4 from another
preparation
CPU becomes possible after power-on or reset opera-
CPU No.4 prepara- uncompleted
SM223 tion. This relay is used as an interlock for accessing QnU 5)
tion completed ON: CPU No.4
CPU No.4 when the multiple CPU synchronous setting
preparation
is set to asynchronous.
completed
OFF: Online module
change is not in
S
Online module progress This relay is on during online module change. (for host
SM235 (During online
change flag ON: Online module CPU)
module change)
change in
progress
QnPH
OFF: Online module
change  This relay is on only for one scan after completion
Online module S (When online
incomplete of online module change.
SM236 change complete  This relay can be used only in the scan execution module change is
ON: Online module
flag type program. (for host CPU) complete)
change
complete
OFF: Device range Selects whether to check a device range during execu-
Device range check checked tion of the BMOV, FMOV or DFMOV instruction (only QnU 6)
SM237 U New
inhibit flag ON: Device range when the conditions for subset processing are estab- LCPU
not checked lished).

Tab. A-43: Special relays (2): System information

Programming MELSEC System Q and L series A – 117


Table of special relays Appendix A

ACPU
Number Name Meaning Description Set by (if set) Valid for:
M9
Q00/Q01 1)
OFF: No reset This flag comes ON when the CPU no. 1 has been reset Qn(H) 1)
ON: CPU 1 has been or has been removed from the base. The other CPUs of S
SM240 CPU No. 1 reset flag reset the multi-CPU system are also put in reset status. New QnPH
(Status change)
QnU 7)
Reset status Aways off (reset status) LCPU
This flag comes ON when the CPU no. 2 has been reset
OFF: No reset
or has been removed from the base. In the other CPUs S
SM241 CPU No. 2 reset flag ON: CPU 2 has been New Q00/Q01 1)
of the multi-CPU system the error code 7000 ("MULTI (Status change)
reset
CPU DOWN") will occur. Qn(H) 1)
This flag comes ON when the CPU no. 3 has been reset QnPH
OFF: No reset S
SM242 CPU No. 3 reset flag ON: CPU 3 has been
or has been removed from the base. In the other CPUs
New QnU 7)
of the multi-CPU system the error code 7000 ("MULTI (Status change)
reset
CPU DOWN") will occur.

OFF: No reset
This flag comes ON when the CPU no. 4 has been reset Qn(H) 1)
or has been removed from the base. In the other CPUs S
SM243 CPU No. 4 reset flag ON: CPU 4 has been New QnPH
of the multi-CPU system the error code 7000 ("MULTI (Status change)
reset QnU 5)
CPU DOWN") will occur.
Q00/Q01 1)
OFF: No error Qn(H) 1)
ON: CPU no. 1 is S
SM244 CPU No. 1 error flag New QnPH
stopped due to (Status change)
an error QnU 7)
LCPU
OFF: No error
ON: CPU no. 2 is The set flag indicates that an error has occured which S
SM245 CPU No. 2 error flag New Q00/Q01 1)
stopped due to has stopped the CPU. (Status change)
an error The flag goes OFF when the CPU is normal or when an Qn(H) 1)
OFF: No error error occurs which will not stop the CPU. QnPH
ON: CPU no. 3 is S QnU 7)
SM246 CPU No. 3 error flag New
stopped due to (Status change)
an error
OFF: No error Qn(H) 1)
ON: CPU no. 4 is S
SM247 CPU No. 4 error flag New QnPH
stopped due to (Status change)
an error QnU 5)
Qn(H)
Max. loaded I/O OFF: Ignored When this relay goes from OFF to ON, maximum loaded
SM250 U New QnPH
read ON: Read I/O number is read to SD250.
QnPRH
 Effective for the batch refresh and the low-speed
cycle.
 Designate whether to receive arrival stations only
or to receive all slave stations in the Qn(H)
MELSECNET/H.
QnPH
OFF: Refresh the  Effective for the batch refresh and the low-speed
head station cycle. QnPRH
All stations refresh
SM254 only  Designate whether to receive arrival stations only U New
command or to receive all slave stations in the CC-Link IE
ON: Refresh all
stations controller network.
 Effective for the batch refresh and the low-speed
cycle.
 Specify whether to receive only arrival station or all QnU
stations in the MELSECNET/H or CC-Link IE
controller network.
OFF: Operative
Goes ON for standby network.
network S
SM255 (If no designation has been made concerning active or New
ON: Standby (Initial)
MELSECNET/10, standby, active is assumed.) Qn(H)
network
MELSECNET/H
QnPH
module 1 informa- OFF: Reads For refresh from link to CPU (B, W, etc.) indicate
SM256 U New QnPRH
tion ON: Does not read whether to read from the link module.
OFF: Writes For refresh from CPU to link (B, W etc.) designate
SM257 U New
ON: Does not write whether to write to the link module.

Tab. A-43: Special relays (2): System information

A – 118
Appendix A Table of special relays

ACPU
Number Name Meaning Description Set by (if set) Valid for:
M9
OFF: Operative
Goes ON for standby network.
network S
SM260 (If no designation has been made concerning active or New
ON: Standby (Initial)
MELSECNET/10, standby, active is assumed.) Qn(H)
network
MELSECNET/H
QnPH
module 2 informa- OFF: Reads For refresh from link to CPU (B, W, etc.) indicate
SM261 U New QnPRH
tion ON: Does not read whether to read from the link module.
OFF: Writes For refresh from CPU to link (B, W etc.) designate
SM262 U New
ON: Does not write whether to write to the link module.
OFF: Operative
Goes ON for standby network.
network S
SM265 (If no designation has been made concerning active or New
ON: Standby (Initial)
MELSECNET/10, standby, active is assumed.) Qn(H)
network
MELSECNET/H
QnPH
module 3 informa- OFF: Reads For refresh from link to CPU (B, W, etc.) indicate
SM266 U New QnPRH
tion ON: Does not read whether to read from the link module.
OFF: Writes For refresh from CPU to link (B, W etc.) designate
SM267 U New
ON: Does not write whether to write to the link module.
OFF: Operative
Goes ON for standby network.
network S
SM270 (If no designation has been made concerning active or New
ON: Standby (Initial)
standby, active is assumed.) Qn(H)
MELSECNET/10 network
module 4 informa- QnPH
OFF: Reads For refresh from link to CPU (B, W, etc.) indicate
SM271 tion U New QnPRH
ON: Does not read whether to read from the link module.
OFF: Writes For refresh from CPU to link (B, W etc.) designate
SM272 U New
ON: Does not write whether to write to the link module.

Goes ON when a CC-Link error is detected in any of the Qn(H)


OFF: Normal S
SM280 CC-Link error CC-Link modules installed. New QnPH
ON: Error (Status change)
Goes OFF when normal operation is restored. QnPRH
This relay stores information on whether an RS-232
adapter is connected or not. Connection of an RS-232
OFF: Not connected adapter is checked at the time of initialization, and if it is S
SM310 RS-232 adapter New LCPU
ON: Connected connected, this relay turns on. The on/off status set (Initial)
during initialization is held until the power is turned off
and on again or the system is reset.
 The usage of this flag is enabled when the time
reserved for communication has been set in
SD315.
Communication  When this flag is turned ON, the END processing is
OFF: Witout delay delayed by the time set in SD315 if no Q00J/Q00/
SM315 reserved time delay U New
ON: With delay communication is performed. The scan time Q01
enable flag increases by the time set in SD315.
 When this flag is turned OFF, the END processing is
performed without delay if there is no
communication processing.
 This relay indicates whether the CC-Link module is
started and all the data are refreshed by the
automatic CC-Link start function.
 This relay is on when all the data are refreshed by
the automatic CC-Link start function. S (Initial
Automatic CC- OFF: Not activated
SM319  Then the automatic CC-Link start function is not processing and New LCPU
Link start ON: Activated activated, or when the refresh device range is status change)
insufficient, this relay is turned off. (If the refresh
device range set for the automatic CC-Link start
function is insufficient, all of the refresh is
stopped.)

Tab. A-43: Special relays (2): System information

Programming MELSEC System Q and L series A – 119


Table of special relays Appendix A

ACPU
Number Name Meaning Description Set by (if set) Valid for:
M9
OFF: SFC program
ON if SFC program is correctly registered, and OFF if
Presence/absence absent S
SM320 not registered. M9100
of SFC program ON: SFC program (Initial)
Goes OFF if SFC dedicated instruction is not correct.
present
Initial value is set at the same value as SM900.
(Goes ON automatically if SFC program is present.)
OFF: SFC program SFC program will not execute if this goes OFF prior to
Start/stop SFC pro- stop SFC program processing. S M9101 Q00J/Q00/
SM321 Q01 1)
gram ON: SFC program Subsequently, starts SFC program when this goes from (Initial)/U format change
start OFF to ON. Qn(H)
Subsequently, stops SFC program when this goes from QnPH
ON to OFF.
QnPRH
Initial value is set at ON or OFF depending on parame- QnU
ters.
When OFF, all execution states are cleared from time LCPU
SFC program was stopped; starts from the initial step
SFC program start OFF: Initial start of block where the start request was made. S/U M9102
SM322
state ON: Restart When ON, starts from execution block and execution (Initial) format change
step active at time SFC program was stopped.
(ON is enabled only when resumptive start has been
designated at parameters.)
SM902 is not automatically designated for latch.
When OFF, transition occurs at one scan/one step, for
OFF: Continuous
all blocks. Q00J/Q00/
Presence/absence transition not
When ON, transition occurs continuously for all blocks Q01 1)
of continuous tran- effective
SM323 in one scan. U M9103 Qn(H)
sition for entire ON: Continuous
block In designation of individual blocks, priority is given to
transition QnPH
the continuous transition bit of the block.
effective QnPRH
(Designation is checked when block starts.)
S QnU
(Instruction M9104 LCPU
execution)
When continuous transition is effective, goes ON when
OFF: When transition Q00J/Q00/
continuous transition is not being executed; goes OFF
SM324
Continuous transi- is executed
when continuous transition is being executed. Q01 1)
tion prevention flag ON: When no Qn(H)
Normally ON when continuous transition is not effec- S
transition New
tive. (Status change) QnPH
QnPRH
QnU
When block stops, selects active step operation output. Q00J/Q00/
Output mode at OFF: OFF S
SM325 All coil outputs go OFF when OFF. M9196 Q01 1)
block stop ON: Preserves (Status change)
Coil outputs are preserved when ON. Qn(H)
QnPH
OFF: Clear device Selects the device status when the stopped CPU is run QnPRH
SFC device clear
SM326 ON: Preserves after the sequence profram or SFC program has been U New
mode QnU
device modified when the SFC program exists.
LCPU
Qn(H)
S QnPH
OFF: Hold step output
turned OFF If this relay is off, the coil output turns off when the (Initial) New QnPRH
Output during end U
SM327 (cleared) step held after transition (SC, SE, or ST) reaches the QnU
step execution
ON: Hold step end step. LCPU
output held
Q00J/Q00/
New
Q01 1)
Select whether clear processing will be performed or
not if active steps other than the ones being held exist
OFF: Clear processing in the block when the end step is reached. Q00J/Q00/
Clear processing is performed.  When this relay turns OFF, all active steps are forcibly U Q01 1)
SM328 mode when end ON: Clear terminated to terminate the block. New
processing is  When this relay is ON, the execution of the block is
QnU
step is reached
continued as-is. LCPU
not performed.  If active steps other than the ones being held do not
exist when the end step is reached, the steps being
held are terminated to terminate the block.

Tab. A-43: Special relays (2): System information

A – 120
Appendix A Table of special relays

ACPU
Number Name Meaning Description Set by (if set) Valid for:
M9
Online change (inac-
OFF: Not executed This relay is on while online change (inactive block) is S
SM329 tive block) status New QnU 8)
ON: Being executed executed. (Status change)
flag
 Asynchronous mode: Mode where the operations
OFF: Asynchronous for the low-speed execution type program are
Operation mode for continued during excess time. Qn(H)
mode
SM330 low-speed execution  Synchronous mode: Mode where the operations U New
ON: Synchronous for the low-speed execution type program are QnPH
type programs
mode started from the next scan even when there is
excess time.

Normal SFC pro-  This relay stores the information on whether the
OFF: Not executed normal SFC program is in execution or not.
SM331 gram execution sta-
ON: Being executed  Used as an interlock for execution of the SFC
tus control instruction. Qn(H) 3)
S
 This relay stores the information on whether the New QnPH 4)
Program execution (Status change)
management SFC OFF: Not executed SFC program for program execution management QnPRH
SM332 is in execution or not.
program execution ON: Being executed  Used as an interlock for execution of the SFC
status control instruction.
 This relay stores the status information on the
ON indicates intelligent function module access instruction that Qn(H)
Access execution completion of was just executed. (This data is overwritten if the S
SM390 New QnPH
flag intelligent function intelligent function module access instruction is (Status change)
module access executed again.) QnPRH
 Used by the user in a program as a completion bit.
Stores the execution status of the S(P).GINT instruc-
GINT instruction OFF: Not executed S
tion.
SM391 execution comple- ON: Execution (Instruction New QnU
tion flag  Turns off before execution of the instruction. execution)
completed
 Turns on after completion of the instruction.

Tab. A-43: Special relays (2): System information


1
This applies to the CPU of function version B or later.
2
The module whose first 5 digits of serial No. is "09012" or higher.
3
The module whose first 5 digits of serial No. is "04122" or higher.
4
The module whose first 5 digits of serial No. is "07032" or higher.
5
The Universal model QCPU except the Q00UJCPU, Q00UCPU, Q01UCPU, and Q02UCPU.
6
The relevant modules are as follows:
• The Universal model QCPU whose serial number (first five digits) is "10012" or higher.
• Q13UDHCPU, Q26UDHCPU
7
The Universal model QCPU except the Q00UJCPU.
8
This applies when the first five digits of the serial number is "12052" or higher.

Programming MELSEC System Q and L series A – 121


Table of special relays Appendix A

A.6.3 System clocks

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
ON S
SM400 Always ON This flag is normally ON (Every END M9036
OFF processing) QCPU
ON S LCPU
SM401 Always OFF This flag is normally OFF (Every END M9037
OFF processing)
 After RUN, ON for 1 scan only.
 This connection can be used for scan
execution type programs only.
 When an initial execution type program is Qn(H)
used, this relay turns off at the END QnPH
processing of the scan execution type
ON program in the first scan after the CPU S M9038 QnPRH
ON for 1 scan module enters the RUN status.
SM402 1 scan (Every END QnU
only after RUN
OFF ON processing) LCPU
OFF Initial 1 scan of scan
execution type execution type
program program

Q00J/Q00
After RUN, ON for 1 scan only. New
/Q01
 After RUN, OFF for 1 scan only.
 This connection can be used for scan
execution type programs only.
 When an initial execution type program is Qn(H)
used, this relay turns on at the END QnPH
processing of the scan execution type
ON program in the first scan after the CPU S M9039 QnPRH
After RUN, 1 scan module enters the RUN status.
SM403 (Every END QnU
OFF for 1 scan only OFF ON processing) LCPU
OFF
Initial 1 scan of scan
execution type execution type
program program

Q00J/Q00
After RUN, OFF for 1 scan only. New
/Q01
ON After RUN, ON for 1 scan only. S
ON for 1 scan
SM404 This connection can be used for scan execution (Every END New
only after RUN OFF
1 scan
type programs only. processing)
Qn(H)
ON After RUN, OFF for 1 scan only. QnPH
S
After RUN, 1 scan
SM405 This connection can be used for scan execution (Every END New
OFF for 1 scan only OFF
type programs only. processing)

Qn(H)
Repeatedly changes between ON and OFF at 5-ms QnPH
0.005 s 0.005 s interval. S
SM409 0.01 second clock New QnPRH
When power supply is turned ON, or reset is per- (Status change)
formed, starts with OFF. QnU
LCPU

0.05 s 0.05 s
SM410 0.1 second clock M9030

0.1 s 0.1 s
SM411 0.2 second clock Repeatedly changes between ON and OFF at each M9031
designated time interval.
When power supply is turned ON, or reset is per-
0.5 s 0.5 s
formed, starts with OFF. S QCPU
SM412 1 second clock M9032
(Status change) LCPU

1s 1s
SM413 2 second clock M9033

n (s) n (s) Goes between ON and OFF in accordance with the M9034
SM414 2x n second clock
number of seconds designated by SD414. format change

Tab. A-44: Special relays (3): System clocks

A – 122
Appendix A Table of special relays

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
Qn(H)
QnPH
n (ms) n (ms) Goes between ON and OFF in accordance with the S
SM415 2 x n ms clock New QnPRH
number of milliseconds designated by SD415. (Status change)
QnU
LCPU
User timing clock
SM420 M9020
No. 0
Relay repeats ON/OFF switching at fixed scan
User timing clock
SM421 intervals. M9021
No.1
When power supply is turned ON, or reset is per-
User timing clock formed, goes from OFF to start.
SM422 M9022
No. 2 The ON/OFF intervals are set with the DUTY
instruction. S QCPU
User timing clock
SM423 (Every END
No. 3 LCPU
processing) M9023
User timing clock
SM424
No. 4 n2 n1 n2
scan scan scan
User timing clock
SM430
No. 5
M9024
User timing clock
SM431
No. 6
User timing clock
SM432
No. 7
S Qn(H)
User timing clock For use with SM420 through SM424 low speed
SM433 (Every END New
No. 8 programs. QnPH
processing)
User timing clock
SM434
No. 9

Tab. A-44: Special relays (3): System clocks

Programming MELSEC System Q and L series A – 123


Table of special relays Appendix A

A.6.4 Scan information

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
OFF: Completed or
S Qn(H)
Low speed program not executed Goes ON when low-speed execution type program
SM510 (Every END New
execution flag ON: Execution under is executed. QnPH
processing)
way

When this goes from OFF to ON, the module serv- Qn(H)
Reads module service OFF: Ignored
SM551 ice interval designated by SD550 is read to SD551 U New QnPH
interval ON: Read
through SD552. QnPRH

Tab. A-45: Special relays (4): Scan information

A.6.5 I/O refresh

ACPU Valid
Number Name Meaning Description Set by (if set) M9 for:
When this relay is turned on, I/O refresh is per-
formed after execution of the first program, and
then the next program is executed. When a
Program to program I/O OFF: Not refreshed Q00J/Q00
SM580 sequence program and a SFC program are to be U New
refresh ON: Refreshed /Q01 1)
executed, the sequence program is executed, I/O
refresh is performed, and then the SFC program is
executed.

Tab. A-46: Special relays (5): I/O refresh


1
This applies to the CPU of function version B or later.

A – 124
Appendix A Table of special relays

A.6.6 Drive information

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
Qn(H)
QnPH
ON when memory card is ready for use by user.
QnPRH
Memory card usable OFF: Unusable S QnU 1)
SM600 New
flags ON: Use enabled (Status change)
Turns ON when the SD memory card becomes
ready for use. (This relay turns on when a com-
LCPU
patible SD memory card is inserted and set to be
enabled with the SD memory card lock switch.)
Qn(H)
QnPH
Memory card protect OFF: No protect Goes ON when memory card protect switch is S
SM601 New QnPRH
flag ON: Protect ON. (Status change)
QnU 1)
LCPU
Qn(H)
OFF: No drive 1 Goes ON when drive 1 (card 1 RAM area) is S QnPH
SM602 Drive 1 flag New
ON: Drive 1 present present. (Status change) QnPRH
QnU 1)
Qn(H)
Goes ON when drive 2 (card 1 ROM area) is S QnPH
present. (Status change) QnPRH
OFF: No drive 2 QnU 1)
SM603 Drive 2 flag New
ON: Drive 2 present
Is ON while a SD memory card is being inserted.
(This relay is ON while a SD memory card is S
LCPU
being inserted, regardless of the availability and (Status change)
the type of the card.)
Qn(H)
QnPH
Memory card in-use OFF: Not in use S
SM604 Goes ON when memory card is in use. New QnPRH
flag ON: In use (Status change)
QnU 1)
LCPU
Qn(H)
Goes ON when memory card cannot be inserted QnPH
U New
or removed. QnPRH
OFF: Remove/insert QnU 1)
Memory card
enabled
SM605 remove/insert pro- Turns ON to disable the insertion and removal of
ON: Remove/insert
hibit flag a memory card. (Turns ON when a compatible
prohibited
SD memory card is inserted and set to be ena- S
New LCPU
bled with the SD memory card lock switch. This (Status change)
relay does not turn ON while "ICM.OPE.ERROR"
occurs.)
OFF: SD memory card  This relay is turned on to execute the SD
forced disable cancel memory card forced disable instruction.
SD memory card
instruction  When there are any functions accessing to
SM606 forced disable instruc- an SD memory card, the process of U New LCPU
ON: SD memory card disablement is held until it is completed.
tion
forced disable  This relay is turned off to cancel the SD
instruction memory card forced disable instruction.
OFF: Not being disabled by  This relay turns on when an SD memory
SD memory card card is disabled by turning on SM606 (SD
SD memory card forced disable memory card forced disable instruction). S
SM607 forced disable status instruction  This relay turns off when the forced disable New LCPU
status of SD memory card is canceled by (Status change)
flag ON: Being disabled by SD
memory card forced turning off SM606 (SD memory card forced
disable instruction disable instruction).

Tab. A-47: Special relays (6): Drive information

Programming MELSEC System Q and L series A – 125


Table of special relays Appendix A

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
 This relay is turned ON to enable the Qn(H)
OFF: Remove/insert insertion and removal of a memory card.
Memory card QnPH
SM609 remove/insert enable
prohibited  Turned OFF by the system after the memory S/U New
ON: Remove/insert card is removed. QnPRH
flag  This relay can be used while both SM604
enabled
and SM605 are off. QnU 1)

OFF: Unusable S QCPU


SM620 Drive 3/4 usable flags Always ON New
ON: Use enabled (Initial) LCPU
OFF: No protect S QCPU
SM621 Drive 3/4 protect flag Always OFF New
ON: Protect (Initial) LCPU
Q00J/Q00
/Q01
Qn(H)
OFF: No drive 3 S QnPH
SM622 Drive 3 flag Always ON New
ON: Drive 3 present (Initial)
QnPRH
QnU 2)
LCPU
OFF: No drive 4 S QCPU
SM623 Drive 4 flag Always ON New
ON: Drive 4 present (Initial) LCPU
Qn(H)
This relay is ON while a file stored in the drive 3 QnPH
OFF: Not in use S
SM624 Drive 3/4 in-use flag (standard RAM) or the drive 4 (standard New QnPRH
ON: In Use (Status change)
ROM) is being used. QnU
LCPU
Q00J/Q00
/Q01
Qn(H)
OFF: File register not in
S QnPH
SM640 File register use use Goes ON when file register is in use. New
(Status change)
ON: File register in use QnPRH
QnU 2)
LCPU
Qn(H)
QnPH
OFF: Comment not used S
SM650 Comment use Goes ON when comment ile is in use. New QnPRH
ON: Comment in use (Status change)
QnU
LCPU
OFF: Internal memory Qn(H)
execution Goes ON while boot operation is in process
QnPH
ON: Boot operation in Goes OFF if boot designation switch is OFF.
progress QnPRH
S
SM660 Boot operation New
OFF: Program memory (Status change) Q00J/Q00
execution /Q01
Goes ON while boot operation is in process
ON: Boot operation in QnU 3)
progress LCPU

Latch data backup to  This relay turns on when latch data backup
OFF: Not completed to the standard ROM is completed. S QnU
SM671 standard ROM com- New
ON: Completed  Time when the backup is completed is (Status change) LCPU
pletion flag stored in SD672 or later.
Goes ON when access is made to area outside Qn(H)
Memory card A file
OFF: Within access range the range of file register R of memory card A
SM672 register access range S/U New QnPH
ON: Outside access range (set within END processing).
flag QnPRH
Reset at user program.

Error completion of  This relay turns on if latch data backup to


OFF: No Error the standard ROM is not completed. QnU
SM675 latch data backup to S New
ON: Error  This relay turns off when the backup is LCPU
standard ROM completed.

Tab. A-47: Special relays (6): Drive information

A – 126
Appendix A Table of special relays

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
 When latch data are backed up while this
Specification of relay is on, the backup data will be restored
OFF: Not specified at every power-on of the CPU module. QnU
SM676 restration repeated U New
ON: Specified  The backup data will be restored at every LCPU
execution power-on until the latch data are deleted or
the latch data are backed up again.
This relay turns on if a write error is detected
OFF: Write not
Program memory during writing to the program memory (flash QnU
SM680 executed/normal S (At write) New
write error ROM). This relay turns off when a write LCPU
ON: Write error
command is given.
This relay is on during writing to the program
Program memory OFF: Write not executed QnU
SM681 memory (flash ROM) and turns off when the S (At write) New
writing flag ON: During writing LCPU
writing is completed.
OFF: Overwrite count is This relay turns on when overwrite count of the
Program memory
less than 100,000 program memory (flash ROM) reaches to QnU
SM682 overwrite count error S (At write) New
ON: Overwrite count is 100,000. (It is necessary to change CPU LCPU
flag
100,000 or more module.)
This relay turns on if a write error is detected
OFF: Write not
Standard ROM write during writing to the standard ROM (flash QnU
SM685 executed/normal S (At write) New
error ROM). This relay turns off when a write LCPU
ON: Write error
command is given.
OFF: Overwrite not This relay is on during writing to the standard
Standard ROM writing QnU
SM686 executed ROM (flash ROM) and turns off when the writing S (At write) New
flag LCPU
ON: During overwriting is completed.
OFF: Overwrite count is
Standard ROM This relay turns on when overwrite count of the
less than 100,000 QnU
SM687 overwrite count error standard ROM (flash ROM) reaches to 100,000. S (At write) New
ON: Overwrite count is LCPU
flag (It is necessary to change CPU module.)
100,000 or more
OFF: Backup start
preparation not
Backup start completed Turns on when the backup preparation is
SM691
preparation status flag ON: Backup start completed.
preparation S QnU 1)
completed New
(Status change) LCPU
OFF: Restoration not
Restoration complete completed This relay turns on when backup data in a
SM692
flag ON: Restoration memory card has been restored.
completed

Tab. A-47: Special relays (6): Drive information


1
The modules whose serial number (first five digits) is "10102" or higher are the relevant models. (Except the Q00UJCPU, Q00UCPU, and Q01UCPU)
2 The Universal model QCPU except the Q00UJCPU.
3
The Universal model QCPU except the Q00UJCPU, Q00UCPU, and Q01UCPU.

Programming MELSEC System Q and L series A – 127


Table of special relays Appendix A

A.6.7 Instruction related special relays

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
S
OFF: Carry OFF QCPU
SM700 Carry flag Carry flag used in application instruction. (Instruction M9012
ON: Carry ON LCPU
execution)
Qn(H)
OFF: Outputs until NUL QnPH
Number of output Used for the PR, PRC, BINDA, DBINDA, BINHA,
SM701 ON: 16 characters U M9049 QnPRH
characters selection DBINHA, BCDDA, DBCDDA, or COMRD instruction
output QnU
LCPU
Designates method to be used by search instruc-
OFF: Search next
SM702 Search method tion. U New
ON: 2-part search
Data must be arranged for 2-part search.
The sort instruction is used to designate whether QCPU
OFF: Ascending order
SM703 Sort order data should be sorted in ascending order or in U New LCPU
ON: Descending order
descending order.
Goes ON when all data conditions have been met
for the BKCMP instruction. S
OFF: Non-match found
SM704 Block comparison (Instruction New
ON: All match This relay turns on when all data conditions are QnU 2)
execution)
met for the DBKCMP instruction. LCPU
This relay turns on when the data to be compared
OFF: Improper data not
DT/TM instruction by the DT or TM instruction cannot S QnU 2)
detected
SM709 improper data detec- be recognized as date or time data, when the (Instruction New
ON: Improper data LCPU
tion flag device (three words) to be compared is execution)/U
detected
exceeding the specified device range.
S Qn(H)
CHK instruction prior- OFF: Conditions priority Remains as originally set when OFF.
SM710 (Instruction New QnPH
ity ranking flag ON: Pattern priority CHK priorities updated when ON.
execution) QnPRH
OFF: During DI QCPU
SM715 EI flag ON when EI instruction is being executed.
ON: During EI LCPU
This relay turns on when all data conditions are
met for the DBKCMP instruction. (Initial execution
Block comparison
OFF: Mismatch found type program and scan execution type program or
SM716 (Except an interrupt
ON: No mismatch standby type program executed from initial execu-
program)
tion type program or scan execution type pro-
gram)
S QnU 2)
This relay turns on when all data conditions are (Instruction New LCPU
met for the DBKCMP instruction. execution)
Block comparison OFF: Mismatch found (Interrupt program, fixed scan execution type pro-
SM717
(Interrupt program) ON: No mismatch gram, or standby type program executed from
interrupt program or fixed scan execution type
program)
This relay turns on when all data conditions are
Block comparison
OFF: Mismatch found met for the DBKCMP instruction.
SM718 (Interrupt program QnU 3)
ON: No mismatch (Interrupt program (I45) or standby type program
(I45))
that was executed from interrupt program (I45))
SM720 is set for one scan after the execution of Qn(H)
OFF: Comment read not the COMRD or PRC instruction QnPH
Comment read com- completed S
SM720 This relay turns on only during first scan after the New QnPRH
pletion flag ON: Comment read (Status change)
completed processing of the COMRD instruction is com- QnU
pleted. LCPU

Tab. A-48: Special relays (7): Instruction related special relays

A – 128
Appendix A Table of special relays

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
This flag is ON while a file is being accessed by the Qn(H)
SP.FWRITE, SP.FREAD, COMRD, PRC, or LEDC
instruction QnPH

This relay is on while a file is being accessed by Qn(H)


the SP. FWRITE, SP. FREAD, COMRD, or LEDC QnPH
instruction. QnPRH
This relay is on while a file is being accessed by
the SP. FWRITE, SP. FREAD, COMRD, or QnU
OFF: File is not accessed SP.DEVST instruction. S
SM721 File being accessed New
ON: File is accessed  This relay is on while a file is being accessed (Status change)
by the SP. FWRITE, SP. FREAD, COMRD, or
SP.DEVST instruction. LCPU
 This relay is on while a SD memory card or the
standard ROM is being accessed.
This relay is on while an ATA card or the standard
QnU 4)
ROM is being accessed.
This relay is on while the S(P).SFCSCOMR or the
S(P).SFCTCOMR instruction is QnU 11)
executed.
When this flag is set, an "OPERATION ERROR" is QCPU
BIN/DBIN instruction OFF: Error enabled
SM722 suppressed for both the BIN and the DBIN instruc- U New
error disabling flag ON: Error disabled LCPU
tion.
OFF: Not executed by
execution condition  During OFF, XCALL instructions will not be
XCALL instruction
risen executed even if execution condition is risen.
SM734 execution condition U New Qn(H) 4)
ON: Executed by  During ON, XCALL instructions will be
designation executed when execution condition is risen.
execution condition
risen
OFF: SFC comment
Qn(H) 5)
readout instruction This relay turns on while a SFC step comment rea-
SFC comment read- QnPH 6)
is inactivated. dout instruction (S(P).SFCSCOMR) or SFC trans- S
SM735 out instruction in exe- New
cution flag
ON: SFC comment mission condition comment readout instruction (Status change) QnPRH 6)
readout instruction (S(P). SFCTCOMR) is being executed.
QnU 11)
is activating.
OFF: Instruction not S
MSG instruction executed Qn(H)
SM738 Goes ON when MSG instruction is executed. (Instruction New
reception flag ON: Instruction QnPRH
execution execution)

Display unit availabil- OFF: Not usable S


SM740 This relay is on while the display unit can be used. New LCPU
ity flag ON: Usable (Initial/Status change)
Scaling instruction OFF: Search next Determines a search method when the scaling QnU 2)
SM750 U New
search method setting ON: 2-part search instruction is executed. LCPU
Q00J/Q00
/Q01 1)
OFF: Forces match Qn(H)
PID bumpless In manual mode, designates whether or not to
SM774 ON: Does not force U New
processing force the SV value to match the PV value. QnPRH
match
QnU
LCPU

OFF: Performs link Select whether or not to perform link refresh Q00J/Q00
refresh processing in cases where only general data /Q01
ON: No link refresh processing will be conducted during the execution Qn(H)
performed of the COM instruction. QnPH
Selection of link Q00J/Q00
refresh processing /Q01 1)
SM775 U New
during COM/CCOM OFF: Performs refresh
instruction execution Qn(H) 7)
processes other Select whether to perform refresh processes other
than an I/O refresh than an I/O refresh set by SD778 when QnPH 4)
ON: Performs refresh the COM or CCOM instruction is executed. QnPRH
set by SD778
QnU
LCPU

Tab. A-48: Special relays (7): Instruction related special relays

Programming MELSEC System Q and L series A – 129


Table of special relays Appendix A

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
OFF: Local device
This flag specifies whether to enable or disable the
Enable local device at disabled Qn(H)
SM776 local device in the program called at the CALL U New
CALL ON: Local device
instruction. QnPH
enabled
QnPRH
OFF: Local device
This flag specifies whether to enable or disable the QnU 10)
Enable local device in disabled
SM777 local device at the execution of an interrupt pro- U New LCPU
interrupt program ON: Local device
gram.
enabled
Q00J/Q00
S /Q01 1)
PID bumpless
OFF: Matched Specifies whether to match the set value (SV) with (When Qn(H) 8)
SM794 processing(for incom- New
ON: Not matched the process value (PV) or not in the manual mode. instruction/END QnPRH
plete derivative)
processing executed) QnU
LCPU
This relay turns on when the number of the
remaining blocks in the dedicated instruction
Block information
transmission area used for the multiple CPU high-
using multiple CPU S
OFF: Block is secured speed transmission dedicated instruction (target
high-speed transmis- (When
SM796 ON: Block set by SD796 CPU= CPU No.1) is less than the number of blocks New QnU 9)
sion dedicated instruction/END
cannot be secured specified in SD796. This relay is on when an
instruction (for CPU processing executed)
instruction is executed, and is off while an END
No.1)
processing is being executed or when free space
is available in the area.
This relay turns on when the number of the
remaining blocks in the dedicated instruction
Block information
transmission area used for the multiple CPU high-
using multiple CPU S
OFF: Block is secured speed transmission dedicated instruction (target
high-speed transmis- (When
SM797 ON: Block set by SD797 CPU= CPU No.2) is less than the number of blocks New QnU 9)
sion dedicated instruction/END
cannot be secured specified in SD797. This relay is on when an
instruction (for CPU processing executed)
instruction is executed, and is off while an END
No.2)
processing is being executed or when free space
is available in the area.
This relay turns on when the number of the
remaining blocks in the dedicated instruction
Block information
transmission area used for the multiple CPU high-
using multiple CPU S
OFF: Block is secured speed transmission dedicated instruction (target
high-speed transmis- (When
SM798 ON: Block set by SD798 CPU= CPU No.3) is less than the number of blocks New QnU 9)
sion dedicated instruction/END
cannot be secured specified in SD798. This relay is on when an
instruction (for CPU processing executed)
instruction is executed, and is off while an END
No.3)
processing is being executed or when free space
is available in the area.
This relay turns on when the number of the
remaining blocks in the dedicated instruction
Block information
transmission area used for the multiple CPU high-
using multiple CPU S
OFF: Block is secured speed transmission dedicated instruction (target
high-speed transmis- (When
SM799 ON: Block set by SD799 CPU= CPU No.) is less than the number of blocks New QnU 9)
sion dedicated instruction/END
cannot be secured specified in SD799. This relay is on when an
instruction (for CPU processing executed)
instruction is executed, and is off while an END
No.4)
processing is being executed or when free space
is available in the area.

Tab. A-48: Special relays (7): Instruction related special relays


1
This applies to the CPU module of function version B or later.
2 The relevant modules are as follows:
• The Universal model QCPU whose serial number (first five digits) is "10102" or higher.
• Q00UJCPU, Q00UCPU, Q01UCPU
3
The relevant modules are as follows:
• The Universal model QCPU whose serial number (first five digits) is "10102" or higher.
• Q00UCPU, Q01UCPU
4
The module whose first 5 digits of serial No. is "07032" or higher.
5
The module whose first 5 digits of serial No. is "06082" or higher.
6 The module whose first 5 digits of serial No. is "07012" or higher.
7
The module whose first 5 digits of serial No. is "04012" or higher.
8 The module whose first 5 digits of serial No. is "05032" or higher.
9 The Universal model QCPU except the Q00UJCPU, Q00UCPU, Q01UCPU, and Q02UCPU.
10
The Universal model QCPU except the Q00UJCPU.
11This applies when the first five digits of the serial number is "12052" or higher.

A – 130
Appendix A Table of special relays

A.6.8 Debugging

ACPU Valid
Number Name Meaning Description Set by (if set)
M9 for:
Qn(H)
QnPH
OFF: Not prepared Goes ON when the trace preparation is com- S
SM800 Trace preparation New QnPRH
ON: Ready pleted. (Status change)
QnU 1)
LCPU
Qn(H)
QnPH
OFF: Suspend Trace is started when this goes ON.
SM801 Trace start U M9047 QnPRH
ON: Start Suspended when OFF (Related special M all OFF).
QnU 1)
LCPU
Qn(H)
QnPH
Trace execution in OFF: Suspend S
SM802 Goes ON during execution of trace. M9046 QnPRH
progress ON: Start (Status change)
QnU 1)
LCPU
Qn(H)
 This relay turns on when the specified trigger QnPH
condition is met. S
SM803 Trace trigger OFF → ON: Start M9044 QnPRH
 This relay is turned on to meet the trigger (Status change)/U
condition. QnU 1)
LCPU
Qn(H)
QnPH
OFF: Not after trigger S
SM804 After Trace trigger Goes ON after trace trigger is triggered. New QnPRH
ON: After trigger (Status change)
QnU 1)
LCPU
Qn(H)
QnPH
OFF: Not completed S
SM805 Trace completed Goes ON at completion of trace. M9043 QnPRH
ON: End (Status change)
QnU 1)
LCPU
Qn(H)
QnPH
OFF: Normal Goes ON if error occurs during execution of S
SM826 Trace error New QnPRH
ON: Error trace/sampling trace. (Status change)
QnU 1)
LCPU
When this relay is turned on and a sampling trace
OFF: Forced registration
Forced registration setting is registered using a programming tool, QnU 1)
disabled
SM829 specification of trace the sampling trace setting can be registered with U
ON: Forced registration LCPU
setting the CPU module even when the trigger condition
enabled
has been met.
New
This relay is on while auto logging is being exe-
cuted. This relay turns off when auto logging is
OFF: No auto logging S
SM841 Auto logging completed and the SD memory card lock switch LCPU
ON: Auto logging (Status change)
is slid toward the module top to stop access to
the SD memory card.

Tab. A-49: Special relays (8): Debugging


1
The Universal model QCPU except the Q00UJCPU.

Programming MELSEC System Q and L series A – 131


Table of special relays Appendix A

A.6.9 Conversion from A series to System Q or L series

For a conversion from the MELSEC A series to the MELSEC System Q or L series the special
relays M9000 through M9255 (A series) correspond to the special relays SM1000 through
SM1255 for QCPU or LCPU after the A to Q/L conversion. (Note that the Basic model QCPU
and Redundant CPU do not support the A to Q/L conversion.)
These special relays are all set by the system and cannot be changed by a user-program.
Users intending to set or reset these relays should alter their programs so that only real QCPU
or LCPU special relays are applied. An exception are the special relays M9084 and M9200
through M9255. If a user can set or reset some of these special relays before conversion, the
user can also set and reset the corresponding relays among SM1084 and SM1200 through
SM1255 after the conversion.
Refer to the manuals of the CPUs and the networks MELSECNET and MELSECNET/B for
detailed information on the special relays of the A series.

NOTE To use the converted special relay in the High Performance model QCPU, Process CPU, Uni-
versal model QCPU, or LCPU, check "Use special relay/special register from SM/SD1000" un-
der "A-PLC Compatibility Setting".
Project window ⇒ [Parameter] ⇒ [PLC Parameter] ⇒ [PLC System]
Note that the processing time will increase when the converted special relay is used.
How to read the Special Relay for Modification column:
• If the special relay number for QCPU or LCPU is provided, correct the program using it.
• If no special relay is specified (–), the converted special relay can be used.
• If the special relay cannot be used in QCPU or LCPU, this is indicated as "No function for
QCPU/LCPU".

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
 Turns on if there is at least one output
OFF: Normal module whose fuse has blown. Qn(H)
M9000 SM1000 — Fuse blown  This relay remains on even after the QnPH
ON: Fuse blown module with condition returns to normal.
blown fuse present  Output modules on remote I/O stations QnU 1)
are also checked for blown fuse.
 This relay turns on if the status of the
I/O module differs from that registered
at power-on. Qn(H)
I/O module verification OFF: Normal  This relay remains on even after the QnPH
M9002 SM1002 — system returns to normal.
error ON: Error  I/O modules on remote I/O stations are QnU 1)
also checked. LCPU
 This relay is reset only when SD1116
to SD1123 are reset.

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

A – 132
Appendix A Table of special relays

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
 This relay turns on if a momentary
power failure within 20ms occurs Qn(H)
during use of an AC power supply
module. QnPH
 This relay is reset when the CPU QnU 1)
module is powered off and then on.
 This relay turns on if a momentary
power failure within 10ms occurs
OFF: AC DOWN not detected when using an AC power supply
M9005 SM1005 — AC DOWN detection module. LCPU
ON: AC DOWN detected
 This relay is reset when the CPU
module is powered off and then on.
 This relay turns on if a momentary Qn(H)
power failure within 10ms occurs
during use of a DC power supply QnPH
module. QnU 1)
 This relay is reset when the CPU
module is powered off and then on. LCPU

 This relay turns on when the battery


OFF: Normal voltage drops to or below the
M9006 SM1006 — Battery low specified.
ON: Battery low  It turns off when the battery voltage
returns to normal.
 This relay turns on when the battery
voltage drops to or below the Qn(H)
OFF: Normal
M9007 SM1007 — Battery low (latched) specified. QnPH
ON: Battery low  This relay remains on even after the
battery voltage returns to normal. QnU 1)
LCPU
OFF: No error This relay turns on if an error is detected
M9008 SM1008 SM1 Self-diagnostic error
ON: Error by selfdiagnostics.
 This relay turns on when the OUT F or
OFF: No F number detected SET F instruction is executed.
M9009 SM1009 SM62 Annunciator detection  It turns off when the SD1124 value is
ON: F number detected
cleared to zero.
 This relay turns on when an operation
error occurs during execution of an Qn(H)
OFF: No error
M9011 SM1011 SM56 Operation error flag application instruction. QnPH
ON: Error  This relay remains on even after the
system returns to normal. QnU 1)

OFF: Carry OFF Qn(H)


M9012 SM1012 SM700 Carry Flag Carry flag used in application instruction.
ON: Carry ON QnPH
When SM1016 turns on and remote RUN
mode is activated from a computer, all the Qn(H)
No function for OFF: Ignored
M9016 SM1016 Data memory clear flag data memory including the latch range
QCPU/LCPU ON: Output cleared QnPH
(except for the special relay and special
register) is cleared.
When SM1017 turns on and remote RUN
mode is activated from a computer, all the Qn(H)
No function for OFF: Ignored
M9017 SM1017 Data memory clear flag data memory that is not latched (except for
QCPU/LCPU ON: Output cleared QnPH
the special relay and special register) is
cleared.

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

Programming MELSEC System Q and L series A – 133


Table of special relays Appendix A

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
M9020 SM1020 — User timing clock No. 0  This relay repeatedly turns on and off
at the specified scan intervals.
M9021 SM1021 — User timing clock No. 1  When the CPU module is powered on
or reset, this relay is set to on from off
M9022 SM1022 — User timing clock No. 2
to start the clock. Set the intervals of
M9023 SM1023 — User timing clock No. 3 on/off by DUTY instruction.

DUTY n1 n2 SM1020
n1: ON scan interval
n2: OFF scan interval
n2 n2
scan scan
n1
When SM1020 to SM1024 are specified
scan for the DUTY instruction in programs, if
M9024 SM1024 — User timing clock No. 4 the CPU type is changed from the High
Performance model QCPU or Process Qn(H)
CPU to the Universal model QCPU or QnPH
LCPU, they are replaced with SM420 to QnU 1)
SM424. (For the Universal model QCPU
and LCPU, SM1020 to SM1024 cannot LCPU
be specified.)
Clock data stored in SD1025 to SD1028
OFF: Ignored are written to the CPU module after the
M9025 SM1025 — Clock data set request
ON: Set request present used END instruction execution in the scan
where SM1025 is turned on.
This relay turns on if an error occurs in the
OFF: No error
M9026 SM1026 — Clock data error clock data (SD1025 to SD1028), and is off
ON: Error
while there is no error.
This relay is turned on to read clock data
OFF: Ignored
M9028 SM1028 — Clock data read request and store them as BCD values into SD1025
ON: Read request
to SD1028.
 When this relay is turned on in the
program, all the data communication
requests accepted during one scan are
processed in the END processing of
OFF: Batch processing not that scan.
No function for Batch processing of data conducted  The batch processing of data Qn(H)
M9029 SM1029 communication requests can be turned
QCPU/LCPU communications request ON: Batch processing QnPH
conducted on or off during running.
 The default is OFF (processed one at a
time for each END processing in the
order in which data communication
requests are accepted).

M9030 SM1030 — 0.1 second clock 0.05 s 0.05 s

M9031 SM1031 — 0.2 second clock  0.1-, 0.2-, 1-, and 2-second clocks are
0.1 s 0.1 s generated. Qn(H)
 The relay turns on or off not for each
scan, but also during a scan if the time QnPH
has elapsed. QnU 1)
 When the CPU module is powered on
M9032 SM1032 — 1 second clock or reset, this relay is set to on from off LCPU
0.5 s 0.5 s to start the clock.

M9033 SM1033 — 2 second clock


1s 1s

 This relay repeatedly turns on and off


according to the number of seconds
specified in SD414. (Default: n = 30) Qn(H)
2n minute clock  The relay turns on or off not for each QnPH
M9034 SM1034 — scan, but also during a scan if the time
(1 minute clock) 2) ns ns has elapsed. QnU 1)
 When the CPU module is powered on LCPU
or reset, this relay is set to on from off
to start the clock.

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

A – 134
Appendix A Table of special relays

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
ON
M9036 SM1036 — Always ON
OFF  This relay is used for initialization or as
a dummy contact of application
ON instructions in the program.
M9037 SM1037 — Always OFF  SM1036 and SM1037 are turned on or Qn(H)
OFF off regardless of the key switch setting
on the front face of the CPU module. QnPH
ON The states of SM1038 and SM1039 QnU 1)
ON for 1 scan only after change depending on the key switch
M9038 SM1038 — LCPU
RUN 1 scan setting. When it is set to STOP, the
OFF relay is off.When it is set to other than
ON STOP, SM1038 is on for one scan only
RUN flag and SM1039 is off for one scan only.
M9039 SM1039 — (After RUN, OFF for 1 1 scan
scan only) OFF

OFF: PAUSE disabled Qn(H)


M9040 SM1040 SM206 PAUSE enable coil This relay is on when the CPU module is in
ON: PAUSE enabled QnPH
PAUSE status or when the PAUSE contact
OFF: PAUSE not in effect is on.
M9041 SM1041 SM204 PAUSE status contact
ON: PAUSE in effect
OFF: STOP not in effect This relay turns on when the RUN key Qn(H)
M9042 SM1042 SM203 STOP status contact
ON: STOP in effect switch or RUN/STOP switch is set to STOP. QnPH
This relay turns on after execution of the QnU 1)
OFF: Sampling trace in TRACE instruction and upon completion of LCPU
Sampling trace com-
M9043 SM1043 SM805 progress sampling trace performed the number of
pleted
ON: Sampling trace completed times preset by the parameter. Reset when
TRACER instruction is executed.
If SM1045 is turned on, the watchdog
timer is reset when the ZCOM instruction
No function for Watchdog timer (WDT) OFF: Does not reset WDT and batch processing of data Qn(H)
M9045 SM1045
QCPU/LCPU reset ON: Resets WDT communication requests are executed. QnPH
(Use this when scan time exceeds
200 ms.)
Qn(H)
OFF: Trace not in progress This relay is on during execution of QnPH
M9046 SM1046 SM802 Sampling trace
ON: Trace in progress sampling trace. QnU 1)
LCPU
OFF: Sampling Trace Sampling trace is not executed unless Qn(H)
Sampling trace prepara-
M9047 SM1047 SM801 suspended SM1047 is turned ON. Sampling trace is
tions QnPH
ON: Sampling Trace started cancelled when SM1047 turns off.
 When SM1049 is off, characters up to
Selection of number of OFF: Output until NUL NULL (00H) code are output. Qn(H)
M9049 SM1049 SM701
characters output ON: 16 characters output  When SM1049 is ON, ASCII codes of QnPH
16 characters are output.
 Switched ON to disable the CHG
No function for CHG instruction execu- OFF: Enabled instruction. Qn(H)
M9051 SM1051  Turn this on when requesting program
QCPU/LCPU tion disable ON: Disable transfer. It is automatically turned off QnPH
upon completion of the transfer.
When SM1052 is on, the SEG instruction is
No function for OFF: 7 segment display used as an I/O part refresh instruction. Qn(H)
M9052 SM1052 SEG instruction switch
QCPU/LCPU ON: I/O partial refresh When SM1052 is off, the SEG instruction is QnPH
used as a 7-SEG display instruction.

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

Programming MELSEC System Q and L series A – 135


Table of special relays Appendix A

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
M9056 SM1056 Main side P, I set request While a program is running, upon
completion of transfer of another program
OFF: Other than when P, I set
(for example, a subprogram when the main
being requested
M9057 SM1057 Sub side P, I set request program is running), a P and I set request
ON: P, I set being requested
is turned on. This relay automatically turns
off upon completion of P and I setting.
Main program P, I set Momentarily ON at P, I set
M9058 SM1058 This relay turns on for a moment upon
No function for completion completion Qn(H)
completion of P and I setting, and
QCPU/LCPU Sub program P, I set Momentarily ON at P, I set QnPH
M9059 SM1059 immediately turns off.
completion completion
Sub program 2 P, I set While a program is running, upon
M9060 SM1060
request completion of transfer of another program
OFF: Other than when P, I set
(for example, a subprogram when the main
being requested
Sub program 3 P, I set program is running), a P and I set request
M9061 SM1061 ON: P, I set being requested
request is turned on. This relay automatically turns
off upon completion of P and I setting.
When this is turned on, the search time in
No function for A8UPU/A8PUJ required OFF: Read time not shortened the A8UPU/A8PUJ can be shortened. (In Qn(H)
M9070 SM1070
QCPU/LCPU search time 3) ON: Read time shortened this case, the scan time is extended by QnPH
10%.)
This relay sets whether or not to check the
following errors at the time of the END
No function for OFF: Error check executed instruction processing (for setting of the
M9084 SM1084 Error check END instruction processing time).
QCPU/LCPU ON: No error check
 Check for fuse blown. Qn(H)
 Check of battery
 Collation check of I/O module QnPH
 Turns on when the detail factor of the
No function for OFF: No error operation error is stored into SD1091.
M9091 SM1091 Instruction error flag  Remains on even after the condition
QCPU/LCPU ON: Error
returns to normal.

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

A – 136
Appendix A Table of special relays

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
This relay is on when an SFC program has
Presence/absence of SFC OFF: SFC programs not used
M9100 SM1100 SM320 been registered, and is off when no
program ON: SFC programs used
program is registered.
 The same value as in SM1100 is set as
the initial value. (This relay turns on
OFF: SFC programs stop when an SFC program is registered.)
M9101 SM1101 SM321 Start/stop SFC program  This relay is turned off to stop SFC
ON: SFC programs start program execution.
 This relay is turned on to resume the
SFC program execution.
In the SFC setting of the PLC parameter
dialog box, Initial start is set for the SFC
OFF: Initial Start
M9102 SM1102 SM322 SFC program start state program start mode.
ON: Continue
• At initial start: OFF
• At continue start: ON
OFF: Continuous transition not Set whether to enable or disable
Presence/absence of con- effective continuous transition for the blocks where
M9103 SM1103 SM323
tinuous transition ON: Continuous transition "continuous transition bit" of the SFC
effective information device is not set.
 This relay is off during operation in the
continuous transition mode or during
OFF: When transition is continuous transition, and is on while
Continuous transition continuous transition is not
M9104 SM1104 SM324 completed
suspension flag performed.
ON: When no transition  This relay is always on while the CPU Qn(H)
module is operating not in the
continuous transition mode. QnPH

Step transition watchdog


M9108 SM1108 SM90 timer start (equivalent of
SD90)
Step transition watchdog
M9109 SM1109 SM91 timer start (equivalent of
SD91)
Step transition watchdog
M9110 SM1110 SM92 timer start (equivalent of
SD92)
The relay turns on when measurement by
Step transition watchdog OFF: Watchdog timer reset
the step transition monitoring timer is
M9111 SM1111 SM93 timer start (equivalent of ON: Watchdog timer reset
started. The step transition monitoring
SD93) start
timer is reset when the relay turns off.
Step transition watchdog
M9112 SM1112 SM94 timer start (equivalent of
SD94)
Step transition watchdog
M9113 SM1113 SM95 timer start (equivalent of
SD95)
Step transition watchdog
M9114 SM1114 SM96 timer start (equivalent of
SD96)

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series

Programming MELSEC System Q and L series A – 137


Table of special relays Appendix A

ACPU Special Special


Special Relay after Relay for Name Meaning Details Valid for:
Relay Conversion Modification
 Selects the operation output when
block stop is executed.
 On: Retains the on or off status of the
coil used in the operation output of the
Operation output at block OFF: Coil output OFF step, which was being executed at the
M9196 SM1196 SM325
stop ON: Coil output ON time of block stop.
 Off:Turns off all the coil outputs.
(Operation output by the SET
instruction is retained regardless of the
on/off status of SM1196.)
No function for Display is changed depending
M9197 SM1197
QCPU/LCPU on combination of M9197
ON/OFF state and M9198
ON/OFF state.
Switches I/O numbers between the fuse-
I/O numbers Qn(H)
SM1197 SM1198 to be blown module registers (SD1100 to
Switch between blown QnPH
displayed SD1107) and I/O module verify error
fuse and I/O verification
No function for error display OFF OFF
X/Y0 registers (SD1116 to SD1123) according
M9198 SM1198 to 7F0 to the on/off combination of SM1197 and
QCPU/LCPU X/Y800
ON OFF SM1198.
to FF0
X/Y1000
OFF ON to 17F0
X/Y1800
ON ON
to 1FF0

 Recovers the setting data stored in the


CPU module at restart when sampling
Online recovery of sam- OFF: Does not perform data trace/status latch is executed.
No function for
M9199 SM1199 pling trace status latch recovery  Turn this on to re-execute the sampling
QCPU/LCPU trace or status latch. (Rewriting data
data ON: Performs data recovery
using the programming tool is not
required.)

Tab. A-50: Special relays (9): Conversion from A series to System Q or L series
1
The relevant modules are as follows:
• The Universal model QCPU whose serial number (first five digits) is "10102" or higher.
• Q00UJCPU, Q00UCPU, Q01UCPU
2 1 minute clock indicates the name of the special relay (M9034) of the ACPU.
3
The A8UPU/A8PUJ is not available for the QCPU/LCPU.

A – 138
Appendix A Table of special relays

A.6.10 Built-in Ethernet port and built-in Ethernet function

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
OFF: No time setting
function (SNTP This relay is turned on to perform the time setting
Time setting function (SNTP client) execution function (SNTP client). (Turns on only when "Use"
SM1270
client) execution ON: Time setting function has been set for the time setting function in the time
(SNTP client) setting parameter.) QnU 1)
execution LCPU

This relay is turned on to clear the accumulated U


Remote password OFF: Normal
SM1273 number of mismatched remote password entries
mismatch count clear ON: Clear
(SD979 to SD999).
The IP address setting stored in SD1292 to SD1297
IP address storage area OFF: Ignored are written to the IP address storage area (flash
SM1292
write request ON: Write request ROM) of the CPU module when the END instruction
is executed in the scan where this relay is turned on.
 This relay turns on when writing to the IP
IP address storage area OFF: Not completed address storage area (flash ROM) is completed.
SM1293  This relay turns off when the END instruction is
write completion ON: Completed executed in the scan where SM1292 is turned
off. S (Status New
 This relay turns on when writing to the IP change)
IP address storage area OFF: Normal address storage area (flash ROM) fails.
SM1294  This relay turns off when the END instruction is
write error ON: Error executed in the scan where SM1292 is turned
off. QnU 2)
The IP address storage area (flash ROM) is cleared
IP address storage area OFF: Ignored
SM1295 when the END instruction is executed in the scan U
clear request ON: Clear request
where this relay is turned on.
 This relay turns on when clearing the IP address
IP address storage area OFF: Not completed storage area (flash ROM) is completed.
SM1296  This relay turns off when the END instruction is
clear completion ON: Completed executed in the scan where SM1295 is turned
off. S (Status
 This relay turns on when clearing the IP address change)
IP address storage area OFF: Normal storage area (flash ROM) fails.
SM1297  This relay turns off when the END instruction is
clear error ON: Error executed in the scan where SM1295 is turned
off.

Tab. A-51: Special relays (10): Built-in Ethernet port and built-in Ethernet function
1
This applies to the Built-in Ethernet port QCPU.
2
This applies to the built-in Ethernet port QCPU whose first five digits of serial No. is "11082" or higher.

Programming MELSEC System Q and L series A – 139


Table of special relays Appendix A

A.6.11 Process control instruction

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
Specifies whether or not to hold the output value
SM1500 when a range over occurs for the S.IN instruction
OFF: No-hold range check. QnPH
Hold mode U New
ON: Hold Specifies whether or not the output value is held QnPR
SM1501 when a range over occurs for the S.OUT instruction
range check.

Tab. A-52: Special relays (11): Process control instruction

A.6.12 Redundant system (host system CPU information)

The special relays SM1510 to SM1599 store information of the host CPU module.
These special relays are valid only for redundant systems. SM1510 to SM1599 are set to off
for stand-alone systems.

Set by ACPU
Number Name Meaning Description (if set) M9 Valid for:

OFF: Redundant system


backup mode, S
This relay is on while the system is operating in the sepa-
SM1510 Operation mode stand-alone system (Every END New QnPRH
rate mode.
ON: Redundant system processing)
separate mode
System A  Distinguishes between system A and system B.
SM1511  The flag status does not change even if the tracking cable is disconnected. New QnPRH
identification flag

If TRK. CABLE ERR. (error code:


System A System B
6210) occurred (Unknown)
System B
SM1512 New QnPRH
identification flag SM1511 ON OFF OFF S
SM1512 OFF ON OFF (Initial)

Debug mode status OFF: Not in debug mode This relay is on while the system is operating in the debug
SM1513 New QnPRH
flag ON: Debug mode mode.

Control system  Indicates operation system status.


SM1515  The flag status does not change even if the tracking cable is disconnected. New QnPRH
judgment flag

Control Standby If TRK. CABLE ERR. (error code: S


system system 6210) occurred (Unknown) (Status
Standby system change)
SM1516 SM1515 ON OFF OFF New QnPRH
judgment flag
SM1516 OFF ON OFF

Turns on when the CPU module is started up by the


OFF: Power supply on
system switching (switching from the standby system to S
CPU module startup startup
SM1517 the control system). Remains OFF when the standby (Status New QnPRH
status ON: Operation system
system is switched to the control system by a power-ON change)
switch start up
startup.

Tab. A-53: Special relays (12): Redundant system (host system CPU information)

A – 140
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9

Standby system to  This relay turns on during one scan after the standby
ON system was switched to the control system.
SM1518 control system 1 scan New QnPRH
 This relay can be used only in a scan execution type
switching status flag OFF
program. S
(Every END
When the previous control system is System B, this relay processing)
Previous Control
ON 1 scan turns on during one scan in System A, following the RUN
SM1519 System Identification New QnPRH
OFF state after both Systems A and B were simultaneously
Flag
turned on or were reset.

SM1520 SM1520 Block 1

SM1521 SM1521 Block 2


SM1522 SM1522 Block 3
SM1523 SM1523 Block 4
SM1524 SM1524 Block 5
SM1525 SM1525 Block 6
SM1526 SM1526 Block 7
SM1527 SM1527 Block 8
SM1528 SM1528 Block 9
SM1529 SM1529 Block 10
SM1530 SM1530 Block 11
 When data is transferred
SM1531 SM1531 Block 12 based on the tracking
setting of the Redundant
SM1532 SM1532 Block 13 parameter dialog box, the
SM1533 SM1533 Block 14 target block is specified
as trigger.
SM1534 SM1534 Block 15  When "Do auto forward
Data tracking transfer OFF: No trigger Tracking block No.1" is S
SM1535 SM1535 Block 16 selected for the tracking New QnPRH
trigger specification ON: Trigger setting, SM1520 is turned (initial)/U
SM1536 SM1536 Block 17 on by the system at
SM1537 SM1537 Block 18 power-on or when the
system is switched from
SM1538 SM1538 Block 19 STOP to RUN.In other
cases, SM1520 to
SM1539 SM1539 Block 20 SM1583 are turned on by
the user.
SM1540 SM1540 Block 21
SM1541 SM1541 Block 22
SM1542 SM1542 Block 23
SM1543 SM1543 Block 24
SM1544 SM1544 Block 25
SM1545 SM1545 Block 26
SM1546 SM1546 Block 27
SM1547 SM1547 Block 28
SM1548 SM1548 Block 29
SM1549 SM1549 Block 30
SM1550 SM1550 Block 31
SM1551 SM1551 Block 32

Tab. A-53: Special relays (12): Redundant system (host system CPU information)

Programming MELSEC System Q and L series A – 141


Table of special relays Appendix A

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9

SM1552 SM1552 Block 33

SM1553 SM1553 Block 34


SM1554 SM1554 Block 35
SM1555 SM1555 Block 36
SM1556 SM1556 Block 37
SM1557 SM1557 Block 38
SM1558 SM1558 Block 39
SM1559 SM1559 Block 40
SM1560 SM1560 Block 41
SM1561 SM1561 Block 42
SM1562 SM1562 Block 43  When data is transferred
based on the tracking
SM1563 SM1563 Block 44 setting of the Redundant
SM1564 SM1564 Block 45 parameter dialog box, the
target block is specified
SM1565 SM1565 Block 46 as trigger.
 When "Do auto forward
SM1566 Data tracking transfer OFF: No trigger SM1566 Block 47 Tracking block No.1" is S
selected for the tracking New QnPRH
SM1567 trigger specification ON: Trigger SM1567 Block 48 setting, SM1520 is turned (initial)/U
SM1568 SM1568 Block 49 on by the system at
power-on or when the
SM1569 SM1569 Block 50 system is switched from
STOP to RUN.In other
SM1570 SM1570 Block 51 cases, SM1520 to
SM1583 are turned on by
SM1571 SM1571 Block 52 the user.
SM1572 SM1572 Block 53
SM1573 SM1573 Block 54
SM1574 SM1574 Block 55
SM1575 SM1575 Block 56
SM1576 SM1576 Block 57
SM1577 SM1577 Block 58
SM1578 SM1578 Block 59
SM1579 SM1579 Block 60
SM1581 SM1581 Block 61
SM1582 SM1582 Block 62
SM1583 SM1583 Block 63
OFF: System switching
request issuing Turns on when a system switching request is issued from
System switching S
module absent the network module. The module No. that issued system
SM1590 enable/disable flag (Every END New QnPRH
ON: System switching switching can be checked by SD1590. Turns off when all
from network module processing)
request issuing bits of SD1590 are off.
module present
OFF: Error is detected by
new standby This flag is used when switching the system in any of the
system at system following sources to determine whether to detect
Standby system error "STANDBY" (error code 6210) in the new standby system:
switching
SM1591 detection disable flag [Reason(s) for system switching] U New QnPRH
ON: Error is not
at system switching  System switching with a programming tool
detected by new
 System switching using dedicated instruction
standby system at  System switching by the intelligent function module
system switching

Tab. A-53: Special relays (12): Redundant system (host system CPU information)

A – 142
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9

OFF: Disable user system


This relay stores whether to enable manual switching
Enable/disable user switching
SM1592 using a programming tool or the system switching U New QnPRH
system switching ON: Enable user system
instruction (SP.CONTSW).
switching

This relay sets the behavior of the system after the


standby CPU in the separate mode accessed the buffer
Setting to access memory of an intelligent function module mounted on an
OFF: Error
SM1593 extension base unit of extension base unit. U New QnPRH
ON: Ignored
standby system CPU  OFF: "OPERATION ERROR" (error code: 4112) is
returned.
 ON: No processing
When SM1595 is turned ON from OFF, memory copying
from the control system to the standby system starts.
OFF: No memory copy
Memory copy to other Note that memory copy does not start even after SM1595
SM1595 initiated U New QnPRH
system start flag was turned on from off if the I/O No. of the copy
ON: Start memory copy
destination (standby system CPU module: 3D1H) is not
stored in SD1595.

OFF: Memory copy not


Memory copy to other executed  This relay is on during memory copy from the control S
SM1596 system to the standby system. (Starting to New QnPRH
system status flag ON: Memory copy  This relay turns off when memory copy is complete. copy/finish)
executed

OFF: Memory copy not


Memory copy to other
completed This relay turns upon completion of memory copy from S
SM1597 system completion New QnPRH
ON: Memory copy the control system to the standby system. (finish)/U
flag
completed
OFF: Copy standard ROM
Copy contents of
data If set to on by user, the standard ROM data is not copied
SM1598 standard ROM during U New QnPRH
ON: Standard ROM data to the other system while memory copy is executing.
memory copy
is not copied

Tab. A-53: Special relays (12): Redundant system (host system CPU information)

Programming MELSEC System Q and L series A – 143


Table of special relays Appendix A

A.6.13 Redundant system (other system CPU information)

The special relays SM1600 to SM1649 store diagnostic information and system information of
other system CPU.
These special relays are valid only when the redundant system is in backup mode and is invalid
in separate mode. SM1600 to SM1649 are set to OFF for stand-alone systems.

Correspon
ding host
Set by
Number Name Meaning Description (if set) system Valid for:
special
relay
 This relay turns on if an error is detected by error
OFF: No error check for redundant system. (This relay turns on
SM1600 Other system error flag when any of the SD1600 bits turns on.) — QnPRH
ON: Error
 This relay turns off when an error is cleared.
 This relay turns ON if a diagnostic error occurs in
the CPU module in the other system. (Also turns
Other system diagnostics OFF: No error ON when an annunciator turns ON and when an
SM1610 SM0 QnPRH
error ON: Error error is detected by the CHK instruction.)
 The SM0 status for the CPU module in the other
system is reflected.
 This relay turns on if a self-diagnostics error
OFF: No self diagnostics occurred in the CPU module in the other system. S
Other systems self error occurred (Excluding error detections by an annunciator and
SM1611 (Every END SM1 QnPRH
diagnostics error. ON: Self diagnostics error the CHK instruction.)
 The SM1 status for the CPU module in the other processing)
occurred
system is reflected.

OFF: No common error  This relay turns on when there is error common
Other system common information present information data for an error occurred in the CPU
SM1615 module in the other system. SM5 QnPRH
error information ON: Common error  The SM5 status for the CPU module in the other
information present system is reflected.

OFF: No individual error  This relay turns on when there is error individual
Error individual information for an error occurred in the CPU
information present
SM1626 information for other module in the other system. SM16 QnPRH
ON: Individual error  The SM16 status for the CPU module in the other
systems
information present system is reflected.
OFF to ON: This relay is turned on from off to clear a continuation
Standby system cancel
SM1649 Cancels error of standby error occurred in the standby system. Use SD1649 to U — QnPRH
error flag
system specify the error code of the error to be canceled.

Tab. A-54: Special relays (13): Redundant system (other system CPU information)

A – 144
Appendix A Table of special relays

A.6.14 Redundant system (tracking information)

The special relays SM1700 to SM1799 are valid when the redundant system is in backup mode
or in separate mode. SM1700 to SM1799 are set to OFF for stand-alone systems.

Number Name Meaning Description Set by (if ACPU Valid for:


set) M9

OFF: Transfer not S


Transfer trigger This relay remains on for one scan upon completion of a
SM1700 completed (Status New QnPRH
completion flag transfer for any of the blocks 1 to 64.
ON: Transfer completed change)

 This relay is turned from off to on to enable the user to


switch a system during online program change for
redundancy. After the manual system switching disable
status is canceled, the system automatically turns off
SM1709.
 A system can be switched even a online program
change for redundancy is being performed and
Manual system OFF: Manual system regardless of the status of this relay, if the reason for
switching disabled the switching is any of the following:
switching disable/ - Power-off S
SM1709 enable setting during ON: Manual system (Request)/ New QnPRH
- Reset
online program change switching enabled U
- Hardware failure
redundant tracking (Disable canceled)
- CPU stop error
 The system switching disable status can also be
canceled by this relay during the following states.
- Multiple-block online program change redundant
tracking execution status
- File batch online program change redundant
tracking execution status
 This relay specifies whether to execute a tracking
transfer for the following control data during online
program change for redundancy.
- Device memory (Including SMs and SDs that
automatically execute a tracking transfer)
Transfer tracking data OFF: No device tracking - PIDINIT information, S.PIDINIT information, SFC
SM1710 during online program ON: Transfer device information U New QnPRH
change enable flag memory  SM1710 can be also used to specify whether to enable
a tracking transfer while multiple-block online program
change redundant tracking and while file batch online
program change redundant tracking.
 SM1710 is transferred from the control system to the
standby system by tracking transfer.

Tab. A-55: Special relays (14): Redundant system (tracking information)

Programming MELSEC System Q and L series A – 145


Table of special relays Appendix A

Set by (if ACPU


Number Name Meaning Description Valid for:
set) M9
SM1712 SM1712 Block 1
SM1713 SM1713 Block 2
SM1714 SM1714 Block 3
SM1715 SM1715 Block 4
SM1716 SM1716 Block 5
SM1717 SM1717 Block 6
SM1718 SM1718 Block 7
SM1719 SM1719 Block 8
SM1720 SM1720 Block 9
SM1721 SM1721 Block 10
SM1722 SM1722 Block 11
SM1723 SM1723 Block 12
SM1724 SM1724 Block 13
SM1725 SM1725 Block 14
SM1726 SM1726 Block 15
SM1727 SM1727 Block 16
SM1728 SM1728 Block 17
This relay turns on only
SM1729 S
Transfer trigger OFF: Transfer uncompleted SM1729 Block 18 during one scan upon
(Status New QnPRH
SM1730 completion flag ON: Transfer completed SM1730 Block 19 completion of a transfer for
change)
the relevant block.
SM1731 SM1731 Block 20
SM1732 SM1732 Block 21
SM1733 SM1733 Block 22
SM1734 SM1734 Block 23
SM1735 SM1735 Block 24
SM1736 SM1736 Block 25
SM1737 SM1737 Block 26
SM1738 SM1738 Block 27
SM1739 SM1739 Block 28
SM1740 SM1740 Block 29
SM1741 SM1741 Block 30
SM1742 SM1742 Block 31
SM1743 SM1743 Block 32
SM1744 SM1744 Block 33
SM1745 SM1745 Block 34
SM1746 SM1746 Block 35
SM1747 SM1747 Block 36

Tab. A-55: Special relays (14): Redundant system (tracking information)

A – 146
Appendix A Table of special relays

Set by (if ACPU


Number Name Meaning Description Valid for:
set) M9
SM1748 SM1748 Block 37
SM1749 SM1749 Block 38
SM1750 SM1750 Block 39
SM1751 SM1751 Block 40
SM1752 SM1752 Block 41
SM1753 SM1753 Block 42
SM1754 SM1754 Block 43
SM1755 SM1755 Block 44
SM1756 SM1756 Block 45
SM1757 SM1757 Block 46
SM1758 SM1758 Block 47
SM1759 SM1759 Block 48
SM1760 SM1760 Block 49
This relay turns on only for
SM1761 S
Transfer trigger OFF: Transfer uncompleted SM1761 Block 50 one scan upon completion of
(Status New QnPRH
SM1762 completion flag ON: Transfer completed SM1762 Block 51 a transfer for the relevant
change)
block.
SM1763 SM1763 Block 52
SM1764 SM1764 Block 53
SM1765 SM1765 Block 54
SM1766 SM1766 Block 55
SM1767 SM1767 Block 56
SM1768 SM1768 Block 57
SM1769 SM1769 Block 58
SM1770 SM1770 Block 59
SM1771 SM1771 Block 60
SM1772 SM1772 Block 61
SM1773 SM1773 Block 62
SM1774 SM1774 Block 63
SM1775 SM1775 Block 64

Tab. A-55: Special relays (14): Redundant system (tracking information)

Programming MELSEC System Q and L series A – 147


Table of special relays Appendix A

A.6.15 Redundant power supply module information

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
OFF: No redundant power  Turns ON when one or more redundant power
supply module with supply modules with input power OFF are
input power OFF detected. Qn(H) 3)
Power supply off detection detected  Turns on if any of SD1780 bits is on. S
QnPH 3)
SM1780  Turns off if all bits of SD1780 are off. (Every END New
flag ON: Redundant power  This relay turns off when the main base unit is QnPRH
processing)
supply module with not the redundant main base unit (Q38RB). QnU 4)
input power OFF  When the multiple CPU system is configured,
detected the flags are stored only to the CPU No.1.
 Turns ON when one or more faulty redundant
OFF: No faulty redundant power supply modules are detected.
power supply module  Turns on if any of SD1781 bits is on. Qn(H) 3)
S
Power supply failure detected  Turns off if all bits of SD1781 are off. QnPH 3)
SM1781  This relay turns off when the main base unit is (Every END New
detection flag ON: Faulty redundant QnPRH
processing)
power supply module not the redundant main base unit (Q38RB). QnU 4)
detected  When the multiple CPU system is configured,
the flags are stored only to the CPU No.1.

Momentary power failure  Turns ON when a momentary power failure of Qn(H) 3)


S
detection flag for power
the input power supply to the power supply 1 or QnPH 3)
SM1782 2 is detected one or more times. After turning (Every END New
QnPRH
supply 1 1) on, this relay remains on even if the power processing)
QnU 4)
supply recovers from the momentary power
failure.
OFF: No momentary power  Turns off the flags (SM1782 and SM1783) of the
failure detected power supply 1 and 2 when the CPU module
ON: Momentary power starts. Qn(H) 3)
Momentary power failure failure detected  When the input power to one of the redundant S
detection flag for power QnPH 3)
SM1783 power supply modules turns OFF the (Every END New
corresponding flag turns OFF. QnPRH
supply 2 2) processing)
QnU 4)
 This relay turns off when the main base unit is
not the redundant main base unit (Q38RB).
 When the multiple CPU system is configured,
the flags are stored only to the CPU No.1.

Tab. A-56: Special relays (15): Redundant power supply module information
1
The "power supply 1" indicates the redundant power supply module mounted on the POWER 1 slot of the redundant base unit
(Q38RB/Q68RB/Q65WRB).
2
The "power supply 2" indicates the redundant power supply module mounted on the POWER 2 slot of the redundant base unit (Q38RB/Q68RB/Q65WRB).
3
The module whose first 5 digits of serial No. is "04012" or higher. However, for the multiple CPU system configuration, this applies to all CPU modules
whose first 5 digits of serial No. are "07032" or higher.
4
The module whose first 5 digits of serial No. is "10042" or higher.

A – 148
Appendix A Table of special relays

A.6.16 Built-in I/O function

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
 This relay turns on when positioning control, OPR
control, JOG operation, or absolute position
restoration is started. This relay turns off when
each control is completed. In positioning control, S
OFF: Not busy this relay turns off when the axis 1 decelerates
SM1840 Axis 1 busy (Every END New LCPU
ON: Busy and stops, and then "dwell time" elapsed. (This
relay remains on while positioning control is processing)
being performed.)
 This relay turns off when each control is ended
due to such as an error or stop operation.
 This relay turns on when OPR control, position
control, or absolute position restoration is
completed. S
 This relay turns off when OPR control, positioning (Instruction
Axis 1 positioning OFF: Not completed control, absolute position restoration, or JOG
SM1841 execution/ New LCPU
completion ON: Completed operation is started.
 This relay remains off when JOG operation is Status
completed. change)
 This relay remains off when position control is
stopped.
 This relay turns on when the CPU module is
OFF: Machine OPR control powered on, is reset, or is set from STOP to RUN; S
completed or the drive unit ready signal turns off; or machine
SM1842 Axis 1 OPR request (Every END New LCPU
ON: Machine OPR control OPR control is started.
 This relay turns off when machine OPR control is processing)
started
completed.
 This relay turns on when machine OPR control is
completed. S
OFF: Not completed  This relay turns off when OPR control, positioning (Instruction
SM1843 Axis 1 OPR completion control, absolute position restoration, or JOG execution/ New LCPU
ON: Completed operation is started; or the CPU module is set Status
from STOP to RUN; or the drive unit ready signal change)
turns off.
 This relay turns on when JOG operation or speed
control in speed/position switching control set at
OFF: Operating at speed a speed of "0" is started.
SM1844 Axis 1 speed 0 other than 0  This relay turns on when speed is changed with a New LCPU
ON: Operating at speed 0 new speed value of "0", and turns off when speed
is changed with a new speed value other than "0".
 This relay turns off when SM1840 turns off. S
(Every END
OFF: No error  This relay turns on if an error occurs. processing)
SM1845 Axis 1 error  The present error can be checked by SD1845. New LCPU
ON: Error  This relay is turned off by turning on SM1850.

OFF: No warning  This relay turns on if a warning occurs.


SM1846 Axis 1 warning  The present warning can be checked by SD1846. New LCPU
ON: Warning  This relay is turned off by turning on SM1850.
 This relay turns on when positioning control, OPR
OFF: No start attempted in control, JOG operation, or absolute position S
busy status restoration is attempted while the axis 1 is in the (Instruction
SM1847 Axis 1 start in busy status busy status. The executed start instruction will be New LCPU
ON: Start attempted in busy execution)
status ignored. /U
 This relay is reset by the user.
 This relay turns on when positioning control by
the start instruction (IPPSTRT1(P), IPDSTRT1(P), S
IPSIMUL(P), IPABRST1), JOG operation by the (Instruction
OFF: Not executed
SM1848 Axis 1 start instruction JOG start instruction (IPJOG1), or OPR control by execution/ New LCPU
ON: Being executed the OPR start instruction (IPOPR1(P)) is started. Status
 This relay turns off when positioning control, OPR change)
control, or JOG operation is completed.

Tab. A-57: Special relays (16): Built-in I/O function

Programming MELSEC System Q and L series A – 149


Table of special relays Appendix A

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
 Turning on this relay will turn off SM1845 and
OFF → ON: Resets the Axis SM1846 and will clear the SD1845 and SD1846
SM1850 Axis 1 error reset 1 error. values to "0".
 Even if this relay is turned on, SM1845 will not
OFF: Clears the reset status. turn off and the SD1845 value will not be cleared
to "0" until SM1840 turns off. U
OFF → ON: Axis 1 OPR New LCPU
SM1851 Axis 1 OPR request off request Turning on this relay will forcibly turn off SM1842.
OFF: Cleared
This relay stores whether to enable switching from
Axis 1 speed/ position OFF: Disabled
SM1852 speed control to position control in speed/position
switching ON: Enabled
switching control.
 This relay turns on when positioning control, OPR
control, JOG operation, or absolute position
restoration is started. This relay turns off when
each control is completed. In positioning control, S
OFF: Not busy this relay turns off when the axis 2 decelerates
SM1860 Axis 2 busy (Every END New LCPU
ON: Busy and stops, and then "dwell time" elapsed. (This
relay remains on while positioning control is processing)
being performed.)
 This relay turns off when each control is ended
due to such as an error or stop operation.
 This relay turns on when OPR control, position
control, or absolute position restoration is
completed. S
 This relay turns off when OPR control, positioning (Instruction
Axis 2 positioning OFF: Not completed control, absolute position restoration, or JOG
SM1861 operation is started. execution/ New LCPU
completion ON: Completed
 This relay remains off when JOG operation is Status
completed. change)
 This relay remains off when position control is
stopped.
 This relay turns on when the CPU module is
OFF: Machine OPR control powered on, is reset, or is set from STOP to RUN; S (Every
completed or the drive unit ready signal turns off; or machine
SM1862 Axis 2 OPR request END New LCPU
ON: Machine OPR control OPR control is started.
 This relay turns off when machine OPR control is processing)
started
completed.
 This relay turns on when machine OPR control is
completed. S
OFF: Not completed  This relay turns off when OPR control, positioning (Instruction
SM1863 Axis 2 OPR completion control, absolute position restoration, or JOG execution/ New LCPU
ON: Completed operation is started; or the CPU module is set Status
from STOP to RUN; or the drive unit ready signal change)
turns off.
 This relay turns on when JOG operation or speed
control in speed/position switching control set at
OFF: Operating at speed a speed of "0" is started. S (Every
SM1864 Axis 2 speed 0 other than 0  This relay turns on when speed is changed with a END New LCPU
ON: Operating at speed 0 new speed value of "0", and turns off when speed processing)
is changed with a new speed value other than "0".
 This relay turns off when SM1860 turns off.

OFF: No error  This relay turns on if an error occurs. S (Every


SM1865 Axis 2 error  The present error can be checked by SD1865. END New LCPU
ON: Error  This relay is turned off by turning on SM1870. processing)

OFF: No warning  This relay turns on if a warning occurs. S (Every


SM1866 Axis 2 warning  The present warning can be checked by SD1866. END New LCPU
ON: Warning  This relay is turned off by turning on SM1870. processing)
 This relay turns on when positioning control, OPR
OFF: No start attempted in control, JOG operation, or absolute position S
busy status restoration is attempted while the axis 2 is in the (Instruction
SM1867 Axis 2 start in busy status New LCPU
ON: Start attempted in busy busy status. The executed start instruction will be execution)
status ignored. /U
 This relay is reset by the user.
 This relay turns on when positioning control by
the start instruction (IPPSTRT2(P), IPDSTRT2(P), S
IPSIMUL(P), IPABRST2), JOG operation by the (Instruction
OFF: Not executed
SM1868 Axis 2 start instruction JOG start instruction (IPJOG2), or OPR control by execution/ New LCPU
ON: Being executed the OPR start instruction (IPOPR2(P)) is started. Status
 This relay turns off when positioning control, OPR change)
control, or JOG operation is completed.

Tab. A-57: Special relays (16): Built-in I/O function

A – 150
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
 Turning on this relay will turn off SM1865 and
OFF → ON: Resets the Axis SM1866 and will clear the SD1865 and SD1866
SM1870 Axis 2 error reset 2 error. values to "0". New LCPU
 Even if this relay is turned on, SM1865 will not
OFF: Clears the reset status. turn off and the SD1865 value will not be cleared
to "0" until SM1860 turns off.
OFF → ON: Axis 2 OPR U
SM1871 Axis 2 OPR request off request Turning on this relay will forcibly turn off SM1862. New LCPU
OFF: Cleared
This relay stores whether to enable switching from
Axis 2 speed/ position OFF: Disabled
SM1872 speed control to position control in speed/position New LCPU
switching ON: Enabled
switching control.
OFF: Coincidence point  This relay turns on when "current value of CH1 >
(No.1) or smaller coincidence output No.1 point setting value" is S
CH1 counter value greater met.
SM1880 ON: Greater than  This relay turns off when "current value of CH1 <= (Every END New LCPU
(No.1)
coincidence point coincidence output No.1 point setting value" is processing)
(No.1) met.

 This relay turns on when "current value of CH1 = S


coincidence output No.1 point setting value" is (Status
CH1 counter value OFF: Not detected
SM1881 met. change/ New LCPU
coincidence (No.1) ON: Detected  This relay is turned off by turning on CH1 Every END
coincidence signal No.1 reset command. processing)
OFF: Coincidence point  This relay turns on when "current value of CH1 <
(No.1) or greater coincidence output No.1 point setting value" is S
CH1 counter value smaller met.
SM1882 ON: Smaller than (Every END New LCPU
(No.1)  This relay turns off when "current value of CH1 >=
coincidence point coincidence output No.1 point setting value" is processing)
(No.1) met.
OFF: Coincidence point  This relay turns on when "current value of CH1 >
(No.2) or smaller coincidence output No.2 point setting value" is S
CH1 counter value greater met.
SM1883 ON: Greater than (Every END New LCPU
(No.2)  This relay turns off when "current value of CH1 <=
coincidence point coincidence output No.2 point setting value" is processing)
(No.2) met.

 This relay turns on when "current value of CH1 = S


coincidence output No.2 point setting value" is (Status
CH1 counter value OFF: Not detected
SM1884 met. change/ New LCPU
coincidence (No.2) ON: Detected  This relay is turned off by turning on CH1 Every END
coincidence signal No.2 reset command. processing)
OFF: Coincidence point  This relay turns on when "current value of CH1 <
(No.2) or greater coincidence output No.2 point setting value" is S (Every
CH1 counter value smaller met.
SM1885 ON: Smaller than END New LCPU
(No.2)  This relay turns off when "current value of CH1 >=
coincidence point coincidence output No.2 point setting value" is processing)
(No.2) met.
 This relay turns on when a preset request by
CH1 external preset phase Z (preset) terminal of CH1 is detected. S (Every
OFF: Not detected
SM1886 (phase Z) request  This relay is turned off by turning on CH1 external END New LCPU
ON: Detected preset (phase Z) request detection clear
detection processing)
command.
 This relay turns on if the CH1 error occurs. S (Every
OFF: No error  This relay turns off when an error cause is
SM1887 CH1 error removed and CH1 error reset command is turned END New LCPU
ON: Error
on. processing)

 This relay turns on if a warning occurs in CH1. S (Every


SM1888 CH1 warning
OFF: No warning  This relay turns off when a warning cause is END New LCPU
ON: Warning removed and CH1 error reset command is turned
on. processing)

 This relay is turned on to reset CH1 counter value


CH1 coincidence signal Resets CH1 counter value coincidence No.1.
SM1890  The command is valid while this relay is on. U New LCPU
No.1 reset command coincidence No.1.
 The on time must be held for at least 2ms.
 This relay is turned on to reset CH1 counter value
CH1 coincidence signal Resets CH1 counter value coincidence No.2.
SM1891 U New LCPU
No.2 reset command coincidence No.2.  The command is valid while this relay is on.
 The on time must be held for at least 2ms.

Tab. A-57: Special relays (16): Built-in I/O function

Programming MELSEC System Q and L series A – 151


Table of special relays Appendix A

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9

Controls outputs from CH1  This relay is turned on to perform coincidence


CH1 coincidence output output from CH1 coincidence output No.1 and
SM1892 coincidence output No.1 U New LCPU
enable command CH1 coincidence output No.2 terminals.
and No.2 terminals.  The command is valid while this relay is on.
 This relay is turned on to preset the counter value.
 The command is valid at the rise of this relay
SM1893 CH1 preset command Presets the counter value. (from OFF to ON). U New LCPU
 The on and off time must be held for at least
2 ms.
 This relay is turned on to count down pulses.
CH1 count down  The command is valid while the Pulse input mode
SM1894 Counts down pulses. is either 1-phase multiple of n or 1-phase multiple U New LCPU
command of n (A phase only).
 The command is valid while this relay is on.

SM1895
CH1 count enable
Starts counting.  This relay is turned on to start counting. U New LCPU
command  The command is valid while this relay is on.
 This relay is turned on to start the selected
counter function.
 When the count disabling function is selected, the
command is valid while this relay is on.
CH1 counter function Starts the selected counter  When the latch counter function or the sampling
SM1896 counter function is selected, the command is U New LCPU
selection start command function. valid at the rise of this relay (from OFF to ON). The
on time must be held for at least 2 ms.
 When the count disabling/preset function or the
latch counter/preset function is selected, the
command is invalid.
 This relay is turned on to reset CH1 external
CH1 external preset preset (phase Z) request detection.
Resets CH1 external preset  The command is valid at the rise of this relay
SM1897 (phase Z) request (from OFF to ON). U New LCPU
(phase Z) request detection.
detection reset command  The on and off time must be held for at least
2 ms.

SM1898
CH1 pulse measurement
Starts pulse measurement.  This relay is turned on to measure pulses. U New LCPU
start command  The command is valid while this relay is on.
 This relay is turned on to reset the CH1 error.
 The command is valid at the rise of this relay
SM1899 CH1 error reset command Resets the CH1 error. (from OFF to ON). U New LCPU
 The on and off time must be held for at least
2 ms.
OFF: Coincidence point  This relay turns on when "current value of CH2 >
(No.1) or smaller coincidence output No.1 point setting value" is S (Every
CH2 counter value greater met.
SM1900 ON: Greater than END New LCPU
(No.1)  This relay turns off when "current value of CH2 <=
coincidence point coincidence output No.1 point setting value" is processing)
(No.1) met.
 This relay turns on when "current value of CH2 = S (Status
CH2 counter value OFF: Not detected coincidence output No.1 point setting value" is change/
SM1901 met. New LCPU
coincidence (No.1) ON: Detected  This relay is turned off by turning on CH2 Every END
coincidence signal No.1 reset command. processing)

OFF: Coincidence point  This relay turns on when "current value of CH2 <
(No.1) or greater coincidence output No.1 point setting value" is
CH2 counter value smaller met.
SM1902 ON: Smaller than
(No.1)  This relay turns off when "current value of CH2 >=
coincidence point coincidence output No.1 point setting value" is S (Every
(No.1) met. END
processing) New LCPU
OFF: Coincidence point  This relay turns on when "current value of CH2 >
(No.2) or smaller coincidence output No.2 point setting value" is
CH2 counter value greater met.
SM1903 ON: Greater than
(No.2)  This relay turns off when "current value of CH2 <=
coincidence point coincidence output No.2 point setting value" is
(No.2) met.
 This relay turns on when "current value of CH2 = S (Status
CH2 counter value OFF: Not detected coincidence output No.2 point setting value" is change/
SM1904 met. New LCPU
coincidence (No.2) ON: Detected  This relay is turned off by turning on CH2 Every END
coincidence signal No.2 reset command. processing)

Tab. A-57: Special relays (16): Built-in I/O function

A – 152
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
OFF: Coincidence point  This relay turns on when "current value of CH2 <
(No.2) or greater coincidence output No.2 point setting value" is
CH2 counter value smaller met.
SM1905 ON: Smaller than
(No.2)  This relay turns off when "current value of CH2 >=
coincidence point coincidence output No.2 point setting value" is S (Every
(No.2) met. END New LCPU
 This relay turns on when a preset request by processing)
CH2 external preset phase Z (preset) terminal of CH2 is detected.
OFF: Not detected
SM1906 (phase Z) request  This relay is turned off by turning on CH2 external
ON: Detected preset (phase Z) request detection clear
detection
command.
 This relay turns on if the CH2 error occurs.
OFF: No error  This relay turns off when an error cause is
SM1907 CH2 Error removed and CH2 error reset command is turned
ON: Error
on. S (Every
END New LCPU
 This relay turns on if a warning occurs in CH2. processing)
OFF: No warning  This relay turns off when a warning cause is
SM1908 CH2 warning
ON: Warning removed and CH2 error reset command is turned
on.
 This relay is turned on to reset CH2 counter value
CH2 coincidence signal Resets CH2 counter value coincidence No.1.
SM1910 U New LCPU
No.1 reset command coincidence No.1.  The command is valid while this relay is on.
 The on time must be held for at least 2ms.
 This relay is turned on to reset CH2 counter value
CH2 coincidence signal Resets CH2 counter value coincidence No.2.
SM1911  The command is valid while this relay is on. U New LCPU
No.2 reset command coincidence No.2.
 The on time must be held for at least 2ms.

Controls outputs from CH2  This relay is turned on to perform coincidence


CH2 coincidence output output from CH2 coincidence output No.1 and
SM1912 coincidence output No.1 U New LCPU
enable command CH2 coincidence output No.2 terminals.
and No.2 terminals.  The command is valid while this relay is on.
 This relay is turned on to preset the counter value.
SM1913 CH2 preset command Presets the counter value.  The command is valid at the rise of this relay U New LCPU
(from OFF to ON).
 The on and off time must be held for at least 2ms.
 This relay is turned on to count down pulses.
CH2 count down  The command is valid while the Pulse input mode
SM1914 Counts down pulses. is either 1-phase multiple of n or 1-phase multiple U New LCPU
command of n (A phase only).
 The command is valid while this relay is on.

SM1915
CH2 count enable
Starts counting.  This relay is turned on to start counting. U New LCPU
command  The command is valid while this relay is on.
 This relay is turned on to start the selected
counter function.
 When the count disabling function is selected, the
command is valid while this relay is on.
CH2 counter function Starts the selected counter  When the latch counter function or the sampling
SM1916 counter function is selected, the command is U New LCPU
selection start command function. valid at the rise of this relay (from OFF to ON). The
on time must be held for at least 2 ms.
 When the count disabling/preset function or the
latch counter/preset function is selected, the
command is invalid.
 This relay is turned on to reset CH2 external
CH2 external preset preset (phase Z) request detection.
Resets CH2 external preset
SM1917 (phase Z) request  The command is valid at the rise of this relay U New LCPU
(phase Z) request detection. (from OFF to ON).
detection reset command
 The on and off time must be held for at least 2ms.
CH2 pulse measurement  This relay is turned on to measure pulses.
SM1918 Starts pulse measurement.  The command is valid while this relay is on. U New LCPU
start command
 This relay is turned on to reset the CH2 error.
 The command is valid at the rise of this relay
SM1919 CH2 error reset command Resets the CH2 error. (from OFF to ON). U New LCPU
 The on and off time must be held for at least 2
ms.

Tab. A-57: Special relays (16): Built-in I/O function

Programming MELSEC System Q and L series A – 153


Table of special relays Appendix A

A.6.17 Data logging

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
This relay turns on when the system is ready for
data logging.
Data logging setting No.1 OFF: Not ready S
SM1940 This relay remains on even after data logging is sus- New LCPU
Data logging preparation ON: Ready (Initial)
pended. However, this relay turns off when data log-
ging is stopped.
This relay is turned on to start data logging and is
Data logging setting No.1 OFF: Pause
SM1941 turned off to suspend data logging. (The related U New LCPU
Data logging start ON: Start
special relays will all turn off.)
S
Data logging setting No.1 OFF: Not being collected
SM1942 This relay is on while data logging is being collected. (Status New LCPU
Data logging collection ON: Being collected
change)
This relay turns on when data logging is ended.
[Continuous is set for Logging type]
The corresponding bit turns on when data logging is
ended after data have been written by the number of
storable files (Stop is set for Operation occurring
when number of saved files is exceeded). [Trigger is
S
Data logging setting No.1 OFF: Not ended set for Logging type]
SM1943 (Status New LCPU
Data logging end ON: Ended The corresponding bit turns on when the trigger
change)
condition is met, data are collected by the number of
set times, and then the data are written to the SD
memory card.
This relay also turns on if an error occurs during
data logging (except data logging error occurred by
the execution of online change).

 This relay turns on when the specified trigger S


Data logging setting No.1 condition is met.
SM1944 OFF → ON: Triggered  This relay is turned on to meet the trigger (Status New LCPU
Data logging trigger
condition. change)/U

This relay turns on after trigger logging is triggered.


This relay remains on even after data logging is S
Data logging setting No.1 OFF: Not triggered
SM1945 completed. (Status New LCPU
After data logging trigger ON: Triggered
This relay turns off when trigger logging is sus- change)
pended or stopped.

This relay turns on if a data logging error occurs.


Data logging setting No.1 OFF: No error This relay is turned off by the registration of the set- S
SM1946 New LCPU
Data logging error ON: Error ting or a stop command from LCPU Logging Config- (Error)
uration Tool.
Data logging setting No.1 S
OFF: Not stored This relay is on while buffer memory data are being
SM1947 Data storage in SD memory (Status New LCPU
ON: Being stored stored to a SD memory card by data logging.
card change)

Tab. A-58: Special relays (17): Data logging

A – 154
Appendix A Table of special relays

Set by ACPU
Number Name Meaning Description Valid for:
(if set) M9
SM1950 to
Data logging setting No. 2
SM1957
SM1960 to
Data logging setting No. 3
SM1967
SM1970 to
Data logging setting No. 4
SM1977
SM1980 to
Data logging setting No. 5
SM1987 Same as in
data
SM1990 to Same as in data logging Same as in data logging setting No. 1
Data logging setting No. 6 logging New LCPU
SM1997 setting No. 1 (SM1940 to SM1947)
setting
SM2000 to No. 1
Data logging setting No. 7
SM2007
SM2010 to
Data logging setting No. 8
SM2017
SM2020 to
Data logging setting No. 9
SM2027
SM2030 to
Data logging setting No. 10
SM2037

Tab. A-58: Special relays (17): Data logging

Programming MELSEC System Q and L series A – 155


Table of special registers Appendix A

A.7 Table of special registers


The special registers are internal registers with fixed applications in the programmable con-
troller.
Therefore, they cannot be used like other special registers in a sequence program. However,
data can be written to these registers in order to control the CPU module. Data is usually stored
in binary format except another format is required.
The table below describes the meanings of the headings in the following table:

Item Meaning
Number Indicates the number of the special register.
Name Indicates the name of the special register.
Meaning Contains the function of the special register in brief.
Description Contains a detailed description of the register.
Indicates whether the special relay is set by the system or the user.
<Set by>
S : Set by the system
U : Set by the user (using a program, programming tool, GOT,
or test operation frosm other external devices)
S/U : Set by the system or user

Is indicated only if the system set the status.


<if set>
END processing : Set during END processing
Set by Initial : Set during initial processing (Power ON, STOP->RUN)
(if set) Status change : Set after status change
Error : Set after error
Instruction execution : Set during instruction execution
Request : Set for user request (through SM, etc.)
When condition occurs : Set when the condition is triggered
When system is switched : Set when the system is switched
(between the control system and the standby system)
When RUN/STOP/RESET
switch changed : Set when the RUN/STOP/RESET switch is changed
Card removal : Set when a memory card is inserted or removed
At write : Set when data is written to the CPU module
Indicates special register D9 corresponding to the ACPU (Change and notation when contents changed. Incom-
ACPU D9 patible with the Q00J/Q00/Q01 and QnPRH.)
Items indicated as "New“ were newly added to the QCPU or LCPU.
Indicates the corresponding CPU:
• QCPU: All the System Q CPU modules
• Q00J/Q00/Q01: Basic model QCPU
• Qn(H): High Performance model QCPU
• QnPH: Process CPU
Valid for:
• QnPRH: Redundant CPU
• QnU: Universal model QCPU
• Q00UJ/Q00U/Q01U: Q00UJCPU, Q00UCPU, and Q01UCPU
• LCPU: All the L series CPU modules
• CPU module model: Only the specified model (Example: Q02UCPU, L26CPU-BT)

For detailed information on the following topic refer to the manuals:


● Networks → Manuals for each network module
● SFC → MELSEC-Q/L/QnA Programming Manual (SFC)

NOTE Do not change the values of special register set by system using a program or by test operation.
Doing so may result in system down or communication failure.

A – 156
Appendix A Table of special registers

A.7.1 Diagnostic information

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Error codes for errors found by diagnosis are stored as BIN
S D9008 QCPU
SD0 Diagnostic errors data.
(Error) format change LCPU
Contents identical to latest fault history information.
Year (last two digits) and month that SD0 data was updated
is stored as BCD 2-digit code.
Example: October 1995
SD1 H9510
b15 b8 b7 b0
Year (0 to 99) Month (1 to 31)

The day and hour that SD0 was updated is stored as BCD 2-
digit code.
Example: 10 p.m. on 25th
Clock time for diagnosis error occur- S QCPU
SD2 H2510 New
rence (Error) LCPU
b15 b8 b7 b0
Day (1 to 31) Hour (0 to 23)

The minute and second that SD0 data was updated is stored
as BCD 2-digit code.
Example: 35 min 48s
SD3 H3548
b15 b8 b7 b0
Minute (1 to 60) Second (1 to 60)

Tab. A-59: Special registers (1): Diagnostic information

Programming MELSEC System Q and L series A – 157


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Category codes which help indicate what type of informa-
tion is being stored in the common information areas (SD5
through SD15) and the individual information areas (SD16
through SD26) are stored here.
b15 b8 b7 b0
Individual error info. Common error info.

The common information category codes store the follow-


ing codes:
0: No error
1: Module No. (Slot No./CPU No./base No.) 1, 2)
2: File name/Drive name
3: Time (value set)
4: Program error location
5: Reason(s) for system switching
(for Redundant CPU)
6: Reason(s) for tracking size excess error
(for Redundant CPU)
7: Base No./power supply No. (Except for the
Universal model QCPU and LCPU having the serial No.
(first five digits) of "10041" or lower)
8: Tracking transmission data classification
(for Redundant CPU)

Error informa- Error information cat- 1 S QCPU


SD4 For a multiple CPU system, the module No. or CPU No. is New
tion categories egory code (Error) LCPU
stored according to an error. (To determine whether a
storage value is a module No. or CPU No., refer to each error
code.)
CPU No. 1: 1, CPU No. 2: 2, CPU No. 3: 3,
CPU No. 4: 4
2
For the LCPU, only a slot No. is stored.
The individual information category codes store the follow-
ing codes:
0: No error
1: (Open)
2: File name/Drive name
3: Time (value actually measured)
4: Program error location
5: Parameter number
6: Annunciator number
7: Check instruction malfunction number (Except for
the Basic model QCPU, Universal model QCPU, and
LCPU)
8: Reason(s) for system switching failure (for
Redundant CPU)
9: Failure information (for LCPU)
12: File diagnostic information (for Universal model
QCPU and LCPU)
13: Parameter No./CPU No.
(for Universal model QCPU)

Tab. A-59: Special registers (1): Diagnostic information

A – 158
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD5  Common information corresponding to the error codes
(SD0) is stored here.
SD6  The following ten types of information are stored here.
 The error common information type can be determined
SD7
by "common information category code" stored in SD4.
SD8 (Values stored in "common information category code"
correspond to the following (1) to (8).)
SD9 (1) Module No.
SD10
Number Meaning
SD11 SM5 Slot No./CPU No./Base No. 1, 2, 3, 4, 5)
SD12 SM6 I/O No. 6)
SD13 SM7
SM8
SD14
SM9
SM10
SM11 (Vacant)
SM12
SM13
SM14
SM15
1
For a multiple CPU system, the module No. or CPU No. is
stored according to an error. (To determine whether a
storage value is a module No. or CPU No., refer to each
error code.)
CPU No. 1: 1, CPU No. 2: 2, CPU No. 3: 3, CPU No. 4: 4
2 If a fuse has been blown or an I/O module verification error
occurs in a module on the MELSECNET/H remote I/O sta-
tion, the network No. is stored in the upper 8 bits and the
station No. is stored in the lower 8 bits. To determine a
fuseblown module or a module where an I/O module veri- S QCPU
Error common information fication error occurs, check the I/O No. New
(Error) LCPU
3
If an instruction is executed to the Basic model QCPU on
the slot where the module cannot be mounted, "255" is
stored in SD5.
4
The definitions of the base No. and slot No. are as follows:
[Base No.]
SD15
Base No. Definition
0 Indicates the main base unit where a CPU
module is mounted.
1 to 7 Indicates the extension base unit. The
stage number setting made by the stage
number setting connector on the
extension base unit is the base No.
When stage number setting is extension 1:
Base No. = 1
When stage number setting is extension 7:
Base No. = 7

[Slot No.]
This number is used to identify the slot No. of a module
where an error occurs. The "0" I/O slot (slot on the right of
the CPU slot) on the main base unit is defined as "Slot No.
= 0". The slot Nos. are assigned in sequence numbers in
order of the main base unit and then the first extension
base unit to 7th extension base unit. When the number of
slots on base units has been set in the I/O assignment tab
of the PLC Parameter dialog box, the slot Nos. are
assigned by the number of set slots.
5
If a module is not mounted on any slots as set, FFH is stored.
6
If FFFFH is stored in SD6 (I/O No.), this indicates that the I/O
No. cannot be identified due to such as overlap of an I/O No.
in the I/O assignment setting of the PLC Parameter dialog
box. In this case, identify the error location using SD5.

Tab. A-59: Special registers (1): Diagnostic information

Programming MELSEC System Q and L series A – 159


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD5 (2) File name/Drive name
Example:
SD6
File name = ABCDEFGH.IJK
SD7 Number Meaning
Drive
SD8 b15 b0
B A
SD9 File name
D C
(ASCII code: 8
F E
SD10 characters)
H G
SD11 I .
Extension 7)
(ASCII code: 3 characters) K J
SD12
SD13 Vacant

SD14

(3) Time (value set)


Number Meaning
SD5 Time: 1µs-steps (0 to 999 µs)
SD6 Time: 1ms-steps (0 to 65535 ms)
SD7
SD8
SD9
SD10 S QCPU
Error common information Vacant New
SD11 (Error) LCPU
SD12
SD13
SD14
SD15

(4) Program error location


SD15 Number Meaning

SD5
SD6 File name

SD7 (ASCII code: 8 characters)

SD8
SD9 Extension 7) 2E H (.)
SD10 (ASCII code: 3 characters)

SD11 Pattern *

SD12 Block No.


SD13 Step / transition No.
SD14 Sequence step No. (L)

SD15 Sequence step No. (H)

* Contents of pattern data

15 14 4 3 2 1 0 ( Bit No. )
0 0 0 0 * * *
SFC block designation present (1) / absent (0)
not used SFC step designation present (1) / absent (0)
SFC transiton designation present (1) / absent (0)

7)
Meaning of the extensions:

SDn SDn+1
Extension Name File type
Higher 8 bits Lower 8 bits Higher 8 bits
51H 50H 41H QPA Parameters
51H 50H 47H QPG Program
51H 43H 44H QCD Device comment
51H 44H 49H QDI Initial device value
51H 44H 52H QDR File register
Local device (For High Performance model QCPU, Process CPU, Redundant
51H 44H 4CH QDL
CPU, Universal model QCPU, and LCPU)
Sampling trace data (For High Performance model QCPU, Process CPU, Redun-
51H 54H 44H QTD
dant CPU, Universal model QCPU, and LCPU)
Breakdown history data (For High Performance model QCPU, Process CPU, and
51H 46H 44H QFD
Redundant CPU)
51H 53H 54H QST SP.DEVST/S.DEVLD instruction file (for Universal model QCPU and LCPU)

Tab. A-59: Special registers (1): Diagnostic information

A – 160
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD5 (5) Reason(s) for system switching
SD6 Number Meaning
SD5 System switching cause *
SD7
SD6 Control system switching instruction argument
SD8 SD7
SD8
SD9 SD9
SD10
SD10
SD11 Vacant
SD11 SD12
SD13
SD12
SD14

SD13 SD15

SD14 * Following shows the description:

0: No system switching condition (default)


1: Power-OFF, reset, hardware failure, S
Error common information watchdog timer error New QnPRH
2: Stop error (except watchdog timer error)
(Error)
3: System switching request by network
module
16: Control system switching instruction
17: Control system switching request from
programming tool.

(6) Reason(s) for tracking size excess error


SD15 The following shows block Nos. when data size that
can be tracked (100K) is exceeded in the bit pattern of
the corresponding special relay.
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1
SD5 (SM1535) 0 0 0 0 0 0 (SM1528) 0 0 0 0 0 0 0 (SM1520)
(Block16) (Block9) (Block1)

SD6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

SD7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 1
SD8 (SM1583) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (SM1568)
(Block64) (Block49)

SD9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

SD15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Tab. A-59: Special registers (1): Diagnostic information

Programming MELSEC System Q and L series A – 161


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD5 (7) Base No./power supply No.
SD6 Number Meaning

SD7 SD5 Base No.


SD6 Power supply No.
SD8 SD7
SD8
SD9
SD9
SD10 SD10 Qn(H) 1)
SD11 Vacant QnPH 1)
SD11 SD12
SD13
QnPRH
SD12
SD14 QnU 2)
SD13 SD15

SD14
1: Power supply 1 fault
2: Power supply 2 fault
Redundant power supply module mounted on POWER
1 resp. POWER 2 slot of redundant base unit (Q38RB,
Q68RB, Q65WRB)
(8) Tracking transmission data classification
This register stores a data type during tracking.
Number Meaning
S
Error common information SD5 Data type * New
SD6 (Error)
SD7
SD8
SD9
SD10
Vacant
SD11
SD12
SD13
SD14
SD15 SD15

* Description of data type: QnPRH


Each bit
b15 b14 ... b6 b5 b4 b3 b2 b1 b0 0: Not sent
0 1: Being sent

Device data

Signal flow

PIDINIT/S.
PIDINIT
instruction data
SFC execution
data
System switching
request
Operation mode
change request
System data

Tab. A-59: Special registers (1): Diagnostic information

A – 162
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD16  Individual information corresponding to the error codes
(SD0) is stored here.
SD17  The following eight types of information are stored
here.
SD18
 The error individual information type can be determined
SD19 by "individual information category code" stored in SD4.
(Values stored in "individual information category code"
SD20 correspond to the following (1) to (8), (12) and (13).
(1) Empty
SD21
(2) File name/Drive name
SD22 Example:
File name = ABCDEFGH.IJK
SD23
Number Meaning
SD24 Drive

SD25 b15 b0
File name
(ASCII code: 8 B A
characters)
D C
F E
Extension 1)
(ASCII code: 3 characters) H G
I .
K J
Vacant

(3) Time (value actually measured)


Number Meaning
SD16 Time: 1µs-steps (0 to 999 µs)

SD17 Time: 1ms-steps (0 to 65535 ms)


S QCPU
Error individual information SD18 New
SD19
(Error) LCPU
SD20
SD21 Vacant
SD22
SD23
SD24
SD25
SD26
SD26

(4) Program error location


Number Meaning

SD16
SD17 File name
(ASCII code: 8 characters)
SD18
SD19
SD20 Extension 1) 2E H (.)
SD21 (ASCII code: 3 characters)
SD22 Pattern *

SD23 Block No.

SD24 Step / transition No.

SD25 Sequence step No. (L)


Sequence step No. (H)
SD26

* Contents of pattern data


15 14 4 3 2 1 0 ( Bit Nr. )
0 0 0 0 * * *
SFC block designation present (1) / absent (0)
not used SFC step designation present (1) / absent (0)
SFC transiton designation present (1) / absent (0)
1)For extension names, refer to table on page A-160.

Tab. A-59: Special registers (1): Diagnostic information

Programming MELSEC System Q and L series A – 163


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
(5) Parameter number
(6) Annunciator number
(7) CHK instruction malfunction number

Number Meaning Number Meaning


SD16 Parameter No.* SD16 No.

SD17 SD17
SD18 SD18
SD19 SD19
SD20 SD20
SD21 SD21
Vacant Vacant
SD22 SD22
SD23 SD23
SD24 SD24
SD25 SD25
SD26 SD26

* For details of the parameter No., refer to the following: User's


Manual (Function Explanation, Program Fundamentals) for the
CPU module used

(8) Reason(s) for system switching failure


Number Meaning
SM16 System switching prohibition condition *
S QCPU
SD26 Error individual information SM17 New
(Error) LCPU
SM18
SM19
SM20
SM21
SM22 (Vacant)
SM23
SM24
SM25
SM26

* Following shows the description:

0: Normal switching completion (default)


1: Tracking cable fault (cable removal, cable fault, internal circuit
fault, hardware fault)
2: Hardware failure, power OFF, reset or watchdog timer error
occurring in standby system
3: Hardware failure, power OFF, reset or watchdog timer error
occurring in control system
4: Preparing for tracking
5: Time limit exceeded
6: Standby system is in stop error (except watchdog timer error)
7: Operation differs between two systems (in backup mode only)
8: During memory copy from control system to standby system
9: Online program change
10: Error detected by network module of standby system
11: System switching being executed
12: Online module change in progress

Tab. A-59: Special registers (1): Diagnostic information

A – 164
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
(9) Failure information

Number Meaning
SM16 Failure information 1
SM17 Failure information 2
SM18 Failure information 3
SM19 Failure information 4 S
SM20 Failure information 5 LCPU
(Error)
SM21 Failure information 6
SM22 Failure information 7
SM23 Failure information 8
SM24 Failure information 9
SM25 Failure information 10
SM26 Failure information 11

(12) File diagnostic information

Number Meaning
SM16 Failure information (H) Drive No. (L)
SM17
SM18 File name
SM19 (ASCII: 8 characters)
SM20 QnU
SD26 Error individual information SM21 Extension 1) 2EH(.) New LCPU
SM22 (ASCII: 3 characters)
SM23 Failure information 2
SM24 (CRC value that is read)
SM25 Failure information 3
SM26 (CRC value that is calculated)

1)For extension names, refer to table on page A-160.


U
* (13) Parameter No./CPU No.

Number Meaning
SM16 Parameter No. *
SM17 CPU No. (1 to 4)
SM18
SM19
SM20
SM21 QnU
SM22 (Vacant)
SM23
SM24
SM25
SM26

* For details of the parameter No., refer to the following: User's Manual
(Function Explanation, Program Fundamentals) for the CPU module used

Error number that QCPU


SD50 Error reset Stores error number that performs error reset U New
performs error reset LCPU
All corresponding bits go ON when battery voltage drops.
Subsequently, these remain ON even after battery voltage
has been returned to normal.
b15 ... b3 b2 b1 b0
0
Battery error for CPU
Bit pattern indicating module QCPU
Battery low S
SD51 where battery voltage SRAM card battery alarm New
latch (Error) LCPU
drop occurred SRAM card battery error

Bits 1 and 2 are not available for the Basic model QCPU and
LCPU.
If an alarm occurs, data can be held within the time speci-
fied for battery low.
The error indicates full discharge of a battery.

Tab. A-59: Special registers (1): Diagnostic information

Programming MELSEC System Q and L series A – 165


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
 Same configuration as SD51 above
Bit pattern indicating  After an alarm is detected (the alarm bit turns on), the QCPU
alarm bit turns off if an error is detected (the error bit S
SD52 Battery low where battery voltage turns on). (Universal model QCPU only) New
(Error) LCPU
drop occurred  Subsequently, goes OFF when battery voltage is
restored to normal.
 A value stored in this register is incremented by 1
whenever the input voltage falls to or below 85% (AC
AC DOWN Number of times for power)/65% (DC power) of the rating during operation S QCPU
SD53 of the CPU module. D9005
detection AC DOWN  The counter repeats increment and decrement of the (Error) LCPU
value;
(0 ==> 32767 ==> -32768 ==> 0)
Blown fuse Number of module Value stored here is the lowest station number of the mod- S
SD60 D9000 QCPU
number with blown fuse ule with the blown fuse, divided by 16. (Error)
I/O module I/O module QCPU
The lowest number of the module where the I/O module S
SD61 verification verification error D9002
verification number took place. (Error) LCPU
error module number
S
SD62 Annunciator number The first annunciator number to be detected is stored here. (Instruction D9009
execution) QCPU
S LCPU
SD63 Number of annunciators Stores the number of annunciators searched. (Instruction D9124
execution)
SD64 When F goes ON due to OUT F or SET F, the F numbers D9125
which go progressively ON from SD64 through SD79 are
SD65 D9126
registered.
SD66 F numbers turned OFF by RST F are deleted from SD64 to D9127
SD79, and are shifted to the data register following the data
SD67 register where the deleted F numbers had been stored. D9128
SD68 Execution of the LEDR instruction shifts the contents of D9129
SD64 to SD79 up by one.
SD69 After 16 annunciators have been detected, detection of the D9130
SD70 17th will not be stored from SD64 through SD79. D9131
SD71 D9132
SET SET SET SET SET SET SET SET SET SET SET
F50 F25 F19 F25 F15 F70 F65 F38 F110 F151F210 LEDR
SD72
Table of Number
SD74 detected S QCPU
detected Annunciator Number of (Instruction
SD75 annunciator detection number annunciators LCPU
detected execution)
numbers
SD76
SD77
SD78
New
Number
detected

SD79

S Qn(H)
Error codes detected by the CHK instruction are stored as
SD80 CHK number (Instruction New QnPH
BCD code.
execution) QnPRH

Tab. A-59: Special registers (1): Diagnostic information

A – 166
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD81 This register stores a continuation error cause

b15 b12 b11 b8 b7 b4 b3 b0


SD81

SP.UNIT DOWN
AC/DC DOWN
BATTERY ERROR
FLASH ROM ERROR
SP.UNIT ERROR
ICM.OPE.ERROR S
Continuation error cause New LCPU
SD82 FILE OPE.ERROR (Error)
REMOTE PASS.FAIL
SNTP OPE.ERROR
DISPLAY ERROR
OPERATION ERROR
PRG.TIME OVER
F***(Annunciator)
Empty
Empty
Empty

The SD82 bits are all empty.


SD84 This register stores a continuation error to be cleared in bit
pattern.
Continuation error clear U New LCPU
SD85 This register has the same bit pattern as that of SD81 and
SD82.

Tab. A-59: Special registers (1): Diagnostic information

ACPU
Number Name Meaning Description Set by (if set) register Valid
for:
D9
Corresponds to
SD90 D9108
SM90
Corresponds to
SD91 F numbers that are set ON at setting D9109
SM91
value of step transition watchdog
Corresponds to timer and watchdog timer over
SD92 D9110
SM92 errors.
Corresponds to
SD93 D9111
SM93
Step transition
watchdog timer Corresponds to
SD94 F number for timer D9112 Qn(H)
setting value SM94
Setting of timer
set value and time Setting of U QnPH
(Enabled only Corresponds to F-number limit value
SD95 over error (0 to 255) (1 to 255 s, in 1 s steps)
D9113 QnPRH
when SFC SM95
program exists)
Corresponds to Timer is started by turning SM90
SD96 D9114
SM96 through SM99 ON during active step,
Corresponds to and if the transition conditions for the
SD97 relevant steps are not met within the New
SM97
timer limits, the designated annunci-
Corresponds to ator (F) will go ON.
SD98 New
SM98
Corresponds to
SD99 New
SM99

Tab. A-59: Special registers (1): Diagnostic information (continued)

Programming MELSEC System Q and L series A – 167


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Stores the
transmission speed
Transmission K96: 9600 bps, K192: 19.2 kbps, K384: 38.4 kbps,
SD100 specified in the serial New
speed K576: 57.6 kbps, K1152: 115.2 kbps
communication
setting.
Bit 4 = OFF: Without sumcheck Q00/Q01
Bit 4 = ON: With sumcheck
Stores the settings Q00UJ
Communication S
SD101 for serial Bit 5 = OFF: Online program correction disabled New Q00U
settings (power on or reset)
communication Bit 5 = ON: Online program correction enabled Q01U
The other bits have no function. Q02U 4)

Stores the waiting


time specified in the 0: No waiting time
Message
SD102 serial 1 to FH: Waiting time (unit: 10 ms) New
waiting time
communication Default: 0
setting.
K96: 9600 bps, K192: 19.2 kbps, K384: 38.4 kbps,
K576: 57.6 kbps, K1152: 115.2 kbps Qn(H)
CH1 QnPH
transmission Stores the present QnPRH
SD105 This register holds a value stored in RS-232 connection S New
speed setting transmission speed.
(RS-232) even after communication in other than RS-232 connection QnU 3)
is started. (When no connection is made, this register LCPU
stores "1152".)
Stores the data
sending result when
Data sending Stores the error code which occured during transmission S
SD110 the serial New Q00/Q01
result using the serial communication. (Error)
communication is
Q00UJ
used.
Q00U
Stores the data
Q01U
receiving result when
Data receiving Stores the error code which occured when data was S Q02U 4)
SD111 the serial New
result received using the serial communication. (Error)
communication is
used.
This register stores a battery consumption rate.
[Value range]
 1 or 2: Q00UJCPU, Q00UCPU, Q01UCPU, Q02UCPU,
Q03UD(E)CPU, Q04UD(E)HCPU, L02CPU S QnU
SD118 Amount of battery consumption New
 1 to 3: Q06UD(E)HCPU, L26CPU-BT (Status change) LCPU
 1 to 4: Q10UD(E)HCPU, Q20UD(E)HCPU,
Q13UD(E)HCPU, Q26UD(E)HCPU
 1 to 5: Q50UDEHCPU, Q100UDEHCPU
This register stores a value indicating a cause that has the
battery life-prolonging function enabled. While this register
is other than "0", the battery life-prolonging function is ena-
bled.
0: No factor S QnU
SD119 Battery lifeprolonging factor b15 ... b2 b1 b0 1: Factor New
Fixed to 0 (Status change) LCPU
b0: CPU switch setting
b1:
Backup in execution by
latch data backup
function (to standard
ROM)

Tab. A-59: Special registers (1): Diagnostic information (continued)

A – 168
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD130  The number of output modules whose fuses have
blown are input as a bit pattern in units of 16 points. If
SD131 the module numbers are set by parameter, the
parameter-set numbers are stored.
SD132
 Blown fuses of remote station output modules will be
SD133 detected also.
The bit pattern  A set bit is not automatically cleared when the module
SD134 (16 Bit) indicates the with the blown fuse is replaced. The flag is cleared by
modules with a an error reset operation.
SD135 Modules with S
blown fuse. New
blown fuse b15 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
(Error)
SD136 0: No blown fuse SD130 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
(YC0) (Y80)
1: Blown fuse SD131 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
detected (Y1F0) (Y1A)

SD137 SD137 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0
(Y1F30)

Blown fuse at the module with the


head I/O number Y7B0. Q00J/
Q00/
SD150  When the power is turned on, the module numbers of Q01
the I/O modules whose information differs from the
SD151 registered I/O module information are set in this
SD152 register (in units of 16 points). If the I/O module
numbers are set by parameter, the parameter-set
SD153 The bit pattern numbers are stored.
.

(16 Bit) indicates the b15 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0


SD154 modules with 1
I/O module SD150 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

SD155 verification errors. XY80 XY0


S
verification SD151 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 New
0: No I/O XY190 (Error)
SD156 error
verification error
1: I/O verification
error present SD157 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
XYFB0

SD157 Verification error for the module with


the head I/O number X/YFB0.

 Not cleared even if the module is replaced with another


one. The storage value is cleared by clearing the error.
1
The module whose first 5 digits of serial No. is "07032" or higher.
2
The module whose first 5 digits of serial No. is "10042" or higher.
3
This applies to Universal model QCPUs except for the Built-in Ethernet port QCPU.
4
The module whose first 5 digits of serial No. is "10102" or higher.

Tab. A-59: Special registers (1): Diagnostic information (continued)

Programming MELSEC System Q and L series A – 169


Table of special registers Appendix A

A.7.2 System information

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
The CPU switch state is stored in the following format:
b15 b12b11 b8 b7 b4 b3 b0

(3) Free (2) (1)

(1) CPU switch status (0): RUN


(1): STOP Qn(H)
(2): L.CLR QnPH
(2) Memory card Always OFF QnPRH
switch

(3) DIP-Switch b8 to b12 correspond


to SW1 through SW5
of system setting S
switch 1. (Every END New
0: OFF, 1: ON
b13 to b15 are vacant. processing)

The CPU switch state is stored in the following format:


b15 b8 b7 b4 b3 b0

Vacant (2) (1)


Q00J/Q00/
(1) CPU switch (0): RUN
Q01
status (1): STOP
SD200 State of CPU switch (2) Memory card Always OFF
switch

The CPU switch state is stored in the following format:


b15 b8 b7 b4 b3 b0

Vacant (2) (1)

New QnU
(1) CPU switch (0): RUN
status (1): STOP

(2) Memory card Always OFF S


switch
(when
RUN/STOP/
The CPU switch state is stored in the following format: RESET switch
changed)
b15 b8 b7 b4 b3 b0

Vacant (2) (1)


New LCPU
(1) CPU switch status 0: RUN
1: STOP
(2) SD memory card 0: Not usable
switch 1: Usable

Tab. A-60: Special registers (2): System information

A – 170
Appendix A Table of special registers

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
 The following bit patterns are used to store the statuses of
the LEDs of the CPU.
 0: OFF, 1: ON, 2: Flicker
bF bC bB b8 b7 b4 b3 b0

Q00J/Q00/
(8) (7) (6) (5) (4) (3) (2) (1)
S Q01
(Status New Qn(H)
(1): RUN (5): BOOT change)
(2): ERROR (6): Vacant QnPH
(3): USER (7): Vacant QnPRH
(4): BAT.ALARM
(8): MODE (0: OFF, 1: Green, 2: Orange)

For the Basic model QCPU, 3) to 8) are left empty.


Information concerning which of the following states the LEDs
on the CPU are stored in the following bit patterns:
0 is off, 1 is on, and 2 is flicker
b15 b13 b12 b8 b7 b4 b3 b0

SD201 LED status State of CPU-LED (8) (7) (6) (5) (4) (3) (2) (1) S
(Status New QnU
(1): RUN (5): BOOT * change)
(2): ERROR (6): Empty
(3): USER (7): Empty
(4): BAT.ALARM (8): MODE

* For the Q00UJCPU, Q00UCPU, and Q01UCPU, 5) is left


empty.
Information concerning which of the following states the LEDs
on the CPU are stored in the following bit patterns:
0 is off, 1 is on, and 2 is flicker
b15 b13 b12 b8 b7 b4 b3 b0
S
(8) (7) (6) (5) (4) (3) (2) (1)
(Status New LCPU
change)
(1): RUN (5): Empty
(2): ERROR (6): Empty
(3): USER (7): I/O ERR.
(4): BAT.ALARM (8): MODE
Stored bit patterns of LEDs turned off Qn(H)
(Only USER and BOOT* enabled) QnPH
Turned off at 1, not turned off at 0
QnPRH
Bit pattern of LED that is * For the Q00UJCPU, Q00UCPU, and Q01UCPU, the BOOT
SD202 LED off LED cannot be specified. U New QnU
turned off
Stored bit patterns of LEDs turned off
(Only USER enabled) LCPU
Turned off at 1, not turned off at 0

Tab. A-60: Special registers (2): System information

Programming MELSEC System Q and L series A – 171


Table of special registers Appendix A

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
The CPU operating state is stored as indicated in the following
figure:
b15 b12 b11 b8 b7 b4 b3 b0

(2) (1) <N>

(1): Operating state of CPU


0: RUN
2: STOP S D9015
3: PAUSE QCPU
SD203 Operating state of CPU (Every END (format
(2): STOP/PAUSE cause processing) change) LCPU
0: Switch
1: Remote contact
2: Peripheral, computer link, or operation from some
other remote source
3: Internal program instruction
4: Error
Remark: The item detected first is stored.
(However, for the Universal model QCPU and LCPU, the
latest cause after operation status change is stored.)

Tab. A-60: Special registers (2): System information

A – 172
Appendix A Table of special registers

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
The LED display color of the LED status shown in SD201 1) to
8).
b15 b12 b11 b8 b7 b4 b3 b0

1) RUN LED
0: OFF
1: Green

2) ERR. LED
0: OFF
1: Red

3) USER LED
0: OFF
1: Red

4) BAT. LED
QnU
0: OFF
1: Yellow
2: Green
5) BOOT LED*
0: OFF
1: Green
6) Empty

7) Empty

8) MODE LED
0: OFF
1: Green
S
LED display * For the Q00UJCPU, Q00UCPU, and Q01UCPU, 5) is left empty.
SD204 CPU-LED display color (Status New
color
The LED display color of the LED status shown in SD201 1) to change)
8).
b15 b12 b11 b8 b7 b4 b3 b0

1) RUN LED
0: OFF
1: Green

2) ERR. LED
0: OFF
1: Red

3) USER LED
0: OFF
1: Red
LCPU
4) BAT. LED
0: OFF
1: Yellow
2: Green
5) Empty

6) Empty

7) I/O ERR.LED
0: OFF
1: Red
8) MODE LED
0: OFF
1: Green

Tab. A-60: Special registers (2): System information

Programming MELSEC System Q and L series A – 173


Table of special registers Appendix A

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
SD207 Priorities 1 to 4  The priority of the LED indication in the case of an error is D9038
set by a cause number. (For the Basic model QCPU, only D9039
SD208 Priorities 5 to 8 the annunciator (cause number 7) is available.) (format
 For the Universal model QCPU and LCPU, specify whether
to enable or disable LED indication of the error that has change)
priority when an error occurs.
 The setting areas for priorities are as follows:

b15 to b12 b11 to b8 b7 to b4 b3 to b0


SD207 Priority 4 Priority 3 Priority 2 Priority 1
SD208 Priority 8 Priority 7 Priority 6 Priority 5
SD209 Priority 12 Priority 11 Priority 10 Priority 9
(Priority 11 is valid when Redundant CPU is used.) Q00J/ Q00/
(Priority 12 is valid when LCPU is used.) Q01 1)
LED display Qn(H)
priority [Default value] U QnPH
ranking QnPRH
SD207 = 4321H (0000H for Basic model QCPU)
SD209 Priorities 9 to 12 SD208 = 8765H (0700H for Basic model QCPU) New QnU
(0765H for Redundant CPU) LCPU
SD209 = 00A9H (0000H for Basic model QCPU)
(0B09H for Redundant CPU, CBA9H for LCPU)
 No display is made if "0" is set.
 For the Basic model QCPU, the ERR. LED lights up upon
turn-on of the annunciator, if "7" is stored in any of
Priorities 1 to 11.
 For the Basic model QCPU, the ERR. LED does not light up
upon turn-on of the annumciator, if "7" is not stored in any
of Priorities 1 to 11.
However, even if "7" has been set, information concerning
CPU operation stop (including parameter settings) errors
will be indicated by the LEDs without conditions.
The year (last two digits) and month are stored as BCD code at
SD210 as shown below:
Clock data b15 b12 b11 b8 b7 b4 b3 b0
SD210 Example: D9025
(year, month) July 1993 =
9307H
Year Month

The day and hour are stored as BCD code at SD211 as shown
below:

Clock data b15 b12 b11 b8 b7 b4 b3 b0 S/U QCPU


SD211 D9026
(day, hour) Example: (Request) LCPU
31., 10 a.m.
Day = 3110H
Hour

The minutes and seconds (after the hour) are stored as BCD
code at SD212 as shown below:
Clock data b15 b12 b11 b8 b7 b4 b3 b0
SD212 Clock data Example: D9027
(minute, second)
35 min., 48
Minute sec. = 3548H
Second

The day of the week is stored as BCD code at SD213 as shown


below:
b15-------b12 b11-------b8 b7-------b4 b3-------b0
Friday
H0005

Clock data Day of week S/U QCPU


SD213 D9028
(day of the week) Higher
Higherdigits
digits of
of year
0 Sunday (Request) LCPU
(19 or (0
year 20)
to 99) 1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Tab. A-60: Special registers (2): System information

A – 174
Appendix A Table of special registers

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
LED display ASCII data (16 characters) stored here.
For the Basic model QCPU, an error message (up to 16 ASCII
SD220 characters) is stored. (Including a message for the case the
annunciator is on.)
b15 to b8 b7 to b0
15th character from 16th character from
SD221 SD220
the right the right
13th character from 14th character from
SD222 SD221
the right the right
11th character from 12th character from
SD223 SD222
the right the right
9th character from 10th character from S QCPU
SD224 LED display SD223
Display indicator data the right the right (Status New
data LCPU
change)
7th character from 8th character from
SD225 SD224
the right the right
5th character from 6th character from
SD225
the right the right
SD226
3rd character from 4th character from
SD226
the right the right
1st character from 2nd character from
SD227
the right the right
SD227 For the Basic model QCPU, Universal model QCPU or LCPU,
HMI data at the time of CHK instruction execution are not
stored.
Module to
which online (The header I/O number of S
The value of the header I/O number of which the online mod- QnPH
module the module to which online (During online
SD235 ule change is being performed is divided by 10H and stored New
change is module change is being per- module QnPRH
here.
being per- formed)/10H change)
formed
0: Automatic mode S
SD240 Base mode Stores the base mode New
1: Detail mode (Initial)
Number of 0: Basic only QCPU
S
SD241 extension 1 to 7: Number of Stores the number of extension bases being installed New
(Initial)
bases extension bases

Tab. A-60: Special registers (2): System information

Programming MELSEC System Q and L series A – 175


Table of special registers Appendix A

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9

b7 b2 b1 b0

Fixed to 0 to

0: QA**B is Main base


installed 1st expansion base
Qn(H)
A/Q base
(A mode) 2nd expansion base
differentia- QnPH
1: Q**B is
tion to QnPRH
installed
(Q mode) 7th expansion base

When no expansion base is installed, the value for


b1 to b7 is fixed to "0".

b4 b3 b2 b1 b0

Fixed to 0
Main base
1st expansion base S Q00J/Q00/
SD242 New
(Initial) Q01
2nd expansion base

3rd expansion base

4th expansion base

Installed Q Base type differentiation


base 0: Base not installed b7 b2 b1 b0
presence/
1: Q**B is installed
absence Fixed to 0 to
Main base
1st expansion base
2nd expansion base
QnU
to

7th expansion base


 For the Q00UJCPU, the bits for the third to seventh
extension bases are fixed to "0".
 For the Q00UCPU, Q01UCPU, and Q02UCPU, the bits for the
fifth to seventh extension bases are fixed to "0".
The number of slots being installed is stored in the respective
areas for the main base and the extension bases.
SD243
b15 to b12 b11 to b8 b7 to b4 b3 to b0 Qn(H)
SD243 Extension 3 Extension 2 Extension 1 Main
S QnPH
Number of base slots SD244 Extension 7 Extension 6 Extension 5 Extension 4 New
(Initial) QnPRH
 For the Q00UJCPU, the bits for the third to seventh QnU
SD244 extension bases are fixed to "0".
 For the Q00UCPU, Q01UCPU, and Q02UCPU, the bits for
the fifth to seventh extension bases are fixed to "0".
The number of slots being installed is stored in the respective
areas for the main base and the extension bases.
SD243 S Q00J/Q00/
Number of base slots (Operation status) b15 to b12 b11 to b8 b7 to b4 b3 to b0 New
(Initial) Q01
SD243 Extension 3 Extension 2 Extension 1 Main
SD244 Extension 7 Extension 6 Extension 5 Extension 4
SD244
The number of slots where modules are actually mounted is
stored in the area corresponding to each base unit as shown Qn(H)
SD245 below.
S QnPH
Number of base slots (Mounting status) b15 to b12 b11 to b8 b7 to b4 b3 to b0 New
(Initial) QnPRH
SD245 Extension 3 Extension 2 Extension 1 Main
QnU
SD246 SD246 Fixed to 0 Fixed to 0 Fixed to 0 Extension 4

Tab. A-60: Special registers (2): System information

A – 176
Appendix A Table of special registers

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
When SM250 goes from OFF to ON, the upper 2 digits of the S Qn(H)
final I/O number plus 1 of the modules loaded are stored as (Request QnPH
Loaded BIN values. END) QnPRH
SD250 maximum Loaded maximum I/O No. New Q00J/Q00/
I/O The first two digits of the number, which is the last I/O number S Q01
of the mounted modules plus 1, are stored. (Initial) QnU
LCPU
Number of modules Indicates the number of mounted MELSECNET/10 modules or
SD254
installed MELSECNET/H modules.
Indicates the I/O number of mounted MELSECNET/10 mod-
SD255 I/O No.
ules or MELSECNET/H modules.
Indicates the network No. of mounted MELSECNET/10 mod-
SD256 Network No. QCPU
ules or MELSECNET/H modules.
Information
Group Indicates the group number of mounted MELSECNET/10 mod-
SD257 from 1st
Number ules or MELSECNET/H modules.
module
Indicates the station number of mounted MELSECNET/10
SD258 Station No.
modules or MELSECNET/H modules.
MELSECNET/ S
Standby In the case of standby stations, the module number of the New Qn(H)
SD259 10/H infor- (Initial)
mation information standby station is stored. (1 to 4)
QnPH
SD260
Information from 2nd QnPRH
– Configuration is identical to that for the first module.
module QnU 2)
SD264
SD265
Information from 3rd Qn(H)
– Configuration is identical to that for the first module.
module
SD269 QnPH
SD270 QnPRH
Information from 4th
– Configuration is identical to that for the first module. QnU 3)
module
SD274
(3) (2) (1)

b15 b12 b11 b8 b7 b4 b3 b0


Vacant
1st module
2nd module
3rd module
4th module

Qn(H)
(1) When Xn0 of the installed CC-Link module goes ON, the S
SD280 bit corresponding to the station switches ON. New QnPH
(error)
(2) When either Xn1 or XnF of the installed CC-Link module QnPRH
switch OFF, the bit corresponding to the station switches
ON.
(3) Switches ON when the CPU cannot communicate with
the installed CC-Link module.
The above modules are numbered in order of the head I/O
numbers. (However, the one where parameter setting has not
been made is not counted.)
CC-Link error Error detection status (3) (2) (1)
b15 ... b12 b11 ... b8 b7 ... b4 b3 ... b0

5th module

6th module
7th module

8th module
Qn(H) 4)
S
SD281 (1) When Xn0 of the installed CC-Link module goes ON, the New QnPH 4)
(error)
bit corresponding to the station switches ON. QnPRH 5)
(2) When either Xn1 or XnF of the installed CC-Link module
switch OFF, the bit corresponding to the station switches
ON.
(3) Switches ON when the CPU cannot communicate with
the installed CC-Link module.
The above modules are numbered in order of the head I/O
numbers. (However, the one where parameter setting has not
been made is not counted.)

Tab. A-60: Special registers (2): System information

Programming MELSEC System Q and L series A – 177


Table of special registers Appendix A

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
SD286 Points assigned to M  The number of points assigned to M is stored with 32 bits.
SD287 Device (for extension)  The number of 32k or less points can be assigned to M. S QnU 6)
New
SD288 assignment Points assigned to B  The number of points assigned to B is stored with 32 bits. (Initial) LCPU
SD289 (for extension)  The number of 32k or less points can be assigned to B.
Number of points
SD290 Stores the number of points currently set for X
allocated for X
Number of points
SD291 Stores the number of points currently set for Y
allocated for Y
Number of points
SD292 Stores the number of points currently set for M
allocated for M
Number of points
SD293 Stores the number of points currently set for L
allocated for L
Number of points
SD294 Stores the number of points currently set for B
allocated for B
Number of points
SD295 Stores the number of points currently set for F
allocated for F
Number of points
SD296 Device allo- Stores the number of points currently set for SB
allocated for SB
cation QCPU
Number of points S
SD297 (Same as Stores the number of points currently set for V New
allocated for V (Initial) LCPU
parameter
contents) Number of points
SD298 Stores the number of points currently set for S
allocated for S
Number of points
SD299 Stores the number of points currently set for T
allocated for T
Number of points
SD300 Stores the number of points currently set for ST
allocated for ST
Number of points
SD301 Stores the number of points currently set for C
allocated for C
Number of points
SD302 Stores the number of points currently set for D
allocated for D
Number of points
SD303 Stores the number of points currently set for W
allocated for W
Number of points
SD304 Stores the number of points currently set for SW
allocated for SW
Device
Stores the number of points of index register (Z) used for the QnU
assignment 16-bit modification Number
SD305 16-bit modification area. (Depending on the index modifica-
(Index regis- of points assigned for Z LCPU
tion setting for ZR in the parameter setting.)
ter)
SD306 Device The number of points for ZR is stored (except the number of
assignment points of extended data register (D) and extended link register
Number of points assigned
(Same as (W)). The number of points assigned to ZR is stored into this
SD307 for ZR (for extension)
parameter register only when 1k point or more is set for the extended
contents) data register (D) or extended link register (W).
SD308 Device Number of points assigned The total points of the data register (D) in the internal device S (Initial) New
assignment for D (for inside + for exten- memory area and the extended data register (D) are stored as
SD309 (assignment sion) a 32-bit binary value. QnU 7)
SD310 including the LCPU
number of
points set to
the extended Number of points assigned The total points of the link register (W) in the internal device
data register for W (for inside + for exten- memory area and the extended link register (W) are stored as
SD311 sion) a 32-bit binary value.
(D) and
extended link
register (W))
 Reserves the designated time for communication
processing with a programming tool or other units.
Q00J/Q00/
Time  The greater the value is designated, the shorter the
reserved for response time for communication with other devices Q01
Time reserved for commu- (programming tool, serial communication units)
SD315 communica- U New Qn(H)
nication processing becomes.
tion process-  Setting range: 1 to 100 ms. QnPH
ing If the specified value is out of range, it is assumed to no
QnPRH
setting.
The scan time becomes longer by the specified time.

Tab. A-60: Special registers (2): System information

A – 178
Appendix A Table of special registers

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
Online
change
(inactive  While online change (inactive block) is executed (SM329 S
SD329 SFC block number is on.), this register stores the target SFC block number. (Status New QnU 8)
block) target  In other than the above status, this register stores FFFFH. change)
block
number
Number of modules
SD340 Indicates the number of modules installed on Ethernet.
installed
I/O
SD341 Ethernet I/O number of the first module installed.
number
Network
SD342 Ethernet network number of the first module installed. QCPU
number
Group
SD343 Ethernet group number of the first module installed.
Information number
from 1st Station
SD344 module Ethernet station number of the first module installed.
number
SD345
Ethernet Vacant (the Ethernet IP adress of the first module is stored in S
and Vacant New
information buffer memory. (Initial) Qn(H)
SD346
Vacant (the Ethernet error code of the first module is read QnPH
SD347 Vacant
with the ERRRD instruction. QnPRH
SD348 QnU 2)
Information from 2nd
to Configuration is identical to that for the first module.
module
SD354
SD355
Information from 3rd Qn(H)
to Configuration is identical to that for the first module.
module QnPH
SD361
SD362 QnPRH
Information from 4th
to Configuration is identical to that for the first module. QnU 3)
module
SD368

b15 b8 b7 b6 b5 b4 b3 b1 b0
0 … 0
Not used Status of channel 1
Status of channel 2
Status of channel 3
Instruction reception status Status of channel 4
SD380 Status of channel 5
of the 1st module
Status of channel 6
Ethernet Status of channel 7
instruction Status of channel 8 S
New QnPRH
reception ON: Received (Channel is used) (Initial)
status OFF: Not received (Channel is not used)

Instruction reception status


SD381 Configuration is identical to that for the first module.
of the 2nd module
Instruction reception status
SD382 Configuration is identical to that for the first module.
of the 3rd module
Instruction reception status
SD383 Configuration is identical to that for the first module.
of the 4th module

Tab. A-60: Special registers (2): System information

Programming MELSEC System Q and L series A – 179


Table of special registers Appendix A

ACPU
Number Name Meaning Description Set by register Valid for:
(if set)
D9
The number of CPU modules that comprise the multiple CPU Q00/Q01 1)
SD393 Number of multiple CPUs
system is stored. (1 to 3, Empty also included) QnU
This register stores information on the CPU module types of
CPU No.1 to No.3 and whether or not the CPU modules are
mounted.

b15 .... b12 b11 ..... b8 b7 ..... b4 b3 .... b0


SD394 Vacant (0) CPU No. 3 CPU No. 2 CPU No. 1 S
New
(Initial)
SD394 CPU mounting information Q00/Q01 1)

CPU module mounted CPU module type


or not mounted
0: Programmable
0: Not mounted controller CPU
1: Mounted 1: Motion CPU
2: PC CPU
Multiple CPU
system infor- Q00/Q01 1)
mation Stores the number of the CPU when operated in a multi-CPU QnH
S
SD395 Multiple CPU number system. New
(Initial) QnPH
1: CPU No. 1; 2: CPU No. 2; 3: CPU No. 3; 4: CPU No. 4
QnU
The operation information of each CPU No. is stored. (The Q00/Q01 1)
SD396 CPU No. 1 operation status information on the number of multiple CPUs indicated in New
QnU
SD393 is stored.)
Q00/Q01 1)
SD397 CPU No. 2 operation status New
b15 b14 ...
Vacant
b8 b7 ... b4 b3
Classification
... b0
Operation status QnU 7)
SD398 CPU No. 3 operation status S New
0: Not mounted (END
1: Mounted processing
error)
0: Normal 0: RUN
1: Minor fault 2: STOP
QnU 3)
SD399 CPU No. 4 operation status New
2: Medium fault 3: PAUSE
3: Major fault 4: Initial
FH: Reset FH: Reset

Tab. A-60: Special registers (2): System information


1
Function version is B or later.
2
The Universal model QCPU except the Q00UJCPU, Q00UCPU, and Q01UCPU.
3
The Universal model QCPU except the Q00UJCPU, Q00UCPU, Q01UCPU, and Q02UCPU.
4
The module whose first 5 digits of serial No. is "08032" or higher.
5
The module whose first 5 digits of serial No. is "09012" or higher.
6
The module whose first 5 digits of serial No. is "10042" or higher.
7
The Universal model QCPU except the Q00UJCPU.
8
This applies when the first five digits of the serial number is "12052" or higher.

A – 180
Appendix A Table of special registers

A.7.3 System clocks/counters

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Following programmable controller CPU RUN, 1 is added each
1 second Number of counts S
SD412 second. D9022
counter in 1-second units (Status change) QCPU
Count repeats from 0 to 32767 to -32768 to 0.
LCPU
n = 1 second 2n second clock Stores value n of 2n second clock (Default is 30).
SD414 U New
steps units Setting can be made between 1 and 32767.
Stores value n of 2n ms clock (Default is 30). Qn(H)
SD415 n = 1 ms steps 2n ms clock units U New
Setting can be made between 1 and 32767.
QnPH
Incremented by 1 for each scan execution after the PC CPU is set QnPRH
to RUN. (Not incremented for each scan of an initial execution
QnU
type program.) S
Number of counts Count repeats from 0 to 32767 to -32768 to 0. LCPU
SD420 Scan counter (Every END New
in each scan
Incremented by 1 for each scan execution after the PC CPU is set processing)
Q00J/Q00
to RUN.
/Q01
Count repeats from 0 to 32767 to -32768 to 0.
Incremented by 1 for each scan execution after the PC CPU is set
S Qn(H)
Low speed scan Number of counts to RUN.
SD430 (Every END New
counter in each scan Count repeats from 0 to 32767 to -32768 to 0. QnPH
processing)
Used only for low speed execution type programs.

Tab. A-61: Special registers (3): System clocks/counters

Programming MELSEC System Q and L series A – 181


Table of special registers Appendix A

A.7.4 Scan information

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Qn(H)
QnPH
Program number of program currently being executed is stored as S
SD500 Execution program No. New QnPRH
BIN value. (Status change)
QnU
LCPU
Program number of low speed program currently being executed is S QnH
SD510 Low speed program No. stored as BIN value. (Every END New
Enabled only when SM510 is ON. processing) QnPH

D9018
Current scan time Stores current scan time (in 1 ms units)
SD520 (format
(ms value) Range from 0 to 65535
change)
Stores current scan time (in 100 μs units, in increments of 1µs for
the Universal model QCPU and LCPU) S QCPU
Current scan
Range from 0 to 900 (0 to 999 for the Universal model QCPU and (Every END
time LCPU
Current scan time LCPU). processing)
SD521 New
(μs value) (Example)
A current scan of 23.6 ms would be stored as follows:
D520 = 23
D521 = 600
Initial scan time Stores scan time for first scan (in 1 ms units). Qn(H)
SD522
(ms value) Range from 0 to 65535
S QnPH
Initial scan Stores scan time for first scan (in 100 μs units, in increments of 1µs (First END New QnPRH
time Initial scan time for the Universal model QCPU and LCPU).
SD523 processing) QnU
(μs value) Range from 0 to 900 (0 to 999 for the Universal model QCPU and
LCPU). LCPU
Minimum scan
Stores minimum value of scan time (in 1 ms units).
SD524 time
Range from 0 to 65535 S
Minimum scan (ms value)
(Every END
time Minimum scan
Stores minimum value of scan time (in 100 μs units). processing)
SD525 time
Range from 0 to 900 Q00J/
(μs value)
New Q00/
Maximum scan Stores meximum value of scan time, excepting the first scan. (in 1 Q01
SD526 time ms units).
S
Maximum scan (ms value) Range from 0 to 65535
(Every END
time Maximum scan Stores maximum value of scan time, excepting the first scan. (in processing)
SD527 time 100 μs units).
(μs value) Range from 0 to 900
Minimum scan Stores minimum value of scan time except that of an initial execu- D9017
SD524 time tion type program (in 1 ms units). (format
(ms value) Range from 0 to 65535 change)
S
Minimum scan Stores minimum value of scan time except that of an initial execu- (Every END
time Minimum scan tion type program (in 100 μs units; in increments of 1µs for the Uni- processing)
SD525 time versal model QCPU and LCPU). New Qn(H)
(μs value) Range from 0 to 900
QnPH
(0 to 999 for the Universal model QCPU and LCPU)
QnPRH
Maximum scan Stores maximum value of scan time, except that of an initial execu- D9019
QnU
SD526 time tion type program (in 1 ms units). (format
(ms value) Range from 0 to 65535 change) LCPU
S
Maximum scan Stores maximum value of scan time, except that of an initial execu- (Every END
time Maximum scan tion type program (in 100 μs units, in increments of 1µs for the Uni- processing)
SD527 time versal model QCPU and LCPU).). New
(μs value) Range from 0 to 900
(0 to 999 for the Universal model QCPU and LCPU)

Tab. A-62: Special registers (4): Scan information

A – 182
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Stores current scan time for low speed execution type program (in 1
Current scan time
SD528 For low speed (ms value) ms units).
Range from 0 to 65535 S
execution type
(Every END New
programs cur- Stores current scan time for low speed execution type program (in processing)
SD529 rent scan time Current scan time 100 μs units).
(μs value)
Range from 0 to 900
Minimum scan Stores minimum value of scan time for low speed execution type
SD532 Minimum scan time program (in 1 ms units).
time for low (ms value) Range from 0 to 65535 S Qn(H)
speed execu- (Every END New
tion type pro- Minimum scan Stores minimum value of scan time for low speed execution type processing) QnPH
SD533 grams time program (in 100 μs units).
(μs value) Range from 0to 900
Stores the maximum scan time for all except low speed execution
Maximum scan Maximum scan
SD534 type program’s first scan (in 1 ms units).
time for low time (ms value) S
Range from 0 to 65535
speed execu- (Every END New
tion type pro- Maximum scan Stores the maximum scan time for all except low speed execution processing)
SD535 grams time type program’s first scan (in 100 μs units).
(μs value) Range from 0 to 900
Stores time from completion of scan program to start of next scan
END processing
SD540 (in 1 ms units).
time (ms value) S Q00J/
END process- Range from 0 to 65535
(Every END New Q00/
ing time END processing Stores time from completion of scan program to start of next scan processing) Q01
SD541 time (in 100 μs units).
(μs value) Range from 0 to 900
Stores time from completion of scan program to start of next scan
END processing
SD540 (in 1 ms units). Qn(H)
time (ms value)
Range from 0 to 65535
S QnPH
END process- Stores time from completion of scan program to start of next scan (Every END New QnPRH
ing time END processing (in 100 μs units, in increments of 1µs for the Universal model QCPU processing) QnU
SD541 time and LCPU).
(μs value) Range from 0 to 900 LCPU
(0 to 999 for the Universal model QCPU and LCPU)
Stores wait time when constant scan time has been set (in 1 ms
Constant scan wait
SD542 units).
time (ms value)
Range from 0 to 65535
S QCPU
Constant scan Stores wait time when constant scan time has been set (in 100 μs (First END New
wait time units, in increments of 1µs for the Universal model QCPU and LCPU
Constant scan wait processing)
SD543 LCPU).
time (μs value)
Range from 0 to 900
(0 to 999 for the Universal model QCPU and LCPU)
Cumulative execu- Stores cumulative execution time for low speed execution type pro-
tion time for low grams (in 1 ms units).
SD544 speed execution Range from 0 to 65535
Cumulative type programs Cleared to 0 after the end of one scan of a low-speed execution type
execution time (ms value) program. S
for low speed Cumulative execu- (Every END New
execution type tion time for low Stores cumulative execution time for low speed execution type pro- processing)
programs grams (in 100 μs units).
speed execution
SD545 Range from 0 to 900
type
programs Cleared to 0 after the end of one scan of a low-speed execution type Qn(H)
program. QnPH
(μs value)
Execution time for Stores low speed program execution time during 1 scan (in 1 ms
low speed execu- units).
SD546
Execution time tion type programs Range from 0 to 65535
S
for low speed (ms value) Stores each scan
(Every END New
execution type Execution time for Stores low speed program execution time during 1 scan (in 100 μs
processing)
programs low speed execu- units).
SD547
tion type programs Range from 0 to 900
(μs value) Stores each scan

Tab. A-62: Special registers (4): Scan information

Programming MELSEC System Q and L series A – 183


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Stores execution time for scan execution type program during 1
Scan program exe- scan (in 1 ms units).
SD548 cution time
Range from 0 to 65535
(ms value) Q00J/
Stores each scan
S Q00/
Scan program Stores execution time for scan execution type program during 1 Q01
(Every END New
execution time scan (in 100 μs units, in increments of 1µs for the Universal model
Scan program exe- QCPU and LCPU). processing) QnU
SD549 cution time LCPU
Range from 0 to 900
(μs value)
(0 to 999 for the Universal model QCPU and LCPU)
Stores each scan
Stores execution time for scan execution type program during 1
Scan program exe- scan (in 1 ms units).
SD548 cution time
Range from 0 to 65535
(ms value) S Qn(H)
Scan program Stores each scan
(Every END New QnPH
execution time Stores execution time for scan execution type program during 1
Scan program exe- scan (in 100 μs units). processing) QnPRH
SD549 cution time
Range from 0 to 900
(μs value)
Stores each scan
Service interval
SD550 measurement Unit/module No. Sets I/O number for module that measures service interval. U New
module
Module service When SM551 is ON, stores service interval for module designated Qn(H)
SD551 interval by SD550 (in 1 ms units). QnPH
Service inter- (ms value) Range from 0 to 65535 S QnPRH
New
val time Module service When SM551 is ON, stores service interval for module designated (Request)
SD552 interval by SD550 (in 100 μs units).
(μs value) Range from 0 to 900

Tab. A-62: Special registers (4): Scan information

A – 184
Appendix A Table of special registers

A.7.5 Memory cards

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Indicates type of memory card installed.
b15 b8 b7 b4 b3 b0
0 0
Qn(H)
S QnPH
Drive 1 0: Does not exist (Initial and card New
(RAM) 1: SRAM QnPRH
removal)
Drive 2 QnU
0: Does not exist
(ROM) (1: SRAM)
2: ATA FLASH
3: FLASH ROM

SD600 Memory card models


Indicates type of memory card installed.

b15 b8 b7 b4 b3 b0
0 0
S
Drive 1 0: Does not exist (Initial and card New LCPU
(RAM) (Fixed
1: SRAMto 0) removal)
Drive 2 0: Does not exist
(ROM) 4: SD memory
card
2: EEPROM
3: FLASH ROM

S
SD602 Drive 1 (RAM) capacity Drive 1 capacity is stored in 1 k byte units (Initial and card New
removal) Qn(H)
Drive 2 capacity is stored in 1 k byte units QnPH
S QnPRH
SD603 Drive 2 (ROM) capacity For the Q2MEM-8MBA, a value stored to this register depends on the (Initial and card New
product control number of the ATA card. For details, refer to the fol- QnU 2)
removal)
lowing manual: User's Manual (Hardware Design, Maintenance and
Inspection) for the CPU module used

Tab. A-63: Special registers (5): Memory cards

Programming MELSEC System Q and L series A – 185


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
The use conditions for memory card are stored as bit patterns (in
use when ON).
The significance of these bit patterns is indicated below:

b0: Boot operation (QBT) b8: Not used


b1: Parameters (QPA) b9: CPU fault history (QFD) Qn(H)
b2: Device comments (QCD) b10: Not used S
New QnPH
b3: Device initial value (QDI) b11: Local device (QDL) (Status change)
QnPRH
b4: File register (QDR) b12: Not used
b5: Sampling trace (QTD) b13: Not used
b6: Not used b14: Not used
b7: Not used b15: Not used

The use conditions for memory card are stored as bit patterns (in
use when ON).
The significance of these bit patterns is indicated below:

b0: Boot operation (QBT) 1) b8: Not used


b1: Parameters (QPA) b9: Not used
b2: Device comments (QCD) b10: Not used
b3: Device initial value (QDI) 2) b11: Local device (QDL)
b4: File register (QDR) b12: Not used S
b5: Sampling trace (QTD) b13: Not used New QnU 2)
(Status change)
b6: Not used b14: Not used
b7: Backup data (QBP) 3) b15: Not used
SD604 Memory card use conditions
1
This bit turns on at boot start and turns off at the completion.
2 This bit turns on when the writing of initial device values is started and
turns off at the completion.
3 This bit can be used when the first five digits of the serial No. is "10102"
or higher.
The use conditions for memory card are stored as bit patterns (in
use when ON).
The significance of these bit patterns is indicated below:

b0: Boot operation (QBT) 1) b8: Not used


b1: Parameters (QPA) b9: Not used
b2: Device comments (QCD) b10: Not used
b3: Device initial value (QDI) 2) b11: Local device (QDL) 3)
b4: File register (QDR) 3) b12: Not used
b13: Data logging setting S
b5: Sampling trace (QTD) New LCPU
(QLG) 4) (Status change)
b6: Not used b14: Not used
b7: Backup data (QBP) b15: Not used

1
This bit turns on at boot start and turns off at the completion.
2
This bit turns on when the writing of initial device values is started and
turns off at the completion.
3
Fixed at "0".
4
This bit turns on when data logging setting is registered and turns off
at the completion or stop of data logging.
Drive 2 storage
SD606 capacity (lower
Drive 2 (Memory bits) S
These registers store the drive 2 storage capacity (unit: 1M byte).
card ROM) (Initial and card New LCPU
Drive 2 storage (Free space value after formatting is stored.)
capacity removal)
SD607 capacity (upper
bits)

Tab. A-63: Special registers (5): Memory cards

A – 186
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Free space in drive
SD616 Free space in 2 (lower bits) S
drive 2 (Mem- These registers store free space value in the drive 2 (unit: 1M byte). New LCPU
ory card ROM) Free space in drive (Status change)
SD617
2 (upper bits)
Indicates usage status of drives 3 and 4:
b15 ... b8 b7 ... b4 b3 ... b0
0

Drive 3 0: Absent Q00J/


S
Standard 1: Present New Q00/
RAM (Initial)
Q01
Drive 4 3 (Flash ROM)
Standard
ROM

SD620 Drive 3/4 types


Indicates usage status of drives 3 and 4:
b15 ... b8 b7 ... b4 b3 ... b0
0 Qn(H)
QnPH
Drive 3 Fixed to 1 * S
Standard New QnPRH
RAM (Initial)
QnU
Drive 4 Fixed to 3
Standard LCPU
ROM

* For the Q00UJCPU, the drive 3 (Standard RAM) type is fixed at "0".

Q00J/
Drive 3 capacity is stored in 1k byte units Q00/
Q01

S Qn(H)
SD622 Drive 3 (RAM) capacity New QnPH
(Initial)
Drive 3 capacity is stored in 1k byte units.
QnPRH
(Free space value after formatting is stored.)
QnU
LCPU
Q00J/
Drive 4 capacity is stored in 1k byte units Q00/
Q01

S Qn(H)
SD623 Drive 4 (ROM) capacity New
(Initial) QnPH
Drive 4 capacity is stored in 1k byte units.
QnPRH
(Free space value after formatting is stored.)
QnU
LCPU

Tab. A-63: Special registers (5): Memory cards

Programming MELSEC System Q and L series A – 187


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
The use conditions for drives 3 and 4 are stored as bit patterns
b15 ... b5 b4 ... b0
0 0 0 0 0 0
Q00J/
Boot operation (QBT)
Q00/
0: Not used Q01
1: In use
File register (QDR)
0: Not used 1: In use

The use conditions for drives 3 and 4 are stored as bit patterns
(In use when ON)
The significance of these bit patterns is indicated below:
b0: Boot operation (QBT) b8: Not used
b1: Parameters (QPA) b9: CPU fault history (QFD) Qn(H)
b2: Device comments (QCD) b10: Not used QnPH
b3: Device initial value (QDI) b11: Local device (QDL) QnPRH
b4: File register (QDR) b12: Not used
b5: Sampling trace (QTD) b13: Not used
b6: Not used b14: Not used
b7: Not used b15: Not used

The use conditions for drives 3 and 4 are stored as bit patterns (in
use when ON).
The significance of these bit patterns is indicated below:

b0: Not used b8: Module error log 2)


b1: Parameters (QPA) b9: Not used
b2: Device comments (QCD) b10: Not used
SD624 S
Drive 3 and 4 use conditions b3: Device initial value (QDI) 1) b11: Local device (QDL) (Status change)
New
b4: File register (QDR) b12: Not used QnU
b5: Sampling trace (QTD) b13: Not used
b6: Not used b14: Not used
b7: Not used b15: Not used
1
This bit turns on when the writing of initial device values is started
and turns off at the completion.
2
This bit can be used when the first five digits of the serial No. is "11043"
or higher.
The use conditions for drives 3 and 4 are stored as bit patterns (in
use when ON).
The significance of these bit patterns is indicated below:

b0: Not used b8: Module error log


b1: Parameters (QPA) b9: Not used
b2: Device comments (QCD) b10: Not used
b3: Device initial value (QDI) 1) b11: Local device (QDL)
b4: File register (QDR) b12: Not used LCPU
b13: Data logging setting
b5: Sampling trace (QTD)
(QLG) 2)
b6: Not used b14: Not used
b7: Not used b15: Not used
1 This bit turns on when the writing of initial device values is started
and turns off at the completion.
2 This bit turns on when data logging setting is registered and turns off
at the completion or stop of data logging.

Tab. A-63: Special registers (5): Memory cards

A – 188
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Q00J/
Q00/
Q01
Stores drive number being used by file register. * Qn(H)
S
SD640 File register drive Drive number New
(Status change) 4) QnPH
* For the LCPU, this register is fixed at drive 3.
QnPRH
QnU 3)
LCPU
SD641 Stores file register file name (MAIN.QDR) as ASCII code.
b15 b8 b7 b0

SD641 2nd character (A) 1st character (M)


Q00J/
SD642 4th character (N) 3rd character (I) S
Q00/
SD642 SD643 6th character ( ) 5th character ( ) (Initial)
Q01
SD644 8th character ( ) 7th character ( )
SD645 1st char. of extension (Q) 2EH (.)
SD646 3rd char. of extension (R) 2nd char. of extension (D)

SD643 Stores file register file name (with extension) selected at parameters
or by use of QDRSET instruction as ASCII code.
b15 b8 b7 b0
Qn(H)
SD641 2nd character 1st character
S QnPH
SD642 4th character 3rd character
SD644 File register file name (Status change) New QnPRH
SD643 6th character 5th character
SD644 8th character 7th character QnU 3)
SD645 1st char. of extension 2EH (.)
SD646 3rd char. of extension 2nd char. of extension

SD645 Stores file register file name (with extension) selected at parameters
as ASCII code.
b15 b8 b7 b0

SD641 2nd character 1st character


S
SD642 4th character 3rd character LCPU
SD646 (Status change)
SD643 6th character 5th character
SD644 8th character 7th character
SD645 1st char. of extension 2EH (.)
SD646 3rd char. of extension 2nd char. of extension

Qn(H)
QnPH
S
QnPRH
(Status change)
Stores the data capacity of the currently selected file register in 1 K QnU 3)
SD647 File register capacity New
word units. LCPU
Q00J/
S
Q00/
(Initial)
Q01
Q00J/
Q00/
Q01
Qn(H)
S
SD648 File register block number Stores the currently selected file register block number. D9035
(Status change) 4) QnPH
QnPRH
QnU 3)
LCPU

Tab. A-63: Special registers (5): Memory cards

Programming MELSEC System Q and L series A – 189


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Stores the comment drive number selected at the parameters or by S
SD650 Comment drive New
the QCDSET instruction. (Status change)
SD651 Stores the comment file name (with extension) selected at the
parameters or by the QCDSET instruction in ASCII code. Qn(H)
SD652
QnPH
SD653 b15 b8 b7 b0
QnPRH
SD654 SD651 2nd character 1st character S
Comment file name New QnU
SD652 4th character 3rd character (Status change)
SD655 LCPU
SD653 6th character 5th character
SD654 8th character 7th character
SD656 SD655 1st char. of extension 2EH (.)
SD656 3rd char. of extension 2nd char. of extension
Boot designation Stores the drive number where the boot designation file (*.QBT) is S
SD660 New
file drive number being stored. (Initial)
SD661 Stores the file name of the boot designation file (*.QBT).
Qn(H)
SD662
b15 b8 b7 b0 QnPH
SD663 Boot operation
SD661 2nd character 1st character QnPRH
designation file File name of boot S
SD664 SD662 4th character 3rd character New QnU 2)
designation file (Initial)
SD665
SD663 6th character 5th character LCPU
SD664 8th character 7th character
SD666
SD665 1st char. of extension 2EH (.)
SD666 3rd char. of extension 2nd char. of extension
This register stores the number of a drive where valid parameters
have been stored. *
•0: Drive 0 (program memory)
•1: Drive 1 (SRAM card)
•2: Drive 2 (Flash card/ATA card) QnU
•4: Drive 4 (standard ROM)
S
SD670 Parameter enable drive information * For the Q00UJCPU, Q00UCPU, and Q01UCPU, only drives 0 and 4 New
(Initial)
are parameter-valid drives.
This register stores the number of a drive where valid parameters
have been stored.
•0: Drive 0 (program memory) LCPU
•2: Drive 2 (SD memory card)
•4: Drive 4 (standard ROM)
This register stores the execution status of latch data backup in the
following bit pattern.

Presence/ Restore operation at


Status absence of turning power supply
backup data ON from OFF
0 No backup data Absent Restoring not execute
Restoring executed
Restore ready when turning power
1
completion supply ON from OFF the
following time
Status of latch Restore QnU
S
SD671 data backup Status display 2 execution Restoring not executed New
(Status change) LCPU
function completion 1) Present
Backup
3 Restoring not executed
execution wait 2
Restore
Restoring executed
repeated
4 when turning power
execution ready
supply ON from OFF
completion
1) Indicates status immediately after restoration.
2) Indicates status after the CPU module is powered off and then on
while the CPU module is in the "2: Restore execution completion"
status.

Tab. A-63: Special registers (5): Memory cards

A – 190
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
This register stores the year (last two digits) and the month when
data were backed-up in 2-digit BCD.
Example: July, 1993 = 9307H

Backup time b15 to b12 b11 to b8 b7 to b4 b3 to b0 S QnU


SD672 New
(Year and month) (At write) LCPU

Year Month

This register stores the day and the hour when data were backed-up
in a 2-digit BCD.
Example: 31st, 10 a.m. = 3110H

Backup time b15 to b12 b11 to b8 b7 to b4 b3 to b0 S QnU


SD673 New
(day and hour) (At write) LCPU

Day Hour

This register stores the minute and the second when data were
backed-up in a 2-digit BCD.
Example: 35 min., 48 sec. = 3548H
Backup Backup time
information b15 to b12 b11 to b8 b7 to b4 b3 to b0 S QnU
SD674 (Minute and New
(At write) LCPU
second)

Minute Second

This register stores the year (first two digits) and the day of the week
when data were backed-up in 2-digit BCD.
Example: 1993, Friday = 1905H

b15 to b12 b11 to b8 b7 to b4 b3 to b0

Backup time Higher digits of year Day ot the QnU


S
SD675 (Year and day of (0 to 99) week New
(At write) LCPU
week)
Day of the week
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

This register stores the year (last two digits) and the month when
data were restored in 2-digit BCD.
Example: July, 1993 = 9307H

Restore time b15 to b12 b11 to b8 b7 to b4 b3 to b0 S QnU


SD672 New
(Year and month) (Initial) LCPU

Year Month
Backup
restoration
information This register stores the day and the hour when data were restored in
a 2-digit BCD.
Example: 31st, 10 a.m. = 3110H

Restore time b15 to b12 b11 to b8 b7 to b4 b3 to b0 S QnU


SD673 New
(day and hour) (Initial) LCPU

Day Hour

Tab. A-63: Special registers (5): Memory cards

Programming MELSEC System Q and L series A – 191


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
This register stores the minute and the second when data were
restored in a 2-digit BCD.
Example: 35 min., 48 sec. = 3548H
Backup Restore time QnU
b15 to b12 b11 to b8 b7 to b4 b3 to b0 S
SD674 restoration (Minute and sec- New
(Initial) LCPU
information ond)

Minute Second

This register stores the year (first two digits) and the day of the week
when data were restored in 2-digit BCD.
Example: 1993, Friday = 1905H

b15 to b12 b11 to b8 b7 to b4 b3 to b0

Restore time Higher digits of year Day ot the QnU


Backup S
SD675 (Year and day of (0 to 99) week New
information (Initial) LCPU
week)
Day of the week
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Program Write (transfer) This register stores the progress of writing (transfer) to the program
S QnU
SD681 memory write status display memory (flash ROM) in percentage (0 to 100%). (When a write New
(At write) LCPU
(transfer) status (percentage) (transfer) command is given, "0" is stored in this register.)
This register stores the index value of write count of the program
SD682 memory (flash ROM)* up to the present in 32-bit binary. When the
index value exceeds 100 thousand times, "FLASH ROM ERROR"
Program (error code: 1610) occurs. (The index value will be counted even
Write count index after it exceeds 100 thousand.) QnU
memory write S (At write) New
up to present LCPU
count index
SD683 * The write count does not equal to the index value. (Since the
maximum write count of the flash ROM has been increased by the
system, 1 is added about every two writing operations.)
Standard ROM Write (transfer) This register stores the progress of writing (transfer) to the standard
S QnU
SD686 write (transfer) status display ROM (flash ROM) in percentage (0 to 100%). When a write New
(At write) LCPU
status (percentage) (transfer) command is given, "0" is stored in this register.
SD687 This register stores the index value of write count of the standard
ROM (flash ROM)* up to the present in 32-bit binary. When the
index value exceeds 100 thousand times, "FLASH ROM ERROR"
(error code: 1610) occurs. (The index value will be counted even
Standard ROM Write count index after it exceeds 100 thousand.) S QnU
New
SD688 write count index up to present (At write) LCPU
* The write count does not equal to the index value. (Since the
maximum write count of the flash ROM has been increased by the
system, 1 is added to the index value when the total write data size
after the previous count-up reaches about 1M byte.)
This register stores the cause of an error that occurred during
backup.
 0H: No error
 100H: Memory card not inserted
 200H: Backup data size exceeded
 300H: Memory card write-protect setting
 400H: Memory card write error
 500H: Backup data read error (program memory) S QnU 1)
SD689 Backup error factor New
 503H: Backup data read error (standard RAM) (Error) LCPU
 504H: Backup data read error (standard ROM)
 510H: Backup data read error (system data)
 600H: Backup preparation was performed while latch data was
being backed up to the standard ROM.
 601H: Backup preparation was performed during online change.
 602H: Backup preparation was performed while a FTP client
connected to the CPU module in FTP connection is present.

Tab. A-63: Special registers (5): Memory cards

A – 192
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Stores the current backup status.
 0: Before backup
 1: Being prepared S QnU 1)
SD690 Backup status  2: Ready (Status change)
New
LCPU
 3: Being executed
 4: Completed
 FF: Backup error

Backup execution  This register stores the progress of backup to the memory card
Backup S QnU 1)
SD691 status display in percentage (0 to 100%). New
execution status  "0" is stored at the start of backup. (Status change) LCPU
(percentage)

Stores the cause of an error that occurred in restoration.


Factor of error  800H: The CPU module model name does not match.
Restoration error  801H: The backup data file does not match or the reading of S QnU 1)
SD692 occurred in New
factor backup data from the memory card is not completed. (Error) LCPU
restoration  810H: Writing backup data to the restoration drive is not
completed.

Stores the current restoration status.


 0: Before restoration
Restoration Current  1: Being executed S QnU 1)
SD693 New
status restoration status  2: Completed (Status change) LCPU
 FF: Restoration error (In automatic restoration, "0: Before
restoration" is stored at the completion of restoration.)

Restoration
Restoration execution status  This register stores the progress of restoration to the CPU QnU 1)
SD694 module in percentage (0 to 100%). S (Status change) New
execution status display  "0" is stored at the start of restoration. LCPU
(Percentage)

 This register stores the maximum number of executions of the


writing to standard ROM instruction (SP.DEVST) per day.
 When the number of executions of the writing to standard ROM
Specification of writing to standard instruction exceeds the number of times set by SD695, QnU
SD695 "OPERATION ERROR" (error code: 4113) occurs. U New
ROM instruction count  The setting range of this register is 1 to 32767. If "0" or a value LCPU
outside the range has been set, "OPERATION ERROR" (error
code: 4113) occurs at execution of the writing to standard ROM
instruction.
SD696 S
This register stores a free space value in a memory card in 32-bit
Available memory in memory card (Backup in New QnU 1)
SD697 binary.
operation)
Free memory card
SD696 space at backup This register stores a free space value in a SD memory card if the QnU 1)
Free memory (lower bits) S
free space is insufficient for storing the backup data and resulting in
card space at (Backup in New
backup Free memory card a backup error. (unit: byte) This register is cleared to "0" when operation)
SD697 space at backup backup is completed. LCPU
(upper bits)
Backup data size
SD698 S
Backup data (lower bits) QnU 1)
This register stores backup data size in 32-bit binary. (Backup in New
capacity Backup data size LCPU
SD699 operation)
(upper bits)

Tab. A-63: Special registers (5): Memory cards


1
The module whose first 5 digits of serial No. is "10102" or higher. (Except the Q00UJCPU, Q00UCPU, and Q01UCPU)
2
The Universal model QCPU except the Q00UJCPU, Q00UCPU, and Q01UCPU.
3
The Universal model QCPU except the Q00UJCPU.
4
On the Basic model QCPU, data is set at STOP to RUN or RSET instruction execution after parameter execution.

Programming MELSEC System Q and L series A – 193


Table of special registers Appendix A

A.7.6 Instruction related registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
SD705 Q00J/
Q00/
During block operations, turning SM705 ON makes it possible to use
Q01
the mask pattern being stored at SD705 (or at SD705 and SD706 if
Mask pattern U New Qn(H)
SD706 double words are being used) to operate on all data in the block with
the masked values. QnPH
QnPRH
SD715 Patterns masked by use of the IMASK instruction are stored in the fol-
lowing manner:
SD716
IMASK b15 ...................... b0
S
instruction Mask pattern SD715 I15 I14 I13 I12 I11 I10 I9 I8 I7 I6 I5 I4 I3 I2 I1 I0 New
(During execution) QCPU
mask pattern I31 I30 I29 I28 I27 I26 I25 I24 I23 I22 I21 I20 I19 I18 I17 I16
SD717 SD716
SD717 I47 I46 I45 I44 I43 I42 I41 I40 I39 I38 I37 I36 I35 I34 I33 I32
LCPU

SD718
Accumulator For use as replacement for accumulators used in A-series programs. S/U New
SD719
Program No. destination for Stores the program number of the program to be loaded by the PLOAD Qn(H)
SD720 U New
PLOAD instruction instruction when designated. The destination range is from 1 to 124. QnPH
SD738 Stores the message designated by the MSG instruction.
SD739
SD740
SD741 2nd character 1st character
4th character 3rd character
SD742
6th character 5th character
SD743
8th character 7th character
SD744 10th character 9th character
SD745 12th character 11th character
SD746 14th character 13th character
SD747 16th character 15th character
18th character 17th character
SD748
20th character 19th character
SD749 22nd character 21th character
SD750 24th character 23th character
SD751 26th character 25th character
SD752 28th character 27th character

SD753 30th character 29th character S


Message storage 32th character 31st character New QnH
SD754 (During execution)
34th character 33rd character
SD755 36th character 35th character
SD756 38th character 37th character
SD757 40nd character 39th character
SD758 42nd character 41st character
44th character 43rd character
SD759
46th character 45th character
SD760
48th character 47th character
SD761 50th character 49th character
SD762 52nd character 51st character
SD763 54th character 53rd character
SD764 56th character 55th character
58th character 57th character
SD765
60th character 59th character
SD766 62nd character 61st character
SD767 64th character 63rd character
SD768
SD769
Tab. A-64: Special registers (6): Instruction related registers

A – 194
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Designate the limit for each PID loop as follows:
Q00J/Q00
SD774 b15 to b8 b7 ... b1 b0
/Q01 1)
SD774 Loop 8 Loop 2 Loop 1
PID limit
setting (for 0: Limit set
Designate the limit for each PID loop as follows: U New
complete 1: Limit not set Qn(H)
SD774 derivative)
b15 b1 b0 QnPRH
and
SD775 SD774 Loop
Loop 16
16 to Loop
Loop 22 Loop
Loop 11 QnU
SD775 Loop
Loop 32
32 to Loop
Loop 18
18 Loop
Loop 17
17 LCPU

 Selects whether or not the data is refreshed when the COM


instruction is executed.
 Designation of SD778 is made valid when SM775 turns ON.
b15 b14 ... b5 b4 b3 b2 b1 b0
SD778 0
I/O refresh
CC-Link refresh
MELSECNET/H
refresh
Automatic refresh of Q00J/Q00
intelligent function
modules /Q01 1)
Automatic refresh of
CPU shared memory Qn(H) 2)
(Fixed to "0" for
Redundant CPU)
Execution/
non-execution of
communication with
b0 to b14: programming tool
(Default: 0)  Refresh between multiple CPUs by the COM instruction is
0: Do not refresh performed under the following conditions.
Refresh 1: Refresh Data reception from another CPU: When b4 of SD778 is "1"
processing b15 bit Data transmission from host CPU: When b15 of SD778 is "0"
selection 0: Communica-  Selects whether or not the data is refreshed when the COM
SD778 when the tion with CPU instruction is executed. U New
COM/CCOM module is  Designation of SD778 is made valid when SM775 turns ON.
instruction is executed
executed b15 b14 ... b5 b4 b3 b2 b1 b0
1: Communica-
tion with CPU SD778 0
I/O refresh
module is CC-Link refresh
non-executed Refresh of CC-Link IE
controller network
and MELSECNET/H
Automatic refresh of
intelligent function Qn(H) 4)
modules
Automatic refresh of QnPH 3)
CPU shared memory
(Fixed to "0" for QnPRH
Redundant CPU)
Execution/
non-execution of
communication with
programming tool
 Refresh between multiple CPUs by the COM instruction is
performed under the following conditions.
Data reception from another CPU: When b4 of SD778 is "1"
Data transmission from host CPU: When b15 of SD778 is "0"
 When b2 of SD778 is 1, both the CC-Link IE controller network and
MELSECNET/H perform a refresh. Therefore, when refresh point is
large, processing time for the COM instruction is extended.

Tab. A-64: Special registers (6): Instruction related registers

Programming MELSEC System Q and L series A – 195


Table of special registers Appendix A

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
 Selects whether or not the data is refreshed when the COM/CCOM
instruction is executed.
 Designation of SD778 is made valid when SM775 turns ON.
b15 b14 ... b7 b6 b5 b4 b3 b2 b1 b0
SD778 0
b0 to b14:
(Default: 0) I/O refresh
CC-Link refresh
0: Do not refresh Refresh of MELSECNET/H
1: Refresh and CC-Link IE controller
network
b15 bit
Automatic refresh of
0: Communica- intelligent function
tion with CPU modules U New QnU
Auto refresh using QCPU
module is standard area of multiple
executed CPU system and reading
input/output from group
1: Communica- outside.
tion with CPU Auto refresh using the
Refresh module is multiple CPU high speed
transmission area of multiple
processing nonexecuted CPU system
selection CC-Link IE field network
refresh
SD778 when the
Execution/
COM/CCOM non-execution of
instruction is communication with
programming tool
executed
b0, b1, b3, b14:  Selects whether or not the data is refreshed when the COM/CCOM
(Default: 0) instruction is executed.
 Designation of SD778 is made valid when SM775 turns ON.
0: Do not refresh
1: Refresh b15 b14 ... b4 b3 b2 b1 b0
b15 bit SD778 0
0: Communica- I/O refresh
tion with CC-Link refresh
peripheral Fixed to 0 U New LCPU
Automatic refresh of
device is intelligent function
executed modules
Fixed to 0
1: Communica-
Communication with
tion with display unit
peripheral Execution/
non-execution of
device is non- communication with
executed programming tool

Stores the mask pattern masked by the IMASK instruction as follows:

b15 b1 b0
SD781 l63 ... l49 l48
SD781
SD782 l79 ... l65 l64 Q00J/Q00
to
/Q01
SD785
... ...

SD785 l127 ... l113 l112

Mask pattern
Stores the mask pattern masked by the IMASK instruction as follows: S
of IMASK Mask pattern New
(During execution)
instruction b15 b11 b0
SD781 I63 to I59 I48
Qn(H)
SD782 I79 to I65 I64
SD781 QnPH
to QnPRH
to
SD793 QnU
SD793 I255 I241 I240 LCPU

The Q00UJCPU, Q00UCPU, and Q01UCPU cannot use SD786 to


SD793.

Tab. A-64: Special registers (6): Instruction related registers

A – 196
Appendix A Table of special registers

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
Designate the limit for each PID loop as follows:
Q00J/Q00
SD794 b15 to b8 b7 ... b1 b0
/Q01 1)
SD794 Loop 8 Loop 2 Loop 1
PID limit set-
ting (for 0: With limit
U New
incomplete 1: Without limit Designate the limit for each PID loop as follows: Qn(H) 4)
SD794 derivative)
b15 b1 b0 QnPRH
to SD794 Loop 16 ... Loop 2 Loop 1 QnU
SD795
SD795 Loop 32 ... Loop 18 Loop 17 LCPU

Maximum
number of Specifies the maximum number of blocks used for the multiple CPU
blocks used high-speed transmission dedicated instruction
for the multi- (target CPU = CPU No. 1).
ple CPU high- When the multiple CPU high-speed transmission dedicated instruction
SD796 speed trans- is executed to the CPU No.1, and the number of empty blocks of the New QnU 5)
mission dedi- dedicated instruction transmission area is less than the setting value of
cated this register, SM796 is turned ON, which is used as the interlock signal
instruction for consecutive execution of the multiple CPU high-speed transmission
setting (for dedicated instruction.
CPU No.1)
Maximum
number of Specifies the maximum number of blocks used for the multiple CPU
blocks used high-speed transmission dedicated instruction
for the multi- (target CPU = CPU No. 2).
ple CPU high- When the multiple CPU high-speed transmission dedicated instruction
SD797 speed trans- is executed to the CPU No.2, and the number of empty blocks of the New QnU 5)
mission dedi- Maximum dedicated instruction transmission area is less than the setting value of
cated number of blocks this register, SM797 is turned ON, which is used as the interlock signal
instruction range for dedi- for consecutive execution of the multiple CPU high-speed transmission
setting (for cated instruc- dedicated instruction.
CPU No. 2) tions U
Range: 1 to 7 (At 1 scan after
Maximum (Default: 2 RUN)
number of or when setting Specifies the maximum number of blocks used for the multiple CPU
blocks used other than 1 to 7, high-speed transmission dedicated instruction
for the multi- the register oper- (target CPU = CPU No. 3).
ple CPU high- ates as 7).6) When the multiple CPU high-speed transmission dedicated instruction
SD798 speed trans- is executed to the CPU No.3, and the number of empty blocks of the New QnU 5)
mission dedi- dedicated instruction transmission area is less than the setting value of
cated this register, SM798 is turned ON, which is used as the interlock signal
instruction for consecutive execution of the multiple CPU high-speed transmission
setting (for dedicated instruction.
CPU No.3)
Maximum
number of Specifies the maximum number of blocks used for the multiple CPU
blocks used high-speed transmission dedicated instruction
for the multi- (target CPU = CPU No. 4).
ple CPU high- When the multiple CPU high-speed transmission dedicated instruction
SD799 speed trans- is executed to the CPU No.4, and the number of empty blocks of the New QnU 5)
mission dedi- dedicated instruction transmission area is less than the setting value of
cated this register, SM799 is turned ON, which is used as the interlock signal
instruction for consecutive execution of the multiple CPU high-speed transmission
setting (for dedicated instruction.
CPU No.4)

Tab. A-64: Special registers (6): Instruction related registers


1
Function version is B or later.
2
The module whose first 5 digits of serial No. is "04012" or higher.
3
The module whose first 5 digits of serial No. is "07032" or higher.
4
The module whose first 5 digits of serial No. is "09012" or higher.
5 The Universal model QCPU except the Q00UJCPU, Q00UCPU, Q01UCPU, and Q02UCPU.
6
The range is from 1 to 9 for the Q03UDCPU, Q04UDCPU, and Q06UDHCP whose first 5 digits of serial number is "10012" or lower. (Default: 2 Or when
setting other than 1 to 9, the register operates as 9).

Programming MELSEC System Q and L series A – 197


Table of special registers Appendix A

A.7.7 Debugging

ACPU
Valid
Number Name Meaning Description Set by (if set) register for:
D9
This register indicates the status of the debug function usage
as shown below.

SD840 Debug function usage


b15 ... b2 b1 b0 S
New QnU 1)
0 (Status change) LCPU
Forced on/off for external I/O
2 to 15: Empty (fixed at 0)
Executional conditioned device test
(0: Not used, 1: Used)

Tab. A-65: Special registers (7): Debugging


1 The module whose first 5 digits of serial No. is "10042" or higher.

A.7.8 Redundant CPU information (host system CPU information)

ACPU Valid
Number Name Meaning Description Set by (if set) register
D9 for:

This register stores a value indicating the completion status of the lat-
History of est memory data copy from the control system to the standby system.
Latest status of  The value same as the SD1596 value is stored at completion or
memory copy
memory copy abend of the memory data copy from the control system to the
from control S
SD952 from control standby system. New QnPRH
system to (Status change)
system to  Since data have been backed up in case of power failure, this
standby register holds the value indicating the latest memory data copy
standby system
system status from the control system to the standby system.
 This register is cleared to 0 by latch clear.

Tab. A-66: Special registers (8): Redundant CPU information (host system CPU information)

A.7.9 Remote password count

ACPU Valid
Number Name Meaning Description Set by (if set) register
D9 for:

Direct
SD979 MELSOFT
connection
Connection 1
SD980
to 16
MELSOFT
connection Count of unlock
SD997
using UDP processing fail-
These registers store the number of mismatched password entries. S
New QnU 1)
Range: 0 to 0FFFEH (0FFFFH when the range is exceeded) (Status change) LCPU
port ures
MELSOFT
connection
SD998
using TCP
port
FTP commu-
SD999
nication port

Tab. A-67: Special registers (9): Remote password count


1
This applies to the Built-in Ethernet port QCPU.

A – 198
Appendix A Table of special registers

A.7.10 Conversion from A series to System Q or L series

For a conversion from the MELSEC A series to the MELSEC System Q or L series the special
registers D9000 through D9255 (A series) correspond to the diagnostic special registers
SD1000 to SD1255 for QCPU or LCPU after the A to Q/L conversion. (Note that the Basic
model QCPU and Redundant CPU do not support the A to Q/L conversion.)
These diagnostic special registers are all set by the system and cannot be changed by a user-
program. Users intending to change the contents of these registers should alter their programs
so that only real QCPU or LCPU diagnostic special registers are applied.
An exception are the special registers D9200 through D9255. The data in these registers can
be changed by the user. Therefore, the user can change the data in the diagnostic special reg-
isters SD1200 to SD1255 after the conversion.
Refer to the manuals of the CPUs and the networks MELSECNET and MELSECNET/B for
detailed information on the special registers of the A series.

NOTE To use the converted special register in the High Performance model QCPU, Process CPU, Uni-
versal model QCPU, or LCPU, check "Use special relay/special register from SM/SD1000" un-
der "A-PLC Compatibility Setting".
Project window ⇒ [Parameter] ⇒ [PLC Parameter] ⇒ [PLC System]
Note that the processing time will increase when the converted special register is used.
How to read the Special Register for Modification column.
● If the special register number for QCPU or LCPU is provided, correct the program using it.
● If no special register is specified (–), the converted special register can be used.
● If the special register cannot be used in QCPU or LCPU, this is indicated as "No function
for QCPU/LCPU".

ACPU Special Special


Special Register after Register for Name Meaning Details Valid for:
Register Conversion Modification
 If a module with blown fuse is detected, the
lowest first I/O number of the module is stored in
hexadecimal. (Example: If a fuse blown is
occurred in the output module with output
Number of number Y50 to Y6F, "50" is stored in Qn(H)
D9000 SD1000 — Fuse blown module with hexadecimal.) To monitor the number by a QnPH
blown fuse programming tool, monitor in hexadecimal.(This
register is cleared when contents in SD1100 to QnU 1)
SD1107 are all reset to "0".)
 Output modules on remote I/O stations are also
checked for blown fuse.
 If any fuse is blown, this register stores a number
corresponding to each setting switch number or
to slot number of the base unit.

AJ02 I/O module Extension base unit


Setting Stored Base unit Stored
switch data Slot No. data
0 0 0 4
Number of 1 1 1 5 Qn(H)
D9001 SD1001 — Fuse blown module with 2 2 2 6
blown fuse QnPH
3 3 3 7
4 4
5 5
6 6
7 7
 For the remote I/O station, the value of (module
I/O No./ 10H) + 1 is stored.

Tab. A-68: Special registers (10): Conversion from A series to System Q or L series

Programming MELSEC System Q and L series A – 199


Table of special registers Appendix A

ACPU Special Special


Special Register after Register for Name Meaning Details Valid for:
Register Conversion Modification
 If the status of the I/O modules changes from that
obtained at power-on, the lowest first I/O number
of the module is stored in hexadecimal.(Example:
If a module verification error is occurred on the Qn(H)
I/O module verifi- output module with output numbers Y50 to Y6F,
I/O module verifi- "50" is stored in hexadecimal.) To monitor the QnPH
D9002 SD1002 — cation error mod- number by a programming tool, monitor in
cation error
ule number QnU 1)
hexadecimal.(This register is cleared when
contents in SD1116 to SD1123 are all reset to LCPU
"0".)
 I/O module verification is conducted on I/O
modules on remote I/O stations.
 A value stored in this register is incremented by
one whenever the input voltage falls to or below Qn(H)
Number of times 85% (AC power) or 65 % (DC power) of the rating QnPH
D9005 SD1005 — AC DOWN counter during operation of the CPU module.
for AC DOWN  The counter starts the routine: counts up from 0 QnU 1)
to 32767, then counts down to -32768 and then LCPU
again counts up to 0.
Self-diagnostic Self-diagnostic This register stores the error code of an error detected
D9008 SD1008 SD0
error error number by self-diagnostics.
 When any of F0 to F2047 (default device setting) Qn(H)
is turned on by the OUT F or SET F instruction, the
F number that has been detected earliest among QnPH
F number at which the F numbers that have turned on is stored in BIN QnU 1)
Annunciator
D9009 SD1009 SD62 external failure code.
detection  SD1009 can be cleared by RST F or LEDR LCPU
has occurred
instruction. If another F number has been
detected, the clearing of SD1009 causes the next
number to be stored in SD1009.
Step number at If an operation error occurred during execution of an
which operation application instruction, the number of the step having
D9010 SD1010 Error step
error has the error is stored. The contents of SD1010 are
occurred. updated upon every operation error.
If an operation error occurred during execution of an
Step number at application instruction, the number of the step having
No function for which operation the error is stored. Because the step number is stored Qn(H)
D9011 SD1011 Error step
QCPU/LCPU error has in SD1011 when SM1011 turns from off to on, the
occurred. data in SD1011 are not updated unless SM1011 is QnPH
cleared by a user program
The I/O control mode that has been set is returned in
I/O control mode any of the following numbers.
D9014 SD1014 I/O control mode
number  0: Both input and output in direct mode
 1: Input in refresh mode, output in direct mode
 3: Both input and output in refresh mode
Operation status of a CPU module is stored as shown
below.
b15 ... b12 b11 .... b8 b7 .... b4 b3 ... b0

Remote RUN/STOP CPU module key switch


by computer
0 RUN
0 RUN
1 STOP
1 STOP
2 PAUSE
1) Qn(H)
2 PAUSE 1)
3 STEP RUN
QnPH
D9015 SD1015 SD203 Operating state of CPU (Remains the same in
remote RUN/STOP mode) QnU 1)
Status in program Remote RUN/STOP
by parameter setting
LCPU
0 Except below
0 RUN
STOP
1 Instruction 1 STOP
execution 1)
2 PAUSE

1
For the High Performance model QCPU and Process
CPU, if the CPU module is running and SM1040 is off,
the CPU module remains in the RUN status even
though it is set to the PAUSE status.

Tab. A-68: Special registers (10): Conversion from A series to System Q or L series

A – 200
Appendix A Table of special registers

ACPU Special Special


Special Register after Register for Name Meaning Details Valid for:
Register Conversion Modification
This register stores any of the values from 0 to B, indi-
cating which program is currently running.
0: Main program (ROM)
1: Main program (RAM)
2: Subprogram 1 (RAM)
Stores sequence 3: Subprogram 2 (RAM)
No function for program under 4: Subprogram 3 (RAM) Qn(H)
D9016 SD1016 Program number
QCPU/LCPU execution as BIN 5: Subprogram 1 (ROM) QnPH
value 6: Subprogram 2 (ROM)
7: Subprogram 3 (ROM)
8: Main program (EEPROM)
9: Subprogram 1 (EEPROM)
A: Subprogram 2 (EEPROM)
B: Subprogram 3 (EEPROM)
Qn(H)
If a scan time value is smaller than the value in
Minimum scan SD1017, the SD1017 value is updated in the END QnPH
D9017 SD1017 SD520
time (10 ms units) processing. Therefore the minimum value of scan QnU 1)
time is stored in SD1017.
LCPU
Qn(H)
Scan time This register stores a scan time in every END process- QnPH
D9018 SD1018 SD524 Scan time
(10 ms units) ing. QnU 1)
LCPU
Qn(H)
If a scan time value is greater than the value in
Maximum scan QnPH
SD1019, the SD1019 value is updated in END
D9019 SD1019 SD526 time
(10 ms units)
processing. Therefore the maximum value of scan QnU 1)
time is stored in SD1019.
LCPU

Constant scan This register stores an interval value in units of 10ms


No function for time to run a program at regular intervals. Qn(H)
D9020 SD1020
QCPU/LCPU
Constant scan
(User sets in 10  0: No constant scan function
 1 to 200: Constant scan function available QnPH
ms units) (executing at a interval of setting value × 10ms)
Scan time This register stores scan time in every END process-
D9021 SD1021 — Scan time
(in 1 ms units) ing. Qn(H)
 The value is incremented by one every second QnPH
after RUN. QnU 1)
D9022 SD1022 SD412 Time Time  The counter starts the routine: counts up from 0
to 32767, then counts down to -32768 and then LCPU
again counts up to 0.
This register stores the year (last two digits) and the
month in 2-digit BCD.
Example: July, 1993 = 9307H
Clock data b15 to b12 b11 to b8 b7 to b4 b3 to b0
D9025 SD1025 SD210
(year, month)

Year Month Qn(H)


QnPH
Clock data
This register stores the day and the hour in a 2-digit QnU 1)
BCD. LCPU
Example: 31st, 10 a.m. = 3110H

Clock data b15 to b12 b11 to b8 b7 to b4 b3 to b0


D9026 SD1026 SD211
(day, hour)

Day Hour

Tab. A-68: Special registers (10): Conversion from A series to System Q or L series

Programming MELSEC System Q and L series A – 201


Table of special registers Appendix A

ACPU Special Special


Special Register after Register for Name Meaning Details Valid for:
Register Conversion Modification
This register stores the minute and the second in
2-digit BCD.
Example: 35 min., 48 sec. = 3548H

Clock data b15 to b12 b11 to b8 b7 to b4 b3 to b0


D9027 SD1027 SD212
(minute, second)

Minute Second

This register stores the the day of the week in


2-digit BCD. Qn(H)
Example: Friday = 0005H
QnPH
Clock data
b15 to b12 b11 to b8 b7 to b4 b3 to b0 QnU 1)
LCPU
Day ot the
Always set to "0"
Clock data week
D9028 SD1028 SD213
(day of week)
Day of the week
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Qn(H)
Extension file Stores the block No. of the extension file register QnPH
D9035 SD1035 SD648 Use block No.
register being used in BCD code. QnU 1)
LCPU
Designate the device number for the extension file
register for direct read and write in 2 words at SD1036
and SD1037 in BIN data. Use consecutive numbers
D9036 SD1036 beginning with R0 of block No. 1 to designate device
Device number numbers.
Extension file when individual
Extension file register QnH
No function for register for devices from
0 Block No. 1 data
QCPU/LCPU designation of extension file reg- QnPH
device number ister are directly 16383

accessed 16384 Block No. 2 data

D9037 SD1037 SD1037,SD1036


Device No. (BIN data)

This register stores priority of errors to be indicated


by the ERROR LED (on or flash) by using cause num-
bers.
D9038 SD1038 SD207 Priorities 1 to 4
b15 ... b12 b11 ... b8 b7 .... b4 b3 .... b0
Priority 4 Priority 3 Priority 2 Priority 1
LED display SD207 QnH
priority ranking SD208 Priority 7 Priority 6 Priority 5
QnPH
 Configuration of the priority setting areas is as
shown above.
D9039 SD1039 SD208 Priorities 5 to 7  For details, refer to the following manual: User's
manual of the CPU module used Type ACPU/QCPU-
A (A Mode) Programming Manual (Fundamentals)

Tab. A-68: Special registers (10): Conversion from A series to System Q or L series

A – 202
Appendix A Table of special registers

ACPU Special Special


Special Register after Register for Name Meaning Details Valid for:
Register Conversion Modification
To operate the STRA or STRAR instruction of a sam-
pling trace by turning on or off SM803 with a pro-
Step or time gramming tool, use the value stored in SD1044 as the QnH
For sampling
D9044 SD1044 during sampling sampling trace condition.
trace QnPH
trace  When "Each scan" is selected: 0
 When a timing is specified: setting value (Unit:
10ms)
 This register stores the block No. of the extended
file register used as a work area for executing the
Block number of SFC program. QnH
D9049 SD1049 Work area for SFC extension file  This register stores "0" when SM320 is off and
register when empty area of 16K bytes or smaller is used QnPH
(16K byte or less is too small to be used as block
No.1 for an extended file register).
This register stores an error code of the error
occurred in the SFC program.
 0 : No error
Error code  80: SFC program parameter error QnH
SFC program
D9050 SD1050 generated by SFC  81: SFC code error
error number QnPH
No function for program  82: Number of steps of simultaneous execution
QCPU/LCPU exceeded
 83: Block start error
 84: SFC program operation error
This register stores the number of the block in the SFC
Block number QnH
program where an error occurred.
D9051 SD1051 Error block where error
For error 83, the number of the block where the pro- QnPH
occurred
gram was started is stored.
 This register stores the number of the step in the
Step number SFC program where error 83 occurred. QnH
D9052 SD1052 Error step where error  For error 80, 81, and 82, "0" is stored.
occurred  For error 83, the block starting step number is QnPH
stored.
Transition condi- This register stores the number of the transition con-
tion number dition in the SFC program where error code 84 QnH
D9053 SD1053 Error transition
where error occurred. For error codes 80, 81, 82, and 83, "0" is QnPH
occurred stored.
Sequence step This register stores the sequence step number of QnH
Error sequence
D9054 SD1054 number where transfer condition and operation output in the SFC
step QnPH
error occurred program where error 84 occurred.
 This register stores the number of the step where
a status latch was executed.
 When a status latch was executed in a main
sequence program, the step No. is stored.
 When a status latch was executed in a SFC
program, the block number and step number are
stored. QnH
D9055 SD1055 SD812 Status latch Status latch step
QnPH
Block No. Step No.
(BIN) (BIN)

Upper 8 bits Lower 8 bits

Data check of The serial co

You might also like