Download Print this page

Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs

Advertisement

MELSEC iQ-R Programming Manual
(Instructions, Standard Functions/Function Blocks)

Advertisement

loading

  Related Manuals for Mitsubishi Electric MELSEC iQ-R Series

  Summary of Contents for Mitsubishi Electric MELSEC iQ-R Series

  • Page 1 MELSEC iQ-R Programming Manual (Instructions, Standard Functions/Function Blocks)
  • Page 3: Safety Precautions

    (Read these precautions before using this product.) Before using MELSEC iQ-R series programmable controllers, please read the manuals for the product and the relevant manuals introduced in those manuals carefully, and pay full attention to safety to handle the product correctly.
  • Page 4 • When the Safety CPU is used (1) Although MELCO has obtained the certification for Product's compliance to the international safety standards IEC61508, EN954-1/ISO13849-1 from TUV Rheinland, this fact does not guarantee that Product will be free from any malfunction or failure. The user of this Product shall comply with any and all applicable safety standard, regulation or law and take appropriate safety measures for the system in which the Product is installed or used and shall take the second or third safety measures other than the Product.
  • Page 5: Introduction

    Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the MELSEC iQ-R series programmable controller to handle the product correctly. When applying the program examples provided in this manual to an actual system, ensure the applicability and confirm that it will not cause system control problems.
  • Page 6: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 7 CC-Link Instructions ..............139 Serial Communication Instructions .
  • Page 8 No operation (NOPLF)..............217 CHAPTER 6 BASIC INSTRUCTIONS Comparison Operation Instructions .
  • Page 9 Bit Processing Instructions ............. . 340 Setting a bit in the word device .
  • Page 10 Converting hexadecimal ASCII data to 32-bit binary data ......... 448 Converting decimal ASCII data to BCD 4-digit data .
  • Page 11 Disabling interrupt programs with specified priority or lower ........544 Interrupt program mask .
  • Page 12 Replacing the specified string data ............695 Searching string data.
  • Page 13 Calculating the arc cosine of BCD data............803 Calculating the arc tangent of BCD data .
  • Page 14 7.17 Pulse Related Instructions ............. . . 894 Measuring the density of pulses .
  • Page 15 7.25 Clock Instructions ..............1001 Reading clock data .
  • Page 16 Reading socket communications receive data ..........1107 Predefined Protocol Support Function Instruction .
  • Page 17 Pulse integration ............... 1227 11.3 Control Operation Instructions .
  • Page 18 Reading device data from another CPU module ..........1405 Writing device data to another CPU module .
  • Page 19 Reading receive data (for interrupt programs)..........1550 Sending data .
  • Page 20 20.9 Sending Data by Using User Frames............1699 20.10 Clearing Receive Data.
  • Page 21 25.19 Converting INT to BOOL ..............1814 25.20 Converting INT to WORD .
  • Page 22 CHAPTER 26 SINGLE VARIABLE FUNCTIONS 1893 26.1 Calculating the Absolute Value ............1893 26.2 Calculating the Square Root .
  • Page 23 32.8 Searching String Data ..............1960 CHAPTER 33 TIME DATA TYPE FUNCTIONS 1962 33.1...
  • Page 24 INDEX 2092 INSTRUCTION INDEX 2093 REVISIONS ................2104 WARRANTY .
  • Page 25: Relevant Manuals

    System configuration, parameter settings, and online e-Manual [SH-081215ENG] operations of GX Works3 e-Manual refers to the Mitsubishi Electric FA electronic book manuals that can be browsed using a dedicated tool. e-Manual has the following features: • Required information can be cross-searched in multiple manuals.
  • Page 26: Terms

    CPU module The abbreviation for the MELSEC iQ-R series CPU module D/A converter module A generic term for the MELSEC iQ-R series digital-analog converter module, channel isolated digital-analog converter module, and high speed digital-analog converter module Engineering tool The product name of the software package for the MELSEC programmable controllers...
  • Page 27 A generic term for the safety global label, safety local label, and standard/safety shared label ( MELSEC iQ-R Programming Manual (Program Design)) Standard CPU A generic term for MELSEC iQ-R series CPU modules (other than Safety CPU) that perform standard control (This term is used to distinguish from the Safety CPU.) Standard control Machine control by standard programs and standard data communications.
  • Page 28 Instruction symbols Unless otherwise specified, this manual uses the following generic symbols for some instructions. Classification Instruction symbol Generic symbol PID control instruction S(P).PIDINIT, PIDINIT(P) PIDINIT S(P).PIDCONT, PIDCONT(P) PIDCONT S(P).PIDPRMW, PIDPRMW(P) PIDPRMW Multiple CPU dedicated instruction D(P).DDRD, M(P).DDRD DDRD D(P).DDWR, M(P).DDWR DDWR Network common instruction JP.READ, GP.READ...
  • Page 29: Manual Page Organization

    MANUAL PAGE ORGANIZATION In this manual, pages are organized and the symbols are used as shown below. How to read Part 3 and Part 4 The following illustration is for explanation purpose only, and should not be referred to as an actual documentation. Ò...
  • Page 30  Instruction symbol • An instruction symbol followed by parentheses indicates multiple instructions. For example, "GRY(P)(_U)" indicates four instructions: GRY, GRYP, GRY_U, and GRYP_U. Instruction symbol Meaning Instruction symbol followed by "(P)" This instruction is executed only on the rising edge (off to on). Instruction symbol followed by "(_U)"...
  • Page 31  Precautions  Error code and error details if the instruction has any possible operation error • A device in which an error code is stored is provided in the error code column. When an error code is stored in SD0, an error flag (SM0) turns on.
  • Page 32 How to read Part 5 and Part 6 The following illustration is for explanation purpose only, and should not be referred to as an actual documentation. Ò Ó Ô Õ Ö ×  Function symbol A function symbol followed by parentheses indicates multiple functions or function blocks. For example, "BOOL_TO_DINT(_E)"...
  • Page 33  Description of operands, types, data types, and label data types • For the data type, refer to the following. Page 36 Data Specification Method  Processing details of the standard function or standard function block  Error code and error details if the standard function or standard function block has any possible operation error A device in which an error code is stored is provided in the error code column.
  • Page 34 MEMO...
  • Page 35: Part 1 Overview

    PART 1 OVERVIEW This part consists of the following chapter. 1 OVERVIEW...
  • Page 36: Instruction Configuration

    OVERVIEW Instruction Configuration Many instructions available for programmable controllers are each divided into the instruction part and device part. The instruction part and device part are used as follows. • Instruction part: Indicates the function of the relevant instruction. • Device part: Indicates the data used for the instruction. The device part is further classified to source data, destination data, and numerical data.
  • Page 37 Numerical value (n) For the numerical values of the numbers of devices, transfers, data, and character strings, specify those used by an instruction which uses multiple devices or an instruction which specifies the numbers of repetitions, data to be processed, and character strings.
  • Page 38: Data Specification Method

    Data Specification Method The following table lists the types of data that can be used for instructions in CPU modules. Data Classification Bit data Bit data 16-bit data (word data) 16-bit signed binary data 16-bit unsigned binary data 32-bit data (double word data) 32-bit signed binary data 32-bit unsigned binary data 64-bit data (quad-word data)
  • Page 39 Device data The following table lists devices and constants that can be used to specify the setting data of instructions. Data type Description Specifiable device/constant Bit data can be handled. • Bit device Page 40 Bit data • Bit specification of word device Word Word data can be handled.
  • Page 40 Label data The following table lists labels that can be used to specify the setting data of instructions. ■Primitive data type Data type (label) Specifiable label • Bit type label (BOOL) • Bit-specified word [unsigned]/bit string [16 bits] type label •...
  • Page 41 ■Generic data type The generic data type is the data type of the labels which summarize several primitive data types. Generic data types are used when multiple data types are allowed for arguments and return values of functions or function blocks.
  • Page 42: Bit Data

    Bit data Data size and data range Bit data is handled in increments of bits such as contacts and coils. Data name Data size Value range Bit data 1 bit 0, 1 Handling bit data with bit devices and labels Bit data of one point per point can be handled.
  • Page 43 Handling bit data with word type labels By specifying a bit number for a word type label, bit data of the specified bit number can be handled. A bit in a word type label can be specified by "Label name.Bit number". L_INT.0 L_INT[1].0 L_STRUCT[1].S_INT.0...
  • Page 44: 16-Bit Data (Word Data)

    16-bit data (word data) Data size and data range 16-bit data includes signed and unsigned 16-bit data. In signed 16-bit data, a negative number is represented in two's complement. Data name Data size Value range Decimal notation Hexadecimal notation Signed 16-bit data 16 bits (1 word) -32768 to 32767 0000H to FFFFH...
  • Page 45 Digit specification range The following table lists the range of 16-bit data for each digit specification. Digit Decimal notation Hexadecimal notation specification 0 to 15 0H to FH 0 to 255 00H to FFH 0 to 4095 000H to FFFH Signed 16-bit data: -32768 to 32767 0000H to FFFFH Unsigned 16-bit data: 0 to 65535...
  • Page 46 Handling 16-bit data with word devices/labels ■Word device One point of word device can handle 16-bit data. ■Word type label One point of word type label can handle 16-bit data. 1 OVERVIEW 1.2 Data Specification Method...
  • Page 47: 32-Bit Data (Double Word Data)

    32-bit data (double word data) Data size and data range 32-bit data includes signed and unsigned 32-bit data. In signed 32-bit data, a negative number is represented in two's complement. Data name Data size Value range Decimal notation Hexadecimal notation Signed 32-bit data 32 bits (2 word) -2147483648 to 2147483647...
  • Page 48 Digit specification range The following table lists the range of 32-bit data for each digit specification. Digit Decimal notation Hexadecimal notation specification 0 to 15 0H to FH 0 to 255 00H to FFH 0 to 4095 000H to FFFH 0 to 65535 0000H to FFFFH 0 to 1048575...
  • Page 49 ■Specifying a bit device with digit specification in the source (s) When a bit device with digit specification is specified in the source of an instruction, 0 is stored in the bits, which follow the bit for which digit specification is made in the source, in the word device of the destination. Ladder example Processing •...
  • Page 50: Real Number Data (Floating-Point Data)

    Real number data (floating-point data) Data size and data range Real number data includes single-precision 32-bit real number data and double-precision 64-bit real number data. Real number data can be stored only in devices other than bit devices or in single-precision or double-precision real data type labels.
  • Page 51 Configuration of double-precision real number data Double-precision real number data consists of a sign, mantissa, and exponent, and is expressed as shown below. Exponent × 2 Sign Mantissa The following figure shows the bit configuration of the internal expression of double-precision real number data and the meaning of each part.
  • Page 52 The monitor function of the engineering tool can monitor real number data of CPU modules. To represent "0" in real number data, set all numbers in each of the following range to 0. • Single-precision real number data: b0 to b31 •...
  • Page 53: String Data

    String data Format of character string data The following table lists the types of character string data, each of which ends with a NULL code to be handled as a character string. Type Character code Last character Character string ASCII code, Shift JIS code NULL(00H) Unicode character string Unicode (UTF-16 (little endian))
  • Page 54 Number of words required for storing data Character string data can be stored in word devices. The following table lists the numbers of words required for storing character string data. Number of Number of words required for storing character Number of words required for storing Unicode character string strings character strings...
  • Page 55: Execution Condition

    Execution Condition Types of execution conditions The following table lists the execution conditions of instructions. Execution condition Description An instruction is executed during on. It is executed only while the precondition of the instruction is on. When the precondition is off, the instruction is not executed. Rising edge An instruction is executed one time when turned on.
  • Page 56: High-Speed Instruction Processing

    High-speed Instruction Processing Subset processing Subset processing can reduce the number of steps or speed up the instruction processing when the device and label specified by each operand of an instruction satisfy the specified conditions. Instruction symbols and the number of operands do not change whether subset processing is applicable or not. Instructions that support subset processing For the availability of subset processing for each instruction, refer to the following.
  • Page 57: Precautions On Programming

    Precautions on Programming Errors common to instructions The following table lists the conditions under which an error occurs when the instruction is executed. Error content Error code An I/O number which is out of range (other than 000H to FFFH and 3E0H to 3E3H) is specified. 2800H An I/O number which corresponds to no module is specified.
  • Page 58 Checking the range of file register When a file register is specified in an instruction, a range check is performed, so a program needs to be created so that the operation result falls within the range of the relevant file register. If a range exceeding that of the file register (ZR) is specified, an error (error code: 2820) occurs.
  • Page 59: Operation When A Long Timer Or Long Retentive Timer Device Is Used

    Operation when a long timer or long retentive timer device is used When the data to be handled exceeds the width (32 bits) of the current value, the long timer or long retentive timer operates by using not only the area of the current value but also the areas of the previous value, contact, and coil. Device Configuration Timer (T)
  • Page 60 To batch-transfer the current values of the long timer device When the BMOV instruction is used, all current values, contacts, and coils are batch-transferred. BMOVP Current value Coil Contact FRT previous value Current value Coil Contact FRT previous value Current value Contact Coil FRT previous value...
  • Page 61: Operations Arising When The Out, Set/Rst, And Pls/Plf Instructions Of The Same Device Are Used

    Operations arising when the OUT, SET/RST, and PLS/PLF instructions of the same device are used This section describes the operation when two or more OUT, SET/RST, and PLS/PLF instructions that use the same device are executed within one scan. In safety programs executed by the Safety CPU, replace some words as follows: •...
  • Page 62 If SET/RST instructions of the same device are used ■For SET instructions The SET instruction turns on the specified device if the execution command is on, and causes no operation if it is off. Thus, if two or more SET instructions of the same device are executed during one scan, the specified device turns on even if one execution command is on.
  • Page 63 If PLS instructions of the same device are used The PLS instruction turns on the specified device when the execution command specifies an off-to-on change. The specified device is turned off unless the execution command specifies an off-to-on change (i.e. off to off, on to on, on to off). Thus, if two or more PLS instructions of the same device are issued during one scan, the specified device is turned on when the execution command of each PLS instruction specifies an off-to-on change.
  • Page 64 • If the off-to-on changes of X0 and X1 are at the same timing PLS M0 PLS M0 PLS M0 (1) Since X0 turns on, M0 turns on. (2) Since X1 turns on, M0 remains off. (3) Since X0 is other than turning on, M0 turns off. (4) Since X1 is other than turning on, M0 remains off.
  • Page 65 If PLF instructions of the same device are used The PLF instruction turns on the specified device when the execution command specifies an off-to-on change. The specified device is turned off unless the execution command specifies an on-to-off change (i.e. off to off, off to on, on to on). Thus, if two or more PLS instructions of the same device are issued during one scan, the specified device is turned on when the execution command of each PLS instruction specifies an on-to-off change.
  • Page 66 • If the on-to-off changes of X0 and X1 are at the same timing PLF M0 PLF M0 PLF M0 (1) Since X0 turns off, M0 turns on. (2) Since X1 turns off, M0 remains on. (3) Since X0 is other than turning off, M0 turns off. (4) Since X1 is other than turning off, M0 remains off.
  • Page 67: Restrictions On Using File Registers

    Restrictions on using file registers When a file register is specified for the refresh device, note the following restrictions. When a file register having the same name as a program is specified If the use of a file register having the same name as a program is specified in the parameter, refresh cannot be performed correctly.
  • Page 68 MEMO 1 OVERVIEW 1.5 Precautions on Programming...
  • Page 69: Part 2 Lists Of Instructions And Fun/Fb

    PART 2 LISTS OF INSTRUCTIONS AND FUN/FB This part consists of the following chapters. 2 CPU MODULE INSTRUCTIONS 3 MODULE DEDICATED INSTRUCTIONS 4 STANDARD FUNCTIONS/FUNCTION BLOCKS...
  • Page 70: Chapter 2 Cpu Module Instructions

    CPU MODULE INSTRUCTIONS The following table summarizes how to read the instruction lists. Item Description Instruction symbol An instruction name Processing details An overview of the instruction Reference Section where detailed information is described Sequence Instructions Contact instructions ■Operation start, series connection, parallel connection Instruction symbol Processing details Reference...
  • Page 71 ■Pulse NOT operation start, pulse NOT series connection, pulse NOT parallel connection Instruction symbol Processing details Reference LDPI Turns on when the specified device is off, on, or at the falling edge (on to off). (Rising edge pulse Page 165 LDPI, LDFI, NOT operation start instruction) ANDPI, ANDFI, ORPI, ORFI...
  • Page 72 Output instructions ■Out (excluding the timer, counter, and annunciator) Instruction symbol Processing details Reference Outputs the operation result to the specified device. Page 175 OUT ■Timer, long timer Instruction symbol Processing details Reference OUT T Starts time measurement when the operation result up to the OUT instruction is on. When time is Page 177 OUT T, up, the normally open contact turns on (continuity state) and the normally closed contact turns off OUTH T, OUT ST,...
  • Page 73 Shift instructions ■Shifting bit devices Instruction symbol Processing details Reference Shifts the on/off state of the device area just before the one specified to the specified device area, Page 205 SFT(P) and turns off the shift source device. SFTP Master control instructions ■Setting/resetting a master control Instruction symbol Processing details...
  • Page 74: Basic Instructions

    Basic Instructions Comparison operation instructions ■Comparing 16-bit binary data Instruction symbol Processing details Reference LD=, AND=, OR= Compares the two sets of 16-bit binary data specified. (Devices are used as normally open Page 218 LD(_U), contacts.) AND(_U), OR(_U) LD=_U, AND=_U, OR=_U LD<>, AND<>, OR<>...
  • Page 75 ■Outputting a comparison result of 32-bit binary data Instruction symbol Processing details Reference DCMP Compares the 32-bit binary data specified by (s1) with the 32-bit binary data specified by (s2), Page 224 DCMP(P)(_U) and according to the result (small, equal, or large), (d), (d)+1, or (d)+2 is turned on. DCMPP DCMP_U DCMPP_U...
  • Page 76 Arithmetic operation instructions ■Adding/subtracting 16-bit binary data Instruction symbol Processing details Reference Adds the two sets of 16-bit binary data specified. (Two operands) Page 235 +(P)(_U) [when two operands are set] +P_U Adds the two sets of 16-bit binary data specified. (Three operands) Page 237 +(P)(_U) [when three operands are set]...
  • Page 77 ■Multiplying/dividing 32-bit binary data Instruction symbol Processing details Reference Multiplies the two sets of 32-bit binary data specified. Page 255 D*(P)(_U) D*_U D*P_U Performs division between the two sets of 32-bit binary data specified. Page 257 D/(P)(_U) D/_U D/P_U ■Adding/subtracting BCD 4-digit data Instruction symbol Processing details Reference...
  • Page 78 ■Adding/subtracting 16-bit binary block data Instruction symbol Processing details Reference Adds the two 16-bit binary data blocks specified. Page 282 BK+(P)(_U) BK+P BK+_U BK+P_U Performs subtraction between the two 16-bit binary data blocks specified. Page 284 BK-(P)(_U) BK-P BK-_U BK-P_U ■Adding/subtracting 32-bit binary block data Instruction symbol Processing details...
  • Page 79 Logical operation instructions ■Performing an AND operation on 16-bit/32-bit data Instruction symbol Processing details Reference WAND Performs an AND operation on the two sets of 16-bit binary data specified. (Two operands) Page 300 WAND(P) [when two operands WANDP are set] WAND Performs an AND operation on the two sets of 16-bit binary data specified.
  • Page 80 ■Performing an XOR operation on 16-bit block data Instruction symbol Processing details Reference BKXOR Performs an XOR operation on the two 16-bit binary data blocks specified. Page 328 BKXOR(P) BKXORP (s1) (s2) ■Performing an XNOR operation on 16-bit/32-bit data Instruction symbol Processing details Reference WXNR...
  • Page 81 Bit processing instructions ■Setting/resetting a bit in the word device Instruction symbol Processing details Reference BSET Sets the 'n'th bit in the specified word device to 1. Page 340 BSET(P) BSETP BRST Resets the 'n'th bit in the specified word device to 0. Page 342 BRST(P) BRSTP ■Performing a bit test...
  • Page 82 ■Converting BCD 4-digit/8-digit data to 16-bit/32-bit binary data Instruction symbol Processing details Reference Converts the specified BCD 4-digit data (0 to 9999) to 16-bit binary data. Page 382 BIN(P) BINP DBIN Converts the specified BCD 8-digit data (0 to 99999999) to 32-bit binary data. Page 384 DBIN(P) DBINP (s)+1, (s)
  • Page 83 ■Converting double-precision real number to 16-bit/32-bit unsigned binary data Instruction symbol Processing details Reference DBL2UINT Converts the specified double-precision real number (0 to 65535) to 16-bit unsigned binary data. Page 396 DBL2UINT(P) DBL2UINTP (s)+3, (s)+2, (s)+1, (s) (1) Real number DBL2UDINT Converts the specified double-precision real number (0 to 4294967295) to 32-bit unsigned binary Page 400...
  • Page 84 ■Converting 32-bit unsigned binary data to 16-bit unsigned binary data Instruction symbol Processing details Reference UDINT2UINT Converts the 32-bit unsigned binary data in the device specified by (s) to 16-bit unsigned binary Page 422 data, and stores the converted data in the device specified by (d). UDINT2UINT(P) UDINT2UINTP ■Converting 16-bit/32-bit binary data to 16-bit/32-bit binary Gray code data...
  • Page 85 ■Converting BCD 4-digit data block to 16-bit binary data block Instruction symbol Processing details Reference BKBIN Batch-converts the (n) points of BCD data in the device starting from the one specified by (s) to Page 436 BKBIN(P) binary data, and stores the converted data in the device specified by (d) and later. BKBINP ■Converting decimal ASCII data to 16-bit/32-bit binary data Instruction symbol...
  • Page 86 ■Two's complement of 16-bit/32-bit binary data (sign inversion) Instruction symbol Processing details Reference Inverts the sign of 16-bit binary device. Page 467 NEG(P) NEGP DNEG Inverts the sign of 32-bit binary device. Page 469 DNEG(P) DNEGP (d)+1, (d) (d)+1, (d) ■Decoding 8-bit data to 256-bit data Instruction symbol Processing details...
  • Page 87 Shift instructions ■Shifting 16-bit binary data to the right/left by n bit(s) Instruction symbol Processing details Reference Shifts the 16-bit binary data in the specified device to the right. Page 350 SFR(P) SFRP bn-1 (SM700) 0∙∙∙0 Shifts the 16-bit binary data in the specified device to the left. Page 352 SFL(P) SFLP bn+1 bn...
  • Page 88 ■Shifting n-bit data to the right/left by n bit(s) Instruction symbol Processing details Reference SFTBR Shifts the n-bit data starting from the specified device to the right by n bit(s). Page 362 SFTBR(P) SFTBRP (n1) (n2) (SM700) SFTR Shifts the (n2) bit(s) of area to the right within the (n1) bits of data area starting from the specified Page 364 SFTR(P) device.
  • Page 89 ■Shifting n-word data to the right/left by n word(s) Instruction symbol Processing details Reference SFTWR Shifts the n-word data starting from the specified device to the right by n word(s). Page 370 SFTWR(P) SFTWRP (n1) (n2) WSFR Shifts the (n2) word(s) of area to the right within the (n1) words of data area starting from the Page 372 WSFR(P) specified device.
  • Page 90 Data transfer instructions ■Transferring 16-bit/32-bit binary data Instruction symbol Processing details Reference Transfers the 16-bit binary data in the device specified. Page 490 MOV(P) MOVP DMOV Transfers the 32-bit binary data in the device specified. Page 492 DMOV(P) DMOVP (s)+1, (s) (d)+1, (d) ■Inverting and transferring 16-bit/32-bit binary data Instruction symbol...
  • Page 91 ■Transferring the same 16-bit binary data block (32 bits) Instruction symbol Processing details Reference FMOVL Transfers 16-bit binary data to the (n) points starting from the device specified. Page 509 FMOVL(P) FMOVLP (n) = 1 to 4294967295 ■Transferring the same 32-bit binary data block (16 bits) Instruction symbol Processing details Reference...
  • Page 92 ■Exchanging the upper and lower bytes of 32-bit binary data Instruction symbol Processing details Reference DSWAP Exchanges upper and lower 8-bit data in the specified device. Page 522 DSWAP(P) ··· b8 b7 ··· ··· b8 b7 ··· (d)+1 8 bits 8 bits 8 bits 8 bits...
  • Page 93: Application Instructions

    Application Instructions Rotation instructions ■Rotating 16-bit binary data to the right Instruction symbol Processing details Reference Rotates the 16-bit binary data to the right by (n) bit(s) (not including the carry flag). Page 527 ROR(P), RCR(P) RORP (SM700) (1) Right rotation by (n) bits Rotates the 16-bit binary data to the right by (n) bit(s) (including the carry flag).
  • Page 94 ■Rotating 32-bit binary data to the left Instruction symbol Processing details Reference DROL Rotates the 32-bit binary data to the left by (n) bit(s) (not including the carry flag). Page 535 DROL(P), DRCL(P) DROLP (d)+1 (SM700) ∙∙∙ b16 b15 ∙∙∙ (1) Left rotation by (n) bits DRCL Rotates the 32-bit binary data to the left by (n) bit(s) (including the carry flag).
  • Page 95 ■Resetting the watchdog timer Instruction symbol Processing details Reference Resets the watchdog timer. Page 554 WDT(P) WDTP Structure creation instructions ■Performing the FOR to NEXT instruction loop Instruction symbol Processing details Reference Executes the processing between FOR to NEXT (n) times. Page 555 FOR, NEXT NEXT ■Forcibly terminating the FOR to NEXT instruction loop...
  • Page 96 Data table operation instructions ■Reading the oldest data from the data table Instruction symbol Processing details Reference FIFR Stores the data first stored in the table in the specified device. Page 583 FIFR(P) FIFRP (d)+1 N: Number of data ■Reading the newest data from the data table Instruction symbol Processing details Reference...
  • Page 97 Reading/writing data instructions ■Reading data from the data memory Instruction symbol Processing details Reference S.DEVLD Reads data from the device data storage file in data memory. Page 594 S(P).DEVLD SP.DEVLD ■Writing data to the data memory Instruction symbol Processing details Reference SP.DEVST Writes the specified number of points of data to the device data storage file in data memory.
  • Page 98 ■Transferring string data Instruction symbol Processing details Reference $MOV Transfers the character strings in the device specified by (s) to the device specified by (d) and later. Page 638 $MOV(P) $MOVP $MOV_WS Transfers the Unicode character strings in the device specified by (s) to the device specified by (d) Page 640 and later.
  • Page 99 ■Converting Unicode character string to Shift JIS character string Instruction symbol Processing details Reference WS2SJIS Converts the Unicode character string in the device specified by (s) to the shift JIS character string, Page 681 WS2SJIS(P) and stores the converted data in the device specified by (d). WS2SJISP ■Converting shift JIS character string to Unicode character string (without byte order mark) Instruction symbol...
  • Page 100 Real number instructions ■Comparing single-precision real numbers Instruction symbol Processing details Reference LDE=, ANDE=, ORE= Performs a comparison operation of a single-precision real number. (Devices are used as a Page 704 LDE, normally open contact.) ANDE, ORE LDE<>, ANDE<>, ORE<> LDE>, ANDE>, ORE>...
  • Page 101 ■Adding/subtracting double-precision real numbers Instruction symbol Processing details Reference Adds double-precision real numbers. (Using two operands) Page 725 ED+(P) [when two operands ED+P are set] Adds double-precision real numbers. (Using three operands) Page 727 ED+(P) [when three operands ED+P are set] Performs subtraction between double-precision real numbers.
  • Page 102 ■Converting 16-bit/32-bit signed binary data to double-precision real number Instruction symbol Processing details Reference INT2DBL Converts the 16-bit signed binary data in the device specified by (s) to a double-precision real Page 751 INT2DBL(P) number, and stores the real number in the device specified by (d). INT2DBLP DINT2DBL Converts the 32-bit signed binary data in the device specified by (s) to a double-precision real...
  • Page 103 ■Transferring double-precision real number Instruction symbol Processing details Reference EDMOV Transfers double-precision real number data to the specified device. Page 770 EDMOV(P) EDMOVP (s)+3, (s)+2, (s)+1, (s) (d)+3, (d)+2, (d)+1, (d) (1) Real number ■Calculating the sine of single-precision real number Instruction symbol Processing details Reference...
  • Page 104 ■Calculating the arc cosine of double-precision real number Instruction symbol Processing details Reference ACOSD Calculates the angle from the cosine specified by a double-precision real number. Page 791 ACOSD(P) ACOSDP ■Calculating the arc tangent of double-precision real number Instruction symbol Processing details Reference ATAND...
  • Page 105 ■Calculating the arc cosine of BCD data Instruction symbol Processing details Reference BACOS Calculates the arc cosine of the angle specified by a BCD value. Page 803 BACOS(P) BACOSP (d)+1 (d)+2 (d): Sign (d)+1: Integral part (d)+2: Decimal part ■Calculating the arc tangent of BCD data Instruction symbol Processing details Reference...
  • Page 106 ■Calculating the square root of single-precision real number Instruction symbol Processing details Reference ESQRT Calculates the square root of the value specified by a single-precision real number. Page 815 ESQRT(P) ESQRTP (s)+1, (s) (d)+1, (d) ■Calculating the square root of double-precision real number Instruction symbol Processing details Reference...
  • Page 107 ■Calculating the common logarithm of single-precision real number Instruction symbol Processing details Reference LOG10 Calculates the logarithm using the common logarithm (using 10 as the base) of the value specified Page 835 LOG10(P) by a single-precision real number. LOG10P ■Calculating the common logarithm of double-precision real number Instruction symbol Processing details Reference...
  • Page 108 Random number instructions ■Generating random number, changing random sequence Instruction symbol Processing details Reference Generates a random number between 0 and less than 32767, and stores the random number in Page 847 RND(P) the device specified by (d). RNDP SRND Changes the random number sequence according to the content of the 16-bit binary data stored in Page 848 SRND(P) the device specified by (s).
  • Page 109 ■Zone control of 16-bit/32-bit binary data Instruction symbol Processing details Reference ZONE Adds a bias value to the specified input value (16-bit binary). Page 865 ZONE(P)(_U) ZONEP ZONE_U ZONEP_U DZONE Adds a bias value to the specified input value (32-bit binary). Page 867 DZONE(P)(_U) DZONEP...
  • Page 110 Special timer instructions ■Teaching timer Instruction symbol Processing details Reference TTMR Measures the on time of the measurement command in seconds, multiplies it by a multiplier, and Page 883 TTMR stores the operation result. ×(s) (s)=0:1, (s)=1:10, (s)=2:100 : On time of TTMR ■Special function timer Instruction symbol Processing details...
  • Page 111 Check code instructions ■Check code Instruction symbol Processing details Reference Performs addition of the data stored in the devices specified by (s) to (s)+(n)-1 and calculate the Page 903 CCD(P) horizontal parity, and stores the added data in the device specified by (d) and the horizontal parity CCDP in the device specified by (d)+1.
  • Page 112 ■Checking the bit status in 16-bit/32-bit binary data Instruction symbol Processing details Reference Checks whether (n) bit(s) of the specified device are on or off, and stores the result in the device Page 918 BON(P) specified by (d). BONP DBON Checks whether (n) bit(s) of the specified device are on or off, and stores the result in the device Page 920 DBON(P) specified by (d).
  • Page 113 ■Calculating the mean value of 16-bit/32-bit binary data Instruction symbol Processing details Reference MEAN Calculates the average value of the (n) points of 16-bit data in the device starting from the one Page 938 specified by (s), and stores the average value in the device specified by (d). MEAN(P)(_U) MEANP MEAN_U...
  • Page 114 ■Importing data to the database Instruction symbol Processing details Reference DBIMPORT Imports the data set in the Unicode text file stored in the path specified by (s) to construct a Page 946 database. DBIMPORT(P) DBIMPORTP ■Exporting data from the database Instruction symbol Processing details Reference...
  • Page 115 Indirect address read instructions ■Reading the indirect address Instruction symbol Processing details Reference ADRSET Reads the indirect address of the specified device. Page 999 ADRSET(P) ADRSETP (1) Indirect address of specified device (2) Device name Clock instructions ■Reading clock data Instruction symbol Processing details Reference...
  • Page 116 ■Subtracting clock data Instruction symbol Processing details Reference DATE- Subtracts time data. Page 1007 DATE-(P) DATE-P (s1) (s2) hour hour hour minute minute minute second second second ■Converting time data from hour/minute/second to second Instruction symbol Processing details Reference TIME2SEC Converts time data from hour/minute/second to second.
  • Page 117 ■Reading expansion clock data Instruction symbol Processing details Reference S.DATERD Reads clock data including millisecond from the clock elements in the CPU module. Page 1025 S(P).DATERD SP.DATERD (d)+1 (d)+2 (d)+3 (d)+4 (d)+5 (d)+6 (d)+7 (d): Year (d)+1: Month (d)+2: Day (d)+3: Hour (d)+4: Minute (d)+5: Second...
  • Page 118 ■Hour meter Instruction symbol Processing details Reference HOURM Measures the period of time for which the start contact is ON in units of hour, and turns on the Page 1035 HOURM device specified by (d2) when the accumulated ON time reaches the time (16-bit binary data) specified in (s).
  • Page 119 ■Reading the module model name Instruction symbol Processing details Reference TYPERD Reads the module model name mounted on the slot specified by (H), and stores the model name in Page 1063 the device areas specified by (d) and later. TYPERD(P) TYPERDP ■Reading module specific information Instruction symbol...
  • Page 120: Built-In Ethernet Function Instructions

    Built-in Ethernet Function Instructions Open/close processing instructions ■Opening a connection Instruction symbol Processing details Reference SP.SOCOPEN Opens the connection specified by (s1). Page 1085 SP.SOCOPEN ■Closing a connection Instruction symbol Processing details Reference SP.SOCCLOSE Closes the connection specified by (s1). (Closing a connection) Page 1088 SP.SOCCLOSE Socket communications instructions...
  • Page 121 Predefined protocol support function instruction ■Executing the registered protocols Instruction symbol Processing details Reference SP.ECPRTCL Executes the protocol specified by the communication protocol support tool of the engineering tool. Page 1109 SP.ECPRTCL SLMP frame send instruction ■Sending an SLMP frame Instruction symbol Processing details Reference...
  • Page 122: Pid Operation Instruction

    PID Operation Instruction Performing PID operation Instruction symbol Processing details Reference Performs PID operation using the values set in (s1) to (s3), and stores the operation result in (d) at Page 1145 PID each cycle of sampling time. PID Control Instructions PID control instructions (inexact differential) ■Registering the PID control data to the CPU module Instruction symbol...
  • Page 123 ■Changing the parameters of specified loop number Instruction symbol Processing details Reference PIDPRMW Changes the operation parameter of the loop number in the device specified by (s1) to the PID Page 1179 control data stored in the device number specified by (s2) and later. PIDPRMW(P) PIDPRMWP 2 CPU MODULE INSTRUCTIONS...
  • Page 124: Process Control Instructions

    Process Control Instructions When a process control program is created, using process control function blocks is recommended. Process control function blocks have features as follows. • A process control program can be easily created by placing and connecting FB elements. •...
  • Page 125 Control operation instructions ■Basic PID control Instruction symbol Processing details Reference S.PID Performs process value derivative type (inexact differential) PID operation. Page 1232 S.PID The instruction performs the following processing steps: SV setting, tracking, gain (Kp) operation, PID operation, and deviation check. ■Two-degree-of-freedom PID control Instruction symbol Processing details...
  • Page 126 ■Derivative control Instruction symbol Processing details Reference Performs differential operation to the input data, and outputs the operation result. Page 1292 S.D ■Dead time Instruction symbol Processing details Reference S.DED Delays the output of the input data by the specified dead time. Page 1295 S.DED ■High selector Instruction symbol...
  • Page 127 ■Loop selector Instruction symbol Processing details Reference S.SEL Outputs the value selected by the selection signal from the input data in automatic mode, and Page 1338 S.SEL outputs the manipulated value (MV) in the loop tag memory in manual mode. ■Bumpless transfer Instruction symbol Processing details...
  • Page 128 ■Multiplication Instruction symbol Processing details Reference S.MUL Multiplies input data with a coefficient. Page 1372 S.MUL ■Division Instruction symbol Processing details Reference S.DIV Divides input data with a coefficient. Page 1374 S.DIV ■Square root Instruction symbol Processing details Reference S.SQR Outputs the square root () of input data.
  • Page 129: Multiple Cpu Dedicated Instructions

    Multiple CPU Dedicated Instructions Reading device data from another CPU module Instruction symbol Processing details Reference D.DDRD Reads the data in the device of another CPU module specified by (n), and stores the data to the Page 1405 read-source CPU module in a multiple CPU system. D(P).DDRD, DP.DDRD M(P).DDRD...
  • Page 130: Sfc Program Instructions

    SFC Program Instructions SFC control instructions ■Checking the status of a step Instruction symbol Processing details Reference LD [S/BL\S] Outputs the status (active or inactive) of the specified step as the operation result. (Normally open Page 1411 LD, LDI, contact instruction) AND, ANI, OR, ORI [S/BL\S] LDI [S/BL\S]...
  • Page 131 ■Pausing a block Instruction symbol Processing details Reference PAUSE [BL] Temporarily stops the step sequence in the specified block. Page 1429 PAUSE [BL] ■Restarting a block Instruction symbol Processing details Reference RSTART [BL] Releases the temporary stop, and restarts the sequence from the step where the sequence was Page 1431 RSTART stopped in the specified block.
  • Page 132: Redundant System Instructions

    2.10 Redundant System Instructions System switching Instruction symbol Processing details Reference SP.CONTSW Switches the systems (control system and standby system) during END processing of the scan Page 1440 where the instruction is executed. SP.CONTSW Disabling/enabling system switching Instruction symbol Processing details Reference DCONTSW Disables manual system switching.
  • Page 133: Chapter 3 Module Dedicated Instructions

    MODULE DEDICATED INSTRUCTIONS How to read the list is shown below. Item Description Instruction symbol Indicates the instruction name. Processing details Indicates the overview of an instruction. Reference Indicates the reference of detailed information. Network Common Instructions Link dedicated instructions ■Reading data from the programmable controller on another station Instruction symbol Processing details...
  • Page 134 ■Reading data from the programmable controller (Q series-compatible) Instruction symbol Processing details Reference J.ZNRD Reads data in units of words from a device in the programmable controller of another station. Page 1501 J(P).ZNRD JP.ZNRD ■Writing data to the programmable controller (Q series-compatible) Instruction symbol Processing details Reference...
  • Page 135: Ethernet Instructions

    Ethernet Instructions Open/close processing instructions ■Opening a connection Instruction symbol Processing details Reference GP.CONOPEN Establishes (opens) a connection with an external device for data communication. Page 1535 GP.CONOPEN ■Closing a connection Instruction symbol Processing details Reference GP.CONCLOSE Disconnects (closes) the connection from the external device during data communication. Page 1539 GP.CONCLOSE ■Opening a connection...
  • Page 136 ■Reading receive data (for interrupt programs) Instruction symbol Processing details Reference G.BUFRCVS Reads receive data from the external device through fixed buffer communications. This instruction Page 1557 is used in the interrupt program. G.BUFRCVS, Z.BUFRCVS Z.BUFRCVS ■Sending data Instruction symbol Processing details Reference GP.BUFSND...
  • Page 137: Cc-Link Ie Controller Network Instructions

    CC-Link IE Controller Network Instructions Remote RUN Instruction symbol Processing details Reference J.RRUN Sends a remote RUN request to the programmable controller of another station. Page 1576 J(P).RRUN, G(P).RRUN, JP.RRUN Z(P).RRUN G.RRUN GP.RRUN Z.RRUN ZP.RRUN Remote STOP Instruction symbol Processing details Reference J.RSTOP Sends a remote STOP request to the programmable controller of another station.
  • Page 138 Setting the station number to own station Instruction symbol Processing details Reference G.UINI Sets the station number of the own station. Page 1597 G(P).UINI, Z(P).UINI GP.UINI Z.UINI ZP.UINI • When the target station is QSCPU, the RRUN and RSTOP instructions cannot be used. •...
  • Page 139: Cc-Link Ie Field Network Instructions

    CC-Link IE Field Network Instructions Reading data from the intelligent device station/remote device station Instruction symbol Processing details Reference JP.REMFR Reads data from the buffer memory area of the intelligent device station or the remote device Page 1600 JP.REMFR, station in units of words (16-bit address specified). ZP.REMFR ZP.REMFR JP.REMFRD...
  • Page 140 Sending an SLMP frame Instruction symbol Processing details Reference J.SLMPREQ Sends an SLMP frame to the SLMP-compatible device in the same network. Data of the target Page 1638 station can be read/written and operated. J(P).SLMPREQ, JP.SLMPREQ G(P).SLMPREQ G.SLMPREQ GP.SLMPREQ The REMFR, REMTO, REMFRD, and REMTOD instructions cannot be executed in local stations. Execute them in the master station.
  • Page 141: Cc-Link Instructions

    CC-Link Instructions Reading data from the target station Instruction symbol Processing details Reference G.RIRD Reads data of the specified number of points from the buffer memory area of the target station or Page 1643 G(P).RIRD the device in the CPU module on the target station. GP.RIRD Writing data to the target station Instruction symbol...
  • Page 142: Serial Communication Instructions

    Serial Communication Instructions Sending data using the on-demand function Instruction symbol Processing details Reference G.ONDEMAND Sends data using the on-demand function of SLMP (MC protocol). Page 1673 G(P).ONDEMAND GP.ONDEMAND Executing the protocols registered for the predefined protocol support function Instruction symbol Processing details Reference G.CPRTCL...
  • Page 143 Sending data by using user frames Instruction symbol Processing details Reference G.PRR Sends data with user frames according to the specification in the user frame specification area for Page 1699 G(P).PRR sending, through communication with the nonprocedural protocol. GP.PRR Clearing receive data Instruction symbol Processing details Reference...
  • Page 144: A/D Conversion Instructions

    A/D Conversion Instructions Switching the mode Instruction symbol Processing details Reference G.OFFGAN Switches the analog module mode. Page 1724 • Normal mode to offset/gain setting mode G(P).OFFGAN GP.OFFGAN • Offset/gain setting mode to normal mode Reading the user range setting values Instruction symbol Processing details Reference...
  • Page 145: Positioning Instructions

    Positioning Instructions Restoring the absolute position Instruction symbol Processing details Reference G.ABRST1 Restores the absolute position of specified axis. Page 1765 G.ABRST, G.ABRST2 Z.ABRST G.ABRST3 G.ABRST4 Z.ABRST1 Z.ABRST2 Z.ABRST3 Z.ABRST4 Starting the positioning Instruction symbol Processing details Reference GP.PSTRT1 Starts positioning of the specified axis. Page 1769 GP.PSTRT, GP.PSTRT2...
  • Page 146: High Speed Data Logger Module Instructions

    High Speed Data Logger Module Instructions File access instructions ■Recipe write Instruction symbol Processing details Reference Z.RCPWRITE Writes device values of the CPU module to the specified recipe file in the SD memory card. Page 1781 Z(P).RCPWRITE ZP.RCPWRITE ■Recipe read Instruction symbol Processing details Reference...
  • Page 147: C Intelligent Function Module Instructions

    3.10 C Intelligent Function Module Instructions User function execution instruction Instruction symbol Processing details Reference G.CEXECUTE Instructs to execute a function for the pre-registered function. Page 1787 G(P).CEXECUTE GP.CEXECUTE 3 MODULE DEDICATED INSTRUCTIONS 3.10 C Intelligent Function Module Instructions...
  • Page 148: Chapter 4 Standard Functions/Function Blocks

    STANDARD FUNCTIONS/FUNCTION BLOCKS How to read the list is shown below. Item Description Function symbol and function block symbol A function and function block name are shown. Processing details An overview of the functions and function blocks is explained. Reference Indicates the reference of detailed information.
  • Page 149 ■Converting WORD to INT/DINT Function symbol Processing details Reference WORD_TO_INT Converts a value from WORD data type to INT data type. Page 1801 WORD_TO_INT(_E) WORD_TO_INT_E WORD_TO_DINT Converts a value from WORD data type to DINT data type. Page 1802 WORD_TO_DINT(_E) WORD_TO_DINT_E ■Converting WORD to TIME Function symbol...
  • Page 150 ■Converting INT to WORD/DWORD Function symbol Processing details Reference INT_TO_WORD Converts a value from INT data type to WORD data type. Page 1815 INT_TO_WORD(_E) INT_TO_WORD_E INT_TO_DWORD Converts a value from INT data type to DWORD data type. Page 1816 INT_TO_DWORD(_E) INT_TO_DWORD_E ■Converting INT to DINT Function symbol...
  • Page 151 ■Converting DINT to BCD Function symbol Processing details Reference DINT_TO_BCD Converts a value from DINT data type to BCD data type. Page 1831 DINT_TO_BCD(_E) DINT_TO_BCD_E ■Converting DINT to REAL/LREAL Function symbol Processing details Reference DINT_TO_REAL Converts a value from DINT data type to REAL data type. Page 1833 DINT_TO_REAL(_E) DINT_TO_REAL_E...
  • Page 152 ■Converting LREAL to INT/DINT Function symbol Processing details Reference LREAL_TO_INT Converts a value from LREAL data type to INT data type. Page 1854 LREAL_TO_INT(_E) LREAL_TO_INT_E LREAL_TO_DINT Converts a value from LREAL data type to DINT data type. Page 1856 LREAL_TO_DINT(_E) LREAL_TO_DINT_E ■Converting LREAL to REAL Function symbol...
  • Page 153 ■Converting STRING to INT/DINT Function symbol Processing details Reference STRING_TO_INT Converts a value from STRING data type to INT data type. Page 1870 STRING_TO_INT(_E) STRING_TO_INT_E STRING_TO_DINT Converts a value from STRING data type to DINT data type. Page 1872 STRING_TO_DINT(_E STRING_TO_DINT_E ■Converting STRING to BCD Function symbol...
  • Page 154 ■Getting the start data Function symbol Processing details Reference GET_BOOL_ADDR Outputs the top data of the specified data as the BOOL, INT, or WORD type data. Page 1892 GET_BOOL_ADDR, GET_INT_ADDR GET_INT_ADDR, GET_WORD_ADDR GET_WORD_ADDR Single variable functions ■Calculating the absolute value Function symbol Processing details Reference...
  • Page 155 Arithmetic operation functions ■Addition Function symbol Processing details Reference Outputs the sum of input values ((s1)+(s2)++(s28)). Page 1906 ADD(_E) ADD_E ■Multiplication Function symbol Processing details Reference Outputs the product of input values ((s1)(s2)(s28)). Page 1908 MUL(_E) MUL_E ■Subtraction Function symbol Processing details Reference Outputs the difference between input values ((s1)-(s2)).
  • Page 156 Boolean functions ■AND operation, OR operation, XOR operation Function symbol Processing details Reference Outputs the logical product of input values. Page 1927 AND(_E), OR(_E), XOR(_E) AND_E Outputs the logical sum of input values. OR_E Outputs the exclusive logical sum of input values. XOR_E ■NOT operation Function symbol...
  • Page 157 Comparison functions ■Comparing data Function symbol Processing details Reference Outputs the comparison result of input values. Page 1940 GT(_E), GE(_E), EQ(_E), GT_E LE(_E), LT(_E) GE_E EQ_E LE_E LT_E Page 1942 NE(_E) NE_E String functions ■Detecting a string length Function symbol Processing details Reference Detects and outputs the length of the string input.
  • Page 158 ■Replacing string data Function symbol Processing details Reference REPLACE Replaces the specified range in a character string, and outputs the operation result. Page 1957 REPLACE(_E) REPLACE_E ■Searching string data Function symbol Processing details Reference FIND Searches a character string, and outputs the operation result. Page 1960 FIND(_E) FIND_E Time data type functions...
  • Page 159: Standard Function Flocks

    Standard Function Flocks Bistable function blocks ■Bistable function block (set-dominant) Function block symbol Processing details Reference Discriminates between two input values, and outputs1 (TRUE) or 0 (FALSE). Page 1972 SR(_E) SR_E ■Bistable function block (reset-dominant) Function block symbol Processing details Reference Discriminates between two input values, and outputs1 (TRUE) or 0 (FALSE).
  • Page 160 ■Counter function block Function block symbol Processing details Reference COUNTER_FB_M Starts counting up when the execution condition is satisfied. Page 1987 COUNTER_FB_M Timer function blocks ■Pulse timer Function block symbol Processing details Reference Keeps the signal on for the specified period of time. Page 1989 TP(_E) TP_E ■On delay timer...
  • Page 161: Part 3 Cpu Module Instructions

    PART 3 CPU MODULE INSTRUCTIONS This part consists of the following chapters. 5 SEQUENCE INSTRUCTIONS 6 BASIC INSTRUCTIONS 7 APPLICATION INSTRUCTIONS 8 BUILT-IN ETHERNET FUNCTION INSTRUCTIONS 9 PID OPERATION INSTRUCTION 10 PID CONTROL INSTRUCTIONS 11 PROCESS CONTROL INSTRUCTIONS 12 MULTIPLE CPU DEDICATED INSTRUCTIONS 13 SFC PROGRAM INSTRUCTIONS 14 REDUNDANT SYSTEM INSTRUCTIONS...
  • Page 162: Chapter 5 Sequence Instructions

    SEQUENCE INSTRUCTIONS Contact Instructions Operation start, series connection, parallel connection LD, LDI, AND, ANI, OR, ORI RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • LD: Normally open contact operation start, LDI: Normally closed contact operation start These instructions output the on/off information of the specified device as the operation result. •...
  • Page 163 Setting data ■Description, range, data type Operand Description Range Data type Data type (label)  Device used as a contact ANY_BOOL • In safety programs executed by the Safety CPU, only safety devices and safety labels of data types described in the table can be used.
  • Page 164: Pulse Operation Start, Pulse Series Connection, Pulse Parallel Connection

    Pulse operation start, pulse series connection, pulse parallel connection LDP, LDF, ANDP, ANDF, ORP, ORF RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • LDP: Rising edge pulse operation start This instruction turns on only at the rising edge (off to on) of the specified bit device. •...
  • Page 165 Setting data ■Description, range, data type Operand Description Range Data type Data type (label)  Device used as a contact ANY_BOOL  Execution condition BOOL Execution result  BOOL • In safety programs executed by the Safety CPU, only safety devices and safety labels of data types described in the table can be used.
  • Page 166 ■ANDP, ANDF • ANDP is a rising edge pulse series connection instruction and ANDF is a falling edge pulse series connection instruction. These instructions perform an AND operation with the previous operation result, and output the operation result. The following table lists the on/off information used by the ANDP and ANDF instructions. Device specified by ANDP or ANDF ANDP status ANDF status...
  • Page 167: Pulse Not Operation Start, Pulse Not Series Connection, Pulse Not Parallel Connection

    Pulse NOT operation start, pulse NOT series connection, pulse NOT parallel connection LDPI, LDFI, ANDPI, ANDFI, ORPI, ORFI RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • LDPI: Rising edge pulse NOT operation start This instruction turns on when the specified device is off, on, or at the falling edge (on to off). •...
  • Page 168 Setting data ■Description, range, data type Operand Description Range Data type Data type (label)  Device used as a contact ANY_BOOL  Execution condition BOOL  Execution result BOOL • In safety programs executed by the Safety CPU, only safety devices and safety labels of data types described in the table can be used.
  • Page 169 ■ANDPI, ANDFI • ANDPI is a rising edge pulse NOT series connection instruction and ANDFI is a falling edge pulse NOT series connection instruction. These instructions perform an AND operation with the previous operation result, and output the operation result. The following table lists the on/off information used by the ANDPI and ANDFI instructions.
  • Page 170: Association Instructions

    Association Instructions Ladder block series/parallel connection ANB, ORB RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • ANB: Ladder block series connection This instruction performs an AND operation between block A and block B. • ORB: Ladder block parallel connection This instruction performs an OR operation between block A and block B.
  • Page 171: Storing/Reading/Clearing The Operation Result

    Storing/reading/clearing the operation result MPS, MRD, MPP RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • MPS: Storing the operation result This instruction stores the operation result (on/off) immediately before the MPS instruction. • MRD: Reading the operation result This instruction reads the operation result stored by using the MPS instruction.
  • Page 172 Operation error There is no operation error. • The following are the ladder program examples. [Ladder program using the MPS, MRD, and MPP instructions] [Ladder program not using the MPS, MRD, or MPP instruction] • Use the same number of MPS instructions as that of MPP instructions. If the numbers of MPS and MPP instructions are different, the ladder is not displayed correctly on the engineering tool (ladder mode).
  • Page 173: Inverting The Operation Result

    Inverting the operation result RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction inverts the operation result up to just before the INV instruction. Ladder ENO:=INV(EN); FBD/LD ■Execution condition Instruction Execution condition Every scan Processing details • This instruction inverts the operation result up to just before the INV instruction. Operation result up to just before the INV instruction Operation result after execution of the INV instruction Operation error...
  • Page 174: Converting The Operation Result Into A Pulse

    Converting the operation result into a pulse MEP, MEF RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • MEP: Converting the operation result into a pulse (rising edge) This instruction turns on at the rising edge (off to on) of the operation result up to the MEP instruction. •...
  • Page 175: Converting The Edge Relay Operation Result Into A Pulse

    Converting the edge relay operation result into a pulse EGP, EGF RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • EGP: Converting the edge relay operation result into a pulse (rising edge) This instruction stores the operation result up to the EGP instruction in the edge relay (V). The instruction turns on at the rising edge (off to on) of the operation result.
  • Page 176 Processing details ■EGP • This instruction stores the operation result up to the EGP instruction in the edge relay (V). • The instruction turns on (continuity state) at the rising edge (off to on) of the operation result up to the EGP instruction. The instruction turns off (non-continuity state) when the operation result is in another state (staying on, falling edge (on to off), or staying off).
  • Page 177: Output Instructions

    Output Instructions Out (excluding the timer, counter, and annunciator) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction outputs the operation result to the specified device. Ladder ENO:=OUT(EN,d); FBD/LD ■Execution condition Instruction Execution condition Every scan Setting data ■Description, range, data type Operand Description...
  • Page 178 Processing details • This instruction outputs the operation result up to the OUT instruction to the specified device. Condition Operation result Coil/Specified bit When a bit device is used When a bit-specified word device is used • When indirect specification is used, specify the bit as shown below. @D0.0 (1) The operation result is output to bit 0 of the indirect address stored in D0.
  • Page 179: Timer

    Timer OUT T, OUTH T, OUT ST, OUTH ST RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • [RnPCPU (redundant)] If these instructions are used in a program executed in both systems, there are restrictions on their operation when the systems are switched.
  • Page 180 Setting data ■Description, range, data type Operand Description Range Data type Data type (label)  Timer device or timer type label ANY_BOOL Coil Value Value set for the timer 0 to 32767 16-bit unsigned ANY16 binary  Execution condition BOOL ...
  • Page 181 Processing details • These instructions start time measurement, triggered by the coil specified by (d) (in SD language or FBD/LD, displayed as Coil), when the operation result up to the OUT instruction is on. When time is up (current value  set value), the normally open contact turns on (continuity state) and the normally closed contact turns off (non-continuity state).
  • Page 182 When timers T0 to T2 are programmed in order of measurement (1) Timer T0 starts measurement when X0 turns on. (2) When the contact of timer T0 turns on, the contacts of timers T1 and T2 also turn on. Operation error There is no operation error.
  • Page 183: Long Timer

    Long timer OUT LT, OUT LST RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • [RnPCPU (redundant)] If these instructions are used in a program executed in both systems, they do not operate in the standby system when the redundant system is in backup mode.
  • Page 184 Processing details • These instructions start time measurement, triggered by the coil specified by (d) (in SD language or FBD/LD, displayed as Coil), when the operation result up to the OUT instruction is on. When time is up (current value  set value), the normally open contact turns on (continuity state) and the normally closed contact turns off (non-continuity state).
  • Page 185 When long timers LT0 to LT2 are programmed in order of measurement (1) Long timer LT0 starts measurement when X0 turns on. (2) When the contact of timer LT0 turns on, the contacts of timers LT1 and LT2 also turn on. Operation error There is no operation error.
  • Page 186: Counter

    Counter OUT C RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) When the safety counter is used in safety programs executed by the Safety CPU, unless otherwise specified, replace some words as follows: • "OUT C"  "OUT SA\C" This instruction increments the current counter value (count value) by one when the operation result up to the OUT instruction turns on.
  • Page 187 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD  ...
  • Page 188: Long Counter

    Long counter OUT LC RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction increments the current long counter value (count value) by one on the rising edge (off to on) of the operation result up to the OUT instruction. When the count value reaches the set value, the normally open contact of the long counter turns on (continuity state) and the normally closed contact turns off (non-continuity state).
  • Page 189 Processing details • This instruction increments the current long counter value (count value) in the device specified by (d) (in SD language or FBD/LD, displayed as Coil) by one on the rising edge (off to on) of the operation result up to the OUT instruction. When the count value reaches the set value (current value ...
  • Page 190: Annunciator

    Annunciator OUT F RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction outputs the operation result up to the OUT F instruction to the specified annunciator. Ladder ENO:=OUT(EN,d); FBD/LD ( is to be replaced by OUT.) ■Execution condition Instruction Execution condition OUT F...
  • Page 191: Setting Devices (Excluding Annunciator)

    Setting devices (excluding annunciator) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction turns on the specified bit. Ladder ENO:=SET(EN,d); FBD/LD ■Execution condition Instruction Execution condition Setting data ■Description, range, data type Operand Description Range Data type Data type (label) Set target bit device number or bit specification of word ...
  • Page 192 Processing details • This instruction changes the device status as follows when the execution command turns on. Device Status Bit device Turns on the coil or contact. Bit-specified word device Sets the specified bit to 1. • The device that has been turned on remains on even after the execution command turns off. The device that has been turned on can be turned off by using the RST instruction.
  • Page 193: Resetting Devices (Excluding Annunciator)

    Resetting devices (excluding annunciator) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction turns off the specified device. For the timer and counter, the instruction clears the current value to 0 and turns off the contact or coil. Ladder ENO:=RST(EN,d);...
  • Page 194 Processing details • This instruction changes the device status as follows when the execution command turns on. Device Status Bit device Turns off the coil or contact. Timer, counter Clears the current value to 0 and turns off the coil or contact. Bit-specified word device Sets the specified bit to 0.
  • Page 195: Setting Annunciator

    Setting annunciator SET F RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction turns on the specified annunciator. Ladder ENO:=SET(EN,d); FBD/LD ( is to be replaced by SET.) ■Execution condition Instruction Execution condition SET F Setting data ■Description, range, data type Operand Description...
  • Page 196 Processing details • This instruction turns on the annunciator specified by (d) when the execution command turns on. • When the annunciator (F) is turned on, the following are performed. • The USER LED turns on. • The annunciator number (F number) turned on is stored in the special register (SD64 to SD79). •...
  • Page 197: Resetting Annunciator

    Resetting annunciator RST F RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction turns off the specified annunciator. Ladder ENO:=RST(EN,d); FBD/LD ( is to be replaced by RST.) ■Execution condition Instruction Execution condition RST F Setting data ■Description, range, data type Operand Description...
  • Page 198 Processing details • This instruction turns off the annunciator specified by (d) when the execution command turns on. • The annunciator number (F number) turned off is deleted from the special register (SD64 to SD79), and the value in SD63 is decremented by one.
  • Page 199: Rising Edge Output

    Rising edge output RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) When this instruction is used in safety programs executed by the Safety CPU, unless otherwise specified, replace some words as follows: • "X0"  "SA\X0", "X5"  "SA\X5", "M0"  "SA\M0" •...
  • Page 200 Processing details • This instruction turns on the specified device on the rising edge (off to on) of the execution command. When the execution command is in another state (staying on, falling edge (on to off), or staying off), the instruction turns off the specified device. If only one PLS instruction in the device specified by (d) is executed in a single scan, the specified device turns on for one scan.
  • Page 201: Falling Edge Output

    Falling edge output RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) When this instruction is used in safety programs executed by the Safety CPU, unless otherwise specified, replace some words as follows: • "X5"  "SA\X5" • "Scan"  "Safety cycle processing" This instruction turns on the specified device for one scan on the falling edge (on to off) of the execution command.
  • Page 202 Processing details • This instruction turns on the specified device on the falling edge (on to off) of the execution command. When the execution command is in another state (staying off, rising edge (off to on), or staying on), the instruction turns off the specified device. If only one PLF instruction in the device specified by (d) is executed during one scan, the specified device turns on for one scan.
  • Page 203: Inverting The Bit Device Output

    Inverting the bit device output RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction inverts the status of the specified device. Ladder ENO:=FF(EN,d); FBD/LD ■Execution condition Instruction Execution condition Setting data ■Description, range, data type Operand Description Range Data type Data type (label)
  • Page 204 Operation error There is no operation error. 5 SEQUENCE INSTRUCTIONS 5.3 Output Instructions...
  • Page 205: Converting The Direct Access Output Into A Pulse

    Converting the direct access output into a pulse DELTA(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified direct access output (DY) into pulse output. Ladder ENO:=DELTA(EN,d); ENO:=DELTAP(EN,d); FBD/LD ■Execution condition Instruction Execution condition DELTA DELTAP Setting data...
  • Page 206 Processing details • These instructions convert the direct access output (DY) specified by (d) into pulse output. If DY0 is specified by (d), the program operates in the same way as the one that uses the SET and RST instructions. The following figure shows an example when a ladder using the DELTA instruction is replaced with a ladder using the SET/ RST instructions.
  • Page 207: Shift Instructions

    Shift Instructions Shifting bit devices SFT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the on/off state of the device area just before the one specified to the specified device area, and turn off the shift source device. Ladder ENO:=SFT(EN,d);...
  • Page 208 Processing details ■Bit device • These instructions shift the on/off state of the device area just before the one specified by (d) to the device area specified by (d). After the data is shifted, the data of the shift source device area is turned off. When the SFTP instruction that specifies M11 is executed, it shifts the on/off state of M10 to M11, and turns off M10.
  • Page 209: Master Control Instructions

    Master Control Instructions Setting/resetting a master control MC, MCR RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) When this instruction is used in safety programs executed by the Safety CPU, unless otherwise specified, replace some words as follows: •...
  • Page 210 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD  ...
  • Page 211 • When a ladder performing a master control includes an instruction which does not require a contact instruction (such as the FOR to NEXT instruction), the CPU module executes the instruction regardless of the execution command of the MC instruction. •...
  • Page 212 Precautions • Up to 15 nests (N0 to N14) are allowed. When nesting is performed, the MC instruction should use nesting (N) numbers in order from lower numbers and the MCR instruction should use them in order from higher numbers. •...
  • Page 213: Termination Instructions

    Termination Instructions Ending the main routine program FEND RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction is used to separate the main routine program from subroutine programs and interrupt programs in a program file. Ladder Not supported FBD/LD Not supported ■Execution condition...
  • Page 214 Operation error Error code Description (SD0) 3340H After execution of the FOR instruction, the FEND instruction is executed before the NEXT instruction. 3381H After execution of the CALL(P), FCALL(P), ECALL(P), or EFCALL(P) instruction, the FEND instruction is executed before the RET instruction.
  • Page 215: Ending The Sequence Program

    Ending the sequence program RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction indicates the end of a program. Ladder Not supported FBD/LD Not supported ■Execution condition Instruction Execution condition Every scan Processing details • This instruction indicates the end of a program including a main routine program, subroutine programs, and interrupt programs.
  • Page 216 When a program is divided into multiple program blocks, the END instruction indicates the end of a program block. The END instruction within the program registered at the end of the program setting performs END processing. Operation error Error code Description (SD0) 3340H...
  • Page 217: Stop Instruction

    Stop Instruction Stopping the sequence program STOP RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction stops the operation of the CPU module. (The operation of this instruction is the same as setting the switch of the CPU module to the STOP position.) Ladder ENO:=STOP(EN);...
  • Page 218: No Operation Instruction

    No Operation Instruction No operation (NOP) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction is used to insert a space for debugging. Ladder  Not supported FBD/LD Not supported ■Execution condition Instruction Execution condition Every scan Processing details •...
  • Page 219: No Operation (Noplf)

    No operation (NOPLF) NOPLF RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) This instruction is a no-operation instruction and has no impact on the previous operations. Ladder Not supported FBD/LD Not supported ■Execution condition Instruction Execution condition NOPLF Every scan Processing details •...
  • Page 220: Chapter 6 Basic Instructions

    BASIC INSTRUCTIONS Comparison Operation Instructions Comparing 16-bit binary data LD(_U), AND(_U), OR(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions compare the two sets of 16-bit binary data specified. (Devices are used as normally open contacts.) Ladder ENO:=LD_(EN,s1,s2);...
  • Page 221 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 222: Comparing 32-Bit Binary Data

    Comparing 32-bit binary data LDD(_U), ANDD(_U), ORD(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions compare the two sets of 32-bit binary data specified. (Devices are used as normally open contacts.) Ladder ENO:=LDD_(EN,s1,s2); ENO:=LDD__U(EN,s1,s2); ENO:=ANDD_(EN,s1,s2); ENO:=ANDD__U(EN,s1,s2); (s1) (s2) ENO:=ORD_(EN,s1,s2);...
  • Page 223 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 224: Outputting A Comparison Result Of 16-Bit Binary Data

    Outputting a comparison result of 16-bit binary data CMP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions compare the 16-bit binary data specified by (s1) with the 16-bit binary data specified by (s2), and according to the result (small, equal, or large), (d), (d)+1, or (d)+2 is turned on.
  • Page 225 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 226: Outputting A Comparison Result Of 32-Bit Binary Data

    Outputting a comparison result of 32-bit binary data DCMP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions compare the 32-bit binary data specified by (s1) with the 32-bit binary data specified by (s2), and according to the result (small, equal, or large), (d), (d)+1, or (d)+2 is turned on.
  • Page 227 Processing details • These instructions compare the 32-bit binary data specified by (s1) with the 32-bit binary data specified by (s2), and according to the result (small, equal, or large), (d), (d)+1, or (d)+2 is turned on. DCMP (s1) (s2) (s2) Turns on when [(s1), (s1)+1] >...
  • Page 228: Outputting A Band Comparison Result Of 16-Bit Binary Data

    Outputting a band comparison result of 16-bit binary data ZCP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions compare the band between the 16-bit binary data specified by lower limit value (s1) and the 16-bit binary data specified by upper limit value (s2) with the 16-bit binary data in the device specified by comparison data (s3).
  • Page 229 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 230: Outputting A Band Comparison Result Of 32-Bit Binary Data

    Outputting a band comparison result of 32-bit binary data DZCP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions compare the band between the 32-bit binary data specified by lower limit value (s1) and the 32-bit binary data specified by upper limit value (s2) with the 32-bit binary data in the device specified by comparison data (s3).
  • Page 231 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 232: Comparing 16-Bit Binary Block Data

    Comparing 16-bit binary block data BKCMP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions compare the two sets of 16-bit binary block data specified. Ladder ENO:=BKCMP_(EN,s1,s2,n,d); ENO:=BKCMP__U(EN,s1,s2,n,d); ENO:=BKCMP_P(EN,s1,s2,n,d); ENO:=BKCMP_P_U(EN,s1,s2,n,d) (s1) (s2) ( is replaced by any of the following: EQ, NE, GT, LE, LT, GE.) (...
  • Page 233 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 234: Comparing 32-Bit Binary Block Data

    Comparing 32-bit binary block data DBKCMP(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions compare the two sets of 32-bit binary block data specified. Ladder ENO:=DBKCMP_(EN,s1,s2,n,d); ENO:=DBKCMP__U(EN,s1,s2,n,d) ENO:=DBKCMP_P(EN,s1,s2,n,d); (s1) (s2) ENO:=DBKCMP_P_U(EN,s1,s2,n, ( is replaced by any of the following: DBKCMP=(P)(_U), (...
  • Page 235 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1)   ...
  • Page 236 Operation error Error code Description (SD0) 2821H The device ranges starting from the ones specified by (s1) and (d) are overlapping. The device ranges starting from the ones specified by (s2) and (d) are overlapping. When bits of a word device are specified, the bits other than the specified ones for storing the operation result do not change.
  • Page 237: Arithmetic Operation Instructions

    Arithmetic Operation Instructions Adding 16-bit binary data +(P)(_U) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of 16-bit binary data specified. Ladder Not supported ( Page 237 +(P)(_U) [when three operands are set]) FBD/LD Not supported (...
  • Page 238 Processing details • These instructions add the 16-bit binary data in the device specified by (d) and the 16-bit binary data in the device specified by (s), and store the operation result in the device specified by (d). ··· ··· ···...
  • Page 239 +(P)(_U) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of 16-bit binary data specified. Ladder ENO:=PLUS(EN,s1,s2,d); ENO:=PLUSP(EN,s1,s2,d); (s1) (s2) ENO:=PLUS_U(EN,s1,s2,d); ENO:=PLUSP_U(EN,s1,s2,d); FBD/LD ( is to be replaced by any of the following: PLUS, PLUSP, PLUS_U, PLUSP_U.) ■Execution condition Instruction Execution condition...
  • Page 240 Processing details • These instructions add the 16-bit binary data in the device specified by (s1) and the 16-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1) (s2) ···...
  • Page 241: Subtracting 16-Bit Binary Data

    Subtracting 16-bit binary data -(P)(_U) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of 16-bit binary data specified. Ladder Not supported ( Page 241 -(P)(_U) [when three operands are set]) FBD/LD Not supported (...
  • Page 242 Processing details • These instructions subtract the 16-bit binary data in the device specified by (s) from the 16-bit binary data in the device specified by (d), and store the operation result in the device specified by (d). ··· ··· ···...
  • Page 243 -(P)(_U) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of 16-bit binary data specified. Ladder ENO:=MINUS(EN,s1,s2,d); ENO:=MINUSP(EN,s1,s2,d); (s1) (s2) ENO:=MINUS_U(EN,s1,s2,d); ENO:=MINUSP_U(EN,s1,s2,d); FBD/LD ( is to be replaced by any of the following: MINUS, MINUSP, MINUS_U, MINUSP_U.) ■Execution condition Instruction Execution condition...
  • Page 244 Processing details • These instructions subtract the 16-bit binary data in the device specified by (s2) from the 16-bit binary data in the device specified by (s1), and store the operation result in the device specified by (d). (s1) (s2) ···...
  • Page 245: Adding 32-Bit Binary Data

    Adding 32-bit binary data D+(P)(_U) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of 32-bit binary data specified. Ladder Not supported ( Page 245 D+(P)(_U) [when three operands are set]) FBD/LD Not supported (...
  • Page 246 Processing details • These instructions add the 32-bit binary data in the device specified by (d) and the 32-bit binary data in the device specified by (s), and store the operation result in the device specified by (d). (d)+1 (s)+1 (d)+1 b16 b15 b16 b15...
  • Page 247 D+(P)(_U) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of 32-bit binary data specified. Ladder ENO:=DPLUS(EN,s1,s2,d); ENO:=DPLUSP(EN,s1,s2,d); (s1) (s2) ENO:=DPLUS_U(EN,s1,s2,d); ENO:=DPLUSP_U(EN,s1,s2,d); FBD/LD ( is to be replaced by any of the following: DPLUS, DPLUSP, DPLUS_U, DPLUSP_U.) ■Execution condition Instruction Execution condition...
  • Page 248 Processing details • These instructions add the 32-bit binary data in the device specified by (s1) and the 32-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1) (s2) (s1)+1 (s2)+1 (d)+1...
  • Page 249: Subtracting 32-Bit Binary Data

    Subtracting 32-bit binary data D-(P)(_U) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of 32-bit binary data specified. Ladder Not supported ( Page 249 D-(P)(_U) [when three operands are set]) FBD/LD Not supported (...
  • Page 250 Processing details • These instructions subtract the 32-bit binary data in the device specified by (s) from the 32-bit binary data in the device specified by (d) and, and store the operation result in the device specified by (d). (d)+1 (s)+1 (d)+1 b16 b15...
  • Page 251 D-(P)(_U) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of 32-bit binary data specified. Ladder ENO:=DMINUS(EN,s1,s2,d); ENO:=DMINUSP(EN,s1,s2,d); (s1) (s2) ENO:=DMINUS_U(EN,s1,s2,d); ENO:=DMINUSP_U(EN,s1,s2,d); FBD/LD ( is to be replaced by any of the following: DMINUS, DMINUSP, DMINUS_U, DMINUSP_U.) ■Execution condition Instruction Execution condition...
  • Page 252 Processing details • These instructions subtracts the 32-bit binary data in the device specified by (s2) from the 32-bit binary data in the device specified by (s1), and store the operation result in the device specified by (d). (s1) (s2) (s1)+1 (s2)+1 (d)+1...
  • Page 253: Multiplying 16-Bit Binary Data

    Multiplying 16-bit binary data *(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions multiply the two sets of 16-bit binary data specified. Ladder ENO:=MULTI(EN,s1,s2,d); ENO:=MULTI_U(EN,s1,s2,d); ENO:=MULTIP(EN,s1,s2,d); ENO:=MULTIP_U(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: MULTI, MULTIP, MULTI_U, MULTIP_U.) *1 The engineering tool with version "1.035M"...
  • Page 254 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 255: Dividing 16-Bit Binary Data

    Dividing 16-bit binary data /(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform division between the two sets of 16-bit binary data specified. Ladder ENO:=DIVISION(EN,s1,s2,d); ENO:=DIVISION_U(EN,s1,s2,d); ENO:=DIVISIONP(EN,s1,s2,d); ENO:=DIVISIONP_U(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: DIVISION, DIVISIONP, DIVISION_U, DIVISIONP_U.) *1 The engineering tool with version "1.035M"...
  • Page 256 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1)   ...
  • Page 257: Multiplying 32-Bit Binary Data

    Multiplying 32-bit binary data D*(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions multiply the two sets of 32-bit binary data specified. Ladder ENO:=DMULTI(EN,s1,s2,d); ENO:=DMULTI_U(EN,s1,s2,d); ENO:=DMULTIP(EN,s1,s2,d); ENO:=DMULTIP_U(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: DMULTI, DMULTIP, DMULTI_U, DMULTIP_U.) *1 The engineering tool with version "1.035M"...
  • Page 258 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 259: Dividing 32-Bit Binary Data

    Dividing 32-bit binary data D/(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform division between the two sets of 32-bit binary data specified. Ladder ENO:=DDIVISION(EN,s1,s2,d); ENO:=DDIVISION_U(EN,s1,s2,d); ENO:=DDIVISIONP(EN,s1,s2,d); ENO:=DDIVISIONP_U(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: DDIVISION, DDIVISIONP, DDIVISION_U, DDIVISIONP_U.) *1 The engineering tool with version "1.035M"...
  • Page 260 ■Applicable devices Operand Word Double word Indirect Constant Others specification X, Y, M, L, J\ T, ST, C, D, W, U\G, J\, LT, LST, K, H E SM, F, B, SB, SD, SW, FD, R, U3E\(H)G FX, FY ZR, RD (s1) ...
  • Page 261: Adding Bcd 4-Digit Data

    Adding BCD 4-digit data B+(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of BCD 4-digit data specified. Ladder Not supported ( Page 260 B+(P) [when three operands are set]) FBD/LD Not supported (...
  • Page 262 B+(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of BCD 4-digit data specified. Ladder ENO:=BPLUS(EN,s1,s2,d); ENO:=BPLUSP(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by either of the following: BPLUS, BPLUSP.) ■Execution condition Instruction Execution condition...
  • Page 263 Processing details • These instructions add the BCD 4-digit data in the device specified by (s1) and the BCD 4-digit data in the device specified by (s2), and store the operation result in the device specified by (d). (s1) (s2) •...
  • Page 264: Subtracting Bcd 4-Digit Data

    Subtracting BCD 4-digit data B-(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of BCD 4-digit data specified. Ladder Not supported ( Page 264 B-(P) [when three operands are set]) FBD/LD Not supported (...
  • Page 265 Operation error Error code Description (SD0) 3405H The BCD data in the device specified by (s) is out of the range, 0 to 9999. The BCD data in the device specified by (d) is out of the range, 0 to 9999. 6 BASIC INSTRUCTIONS 6.2 Arithmetic Operation Instructions...
  • Page 266 B-(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of BCD 4-digit data specified. Ladder ENO:=BMINUS(EN,s1,s2,d); ENO:=BMINUSP(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by either of the following: BMINUS, BMINUSP.) ■Execution condition Instruction Execution condition...
  • Page 267 Processing details • These instructions subtract the BCD 4-digit data in the device specified by (s2) from the BCD 4-digit data in the device specified by (s1), and store the operation result in the device specified by (d). (s1) (s2) Filled with 0s.
  • Page 268: Adding Bcd 8-Digit Data

    Adding BCD 8-digit data DB+(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of BCD 8-digit data specified. Ladder Not supported ( Page 268 DB+(P) [when three operands are set]) FBD/LD Not supported (...
  • Page 269 Operation error Error code Description (SD0) 3405H The BCD data in the device specified by (s) is out of the range, 0 to 99999999. The BCD data in the device specified by (d) is out of the range, 0 to 99999999. 6 BASIC INSTRUCTIONS 6.2 Arithmetic Operation Instructions...
  • Page 270 DB+(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two sets of BCD 8-digit data specified. Ladder ENO:=DBPLUS(EN,s1,s2,d); ENO:=DBPLUSP(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by either of the following: DBPLUS, DBPLUSP.) ■Execution condition Instruction Execution condition...
  • Page 271 Processing details • These instructions add the BCD 8-digit data in the device specified by (s1) and the BCD 8-digit data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) (s2)+1 (s2) (d)+1...
  • Page 272: Subtracting Bcd 8-Digit Data

    Subtracting BCD 8-digit data DB-(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of BCD 8-digit data specified. Ladder Not supported ( Page 272 DB-(P) [when three operands are set]) FBD/LD Not supported (...
  • Page 273 Operation error Error code Description (SD0) 3405H The BCD data in the device specified by (s) is out of the range, 0 to 99999999. The BCD data in the device specified by (d) is out of the range, 0 to 99999999. 6 BASIC INSTRUCTIONS 6.2 Arithmetic Operation Instructions...
  • Page 274 DB-(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two sets of BCD 8-digit data specified. Ladder ENO:=DBMINUS(EN,s1,s2,d); ENO:=DBMINUSP(EN,s1,s2,d); (s1) (s2) FBD/LD ( is to be replaced by either of the following: DBMINUS, DBMINUSP.) ■Execution condition Instruction Execution condition...
  • Page 275 Processing details • These instructions subtract the BCD 8-digit data in the device specified by (s2) from the BCD 8-digit data in the device specified by (s1), and store the operation result in the device specified by (d). (s1)+1 (s1) (s2)+1 (s2) (d)+1...
  • Page 276: Multiplying Bcd 4-Digit Data

    Multiplying BCD 4-digit data B*(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions multiply the two sets of BCD 4-digit data specified. Ladder Not supported (s1) (s2) FBD/LD ( is to be replaced by either of the following: BMULTI, BMULTIP.) ■Execution condition Instruction Execution condition...
  • Page 277 Processing details • These instructions multiply the BCD 4-digit data in the device specified by (s1) by the BCD 4-digit data in the device specified by (s2), and store the operation result in the device specified by (d). ((d)+1: Upper 4 digits, (d): Lower 4 digits) (s1) (s2) (d)+1...
  • Page 278: Dividing Bcd 4-Digit Data

    Dividing BCD 4-digit data B/(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform division between the two sets of BCD 4-digit data specified. Ladder Not supported (s1) (s2) FBD/LD ( is to be replaced by either of the following: BDIVISION, BDIVISIONP.) ■Execution condition Instruction Execution condition...
  • Page 279 Processing details • These instructions divide the BCD 4-digit data in the device specified by (s1) by the BCD 4-digit data in the device specified by (s2), and store the operation result in the device specified by (d). (s1) (s2) (d)+1 ÷...
  • Page 280: Multiplying Bcd 8-Digit Data

    Multiplying BCD 8-digit data DB*(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions multiply the two sets of BCD 8-digit data specified. Ladder Not supported (s1) (s2) FBD/LD ( is to be replaced by either of the following: DBMULTI, DBMULTIP.) ■Execution condition Instruction Execution condition...
  • Page 281 Processing details • These instructions multiply the BCD 8-digit data in the device specified by (s1) by the BCD 8-digit data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) (s2)+1 (s2) ×...
  • Page 282: Dividing Bcd 8-Digit Data

    Dividing BCD 8-digit data DB/(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform division between the two sets of BCD 8-digit data specified. Ladder Not supported (s1) (s2) FBD/LD ( is to be replaced by either of the following: DBDIVISION, DBDIVISIONP.) ■Execution condition Instruction Execution condition...
  • Page 283 Processing details • These instructions divide the BCD 8-digit data in the device specified by (s1) by the BCD 8-digit data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) (s2)+1 (s2) ÷...
  • Page 284: Adding 16-Bit Binary Block Data

    Adding 16-bit binary block data BK+(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two 16-bit binary data blocks specified. Ladder ENO:=BKPLUS(EN,s1,s2,n,d); ENO:=BKPLUS_U(EN,s1,s2,n,d); ENO:=BKPLUSP(EN,s1,s2,n,d); ENO:=BKPLUSP_U(EN,s1,s2,n,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: DMINUS, DMINUSP, DMINUS_U, DMINUSP_U.) *1 The engineering tool with version "1.035M"...
  • Page 285 Processing details • These instructions add the (n) points of 16-bit binary data from the device specified by (s1) and the (n) points of 16-bit binary data from the device specified by (s2) or the constant, and store the operation result in the device specified by (d) and later.
  • Page 286: Subtracting 16-Bit Binary Block Data

    Subtracting 16-bit binary block data BK-(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two 16-bit binary data blocks specified. Ladder ENO:=BKMINUS(EN,s1,s2,n,d); ENO:=BKMINUS_U(EN,s1,s2,n,d); ENO:=BKMINUSP(EN,s1,s2,n,d); ENO:=BKMINUSP_U(EN,s1,s2,n,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: BKMINUS, BKMINUSP, BKMINUS_U, BKMINUSP_U.) *1 The engineering tool with version "1.035M"...
  • Page 287 Processing details • These instructions subtract the (n) points of 16-bit binary data from the device specified by (s2) or the constant from the (n) points of 16-bit binary data from the device specified by (s1), and store the operation result in the device specified by (d) and later.
  • Page 288: Adding 32-Bit Binary Block Data

    Adding 32-bit binary block data DBK+(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions add the two 32-bit binary data blocks specified. Ladder ENO:=DBKPLUS(EN,s1,s2,n,d); ENO:=DBKPLUS_U(EN,s1,s2,n,d); ENO:=DBKPLUSP(EN,s1,s2,n,d); ENO:=DBKPLUSP_U(EN,s1,s2,n,d); (s1) (s2) FBD/LD ( is to be replaced by any of the following: DBKPLUS, DBKPLUSP, DBKPLUS_U, DBKPLUSP_U.) *1 The engineering tool with version "1.035M"...
  • Page 289 Processing details • These instructions add the (n) points of 32-bit binary data from the device specified by (s1) and the (n) points of 32-bit binary data from the device specified by (s2) or the constant, and store the operation result in the device specified by (d) and later.
  • Page 290 Operation error Error code Description (SD0) 2821H The device ranges starting from the ones specified by (s1) and (d) are overlapping (except when the same device is specified for (s1) and (d)). The device ranges starting from the ones specified by (s2) and (d) are overlapping (except when the same device is specified for (s2) and (d)).
  • Page 291: Subtracting 32-Bit Binary Block Data

    Subtracting 32-bit binary block data DBK-(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform subtraction between the two 32-bit binary data blocks specified. Ladder ENO:=DBKMINUS(EN,s1,s2,n,d); ENO:=DBKMINUS_U(EN,s1,s2,n,d); ENO:=DBKMINUSP(EN,s1,s2,n,d); ENO:=DBKMINUSP_U(EN,s1,s2,n,d (s1) (s2) FBD/LD ( is to be replaced by any of the following: DBKMINUS, DBKMINUSP, DBKMINUS_U, DBKMINUSP_U.) *1 The engineering tool with version "1.035M"...
  • Page 292 Processing details • These instructions subtract the (n) points of 32-bit binary data from the device specified by (s2) or the constant from the (n) points of 32-bit binary data from the device specified by (s1), and store the operation result in the device specified by (d) and later.
  • Page 293 Operation error Error code Description (SD0) 2821H The device ranges starting from the ones specified by (s1) and (d) are overlapping (except when the same device is specified for (s1) and (d)). The device ranges starting from the ones specified by (s2) and (d) are overlapping (except when the same device is specified for (s2) and (d)).
  • Page 294: Incrementing 16-Bit Binary Data

    Incrementing 16-bit binary data INC(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions increment the specified 16-bit binary data by one. Ladder ENO:=INC(EN,d); ENO:=INC_U(EN,d); ENO:=INCP(EN,d); ENO:=INCP_U(EN,d); FBD/LD ■Execution condition Instruction Execution condition INC_U INCP INCP_U Setting data ■Description, range, data type Operand Description...
  • Page 295 Processing details • These instructions increment the 16-bit binary data in the device specified by (d) by one. ··· ··· 5678 (BIN) 5679 (BIN) • When the INC(P) instruction is executed while the data in the device specified by (d) is 32767, -32768 is stored in the device specified by (d).
  • Page 296: Decrementing 16-Bit Binary Data

    Decrementing 16-bit binary data DEC(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions decrement the specified 16-bit binary data by one. Ladder ENO:=DEC(EN,d); ENO:=DEC_U(EN,d); ENO:=DECP(EN,d); ENO:=DECP_U(EN,d); FBD/LD ■Execution condition Instruction Execution condition DEC_U DECP DECP_U Setting data ■Description, range, data type Operand Description...
  • Page 297 Processing details • These instructions decrement the 16-bit binary data in the device specified by (d) by one. ··· ··· 5678 (BIN) 5677 (BIN) • When the DEC(P) instruction is executed while the data in the device specified by (d) is -32768, 32767 is stored in the device specified by (d).
  • Page 298: Incrementing 32-Bit Binary Data

    Incrementing 32-bit binary data DINC(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions increment the specified 32-bit binary data by one. Ladder ENO:=DINC(EN,d); ENO:=DINC_U(EN,d); ENO:=DINCP(EN,d); ENO:=DINCP_U(EN,d); FBD/LD ■Execution condition Instruction Execution condition DINC DINC_U DINCP DINCP_U Setting data ■Description, range, data type Operand...
  • Page 299 Processing details • These instructions increment the 32-bit binary data in the device specified by (d) by one. (d)+1 (d)+1 b16 b15 b16 b15 ··· ··· ··· ··· 73500 (BIN) 73501 (BIN) • When the DINC(P) instruction is executed while the data in the device specified by (d) is 2147483647, -2147483648 is stored in the device specified by (d).
  • Page 300: Decrementing 32-Bit Binary Data

    Decrementing 32-bit binary data DDEC(P)(_U) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions decrement the specified 32-bit binary data by one. Ladder ENO:=DDEC(EN,d); ENO:=DDEC_U(EN,d); ENO:=DDECP(EN,d); ENO:=DDECP_U(EN,d); FBD/LD ■Execution condition Instruction Execution condition DDEC DDEC_U DDECP DDECP_U Setting data ■Description, range, data type Operand...
  • Page 301 Processing details • These instructions decrement the 32-bit binary data in the device specified by (d) by one. (d)+1 (d)+1 b16 b15 b16 b15 ··· ··· ··· ··· 73500 (BIN) 73499 (BIN) • When the DDEC(P) instruction is executed while the data in the device specified by (d) is -2147483648, 2147483647 is stored in the device specified by (d).
  • Page 302: Logical Operation Instructions

    Logical Operation Instructions Performing an AND operation on 16-bit data WAND(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an AND operation on the two sets of 16-bit binary data specified. Ladder Not supported (...
  • Page 303 Processing details • These instructions perform an AND operation (bit-by-bit) on the 16-bit binary data in the device specified by (d) and the 16- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 304 WAND(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an AND operation on the two sets of 16-bit binary data specified. Ladder ENO:=WAND(EN,s1,s2,d); ENO:=WANDP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition WAND WANDP...
  • Page 305 Processing details • These instructions perform an AND operation (bit-by-bit) on the 16-bit binary data in the device specified by (s1) and the 16-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 306: Performing An And Operation On 32-Bit Data

    Performing an AND operation on 32-bit data DAND(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an AND operation on the two sets of 32-bit binary data specified. Ladder Not supported (...
  • Page 307 Processing details • These instructions perform an AND operation (bit-by-bit) on the 32-bit binary data in the device specified by (d) and the 32- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). (d)+1 ∙∙∙...
  • Page 308 DAND(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an AND operation on the two sets of 32-bit binary data specified. Ladder ENO:=DAND(EN,s1,s2,d); ENO:=DANDP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition DAND DANDP...
  • Page 309 Processing details • These instructions perform an AND operation (bit-by-bit) on the 32-bit binary data in the device specified by (s1) and the 32-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) ∙∙∙...
  • Page 310: Performing An And Operation On 16-Bit Block Data

    Performing an AND operation on 16-bit block data BKAND(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an AND operation on the two 16-bit binary data blocks specified. Ladder ENO:=BKAND(EN,s1,s2,n,d); ENO:=BKANDP(EN,s1,s2,n,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition BKAND...
  • Page 311 Processing details • These instructions perform an AND operation on the (n) points of data from the device specified by (s1) and the (n) points of data from the device specified by (s2), and store the operation result in the device specified by (d) and later. ∙∙∙...
  • Page 312: Performing An Or Operation On 16-Bit Data

    Performing an OR operation on 16-bit data WOR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an OR operation on the two sets of 16-bit binary data specified. Ladder Not supported (...
  • Page 313 Processing details • These instructions perform an OR operation (bit-by-bit) on the 16-bit binary data in the device specified by (d) and the 16- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 314 WOR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an OR operation on the two sets of 16-bit binary data specified. Ladder ENO:=WOR(EN,s1,s2,d); ENO:=WORP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition WORP Setting data...
  • Page 315 Processing details • These instructions perform an OR operation (bit-by-bit) on the 16-bit binary data in the device specified by (s1) and the 16- bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 316: Performing An Or Operation On 32-Bit Data

    Performing an OR operation on 32-bit data DOR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an OR operation on the two sets of 32-bit binary data specified. Ladder Not supported (...
  • Page 317 Processing details • These instructions perform an OR operation (bit-by-bit) on the 32-bit binary data in the device specified by (d) and the 32- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). (d)+1 ∙∙∙...
  • Page 318 DOR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an OR operation on the two sets of 32-bit binary data specified. Ladder ENO:=DOR(EN,s1,s2,d); ENO:=DORP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition DORP Setting data...
  • Page 319 Processing details • These instructions perform an OR operation (bit-by-bit) on the 32-bit binary data in the device specified by (s1) and the 32- bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) ∙∙∙...
  • Page 320: Performing An Or Operation On 16-Bit Block Data

    Performing an OR operation on 16-bit block data BKOR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an OR operation on the two 16-bit binary data blocks specified. Ladder ENO:=BKOR(EN,s1,s2,n,d); ENO:=BKORP(EN,s1,s2,n,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition BKOR...
  • Page 321 Processing details • These instructions perform an OR operation on the (n) points of data from the device specified by (s1) and the (n) points of data from the device specified by (s2), and store the operation result in the device specified by (d) and later. ∙∙∙...
  • Page 322: Performing An Xor Operation On 16-Bit Data

    Performing an XOR operation on 16-bit data WXOR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XOR operation on the two sets of 16-bit binary data specified. Ladder Not supported (...
  • Page 323 Processing details • These instructions perform an XOR operation (bit-by-bit) on the 16-bit binary data in the device specified by (d) and the 16- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 324 WXOR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XOR operation on the two sets of 16-bit binary data specified. Ladder ENO:=WXOR(EN,s1,s2,d); ENO:=WXORP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition WXOR WXORP...
  • Page 325 Processing details • These instructions perform an XOR operation (bit-by-bit) on the 16-bit binary data in the device specified by (s1) and the 16-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 326: Performing An Xor Operation On 32-Bit Data

    Performing an XOR operation on 32-bit data DXOR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XOR operation on the two sets of 32-bit binary data specified. Ladder Not supported (...
  • Page 327 Processing details • These instructions perform an XOR operation (bit-by-bit) on the 32-bit binary data in the device specified by (d) and the 32- bit binary data in the device specified by (s), and store the operation result in the device specified by (d). (d)+1 ∙∙∙...
  • Page 328 DXOR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XOR operation on the two sets of 32-bit binary data specified. Ladder ENO:=DXOR(EN,s1,s2,d); ENO:=DXORP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition DXOR DXORP...
  • Page 329 Processing details • These instructions perform an XOR operation (bit-by-bit) on the 32-bit binary data in the device specified by (s1) and the 32-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) ∙∙∙...
  • Page 330: Performing An Xor Operation On 16-Bit Block Data

    Performing an XOR operation on 16-bit block data BKXOR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XOR operation on the two 16-bit binary data blocks specified. Ladder ENO:=BKXOR(EN,s1,s2,n,d); ENO:=BKXORP(EN,s1,s2,n,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition BKXOR...
  • Page 331 Processing details • These instructions perform an XOR operation on the (n) points of data from the device specified by (s1) and the (n) points of data from the device specified by (s2), and store the operation result in the device specified by (d) and later. ∙∙∙...
  • Page 332: Performing An Xnor Operation On 16-Bit Data

    Performing an XNOR operation on 16-bit data WXNR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XNOR operation on the two sets of 16-bit binary data specified. Ladder Not supported (...
  • Page 333 Processing details • These instructions perform an XNOR operation on the 16-bit binary data in the device specified by (d) and the 16-bit binary data in the device specified by (s), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 334 WXNR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XNOR operation on the two sets of 16-bit binary data specified. Ladder ENO:=WXNR(EN,s1,s2,d); ENO:=WXNRP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition WXNR WXNRP...
  • Page 335 Processing details • These instructions perform an exclusive NOR operation on the 16-bit binary data in the device specified by (s1) and the 16- bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). ∙∙∙...
  • Page 336: Performing An Xnor Operation On 32-Bit Data

    Performing an XNOR operation on 32-bit data DXNR(P) [when two operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XNOR operation on the two sets of 32-bit binary data specified. Ladder Not supported (...
  • Page 337 Processing details • These instructions perform an XNOR operation on the 32-bit binary data in the device specified by (d) and the 32-bit binary data in the device specified by (s), and store the operation result in the device specified by (d). (d)+1 ∙∙∙...
  • Page 338 DXNR(P) [when three operands are set] RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XNOR operation on the two sets of 32-bit binary data specified. Ladder ENO:=DXNR(EN,s1,s2,d); ENO:=DXNRP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition DXNR DXNRP...
  • Page 339 Processing details • These instructions perform an XNOR operation on the 32-bit binary data in the device specified by (s1) and the 32-bit binary data in the device specified by (s2), and store the operation result in the device specified by (d). (s1)+1 (s1) ∙∙∙...
  • Page 340: Performing An Xnor Operation On 16-Bit Block Data

    Performing an XNOR operation on 16-bit block data BKXNR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions perform an XNOR operation on the two 16-bit binary data blocks specified. Ladder ENO:=BKXNR(EN,s1,s2,n,d); ENO:=BKXNRP(EN,s1,s2,n,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition BKXNR...
  • Page 341 Processing details • These instructions perform an exclusive NOR operation on the (n) points of data from the device specified by (s1) and the (n) points of data from the device specified by (s2), and store the operation result in the device specified by (d) and later. ∙∙∙...
  • Page 342: Bit Processing Instructions

    Bit Processing Instructions Setting a bit in the word device BSET(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions set the 'n'th bit in the specified word device to 1. Ladder ENO:=BSET(EN,n,d); ENO:=BSETP(EN,n,d); FBD/LD ■Execution condition Instruction Execution condition BSET...
  • Page 343 Processing details • These instructions set the 'n'th bit in the word device specified by (d) to 1. BSETP ∙∙∙ ∙∙∙ D10 1 1 0 0 1 1 0 1 1 0 1 1 ∙∙∙ ∙∙∙ D10 1 1 0 0 1 1 0 1 1 0 1 1 (1) Set b6 of D10 to 1.
  • Page 344: Resetting A Bit In The Word Device

    Resetting a bit in the word device BRST(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions reset the 'n'th bit in the specified word device to 0. Ladder ENO:=BRST(EN,n,d); ENO:=BRSTP(EN,n,d); FBD/LD ■Execution condition Instruction Execution condition BRST BRSTP Setting data...
  • Page 345 Processing details • These instructions reset the 'n'th bit in the word device specified by (d) to 0. BRSTP ∙∙∙ ∙∙∙ D10 1 1 0 0 1 1 0 1 1 0 1 1 ∙∙∙ ∙∙∙ D10 1 1 0 0 1 1 0 1 1 0 1 1 (1) Reset the b11 of D10 to 0.
  • Page 346: Performing A 16-Bit Test

    Performing a 16-bit test TEST(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions extract the 'n'th bit in the specified word device. Ladder ENO:=TEST(EN,s1,s2,d); ENO:=TESTP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition TEST TESTP Setting data ■Description, range, data type Operand Description...
  • Page 347 Processing details • These instructions extract the bit data at the position specified by (s2) of the word device specified by (s1), and write it to the bit device specified by (d). ∙∙∙ ∙∙∙ (s1) (1) (s2) bit (When (s2)=5) •...
  • Page 348: Performing A 32-Bit Test

    Performing a 32-bit test DTEST(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions extract the 'n'th bit in the specified double-word device. Ladder ENO:=DTEST(EN,s1,s2,d); ENO:=DTESTP(EN,s1,s2,d); (s1) (s2) FBD/LD ■Execution condition Instruction Execution condition DTEST DTESTP Setting data ■Description, range, data type Operand Description...
  • Page 349 Processing details • These instructions extract the bit data at the position specified by (s2) of the double-word device specified by (s1), and write it to the bit device specified by (d). ∙∙∙ ∙∙∙ ∙∙∙ (s1)+1 (s1) (1) (s2) bit (When (s2)=21) •...
  • Page 350: Batch-Resetting Bit Devices

    Batch-resetting bit devices BKRST(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions reset the (n) points of bit devices starting from the bit device specified. Ladder ENO:=BKRST(EN,n,d); ENO:=BKRSTP(EN,n,d); FBD/LD ■Execution condition Instruction Execution condition BKRST BKRSTP Setting data ■Description, range, data type Operand...
  • Page 351 Processing details • These instructions reset the (n) points of bit devices starting from the bit device specified by (d). • The following table lists the reset status of the bit devices. Device Status Annunciator (F) • The (n) points of data starting from the annunciator (F) number in the device specified by (d) turn off. •...
  • Page 352: Shift Instructions

    Shift Instructions Shifting 16-bit binary data to the right by n bit(s) SFR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the 16-bit binary data in the specified device to the right. Ladder ENO:=SFR(EN,n,d); ENO:=SFRP(EN,n,d); FBD/LD ■Execution condition Instruction...
  • Page 353 Processing details • These instructions shift the 16-bit binary data in the device specified by (d) to the right by (n) bit(s). The (n) bit(s) from the most significant bit is/are filled with 0(s). When (n)=6 b14 b13 b12 b11 b10 b9 b6 b5 b4 b3 b2 b1 (SM700) b14 b13 b12 b11 b10 b9...
  • Page 354: Shifting 16-Bit Binary Data To The Left By N Bit(S)

    Shifting 16-bit binary data to the left by n bit(s) SFL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the 16-bit binary data in the specified device to the left. Ladder ENO:=SFL(EN,n,d); ENO:=SFLP(EN,n,d); FBD/LD ■Execution condition Instruction Execution condition SFLP...
  • Page 355 Processing details • This instruction shifts the 16-bit binary data in the device specified by (d) to the left by (n) bit(s). The (n) bit(s) from the least significant bit is/are filled with 0(s). When (n)=8 b14 b13 b12 b11 b10 b9 b6 b5 b4 b3 b2 b1 (SM700) b14 b13 b12 b11 b10 b9...
  • Page 356: Shifting N-Bit Data To The Right By One Bit

    Shifting n-bit data to the right by one bit BSFR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n points of data starting from the specified device to the right by one bit. Ladder ENO:=BSFR(EN,n,d);...
  • Page 357 Processing details • These instructions shift the (n) points of data starting from the device specified by (d) to the right by one bit. (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (SM700) (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (1) Filled with 0. Operation error There is no operation error.
  • Page 358: Shifting N-Bit Data To The Left By One Bit

    Shifting n-bit data to the left by one bit BSFL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n points of data starting from the specified device to the left by one bit. Ladder ENO:=BSFL(EN,n,d);...
  • Page 359 Processing details • These instructions shift the (n) points of data starting from the device specified by (d) to the left by one bit. (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (SM700) (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (1) Filled with 0 Operation error There is no operation error.
  • Page 360: Shifting N-Word Data To The Right By One Word

    Shifting n-word data to the right by one word DSFR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n points of data starting from the specified device to the right by one word. Ladder ENO:=DSFR(EN,n,d);...
  • Page 361 Processing details • These instructions shift the (n) points of data starting from the device specified by (d) to the right by one word. (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 (d)+(n)-4 ∙∙∙ (d)+1 (1) Filled with 0. Operation error There is no operation error.
  • Page 362: Shifting N-Word Data To The Left By One Word

    Shifting n-word data to the left by one word DSFL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n points of data starting from the specified device to the left by one word. Ladder ENO:=DSFL(EN,n,d);...
  • Page 363 Processing details • These instructions shift the (n) points of data starting from the device specified by (d) to the left by one word. (d)+(n)-1 (d)+(n)-2 (d)+(n)-3 ∙∙∙ (d)+2 (d)+1 (d)+(n)-1 (d)+(n)-2 ∙∙∙ (d)+3 (d)+2 (d)+1 (1) Filled with 0. Operation error There is no operation error.
  • Page 364: Shifting N-Bit Data To The Right By N Bit(S)

    Shifting n-bit data to the right by n bit(s) SFTBR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n-bit data starting from the specified device to the right by n bit(s). Ladder ENO:=SFTBR(EN,n1,n2,d); ENO:=SFTBRP(EN,n1,n2,d); (n1) (n2) FBD/LD...
  • Page 365 Processing details • These instructions shift the (n1) bit(s) of data starting from the specified device to the right by (n2) bit(s). When (n1)=10 and (n2)=4 (n1) (n2) (d)+9 (d)+8 (d)+7 (d)+6 (d)+5 (d)+4 (d)+3 (d)+2 (d)+1 (d)+9 (d)+8 (d)+7 (d)+6 (d)+5 (d)+4...
  • Page 366 SFTR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions shift the (n2) bit(s) of area to the right within the (n1) bits of data area starting from the specified device. Ladder ENO:=SFTR(EN,s,n1,n2,d);...
  • Page 367 Processing details • These instructions shift the (n2) bit(s) of area to the right within the (n1) bits of data area starting from the device specified by (d). After the shift, (n2) points of area from (s) are set into (n2) points of area from (d)+(n1-n2). •...
  • Page 368: Shifting N-Bit Data To The Left By N Bit(S)

    Shifting n-bit data to the left by n bit(s) SFTBL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n-bit data starting from the specified device to the left by n bit(s). Ladder ENO:=SFTBL(EN,n1,n2,d); ENO:=SFTBLP(EN,n1,n2,d); (n1) (n2) FBD/LD...
  • Page 369 Processing details • These instructions shift the (n1) bit(s) of data starting from the specified device to the left by (n2) bit(s). When (n1)=10 and (n2)=4 (n1) (n2) (d)+9 (d)+8 (d)+7 (d)+6 (d)+5 (d)+4 (d)+3 (d)+2 (d)+1 (SM700) (d)+9 (d)+8 (d)+7 (d)+6 (d)+5...
  • Page 370 SFTL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions shift the (n2) bit(s) of area to the left within the (n1) bits of data area starting from the specified device. Ladder ENO:=SFTL(EN,s,n1,n2,d);...
  • Page 371 Processing details • These instructions shift the (n2) bit(s) of area to the left within the (n1) bits of data area starting from the device specified by (d). After the shift, (n2) points from (s) are set into (n2) points from (d). •...
  • Page 372: Shifting N-Word Data To The Right By N Word(S)

    Shifting n-word data to the right by n word(s) SFTWR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n-word data starting from the specified device to the right by n word(s). Ladder ENO:=SFTWR(EN,n1,n2,d); ENO:=SFTWRP(EN,n1,n2,d); (n1) (n2) FBD/LD...
  • Page 373 Processing details • These instructions shift the (n1) word(s) of data starting from the specified device to the right by (n2) word(s). When (n1)=9 and (n2)=4 (n1) (n2) (d)+8 (d)+7 (d)+6 (d)+5 (d)+4 (d)+3 (d)+2 (d)+1 30FH 100H 1FFH 7FFH (d)+8 (d)+7 (d)+6...
  • Page 374 WSFR(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions shift the (n2) word(s) of area to the right within the (n1) words of data area starting from the specified device.
  • Page 375 Processing details • These instructions shift the (n2) word(s) of area to the right within the (n1) words of data area starting from the device specified by (d). After the shift, (n2) points of area from (s) are set into (n2) points of area from (d)+(n1-n2). •...
  • Page 376: Shifting N-Word Data To The Left By N Word(S)

    Shifting n-word data to the left by n word(s) SFTWL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions shift the n-word data starting from the specified device to the left by n word(s). Ladder ENO:=SFTWL(EN,n1,n2,d); ENO:=SFTWLP(EN,n1,n2,d); (n1) (n2) FBD/LD...
  • Page 377 Processing details • These instructions shift the (n1) word(s) of data starting from the specified device to the left by (n2) word(s). When (n1)=9 and (n2)=4 (n1) (n2) (d)+8 (d)+7 (d)+6 (d)+5 (d)+4 (d)+3 (d)+2 (d)+1 1FFH 7FFH (d)+8 (d)+7 (d)+6 (d)+5 (d)+4...
  • Page 378 WSFL(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) • The RnCPU and RnENCPU with firmware version "17" or later support this instruction. (Use an engineering tool with version "1.020W" or later.) These instructions shift the (n2) word(s) of area to the left within the (n1) words of data area starting from the specified device. Ladder ENO:=WSFL(EN,s,n1,n2,d);...
  • Page 379 Processing details • These instructions shift the (n2) word(s) of area to the left within the (n1) words of data area starting from the device specified by (d). After the shift, (n2) points from (s) are set into (n2) points from (d). •...
  • Page 380: Data Conversion Instructions

    Data Conversion Instructions Converting binary data to BCD 4-digit data BCD(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit binary data to BCD 4-digit data. Ladder ENO:=BCD(EN,s,d); ENO:=BCDP(EN,s,d); FBD/LD ■Execution condition Instruction Execution condition BCDP Setting data...
  • Page 381 Processing details • These instructions convert the 16-bit binary data (0 to 9999) in the device specified by (s) to BCD 4-digit data, and store the converted data in the device specified by (d). BIN 9999 ×10 ×10 ×10 ×10 BCD 9999 (1) Set 0s.
  • Page 382: Converting Binary Data To Bcd 8-Digit Data

    Converting binary data to BCD 8-digit data DBCD(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit binary data to BCD 8-digit data. Ladder ENO:=DBCD(EN,s,d); ENO:=DBCDP(EN,s,d); FBD/LD ■Execution condition Instruction Execution condition DBCD DBCDP Setting data ■Description, range, data type...
  • Page 383 Processing details • These instructions convert the 32-bit binary data (0 to 99999999) in the device specified by (s) to BCD 8-digit data, and store the converted data in the device specified by (d). (s)+1 (Upper 16 bits) (s) (Lower 16 bits) BIN 99999999 ×10 ×10...
  • Page 384: Converting Bcd 4-Digit Data To 16-Bit Binary Data

    Converting BCD 4-digit data to 16-bit binary data BIN(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified BCD 4-digit data to 16-bit binary data. Ladder ENO:=BIN(EN,s,d); ENO:=BINP(EN,s,d); FBD/LD ■Execution condition Instruction Execution condition BINP Setting data ■Description, range, data type...
  • Page 385 Operation error Error code Description (SD0) 3401H A value other than 0 to 9 exists at any digit of the value in the device specified by (s). *1 Turning on SM754 can prevent this error from being detected. If the specified value is out of the valid range, the BIN(P) instruction is not executed regardless of the status (on/off) of SM754. The BIN(P) instruction does not execute the next operation until the command (execution condition) is turned off and on regardless of the presence of an error.
  • Page 386: Converting Bcd 8-Digit Data To 32-Bit Binary Data

    Converting BCD 8-digit data to 32-bit binary data DBIN(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified BCD 8-digit data to 32-bit binary data. Ladder ENO:=DBIN(EN,s,d); ENO:=DBINP(EN,s,d); FBD/LD ■Execution condition Instruction Execution condition DBIN DBINP Setting data...
  • Page 387 Processing details • These instructions convert the BCD 8-digit data (0 to 99999999) in the device specified by (s) to 32-bit binary data, and store the converted data in the device specified by (d). (s)+1 ×10 ×10 ×10 ×10 ×10 ×10 ×10 ×10...
  • Page 388: Converting Single-Precision Real Number To 16-Bit Signed Binary Data

    Converting single-precision real number to 16-bit signed binary data FLT2INT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified single-precision real number to 16-bit signed binary data. Ladder ENO:=FLT2INT(EN,s,d); ENO:=FLT2INTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 389 Processing details • These instructions convert the single-precision real number in the device specified by (s) to 16-bit signed binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the single-precision real number is rounded off. •...
  • Page 390: Converting Single-Precision Real Number To 16-Bit Unsigned Binary Data

    Converting single-precision real number to 16-bit unsigned binary data FLT2UINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified single-precision real number to 16-bit unsigned binary data. Ladder ENO:=FLT2UINT(EN,s,d); ENO:=FLT2UINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 391 Processing details • These instructions convert the single-precision real number in the device specified by (s) to 16-bit unsigned binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the single-precision real number is rounded off. •...
  • Page 392: Converting Single-Precision Real Number To 32-Bit Signed Binary Data

    Converting single-precision real number to 32-bit signed binary data FLT2DINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified single-precision real number to 32-bit signed binary data. Ladder ENO:=FLT2DINT(EN,s,d); ENO:=FLT2DINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 393 Processing details • These instructions convert the single-precision real number in the device specified by (s) to 32-bit signed binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the single-precision real number is rounded off. •...
  • Page 394: Converting Single-Precision Real Number To 32-Bit Unsigned Binary Data

    Converting single-precision real number to 32-bit unsigned binary data FLT2UDINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified single-precision real number to 32-bit unsigned binary data. Ladder ENO:=FLT2UDINT(EN,s,d); ENO:=FLT2UDINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 395 Processing details • These instructions convert the single-precision real number in the device specified by (s) to 32-bit unsigned binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the single-precision real number is rounded off. •...
  • Page 396: Converting Double-Precision Real Number To 16-Bit Signed Binary Data

    Converting double-precision real number to 16-bit signed binary data DBL2INT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified double-precision real number to 16-bit signed binary data. Ladder ENO:=DBL2INT(EN,s,d); ENO:=DBL2INTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 397 Processing details • These instructions convert the double-precision real number in the device specified by (s) to 16-bit signed binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the double-precision real number is rounded off. •...
  • Page 398: Converting Double-Precision Real Number To 16-Bit Unsigned Binary Data

    Converting double-precision real number to 16-bit unsigned binary data DBL2UINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified double-precision real number to 16-bit unsigned binary data. Ladder ENO:=DBL2UINT(EN,s,d); ENO:=DBL2UINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 399 Processing details • These instructions convert the double-precision real number in the device specified by (s) to 16-bit unsigned binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the double-precision real number is rounded off. •...
  • Page 400: Converting Double-Precision Real Number To 32-Bit Signed Binary Data

    Converting double-precision real number to 32-bit signed binary data DBL2DINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified double-precision real number to 32-bit signed binary data. Ladder ENO:=DBL2DINT(EN,s,d); ENO:=DBL2DINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 401 Processing details • These instructions convert the double-precision real number in the device specified by (s) to 32-bit signed binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the double-precision real number is rounded off. •...
  • Page 402: Converting Double-Precision Real Number To 32-Bit Unsigned Binary Data

    Converting double-precision real number to 32-bit unsigned binary data DBL2UDINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified double-precision real number to 32-bit unsigned binary data. Ladder ENO:=DBL2UDINT(EN,s,d); ENO:=DBL2UDINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 403 Processing details • These instructions convert the double-precision real number in the device specified by (s) to 32-bit unsigned binary data, and store the converted data in the device specified by (d). • After conversion, the first digit after the decimal point of the double-precision real number is rounded off. •...
  • Page 404: Converting 16-Bit Signed Binary Data To 16-Bit Unsigned Binary Data

    Converting 16-bit signed binary data to 16-bit unsigned binary data INT2UINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit signed binary data to 16-bit unsigned binary data. Ladder ENO:=INT2UINT(EN,s,d); ENO:=INT2UINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 405 Processing details • These instructions convert the 16-bit signed binary data (ANY16_S) in the label specified by (s) to 16-bit unsigned binary data (ANY16_U), and store the converted data in the label specified by (d). • The following figure shows a program example using the INT2UINT(P) instruction. The +_U instruction requires ANY16_U to be specified by the operand, and therefore, before the +_U instruction is executed, the INT2UINT instruction is used to convert wLabel0 of ANY16_S to uLabel1 of ANY16_U.
  • Page 406: Converting 16-Bit Signed Binary Data To 32-Bit Signed Binary Data

    Converting 16-bit signed binary data to 32-bit signed binary data INT2DINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit signed binary data to 32-bit signed binary data. Ladder ENO:=INT2DINT(EN,s,d); ENO:=INT2DINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 407 Processing details • These instructions convert the 16-bit signed binary data in the device specified by (s) to 32-bit signed binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 16-bit signed binary data stored in D0 to 32-bit signed binary data, and stores the converted data in D100 and D101.
  • Page 408: Converting 16-Bit Signed Binary Data To 32-Bit Unsigned Binary Data

    Converting 16-bit signed binary data to 32-bit unsigned binary data INT2UDINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit signed binary data to 32-bit unsigned binary data. Ladder ENO:=INT2UDINT(EN,s,d); ENO:=INT2UDINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 409 Processing details • These instructions convert the 16-bit signed binary data in the device specified by (s) to 32-bit unsigned binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 16-bit signed binary data stored in D0 to 32-bit unsigned binary data, and stores the converted data in D100 and D101.
  • Page 410: Converting 16-Bit Unsigned Binary Data To 16-Bit Signed Binary Data

    Converting 16-bit unsigned binary data to 16-bit signed binary data UINT2INT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit unsigned binary data to 16-bit signed binary data. Ladder ENO:=UINT2INT(EN,s,d); ENO:=UINT2INTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 411 Processing details • These instructions convert the 16-bit signed binary data (ANY16_U) in the label specified by (s) to 16-bit unsigned binary data (ANY16_S), and store the converted data in the label specified by (d). • The following figure shows a program example using the UINT2INT(P) instruction. The + instruction requires ANY16_S to be specified by the operand, and therefore, before the + instruction is executed, the UINT2INT instruction is used to convert uLabel0 of ANY16_U to wLabel1 of ANY16_S.
  • Page 412: Converting 16-Bit Unsigned Binary Data To 32-Bit Signed Binary Data

    Converting 16-bit unsigned binary data to 32-bit signed binary data UINT2DINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit unsigned binary data to 32-bit signed binary data. Ladder ENO:=UINT2DINT(EN,s,d); ENO:=UINT2DINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 413 Processing details • These instructions convert the 16-bit unsigned binary data in the device specified by (s) to 32-bit signed binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 16-bit unsigned binary data stored in D0 to 32-bit signed binary data, and stores the converted data in D100 and D101.
  • Page 414: Converting 16-Bit Unsigned Binary Data To 32-Bit Unsigned Binary Data

    Converting 16-bit unsigned binary data to 32-bit unsigned binary data UINT2UDINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 16-bit unsigned binary data to 32-bit unsigned binary data. Ladder ENO:=UINT2UDINT(EN,s,d); ENO:=UINT2UDINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 415 Processing details • These instructions convert the 16-bit unsigned binary data in the device specified by (s) to 32-bit unsigned binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 16-bit unsigned binary data stored in D0 to 32-bit unsigned binary data, and stores the converted data in D100 and D101.
  • Page 416: Converting 32-Bit Signed Binary Data To 16-Bit Signed Binary Data

    Converting 32-bit signed binary data to 16-bit signed binary data DINT2INT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit signed binary data to 16-bit signed binary data. Ladder ENO:=DINT2INT(EN,s,d); ENO:=DINT2INTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 417 Processing details • These instructions convert the 32-bit signed binary data in the device specified by (s) to 16-bit signed binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 32-bit signed binary data stored in D0 and D1 to 16-bit signed binary data, and stores the converted data in D100.
  • Page 418: Converting 32-Bit Signed Binary Data To 16-Bit Unsigned Binary Data

    Converting 32-bit signed binary data to 16-bit unsigned binary data DINT2UINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit signed binary data to 16-bit unsigned binary data. Ladder ENO:=DINT2UINT(EN,s,d); ENO:=DINT2UINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 419 Processing details • These instructions convert the 32-bit signed binary data in the device specified by (s) to 16-bit unsigned binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 32-bit signed binary data stored in D0 and D1 to 16-bit unsigned binary data, and stores the converted data in D100.
  • Page 420: Converting 32-Bit Signed Binary Data To 32-Bit Unsigned Binary Data

    Converting 32-bit signed binary data to 32-bit unsigned binary data DINT2UDINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit signed binary data to 32-bit unsigned binary data. Ladder ENO:=DINT2UDINT(EN,s,d); ENO:=DINT2UDINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 421 Processing details • These instructions convert the 32-bit signed binary data (ANY32_S) in the label specified by (s) to 32-bit unsigned binary data (ANY32_U), and store the converted data in the label specified by (d). • The following figure shows a program example using the DINT2UDINT(P) instruction. The D+_U instruction requires ANY32_U to be specified by the operand, and therefore, before the D+_U instruction is executed, the DINT2UDINT instruction is used to convert dLabel0 of ANY32_S to udLabel1 of ANY32_U.
  • Page 422: Converting 32-Bit Unsigned Binary Data To 16-Bit Signed Binary Data

    Converting 32-bit unsigned binary data to 16-bit signed binary data UDINT2INT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit unsigned binary data to 16-bit signed binary data. Ladder ENO:=UDINT2INT(EN,s,d); ENO:=UDINT2INTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 423 Processing details • These instructions convert the 32-bit unsigned binary data in the device specified by (s) to 16-bit signed binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 32-bit unsigned binary data stored in D0 and D1 to 16-bit signed binary data, and stores the converted data in D100.
  • Page 424: Converting 32-Bit Unsigned Binary Data To 16-Bit Unsigned Binary Data

    Converting 32-bit unsigned binary data to 16-bit unsigned binary data UDINT2UINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit unsigned binary data to 16-bit unsigned binary data. Ladder ENO:=UDINT2UINT(EN,s,d); ENO:=UDINT2UINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later supports the ST. ■Execution condition Instruction Execution condition...
  • Page 425 Processing details • These instructions convert the 32-bit unsigned binary data in the device specified by (s) to 16-bit unsigned binary data, and store the converted data in the device specified by (d). The following program example converts, when M0 turns on, the 32-bit unsigned binary data stored in D0 and D1 to 16-bit unsigned binary data, and stores the converted data in D100.
  • Page 426: Converting 32-Bit Unsigned Binary Data To 32-Bit Signed Binary Data

    Converting 32-bit unsigned binary data to 32-bit signed binary data UDINT2DINT(P) RnPCPU RnPCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) These instructions convert the specified 32-bit unsigned binary data to 32-bit signed binary data. Ladder ENO:=UDINT2DINT(EN,s,d); ENO:=UDINT2DINTP(EN,s,d); FBD/LD *1 The engineering tool with version "1.035M" or later suppor