Mitsubishi MELSEC QS Series Programming Manual

Mitsubishi MELSEC QS Series Programming Manual

Hide thumbs Also See for MELSEC QS Series:
Table of Contents

Advertisement

Quick Links

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi MELSEC QS Series

  • Page 3: Safety Precautions

    SAFETY PRECAUTIONS (Always read these cautions before using the product) Before using this product, please read this manual and the related manuals introduced in this manual, and pay full attention to safety to handle the product correctly. Please store this manual in a safe place and make it accessible when required. Always forward a copy of the manual to the end user.
  • Page 4: Revisions

    This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
  • Page 5: Table Of Contents

    INTRODUCTION Thank you for choosing the Mitsubishi MELSEC-QS Series of Safety Programmable Logic Controllers. Before using the equipment, please read this manual carefully to develop full familiarity with the functions and performance of the QS series PLC you have purchased, so as to ensure correct use.
  • Page 6 3.5 Conditions for Execution of Instructions 3 - 12 3.6 Counting Step Number 3 - 13 3.7 Operation when OUT, SET/RST, or PLS/PLF Instructions Use the Same Device 3 - 14 4. HOW TO READ INSTRUCTIONS 4 - 1 to 4 - 4 5.
  • Page 7 6.3.2 Conversion from BCD 4-digit and 8-digit data to BIN data (BIN(P), DBIN(P))......6 - 24 6.3.3 Complement of 2 of BIN 16- and 32-bit data (sign reversal) (NEG(P), DNEG(P)) ...... 6 - 27 6.4 Data Transfer Instructions 6 - 29 6.4.1 16-bit and 32-bit data transfers (MOV(P), DMOV(P))..............
  • Page 8: Introduction

    ABOUT MANUALS Introduction Manual Before constructing or designing the safety-related system, be sure to read the following manual. Manual Number Manual Name (Model Code) Safety Application Guide Explains the overview, construction method, laying and wiring examples, and application programs of the safety- SH-080613ENG related system.
  • Page 9 Manual Number Manual Name (Model Code) Q Corresponding Ethernet Interface Module User’s Manual (Application) Explains the e-mail function, programmable controller CPU status monitoring function, communication function via CC- SH-080010 Link IE controller network, MELSECNET/H or MELSECNET/10, communication function using the data link instruc- (13JL89) tions, file transfer function (FTP server) of the Ethernet module.
  • Page 10 MEMO...
  • Page 11: General Description

    GENERAL DESCRIPTION...
  • Page 12: Manuals Essential For Programming

    This manual describes the instructions required to execute programming of the QSCPU. Manuals Essential for Programming Before reading this manual, check the functions, programming methods, devices and others that are necessary to create programs with the QSCPU in the manuals below: •...
  • Page 13: Generic Terms And Abbreviations

    Generic term of each module for MELSEC-Q series, MELSEC-QnA Standard PLC series, MELSEC-A series and MELSEC-FX series. (Used for distinction from safety PLC.) QS Series Abbreviation for Mitsubishi Safety PLC MELSEC-QS Series Abbreviation for QS001CPU-type safety CPU module QS001CPU Other name for QS001CPU CPU Module...
  • Page 14 MEMO...
  • Page 15: Instruction Tables

    INSTRUCTION TABLES...
  • Page 16: Types Of Instructions

    Types of Instructions The major types of safety CPU module instructions are sequence instructions, basic instructions, application instructions, and QSCPU dedicated instructions as shown in Table 2.1 Table 2.1 Types of Instructions Reference Types of Instructions Meaning Chapter Contact instruction Operation start, series connection, parallel connection Ladder block connection, store/read operation results, creation of pulses from Connection instructions...
  • Page 17: How To Read Instruction Tables

    How to Read Instruction Tables The instruction tables found from Section 2.3 to 2.6 have been made according to the following format: Table 2.2 How to Read Instruction Tables Execution Category Symbol Processing Details ondition (D)+(S) 16-bit addition and subtraction S1 S2 D operations (S1)+(S2)
  • Page 18 3) ..Shows symbol diagram on the ladder. S1 S2 Indicates destination. Indicates destination. Indicates source. Indicates source. Indicates instruction symbol. Indicates instruction symbol. Fig. 2.1 Shows Symbol Diagram on the Ladder Destination ..Indicates where data will be sent after operation. Source .
  • Page 19: Sequence Instruction

    Sequence Instruction 2.3.1 Contact instructions Table 2.3 Contact Instructions Execution Category Symbol Processing Details Condition • Starts logic operation (Starts a contact logic operation) • Starts logical NOT operation (Starts b contact logic operation) • Logical product (a contact series connection) •...
  • Page 20: Connection Instructions

    2.3.2 Connection instructions Table 2.4 Connection Instructions Execution Category Symbol Processing Details Condition • AND between logical blocks (Series connection between logical blocks) • OR between logical blocks (Series connection between logical blocks) • Memory storage of operation results • Read of operation results stored with MPS instruction •...
  • Page 21: Output Instructions

    2.3.3 Output instructions Table 2.5 Output Instructions Execution Category Symbol Processing Details Condition 5-17 5-19 • Device output 5-23 5-25 5-27 • Set device 5-31 5-29 Output • Reset device 5-31 • Generates 1 cycle program pulse at leading edge of input signal. 5-33 •...
  • Page 22: Termination Instruction

    2.3.5 Termination instruction Table 2.7 Termination Instruction Execution Category Symbol Processing Details Condition 5-42 Termination END • Termination of sequence program 2.3.6 Other instructions Table 2.8 Other Instructions Execution Category Symbol Processing Details Condition ––––––– • Ignored (For program deletion or space) •...
  • Page 23: Basic Instructions

    Basic Instructions 2.4.1 Comparison operation instructions Table 2.9 Comparison Operation Instructions Execution Category Symbol Processing Details Condition LD = S1 S2 • Conductive status when (S1) (S2) AND = S1 S2 • Non-conductive status when (S1) (S2) OR = S1 S2 LD<>...
  • Page 24 Table 2.9 Comparison Operation Instructions (Continued) Execution Category Symbol Processing Details Condition LDD = S1 S2 • Conductive status when ANDD = (S1+1, S1) (S2+1, S2) S1 S2 • Non-Conductive status when ORD = (S1+1, S1) (S2+1, S2) S1 S2 LDD<>...
  • Page 25: Arithmetic Operation Instructions

    2.4.2 Arithmetic operation instructions Table 2.10 Arithmetic Operation Instructions Execution Category Symbol Processing Details Condition • (D) + (S) S1 S2 D • (S1) + (S2) 16-bit S1 S2 D addition and – subtraction • (D) operations –P – S1 S2 D •...
  • Page 26: Data Conversion Instructions

    Table 2.10 Arithmetic Operation Instructions (Continued) Execution Category Symbol Processing Details Condition 6-18 • (D) + 1 INCP INCP DINC DINC 6-20 • (D+1, D) + 1 (D+1, D) DINCP DINCP BIN data increment 6-18 • (D) DECP DECP DDEC DDEC 6-20 •...
  • Page 27: Data Transfer Instructions

    2.4.4 Data transfer instructions Table 2.12 Data Transfer Instructions Execution Category Symbol Processing Details Condition 16-bit data ⋅ (S) ( D) transfer MOVP MOVP 6-29 DMOV DMOV 32-bit data ⋅ (S+1,S) ( D+1,D) transfer DMOVP DMOVP 16-bit data ⋅ (S) negation ( D) CMLP...
  • Page 28: Application Instructions

    Application Instructions 2.5.1 Logical operation instructions Table 2.13 Logical Operation Instructions Execution Category Symbol Processing Details Condition WAND WAND ⋅ (D) WANDP WANDP WAND WAND S1 S2 D ⋅ (S1) (S2) WANDP WANDP S1 S2 D Logical product DAND DAND ⋅...
  • Page 29 Table 2.13 Logical Operation Instructions (Continued) Execution Category Symbol Processing Details Condition WXNR WXNR ⋅ (D) 7-16 WXNRP WXNRP WXNR WXNR S1 S2 D ⋅ (S1) (S2) 7-18 WXNRP WXNRP S1 S2 D exclusive logical DXNR DXNR ⋅ (D+1,D) (S+1,S) (D+1,D) 7-16 DXNRP...
  • Page 30: Qscpu Dedicated Instruction

    QSCPU Dedicated Instruction 2.6.1 Forced control stop instruction Table 2.14 Forced Control Stop Instruction Execution Category Symbol Processing Details Condition Forced • Stops program execution. S.QSABORT control • Places safety CPU module in the stop error – S.QSABORT S stop state.
  • Page 31: Configuration Of Instructions

    CONFIGURATION OF INSTRUCTIONS...
  • Page 32 Configuration of Instructions Most safety CPU module instructions consist of an instruction part and a device part. Each part is used for the following purpose: • Instruction part .. Indicates the function of the instruction. • Device part ..Indicates the data that is to be used with the instruction. The device part is classified into source data, destination data, and number of devices.
  • Page 33: Designating Data

    Designating Data The following three types of data can be used with safety CPU module instructions: ...Section 3.2.1 Bit Data Data that can be handled by safety CPU module ...Section 3.2.2 Numeric data Integer data Word data ...Section 3.2.3 Double word data 3.2.1 Using bit data Bit data is data used in one-bit units, such as for contact points or coils.
  • Page 34: Using Word (16 Bits) Data

    3.2.2 Using word (16 bits) data Word data is 16-bit numeric data used by basic instructions and application instructions. The following two types of word data can be used with safety CPU module: • Decimal constants...... K-32768 to K32767 • Hexadecimal constants ....H0000 to HFFFF Word devices and bit devices designated by digit can be used as word data.
  • Page 35 (c) When destination (D) data is a word device The word device for the destination becomes 0 following the bit designated by digit designation at the source. Ladder Example Processing 16-bit Instruction K1X0 X3 X2 X1 X0 X010 Filled with 0. MOV K1X0 X2 X1 X0 Source (S) data...
  • Page 36: Using Double Word (32 Bits) Data

    3.2.3 Using double word (32 bits) data Double word data is 32-bit numerical data used by basic instructions and application instructions. The two types of double word data that can be dealt with by CPU module are as follows: • Decimal constants...... K–2147483648 to K2147483647 •...
  • Page 37 (c) When destination (D) data is a word device The word device for the destination becomes 0 following the bit designated by digit designation at the source. Ladder Example Processing 32-bit Instruction K1X0 X3 X2 X1 X0 Filled with 0. DMOV K1X0 0 0 0 0 0 0 0 0 0 0 X2 X1 X0...
  • Page 38 (2) Using word devices A word device designates devices used by the lower 16 bits of data. A 32-bit instruction uses (designation device number) and (designation device number + 1). DMOV K100 The 2 points (32 bits) D0 and D1 are designated 32-bit data transfer instruction 3.2 Designating Data 3.2.3 Using double word (32 bits) data...
  • Page 39: Subset Processing

    Subset Processing Subset processing is used to place limits on bit devices used by basic instructions and application instructions in order to increase processing speed. However, the instruction symbol does not change. To shorten scans, run instructions under the conditions indicated below. (1) Conditions which each device must meet for subset processing (a) When using word data Device...
  • Page 40: Cautions On Programming (Operation Errors)

    Cautions on Programming (Operation Errors) Operation errors are returned in the following cases when executing basic instructions, application instructions and QSCPU dedicated instructions with safety CPU module: • An error listed on the explanatory page for the individual instruction occurred. (1) Device range check Device range checks for the devices used by basic instructions and application instructions in safety CPU module are as indicated below:...
  • Page 41 Remark Refer to the manual below for how to change the internal user device allocation: • QSCPU User's Manual (Function Explanation, Program Fundamentals) (2) Device data check Device data checks for the devices used by basic instructions and application instructions in safety CPU module are as indicated below: (a) When using BIN data No error is returned even if the operation results in overflow or underflow.
  • Page 42: Conditions For Execution Of Instructions

    Conditions for Execution of Instructions The following four types of execution conditions exist for the execution of safety CPU module sequence instructions, basic instructions, application instructions and QSCPU dedicated instructions: • Non-conditional execution..Instructions executed without regard to the ON/OFF status of the device Example LD X0, OUT Y10...
  • Page 43: Counting Step Number

    Counting Step Number The number of steps in basic instructions and application instructions of the safety CPU module may increase depending on the devices to be used. (1) Counting the number of basic steps The basic number of steps for basic instructions and application instructions is calculated by adding the device number and 1.
  • Page 44: Operation When Out, Set/Rst, Or Pls/Plf Instructions Use The Same Device

    Operation when OUT, SET/RST, or PLS/PLF Instructions Use the Same Device The following describes the operation for executing multiple instructions of OUT, SET/RST, or PLS/PLF that use the same device in one scan. (1) OUT instructions using the same device Do not program more than one OUT instruction using the same device in one scan.
  • Page 45 (2) SET/RST instructions using the same device (a) 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 SET instructions 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.
  • Page 46 (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 instruction turns ON the device when the corresponding execution command is turned ON from OFF and turns OFF the device in other cases.
  • Page 47 • The X0 and X1 turn ON from OFF at the same time. M0 is turned ON because M0 is turned OFF X1 goes OFF because X1 is other (M0 remains ON.) than OFF ON status. (M0 remains OFF.) M0 is turned ON because M0 is turned OFF because X0 is other X0 goes OFF than OFF...
  • Page 48 [Timing Chart] • The ON/OFF timing of the X0 and X1 is different. (The specified device does not turn ON throughout the scan.) M0 is turned OFF because X1 is other than ON OFF status. M0 is turned OFF because (M0 remains OFF.) X1 is other than ON OFF status.
  • Page 49: How To Read Instructions

    HOW TO READ INSTRUCTIONS...
  • Page 50 The description of instructions that are contained in the following chapters are presented in the following format. Code used to write instruction (instruction symbol). Section number and general category of instructions being discussed. Indicates ladder mode expressions and execution conditions for instructions. Non-conditional Executed One Time Executed One...
  • Page 51 Devices which can be used by the instruction in question are indicated with circle. The types of devices that can be used are as indicated below: Internal Devices (System, User) Device Type Constant *3 Others *3 Word X, Y, M T, ST, C, *2 Applicable SM, F,...
  • Page 52 MEMO...
  • Page 53: Sequence Instructions

    SEQUENCE INSTRUCTIONS Reference Category Processing Details section Contact instruction Operation start, series connection, parallel connection Ladder block connection, creation of pulses from operation Connection instructions results, store/read operation results Output instruction Bit device output, output reversal Master control instruction Master control Termination instruction Program termination Instructions such as no operation which do not fit in the above...
  • Page 54: Contact Instruction

    LD, LDI, AND, ANI, OR, ORI Contact Instruction 5.1.1 Operation start, series connection, parallel connection (LD, LDI, AND, ANI, OR, ORI) LD, LDI, AND, ANI, OR, ORI Bit device number / Bit designation of word device S X1/D0.1 X1/D0.1 X2/D0.2 X2/D0.2 X3/D0.3 X3/D0.3...
  • Page 55 LD, LDI, AND, ANI, OR, ORI AND, ANI (1) AND is the A contact series connection instruction, and ANI is the B contact series connection instruction. They read the ON/OFF data of the designated bit device , perform an AND operation on that data and the operation result to that point, and take this value as the operation result.
  • Page 56 LD, LDI, AND, ANI, OR, ORI Operation Error (1) There are no operation errors with LD, LDI, AND, ANI, OR, or ORI instructions. Program Example (1) A program using LD, AND, OR, and ORI instructions. [Ladder Mode] (2) A program linking contact points established through the use of ANB and ORB instructions. [Ladder Mode] (3) A parallel program with OUT instruction.
  • Page 57: Pulse Operation Start, Pulse Series Connection, Pulse Parallel Connection (Ldp, Ldf, Andp, Andf, Orp, Orf)

    LDP, LDF, ANDP, ANDF, ORP, ORF 5.1.2 Pulse operation start, pulse series connection, pulse parallel connection (LDP, LDF, ANDP, ANDF, ORP, ORF) LDP, LDF, ANDP, ANDF, ORP, ORF Bit device number / Bit designation of word device S X1/D0.1 X1/D0.1 X2/D0.2 ANDP X2/D0.2...
  • Page 58 LDP, LDF, ANDP, ANDF, ORP, ORF (2) LDF is the trailing edge pulse operation start instruction, and is ON only at the trailing edge of the designated bit device (when it goes from ON to OFF). If a word device has been designated, it is ON only when the designated bit changes from 1 to 0.
  • Page 59: Connection Instructions

    ANB, ORB Connection Instructions 5.2.1 Ladder block series connections and parallel connections (ANB, ORB) ANB, ORB Block A Block B Block A Block B For parallel connection of 1 contact, OR or ORI is used. Internal Devices Constants Others Data Word ––...
  • Page 60 ANB, ORB Operation Error (1) There are no operation errors associated with ANB or ORB instructions. Program Example (1) A program using ANB and ORB instructions. [Ladder Mode] 5.2 Connection Instructions 5.2.1 Ladder block series connections and parallel connections (ANB, ORB)
  • Page 61: Operation Results Push, Read, Pop (Mps, Mrd, Mpp)

    MPS, MRD, MPP 5.2.2 Operation results push, read, pop (MPS, MRD, MPP) MPS, MRD, MPP In the ladder display, MPS, MRD and MPP are not displayed. Command Command Command Command Internal Devices Constants Others Data Word –– –– Function (1) Stores in memory the operation result (ON or OFF) immediately prior to the MPS instruction. (2) Up to 16 MPS instructions can be used successively.
  • Page 62 MPS, MRD, MPP 1. The following shows ladders both using and not using the MPS, MRD, and MPP instructions. Ladder Using the MPS, MRD and MPP Instruction Ladder not Using MPS, MRD, and MPP Instructions 2. The number of times the MPS and MPP instructions are used must be the same.
  • Page 63 MPS, MRD, MPP (2) A program using MPS and MPP instructions successively. [Ladder Mode] 5.2 Connection Instructions 5-11 5.2.2 Operation results push, read, pop (MPS, MRD, MPP)
  • Page 64: Operation Results Inversion (Inv)

    5.2.3 Operation results inversion (INV) Command Internal Devices Constants Others Data Word –– –– Function (1) Inverts the operation result immediately prior to the INV instruction. Operation Result Immediately Prior to the Operation Result Following the Execution of INV Instruction. the INV Instruction.
  • Page 65 1. The INV instruction operates based on the results of calculation made until the INV instruction is given. Accordingly, use it in the same position as that of the AND instruction. The INV instruction cannot be used at the LD and OR positions. 2.
  • Page 66: Operation Result Pulse Conversion (Mep, Mef)

    MEP, MEF 5.2.4 Operation result pulse conversion (MEP, MEF) MEP, MEF Command Command Internal Devices Constants Others Data Word –– –– Function (1) If operation results up to MEP instruction are leading edge (from OFF to ON), goes ON (continuity status). If operation results up to MEP instruction are anything other than leading edge, goes OFF (non-continuity status).
  • Page 67: Pulse Conversion Of Edge Relay Operation Results (Egp, Egf)

    EGP, EGF 5.2.5 Pulse conversion of edge relay operation results (EGP, EGF) EGP, EGF Command Command : Edge relay number where operation results are stored (bits) Internal Devices Others Constants Data Word –– Function (1) Operation results up to the EGP instruction are stored in memory by the edge relay (V). (2) Goes ON (continuity status) at the leading edge (OFF to ON) of the operation result up to the EGP instruction.
  • Page 68 EGP, EGF Program Example (1) A program containing a subroutine program using an EGP instruction [Ladder Mode] [Operation] END processing V0 is turned ON because V0 remains OFF because X0 changes from OFF to ON. X0 changes from ON to OFF. V0 is turned OFF because X0 remains ON.
  • Page 69: Output Instruction

    Output Instruction 5.3.1 Out instructions (excluding timers, counters, and annunciators) (OUT) Bit device number D Command Bit designation of word device D Command D0.5 : Number of the device to be turned ON and OFF (bits) Internal Devices Constants Others Data Word ––...
  • Page 70 Program Example (1) When Using Bit Devices [Ladder Mode] (2) When Bit Designation has been Made for Word Device [Ladder Mode] Remark The number of basic steps is 1 when a device other than a timer, counter and annunciator is designated for the OUT instruction. 5-18 5.3 Output Instruction 5.3.1 Out instructions (excluding timers, counters, and annunciators) (OUT)
  • Page 71: Timers (Out T,Outh T)

    OUT T, OUTH T 5.3.2 Timers (OUT T,OUTH T) OUT T, OUTH T Set value Command (1 to 32767 is valid) OUT T (Low speed timer) Set value Command (Data register value from 1 to 32767 is valid) Set value Command (Setting in the range from 1 to 32767 is valid)
  • Page 72 OUT T, OUTH T (2) The contact responds as follows when the operation result up to the OUT instruction is a change from ON to OFF: Prior to Time Up After Time Up Present Value of Type of Timer Timer Coil Timer A Contact B Contact...
  • Page 73 OUT T, OUTH T Caution (1) When creating a program in which the operation of the timer contact triggers the operation of other timer, create the program according to the operation order of the timers - create the program for the timer that operates later first. In the following cases, all timers go ON at the same scan if the program is created in the order the timers operate.
  • Page 74 OUT T, OUTH T Program Example (1) The following program turns Y10 and Y14 ON 10 seconds after X0 has gone ON. [Ladder Mode] *2: The set value of the low-speed timer indicates its default time limit (100 ms). (2) The following program uses the BCD data at X10 to X1F as the timer's set value. [Ladder Mode] Converts BCD data at X10 to X1F to BIN and stores the converted value in D10.
  • Page 75: Counters (Out C)

    OUT C 5.3.3 Counters (OUT C) OUT C Command Set value (1 to 32767 is valid) OUT C Command Set value (Data register value from 1 to 32767 is valid) Counter number (bits) Set value: Counter set value (BIN 16 bits) Internal Devices Constants Others...
  • Page 76 OUT C Program Example (1) The following program turns Y30 ON after X0 has gone ON 10 times, and resets the counter when X1 goes ON. [Ladder Mode] (2) The following program sets the value for C10 at 10 when X0 goes ON, and at 20 when X1 goes ON.
  • Page 77: Annunciator Output (Out F)

    OUT F 5.3.4 Annunciator output (OUT F) OUT F Annunciator number Command OUT F : Number of the annunciator to be turned ON (bits) Internal Devices Constants Others Data Word –– (Only F) Function (1) Operation results up to the OUT instruction are output to the designated annunciator. (2) The following responses occur when an annunciator (F) is turned ON.
  • Page 78 OUT F Program Example (1) The following program turns F7 ON when X0 goes ON, and stores the value 7 from SD64 to SD79. [Ladder Mode] [Operation] X0 ON Adds 1. SD63 SD63 SD64 SD64 SD65 SD65 SD66 SD66 SD67 SD67 SD79 SD79...
  • Page 79: Setting Devices (Except For Annunciators) (Set)

    5.3.5 Setting devices (except for annunciators) (SET) Command : Bit device number to be set (ON)/Word device bit designation (bits) Internal Devices Constants Others Data Word –– (Except T, C) Function (1) When the execution command is turned ON, the status of the designated devices becomes as shown below: Device Device Status...
  • Page 80 Operation Error (1) There are no operation errors associated with the SET instruction. Program Example (1) The following program sets Y8B (ON) when X8 goes ON, and resets Y8B (OFF) when X9 goes ON. [Ladder Mode] (2) The following program sets the value of D0 bit 5 (b5) to 1 when X8 goes ON, and set the bit value to 0 when X9 goes ON.
  • Page 81: Resetting Devices (Except For Annunciators) (Rst)

    5.3.6 Resetting devices (except for annunciators) (RST) Command : Bit device number to be reset/ Word device bit designation (bits) Word device number to be reset (BIN 16 bits) Internal Devices Constants Others Data Word –– Function (1) When the execution command is turned ON, the status of the designated devices becomes as shown below: Device Device Status...
  • Page 82 Program Example (1) The following program sets the value of the data register to 0. [Ladder Mode] Stores the values of X10 to X1F in D8 when X0 is turned ON. Sets the value of D8 to 0 when X5 is turned ON. (2) The following program resets the 100 ms retentive timer and counter.
  • Page 83: Setting And Resetting The Annunciators (Set F, Rst F)

    SET F, RST F 5.3.7 Setting and resetting the annunciators (SET F, RST F) SET F, RST F Command Command : Number of the annunciator to be set (F number) (bits) : Number of the annunciator to be reset (F number) (bits) Internal Devices Constants Others...
  • Page 84 SET F, RST F (3) When the value of SD63 is "16", the annunciator numbers are deleted from SD64 to SD79 by the use of the RST instruction. If the annunciators whose numbers are not registered in SD64 to SD79 are ON, these numbers will be registered. If all annunciator numbers from SD64 to SD79 are turned OFF, the "USER"...
  • Page 85: Leading Edge And Trailing Edge Output (Pls, Plf)

    PLS, PLF 5.3.8 Leading edge and trailing edge output (PLS, PLF) PLS, PLF Command Command : Pulse conversion device (bits) Internal Devices Constants Others Data Word –– Function (1) Turns ON the designated device when the execution command is turned OFF ON, and turns OFF the device in any other case the execution command is turned OFF ON (i.e., at...
  • Page 86 PLS, PLF (3) When designating a latch relay (L) for the execution command and turning the power supply OFF to ON with the latch relay ON, the execution command turns OFF to ON at the first scan, executing the PLS instruction and turning ON the designated device. The device turned ON at the first scan after power-ON turns OFF at the next PLS instruction.
  • Page 87 PLS, PLF (2) The following program executes the PLF instruction when X9 goes OFF. [Ladder Mode] [Timing Chart] X9 OFF M9 OFF 1 scan 5.3 Output Instruction 5-35 5.3.8 Leading edge and trailing edge output (PLS, PLF)
  • Page 88: Bit Device Output Reverse (Ff)

    5.3.9 Bit device output reverse (FF) Command : Device number of the device to be reversed (bits) Internal Devices Constants Others Data Word –– Function (1) Reverses the output status of the device designated by when the execution command is turned OFF Device Status Device...
  • Page 89 (2) The following program reverses b10 (bit 10) of D10 when X0 goes ON. [Ladder Mode] [Timing Chart] b10 of D10 5.3 Output Instruction 5-37 5.3.9 Bit device output reverse (FF)
  • Page 90: Master Control Instructions

    MC, MCR Master Control Instructions 5.4.1 Setting and resetting the master control (MC, MCR) MC, MCR Command Master control ladder : Nesting (N0 to N14) (Nesting) : Number of the device to turn ON (bits) Internal Devices Others Constants Data Word ––...
  • Page 91 MC, MCR (1) If the execution command of the MC instruction is ON when master control is commenced, the result of the operation from the MC instruction to the MCR instruction will be exactly as the instruction (ladder) shows. If the execution command of the MC instruction is OFF, the result of the operation from the MC instruction to the MCR instruction will be as shown below: Device Device Status...
  • Page 92 MC, MCR Program Example (1) The master control instruction can be used in nesting. The different master control regions are distinguished by nesting (N). Nesting can be performed from N0 to N14. The use of nesting enables the creation of ladders which successively limit the execution condition of the program.
  • Page 93 MC, MCR Cautions when Using Nesting Architecture (1) Nesting can be used up to 15 times (N0 to N14) When using nesting, nests should be inserted from the lower to higher nesting number (N) with the MC instruction, and from the higher to the lower order with the MCR instruction. If this order is reversed, there will be no nesting architecture, and the safety CPU module will not be capable of performing correct operations.
  • Page 94: Termination Instruction

    Termination Instruction 5.5.1 End sequence program (END) Internal Devices Constants Others Data Word –– –– Function (1) The termination of a sequence program is indicated. Execution of the END instruction will cause the safety CPU module to terminate the program that was being executed.
  • Page 95: Other Instructions

    NOP, NOPLF, PAGE n Other Instructions 5.6.1 No-operation (NOP, NOPLF, PAGE n) NOP, NOPLF, PAGE n In the ladder display, NOP is not displayed. Command NOPLF NOPLF PAGE n PAGE n Internal Devices Constants Others Data Word –– –– Function (1) This is a no operation instruction that has no impact on any operations up to that point.
  • Page 96 NOP, NOPLF, PAGE n Operation Error (1) There are no errors associated with the NOP, NOPLF, or PAGE instructions. Program Example (1) Contact closed..Deletes AND or ANI instruction. [Ladder Mode] Before change Changing to NOP After change (2) Contact closed..LD, LDI changed to NOP (Note carefully that changing the LD and LDI instructions to NOP completely changes the nature of the ladder.) [Ladder Mode]...
  • Page 97 NOP, NOPLF, PAGE n [Ladder Mode] Before change Changing to LD T3 Changing to NOP After change NOPLF [Ladder Mode] 5.6 Other Instructions 5-45 5.6.1 No-operation (NOP, NOPLF, PAGE n)
  • Page 98 NOP, NOPLF, PAGE n • Printing the ladder will result in the following: NOPLF A page break will be inserted between ladder blocks with the presence of NOPLF instruction. PAGE n [Ladder Mode] 5.6 Other Instructions 5-46 5.6.1 No-operation (NOP, NOPLF, PAGE n)
  • Page 99: Basic Instructions

    BASIC INSTRUCTIONS Reference Category Processing Details section Comparison operation Compares data to data instruction Adds, subtracts, multiplies, divides, increments, or Arithmetic operation instruction decrements data with other data Data conversion instructions Converts data types Data transfer instruction Transmits designated data...
  • Page 100: Bin 16-Bit Data Comparisons (= , <> , >, <= , <, >=)

    =, <>, >, <=, <, >= Comparison Operation Instruction 6.1.1 BIN 16-bit data comparisons (= , <> , >, <= , <, >=) =, <>, >, <=, <, >= indicates "= / < > / > / <= / < / >=". Command Command Command...
  • Page 101 =, <>, >, <=, <, >= Operation Error (1) There are no operation errors associated with the instructions. Program Example (1) The following program compares the data at X0 to XF with the data at D3, and turns Y33 ON if the data is identical.
  • Page 102: Bin 32-Bit Data Comparisons (D=, D<>, D>, D<=, D<, D>=)

    D=, D< >, D>, D<=, D<, D>= 6.1.2 BIN 32-bit data comparisons (D=, D<>, D>, D<=, D<, D>=) D=, D< >, D>, D<=, D<, D>= indicates "D= / D< > / D> / D<= / D< / D>=". Command Command Command : Data for comparison or start number of the devices where the data for comparison is stored (BIN 32 bits) Internal Devices Constants...
  • Page 103 D=, D< >, D>, D<=, D<, D>= Operation Error (1) There are no operation errors associated with the D , D , D , D or D instruction. Program Example (1) The following program compares the data at X0 to X1F with the data at D3 and D4, and turns Y33 ON, if the data at X0 to X1F and the data at D3 and D4 match.
  • Page 104: Arithmetic Operation Instructions

    +(P), -(P) Arithmetic Operation Instructions 6.2.1 BIN 16-bit addition and subtraction operations (+(P), –(P)) +(P), -(P) When two data are set ( – indicates "+ / -". Command Command : Data for additing/subtracting or start number of the devices where the data for additing/subtracting is stored (BIN 16 bits) :Start number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits) S1 D...
  • Page 105 +(P), -(P) – (1) Subtracts 16-bit BIN data designated by from 16-bit BIN data designated by stores the result of the subtraction at the device designated by 5678 (BIN) 1234 (BIN) 4444 (BIN) (2) Values for can be designated between 32768 and 32767 (BIN, 16 bits).
  • Page 106 +(P), -(P) When three data are set ( – indicates "+ / -". Command Command Data to be added to/subtracted from or start number of the devices where the data to be added to/ subtracted from is stored (BIN 16 bits) Data for additing/subtracting or start number of the devices where the data for additing/subtracting is stored (BIN 16 bits) Start number of the devices where the addition/subtraction operation result will be stored (BIN 16 bits)
  • Page 107 +(P), -(P) – (1) Subtracts 16-bit BIN data designated by from 16-bit BIN data designated by stores the result of the subtraction at the device designated by 5678 (BIN) 1234 (BIN) 4444 (BIN) (2) Values for can be designated between 32768 and 32767 (BIN, 16 bits).
  • Page 108: Bin 32-Bit Addition And Subtraction Operations (D+(P), D-(P))

    D+(P), D-(P) 6.2.2 BIN 32-bit addition and subtraction operations (D+(P), D–(P)) D+(P), D-(P) When two data are set (( + 1, ) + ( + 1, + 1, ) – ( + 1, indicates "D+ / D-". Command D+, D Command D+P, : Data for additing/subtracting or start number of the devices where the data for additing/subtracting is stored...
  • Page 109 D+(P), D-(P) D – (1) Subtracts 32-bit BIN data designated by from 32-bit BIN data designated by stores the result of the subtraction at the device designated by D +1 b16 b15 b16 b15 b16 b15 567890 (BIN) 123456 (BIN) 444434 (BIN) (2) The values for can be designated at between...
  • Page 110 D+(P), D-(P) When three data are set (( + 1, ) + ( + 1, + 1, + 1, ) – ( + 1, indicates "D+ / D-". Command D+,D Command D+P, : Data to be added to/subtracted from or start number of the devices where the data to be added to/subtracted from is stored (BIN 32 bits) : Data for additing/subtracting or start number of the devices where the data for additing/subtracting is stored (BIN 32 bits)
  • Page 111 D+(P), D-(P) D – (1) Subtracts 32-bit BIN data designated by from 32-bit BIN data designated by stores the result of the subtraction at the device designated by b16 b15 b16 b15 b16 b15 567890 (BIN) 123456 (BIN) 444434 (BIN) (2) The values for can be designated at between 2147483648 and 2147483647...
  • Page 112: Bin 16-Bit Multiplication And Division Operations (*(P), /(P))

    *(P), /(P) 6.2.3 BIN 16-bit multiplication and division operations (*(P), /(P)) *(P), /(P) indicates " , /". Command Command , / P : Data to be multiplied/divided or start number of the devices where the data to be multiplied/divided is stored (BIN 16 bits) : Data for multiplying/dividing or start number of the devices where the data for multiplying/dividing is stored (BIN 16 bits)
  • Page 113 *(P), /(P) (1) Divides BIN 16-bit data designated by and BIN 16-bit data designated by , and stores the result in the device designated by Quotient Remainder 5678 (BIN) 1234 (BIN) 4 (BIN) 742 (BIN) (2) If a word device has been used, the result of the division operation is stored as 32 bits, and both the quotient and remainder are stored;...
  • Page 114: Bin 32-Bit Multiplication And Division Operations (D*(P), D/(P))

    D*(P), D/(P) 6.2.4 BIN 32-bit multiplication and division operations (D*(P), D/(P)) D*(P), D/(P) indicates "D , D/". Command D*, D/ Command P, D/ P : Data to be multiplied/divided or start number of the devices where the data to be multiplied/divided is stored (BIN 32 bits) : Data for multiplying/dividing or start number of the devices where the data for multiplying/dividing is stored (BIN 32 bits)
  • Page 115 D*(P), D/(P) (1) Divides BIN 32-bit data designated by and BIN 32-bit data designated by , and stores the result in the device designated by b31 b16 b31 b16 b31 b16 567890 (BIN) 123456 (BIN) 4 (BIN) 74066 (BIN) (2) With a word device, the division operation result is stored in 64 bits and both the quotient and remainder are stored.
  • Page 116: Incrementing And Decrementing 16-Bit Bin Data (Inc(P), Dec(P))

    INC(P), DEC(P) 6.2.5 Incrementing and decrementing 16-bit BIN data (INC(P), DEC(P)) INC(P), DEC(P) indicates "INC / DEC". Command INC, DEC Command INCP, DECP : Start number of devices for INC (+1)/DEC ( 1) operation (BIN 16 bits) Internal Devices Constants Others Data Word...
  • Page 117 INC(P), DEC(P) Program Example (1) The following program outputs the present value at the counter C0 to C20 to the area Y30 to Y3F in BCD, every time X8 is turned ON. (When present value is less than 9999) [Ladder Mode] Outputs the present value of C (D+Z1) to Y30 to Y3F.
  • Page 118: Incrementing And Decrementing 32-Bit Bin Data (Dinc(P), Ddec(P))

    DINC(P), DDEC(P) 6.2.6 Incrementing and decrementing 32-bit BIN data (DINC(P), DDEC(P)) DINC(P), DDEC(P) indicates "DINC / DDEC". Command DINC, DDEC Command DINCP, DDECP : Start number of devices for DINC(+1) or DDEC(–1) operation (BIN 32 bits) Internal Devices Constants Others Data Word ––...
  • Page 119 DINC(P), DDEC(P) Program Example (1) The following program adds 1 to the data at D0 and D1 when X0 is ON. [Ladder Mode] (2) The following program adds 1 to the data set at X10 to X27 when X0 goes ON, and stores the result at D3 and D4.
  • Page 120: Data Conversion Instructions

    BCD(P), DBCD(P) Data Conversion Instructions 6.3.1 Conversion from BIN data to 4-digit and 8-digit BCD (BCD(P), DBCD(P)) BCD(P), DBCD(P) BCD(P), DBCD(P) indicates "BCD / DBCD". Command BCD, DBCD Command BCDP, DBCDP : BIN data or start number of the devices where the BIN data is stored (BIN 16/32 bits) : Start number of the devices where BCD data will be stored (BCD 4/8 digits) Internal Devices Constants...
  • Page 121 BCD(P), DBCD(P) Operation Error (1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and the corresponding error code is stored into SD0. • The data of is other than 0 to 9999 at BCD instruction. (Error code: 4100) •...
  • Page 122: Conversion From Bcd 4-Digit And 8-Digit Data To Bin Data (Bin(P), Dbin(P))

    BIN(P), DBIN(P) 6.3.2 Conversion from BCD 4-digit and 8-digit data to BIN data (BIN(P), DBIN(P)) BIN(P), DBIN(P) indicates "BIN / DBIN". Command BIN, DBIN Command BINP, DBINP : BCD data or start number of the devices where the BCD data is stored (BCD 4/8 digits) : Start number of the devices where BIN data will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 123 BIN(P), DBIN(P) Operation Error (1) In the following cases, an operation error occurs, the error flag (SM0) turns ON, an error code is stored in SD0, and the instruction is not executed. • When values other than 0 to 9 are designated to any digits of .(Error code: 4100) In this regard, however, the error above can be suppressed by turning SM722 ON.
  • Page 124 BIN(P), DBIN(P) (2) The following program converts the BCD data at X10 to X37 to BIN when X8 is ON, and stores it at D0 and D1. (Addition of the BIN data converted from BCD at X20 to X37 and the BIN data converted from BCD at X10 to X1F) BCD digital switch Input power supply...
  • Page 125: Complement Of 2 Of Bin 16- And 32-Bit Data (Sign Reversal) (Neg(P), Dneg(P))

    NEG(P), DNEG(P) 6.3.3 Complement of 2 of BIN 16- and 32-bit data (sign reversal) (NEG(P), DNEG(P)) NEG(P), DNEG(P) indicates "NEG / DNEG". Command NEG, DNEG Command NEGP, DNEGP : Start number of the devices where the data for which complement of 2 is performed is stored (BIN 16/32 bits) Internal Devices Constants Others...
  • Page 126 NEG(P), DNEG(P) DNEG (1) Reverses the sign of the 32-bit device designated by and stores at the device designated 32 bits Before −218460 execution Sign conversion After 218460 execution (2) Used when reversing positive and negative signs. Operation Error (1) There are no operation errors associated with the NEG(P) or DNEG(P) instructions. Program Example (1) The following program calculates a total for the data at D10 through D20 when XA goes ON, and seeks an absolute value if the result is negative.
  • Page 127: Data Transfer Instructions

    MOV(P), DMOV(P) Data Transfer Instructions 6.4.1 16-bit and 32-bit data transfers (MOV(P), DMOV(P)) MOV(P), DMOV(P) indicates "MOV / DMOV". Command MOV, DMOV Command MOVP, DMOVP : Data to be transferred or the number of the device where the data to be transferred is stored (BIN 16/32 bits) : Number of the device where the data will be transferred (BIN 16/32 bits) Internal Devices Constants...
  • Page 128 MOV(P), DMOV(P) Program Example (1) The following program stores input data from X0 to XB at D8. [Ladder Mode] (2) The following program stores the constant K155 at D8 when X8 goes ON. [Ladder Mode] 009BH b8 b7 1 0 0 1 1 0 1 1 (3) The following program stores the data from D0 and D1 at D7 and D8.
  • Page 129: 16-Bit And 32-Bit Negation Transfers (Cml(P), Dcml(P))

    CML(P), DCML(P) 6.4.2 16-bit and 32-bit negation transfers (CML(P), DCML(P)) CML(P), DCML(P) indicates "CML / DCML". Command CML, DCML Command CMLP, DCMLP : Data to be reversed or the number of the device where data to be reversed is stored (BIN 16/32 bits) : Number of the device where the reversing result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 130 CML(P), DCML(P) Program Example (1) The following program inverts the data from X0 to X7, and transfers result to D0. [Ladder Mode] [Operation] When "Number of bits of (S) < Number of bits of (D)" These bits are 1 1 0 1 0 0 0 0 all regarded as 0.
  • Page 131 CML(P), DCML(P) (4) The following program inverts the data at X0 to X1F, and transfers results to D0 and D1. [Ladder Mode] [Operation] When "Number of bits of (S) < Number of bits of (D)" X8 X7 These bits are 0 1 0 0 0 1 1 1 0 0 1 0 1 1 0 0 all regarded as 0...
  • Page 132: Block 16-Bit Data Transfers (Bmov(P))

    BMOV(P) 6.4.3 Block 16-bit data transfers (BMOV(P)) BMOV(P) Command BMOV BMOV Command BMOVP BMOVP : Start number of the devices where the data to be transferred is stored (BIN 16 bits) : Start number of the devices of transfer destination (BIN 16 bits) n : Number of data to be transferred (BIN 16 bits) Internal Devices Constants...
  • Page 133 BMOV(P) Operation Error (1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and the corresponding error code is stored into SD0. • The device range of n-points from exceeds the corresponding device range. (Error code: 4101) Program Example (1) The following program outputs the lower 4 bits of data at D66 to D69 to Y30 to Y3F in 4-point...
  • Page 134: Identical 16-Bit Data Block Transfers (Fmov(P))

    FMOV(P) 6.4.4 Identical 16-bit data block transfers (FMOV(P)) FMOV(P) Command FMOV FMOV Command FMOVP FMOVP : Data to be transferred or the start number of the devices where the data to be transferred is stored (BIN 16 bits) : Start number of the devices of transfer destination (BIN 16 bits) n : Number of data to be transferred (BIN 16 bits) Internal Devices Constants...
  • Page 135 FMOV(P) Operation Error (1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and the corresponding error code is stored into SD0. • The device range of n-points from or exceeds the corresponding device range. (Error code: 4101) Program Example (1) The following program outputs the lower 4 bits of D0 when XA goes ON to Y10 to Y23 in...
  • Page 136 MEMO 6-38...
  • Page 137: Application Instructions

    APPLICATION INSTRUCTIONS Reference Category Processing Details section Logical operation instructions Logical operations such as logical sum, logical product, etc.
  • Page 138: Logical Operation Instructions

    Logical Operation Instructions (1) The logical operation instructions perform logical sum, logical product or other logical operations in 1-bit units. Example Formula for Category Processing Details Operation Logical product Becomes 1 only when both input A and A * B (AND) input B are 1;...
  • Page 139: Logical Products With 16-Bit And 32-Bit Data (Wand(P), Dand(P))

    WAND(P), DAND(P) 7.1.1 Logical products with 16-bit and 32-bit data (WAND(P), DAND(P)) WAND(P), DAND(P) When two data are set ( + 1, + 1, + 1, indicates "WAND / DAND". Command WAND,DAND Command WANDP,DANDP : Data for a logical product operation or the start number of the devices where the data is stored (BIN 16/32 bits) : Start number of the devices where the logical product operation result will be stored (BIN 16/32 bits) Internal Devices...
  • Page 140 WAND(P), DAND(P) (2) When bit devices are designated, the bit devices below the points designated as digits are regarded as "0" in the operation. (See Program Example (2)) Operation Error (1) There are no operation errors associated with the WAND(P) or DAND(P) instruction. Program Example (1) The following program masks the digit in the 10s place of the 4-digit BCD value at D10 (second digit from the end) to 0 when XA is turned ON.
  • Page 141 WAND(P), DAND(P) When three data are set ( + 1, indicates "WAND / DAND". Command WAND,DAND Command WANDP,DANDP : Data for a logical product operation or the start number of the devices where the data is stored (BIN 16/32 bits) Start number of the devices where the logical product operation result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 142 WAND(P), DAND(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. (See Program Example (3)) Operation Error (1) There are no operation errors associated with the WAND(P) or DAND(P) instruction. Program Example (1) The following program performs a logical product operation on the data from X10 to X1B and the data at D33 when XA is ON, and stores the results at D40.
  • Page 143 WAND(P), DAND(P) (3) The following program masks the digit in the hundred-thousands place of the 8-digit BCD value at D10 and D11 (sixth digit from the end) to 0 when XA is ON, and outputs the results to from Y10 to Y2B. [Ladder Mode] [Operation] D10, D11(BCD12345678) 0...
  • Page 144: Logical Sums Of 16-Bit And 32-Bit Data (Wor(P), Dor(P))

    WOR(P), DOR(P) 7.1.2 Logical sums of 16-bit and 32-bit data (WOR(P), DOR(P)) WOR(P), DOR(P) When two data are set ( indicates "WOR / DOR". Command WOR, DOR Command WORP, DORP : Data for a logical sum operation or start number of the devices where the data is stored (BIN 16/32 bits) : Start number of the devices where the logical sum operation result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 145 WOR(P), DOR(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. Operation Error (1) There are no operation errors associated with the WOR(P) or DOR(P) instructions. Program Example (1) The following program performs a logical sum operation on the data at D10 and D20 when XA goes ON, and stores the results at D10.
  • Page 146 WOR(P), DOR(P) When three data are set ( indicates "WOR / DOR". Command WOR, DOR Command WORP, DORP : Data for a logical sum operation or start number of the devices where the data is stored (BIN 16/32 bits) Start number of the devices where the logical sum operation result will be stored (BIN 16/32 bits) Internal Devices Constants Others...
  • Page 147 WOR(P), DOR(P) (2) When bit devices are designated, the bit devices below the points designated as digits are regarded as "0" in the operation. (See Program Example (2)) Operation Error (1) There are no operation errors associated with the WOR(P) or DOR(P) instructions. Program Example (1) The following program performs a logical sum operation on the data from X10 to X1B, and the data at D33, and stores the result at Y30 to Y3B when XA is ON.
  • Page 148: 16-Bit And 32-Bit Exclusive Or Operations (Wxor(P), Dxor(P))

    WXOR(P), DXOR(P) 7.1.3 16-bit and 32-bit exclusive OR operations (WXOR(P), DXOR(P)) WXOR(P), DXOR(P) When two data are set ( indicates "WXOR / DXOR". Command WXOR, DXOR Command WXORP, DXOR : Data for an exclusive OR operation or start number of the devices where the data is stored (BIN 16/32 bits) : Start number of the devices where the exclusive OR operation result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 149 WXOR(P), DXOR(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. Operation Error (1) There are no operation errors associated with the WXOR(P) or DXOR(P) instructions. Program Example (1) The following program performs an exclusive OR operation on the data at D10 and D20 when XA is ON, and stores the result at D10.
  • Page 150 WXOR(P), DXOR(P) When three data are set ( indicates "WXOR / DXOR". Command WXOR, DXOR Command WXORP, DXORP : Data for an exclusive OR operation or start number of the devices where the data is stored (BIN 16/32 bits) Start number of the devices where the exclusive OR operation result will be stored (BIN 16/32 bits) Internal Devices Constants Others...
  • Page 151 WXOR(P), DXOR(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. Operation Error (1) There are no operation errors associated with the WXOR(P) or DXOR(P) instructions. Program Example (1) The following program conducts an exclusive OR operation on the data from X10 to X1B and the data at D33 when X10 is ON, and outputs the result to from Y30 to Y3B.
  • Page 152: 16-Bit And 32-Bit Data Exclusive Nor Operations (Wxnr(P), Dxnr(P))

    WXNR(P), DXNR(P) 7.1.4 16-bit and 32-bit data exclusive NOR operations (WXNR(P), DXNR(P)) WXNR(P), DXNR(P) When two data are set indicates "WXNR / DXNR". Command WXNR, DXNR Command WXNRP, DXNRP : Data for an exclusive NOR operation or start number of the devices where the data is stored (BIN 16/32 bits) : Start number of the devices where the exclusive NOR operation result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 153 WXNR(P), DXNR(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. Operation Error (1) There are no operation errors associated with the WXNR(P) or DXNR(P) instructions. Program Example (1) The following program compares the bit pattern of the 16-bit data from X30 to X3F with the bit pattern of the 16-bit data at D99 when X6 is ON [Ladder Mode]...
  • Page 154 WXNR(P), DXNR(P) When three data are set ( indicates a symbol of "WXNR / DXNR". Command WXNR, DXNR Command WXNRP, DXNRP : Data for an exclusive NOR operation or start number of the devices where the data is stored (BIN 16/32 bits) Start number of the devices where the exclusive NOR operation result will be stored (BIN 16/32 bits) Internal Devices Constants...
  • Page 155 WXNR(P), DXNR(P) (2) For bit devices, the bit devices below the points designated by digit specification are regarded as "0" in the operation. Operation Error (1) There are no operation errors associated with the WXNR(P) or DXNR(P) instructions. Program Example (1) The following program performs an exclusive NOR operation on the 16-bit data from X30 to X3F and the data at D99 when X0 is turned ON, and stores the results to D7.
  • Page 156 MEMO 7-20...
  • Page 157: Qscpu Dedicated Instructions

    QSCPU DEDICATED INSTRUCTIONS Reference Category Processing Details section Forced control stop instruction Forced control stop...
  • Page 158: Forced Control Stop Instruction (S.qsabort)

    S.QSABORT Forced Control Stop Instruction (S.QSABORT) S.QSABORT Command S.QSABORT S.QSABORT : Data to be stored in SD16 as the abort code, or the number of the device where the data is stored (BIN 16 bits). Internal Devices Constants Others Data K, H Word ––...
  • Page 159 S.QSABORT (3) Program abort information is stored in the individual information (SD16 to SD26). Device Meaning SD16 Abort code (The first argument of the S.QSABORT instruction is stored.) SD17 SD18 SD19 SD20 SD21 Empty (Fixed at 0) SD22 SD23 SD24 SD25 SD26 (4) If the abort code is designated using digit designation of a bit device, the data of the...
  • Page 160 MEMO...
  • Page 161: Error Code

    ERROR CODE...
  • Page 162: Error Code List

    Error Code List The QS series CPU module uses the self diagnostics function to display error information (LED indication) and stores the information into the special relay SM and special register SD, when an error occurs in the following situations: •...
  • Page 163: Error Codes

    9.1.1 Error codes Errors are detected by the self diagnostic function of the CPU module or detected during communication with the CPU module. The relation between the error detection pattern, error detection location and error code is shown in Table9.1. Table9.1 Reference destination Error detection Error detection pattern...
  • Page 164: Error Code List (1000 To 1999)

    9.1.3 Error code list (1000 to 1999) The following shows the error messages from the error code 1000 to 1999, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 165 1009 supply module, CPU module, or base supply module, CPU module, or base unit. unit is failure. (Contact your local Mitsubishi representative.) Entire program was executed without the execution of an END instruction. • Take noise reduction measures. • When the END instruction is •...
  • Page 166 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status 1131 1132 At power-ON/ 1133 At reset 1136 Error 1137 RAM ERROR – Flicker Stop information 1141 1142 Always 1143 1146...
  • Page 167 1401 initial processing. expecting a hardware fault. (Please • The size of the buffer memory of the consult your local Mitsubishi Service or intelligent function module is invalid. representative.) • The hardware test of the module installed in the slot indicated by •...
  • Page 168 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status CONTROL- At power ON/ 1411 Module No. – Flicker Stop BUS ERROR At reset CONTROL- 1413 – – Flicker Stop Always...
  • Page 169 1411 (On error occurring, the head I/O CPU module or base unit is faulty. number of the corresponding intelligent (Contact your local Mitsubishi function module is stored in the representative.) common information.) The intelligent function module, CPU...
  • Page 170: Error Code List (2000 To 2999)

    9.1.4 Error code list (2000 to 2999) The following shows the error messages from the error code 2000 to 2999, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 171 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) Read the common information of the error using the GX Developer, and • Intelligent function module check and/or change the module that information at power ON are corresponds to the numerical values changed.
  • Page 172 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status INTELLIGENT At an FUNCTION Program error 2112 Module No. Flicker Stop execution of MODULE location instruction ERR. MODULE At power ON/ 2124 LAYOUT...
  • Page 173 • The intelligent function module is 2125 • There was no response from the experiencing a hardware fault. intelligent function module. (Contact your local Mitsubishi representative.) There is no parameter file at the Set the parameter file to the program 2200 program memory.
  • Page 174: Error Code List (3000 To 3999)

    9.1.5 Error code list (3000 to 3999) The following shows the error messages from the error code 3000 to 3999, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 175 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) The PLC parameter settings for timer Read the detailed information of the time limit setting, the RUN-PAUSE error using the GX Developer, check the 3000 contact and number of vacant slots is parameter items corresponding to those outside the range that can be used by numerical values (parameter numbers),...
  • Page 176 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status NETWORK File name/ Parameter At power ON/ 3100 PARAMETER Flicker Stop Drive No. number At reset ERROR 9-16 9.1 Error Code List 9.1.5 Error code list (3000 to 3999)
  • Page 177 • The station type for a CC-Link IE correction, a hardware failure is controller network has been changed considered. (Please consult your while the power is ON. local Mitsubishi representative.) (RESET RUN is required for changing the station type.) 3100 • The number of modules actually •...
  • Page 178 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status NETWORK File name/ Parameter At power ON/ 3101 PARAMETER Flicker Stop Drive No. number At reset ERROR NETWORK File name/ Parameter At power ON/...
  • Page 179 • The MELSECNET/H inherent correction, a hardware failure is parameter setting is incorrect. considered. (Please consult your local Mitsubishi representative.) • Check the setting in Network parameter and actual mounting status, and if they differ, correct either • The number of modules actually...
  • Page 180 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status NETWORK File name/ Parameter At power ON/ 3104 PARAMETER Flicker Stop Drive No. number At reset ERROR CC-LINK File name/ Parameter At power ON/...
  • Page 181 • If the error occurs after correction, it parameters is different from that of suggests a hardware fault. (Contact the actually mounted module. your local Mitsubishi representative.) • The station type of the CC-Link module count setting parameters is different from that of the actually mounted station.
  • Page 182: Error Code List (4000 To 4999)

    9.1.6 Error code list (4000 to 4999) The following shows the error messages from the error code 4000 to 4999, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 183 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) • The program contains an instruction code that cannot be decoded. 4000 • An unusable instruction is included in the program. • The name of dedicated instruction specified in the program is incorrect. •...
  • Page 184 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status When OPERATION Program error Off/ 4101 – Flicker Stop instruction ERROR location executed. At an OPERATION Program error 4102 –...
  • Page 185 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) • The designated device number for data processed by the instruction Read the common information of the exceeds the usable range. error using GX Developer, check and 4101 • Alternatively, the stored data or correct the error step corresponding to constants for the devices designated its value (program error location).
  • Page 186: Error Code List (5000 To 5999)

    9.1.7 Error code list (5000 to 5999) The following shows the error messages from the error code 5000 to 5999, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 187 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) The program scan time exceeded the Read the individual information of the WDT value specified in the PLC RAS 5001 error with the GX Developer, check its setting of the PLC parameter dialog value (time), and shorten the scan time.
  • Page 188: Error Code List (8000 To 9000)

    9.1.8 Error code list (8000 to 9000) The following shows the error messages from the error code 8000 to 9000, the contents and causes of the errors, and the corrective actions for the errors. Error Common Individual LED Status Error Diagnostic Code Information...
  • Page 189 (SD0) This suggests a CPU module hardware Error is detected by the inside register 8000 fault. (Contact your local Mitsubishi diagnostics built in the CPU module. representative.) This suggests a CPU module hardware Error is detected inside the bus of the 8010 fault.
  • Page 190 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status 8070 At power ON/ 8071 INTERNAL At reset Error 8072 COMMUNI- – Flicker Stop information CATION ERROR 8073 When an END instruction 8074...
  • Page 191 CPU A and CPU B cannot receive data If the same error is displayed again, this 8072 from each other. suggests a CPU module hardware fault. (Contact your local Mitsubishi CPU A and CPU B cannot send data to 8073 representative.) each other.
  • Page 192 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status CC-LINK Stop/ Flicker/ PRODUCT CC-Link Safety CC-Link Safety 8310 Always Continues Off/On INFO. information information MISMATCH While 8320 initializing remote station 8321...
  • Page 193 Error Corresponding Code Error Contents and Cause Corrective Action (SD0) Check that [Model name], [Module technical version] or [Production information] of the CC-Link Safety remote station set in the network The installed product is different from 8310 parameter matches the product the specified one by network parameter.
  • Page 194 Error Common Individual LED Status Error Diagnostic Code Information Information Operation Message ERROR Timing (SD0) (SD5 to 15) (SD16 to 26) Status 8330 8331 8332 CC-LINK Stop/ Flicker/ CC-Link Safety CC-Link Safety RECEIVED Always Continues Off/On information information DATA ERROR 8333 8334 When...
  • Page 195 CC- 8331 Link Safety remote module (Contact occurred. your local Mitsubishi representative.) • Check if the link ID setting of the relevant remote station and the link ID that has been set in the network The link ID in receiving data is different parameter are identical.
  • Page 196: Canceling Errors

    Canceling Errors CPU module can perform the cancel operation for errors only when the errors allow the CPU module to continue its operation. To cancel the errors, follow the steps shown below. 1) Read the special register SD81 with GX Developer and confirm the cause of the continuation error that currently occurs in the CPU module.
  • Page 197 1. When the error is canceled with the error code to be canceled stored in the SD50, the lower one digit of the code is neglected. (Example) If error codes 2100 and 2106 occur, and error code 2100 to cancel error code 2106.
  • Page 198 MEMO 9-38...
  • Page 199: Appendicies

    APPENDICIES App-1...
  • Page 200: Appendix 1 Operation Processing Timea Appendix 1.1Definition

    Appendix 1 OPERATION PROCESSING TIME Appendix 1.1 Definition (1) Processing time taken by the QSCPU is the total of the following processing times. • Total of each instruction processing time • END processing time • I/O refresh time • Service processing time (2) Instruction processing time This is the total of processing time of each instruction shown in Appendix 1.2.
  • Page 201 Appendix 1 OPERATION PROCESSING TIME Appendix 1.2 Operation Processing Time The processing times for the individual instructions are shown in the table on the following pages. Operation processing times can vary substantially depending on the nature of the sources and destinations of the instructions, and the values contained in the following tables should therefore be taken as a set of general guidelines to processing times rather than as being strictly accurate.
  • Page 202 Instruction Conditions (Device) Processing Time (µs) (OFF OFF) When not changed 0.10 (OFF When changed OFF) (OFF OFF) When not changed D0.0 0.20 (OFF When changed OFF) When OFF When displayed When Display completed When not executed 0.55 After Time Up 0.55 When 0.55...
  • Page 203 Instruction Conditions (Device) Processing Time (µs) When not executed 0.10 When not changed 0.10 (OFF OFF) When executed When changed 0.10 OFF) When not executed 0.20 When not changed 0.20 D0.0 When executed When changed 0.20 (OFF When not executed 0.10 When executed 0.10...
  • Page 204: Appendix 1.2Operation Processing Time

    (2) Basic instructions The processing time when the instruction is not executed is calculated as follows: 0.10 (Number of steps of each instruction +1) µs Instruction Conditions (Device) Processing Time (µs) When continuity established 0.40 LD = When no continuity 0.40 When not executed 0.35...
  • Page 205 Instruction Conditions (Device) Processing Time (µs) When not executed 0.35 AND < = When continuity established 0.40 When executed When no continuity 0.40 When not executed 0.35 OR < = When continuity established 0.40 When executed When no continuity 0.40 When continuity established 0.40 LD <...
  • Page 206 Instruction Conditions (Device) Processing Time (µs) When not executed 0.40 ANDD < = When continuity established 0.50 When executed When no continuity 0.50 When not executed 0.40 ORD < = When continuity established 0.50 When executed When no continuity 0.50 When continuity established 0.50 LDD <...
  • Page 207 Instruction Conditions (Device) Processing Time (µs) –– 0.35 INCP DINC –– 0.45 DINCP –– 0.35 DECP DDEC –– 0.45 DDECP –– BCDP DBCD –– DBCDP –– BINP DBIN –– DBINP –– NEGP DNEG –– DNEGP 0.35 = D0, = D1 MOVP DMOV 0.45...
  • Page 208 (3) Application instructions The processing time when the instruction is not executed is calculated as follows: 0.10 (Number of steps of each instruction +1) µs Instruction Conditions (Device) Processing Time (µs) WAND When executed 0.50 WANDP WAND S1 S2 When executed 0.60 WANDP S1 S2...
  • Page 209: Appendix 2 Special Relay List

    Appendix 2 SPECIAL RELAY LIST Special relays, SM, are internal relays whose applications are fixed in the Programmable Controller. For this reason, they cannot be used by sequence programs in the same way as the normal internal relays. However, they can be turned ON or OFF as needed in order to control the CPU module and remote I/O modules.
  • Page 210 (1) Diagnostic Information TableApp.2.2 Descriptions of the special relay headings Set by Corresponding Number Name Meaning Explanation (When Set) • Turns ON when an error is detected by diagnostics Diagnostic OFF : No error (Includes when an annunciator is ON) S (Error) errors ON : Error...
  • Page 211 (2) System information TableApp.2.3 Special relay Set by Corresponding Number Name Meaning Explanation (When Set) SM203 STOP contact STOP status • Turns ON when the CPU is in STOP status. S (Status change) • Writes clock data stored in SD210 to SD213 Clock data set OFF : Ignored to the CPU module after the END instruction...
  • Page 212 (5) Boot operation TableApp.2.6 Special relay Set by Corresponding Number Name Meaning Explanation (When Set) (On the TEST MODE) • Turns ON during the boot operation from OFF : Program memory standard ROM. execution SM660 Boot operation • Turns OFF when the boot operation from S (Initial) ON : During boot standard ROM is not run.
  • Page 213: Appendix 3 Special Register List

    Appendix 3 SPECIAL REGISTER LIST Special relays, SM, are internal relays whose applications are fixed in the Programmable Controller. For this reason, it is not possible to use these registers in sequence programs in the same way that normal registers are used. However, data can be written as needed in order to control the CPU modules and remote I/ O modules.
  • Page 214 (1) Diagnostic Information TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) • Error codes for errors detected by diagnostics are stored as Diagnostic Diagnosis error BIN data. S (Error) errors code • Contents identical to latest fault history information. •...
  • Page 215 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) • Common information corresponding to the error codes (SD0) is stored here. • The following six types of information are stored here: Module No./Base No. Number Meaning Slot No./Base No. I/O No.
  • Page 216 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) Time (value set) Number Meaning Time : 1 s units (0 to 999 s) Time : 1ms units (0 to 65535ms) SD10 (Empty) SD11 SD12 SD13 SD14 SD15 Program error location Meaning Number...
  • Page 217 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) • Individual information corresponding to error codes (SD0) is stored here. • There are the following nine different types of information are SD16 stored. File name/Drive name Meaning (Example) File name = Number SD17...
  • Page 218 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) 10) CC-Link Safety information SD16 Meaning Number SD16 Number of items for individual information SD17 individual information 1 SD18 individual information 2 SD17 SD19 individual information 3 SD20 individual information 4 SD21 individual information 5...
  • Page 219 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) I/O module I/O module • The lowest I/O number of the module where the I/O module SD61 verify error verify error S (Error) verification number took place. number module number Annunciator Annunciator...
  • Page 220 TableApp.3.2 Special register Set by Corresponding Number Name Meaning Explanation (When set) • When I/O modules, of which data are different from those entered at power-on, have been detected, the I/O module SD150 numbers (in units of 16 points) are entered in bit pattern. Bit pattern, in (Preset I/O module numbers set in parmeters when parameter units of 16...
  • Page 221 TableApp.3.4 Special register Set by Corresponding Number Name Meaning Explanation (When set) • The year (last two digits) and month are stored as BCD code at SD210 as shown below: Example: Clock data SD210 Clock data September, 2006 (year, month) 0609 Year Month...
  • Page 222 TableApp.3.4 Special register Set by Corresponding Number Name Meaning Explanation (When set) Base type Installed Q differentiation base Empty SD242 0: Base not S (Initial) presence/ Main base unit installed absence 1: QS**B is installed b4 b3 to b0 SD243 Empty Main No.
  • Page 223 Set by Corresponding Number Name Meaning Explanation (When set) Number of points SD300 • Stores the number of points currently set for ST devices assigned for ST Number of points SD301 • Stores the number of points currently set for C devices Device assigned for C assignment...
  • Page 224 (4) Scan information TableApp.3.6 Special register Set by Corresponding Number Name Meaning Explanation (When set) • The current scan time is stored into SD520 and SD521. Current scan (Measurement is made in 100 s units.) SD520 time (in 1 ms SD520: Stores the value of ms.
  • Page 225 (5) Safety CPU TableApp.3.7 Special register Set by Corresponding Number Name Meaning Explanation (When set) • Stores the safety CPU operation mode. b2 b1b0 Safety CPU Empty Safety CPU S (Status SD560 operation operation mode change) 00 : SAFETY MODE mode 01 : TEST MODE 10 : SAFETY MODE...
  • Page 226 (7) CC-Link Safety TableApp.3.9 Special register Set by Corresponding Number Name Meaning Explanation (When set) • The specified status of safety remote station is stored. • "0" is stored for the standard remote station. Safety remote 0: No safety station remote station SD1000 SD1000...
  • Page 227 TableApp.3.9 Special register Set by Corresponding Number Name Meaning Explanation (When set) Cancel the I/O interlock of safety station by changing the bit of register from 0 to 1. 0: Not cancel the Safety station I/O interlock interlock SD1076 of safety SD1076 cancel request station...
  • Page 228 TableApp.3.9 Special register Set by Corresponding Number Name Meaning Explanation (When set) Bit corresponding to the station number turns 1 when the master station goes to the interlock status after the error was detected at the master station. Safety station interlock 0: Interlock is SD1272...
  • Page 229: Index

    INDEX Index-1...
  • Page 230 [Symbols] BIN (Conversion from BCD 4-digit data to BIN data) ...............6-24 * (BIN 16-bit multiplication operations) ....6-14 BIN 16-bit addition and subtraction operations + (BIN 16-bit addition operations) ......6-6 (+, -) ................6-6 - (BIN 16-bit subtraction operations) ....... 6-6 BIN 16-bit data comparisons / (BIN 16-bit division operations) ......
  • Page 231 DBIN (Conversion from BCD 8-digit data to BIN data) 6-24 DCML (32-bit negation transfers) ......6-31 Identical 16-bit data block transfers (FMOV) ..6-36 DDEC (Decrementing 32-bit BIN data) ....6-20 INC (Incrementing 16-bit BIN data) ......6-18 DEC (Decrementing 16-bit BIN data) ....6-18 Incrementing Decrementing 16-bit BIN data (INC) ........6-18...
  • Page 232 NOPLF (No operation / page break) ..... 5-43 QSCPU Dedicated Instruction List ......2-16 Operation error ............. 3-10 Operation results inversion (INV) ......5-12 Read (MRD) ............5-9 Operation results pop (MPP) ........5-9 Reading an error code ..........9-3 Operation results pulse Reset (RST) ............5-29 Edge relay memory (EGF, EGP) .....
  • Page 233 MEMO Index-5...
  • Page 234 1. Limited Warranty and Product Support. a. Mitsubishi Electric Company ("MELCO") warrants that for a period of eighteen (18) months after date of delivery from the point of manufacture or one year from date of Customer's purchase, whichever is less, Mitsubishi MELSEC Safety programmable logic controllers (the "Products") will be free from defects in material and workmanship.
  • Page 235 g. The Product information and statements contained on MELCO's website and in catalogs, manuals, technical bulletins or other materials provided by MELCO are provided as a guide for Customer's use. They do not constitute warranties and are not incorporated in the contract of sale for the Products. h.
  • Page 236 Microsoft, Windows, Windows NT are registered trademarks of Microsoft Corporation in the United States and other countries. Pentium and Celeron are trademarks of Intel Corporation in the United States and other countries. Ethernet is a trademark of Xerox Co., Ltd. in the United States. CompactFlash is a trademark of SanDisk Corporation.

Table of Contents