EN
Mitsubishi Electronics logo
Official user manual

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU)

838 pages·27.8 MB·Video Game Controller·PDF·ENDEFRITNLJA
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU)
Table of Contents 327 sections Front Cover · Manual number · Table of Contents · Positioning of This Manual · … ShowHide
Front Coverp.1Manual numberp.3Table of Contentsp.5Positioning of This Manualp.13Related Manualsp.16Generic Names and Abbreviations Used in Manualsp.191. Outlinep.201.1 Outline of Structured Programs and Programming languagesp.201.1.1 Outline of Structured Programsp.201.1.2 Programming languagesp.211.2 PLC Series and Programming Software Versionp.221.3 Cautions on Creation of Fundamental Programsp.221.3.1 I/O PROCESSING AND RESPONSE DELAYp.221.3.2 Double output (double coil) operation and countermeasuresp.231.3.3 Circuits which cannot be created by structured ladder programs and countermeasuresp.241.3.4 Handling of general flagsp.241.3.5 Handling of operation error flagp.271.3.6 Handling of function extension flagp.271.3.7 Limitation in the number of instructions and limitation in simultaneous instruction instancesp.282. Instruction Listp.302.1 Basic Instructionsp.302.2 Step Ladder Instructionsp.312.3 Applied Instructionsp.313. Configuration of Instructionp.443.1 Expression and Operation Form of Sequence Instructionsp.443.2 Labelsp.463.3 Devices and Addressesp.493.4 EN and ENOp.504. How to Read Explanation of Instructionsp.525. Basic Instructionp.545.1 LD, LDI, AND, ANI, OR, ORIp.555.2 LDP, LDF, ANDP, ANDF, ORP, ORFp.595.3 OUT (Excluding timers and counters)p.645.4 Operating Timerp.675.4.1 OUT_Tp.675.5 Operating Countersp.715.5.1 OUT_C, OUT_C_32p.715.6 AND(...), OR(...)p.735.7 MPS, MRD, MPPp.755.8 INVp.795.9 MEP, MEFp.815.10 SET, RSTp.835.11 PLS, PLFp.875.12 MC, MCRp.895.13 ENDp.935.14 NOP (for simple project only)p.936. Step Ladder Instructionsp.946.1 Step Ladderp.946.1.1 Outlinep.946.1.2 Function and operation explanationp.946.1.3 Program examplesp.1016.2 STLp.1026.3 RETp.1037. Applied Instructions (Program Flow)p.1057.1 CJ / Conditional Jumpp.1067.2 CALL / Call Subroutinep.1137.3 SRET / Subroutine Returnp.1187.4 IRET / Interrupt Returnp.1197.5 DI / Disable Interruptp.1227.6 EI / Enable Interruptp.1237.7 FEND / Main Routine Program Endp.1257.8 WDT / Watchdog Timer Refreshp.1277.9 FOR / Start a FOR/NEXT Loopp.1307.10 NEXT / End a FOR/NEXT Loopp.1318. Applied Instructions (Move and Compare)p.1348.1 CMP / Comparep.1358.2 ZCP / Zone Comparep.1388.3 MOV / Movep.1418.4 SMOV / Shift Movep.1458.5 CML / Complementp.1488.6 BMOV / Block Movep.1518.7 FMOV / Fill Movep.1568.8 XCH / Exchangep.1598.9 BCD / Conversion to Binary Coded Decimalp.1618.10 BIN / Conversion to Binaryp.1659. Applied Instructions (Arithmetic and Logical Operation)p.1699.1 ADDP / Additionp.1709.2 SUBP / Subtractionp.1739.3 MULP / Multiplicationp.1769.4 DIVP / Divisionp.1809.5 INC / Incrementp.1839.6 DEC / Decrementp.1859.7 WAND / Logical Word ANDp.1879.8 WOR / Logical Word ORp.1899.9 WXOR / Logical Exclusive ORp.1919.10 NEG / Negationp.19410. Applied Instructions (Rotation and Shift Operation)p.19710.1 ROR / Rotation Rightp.19810.2 ROL / Rotation Leftp.20110.3 RCR / Rotation Right with Carryp.20410.4 RCL / Rotation Left with Carryp.20710.5 SFTR / Bit Shift Rightp.21010.6 SFTL / Bit Shift Leftp.21210.7 WSFR / Word Shift Rightp.21510.8 WSFL / Word Shift Leftp.21810.9 SFWR / Shift Write [FIFO/FILO Control]p.22110.10 SFRD / Shift Read [FIFO Control]p.22411. Applied Instructions (Data Operation)p.22611.1 ZRST / Zone Resetp.22711.2 DECO / Decodep.23111.3 ENCO / Encodep.23511.4 SUM / Sum of Active Bitsp.23811.5 BON / Check Specified Bit Statusp.24111.6 MEAN / Meanp.24411.7 ANS / Timed Annunciator Setp.24611.8 ANR / Annunciator Resetp.24811.9 SQR / Square Rootp.25011.10 FLT / Conversion to Floating Pointp.25212. Applied Instructions (High Speed Processing)p.25612.1 REF / Refreshp.25712.1.1 What should be understood before using the REF instructionp.26012.2 REFF / Refresh and Filter Adjustp.26112.2.1 What should be understood before using REFF instructionp.26412.3 MTR / Input Matrixp.26512.3.1 Operation and cautions for MTR instructionp.26812.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Setp.26912.4.1 Common cautions on using instructions for high speed counterp.27312.5 DHSCR / High Speed Counter Resetp.27712.6 DHSZ / High Speed Counter Zone Comparep.28112.6.1 Program in which comparison result is set to ON when power is turned ON [ZCP] instructionp.28512.6.2 Table high speed comparison mode (M8130)p.28712.6.3 Frequency control mode (DHSZ, DPLSY) (M8132)p.29112.7 SPD / Speed Detectionp.29412.8 PLSY / Pulse Y Outputp.29812.9 PWM / Pulse Width Modulationp.30512.10 PLSR / Acceleration/Deceleration Setupp.30813. Applied Instructions (Handy Instruction)p.31313.1 IST / Initial Statep.31413.2 SER / Search a Data Stackp.32513.3 ABSD / Absolute Drum Sequencerp.32913.4 INCD / Incremental Drum Sequencerp.33313.5 TTMR / Teaching Timerp.33613.6 STMR / Special Timerp.33913.7 ALT / Alternate Statep.34213.8 RAMP / Ramp Variable Valuep.34513.9 ROTC / Rotary Table Controlp.34813.10 SORT / SORT Tabulated Datap.35114. Applied Instructions (External FX I/O Device)p.35414.1 TKY / Ten Key Inputp.35514.2 HKY / Hexadecimal Inputp.35914.3 DSW / Digital Switch (Thumbwheel Input)p.36314.4 SEGD / Seven Segment Decoderp.36714.5 SEGL / Seven Segment With Latchp.36914.5.1 Selection procedure of 7-segment display unitp.37214.5.2 Selection procedure of parameter n by specification of 7-segment displayp.37214.6 ARWS / Arrow Switchp.37414.7 ASC / ASCII Code Data Inputp.37814.8 PR / Print (ASCII Code)p.38014.9 FROM / Read From A Special Function Blockp.38314.9.1 Common terms of FROM/TO instruction (detail)p.38614.10 TO / Write To A Special Function Blockp.38815. Applied Instructions (External Device (optional device))p.39115.1 RS / Serial Communicationp.39215.2 PRUN / Parallel Run (Octal Mode)p.39515.3 ASCI / Hexadecimal to ASCII Conversionp.39715.4 HEX / ASCII to Hexadecimal Conversionp.40115.5 CCD / Check Codep.40515.6 VRRD / Volume Readp.40815.7 VRSC / Volume Scalep.41115.8 RS2 / Serial Communication 2p.41315.9 PID / PID Control Loopp.41616. Applied Instructions (External Device)p.42016.1 MNET / F-16NP/NT communicationp.42116.2 ANRD / Read from F2-6Ap.42316.3 ANWR / Write to F2-6Ap.42516.4 RMST / F2-32RM startp.42616.5 RMWR / Write to F2-32RMp.42716.6 RMRD / Read from F2-32RMp.42916.7 RMMN / F2-32RM monitorp.43116.8 BLK / Specify F2-30GMp.43216.9 MCDE / F2-30GM codep.43417. Applied Instructions (Data Transfer 2)p.43517.1 ZPUSH / Batch Store of Index Registerp.43617.2 ZPOP / Batch POP of Index Registerp.43918. Applied Instructions (Floating Point)p.44118.1 DECMP / Floating Point Comparep.44318.2 DEZCP / Floating Point Zone Comparep.44518.3 DEMOV / Floating Point Movep.44718.4 DESTR / Floating Point to Character String Conversionp.44918.5 DEVAL / Character String to Floating Point Conversionp.45618.6 DEBCD / Floating Point to Scientific Notation Conversionp.46118.7 DEBIN / Scientific Notation to Floating Point Conversionp.46318.8 DEADD / Floating Point Additionp.46518.9 DESUB / Floating Point Subtractionp.46718.10 DEMUL / Floating Point Multiplicationp.46918.11 DEDIV / Floating Point Divisionp.47118.12 DEXP / Floating Point Exponentp.47318.13 DLOGE / Floating Point Natural Logarithmp.47518.14 DLOG10 / Floating Point Common Logarithmp.47718.15 DESQR / Floating Point Square Rootp.47918.16 DENEG / Floating Point Negationp.48118.17 INT / Floating Point to Integer Conversionp.48218.18 DSIN / Floating Point Sinep.48418.19 DCOS / Floating Point Cosinep.48618.20 DTAN / Floating Point Tangentp.48718.21 DASIN / Floating Point Arc Sinep.48818.22 DACOS / Floating Point Arc Cosinep.49018.23 DATAN / Floating Point Arc Tangentp.49218.24 DRAD / Floating Point Degrees to Radians Conversionp.49418.25 DDEG / Floating Point Radians to Degrees Conversionp.49619. Applied Instructions (Data Operation 2)p.49819.1 WSUM / Sum of Word Datap.49919.2 WTOB / WORD to BYTEp.50219.3 BTOW / BYTE to WORDp.50519.4 UNI / 4-bit Linking of Word Datap.50819.5 DIS / 4-bit Grouping of Word Datap.51019.6 SWAP / Byte Swapp.51219.7 SORT2 / Sort Tabulated Data 2p.51420. Applied Instructions (Positioning Control)p.51920.1 DSZR / Dog Search Zero Returnp.52020.2 DVIT / Interrupt Positioningp.52220.3 DTBL / Batch Data Positioning Modep.52520.4 DABS / Absolute Current Value Readp.52720.5 ZRN / Zero Returnp.52920.6 PLSV / Variable Speed Pulse Outputp.53320.7 DRVI / Drive to Incrementp.53620.8 DRVA / Drive to Absolutep.53921. Applied Instructions (Real Time Clock Control)p.54221.1 TCMP / RTC Data Comparep.54321.2 TZCP / RTC Data Zone Comparep.54621.3 TADD / RTC Data Additionp.54921.4 TSUB / RTC Data Subtractionp.55121.5 HTOS / Hour to Second Conversionp.55321.6 STOH / Second to Hour Conversionp.55621.7 TRD / Read RTC datap.55921.8 TWR / Set RTC datap.56121.9 HOUR / Hour Meterp.56522. Applied Instructions (External Device)p.56822.1 GRY / Decimal to Gray Code Conversionp.56922.2 GBIN / Gray Code to Decimal Conversionp.57122.3 RD3A / Read form Dedicated Analog Blockp.57322.4 WR3A / Write to Dedicated Analog Blockp.57523. Applied Instructions (Extension Function)p.57723.1 EXTR_IN / External ROM functionp.57823.2 EXTR_OUT / External ROM functionp.58124. Applied Instructions (Others)p.58524.1 COMRD / Read Device Comment Datap.58624.2 RND / Random Number Generationp.58924.3 DUTY / Timing Pulse Generationp.59124.4 CRC / Cyclic Redundancy Checkp.59424.5 DHCMOV / High Speed Counter Movep.59825. Applied Instructions (Block Data Operation)p.60225.1 BK+ / Block Data Additionp.60325.2 BK- / Block Data Subtractionp.60725.3 BKCMP=, >, <, < >, <=, >= / Block Data Comparep.61126. Applied Instructions (Character String Control)p.61826.1 STR / BIN to Character String Conversionp.61926.2 VAL / Character String to BIN Conversionp.62426.3 $+ / Link Character Stringsp.63026.4 LEN / Character String Length Detectionp.63326.5 RIGHT / Extracting Character String Data from the Rightp.63626.6 LEFT / Extracting Character String Data from the Leftp.63926.7 MIDR / Random Selection of Character Stringsp.64226.8 MIDW / Random Replacement of Character Stringsp.64526.9 INSTR / Character string searchp.64926.10 $MOV / Character String Transferp.65227. Applied Instructions (Data Operation 3)p.65527.1 FDEL / Deleting Data from Tablesp.65627.2 FINS / Inserting Data to Tablesp.65927.3 POP / Shift Last Data Read [FILO Control]p.66227.4 SFR / Bit Shift Right with Carryp.66627.5 SFL / Bit Shift Left with Carryp.66828. Applied Instructions (Data Comparison)p.67028.1 LD =, >, <, <>, <=, >= / Data Comparisonp.67128.2 AND=, >, <, < >, <=, >= / Data Comparisonp.67428.3 OR=, >, <, < >, <=, >= / Data Comparisonp.67729. Applied Instructions (Data Table Operation)p.68029.1 LIMIT / Limit Controlp.68129.2 BAND / Dead Band Controlp.68529.3 ZONE / Zone Controlp.68929.4 SCL / Scaling (Coordinate by Point Data)p.69329.5 DABIN / Decimal ASCII to BIN Conversionp.69729.6 BINDA / BIN to Decimal ASCII Conversionp.70029.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)p.70430. Applied Instructions (External Device Communication)p.70930.1 IVCK / Inverter Status Checkp.71030.2 IVDR / Inverter Drivep.71330.3 IVRD / Inverter Parameter Readp.71630.4 IVWR / Inverter Parameter Writep.71830.5 IVBWR / Inverter Parameter Block Writep.72130.6 IVMC / Inverter Multi Commandp.72330.7 ADPRW / MODBUS Read/Writep.72630.7.1 Command Code and Parametersp.72731. Applied Instructions (Data Transfer 3)p.73031.1 RBFM / Divided BFM Readp.73131.1.1 Common items between RBFM instruction and WBFM instructionp.73331.2 WBFM / Divided BFM Writep.73732. Applied Instructions (High Speed Processing 2)p.73932.1 DHSCT / High Speed Counter Compare With Data Tablep.74033. Applied Instructions (Extension File Register Control)p.74533.1 LOADR / Load From ERp.74633.2 SAVER / Save to ERp.75033.3 INITR / Initialize R and ERp.75933.4 LOGR / Logging R and ERp.76333.5 RWER / Rewrite to ERp.76733.6 INITER / Initialize ERp.77234. Applied Instructions (FX3U-CF-ADP)p.77634.1 FLCRT / File create • checkp.77734.2 FLDEL / File delete • CF card formatp.78134.3 FLWR / Data writep.78334.4 FLRD / Data readp.78734.5 FLCMD / FX3U-CF-ADP commandp.78934.6 FLSTRD / FX3U-CF-ADP status readp.79135. Interrupt Function and Pulse Catch Functionp.79435.1 Outlinep.79435.2 Common itemsp.79535.2.1 Interrupt functionp.79535.2.2 How to disable interrupt function and pulse catch functionp.79635.2.3 Related itemsp.79735.2.4 Cautions on use (common)p.79835.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]p.80035.3.1 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]p.80035.3.2 Examples of practical programs (programs to measure short pulse width)p.80435.4 Input Interrupt (Interrupt by External Signal) [With Delay function]p.80635.5 Timer Interrupt (Interrupt in Constant Cycle)p.80735.5.1 Timer Interrupt (Interrupt in Constant Cycle)p.80735.5.2 Example of practical program (timer interrupt program using instruction)p.80835.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counterp.81235.7 Pulse Catch Function[M8170 to M8177]p.81335.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]p.815Appendix A: Relationships between devices and addressesp.820Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]p.822Appendix B-1 Applied instructions [by instruction type]p.822Appendix B-2 Applied instructions [in alphabetical order]p.829Warrantyp.835Revised Historyp.836Back Coverp.838
Page 1 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FXCPU
Page 1 · click to enlarge
Page 1
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Front Cover diagram (page 1)
Fig. 1 · Front Cover

FXCPU

Structured Programming Manual

Basic & Applied Instruction

Page 2 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Front Cover
Page 2 · click to enlarge
Page 2
Page 2 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Front Cover
Page 3 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — © 2009 MITSUBISHI ELECTRIC CORPORATION
Page 3 · click to enlarge
Page 3

FXCPU Structured Programming Manual

[Basic & Applied Instruction]

Manual number Manual revision DateJY997D34701 L 9/2013 Manual numberJY997D34701 Manual revisionL Date9/2013

Foreword

This manual contains text, diagrams and explanations which will guide the reader through the safe and correct installation, use, and operation of the FX Series programmable controller function for structured programs. It should be read and understood before attempting to install or use the unit. Store this manual in a safe place so that you can take it out and read it whenever necessary. Always forward it to the end user.

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

© 2009 MITSUBISHI ELECTRIC CORPORATION

Page 4 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Registration
Page 4 · click to enlarge
Page 4

Outline Precautions

  • This manual provides information for the use of the FX Series Programmable Controllers. The manual has been written to be used by trained and competent personnel. The definition of such a person or persons is as follows;
1. Any engineer who is responsible for the planning, design and construction of automatic equipment using the product associated with this manual should be of a competent nature, trained and qualified to the local and national standards required to fulfill that role. These engineers should be fully aware of all aspects of safety with aspects regarding to automated equipment.
2. Any commissioning or maintenance engineer must be of a competent nature, trained and qualified to the local and national standards required to fulfill the job. These engineers should also be trained in the use and maintenance of the completed product. This includes being familiar with all associated manuals and documentation for the product. All maintenance should be carried out in accordance with established safety practices.
3. All operators of the completed equipment should be trained to use that product in a safe and coordinated manner in compliance with established safety practices. The operators should also be familiar with documentation that is connected with the actual operation of the completed equipment. Note: the term 'completed equipment' refers to a third party constructed device that contains or uses the

product associated with this manual.

  • This product has been manufactured as a general-purpose part for general industries, and has not been designed or manufactured to be incorporated in a device or system used in purposes related to human life.
  • Before using the product for special purposes such as nuclear power, electric power, aerospace, medicine or passenger movement vehicles, consult with Mitsubishi Electric.
  • This product has been manufactured under strict quality control. However when installing the product where major accidents or losses could occur if the product fails, install appropriate backup or failsafe functions into the system.
  • When combining this product with other products, please confirm the standards and codes of regulation to which the user should follow. Moreover, please confirm the compatibility of this product with the system, machines, and apparatuses to be used.
  • If there is doubt at any stage during installation of the product, always consult a professional electrical engineer who is qualified and trained in the local and national standards. If there is doubt about the operation or use, please consult the nearest Mitsubishi Electric representative.
  • Since the examples within this manual, technical bulletin, catalog, etc. are used as reference; please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will not accept responsibility for actual use of the product based on these illustrative examples.
  • The content, specification etc. of this manual may be changed for improvement without notice.
  • The information in this manual has been carefully checked and is believed to be accurate; however, if you notice any doubtful point, error, etc., please contact the nearest Mitsubishi Electric representative.

Registration

  • Microsoft ® , Windows ® and Excel ® are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
  • CompactFlash is a trademark of SanDisk Corporation in the United States and other countries.
  • Ethernet is a trademark of Xerox Corporation.
  • MODBUS ® is a registered trademark of Schneider Electric SA.
  • The company name and the product name to be described in this manual are the registered trademarks or trademarks of each company.
Page 5 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Table of Contents
Page 5 · Contents
Contents

Contents

Front Coverp.1Manual numberp.3Table of Contentsp.5Positioning of This Manualp.13Related Manualsp.16Generic Names and Abbreviations Used in Manualsp.191. Outlinep.201.1 Outline of Structured Programs and Programming languagesp.201.1.1 Outline of Structured Programsp.201.1.2 Programming languagesp.211.2 PLC Series and Programming Software Versionp.221.3 Cautions on Creation of Fundamental Programsp.221.3.1 I/O PROCESSING AND RESPONSE DELAYp.221.3.2 Double output (double coil) operation and countermeasuresp.231.3.3 Circuits which cannot be created by structured ladder programs and countermeasuresp.241.3.4 Handling of general flagsp.241.3.5 Handling of operation error flagp.271.3.6 Handling of function extension flagp.271.3.7 Limitation in the number of instructions and limitation in simultaneous instruction instancesp.282. Instruction Listp.302.1 Basic Instructionsp.302.2 Step Ladder Instructionsp.312.3 Applied Instructionsp.313. Configuration of Instructionp.443.1 Expression and Operation Form of Sequence Instructionsp.443.2 Labelsp.463.3 Devices and Addressesp.493.4 EN and ENOp.504. How to Read Explanation of Instructionsp.525. Basic Instructionp.545.1 LD, LDI, AND, ANI, OR, ORIp.555.2 LDP, LDF, ANDP, ANDF, ORP, ORFp.595.3 OUT (Excluding timers and counters)p.645.4 Operating Timerp.675.4.1 OUT_Tp.675.5 Operating Countersp.715.5.1 OUT_C, OUT_C_32p.715.6 AND(...), OR(...)p.735.7 MPS, MRD, MPPp.755.8 INVp.795.9 MEP, MEFp.815.10 SET, RSTp.835.11 PLS, PLFp.875.12 MC, MCRp.895.13 ENDp.935.14 NOP (for simple project only)p.936. Step Ladder Instructionsp.946.1 Step Ladderp.946.1.1 Outlinep.946.1.2 Function and operation explanationp.946.1.3 Program examplesp.1016.2 STLp.1026.3 RETp.1037. Applied Instructions (Program Flow)p.1057.1 CJ / Conditional Jumpp.1067.2 CALL / Call Subroutinep.1137.3 SRET / Subroutine Returnp.1187.4 IRET / Interrupt Returnp.1197.5 DI / Disable Interruptp.1227.6 EI / Enable Interruptp.1237.7 FEND / Main Routine Program Endp.1257.8 WDT / Watchdog Timer Refreshp.1277.9 FOR / Start a FOR/NEXT Loopp.1307.10 NEXT / End a FOR/NEXT Loopp.1318. Applied Instructions (Move and Compare)p.1348.1 CMP / Comparep.1358.2 ZCP / Zone Comparep.1388.3 MOV / Movep.1418.4 SMOV / Shift Movep.1458.5 CML / Complementp.1488.6 BMOV / Block Movep.1518.7 FMOV / Fill Movep.1568.8 XCH / Exchangep.1598.9 BCD / Conversion to Binary Coded Decimalp.1618.10 BIN / Conversion to Binaryp.1659. Applied Instructions (Arithmetic and Logical Operation)p.1699.1 ADDP / Additionp.1709.2 SUBP / Subtractionp.1739.3 MULP / Multiplicationp.1769.4 DIVP / Divisionp.1809.5 INC / Incrementp.1839.6 DEC / Decrementp.1859.7 WAND / Logical Word ANDp.1879.8 WOR / Logical Word ORp.1899.9 WXOR / Logical Exclusive ORp.1919.10 NEG / Negationp.19410. Applied Instructions (Rotation and Shift Operation)p.19710.1 ROR / Rotation Rightp.19810.2 ROL / Rotation Leftp.20110.3 RCR / Rotation Right with Carryp.20410.4 RCL / Rotation Left with Carryp.20710.5 SFTR / Bit Shift Rightp.21010.6 SFTL / Bit Shift Leftp.21210.7 WSFR / Word Shift Rightp.21510.8 WSFL / Word Shift Leftp.21810.9 SFWR / Shift Write [FIFO/FILO Control]p.22110.10 SFRD / Shift Read [FIFO Control]p.22411. Applied Instructions (Data Operation)p.22611.1 ZRST / Zone Resetp.22711.2 DECO / Decodep.23111.3 ENCO / Encodep.23511.4 SUM / Sum of Active Bitsp.23811.5 BON / Check Specified Bit Statusp.24111.6 MEAN / Meanp.24411.7 ANS / Timed Annunciator Setp.24611.8 ANR / Annunciator Resetp.24811.9 SQR / Square Rootp.25011.10 FLT / Conversion to Floating Pointp.25212. Applied Instructions (High Speed Processing)p.25612.1 REF / Refreshp.25712.1.1 What should be understood before using the REF instructionp.26012.2 REFF / Refresh and Filter Adjustp.26112.2.1 What should be understood before using REFF instructionp.26412.3 MTR / Input Matrixp.26512.3.1 Operation and cautions for MTR instructionp.26812.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Setp.26912.4.1 Common cautions on using instructions for high speed counterp.27312.5 DHSCR / High Speed Counter Resetp.27712.6 DHSZ / High Speed Counter Zone Comparep.28112.6.1 Program in which comparison result is set to ON when power is turned ON [ZCP] instructionp.28512.6.2 Table high speed comparison mode (M8130)p.28712.6.3 Frequency control mode (DHSZ, DPLSY) (M8132)p.29112.7 SPD / Speed Detectionp.29412.8 PLSY / Pulse Y Outputp.29812.9 PWM / Pulse Width Modulationp.30512.10 PLSR / Acceleration/Deceleration Setupp.30813. Applied Instructions (Handy Instruction)p.31313.1 IST / Initial Statep.31413.2 SER / Search a Data Stackp.32513.3 ABSD / Absolute Drum Sequencerp.32913.4 INCD / Incremental Drum Sequencerp.33313.5 TTMR / Teaching Timerp.33613.6 STMR / Special Timerp.33913.7 ALT / Alternate Statep.34213.8 RAMP / Ramp Variable Valuep.34513.9 ROTC / Rotary Table Controlp.34813.10 SORT / SORT Tabulated Datap.35114. Applied Instructions (External FX I/O Device)p.35414.1 TKY / Ten Key Inputp.35514.2 HKY / Hexadecimal Inputp.35914.3 DSW / Digital Switch (Thumbwheel Input)p.36314.4 SEGD / Seven Segment Decoderp.36714.5 SEGL / Seven Segment With Latchp.36914.5.1 Selection procedure of 7-segment display unitp.37214.5.2 Selection procedure of parameter n by specification of 7-segment displayp.37214.6 ARWS / Arrow Switchp.37414.7 ASC / ASCII Code Data Inputp.37814.8 PR / Print (ASCII Code)p.38014.9 FROM / Read From A Special Function Blockp.38314.9.1 Common terms of FROM/TO instruction (detail)p.38614.10 TO / Write To A Special Function Blockp.38815. Applied Instructions (External Device (optional device))p.39115.1 RS / Serial Communicationp.39215.2 PRUN / Parallel Run (Octal Mode)p.39515.3 ASCI / Hexadecimal to ASCII Conversionp.39715.4 HEX / ASCII to Hexadecimal Conversionp.40115.5 CCD / Check Codep.40515.6 VRRD / Volume Readp.40815.7 VRSC / Volume Scalep.41115.8 RS2 / Serial Communication 2p.41315.9 PID / PID Control Loopp.41616. Applied Instructions (External Device)p.42016.1 MNET / F-16NP/NT communicationp.42116.2 ANRD / Read from F2-6Ap.42316.3 ANWR / Write to F2-6Ap.42516.4 RMST / F2-32RM startp.42616.5 RMWR / Write to F2-32RMp.42716.6 RMRD / Read from F2-32RMp.42916.7 RMMN / F2-32RM monitorp.43116.8 BLK / Specify F2-30GMp.43216.9 MCDE / F2-30GM codep.43417. Applied Instructions (Data Transfer 2)p.43517.1 ZPUSH / Batch Store of Index Registerp.43617.2 ZPOP / Batch POP of Index Registerp.43918. Applied Instructions (Floating Point)p.44118.1 DECMP / Floating Point Comparep.44318.2 DEZCP / Floating Point Zone Comparep.44518.3 DEMOV / Floating Point Movep.44718.4 DESTR / Floating Point to Character String Conversionp.44918.5 DEVAL / Character String to Floating Point Conversionp.45618.6 DEBCD / Floating Point to Scientific Notation Conversionp.46118.7 DEBIN / Scientific Notation to Floating Point Conversionp.46318.8 DEADD / Floating Point Additionp.46518.9 DESUB / Floating Point Subtractionp.46718.10 DEMUL / Floating Point Multiplicationp.46918.11 DEDIV / Floating Point Divisionp.47118.12 DEXP / Floating Point Exponentp.47318.13 DLOGE / Floating Point Natural Logarithmp.47518.14 DLOG10 / Floating Point Common Logarithmp.47718.15 DESQR / Floating Point Square Rootp.47918.16 DENEG / Floating Point Negationp.48118.17 INT / Floating Point to Integer Conversionp.48218.18 DSIN / Floating Point Sinep.48418.19 DCOS / Floating Point Cosinep.48618.20 DTAN / Floating Point Tangentp.48718.21 DASIN / Floating Point Arc Sinep.48818.22 DACOS / Floating Point Arc Cosinep.49018.23 DATAN / Floating Point Arc Tangentp.49218.24 DRAD / Floating Point Degrees to Radians Conversionp.49418.25 DDEG / Floating Point Radians to Degrees Conversionp.49619. Applied Instructions (Data Operation 2)p.49819.1 WSUM / Sum of Word Datap.49919.2 WTOB / WORD to BYTEp.50219.3 BTOW / BYTE to WORDp.50519.4 UNI / 4-bit Linking of Word Datap.50819.5 DIS / 4-bit Grouping of Word Datap.51019.6 SWAP / Byte Swapp.51219.7 SORT2 / Sort Tabulated Data 2p.51420. Applied Instructions (Positioning Control)p.51920.1 DSZR / Dog Search Zero Returnp.52020.2 DVIT / Interrupt Positioningp.52220.3 DTBL / Batch Data Positioning Modep.52520.4 DABS / Absolute Current Value Readp.52720.5 ZRN / Zero Returnp.52920.6 PLSV / Variable Speed Pulse Outputp.53320.7 DRVI / Drive to Incrementp.53620.8 DRVA / Drive to Absolutep.53921. Applied Instructions (Real Time Clock Control)p.54221.1 TCMP / RTC Data Comparep.54321.2 TZCP / RTC Data Zone Comparep.54621.3 TADD / RTC Data Additionp.54921.4 TSUB / RTC Data Subtractionp.55121.5 HTOS / Hour to Second Conversionp.55321.6 STOH / Second to Hour Conversionp.55621.7 TRD / Read RTC datap.55921.8 TWR / Set RTC datap.56121.9 HOUR / Hour Meterp.56522. Applied Instructions (External Device)p.56822.1 GRY / Decimal to Gray Code Conversionp.56922.2 GBIN / Gray Code to Decimal Conversionp.57122.3 RD3A / Read form Dedicated Analog Blockp.57322.4 WR3A / Write to Dedicated Analog Blockp.57523. Applied Instructions (Extension Function)p.57723.1 EXTR_IN / External ROM functionp.57823.2 EXTR_OUT / External ROM functionp.58124. Applied Instructions (Others)p.58524.1 COMRD / Read Device Comment Datap.58624.2 RND / Random Number Generationp.58924.3 DUTY / Timing Pulse Generationp.59124.4 CRC / Cyclic Redundancy Checkp.59424.5 DHCMOV / High Speed Counter Movep.59825. Applied Instructions (Block Data Operation)p.60225.1 BK+ / Block Data Additionp.60325.2 BK- / Block Data Subtractionp.60725.3 BKCMP=, >, <, < >, <=, >= / Block Data Comparep.61126. Applied Instructions (Character String Control)p.61826.1 STR / BIN to Character String Conversionp.61926.2 VAL / Character String to BIN Conversionp.62426.3 $+ / Link Character Stringsp.63026.4 LEN / Character String Length Detectionp.63326.5 RIGHT / Extracting Character String Data from the Rightp.63626.6 LEFT / Extracting Character String Data from the Leftp.63926.7 MIDR / Random Selection of Character Stringsp.64226.8 MIDW / Random Replacement of Character Stringsp.64526.9 INSTR / Character string searchp.64926.10 $MOV / Character String Transferp.65227. Applied Instructions (Data Operation 3)p.65527.1 FDEL / Deleting Data from Tablesp.65627.2 FINS / Inserting Data to Tablesp.65927.3 POP / Shift Last Data Read [FILO Control]p.66227.4 SFR / Bit Shift Right with Carryp.66627.5 SFL / Bit Shift Left with Carryp.66828. Applied Instructions (Data Comparison)p.67028.1 LD =, >, <, <>, <=, >= / Data Comparisonp.67128.2 AND=, >, <, < >, <=, >= / Data Comparisonp.67428.3 OR=, >, <, < >, <=, >= / Data Comparisonp.67729. Applied Instructions (Data Table Operation)p.68029.1 LIMIT / Limit Controlp.68129.2 BAND / Dead Band Controlp.68529.3 ZONE / Zone Controlp.68929.4 SCL / Scaling (Coordinate by Point Data)p.69329.5 DABIN / Decimal ASCII to BIN Conversionp.69729.6 BINDA / BIN to Decimal ASCII Conversionp.70029.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)p.70430. Applied Instructions (External Device Communication)p.70930.1 IVCK / Inverter Status Checkp.71030.2 IVDR / Inverter Drivep.71330.3 IVRD / Inverter Parameter Readp.71630.4 IVWR / Inverter Parameter Writep.71830.5 IVBWR / Inverter Parameter Block Writep.72130.6 IVMC / Inverter Multi Commandp.72330.7 ADPRW / MODBUS Read/Writep.72630.7.1 Command Code and Parametersp.72731. Applied Instructions (Data Transfer 3)p.73031.1 RBFM / Divided BFM Readp.73131.1.1 Common items between RBFM instruction and WBFM instructionp.73331.2 WBFM / Divided BFM Writep.73732. Applied Instructions (High Speed Processing 2)p.73932.1 DHSCT / High Speed Counter Compare With Data Tablep.74033. Applied Instructions (Extension File Register Control)p.74533.1 LOADR / Load From ERp.74633.2 SAVER / Save to ERp.75033.3 INITR / Initialize R and ERp.75933.4 LOGR / Logging R and ERp.76333.5 RWER / Rewrite to ERp.76733.6 INITER / Initialize ERp.77234. Applied Instructions (FX3U-CF-ADP)p.77634.1 FLCRT / File create • checkp.77734.2 FLDEL / File delete • CF card formatp.78134.3 FLWR / Data writep.78334.4 FLRD / Data readp.78734.5 FLCMD / FX3U-CF-ADP commandp.78934.6 FLSTRD / FX3U-CF-ADP status readp.79135. Interrupt Function and Pulse Catch Functionp.79435.1 Outlinep.79435.2 Common itemsp.79535.2.1 Interrupt functionp.79535.2.2 How to disable interrupt function and pulse catch functionp.79635.2.3 Related itemsp.79735.2.4 Cautions on use (common)p.79835.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]p.80035.3.1 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]p.80035.3.2 Examples of practical programs (programs to measure short pulse width)p.80435.4 Input Interrupt (Interrupt by External Signal) [With Delay function]p.80635.5 Timer Interrupt (Interrupt in Constant Cycle)p.80735.5.1 Timer Interrupt (Interrupt in Constant Cycle)p.80735.5.2 Example of practical program (timer interrupt program using instruction)p.80835.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counterp.81235.7 Pulse Catch Function[M8170 to M8177]p.81335.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]p.815Appendix A: Relationships between devices and addressesp.820Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]p.822Appendix B-1 Applied instructions [by instruction type]p.822Appendix B-2 Applied instructions [in alphabetical order]p.829Warrantyp.835Revised Historyp.836Back Coverp.838
Page 13 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Individual manuals
Page 13 · click to enlarge
Page 13

Positioning of This Manual

This manual explains sequence instructions for structured programs provided by GX Works2. Refer to other manuals for devices, parameters and application functions. Refer to each corresponding manual for analog, communication, positioning control and special units and blocks.

1. When using FX 3S /FX 3G /FX 3GC /FX 3U /FX 3UC PLCs

MELSEC-Q/L/F Structured Programming Manual (Fundamentals)

This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F

FXCPU Structured Programming Manual [Device & Common]

This manual explains devices and parameters for structured programs provided by GX Works2. FX

(This manual)

FX

This manual explains sequence instructions for structured programs provided by GX Works2.

FXCPU Structured Programming Manual [Application Functions]

FX

This manual explains application functions for structured programs provided by GX Works2.

FX3S/FX3G/FX3GC/FX3U/FX3UC User's Manual- Analog Control Edition

FX3S FX3G FX3GC FX3U FX3UC

This manual explains details of analog special function blocks and analog special adapters for FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs and PID instruction. Explanation of instructions and instructions used in program examples are expressed for GX Developer.

FX Series User's Manual -Data Communication Edition

This manual explains details of simple N:N link, parallel link, computer link, no-protocol communication (RS and RS2 instructions), programming communication and inverter communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer.

FX

FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual -Positioning Edition

FX3S FX3G FX3GC FX3U FX3UC

This manual explains details of wiring, instructions and operations of the positioning function built in FX3S/FX3G/FX3GC/FX3U/FX3UC PLC main units. Explanation of instructions and instructions used in program examples are expressed for GX Developer.

Individual manuals

(Manual supplied with product or additional Manual ) *1

This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer.

*1. Detailed explanation may be provided by a separate manual in some products.

Show 12 more labels / short text on this page
(Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · (Additional Manual) · (Additional Manual) · Special unit/block
Page 14 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Individual manuals
Page 14 · click to enlarge
Page 14
2. When using FX 1S /FX 1N /FX 1NC /FX 2N /FX 2NC PLCs

(Additional Manual) MELSEC-Q/L/F Structured Programming Manual (Fundamentals)

This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F

FXCPU Structured Programming Manual [Device & Common]

This manual explains devices and parameters for structured programs provided by GX Works2. FX

(This manual)

FX

This manual explains sequence instructions for structured programs provided by GX Works2.

FXCPU Structured Programming Manual [Application Functions]

FX

This manual explains application functions for structured programs provided by GX Works2.

FX Series User's Manual -Data Communication Edition

FX

This manual explains details of simple N:N link, parallel link, computer link, no-protocol communication (RS instruction), programming communication and inverter communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.

Individual manuals

(Manual supplied with product or additional Manual ) *1

This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.

*1. Detailed explanation may be provided by a separate manual in some products.

Show 9 more labels / short text on this page
Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Special unit/block
Page 15 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Individual manuals
Page 15 · click to enlarge
Page 15
3. When using FX 0S /FX 0 /FX 0N /FX U /FX 2C PLCs

(Additional Manual) MELSEC-Q/L/F Structured Programming Manual (Fundamentals)

This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F

FXCPU Structured Programming Manual [Device & Common]

This manual explains devices and parameters for structured programs provided by GX Works2. FX

(This manual)

FX

This manual explains sequence instructions for structured programs provided by GX Works2.

FXCPU Structured Programming Manual [Application Functions]

FX

This manual explains application functions for structured programs provided by GX Works2.

FX Series User's Manual -Data Communication Edition

FX

This manual explains details of parallel link, computer link, no-protocol communication (RS instruction) and programming communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.

Individual manuals

(Manual supplied with product or additional Manual ) *1

This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.

*1. Detailed explanation may be provided by a separate manual in some products.

Show 9 more labels / short text on this page
Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Structured · (Additional Manual) · Special unit/block
Page 16 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 09R533
Page 16 · click to enlarge
Page 16

Related Manuals

This manual explains devices and parameters for structured programs provided by GX Works2. Refer to other manuals for sequence instructions and applied functions. This chapter introduces only reference manuals for this manual and manuals which describe the hardware information of PLC main units. Manuals not introduced here may be required in some applications. Refer to the manual of the used PLC main unit and manuals supplied together with used products. Contact the representative for acquiring required manuals.

Common among FX PLCs [structured]

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

MELSEC-Q/L/F Structured Programming Manual (Fundamentals) SH-080782 Additional Manual Programming methods, specifications, functions, etc. required to create structured programs 13JW06

FXCPU Structured Programming Manual [Device & Common] JY997D26001 Additional Manual Devices, parameters, etc. provided in structured projects of GX Works2 09R925

FXCPU Structured Programming Manual [Basic & Applied Instruction] JY997D34701 Additional Manual Sequence instructions provided in structured projects of GX Works2 09R926

FXCPU Structured Programming Manual [Application Functions] JY997D34801 Additional Manual Application functions provided in structured projects of GX Works2 09R927

FX 3S /FX 3G /FX 3GC /FX 3U /FX 3UC PLCs

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

I/O specifications, wiring and installation of the PLC main unit FX3U extracted from the FX3U Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3U Series User’s Manual - Hardware Edition.

FX3U Series Hardware Manual JY997D18801 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3U PLC main unit.

FX3U Series User's Manual- Hardware Edition JY997D16501 Additional Manual

09R516

I/O specifications, wiring and installation of the PLC main unit FX3UC (D, DS, DSS) extracted from the FX3UC Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3UC Series User’s Manual - Hardware Edition.

FX3UC (D, DS, DSS) Series Hardware Manual JY997D28601 Supplied with product

I/O specifications, wiring and installation of the PLC main unit FX3UC-32MT-LT-2 extracted from the FX3UC Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3UC Series User’s Manual - Hardware Edition.

FX3UC-32MT-LT-2 Hardware Manual JY997D31601 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3UC PLC main unit.

FX3UC Series User's Manual - Hardware Edition JY997D28701 Additional Manual

09R519

I/O specifications, wiring and installation of the PLC main unit FX3G extracted from the FX3G Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3G Series User’s Manual - Hardware Edition.

FX3G Series Hardware Manual JY997D46001 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3G PLC main unit.

FX3G Series User's Manual- Hardware Edition JY997D31301 Additional Manual

09R521

I/O specifications, wiring and installation of the PLC main unit FX3GC extracted from the FX3GC Series User's Manual - Hardware Edition. For detailed explanation, refer to the FX3GC Series User's Manual - Hardware Edition.

FX3GC Series Hardware Manual JY997D45201 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3GC PLC main unit.

FX3GC Series User's Manual- Hardware Edition JY997D45401 Additional Manual

09R533

PLC main unit

Page 17 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 09R715
Page 17 · click to enlarge
Page 17

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

I/O specifications, wiring and installation of the PLC main unit FX3S extracted from the FX3S Series User's Manual - Hardware Edition. For detailed explanation, refer to the FX3S Series User's Manual - Hardware Edition.

FX3S Series Hardware Manual JY997D48301 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3S PLC main unit.

FX3S Series User's Manual- Hardware Edition JY997D48601 Additional Manual

09R535

Details about the analog special function block (FX3U-4AD, FX3U-4DA, FX3UC-4AD) and analog special adapter (FX3U-****-ADP).

FX3S/FX3G/FX3GC/FX3U/FX3UC User's Manual- Analog Control Edition JY997D16701 Additional Manual

09R619

Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).

FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual

09R715

FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual - MODBUS Serial Communication Edition

JY997D26201 Additional Manual Explains the MODBUS serial communication network in FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs. 09R626

FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual -Positioning Edition JY997D16801 Additional Manual Details about the positioning function built in the FX3S/FX3G/FX3GC/FX3U/FX3UC Series. 09R620

FX3U-CF-ADP User's Manual JY997D35401 Additional Manual Describes details of the FX3U-CF-ADP CF card special adapter. 09R720

FX1S/FX1N/FX1NC PLCs FX2N/FX2NC PLCs [whose production is finished]

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1S PLC main unit.

FX1S HARDWARE MANUAL JY992D83901 Additional Manual

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1N PLC main unit.

FX1N HARDWARE MANUAL JY992D89301 Additional Manual

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX2N PLC main unit.

FX2N HARDWARE MANUAL JY992D66301 Additional Manual

09R508

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1NC PLC main unit. (Japanese only)

FX1NC HARDWARE MANUAL JY992D92101 Additional Manual

09R505

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX2NC PLC main unit.

FX2NC HARDWARE MANUAL JY992D76401 Additional Manual

09R509

Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).

FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual

09R715

Show 4 more labels / short text on this page
PLC main unit · Programming · PLC main unit · Programming
Page 18 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 09R715
Page 18 · click to enlarge
Page 18

FX0S/FX0/FX0N/FXU/FX2C PLCs [whose production is finished]

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0/FX0N PLC main unit.

FX0/FX0N HARDWARE MANUAL JY992D47501 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0S PLC main unit.

FX0S HARDWARE MANUAL JY992D55301 Supplied with product

Details about the hardware including I/O specifications, wiring, installation and maintenance of the FXU/FX2C PLC main unit.

FX/FX2C HARDWARE MANUAL JY992D47401 Supplied with product

Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).

FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual

09R715

Manuals of models whose production is finished

Production is finished for FX0S/FX0/FX0N/FXU/FX2C/FX2N/FX2NC PLCs.

PLC main unit · Programming

Page 19 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CF-ADP FX 3U -CF-ADP
Page 19 · click to enlarge
Page 19

Generic Names and Abbreviations Used in Manuals

FX3U Series or FX3U PLC Generic name of FX3U Series PLCs

FX3UC Series or FX3UC PLC Generic name of FX3UC Series PLCs

FX3G Series or FX3G PLC Generic name of FX3G Series PLCs

FX3GC Series or FX3GC PLC Generic name of FX3GC Series PLCs

FX3S Series or FX3S PLC Generic name of FX3S Series PLCs

FX2N Series or FX2N PLC Generic name of FX2N Series PLCs

FX2NC Series or FX2NC PLC Generic name of FX2NC Series PLCs

FX1N Series or FX1N PLC Generic name of FX1N Series PLCs

FX1NC Series or FX1NC PLC Generic name of FX1NC Series PLCs These products can only used in Japan.

FX1S Series or FX1S PLC Generic name of FX1S Series PLCs

FXU Series or FXU PLC Generic name of FXU(FX,FX2) Series PLCs

FX2C Series or FX2C PLC Generic name of FX2C Series PLCs

FX0N Series or FX0N PLC Generic name of FX0N Series PLCs

FX0S Series or FX0S PLC Generic name of FX0S Series PLCs

FX0 Series or FX0 PLC Generic name of FX0 Series PLCs

CF card special adapter Generic name of CF card special adapters

CF-ADP FX 3U -CF-ADP

ST Abbreviation of structured text language

Structured ladder Abbreviation of ladder diagram language

FBD Abbreviation of function block diagram language

Q/L/F Structured Programming Manual (Fundamentals) Abbreviation of MELSEC-Q/L/F Structured Programming Manual (Fundamentals)

FX Structured Programming Manual [Device & Common] Abbreviation of FXCPU Structured Programming Manual [Device & Common]

FX Structured Programming Manual [Basic & Applied Instruction] Abbreviation of FXCPU Structured Programming Manual [Basic & Applied Instruction]

FX Structured Programming Manual [Application Functions] Abbreviation of FXCPU Structured Programming Manual [Application Functions]

COMMUNICATION CONTROL EDITION Abbreviation of FX Series User's Manual-DATA COMMUNICATION CONTROL EDITION

ANALOG CONTROL EDITION Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-ANALOG CONTROL EDITION

POSITIONING CONTROL EDITION Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-POSITIONING CONTROL EDITION

Show 5 more labels / short text on this page
Abbreviation/generic name Name · PLCs · Special adapters · Programming language · Manuals
Page 20 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Advantages of program consisting of program blocks
Page 20 · click to enlarge
Page 20

1.1 Outline of Structured Programs and Programming languages FXCPU Structured Programming Manual [Basic & Applied Instruction]

This manual explains setting of sequence instructions for structured programs provided by GX Works2. Refer to another manuals for device, parameter, and application functions for structured programs. Refer to the following manual for label, data types and programming languages for structured programs.

→ Q/L/F Structured Programming Manual (Fundamentals)

1.1 Outline of Structured Programs and Programming languages

1.1.1 Outline of Structured Programs

You can construct two or more programs (program blocks) into one program. Because you can divide the entire machine processing into small sub processes and create a program for each sub process, you can create a program for a large system efficiently.

1. Structured program Program structuring is a technique to divide the contents of control executed by the PLC CPU into hierarchical small units (blocks) of processing, and then construct a program. By using this technique, you can design a program while recognizing structuring of a sequence program.

Advantages of hierarchical program

  • You can examine the outline of a program at first, and then design its details gradually.
  • Program blocks located at the lowest level in the hierarchy are extremely simple and highly dependent.

Advantages of program consisting of program blocks

  • Because the processing of each block is clear, the entire program is easy to understand.
  • The entire program can be divided into several blocks that are created by several people.
  • The program reusability is improved, and the development efficiency is improved accordingly.
2. Improved reusability of programs You can save program blocks in a library. Program resources in the library can be shared, and often used again.
Page 21 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — XOR
Page 21 · click to enlarge
Page 21

1.1 Outline of Structured Programs and Programming languages

1.1.2 Programming languages

The following programming languages can be used in each program block.

Graphic languages

1. Structured ladder language This graphic language is created based on the relay circuit design technology. A circuit always starts from the bus line located on the left side. The structured ladder language consists of contacts, coils, functions and function blocks. These components are connected with vertical lines and horizontal lines.

X000 X001 Y000

Y000

MOV EN ENO s d D0 D2

How to Read Explanation of Instructions

When X001 is ON, the contents of D0 are transferred to D2.

2. FBD [Function Block Diagram language] FBD is a graphic language easy to understand visually. You can easily create programs by connecting parts (functions and function blocks) for special processing, variables and constants along the flow of data and signals to improve the programming efficiency.

1 EQ D0 D2

AND INT_TO_WORD_E EN ENO _INT

X000 X001 X002

K4X010

When the contents of D0 are equivalent to the contents of D2, EQ turns ON.

XOR

D30 D20

Text language

Applied Instructions (Program Flow)

1. ST ("Structured text language") The ST language can describe control achieved by syntax using selective branches with conditional statements and repetition by repetitive statements in the same way as high-level languages such as C language. By using the ST language, you can create simple programs easy to understand.

Y000:=(X000 OR Y000) AND NOT X001; IF X001 THEN D2:=D0; (* When X001 is ON, the contents of D0 are transferred to D2.*) END_IF; IF X002 THEN D4:=D4+1; (* When X002 is ON, the contents of D4 are added by "1". *) ELSE D6:=D6+1; (* When X002 is OFF, the contents of D6 are added by "1". *) END_IF;

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
Instruction List · Output Y000 · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 22 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1.3.1 I/O PROCESSING AND RESPONSE DELAY
Page 22 · click to enlarge
Page 22

1.2 PLC Series and Programming Software Version FXCPU Structured Programming Manual [Basic & Applied Instruction]

1.2 PLC Series and Programming Software Version

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1.2 PLC Series and Programming Software Version diagram (page 22)
Fig. 2 · 1.2 PLC Series and Programming Software Version

1.3 Cautions on Creation of Fundamental Programs

This section explains cautions on programming. Refer to the following manual for cautions on structured programs and programming languages:

→ Q/L/F Structured Programming Manual (Fundamentals) Refer to the following programming manual for detailed operations of and cautions on devices and parameters:

→ FX Structured Programming Manual [Device & Common]

1.3.1 I/O PROCESSING AND RESPONSE DELAY

1. Operation timing of I/O relays and resonse delay FX PLCs execute the I/O processing by repeating the processing (1) to processing (3). Accordingly, the control executed by PLCs contains not only the drive time of input filters and output devices but also the response delay caused by the operation cycle.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1.3.1 I/O PROCESSING AND RESPONSE DELAY diagram (page 22)
Fig. 3

The ON/OFF status of input terminals is received at one time.

Input image is read, and operation is executed according to program.

[Program processing] Image memory of each device is updated.

[Output processing] Result is transferred to output latch memory.

Acquiring the latest I/O information For acquiring the latest input information or immediately outputting the operation result in the middle of the operation cycle shown above, the I/O refresh instruction "REF" is available.

Output devices are driven. Batch I/O method (refresh method)

2. Short input pulses cannot be received. The ON duration and OFF duration of inputs in PLCs require longer time than "PLC scan time + Input filter response delay." When the response delay "10 ms" of the input filter is considered and the scan time is supposed as "10 ms", the ON duration and OFF duration should be at least 20 ms respectively. Accordingly, PLCs cannot handle input pulses at 25 Hz (1000 / (20+20) = 25) or more. However, the situation can be improved by PLC special functions and instructions.

Convenient functions for improvement By using the following functions, PLCs can receive pulses shorter than the operation cycle.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1.3.1 I/O PROCESSING AND RESPONSE DELAY diagram (page 22)
Fig. 4
  • High speed counter function
  • Input interrupt function
  • Pulse catch function
  • Input filter value adjustment function
Page 23 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M101
Page 23 · click to enlarge
Page 23

1.3 Cautions on Creation of Fundamental Programs

1.3.2 Double output (double coil) operation and countermeasures

This subsection explains the double output (double coil) operation and countermeasures.

1. Operation of double output When a coil (output variable) is used twice (double coil) in another program block to be executed or in the same program block, the PLC gives priority to the last coil.

Suppose that the same coil Y003 is used in two positions as shown in the figure on the right. For example, suppose that X001 is ON and X002 is OFF.

Input processing X001=ON X002=OFF

In the first coil Y003, the image memory turns ON and the output Y004 turns ON also because the input X001 is ON.

Y003

In the second coil Y003, however, the image memory is set to OFF because the input X002 is OFF.

Y003

Y004

Accordingly, the actual output to the outside is "Y003 = OFF, Y004 = ON".

Y003

How to Read Explanation of Instructions

Output processing Y003=OFF Y004=ON

2. Countermeasures against double output Double output (double coil) does not cause an illegal input (program error), but the operation is disrupted as described above. Change the program as shown in the example below.

A B

Y000

A B

Y000

C E

C E

Y000

Applied Instructions (Program Flow)

A B

M100

C E

M101

Applied Instructions (Move and Compare)

Y000

M100

Applied Instructions (Arithmetic and Logical Operation)

M101

SET, RST or jump instruction can be used instead, or a same output coil can be programmed at each state by using step ladder instructions STL or RET. When you use the step ladder instruction STL or RET, note that the PLC regards it as double coils if you program, inside the state, an output coil located outside the RET from another program block or the STL instruction.

Applied Instructions (Rotation and Shift Operation)

Show 8 more labels / short text on this page
Instruction List · First · Configuration of Instruction · Second · Basic Instruction · Step Ladder Instructions · Ignored · Or
Page 24 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1.3.4 Handling of general flags
Page 24 · click to enlarge
Page 24

1.3 Cautions on Creation of Fundamental Programs FXCPU Structured Programming Manual [Basic & Applied Instruction]

1.3.3 Circuits which cannot be created by structured ladder programs and countermeasures

1. Bridge circuit A circuit in which the current flows in both directions should be changed as shown in the figure on the right (so that a circuit without D and a circuit without B are connected in parallel).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1.3.3 Circuits which cannot be created by structured ladder programs and countermeasures diagram (page 24)
Fig. 5 · 1.3.3 Circuits which cannot be created by structured…

2. Coil connection position

  • You can program a contact on the right side of a coil. In this case, be sure to program a coil (including a function or a function block) at the end of the circuit.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Coil connection position diagram (page 24)
Fig. 6 · 2. Coil connection position

1.3.4 Handling of general flags

In some types of sequence instructions, the following flags operate: M8020: Zero flag M8021: Borrow flag M8022: Carry flag M8029: Instruction execution complete flag M8090: Block comparison signal*1 M8328: Instruction non-execution flag*1

M8329Instruction execution abnormal complete flag *2
M8304Zero flag *2 M8306: Carry flag *2

*1. Supported only by FX3U and FX3UC PLCs.

*2. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Each of these flags turns ON or OFF every time the PLC executes a corresponding function. These flags do not turn ON or OFF when the PLC does not execute a corresponding function or when an error occurs. Because these flags turn ON or OFF in many sequence instructions, the ON/OFF status of flags changes every time such instructions are executed. Refer to the examples in the next page, and program a flag contact just under the target sequence instruction.

Page 25 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y001
Page 25 · click to enlarge
Page 25

1.3 Cautions on Creation of Fundamental Programs

1. Program containing many flags (example of instruction execution complete flag M8029) If you program the instruction execution completion flag M8029 for two or more sequence instructions which actuate the flag M8029, you cannot judge easily by which sequence instruction the flag M8029 is controlled. In addition, the flag M8029 does not turn ON or OFF correctly for each corresponding sequence instruction. Refer to the next page when you would like to use the flag M8029 in any position other than the position just under the corresponding sequence instruction.

M8000

d1 Y010 n d2

MUL_E EN _IN

M8029 works as a flag to indicate that execution of DSW is completed.

M8029

Execution is completed.

Number of output pulses

_IN

How to Read Explanation of Instructions

X000 M0

S

M0

1000 Number of output pulses

Y000

M8029 works as a flag to indicate that execution of DPLSY is completed.

M0

M8029

R

Execution is completed.

M8029

M0

M8029 works as a flag to indicate that execution of DPLSY (on the lower side) is completed.

R

Program for DPLSY (on the upper side)

Execution is completed.

M8000

Applied Instructions (Program Flow)

M8029 works as a flag to indicate that execution of DSW is completed.

d1 Y010 n d2 D0

M0

S

Applied Instructions (Move and Compare)

M0

DPLSY (on the upper side)

1000 Number of output pulses

Y000

M8029 works as a flag to indicate that execution of DPLSY (on the upper side) is completed.

M8029

MUL_E EN _IN

Applied Instructions (Arithmetic and Logical Operation)

Execution is completed.

Number of output pulses

_IN

M1

DPLSY (on the lower side)

1000 Number of output pulses 2

Y001

Applied Instructions (Rotation and Shift Operation)

Show 15 more labels / short text on this page
Good example · Instruction List · DSW EN s · Configuration of Instruction · DPLSY EN s1 · d s2 · Basic Instruction · Bad example · Step Ladder Instructions · DSW EN s · DPLSY EN s1 · d s2 · Program for DSW · DPLSY EN s1 · d s2
Page 26 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1.3.3 Circuits which cannot be created by structured ladder programs and countermeasures
Page 26 · click to enlarge
Page 26

1.3 Cautions on Creation of Fundamental Programs FXCPU Structured Programming Manual [Basic & Applied Instruction]

2. Introduction of method for using flags in any positions other than directly under sequence instructions. When two or more sequence instructions are programmed, general flags turn ON or OFF when each sequence instruction turns ON. Accordingly, when using a flag in any position other than directly under a sequence instruction, set to ON or OFF another bit device (variable), and then use the contact (variable) of the device as the command contact.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1.3.3 Circuits which cannot be created by structured ladder programs and countermeasures diagram (page 26)
Fig. 7 · 1.3.3 Circuits which cannot be created by structured…

DSW execution complete flag M8029 is changed to M100.

DPLSY execution complete flag M8029 is changed to M200.

Page 27 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8160 M8000
Page 27 · click to enlarge
Page 27

1.3 Cautions on Creation of Fundamental Programs

1.3.5 Handling of operation error flag

When there is an error in the sequence instruction configuration, target device or target device number range and an error occurs while operation is executed, the following flag turns ON and the error information is store.

1. Operation error

Device storing error occurrence step

Error flag Device storing error code

FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/ FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC FX3U/FX3UC

M8067 D8067 D8069 *1 D8315, D8314

*1. When the error occurrence step is up to the 32767th step in FX3U and FX3UC PLCs, the error occurrence step can be checked in D8069 (16 bits).

  • When an operation error has occurred, M8067 is set, D8067 stores the operation error code number, and the device storing error occurrence step (see the table above) stores the error occurrence step number.
  • If another error occurs in another step, the stored data is updated in turn to the error code and step number of the new error. (These devices are set to OFF when errors are cleared.)
  • When the PLC mode switches from STOP to RUN, these devices are cleared instantaneously, and then set to ON again if errors have not been cleared.

How to Read Explanation of Instructions

2. Operation error latch

Device storing error occurrence step

Error flag Device storing error code

FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/ FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC FX3U/FX3UC

M8068 - D8068 *2 D8313, D8312

*2. When the error occurrence step is up to the 32767th step in FX3U and FX3UC PLCs, the error occurrence step can be checked in D8068 (16 bits).

  • When an operation error has occurred, M8068 is set, and the device storing error occurrence step (see the table above) stores the error occurrence step number.
  • Even if another error has occurred in another step, the stored data is not updated, and remains held until these devices are forcibly reset or until the power turns OFF.

1.3.6 Handling of function extension flag

Applied Instructions (Program Flow)

In some sequence instructions, the function can be extended by combining a specific special auxiliary relay determined for each sequence instruction. An example is explained below.

  • When X000 turns ON, this instruction exchanges the contents of D10 and D11 with each other.

X000 XCHP EN ENO

Applied Instructions (Move and Compare)

d1 D10 d2 D11

  • If M8160 has been driven before the XCH function and the source and destination of the XCH instruction are specified to the same device, high-order 8 bits and loworder 8 bits are exchanged with each other inside the device.

M8160

Function extension flag for the XCH instruction

XCHP EN ENO

Applied Instructions (Arithmetic and Logical Operation)

d1 D10 d2 D10

  • For returning this XCH to the normal XCH function, it is necessary to set M8160 to OFF.

M8160 M8000

Applied Instructions (Rotation and Shift Operation)

When using an instruction requiring the function extension flag in an interrupt program, program DI function (for disabling interrupt) before driving the function extension flag, and program EI function (for enabling interrupt) after turning OFF the function extension flag.

Show 5 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · Same number
Page 28 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — MTR 1 1
Page 28 · click to enlarge
Page 28

1.3 Cautions on Creation of Fundamental Programs FXCPU Structured Programming Manual [Basic & Applied Instruction]

1.3.7 Limitation in the number of instructions and limitation in simultaneous instruction instances

Each sequence instruction has a limitation in the number of using the instruction and the number of simultaneous instances of instructions. The limitation, however, differs from one PLC to another.

Limitations in the number of instructions

Some instructions can be used only up to the specified number of times. As for the instructions having a limited number of times of use and whose operands allow indexing, device numbers and numeric values in such instructions can be changed by index registers. By indexing, when driving multiple instances simultaneously is required, such instruction can be used as if they were used beyond the allowable number of times.

→ FX Structured Programming Manual [Device & Common] Note that some PLCs do not provide some instructions.

→ 2. Instruction List

FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs

Allowable number of times of

MTR 1 -

Pay attention so that this instruction does not overlap the input numbers in interrupt input in DVIT instruction, DOG inputs in ZRN instruction, zero point signal in DSZR instruction, input interrupt numbers and high speed counter input numbers. IST 1 - SORT 1 FX3S, FX3G or FX3GC PLCs are not provided. TKY 1 FX3S, FX3G or FX3GC PLCs are not provided. HKY 1 FX3S, FX3G or FX3GC PLCs are not provided. ARWS 1 FX3S, FX3G or FX3GC PLCs are not provided. PR 2 FX3S, FX3G or FX3GC PLCs are not provided. SORT2 2 FX3S, FX3G or FX3GC PLCs are not provided.

SPD 8 (1 instruction / 1 input or fewer)

DUTY 5 (1 instruction / 1 output or fewer) FX3S, FX3G or FX3GC PLCs are not provided.

DHSCT 1 FX3S, FX3G or FX3GC PLCs are not provided.

FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs

Allowable number of times of use

FX1S, FX1N, FX1NC FX2N, FX2NC

MTR 1 1

SPD 1 1

PWM 1 1

IST 1 1

ABSD 1 1

INCD 1 1

ROTC FX1S, FX1N or FX1NC PLCs are not provided. 1

SORT FX1S, FX1N or FX1NC PLCs are not provided. 1

TKY FX1S, FX1N or FX1NC PLCs are not provided. 1

HKY FX1S, FX1N or FX1NC PLCs are not provided. 1

DSW No limit 2

SEGL No limit 2

ARWS FX1S, FX1N or FX1NC PLCs are not provided. 1

PR FX1S, FX1N or FX1NC PLCs are not provided. 2

Show 5 more labels / short text on this page
Instruction · use Remarks · name · Instruction · name
Page 29 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — HKY 1
Page 29 · click to enlarge
Page 29

1.3 Cautions on Creation of Fundamental Programs

FX0S, FX0, FX0N, FXU and FX2C PLCs

times of use Remarks

MTR 1 FX0, FX0S or FX0N PLCs are not provided.

PLSY 1 - PWM 1

IST 1 -

ABSD 1

INCD 1

ROTC 1

SORT 1

TKY 1

FX0S, FX0 or FX0N PLCs are not provided.

HKY 1

DSW 2

SEGL 2

ARWS 1

PR 2

Limitation in simultaneous instances of instructions

How to Read Explanation of Instructions

Some instructions can be programmed two or more times, but the number of simultaneous instances is limited. Even in instructions not shown below, if two or more instructions are driven at the same time for a same I/O number, it is regarded as double outputs. In some combinations of instructions, the operation may be disrupted, or the instructions cannot be executed. For details, refer to the caution described in each instruction page.

  • FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs PLSY, PWM, PLSR, DSZR, DVIT *1 , ZRN, PLSV, DRVI, DRVA DHSCS, DHSCR, DHSZ, DHSCT *1

RS, RS2, IVCK, IVDR, IVRD, IVWR, IVBWR*1, IVMC FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1, FLSTRD*1

*1. FX3S, FX3G and FX3GC PLCs are not compatible.

  • FX 1S , FX 1N , FX 1NC , FX 2N and FX 2NC PLCs DHSCS, DHSCR, DHSZ(FX 1S , FX 1N , FX 1NC , FX 2N and FX 2NC PLCs) RS (FX 2N and FX 2NC PLCs) PLSY, PLSR, RS, ZRN, PLSV, DRVI, DRVA(FX 1S , FX 1N and FX 1NC PLCs)
  • FX 0S , FX 0, FX 0N , FX U and FX 2C PLCs DHSCS, DHSCR, DHSZ(FX 0 , FX 0S , FX 0N , FX U and FX 2C PLCs) RS (FX 0N , FX U and FX 2C PLCs)

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
Instruction · Allowable number of · name · Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 30 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — AND( ··· ) Serial connection of circuit block
Page 30 · click to enlarge
Page 30

2.1 Basic Instructions

2. Instruction List

This chapter introduces a list of instructions available in programming.

2.1 Basic Instructions

FX U /FX 2C

FX 3U(C)

FX 3G(C)

FX 3S

FX 2N(C)

FX 1N(C)

FX 1S

FX 0N

FX 0(S)

LD Initial logical operation contact type NO (normally open)

LDI Initial logical operation contact type NC (normally closed)

AND Serial connection of NO contacts

3 Section 5.1

ANI Serial connection of NC contacts

OR Parallel connection of NO contacts

ORI Parallel connection of NC contacts

LDP Initial logical operation of rising edge pulse

LDF Initial logical operation of falling edge pulse

ANDP Serial connection of rising edge pulse

3 Section 5.2

ANDF Serial connection of falling edge pulse

ORP Parallel connection of rising edge pulse

ORF Parallel connection of falling edge pulse

OUT Coil drive 3 Section 5.3

OUT_T Timer drive 3 Section 5.4.1

OUT_C

Counter drive 3 Section 5.5.1 OUT_C_32

AND( ··· ) Serial connection of circuit block

3 Section 5.6 OR(···) Parallel connection of circuit block

3 Section 5.7 MRD Stack read

INV Invert the current result of the internal PLC operations 3 Section 5.8

MEP Conversion of operation result to leading edge pulse

*1 3 3 Section 5.9

MEF Conversion of operation result to trailing edge pulse

SET Set bit device latch ON

3 Section 5.10 RST Reset bit device OFF and clear current value and resister

PLS Rising edge pulse differential output

3 Section 5.11 PLF Falling edge pulse differential output

MC Connection to common contact

3 Section 5.12 MCR Clear connection to common contact

END Program END, I/O refresh and return to step 0 3 Section 5.13

NOP No operation or null step Section 5.14

*1. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.30 or later.

Show 6 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Function · Reference · MPS Stack pushdown · MPP Stack popup
Page 31 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX U /FX 2C
Page 31 · click to enlarge
Page 31

2.2 Step Ladder Instructions

2.2 Step Ladder Instructions

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3S

FX 1S

FX 0N

FX 0(S)

STL Starts step ladder 3 Section 6.2

RET Completes step ladder 3 Section 6.3

2.3 Applied Instructions

FX U /FX 2C

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3S

FX 1S

FX 0N

How to Read Explanation of Instructions

3 Section 7.1 CJP Pulse 3

3 Section 7.2 CALLP Pulse 3

SRET Continuous Subroutine return 3 Section 7.3

IRET Continuous Interrupt return 3 Section 7.4

DI Continuous Disable interrupt 3 Section 7.5

EI Continuous Enable interrupt 3 Section 7.6

FEND Continuous Main routine program end 3 Section 7.7

3 Section 7.8 WDTP Pulse 3

FOR Continuous Start a FOR/NEXT loop 3 Section 7.9

NEXT Continuous End a FOR/NEXT loop 3 Section 7.10

3

Section 8.1 CMPP Pulse 3

DCMP Continuous 3

Applied Instructions (Program Flow)

DCMPP Pulse 3

3

Section 8.2 ZCPP Pulse 3

DZCP Continuous 3

DZCPP Pulse 3

Applied Instructions (Move and Compare)

3

Section 8.3 MOVP Pulse 3

DMOV Continuous 3

DMOVP Pulse 3

3 Section 8.4 SMOVP Pulse 3

Applied Instructions (Arithmetic and Logical Operation)

3

Section 8.5 CMLP Pulse 3

DCML Continuous 3

DCMLP Pulse 3

3 Section 8.6 BMOVP Pulse 3

Applied Instructions (Rotation and Shift Operation)

Show 32 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Function · Reference · Instruction List · Configuration of Instruction · Applicable PLCs · Instruction name Execution · condition Function · Reference · Program Flow · CJ Continuous · Conditional jump · CALL Continuous · Call subroutine · Basic Instruction · WDT Continuous · Watchdog timer refresh · Step Ladder Instructions · Move and Compare · CMP Continuous · Compare · ZCP Continuous · Zone compare · MOV Continuous · Move · SMOV Continuous · Shift move · CML Continuous · Inversion move · BMOV Continuous · Block move
Page 32 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX U /FX 2C
Page 32 · click to enlarge
Page 32

2.3 Applied Instructions

FX U /FX 2C

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX 3S

FX 1S

FX 0N

FX 0(S)

3

Section 8.7 FMOVP Pulse 3

DFMOV Continuous 3 *1

DFMOVP Pulse 3 *1

Section 8.8 XCHP Pulse 3 3 3

DXCH Continuous 3 3 3

DXCHP Pulse 3 3 3

3

Section 8.9 BCDP Pulse 3

Conversion to binary coded decimal

DBCD Continuous 3

DBCDP Pulse 3

3

Section 8.10 BINP Pulse 3

DBIN Continuous 3

DBINP Pulse 3

Arithmetic and Logical Operation

3

Section 9.1 DADD Continuous 3

DADDP Pulse 3

3

Section 9.2 DSUB Continuous 3

DSUBP Pulse 3

3

Section 9.3 DMUL Continuous 3

DMULP Pulse 3

3

Section 9.4 DDIV Continuous 3

DDIVP Pulse 3

3

Section 9.5 INCP Pulse 3

DINC Continuous 3

DINCP Pulse 3

3

Section 9.6 DECP Pulse 3

DDEC Continuous 3

DDECP Pulse 3

3

Section 9.7 WANDP Pulse 3

DAND Continuous 3

DANDP Pulse 3

3

Section 9.8 WORP Pulse 3

DOR Continuous 3

DORP Pulse 3

*1. The instruction is provided in the FXU PLC Ver. 2.30 or later.

Show 29 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Execution · condition Function · Reference · Move and Compare · FMOV Continuous · Fill move · XCH Continuous · Exchange · BCD Continuous · BIN Continuous · Conversion to binary · ADDP Pulse · Addition · SUBP Pulse · Subtraction · MULP Pulse · Multiplication · DIVP Pulse · Division · INC Continuous · Increment · DEC Continuous · Decrement · WAND Continuous · Logical word AND · WOR Continuous · Logical word OR
Page 33 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 33 · click to enlarge
Page 33
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 33)
Fig. 8 · 2.2 Step Ladder Instructions

3

Section 9.9 WXORP Pulse 3

DXOR Continuous 3

DXORP Pulse 3

Section 10.1 RORP Pulse 3

Section 10.2 ROLP Pulse 3

3 Section 10.5 SFTRP Pulse 3

3 Section 10.6 SFTLP Pulse 3

3 Section 10.7 WSFRP Pulse 3

3 Section 10.8 WSFLP Pulse 3

3 Section 10.9 SFWRP Pulse 3

3 Section 10.10 SFRDP Pulse 3

3 Section 11.1 ZRSTP Pulse 3

3 Section 11.2 DECOP Pulse 3

3 Section 11.3 ENCOP Pulse 3

Section 11.4 SUMP Pulse 3

Page 34 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX 3U(C)
Page 34 · click to enlarge
Page 34

2.3 Applied Instructions

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3S

FX 1S

FX 0N

FX 0(S)

3

Section 11.5 BONP Pulse 3

Check specified bit status

DBON Continuous 3

DBONP Pulse 3

3

Section 11.6 MEANP Pulse 3

DMEAN Continuous 3 *1

DMEANP Pulse 3 *1

ANS Continuous Timed annunciator set 3 Section 11.7

3 Section 11.8 ANRP Pulse 3

Section 11.9 SQRP Pulse 3 3 3

DSQR Continuous 3 3 3

DSQRP Pulse 3 3 3

3 *2 3 3 *3

Section 11.10 FLTP Pulse 3 *2 3 3 *3

Conversion to floating point

DFLT Continuous 3 *2 3 3 *3

DFLTP Pulse 3 *2 3 3 *3

3 Section 12.1 REFP Pulse 3

3 3 3 Section 12.2 REFFP Pulse 3 3 3

Refresh and filter adjust

MTR Continuous Input matrix 3 Section 12.3

DHSCS Continuous High speed counter set 3 Section 12.4 DHSCS_I Continuous High Speed Interrupt Counter Set 3 3 3

DHSCR Continuous High speed counter reset 3 Section 12.5

DHSZ Continuous High speed counter zone compare 3 Section 12.6

3 Section 12.7 DSPD Continuous *4 3 3

3 Section 12.8 DPLSY Continuous 3

PWM Continuous Pulse width modulation 3 Section 12.9

3 Section 12.10 DPLSR Continuous 3

IST Continuous Initial state 3 Section 13.1

3 *3

Section 13.2 SERP Pulse 3 *3

Search a data stack

DSER Continuous 3 *3

DSERP Pulse 3 *3

3 Section 13.3 DABSD Continuous 3 *1

INCD Continuous Incremental drum sequencer 3 Section 13.4

TTMR Continuous Teaching timer 3 3 3 Section 13.5

*1. The instruction is provided in the FXU PLC Ver. 2.30 or later. *2. The instruction is provided in the FX3G PLC Ver. 1.10 or later. *3. The instruction is provided in the FXU PLC Ver. 3.07 or later. *4. The 32-bit operations are provided in the FX3UC PLC Ver. 2.20 or later.

Show 28 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Execution · condition Function · Reference · Data Operation · BON Continuous · MEAN Continuous · Mean · ANR Continuous · Annuncator reset · SQR Continuous · Square root · FLT Continuous · High Speed Processing · REF Continuous · Refresh · REFF Continuous · SPD Continuous · Speed detection · PLSY Continuous · Pulse Y output · PLSR Continuous · Acceleration/deceleration setup · Handy Instruction · SER Continuous · ABSD Continuous · Absolute drum sequencer
Page 35 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX 3U(C)
Page 35 · click to enlarge
Page 35

2.3 Applied Instructions

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3S

FX 1S

FX 0N

FX 0(S)

STMR Continuous Special timer 3 3 3 Section 13.6

3 Section 13.7 ALTP Pulse 3

RAMP Pulse Ramp variable value 3 Section 13.8

ROTC Continuous Rotary table control 3 3 3 Section 13.9

SORT Continuous SORT tabulated data 3 3 *1 Section 13.10

External FX I/O Device

3 3 3 Section 14.1 DTKY Continuous 3 3 3

3 3 3 Section 14.2 DHKY Continuous 3 3 3

How to Read Explanation of Instructions

DSW Continuous Digital switch 3 Section 14.3

3 3 3 Section 14.4 SEGDP Pulse 3 3 3

SEGL Continuous Seven segment with latch 3 Section 14.5

ARWS Continuous Arrow switch 3 3 3 Section 14.6

ASC Continuous ASCII code data input 3 3 3 Section 14.7

PR Continuous Print (ASCII code) 3 3 3 Section 14.8

3 *2 3

Section 14.9 FROMP Pulse 3 *2

Read from a special function block

DFROM Continuous 3 *2 3

DFROMP Pulse 3 *2

3 *2 3

Section 14.10 TOP Pulse 3 *2

Write to a special function block

DTO Continuous 3 *2 3

DTOP Pulse 3 *2

External Device (optional devices)

RS Continuous Serial Communication 3 *1 *3 Section 15.1

Applied Instructions (Program Flow)

3

Section 15.2 PRUNP Pulse 3

Parallel run (octal mode)

DPRUN Continuous 3

DPRUNP Pulse 3

3 *1 *3 Section 15.3 ASCIP Pulse 3 *1

Hexadecimal to ASCII conversion

Applied Instructions (Move and Compare)

3 *1 *3 Section 15.4 HEXP Pulse 3 *1

ASCII to hexadecimal conversion

3 *1 *3 Section 15.5 CCDP Pulse 3 *1

*1. The instruction is provided in the FXU PLC Ver. 3.07 or later.

Applied Instructions (Arithmetic and Logical Operation)

*2. The instruction is provided in the FXU PLC Ver. 2.10 or later.

*3. The instruction is provided in the FX0N PLC Ver. 1.20 or later.

Applied Instructions (Rotation and Shift Operation)

Show 25 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Execution · condition Function · Reference · Handy Instruction · Instruction List · ALT Continuous · Alternate state · Configuration of Instruction · TKY Continuous · Ten key input · HKY Continuous · Hexadecimal input · SEGD Continuous · Seven segment decoder · Basic Instruction · FROM Continuous · Step Ladder Instructions · TO Continuous · PRUN Continuous · ASCI Continuous · HEX Continuous · CCD Continuous · Check code
Page 36 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 36 · click to enlarge
Page 36

2.3 Applied Instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 36)
Fig. 9 · 2.2 Step Ladder Instructions

*1 *2*3 3 *2 *2 3 3 Section 15.6 VRRDP Pulse *1 *2*3 3 *2 *2 3 3

*1 *2*3 3 *2 *2 3 3 Section 15.7 VRSCP Pulse *1 *2*3 3 *2 *2 3 3

RS2 Continuous Serial data communication 2 3 3 3 Section 15.8

PID Continuous PID control loop 3 *4 Section 15.9

3 *3 3 3 Section 18.1 DECMPP Pulse 3 *3 3 3

3 *3 3 Section 18.3 DEMOVP Pulse 3 *3 3

*1. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.70 or later.

*2. Though programmed, this instruction is not valid because the FX1NC, FX2NC or FX3GC PLC does not have a volume to read out under this instruction.

*3. The instruction is provided in the FX3G PLC Ver. 1.10 or later.

*4. The instruction is provided in the FXU and FX2C PLCs Ver. 3.30 or later.

*5. The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later.

2 Instruction List

Page 37 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 37 · click to enlarge
Page 37
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 37)
Fig. 10 · 2.2 Step Ladder Instructions

3 *1 3 3 Section 18.8 DEADDP Pulse 3 *1 3 3

3 *1 3 3 Section 18.9 DESUBP Pulse 3 *1 3 3

3 *1 3 3 Section 18.10 DEMULP Pulse 3 *1 3 3

3 *1 3 3 Section 18.11 DEDIVP Pulse 3 *1 3 3

3 *1 3 3 Section 18.15 DESQRP Pulse 3 *1 3 3

*1. The instruction is provided in the FX3G PLC Ver. 1.10 or later.

Page 38 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX U /FX 2C
Page 38 · click to enlarge
Page 38

2.3 Applied Instructions

FX U /FX 2C

FX 3U(C)

FX 3G(C)

FX 2N(C)

FX 1N(C)

FX 3S

FX 1S

FX 0N

FX 0(S)

Section 19.1 WSUMP Pulse *1

Sum of word data

*1 Section 19.2 WTOBP Pulse *1

*1 Section 19.3 BTOWP Pulse *1

4-bit linking of word data *1 Section 19.4 UNIP Pulse *1

4-bit grouping of word data *1 Section 19.5 DISP Pulse *1

Section 19.6 SWAPP Pulse 3 3

DSWAP Continuous 3 3

DSWAPP Pulse 3 3

*1 Section 19.7 DSORT2 Continuous *1

Sort tabulated data 2

DSZR Continuous Dog search zero return 3 3 3 Section 20.1

3 Section 20.2 DDVIT Continuous 3

DTBL Continuous Batch data positioning mode *1 3 Section 20.3

DABS Continuous Absolute current value read 3 3 3 *2 3 3 Section 20.4

3 Section 20.5 DZRN Continuous 3

3 Section 20.6 DPLSV Continuous 3

Variable speed pulse output

3 Section 20.7 DDRVI Continuous 3

3 Section 20.8 DDRVA Continuous 3

Real Time Clock Control

3 Section 21.1 TCMPP Pulse 3

3 Section 21.2 TZCPP Pulse 3

RTC data zone compare

3 Section 21.3 TADDP Pulse 3

3 Section 21.4 TSUBP Pulse 3

Section 21.5 HTOSP Pulse 3

Hour to second conversion

Section 21.6 STOHP Pulse 3

Second to hour conversion

*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later. *2. The instruction is provided in the FX2N and FX2NC PLCs Ver. 3.00 or later.

Show 42 more labels / short text on this page
2 Instruction List · Applicable PLCs · Instruction name Execution · condition Function · Reference · Data Operation 2 · WSUM Continuous · *1 · DWSUM Continuous *1 · DWSUMP Pulse *1 · WTOB Continuous · WORD to BYTE · BTOW Continuous · BYTE to WORD · UNI Continuous · DIS Continuous · SWAP Continuous · Byte swap · SORT2 Continuous · Positioning Control · DVIT Continuous · Interrupt positioning · ZRN Continuous · Zero return · PLSV Continuous · DRVI Continuous · Drive to increment · DRVA Continuous · Drive to absolute · TCMP Continuous · RTC data compare · TZCP Continuous · TADD Continuous · RTC data addition · TSUB Continuous · RTC data subtraction · HTOS Continuous · DHTOS Continuous 3 · DHTOSP Pulse 3 · STOH Continuous · DSTOH Continuous 3 · DSTOHP Pulse 3
Page 39 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 39 · click to enlarge
Page 39
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 39)
Fig. 11 · 2.2 Step Ladder Instructions

3 Section 21.7 TRDP Pulse 3

3 Section 21.8 TWRP Pulse 3

3 3 3 *1 3 3 Section 21.9 DHOUR Continuous 3 3 3 *1 3 3

3 3 3 *1 3 Section 22.3 RD3AP Pulse 3 3 3 *1 3

3 3 3 *1 3 Section 22.4 WR3AP Pulse 3 3 3 *1 3

DHCMOV Continuous High speed counter move 3 Section 24.5

*1. The instruction is provided in the FX2N and FX2NC PLCs Ver. 3.00 or later. *2. The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

Page 40 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 40 · click to enlarge
Page 40

2.3 Applied Instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 40)
Fig. 12 · 2.2 Step Ladder Instructions

RIGHT Continuous Extracting character string data from the right

LEFT Continuous Extracting character string data from the left

*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

2 Instruction List

Page 41 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 41 · click to enlarge
Page 41
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 41)
Fig. 13 · 2.2 Step Ladder Instructions

*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

Page 42 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 42 · click to enlarge
Page 42

2.3 Applied Instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 42)
Fig. 14 · 2.2 Step Ladder Instructions

IVCK Continuous Inverter status check 3 *2 3 Section 30.1

IVDR Continuous Inverter drive 3 *2 3 Section 30.2

IVRD Continuous Inverter parameter read 3 *2 3 Section 30.3

IVWR Continuous Inverter parameter write 3 *2 3 Section 30.4

IVBWR Continuous Inverter parameter block write 3 Section 30.5

IVMC Continuous Inverter Multi Command *3 *4 3 Section 30.6

ADPRW Continuous MODBUS Read / Write *5 *6 3 Section 30.7

DHSCT Continuous High speed counter compare with data table 3 Section 32.1

*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later. *2. The instruction is provided in the FX3G PLC Ver. 1.10 or later. *3. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.70 or later. *4. The instruction is provided in the FX3G PLC Ver. 1.40 or later. *5. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.40 or later. *6. The instruction is provided in the FX3G PLC Ver. 1.30 or later.

2 Instruction List

Page 43 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2.2 Step Ladder Instructions
Page 43 · click to enlarge
Page 43
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2.2 Step Ladder Instructions diagram (page 43)
Fig. 15 · 2.2 Step Ladder Instructions

FLCRT Continuous File create / check *2 Section 34.1

FLDEL Continuous File delete / CF card format *2 Section 34.2

*1. The instruction is provided in the FX3UC PLC Ver. 1.30 or later.

*2. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.61 or later.

Page 44 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Applicable devices of arguments
Page 44 · click to enlarge
Page 44

3.1 Expression and Operation Form of Sequence Instructions FXCPU Structured Programming Manual [Basic & Applied Instruction]

3 Configuration of Instruction

3. Configuration of Instruction

This chapter explains the configuration of sequence instructions.

3.1 Expression and Operation Form of Sequence Instructions

Instructions and arguments

  • Each instruction is given a specific name that indicates its contents. "SMOV" (shift move) is one of such examples.
  • Each instruction consists of the arguments that indicate input and output data used in that particular instruction.

SMOV EN s m1

d D10 D0 K1

: This symbol indicates an argument called "source" that does not change its contents by the

execution of an instruction. : This symbol indicates an argument called "destination" that changes its contents by the

execution of an instruction. m, n : Symbols "m" and "n" indicate an argument that belongs to neither the source nor the

destination.

Applicable devices of arguments

  • An input variable (label or device) specifies the applicable device of an argument.
  • Bit devices such as X, Y, M and S may be handled.
  • These bit devices may be combined to form KnX, KnY, KnM and KnS to be handled as numerical data.

→ FX Structured Programming Manual [Device & Common]

  • The current value register of data register D, timer T and counter C may be handled.
  • When handling 32-bit data, a 16-bit data register D is a combination of data registers of two consecutive points. For example, where data register D0 is defined by a label as the argument of a 32-bit instruction, the 32-bit data of (D1, D0) is handled. (D1 is high order 16 bits and D2 is low order 16 bits.) Where the current value registers of T and C are used as general data registers, they are handled in the same manner.

Command input · m2 K2 · n K3

Page 45 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Pulse execution and continuous execution instructions
Page 45 · click to enlarge
Page 45

3 Configuration of Instruction

3.1 Expression and Operation Form of Sequence Instructions

Instruction mode and Operation form

Instructions are divided into "16-bit instructions" and "32-bit instructions" depending on the size of values they handle. The instructions also have characteristics of either a "continuous execution" or "pulse execution" depending on the form of execution. Some of the instructions have all these combinations.

1. 16-bit and 32-bit instructions

  • An applied instruction that handles a numeric value is either 16 bits or 32 bits depending on the bit length of the numeric value data.

Instruction that transfers the D10 contents to D12

Instruction that transfers the contents of (D21, D20) to (D23, D22).

D20 D22

  • Where it is a 32-bit instruction, "D" is added to express as "DMOV".

How to Read Explanation of Instructions

  • The specified device can be an even number or an odd number and is used in combination with the device of the next higher number. (In the case of word devices such as T, C and D) To avoid confusion, it is suggested to give an even number to the low order device specified by the argument of a 32-bit instruction.
  • A 32-bit counter can be used as a 32-bit data register. 32-bit counters cannot be handled as target devices in 16-bit applied instructions.

2. Pulse execution and continuous execution instructions

Pulse operation In an example shown on the right, when X000 changes from OFF to ON, the instruction is executed only once. No other execution takes place. It is therefore suggested that the instructions of pulse operation be used if not executed all the time. Symbol "P" indicates that the instruction is of pulse operation. The same is applied to DMOVP.

Continuous operation The instruction in the figure on the right is of continuous operation. It is executed in each cycle of operation while X001 is ON.

Applied Instructions (Program Flow)

Where continuous execution instructions such as INC and DEC are used, some instructions have the destination contents be changed in each cycle of operation.

In either cases, the instruction is not executed if the drive input X000 or X001 is OFF. The destination does not change either if the instruction is not specified otherwise.

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 13 more labels / short text on this page
Instruction List · Command 1 · MOV EN s · d D12 D10 · Configuration of Instruction · Command 2 · DMOV EN s · Basic Instruction · MOVP EN s · d D12 D10 · Step Ladder Instructions · MOV EN s · d D12 D10
Page 46 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Definition of labels
Page 46 · click to enlarge
Page 46

3.2 Labels FXCPU Structured Programming Manual [Basic & Applied Instruction]

3 Configuration of Instruction

3.2 Labels

Types of labels

Labels are either global labels or local labels.

  • Global labels are available for use in program blocks and function blocks.
  • Local labels are available for use only in a declared program part.

Label classes

The label classes indicate how they are used in which program parts. The table below shows the label classes.

Program parts available for use

VAR_GLOBAL A common label that can be used in all program parts. 3 3

VAR_GLOBAL_CONSTANT A common constant that can be used in all program parts. 3 3

VAR A label used within declared program parts. It cannot be used in other program parts. 3 3 3

VAR_CONSTANT A constant used within declared program parts. It cannot be used in other program parts. 3 3 3

VAR_INPUT A label that receives values. It cannot be changed within program parts. 3 3

VAR_OUTPUT A label for output from a function block. 3

VAR_IN_OUT A local label that receives values and outputs from a program part. 3

Definition of labels

Before using a label, the label needs to be defined. An error is generated if attempting to convert (compile) a program where the label is not defined.

  • Where defining a global label, the label name, class, data type and device are interrelated.
  • Where defining a local label, the label name, class and data type are set. The user does not have to specify a device when using a local label. A device is allocated automatically during the compilation. The following is an example of setting the label Var_dint1 and Var_dint2 of a DMOV instruction.
  • When using as a global label: Set the class, label name and data type and device or address.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Definition of labels diagram (page 46)
Fig. 16 · Definition of labels
Show 6 more labels / short text on this page
Label class Descriptions · Program · block Function Function · block · DMOV EN s · Var_dint1 Var_dint2
Page 47 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — E ± 3.402823 +38
Page 47 · click to enlarge
Page 47

3 Configuration of Instruction

3.2 Labels

  • When using as a local label: Set the class, label name and data type.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3.2 Labels diagram (page 47)
Fig. 17 · 3.2 Labels

Expressing constants

The following describes the method of expression when setting constant to a label.

Type of constant Method of expression Example

Bit Enter either "FALSE" or "TRUE", or either "0" or "1". TRUE, FALSE

Binary number Add "2#" before the binary number. 2#0010, 2#01101010

How to Read Explanation of Instructions

Octal number Add "8#" before the octal number. 8#0, 8#337

Decimal number Enter the decimal number directly. Or, add "K" before the decimal number 123, K123

Hexadecimal number Add "16#" or "H" before the hexadecimal number. 16#FF, HFF

Real number Enter the real number directly. Or, add "E" before the real number. 2.34, E2.34

Character string Put the character string between single quotations ('') or double quotations (""). 'ABC', "ABC"

Data type

The data type of label is either basic data type or universal data type.

  • The table below lists the basic data types.

Data type Description Value range Bit length

Bit Boolean data 0(FALSE), 1(TRUE) 1 bit

Word [signed] Integer -32768 to 32767 16 bits

Double Word [signed] Double precision integer -2147483648 to 2147483647 32 bits

Word [unsigned]/Bit String [16-bit] 16-bit data 0 to 65535 16 bits

Applied Instructions (Program Flow)

Double Word [unsigned]/Bit String [32-bit] 32-bit data 0 to 4294967295 32 bits

E ±1.175495-38 to

FLOAT (Single Precision) Real number

E ± 3.402823 +38

(Number of significant figures6)

Applied Instructions (Move and Compare)

String Character string (50 characters maximum) Variable

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

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · 32 bits
Page 48 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ANY16
Page 48 · click to enlarge
Page 48

3.2 Labels FXCPU Structured Programming Manual [Basic & Applied Instruction]

3 Configuration of Instruction

  • The universal data type is the data type of a label that puts together several basic data types. The data type name starts with "ANY".

ANY

ANY_SIMPLE

ANY_NUM ANY_BIT Time String

Word [unsigned]/ Bit String [16-bit]

ANY_REAL ANY_INT

The "ANY" type on a higher layer contains types on the lower layer. The "ANY" type on the top layer contains all types.

Double Word [unsigned]/ Bit String [32-bit]

ANY16

ANY32

Word [unsigned]/ Bit String [16-bit]

Double Word [unsigned]/ Bit String [32-bit]

*1 Refer to the following manual for details.

Q/L/F Structured Programming Manual (Fundamentals)

Show 9 more labels / short text on this page
Array Structure · *1 *1 · Bit · FLOAT (Single Precision) · Word [signed] · FLOAT (Double Precision) · Double word [signed] · Word [signed] · Double word [signed]
Page 49 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — %I X 0 %M X 1 . 863
Page 49 · click to enlarge
Page 49

3 Configuration of Instruction

3.3 Devices and Addresses

3.3 Devices and Addresses

A device is expressed by a device or an address.

Device

The device is expressed by a device name and a device number.

X 0 D 100

Device name Device number

Address

An address is expressed by a method defined by IEC61131-3. It is expressed as follows according to IEC61131-3.

Top 1st characterposition 2nd character: size 3rd character and onwards: classification Number

How to Read Explanation of Instructions

I Input (Omitted) Bit These are the numbers for detailed classification. This number is separated by "." (period) from subsequent numbers. This number may be omitted.

Q Output X Bit

The number that indicates a device number (decimal number).

M Internal W Word (16 bits)

D Double word (32 bits)

%I X 0 %M X 1 . 863

Position of memory area

  • Position of memory area This is the first classification to identify the position of memory area either by input, output and internal where data is allocated. X (X device) :I (Input) Y (Y device) :Q (Output) Device other than above :M (Internal)

Applied Instructions (Program Flow)

  • Size The principle of expression method corresponding to device (method of expression for MELSEC) is as follows. Bit device :X (Bit) Word device :W (Word), D (Double word)

Applied Instructions (Move and Compare)

  • Classification This is the second classification to identify the types of device that cannot be classified only by the above position and size. X or Y of a device does not classify. Refer below for the expression corresponding to the device expression.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
Instruction List · Configuration of Instruction · % · Basic Instruction · Step Ladder Instructions · Size Classification Number · → Appendix A
Page 50 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M1
Page 50 · click to enlarge
Page 50

3.4 EN and ENO FXCPU Structured Programming Manual [Basic & Applied Instruction]

3 Configuration of Instruction

3.4 EN and ENO

The execution control is available for an instruction with "EN".

  • EN is for entering an execution condition of instruction.
  • ENO is for outputting the state of execution of instruction.
  • The table below shows the relationships between the EN and ENO and the contents of operation results.

EN ENO Operation results

TRUE(Without operation error) Operation output value

FALSE(With operation error) Undefined value

FALSE(Stopping operation) FALSE Undefined value

M1

In the instruction above, instruction MOV is executed only when X000 is TRUE.

TRUE(Executing operation) · MOV EN s · d D2 D0

Page 51 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — MEMO
Page 51 · click to enlarge
Page 51

3 Configuration of Instruction

3.4 EN and ENO

MEMO

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 4 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 52 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 4. How to Read Explanation of Instructions
Page 52 · click to enlarge
Page 52

4 How to Read Explanation of Instructions

4. How to Read Explanation of Instructions

The following shows one of the pages that explains the instructions.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 4. How to Read Explanation of Instructions diagram (page 52)
Fig. 18 · 4. How to Read Explanation of Instructions

* The above is different from the actual page, as it is provided for explanation only.

Page 53 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FBD
Page 53 · click to enlarge
Page 53

4 How to Read Explanation of Instructions

1. Indicates the corresponding chapter, section, subsection, number and instruction name.
2. Indicates the PLCs that support the instruction.

Supported by PLCs from the first release.

The support conditions depend on the versions. "Cautions" explains the applicable versions.

This particular series PLCs do not support the instruction.

3. Indicates the data length, operation form and expression of each instruction.

16 bits An instruction of 16-bit data length

32 bits An instruction of 32-bit data length

Continuous This is a continuous execution instruction that is executed in each cycle of operation while the execution condition (EN) is being satisfied.

Pulse This is a pulse execution instruction that is executed only when the execution condition (EN) changes from the state of not established to the state of established.

Indicates the instruction expression in the structured ladder language adopted as the representative.

FBD

ST Indicates a ST language instruction.

How to Read Explanation of Instructions

Some PLCs do not support "16 bits / 32 bits" or "continuous / pulse" depending on their versions. Refer to "Cautions".

4. Indicates the names of the input and output variables of the instruction and the contents and data type of each variable. Refer to the following manual for details of data type.

→ Q/L/F Structured Programming Manual (Fundamentals)

5. Applicable devices " z " indicates the devices that can be used in an instruction. Devices marked " S " have restrictions in use. Refer to "Cautions".
6. Function and operation explanation Explains the functions that the instruction is responsible for. This explanation uses an example of structured ladder language.
7. Summarizes the notes before using the instruction.
8. Program example Explains a program example in each language. In program examples of the structured ladder/FBD language, the structured ladder language is adopted as the representative.

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
Item Descriptions · Instruction List · Item Descriptions · Configuration of Instruction · Structured ladder/ · Basic Instruction · Step Ladder Instructions
Page 54 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5. Basic Instruction
Page 54 · click to enlarge
Page 54

5. Basic Instruction

This chapter introduces the instructions for the structured project corresponding to the basic instructions for the simple project.

Instruction name Function Reference

LD Initial logical operation of NO (normally open) contacts Section 5.1

LDI Initial logical operation of NC (normally closed) contact type Section 5.1

AND Serial connection of NO (normally open) contacts Section 5.1

ANDI Serial connection of NC (normally closed) contacts Section 5.1

OR Parallel connection of NO (normally open) contacts Section 5.1

ORI Parallel connection of NC (normally closed) contacts Section 5.1

LDP Initial logical operation of rising edge pulse Section 5.2

LDF Initial logical operation of falling/trailing edge pulse Section 5.2

ANDP Serial connection of rising edge pulse Section 5.2

ANDF Serial connection of falling/trailing edge pulse Section 5.2

ORP Parallel connection of rising edge pulse Section 5.2

ORF Parallel connection of falling/trailing edge pulse Section 5.2

OUT Final logical operation type coil drive (Excluding timers and counters) Section 5.3

OUT_T Final logical operation type coil drive (timers) Section 5.4

OUT_C Final logical operation type coil drive (16-bit counter) Section 5.5

OUT_C_32 Final logical operation type coil drive (32-bit counter) Section 5.5

AND(...) Serial connection of multiple parallel circuits Section 5.6

OR(...) Parallel connection of multiple contact circuits Section 5.6

MPS Stores the current result of the internal PLC operations Section 5.7

MRD Reads the current result of the internal PLC operations Section 5.7

MPP Pops (recalls and removes) the currently stored result Section 5.7

INV Invert the current result of the internal PLC operations Section 5.8

MEP Conversion of operation result to leading edge pulse Section 5.9

MEF Conversion of operation result to trailing edge pulse Section 5.9

SET SET Bit device latch ON Section 5.10

RST RESET Bit device OFF Section 5.10

PLS Rising edge pulse Section 5.11

PLF Falling/trailing edge pulse Section 5.11

MC Denotes the start of a master control block Section 5.12

MCR Denotes the end of a master control block Section 5.12

END Program END, I/O refresh and Return to Step 0 Section 5.13

NOP No operation or null step Section 5.14

5 Basic Instruction

Page 55 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 55 · click to enlarge
Page 55

5.1 LD, LDI, AND, ANI, OR, ORI

5.1 LD, LDI, AND, ANI, OR, ORI

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The LD and LDI instructions are contacts connected to bus lines. The AND and ANI instructions connect one contact in series. The OR and ORI instructions connect one contact in parallel.

1. Format and operation, execution form

Expression in each language

LD Continuous To become an assignment statement, operator, control syntax and so forth.

LD AND ANI

X000 X002

Y000

The ST language may not have the instructions (symbols) directly corresponding to the contacts of LD, AND and OR that are programmed in a simple project. The structured ladder shown on the left can be expressed as shown below. (When configuring with assignment statements)

OR

Y001

How to Read Explanation of Instructions

LDI

X002 X000

Y002

Y000:=(X000 OR X001) AND X002; Y001:=(X000 OR X001) AND X002 AND NOT X003; Y002:=(NOT X000 OR NOT X001) AND NOT X002; Y003:=(NOT X000 OR NOT X001) AND NOT X002 AND X003;

ORI

Y003

AND

2. Set data

Variable Description Data type

Input variable - Variable that are applicable to AND and OR input. Bit

Output variable - Result of operation of AND and OR. Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

LD z S1 S2

Applied Instructions (Program Flow)

LDI z S1 S2

AND z S1 S2

ANI z S1 S2

OR z S1 S2

ORI z S1 S2

Applied Instructions (Move and Compare)

S: Refer to "Cautions".

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 19 more labels / short text on this page
5 Basic Instruction · Instruction List · Instruction · Execution · name · form · Configuration of Instruction · LDI Continuous · AND Continuous · ANI Continuous · OR Continuous · ORI Continuous · Basic Instruction · Step Ladder Instructions · Special · Character · String Pointer · Instruction · User
Page 56 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. AND (Serial connection of NO (normally open) contacts)
Page 56 · click to enlarge
Page 56

5.1 LD, LDI, AND, ANI, OR, ORI

Function and operation explanation

1. LD (Initial logical operation of NO (normally open) contacts)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.1 LD, LDI, AND, ANI, OR, ORI diagram (page 56)
Fig. 19

2. LDI (Initial logical operation of NC (normally closed) contact type)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. LDI (Initial logical operation of NC (normally closed) contact type) diagram (page 56)
Fig. 20 · 2. LDI (Initial logical operation of NC (normally cl…

3. AND (Serial connection of NO (normally open) contacts)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. AND (Serial connection of NO (normally open) contacts) diagram (page 56)
Fig. 21 · 3. AND (Serial connection of NO (normally open) cont…

5 Basic Instruction

Page 57 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 4. ANI (Serial connection of NC (normally closed) contacts)
Page 57 · click to enlarge
Page 57
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.1 LD, LDI, AND, ANI, OR, ORI diagram (page 57)
Fig. 22

4. ANI (Serial connection of NC (normally closed) contacts)

5. OR (Parallel connection of NO (normally open) contacts)

6. ORI (Parallel connection of NC (normally closed) contacts)

Page 58 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Errors
Page 58 · click to enlarge
Page 58

5.1 LD, LDI, AND, ANI, OR, ORI

7. Relationship with AND (...) The parallel connection by OR or ORI instruction is connected to the preceding LD or LDI instruction in principle. The "AND (...) after" instruction, however, the parallel connection by OR or ORI instruction is connected to the second preceding LD or LDI instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.1 LD, LDI, AND, ANI, OR, ORI diagram (page 58)
Fig. 23
8. Indexing Devices used in LD, LDI, AND, ANI, OR and ORI instructions can be indexed with index registers (V, Z). (State relays (S), special auxiliary relays (M), 32-bit counters (C) or "D .b" cannot be indexed.) Applicable only to the FX 3U and FX 3UC PLCs.

When a used devices is an input (X) or output (Y), the value of an index register (V or Z) is converted into an octal number, and then added.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.1 LD, LDI, AND, ANI, OR, ORI diagram (page 58)
Fig. 24
ExampleWhen the value of V0 is "10", the

LD contact is set to ON (becomes conductive) or OFF (becomes nonconductive) by X013.

9. Bit specification of data register (D) A bit in data register (D) can be specified as a device used in LD, LDI, AND, ANI, OR and ORI instructions. Applicable only to the FX 3U and FX 3UC PLCs.

When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.1 LD, LDI, AND, ANI, OR, ORI diagram (page 58)
Fig. 25
ExampleIn the example shown on the left,

LD contact is set to ON (becomes conductive) or OFF (becomes nonconductive) by the bit 3 of D0.

Cautions

1. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable. S 2: Only the FX 3U and FX 3UC PLCs are capable of indexing applicable devices.

The following devices cannot be indexed.

  • Special auxiliary relays (M)
  • 32-bit counters (C)
  • State (S)
  • Word bit specification "D .b"

Errors

1. When an I/O number used in LD, LDI, AND, ANI, OR or ORI instruction does not exist due to indexing, M8316 (Non-existing I/O specification error) turns ON. (Applicable to the FX 3U and FX 3UC PLCs only)
2. When the device number of a device (M, T or C) other than I/O does not exist due to indexing, an operation error (error code: 6706) occurs. (Applicable to the FX 3U and FX 3UC PLCs only)

5 Basic Instruction

Page 59 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Set data
Page 59 · click to enlarge
Page 59

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Contact instructions LDP, ANDP, and ORP detect the rising edge, and become active during one operation cycle only at the rising edge of a specified bit device (that is, when the bit device turns ON from OFF). Contact instructions LDF, ANDF and ORF detect the falling edge, and become active during one operation cycle only at the falling edge of a specified bit device (that is, when the bit device turns OFF from ON).

1. Format and operation, execution form

Expression in each language

Pulse (detecting rising pulse)

LDP

How to Read Explanation of Instructions

Pulse (detecting falling pulse)

LDF

Pulse (detecting rising pulse)

ANDP

Pulse (detecting falling pulse)

ANDF

Pulse (detecting rising pulse)

ORP

Pulse (detecting falling pulse)

ORF

Applied Instructions (Program Flow)

2. Set data

Variable Description Data type

EN Execution condition LDP,LDFAlways TRUE Except LDP, LDF : BOOL

Applied Instructions (Move and Compare)

Output variable ENO Execution state Bit

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 23 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Instruction · Execution · name · form · LDP EN s · LDP(EN,s); · LDF EN s · LDF(EN,s); · ANDP EN s · ANDP(EN,s); · Basic Instruction · ANDF EN s · ANDF(EN,s); · Step Ladder Instructions · ORP EN s · ORP(EN,s); · ORF EN s · ORF(EN,s); · Input variable · Applicable devices Bit
Page 60 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 60 · click to enlarge
Page 60

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.2 LDP, LDF, ANDP, ANDF, ORP, ORF diagram (page 60)
Fig. 26

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

LDP z S1

LDF z S1

ANDP z S1

ANDF z S1

ORP z S1

ORF z S1

S: Refer to "Cautions".

Function and operation explanation

1. LDP, ANDP, ORP (Initial logical operation of rising edge pulse, serial connection and parallel connection)
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 60)
Fig. 27 · Function and operation explanation

In the example shown above, M0 or M1 is ON during only one operation cycle when X000 to X002 turn ON from OFF.

5 Basic Instruction

Page 61 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K10
Page 61 · click to enlarge
Page 61

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

2. LDF, ANDF, ORF (Initial logical operation of falling/trailing edge pulse, serial connection and parallel connection)

M0 ORF EN s

M0:=ORF(LDF(TRUE,X000),X001); M1:= ANDF(M8000,X002);

M8000 ANDF EN s

M1

LDF X000

ON

ON

ON ON

ORF

ON during one operation cycle

M0

How to Read Explanation of Instructions

M8000

ON

X002 ON ON ON

ANDF

ON during one operation cycle

M1

In the example shown above, M0 or M1 is ON during only one operation cycle when X000 to X002 turn OFF from ON. 3. Bit specification of data register (D) A bit data register (D) can be specified as a device used in LDP, LDF, ANDP, ANDF, ORP and ORF instructions.

When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.

Y000:= LDP(TRUE,D0.3);

Y000

Applied Instructions (Program Flow)

ExampleIn the example shown on the left, LDP

contact turns ON (becomes conductive) or OFF (becomes nonconductive) when the bit 3 of D0 turns ON or OFF. 4. Output drive side The following two circuits offer the same operation.

Applied Instructions (Move and Compare)

M6

PLS EN ENO

=

Applied Instructions (Arithmetic and Logical Operation)

M 6

In each circuit, M6 is ON during only one operation cycle when X010 turns ON from OFF.

=

Applied Instructions (Rotation and Shift Operation)

K10

In each circuit, MOV instruction is executed only once when X020 turns ON from OFF.

Show 18 more labels / short text on this page
5 Basic Instruction · LDF EN s · Instruction List · RUN monitor · timing chart · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · LDP EN s · LDP EN s · d M6 · One operation cycle · One operation cycle · LDP EN s · MOV EN s · MOVP EN s · d D0 · d D0 K10
Page 62 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.2 LDP, LDF, ANDP, ANDF, ORP, ORF
Page 62 · click to enlarge
Page 62

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

5. Differences in the operation caused by auxiliary relay (M) numbers Not supported by the FX 1S , FX 1N or FX 1NC PLC. When an auxiliary relay (M) is specified as a device in LDP, LDF, ANDP, ANDF, ORP and ORF instructions, the operation varies depending on the device number range as shown in the figure below.

(M0 to M2799 for the FX2N and FX2NC PLCs, M0 to M1535 for the FX3S PLC)

After M0 is driven by X000, all contacts 1) to 4) corresponding to M0 are activated.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.2 LDP, LDF, ANDP, ANDF, ORP, ORF diagram (page 62)
Fig. 28
  • The contacts 1) to 3) detect the rising edge of M0.
  • Because of LD instruction, the contact 4) is conductive while M0 is ON.

From M2800 driven by X000, the program is divided into the upper block (block A) and the lower block (block B). In each of the blocks A and B, only the first contact which detects the rising or falling edge is activated. Because of LD instruction, the contact in the block C is conductive while M2800 is ON. By utilizing these characteristics, "transition of state by same signal" in a step ladder circuit can be efficiently programmed.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.2 LDP, LDF, ANDP, ANDF, ORP, ORF diagram (page 62)
Fig. 29

5 Basic Instruction ·

Page 63 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — NEXT EN ENO
Page 63 · click to enlarge
Page 63

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF

Cautions

1. When LDP, LDF, ANDP, ANDF, ORP or ORF instruction programmed in a same step is executed two or more times within one operation cycle, the operation is as follows.

Programs executed two or more times - Program between FOR and NEXT instructions - Program which executes a same subroutine program from two or more CALL instructions during one operation cycle. - Program which jumps to a pointer number or ladder block label in a smaller ladder block number by CJ instruction.

KOO

Operation - When a device turns ON from OFF 1st time :LDP, ANDP or ORP instruction turns ON. 2nd time and later :When the device status is same as the time when the instruction was executed last, the instruction turns OFF. - When a device turns OFF from ON 1st time :LDF, ANDF or ORF instruction turns ON. 2nd time and later :When the device status is same as the time when the instruction was executed last, the instruction turns OFF.

NEXT EN ENO

How to Read Explanation of Instructions

2) When write during RUN is completed for a circuit including an instruction for falling edge pulse (LDF, ANDF, or ORF instruction), the instruction for falling edge pulse is not executed without regard to the ON/ OFF status of the target device of the instruction for falling edge pulse. When write during RUN is completed for a circuit including an instruction for falling edge pulse (PLF instruction), the instruction for falling edge pulse is not executed without regard to the ON/OFF status of the operation condition device. It is necessary to set to ON the target device or operation condition device once and then set it to OFF for executing the instruction for falling edge pulse.

3. When write during RUN is completed for a circuit including an instruction for rising edge pulse, the instruction for rising edge pulse is executed if a target device of the instruction for rising edge pulse or the operation condition device is ON. Target instructions for rising edge pulse: LDP, ANDP, ORP and pulse operation type applied instructions (such as MOVP)

Contact ON/OFF status (while write

during RUN is executed) Instruction for rising edge pulse Instruction for falling edge pulse

OFF Not executed Not executed

ON Executed*1 Not executed

Applied Instructions (Program Flow)

*1. PLS instruction is not executed.

4. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
5 Basic Instruction · FOR EN n · Instruction List · LDP EN s · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 64 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 64 · click to enlarge
Page 64

5.3 OUT (Excluding timers and counters)

5.3 OUT (Excluding timers and counters)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction outputs the operation result up to the execution of the OUT instruction to the specified device.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 64)
Fig. 30 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 64)
Fig. 31 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 64)
Fig. 32 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

5 Basic Instruction

Page 65 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — OUT(X000,D0.3);
Page 65 · click to enlarge
Page 65

5.3 OUT (Excluding timers and counters)

Function and operation explanation

1. When a bit device is used A device described in OUT instruction turns ON or OFF according to the driven contact status. Parallel OUT instructions can be used consecutively as many times as necessary. In the program example shown below, OUT M100 and OUT M101 are parallel. If two or more OUT instructions are executed for a same device number, however, the double output (double coil) operation is resulted.

Drive contact of OUT instruction

OUT(X000,Y000); OUT(NOT X001,M100); OUT(NOT X001,M101);

Y000

OUT

OUT

M100

OUT

For assignment statement Y000:= X000; M100:= NOT X001; M101:= NOT X001;

M101

How to Read Explanation of Instructions

ON ON X000

OUT

ON Y000

ON

ON X001

ON

OUT

ON M100

ON M101 OUT

2. Indexing Devices used in OUT instruction can be indexed with index registers (V and Z). (State relays (S), special auxiliary relays (M), or "D .b" cannot be indexed.) Applicable only to the FX 3U and FX 3UC PLCs.

Applied Instructions (Program Flow)

When a used devices is an input (X) or output (Y), the value of an index register (V or Z) is converted into an octal number, and then added.

OUT(X000,Y000Z0);

X000 Y000Z0

ExampleWhen the value of Z0 is "20",

For assignment statement Y000Z0:= X000;

Y024 turns ON or OFF.

Applied Instructions (Move and Compare)

3. Bit specification of data register (D) A bit in data register (D) can be specified as a device used in OUT instruction. Applicable only to the FX 3U and FX 3UC PLCs.

When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.

Applied Instructions (Arithmetic and Logical Operation)

OUT(X000,D0.3);

For assignment statement D0.3:= X000;

ExampleIn the example shown on the left,

Applied Instructions (Rotation and Shift Operation)

the bit 3 of D0 turns ON or OFF when X000 turns ON or OFF.

Show 6 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · timing chart · Basic Instruction · Step Ladder Instructions
Page 66 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. When specifying bit of word device
Page 66 · click to enlarge
Page 66

5.3 OUT (Excluding timers and counters)

Cautions

1. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable. S 2: Only the FX 3U and FX 3UC PLCs are capable of indexing applicable devices.

The following devices cannot be indexed.

  • Special auxiliary relays (M)
  • State (S)
  • Word bit specification "D .b"
2. The following instructions are used to operate the timer and counter in a structured program. Note that they are not operable in the OUT instruction.

OUT_T Section 5.4.1

OUT_C Section 5.5.1

OUT_C_32 Section 5.5.1

Errors

1. When a Y number used in OUT instruction does not exist due to indexing, M8316 (Non-existing I/O specification error) turns ON. (Applicable to the FX 3U and FX 3UC PLCs only)
2. When the device number of a device (M,T,C)other than I/O does not exist due to indexing, an operation error (error code: 6706) occurs. (Applicable to the FX 3U and FX 3UC PLCs only.)

Program example

1. When using bit device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 66)
Fig. 33 · Program example

2. When specifying bit of word device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. When specifying bit of word device diagram (page 66)
Fig. 34 · 2. When specifying bit of word device

5 Basic Instruction · Instruction name Reference

Page 67 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.4 Operating Timer
Page 67 · click to enlarge
Page 67
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.4 Operating Timer diagram (page 67)
Fig. 35 · 5.4 Operating Timer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

An output is generated when a set time expires.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 68 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 68 · click to enlarge
Page 68

5.4 Operating Timer

Function and operation explanation

1. OUT_T operation

1. When the operation result up to the OUT_T instruction operation is ON, the timer coils is ON and counts until the set value is reached. When the set time expires (or reaches the set count), the contacts become as follows:

NO (normally open) contact Timer is conductive.

NC (normally closed) contact Timer is not conductive.

2. When the operation result up to the OUT_T instruction operation turns OFF from ON, the timer parameters become as follows.

Before time-up After time-up

Timer type Timer coil Current timer

NO (normally open) contact

NO (normally open) contact

100 ms timer 0.1 to 3276.7 seconds

OFF 0 Nonconductive Conductive Nonconductive Conductive 10 ms timer 0.01 to 327.67 seconds

1 ms timer*1

0.001 to 32.767 seconds

100 ms integrating timer*2

0.1 to 3276.7 seconds OFF Holding current value Nonconductive Conductive Nonconductive Conductive 1 ms integrating timer*2

0.001 to 32.767 seconds

*1. Not supported by the FX0S, FX0, FX1N, FX1NC, FXU, FX2C, FX2N or FX2NC PLC.

*2. Not supported by the FX0S, FX0, FX0N or FX1S PLC.

2. Clearing integrating timer After the set time expires, the current value of the integrating timer is cleared and the contacts are turned OFF by the RST.
3. Timer set value The set value can be specified directly by a decimal number (K) or indirectly using a data register (D) or extension register (R). Indirect setting by the extension register (R) is applicable only to the FX 3U and FX 3UC PLCs. No negative numbers (-32768 to -1) can be set. If the timer value is set to "0", the time expires at the same time as the OUT_T instruction activates.
4. OUT_T operation The following processes take place when the OUT_T instruction activates.
1. The OUT_T instruction TC coil turns ON or OFF.
2. The OUT_T instruction TS contacts turn ON or OFF.
3. The OUT_T instruction TN current value is changed.

If the OUT_T instruction is skipped by an instruction such as JMP while the OUT_T instruction is ON, neither the current value is updated nor contacts are turned ON or OFF. When one particular OUT_T instruction operates more than once within the same scan, the current value is updated as many times as the timer operates.

Show 6 more labels / short text on this page
5 Basic Instruction · NC (normally · NC (normally · value · closed) contact · closed) contact
Page 69 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 69 · click to enlarge
Page 69

5.4 Operating Timer

Cautions

1. When a timer device is specified in a program, use the following depending on the locations of use. - Used as contacts: TS - Used as a coil: TC - Used as a current value: TN

2) Use the timer T192 to T199 within a subroutine or interrupt routine. This timer counts the time when executing a coil instruction or END instruction. When the set value is reached, the output contact operates when the coil instruction or the END instruction is executed. A general purpose timer counts the time only when the coil instruction is executed. Such a timer does not operate normally because it does not count the time if used in a subroutine or an interrupt routine where the coil instruction is executed only under certain conditions.

3. Note: If a 1 ms integrating timer is used in a subroutine or an interrupt routine, the output contact operates when the first coil instruction is executed after the set value is reached (FX 1N , FX 1NC , FX U , FX 2C , FX 2N , FX 2NC , FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs)
4. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The target device can be indexed only by the FX 3U and FX 3UC PLCs.

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 70 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 70 · click to enlarge
Page 70

5.4 Operating Timer

Program example

1. Program that turns ON Y010 and Y014 in 10 seconds after X000 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 70)
Fig. 36 · Program example
2. Program that sets the BCD data of X010 to X01F to a timer.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 70)
Fig. 37 · Program example

BCD data of X010 to X01F is converted to binary data and stored in D10.

When X002 turns ON, timer starts to count using data stored in D10 as set value.

When T2 timer completes counting up, Y015 turns on.

3. Program that turns ON Y010 in 250 milliseconds after X000 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 70)
Fig. 38 · Program example

5 Basic Instruction

Page 71 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 71 · click to enlarge
Page 71

5.5 Operating Counters

5.5 Operating Counters

5.5.1 OUT_C, OUT_C_32

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The counter starts counting when the condition turns ON from OFF. It generates an output when counting up to the set value.

1. Format and operation, execution form

Expression in each language

OUT_C EN ENO CCoil CValue

OUT_C 16 bits Continuous OUT_C(EN,CCoil,CValue);

How to Read Explanation of Instructions

OUT_C_32 EN ENO CCoil CValue

OUT_C_32 32 bits Continuous OUT_C_32(EN,CCoil,CValue);

2. Set data

16-bit operation 32-bit operation

EN Execution condition Bit

CCoil Target counter Bit

CValue Counter set value ANY16 ANY32

Output variable ENO Execution state Bit

3. Applicable devices

Applied Instructions (Program Flow)

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

CValue z S1 S2 z

Applied Instructions (Move and Compare)

S: Refer to "Cautions".

Function and operation explanation

1. OUT_C operation

Applied Instructions (Arithmetic and Logical Operation)

1. When the operation result up to the OUT_C instruction turns ON from OFF, the counter counts up the current value (count value) by +1. When the counter completes counting (the current value reaches the set value), the contact becomes as follows.

NO (normally open) contact Conductive

NC (normally closed) contac Nonconductive

Applied Instructions (Rotation and Shift Operation)

2. The counter does not count if the operation result remains ON. (The count input does not need to be in the form of pulse.)
Show 18 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Instruction · name Operation Execution · form · Basic Instruction · Data type · Variable Description · Step Ladder Instructions · Input variable · Operand · Special · Character · User · String Pointer · type · CCoil z
Page 72 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 72 · click to enlarge
Page 72

5.5 Operating Counters

2. Counter reset After completing to count, the count value and contact condition does not change until the RST instruction is executed.
3. Counter set value The set value of the counter can be specified directly by a decimal number (K) or indirectly using a data register (D) or extension register (R). Indirect setting by the extension register (R) is applicable only to the FX 3U and FX 3UC PLCs. No negative numbers (-32768 to -1) can be set. If set to "0", the same process as 1 takes place.
4. When using counter device When a counter device is specified in a program, use the following depending on the locations of use.
  • Used as contacts: CS
  • Used as a coil: CC
  • Used as a current value: CN

Cautions

1. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: Only the FX 3U and FX 3UC PLCs can index the target device.

A 32-bit counter cannot be indexed.

Program example

1. This program turns ON Y30 when X0 turns ON 10 times and resets the counter when X1 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 72)
Fig. 39 · Program example
2. This program sets "10" to C10 when X0 turns ON and sets to "20" to C10 when X1 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 72)
Fig. 40 · Program example

MOVP(X0 AND NOT X1,10,D0); MOVP(X1 AND NOT X0,20,D0); OUT_C(X3,CC10,D0); OUT(CS10,Y30);

C10 counts with the data stored in D0 as the set value.

5 Basic Instruction

Page 73 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.6 AND(...), OR(...)
Page 73 · click to enlarge
Page 73
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.6 AND(...), OR(...) diagram (page 73)
Fig. 41

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Use AND (...) instruction to connect a branch circuit (parallel circuit block) to the preceding circuit in series. Use OR (...) instruction to connect a series circuit block in parallel.

AND(...) The ladder diagram (or LD) is described as follows.

OR(...) The ladder diagram (or LD) is described as follows.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 74 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.6 AND(...), OR(...)
Page 74 · click to enlarge
Page 74

5.6 AND(...), OR(...)

Function and operation explanation

1. AND( ... )(Serial connection of circuit blocks) AND (...) is an independent instruction not associated with any device number in the same way as the OR (...) instruction described later. When there are many parallel circuits, the AND (...) instruction can be used for each circuit block to connect them.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.6 AND(...), OR(...) diagram (page 74)
Fig. 42

[ ST ] Y007:= ((X000 OR X001) AND ((X002 AND X003) OR (NOT X004 AND X005) OR X006)) OR X003;

2. OR(...)(Parallel connection of circuit blocks) OR (...) is an independent instruction not associated with any device number in the same way as the AND (...) instruction. When there are many parallel circuits, the OR (...) instruction can be used for each circuit block to connect them.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.6 AND(...), OR(...) diagram (page 74)
Fig. 43

[ ST ] Y007:=(X000 AND X001) OR (X002 AND X003) OR (NOT X004 AND X005);

5 Basic Instruction

Page 75 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.7 MPS, MRD, MPP
Page 75 · click to enlarge
Page 75
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.7 MPS, MRD, MPP diagram (page 75)
Fig. 44

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

These PLCs have 11 memories called "Stack" which store the intermediate result (ON or OFF) of operations.

Input variable EN Execution condition MPS: Bit MRD, MPP: Always TRUE

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 76 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 76 · click to enlarge
Page 76

5.7 MPS, MRD, MPP

Function and operation explanation

These instructions are convenient in programming branched multi-output circuits.

1. MPS, MRD, MPP (Stack push down, stack read and stack popup)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. MPS, MRD, MPP (Stack push down, stack read and stack popup) diagram (page 76)
Fig. 45 · 1. MPS, MRD, MPP (Stack push down, stack read and st…

[ ST ] Y002:= X005 AND MPS(X004); Y003:= MRD(TRUE) AND X006; Y004:= MRD(TRUE); Y005:= MPP(TRUE) AND X007;

1. Use MPS instruction to store the intermediate result of operation, and then drive the output Y002.
2. Use MRD instruction to read the stored data, and then drive the output Y003. MRD instruction can be programmed as many times as necessary.
3. In the final output circuit, use MPP instruction instead of MRD instruction. MPP instruction reads the stored data described above, and then resets it.

Error

MPS instruction can be used two or more times. However, the difference between the number of MPS instructions and the number of MPP instructions should be 11 or less, and should be 0 at the end.

Caution

When a circuit is programmed as shown on the left, it is compiled in fact as the program on the right that does not use MPS, MRD or MPP instruction.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Caution diagram (page 76)
Fig. 46 · Caution

5 Basic Instruction

Page 77 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.7 MPS, MRD, MPP
Page 77 · click to enlarge
Page 77
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.7 MPS, MRD, MPP diagram (page 77)
Fig. 47
1. Program example 1 (One stack) Only one stack is used in this example.

Y004:= MPS(X006) AND X007; Y005:= MRD(TRUE) AND X010; Y006:= MRD(TRUE) AND X011; Y007:= MPP(TRUE) AND X012;

2. Program example 2 (One stack with AND (...) and OR (...) instructions)

Y000:= MPS(X000) AND (X001 OR X002); Y001:= MRD(TRUE) AND ((X003 AND X004) OR (X005 AND X006)); Y002:= MPP(TRUE) AND X007; Y003:= Y002 AND (X010 OR X011);

Page 78 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 4. Program example 4 (Four stacks)
Page 78 · click to enlarge
Page 78

5.7 MPS, MRD, MPP

3. Program example 3 (Two stacks)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.7 MPS, MRD, MPP diagram (page 78)
Fig. 48

Y000:= (MPS(X000) AND MPS(X001)) AND X002; Y001:= MPP(TRUE) AND X003; Y002:= (MPP(TRUE) AND MPS(X004)) AND X005; Y003:= MPP(TRUE) AND X006;

4. Program example 4 (Four stacks)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 4. Program example 4 (Four stacks) diagram (page 78)
Fig. 49 · 4. Program example 4 (Four stacks)

Y000:= (((MPS(X000) AND MPS(X001)) AND MPS(X002)) AND MPS(X003)) AND X004; Y001:= MPP(TRUE); Y002:= MPP(TRUE); Y003:= MPP(TRUE); Y004:= MPP(TRUE);

Y004:= X000; Y003:= Y004 AND X001; Y002:= Y003 AND X002; Y001:= Y002 AND X003; Y000:= Y001 AND X004;

In programming a circuit on the upper side, it is necessary to use MPS instruction three times. By changing the circuit on the upper side into the circuit on the lower side, the same contents can be programmed easily without MPS instruction.

5 Basic Instruction

Page 79 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000:= INV(X000)
Page 79 · click to enlarge
Page 79

5.8 INV

5.8 INV

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

INV instruction inverts the operation result up to just before INV instruction.

1. Format and operation, execution form

Expression in each language

INV EN ENO

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

How to Read Explanation of Instructions

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

INV There are no applicable devices.

Function and operation explanation

1. INV(inverts the result of operations)

ON

Y000 X000

OFF

OFF

INV EN ENO

Applied Instructions (Program Flow)

ON OFF

ON

Y000

[ ST ]

Operation result until just

Operation result after INV

Y000:= INV(X000)

OFF ON

ON OFF

Applied Instructions (Move and Compare)

In the figure above, Y000 turns ON when X000 is OFF, and Y000 turns OFF when X000 is ON. INV instruction can be used in a same position as serial contact instructions (AND, ANI, ANDP and ANDF). Different from LD, LDI, LDP and LDF instructions shown in the list, INV instruction cannot execute connection to bus lines. Different from OR, ORI, ORP and ORF instructions, INV instruction cannot be used independently in parallel to a contact instruction.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 20 more labels / short text on this page
5 Basic Instruction · Instruction List · Instruction · Execution · name · form · Configuration of Instruction · INV Continuous INV(EN); · Basic Instruction · Special · Character · String Pointer · Instruction · User · Step Ladder Instructions · [Structured ladder/FBD] · Timing chart · before INV instruction · instruction is executed · Inverted
Page 80 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.8 INV
Page 80 · click to enlarge
Page 80

5.8 INV

2. Operation range of INV instruction When INV instruction is used in a complicated circuit containing ORB and ANB instructions, the operation range of INV instruction is as shown in the figure below:
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.8 INV diagram (page 80)
Fig. 50

INV instruction inverts the operation result after LD, LDI, LDP or LDF instruction located before INV instruction. Accordingly, if INV instructions are used inside ORB and ANB instructions, blocks after LD, LDI, LDP or LDF instruction seen from each INV instruction are regarded as the target of INV operation.

5 Basic Instruction

Page 81 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — MEP
Page 81 · click to enlarge
Page 81

5.9 MEP, MEF

5.9 MEP, MEF

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

MEP and MEF commands are instructions that change the operation results to pulses so that device numbers do not have to be specified.

1. MEP The operation results up to the MEP instruction become conductive when the driving contacts turn ON from OFF. The use of MEP instructions simplifies the process of changing driving contacts to pulses when multiple contact points connect in a series.
2. MEF The operation results up to the MEF instruction become conductive when the driving contacts turn OFF from ON. The use of MEF instructions simplifies the process of changing driving contacts to pulses when multiple contact points connect in a series.

How to Read Explanation of Instructions

1. Format and operation, execution form

Expression in each language

MEP EN ENO

MEF EN ENO

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

Output variable ENO Execution state Bit

3. Applicable devices

Applied Instructions (Program Flow)

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

MEP

There are no applicable devices.s MEF

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 16 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Instruction · Execution · name · form · MEP Pulse MEP(EN); · Basic Instruction · MEF Pulse MEF(EN); · Step Ladder Instructions · Special · Character · Instruction · User · String Pointer
Page 82 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.9 MEP, MEF
Page 82 · click to enlarge
Page 82

5.9 MEP, MEF

Function and operation explanation

1. MEP(ON during rising edge of driving contacts results)

X000 X001 MEP EN ENO

SET EN ENO

ON X000

OFF

M0

ON X001 OFF

[ ST ]

SET(MEP(X000 AND X001),M0);

ON M0 OFF

2. MEF(ON during falling edge of driving contacts results)

X000 X001 MEF EN ENO

SET EN ENO

ON X000

OFF

OFF

OFF M0

ON X001 OFF

[ ST ]

SET(MEF(X000 AND X001),M0);

ON M0 OFF

Cautions

1. MEP and MEF instructions are provided in the FX 3U and FX3 UC PLCs Ver. 2.30 or later.
2. MEP and MEF instructions may not operate normally if the indexed contact is modified and changed to pulses by sub-routine programs, the FOR and NEXT instructions, etc.
3. As the MEP and MEF instructions operate using the operation results immediately before them, use at the list program as the AND instruction. The MEP and MEF instructions cannot be used at the list program as LD or OR.
4. Caution on writing during RUN a) Pulse command during rising edge of operation (MEP instruction) results

After writing to the circuit with MEP instructions during RUN, the MEP instruction result turns ON (conductive) while the operation results up to the MEP instruction are ON. b) Pulse instruction during falling edge of operation (MEF command) results

After writing to the circuit with MEF instructions during RUN , the MEF instruction result turns OFF (nonconductive), regardless of the operation results up to the MEF instruction. The operation results of MEF instruction turns ON (conductive) when the operation results up to the MEF instruction turn OFF.

Operation Results up to MEP/MEF Instruction

(while writing is excuted during RUN) MEP MEF

OFF OFF (non-conductive) OFF (non-conductive)

ON ON (conductive) OFF (non-conductive)

Show 5 more labels / short text on this page
5 Basic Instruction · [Structured ladder/FBD] · Timing chart · [Structured ladder/FBD] · Timing chart
Page 83 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 83 · click to enlarge
Page 83

5.10 SET, RST

5.10 SET, RST

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

1. Setting a bit device (SET instruction [holding operation]) When the command input turns ON, SET instruction sets to ON an output relay (Y), auxiliary relay (M), state relay (S) and bit specification of word device. Even if the command input turns OFF after that, the device which was set to ON by SET instruction remains ON.
2. Resetting a bit device (RST instruction [resetting folding operation]) RST instruction resets an output relay (Y), auxiliary relay (M), state relay (S), timer (T), counter (C) or bit specification of a word device. Use the RST instruction to reset (reset to OFF) a device which was set to ON by SET instruction.

3) Clearing the current value of a word device (RST instruction [Clearing current value and resister]) RST instruction clears the current value data of a timer (T), counter (C), data register (D), extension register or (R)index register (V) (Z). (The same result can be obtained by MOV instruction which transfers the constant K0.) RST instruction can be used also to reset the current value and return the contact of retentive type timers. SET and RST instructions can be used for a same device as many times as necessary in an arbitrary order.

How to Read Explanation of Instructions

1. Format and operation, execution form

Expression in each language

SET EN ENO

ExampleSET(X000,Y000);

X000 *1

Y000

S

RST EN ENO

ExampleRST(X001,Y000);

Applied Instructions (Program Flow)

Y000

R

*1. This symbol is applicable to the bit type data only.

2. Set data

Applied Instructions (Move and Compare)

Variable Description Data type

Input variable EN Execution condition Bit

ENO Execution state Bit

Applicable device or variable SET Bit RST ANY_SIMPLE

3. Applicable devices

Applied Instructions (Arithmetic and Logical Operation)

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

SET z z z S1 S3

Applied Instructions (Rotation and Shift Operation)

RST z S1 z z z S2 z z S3

S: Refer to "Cautions".

Show 24 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Instruction · Execution · name · form · Basic Instruction · d Y000 · SET(EN,d); · SET Continuous · Or · Step Ladder Instructions · d Y000 · RST(EN,d); · RST Continuous · Or · *1 · Output variable · Special · Character · Instruction · String Pointer · User
Page 84 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ON
Page 84 · click to enlarge
Page 84

5.10 SET, RST

Function and operation explanation

SET instruction drives the coil for an output relay (Y), auxiliary relay (M), state relay (S) and bit specification of data register (D).

1. When using a bit device SET instructions located in parallel can be used consecutively as many times as necessary. In the program example shown below, RST (X1001, Y000) after SET (X000, Y000) corresponds to this usage.

[Structured ladder/FBD] [ ST ] timing chart

ON

SET EN ENO

SET(X000,Y000); RST(X001,Y000);

ON

RST EN ENO

Y000

ON

Show 5 more labels / short text on this page
5 Basic Instruction · d Y000 · d Y000 · SET instruction · RST instruction
Page 85 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RST EN ENO
Page 85 · click to enlarge
Page 85

5.10 SET, RST

2. When using word device (timer or counter) Use RST instruction to reset a counter or retentive type timer.
1. Program example of an internal counter

C0 up-counts the number of turning ON from OFF at X011. When the counting result reaches the set value K10, the output contact C0 is activated. Even if X011 changes from OFF to ON after that, the current value of the counter remains unchanged and the output contact remains activated. For clearing the counter and returning the output contact, X010 is set to ON.

RST EN ENO

OUT_C EN ENO CC0

In case of latched (battery backed) type counters, the current value and the operation status and reset status of the output contact are latched even after power failure.

CS0

Y003

2. Program example of a high speed counter

For one-phase one-input counters, use special auxiliary relays for specifying the counting direction. X010 in ON status: specifies down counting. X010 in OFF status: Specifies up counting When X011 turns ON, the output contact of the counter CUUU is returned and the current value of the counter is reset to "0". In counters with reset input, the same situation is achieved by interrupt operation when the corresponding reset input turns ON, but any program is not required for this operation. When X012 turns ON, turning ON/OFF of a counting input X000 to X005 determined according to the counter number is counted. In counters having start input, counting is started only after the corresponding start input turns ON. When the current value of a counter increases and reaches the set value (K or contents of D), the output contact is set. When the current value decreases and reaches the set value, the output contact is reset.

X010 M8

How to Read Explanation of Instructions

RST EN ENO

X012 CC

CS Y002

As a contact driving the counting coil of a high speed counter, program a contact which is normally ON when high speed counting is executed. If an input relay (X000 to X005) assigned for high speed counters is used for driving the counting coil, accurate counting cannot be achieved.

Applied Instructions (Program Flow)

3. Caution on using RST instruction for a jumped program, subroutine program or interrupt program When RST instruction for a timer or counter is executed in a jumped program, subroutine program or interrupt program, the timer or counter may be kept in the reset status and the timer or counter may be disabled. For details, refer to the following sections.

Applied Instructions (Move and Compare)

→ For a jumped program, refer to section 7.1. → For a subroutine program, refer to section 7.2.

→ For an interrupt program, refer to section 7.3.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 12 more labels / short text on this page
5 Basic Instruction · d CN0 · Instruction List · CCoil CValue K10 · Configuration of Instruction · Counting direction · Sequence reset circuit · d CN · Counting coil · Basic Instruction · K or D · Step Ladder Instructions
Page 86 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 86 · click to enlarge
Page 86

5.10 SET, RST

3. Indexing Devices used in SET and RST instructions can be indexed with index registers (V, Z). (State relays (S), special auxiliary relays (M), 32-bit counters, "D .b" and word devices cannot be indexed.) This is applicable only to the FX 3U and FX 3UC PLCs.

When a used device is an input (X) or output (Y), the value of an index register (V, Z) is converted into octal, and then added. Example: When Z0 is "20", Y024 turns ON or

SET EN ENO

SET(X000,Y000Z0); RST(X001,Y000Z0);

OFF.

RST EN ENO

Y000Z0

4. Bit specification of a data register (D) A bit data register (D) can be specified as a device used in SET or RST instruction. This is applicable only to the FX 3U and FX 3UC PLCs.

When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data registers are available. Specify a bit number as "0, 1,2, ..., 9, A, B, ..., F" from the least significant bit. Example: In the example shown on the left,

SET EN ENO

SET(X000,D0.3); RST(X001,D0.3);

d D0.3

RST EN ENO

when X000 turns ON once, the bit 3 of D0 turns ON. When X001 turns ON, the bit 3 of D0 turns OFF.

d D0.3

Cautions

1. Some restrictions to applicable devices S 1: FX 3U and FX 3UC PLCs only are applicable. S 2: FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: Only the FX 3U and FX 3UC PLCs are capable of indexing applicable devices.

The following devices cannot be indexed.

  • Special auxiliary relays (M)
  • 32-bit counters (C)
  • State (S)
  • Word device
  • Word bit specification "D .b"
2. When SET and RST instructions are executed for an output relay (Y) in a same operation, the result of the instruction located nearest the END instruction (which specifies the end of program) is output.
3. When using the retentive type timers of the FX 1N , FX 1NC , FX 2N and FX 2NC , be sure to create a program where the RST instruction resets the retentive type timers to be used. If no such a reset circuit by RST is present in the program, the timers remain in the state of reset, possibly causing the timers not to operate.

Error

1. When an I/O number used in SET or RST instruction does not exist due to indexing, M8316 (non-existing I/O specification error) turns ON. (Applicable only to the FX 3U and FX 3UC PLCs.)
2. When the device number of a device (M, T or C) other than I/O used in SET or RST instruction does not exist due to indexing, an operation error (error code: 6706) occurs. (Applicable only to the FX 3U and FX 3UC PLCs.)

5 Basic Instruction · d Y000Z0

Page 87 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ON
Page 87 · click to enlarge
Page 87

5.11 PLS, PLF

5.11 PLS, PLF

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

When PLS instruction is executed, an applicable device is activated during only one operation cycle after a drive input turns ON. When PLF instruction is executed, an applicable device is activated during only one operation cycle after a drive input turns OFF. For example, when PLC mode is changed in the way "RUN → STOP → RUN while a drive input remains ON, "PLS(**, M0) operates, but "PLS (**, M600) (backed up by the battery)" does not operate (when the PLC mode switches from STOP to RUN) because the status of M600 is latched even while the PLC is in the STOP mode.

1. Format and operation, execution form

Expression in each language

PLS EN ENO

How to Read Explanation of Instructions

PLF EN ENO

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

ENO Execution state Bit

Applicable device or variable Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Program Flow)

PLS z S1 S2

PLF z S1 S2

S: Refer to "Cautions".

Function and operation explanation

Applied Instructions (Move and Compare)

1. PLS (rising edge differential output)

[Structured ladder/FBD] [ ST ] timing chart

PLS(X000, M0); X000

ON

X000 PLS EN ENO

ON during one operation cycle

M 0 PLS instruction

Applied Instructions (Arithmetic and Logical Operation)

In the figure above, M0 is ON during only one operation cycle when X000 changes from OFF to ON.

2. PLF (falling edge differential output)

ON

PLF(X000, M1); X000 PLF EN ENO

Applied Instructions (Rotation and Shift Operation)

ON during one operation cycle

M 1 PLF instruction

In the figure above, M1 is ON during only one operation cycle when X000 changes from ON to OFF.

Show 20 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Instruction · Execution · name · form · PLS Pulse PLS(EN,d); · PLF Pulse PLF(EN,d); · Basic Instruction · Output variable · Step Ladder Instructions · Special · Character · Instruction · User · String Pointer · d M0 · timing chart · d M1
Page 88 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 88 · click to enlarge
Page 88

5.11 PLS, PLF

3. Output drive side The following two circuits cause a same operation.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.11 PLS, PLF diagram (page 88)
Fig. 51

In each case, M0 is ON during only one operation cycle when X000 changes from OFF to ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.11 PLS, PLF diagram (page 88)
Fig. 52

In each case, MOV instruction is executed only once when X000 changes from OFF to ON.

Cautions

1) When write during RUN is completed for a circuit including an instruction for falling edge pulse (LDF, ANDF or ORF instruction), the instruction is not executed without regard to the ON/OFF status of the target device of the instruction for falling edge pulse. When write during RUN is completed for a circuit including an instruction for falling edge pulse (PLF instruction), the instruction is not executed without regard to the ON/OFF status of the operation condition device. It is necessary to set to ON the target device or operation condition device once and then set it to OFF for executing the instruction for falling edge pulse.

2. When write during RUN is completed for a circuit including an instruction for rising edge pulse, the instruction is executed if a target device of the instruction for rising edge pulse or the operation condition device is ON. Target instructions for rising edge pulse: LDP, ANDP, ORP, and pulse operation type applied instructions (such as MOVP)
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 88)
Fig. 53 · Cautions

Instruction for rising edge pulse Instruction for falling edge pulse

*1. PLS instruction is not executed.

3. Some restrictions to applicable devices S 1: Excluding special auxiliary relays (M) S 2: Only the FX 3U and FX 3UC PLCs are capable of indexing applicable devices.

The following devices cannot be indexed.

  • Special auxiliary relays (M)

5 Basic Instruction

Page 89 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.12 MC, MCR
Page 89 · click to enlarge
Page 89
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.12 MC, MCR diagram (page 89)
Fig. 54

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

When MC instruction is executed, instructions from MC to MCR are executed. Thereby, efficient ladder switching sequence programs can be created.

Nesting level (0 to 7) When adopting a nesting structure, use it in order of 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7. If not adopting a nesting structure, it is always "0".

Device number to be turned ON when executing the MC instruction. Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 90 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 90 · click to enlarge
Page 90

5.12 MC, MCR

Function and operation explanation

When MC instruction is executed, instructions from MC to MCR are executed. When MC instruction is not executed, the operation with the contact OFF is executed. In the program example below, the instructions from MC to MCR are executed as they are while the input X000 is ON. However, while the input X000 is OFF, each drive device offers the following operation.

Timers (except retentive type timers) and devices driven by OUT instruction: Turn OFF Retentive type timers, counters and devices driven by SET/RST instruction : Hold the current status.

MC EN ENO

0 M100

Y000

Y001

MCR EN ENO n

[ ST ]

MC(X000,0,M100); Y000:= X001; Y001:= X002; MCR(TRUE,0);

Caution

1. Some restrictions to applicable devices S 1: Excluding special auxiliary relays (M)
2. Use MC instruction and MCR instruction at a same nesting level as a pair.
3. Do not attach a contact before MCR instruction. (Always make MCR instruction "TRUE".)
4. When not adopting the nesting structure Use the nesting level "0" for creating a program. MC instruction can use the same nesting level "0" as many times as needed by changing the device (Y or M) number specified by .
5. When adopting the nesting structure Increase the nesting level in the way "0 → 1 → ... → 6 → 7".

→ Refer to a program example for the details.

6. The device specified by remains ON while MC instruction is executed. If the same device number is used in another instruction, it results in the double coil operation in the same way as OUT instruction.

5 Basic Instruction · [Structured ladder/FBD] · d n

Page 91 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.12 MC, MCR
Page 91 · click to enlarge
Page 91
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.12 MC, MCR diagram (page 91)
Fig. 55

When not adopting the nesting structure, use nesting level "0" again to program. There is no limitation in the number of nesting level "0". Only in the nesting structure, increase the nesting level 0 1 ... 6 7 as shown in the example 2 on the next page.

MC(X000,0,M100); Y000:= X001; Y001:= X002; MCR(TRUE,0); MC(X003,0,M150); Y002:= X004; Y003:= X005; MCR(TRUE,0);

Page 92 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.12 MC, MCR
Page 92 · click to enlarge
Page 92

5.12 MC, MCR

2. When the nesting structure is adopted. When using MC instructions inside MC instruction, increase the nesting level "N" in turn in the way "N0 → N1 → N2 → N3 → N4 → N5 → N6 → N7". For returning from the nesting structure, reset the nesting levels from the highest one in turn using MCR instruction in the way "N7 → N6 → N5 → N4 → N3 → N2 → N1 → N0". For example, if "MCR N5" is programmed without programming "MCR N6" and "MCR N7", the nesting level is returned to 5 at one time. Available nesting levels are from N0 to N7 (eight layers).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5.12 MC, MCR diagram (page 92)
Fig. 56

Not related to the status of X000, X002 and X004.

5 Basic Instruction

Page 93 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5.14 NOP (for simple project only)
Page 93 · click to enlarge
Page 93

5.13 END

5.13 END

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

END instruction specifies the end of a program. (Do not write the END instruction in the middle of a program.) END instruction for ending a program and input/output processing and returning to 0 step is automatically written at the end of the program. It cannot be programmed into program structural elements (POU).

Function and operation explanation

PLCs repeat "input processing → program execution → output processing". When END instruction is written at the end of a program, PLCs immediately execute the output processing without executing steps after END instruction. If END instruction is not written at the end of a program, PLCs execute the program until the final step, and then execute the output processing. At the first execution after the PLC mode was changed from STOP to RUN, PLCs start from END instruction. When END instruction is executed, the watchdog timer (which checks to see if the operation cycle is too long) is refreshed.

How to Read Explanation of Instructions

Step000 001 002

LD X000

OUT Y000 END NOP NOP

NOP

Cautions

Do not write END instruction in the middle of a program.

Applied Instructions (Program Flow)

5.14 NOP (for simple project only)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (Move and Compare)

This instruction is available for use only in the simple project. It cannot be programmed in the structured project.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
5 Basic Instruction · Instruction List · Configuration of Instruction · Input processing · Basic Instruction · Step Ladder Instructions · Output processing
Page 94 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6.1.2 Function and operation explanation
Page 94 · click to enlarge
Page 94

6 Step Ladder Instructions

6.1 Step Ladder

6. Step Ladder Instructions

6.1 Step Ladder

This chapter introduces the instructions of structured project that correspond to the MELSEC-LD step ladder instructions.

In programs using step ladder instructions, a state relay S is assigned to each process based on machine operations, and input condition and output control are programmed as sequences connected to the state output.

6.1.2 Function and operation explanation

In step ladder program, a state S is regarded as one control process, and a sequence of input condition and output control are programmed in a state relay. Because the preceding process is not performed any more when the program execution proceeds to the next process, a machine can be controlled using simple sequences for each process.

1. Operation of instruction In a step ladder program, each process performed by the machine is expressed by a state relay. A state relay consists of a drive coil and contact (STL output) in the same way as other relays. Use SET or OUT instruction to drive a coil, and use STL instruction for a contact.
  • When a state relay turns ON, a connected circuit (internal circuit) is activated by way of an STL output. When a state relay turns OFF, a connected internal circuit is deactivated by way of an STL output. After one operation cycle, non-driving of an instruction (jump status) is not available.
  • When a condition (transfer condition) provided between state relays is satisfied, the next state relay turns ON, and the state relay which has been ON so far turns OFF (transfer operation). In the state relay transfer process, the both state relays are ON only instantaneously (during one operation cycle). In the next operation cycle after the ON status was transferred the former state is reset to OFF. When the transfer state relay S is used in a contact instruction, however, the contact image is executed in the OFF status immediately after the transfer condition is satisfied.
  • One state relay number can be used only once.
Page 95 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — LD/LDI/LDP/LDF AND/ANI/ANDP/ANDF, OR/ORI/ORP/ORF, OUT,
Page 95 · click to enlarge
Page 95

6 Step Ladder Instructions

6.1 Step Ladder

STL EN ENO s

*1 Y030

S31

SET EN ENO

When X001 turns ON, S32 turns ON and S31 is automatically reset.

SET EN ENO

STL EN ENO s

Y030

S32

Y032

SET EN ENO

How to Read Explanation of Instructions

STL EN ENO s

Y030

S31

SET EN ENO

Y31 programmed in SET instruction remains ON even if S31 is reset.

SET EN ENO

STL EN ENO s

Y030

S32

Y032

SET EN ENO

Applied Instructions (Program Flow)

*1. Output coils can be used again in different state relays.

2. Primary knowledge for creating programs

  • List of sequence instructions available between STL instruction and RET instruction

Applied Instructions (Move and Compare)

LD/LDI/LDP/LDF AND/ANI/ANDP/ANDF, OR/ORI/ORP/ORF, OUT,

ANB/ORB/MPS/MRD/

MPP MC/MCR

SET/RST, PLS/PLF

Initial/general state relay Available Available*1 Not available

Drive processing Available Available*1 Not available

Applied Instructions (Arithmetic and Logical Operation)

Transfer processing Available Not available Not available

- STL instruction cannot be used in interrupt program and subroutine programs. - It is not prohibited to use jump instructions in state relays. But it is not recommended to use jump instructions because complicated movements will be resulted.

Applied Instructions (Rotation and Shift Operation)

*1. MPS instruction cannot be used immediately after an STL instruction, even in a drive processing circuit.

Show 17 more labels / short text on this page
Process of S31 · d Y31 · Instruction List · d S32 · *1 · Configuration of Instruction · Process of S32 · d S33 · d Y31 · Basic Instruction · d S32 · Step Ladder Instructions · Activated · d S33 · Instruction · State relay · Branch/recombination state relay
Page 96 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RET EN ENO
Page 96 · click to enlarge
Page 96

6 Step Ladder Instructions

6.1 Step Ladder

  • Special auxiliary relays For efficiently creating step ladder programs, it is necessary to use some special auxiliary relays. The table below shows major ones.

Device number Name Function and application

This relay is normally ON while the PLC is in the RUN mode. Use this relay as the program input condition requiring the normally driven status or for indicating the PLC operation status.

This relay turns ON and remains ON only instantaneously (during one operation cycle) when the PLC mode is changed from STOP to RUN. Use this relay for the initial setting of a program or for setting the initial state relay.

When this relay is set to ON, transfer of the ON status is disabled among all state relays. Because programs in state relays are operating even in the transfer disabled status, output coils do not turn OFF automatically.

M8040 STL transfer disable

Use this relay to prevent simultaneous startup of another flow or as a process ON/OFF flag. When M8047 is OFF, M8046 is normally OFF. When M8047 is ON, M8046 operates as follows: FX3S PLC When at least one among the state relays S0 to S255 is ON: ON When all of the state relays S0 to S255 are OFF: OFF FX3G/FX3GC/FX3U/FX3UC PLCs When at least one among the state relays S0 to S899 and S1000 to S4095 is ON: ON When all of the state relays S0 to S899 and S1000 to S4095 are OFF: OFF

M8046*1 STL state ON

When this relay is driven, the device number of a state relay in the ON status having the smallest device number among S0 to S255 (FX3S PLC), S0 to S899 and S1000 to S4095 (FX3G/FX3GC/FX3U/FX3UC PLCs) is stored to D8040, and the state relay number in the ON status having the next smallest device number is stored to D8041. In this way, up to eight state relays in the ON status are stored in registers up to D8047.

M8047*1 Enable STL monitoring

*1. Processed when END instruction is executed.

  • Block When there are relay ladder blocks and step ladder blocks, put RET instruction at the end of each step ladder program. A PLC starts the step ladder processing by STL instruction, and returns to the relay ladder processing from the step ladder processing by RET instruction. However, when consecutively programming a step ladder in a different flow (when there is no relay ladder before the step ladder in the different flow), RET instruction between flows can be omitted, and RET instruction can be programmed only at the end of the last flow.

SET EN ENO

M8002

SET EN ENO

STL EN ENO s

Y000

Step ladder is started by STL instruction.

S0

SET EN ENO

STL EN ENO s X001 S0

Y001

It can be omitted.

S20

Step ladder is finished by RET instruction

RET EN ENO

STL EN ENO s

Y001

Step ladder is started by STL instruction.

S1

SET EN ENO

STL EN ENO s X003 S1

Y003

S30

Step ladder is finished by RET instruction

RET EN ENO

Show 10 more labels / short text on this page
M8000 RUN monitor · M8002 Initial pulse · Initial pulse · d S0 · Relay ladder · d S1 · d S20 · Step ladder · d S30 · Step ladder
Page 97 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SET EN ENO
Page 97 · click to enlarge
Page 97

6 Step Ladder Instructions

6.1 Step Ladder

  • Output driving method It is required to include a LD or LDI instruction before the last OUT instruction in a state relay. Change such a circuit as shown below.

STL EN ENO s Y002

Y001

S20

Y003

STL EN ENO s Y003

Y001

STL EN ENO s Y002

Y001

S20

S20

Y002 X005

M8000

Y003

Move the position.

How to Read Explanation of Instructions

Insert "always ON" contact.

  • State relay transfer method Each OUT and SET instruction in state relays automatically resets the transfer source, and has the selfholding function. OUT instructions can be used only for transfer to a separate state relay in an SFC program.

STL EN ENO s SET EN ENO

S41

Transfer to the next state relay (SET instruction)

S50

Transfer to a separate state relay (OUT instruction)

3. Program with state relays in branches and recombination

  • Example of selective branch Do not use MPS, MRD, MPP, AND ( … ) and OR ( … ) instructions in a transfer processing program with branches and recombination. Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions. In the same way as programs for general state relays, program the drive processing first, and then program the transfer processing. Continuously program all transfer processing.

Applied Instructions (Program Flow)

STL EN ENO s

Y000

Applied Instructions (Move and Compare)

S20

SET EN ENO

Transfer processing SET EN ENO

Applied Instructions (Arithmetic and Logical Operation)

SET EN ENO

Applied Instructions (Rotation and Shift Operation)

Show 14 more labels / short text on this page
Instruction List · Change · Change · Configuration of Instruction · Or · RUN monitor · Basic Instruction · Transfer condition · d S42 · Step Ladder Instructions · Drive processing · d S21 · d S31 · d S41
Page 98 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6. Step Ladder Instructions
Page 98 · click to enlarge
Page 98

6 Step Ladder Instructions

6.1 Step Ladder

  • Example of selective recombination Do not use MPS, MRD, MPP, AND ( … ) and OR ( … ) instructions in a transfer processing program with branches and recombination. Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions. Pay attention to the programming order so that a branch line does not cross a recombination line.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Step Ladder Instructions diagram (page 98)
Fig. 57 · 6. Step Ladder Instructions

Before recombination, program the drive processing of state relays first. After that, program only the transfer processing to recombination state relays continuously. This rule should be observed to enable inverse conversion into an SFC program.

  • Example of parallel branch Do not use MPS, MRD, MPP, AND ( … ) and OR ( … ) instructions in a transfer processing program with branches and recombination. Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions. In the same way as programs for general state relays, program the drive processing first, and then program the transfer processing. Continuously program all transfer processing.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Step Ladder Instructions diagram (page 98)
Fig. 58 · 6. Step Ladder Instructions
Page 99 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SET EN ENO
Page 99 · click to enlarge
Page 99

6 Step Ladder Instructions

6.1 Step Ladder

  • Example of parallel recombination Do not use MPS, MRD, MPP, AND ( … ) and OR ( … ) instructions in a transfer processing program with branches and recombination. Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions. Pay attention to the programming order so that a branch line does not cross a recombination line.

STL EN ENO s

Y010

S29

STL EN ENO s

Y011

S39

STL EN ENO s

Y012

S49

STL EN ENO s

S29

How to Read Explanation of Instructions

STL EN ENO s

S39

STL EN ENO s

S49

X010 X011 X012

SET EN ENO

Before recombination, program the drive processing of state relays first. After that, program only the transfer processing to recombination state relays continuously.

  • Composition of branches and recombination When a recombination line is directly connected to a branch line (not by way of a state relay as shown below), it is recommended to provide a dummy state relay between the lines. Create step ladder programs as shown below.
1. Selective recombination and selective branch

Applied Instructions (Program Flow)

STL EN ENO s

SET EN ENO

S20

STL EN ENO s

SET EN ENO

Applied Instructions (Move and Compare)

S30

STL EN ENO s

SET EN ENO

S100

SET EN ENO

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 11 more labels / short text on this page
Instruction List · Drive processing · Configuration of Instruction · Transfer processing · Basic Instruction · d S50 · Step Ladder Instructions · d S100 · d S100 · d S50 · d S60
Page 100 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6. Step Ladder Instructions
Page 100 · click to enlarge
Page 100

6 Step Ladder Instructions

6.1 Step Ladder

2. Parallel recombination and parallel branch
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Step Ladder Instructions diagram (page 100)
Fig. 59 · 6. Step Ladder Instructions
3. Selective recombination and parallel branch
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Step Ladder Instructions diagram (page 100)
Fig. 60 · 6. Step Ladder Instructions
4. Parallel recombination and selective branch
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Step Ladder Instructions diagram (page 100)
Fig. 61 · 6. Step Ladder Instructions
Page 101 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6.1.3 Program examples
Page 101 · click to enlarge
Page 101
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6.1.3 Program examples diagram (page 101)
Fig. 62 · 6.1.3 Program examples
  • When the PLC mode is changed from STOP to RUN, the state relay S3 is driven by the initial pulse (M8002).
  • The state relay S3 outputs Y000. One second later, the ON status transfers to the state relay S20.
  • The state relay S20 outputs Y001. 1.5 seconds later, the ON status returns to the state relay S3.
Page 102 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 102 · click to enlarge
Page 102

6 Step Ladder Instructions

6.2 STL

6.2 STL

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

In programs using step ladder instructions, a state relay State S is assigned to each process based on machine operations, and input condition and output control are programmed as sequences connected to the state output.

STL instruction for step ladder programs is expressed as follows in each language.

1. Format and operation, execution form

Expression in each language

STL 16 bits Continuous STL(EN,s);

2. Set data

Variable Description Data type

Input variable EN Execution condition Always TRUE

Target device or variable Bit

ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

4. Caution Refer to the cautions in the items below for expressing step ladders in a structured project (Structured ladder/ FBD, ST).

→ Section 6.3 RET

Show 12 more labels / short text on this page
Instruction · name Operation Execution · form · STL EN s · Output variable · Operand · Special · Character · String Pointer · type · User · z
Page 103 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6.3 RET
Page 103 · click to enlarge
Page 103
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6.3 RET diagram (page 103)
Fig. 63

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

RET instruction for step ladder programs is expressed as follows in each language.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 104 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2) ST
Page 104 · click to enlarge
Page 104

6 Step Ladder Instructions

6.3 RET

4. Caution The following examples show how MELSEC-LD step ladders are expressed in the structured programs.

Reference: MELSEC-LD step ladder expression

1. When expressing step ladder (STL) instructions in the coil format. (Same as that for GX Developer)
2. When expressing step ladder (STL) instructions in the contact format.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Reference: MELSEC-LD step ladder expression diagram (page 104)
Fig. 64 · Reference: MELSEC-LD step ladder expression
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Reference: MELSEC-LD step ladder expression diagram (page 104)
Fig. 65 · Reference: MELSEC-LD step ladder expression

Expressing step ladder in structured program

1. Structured ladder/FBD
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Reference: MELSEC-LD step ladder expression diagram (page 104)
Fig. 66 · Reference: MELSEC-LD step ladder expression

2) ST

SET(M8002, S0); STL(TRUE, S0);

Y000:=TRUE; SET(X000, S20); STL(TRUE, S20);

S0:=X001; RET(TRUE);

Page 105 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CALL
Page 105 · click to enlarge
Page 105

7 Applied Instructions (Program Flow)

7. Applied Instructions (Program Flow)

This chapter introduces the instructions mainly related to control flow of sequence programs such as conditional program execution and priority processing.

Instruction name Function Reference

CJ

Conditional Jump Section 7.1 CJP

CALL

Call Subroutine Section 7.2 CALLP

SRET Subroutine Return Section 7.3

IRET Interrupt Return Section 7.4

DI Disable Interrupt Section 7.5

EI Enable Interrupt Section 7.6

FEND Main Routine Program End Section 7.7

WDT Watchdog Timer Refresh Section 7.8

How to Read Explanation of Instructions

FOR Start a FOR/NEXT Loop Section 7.9

NEXT End a FOR/NEXT Loop Section 7.10

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 4 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 106 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 106 · click to enlarge
Page 106

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

7.1 CJ / Conditional Jump

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

CJ or CJP instruction jumps to the specified pointer number or ladder block label. The sequence program steps between CJ or CJP instruction and the pointer are not executed.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 106)
Fig. 67 · 1. Format and operation, execution form

CJ 16 bits Continuous Syntax such as condition sentence is used. Refer to the following manual for syntaxes.

2. Input and output data types

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Input and output data types diagram (page 106)
Fig. 68 · 2. Input and output data types

Pointer number or ladder block label for the jump destination ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 106)
Fig. 69 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 107 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — P10:
Page 107 · click to enlarge
Page 107

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

Function and operation explanation

1. 16-bit operation(CJ, CJP) While the command input is ON, CJ or CJP instruction executes a program with a specified pointer number or ladder block label.
1. In the case of CJ instruction

CJ EN ENO p P10

ON

Jumps to the pointer while the command is ON.

CJ

Executed in every scan

User program Which is skipped and is not executed when the command turns ON.

P10:

How to Read Explanation of Instructions

2. In the case of CJP instruction

ON CJP EN ENO p P10

Jumps to the pointer only in one operation while the command is ON.

CJP

User program Which is skipped and is not executed in one operation

Executed in one scan

cycle when the command turns ON.

P10:

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.

Applied Instructions (Program Flow)

2. Set a pointer number or ladder block label for the jump destination in the ladder block header . Add ":" to the entered pointer number or ladder block label.

CJ EN ENO p

P20

Applied Instructions (Move and Compare)

Y010

Y011

P20:

3. A pointer number or ladder block label can be programmed in a smaller number step than CJ instruction. However, note that a watchdog timer error occurs when the scan time exceeds 200 ms (default setting).

Applied Instructions (Arithmetic and Logical Operation)

P10:

X022 CJ EN ENO p P10

Applied Instructions (Rotation and Shift Operation)

Show 12 more labels / short text on this page
Instruction List · User program · Command · Command input · Configuration of Instruction · User program · User program · Command · Command input · Basic Instruction · Step Ladder Instructions · User program
Page 108 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 7.1 CJ / Conditional Jump
Page 108 · click to enlarge
Page 108

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

4. When the pointer number or ladder block label specified by is same and there is one jump destination, the following operation is caused. When X020 turns ON, the program execution jumps from CJ instruction corresponding to X020 to the pointer P9. When X020 turns OFF and X021 turns ON, the program execution jumps from CJ instruction corresponding to X021 to the pointer P9.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.1 CJ / Conditional Jump diagram (page 108)
Fig. 70 · 7.1 CJ / Conditional Jump
5. When a pointer number or ladder block label (including pointer number or ladder block label for CALL instructions described later) is used two or more times, an error is caused.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.1 CJ / Conditional Jump diagram (page 108)
Fig. 71 · 7.1 CJ / Conditional Jump
6. The pointer P63 specifies jump to END step. The pointer P63 needs not to be programmed.
7. Any pointer number or ladder block label cannot be shared by CALL instruction and CJ instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.1 CJ / Conditional Jump diagram (page 108)
Fig. 72 · 7.1 CJ / Conditional Jump
Page 109 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — P7:
Page 109 · click to enlarge
Page 109

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

8. Because M8000 is normally ON while a PLC is operating, unconditional jump is specified when M8000 is used in the following example.

M8000

CJ EN ENO p P5

User program (It is skipped, and is not executed.)

P5:

9. The operation of the CJ instruction and contact coils are described later.
10. The relationships between the master control instructions and jump instructions are described later.
11. The jumping ranges of CJ instruction is different according to the pointer type specified by .

Pointer type Jumping range

Pointer number Pointer numbers within the same program file

Ladder block label Ladder block labels within the same POU

How to Read Explanation of Instructions

Program examples

In one operation cycle after X023 changes to ON from OFF, CJ P7 instruction becomes valid. By using this method, jump can be executed after all outputs between CJ P7 instruction and the pointer P7 turn OFF.

PLS EN ENO

M0

CJ EN ENO p P7

Applied Instructions (Program Flow)

P7:

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 8 more labels / short text on this page
RUN monitor · Instruction List · User program · Configuration of Instruction · Basic Instruction · d M0 · Step Ladder Instructions · User program
Page 110 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CN0
Page 110 · click to enlarge
Page 110

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

CJ instruction and operations of contact and coil

In the program example shown below, when X000 turns ON, the program execution jumps from CJ instruction in the first circuit to the pointer P8. While X000 is OFF, jump is executed. The program is sequentially executed from first step, and jumps from 11th circuit to the pointer P9. The jumped instruction is not executed.

1. Circuit example 1 for explain operations

CJ EN ENO p

  • Double coil operation of output Y001 While X000 is OFF, output Y001 is activated by X001. While X000 is ON, output Y001 is activated by X012. Even in a program divided by conditional jumps, if a same coil (Y000 in this case) is programmed two or more times within the jump area or outside the jump area, such a coil is handled as double coil.

P8

Y001

M1

X003 S1

  • When the reset (RST) instruction for the retentive type timer (T246) is located outside jump area: Even if the counting coil (T246) is jumped, reset (return of the contact and clearing of the current value) is valid.

OUT_T EN ENO TCoil TValue

TC0 K10

  • When the reset (RST) instruction for the counter (C0) is located outside the jump area: Even if the counting coil is jumped, reset (return of the contact and clearing of the current value) is valid.

RST EN ENO

TN246

  • Operation of the routine timers: A routine timer continues its operation even if it is jumped after the coil is driven, and the output contact is activated.

OUT_T EN ENO TCoil TValue TC246 K1000

X007 RST EN ENO

  • Operation of the high speed counters: A high speed counter continues its operation even if it is jumped after the coil is driven, and the output contact is activated.

OUT_C EN ENO CCoil CValue

When each input changes during jump in the program shown on the left, each coil executes the following operation:

K20

Classification Contact status before

Y, M, S (Y001, M1, S1)

X001, X002, X003 OFF Y001, M1, S1 OFF

X001, X002, X003 ON Y001, M1, S1 ON

P8:

X004 OFF Timer is not activated.

10 ms timer and 100 ms timer (T0)

Counting is paused (and is restarted after X000 turns OFF).

CJ EN ENO p P9

X004 ON

Timer is not activated. The deactivation status is reset when X013 turns ON.

X005 OFF X006 OFF

X012 Y001

1 ms timer (T246)

Counting is continued (and the contact is activated after X000 turns OFF).

X005 OFF X006 ON

P9:

RST EN ENO

X007 OFF X010 OFF

Countint is not activated. The deactivation status is reset when X013 turns ON.

TN246

X007 OFF X010 ON

Counting is paused (and is restarted after X000 turns OFF).

RST EN ENO

X011 OFF Instruction is not executed during jump. But MTR, HSCS, HSCR, HSZ, SPD, PLSY and PWM instructions continue their operations.

CN0

X011 ON

Show 10 more labels / short text on this page
1st circuit · d CN0 · Coil operation during · MOV EN s · jump · jump · d K3 D0 · 11th circuit · Counter (C0) · Instruction (MOV)
Page 111 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RST EN ENO
Page 111 · click to enlarge
Page 111

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

2. Circuit example 2 for explaining operations (when only an RST instruction for timer or counter is jumped)

When X011 turns ON while the RST instruction for the counter C0 is operating (X010 is ON), the program execution jumps past the RST instruction due to the CJ instruction. In this jump status, the counter C0 remains reset. Accordingly, the current value of C0 remains "0" even if X012 turns ON. To clear this reset status, it is necessary to turn OFF the RST instruction for counter C0. (Refer to the program shown below.)

OUT_C EN ENO CCoil CValue

K10

X011 CJ EN ENO p

P0

RST EN ENO

CN0

P0:

Timing chart

Jump operation by CJ instruction driven by X011

How to Read Explanation of Instructions

Because C0 remains reset, its current value remains unchanged even if X012 turns ON.

Current value of C0 1 2 3 Counter is reset.

ON

RST C0

Program example for activating a timer and counter even during a jump

OUT_C EN ENO CCoil CValue

K10

X011 CJ EN ENO p

Applied Instructions (Program Flow)

P0

RST EN ENO

CN0

P0:

Applied Instructions (Move and Compare)

M8000 Clears the reset status of counter C0 during jump

RST EN ENO

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 6 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Remains reset · Step Ladder Instructions · d CN0
Page 112 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Relationship between master control instruction and jump instruction
Page 112 · click to enlarge
Page 112

7 Applied Instructions (Program Flow)

7.1 CJ / Conditional Jump

Timing chart

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Timing chart diagram (page 112)
Fig. 73 · Timing chart

Current value of C0 1 2 3 Counter is reset.

In the same operating cycle as the reset, the reset status of counter C0 is cleared.

Relationship between master control instruction and jump instruction

The figure below shows the contents of operation and the relationship between the master control instruction. Avoid using 2), 4) and 5) because the operation will be complicated.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Relationship between master control instruction and jump instruction diagram (page 112)
Fig. 74 · Relationship between master control instruction and…
1. Jump from outside MC to outside MC is available arbitrarily.
2. Jump from outside MC to inside MC Jump is executed regardless of the MC operation. Even if M0 is OFF, M0 is regarded as ON after P1.
5. Jump from inside MC to inside other MC
3. Jump from inside MC to inside MC Jump is disabled while M0 is OFF.
4. Jump from inside MC to outside MC Jump is disabled while M0 is OFF. Jump is executed while M0 is ON, but MCR is invalid.

Jump is enabled while M1 is ON. In circuits after jump, M2 is regarded as ON regardless of the actual ON/OFF status of M2. And the first MCR is ignored.

Page 113 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 113 · click to enlarge
Page 113

7 Applied Instructions (Program Flow)

7.2 CALL / Call Subroutine

7.2 CALL / Call Subroutine

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction calls and executes a program which should be processed commonly in a sequence program. This instruction saves the number of program steps, and achieves efficient program design. For creating a subroutine program, FEND and SRET instructions are required. A similar processing is available by creating a function block and read it out from the program block. Refer to the following manual for creating function blocks.

→ GX Works2 Version 1 Operating Manual (Structured Project)

→ Q/L/F Structured Programming Manual (Fundamentals)

1. Format and operation, execution form

Expression in each language

CALL EN ENO p

How to Read Explanation of Instructions

CALL

Use a subroutine program by reading out the function block made of other program parts.

CALLP EN ENO p

2. Set data

Variable Description Data type

EN Execution condition Bit

Pointer number or ladder block label of subroutine program to be executed. ANY16

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 20 more labels / short text on this page
Instruction List · Configuration of Instruction · Instruction · name Operation Execution · form · Continuous · 16 bits · CALLP Pulse · Basic Instruction · Input variable · p · Step Ladder Instructions · Operand · Special · Character · User · String Pointer · type · p · z z
Page 114 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 114 · click to enlarge
Page 114

7 Applied Instructions (Program Flow)

7.2 CALL / Call Subroutine

Function and operation explanation

1. 16-bit operation While the command input is ON, CALL instruction is executed and the program execution jumps to a step with a specified pointer number or ladder block label. Then, the corresponding subroutine program is executed. When SRET instruction is executed, the program execution returns to the step after CALL instruction.
  • At the end of the main program, put FEND instruction.
  • Put a pointer p for CALL instruction after FEND instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 114)
Fig. 75 · Function and operation explanation

Main program Program area from the step 0 to FEND instruction

Subroutine program Program area from a pointer Pn to SRET instruction

Cautions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Enter a pointer number or ladder block label for specifying the jump destination to the ladder block header in the ladder block regarded as the jump destination. Add ":" to an entered pointer.
3. To use the subroutine call, follow the steps below. Name the task "MELSEC_MAIN". Using a different task name prompts an error because the "one set in the program block" by FEND instruction and the "one finally added to the program block during compiling" become redundant.

Be sure to program in combination with the SRET and FEND functions.

→ Refer to Section 7.3 for SRET. → Refer to Section 7.7 for FEND.

4. In CALL instructions, a same number can be used two or more times in pointer number or ladder block label. However, do not use a pointer number or ladder block label and number used in another instruction (CJ).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 114)
Fig. 76 · Cautions
5. Cautions about the use in subroutines or interrupt routines are described later.
Page 115 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SRET EN ENO
Page 115 · click to enlarge
Page 115

7 Applied Instructions (Program Flow)

7.2 CALL / Call Subroutine

Program examples

1. Example of fundamental use (no nesting)

X000 CALL EN ENO p

P10

Main program While X000 is ON, the program execution jumps to a step with the label P10.

FEND EN ENO

P10:

Subroutine program When SRET instruction is executed after the subroutine program has executed, the program execution returns to the original step +1.

SRET EN ENO

How to Read Explanation of Instructions

2. Example of multiple CALL instructions in subroutines (multiple nesting) CALL instruction can be used up to 4 times in subroutine programs. Nesting of up to five layers is allowed.

CALLP EN ENO p

P11

Main program When X001 turns ON from OFF, the program execution jumps to the pointer P11 only once.

FEND EN ENO

P11:

Subroutine program1 When SRET instruction is executed, the program execution returns to the main program. If X002 is ON while the subroutine program 1 is executed, the program execution jumps to a step with the pointer P12.

CALL EN ENO p

P12

Applied Instructions (Program Flow)

SRET EN ENO

P12:

The subroutine program with P12 is executed, and then the program execution returns to the subroutine program with P11 by SRET instruction.

Applied Instructions (Move and Compare)

SRET EN ENO

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · Subroutine program2
Page 116 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions on subroutines and interrupt routines
Page 116 · click to enlarge
Page 116

7 Applied Instructions (Program Flow)

7.2 CALL / Call Subroutine

Cautions on subroutines and interrupt routines

This section explains cautions on creating programs in subroutines and interrupt routines. The explanation below is given for subroutines, but the situation also applies to interrupt routines.

1. When using timers in subroutines (or interrupt routines) Use retentive type timers T192 to T199 in subroutines. These timers execute counting when the coil instruction or END instruction is executed. After a timer reaches the set value, the output contact is activated when the coil instruction or END instruction is executed. Because general timers execute counting only when the coil instruction is executed, they do not execute counting if they are used in subroutines in which the coil instruction is executed only under some conditions.

2. When using retentive type 1 ms timers in subroutines (or interrupt routines) If a retentive type 1 ms timer is used in a subroutine, note that the output contact is activated when the first coil instruction (or subroutine) is executed after the timer reaches its set value.

3. Countermeasures against latches of devices used in subroutines (or interrupt routines) Devices which were set to ON in a subroutine are latched in the ON status even after the subroutine is finished. (Refer to the program described later.) When RST instruction for a timer or counter is executed, the reset status of the timer or counter is latched also. For turning OFF such a device latched in the ON status or for canceling such a timer or counter latched in the reset status, reset such a device in the main program after the routine is finished, or program a sequence for resetting such a device or for deactivating RST instruction in the routine. (Refer to the program described later.)

1. Example in which outputs are latched In the following program example, the counter C0 is provided to count X001. When X000 is input, the subroutine P0 is executed only in one scan, and then the counter is reset and Y007 is output. • Program examples
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions on subroutines and interrupt routines diagram (page 116)
Fig. 77 · Cautions on subroutines and interrupt routines

Current value of C0 1 2 3 Counter is reset.

Because the reset instruction for C0 is valid, the current value of C0 remains unchanged even if pulses are input.

Page 117 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 7.2 CALL / Call Subroutine
Page 117 · click to enlarge
Page 117
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.2 CALL / Call Subroutine diagram (page 117)
Fig. 78 · 7.2 CALL / Call Subroutine

The preceding RST C0 instruction is deactivated in the subroutine.

Counter reset instruction is deactivated (part in above program). B Counter is reset (part in above program). A

Page 118 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 118 · click to enlarge
Page 118

7 Applied Instructions (Program Flow)

7.3 SRET / Subroutine Return

7.3 SRET / Subroutine Return

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction returns the program execution from a subroutine to the main program.

1. Format and operation, execution form

Expression in each language

SRET 16 bits Continuous Use a subroutine program by reading out the function block made of other program parts.

SRET EN ENO

2. Set data

Variable Description Data type

Input variable EN Execution condition Always TRUE

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

- No target device is available.

Function and operation explanation

When CALL instruction in the main program is executed, the program execution jumps to a subroutine. SRET instruction returns the program execution to the main routine.

→ Refer to Section 7.2.

Show 9 more labels / short text on this page
Instruction · name Operation Execution · form · Operand · Special · Character · String Pointer · type · User
Page 119 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 119 · click to enlarge
Page 119

7 Applied Instructions (Program Flow)

7.4 IRET / Interrupt Return

7.4 IRET / Interrupt Return

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction returns the program execution from an interrupt routine to the main program.

1. Format and operation, execution form

Expression in each language

IRET EN ENO

IRET 16 bits Continuous IRET(EN);

2. Input and output data types

Variable Description Data type

How to Read Explanation of Instructions

Input variable EN Execution condition Always TRUE

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

- No target device is available.

Function and operation explanation

When an interrupt (input, timer or counter) is generated while the main program is executed, the program execution jumps to an interrupt (I) routine. IRET instruction returns the program execution to the main routine. The table below shows the three types of jump to an interrupt routine.

Applied Instructions (Program Flow)

Input interrupt Executes the interrupt processing when an input(X) signal turns ON or OFF.

Timer interrupt Executes the interrupt processing at a specified time interval (constant cycle).

Counter interrupt *1 Executes the interrupt processing when a high speed counter reaches its set value.

*1. This function is provided only in the FX3U, FX3UC and FX2C PLCs Ver. 3.07 or later.

→ For the interrupt function, refer to Chapter 35.

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 14 more labels / short text on this page
Instruction List · Instruction · name Operation Execution · form · Configuration of Instruction · Basic Instruction · Operand · Special · Character · String Pointer · type · User · Step Ladder Instructions · Function Description
Page 120 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FEND EN ENO
Page 120 · click to enlarge
Page 120

7 Applied Instructions (Program Flow)

7.4 IRET / Interrupt Return

Cautions

1. Create a task for the interrupt program and the main program.
2. Use "Event" to specify the interrupt pointer to be used for the task for the interrupt program.

→ For the interrupt pointer, refer to Chapter 35.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 120)
Fig. 79 · Cautions

Set an interrupt pointer

3. IRET instruction needs not to be programmed because the IRET instruction is automatically added during the compilation at the end of the program block that is registered in the task for the interrupt program.

Interrupt program

INC EN ENO

IRET EN ENO

Do not program IRET instruction because it is automatically added during the compilation.

4. The program block registered in the task for the main program requires the function EI instruction (interrupt enabled). Program the function DI instruction (interrupt disabled) as necessary.

EI EN ENO

Range of interrupt enabled

DI EN ENO

If necessary, program the DI instruction as it is a interrupt disabled function.

FEND EN ENO

Do not program the FEND instruction as it is automatically added during the compilation.

Page 121 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000: =X000;
Page 121 · click to enlarge
Page 121

7 Applied Instructions (Program Flow)

7.4 IRET / Interrupt Return

Program examples

Task for main program

Interrupts are usually disabled in PLCs. Use EI instruction to enable interrupts. When X000 turns ON while the main program is executed,instructions after the interrupt routine pointer I001 are executed, and the program execution returns to the original main program by IRET instruction.

EI EN ENO

OUT_C EN ENO CCoil CValue CC255

K100

Task for interrupt program(Interrupt pointer I001 is set by event.)

I001:The rising edge of X000 is detected.

How to Read Explanation of Instructions

Task for interrupt program(Interrupt pointer I620 is set by event.)

The timer interrupt of the pointer I620 is executed every timer time of 20 ms, and the program execution is returned to the original main program by IRET instruction each time.

I620:Interrupt every 20 ms.

Task for interrupt program(Interrupt pointer I010 is set by event.)

The high speed counter interrupt of the pointer I010 is executed when the current value of a high speed counter becomes equivalent to a value specified by DHSCS instruction, and the program execution returns to the original main program by IRET.

I010:High speed counter interrupt

High speed counter routine

[ ST ]

Task for main program

Interrupts are usually disabled in PLCs. Use EI instruction to enable interrupts. When X000 turns ON while the main program is executed,instructions after the interrupt routine pointer I001 are executed, and the program execution returns to the original main program by IRET instruction.

EI(TRUE); OUT_C(M8000, CC255, K100);

Task for interrupt program(Interrupt pointer I001 is set by event.)

I001:The rising edge of X000 is detected.

Applied Instructions (Program Flow)

Y000: =X000;

Task for interrupt program(Interrupt pointer I620 is set by event.)

I620:Interrupt every 20 ms.

Applied Instructions (Move and Compare)

The timer interrupt of the pointer I620 is executed every timer time of 20 ms, and the program execution is returned to the original main program by IRET instruction each time.

Y000: =X000;

Task for interrupt program(Interrupt pointer I010 is set by event.)

I010:High speed counter interrupt

The high speed counter interrupt of the pointer I010 is executed when the current value of a high speed counter becomes equivalent to a value specified by DHSCS instruction, and the program execution returns to the original main program by IRET.

Applied Instructions (Arithmetic and Logical Operation)

Y000: =X000;

High speed counter routine

Applied Instructions (Rotation and Shift Operation)

Show 11 more labels / short text on this page
[Structured ladder/FBD] · Instruction List · M8000 Main program · Configuration of Instruction · Input interrupt routine · Timer interrupt routine · Basic Instruction · Step Ladder Instructions · Main program · Input interrupt routine · Timer interrupt routine
Page 122 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 122 · click to enlarge
Page 122

7 Applied Instructions (Program Flow)

7.5 DI / Disable Interrupt

7.5 DI / Disable Interrupt

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction disables interrupts after interrupts were enabled by EI instruction.

1. Format and operation, execution form

Expression in each language

DI EN ENO

DI 16 bits Continuous DI(EN);

2. Set data

Variable Description Data type

Input variable EN Execution condition Always TRUE

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

- No target device is available.

Function and operation explanation

DI instruction is the independent type, and does not require command (drive) contact.

Cautions

Interrupts (requests) generated after DI instruction are processed after EI instruction is executed.

Show 9 more labels / short text on this page
Instruction · name Operation Execution · form · Operand · Special · Character · String Pointer · type · User
Page 123 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 7.6 EI / Enable Interrupt
Page 123 · click to enlarge
Page 123
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.6 EI / Enable Interrupt diagram (page 123)
Fig. 80 · 7.6 EI / Enable Interrupt

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Interrupts are usually disabled in PLCs. This instruction enables interrupts in PLCs. Use this instruction for using the input interrupt, timer interrupt and counter interrupt functions.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

EI instruction is the independent type, and does not require command (drive) contact.

Page 124 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RST EN ENO
Page 124 · click to enlarge
Page 124

7 Applied Instructions (Program Flow)

7.6 EI / Enable Interrupt

Cautions

1. Refer to the following items for the cautions on the interrupt program.

→ Refer to Section 7.4.

2) Use the EI instruction as follows when the FXU, FX2C, FX2N, FX2NC, FX3U and FX3UC PLCs use the pulse catch function. The IE instruction does not need to be programmed when the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC uses the pulse catch function. For the details of special auxiliary relays and other devices used with the pulse catch function, refer to the following manual.

→ FX Structured Programming Manual [Device & Common] When using the FX3U PLC

[ ST ]

EI(TRUE)

EI EN ENO

Y000:=M8170; *1

RST(X002, M8170); *1

M8170 *1

Y000

With the rising edge of X000 detected, M8170 is reset by interrupt.

RST EN ENO

Resets pulse catch results.

*1. A special auxiliary relay for the X000 pulse catch function used in the FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. The special auxiliary relay depends on the PLC used and input number. For the pulse catch function, refer to Chapter 35.

[Structured ladder/FBD] · d M8170

Page 125 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 7.7 FEND / Main Routine Program End
Page 125 · click to enlarge
Page 125
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.7 FEND / Main Routine Program End diagram (page 125)
Fig. 81 · 7.7 FEND / Main Routine Program End

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction indicates the end of the main program.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

When FEND instruction is executed, output processing, input processing and watchdog timer refresh are executed, and then the program execution returns to the step 0. FEND instruction is required in creating subroutine programs and interrupt programs.

*1. The function FEND instruction is added automatically during compilation, and does not require to be programmed. Refer to "Cautions".

Page 126 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 126 · click to enlarge
Page 126

7 Applied Instructions (Program Flow)

7.7 FEND / Main Routine Program End

2. In the case of CALL instruction

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. In the case of CALL instruction diagram (page 126)
Fig. 82 · 2. In the case of CALL instruction

*1. If task names other than "MELSEC_MAIN" are used, FEND instruction is added automatically, and cause an error. Refer to item 6 of "Cautions".

Cautions

1. The function FEND instruction is usually added automatically during compilation. It is not necessary to program the FEND instruction in the program block except when creating subroutine program and interrupt routine program. As for the subroutine programs, refer to the following.

→ Refer to Section 7.2.

2. When FEND instruction is programmed two or more times, put a subroutine program or interrupt routine program after the last FEND instruction.
3. When CALL or CALLP instruction is used, put a label after FEND instruction. And the SRET instruction is required in every case.
4. When CALL or CALLP instruction is used, if FEND instruction is executed after CALL or CALLP instruction was executed and before SRET instruction is executed, an error is caused.
5. When FOR instruction is used, if FEND instruction is executed after FOR instruction was executed and before NEXT instruction is executed, an error is caused.

6) When CALL instruction is used, set the registered task name to "MELSEC_MAIN". Any other task names add FEND instruction automatically at the end of the program block (*1 in "2. In the case of CALL instruction") during compilation, and cause an error during writing to the PLC (due to already existing FEND instruction located at the end of the main program (*2 in "2. In the case of CALL instruction")). It is not possible to use CALL instruction in multiple tasks. Use function blocks.

Page 127 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related device
Page 127 · click to enlarge
Page 127

7 Applied Instructions (Program Flow)

7.8 WDT / Watchdog Timer Refresh

7.8 WDT / Watchdog Timer Refresh

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction refreshes the watchdog timer in a sequence program.

1. Format and operation, execution form

Expression in each language

WDT EN ENO

WDT

WDTP EN ENO

2. Set data

How to Read Explanation of Instructions

Variable Description Data type

Input variable EN Execution condition Bit

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

- No target device is available.

Function and operation explanation

When the operation cycle (time until END or FEND instruction is executed after the step 0) of a PLC exceeds 200 ms, a watchdog timer error (indicating abnormal operation) occurs. The CPU error LED lights, and the PLC stops. When the operation cycle is long, insert WDT instruction in the middle of the program to avoid the watchdog timer error.

Applied Instructions (Program Flow)

Command contact WDTP EN ENO

One scan is executed.

Command contact WDT EN ENO

Applied Instructions (Move and Compare)

Each scan is executed.

Applied Instructions (Arithmetic and Logical Operation)

Related device

D8000 Watchdog timer time Up to 32767 ms can be set in units of ms (initial value: 200 ms).

Applied Instructions (Rotation and Shift Operation)

Show 19 more labels / short text on this page
Instruction List · Instruction · name Operation Execution · form · Configuration of Instruction · Continuous WDT(EN); · 16 bits · WDTP Pulse WDTP(EN); · Basic Instruction · Special · Character · Operand · String Pointer · type · User · Step Ladder Instructions · Command input · Command input · Device Name Description
Page 128 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 128 · click to enlarge
Page 128

7 Applied Instructions (Program Flow)

7.8 WDT / Watchdog Timer Refresh

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. A watchdog timer error may occur in the following cases. To avoid the error, input a program shown below near the head step to extend the watchdog timer time, or shift FROM/TO instruction execution timing. - Caution when many special extension devices are connected.

In such configuration that many special extension devices (such as positioning units, cam switches, analog units and link units) are connected, the buffer memory initialization time may become longer, thus the operation time may become longer, and a watchdog timer error may occur. - Caution when many FROM/TO instructions are driven at one time.

When many FROM/TO instructions are executed or when many buffer memories are transferred, the operation time may become longer, and a watchdog timer error may occur. - Caution when there are many high speed counters (software counters).

When many high speed counters are provided and high frequency are counted at one time, the operation time may become longer, and a watchdog timer error may occur.

3. The watchdog timer time can be changed. By overwriting the contents of D8000 (watchdog timer time), the watchdog timer detection time (initial value: 200 ms) can be changed. By inputting the program shown below, the sequence program after this insertion is monitored by a new watchdog timer time.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 128)
Fig. 83 · Cautions

Watchdog timer refresh If WDT (FNC 07) instruction is not programmed, the value of D8000 is valid during END processing.

Program examples

1. When the operation cycle is long and causes an error For example, by dividing a program whose operation cycle is 240 ms into two portions and inserting WDT instruction between them, the operation cycle becomes less than 200 ms in both the former half portion and the latter half portion.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 128)
Fig. 84 · Program examples
2. When a pointer number or ladder block label of CJ instruction is located in a step number smaller than the step number of CJ instruction Put WDT instruction after the pointer number or ladder block label.

If an input relay (X) is used as the command contact, input refresh is disabled, so the program execution cannot be returned from the area between Pn and CJ. As the command contact, use such device that can be set to OFF in a program being jumped.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 128)
Fig. 85 · Program examples
Page 129 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K30000
Page 129 · click to enlarge
Page 129

7 Applied Instructions (Program Flow)

7.8 WDT / Watchdog Timer Refresh

3. When FOR/NEXT instruction is repeated many times Put WDT instruction between FOR and NEXT.

K30000

WDT EN ENO

NEXT EN ENO

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 6 more labels / short text on this page
FOR EN n · Instruction List · Program · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 130 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 130 · click to enlarge
Page 130

7 Applied Instructions (Program Flow)

7.9 FOR / Start a FOR/NEXT Loop

7.9 FOR / Start a FOR/NEXT Loop

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

FOR instruction specifies the number of repetition of the loop between FOR and NEXT instructions.

1. Format and operation, execution form

Expression in each language

Syntax such as condition sentence is used. Refer to the following manual for syntaxes.

FOR 16 bits Continuous

→ Q/L/F Structured Programming Manual

2. Set data

Variable Description Data type

EN Execution condition Always TRUE

Number of repetition of the loop between FOR and NEXT instructions ANY16

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

S: Refer to "Cautions".

Function and operation explanation

→ Refer to Section 7.10 for details.

Related instruction

FOR instruction and NEXT instruction are set as a pair in programming.

Cautions

1. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Show 12 more labels / short text on this page
Instruction · name Operation Execution · form · FOR EN n · (Fundamentals) · Input variable · Operand · Special · Character · User · String Pointer · type
Page 131 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related instruction
Page 131 · click to enlarge
Page 131

7 Applied Instructions (Program Flow)

7.10 NEXT / End a FOR/NEXT Loop

7.10 NEXT / End a FOR/NEXT Loop

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

FOR instruction specifies the number of repetition of the loop between FOR and NEXT instructions.

1. Format and operation, execution form

Expression in each language

Syntax such as condition sentence is used. Refer to the following manual for syntaxes.

NEXT 16 bits Continuous

NEXT EN ENO

→ Q/L/F Structured Programming Manual

2. Set data

Variable Description Data type

How to Read Explanation of Instructions

Input variable EN Execution condition Always TRUE

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

- No target device is available.

Function and operation explanation

The loop between FOR and NEXT instruction is repeated "n" times (which is specified by the input variable (n)). After the loop is repeated by the specified number of times, steps after NEXT instruction are executed.

Applied Instructions (Program Flow)

NEXT EN ENO

Applied Instructions (Move and Compare)

Related instruction

NEXT instruction and FOR instruction are set as a pair in programming.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 17 more labels / short text on this page
Instruction List · Instruction · name Operation Execution · form · Configuration of Instruction · (Fundamentals) · Basic Instruction · Operand · Special · Character · String Pointer · type · User · Step Ladder Instructions · FOR EN n · n · Repeated "n" times
Page 132 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 132 · click to enlarge
Page 132

7 Applied Instructions (Program Flow)

7.10 NEXT / End a FOR/NEXT Loop

Cautions

FOR-NEXT loop can be nested up to 5 levels.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 132)
Fig. 86 · Cautions

Error

1. When FOR-NEXT loop is repeated many times, the operation cycle (D8010) is too long, and a watchdog timer error may occur. In such a case, change the watchdog timer time or reset the watchdog timer.

→ For details on changing and resetting the watchdog timer, refer to Section 7.8.

2. The following programs are regarded as errors.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Error diagram (page 132)
Fig. 87 · Error

When number of FOR instructions is not equivalent to the number of NEXT instructions.

Page 133 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 7.10 NEXT / End a FOR/NEXT Loop
Page 133 · click to enlarge
Page 133
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 7.10 NEXT / End a FOR/NEXT Loop diagram (page 133)
Fig. 88 · 7.10 NEXT / End a FOR/NEXT Loop

When the data value (current value) of D0Z (D4 when Z is "4") is "6", the loop 2) is repeated 6 times.

When X010 is OFF When K1X000 is "7", the loop 1) is repeated 7 times.

When X010 is ON The program execution jumps to the pointer P22, and the loop 1) is skipped.

Number of times of repeating the loops 1), 2) and 3).

7 6 4 = 168 times 6 4 = 24 times

Page 134 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DBIN
Page 134 · click to enlarge
Page 134

8 Applied Instructions (Move and Compare)

8. Applied Instructions (Move and Compare)

This chapter introduces fundamental data processing instructions such as data transfer and data comparison which are regarded as most important in applied instructions.

Instruction name Function Reference

CMP

Compare Section 8.1 CMPP

DCMP

DCMPP

ZCP

Zone Compare Section 8.2 ZCPP

DZCP

DZCPP

MOV

Move Section 8.3 MOVP

DMOV

DMOVP

SMOV

Shift Move Section 8.4 SMOVP

CML

Complement Section 8.5 CMLP

DCML

DCMLP

BMOV

Block Move Section 8.6 BMOVP

FMOV

Fill Move Section 8.7 FMOVP

DFMOV

DFMOVP

XCH

Exchange Section 8.8 XCHP

DXCH

DXCHP

BCD

Conversion to Binary Coded Decimal Section 8.9 BCDP

DBCD

DBCDP

BIN

Conversion to Binary Section 8.10 BINP

DBIN

DBINP

Page 135 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.1 CMP / Compare
Page 135 · click to enlarge
Page 135
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.1 CMP / Compare diagram (page 135)
Fig. 89 · 8.1 CMP / Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction compares two values, and outputs the result (smaller, equal or larger) to bit devices (3 points).

→ For the contact comparison instruction, refer to Chapter 28.

→ For floating point comparison, refer to Section 18.1.

Data or device number handled as comparison value ANY16 ANY32

Data or device number handled as comparison source ANY16 ANY32

Head bit device to which comparison result is output. ARRAY [0..2] OF Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

Page 136 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 136 · click to enlarge
Page 136

8 Applied Instructions (Move and Compare)

8.1 CMP / Compare

Function and operation explanation

1. 16-bit operation(CMP, CMPP) The comparison value specified by and the comparison source specified by are compared with each other. According to the result (smaller, equal or larger), any of the three points of the devices specified by turns on.
  • The source data specified by and are handled as BIN (binary) values.
  • Comparison is executed algebraically. Example: -10 < 2
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 136)
Fig. 90 · Function and operation explanation

s1 s2 Turns on in the case of >

s1 s2 Turns on in the case of =

s1 s2 Turns on in the case of

Even if the command input turns OFF and CMP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON.

2. 32-bit operation(DCMP, DCMPP) The comparison value specified by and the comparison source specified by are compared with each other. According to the result (smaller, equal or larger), any of the three points of the devices specified by turns on.
  • The source data specified by and are handled as BIN (binary) values.
  • Comparison is executed algebraically. Example: -125400 < 22466
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 136)
Fig. 91 · Function and operation explanation

Turns on in the case of [ +1, ] > [ +1, ] s2 s1 s1 s2

Turns on in the case of [ +1, ] = [ +1, ] s2 s1 s1 s2

Turns on in the case of [ +1, ] < [ +1, ] s2 s1 s1 s2

Even if the command input turns OFF and DCMP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d

Page 137 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ZRST EN ENO
Page 137 · click to enlarge
Page 137

8 Applied Instructions (Move and Compare)

8.1 CMP / Compare

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable. Not indexed (V,Z). S 2:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3U and FX 3UC PLCs only are applicable.
2. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. From the device specified as , three devices are occupied. Be sure not to use those devices in another control.

Program examples

1. When comparing present value of a counter

CMP EN s1 s2

d M0 K100 CN20

How to Read Explanation of Instructions

M0 Y000

CN20

Turns ON in the case of K100 > C 20 current value.

M0

M1 Y001

Turns ON in the case of K100 = C 20 current value.

M1

M2 Y002

Turns ON in the case of K100 < C 20 current value.

M2

Latched in the ON status.

Latched in the ON status.

Latched in the ON status.

CMP(X000, K100, CN20, M0); Y000:=X000 AND M0; Y001:=X000 AND M1; Y002:=X000 AND M2;

If it is necessary to clear the comparison result when the instruction is not executed, add the following contents under the above program.

1) RST

RST EN ENO

Applied Instructions (Program Flow)

RST(NOT X000, M0); RST(NOT X000, M1); RST(NOT X000, M2);

RST EN ENO

Applied Instructions (Move and Compare)

RST EN ENO

2) ZRST

Applied Instructions (Arithmetic and Logical Operation)

ZRST EN ENO

ZRST(NOT X000, M0, M2);

M0 M2

M0 to M2 are reset.

Applied Instructions (Rotation and Shift Operation)

Show 10 more labels / short text on this page
Instruction List · Configuration of Instruction · [Structured ladder/FBD] · 99 100 101 · Basic Instruction · Step Ladder Instructions · d M0 · d M1 · d M2 · d1 d2
Page 138 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 138 · click to enlarge
Page 138

8 Applied Instructions (Move and Compare)

8.2 ZCP / Zone Compare

8.2 ZCP / Zone Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction compares two values (zone) with the comparison source, and outputs the result (upper, equal or lower) to bit devices (3 points).

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 138)
Fig. 92 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 138)
Fig. 93 · 2. Set data

Data or device handled as lower comparison value ANY16 ANY32

Data or device handled as upper comparison value ANY16 ANY32

Data or device number handled as comparison source ANY16 ANY32

Head bit device to which comparison result is output. ARRAY [0..2] OF Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 138)
Fig. 94 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

z S2 S3 z

S: Refer to "Cautions".

Page 139 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M102
Page 139 · click to enlarge
Page 139

8 Applied Instructions (Move and Compare)

8.2 ZCP / Zone Compare

Function and operation explanation

1. 16-bit operation(ZCP, ZCPP) The lower comparison value specified by and the upper comparison value specified by are compared with the contents of the comparison source specified by . According to the result (smaller, within zone or larger), any of the three points of the devices specified by turns ON.
  • Comparison is executed algebraically. Example: -10 < 2 < 10

ZCP EN s1 s2

Lower comparison value M100

M100

(Lower comparison value specified by ) > (Comparison source specified by )

M101

(Lower comparison value specified by ) (Comparison source specified by ) (Upper comparison value specified by )

How to Read Explanation of Instructions

M102

(Comparison source specified by ) > (Upper comparison value specified by ) s2

Even if the command input turns OFF and ZCP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d

2. 32-bit operation(DZCP, DZCPP) The lower comparison value specified by and the upper comparison value specified by are compared with the contents of the comparison source specified by . According to the result (smaller, within zone or larger), any of the three points of the devices specified by turns ON.
  • Comparison is executed algebraically. Example: -125400 < 22466 < 1015444

DZCP EN s1 s2

M100

Applied Instructions (Program Flow)

M100

(Lower comparison value specified by ) > (Comparison source specified by ) s3

M101

(Lower comparison value specified by ) (Comparison source specified by ) (Upper comparison value specified by )

M102

(Comparison source specified by ) > (Upper comparison value specified by ) s2

Applied Instructions (Move and Compare)

Even if the command input turns OFF and DZCP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d d

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 20 more labels / short text on this page
Instruction List · Command input · Upper comparison value · Comparison source data · s3 · Configuration of Instruction · s1 · s3 · s1 s3 s2 · s3 · Basic Instruction · Step Ladder Instructions · Command input · Lower comparison value · Upper comparison value · Comparison source data · s3 · s1 · s1 s3 s2 · s3
Page 140 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 140 · click to enlarge
Page 140

8 Applied Instructions (Move and Compare)

8.2 ZCP / Zone Compare

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable. Not indexed (V,Z). S 2:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3U and FX 3UC PLCs only are applicable.
2. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. From the device specified as , three devices are occupied. Be sure not to use those devices in another control.
4. The lower comparison value specified by should be smaller than the upper comparison value specified by .
  • When the lower comparison value is smaller than the upper comparison value
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 140)
Fig. 95 · Cautions

Turns ON in the case of "K100 > CN30 (current value)".

Turns ON in the case of "K100 CN30 (current value) K120"

Turns ON in the case of "K120 < CN30 (current value)".

  • When the lower comparison value is larger than the upper comparison value

Turns ON in the case of "K120 > CN30 (current value)".

Turns ON in the case of "K120 = CN30 (current value)".

Turns ON in the case of "K120 < CN30 (current value)".

Page 141 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.3 MOV / Move
Page 141 · click to enlarge
Page 141
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.3 MOV / Move diagram (page 141)
Fig. 96 · 8.3 MOV / Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction transfers (copies) the contents of a device to another device.

MOV 16 bits Continuous MOV(EN,s,d); Or an assignment statement

MOVP 16 bits Pulse MOVP(EN,s,d); Or an assignment statement

DMOV 32 bits Continuous DMOV(EN,s,d); Or an assignment statement

DMOVP 32 bits Pulse DMOVP(EN,s,d); Or an assignment statement

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

Page 142 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 142 · click to enlarge
Page 142

8 Applied Instructions (Move and Compare)

8.3 MOV / Move

Function and operation explanation

1. 16-bit operation(MOV, MOVP) The contents of the transfer source specified by are transferred to the transfer destination specified by .
  • While the command input is OFF, the transfer destination specified by does not change.
  • When a constant (K) is specified as the transfer source specified by , it is automatically converted into binary.

Command input MOV EN s

When specifying digits of a bit device (K1X000 K1Y000) The bit device transfers a maximum of 16 points (multiple of 4).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 142)
Fig. 97 · Function and operation explanation

When a word device is specified The word device transfers 1 point.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 142)
Fig. 98 · Function and operation explanation
Show 4 more labels / short text on this page
d s · d Transfer source · Transfer destination data · data
Page 143 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 143 · click to enlarge
Page 143

8 Applied Instructions (Move and Compare)

8.3 MOV / Move

2. 32-bit operation(DMOV, DMOVP) The contents of the transfer source specified by are transferred to the transfer destination specified by .
  • While the command input is OFF, the transfer destination specified by does not change.
  • When a constant (K) is specified as the transfer source specified by , it is automatically converted into binary.

Command input DMOV EN s

[ +1, ] [ +1, ] s s d d

data Transfer destination data

When specifying digits of a bit device (K8X000 K8Y000) The bit device transfers a maximum of 32 points (multiple of 4).

ON X000

OFF X001

: K8Y000 : K8X000 d s Before execution

OFF

X37 to X1 X0

Y37 to Y1 Y0

How to Read Explanation of Instructions

ON X037

ON OFF OFF ON

ON ON ON OFF

ON Y000 OFF

ON Y001 OFF

X37 to X1 X0

Y37 to Y1 Y0

ON OFF OFF ON

ON OFF OFF ON

ON OFF

ON Y037

When a word device is specified The word device transfers 1 point.

: D51, D50 : D11, D10 d s

ON

K500000 K4321

K500000 K500000

Applied Instructions (Program Flow)

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 23 more labels / short text on this page
Instruction List · d Transfer source · Configuration of Instruction · Command input · DMOV EN s · Command contact ON · d K8X000 K8Y000 · s · to · Transfer · After execution · to · Basic Instruction · Command input · DMOV EN s · d D10 D50 · Step Ladder Instructions · Command contact · Before execution · s · Transfer · After execution · 500000 4321
Page 144 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — MOV(X001,TN0,D20);
Page 144 · click to enlarge
Page 144

8 Applied Instructions (Move and Compare)

8.3 MOV / Move

Program examples

1. When reading the current value of a timer and counter

X001 MOV EN s

MOV(X001,TN0,D20);

(Current value of T0) (D20) The operation is the same as a counter.

2. When indirectly specifying the set value of a timer or counter As the set value of the timer T20, two values can be specified by turning ON or OFF the switch X002. For specifying more than three set values, more than one switch is required.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — MOV(X001,TN0,D20); diagram (page 144)
Fig. 99

D 10=K100(10-second timer) D 10=K50(5-second timer) When X002 is ON, When X002 is OFF,

MOV(X002, K100, D10); MOV(NOT X002, K50, D10); OUT_T(M0, TC20, D10);

3. When transferring a bit device The program written by basic instructions shown below can be expressed using MOV instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — MOV(X001,TN0,D20); diagram (page 144)
Fig. 100
4. When transferring 32-bit data Be sure to use DMOV instruction for transferring an applied instruction (such as MUL) whose operation result is output in 32 bits, and for transferring a 32-bit numeric value or transferring the current value of a high speed counter (C235 to C255) which is a 32-bit device.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — MOV(X001,TN0,D20); diagram (page 144)
Fig. 101

d TN0 D20

Page 145 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.4 SMOV / Shift Move
Page 145 · click to enlarge
Page 145
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.4 SMOV / Shift Move diagram (page 145)
Fig. 102 · 8.4 SMOV / Shift Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction distributes and composes data in units of digit (4 bits).

Word device storing data whose digits will be moved. ANY16

Word device storing data whose digits are moved ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

Page 146 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 146 · click to enlarge
Page 146

8 Applied Instructions (Move and Compare)

8.4 SMOV / Shift Move

Function and operation explanation

1. 16-bit operation(SMOV, SMOVP) The contents of the transfer source specified by and transfer destination specified by are converted into 4-digit BCD (0000 to 9999) respectively. "m2" digits starting from "m1"th digit are transferred (composed) to the transfer destination specified by starting from "n"th digit, converted into binary, and then stored to the transfer destination specified by .
  • While the command input is OFF, the transfer destination specified by does not change.
  • When the command input turns ON, the data of the transfer source specified by and unspecified digits in the transfer destination specified by do not change.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 146)
Fig. 103 · Function and operation explanation
1. is converted from binary into BCD.

In the case of = 4, = 2, = 3 4th digit 1st digit 2nd digit 3rd digit

2. "m2" digits starting from "m1"th digit are transferred (composed) to ' starting from "n"th digit. The digits of 10 3 and 10 0 of ' are not affected even if data is transferred from '.
3. The composed data (BCD) is converted into binary, and stored to .
2. Extension function When M8168 is set to ON first and then SMOV instruction is executed, conversion from binary to BCD is not executed. Data is moved in units of 4 bits.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 146)
Fig. 104 · Function and operation explanation

M8168 is available for other instructions also. After using M8168 for SMOV instruction, return it to OFF.

Cautions

1. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 147 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 147 · click to enlarge
Page 147

8 Applied Instructions (Move and Compare)

8.4 SMOV / Shift Move

Program examples

The data on three-digit digital switches are composed, and stored as binary data to D2.

102 101 100

(X020 to X027)2-digit BCD

M8000

K2X020

8 1 8 1 8 1

(X000 to X003)1-digit BCD

K1X000

X003 to X000 X027 to X020

SMOV EN s m1

1-digit BCD data of D1 is transferred to the 3rd digit (BCD data) of D2, and automatically converted into binary data.

PLC

D1 D2 K1 K1 K3

Data on three digital switches connected to non-consecutive input terminals are composed.

[ ST ]

BIN(M8000, K2X020, D2); BIN(M8000, K1X000, D1); SMOV(M8000, D1, K1, K1, K3, D2);

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 10 more labels / short text on this page
[Structured ladder/FBD] · BIN EN s · D 2(Binary) · Instruction List · BIN EN s · D 1(Binary) · Configuration of Instruction · m2 n · Basic Instruction · Step Ladder Instructions
Page 148 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 148 · click to enlarge
Page 148

8 Applied Instructions (Move and Compare)

8.5 CML / Complement

8.5 CML / Complement

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction inverts data in units of bit, and then transfers (copies) the inverted data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 148)
Fig. 105 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 148)
Fig. 106 · 2. Set data

Data to be inverted or word device storing the data ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 148)
Fig. 107 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

S: Refer to "Cautions".

Page 149 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 149 · click to enlarge
Page 149

8 Applied Instructions (Move and Compare)

8.5 CML / Complement

Function and operation explanation

1. 16-bit operation(CML, CMLP) Each bit of a device specified by is inverted (from 0 to 1 or from 1 to 0), and then transferred to the device specified by .
  • When a constant (K) is specified as , it is automatically converted into binary.
  • This operation is useful when a logically inverted output is required as an output from a PLC.

Data having been inverted

b15 b14 b13 b12 b11 b11 b9 b8 b7 b6 n5 b4 b3 b2 b1 b0

0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 1

sign bit (0=Positive number 1=Negative number)

0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1

Inverted data is transferred.

How to Read Explanation of Instructions

2. 32-bit operation(DCML, DCMLP) Each bit of a device specified by is inverted (from 0 to 1 or from 1 to 0), and then transferred to the device specified by .
  • When a constant (K) is specified as , it is automatically converted into binary.
  • This operation is useful when a logically inverted output is required as an output from a PLC.

→ +1, d s s +1, d

Data having been inverted

b31 b30 b29 b28 b27 b26 b25 to b7 b6 n5 b4 b3 b2 b1 b0

0 1 0 1 1 1 0 0 1 0 1 0 1 0 1

sign bit (0=Positive number 1=Negative number)

0 1 0 1 0 1 0 1 1 0 0 0 1 0 1

Applied Instructions (Program Flow)

Inverted data is transferred.

Cautions

1. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 17 more labels / short text on this page
Instruction List · Command input · CML EN s · → d s · Data to be · inverted · Configuration of Instruction · s · Command contact=ON · Basic Instruction · Command input · DCML EN s · Data to be · inverted · Step Ladder Instructions · s · Command contact=ON
Page 150 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. When four bits are specified for a device with digit specification
Page 150 · click to enlarge
Page 150

8 Applied Instructions (Move and Compare)

8.5 CML / Complement

Program examples

1. When receiving an inverted input The sequence program can be written by CML instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 150)
Fig. 108 · Program examples

2. When four bits are specified for a device with digit specification

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. When four bits are specified for a device with digit specification diagram (page 150)
Fig. 109 · 2. When four bits are specified for a device with di…

Y015 b14 b13 b12 b11 b11 b9 b8 b7 b6 n5 b4 b3 b2 b1 b0

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000

Page 151 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.6 BMOV / Block Move
Page 151 · click to enlarge
Page 151
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.6 BMOV / Block Move diagram (page 151)
Fig. 110 · 8.6 BMOV / Block Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction transfers (copies) a specified number of data at one time.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

Page 152 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Extension function (bi-directional transfer function)
Page 152 · click to enlarge
Page 152

8 Applied Instructions (Move and Compare)

8.6 BMOV / Block Move

Function and operation explanation

BMOV instruction transfers "n" points of data from the device specified by to the device specified by at one time.

  • If the device number range is exceeded, data is transferred within the possible range.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 152)
Fig. 111 · Function and operation explanation
1. Transfer is enabled even if the transfer number range is overlapped. To prevent overwriting before transfer of source data, data is automatically transferred in the order "1) 2) 3)" according to the number overlap status.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 152)
Fig. 112 · Function and operation explanation

2. Extension function (bi-directional transfer function)

By controlling the direction inverse flag M8024*1 for BMOV instruction, data can be transferred in two directions in one program.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Extension function (bi-directional transfer function) diagram (page 152)
Fig. 113 · 2. Extension function (bi-directional transfer funct…
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Extension function (bi-directional transfer function) diagram (page 152)
Fig. 114 · 2. Extension function (bi-directional transfer funct…

D5ŠD10 D6ŠD11 D7ŠD12

D5D10 D6D11 D7D12

M8001 BMOV direction inverse OFF Normally OFF during operation

*1. M8024 is cleared when the PLC mode is changed from RUN to STOP.

Page 153 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.6 BMOV / Block Move
Page 153 · click to enlarge
Page 153
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.6 BMOV / Block Move diagram (page 153)
Fig. 115 · 8.6 BMOV / Block Move
1. The FX 0N , FX U and FX 2C PLCs handle file registers as follows.
2. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. When specifying digits of bit devices, specify a same number of digits for and .
4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 154 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Cautions on use
Page 154 · click to enlarge
Page 154

8 Applied Instructions (Move and Compare)

8.6 BMOV / Block Move

Function of transfer between file registers and data registers

BMOV instruction has a special function to file registers (D1000 and later). The maximum number of file register differs from one PLC to another. This explanation here uses the FX3U and FX3UC PLCs as examples. For the details of the file registers, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

1. What are file registers By parameter setting, D1000 to D7999 can be handled as file registers, and written to and read from the program memory area.
1. Outline of setting File registers (D1000 to D7999) do not exist in the initial status. They are valid only when some number of file registers are secured by parameter setting in a programming tool.
2. Number of file registers In parameter setting, set 500 file registers as 1 block. 1 to 14 blocks (each of which has 500 file registers) can be set. 1 block occupies 500 steps in the program memory area.
3. Difference between BMOV instruction and other instructions The table below shows the difference between BMOV instruction and other instructions with regard to file registers (D1000 and later).

Instruction Contents of transfer Remarks

BMOV Can read from and write to the file register area [A] inside the program memory. -

Other applied instructions than BMOV

Can read from and write to the data register area [B] inside the image memory in the same way as general data registers.

Because the data register area [B] is provided inside the system RAM in PLCs, its contents can be arbitrarily changed without regard to the optional memory format.

When power is turned ON, data registers set as file registers are automatically copied from the file register area [A] to the data register area [B].

Inside system RAM Inside built-in memory

When power is turned ON When PLC mode is changed from STOP to RUN

Devices D1000 and later specified as operands in applied instructions other than BMOV, indirectly specified values for timers or counters or devices in RST instruction are read from and written to the area [B] in the same way as general data registers.

500 points 14 blocks maximum (7000 points maximum)

[A]

[B]

Remaining area can be used as data register for general purpose.

2. Cautions on use

1. When updating the contents of a file register with a same number (same-number update mode), make sure that the file register number is equivalent between and .
2. When using file registers in the same-number update mode, make sure that the number of transfer points specified by "n" does not exceed the file register area.
3. If the file register area is exceeded while file registers are used in the same-number update mode, an operation error (M8067) is caused and the instruction is not executed.
4. In the case of indexing (in the same-number update mode) When and are modified with index, the instruction is executed if the actual device number is within the file register area and the number of transfer points does not exceed the file register area.
Show 11 more labels / short text on this page
or memory cassette · Program · Data memory · memory · Program/ comment · Data register · file register · Data register · Write · Read · Data register D7999
Page 155 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D1100 D200
Page 155 · click to enlarge
Page 155

8 Applied Instructions (Move and Compare)

8.6 BMOV / Block Move

5) Handling of flash memory When changing the contents of file registers secured inside the flash memory, observe the following condition: - Set the protect switch to OFF in the optional memory. - When writing data using a continuous operation type instruction in a program, data is written to the flash memory in every operation cycle of the PLC. To prevent this, as the flash memory has a limit to the number of times of writing operations, be sure to use a pulse operation type instruction (BMOVP) so that the number of times of writing is reduced. - It takes 66 to 132 ms to write data of one serial block (500 points) to the flash memory. Execution of the program is paused during this period. Because the watchdog timer is not refreshed at this time, it is necessary to take proper countermeasures such as inserting the WDT instruction into the sequence program. - Do not turn OFF the power while the contents of file registers are changed. If the power is turned OFF during the change, the data stored in file registers may be filled with unexpected values, or a parameter error may occur.

6) Write to the EEPROM - It takes 80 ms to write data in one continuous block (500 points) to the EEPROM. Note that execution of the program is paused during this period, but the watchdog timer is automatically refreshed. - It takes 10 ms to write data in one point to the EEPROM. Note that execution of the program is paused during this period, and the watchdog timer is automatically refreshed. - Write to the EEPROM using peripheral equipment.

How to Read Explanation of Instructions

7. File register operation File registers are secured inside the built-in memory or memory cassette. Different from general data registers, file registers can be read and written directly only by peripheral equipment or BMOV instruction.
8. If a file register is not specified as the destination in BMOV instruction, the file register is not accessed. a) Outline of memory operation

D 0 D200

Applied Instructions (Program Flow)

500 points 14 blocks maximum (7000 points maximum) [A]

[B]

Applied Instructions (Move and Compare)

When X000 is set to ON, the data register area [B] is read.

BMOVP(X000, D1100, K400, D200);

BMOVP EN s n

Applied Instructions (Arithmetic and Logical Operation)

D1100 D200

A file register can be specified as . But if a same number with is specified, the same-number register update mode is selected. However, even if a file register having different number is specified for and respectively, data cannot be transferred from the file register area to another file register area. In such a case, read the contents of a file register specified as in the same-number register update mode to the data register area [B] once, and then write the data.

Applied Instructions (Rotation and Shift Operation)

Show 18 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · Inside built-in RAM · or optional cassette · Inside system RAM · Program · Image memory · memory · Program/ comment · Data register · Read · file register · D1100 Data register · Data register · b) Program examples · d K400
Page 156 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 156 · click to enlarge
Page 156

8 Applied Instructions (Move and Compare)

8.7 FMOV / Fill Move

8.7 FMOV / Fill Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction transfers same data to specified number of devices.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 156)
Fig. 116 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 156)
Fig. 117 · 2. Set data

Transfer source data or device storing data ANY16 ANY32

Head word device of transfer destination (Same data is transferred from the transfer source at one time.) ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 156)
Fig. 118 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

S: Refer to "Cautions".

Page 157 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 157 · click to enlarge
Page 157

8 Applied Instructions (Move and Compare)

8.7 FMOV / Fill Move

Function and operation explanation

1. 16-bit operation(FMOV, FMOVP) The data or contents of a device specified by are transferred to "n" devices starting from a device specified by .
  • The contents will be same among all of "n" devices.
  • If the number of points specified by "n" exceeds the device number range, data is transferred within the possible range.
  • While the command input is OFF, the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer source specified by does not change.
  • When a constant (K) is specified as the transfer source specified by , it is automatically converted into binary.

FMOV EN s n

d Transfer source data Number of points

How to Read Explanation of Instructions

2. 32-bit operation(DFMOV, DFMOVP) The contents of the transfer source specified by are transferred to "n" 32-bit devices starting from the device specified by .
  • The contents will be the same among all of "n" 32-bit devices.
  • If the number of points specified by "n" exceeds the device number range, data is transferred within the possible range.
  • While the command input is OFF, the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer source specified by does not change.
  • When a constant (K) is specified as the transfer source specified by , it is automatically converted into binary.

Applied Instructions (Program Flow)

s s Command input

DFMOV EN s n

+3, +2 d d

+5, +4 d d

Applied Instructions (Move and Compare)

+7, +6 d d

+9, +8 d d

Applied Instructions (Arithmetic and Logical Operation)

Cautions

1. 32-bit instructions are not provided in the FX U PLC Ver. 2.30 or earlier.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Rotation and Shift Operation)

Show 21 more labels / short text on this page
Instruction List · Configuration of Instruction · Command input · d s · Transfer destination device · +1 · transferred · +2 · n · +3 · +4 · Basic Instruction · Step Ladder Instructions · +1, · +1, d d · Transfer source data · Transfer destination device · Number of points · transferred · n · d d
Page 158 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 158 · click to enlarge
Page 158

8 Applied Instructions (Move and Compare)

8.7 FMOV / Fill Move

Program examples

1. When writing specified data to two or more devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 158)
Fig. 119 · Program examples
Page 159 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.8 XCH / Exchange
Page 159 · click to enlarge
Page 159
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.8 XCH / Exchange diagram (page 159)
Fig. 120 · 8.8 XCH / Exchange

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S1 z z z

z S1 S1 z z z

Page 160 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 160 · click to enlarge
Page 160

8 Applied Instructions (Move and Compare)

8.8 XCH / Exchange

Function and operation explanation

1. 16-bit operation(XCH, XCHP) Data is exchanged between the device specified by and the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 160)
Fig. 121 · Function and operation explanation
2. 32-bit operation(DXCH, DXCHP) Data is exchanged between the device specified by and the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 160)
Fig. 122 · Function and operation explanation

Extension function

When the instruction is executed while M8160 is ON, high-order 8 bits (byte) and low-order 8 bits (byte) of a word device are exchanged each other. (The FXU PLC of V2.30 or earlier does not support the extension function.) This is the same operation as SWAP instruction, so use SWAP instruction for newly programming. In the case of 32-bit operation, high-order 8 bits (byte) and low-order 8 bits (byte) of a word device are changed.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Extension function diagram (page 160)
Fig. 123 · Extension function

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable.

Error

An operation error occurs in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

  • When M8160 is ON, and the device numbers specified by and are different.
Page 161 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 8.9 BCD / Conversion to Binary Coded Decimal
Page 161 · click to enlarge
Page 161
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 8.9 BCD / Conversion to Binary Coded Decimal diagram (page 161)
Fig. 124 · 8.9 BCD / Conversion to Binary Coded Decimal

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts binary (BIN) data into binary-coded decimal (BCD) data. Binary data is used in operations in PLCs. Use this instruction to display numeric values on the seven- segment display unit equipped with BCD decoder.

Word device storing the conversion source (binary) data ANY16 ANY32

Word device of the conversion destination (binary-coded decimal) data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

Page 162 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 162 · click to enlarge
Page 162

8 Applied Instructions (Move and Compare)

8.9 BCD / Conversion to Binary Coded Decimal

Function and operation explanation

1. 16-bit operation(BCD, BCDP) This instruction converts the binary (BIN) data specified by into binary-coded decimal (BCD) data, and transfers the converted BCD data to the device specified by .
  • The data of the device specified by can be converted if it is within the range from K0 to K9999 (BCD).
  • The table below shows digit specification for the devices specified by and respectively.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 162)
Fig. 125 · Function and operation explanation
2. 32-bit operation(DBCD, DBCDP) This instruction converts the binary (BIN) data specified by into binary-coded decimal (BCD) data, and transfers the converted BCD data to the device specified by .
  • The data of the device specified by can be converted if it is within the range from K0 to K99999999 (BCD).
  • The table below shows digit specification for the devices specified by and respectively.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 162)
Fig. 126 · Function and operation explanation
Page 163 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 163 · click to enlarge
Page 163

8 Applied Instructions (Move and Compare)

8.9 BCD / Conversion to Binary Coded Decimal

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing the instruction with M8023 ON, conversion takes place from binary float to decimal float.

M8023

D2 D0

M8000

M8023

D3 D2

For the float conversion, only data register (D) is applicable as the device for and .

Related instruction

BIN Converts binary-coded decimal (BCD) data into binary (BIN) data.

Cautions

How to Read Explanation of Instructions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Because conversion between binary-coded decimal data and binary data is automatically executed in SEGL and ARWS instructions, BCD instruction is not required.
3. Binary data is used in all operations in PLCs including arithmetic operations (+, -, × and ÷ ), increment and decrement instructions.
  • When receiving the digital switch information in the binary-coded decimal (BCD) format into a PLC, use BIN instruction for converting BCD data into binary data.
  • When outputting data to the seven-segment display unit handling binary-coded decimal (BCD) data, use BCD instruction for converting binary data into BCD data.
4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Error

In BCD or BCDP (16-bit type) instructions, an operation error occurs when the value is outside the range from 0 to 9,999. In DBCD or DBCDP (32-bit type) instructions, an operation error occurs when the value is outside the range from 0 to 99,999,999.

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 9 more labels / short text on this page
DBCD EN s · Instruction List · Binary float value · Variable · Decimal float value · Configuration of Instruction · Instruction Function · Basic Instruction · Step Ladder Instructions
Page 164 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. When the seven-segment display unit has 5 to 8 digits
Page 164 · click to enlarge
Page 164

8 Applied Instructions (Move and Compare)

8.9 BCD / Conversion to Binary Coded Decimal

Program examples

1. When the seven-segment display unit has 1 digit

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 164)
Fig. 127 · Program examples

2. When the seven-segment display unit has 2 to 4 digits

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. When the seven-segment display unit has 2 to 4 digits diagram (page 164)
Fig. 128 · 2. When the seven-segment display unit has 2 to 4 di…

In the case of 2 digits: K2 In the case of 3 digits: K3 In the case of 4 digits: K4

3. When the seven-segment display unit has 5 to 8 digits

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. When the seven-segment display unit has 5 to 8 digits diagram (page 164)
Fig. 129 · 3. When the seven-segment display unit has 5 to 8 di…

In the case of 5 digits: K5 In the case of 6 digits: K6 In the case of 7 digits: K7 In the case of 8 digits: K8

Page 165 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 165 · click to enlarge
Page 165

8 Applied Instructions (Move and Compare)

8.10 BIN / Conversion to Binary

8.10 BIN / Conversion to Binary

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts binary-coded decimal (BCD) data into binary (BIN) data. Use this instruction to convert a binary-coded decimal (BCD) value such as a value set by a digital switch into binary (BIN) data and to receive the converted binary data so that the data can be handled in operations in PLCs.

1. Format and operation, execution form

Expression in each language

BIN 16 bits Continuous BIN(EN,s,d);

How to Read Explanation of Instructions

BINP 16 bits Pulse BINP(EN,s,d);

DBIN 32 bits Continuous DBIN(EN,s,d);

DBINP 32 bits Pulse DBINP(EN,s,d);

2. Set data

EN Execution condition Bit

Word device storing the conversion source (binary-coded decimal) data ANY16 ANY32

ENO Execution state Bit

Applied Instructions (Program Flow)

Word device of the conversion destination (binary) ANY16 ANY32

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

Applied Instructions (Move and Compare)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

S: Refer to "Cautions".

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 23 more labels / short text on this page
Instruction List · Configuration of Instruction · Instruction · name Operation Execution · form · BIN EN s · BINP EN s · DBIN EN s · Basic Instruction · DBINP EN s · Data type · Step Ladder Instructions · Variable Description · 16-bit operation · 32-bit operation · Input variable · Output variable · Operand · Special · Character · User · String Pointer · type
Page 166 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 166 · click to enlarge
Page 166

8 Applied Instructions (Move and Compare)

8.10 BIN / Conversion to Binary

Function and operation explanation

1. 16-bit operation(BIN, BINP) This instruction converts the binary-coded decimal (BCD) data specified by into binary (BIN) data, and transfers the converted binary data to the device specified by .
  • The data of the device specified by can be converted if it is within the range from 0 to 9999 (BCD).
  • The table below shows digit specification for the devices specified by and .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 166)
Fig. 130 · Function and operation explanation
2. 32-bit operation(DBIN, DBINP) This instruction converts the binary-coded decimal (BCD) data specified by into binary (BIN) data, and transfers the converted binary data to the device specified by .
  • The data of the device specified by can be converted if it is within the range from 0 to 99999999 (BCD).
  • The table below shows digit specification for the devices specified by and .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 166)
Fig. 131 · Function and operation explanation

When "K8X000" is specified (sequence on the right) X034

Page 167 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 167 · click to enlarge
Page 167

8 Applied Instructions (Move and Compare)

8.10 BIN / Conversion to Binary

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing the instruction with M8023 ON, conversion takes place from binary-coded decimal float to binary float.

M8023

D6 D4

M8000

M8023

D7 D6 Binary float value

For the float conversion, only data register (D) is applicable as the device for and .

Related instruction

BCD Converts binary (BIN) data into binary-coded decimal (BCD) data.

How to Read Explanation of Instructions

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Because conversion between binary-coded decimal data and binary data is automatically executed in DSW, BIN instruction is not required.
3. Binary data is used in all operations in PLCs including arithmetic operations (+, -, × and ÷ ), increment and decrement instructions.
  • When receiving the digital switch information in the binary-coded decimal (BCD) format into a PLC, use BIN instruction for converting BCD data into binary data.
  • When outputting data to the seven-segment display unit handling binary-coded decimal (BCD) data, use BCD instruction for converting binary data into BCD data.
4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Error

When the data of specified by is not binary-coded decimal (BCD), M8067 (operation error) turns ON. But M8068 (operation error latch) does not turn ON.

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 8 more labels / short text on this page
Instruction List · DBIN EN s · Decimal float value · Variable · Configuration of Instruction · Instruction Function · Basic Instruction · Step Ladder Instructions
Page 168 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. When the digital switch has 5 to 8 digits
Page 168 · click to enlarge
Page 168

8 Applied Instructions (Move and Compare)

8.10 BIN / Conversion to Binary

Program examples

1. When the digital switch has 1 digit

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 168)
Fig. 132 · Program examples

2. When the digital switch has 2 to 4 digits

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. When the digital switch has 2 to 4 digits diagram (page 168)
Fig. 133 · 2. When the digital switch has 2 to 4 digits

Output destination In the case of 2 digits: K2 In the case of 3 digits: K3 In the case of 4 digits: K4

3. When the digital switch has 5 to 8 digits

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. When the digital switch has 5 to 8 digits diagram (page 168)
Fig. 134 · 3. When the digital switch has 5 to 8 digits

Output destination In the case of 5 digits: K5 In the case of 6 digits: K6 In the case of 7 digits: K7 In the case of 8 digits: K8

Page 169 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DNEGP
Page 169 · click to enlarge
Page 169

9 Applied Instructions (Arithmetic and Logical Operation)

9. Applied Instructions (Arithmetic and Logical Operation)

This chapter introduces the instructions for arithmetic operations and logical operations of numeric data.

Instruction name Function Reference

ADDP

Addition Section 9.1 DADD

DADDP

SUBP

Subtraction Section 9.2 DSUB

DSUBP

MULP

Multiplication Section 9.3 DMUL

DMULP

DIVP

Division Section 9.4 DDIV

How to Read Explanation of Instructions

DDIVP

INC

Increment Section 9.5 INCP

DINC

DINCP

DEC

Decrement Section 9.6 DECP

DDEC

DDECP

WAND

Logical Word AND Section 9.7 WANDP

DAND

DANDP

WOR

Logical Word OR Section 9.8 WORP

DOR

DORP

WXOR

Applied Instructions (Program Flow)

Logical Exclusive OR Section 9.9 WXORP

DXOR

DXORP

NEG

Negation Section 9.10 NEGP

DNEG

Applied Instructions (Move and Compare)

DNEGP

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 4 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 170 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 170 · click to enlarge
Page 170

9 Applied Instructions (Arithmetic and Logical Operation)

9.1 ADDP / Addition

9.1 ADDP / Addition

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes addition by two values to obtain the result (A + B = C)

→ For the floating point addition instruction [DEADD], refer to Section 18.8.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 170)
Fig. 135 · 1. Format and operation, execution form

Use application functions (ADD(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 170)
Fig. 136 · 2. Set data

Data for addition or word device storing data ANY16 ANY32

Data for addition or word device storing data ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 170)
Fig. 137 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 z z z

S: Refer to "Cautions".

Page 171 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related device
Page 171 · click to enlarge
Page 171

9 Applied Instructions (Arithmetic and Logical Operation)

9.1 ADDP / Addition

Function and operation explanation

1. 16-bit operation(ADDP) The data specified by and are added in the binary format, and the addition result is transferred to the device specified by .

ADDP EN s1 s2

Addition data 1 Device storing the addition result

+ → d s1 s2

  • The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is added algebraically. 5+(-8)=-3
  • When a constant (K) is specified in or , it is automatically converted into the binary format.
2. 32-bit operation(DADD, DADDP) The data specified by and are added in the binary format, and the addition result is transferred to the device specified by .

Command input DADD EN s1 s2

How to Read Explanation of Instructions

d Device storing the addition result

s1 s2 s2 [ +1, ] + [ +1, ] → [ +1, ] s1 d d

  • The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is added algebraically. 5,500+(-8,540)=-3,040
  • When a constant (K) is specified in or , it is automatically converted into the binary format.

Related device

1. Relationship between the flag operation and the sign → For the flag operations, refer to Section 1.3.4.

M8020 Zero ON : When the operation result is 0 OFF : When the operation result is not 0

ONWhen the operation result is less than -32,768 (in 16-bit operation) or -2,147,483,648 (in

32-bit operation), the borrow flag operates. OFF : When the operation result is not less than -32,768 (in 16-bit operation) or

-2,147,483,648 (in 32-bit operation)

Applied Instructions (Program Flow)

ONWhen the operation result is more than 32,767 (in 16-bit operation) or 2,147,483,647 (in

32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or

Applied Instructions (Move and Compare)

–1, 0, 1 –2, –1, 0, –32,768 32,767, 0, 1, 2

The most significant bit of data becomes "0".

bit of data becomes "1".

Applied Instructions (Arithmetic and Logical Operation)

–2, –1, 0, –2,147,483,648 –1, 0, 1 2,147,483,647, 0, 1, 2

Applied Instructions (Rotation and Shift Operation)

Show 23 more labels / short text on this page
Command input · Instruction List · Addition data 2 · Configuration of Instruction · Addition data 1 · Addition data 2 · Basic Instruction · Step Ladder Instructions · Device Name Description · M8021 Borrow · M8022 Carry · 2,147,483,647(in 32-bit operation) · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · The most significant · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag
Page 172 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ADDP(X001, D0, K1, D0);
Page 172 · click to enlarge
Page 172

9 Applied Instructions (Arithmetic and Logical Operation)

9.1 ADDP / Addition

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place. In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.

Cautions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. When using a 32-bit operation instruction (DADD or DADDP) and specifying word devices, a 16-bit word device on the low-order side is specified first, and a word device with the subsequent device number is automatically set for the high-order 16 bits. To prevent number overlap, it is recommended to always specify an even number, for example.
3. The same device number can be specified for both the source and the destination. In this case, note that the addition result changes in every operation cycle if a continuous operation type instruction (ADD or DADD) is used.

DADD EN s1 s2

(D1,D0) + 25 → (D1,D0)

D0 D0

K25

4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

1. Difference between ADDP and INCP instruction caused by a program for adding "+1". When ADDP instruction is executed, "1" is added to the contents of D0 every time X001 turns ON from OFF. ADDP instruction is similar to INCP instruction described later except the contents shown in the table below.

ADDP/DADD/DADDP INC/INCP/DINC/DINCP

Flag (zero, borrow, carry) Operates Does not operate

+(+1)= +32,767 → 0 → +1 → +2 → +32,767 → -32,768 → -32,767

+(-1)= ← -2 ← -1 ← 0 ← -32,768 -

+(+1)= +2,147,483,647 → 0 → +1 → +2 → +2,147,483,647 → -2,147,483,648 → -2,147,483,647

+(-1)= ← -2 ← -1 ←0 ← -2,147,483,648 -

ADDP EN s1 s2

ADDP(X001, D0, K1, D0);

(D 0) +1 → ( D 0)

D0 D0

K1

INCP EN ENO

INCP(X001, D0); (D 0) +1 →( D 0)

Operation result · 16-bit operation · 32-bit operation

Page 173 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 9.2 SUBP / Subtraction
Page 173 · click to enlarge
Page 173
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.2 SUBP / Subtraction diagram (page 173)
Fig. 138 · 9.2 SUBP / Subtraction

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes subtraction using two values to obtain the result (A -B = C).

→ For the floating point subtraction instruction [DESUB], refer to Section 18.9.

Use application functions (SUB(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.

Data for subtraction or word device storing data ANY16 ANY32

Data for subtraction or word device storing data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 z z z

Page 174 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related device
Page 174 · click to enlarge
Page 174

9 Applied Instructions (Arithmetic and Logical Operation)

9.2 SUBP / Subtraction

Function and operation explanation

1. 16-bit operation(SUBP) The data specified by is subtracted from the data specified by in the binary format, and the subtraction result is transferred to .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 174)
Fig. 139 · Function and operation explanation
  • The most significant bit of each piece of data indicates the sign (positive: 0 or negative: 1), and data is subtracted algebraically. (5-(-8)=13)
  • When a constant (K) is specified in or , it is automatically converted into the binary format.
2. 32-bit operation(DSUB, DSUBP) The data specified by is subtracted from the data specified by in the binary format, and the subtraction result is transferred to .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 174)
Fig. 140 · Function and operation explanation

s1 s2 s2 [ +1, ] – [ +1, ] → [ +1, ] s1 d d Subtraction

  • The most significant bit of each piece of data indicates the sign (positive: 0 or negative: 1), and data is subtracted algebraically. (5,500-(-8,540)=14,040)
  • When a constant (K) is specified in or , it is automatically converted into the binary format.

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place. In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.

Related device

1. Relationship between the flag operation and the sign → For the flag operations, refer to Section 1.3.4.

M8020 Zero ON : When the operation result is 0 OFF : When the operation result is not 0

ONWhen the operation result is less than -32,768 (in 16-bit operation) or -2,147,483,648 (in

32-bit operation), the borrow flag operates. OFF : When the operation result is not less than -32,768 (in 16-bit operation) or

-2,147,483,648 (in 32-bit operation)

ONWhen the operation result is more than 32,767 (in 16-bit operation) or 2,147,483,647 (in

32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or

–1, 0, 1 –2, –1, 0, –32,768 32,767, 0, 1, 2

The most significant bit of data becomes "0".

bit of data becomes "1".

–2, –1, 0, –2,147,483,648 –1, 0, 1 2,147,483,647, 0, 1, 2

Show 15 more labels / short text on this page
Device Name Description · M8021 Borrow · M8022 Carry · 2,147,483,647(in 32-bit operation) · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · The most significant · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag
Page 175 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DECP EN ENO
Page 175 · click to enlarge
Page 175

9 Applied Instructions (Arithmetic and Logical Operation)

9.2 SUBP / Subtraction

Cautions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. When using a 32-bit operation instruction (DSUB or DSUBP) and specifying word devices, a 16-bit word device on the low-order side is specified first, and a word device with the subsequent device number is automatically set for the high-order 16 bits. To prevent number overlap, it is recommended to always specify an even number, for example.
3. The same device number can be specified for both the source and the destination. In this case, note that the addition result changes in every operation cycle if a continuous operation type instruction (DSUB) is used.

DSUB EN s1 s2

d (D1,D0) – 25 → (D1,D0)

D0 D0 K25

4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

How to Read Explanation of Instructions

Program examples

1. Difference between SUBP and DECP instruction caused by a program for subtracting "1" "1" is subtracted from the contents of D0 every time X001 turns ON from OFF. SUB instruction is similar to DECP instruction described later except the contents shown in the table below.

SUBP/DSUB/DSUBP instructions DEC/DECP/DDEC/DDECP instructions

Flag (zero, borrow, carry) Operates Does not operate

-(+1)= ← -2 ← -1 ← 0 ← -32,768 -32,768 → +32,767 → +32,766

-(-1)= +32,767 → 0 → +1 → +2 → -

-(+1)= ← -2 ← -1 ←0 ← -2,147,483,648 -2,147,483,648 → +2,147,483,647 → +2,147,483,646

-(-1)= +2,147,483,647 → 0 → +1 → +2 → -

SUBP(X001, D0, K1, D0);

SUBP EN s1 s2

(D 0) – 1 → (D 0)

D0 D0

K1

Applied Instructions (Program Flow)

DECP EN ENO

DECP(X001, D0); (D 0) – 1 → (D 0)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 7 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Operation result · 16-bit operation · 32-bit operation · Step Ladder Instructions
Page 176 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 176 · click to enlarge
Page 176

9 Applied Instructions (Arithmetic and Logical Operation)

9.3 MULP / Multiplication

9.3 MULP / Multiplication

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes multiplication by two values to obtain the result (A × B = C).

→ For the floating point multiplication instruction [DEMUL], refer to Section 18.10.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 176)
Fig. 141 · 1. Format and operation, execution form

Use application functions (MUL(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 176)
Fig. 142 · 2. Set data

Data for multiplication or word device storing the multiplication data ANY16 ANY32

Data for multiplication or word device storing the multiplication data ANY16 ANY32

Head word device storing the multiplication result ANY32 ARRAY [1..2] OF ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 176)
Fig. 143 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 S3 z

S: Refer to "Cautions".

Page 177 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K795(H031B)
Page 177 · click to enlarge
Page 177

9 Applied Instructions (Arithmetic and Logical Operation)

9.3 MULP / Multiplication

Function and operation explanation

1. 16-bit operation(MULP) The data specified by is multiplied by data specified by in the binary format, and the multiplication result is transferred to 32-bit (double word) device specified by .

Command input MULP EN s1 s2

BIN BIN BIN ( ) × ( ) → ( +1, )

d Device storing the multiplication result

s1 s2 d d 16 bits 32 bits

  • The most significant bit of each piece of data indicates the sign (positive: 0 or negative: 1), and data is multiplied algebraically. (5 × (-8)=-40)
  • When a constant (K) is specified in or , it is automatically converted into the binary format.
  • When a digit (K1 to K8) is specified for the device specified by : A digit can be specified in the range from K1 to K8. For example, when K2 is specified, only low-order 8 bits can be obtained out of the product (32 bits).

MULP EN s1 s2

How to Read Explanation of Instructions

K53 K15

K53(H0035)

K15(H000F)

When command contact turns ON

K795(H031B)

Sign bit (0=Positive 1=Negative)

Y027 Y026 Y025 ··· Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000

0 0 0 ··· 0 0 1 1 0 0 0 1 1 0 1 1

Operation result is output to K2Y000

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 14 more labels / short text on this page
Instruction List · Multiplication · data 1 Multiplication · 16 bits · data 2 · Configuration of Instruction · Command input · d K2Y000 · s1 · × · s2 · Basic Instruction · Step Ladder Instructions · Not output
Page 178 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 178 · click to enlarge
Page 178

9 Applied Instructions (Arithmetic and Logical Operation)

9.3 MULP / Multiplication

2. 32-bit operation(DMUL, DMULP) The data specified by is multiplied by the data specified by in the binary format, and the multiplication result is transferred to 64-bit (four word devices).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.3 MULP / Multiplication diagram (page 178)
Fig. 144 · 9.3 MULP / Multiplication

→ [ +3, +2, +1, ] BIN BIN [ +1, ] × [ +1, ]

d s1 s2 s1 s2 d d d 32 bits 64 bits

  • The most significant bit of each piece of data indicates the sign (positive: 0 or negative: 1), and data is multiplied algebraically. (5,500 × (-8,540)=-46,970,000)
  • When a constant (K) is specified in or , it is automatically converted into the binary format.
  • When a digit (K1 to K8) is specified for the device specified by , the result is obtained only for loworder 32 bits, and is not obtained for high-order 32 bits. Transfer the data to word devices once, then execute the operation.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.3 MULP / Multiplication diagram (page 178)
Fig. 145 · 9.3 MULP / Multiplication

D100 is output to Y017 to Y000 D101 is output to Y037 to Y020

D102 is output to Y057 to Y040 D103 is output to Y077 to Y060

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place, for example, (D1, D0) × (D3, D2) = (D5, D4). In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.

Related device

1. Relationship between the flag operation and the sign

M8304*1 Zero ON : When the operation result is 0 OFF : When the operation result is not 0

*1. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Available in the FX3U and FX3UC PLCs of Ver. 2.30 or later.

Cautions

1. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable. S 3:Available only for a 16-bit operation. Not available for a 32-bit operation.
2. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. When a 32-bit operation (DMUL or DMULP) is used, "Z" cannot be specified to the device specified by
4. In monitoring the operation results by a programming tool, 64-bit data as the operation results cannot be monitored at one time even if a word device is used. In such a case, the FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs can use floating point operation.

→ For the floating point operation, refer to Chapter 18.

Device Name Description

Page 179 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 179 · click to enlarge
Page 179

9 Applied Instructions (Arithmetic and Logical Operation)

9.3 MULP / Multiplication

Program examples

1. 16-bit operation

MULP EN s1 s2

(D 0) × (D 2) × (D 5, D 4) 8 9 72

[ ST ]

MULP(X000, D0, D2, D4);

2. 32-bit operation

DMUL EN s1 s2

(D 1,D 0) × (D 3,D 2) → (D 7,D 6,D 5,D 4) 1,756 327 574,212

D4 D0

How to Read Explanation of Instructions

[ ST ]

DMUL(X001, D0, D2, D4);

Function changes according to versions

Item Function summary FX3S FX3G FX3GC FX3U FX3UC

Ver. 1.00 or

Ver. 1.00 or

Ver. 1.40 or

Ver. 2.30 or

Ver. 2.30 or

later Zero flag Turns the special device M8304 ON when the operation result of MUL instruction is 0.

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 12 more labels / short text on this page
[Structured ladder/FBD] · Instruction List · d D4 · Configuration of Instruction · [Structured ladder/FBD] · Compatible versions · Basic Instruction · later · later · later · later · Step Ladder Instructions
Page 180 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 180 · click to enlarge
Page 180

9 Applied Instructions (Arithmetic and Logical Operation)

9.4 DIVP / Division

9.4 DIVP / Division

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes division by two values to obtain the result [A ÷ B =C...(remainder)].

→ For the floating point division instruction [DEDIV], refer to Section 18.11.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 180)
Fig. 146 · 1. Format and operation, execution form

Use application functions (DIV(_E))) for 16-bit operation and continuous execution. For details, refer to the following manual.

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 180)
Fig. 147 · 2. Set data

Data for division or word device storing the data (dividend). ANY16 ANY32

Data for division or word device storing the data (divisor). ANY16 ANY32

Head word device storing the division result (quotient and remainder)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 180)
Fig. 148 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 S3 z

S: Refer to "Cautions".

Page 181 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related device
Page 181 · click to enlarge
Page 181

9 Applied Instructions (Arithmetic and Logical Operation)

9.4 DIVP / Division

Function and operation explanation

1. 16-bit operation(DIVP) The contents specified by indicates the dividend, the contents specified by indicates the divisor, the quotient and remainder are transferred to the device specified by .

DIVP EN s1 s2

Device storing the division result

BIN ( ) ÷ ( ) → ( )··· ( +1)

16 bits s1 s2 d d 16 bits 16 bits 16 bits

  • The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is divided algebraically, for example, 36 ÷ (-5) = -7 (quotient) and 1 (remainder).
  • Two devices in total starting from are occupied to store the operation result (quotient and remainder). Make sure that these two devices are not used for other control.
  • When a constant (K) is specified in or , it is automatically converted into the binary format.
2. 32-bit operation(DDIV, DDIVP) The contents specified by indicates the dividend, the contents specified by indicates the divisor, the quotient and remainder are transferred to the device specified by .

How to Read Explanation of Instructions

Command input Dividend Divisor Quotient Remainder

DDIV EN s1 s2

s1 s2 s2 [ +1, ] ÷ [ +1, ] → [ +1, ] ··· [ +3, +2] s1 d BIN

Division data 1 Division data 2

d Device storing the division result 32 bits

32 bits 32 bits 32 bits

  • Four devices in total starting from are occupied to store the operation result (quotient and remainder). Make sure that these four devices are not used for other control.
  • The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data is divided algebraically, for example, 5,500 ÷ (-540) = -10 (quotient) and 100 (remainder).
  • When a constant (K) is specified in or , it is automatically converted into the binary format.

Extension function(FX U and FX 2C PLCs)

The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place, for example, (D1, D0) ÷ (D3, D2) = (D5, D4). In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.

Applied Instructions (Program Flow)

Related device

M8304*1 Zero ON : When the operation result is 0 OFF : When the operation result is not 0

ONWhen the operation result is more than 32,767 (in 16-bit operation) or 2,147,483,647 (in

Applied Instructions (Move and Compare)

32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or

*1. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Available in the FX3U and FX3UC PLCs of Ver. 2.30 or later.

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 12 more labels / short text on this page
Command input · Dividend · Divisor Quotient Remainder · Instruction List · Division data 1 · Division data 2 · Configuration of Instruction · Basic Instruction · Step Ladder Instructions · Device Name Description · M8306*1 Carry · 2,147,483,647(in 32-bit operation)
Page 182 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 182 · click to enlarge
Page 182

9 Applied Instructions (Arithmetic and Logical Operation)

9.4 DIVP / Division

Cautions

1. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable. S 3:Available only for a 16-bit operation. Not available for a 32-bit operation.
2. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. The most significant bit of the quotient and remainder indicates the sign (positive: 0 or negative: 1).
4. The quotient is negative when either the dividend or divisor is negative. The remainder is negative when the dividend is negative.
5. The remainder is not obtained when a bit device is specified with digit specification for the device specified by .
6. In a 32-bit operation (by DDIV or DDIVP), Z cannot be specified as the device specified by .

Program examples

1. 16-bit operation

DIVP EN s1 s2

Dividend Divisor Quotient Remainder D4

(D 0) ÷ (D 2) → (D 4) ··· (D 5) 100 33 3 1

D0 D2

[ ST ]

DIVP(X000,D0,D2,D4);

2. 32-bit operation

DDIV EN s1 s2

Dividend Divisor Quotient Remainder

D4 D0

(D 1, D 0) ÷ (D 3, D 2) → (D 5, D 4) ··· (D 7, D 6) 100,000 3,333 30 10

[ ST ]

DDIV(X001, D0, D2, D4);

Function changes according to versions

Item Function summary FX3S FX3G FX3GC FX3U FX3UC

Zero flag Turns M8304 ON when the operation result of DIV instruction is 0.

Turns M8306 ON when the operation result of DIV instruction overflows. 16-bit operation : Only when the maximum negative value (-32,768) is divided by "-1". 32-bit operation : Only when the maximum negative value (-2,147,483,648) is divided by "-1".

Ver. 1.00

Ver. 1.00

Ver. 1.40

Ver. 2.30

Ver. 2.30

Show 9 more labels / short text on this page
[Structured ladder/FBD] · [Structured ladder/FBD] · Compatible versions · or later · or later · or later · or later · or later · Carry flag
Page 183 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DINC EN ENO
Page 183 · click to enlarge
Page 183

9 Applied Instructions (Arithmetic and Logical Operation)

9.5 INC / Increment

9.5 INC / Increment

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction increments the data of a specified device by "1" (+1 addition).

1. Format and operation, execution form

Expression in each language

INC EN ENO

INC 16 bits Continuous INC(EN,d);

INCP EN ENO

INCP 16 bits Pulse INCP(EN,d);

How to Read Explanation of Instructions

DINC EN ENO

DINC 32 bits Continuous DINC(EN,d);

DINCP EN ENO

DINCP 32 bits Pulse DINCP(EN,d);

2. Set data

Input variable EN Execution condition Bit

ENO Execution state Bit

Word device storing data to be incremented by "1" ANY16 ANY32

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

Applied Instructions (Program Flow)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

S: Refer to "Cautions".

Applied Instructions (Move and Compare)

Function and operation explanation

1. 16-bit operation(INC, INCP) The contents of the device specified by is incremented by "1", and the increment result is transferred to .

+1 → d d INC EN ENO

Applied Instructions (Arithmetic and Logical Operation)

2. 32-bit operation(DINC, DINCP) The contents of the device specified by is incremented by "1", and the increment result is transferred to .

Applied Instructions (Rotation and Shift Operation)

DINC EN ENO

d d [ +1, ] +1 → [ +1, ] d d d

Show 22 more labels / short text on this page
Instruction List · Instruction · name Operation Execution · form · Configuration of Instruction · Basic Instruction · Data type · Variable Description · 16-bit operation · 32-bit operation · Step Ladder Instructions · Output variable · Special · Character · Operand · String Pointer · type · User · Command input · +1 addition data · Command input · +1 addition data
Page 184 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M0
Page 184 · click to enlarge
Page 184

9 Applied Instructions (Arithmetic and Logical Operation)

9.5 INC / Increment

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Note that data is incremented in every operation cycle in a continuous operation type instruction.
3. In a 16-bit operation, when "+32,767" is incremented by "1", the result is "-32,768". Flags (zero, borrow and carry) are not activated at this time.
4. In a 32-bit operation, when "+2,147,483,647" is incremented by "1", the result is "-2,147,483,648". Flags (zero, borrow and carry) are not activated at this time.
5. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

X010 MOVP EN s

0 (Z)

Z is cleared by reset input X010.

d K0 Z M1

(C 0Z) (K4Y000) BIN BCD

The current values of counter C0 to C9 are BCD converted, and the result is outputted into K4Y000.

INCP EN ENO

Every time X011 turns ON, the current values are outputted one at a time in the order of C0, C1, ... and C9.

(Z)+1 (Z)

Z

CMPP EN s1 s2

When (Z) is 10 M 1=ON

M0

Z

[ ST ]

MOVP(X010 OR M1, K0, Z); BCDP(X011, CN0Z, K4Y000); INCP(X011, Z); CMPP(X011, K10, Z, M0);

Show 4 more labels / short text on this page
[Structured ladder/FBD] · BCDP EN s · d CN0Z K4Y000 · d K10
Page 185 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DDEC EN ENO
Page 185 · click to enlarge
Page 185

9 Applied Instructions (Arithmetic and Logical Operation)

9.6 DEC / Decrement

9.6 DEC / Decrement

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction decrements the data of a specified device by "1" (-1 addition).

1. Format and operation, execution form

Expression in each language

DEC EN ENO

DEC 16 bits Continuous DEC(EN,d);

DECP EN ENO

DECP 16 bits Pulse DECP(EN,d);

How to Read Explanation of Instructions

DDEC EN ENO

DDEC 32 bits Continuous DDEC(EN,d);

DDECP EN ENO

DDECP 32 bits Pulse DDECP(EN,d);

2. Set data

Input variable EN Execution condition Bit

ENO Execution state Bit

Device storing data to be decremented by "1" ANY16 ANY32

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Constant Real Number

Applied Instructions (Program Flow)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

S: Refer to "Cautions".

Applied Instructions (Move and Compare)

Function and operation explanation

1. 16-bit operation(DEC, DECP) The contents of the device specified by are decremented by "1", and the decremented result is transferred to the device specified by .

DEC EN ENO

Applied Instructions (Arithmetic and Logical Operation)

– 1 → d d

2. 32-bit operation(DDEC, DDECP) The contents of the device specified by are decremented by "1", and the decremented result is transferred to the device specified by .

Applied Instructions (Rotation and Shift Operation)

DDEC EN ENO

d [ +1, ] – 1 → [ +1, ] d d d

Show 22 more labels / short text on this page
Instruction List · Instruction · name Operation Execution · form · Configuration of Instruction · Basic Instruction · Data type · Variable Description · 16-bit operation · 32-bit operation · Step Ladder Instructions · Output variable · Operand · Special · Character · String Pointer · type · User · Command input · "1" decrement data · Command input · "1" decrement data
Page 186 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 186 · click to enlarge
Page 186

9 Applied Instructions (Arithmetic and Logical Operation)

9.6 DEC / Decrement

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. In a 16-bit operation, when "+32,767" is incremented by "1", the result is "-32,768". Flags (zero, borrow and carry) are not activated at this time.
3. In a 32-bit operation, when "+2,147,483,647" is incremented by "1", the result is "-2,147,483,648". Flags (zero, borrow and carry) are not activated at this time.
4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 187 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 9.7 WAND / Logical Word AND
Page 187 · click to enlarge
Page 187
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.7 WAND / Logical Word AND diagram (page 187)
Fig. 149 · 9.7 WAND / Logical Word AND

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes the logical product (AND) operation of two numeric values.

Data used for logical product or word device storing data ANY16 ANY32

Data used for logical product or word device storing data ANY16 ANY32

Word device storing the logical product result ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 z z z

Page 188 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 188 · click to enlarge
Page 188

9 Applied Instructions (Arithmetic and Logical Operation)

9.7 WAND / Logical Word AND

Function and operation explanation

1. 16-bit operation(WAND, WANDP) The logical product (AND) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 188)
Fig. 150 · Function and operation explanation
  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical product operation is executed in units of bit as shown in the table below (1 ∧ 1 = 1, 0 ∧ 1 = 0, 1 ∧ 0 = 0 and 0 ∧ 0 = 0). In the table : 1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 188)
Fig. 151 · Function and operation explanation
2. 32-bit operation(DAND, DANDP) The logical product (AND) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 188)
Fig. 152 · Function and operation explanation

d +1, ∧ +1, → +1, d s1 s2 s1 s2 d

  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical product operation is executed in units of bit as shown in the table below (1 ∧ 1 = 1, 0 ∧ 1 = 0, 1 ∧ 0 = 0 and 0 ∧ 0 = 0).
In the table1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 188)
Fig. 153 · Function and operation explanation

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 189 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 9.8 WOR / Logical Word OR
Page 189 · click to enlarge
Page 189
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.8 WOR / Logical Word OR diagram (page 189)
Fig. 154 · 9.8 WOR / Logical Word OR

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes the logical sum (OR) operation of two numeric values.

Data used for logical sum or word device storing data ANY16 ANY32

Data used for logical sum or word device storing data ANY16 ANY32

Word device storing the logical sum result. ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 z z z

Page 190 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 190 · click to enlarge
Page 190

9 Applied Instructions (Arithmetic and Logical Operation)

9.8 WOR / Logical Word OR

Function and operation explanation

1. 16-bit operation(WOR, WORP) The logical sum (OR) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 190)
Fig. 155 · Function and operation explanation
  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical sum operation is executed in units of bit as shown in the table below (1 ∨ 1 = 1, 0 ∨ 1 = 1, 0 ∨ 0 = 0 and 1 ∨ 0 = 1). In the table : 1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 190)
Fig. 156 · Function and operation explanation
2. 32-bit operation(DOR, DORP) The logical sum (OR) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 190)
Fig. 157 · Function and operation explanation

+1, ∨ +1, → +1, s1 s1 s2 s2 d d Logical sum

  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical sum operation is executed in units of bit as shown in the table below (1 ∨ 1 = 1, 0 ∨ 1 = 1, 0 ∨ 0 = 0 and 1 ∨ 0 = 1). In the table : 1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 190)
Fig. 158 · Function and operation explanation

Cautions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 191 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 9.9 WXOR / Logical Exclusive OR
Page 191 · click to enlarge
Page 191
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.9 WXOR / Logical Exclusive OR diagram (page 191)
Fig. 159 · 9.9 WXOR / Logical Exclusive OR

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes the exclusive logical sum (XOR) operation of two numeric values.

Data used for exclusive logical sum or word device storing data ANY16 ANY32

Data used for exclusive logical sum or word device storing data ANY16 ANY32

Word device storing the exclusive logical sum result ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 S2 z z z

Page 192 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 192 · click to enlarge
Page 192

9 Applied Instructions (Arithmetic and Logical Operation)

9.9 WXOR / Logical Exclusive OR

Function and operation explanation

1. 16-bit operation(WXOR, WXORP) The exclusive logical sum (XOR) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 192)
Fig. 160 · Function and operation explanation
  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical exclusive sum operation is executed in units of bit as shown in the table below (1 ∀ 1 = 0, 0 ∀ 0 = 0, 1 ∀ 0 = 1 and 0 ∀ 1 = 1).
In the table1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 192)
Fig. 161 · Function and operation explanation
2. 32-bit operation(DXOR, DXORP) The exclusive logical sum (XOR) operation is executed to the contents specified by and in units of bit, and the result is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 192)
Fig. 162 · Function and operation explanation

+1, ∀ +1, → +1, d s1 s1 s2 s2 d XOR data 1

  • While the command input is OFF, the data of the transfer destination specified by does not change.
  • While the command input is ON, the data of the transfer sources specified by and do not change.
  • When a constant (K) is specified in the transfer sources specified by and , it is automatically converted into the binary format.
  • The logical exclusive sum operation is executed in units of bit as shown in the table below (1 ∀ 1 = 0, 0 ∀ 0 = 0, 1 ∀ 0 = 1 and 0 ∀ 1 = 1).
In the table1=ON, 0=OFF
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 192)
Fig. 163 · Function and operation explanation

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Page 193 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — WXOR(X000, D10, D12, D14); CML(X000, D14, D14);
Page 193 · click to enlarge
Page 193

9 Applied Instructions (Arithmetic and Logical Operation)

9.9 WXOR / Logical Exclusive OR

Program examples

By combining WXOR and CML instructions, the exclusive logical sum not (XORNOT) operation can be executed.

WXOR EN s1 s2

WXOR(X000, D10, D12, D14); CML(X000, D14, D14);

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 6 more labels / short text on this page
Instruction List · CML EN s · d D14 D14 · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 194 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 194 · click to enlarge
Page 194

9 Applied Instructions (Arithmetic and Logical Operation)

9.10 NEG / Negation

9.10 NEG / Negation

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction obtains the 2's complement of a numeric value (by inverting each bit and adding "1"). A sign of a numeric value can be converted by this instruction.

→ For the floating point sign inversion instruction [DENEG], refer to Section 18.16.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 194)
Fig. 164 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 194)
Fig. 165 · 2. Set data

Word device which stores data for obtaining complement and will store the operation result. (The operation result will be stored in the same word device.)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 194)
Fig. 166 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S1 z z z

S: Refer to "Cautions".

Page 195 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 195 · click to enlarge
Page 195

9 Applied Instructions (Arithmetic and Logical Operation)

9.10 NEG / Negation

Function and operation explanation

1. 16-bit operation(NEG, NEGP) Each bit of the device specified by is inverted (0 → 1, 1 → 0), "1" is added, and then the result is stored in the original device.

NEG EN ENO

( ) +1 → d d

2. 32-bit operation(DNEG, DNEGP) Each bit of the device specified by is inverted (0 → 1, 1 → 0), "1" is added, and then the result is stored in the original device.

DNEG EN ENO

( +1, )+1 = ( +1, ) d

Cautions

1. Note that the complement is obtained in every scan time (operation cycle) in a continuous operation type instruction (NEG,DNEG).

How to Read Explanation of Instructions

2. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

The program examples below are provided to obtain the absolute value of a negative binary value.

1. Obtaining the absolute value of a negative value using NEG instruction

M8000

BON EN s n

In BON (ON bit check) instruction, M0 turns ON when the bit 15 (b15 among b0 to b15) of D10 is "1".

K15

M0

NEGP EN ENO

D10 → D10

NEGP instruction is executed for D10 only when M0 turns ON.

[ ST ]

BON(M8000, D0, K15, M0); NEGP(M0, D10);

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 10 more labels / short text on this page
Command input · Instruction List · Complement data · Command input · Configuration of Instruction · Complement data · Basic Instruction · [Structured ladder/FBD] · M0 RUN monitor · Step Ladder Instructions
Page 196 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Negative value expression and absolute value (reference)
Page 196 · click to enlarge
Page 196

9 Applied Instructions (Arithmetic and Logical Operation)

9.10 NEG / Negation

2. Obtaining the absolute value by SUB (subtraction) instruction Even if NEG instruction (complement operation) is not used, D30 always stores the absolute value of the difference.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9.10 NEG / Negation diagram (page 196)
Fig. 167 · 9.10 NEG / Negation

(D 10) > (D 20) (D10) = (D 20) (D 10) < (D 20) M 10=ON M 11=ON M 12=ON

In the case of "D10 D20", D10 - D20 D30

In the case of "D10 < D20", D20 - D10 D30

CMP(X000,D10, D20, M10); SUB_E(X000 AND (M10 OR M11), D10, D20, D30); SUB_E(X000 AND M12, D20, D10, D30);

Negative value expression and absolute value (reference)

In PLCs, a negative value is expressed in 2's complement. When the most significant bit is "1", it is a negative value, and its absolute value can be obtained by NEG instruction.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Negative value expression and absolute value (reference) diagram (page 196)
Fig. 168 · Negative value expression and absolute value (refere…

0 1 0

0 1

0

1

0 1

1 0

0 1 0

1 0 1

0 1

1 0

1 0

The absolute value can be obtained up to 32,767.

Page 197 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SFRD
Page 197 · click to enlarge
Page 197

10 Applied Instructions (Rotation and Shift Operation)

10. Applied Instructions (Rotation and Shift Operation)

This chapter introduces the instructions for rotating and shifting bit data and word data in specified directions.

Instruction name Function Reference

ROR

Rotation Right Section 10.1 RORP

DROR

DRORP

ROL

Rotation Left Section 10.2 ROLP

DROL

DROLP

RCR

Rotation Right with Carry Section 10.3 RCRP

DRCR

How to Read Explanation of Instructions

DRCRP

RCL

Rotation Left with Carry Section 10.4 RCLP

DRCL

DRCLP

SFTR

Bit Shift Right Section 10.5 SFTRP

SFTL

Bit Shift Left Section 10.6 SFTLP

WSFR

Word Shift Right Section 10.7 WSFRP

WSFL

Word Shift Left Section 10.8 WSFLP

SFWR

Shift Write [FIFO/FILO Control] Section 10.9 SFWRP

SFRD

Shift Read [FIFO Control] Section 10.10 SFRDP

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 4 more labels / short text on this page
Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 198 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 198 · click to enlarge
Page 198

10 Applied Instructions (Rotation and Shift Operation)

10.1 ROR / Rotation Right

10.1 ROR / Rotation Right

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts and rotates the bit information rightward by the specified number of bits without the carry flag.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 198)
Fig. 169 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 198)
Fig. 170 · 2. Set data

Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16

Word device storing data to be rotated rightward ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 198)
Fig. 171 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S1 S1 z z z S3 S4 z z z

S: Refer to "Cautions".

Page 199 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8022
Page 199 · click to enlarge
Page 199

10 Applied Instructions (Rotation and Shift Operation)

10.1 ROR / Rotation Right

Function and operation explanation

1. 16-bit operation (ROR, RORP)

"n" bits out of 16 bits of the device specified by are rotated rightward.

  • The final bit is stored in the carry flag (M8022).
  • In a device with digit specification, K4 (16-bit instruction) is valid.

"n" bits (in the case of K4)

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Before execution

1 0

M8022

After the instruction is executed once.

b0 to b3 (n-1) are moved.

How to Read Explanation of Instructions

Rightward rotation "n-1" bits The status of the bit "n-1" is copied.

High order Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

0 1 0 Carry flag M8022

The contents of b3 are stored.

2. 32-bit operation (DROR, DRORP)

"n" bits out of 32 bits of the device specified by are rotated rightward.

  • The final bit is stored in the carry flag (M8022).
  • In a device with digit specification, K8 (32-bit instruction) is valid.

"n" bits (in the case of K4)

Applied Instructions (Program Flow)

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 0

1 0

M8022

After the instruction is executed once.

The status of the bit "n-1" is copied.

b0 to b3 (n-1) are moved.

Applied Instructions (Move and Compare)

"n-1" bits The status of the bit "n-1" is copied.

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order

0 1 0

0 1 0 Carry flag M8022

Applied Instructions (Arithmetic and Logical Operation)

The contents of b3 are stored.

Applied Instructions (Rotation and Shift Operation)

Show 36 more labels / short text on this page
Command input · ROR EN n · Number of bits · Rightward rotation data · Instruction List · to be rotated · High order · Low order · Configuration of Instruction · Carry flag · "n-1" bits · After execution · Before shift · Before shift · b3 to b0 · b15 to b4 · Basic Instruction · Command input · DROR EN n · Step Ladder Instructions · Number of bits · Rightward rotation data · to be rotated · High order · Low order · b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 · Carry flag · Before execution · Rightward rotation · Low order · b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 · After execution · Before shift · Before shift · b3 to b0 · b31 to b4
Page 200 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 200 · click to enlarge
Page 200

10 Applied Instructions (Rotation and Shift Operation)

10.1 ROR / Rotation Right

Related device

→ For the carry flag use method, refer to Section 1.3.4.

M8022 Carry Turns ON when the bit shifted last from the lowest position is "1".

Cautions

1. Some restrictions to applicable devices S 1:K4Y , K4M and K4S are valid for a 16-bit operation. K8Y , K8M and K8S are valid for a 32-bit operation. S 2:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 4:The FX 3U and FX 3UC PLCs only are applicable.
2. In the case of continuous operation type instructions (ROR and DROR), note that shift and rotation are executed in every scan time (operation cycle).
3. When a device with digit specification is specified as , only K4 (16-bit instruction) or K8 (32-bit instruction) is valid (examples: K4Y010 or K8M0).

Device Name Description

Page 201 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.2 ROL / Rotation Left
Page 201 · click to enlarge
Page 201
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.2 ROL / Rotation Left diagram (page 201)
Fig. 172 · 10.2 ROL / Rotation Left

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts and rotates the bit information leftward by the specified number of bits without the carry flag.

Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16

Word device storing data to be rotated leftward ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S1 S1 z z z S3 S4 z z z

Page 202 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DROL, DROLP)
Page 202 · click to enlarge
Page 202

10 Applied Instructions (Rotation and Shift Operation)

10.2 ROL / Rotation Left

Function and operation explanation

1. 16-bit operation (ROL, ROLP)

"n" bits out of 16 bits of the device specified by are rotated leftward.

  • The final bit is stored in the carry flag (M8022).
  • In a device with digit specification, K4 (16-bit instruction) is valid.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 202)
Fig. 173 · Function and operation explanation

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 0

"n" bits The status of the bit "16-n" is copied.

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 Carry flag

1 0 1

2. 32-bit operation (DROL, DROLP)

"n" bits out of 32 bits of the device specified by are rotated leftward.

  • The final bit is stored in the carry flag (M8022).
  • In a device with digit specification, K8 (32-bit instruction) is valid.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DROL, DROLP) diagram (page 202)
Fig. 174 · 2. 32-bit operation (DROL, DROLP)

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 0

1 0

b28 (32-n) to b31 are moved. The status of the bit "32-n" is copied

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1

1 0 1

1 0 1

Show 10 more labels / short text on this page
Command input · ROL EN n · Number of bits · Leftward rotation data · to be rotated · Command input · DROL EN n · Number of bits · Leftward rotation data · to be rotated
Page 203 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 203 · click to enlarge
Page 203

10 Applied Instructions (Rotation and Shift Operation)

10.2 ROL / Rotation Left

Related device

→ For the carry flag use method, refer to Section 1.3.4.

M8022 Carry Turns ON when the bit shifted last from the highest position is "1".

Cautions

1. Some restrictions to applicable devices S 1:K4Y , K4M and K4S are valid for a 16-bit operation. K8Y , K8M and K8S are valid for a 32-bit operation. S 2:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 4:The FX 3U and FX 3UC PLCs only are applicable.
2. In the case of continuous operation type instructions (ROL and DROL), note that shift and rotation are executed in every scan time (operation cycle).
3. When a device with digit specification is specified as , only K4 (16-bit instruction) or K8 (32-bit instruction) is valid (examples: K4Y010 or K8M0).

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
Device Name Description · Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 204 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 204 · click to enlarge
Page 204

10 Applied Instructions (Rotation and Shift Operation)

10.3 RCR / Rotation Right with Carry

10.3 RCR / Rotation Right with Carry

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts and rotates the bit information rightward by the specified number of bits together with the carry flag.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 204)
Fig. 175 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 204)
Fig. 176 · 2. Set data

Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16

Word device storing data to be rotated rightward ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 204)
Fig. 177 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S1 S1 z z z S2 S2 z z z

S: Refer to "Cautions".

Page 205 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8022
Page 205 · click to enlarge
Page 205

10 Applied Instructions (Rotation and Shift Operation)

10.3 RCR / Rotation Right with Carry

Function and operation explanation

1. 16-bit operation (RCR, RCRP) "n" bits out of 16 bits of the device specified by and 1 bit (carry flag M8022) are rotated rightward.

"n" bits (in the case of K4)

High order Low order

M8022

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 0

When M8022 is ON

After the instruction is executed once.

b3 (n-1) to b0 are moved.

b2 (n-2) to b0 and the head bit indicating the carry flag ON/OFF status are moved.

The status of the final bit b3 (bit "n-1") is stored.

High order Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

How to Read Explanation of Instructions

0 0 0 1 0

Before shift b3 Carry flag

M8022

Before shift b15 to b4

Before shift Carry flagM8022

The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation instruction, the carry flag is transferred to the destination.

2. 32-bit operation (DRCR, DRCRP) "n" bits out of 32 bits of the device specified by and 1 bit (carry flag M8022) are rotated rightward.

"n" bits (in the case of K4)

High order Low order

Applied Instructions (Program Flow)

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16

1 0 1 0 0 0 1 0

b2 (n-2) to b0 and the head bit indicating the carry flag ON/OFF status are moved.

After the instruction is executed once.

Carry flagM8022 When M8022 is OFF

Applied Instructions (Move and Compare)

The status of the final bit b3 (bit "n-1") is stored.

Low order b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order

0 1 0 1 0

Before shift b31 to b4

Before shift Carry flagM8022

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 32 more labels / short text on this page
Command input · RCR EN n · Number of bits · Rightward rotation data · Instruction List · to be rotated · Carry flag · Before execution · Configuration of Instruction · b3(n-1) · "n" bits · Rightward rotation · After execution · Before shift · b2 to b0 · Basic Instruction · Command input · Step Ladder Instructions · DRCR EN n · Number of bits · Rightward rotation data · to be rotated · Before execution · "n" bits · Rightward rotation · After execution · b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 · Before shift · Carry flagM8022 · b2 to b0 · Before shift · b3
Page 206 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 206 · click to enlarge
Page 206

10 Applied Instructions (Rotation and Shift Operation)

10.3 RCR / Rotation Right with Carry

Related device

→ For the carry flag use method, refer to Section 1.3.4.

M8022 Carry Turns ON when the bit shifted last from the lowest position is "1".

Cautions

1. Some restrictions to applicable devices S 1:K4Y , K4M and K4S are valid for a 16-bit operation. K8Y , K8M and K8S are valid for a 32-bit operation. S 2:The FX 3U and FX 3UC PLCs only are applicable.
2. In the case of continuous operation type instructions (RCR and DRCR), note that shift and rotation are executed in every scan time (operation cycle).
3. When a device with digit specification is specified as , only K4 (16-bit instruction) or K8 (32-bit instruction) is valid (examples: K4Y010 or K8M0).

Device Name Description

Page 207 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.4 RCL / Rotation Left with Carry
Page 207 · click to enlarge
Page 207
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.4 RCL / Rotation Left with Carry diagram (page 207)
Fig. 178 · 10.4 RCL / Rotation Left with Carry

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts and rotates the bit information leftward by the specified number of bits together with the carry flag.

Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16

Word device storing data to be rotated leftward ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S1 S1 z z z S2 S2 z z z

Page 208 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 208 · click to enlarge
Page 208

10 Applied Instructions (Rotation and Shift Operation)

10.4 RCL / Rotation Left with Carry

Function and operation explanation

1. 16-bit operation (RCL, RCLP) "n" bits out of 16 bits of the device specified by and 1 bit (carry flag M8022) are rotated leftward.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 208)
Fig. 179 · Function and operation explanation

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 1 1 0 1 0

b15 to b13 (16-n+1) and the head bit indicating the carry flag ON/OFF status are moved.

The status of the final bit b12 (bit "16-n") is stored.

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

1 0 1

Before shift b15 to b13 Before shift b11 to b0

The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation instruction, the carry flag is transferred to the destination.

2. 32-bit operation (DRCL, DRCLP) "n" bits out of 32 bits of the device specified by and 1 bit (carry flag M8022) are rotated leftward.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 208)
Fig. 180 · Function and operation explanation

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 1 1 0 1 0

1 0

b31 to b29 (32-n+1) and the head bit indicating the carry flag ON/OFF status are moved.

The status of the final bit b28 (bit "32-n") is stored.

Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order

1 0 1

1 0 1

Page 209 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 209 · click to enlarge
Page 209

10 Applied Instructions (Rotation and Shift Operation)

10.4 RCL / Rotation Left with Carry

Related device

→ For the carry flag use method, refer to Section 1.3.4.

M8022 Carry Turns ON when the bit shifted last from the highest position is "1".

Cautions

1. Some restrictions to applicable devices S 1:K4Y , K4M and K4S are valid for a 16-bit operation. K8Y , K8M and K8S are valid for a 32-bit operation. S 2:The FX 3U and FX 3UC PLCs only are applicable.
2. In the case of continuous operation type instructions (RCL and DRCL), note that shift and rotation are executed in every scan time (operation cycle).
3. When a device with digit specification is specified as , only K4 (16-bit instruction) or K8 (32-bit instruction) is valid (examples: K4Y010 or K8M0).

How to Read Explanation of Instructions

Applied Instructions (Program Flow)

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 5 more labels / short text on this page
Device Name Description · Instruction List · Configuration of Instruction · Basic Instruction · Step Ladder Instructions
Page 210 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 210 · click to enlarge
Page 210

10 Applied Instructions (Rotation and Shift Operation)

10.5 SFTR / Bit Shift Right

10.5 SFTR / Bit Shift Right

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts bit devices of the specified bit length rightward by the specified number of bits. After shift, the bit device specified by is transferred by "n2" bits from the most significant bit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 210)
Fig. 181 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 210)
Fig. 182 · 2. Set data

Head bit device to be stored to the shift data after rightward shift. Bit

Bit length of the shift data (see Caution). ANY16

Number of bits to be shifted rightward (see Caution) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 210)
Fig. 183 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 211 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 211 · click to enlarge
Page 211

10 Applied Instructions (Rotation and Shift Operation)

10.5 SFTR / Bit Shift Right

Function and operation explanation

1. 16-bit operation (SFTR, SFTRP) For "n1" bits (shift register length) starting from the bit device specified by , "n2" bits are shifted rightward (1) and 2) shown below). After shift, "n2" bits from the bit device specified by are transferred to "n2" bits from +n1-n2 (3) shown below).

SFTR EN s n1

Stored data Shift data Bit data length Number of bits

n2 (in the case of "n2 = 3")

+1 +2 s s s

n1 (in the case of "n1 = 9")

How to Read Explanation of Instructions

+8 +7 +6 +5 +4 +3 d +2 +1 d d d

1. 3) Copy

"n2" bits are shifted rightward (n2 = 3).

Overflow (data to be deleted)

+8 +7 +6 +5 +4 +3 +2 +1 d

+2 to before shift (n2 = 3). s s +8 to +3 before shift (n2 = 3). d d

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable. Not indexed (V, Z). S 2:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
2. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.

Applied Instructions (Program Flow)

3. Note that "n2" bits are shifted every time the command input turns ON from OFF in SFTRP instruction, but that "n2" bits are shifted in each scan time (operation cycle) in SFTR instruction.
4. Limitation to n1 and n2 differs from one PLC to another.

FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U, FX3UC n2≤n1≤1024

Applied Instructions (Move and Compare)

FX0S, FX0, FX0N, FX1S n2≤n1≤512

Error

If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710). (Applicable only to the FX3U and FX3UC PLCs)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 10 more labels / short text on this page
Instruction List · Command input · n2 · Configuration of Instruction · Before execution · 2) · Basic Instruction · After execution · Step Ladder Instructions · PLC Limit
Page 212 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 212 · click to enlarge
Page 212

10 Applied Instructions (Rotation and Shift Operation)

10.6 SFTL / Bit Shift Left

10.6 SFTL / Bit Shift Left

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts bit devices of the specified bit length leftward by the specified number of bits. After shift, the bit device specified by is transferred by "n2" bits from the least significant bit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 212)
Fig. 184 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 212)
Fig. 185 · 2. Set data

Head bit device to be stored to the shift data after leftward shift Bit

Bit length of the shift data (see Caution). ANY16

Number of bits to be shifted leftward (see Caution). ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 212)
Fig. 186 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 213 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 213 · click to enlarge
Page 213

10 Applied Instructions (Rotation and Shift Operation)

10.6 SFTL / Bit Shift Left

Function and operation explanation

1. 16-bit operation (SFTL, SFTLP) For "n1" bits (shift register length) starting from the bit device specified by , "n2" bits are shifted leftward (1) and 2) shown below). After shift, "n2" bits from the bit device specified by are transferred to "n2" bits from the bit device specified by (3) shown below).

SFTL EN s n1

Stored data Shift data Bit data length Number of bits

n2 (in the case of "n2 = 3")

+1 +2 s s s

n1 (in the case of "n1 = 9")

How to Read Explanation of Instructions

+8 +7 +6 d d d +5 +4 +3 d d d +2 +1 d d d

1. Overflow (data to be deleted) 3) Copy
2. "n2" bits are shifted leftward (n2 = 3)

+2 +1 +8 +7 +6 +5 +4 +3 d

+2 to before shift (n2 = 3). s s d to +5 before shift (n2 = 3) d

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable. Not indexed (V, Z). S 2:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
2. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.

Applied Instructions (Program Flow)

3. Note that "n2" bits are shifted every time the command input turns ON from OFF in SFTLP instruction, but that "n2" bits are shifted in each operation cycle in SFTL instruction.
4. Limitation to n1 and n2 differs from one PLC to another.

FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U, FX3UC n2≤n1≤1024

Applied Instructions (Move and Compare)

FX0S, FX0, FX0N, FX1S n2≤n1≤512

Error

If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710). (Applicable only to the FX3U and FX3UC PLCs)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 9 more labels / short text on this page
Instruction List · Command input · n2 · Configuration of Instruction · Before execution · Basic Instruction · After execution · Step Ladder Instructions · PLC Limit
Page 214 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples(Conditional stepping of 1-bit data)
Page 214 · click to enlarge
Page 214

10 Applied Instructions (Rotation and Shift Operation)

10.6 SFTL / Bit Shift Left

Program examples(Conditional stepping of 1-bit data)

By setting X000 to X007 to ON in turn, Y000 to Y007 are activated in turn. If the order is wrong, activation is disabled.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples(Conditional stepping of 1-bit data) diagram (page 214)
Fig. 187 · Program examples(Conditional stepping of 1-bit data)

Bit 1 of M0 is regarded as the head input, and 8-bit shift register is constructed by S0 to S7.

*1:By using a state relay (S), the state under operation can be monitored by the dynamic monitoring function of the state relay.

Even if X000 is set to ON, Y000 is not activated.

M0:= X000 AND NOT M8046; SFTL((NOT M8046 AND X000) OR (S0 AND X001) ··· OR (S1 AND X002) R(S7 AND X000), M0, K8, K1, S0); MOV(M8000, K2S0, K2Y000); M8047:= M8000;

Page 215 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.7 WSFR / Word Shift Right
Page 215 · click to enlarge
Page 215
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.7 WSFR / Word Shift Right diagram (page 215)
Fig. 188 · 10.7 WSFR / Word Shift Right

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts word devices with "n1" data length rightward by "n2" words.

Head device to be stored to the shift data after rightward shift ANY16

Word data length of the shift data (n2 ≤ n1 ≤ 512) ANY16

Number of words to be shifted rightward (n2 ≤ n1 ≤ 512) ANY16

Head word device storing data to be shifted rightward ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

Page 216 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 216 · click to enlarge
Page 216

10 Applied Instructions (Rotation and Shift Operation)

10.7 WSFR / Word Shift Right

Function and operation explanation

1. 16-bit operation (WSFR, WSFRP) For "n1" word devices starting from the device specified by , "n2" words are shifted rightward (1) and 2) shown below) After shift, "n2" words starting from the device specified by are transferred to "n2" words starting from the device specified by [ +n1-n2] (3) shown below).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 216)
Fig. 189 · Function and operation explanation

d

3. Copy 2) "n2" words are shifted rightward (n2 = 3).

d

+2 to before shift (n2 = 3). s s +8 to +3 before shift (n2 = 3). d d

Cautions

1. Note that "n2" words are shifted when the drive input turns ON in WSFRP instruction, but that "n2" words are shifted in each operation cycle in WSFR instruction.
2. Some restrictions to applicable devices S 1:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3U and FX 3UC PLCs only are applicable.

Error

If the transfer source device specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710).

Page 217 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.7 WSFR / Word Shift Right
Page 217 · click to enlarge
Page 217
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.7 WSFR / Word Shift Right diagram (page 217)
Fig. 190 · 10.7 WSFR / Word Shift Right

Specify a same digit for devices with digit specification.

Make sure that the number of digits is equivalent.(Kn )

Y017 Y016 Y015 Y014 Y013 Y012 Y011Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001Y000

Page 218 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 218 · click to enlarge
Page 218

10 Applied Instructions (Rotation and Shift Operation)

10.8 WSFL / Word Shift Left

10.8 WSFL / Word Shift Left

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts the word data information leftward by the specified number of words.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 218)
Fig. 191 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 218)
Fig. 192 · 2. Set data

Head device to be stored to the shift data after leftward shift ANY16

Word data length of the shift data (n2 ≤ n1 ≤ 512) ANY16

Number of words to be shifted leftward (n2 ≤ n1 ≤ 512) ANY16

Head word device storing data to be shifted leftward ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 218)
Fig. 193 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

S: Refer to "Cautions".

Page 219 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 219 · click to enlarge
Page 219

10 Applied Instructions (Rotation and Shift Operation)

10.8 WSFL / Word Shift Left

Function and operation explanation

1. 16-bit operation (WSFL, WSFLP) For "n1" word devices starting from the device specified by , "n2" words are shifted leftward (1) and 2) shown below). After shift, "n2" words starting from the device specified by are shifted to "n2" words starting from the device specified by .

WSFL EN s n1

Stored data Shift data

n2 Word data length Number of words

n2 (in the case of "n2 = 3")

n1 (in the case of "n1 = 9")

How to Read Explanation of Instructions

+8 +7 +6 d d d +5 +4 +3 d d d +2 +1 d d d

Overflow (data to be deleted)

"n2" words are shifted leftward (n2 = 3).

3. Copy

+2 +1 +8 +7 +6 +5 +4 +3 d

+2 to before shift (n2 = 3). s s +5 to before shift (n2 = 3). d d

Cautions

1. Note that "n2" words are shifted every time the drive input turns ON from OFF in WSFLP instruction, but that "n2" words are shifted in each operation cycle in WSFL instruction.
2. Some restrictions to applicable devices S 1:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Program Flow)

Error

If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710).

Applied Instructions (Move and Compare)

Applied Instructions (Arithmetic and Logical Operation)

Applied Instructions (Rotation and Shift Operation)

Show 12 more labels / short text on this page
Instruction List · Command input · Configuration of Instruction · +2 · s s s · +1 · Before execution · 1) · 2) · Basic Instruction · After execution · Step Ladder Instructions
Page 220 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 220 · click to enlarge
Page 220

10 Applied Instructions (Rotation and Shift Operation)

10.8 WSFL / Word Shift Left

Program examples

1. Shifting devices with digit specification

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 220)
Fig. 194 · Program examples

Specify a same digit for devices with digit specification.

Make sure that the number of digits is equivalent.(Kn )

Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000

Page 221 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.9 SFWR / Shift Write [FIFO/FILO Control]
Page 221 · click to enlarge
Page 221
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.9 SFWR / Shift Write [FIFO/FILO Control] diagram (page 221)
Fig. 195 · 10.9 SFWR / Shift Write [FIFO/FILO Control]

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes data for first-in first-out (FIFO) and first-in last-out (FILO) control.

Word device storing data to be put in first ANY16

Number of store points (for pointer, value is added by "+1".) 2 ≤ n ≤ 512 ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

Page 222 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 222 · click to enlarge
Page 222

10 Applied Instructions (Rotation and Shift Operation)

10.9 SFWR / Shift Write [FIFO/FILO Control]

Function and operation explanation

1. 16-bit operation (SFWR, SFWRP) The contents of the device specified by are written to "n-1" devices from the device specified by +1, and "1" is added to the number of data stored in the device specified by . For example, when the device specified by is "0", the contents of the device specified by are written to the device specified by +1. When the device specified by is "1", the contents of the device specified by are written to the device specified by +2.

SFWR EN s n

First-in data Storing device Number of pieces

d d+n ··· d+2 d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+1

Executed at the 1st time( = 0)

(K1) (K0)

d d+n ··· d+2 d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 s

Executed at the 2nd time

(K2) (K1)

d d+n ··· s d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 s

1. When X000 turns ON from OFF, the contents of the device specified by are stored to the device specified by +1. So the contents of the device specified by +1 become equivalent to the contents of the device specified by .

2) When the contents of the device specified by are changed and then the command input is set to ON from OFF again, the new contents of the device specified by are stored to the device specified by +2. So the contents of the device specified by +2 become equivalent to the contents of the device specified by . (When the continuous operation type SFWR instruction is used, the contents are stored in each operation cycle. Use the pulse operation type SFWRP instruction in programming.)

3. Data are stored from the right end in the same way, and the number of stored data is indicated by the contents of the pointer specified by .

Related device

→ For the carry flag use method, refer to Section 1.3.4.

M8022 Carry When the contents of the pointer specified by exceeds "n-1", no operation is executed (data is not written) and the carry flag M8022 turns ON.

Related instructions

SFRD Shift read (for FIFO control)

POP Last-in data read (for FILO control)

Cautions

1. In the case of continuous operation type (SFWR) instruction. Note that data are stored (overwritten) in each scan time (operation cycle).
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.
Show 14 more labels / short text on this page
Command input · of data · n s · Before execution · Pointer · s · +1 → · After execution · Pointer · s · +1 → · Pointer · Device Name Description · Instruction Description
Page 223 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D355 D356 0
Page 223 · click to enlarge
Page 223

10 Applied Instructions (Rotation and Shift Operation)

10.9 SFWR / Shift Write [FIFO/FILO Control]

Program examples

1. Example of first-in first-out control → For a program example of FILO, refer to Section 27.3. In the example below, the shift write (SFWR) and shift read (SFRD) instructions are used. 1) Contents of operation - In this circuit example, a product number to be taken out now is output according to "first-in first-out" rule while products which were put into a warehouse with their product numbers registered are taken out of the warehouse. - The product number is hexadecimal, and up to 4 digits. Up to 99 products can be stored in the warehouse. 2) Program

Button for request to put a product into warehouse

X020 MOVP EN s

The product number is input from X000 to X017, and transferred to D256.

SFWRP EN s n

Pointer D257Data register for storing the product number D258 to D356: (99 points)

D256 D257 K100

How to Read Explanation of Instructions

Button for request to take a product out of warehouse

SFRDP EN s n

The product number of a product put into first is output to D357 in response to the request to take a product out of the warehouse.

D257 D357 K100

M8000 MOV EN s

The product number to be taken out is output to Y000 to Y017 in a four-digit hexadecimal number.

[ ST ]

MOVP(X020, K4X000, D256); SFWRP(X020, D256, K100, D257); SFRDP(X021, D257, K100, D357); MOV(M8000, D357, K4Y000);

Digital switch 0000 to FFFF Seven-segment display unit

1 2 3 4 Request to put a product into warehouse

Request to take a product out of warehouse

Applied Instructions (Program Flow)

Y017 to Y000 X017 to X000

X20 X21

Applied Instructions (Move and Compare)

MOV

D258 D259 D260 D261 D262 D263

0232 0462 0539 0142 0 0

2 3 4 5 6

0232 0462 0539 0142 1234

0232 0462 0539 0142 0

MOV

Applied Instructions (Arithmetic and Logical Operation)

SFWRP instruction is executed.

D355 D356 0

SFRDP instruction is executed.

Applied Instructions (Rotation and Shift Operation)

Show 11 more labels / short text on this page
Instruction List · [Structured ladder/FBD] · Configuration of Instruction · d K4X000 D256 · Basic Instruction · RUN monitor · d D357 K4Y000 · Step Ladder Instructions · Command Command · +1 · Shift
Page 224 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 224 · click to enlarge
Page 224

10 Applied Instructions (Rotation and Shift Operation)

10.10 SFRD / Shift Read [FIFO Control]

10.10 SFRD / Shift Read [FIFO Control]

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads data for first-in first-out control.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 224)
Fig. 196 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 224)
Fig. 197 · 2. Set data

Number of store points (for pointer, value is added by "+1".) 2 ≤ n ≤ 512 ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 224)
Fig. 198 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

S: Refer to "Cautions".

Page 225 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 225 · click to enlarge
Page 225

10 Applied Instructions (Rotation and Shift Operation)

10.10 SFRD / Shift Read [FIFO Control]

Function and operation explanation

1. 16-bit operation (SFRD, SFRDP) The data of the device specified by [ +1] written in turn by SFWR instruction is transferred (read) to the device specified by , and "n-1" words from the device specified by +1 are shifted rightward by 1 word. "1" is subtracted from the number of data stored in the device specified by .

SFRD EN s n

d Number of pieces

Readout data Storing device

s s+n ··· s+2 s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+1

Executed at the 1st time

How to Read Explanation of Instructions

s s+n ··· s+2 s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+n

Word data is shifted.

Executed at the 2nd time

s s+n ··· s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+n s+n

Word data is shifted.

1. When the command contact turns ON, the contents of the device specified by [ +1] are transferred (read) to the device specified by .
2. Accompanied by this transfer, the contents of the pointer specified by decrease, and the data on the left side are shifted rightward by 1 word. (When the continuous operation type SFRD instruction is used, the contents are shifted in turn in each operation cycle. Use the pulse operation type SFRDP instruction in programming.)

Related device

→ For the zero flag use method, refer to Section 1.3.4.

Applied Instructions (Program Flow)

M8020 Zero Data is always read from the device specified by [ +1]. When the contents of the pointer specified by become "0", the zero flag M8020 turns ON.

Related instructions

Applied Instructions (Move and Compare)

SFWR Shift write (for FIFO/FILO control)

POP Last-in data read (for FILO control)

Cautions

1. The contents of the device specified by [ +n] do not change by reading. 2) In the case of continuous operation type (SFRD) instruction, data is read in turn in each scan time (operation cycle), but the contents of the device specified by [ +n] do not change.

Applied Instructions (Arithmetic and Logical Operation)

3. When pointer specified by is "0", data is not processed, and the contents of the device specified by do not change. 4) Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Rotation and Shift Operation)

Program examples

Refer to the program example provided for SFWR instruction.

Show 23 more labels / short text on this page
Command input · Instruction List · of data · n d · Before execution · Configuration of Instruction · s · = n · Pointer · s+1 · s · –1 → · s · After execution · Pointer · s+2 · s s · –1 → · Basic Instruction · Pointer · Step Ladder Instructions · Device Name Description · Instruction Description
Page 226 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DFLT
Page 226 · click to enlarge
Page 226

This chapter introduces the instructions for executing complicated processing for applied instructions move, compare, arithmetic operations, rotation and shift operation instructions.

Instruction name Function Reference

ZRST

Zone Reset Section 11.1 ZRSTP

DECO

Decode Section 11.2 DECOP

ENCO

Encode Section 11.3 ENCOP

SUM

Sum of Active Bits Section 11.4 SUMP

DSUM

DSUMP

BON

Check Specified Bit Status Section 11.5 BONP

DBON

DBONP

MEAN

Mean Section 11.6 MEANP

DMEAN

DMEANP

ANS Timed Annunciator Set Section 11.7

ANR

Annunciator Reset Section 11.8 ANRP

SQR

Square Root Section 11.9 SQRP

DSQR

DSQRP

FLT

Conversion to Floating Point Section 11.10 FLTP

DFLT

DFLTP

Page 227 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.1 ZRST / Zone Reset
Page 227 · click to enlarge
Page 227
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.1 ZRST / Zone Reset diagram (page 227)
Fig. 199 · 11.1 ZRST / Zone Reset

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction resets devices located in a zone between two specified devices at one time. Use this instruction for restarting operation from the beginning after pause or after resetting control data.

Head device to be reset at one time ANY_SIMPLE

Last device to be reset at one time ANY_SIMPLE

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

Page 228 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related instructions
Page 228 · click to enlarge
Page 228

11.1 ZRST / Zone Reset

Function and operation explanation

1. 16-bit operation (ZRST, ZRSTP)

Same type of devices specified by to are reset at one time.

When the devices specified by and are bit devices "OFF (reset)" is written to the entire range from the devices specified by to at one time.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 228)
Fig. 200 · Function and operation explanation

Devices through are reset at one time. d1 d2

··· +2 +9 +8 +7 +6 +5 +4 +3 +1 d1 d2 d1

OFF OFF ··· OFF

When the devices specified by and are word devices "K0" is written to the entire range from the devices specified by to at one time.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 228)
Fig. 201 · Function and operation explanation

Devices through are reset at one time. d1 d2

··· +2 +9 +8 +7 +6 +5 +4 +3 +1 d1 d2 d1

K0 K0 ··· K0

Related instructions

1. RST As an independent reset instruction for devices, RST instruction can be used for bit devices (Y, M and S) and word devices (T, C, D and R).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instructions diagram (page 228)
Fig. 202 · Related instructions
Page 229 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M0
Page 229 · click to enlarge
Page 229

11.1 ZRST / Zone Reset

2. FMOV FMOV instruction is provided to write a constant (example: K0) at one time. By using this instruction, "0" can be written to word devices (KnY, KnM, KnS, T, C, D and R) at one time.

FMOV EN s n

K0 is written to D0 to D99 at one time.

K0 D0

Applied Instructions (High Speed Processing)

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. Specify same type of devices in the devices specified by and . The device number of the device specified by should be smaller than or equal to the device number of the device specified by . If the device number of the device specified by is larger than the device number of the device specified by , only one device specified by is reset.

Applied Instructions (Handy Instruction)

3. When specifying the high-speed counter, ZRST instruction is handled as the 16-bit type, but 32-bit counters can be specified in and . However, it is not possible to specify a 16-bit counter in the device specified by and specify a 32-bit counter in the device specified by ; and should be a same type.

Applied Instructions (External FX I/O Device)

ZRST EN ENO

ZRST EN ENO

CN180

CN180

Applied Instructions (External Device (optional device))

CN230

CN199

ZRST EN ENO

CN200

CN230

4. Caution for simultaneous instances of the ZRST instruction and the PLS instruction The ZRST instruction resets the last stage for the PLS instruction and PLF instruction of the applicable device. In addition, the reset state of T and C is also reset. Accordingly, when the program shown below is executed, the PLS instruction continuously sets M0 to ON.

Timing chart Structured ladder/FBD

M0

ZRST EN ENO

Applied Instructions (Data Transfer 2)

M0

one operation cycle one operation cycle

M100

M0

PLS EN ENO ZRST instruction

Applied Instructions (Floating Point)

M0

Please program in the following way to turn on M0 only once.

M0

ZRST EN ENO

M0 M100

M0 MEP EN ENO

Applied Instructions (Positioning Control)

Show 18 more labels / short text on this page
d K100 · Program example · Command input · Command input · d1 d2 · 16-bit counter · d1 d2 · 32-bit counter · d1 d2 · d1 d2 · ZRST instruction · execution · execution PLS instruction · PLS instruction · execution · execution · Structured ladder/FBD · d1 d2
Page 230 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 230 · click to enlarge
Page 230

11.1 ZRST / Zone Reset

5. Caution on simultaneous instances of the ZRST instruction and a counter The ZRST instruction resets also the last stage and reset state of T and C coils. Accordingly, if the drive contact of X000 is ON in the following program, the counter executes counting after the ZRST instruction is executed.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.1 ZRST / Zone Reset diagram (page 230)
Fig. 203 · 11.1 ZRST / Zone Reset

Program in the following way to disable counting after execution of the ZRST instruction.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.1 ZRST / Zone Reset diagram (page 230)
Fig. 204 · 11.1 ZRST / Zone Reset
6. Some restrictions to applicable devices S 1:The FX 3G, FX 3GC, FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

1. When using devices in the latch area as non-latch type devices When the power of the PLC is turned ON or when the PLC mode is changed to RUN, the specified ranges of bit devices and word devices are reset at one time.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 230)
Fig. 205 · Program examples

CN235 to CN255 are reset at one time. ("0" is written to them, and their contacts are reset.)

ZRST(M8002, M500, M599); ZRST(M8002, CN235, CN255); ZRST(M8002, S500, S599);

Page 231 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.2 DECO / Decode
Page 231 · click to enlarge
Page 231
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.2 DECO / Decode diagram (page 231)
Fig. 206 · 11.2 DECO / Decode

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts numeric data into ON bit. A bit number which is set to ON by this instruction indicates a numeric value

Data to be decoded or word device storing data ANY_SIMPLE

Number of bits of device storing the decoding result [n = 1 to 8] (No processing is executed in the case of "n = 0".) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

Page 232 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K1 K2 K3 K4 K5 K6 K7 K8
Page 232 · click to enlarge
Page 232

11.2 DECO / Decode

Function and operation explanation

1. 16-bit operation (DECO, DECOP)

One bit among the devices specified by [ to +2n-1] is set to ON according to the value of the device specified by .

1. When the device specified by is a bit device (1 ≤ n ≤ 8) n bits (1 ≤ n ≤ 8) of a device specified by is decoded to the device specified by .

- When all bits of the devices specified by are "0", the bit device specified by turns ON.

- When "n" is "8", the bit device specified by occupies maximum 28 = 256 bits.

DECO EN s n

when it is Y, M or S (1≤n≤8)

Ignored when "n" is "8"

b8 b9 b10 b11 b12 b13 b14 b15

b0 b1 b2 b3 b4 b5 b6 b7

0 1 1 1 0

K1 K2 K3 K4 K5 K6 K7 K8

Turns ON when all bits of are OFF.

Up to M31 Up to M63 Up to M127 Up to M255

0 1 0

M255 M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15

Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)

2. When the device specified by is word device (1 ≤ n ≤ 4) n bits on the low-order side of the device specified by is decoded to the device specified by .

- When all bits of the device specified by are "0", b0 of the word device specified by turns ON.

- In the case of "n ≤ 3", all of high-order bits of the device specified by become "0" (turn OFF).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — K1 K2 K3 K4 K5 K6 K7 K8 diagram (page 232)
Fig. 207

When it is T, C, D, R, U\G, V, Z, K or H (1≤ n≤ 4)

0 0 0 1 0 1 0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

1 0 1 0 0 1

0 1

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

Show 11 more labels / short text on this page
Command input · Decoded data · d Resulting data · Number of bits · 8 bits · when is D0 · s · 2n · n · s · When is M0
Page 233 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K1 K2 K3 K4 K5 K6 K7 K8
Page 233 · click to enlarge
Page 233

11.2 DECO / Decode

Cautions

1. Instructions of pulse operation type are not provided in the FX 0 , FX 0S or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. While the command input is OFF, the instruction is not executed. The activated decode output is held in the previous ON/OFF status.
3. When "n" is "0", the instruction executes no processing.

Applied Instructions (High Speed Processing)

4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

Applied Instructions (Handy Instruction)

1. When setting bit devices to ON according to the value of a data register The value of D0 (whose current value is "14" in this example) is decoded to M0 to M15.

M8000

DECO EN s n

DECO(M8000, D0, K4, M0);

Applied Instructions (External FX I/O Device)

K4 D0

Ignored 4 bits (D0 b0 to b3)

(D0 b4 to b15)

b15 ··· When the value of b0 to b3 of D0 is "14"

0 1 1 1 0 b0 1 2 3 4 5 6 7

Applied Instructions (External Device (optional device))

K1 K2 K3 K4 K5 K6 K7 K8

Turns ON when D0 is K0.

Up to M31 Up to M63 Up to M127 Up to M255

0 1 0

M255 M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15

Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)

  • When the value of b0 to b3 of D0 is "14 (=0+2+4+8)", M14 (which is the 15th from M0) becomes "1" (turns ON).

Applied Instructions (Data Transfer 2)

  • When the value of D0 is "0", M0 becomes "1" (turns ON).
  • When "n" is set to "K4", any one point among M0 to M15 turns ON according to the value of D0 (0 to 15).
  • By changing "n" from K1 to K8, D0 can correspond to numeric values from 0 to 255. However, because the device range of the device specified by is occupied for decoding accordingly, such device range should not be used for another control.

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 4 more labels / short text on this page
d M0 · 2n s · n=K4 · When is M0
Page 234 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.2 DECO / Decode
Page 234 · click to enlarge
Page 234

11.2 DECO / Decode

2. Turning ON the bit out of word devices according to the contents of bit devices The value expressed by X000 to X002 is decoded to D0 (X000 and X001 are ON, and X002 is OFF in this example).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.2 DECO / Decode diagram (page 234)
Fig. 208 · 11.2 DECO / Decode

0 0 0 1 0

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

  • When the values expressed by X000 to X002 are "3 (=1+2+0)", b3 (which is the 4th from b0) becomes "1" (turns ON).
  • When all of X000 to X002 are "0" (OFF), b0 becomes "1" (turns ON).
Page 235 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.3 ENCO / Encode
Page 235 · click to enlarge
Page 235
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.3 ENCO / Encode diagram (page 235)
Fig. 209 · 11.3 ENCO / Encode

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction obtains positions in which bits are ON in data.

Data to be encoded or word device storing data ANY_SIMPLE

Number of bits of device storing the encoding result [n = 1 to 8] (When "n" is "0", no processing is executed.) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z z z S1 S2 z z z

Page 236 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 236 · click to enlarge
Page 236

11.3 ENCO / Encode

Function and operation explanation

1. 16-bit operation (ENCO, ENCOP)

The 2n bit of the data specified by is encoded, and the result value is stored to the device specified by . This instruction converts data into binary data according to a bit position in the ON status.

1. When the device specified by is a bit device (1 ≤ n ≤ 8) ON bit positions among "2 n " bits (1 ≤ n ≤ 8) from the device specified by are encoded to the device specified by .

- When "n" is "8", the device specified by occupies 28 = 256 bits (which is the maximum value). - The encoding result of the device specified by is all "0" (OFF) from the most significant bit to the low-order bit "n".

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 236)
Fig. 210 · Function and operation explanation

when it is Y, M or S (1≤n≤8)

M17 M16 M15 M14 M13 M12 M11 M10 When "n" is 3

7 0 1 0 1 2 3) 4 5 6

1 1 0 b15 D10 1) 2) 4

2. When the device specified by is a word device (1 ≤ n ≤ 4) ON bit positions among "2n" bits (1 ≤ n ≤ 4) from a device specified by are encoded to the device specified by . - The encoding result of the device specified by is all "0" (OFF) from the most significant bit to the low-order bit "n".
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 236)
Fig. 211 · Function and operation explanation

When it is T, C, D, R, U\G, V or Z

0 0 0 1 0 1 0 1 0 1 0 1 0 b15

0 1 2 3) 4 5 6 7 Ignored

1 1 0 b15 1) 2) 4

Page 237 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 237 · click to enlarge
Page 237

11.3 ENCO / Encode

Cautions

1. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
2. When two or more bits are ON in the data specified by , the low-order side is ignored, and only the ON position on the high-order side is encoded.
3. When the command input is OFF, the instruction is not executed. Activated encode outputs are latched in the previous ON/OFF status.

Applied Instructions (High Speed Processing)

4. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Handy Instruction)

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 238 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 238 · click to enlarge
Page 238

11.4 SUM / Sum of Active Bits

11.4 SUM / Sum of Active Bits

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction counts the number of "1" (ON) bits in the data of a specified device.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 238)
Fig. 212 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 238)
Fig. 213 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 238)
Fig. 214 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

S: Refer to "Cautions".

Page 239 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K0
Page 239 · click to enlarge
Page 239

11.4 SUM / Sum of Active Bits

Function and operation explanation

1. 16-bit operation (SUM ,SUMP) The number of bits in the ON status in the device specified by is counted, and stored to the device specified by .
  • When all bits are 0 (OFF) in the device specified by , the zero flag M8020 turns ON.

Applied Instructions (High Speed Processing)

Number of bits in the ON status in d s

SUM data Resulting data

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

K21847

0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1

Applied Instructions (Handy Instruction)

1 2 3 ← 4 ← 5 ← 6 ← 7 ← 8 ← 9 (Number of "1" (ON))

K0

0

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

K21847

0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1

Applied Instructions (External FX I/O Device)

32 16 8 4 2 1

K9

1 0 0 1 0

2. 32-bit operation (DSUM, DSUMP) The number of bits in the ON status in the device specified by is counted, and stored to the device specified by .

Applied Instructions (External Device (optional device))

  • The number of bits in the ON status is stored in the device specified by , and K0 is stored in +1.
  • When all bits are 0 (OFF) in the device specified by , the zero flag M8020 turns ON.

Number of bits in the ON status in [ +1, ]

d s s d

SUM data Resulting data

K0 is written.

b16 b17 b31 ··· b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

K21847

0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0

1 2 3 ← 4 ← 5 ← 6 ← 7 ← 8 ← 9 (Number of "1" (ON))

K0

K0

Applied Instructions (Data Transfer 2)

0

b16 b17 b31 ··· b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

K21847

0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1

32 16 8 4 2 1

K0

K9

Applied Instructions (Floating Point)

1 0 0 1 0 1 0 0 1 0

Applied Instructions (Positioning Control)

Show 19 more labels / short text on this page
Command input · SUM EN s · ← · Word data · 16-bit data · Before execution · s · After execution · s · Command input · DSUM EN s · ← · +1, · Word data · 32-bit data · Before execution · s · After execution · s
Page 240 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 240 · click to enlarge
Page 240

11.4 SUM / Sum of Active Bits

3. Operation result of the device specified by according to the value specified by (in 16-bit operation)

M8020 Zero flag Bit device Word device

b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Decimal Hexadecimal

0000 0 ON

0 1 1 0001 1 OFF

0 1 0 2 0002 1 OFF

0 1 1 3 0003 2 OFF

0 1 0 0 4 0004 1 OFF

0 1 0 1 5 0005 2 OFF

0 1 1 0 6 0006 2 OFF

0 1 1 1 7 0007 3 OFF

0 1 0 0 0 8 0008 1 OFF

0 1 0 0 1 9 0009 2 OFF

0 1 0 1 0 10 000A 2 OFF

0 1 0 1 1 11 000B 3 OFF

OFF

1 0 1 1 -5 FFFB 15 OFF

1 0 0 -4 FFFC 14 OFF

1 0 1 -3 FFFD 15 OFF

1 0 -2 FFFE 15 OFF

1 -1 FFFF 16 OFF

Cautions

1. While the command input is OFF, the instruction is not executed. The output of the number of bits in the ON status is latched in the previous status.
2. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Program examples

When X000 is ON, the number of bits in the ON status in D0 is counted, and stored to D2.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 240)
Fig. 215 · Program examples

The number of "1" in D0 is stored to D2.

0

0

0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1

0 1 0 0 1

Page 241 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.5 BON / Check Specified Bit Status
Page 241 · click to enlarge
Page 241
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.5 BON / Check Specified Bit Status diagram (page 241)
Fig. 216 · 11.5 BON / Check Specified Bit Status

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction checks whether a specified bit position in a device is ON or OFF.

Bit position to be checked [n=0 to 15 (16-bit instruction), n=0 to 31 (32-bit instruction)] ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S3 S4 z

Page 242 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 242 · click to enlarge
Page 242

11.5 BON / Check Specified Bit Status

Function and operation explanation

1. 16-bit operation(BON, BONP) The status (ON or OFF) of the bit "n" in the device specified by is output to the device specified by . [When the bit "n" is ON, the device specified by is set to ON. When the bit "n" is OFF, the device specified by is set to OFF.]
  • When a constant (K) is specified as , it is automatically converted into the binary format.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 242)
Fig. 217 · Function and operation explanation

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

0 1 0 0 1 0 1 0 1 0 0 0

K4 K5 K6 K7 K0 K1 K2 K3 K8 K9 K10 K11 K12 K13 K14 K15

2. 32-bit operation(DBON, DBONP) The status (ON or OFF) of the bit "n" in the device specified by is output to the device specified by . [When the bit "n" is ON, the device specified by is set to ON. When the bit "n" is OFF, the device specified by is set to OFF.]
  • When a constant (K) is specified as , it is automatically converted into the binary format.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 242)
Fig. 218 · Function and operation explanation

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

0 1 0 0 1 0 1 0 1 0 0 0

K4 K5 K6 K7 K0 K1 K2 K3 K8 K9 K10 K11 K12 K13 K14 K15

Cautions

1. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable. Not indexed (V, Z). S 2:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 4:The FX 3U and FX 3UC PLCs only are applicable.
Page 243 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.5 BON / Check Specified Bit Status
Page 243 · click to enlarge
Page 243
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.5 BON / Check Specified Bit Status diagram (page 243)
Fig. 219 · 11.5 BON / Check Specified Bit Status

When the bit 9 (n=9) in D10 is "1" (ON), M0 is set to "1" (ON).

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

0 1 0 1 0 1 0 1 0 1 0 0

Page 244 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 244 · click to enlarge
Page 244

11.6 MEAN / Mean

11.6 MEAN / Mean

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction obtains the mean value of data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 244)
Fig. 220 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 244)
Fig. 221 · 2. Set data

Head word device storing data to be averaged ANY16 ANY32

Number of data to be averaged (n=1 to 64) ANY16

Word device storing the mean value result ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 244)
Fig. 222 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z z z

S: Refer to "Cautions".

Page 245 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — (D 0) + (D 1) + (D 2)
Page 245 · click to enlarge
Page 245

11.6 MEAN / Mean

Function and operation explanation

1. 16-bit operation (MEAN, MEANP) The mean value of "n" 16-bit data from the device specified by is stored to the device specified by .
  • The sum is obtained as algebraic sum, and divided by "n".
  • The remainder is ignored.

Applied Instructions (High Speed Processing)

MEAN EN s n

+ +1+ + +n–1 s s s

Mean data Resulting data

Number of pieces of data

2. 32-bit operation (DMEAN, DMEANP) The mean value of "n" 32-bit data from the device specified by is stored to the device specified by .

Applied Instructions (Handy Instruction)

  • The sum is obtained as algebraic sum, and divided by "n".
  • The remainder is ignored.

DMEAN EN s n

Applied Instructions (External FX I/O Device)

d Number of pieces of data

d [ +1, ] + [ +3, +2] + + [{ +n × 2–1}], [{ +n × 2–2}] s

n [ +1, ]

Applied Instructions (External Device (optional device))

Cautions

1. 32-bit instructions are not provided in the FX U PLC Ver. 2.30 or earlier.
2. When a device number is exceeded, "n" is handled as a smaller value in the possible range.
3. Some restrictions to applicable devices S 1:The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3:The FX 3U and FX 3UC PLCs only are applicable.

Error

When "n" is any value outside the range from "1" to "64", an operation error (M8067) is caused.

Applied Instructions (Data Transfer 2)

Program examples

The data of D0, D1 and D2 are summed, divided by "3", and then stored to D10.

MEAN EN s n

Applied Instructions (Floating Point)

(D 0) + (D 1) + (D 2)

D0 D10

K3

[ ST ]

MEAN(X000, D0, K3, D10);

Applied Instructions (Positioning Control)

Show 6 more labels / short text on this page
Command input · n · Command input · Mean data · Resulting data · [Structured ladder/FBD]
Page 246 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 246 · click to enlarge
Page 246

11.7 ANS / Timed Annunciator Set

11.7 ANS / Timed Annunciator Set

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction sets a state relay as an annunciator.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 246)
Fig. 223 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 246)
Fig. 224 · 2. Set data

Evaluation time [m=1 to 32,767] (unit: 100 ms) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 246)
Fig. 225 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation When the command input remains ON for equivalent to or longer than the evaluation time [ m × 100 ms, timer specified by ], the device specified by is set. When the command input remains ON for less than the evaluation time [m × 100 ms] and then turns OFF, the current value of the timer for evaluation specified by is reset and the device specified by is not set. When the command input turns OFF, the timer for evaluation is reset.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 246)
Fig. 226 · Function and operation explanation

Equivalent to or longer than evaluation time (m 100 ms)

Page 247 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ANRP EN ENO
Page 247 · click to enlarge
Page 247

11.7 ANS / Timed Annunciator Set

Related device

M8049 Enable annunciator When M8049 is set to ON, M8048 and D8049 are valid.

M8048 Annunciator ON When M8049 is ON and one of the state relays S900 to S999 is ON, M8048 turns ON.

D8049 Smallest state relay number in ON status Among S900 to S999, the smallest state relay number in the ON status is stored.

Applied Instructions (High Speed Processing)

Cautions

Some restrictions to applicable devices S1:T0 to T199 S2:S900 to 999 S3:The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.

Applied Instructions (Handy Instruction)

Program examples

1. Displaying a fault number using an annunciator When the program for external fault diagnosis shown below is created and the content of D8049 (smallest state relay number in the ON status) is monitored, the smallest state relay number in the ON status from S900 to S999 is displayed. If two or more faults are present at the same time, the next smallest fault number is displayed after the fault of the smallest fault number is cleared.

Applied Instructions (External FX I/O Device)

M8000

M8049

When M8049 turns ON, monitoring becomes valid.

Applied Instructions (External Device (optional device))

Y005

ANS EN s m

If the forward end detection input X000 does not turn ON within 1 second after the forward movement output Y005 is driven, S900 turns ON.

T0 S900 K10

ANS EN s m

If both the upper limit input X001 and the lower limit input X002 are OFF for 2 seconds or more due to a DOG error, S901 turns ON.

T1 S901 K20

ANS EN s m

The switch X004 is set to ON in one operation cycle of the machine. If the switch X004 is not set to ON while the continuous operation mode input X003 is ON in the machine whose tact time is less than 10 seconds, S902 turns ON.

T2 S902 K100

Applied Instructions (Data Transfer 2)

Y005

M8048

Y006

When one among S900 to S999 turns ON, M8048 turns ON and the fault display output Y006 turns ON.

Annunciator ON Fault display

Applied Instructions (Floating Point)

A state relay which was set to ON by the external fault diagnosis program is set to OFF by the reset button X007. Every time X007 is set to ON, an operation state relay in the ON status with the smallest device number is reset (set to OFF) in turn.

ANRP EN ENO

[ ST ]

M8049:= M8000; ANS(Y005 AND NOT X000, T0, K10, S900); ANS(NOT X001 AND NOT X002,T1, K20, S901); ANS(X003 AND NOT X004, T2, K100, S902); Y005:=X005; Y006:=M8048; ANRP(X007);

Applied Instructions (Positioning Control)

Show 11 more labels / short text on this page
Device Name Description · [Structured ladder/FBD] · RUN monitor · Forward movement · Forward end · Upper limit · Lower limit · Continuous · Cycle · Forward movement · Reset
Page 248 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related device
Page 248 · click to enlarge
Page 248

11.8 ANR / Annunciator Reset

11.8 ANR / Annunciator Reset

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction resets an annunciator in the ON status with the smallest number.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 248)
Fig. 227 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 248)
Fig. 228 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 248)
Fig. 229 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 16-bit operation (ANR, ANRP) When the command input turns ON, a state relay working as annunciator in the ON status is reset.
  • If two or more state relays are ON, the state relay with the smallest number is reset. When the command input is set to ON again, the state relay with the next smallest number is reset among state relays working as annunciators in the ON status.

Command input ANR EN ENO

Related device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related device diagram (page 248)
Fig. 230 · Related device

M8049 Enable annunciator When M8049 is set to ON, M8048 and D8049 are valid.

M8048 Annunciator ON When M8049 is ON and one of the state relays S900 to S999 is ON, M8048 turns ON.

D8049 Smallest state relay number in ON status Among S900 to S999, the smallest state relay number in the ON status is stored.

Page 249 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 249 · click to enlarge
Page 249

11.8 ANR / Annunciator Reset

Cautions

1. Execution in each operation cycle

  • When ANR instruction is used, annunciators in the ON status are reset in turn in each operation cycle.
  • When ANRP instruction is used, an annunciator in the ON status is reset only in one operation cycle (only once).

Applied Instructions (High Speed Processing)

Program examples

Refer to ANS instruction

→ For a program example, refer to Section 11.7.

Applied Instructions (Handy Instruction)

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 250 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 250 · click to enlarge
Page 250

11.9 SQR / Square Root

11.9 SQR / Square Root

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction obtains the square root. The DESQR instruction obtains the square root in floating point operation.

→ For DESQR instruction, refer to Section 18.15.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 250)
Fig. 231 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 250)
Fig. 232 · 2. Set data

Word device storing data whose square root is obtained. ANY16 ANY32

Data register storing the square root operation result ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 250)
Fig. 233 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 251 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D 10 D 12
Page 251 · click to enlarge
Page 251

11.9 SQR / Square Root

Function and operation explanation

1. 16-bit operation (SQR, SQRP) The square root of the data stored in the device specified by is calculated, and stored to the device specified by ).

Applied Instructions (High Speed Processing)

Root data Resulting data

2. 32-bit operation (DSQR, DSQRP) The square root of the data stored in the device specified by is calculated, and stored to the device specified by ).

Applied Instructions (Handy Instruction)

+1, +1, d s d s

Root data Resulting data

Cautions

1. The instruction is provided in the FX U PLC Ver. 3.07 or later.

Applied Instructions (External FX I/O Device)

2. The obtained square root is an integer because the decimal point is ignored. When the decimal point is ignored, M8021 (borrow flag) turns ON.
3. When the calculated value is true "0", M8020 (zero flag) turns ON.
4. Some restrictions to applicable devices S 1:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (External Device (optional device))

Program examples

The square root of D10 is stored to D12. The value of D10 is "100".

D 10 D 12

D10 D12

[ ST ]

SQR(X000, D10, D12);

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 8 more labels / short text on this page
Command input · SQR EN s · d s · Command input · DSQR EN s · [Structured ladder/FBD] · SQR EN s · 100 10 =
Page 252 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 252 · click to enlarge
Page 252

11.10 FLT / Conversion to Floating Point

11.10 FLT / Conversion to Floating Point

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts a binary integer into a binary floating point (real number).

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 252)
Fig. 234 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 252)
Fig. 235 · 2. Set data

Data register storing binary floating point (real number) ANY_SIMPLE

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 252)
Fig. 236 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 253 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 253 · click to enlarge
Page 253

11.10 FLT / Conversion to Floating Point

Function and operation explanation

1. 16-bit operation (FLT, FLTP) The binary integer data of the device specified by is converted into binary floating point (real number), and stored to the device specified by .

( +1, ) d s d

Applied Instructions (High Speed Processing)

Binary integer Binary floating point (real number)

Device that stores the binary integer data

Device that stores the binary floating point data

2. 32-bit operation (DFLT, DFLTP) The binary integer data of the device specified by is converted into binary floating point (real number), and stored to the device specified by .

Applied Instructions (Handy Instruction)

( +1, ) ( +1, )

d s d s

Device that stores the binary integer data

Device that stores the binary floating point data

Binary integer Binary floating point (real number)

Related instruction

Applied Instructions (External FX I/O Device)

INT It is inverse of FLT instruction, and converts binary floating point into binary integer.

Related devices

→ For the method of the zero and borrow flags, refer to Section Section 1.3.4.

Applied Instructions (External Device (optional device))

M8020 Zero flag Turns ON when the value is true "0".

M8021 Borrow flag Turns ON when the floating point is rounded down..

Cautions

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. The instruction is provided in the FX U PLC Ver. 3.07 or later.
3. Some restrictions to applicable devices S 1:The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2:The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 6 more labels / short text on this page
Command input · FLT EN s · Command input · DFLT EN s · Instruction Description · Device Name Description
Page 254 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — BIN
Page 254 · click to enlarge
Page 254

11.10 FLT / Conversion to Floating Point

Program examples

1. Arithmetic operations by binary floating point operations The sequence program shown below is constructed as follows:
1. Calculation example

× K34.5 (D 0) (X017 to X010) 16-bit binary 2-digit BCD

(D 11, D 10) Binary floating point

(D 13, D 12) Decimal floating point operation for monitoring

1. 2)

(D 21, D 20) Binary floating point

(D 27, D 26) Binary floating point

(D 15, D 14) 32-bit binary integer

BIN

(D 25, D 24) Binary floating point

(D 29, D 28) Binary floating point

Show 11 more labels / short text on this page
6) · operation · 7) · 5) · 4) · 8) · operation · operation · 3) · operation · operation
Page 255 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 11.10 FLT / Conversion to Floating Point
Page 255 · click to enlarge
Page 255
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11.10 FLT / Conversion to Floating Point diagram (page 255)
Fig. 237 · 11.10 FLT / Conversion to Floating Point

Binary floating point operation (D52, D51) (D55, D54) (D27, D26)

Binary floating point operation Decimal floating point operation for monitoring

FLT(M8000, D0, D20); BIN(M8000, K2X010, D22); FLT(M8000, D22, D24); MOV(M8000, K345, D50; FLT(M8000, D50, D51); MOV(M8000, K10, D53); FLT(M8000, D53, D54); DEDIV(M8000, D51, D54, D26); DEDIV(M8000, D20, D24, D28); DEMUL(M8000, D28, D26, D10); DEBCD(M8000, D10, D12); DINT(M8000, D10, D14);

Page 256 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLSR
Page 256 · click to enlarge
Page 256

12 Applied Instructions (High Speed Processing)

12. Applied Instructions (High Speed Processing)

This chapter introduces interrupt processing type high-speed instructions that execute sequence control using the latest I/O information and utilize the high-speed processing performance of the PLC.

Instruction name Function Reference

REF

Refresh Section 12.1 REFP

REFF

Refresh and Filter Adjust Section 12.2 REFFP

MTR Input Matrix Section 12.3

DHSCS

High Speed Counter Set, High Speed Interrupt Counter Set Section 12.4 DHSCS_I

DHSCR High Speed Counter Reset Section 12.5

DHSZ High Speed Counter Zone Compare Section 12.6

SPD

Speed Detection Section 12.7 DSPD

PLSY

Pulse Y Output Section 12.8 DPLSY

PWM Pulse Width Modulation Section 12.9

PLSR

Acceleration/Deceleration Setup Section 12.10 DPLSR

Page 257 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.1 REF / Refresh
Page 257 · click to enlarge
Page 257
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.1 REF / Refresh diagram (page 257)
Fig. 238 · 12.1 REF / Refresh

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction immediately outputs the latest input (X) information or the current output (Y) operation result in the middle of a sequence program operation.

Bit device (X or Y) to be refreshed Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 258 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 258 · click to enlarge
Page 258

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.1 REF / Refresh

12 Applied Instructions (High Speed Processing)

Function and operation explanation

1. 16-bit operation(REF, REFP)

1. When refreshing outputs (Y) "n" points are refreshed from the output of the device specified by . ("n" must be a multiple of 8.)
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 258)
Fig. 239 · Function and operation explanation

* Refer to "Caution" for the head device number and the number of points.

- When this instruction is executed, the output latch memory is refreshed to the output status in the specified range.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 258)
Fig. 240 · Function and operation explanation
2. When refreshing inputs (X) "n" points are refreshed from the input of the device specified by . ("n" must be a multiple of 8.)
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 258)
Fig. 241 · Function and operation explanation

* Refer to "Caution" for the head device number and the number of points.

- If the input information is turned ON approximately 10 ms (response delay time of the input filter) before the instruction is executed, the input image memory turns ON when the instruction is executed. - The response delay time of the input filter can be changed.

→ For details, refer to "what should be understood before using the REF instruction"

described later.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 258)
Fig. 242 · Function and operation explanation

REF instruction + END instruction processing Only END instruction processing

Page 259 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K 24
Page 259 · click to enlarge
Page 259

12 Applied Instructions (High Speed Processing)

12.1 REF / Refresh

Cautions

1. When setting the specified head device number "d", make sure that the least significant digit number is "0" such as "X000, X010, X020, ..." or "Y000, Y010, Y020, ...".
2. Instructions of pulse operation type are not provided in the FX 0S , FX 0 or FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. Some restrictions to applicable devices S 1: X000, X010, X020 Up to the final input number (The last digit number must be "0".) S 2: Y000, Y010, Y020 Up to the final output number (The last digit number must be "0".) S 3: Set a multiple of "8" to the number of refresh points "n", such as K8(H8), K16(H10), ..., K256 (H100).

Applied Instructions (High Speed Processing)

Any number other than the above generates an error.

FX3U, FX3UC K8(H8), K16(H10), ..., K256(H100)

Applied Instructions (Handy Instruction)

FX3G, FX3GC K8(H8), K16(H10), ..., K128(H80)

FX3S K8(H8) or K16(H10)

FX1S, FX1N, FX1NC, FX2N, FX2NC K8(H8), K16(H10), ..., K256(H100)

FX0S, FX0 K8(H8) or K16(H10)

FX 0N K8(H8), K16(H10), ..., K128(H80)

FXU, FX2C K8(H8), K16(H10), ..., K256(H100)

Applied Instructions (External FX I/O Device)

Program examples

1. When refreshing inputs Only X010 to X017 (8 points in total) are refreshed.

[ST]

Applied Instructions (External Device (optional device))

X000 REF EN d n

ENO X010

REF(X000,X010,K8);

K 8

2. When refreshing outputs Y000 to Y007, Y010 to Y017 and Y020 to Y027 (24 points in total) are refreshed.

[ST]

X001 REF EN d n

ENO Y000

REF(X001,Y000,K24);

Applied Instructions (Data Transfer 2)

K 24

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

PLC n · [Structured ladder/FBD] · [Structured ladder/FBD]

Page 260 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.1.1 What should be understood before using the REF instruction
Page 260 · click to enlarge
Page 260

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.1 REF / Refresh

12 Applied Instructions (High Speed Processing)

12.1.1 What should be understood before using the REF instruction

1. Changing the input filter The input filter value is determined by the contents of D8020 (initial value: 10 ms). Use the MOV instruction, etc. to adjust the value in D8020, which represents the input filter value.

→ For details, refer to "FX Structured Programming Manual (Device & Common)."

2. Output response time After the REF instruction is executed, the output (Y) sets the output signal to ON after the response time shown below.

→ For details, refer to the respective PLC Hardware Edition manuals.

1. Relay output type The output contact is activated after the response time of the output relay. - Y000 and higher: Approximately 10 ms
2. Transistor output type a) For FX 3U PLC

- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) b) For FX3UC (D, DSS) PLC

- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) c) For FX3UC-32MT-LT (-2) PLC

- Y000, Y001, Y002, Y003: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y004 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) d) For FX3G PLC (14-point, 24-point types) and FX3GC PLCs

- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) e) For FX3G (40-point, 60-point types)

- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) f) For FX3GC PLC

- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) g) For FX3S PLC

- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) h) For FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs

- Y000, Y001: 15 μs to 30 μs or less - Y002 and higher: 0.2 ms or less i) For FX0S, FX0, FX0N, FXU and FX2C PLCs - Y000 and higher: 0.2 ms or less

3. When using the REF instruction between FOR and NEXT instructions or between a label (with a lower step number) and CJ instruction (with a higher step number) Inputs and outputs can be refreshed in a routine program even when the input information or immediate output is required in the middle of a routine program during control.
4. When using the input interrupt (I) function When executing interrupt processing accompanied by I/O operations, I/O refresh can be executed in the interrupt routine to receive the latest input (X) information and give the immediate output (Y) of the operation result so that dispersion caused by the operation time is improved.
Page 261 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX 3U , FX 3UC
Page 261 · click to enlarge
Page 261

12 Applied Instructions (High Speed Processing)

12.2 REFF / Refresh and Filter Adjust

12.2 REFF / Refresh and Filter Adjust

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

The digital input filter time of the inputs can be changed using this instruction or D8020. Using this instruction, the status of inputs can be refreshed at an arbitrary step in the program for the specified input filter time, and then transferred to the image memory.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

REFF EN ENO n

REF 16 bits Continuous REF(EN, n);

Applied Instructions (External FX I/O Device)

REFP 16 bits Pulse REFP(EN, n);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Digital input filter time (1 ms increment) ANY16

Output variable ENO Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System User Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S 1 S 1 S 2 S 2

Applied Instructions (Data Transfer 2)

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation(REFF, REFFP) The image inputs below are refreshed at the digital input filter time [n × 1 ms].

Applied Instructions (Floating Point)

X000 to X017 X000 to X007 in the FX3U-16M , and FX3UC-16M

FX 3U , FX 3UC

FX2N, FX2NC X000 to X017 X000 to X007 in the 16-input basic units

FXU, FX2C X000 to X007

REFF EN ENO n

K0 to K60 (Filter constant from 0 to 60 ms)

Applied Instructions (Positioning Control)

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · REFFP EN n · Input variable · Operand · Unit Index Cons · Real Number · Character · String Pointer · type · tant · PLC Input · Command input · Digital input · filter time
Page 262 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 262 · click to enlarge
Page 262

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.2 REFF / Refresh and Filter Adjust

12 Applied Instructions (High Speed Processing)

  • When the input turns ON "n × 1 ms" before the instruction is executed, the input image memory is set to ON. When the input turns OFF "n × 1 ms" before the instruction is executed, the input image memory is set to OFF.
  • When the command input is ON, the REFF instruction is executed in each operation cycle.
  • When the command input is OFF, the REFF instruction is not executed, and the input filter uses the set value of D8020 (which is the value used during input processing).

Cautions

1. Function of the input filter The filter time of the digital filter can be changed in 1 ms units within the range from 0 to 60 ms using instructions. When the filter time is set to "0", the input filter value is as follows.
1. For FX 3U and FX 3UC PLCs

Input number Input filter value when set to "0"

X000 to X005 5μs*2

X006, X007 50μs

X010 to X017*3 200μs*3

*1. X000 to X007 in the FX3U-16M , and FX3UC-16M

*2. When setting the input filter time to "5 μs", perform the following actions. - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 kΩ (1 W or more) to the input terminal, and make sure that the load current in the open collector transistor output of the external equipment is 20 mA or more including the input current of the main unit.

*3. The filter time is fixed for 10 ms in X010 to X017 in 16-point type FX3U PLCs and 16-point type FX3UC PLCs.

2. For FX 2N and FX 2NC PLCs

Input number Input filter value when set to "0"

X000, X001 20μs

X002 to X017 50μs

3. For FX U and FX 2C PLCs

Input number Input filter value when set to "0"

X000 to X007 50μs

2. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable. S 2: Set the filter time within the range of K0(H0) to K60(H3C) [0 to 60 ms].
Page 263 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1. Relationship between the program and the filter time
Page 263 · click to enlarge
Page 263
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.2 REFF / Refresh and Filter Adjust diagram (page 263)
Fig. 243 · 12.2 REFF / Refresh and Filter Adjust

1. Relationship between the program and the filter time

When X010 is ON The image memory is refreshed with an input filter of 1 ms.

Set value of D8020 (Initial value: 10 ms) Sequence

END The image memory is refreshed with an input filter of 20 ms.

The image memory is refreshed with the input filter value set in D8020.

Page 264 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.2.1 What should be understood before using REFF instruction
Page 264 · click to enlarge
Page 264

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.2 REFF / Refresh and Filter Adjust

12 Applied Instructions (High Speed Processing)

12.2.1 What should be understood before using REFF instruction

Generally, a C-R filter of approximately 10 ms is provided for inputs in PLCs as countermeasures against chattering and noise at the input contacts. A digital filter is provided for some inputs (*1). The digital filter value can be changed within the range from 0 to 60 ms using instructions.

1. How to change the digital filter (executing END instruction) The digital filter initial value (10 ms) is set in special data register D8020. By changing this value using the MOV instruction, etc., the input filter value for X000 to X017 *2 which is used during execution of the END instruction can be changed.

When the command is ON

When the END instruction is executed

Digital filter Initial value10 ms

memory C-R filter Fixed to 10 ms

*1. Where a digital filter is used on an input terminal, refer to the descriptions on the functions and operations.

2. Instruction in which the digital filter is automatically changed Regardless of the change in the filter time executed by the REFF instruction, when the following functions and instructions are executed, the input filter value is automatically changed (as shown in the caution). However, if the digital filter is used in any other functions or instructions than the ones listed, the digital filter uses the time set in D8020. As a result, the program will not run correctly if the ON or OFF duration of the corresponding input signal is less than the input filter time.

  • Input of interrupt pointer specified in the input interrupt function
  • Input used in a high speed counter
  • Input used in the SPD instruction
Show 4 more labels / short text on this page
REFF instruction · Input terminal*1 · Input image · Input terminal
Page 265 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 265 · click to enlarge
Page 265

12 Applied Instructions (High Speed Processing)

12.3 MTR / Input Matrix

12.3 MTR / Input Matrix

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction reads matrix input as 8-point input × "n" output (transistor) in the time division method.

1. Format and operation, execution form

Expression in each language

MTR EN s n

Applied Instructions (Handy Instruction)

MTR 16 bits Continuous MTR(EN, s, n, d1, d2);

2. Set data

Applied Instructions (External FX I/O Device)

Variable Description Data type

EN Execution condition Bit

Head device (X) number of matrix signal input X000, X010, X020, ..., final input X number (Only "0" is allowed in the least significant digit of device numbers)

Number of columns in matrix input (K2 to K8/H2 to H8) ANY16

ENO Execution state Bit

Applied Instructions (External Device (optional device))

Head device (Y) number of matrix signal output Y000, Y010, Y020, ..., final output Y number (Only "0" is allowed in the least significant digit of device numbers.)

Head bit device (Y, M or S) number of ON output destination Y000, Y010, Y020, ..., final Y number, M000, M010, M020, ... , final M number or S000, S010, S020, ..., final S number (Only "0" is allowed in the least significant digit of device numbers.)

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · d1 d2 · Bit · Input variable · Bit · Output variable · Bit · Operand · Special · Real Number · Character · String Pointer · type · User · z · z z · z · z z z
Page 266 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 266 · click to enlarge
Page 266

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.3 MTR / Input Matrix

12 Applied Instructions (High Speed Processing)

Function and operation explanation

1. 16-bit operation (MTR) An input signal of 8 points × "n" columns is controlled in the time division method using 8 inputs of the device specified by and "n" transistor outputs of the device specified by . Each column is read in turn, and then output to the device specified by .

MTR EN s n

Input number Output number

ON output destination Number of

For each output, the I/O processing is executed immediately in turn in interrupt at every 20 ms under consideration of the input filter response delay of 10 ms. The figure below shows an example of the FX3U series main unit (sink input / sink output). For the wiring, refer to the manual of the PLC used.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 266)
Fig. 244 · Function and operation explanation

0V 24V s

Related devices

complete Turns ON after the first cycle operation

Cautions

1. Number of occupied devices

1. Eight input points are occupied from the input device number specified in .
2. "n" output points are occupied from the output device number specified in . When specifying the output in , make sure that "n" output numbers specified in does not overlap the output specified in .
2. Limitation in the number of instructions The MTR instruction can be used only once in a program.
3. Wiring One diode of 0.1A/50V is required for each switch.
4. Output format Use the transistor output format.
5. Cautions about writing during RUN Even if an operand device is changed by write during RUN while the MTR instruction is executed, the PLC operates using the device before change. The changed device is reflected after the command input is set to OFF once and set to ON again.
Show 6 more labels / short text on this page
Command input · (normally ON) · d1 d2 · columns · Device Name Description · M8029 Instruction execution
Page 267 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.3 MTR / Input Matrix
Page 267 · click to enlarge
Page 267
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.3 MTR / Input Matrix diagram (page 267)
Fig. 245 · 12.3 MTR / Input Matrix

n = Three outputs (Y020, Y021 and Y022) are set to ON in turn repeatedly. Every time an output is set to ON, eight inputs in the 1st, 2nd and 3rd columns are received in turn repeatedly, and stored to M30 to M37, M40 to M47, and M50 to M57 respectively. In this program example, the FX3U series main unit (sink input / sink output) is used. For the wiring, refer to the manual of the PLC used.

COM Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027

Page 268 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y040
Page 268 · click to enlarge
Page 268

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.3 MTR / Input Matrix

12 Applied Instructions (High Speed Processing)

12.3.1 Operation and cautions for MTR instruction

1. Command input

1. Setting the command input to normally ON For the MTR instruction, set the command input to normally ON.

MTR EN s n

Y040

K 8

M 0

2. Input numbers used in MTR instruction

1. Inputs available in MTR instruction Use inputs X020 and later under normal conditions.
2. When using the inputs X000 to X017 (X000 to X007 for 16-point type main unit) The receiving speed is higher. Because the output transistor recovery time is long and the input sensitivity is high, however, erroneous input pulses may be counted. To prevent erroneous input pulses, connect pull-up resistors (3.3 k Ω / 0.5W) to transistor outputs used in MTR instruction. For pull-up resistors, use the power supply shown in the table below.

Power supply used for pull-up resistors

AC power type PLC Service power supply

DC power type PLC Power supply for driving PLC

The figure below shows an example of the FX3U series main unit (sink input / sink output).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Y040 diagram (page 268)
Fig. 246

0V X000 X001 X002 X003 X004 X005 X006 X007

COM5 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027

3. ON/OFF duration of input signals Because 64 input points (8 rows × 8 columns) are received in a cycle of 80 or 160 ms, the ON/OFF duration of each input signal should be greater than or equal to the value shown below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Y040 diagram (page 268)
Fig. 247

*1. X000 to X007 for FXU, FX2C, FX1S, FX1N, FX1NC, FX3G and FX3GC PLCs.

*2. X010 and later for FXU, FX2C, FX1S, FX1N, FX1NC, FX3G, FX3GC PLCs.

M (Normally ON) · d1 d2 X020

Page 269 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — S 4
Page 269 · click to enlarge
Page 269

12 Applied Instructions (High Speed Processing)

12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

DHSCS

DHSCS_I

Applied Instructions (High Speed Processing)

  • These instructions compare a value counted by a high speed counter with a specified value at each count, and execute the following processing.
  • DHSCS: Sets an external output (Y).
  • DHSCS_I: Executes an interrupt program.

→ Refer to Section 35.6 for the counter interrupt using this (DHSCS_I) instruction. 1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DHSCS EN s1 s2

Applied Instructions (External FX I/O Device)

DHSCS 32 bits Continuous DHSCS(EN, s1, s2, d);

DHSCS EN ENO DHSCS_I EN s1

DHSCS_I 32 bits Continuous DHSCS_I(EN, s1, s2, i);

Applied Instructions (External Device (optional device))

2. Set data

name Variable Description Data type

EN Execution condition Bit

Data to be compared with the current value of a high-speed counter or word device storing the data to be compared ANY32

DHSCS

Device of a high speed counter ANY32

EN0 Execution state Bit

Bit device to be set to ON when the compared two values are equivalent to each other Bit

Applied Instructions (Data Transfer 2)

EN Execution condition Bit

Data to be compared with the current value of a high-speed counter or word device storing the data to be compared ANY32

DHSCS_I

Device of a high speed counter ANY32

Interrupt pointer (I) for executing an interrupt program when the compared two values agree. ANY16

Applied Instructions (Floating Point)

Output variable EN0 Execution state Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System

Unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

DHSCS

z z z S1 z

z S2 S3 z

DHSCS_I

Applied Instructions (Positioning Control)

S 4

S: Refer to "Cautions".

Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · s2 i · Instruction · Input variable · Output variable · Input variable · Instruction · Operand · Special · Real Number · Character · String Pointer · name · type · User · z z · z z
Page 270 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y010 K100 = →
Page 270 · click to enlarge
Page 270

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12 Applied Instructions (High Speed Processing)

Function and operation explanation

1. 32-bit operation (DHSCS) When the current value of a high speed counter of the device specified by becomes the comparison value of the device specified by (for example, when the current value changes from "199" to "200" or from "201" to "200" if the comparison value is K200), the bit device specified by is set to ON without regard to the operation cycle. This instruction is executed after the counting processing in the high speed counter.

OUT_C_32 EN CCoil CValue

ENO CC235

DHSCS EN s1 s2

= → Set to ON s1 s2 d

Comparison value Comparison source

Operation

When the current value of the high speed counter C235 changes from "99" to "100" or from "101" to "100", Y010 is set to ON (output refresh).

M8000

OUT_C_32 EN CCoil CValue

ENO CC235

DHSCS EN s1 s2

Set to ON CN235 Y010

Y010 K100 = →

Related instruction

The following instructions can be combined with high speed counters.

DHSCS High speed counter set

DHSCR High speed counter reset

DHSZ High speed counter zone compare

DHCMOV High speed counter move

DHSCT High speed counter compare with data table

Show 5 more labels / short text on this page
Command input · d Output destination · RUN monitor · d K100 CN235 · Instruction Instruction name
Page 271 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. DHSCS_I instruction
Page 271 · click to enlarge
Page 271

12 Applied Instructions (High Speed Processing)

12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

Cautions

1. Selection of the counter comparison method When the DHSCS instruction is used, the maximum frequency and total frequency of the high speed counter are affected. Refer to the counting operation described below, and select according to the contents of control whether to use this instruction or general-purpose comparison instruction.

Applied Instructions (High Speed Processing)

1. Case to select DHSCS instruction - When the output should be given when the counting result becomes equivalent to the comparison value without regard to the scan time of the PLC.
2. Cases to select a general-purpose comparison instruction - When the required frequency is beyond the counting performance. - When counting is regarded as important, but the effect of the scan time can be ignored in operations according to the counting result. - When the number of an instruction exceeds the allowable limit. For FX 3U and FX 3UC PLCs

Applied Instructions (Handy Instruction)

M8000 DHCMOV EN s n

CN251 D100

Applied Instructions (External FX I/O Device)

LDD

SET EN

K100

Y010

Applied Instructions (External Device (optional device))

REF EN d n

ENO Y010

K8

For FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs

LDD

SET EN

K40000

Y010

CN251

REF EN d n

ENO Y010

K8

Applied Instructions (Data Transfer 2)

For FX0S, FX0, FX0N, FXU, and FX2C PLCs

SET EN

CN251

GE

Y010

REF EN d n

Applied Instructions (Floating Point)

INT_TO_DINT _INT

ENO Y010

K20000

K8

2. Device specification range Only high speed counters can be specified as . For details, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

3. DHSCS_I instruction

  • Use the DHSCS_I instruction when executing counter interrupt using the interrupt pointer (I).

→ Refer to Section 35.6 for the counter interrupt using this instruction.

Applied Instructions (Positioning Control)

  • The FX 0S , FX 0 , FX 0N , FX 1S , FX 1N , FX 1NC , FX 3S , FX 3G and FX 3GC PLCs do not support this instruction.
Show 4 more labels / short text on this page
d K0 · d ENO · d ENO · d ENO
Page 272 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y010
Page 272 · click to enlarge
Page 272

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12 Applied Instructions (High Speed Processing)

4. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable.

Not indexed (V, Z). S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable. S4: When executing counter interrupt, the interrupt pointer is specified using the DHSCS_I instruction.

(Not available for the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC.)

→ For the counter interrupt using this instruction, refer to Section 35.6.

5. Precedence of DHSCS, DHSCR and DHSZ instructions to one particular high speed counter → Refer to caution 6 in "Common cautions on using instructions for high speed counter" which is

described later.

6. Reset operation by an external terminal → Refer to caution 5 in "Common cautions on using instructions for high speed counter" which is

described later.

7. Other cautions on use → Refer to caution in "Common cautions on using instructions for high speed counter" which is

described later.

Program examples

With regard to the current value of a counter, different outputs (Y) are arbitrarily set to ON by two values.

M8000

OUT_C_32 EN CCoil CValue

ENO CC251 K2147483647

Set the maximum counting value of high speed counter.

DHSCS EN s1 s2

CN251=K100 → Y010=ON

K100

Y010

CN251

DHSCS EN s1 s2

CN251=K150 → Y011=ON

K150

Y011

CN251

0 ... 99 100 101 ... 149 150 151

Y010

Y011

[ST]

OUT_C_32(M8000,CC251,K2147483647);

DHSCS(M8000,K100,CN251,Y010);

DHSCS(M8000,K150,CN251,Y011);

[Structured ladder/FBD] · RUN monitor

Page 273 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000
Page 273 · click to enlarge
Page 273

12 Applied Instructions (High Speed Processing)

12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12.4.1 Common cautions on using instructions for high speed counter

DHSCS, DHSCR, DHSZ and DHSCT instructions are provided for high speed counters. This section explains common cautions for these instructions.

1. Limitation in the number of an instruction in a program DHSCS, DHSCR and DHSZ instructions can be used as many times as necessary in the same way as general instructions. However, the number of simultaneously driven instructions is limited.

Applied Instructions (High Speed Processing)

1. For FX 3U and FX 3UC PLCs

Instruction Limitation in number of instructions driven at same time

DHSCS

32 instructions including DHSCT instruction DHSCR

DHSZ

DHSCT Only 1 (This instruction can only be used once.)

Applied Instructions (Handy Instruction)

2. For FX 0S , FX 0 , FX 0N , FX 1S , FX 1N , FX 1NC , FX U , FX 2C , FX 2N , FX 2NC , FX 3S , FX 3G and FX 3GC PLCs

Instruction Limitation in number of instructions driven at same time

DHSCS

DHSZ *1

Applied Instructions (External FX I/O Device)

*1. The instruction is not provided in the FX0S, FX0, FX0N, FX1S, FX1N and FX1NC PLCs.

2. Response frequency of high speed counters When DHSZ instruction is used, the maximum response frequency of every software counter and the total frequency are limited. For details, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

Applied Instructions (External Device (optional device))

3. Specification of output numbers (Y) When using the same instruction for high speed counter repeatedly or when driving two or more instructions for high speed counter at the same time, specify such output devices (Y) whose high-order two digits are the same (in units of 8 devices).
1. When using devices of the same number (in units of 8 devices) Example: when using Y000, specify Y000 to Y007. When using Y010, specify Y010 to Y017.
2. When using two or more instructions for high speed counter and non-consecutive output (Y) numbers A program example is shown below:

M8000 DHSCS EN s1 s2

Y000

Applied Instructions (Data Transfer 2)

DHSCS EN s1 s2

d Y010 K100 CN255

Applied Instructions (Floating Point)

When C255 reaches K100, the output Y000 is driven by interrupt. Y010 is driven when END processing is executed. If interrupt drive is required, use an output number in the range from Y001 to Y007 whose high-order two digits are equivalent.

4. Caution on the counting operation when the current value is changed An instruction for the high speed counter gives the comparison result when a pulse is input to the input (X) of the high speed counter. However, the comparison result is not given when the current value of the high speed counter is changed in the following method.
1. Change method (example) a) Overwriting the contents of a word device used as the comparison value using DMOV instruction, etc. b) Resetting the current value of a high speed counter in a program.

Applied Instructions (Positioning Control)

6 instructions DHSCR · d K100 CN255

Page 274 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000 K0
Page 274 · click to enlarge
Page 274

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12 Applied Instructions (High Speed Processing)

2. Operation Even if the condition for setting the output to ON or OFF is given as the comparison result, the comparison result does not change when an instruction is simply driven.

5. Reset operation by an external terminal [M8025*1: DHSC (external reset) mode] For a high speed counter equipped with an external reset terminal (R) such as C241, an instruction is executed and the comparison result is output at the rising edge of the reset input signal. (The FXU PLC of V2.1 or later and produced February 1990 or later are compatible with this function. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC is not compatible.)

1. Program If an instruction for the high speed counter is used while M8025 *1 is driven, the instruction is executed again when the current value of the high speed counter C241 is cleared by an external reset terminal. And the comparison result is output even if a counting input is not given.

M8000

M8025 External reset mode *1

External reset terminal for C241 X001

OUT_C_32 EN CCoil CValue

ENO CC241

K9999

DHSCR EN s1 s2

Y000 K0

*1. It is not necessary to drive M8025 for the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G and FX3GC PLCs. The above reset operation takes place as a basic function.

2. Operation When the external reset input X001 turns ON while the current value of C241 is "100", for example, the current value of C241 is reset to "0". And Y000 is reset at this time even if a counting input is not given.

RUN monitor · d CN241

Page 275 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K500
Page 275 · click to enlarge
Page 275

12 Applied Instructions (High Speed Processing)

12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

6. Priority order in operations among DHSCS, DHSCR and DHSZ instructions for the same high speed counter when the same comparison value is used.

1) FX3U and FX3UC PLCs When the same comparison value is used for the same high speed counter in DHSCS, DHSCR and DHSZ instructions, high speed counter reset (self-reset) by DHSCR instruction is executed with the highest priority (as shown in the table below). In this case, the comparison results do not change in DHSCS, DHSCR and DHSZ instructions whose comparison value is programmed to be the same as the comparison value for self-reset by DHSCR instruction. To change the comparison results, set the comparison value to "K0".

Applied Instructions (High Speed Processing)

2. FX 1S , FX 1N , FX 1NC , FX 2N , FX 2NC , FX 3S , FX 3G and FX 3GC PLCs Comparison is executed in the programmed sequence without regard to the instructions.

Applied Instructions (Handy Instruction)

  • FX 3U
  • FX 3UC FX 2N
  • FX 2NC
  • FX 3S
  • FX 3G
  • FX 3GC FX 1N
  • FX 1S
  • FX 1NC

DHSCS (1) DHSCR (6) (Self-reset) DHSCS (1) DHSCS (1)

DHSCS (2) DHSZ (4) DHSCS (2) DHSCS (2)

DHSCR (3) DHSCS (1) DHSCR (3) DHSCR (3)

DHSZ (4) DHSCS (2) DHSZ (4) (Not supported)

DHSCR (5) DHSCR (3) DHSCR (5) DHSCR (5)

Applied Instructions (External FX I/O Device)

DHSCR (6) (Self-reset) DHSCR (5) DHSCR (6) (Self-reset) DHSCR (6) (Self-reset)

M8000

OUT_C_32 EN CCoil CValue

ENO CC235

Applied Instructions (External Device (optional device))

DHSCS EN s1 s2

Y000

CN235

DHSCS EN s1 s2

K500

Y001

DHSCR EN s1 s2

Y002

K500

M8000

DHSZ EN s1 s2

Applied Instructions (Data Transfer 2)

K250 K500

Y003

DZCPP EN s1 s2

Applied Instructions (Floating Point)

K250 K500

Y003

M8000

DHSCR EN s1 s2

K500

Y006

DHSCR EN s1 s2

K500

Applied Instructions (Positioning Control)

Show 16 more labels / short text on this page
Processing sequence · Program sequence · d K500 · (1) · d CN235 · (2) · d CN235 · (3) · (4) · s CN235 · s3 CN235 · (5) · d CN235 · (6) · d CN235 · Self-reset program
Page 276 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation of FX 3U and FX 3UC PLCs
Page 276 · click to enlarge
Page 276

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set

12 Applied Instructions (High Speed Processing)

Operation of FX 3U and FX 3UC PLCs

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation of FX 3U and FX 3UC PLCs diagram (page 276)
Fig. 248 · Operation of FX 3U and FX 3UC PLCs

*1. To change the comparison results by the instructions (1) to (3) and (5) in the previous page, change the comparison value "K500" in the instructions (1) to (3) and (5) in the previous page to "K0".

*2. To set Y005 to ON in the DHSZ instruction (4) in the previous page, set a value smaller than the comparison value "K500". However, due to the response delay at the output, the output may not operate within the short time before the counter's current value is reset to "0" (to K500 (K0)).

Y000 to Y002 and Y006 do not change.*1

Operation of FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation of FX 3U and FX 3UC PLCs diagram (page 276)
Fig. 249 · Operation of FX 3U and FX 3UC PLCs

*1. Due to the response delay at the output, the output may not operate within the short time before the counter's current value is reset from "0" to "1".

7. Timing at which the instruction is executed The comparison instruction for high-speed counter is executed at the END instruction for the scan in which the comparison instruction is driven. When the comparison value is changed, the changed comparison instruction also becomes effective at the END instruction for the scan in which the comparison instruction is driven.
Page 277 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.5 DHSCR / High Speed Counter Reset
Page 277 · click to enlarge
Page 277
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.5 DHSCR / High Speed Counter Reset diagram (page 277)
Fig. 250 · 12.5 DHSCR / High Speed Counter Reset

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction compares the value counted by a high speed counter with a specified value at each count, and immediately resets an external output (Y) when both values become equivalent to each other.

Data to be compared with the current value of a high-speed counter or

word device storing the data to be compared*1 ANY32

Bit device to be set to ON when the compared two values are equivalent to each other Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

Page 278 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y010 K100 = → CN235 Y010
Page 278 · click to enlarge
Page 278

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.5 DHSCR / High Speed Counter Reset

12 Applied Instructions (High Speed Processing)

Function and operation explanation

1. 32-bit operation (DHSCR) When the current value of the high speed counter of the device specified by becomes the comparison value of the device specified by (for example, when the current value changes from "199" to "200" or from "201" to "200" if the comparison value is K200), the bit device specified by is reset (set to OFF) regardless of the operation cycle. In this instruction, the comparison processing is executed after the counting processing in the high speed counter.

OUT_C_32 EN CCoil CValue

ENO CC235

DHSCR EN s1 s2

Reset s1 s2 d

Comparison value Comparison source

Operation

When the current value of the high speed counter C255 changes (counts) from "99" to "100" or from "101" to "100", Y010 is reset (output refresh).

M8000

OUT_C_32 EN CCoil CValue

ENO CC235 K2147483647

DHSCR EN s1 s2

Y010 K100 = → CN235 Y010

Related instruction

The following instructions can be combined with high speed counters.

DHSCS High speed counter set

DHSCR High speed counter reset

DHSZ High speed counter zone compare

DHCMOV High speed counter move

DHSCT High speed counter compare with data table

Show 7 more labels / short text on this page
Command input · = → · d Output destination · RUN monitor · Reset · d K100 CN235 · Instruction Instruction name
Page 279 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K20000
Page 279 · click to enlarge
Page 279

12 Applied Instructions (High Speed Processing)

12.5 DHSCR / High Speed Counter Reset

Cautions

1. Selection of the counter comparison method When the DHSCS instruction is used, the maximum frequency and total frequency of the high speed counter are affected. Refer to the counting operation described below, and select according to the contents of control whether to use this instruction or general-purpose comparison instruction.

Applied Instructions (High Speed Processing)

1. Case to select DHSCR instruction - When the output should be given when the counting result becomes equivalent to the comparison value without regard to the scan time of the PLC.
2. Cases to select a general-purpose comparison instruction - When the required frequency is beyond the counting performance. - When counting is regarded as important, but the effect of the scan time can be ignored in operations according to the counting result. - When the number of an instruction exceeds the allowable limit. For FX 3U and FX 3UC PLCs

Applied Instructions (Handy Instruction)

M8000 DHCMOV EN s n

Applied Instructions (External FX I/O Device)

CN251 D100

LDD

RST EN ENO

K100

Y010

Applied Instructions (External Device (optional device))

REF EN d n

ENO Y010

K8

For FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs

LDD

RST EN

K40000

Y010

CN251

REF EN d n

ENO Y010

Applied Instructions (Data Transfer 2)

K8

For FX0S, FX0, FX0N, FXU and FX2C PLCs

RST EN

CN251

GE

Y010

Applied Instructions (Floating Point)

INT_TO_DINT _INT

REF EN d n

K20000

ENO Y010

K8

2. Device specification range Only high speed counters can be specified as . For details, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

3. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

Not indexed. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.

d K0 · d ENO · d ENO

Page 280 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]
Page 280 · click to enlarge
Page 280

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.5 DHSCR / High Speed Counter Reset

12 Applied Instructions (High Speed Processing)

S3: The FX3U and FX3UC PLCs only are applicable. S4: The same counter of the device specified by can be used. (See the program example.)

4. Specifying input and output variables When handling 32-bit data in a structured program, a 16-bit device cannot be specified directly as in the case of a simple project. Use a label to handle 32-bit data. A 32-bit counter can be specified directly as it is a 32-bit long device. Use a global label to specify a device.
5. Precedence of DHSCS, DHSCR and DHSZ instructions to one particular high speed counter → Refer to caution 6 in "Common cautions on using instructions for high speed counter" which is

described in Section 12.4.

6. Reset operation by an external terminal → Refer to caution 5 in "Common cautions on using instructions for high speed counter" which is

described in Section 12.4.

7. Other cautions on use → Refer to caution in "Common cautions on using instructions for high speed counter" which is

described in Section 12.4.

Program examples

1. Example of self-reset circuit When the current value of C255 becomes "400", C255 is immediately reset. Its current value becomes "0", and the output contact is set to OFF.

Reset value of DHSCR

M8000

OUT_C_32 EN CCoil CValue

ENO CC255

K300

Current value of C255

DHSCR EN s1 s2

Output contact of C255

Comparison source Comparison value

[ST]

OUT_C_32(M8000,CC255,K300);

DHSCR(M8000,K400,CN255,CC255);

Show 5 more labels / short text on this page
[Structured ladder/FBD] · 400 Count-up value · RUN monitor · d K400 CN255 · Output destination
Page 281 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 281 · click to enlarge
Page 281

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

12.6 DHSZ / High Speed Counter Zone Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction compares the current value of a high speed counter with two values (one zone), and outputs the comparison result to three bit devices (refresh).

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DHSZ EN s1 s2

DHSZ 32 bits Continuous DHSZ(EN,s1,s2,s,d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Data to be compared with the current value of a high-speed counter or word device storing the data to be compared (Comparison value 1) ANY32

Data to be compared with the current value of a high-speed counter or word device storing the data to be compared (Comparison value 2) ANY32

Applied Instructions (External Device (optional device))

Device of a high speed counter ANY32

ENO Execution state Bit

Head device to which the comparison result is output based on upper and lower comparison values (3 points occupied) ARRAY [0..2] OF Bit

3. Applicable devices

Bit Devices Word Devices Data type

System User Digit Specification System User Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

Applied Instructions (Data Transfer 2)

z S2 S3 z

z z z S1 z

S: Refer to "Cautions".

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Instruction · name Operation Execution · form · s · Input variable · Output variable · Operand · Unit Index Cons · Real Number · Character · tant · String Pointer · type · z z
Page 282 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related instruction
Page 282 · click to enlarge
Page 282

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

Function and operation explanation

1. 32-bit operation (DHSZ) The current value of the high speed counter of the device specified by is compared with two comparison points (comparison value 1 and comparison value 2). Based on the comparison result, "smaller than the lower comparison value", "inside the comparison zone" or "larger than the upper comparison value", one among the devices specified by is set to ON regardless of the operation cycle. In this instruction, the comparison processing is executed after the count processing in the high speed counter.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 282)
Fig. 251 · Function and operation explanation

Comparison points Make sure that the comparison value 1 and the comparison value 2 have the following relationship:

Operation When the current value of the high speed counter C251 changes (counts) as shown below, the comparison result is output to one of the outputs Y000, Y001 or Y002.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 282)
Fig. 252 · Function and operation explanation

Comparison pattern Current value of C251 Change of output contact (Y)

999→1000 ON→OFF OFF→ON OFF

999←1000 OFF→ON ON→OFF OFF

999→1000 ON→OFF OFF→ON OFF

999←1000 OFF→ON ON→OFF OFF

2000→2001 OFF ON→OFF OFF→ON

2000←2001 OFF OFF→ON ON→OFF

2000→2001 OFF ON→OFF OFF→ON

2000←2001 OFF OFF→ON ON→OFF

Related instruction

The following instructions can be combined with high speed counters.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instruction diagram (page 282)
Fig. 253 · Related instruction

≤

Page 283 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K8 Y10
Page 283 · click to enlarge
Page 283

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

Cautions

1. Selection of the counter comparison method When the DHSCS instruction is used, the maximum frequency and total frequency of the high speed counter are affected.Refer to the counting operation described below, and select according to the contents of control whether to use this instruction or general-purpose comparison instruction.
1. Case to select DHSCS instruction - When the output should be given when the counting result becomes equivalent to the comparison value without regard to the scan time of the PLC.

Applied Instructions (High Speed Processing)

2. Cases to select a general-purpose comparison instruction - When the required frequency is beyond the counting performance. - When counting is regarded as important, but the effect of the scan time can be ignored in operations according to the counting result. - When the number of an instruction exceeds the allowable limit. For FX 3U and FX 3UC PLCs

Applied Instructions (Handy Instruction)

M8000

DHCMOV EN s n

ENO CN251

Applied Instructions (External FX I/O Device)

K0

LDD> EN s1 s2

Y010

K10000

LDD

ANDD>= EN s1 s2

Applied Instructions (External Device (optional device))

ENO K20000

Y011

K10000

LDD< EN s1 s2

Y012

K20000

M8000

REF EN d n

K8 Y10

For FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs

Applied Instructions (Data Transfer 2)

LDD> EN s1 s2

Y010

K10000

CN251

Applied Instructions (Floating Point)

LDD

ANDD>= EN s1 s2

ENO K20000

Y011

K10000

CN251

CN251

LDD< EN s1 s2

Y012

K20000

CN251

M8000

REF EN d n

K8 Y10

Applied Instructions (Positioning Control)

d D100

Page 284 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K8 Y010
Page 284 · click to enlarge
Page 284

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

For FXU and FX2C PLCs

LT_E EN _IN _IN

ENO CN251

Y010

INT_TO_DINT _INT K10000

GE_E EN _IN _IN

LE_E EN _IN _IN

ENO CN251

ENO CN251

Y011

INT_TO_DINT _INT K10000

INT_TO_DINT _INT K20000

GT_E EN _IN _IN

ENO CN251

Y012

INT_TO_DINT _INT K20000

M8000

REF EN d n

K8 Y010

2. Device specification range Only high speed counters can be specified as . For details, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

3. Some restrictions to applicable devices S 1: The FX 3U and FX 3UC PLCs only are applicable.

Not indexed (V, Z). S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.

4. Caution on values set in the comparison value 1 and comparison value 2 Make sure that is smaller than or equivalent to .

5. Relationship between the comparison timing and the result output 1) DHSZ instruction executes comparison and outputs the result only when a counting pulse is input to a high speed counter. (When is "1000" and is "1999", the output is set to ON as soon as the current value of C235 changes from "999" to "1000" or from "1999" to "2000".) 2) Because the comparison result cannot be obtained when restoring the power or when the PLC mode switches from STOP to RUN, the result is not output even if the comparison condition is provided. → For details, refer to "Program in which comparison result is set to ON when power is turned ON

[ZCP] instruction" that is described later.

6. Precedence of DHSCS, DHSCR and DHSZ instructions to one particular high speed counter → Refer to caution 6 in "Common cautions on using instructions for high speed counter" which is

described in Section 12.4.

7. Reset operation by an external terminal → Refer to caution 5 in "Common cautions on using instructions for high speed counter" which is

described in Section 12.4. 8. Number of occupied devices 1) The comparison value occupies two devices from or respectively. 2) The output occupies three devices from . 9. When an output (Y) is specified in (D) (FX3G/FX3GC/FX3U/FX3UC) When Y 6 or Y 7 is specified as an output (Y), the refresh timing of the three outputs (Y) occupied by the DHSZ instruction is different for each output. To make the refresh timing of three points simultaneous, specify Y 0 to Y 5. Example: When Y006 is specified as an output (Y), the refresh timing is different between Y006, Y007 and Y010.

Page 285 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RST(NOT X010,CC235);
Page 285 · click to enlarge
Page 285

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

12.6.1 Program in which comparison result is set to ON when power is turned ON [ZCP] instruction

DHSZ instruction outputs the comparison result only when a counting pulse is input. Even if the current value of C235 is "0", Y010 remains OFF at the time of startup. For initializing Y010, compare the current value of C235 with K1000 and K1200 and drive Y010 by DZCPP instruction (for general zone comparison) as pulse operation only at the time of startup. Refer to the program example shown below.

Applied Instructions (High Speed Processing)

Explanation of operation

The outputs Y010 to Y012 are as shown below.

Y010 = ON Y011 = ON Y012 = ON

Applied Instructions (Handy Instruction)

1,000 1,200 Current value of C235 0

Program examples

Applied Instructions (External FX I/O Device)

X010 RST EN

ZRST EN ENO

Y010 Y012

Y010 to Y012 are reset.

Applied Instructions (External Device (optional device))

M8000

OUT_C_32 EN CCoil CValue

ENO CC235 K999 Pulse inputX000

Immediately after start, comparison is executed only once. K1000 CN235 K1000 CN235 K1200 K1200 CN235

M8000 DZCPP EN s1 s2

:Y010 ON :Y011 ON :Y012 ON

K1000 K1200

CN235

Immediately after start, comparison is executed by interrupt when each pulse is input from X000. K1000 CN235 K1000 CN235 K1200 K1200 CN235

DHSZ EN s1 s2

Applied Instructions (Data Transfer 2)

:Y010 ON :Y011 ON :Y012 ON ≤ ≤ >

K1000 K1200

Y010

[ST]

Applied Instructions (Floating Point)

RST(NOT X010,CC235);

ZRST(NOT X010,Y010,Y012);

OUT_C_32(M8000,CC235,K999 );

DZCPP(X010,K1000,K1200,CN235,Y010);

DHSZ(X010,K1000,K1200,CN235,Y010);

Applied Instructions (Positioning Control)

Show 10 more labels / short text on this page
[Structured ladder/FBD] · d ENO · d1 d2 · RUN monitor · ≤ ≤ > · Y010 Start · < · s3 · < · s CN235
Page 286 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Timing chart
Page 286 · click to enlarge
Page 286

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

Timing chart

In the part 1) in the timing chart, Y010 remains OFF if the current value of a high speed counter (C235 in the example below) is "0" when restoring the power.

1. For initializing Y010, the current value of C235 is compared with K1000 and K1200, and Y010 is driven using the DZCPP instruction (for general zone comparison) as pulse operation only in RUN.
2. The comparison result in Y010 is latched until an input pulse is input and the comparison output is driven by the DHSZ instruction.
3. According to the current value of the counter, the DHSZ instruction drives the output , or . A B C
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Timing chart diagram (page 286)
Fig. 254 · Timing chart
Page 287 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Comparison table
Page 287 · click to enlarge
Page 287

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

12.6.2 Table high speed comparison mode (M8130)

This section explains the table high speed comparison mode (high speed pattern output) of the DHSZ instruction. When two or more outputs should be activated at one time, use the DHSCT instruction which can change up to 16 outputs. (Valid for the FXU PLC, V3.07 or later)

Applied Instructions (High Speed Processing)

1. Set data

Operand type Description Data type

Head word device number storing the data table (only data register D) ANY32

Number of lines in the table (only K or H) ... K1 to K128 or H1 to H80 ANY32

Device number of a high speed counter ANY32

Special auxiliary relay for declaring the table high speed comparison mode Bit

Applied Instructions (Handy Instruction)

Function and operation explanation

1. 32-bit operation (DHSZ) When the special auxiliary relay M8130 for declaring the table high speed comparison mode is specified as

in the DHSZ instruction, the special function shown below is provided.

Applied Instructions (External FX I/O Device)

Command input OUT_C_32 EN CCoil CValue

ENO CC K2147483647

DHSZ EN s1 s2

Applied Instructions (External Device (optional device))

M8130 Head device Number of lines Comparison source

Table high speed comparison mode

Comparison table

number SET/RST Table counter (D8130)

+1, +2 +3 0 ↓

+5, +4 +6 +7 1 ↓

+9, +8 +10 +11 2 ↓

Applied Instructions (Data Transfer 2)

to

-1 ↓ Repeated from "0"

+5, +4 +6 +7

1. Specify the head number for the comparison table as Because one line in the comparison table uses four devices, × 4 devices are occupied from .

Applied Instructions (Floating Point)

2. Specify the number of lines in the comparison table as . The created table starts from the head register , and has the number of lines specified in .
3. Comparison data Make sure that the comparison data is 32 bits.
4. Output (Y) number Specify each digit of the (Y) number in hexadecimal form. Example: When specifying Y010, specify "H10".

When Specifying Y020, specify "H20".

5. Specification of set and reset These set and reset are directly controlled as interrupt.

Applied Instructions (Positioning Control)

Show 7 more labels / short text on this page
s · Comparison data · Output (Y) · (32 bits) · Contents of setting · Set (ON) K1/H1 · Reset (OFF) K0/H0
Page 288 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Operation
Page 288 · click to enlarge
Page 288

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

2. Operation

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Operation diagram (page 288)
Fig. 255 · 2. Operation

Output is set or reset K1: Output is set.

Output is set or reset K0: Output is set.

Output is set or reset K1: Output is set.

Output is set or reset K0: Output is set.

Output is set or reset K1: Output is set.

Page 289 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y011
Page 289 · click to enlarge
Page 289

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

OUT_C_32 EN CCoil CValue

ENO CC251

K2147483647

DHSZ EN s1 s2

Applied Instructions (High Speed Processing)

M8130

K5

Table high speed comparison mode

RST EN

Applied Instructions (Handy Instruction)

RST EN

Y011

Applied Instructions (External FX I/O Device)

Comparison table

Current value of C251

number SET/RST Table counter

D201, D200

K123

H10

K1

A program to reset the counter is required.

D205, D204

K234

H10

K0

Applied Instructions (External Device (optional device))

D209, D208

K345

H11

K1

D213, D212

K456

H11

K0

4 ↓ Repeated from "0"

D217, D216

K567

H11

K1

1. When this instruction is executed, the top table in the data table is set as the comparison target data.

Y010

2. When the current value of the high speed counter C251 is equivalent to the comparison target data table, the output (Y) number specified in the comparison data table is set or reset. This output processing is directly executed without regard to completion of output refresh by END instruction.

A program to reset the output is required.

Y011

Applied Instructions (Data Transfer 2)

3. "1" is added to the current value of the table counter D8130.

Applied Instructions (Floating Point)

4. The comparison target data table is transferred to the next table.
5. The step 2) and 3) are repeated until the current value of the table counter D8130 becomes "4". When the current value becomes "4", the program execution returns to the step 1), and the table counter D8130 is reset to "0". At this time, the complete flag M8131 turns ON.
6. When the command contact is set to OFF, execution of the instruction is stopped and the table counter D8130 is reset to "0".

Applied Instructions (Positioning Control)

Show 12 more labels / short text on this page
Command input · s CC251 · Reset Command input · d ENO · d ENO · Comparison · Output (Y) · data · 0 ↓ · 1 ↓ · 2 ↓ · 3 ↓
Page 290 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 290 · click to enlarge
Page 290

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

Cautions

1. Limitation in the number of DHSZ instruction This instruction can be programmed only once in a program. With regard to the DHSCS, DHSCR, DHSZ and DHSCT instructions used for other purposes, a limited number of instructions including the DHSZ instruction can be driven at one time.
2. When the command input is set to OFF in the middle of execution Execution of the instruction is aborted, and the table counter D8130 is reset to K0. However, outputs which have been set or reset remain in the current status.
3. Output start timing After the DHSZ instruction is first executed, creation of the table is completed by END instruction. After that, the DHSZ instruction becomes valid. Accordingly, the output is activated from the second scan.
4. Current value of a high speed counter Be sure to execute the DHSZ instruction from a point where the current value of the high speed counter (regarded as the operation target) is smaller than the value in the first line in the comparison table.
Page 291 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K700
Page 291 · click to enlarge
Page 291

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

12.6.3 Frequency control mode (DHSZ, DPLSY) (M8132)

When the special auxiliary relay M8132 for declaring the frequency control mode is specified as in the DHSZ instruction, the special function shown below is provided if DPLSY instruction is combined. At this time, only a data register D can be specified as , and a constant K or H can be specified as . The available range is limited to "1 ≤ K, H ≤ 128". A high speed counter can be specified as . This function is different from the zone comparison described above. PLSY instruction is as shown on the next page, and only the pulse output can be changed by users. (Valid for the FXU PLC, V3.07 or later)

Applied Instructions (High Speed Processing)

1. Control example

Example of table configuration and data setting

Applied Instructions (Handy Instruction)

Comparison data Frequency Table counter (D8131)

D 301, D 300

D 302, D 303

K 20

K300

Head device (32 bits) specified as s1

D 305, D 304

D 306, D 307

K600

K500

D 309, D 308

D 310, D 311

Applied Instructions (External FX I/O Device)

Number of lines specified as s2

K700

K200

D 313, D 312

D 314, D 315

K800

K100

D 317, D 316

D 318, D 319

K 0

K 0

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 5 more labels / short text on this page
0 ↓ · 1 ↓ · 2 ↓ · 3 ↓ · 4 ↓
Page 292 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.6.3 Frequency control mode (DHSZ, DPLSY) (M8132)
Page 292 · click to enlarge
Page 292

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare

12 Applied Instructions (High Speed Processing)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.6.3 Frequency control mode (DHSZ, DPLSY) (M8132) diagram (page 292)
Fig. 256 · 12.6.3 Frequency control mode (DHSZ, DPLSY) (M8132)
Page 293 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 293 · click to enlarge
Page 293

12 Applied Instructions (High Speed Processing)

12.6 DHSZ / High Speed Counter Zone Compare

Output pulse characteristics

Output pulse Frequency (Hz)

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

0 20 600 700 800

Current value of C251

1. Write prescribed data in advance to data registers constructing the table as shown in this program example.
2. The output frequency of the DPLSY instruction remains in the value (D303, D302) until the current value of a high speed counter specified in becomes equivalent to (D301, D300). (D302 specifies low-order 16 bits. D303 specifies high-order 16 bits, but is always "0".)

Applied Instructions (External FX I/O Device)

3. The operation in the second line is started after that, and then the operation in each line is executed in turn.
4. When the operation in the last line is completed, the complete flag M8133 turns ON. The program execution returns to the first line, and the operation is repeated.

Applied Instructions (External Device (optional device))

5. For stopping the operation in the last line, set the frequency in the last table to K0.
6. When the command input is set to OFF, the pulse output turns OFF and the table counter D8131 is reset.
7. After DHSZ instruction is first executed, creation of the table is completed at the END instruction. The DHSZ instruction becomes valid after that.
8. Accordingly, the contact of PLS M10 is used so that the DPLSY instruction is executed from the second scan after the command input has been set to ON.

Data can be written to the table in a program as shown in this example or directly using keys in peripheral equipment.

1. M8132: This is the special auxiliary relay for declaring the frequency control mode.

Applied Instructions (Data Transfer 2)

2. D8132: In the frequency control mode, the frequency set in the table is received by D8132 sequentially

according to the table counter D8131 count.

3. D8134 (low-order), D8135 (high-order): In the frequency control mode, the comparison data in the table is received sequentially according to the table counter count.

Applied Instructions (Floating Point)

Cautions

1. DHSZ instruction can be used only once.
2. With regard to the DHSCS, DHSCR, DHSZ and DHSCT instructions for other purposes, a limited number of instructions including the DHSZ instruction can be driven at one time.
3. Because the table is created when the END instruction is executed, it is necessary to delay execution of the DPLSY instruction until creation of the table is completed.
4. Do not change the data table while the DHSZ instruction is driven.
5. In the frequency control mode, simultaneous output to Y000 to Y001 is not permitted.

Applied Instructions (Positioning Control)

200 300

Page 294 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 294 · click to enlarge
Page 294

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.7 SPD / Speed Detection

12 Applied Instructions (High Speed Processing)

12.7 SPD / Speed Detection

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction counts the input pulse for a specified period of time as interrupt input. The function of this instruction varies depending on the version.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 294)
Fig. 257 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 294)
Fig. 258 · 2. Set data

Time data (ms) or word device storing the data ANY16 ANY32

Head word device storing the pulse density data ARRAY [0..2] OF ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 294)
Fig. 259 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

S: Refer to "Cautions".

Page 295 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 295 · click to enlarge
Page 295

12 Applied Instructions (High Speed Processing)

12.7 SPD / Speed Detection

Function and operation explanation

1. 16-bit operation (SPD) The input pulse specified by is counted only for the period of "time specified by multiplied by 1 ms." The measured value is stored in , the current value is stored in +1, and the remaining time is stored in +2 (ms). By repeating this operation, the measured value will store the pulse density (which is proportional to the rotation speed).

Applied Instructions (High Speed Processing)

Command input SPD EN s1

d Device for pulse input

Applied Instructions (Handy Instruction)

1. Timing chart

The command contact is set to ON.

Applied Instructions (External FX I/O Device)

+1 counts "OFF to ON" operation of . ms later, the counting result is stored to . Accompanied by this operation, +1 is reset, and then counting of the "OFF to ON" operation of is started again.

Applied Instructions (External Device (optional device))

Counting time Counting time

+2 is used to measure the remaining time.

+2 Remaining time (ms)

2. The measured value is in proportion to the number of rotations as shown below.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

N = nt 60 10 (r/min) 3

t: Measurement time duration specified as (ms). Proximity switch "n" pulses/rotation

Applied Instructions (Positioning Control)

Show 16 more labels / short text on this page
Pulse density data · Time data · s2 · Command input · s1 · +1 Current value · Measured value · s1 · s2 · s1 · s2 s2 · ms ms · s2 · ms · Input X000 · N (rpm)
Page 296 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.7 SPD / Speed Detection
Page 296 · click to enlarge
Page 296

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.7 SPD / Speed Detection

12 Applied Instructions (High Speed Processing)

2. 32-bit operation (DSPD) [FX3GC PLCs Ver. 1.40 or later, FX3UC PLCs Ver. 2.20 or later, and FX3S/FX3G/FX3U PLCs] The input pulse specified by is counted only for the period of "time specified by multiplied by 1 ms." The measured value is stored in [ +1, ], the current value is stored in [ +3, +2], and the remaining time is stored in [ +5, +4] (ms). By repeating this operation, the measured value [ +1, ] will store the pulse density (which is proportional to the rotation speed).

Command input DSPD EN s1

d Device for pulse input

1. Timing chart
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.7 SPD / Speed Detection diagram (page 296)
Fig. 260 · 12.7 SPD / Speed Detection

[ +3, +2] counts "OFF to ON" operation of . [ +1, ] ms later, the counting result is stored to [ +1, ]. Accompanied by this operation, [ +3, +2] is reset, and then counting of the "OFF to ON" operation of is started again.

[ +5, +4] is used to measure the remaining time.

2. The value [ +1, ] is in proportion to the number of rotations as shown below.

nt 60 [ +1, ] 3 10 (r/min) N =

t: Measurement time duration specified as [ +1, ] (ms).

Pulse density data · Time data · s2

Page 297 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX 3U PLC
Page 297 · click to enlarge
Page 297

12 Applied Instructions (High Speed Processing)

12.7 SPD / Speed Detection

Cautions

1. Input specifications of the input specified by

1) can specify the following ranges. FX3G, FX3GC, FX3U and FX3UC PLCs: X000 to X007 FX1S, FX1N, FX1NC, FX2N, FX2NC and FX3S PLCs: X000 to X005 FXU and FX2C PLCs: X000 to X005 2) An input device X000 to X007 (X000 to X005) specified by cannot overlap the following functions or instructions: - High speed counter - DSZR - Input interrupt - DVIT - Pulse catch - ZRN - Pulse width measurement 3) For one input, this instruction can be used only once. 4) The maximum input frequency is shown below:

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

FX 3U PLC

Used input number FX3UC PLC

Main unit FX3U-4HSX-ADP

X000 to X005 100kHz*1 100kHz*1 200kHz X006 to X007 10kHz 10kHz

Applied Instructions (External FX I/O Device)

*1. When receiving pulses within the response frequency range of 50k to 100 kHz, perform the following actions: - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 kΩ (1 W or more) to the input terminal, and make sure that the load current in the open collector transistor output of the external equipment is 20 mA or more.

Used input number FX3G and FX3GC PLCs

X000, X001, X003, X004 60kHz

Applied Instructions (External Device (optional device))

X002, X005, X006, X007 10kHz

Used input number FX1S, FX1N, FX1NC, FX2N, FX2NC and FX3S PLCs

X002, X003, X004, X005 10kHz

Used input number FXU and FX2C PLCs

X000, X002, X003 10kHz

X001, X004, X005 7kHz

2. Occupied devices 1) When using the 16-bit operation Three devices are occupied from a device specified in . *2
2. When using the 32-bit operation Six devices are occupied from a device specified in . *2

Applied Instructions (Data Transfer 2)

*2. The value is updated by interrupt processing from the CPU, not every scan time (operation cycle) of the PLC. 3. Restrictions to devices S1: X000 to X007 (X005) can be specified.

  • Refer to item 1 of "Cautions". S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable. 4. 32-bit operation instruction Only FX 3GC PLCs Ver. 1.40 or later, FX 3UC PLCs Ver. 2.20 or later, and FX 3S /FX 3G /FX 3U PLCs support the 32-bit operation instruction. 5. When the value of the word device specified by is changed while the SPD instruction is being executed When the value of the word device is changed while the SPD instruction is being executed, the operation varies depending on the PLC model.
  • FX 3U /FX 3UC : The changed value of the word device is reflected on the operation at every scan time (operation cycle).
  • FX 3S /FX 3G /FX 3GC : The changed value of the word device is not reflected on the operation at every scan time (operation cycle), and the PLC operates using the value specified when execution of the SPD instruction is started. The PLC operates using the changed value after the command input of the SPD instruction is turned OFF once and turned ON again.

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

X000, X001 60kHz

Page 298 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 298 · click to enlarge
Page 298

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output

12 Applied Instructions (High Speed Processing)

12.8 PLSY / Pulse Y Output

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction generates a pulse signal.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 298)
Fig. 261 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 298)
Fig. 262 · 2. Set data

Frequency data (Hz) or the word device storing the data ANY16 ANY32

Pulse quantity data or the word device storing the data ANY16 ANY32

Bit device (Y) from which pulses are output Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 298)
Fig. 263 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

S: Refer to "Cautions".

Page 299 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 299 · click to enlarge
Page 299

12 Applied Instructions (High Speed Processing)

12.8 PLSY / Pulse Y Output

Function and operation explanation

1. 16-bit operation (PLSY) A pulse train of frequency specified by is output in the quantity specified by from the output (Y) specified by .

Applied Instructions (High Speed Processing)

Frequency data Pulse quantity data

Bit device (Y) from which pulses are output

For setting , and , refer to the "cautions". s1 s2 d

2. 32-bit operation (DPLSY) A pulse train of frequency specified by is output in the quantity specified by from the output (Y) specified by .

Applied Instructions (Handy Instruction)

Command input DPLSY EN s1

s2 +1, Pulse quantity]

Bit device (Y) from which pulses are output Pulse quantity data

Applied Instructions (External FX I/O Device)

For setting , and , refer to the "cautions". s1 s2 d

Related devices

Applied Instructions (External Device (optional device))

1. Instruction execution complete flag The instruction execution complete flag M8029 used for PLSY instruction can be used also for other instructions. When using other instructions, setting the M8029 flag to ON or OFF, or using two or more PLSY instructions, be sure to use each M8029 flag just after an instruction to be monitored. For the method of using the instruction execution complete flag, refer to the following manual.

→ FX Structured Programming Manual [Device & Common]

ON : Generation of specified number of pulses is completed. OFF : Generation of pulses is paused before the specified number of pulses is reached or the

continuous pulse generation operation is stopped.

PLSY EN s1 s2

PLSY EN s1 s2

Applied Instructions (Data Transfer 2)

K1000

Y000

K1000

Y000

K0

K0

M8029

DPLSY EN s1 s2

Applied Instructions (Floating Point)

K1000

Y001

DPLSY EN s1 s2

K0

Y000 K1000 Command input 1

M8029

K0

Changes by DPLSY instruction corresponding to the command input 2.

M8029

M8029

Applied Instructions (Positioning Control)

Show 23 more labels / short text on this page
Command input · s2 · Pulse quantity · PLSY EN s1 · s1 · Frequency · s2 · [ · s2 · d Frequency data · [ · s1 · +1, Frequency] · s1 · s2 · Device Name Description · M8029 Instruction execution · complete · Command input 1 · Command input 1 · Command input 2 · Command input 2 · Command input 2
Page 300 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 300 · click to enlarge
Page 300

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output

12 Applied Instructions (High Speed Processing)

2. Monitoring the current number of generated pulses

The number of pulses output from Y000 or Y001 is stored in the following special data resistors.

Description Contents of data High order Low order

D8141*1 D8140*1 Accumulated number of pulses

Accumulated number of pulses output from Y000 by PLSY and PLSR instructions

D8143*1 D8142*1 Accumulated number of pulses

Accumulated number of pulses output from Y001 by PLSY and PLSR instructions

D8137*2 D8136*2 Total accumulated number of pulses output from Y000 and Y001

Total accumulated number of pulses output from Y000 and Y001 by PLSY and PLSR instructions.

*1. The FX0S, FX0, FX0N, FXU or FX2C PLC is not compatible with this function.

*2. The FX0S, FX0 or FX0N PLC is not compatible with this function. The FXU PLC of V3.07 or later is compatible.

The contents of each data register can be cleared using the following program.

Command input DMOV EN s

d K0 Low order devices in the table above

3. How to stop the pulse output

  • When the command input is set to OFF, the pulse generation is immediately stopped. When the command input is set to ON again, pulse generation operation restarts from the beginning.
  • When the special auxiliary relays (M) shown below are set to ON, the pulse output is stopped.

Description FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC

M8349 M8145, M8349 M8145 Immediately stops pulse output from Y000.

M8359 M8146, M8359 M8146 Immediately stops pulse output from Y001.

To restart pulse output, set the device corresponding to the output signal to OFF, and then drive the pulse output instruction again.

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction.

This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Cautions

1. When a word device is specified as or When the value of the word device is changed while the instruction is executed, the following operation results.
  • When the data in is changed, the output frequency changes accordingly.
  • When the data in is changed, the change (new value) becomes valid the next time the instruction is driven.
Show 4 more labels / short text on this page
Device · output from Y000 · output from Y001 · Device
Page 301 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 4. Pulse output
Page 301 · click to enlarge
Page 301

12 Applied Instructions (High Speed Processing)

12.8 PLSY / Pulse Y Output

2. Frequency When using transistor outputs in the main unit, set the output frequency specified by as follows. Do not set the frequency to "0".
  • FX 3U and FX 3UC PLCs : 16-bit instruction → 1 to 32,767Hz

32-bit instruction→1 to 200,000Hz (When using special high speed output adapter) →1 to 100,000Hz (When using main unit)

Applied Instructions (High Speed Processing)

  • FX 3S , FX 3G and FX 3GC PLCs : 16-bit instruction → 1 to 32,767Hz

32-bit instruction→1 to 100,000Hz

  • FX 2N and FX 2NC PLCs : 2 to 20,000Hz
  • FX 1NC PLC : 1 to 10,000Hz
  • FX 1S and FX 1N PLCs : 16-bit instruction → 1 to 32,767Hz

Applied Instructions (Handy Instruction)

32-bit instruction→1 to 100,000Hz

  • FX 0S , FX 0 and FX 0N PLCs : 10 to 2,000Hz
  • FX U and FX 2C PLCs : 1 to 1,000Hz
3. Pulse quantity The pulse quantity can be set in the range from 1 to 32,767 (PLS) for 16-bit instructions and from 1 to 2,147,483,647 (PLS) for 32-bit instructions. If set to zero, pulse generates infinitely.

Applied Instructions (External FX I/O Device)

4. Pulse output

1. Only a transistor output on the main unit or the following special high speed output adapters *1 can be specified in .

Applied Instructions (External Device (optional device))

  • FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs : Y000, Y001
  • FX 1S , FX 1N , FX 1NC , FX 2N and FX 2NC PLCs : Y000, Y001
  • FX 0S , FX 0 and FX 0N PLCs : Y000
  • FX U and FX 2C PLCs : Valid for all Y When using the PLSY instruction with a relay output type or triac output type FX 3U PLC, a special highspeed output adapter is required.

*1. Special high speed output adapters can be connected only to the FX3U PLC.

2. The duty cycle of the pulse ON/OFF time is 50 % inside the PLC. However, 50 % may not be output depending on the frequency due to the effect of the output circuit.
3. The pulse output is controlled by the dedicated hardware not affected by the sequence program (operation cycle).

Applied Instructions (Data Transfer 2)

4. If the command input is set to OFF during continuous pulse output, the output from the device specified by turns OFF.
5. Restrictions to target devices S 1: Refer to item 4 of "Cautions". S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable. (Special high speed output adapters can be connected only to the FX 3U PLC.)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 302 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12.8 PLSY / Pulse Y Output
Page 302 · click to enlarge
Page 302

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output

12 Applied Instructions (High Speed Processing)

6. Handling of pulse output terminals in the main units The outputs Y000 and Y001 are the high speed response type. When using a pulse output instruction or positioning instruction, adjust the load current of the open collector transistor output.

When the load is smaller, connect a dummy resistor in parallel to the outside of a used output terminal (Y000 or Y001) as shown in the circuit diagram below so that the specified current shown below flows in the output transistor.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12.8 PLSY / Pulse Y Output diagram (page 302)
Fig. 264 · 12.8 PLSY / Pulse Y Output
1. For FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs Operating voltage range : DC5 to 24V Operating current range : 10 to 160 mA Output frequency : 100 kHz or less
2. For FX 2N and FX 2NC PLCs Operating voltage range : DC5V Operating voltage range : DC12 to 24V Operating current range : 0.1A Operating current range : 0.1A Output frequency : 20 kHz or less Output frequency : 10 kHz or less
3. For FX 1NC PLC Operating voltage range : DC5V Operating voltage range : DC12 to 24V Operating current range : 10 to 100 mA Operating current range : 50 to 100 mA Output frequency : 10 kHz or less Output frequency : 10 kHz or less
4. For FX 1S and FX 1N PLCs Even without connecting a dummy resistor, a pulse output of 100 kHz or less can be generated under 5 to 24 VDC (10 to 100 mA).
5. For FX 0S , FX 0 , FX 0N , FX U and FX 2C PLCs Have a current of about 100 mA flow for the FX 2C PLC and a current of about 200 mA flow for the FX 0S , FX 0 , FX 0N and FX U PLCs and extension.
Page 303 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000 M8340 M8340, M8147 M8147
Page 303 · click to enlarge
Page 303

12 Applied Instructions (High Speed Processing)

12.8 PLSY / Pulse Y Output

7. Cautions on using special high speed output adapters (FX 3U PLC)

1. Outputs of special high speed output adapters work as differential line drivers.
2. Set the pulse output type setting switch in a special high speed output adapter to the "pulse train + direction" (PLS - DIR) side. If the switch is set to the "forward rotation pulse train - reverse rotation pulse train" (FP - RP) side, normal operation is disabled. The pulse output destination changes depending on the PLC output status as shown in the table below.

Applied Instructions (High Speed Processing)

= Y000 Y004 While Y004 is ON, pulses are output from Y000 in the high speed output adapter. While Y004 is OFF, pulses are output from Y004 in the high speed output adapter.

= Y001 Y005 While Y005 is ON, pulses are output from Y001 in the high speed output adapter. While Y005 is OFF, pulses are output from Y005 in the high speed output adapter.

Applied Instructions (Handy Instruction)

3. Set the pulse output type setting switch while the PLC is in STOP or while the power is OFF. Do not manipulate the pulse output type setting switch while pulses are being output.
4. When special high speed output adapters are connected, the same output numbers in the main unit are assigned as shown in the table below. Only wire the appropriate terminals. (Use either one only. Do not connect to the other terminal.) Outputs of special high speed output adapters and main units operate as follows.

Applied Instructions (External FX I/O Device)

Assignment of output numbers in special high speed output adapters

Setting name in each positioning

Status of output type

setting switch Signal name

1st unit 2nd unit

1st axis 2nd axis 3rd axis 4th axis

Applied Instructions (External Device (optional device))

tion Y000 Y001 Y002 Y003

"FP - RP" side

signal Y004 Y005 Y006 Y007

Pulse train Pulse output destina-

tion Y000 Y001 Y002 Y003

"PLS - DIR" side

signal Y004 Y005 Y006 Y007

Output operation

Relay output type or triac output type main unit While instruction is activated, relevant output is ON. (LED is also ON.) Use special high speed output adapter.

Applied Instructions (Data Transfer 2)

Special high speed output adapter Operated (LED operated.) Set the output frequency to "200 kHz" or less.

Transistor output type main unit Operated (LED is also ON.) Set the output frequency to "100 kHz" or less.

8. Others

1) When using the same output relay (Y000 or Y001) in several instructions. While a pulse output monitor (BUSY/READY) flag is ON a pulse output instruction and positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction drive contact is set to OFF, a pulse output instruction or positioning instruction for the same output relay cannot be executed. Before executing such an instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX1S, FX1N, FX1NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)

Applied Instructions (Floating Point)

Pulse output monitor flag

FX3U, FX3UC FX3S, FX3G, FX3GC FX1N, FX1NC, FX1S

Y000 M8340 M8340, M8147 M8147

Y001 M8350 M8350, M8148 M8148

Applied Instructions (Positioning Control)

2. "Frequency control mode" in which DHSZ and DPLSY instructions are combined can be used only once in a program.
Show 16 more labels / short text on this page
Pulse output · Output affecting · operation Operation · destination · Output number · instruction · Forward rotation pulse · Pulse output destina- · train (FP) · Reverse rotation pulse · Rotation direction · train (RP) · Direction Rotation direction · Output operation · Pulse output destination · device
Page 304 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000
Page 304 · click to enlarge
Page 304

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output

12 Applied Instructions (High Speed Processing)

Program examples (When outputting pulses without any limitation)

When the device specified by is set to K0, pulses are output without any limitation.

Command input DPLSY EN s1 s2

Y000

K1000

K0

[ST]

DPLSY(X000,K1000,K0,Y000);

Show 4 more labels / short text on this page
[Structured ladder/FBD] · No limitation (K0) · d Y000 · 1000Hz
Page 305 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — T 0
Page 305 · click to enlarge
Page 305

12 Applied Instructions (High Speed Processing)

12.9 PWM / Pulse Width Modulation

12.9 PWM / Pulse Width Modulation

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction outputs pulses with a specified period and ON duration.

1. Format and operation, execution form

Expression in each language

PWM EN s1 s2

Applied Instructions (Handy Instruction)

PWM 16 bits Continuous PWM(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Pulse width (ms) data or word device storing the data ANY16

Period data (ms) or word device storing the data ANY16

ENO Execution state Bit

Applied Instructions (External Device (optional device))

Device (Y) from which pulses are to be output Bit

3. Applicable devices

Bit Devices Word Devices Others

System User Digit Specification System User Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

Applied Instructions (Data Transfer 2)

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation (PWM) Pulses whose ON pulse width (ms) is specified by are output in periods (ms) specified by to the device specified by

Applied Instructions (Floating Point)

PWM EN s1 s2

d Device (Y) from which pulses are to be output

d t T0

T 0

  • Specify the pulse width "t" in . Allowable setting range: 0 to 32,767ms
  • Specify the period "T0" in Allowable setting range: 1 to 32,767ms

Applied Instructions (Positioning Control)

  • Specify the output (Y) number from which pulses are to be output in . Allowable setting range: Refer to "Cautions".
Show 15 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Unit Index Cons · Real Number · Character · Operand · String Pointer · type · tant · S1 z · Command input t · Pulse width Period
Page 306 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000 M8340
Page 306 · click to enlarge
Page 306

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.9 PWM / Pulse Width Modulation

12 Applied Instructions (High Speed Processing)

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction.

This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Cautions

1. Setting the pulse width and period Make sure that the pulse width and period satisfy the relationship " ≤ ".

2. Pulse output

1. Only the following outputs can be specified in according to the system configuration.
  • For FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs

- When using special high speed output adapters*1: Y000, Y001, Y002*2, Y003*2

- When using transistor outputs on the main unit (that is, when not using special high speed output adapters): Y000, Y001, Y002*3

*1. Special high speed output adapters can be connected only to the FX3U PLC. When using the PWM instruction with a relay output type or triac output type FX3U PLC, a special highspeed output adapter is required.

*2. When specifying Y002 or Y003 on a special high speed output adapter, a second special high speed output adapter is required.

*3. "Y002 is not available in FX3S, FX3G PLC (14-point and 24-point type) and FX3GC PLC.

  • For FX 1S , FX 1N , FX 1NC , FX 2N and FX 2NC PLCs Only Y000 or Y001 is valid (transistor output).
  • For FX 0S , FX 0 and FX 0N PLCs Only Y001 is valid (transistor output).
  • For FX U and FX 2C PLCs All Ys are valid (transistor output).
2. The pulse output is controlled by interrupt processing not affected by the sequence program (operation cycle).
3. If the command input is set to OFF, the output from the device specified by turns OFF.

4) While a pulse output monitor (BUSY/READY) flag is ON, a pulse output or positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction derive contact is set to OFF, a pulse output or positioning instruction for the same output relay cannot be executed. Before executing a pulse output or positioning instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)

Pulse output destination device Pulse output monitor flag

Y000 M8340

Y001 M8350

Y002 M8360

Y003 M8370

Page 307 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Ω
Page 307 · click to enlarge
Page 307

12 Applied Instructions (High Speed Processing)

12.9 PWM / Pulse Width Modulation

3. Restrictions to target devices S 1: Refer to item 2 of "Cautions". S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
4. Cautions on using special high speed output adapters → Refer to item in section 12.9 "Cautions".

Applied Instructions (High Speed Processing)

Program examples

When the contents of D10 are changed in the range from "0" to "50" in the program example shown below, the average output from Y000 will be in the range from 0 to 100%. When the contents of D10 exceed "50", it becomes an error. In this program example, the FX3U series main unit (sink output) is used. For wiring details, refer to the manual of the PLC used.

Applied Instructions (Handy Instruction)

X0 D10

Y000 PWM EN s1 s2

Y000

Applied Instructions (External FX I/O Device)

[ST]

PWM(X0,D10,K50,Y000);

Example of smoothing circuit

Applied Instructions (External Device (optional device))

510 Ω

PLC

P 22 Ω E

Y000 COM1 Y001 Y002 Y003

R>>P =R(k ) C(µF)=470ms>>To The time constant of the filter should be considerably larger than the pulse cycle T0.

Ω

Applied Instructions (Data Transfer 2)

The ripple value " e" in the mean output current "e" is approximately " ". e Δe Δ To

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 15 more labels / short text on this page
[Structured ladder/FBD] · d D10 K50 · 50ms · R (1kΩ · 1kΩ · ) · e V + · 12V 1kΩ · 1kΩ · 470µF · 1kΩ · τ τ · × · ≤ · τ
Page 308 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 308 · click to enlarge
Page 308

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup

12 Applied Instructions (High Speed Processing)

12.10 PLSR / Acceleration/Deceleration Setup

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This pulse output instruction has the acceleration/deceleration function.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 308)
Fig. 265 · 1. Format and operation, execution form

PLSR 16 bits Continuous PLSR(EN, s1, s2, s3, d);

DPLSR 32 bits Continuous DPLSR(EN, s1, s2, s3, d);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 308)
Fig. 266 · 2. Set data

Maximum frequency data (Hz) or the word device storing the data ANY16 ANY32

Total number of output pulses (PLS) or word device storing the data ANY16 ANY32

Acceleration/deceleration time (ms) data or word device storing the data ANY16 ANY32

Device (Y) from which pulses are to be output Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 308)
Fig. 267 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

z S2 S3 z

S: Refer to "Cautions".

Page 309 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Pulse output specifications
Page 309 · click to enlarge
Page 309

12 Applied Instructions (High Speed Processing)

12.10 PLSR / Acceleration/Deceleration Setup

Function and operation explanation

1. 16-bit operation (PLSR) Pulses are output from output (Y) specified by by the number of output pulses specified by with acceleration/deceleration to the maximum frequency specified by over the time (ms) specified by .

Command input PLSR EN s1 s2

Applied Instructions (High Speed Processing)

Total number of output pulses(PLS) Acceleration/deceleration time(ms)

Total number of output pulses

(PLS)

Refer to "Cautions" for setting , , and .

Applied Instructions (Handy Instruction)

2. 32-bit operation (DPLSR) Pulses are output from output (Y) specified by by the number of output pulses specified by with acceleration/deceleration to the maximum frequency specified by over the time (ms) specified by .

Applied Instructions (External FX I/O Device)

Command input DPLSR EN s1 s2

Maximum frequency(Hz) Total number of output pulses(PLS) Acceleration/deceleration time(ms)

(Y000,Y001)

Applied Instructions (External Device (optional device))

Refer to "Cautions" for setting , , and .

3. Pulse output specifications

  • Simple positioning (with the acceleration/deceleration function) The operation pattern is as shown below:

Applied Instructions (Data Transfer 2)

Total number of output pulses

Applied Instructions (Floating Point)

s3 Acceleration/ deceleration time

  • Output processing The pulse output is controlled by the dedicated hardware regardless of the operation cycle.
  • Data change while the instruction is executed Even if operands are overwritten while the instruction is executed, such changes are not reflected immediately. The changes become valid the next time the instruction is driven.

Applied Instructions (Positioning Control)

Show 18 more labels / short text on this page
Pulse frequency (Hz) · Maximum frequency s1 · Maximum frequency(Hz) · Output number (Y000,Y001) · s3 · s2 · Acceleration/ deceleration time · s3 s3 · Acceleration/ deceleration time · Output number · s3 · Pulse frequency · s1 · Maximum frequency (Hz) · (Hz) · s2 · s3 · Acceleration/ deceleration time
Page 310 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 310 · click to enlarge
Page 310

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup

12 Applied Instructions (High Speed Processing)

Related devices

1. Instruction execution complete flag

OFF :The command input is OFF, or pulses are being output. (This flag does not turn ON if the pulse

output is interrupted in the middle of output.)

ON :Output of the number of pulses set in is completed.

2. Monitoring the number of generated pulses

The number of pulses output from Y000 or Y001 is stored in the following special data registers:

Description Contents of data High order

D8141 D8140 Accumulated number of pulses

Accumulated number of pulses output from Y000 by PLSY and PLSR instructions

D8143 D8142 Accumulated number of pulses

Accumulated number of pulses output from Y001 by PLSY and PLSR instructions

D8137 D8136 Total accumulated number of pulses output from Y000 and Y001

Total accumulated number of pulses output from Y000 and Y001 by PLSY and PLSR instructions

The contents of each data register can be cleared using the following program.

Command input DMOV EN s

d K0 Low order device in the table above

3. How to stop the pulse output

  • When the command input is set to OFF, the pulse generation is immediately stopped. When the command input is set to ON again, pulse generation operation restarts from the beginning.
  • When the special auxiliary relays (M) shown below are set to ON, the pulse output is stopped.

Description FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC

M8349 M8145, M8349 M8145 Immediately stops pulse output from Y000.

M8359 M8146, M8359 M8146 Immediately stops pulse output from Y001.

To restart pulse output again, set the device corresponding to the output number to OFF, and then drive the pulse output instruction again.

Cautions about writing during RUN

  • Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction.

This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.

Cautions

1. Maximum frequency When using transistor outputs on the main unit, set the maximum frequency specified by as follows.
Show 8 more labels / short text on this page
Device Name Description · M8029 Instruction execution · complete · Device · Low order · output from Y000 · output from Y001 · Device
Page 311 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 4. Pulse output
Page 311 · click to enlarge
Page 311

12 Applied Instructions (High Speed Processing)

12.10 PLSR / Acceleration/Deceleration Setup

  • For FX 3U and FX 3UC PLCs :16-bit instruction → 10 to 32,767(Hz) 32-bit instruction → 10 to 100,000 Hz or less (200,000 Hz or less when using special high speed adapter.)
  • For FX 3S , FX 3G and FX 3GC PLCs :16-bit instruction → 10 to 32,767(Hz)

32-bit instruction→10 to 100,000 Hz or less

  • For FX 2N and FX 2NC PLCs :10 to 20,000 Hz

Applied Instructions (High Speed Processing)

  • For FX 1S and FX 1N PLC :10 to 100,000 Hz
  • For FX 1NC PLC :10 to 10,000 Hz
2. Total number of output pulses Set the total number of output pulses specified by as follows.
  • For FX 3U and FX 3UC PLCs :16-bit instruction → 1 to 32,767PLS 32-bit instruction → 1 to 2,147,483,647PLS

Applied Instructions (Handy Instruction)

  • For FX 3S , FX 3G and FX 3GC PLCs :16-bit instruction → 1 to 32,767PLS

32-bit instruction→1 to 2,147,483,647PLS

  • For FX 2N and FX 2NC PLCs :16-bit instruction → 110 to 32,767PLS 32-bit instruction → 110 to 2,147,483,647PLS When setting a value less than "110", the operation is as follows.

Applied Instructions (External FX I/O Device)

PLC version V3.00 or before : The pulses are not generated normally. PLC version V3.00 or later : One tenth of the maximum frequency is generated.

If the maximum frequency is 100 Hz or less, "10 Hz" is generated.

  • For FX 1S , FX 1N and FX 1NC PLCs : 16-bit instruction → 110 to 32,767(PLS)

32-bit instruction→110 to 999,999(PLS) When setting a value less than "110", the pulses are not generated normally.

Applied Instructions (External Device (optional device))

3. Acceleration/deceleration time Set the acceleration/deceleration time specified by as follows. For FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs: 50 to 5000 (ms) For FX 2N and FX 2NC PLCs: 5000 (ms) or less

Follow, however, the conditions a) through d). a) Make the acceleration/deceleration time be 10 times or more the PLC's maximum scan time (value of

D8012 or greater). If set to less than 10 times, the acceleration/deceleration timing becomes instable. b) The following equation defines the allowable minimum that can be set as the acceleration/

deceleration time.

s1 s3 5 ≥ ×

Applied Instructions (Data Transfer 2)

If setting a value less than the equation indicates, the error in the acceleration time becomes large. If set to less than "90000/ , operation takes place while rounding it up to "90000/ ". c) The following equation defines the allowable maximum that can be set as the acceleration/

deceleration time.

≤ × s1 s3 818 s2

Applied Instructions (Floating Point)

d) The number of speed changes (steps) for the acceleration/deceleration is fixed to "10 times" as shown

in the previous page.

If unable to set the PLC to these conditions, lower the maximum frequency specified by .

  • For FX 1S , FX 1N and FX 1NC PLCs: 50 to 5000(ms)

4. Pulse output

  • Only a transistor output on the main unit or Y000 or Y001 on a special high speed output adapter *1 can be specified in .

*1. Special high speed output adapters can be connected only to the FX3U PLC. When using the PLSR instruction with a relay output type or triac output type FX3U PLC, a special highspeed output adapter is required.

Applied Instructions (Positioning Control)

  • The duty cycle of the pulse ON/OFF time is 50 % inside the PLC. However, 50 % may not be output depending on the frequency due to the effect of the output circuit.
Page 312 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — S 1
Page 312 · click to enlarge
Page 312

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup

12 Applied Instructions (High Speed Processing)

  • The pulse output is controlled by the dedicated hardware not affected by the sequence program (operation cycle).
  • If the command input is set to OFF during continuous pulse output, the output from the device specified by

turns OFF.

5. Restrictions to target devices S 1: Refer to item 4 in "Cautions". S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
6. Handling of pulse output terminals in the main units of the FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs.

→ Refer to item 6 in 12.8 "Cautions".

7. Cautions on using special high speed output adapters → Refer to item 7 in 12.8 "Cautions".

8. Others

1) When using the same output relay (Y000 or Y001) in several instructions. While a pulse output monitor (BUSY/READY) flag is ON a pulse output instruction and positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction drive contact is set to OFF, a pulse output instruction or positioning instruction for the same output relay cannot be executed. Before executing such an instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX1S, FX1N, FX1NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)

Pulse output monitor flag

FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC

Y000 M8340 M8340, M8147 M8147

Y001 M8350 M8350, M8148 M8148

2. Minimum frequency for FX 1S and FX 1N PLCs The output frequency of the PLSR instruction ranges from 10 to 100,000 Hz. If the maximum speed or the speed during acceleration or deceleration goes out of this range, the value is automatically rounded up or down to a value within the range. Note, however, that the following equation defines the minimum output frequency actually generated.

minimum frequency of output pulse frequency

S1 S3 maximum frequency Hz (2 (acceleration or deceleration time ms 1000)) =

  • Note that the frequency after the first step acceleration or the final frequency after deceleration does not go below the value calculated by the above equation. [Example] Maximum speed: 50000Hz Acceleration/deceleration time: 100ms

50000 (2 (100 1000)) = 500Hz ÷ ÷ ×

When setting 50000 Hz into the maximum frequency

S 1

→The actual output frequency is "500 Hz" at the first step of acceleration and the last step of

deceleration.

Pulse output destination · device · 500Hz 500Hz 500Hz

Page 313 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ALT
Page 313 · click to enlarge
Page 313

13 Applied Instructions (Handy Instruction)

13. Applied Instructions (Handy Instruction)

This chapter introduces the instructions which achieve complicated control in a minimum sequence program.

Applied Instructions (High Speed Processing)

Instruction name Function Reference

IST Initial State Section 13.1

SER

Search a Data Stack Section 13.2 SERP

DSER

DSERP

Applied Instructions (Handy Instruction)

ABSD

Absolute Drum Sequencer Section 13.3 DABSD

INCD Incremental Drum Sequencer Section 13.4

TTMR Teaching Timer Section 13.5

STMR Special Timer Section 13.6

ALT

Alternate State Section 13.7 ALTP

Applied Instructions (External FX I/O Device)

RAMP Ramp Variable Value Section 13.8

ROTC Rotary Table Control Section 13.9

SORT SORT Tabulated Data Section 13.10

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 314 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 314 · click to enlarge
Page 314

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

13.1 IST / Initial State

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for controlling the initial state and special auxiliary relay automatically in a program by stepladder.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 314)
Fig. 268 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 314)
Fig. 269 · 2. Set data

Head bit device number of the selector switch in the operation mode (8 points occupied) ARRAY [0..7] OF Bit

Minimum state of practical state in automatic mode [d1

Maximum state of practical state in automatic mode [d1

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 314)
Fig. 270 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 315 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 315 · click to enlarge
Page 315

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

Function and operation explanation

Command input IST EN s

Minimum state Maximum state Head bit device number of the selector switch in the operation mode

Applied Instructions (High Speed Processing)

  • In , designate beginning input of operation mode. Selection switch for operation mode occupies 8 points from the head device designated in , and the following switch functions are assigned individually. As shown in the table below, when X020 is assigned, X020 to X024 must be set in rotary switch so as not to be turned ON simultaneously. Wiring is not needed for switches not in use, but such switches cannot be used in other applications because they are occupied by IST command.

Applied Instructions (Handy Instruction)

Source Device No.

(example) Switch function Source Device No.

X020 Individual operation +4 X024 Continuous operation

+1 X021 Return to home position +5 X025 Return home start

Applied Instructions (External FX I/O Device)

+2 X022 Stepping +6 X026 Automatic start

+3 X023 One-cycle operation +7 X027 Stop

  • In , designate minimum number of practical state (for automatic mode).
  • In , designate maximum number of practical state (for automatic mode).
1. Control of device by switch operation (occupied device) When command input is turned ON, next device is automatically changed over and controlled. No change if command input is turned OFF.

Applied Instructions (External Device (optional device))

Device No. Operation function Device No. Operation function

M8040 Transfer ban S0 Initial state of individual operation

M8041*1 Transfer start S1 Initial state of return to home position

M8042 Start pulse S2 Initial state of automatic operation

M8043*1 Return home end

M8045 All output reset ban

M8047*2 STL monitor valid

*1. Cleared when changed from RUN to STOP

Applied Instructions (Data Transfer 2)

*2. Process during END command execution

The following states should not be programmed as general states.

Device No. Operation function

  • Occupied for initial state.
  • S0 to S2 can be used for individual operation, return to home position, or automatic operation as specified above.
  • S3 to S9 can be used freely.

Applied Instructions (Floating Point)

S10 to S19 Occupied for return to home position.

If return home end (M8043) is not ON, all outputs are OFF if changed over to individual (X020), return to home position (X021), or automatic (X022, X023, X024). Automatic operation can be resumed after returning to home position completely.

→ Before introduction, refer to "IST command introduction examples (examples of work transfer

mechanism)" given below.

Applied Instructions (Positioning Control)

d1 d2 · (example) Switch function · S0 to S9

Page 316 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Program sequence of IST command and STL command
Page 316 · click to enlarge
Page 316

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

Cautions

1. Devices designated in and switches to be used Not all mode selection switches are used. Vacant numbers (not usable in other applications) are designated in switches not in use.

2. Program sequence of IST command and STL command

  • IST command must be programmed prior to a series of STL circuits such as states S0 to S2.
3. State to be used in operation for return to home position Use S10 to S19 for state for return to home position. In final state for return to home position, after setting M8043, terminate by self-resetting.
4. Limit times of use of command IST command can be programmed only once in the program.
5. Object devices are restricted. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The device range is limited as follows by the PLC.

S20 to S899, S1000 to S4095 (FX3G, FX3GC, FX3U and FX3UC PLCs) S20 to S255 (FX3S PLC) S20 to S899 (FX2N and FX2NC PLCs) (FXU and FX2C PLCs) S20 to S999 (FX1N and FX1NC PLCs) S20 to S127 (FX1S PLC) (FX0N PLC) S20 to S63 (FX0S and FX0 PLCs)

Page 317 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8045
Page 317 · click to enlarge
Page 317

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

IST command equivalent circuit

Detail of special auxiliary relay (M) or initial state (S0 to S9) controlled automatically by IST command is as shown in the following equivalent circuit. (Read as reference knowledge.) This equivalent circuit cannot create program.

1. Equivalent circuit

X024 M8041

M8041 Conti- nuous X027 M8041 is put in action when start button is pressed in automatic mode. In continuous mode, self-holding action is set, and it is canceled Stop

Applied Instructions (High Speed Processing)

Transfer start X026 Automatic start

when stop button is pressed.

*1 PLS EN ENO

X026 Automatic start X020

Individual X025 Return home

Applied Instructions (Handy Instruction)

M8042

M8040 is put in action in stepping mode, and is turned OFF every time start button is pressed. In return home or one-cycle mode, self-holding action is set when stop button is pressed, and it is canceled when start button is pressed.

Return home X027 Stop M8042

Start pulse X022 Stepping

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

M8000

M8044

Initial state is changed over depending on each mode input, and M8043 is also controlled. However, M8044 and M8043 must be also controlled by the user program.

S 0

M8043

RST EN ENO

S 1

M8043

Return home end signal reset

M8043 M8041

Transfer start S 2

Automatic Return home end

Applied Instructions (Data Transfer 2)

*1. Equivalent circuit is presented for explanation, and it cannot be actually programmed as shown herein.

2. Changeover of operation mode When the modes are changed over in individual, return home, and automatic modes, unless the machine is at home position, all outputs and former states are reset in batch. (When M8045 is driven, all outputs *1 are not reset.)

Applied Instructions (Floating Point)

Return home X021 Automatic X022 to X024

S1 M8043

Changeover to individual X020

Batch resetting of former states, and resetting of related OUT output.

Return home end S2

M8045

All output reset ban

Individual X020 Automatic X022 to X024

Changeover to return home X021

S2 All outputs Y are reset when M8045 is OFF.

Applied Instructions (Positioning Control)

If changed over from automatic to return home during action of S2, the states other than initial state and outputs are not reset.

*1. All outputs: outputs not driven from the state of the device designated in (Y), and outputs driven by OUT, SET commands from the state of the device designated in (Y).

Show 25 more labels / short text on this page
X022 Stepping · X023 One- · cycle · X024 Conti- · nuous · start · Start pulse · M8040 Individual · Transfer ban X021 · X023 One- · cycle X027 Stop · M8002 Initial pulse · M8040 Self-holding · M8047 RUN monitor · STL monitor valid · *1 · X020 Individual · Home · position condition · Return home end · *1 · X021 Return home · Return home start · *1 · X022 to X024
Page 318 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Transfer mechanism
Page 318 · click to enlarge
Page 318

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

IST command introduction examples (examples of work transfer mechanism)

1. Operation mode

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — IST command introduction examples (examples of work transfer mechanism) diagram (page 318)
Fig. 271 · IST command introduction examples (examples of work…

Mechanism for transferring the work from point A to point B by robot hand

For individual operation of robot hand as shown on right

Pushbutton for external circuit for turning ON/OFF power of load

Operation mode Operation content

Individual operation: Mode for turning ON/OFF each load by individual pushbutton.

Return to home position: Mode for returning machine to home position automatically when return home pushbutton is pressed.

Stepping: To advance process by process every time start button is pressed.

When start button is pressed at home position, the machine is operated by one cycle automatically and stops at home position. If stop button is pressed on the way, the process stops immediately, and start button is pressed, the operation is resumed from the stopped position, and stops automatically at home position.

One-cycle operation:

Continuous operation:

When start button is pressed at home position, continuous repeating operation is started. When stop button is pressed, the machine operates to home position, and then stops.

2. Transfer mechanism

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Transfer mechanism diagram (page 318)
Fig. 272 · 2. Transfer mechanism

Home position condition? Upper limit (X002=ON), left limit (X004=ON), unclamp (Y001=OFF).

The home position is the upper left corner, and the work is sequentially transferred from left to right in the sequence of descend, clamp, ascend, right move, descend, unclamp, ascend, and left move. Solenoid valve of double solenoid (two inputs: drive/non-drive) is used for descend/ascend, left move/right move, and solenoid of single solenoid (active only while energized) is used for clamp.

Manual · Automatic

Page 319 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8000
Page 319 · click to enlarge
Page 319

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

3. Assignment of mode select inputs In order to use IST command, inputs of the following serial numbers must be assigned in the mode inputs. If the numbers are not serial, or modes are partly omitted, the array is modified by using auxiliary relays as shown below, which is used as the mode designation beginning input.

- X020: Individual operation - X021: Return to home position - X022: Stepping - X023: One-cycle operation - X024: Continuous operation - X025: Return home start - X026: Automatic start - X027: Stop

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

When inputs are not serial numbers

In the case of continuous/return home mode only

In the case of continuous/ individual mode only

(Example) X030:Individual operation

(Example) X030:Return to home position

(Example) X030:Individual operation

X035:Return to home position X033:Stepping X040:One-cycle operation X032:Continuous operation X034:Return home start X026:Automatic start X041:Stop

X031:Continuous operation X032:Common for automatic

X031:Continuous operation X032:Automatic start X033:Stop

start and return home start X033:Stop

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

M8000

M 0 X030

M 0 Individual operation

M 0 Not active

M8000

M 1 Return to home position

M 1 Return to home position

M 1

M8000

M 2 Not active

M 2

M 3 One-cycle operation X032

M 3

M 3

Applied Instructions (Data Transfer 2)

M 4 Continuous operation

M 4 Continuous operation

M 4 Continuous operation

M8000

M 5 Return home start

M 5 Return home start

M 5

M 6 Automatic start

M 6 Automatic start

M 6 Automatic start

Applied Instructions (Floating Point)

In this example, M0 is used as the mode designation beginning input.

M8000

d1 d2 M0 S20 S29

Applied Instructions (Positioning Control)

Show 9 more labels / short text on this page
Individual operation · RUN monitor · M 2 Stepping · Not active · M 7 Stop · M 7 Stop · M 7 Stop · IST EN s · RUN monitor
Page 320 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.1 IST / Initial State
Page 320 · click to enlarge
Page 320

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

4. Special auxiliary relays for IST command(M) Auxiliary relays (M) used in IST command are divided into those controlled automatically by the command depending on the circumstances, and others that must be controlled by the program depending on the operation preparation or purpose of control.
1. Those controlled automatically by IST command a) M8040: Transfer ban

When this auxiliary relay is put in action, transfer of all states is banned. individual : Always M8040 is active. Return home, one-cycle: When stop button is pressed, the operation is held until start button is

pressed. SteppingAlways M8040 is active. However, only when start button is pressed, the

operation is stopped, and is transferred. Other : Operation is held when PLC is changed from STOP to RUN, and is

canceled when start button is pressed. In transfer ban state, the output in the state continues to operate. b) M8041: Transfer start

This is the auxiliary relay required as transfer condition from initial state S2 to next state. Individual, return home : Not active. Stepping, one-cycle : Active only while start button is pressed. Continuous : Operation is held when start button is pressed, and canceled when stop

button is pressed. c) M8042Start pulse

Active momentarily only when start button is pressed. d) M8047: STL monitor valid

M8047 is turned ON when IST command is used. STL monitor is valid when M8047 is ON, and active state numbers (S0 to S899) are stored in the special data register D8040 to D8047 in numerical order. As a result, up to eight operation state numbers can be monitored. If any one of these states is active, the special auxiliary relay M8046 operates.

2. Those driven by sequence program

→ For detail of these controls, see next page. a) M8043: Return home end

In the return home mode, when the machine reaches the home position, operate this special auxiliary relay (M) from the user side program. b) M8044: Home position condition

You can drive this special auxiliary relay by detecting the home position condition of the machine. The signal is valid in all modes. c) M8045: All output reset ban

When the modes are changed over in individual, return home, and automatic modes, unless the machine is at home position, all outputs and operation states are reset. However, when the M8045 is driven, only the operation states are reset.

Page 321 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y004 X002
Page 321 · click to enlarge
Page 321

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

5. Program examples

1. Circuit diagram In the sequence circuit shown below, other portions than the shaded area are routine circuits. You can program the shaded area circuit according to the content of the control. a) Initial circuit

During operation of the machine, the operation can be changed over freely within the "automatic operation' mode (stepping/one-cycle/continuous). During operation of the machine, if changed over among "individual operation"/ "return home"/ "automatic operation", for safety precaution, all outputs are once reset, and the mode after changeover is valid. (You cannot reset when all outputs reset ban M8045 is turned ON.)

Applied Instructions (High Speed Processing)

[ ST ]

The home position status is detected, and used as the condition for start of transfer to automatic operation.

M8044:= X004 AND X002 AND NOT Y001; IST(M8000, X020, S20, S27);

Applied Instructions (Handy Instruction)

X004 X002

Y001

M8000

Applied Instructions (External FX I/O Device)

d1 d2 X020 S20 S27

Program is not required when individual mode is not available.

[ ST ]

Applied Instructions (External Device (optional device))

SET(X012, Y001); RST(X007, Y001); Y002:= X005 AND NOT Y000; Y000:= X010 AND NOT Y002; Y004:= X006 AND X002 AND NOT Y003; Y003:= X011 AND X002 AND NOT Y004;

SET EN ENO

RST EN ENO

Y002

Y000

Applied Instructions (Data Transfer 2)

Y004 X002

Y003 X002

Right move Upper limit

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 26 more labels / short text on this page
[Structured ladder/FBD] · M8044 Left limit · Home position condition · Upper limit · Unclamp · IST EN s · Initial state · RUN monitor · b) Individual operation · [Structured ladder/FBD] · Clamp · X012 Clamp command · d Y001 · X007 Unclamp command · d Y001 · X005 Ascend · command Y000 · Ascend · X010 Descend · command Y002 · Descend · X006 Left move · command Y003 · Left move · X011 Right move · command Y004
Page 322 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.1 IST / Initial State
Page 322 · click to enlarge
Page 322

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

c) Return to home position

Program is not required when return home mode is not available. However, before automatic operation, return home end M8043 must be once set.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.1 IST / Initial State diagram (page 322)
Fig. 273 · 13.1 IST / Initial State

STL(TRUE, S1); SET(X025, S10); STL(TRUE, S10); RST(TRUE, Y001); RST(TRUE, Y000); OUT(TRUE, Y002); SET(X002, S11); STL(TRUE, S11); RST(TRUE, Y003); OUT(TRUE, Y004); SET(X004, S12); STL(TRUE, S12); SET(TRUE, M8043); RST(M8043, S12);

Use states S10 to S19 in operation of return home, and in final state, by driving M8043, you can self-reset.

Page 323 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.1 IST / Initial State
Page 323 · click to enlarge
Page 323
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.1 IST / Initial State diagram (page 323)
Fig. 274 · 13.1 IST / Initial State

STL(TRUE, S20); OUT(TRUE, Y000); SET(X001, S21); STL(TRUE, S21); SET(TRUE, Y001); OUT_T(TRUE, TC0, K10); SET(TS0, S22); STL(TRUE, S22); OUT(TRUE, Y002); SET(X002, S23); STL(TRUE, S23); OUT(TRUE, Y003); SET(X003, S24); STL(TRUE, S24); OUT(TRUE, Y000); SET(X001, S25); STL(TRUE, S25); RST(TRUE, Y001); OUT_T(TRUE, TC1, K10); SET(TS1, S26); STL(TRUE, S26); OUT(TRUE, Y002); SET(X002, S27); STL(TRUE, S27); OUT(TRUE, Y004); OUT(X004, S2);

Page 324 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.1 IST / Initial State
Page 324 · click to enlarge
Page 324

13 Applied Instructions (Handy Instruction)

13.1 IST / Initial State

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.1 IST / Initial State diagram (page 324)
Fig. 275 · 13.1 IST / Initial State
Page 325 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ARRAY [1..5] OF ANY16
Page 325 · click to enlarge
Page 325

13 Applied Instructions (Handy Instruction)

13.2 SER / Search a Data Stack

13.2 SER / Search a Data Stack

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This is a command for searching same data and maximum value, minimum value from the table of data.

1. Format and operation, execution form

Expression in each language

SER EN s1 s2

Applied Instructions (Handy Instruction)

SER 16 bits Continuous SER(E, s1, s2, n, d);

SERP EN s1 s2

Applied Instructions (External FX I/O Device)

SERP 16 bits Pulse SERP(EN, s1, s2, n, d);

DSER EN s1 s2

DSER 32 bits Continuous DSER(EN, s1, s2, n, d);

Applied Instructions (External Device (optional device))

DSERP EN s1 s2

DSERP 32 bits Pulse DSERP(EN, s1, s2, n, d);

2. Set data

Applied Instructions (Data Transfer 2)

EN Execution condition Bit

Beginning device for searching same data, maximum value, minimum value ANY16 ANY32

Value for searching same data, maximum value, minimum value, or its storage destination device ANY16 ANY32

The number for searching same data, maximum value, minimum value ANY16

Applied Instructions (Floating Point)

ENO Execution state Bit

Beginning device for storing the numbers after searching same data, maximum value, minimum value

ARRAY [1..5] OF ANY16

ARRAY [1..5] OF ANY32

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

z S1 z z

Applied Instructions (Positioning Control)

z S1 S2 z

S: Refer to "Cautions".

Show 22 more labels / short text on this page
Instruction · name Operation Execution · form · n · n · n · n · Data type · Variable Description · 16-bit operation · 32-bit operation · Input variable · Output variable · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant
Page 326 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 326 · click to enlarge
Page 326

13 Applied Instructions (Handy Instruction)

13.2 SER / Search a Data Stack

Function and operation explanation

1. 16-bit operation

In n pieces of data beginning from the device designated in , same data as the device designated in is searched, and the result is stored in the device designated in .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 326)
Fig. 276 · Function and operation explanation

Beginning device for searching same data, maximum value, minimum value

Beginning device for storing the numbers after searching same data, maximum value, minimum value

Value for searching same data, maximum value, minimum value, or its storage destination device The number for searching same data, maximum value, minimum value

1. Content and result of searched data a) When same data is found

In five devices beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. b) When same data is not found

In five devices beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. However, 0 is stored in three devices beginning from the device designated in (number of same data, initial/final position).

2. Operation examples

a) Examples of composition of search result table and data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 326)
Fig. 277 · Function and operation explanation

b) Search result table

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 326)
Fig. 278 · Function and operation explanation
Page 327 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ +15, +14] K 95000 7
Page 327 · click to enlarge
Page 327

13 Applied Instructions (Handy Instruction)

13.2 SER / Search a Data Stack

2. 32-bit operation(DSER, DSERP) In n pieces of data beginning from the device designated in , same data as the device designated in is searched, and the result is stored in the device designated in .

Command input DSER EN

Beginning device for searching same data, maximum value, minimum value

Beginning device for storing the numbers after searching same data, maximum value, minimum value

Applied Instructions (High Speed Processing)

Value for searching same data, maximum value, minimum value, or its storage destination device

The number for searching same data, maximum value, minimum value

1. Content and result of searched data a) When same data is found

Applied Instructions (Handy Instruction)

In five points of 32-bit data beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. b) When same data is not found

In five points of 32-bit data beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. However, 0 is stored in three points of 32-bit data beginning from the device designated in (number of same data, initial/final position).

Applied Instructions (External FX I/O Device)

2. Operation examples

a) Examples of composition of search result table and data

Value of of searched data

Applied Instructions (External Device (optional device))

(ex.)

[ +1, ] K100000

[ +3, +2] K110100 1

[ +5, +4] K100000 2 3

[ +7, +6] K 98000 3

[ +9, +8] K123000 4

K100000

[ +11, +10] K 66000 5 3

[ +13, +12] K100000 6 3(Final)

[ +15, +14] K 95000 7

[ +17, +16] K910000 8 3

[ +19, +18] K910000 9 3

Applied Instructions (Data Transfer 2)

b) Search result table

Device No. Content Search result item

[ +1, ] 3 Number of same data

[ +3, +2] 0 Position of same data (initial)

Applied Instructions (Floating Point)

[ +5, +4] 6 Position of same data (final)

[ +7, +6] 5 Final position of minimum value

[ +9, +8] 9 Final position of maximum value

Applied Instructions (Positioning Control)

Show 15 more labels / short text on this page
s1 · s2 · n · Search result · Searched device · Comparative · Position · data · of data · Maximum · Coincide Minimum · +1 · value +4 · value +3 · 0 3(Initial)
Page 328 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 328 · click to enlarge
Page 328

13 Applied Instructions (Handy Instruction)

13.2 SER / Search a Data Stack

Cautions

1. Comparison of magnitude To be calculated algebraically. (-10 < 2)

2. When minimum value and maximum value are present in a plurality If there are a plurality of minimum value and maximum value in the data, the latter position is stored individually.
3. Number of bits occupied The search result occupies the following number of devices when this command is driven. Please be careful not to overlap with the devices used in the control of the machine.
1. In the case of 16-bit operation A total of five points will be occupied, that is, , +1, +2, +3, +4.
2. In the case of 32-bit operation A total of ten points will be occupied, that is, ( +1, ), ( +3, +2), ( +5, +4), ( +7, +6), ( +9, +8).
4. FX U PLC supports the command by V3.07 or higher.
5. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Page 329 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.3 ABSD / Absolute Drum Sequencer
Page 329 · click to enlarge
Page 329
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.3 ABSD / Absolute Drum Sequencer diagram (page 329)
Fig. 279 · 13.3 ABSD / Absolute Drum Sequencer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for creating multiple output patterns corresponding to the present value of the counter.

ABSD 16 bits Continuous ABSD(EN, s1, s2, n, d);

DABSD 32 bits Continuous DABSD(EN, s1, s2, n, d);

Beginning device for storing table data (rise point, fall point) ANY16 ANY16

Counter for present value monitor to compare with table data ANY16 ANY16

Number of lines of table and number of points of bit device to be output ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

Page 330 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — IST command equivalent circuit
Page 330 · click to enlarge
Page 330

13 Applied Instructions (Handy Instruction)

13.3 ABSD / Absolute Drum Sequencer

IST command equivalent circuit

1. 16-bit operation(ABSD) This is an example for explaining the ON/OFF control of the output by one revolution of table (0 to 360 degrees). (Rotation angle signal one degree per pulse) Data table (occupying n lines × 2 points) of n lines from the device designated in is compared with the present value of the counter of the device designated in , and outputs of n points continuous from the device designated in are controlled to be ON/OFF during one revolution.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — IST command equivalent circuit diagram (page 330)
Fig. 280 · IST command equivalent circuit

Beginning device for storing table data (rise point, fall point) Beginning bit device to be output

Counter for present value monitor to compare with table data (C )

n Number of lines of table and number of points of bit device to be output

1. Write the following data in to +2n+1, preliminarily by using transfer command.

For example, store rising point data and falling point data alternately.

2. Output pattern When command input is turned ON, n points are changed as follows, starting from the device designated in . Rise point and fall point may be individually changed by rewriting data in to +n × 2.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — IST command equivalent circuit diagram (page 330)
Fig. 281 · IST command equivalent circuit
Page 331 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K360 CC
Page 331 · click to enlarge
Page 331

13 Applied Instructions (Handy Instruction)

13.3 ABSD / Absolute Drum Sequencer

2. 32-bit operation(DABSD) This is an example for explaining the ON/OFF control of the output by one revolution of table (0 to 360 degrees). (Rotation angle signal one degree per pulse) Data table (occupying n lines × 4 points) of n lines from the device designated in is compared with the present value of the counter of the device designated in , and outputs of n points continuous from the device designated in are controlled to be ON/OFF.

Applied Instructions (High Speed Processing)

ABSD EN

Beginning device for storing table data (rise point, fall point) Beginning bit device to be output

Counter for present value monitor to compare with table data (C )

Applied Instructions (Handy Instruction)

n Number of lines of table and number of points of bit device to be output

CS

RST EN ENO

Applied Instructions (External FX I/O Device)

OUT_C EN CCoil CValue

K360 CC

Applied Instructions (External Device (optional device))

Rotation angle signal one degree per pulse

1. Write the following data in ( , +1) to ( +4n+2, +4n+3), preliminarily by using transfer command.

Rise point Fall point

Object output Data value

[ +1, ] 40 [ +3, +2] 140

[ +5, +4] 100 [ +7, +6] 200 +1

[ +9, +8] 160 [ +11, +10] 60 +2

[ +13, +12] 240 [ +15, +14] 280 +3

Applied Instructions (Data Transfer 2)

[ +4n+1, +4n] [ +4n+3, +4n+2] +n-1

For example, store rising point data and falling point data alternately.

2. Output pattern When command input is turned ON, n points are changed as follows, starting from the device designated in . Rise point and fall point may be individually changed by rewriting data in ( +1, ) to ( +(n × 2)+3, +(n × 2)+2).

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 15 more labels / short text on this page
Command input · s1 · s2 · Data value · (example) · (example) · … · … · … · 100 200 · +1 · +2 · 240 280 · +3 · 180 360
Page 332 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Other cautions
Page 332 · click to enlarge
Page 332

13 Applied Instructions (Handy Instruction)

13.3 ABSD / Absolute Drum Sequencer

Cautions

1. Designation of high speed counter DABSD command can designate a high-speed counter in the device designated in . When the high-speed counter is specified, as compared with the counter present value, the output pattern may have a response delay due to scan cycle. When using FX 3U , FX 3UC PLCs, the response may be enhanced by using table high speed comparison function by DHSZ command or by using DHSCT command.

2. When designating the digits of bit device in

1. Device No. Designate a multiple of 16 (0, 16, 32, 64, ...).
2. Number of digits - K4 only in the case of ABSD (16-bit operation) - K8 only in the case of DABSD (32-bit operation)

3. Other cautions

  • The number of output points of the object is determined by the value of n. (1 ≤ n ≤ 64)
  • The output is not changed if the command input is turned OFF.
4. FX U PLC does not support 32-bit command at V2.30 or lower.
5. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.

Page 333 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.4 INCD / Incremental Drum Sequencer
Page 333 · click to enlarge
Page 333
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.4 INCD / Incremental Drum Sequencer diagram (page 333)
Fig. 282 · 13.4 INCD / Incremental Drum Sequencer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for creating multiple output patterns by using a pair of counters.

INCD 16 bits Continuous INCD(EN, s1, s2, n, d);

Beginning word device for storing the set value ANY16

Beginning device of counter for present value monitor (2 points occupied) ANY16

Beginning bit device to be output (n points occupied) Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

Page 334 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation
Page 334 · click to enlarge
Page 334

13 Applied Instructions (Handy Instruction)

13.4 INCD / Incremental Drum Sequencer

Function and operation explanation

1. 16-bit operation(INCD) Data table (n lines × 1 point occupied) of n lines from the device designated in is compared with the present value of the counter of the device designated in , and by resetting when coinciding, outputs are sequentially controlled to be ON/OFF.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 334)
Fig. 283 · Function and operation explanation

Beginning word device for storing the set value Beginning device of counter for present value monitor Number of bit devices to be output

Operation

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation diagram (page 334)
Fig. 284 · Operation
1. Timing chart Write the following data beforehand by using transfer command.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation diagram (page 334)
Fig. 285 · Operation
Page 335 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 335 · click to enlarge
Page 335

13 Applied Instructions (Handy Instruction)

13.4 INCD / Incremental Drum Sequencer

2. M0 output is turned ON when command contact is turned ON.
3. Output (M0) is reset when the present value of C0 reaches comparative value D300, and the count value of the process counter C1 is incremented by +1, and the present value of the counter C0 is also reset.
4. Next output M1 is turned ON.
5. Output M1 is compared with comparative value D301 of C0 present value, and when reaching the comparative value, the count value of the process counter C1 is incremented by +1, and the present value of the counter C0 is also reset.

Applied Instructions (High Speed Processing)

6. Similarly compared up to the number of points designated in n(K4). (1 ≤ n ≤ 64)
7. When the final process designated in n is over, execution complete flag M8029 is turned ON for one operation period. M8029 is a command execution complete flag used by a plurality of commands, and is used as the contact right after the command, and then you can set up a complete flag exclusively for this command.

Applied Instructions (Handy Instruction)

8. Repeat outputs by returning to the beginning.

Cautions

1. When designating the digits of bit device in the device designated in Designate a multiple of 16 (0, 16, 32, 64, ...) in the device number.

Applied Instructions (External FX I/O Device)

2. Number of occupied devices Two devices are occupied from a device designated in . Make sure not to use those devices in another control.
3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (External Device (optional device))

However, index modifier (V, Z) is not applicable. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 336 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 336 · click to enlarge
Page 336

13 Applied Instructions (Handy Instruction)

13.5 TTMR / Teaching Timer

13.5 TTMR / Teaching Timer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for measuring the ON duration of TTMR command. This is used when adjusting the timer setting time by pushbutton.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 336)
Fig. 286 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 336)
Fig. 287 · 2. Set data

Multiplying factor number to be applied to teaching data ANY16

Device for storing teaching data (2 points occupied) ARRAY [0..1] OF ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 336)
Fig. 288 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 337 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 337 · click to enlarge
Page 337

13 Applied Instructions (Handy Instruction)

13.5 TTMR / Teaching Timer

Function and operation explanation

1. 16-bit operation(TTMR) The pushing duration of command input (pushbutton) is measured in the unit of seconds, and is multiplied by multiplying factor (10 n ), and transferred to the device designated in .

Command input TTMR EN n

Applied Instructions (High Speed Processing)

Multiplying factor number to be applied to teaching data

Device for storing teaching data

Applied Instructions (Handy Instruction)

τ0 τ0 Pushing duration (sec) Pushing duration (sec)

The time to be transferred to the device designated in depends on the multiplying factor of n, supposing the pushing duration to be τ0 (1 sec unit), and the value of the device actually designated in is as follows.

Applied Instructions (External FX I/O Device)

K0 τ0 ×1

K1 10τ0 ×10

K2 100τ0 ×100

Related command

Applied Instructions (External Device (optional device))

You can use such a convenient command.

HOUR The command to issue the ON time of HOUR command by the time added and designated in 1 hour unit.

Cautions

1. When command contact is turned OFF The present value ( +1) of the pushing duration is reset, and the teaching time is not changed.
2. Number of bits occupied Two devices are occupied starting from the device (teaching time) designated in . Be careful not to overlap with the device used in control of the machine.

Applied Instructions (Data Transfer 2)

  • : Teaching time
  • +1: Present time of pushing duration
3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 5 more labels / short text on this page
Command contact · +1 · +1 · Multiplying factor · Command Content
Page 338 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 338 · click to enlarge
Page 338

13 Applied Instructions (Handy Instruction)

13.5 TTMR / Teaching Timer

Program examples

Write teaching time in ten data registers. Set values should be preliminarily written in D400 to D409.

OUT_T EN TCoil TValue

TC0 D400

OUT_T EN TCoil TValue

Ten timers desired to be set

TC1 D401

Timers (T0 to T9) are 100 ms timers, and 1/10 of the teaching data is the actual operation time (in seconds).

OUT_T EN TCoil TValue

TC9 D409

Timer selection by digital switch The input of one-digit digital switch connected to X000 to X003 is converted to BIN, and transferred to Z.

M8000

Teaching measurement Pushing duration (seconds) of X010 is stored in D300. TTMR EN n

X010 Teaching button restore detection PLF EN ENO

M0 Writing set value of timer The teaching time (D300) is transferred to the setting register (D400Z) for the timer selected by digital switch.

[ ST ]

OUT_T (X020, TC0, D400); OUT_T (X021, TC1, D401);

OUT_T (X032, TC9, D409); BIN(M8000, K1X000, Z); TTMR(X010, D300, K0); PLF(X010, M0); MOV(M0, D300, D400Z);

Show 9 more labels / short text on this page
[Structured ladder/FBD] · BIN EN s · RUN monitor · d K1X000 Z · Teaching button · d K0 D300 · d M0 · MOV EN s · d D300 D400Z
Page 339 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.6 STMR / Special Timer
Page 339 · click to enlarge
Page 339
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.6 STMR / Special Timer diagram (page 339)
Fig. 289 · 13.6 STMR / Special Timer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is the command for creating the off-delay timer, one-shot timer or flicker timer easily.

Beginning bit device to be output [4 points occupied] ARRAY [0..3] OF Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 340 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M0
Page 340 · click to enlarge
Page 340

13 Applied Instructions (Handy Instruction)

13.6 STMR / Special Timer

Function and operation explanation

1. 16-bit operation(STMR) The value designated in m is determined as the set value for the timer of the device designated in , and is issued to four points from the device designated in . Create the program depending on the application by referring to the following example.

Command input STMR EN s m

Beginning bit device to be output

d Timer to be used Set value of timer

Off-delay timer, one-shot timer When T10 is assigned in , K100 in m, and M0 in

Command input STMR EN s m

M0

  • M0[ ] : This is an off-delay timer for turning OFF with set time delay of the timer after the command

contact is turned OFF.

  • M1[ +1] : This is a one-shot timer for turning OFF after the timer set time by turning ON after the

command contact is changed from ON to OFF.

  • M2[ +2] : Occupied. To be used for flicker application.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — M0 diagram (page 340)
Fig. 290

Flicker The flicker is issued to +1, +2 by preparing the program for turning OFF this command by the b- contact of +3 as shown below. and +3 are occupied.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — M0 diagram (page 340)
Fig. 291
  • M0[ ] : Occupied. (To be used in off-delay timer application. See previous page.)
  • M1[ +1] : This is the flicker (a-contact) for repeating ON/OFF at timer time intervals.
  • M2[ +2] : This is the flicker (b-contact) for repeating ON/OFF at timer time intervals.

d T10 K100

Page 341 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 341 · click to enlarge
Page 341

13 Applied Instructions (Handy Instruction)

13.6 STMR / Special Timer

Cautions

1. Handling of designated timer The timer number designated by this command cannot be used in overlap with other general circuit (OUT command, etc.). If overlapped, the timer does not operate correctly.
2. Number of bits occupied Four devices are occupied from the one designated in . Be careful not to overlap with the device used in control of the machine.

Applied Instructions (High Speed Processing)

Off-delay timer One-shot timer Flicker

Applied Instructions (Handy Instruction)

+1 One-shot timer Flicker(a-contact)

3. When command contact is turned OFF , +1, and +3 are turned OFF after the set time. The timers designated in +2 and are reset immediately.

Applied Instructions (External FX I/O Device)

4. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 5 more labels / short text on this page
Function · Device · Off-delay timer Occupied · +2 Occupied Flicker(b-contact) · +3 Occupied Flicker(b-contact)
Page 342 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 342 · click to enlarge
Page 342

13 Applied Instructions (Handy Instruction)

13.7 ALT / Alternate State

13.7 ALT / Alternate State

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is the command for inverting the bit device (ON to OFF, OFF to ON) when the input is turned ON.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 342)
Fig. 292 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 342)
Fig. 293 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 342)
Fig. 294 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 343 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ALTP(X000, M0); OUT(NOT M0, Y000); OUT(M0, Y001);
Page 343 · click to enlarge
Page 343

13 Applied Instructions (Handy Instruction)

13.7 ALT / Alternate State

Function and operation explanation

1. 16-bit operation(ALT, ALTP)

Alternate output (one stage) Every time the command input is changed from OFF to ON, the bit device designated in is inverted from ON to OFF, from OFF to ON.

Applied Instructions (High Speed Processing)

Command input Command input

ON ON ON ALTP EN ENO

ON ON

Frequency dividing output (alternate output (two stages)) By combining and using a plurality of ALTP commands, the frequency can be divided and issued in multiple stages.

Applied Instructions (Handy Instruction)

ON ON ON

ON

Applied Instructions (External FX I/O Device)

ALTP EN ENO

M0

ON ON

Same device is designated.

M0

ALTP EN ENO

Applied Instructions (External Device (optional device))

M1

ON

Cautions

1. When using ALT command (continuous execution form) When programmed by ATL command, the operation is inverted in every operation period. When inverting by ON/OFF switching of command, use the ALTP command (pulse execution form) or execute the command contact by LDP (pulse execution form).
2. FX 0S , FX 0 , FX 0N PLCs do not support the command of pulse execution form. In the case of pulse execution form, convert the command execution form into pulses.

Applied Instructions (Data Transfer 2)

3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable.

Program examples

Applied Instructions (Floating Point)

1. Start/stop by one input

1. By pressing pushbutton X000, the start output Y001 is put in action.
2. By pressing pushbutton X000 again, the stop output Y000 is put in action.

ALTP(X000, M0); OUT(NOT M0, Y000); OUT(M0, Y001);

X000 ALTP EN ENO

M0

M0

M0

Applied Instructions (Positioning Control)

Show 8 more labels / short text on this page
First stage · Command input · Command input · d M0 · Second stage · d M1 · Y000 Stop · Y001 Start
Page 344 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Flicker operation
Page 344 · click to enlarge
Page 344

13 Applied Instructions (Handy Instruction)

13.7 ALT / Alternate State

2. Flicker operation

1. When the input X006 is turned ON, the contact of timer T2 operates momentarily in every 5 seconds.
2. Every time the contact of T2 is turned ON, the output Y007 is alternately turned ON/OFF.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Flicker operation diagram (page 344)
Fig. 295 · 2. Flicker operation

5 sec 5 sec 5 sec 5 sec 5 sec 5 sec 5 sec

OUT_T(X006 AND NOT TS2, TC2, K50); ALT(X006 AND TS2,Y007);

3. Alternate output operation using auxiliary relay (M) (same operation as ALT command) The following circuit shows an example of alternate operation by using the basic command and auxiliary relay (M) in the same operation as ALT command.
1. When the X000 is turned on, M0 is turned ON for one operation period only.
2. When M0 is turned ON for the first time, the Y000 operates by self-holding, and when turned ON second time, the self-holding function is canceled.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Flicker operation diagram (page 344)
Fig. 296 · 2. Flicker operation

OUT(X000 AND NOT M1, M0); OUT(X000); OUT((M0 OR NOT Y000) OR (NOT M0 AND Y000), Y000));

Page 345 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.8 RAMP / Ramp Variable Value
Page 345 · click to enlarge
Page 345
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.8 RAMP / Ramp Variable Value diagram (page 345)
Fig. 297 · 13.8 RAMP / Ramp Variable Value

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for obtaining data changing n times when designated between the beginning (initial value) and the end (target value).

RAMP 16 bits Continuous RAMP(EN, s1, s2, n, d);

Device storing initial value of ramp, setting of target value ANY16

Device storing initial value of ramp, setting of target value ANY16

Device storing data of present value of ramp (2 points occupied) ANY16(0..1)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 346 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 346 · click to enlarge
Page 346

13 Applied Instructions (Handy Instruction)

13.8 RAMP / Ramp Variable Value

Function and operation explanation

1. 16-bit operation(RAMP) The starting value and the desired end value are designated in and , and when the command input is turned ON, the value equally divided by the number of times designated in n is added to sequentially in every operation period, and the sum is stored in the device designated in . This command and the analog output are combined, and the cushion start/stop command can be issued.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 346)
Fig. 298 · Function and operation explanation
2. When > s1 s2 1) When < s1 s2
  • In +1, scan times (0 to n times) is stored.
  • The time from start till end is scanned by operation period × n times.
  • When the command input is turned OFF in the midst of operation, the execution is interrupted (present value data of is held, and +1 scan times is cleared), and when turned ON again, is cleared, and the operation is resumed from .
  • After completion of transfer, the command execution complete flag M8029 is active, and the value of returns to the value of .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 346)
Fig. 299 · Function and operation explanation
  • When obtaining operation results at specific time intervals (constant scan mode) Write specified scan time in D8039 (a slightly longer value than actual scan time), and when the M8039 is turned ON, the PLC is set in constant scan mode. When this value is, for example, 20 ms and designated by n=100 times, the value of changes from to in 20 seconds.
Page 347 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 347 · click to enlarge
Page 347

13 Applied Instructions (Handy Instruction)

13.8 RAMP / Ramp Variable Value

2. Operation of mode flag (M8026) In FXU (V1.20 or higher), FX2C, FX2N, FX2NC, FX3U and FX3UC PLCs, by ON/OFF switching of mode flag M8026, the content of +1 is changed as follows. FX0S, FX0, FX0N, FX1S, FX1N, FX3S, FX3G and FX3GC PLCs operate same as when the M8026 is turned ON. FXU (V1.1 or lower) PLC operates same as when the M8026 is turned OFF.

1. In the case of M8026=OFF 2) In the case of M8026=ON

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

(M8029)

(M8029)

Applied Instructions (External FX I/O Device)

Related devices

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

M8029

After n operation periods, when becoming = , the device is turned ON.

Applied Instructions (External Device (optional device))

M8026*1 RAMP mode See the Operation of mode flag (M8026) explained above.

*1. Cleared when changed from RUN to STOP (applicable only in FX3U, FX3UC, FX2N, FX2NC, FX2C, FXU PLCs).

Cautions

1. When designating power failure hold device (keep region) in the device designated in When desired to keep the PLC in RUN (start) state while the command input is ON, the device designated in

should be cleared beforehand.

2. Some restrictions to applicable devices. S 1: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 8 more labels / short text on this page
Command · Command · s2 · s2 · d s1 · d s1 · Device Name Content · Command execution complete
Page 348 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 348 · click to enlarge
Page 348

13 Applied Instructions (Handy Instruction)

13.9 ROTC / Rotary Table Control

13.9 ROTC / Rotary Table Control

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command suited for turning the table by a shortcut route depending on the demanding window when putting on or taking out articles on the rotary table.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 348)
Fig. 300 · 1. Format and operation, execution form

ROTC 16 bits Continuous ROTC(EN, s, m1, m2, d);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 348)
Fig. 301 · 2. Set data

Data register for counting (3 points occupied) ARRAY [0..2] OF ANY16

Beginning bit device to be driven (8 points occupied) ARRAY [0..7] OF Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 348)
Fig. 302 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 349 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 13.9 ROTC / Rotary Table Control
Page 349 · click to enlarge
Page 349
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 13.9 ROTC / Rotary Table Control diagram (page 349)
Fig. 303 · 13.9 ROTC / Rotary Table Control
1. 16-bit operation(ROTC) As shown below, in order to put on or take out articles on the rotary table divided into m1 sections (=10), depending on the demanding window, the table is controlled and moved by a shortcut route in the condition designated in m2 or and .

To be set preliminarily by transfer command +1 Setting of calling window number

Internal contact circuit to be driven is preliminarily composed of input signal (X).

Page 350 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 350 · click to enlarge
Page 350

13 Applied Instructions (Handy Instruction)

13.9 ROTC / Rotary Table Control

Operation condition

The condition necessary for using this command is as shown in the example below.

1. Rotation detection signal: X → a) Please install two-phase switch (X000, X001) for detecting normal rotation/reverse rotation of table,

and switch X002 for operating when article number 0 comes to window number 0. b) Create sequence program as shown in the example below.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation condition diagram (page 350)
Fig. 304 · Operation condition

By X000 to X002, you can exchange with internal contacts of to +2. Beginning device number for designating or is arbitrary. d

is a counter for counting article of which number is coming to window number 0.

a) In +1, you can set the window number desired to be called.

b) In +2, you can set the article number desired to be called.

4. Division number m1 and low speed period m2 To designate division number m1 of table and low speed operation section m2.

When the above condition is designated, the output of normal/reverse rotation, high speed/low speed/stop will be obtained in the output of +3 to +7 designated in the beginning device of the command.

Cautions

1. Operation by ON/OFF of command input

  • When this command is driven by turning ON the command input, results of +3 to +7 will be obtained automatically.
  • By turning OFF the command input, +3 to +7 are turned OFF.
2. Operation of plural times in one division section of article of rotation detection signal ( to +2) For example, rotation detection signal ( to +2) operates 10 times in one division section of article, setting of division number, setting of calling window number, and setting of article number should be all multiplied by 10. As a result, the set value of low speed section can be set in an intermediate value of division number.
3. 0 point detection signal When the command input is ON and 0 point detection signal (M2) is turned ON, the content of register for counting is cleared to 0. You must start operation by executing this clearing operation beforehand.
4. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

Page 351 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 351 · click to enlarge
Page 351

13 Applied Instructions (Handy Instruction)

13.10 SORT / SORT Tabulated Data

13.10 SORT / SORT Tabulated Data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This command reshuffles the data table composed of data (columns) and group data (rows) in the ascending order in column unit on the basis of designated group data (rows). In this command, the group data (rows) is stored in continuous devices. Similarly, in SORT2 command, data (columns) is stored in continuous devices, so that the data (columns) may be added easily, and reshuffling is applicable in both ascending order and descending order.

→ As for SORT2 command, see paragraph 19.7.

Applied Instructions (Handy Instruction)

1. Format and operation, execution form

Expression in each language

SORT EN s m1

Applied Instructions (External FX I/O Device)

SORT 16 bits Continuous SORT(EN, s, m1, m2, n, d);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Beginning device storing data table (m1xm2 points occupied) ANY16

Number of data (columns) ANY16

Number of group data (rows) ANY16

Row of group data (rows) as basis of reshuffling ANY16

ENO Execution state Bit

Beginning device storing arithmetic results (m1 × m2 points occupied) ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Floating Point)

z S1 z z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · m2 n · Input variable · Output variable · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant · z S1 · z z · z z · z S1
Page 352 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Reshuffling origin data
Page 352 · click to enlarge
Page 352

13 Applied Instructions (Handy Instruction)

13.10 SORT / SORT Tabulated Data

Function and operation explanation

1. 16-bit operation(SORT) This command reshuffles the data table (reshuffling origin) composed of (m1 × m2) points from the device designated in in the ascending order in data columns on the basis of n rows of group data, and stores in the data table (after reshuffling) of (m1 × m2) points from the device designated in .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 352)
Fig. 305 · Function and operation explanation

Beginning device storing data table Beginning device storing operation results Number of data (columns)

Row of group data (rows) as basis of reshuffling

  • The data table composition is explained in an example of m1=K3, m2=K4 at the reshuffling origin. After reshuffling, replace with in data table composition.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 352)
Fig. 306 · Function and operation explanation
  • When the command input is turned ON, the data arraying is started, and after m1 scan, the data arraying is completed, and the command execution complete flag M8029 is turned ON.

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

2. Operation examples When the following reshuffling origin data is executed in "n=K2 (row number 2)" and "n=K3 (row number 3)", the operation is as follows. When a serial number such as management number is entered in the first row, it is convenient because you can judge the original column number by its content.

Reshuffling origin data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Reshuffling origin data diagram (page 352)
Fig. 307 · Reshuffling origin data
Page 353 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 353 · click to enlarge
Page 353

13 Applied Instructions (Handy Instruction)

13.10 SORT / SORT Tabulated Data

1. Reshuffling results when command is executed in n=K2 (row number 2)

Row number 1 2 3 4

number Height Weight Age

1 +5 +10 +15

4 100 20 8

Applied Instructions (High Speed Processing)

2 +1 +6 +11 +16

1 150 45 20

3 +2 +7 +12 +17

5 150 50 45

4 +3 +8 +13 +18

Applied Instructions (Handy Instruction)

3 160 70 30

5 +4 +9 +14 +19

2 180 50 40

2. Reshuffling results when command is executed in n=K3 (row number 3)

Row number 1 2 3 4

Applied Instructions (External FX I/O Device)

number Height Weight Age

1 +5 +10 +15

4 100 20 8

2 +1 +6 +11 +16

1 150 45 20

Applied Instructions (External Device (optional device))

3 +2 +7 +12 +17

2 180 50 40

4 +3 +8 +13 +18

5 150 50 45

5 +4 +9 +14 +19

3 160 70 30

Related devices

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

Applied Instructions (Data Transfer 2)

complete To be ON when data arraying is complete.

Cautions

1. Do not change the content of operand or data during operation.
2. When resuming the execution, once turn OFF the command input.

Applied Instructions (Floating Point)

3. Limit of number of times of use of command Usable only once in the program.
4. When designating same device in and The original data is rewritten in the data sequence after reshuffling. In particular, never change the content of the device designated in until the completion of execution.
5. FX U PLC supports the command by V3.07 or higher.
6. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

Show 6 more labels / short text on this page
Column number · Management · Column number · Management · Device Name Content · M8029 Command execution
Page 354 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DTO
Page 354 · click to enlarge
Page 354

14 Applied Instructions (External FX I/O Device)

14. Applied Instructions (External FX I/O Device)

This chapter introduces the instructions to receive data from and send data to external devices mainly using inputs and outputs in PLCs.

Instruction name Function Reference

TKY

Ten Key Input Section 14.1 DTKY

HKY

Hexadecimal Input Section 14.2 DHKY

DSW Digital Switch (Thumbwheel Input) Section 14.3

SEGD

Seven Segment Decoder Section 14.4 SEGDP

SEGL Seven Segment With Latch Section 14.5

ARWS Arrow Switch Section 14.6

ASC ASCII Code Data Input Section 14.7

PR Print (ASCII Code) Section 14.8

FROM

Read From A Special Function Block Section 14.9 FROMP

DFROM

DFROMP

TO

Write To A Special Function Block Section 14.10 TOP

DTO

DTOP

Page 355 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 14.1 TKY / Ten Key Input
Page 355 · click to enlarge
Page 355
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 14.1 TKY / Ten Key Input diagram (page 355)
Fig. 308 · 14.1 TKY / Ten Key Input

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This is a command for setting data in the timer or counter by the input of numeric keys 0 to 9.

Beginning bit device for entering numeric keys (10 points occupied) ARRAY [0..9] OF Bit

Beginning bit device for turning ON key pushing information (11 points occupied) ARRAY [0..10] OF Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S2 z z z

Page 356 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 356 · click to enlarge
Page 356

14 Applied Instructions (External FX I/O Device)

14.1 TKY / Ten Key Input

Function and operation explanation

1. 16-bit operation(TKY) By pressing key from the input for connecting the numeric keys (device designated in ), the entered numerical value is stored in the device designated in , and the key pushing information and key sense output are issued to the device designated in .
1. Entered numerical value - If more than 9,999, the value overflows from the higher digits. - The entered numerical value is stored in the BIN (binary) value. - In the diagram of next page, when numeric keys are pressed in the sequence of 1, 2, 3, 4, then "2,130" is stored in the device designated in .
2. Key pushing information - Key pushing information of to +9 is turned ON/OFF depending on the pushed key. - Key sense output of +10 is ON when either key is being pushed.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 356)
Fig. 309 · Function and operation explanation
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 356)
Fig. 310 · Function and operation explanation

Beginning bit device for turning ON key pushing information

The diagram below shows an example of FX3U PLC (sync input). As for the wiring, see the manual of each PLC.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 356)
Fig. 311 · Function and operation explanation

5 6 7 8 1 2 3 4 0 9 Numeric key

Page 357 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M10
Page 357 · click to enlarge
Page 357

14 Applied Instructions (External FX I/O Device)

14.1 TKY / Ten Key Input

2. 32-bit operation(DTKY) By pressing key from the input for connecting the numeric keys (device designated in ), the entered numerical value is stored in the device designated in , and the key pushing information and key sense output are issued to the device designated in .
1. Entered numerical value - If more than 99,999,999, the value overflows from the higher digits. - The entered numerical value is stored in the BIN (binary) value.

Applied Instructions (High Speed Processing)

2. Key pushing information - Key pushing information of to +9 is turned ON/OFF depending on the pushed key. - Key sense output of +10 is ON when either key is being pushed.

Command input DTKY EN s

Applied Instructions (Handy Instruction)

d1 d2 Beginning bit device for entering numeric key

Word device for storing data

Beginning bit device for turning ON key pushing information

As for numeric key connection example and key pushing information, see the above explanation of 16-bit operation (TKY).

Applied Instructions (External FX I/O Device)

Cautions

1. When keys are pressed simultaneously When plural keys are pressed, only the first pressed key is valid.

Applied Instructions (External Device (optional device))

2. When command contact is turned OFF If turned OFF, the content of is not changed, but all of to +10 are turned OFF.

X030 TKY EN s

TKY(X030, X000, D0, M10);

d1 d2 X000 D0

M10

3. Number of bits occupied

1. When a numeric key is connected, 10 points are occupied from . When numeric key is not connected (not used), the devices are occupied and cannot be used in other applications.
2. A total of 11 points are occupied from the beginning device for output of key pushing information. Be careful not to overlap with the device used in control of machine. - to +9: Turned ON corresponding to the input of numeric keys 0 to 9.

Applied Instructions (Data Transfer 2)

- +10: Kept ON while any one of 0 to 9 is being pressed (key sense output).

4. Limit of number of times of use of command Only one of TKY command and DTKY command can be used in the program. If desired to use plural times, you can program by the index modifier (V, Z) function.

Applied Instructions (Floating Point)

5. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

Page 358 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Timing chart
Page 358 · click to enlarge
Page 358

14 Applied Instructions (External FX I/O Device)

14.1 TKY / Ten Key Input

Program examples

This is an explanation of an example in which the input X000 is the beginning, and numeric keys 0 to 9 are connected.

1. Program

X030 TKY EN s

TKY(X030, X000, D0, M10);

d1 d2 X000 D0

M10

2. Wiring diagram This wiring diagram is an example of FX 3U PLC (sync input). As for the actual wiring connection, see the manual of the PLC.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — M10 diagram (page 358)
Fig. 312

S/S X000 X001 X002 X003 X005 X004 X006 X007

3. Timing chart

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Timing chart diagram (page 358)
Fig. 313 · 3. Timing chart
1. When numeric keys are pressed in the sequence of 1, 2, 3, 4, the content of D0 is 2,130. Numerical value more than 9,999 overflows sequentially from the upper digits. (The actual content of D0 is BIN data.)
2. When X002 is pressed, M12 is set (ON) until other key is pressed. It is the same when other key is pressed. Thus, depending on the operation of input X000 to X011, operation of M10 to M19 is carried out.
3. When any key is pressed, the key sense output M20 is kept ON while being pressed.
Page 359 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 359 · click to enlarge
Page 359

14 Applied Instructions (External FX I/O Device)

14.2 HKY / Hexadecimal Input

14.2 HKY / Hexadecimal Input

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This is a command for setting the input data of numerical value (0 to 9) or operation condition (function keys A to F), by the input of keys from 0 to F (16 keys). When the extension function is turned ON, the key input is entered in hexadecimal notation by keys 0 to F.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

HKY 16 bits Continuous HKY(EN, s, d1, d2, d3);

Applied Instructions (External FX I/O Device)

DHKY 32 bits Continuous DHKY(EN, s, d1, d2, d3);

Applied Instructions (External Device (optional device))

2. Set data

EN Execution condition Bit

Beginning device for entering 16 keys (X) (4 points occupied) ARRAY [0..3] OF Bit

ENO Execution state Bit

Beginning device for sending output (Y) (4 points occupied) ARRAY [0..3] OF Bit

Device for storing numerical value entered from 16 keys ANY16 ANY32

Beginning bit device for turning ON key pushing information (8 points occupied) ARRAY [0..7] OF Bit

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Floating Point)

z z z S2 S2 z z z

z z z S1 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 24 more labels / short text on this page
Instruction · name Operation Execution · form · HKY EN s · d1 d2 d3 · DHKY EN s · d1 d2 d3 · Data type · Variable Description · 16-bit operation · 32-bit operation · Input variable · Output variable · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant · z z · z z
Page 360 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 360 · click to enlarge
Page 360

14 Applied Instructions (External FX I/O Device)

14.2 HKY / Hexadecimal Input

Function and operation explanation

1. 16-bit operation(HKY) The numerical value scanned by the signals of the input for connecting 16 keys (0 to F) (device designated in

) and the row output (device designated in ) and by pressing keys 0 to 9 is stored in the device designated in , and the key sense output is issued to the device designated in . When any one of keys A to F is pressed, the key pushing information corresponding to the key (device designated in ) is turned ON, and the key sense output (device designated in ) is issued.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 360)
Fig. 314 · Function and operation explanation

Device for storing numerical value entered from 16 keys Beginning bit device for turning ON key pushing information

1. Numerical value input by keys 0 to 9 If more than 9,999, the value overflows from the higher digits. - The entered numerical value is stored in as BIN (binary) value. - The key sense output +7 is turned ON by pressing any one of keys 0 to 9.
2. Key pushing information of keys A to F - To turn ON 6 points from corresponding to any one of keys A to F.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 360)
Fig. 315 · Function and operation explanation

- The key sense output +6 is turned ON by pressing any one of keys A to F.

2. 32-bit operation(DHKY) The numerical value scanned by the signals of the input for connecting 16 keys (0 to F) (device designated in

) and the row output (device designated in ) and by pressing keys 0 to 9 is stored in the device designated in , and the key sense output is issued to the device designated in . When any one of keys A to F is pressed, the key pushing information corresponding to the key (device designated in ) is turned ON, and the key sense output (device designated in ) is issued.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 360)
Fig. 316 · Function and operation explanation

Device for storing numerical value entered from 16 keys

Beginning bit device for turning ON key pushing information

1. Numerical value input by keys 0 to 9 - If more than 99,999,999, the value overflows from the higher digits. - The entered numerical value is stored in ( +1, ) as BIN (binary) value. - The key sense output +7 is turned ON by pressing any one of keys 0 to 9.
2. Key pushing information of keys A to F As for the key pushing information, refer to the previous page on 16-bit operation (HKY).
Page 361 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 361 · click to enlarge
Page 361

14 Applied Instructions (External FX I/O Device)

14.2 HKY / Hexadecimal Input

Extension function

When the extension function is validated by turning ON the M8167, the hexadecimal key pushing data of 0 to F is stored in BIN. Except for the following, this is same as the "function and operation explanation" given above. FXU PLC: V2.30 or lower has no extension function.

1. 16-bit operation(HKY) Hexadecimal data entered by keys 0 to F is directly written into the device designated in .

Applied Instructions (High Speed Processing)

1. Numerical value input by keys 0 to F - If more than FFFF, the value overflows sequentially from the upper digits. - Example: In the case of input of 1 → 2 → 3 → B → F, "23BF" is stored in BIN in the device designated in . That is, 1 overflows at the time of input of F.

Applied Instructions (Handy Instruction)

M8167

HKY EN

Applied Instructions (External FX I/O Device)

Beginning device for entering 16 keys

Beginning device to be output

Device for storing numerical value entered from 16 keys

Beginning bit device for turning ON key pushing information

Applied Instructions (External Device (optional device))

2. 32-bit operation(DHKY) Hexadecimal data entered by keys 0 to F is directly written into the device designated in .
1. Numerical value input by keys 0 to F - If more than FFFFFFFF, the value overflows sequentially from the upper digits. - Example: In the case of input of 9 → 2 → 3 → B → F → A → F, "923BFAF" is stored in BIN.

M8167

DHKY EN

Applied Instructions (Data Transfer 2)

Beginning device for entering 16 keys

Beginning device to be output

Device for storing numerical value entered from 16 keys Beginning bit device for turning ON key pushing information

Applied Instructions (Floating Point)

Related devices

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

HEX data handling function of HKY command OFF : numeric key + function key ON : hexadecimal key

M8167 Function extension flag

OFFDuring scanning from to +3, or command not executed

ON : To be turned ON after one-cycle operation of to +3 output (key scan of 0 to F).

Applied Instructions (Positioning Control)

Show 7 more labels / short text on this page
Command input · s · Command input · s · Device Name Content · M8029 Command execution · complete
Page 362 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 362 · click to enlarge
Page 362

14 Applied Instructions (External FX I/O Device)

14.2 HKY / Hexadecimal Input

Cautions

1. Limit of number of times of use of command Only one of HKY command and DHKY command can be used in the program. If desired to use plural times, you can program by the index modifier (V, Z) function.
2. When keys are pressed simultaneously When plural keys are pressed, only the first pressed key is valid
3. When command contact is turned OFF If turned OFF, the content of is not changed, but all of to +7 are turned OFF.

4. Number of bits occupied 1) To occupy 4 points for connecting 16 keys from the beginning device of input (X). 2) To occupy 4 points for connecting 16 keys from the beginning device of output (Y). 3) To occupy 8 points from beginning device for output of key pushing information. Be careful not to overlap with the device used in control of the machine. - to +5 : Key pushing information of keys A to F - +6 : Key sense output of keys A to F. - +7 : Key sense output of keys 0 to 9

5. Intake timing of key input HKY and DHKY commands are executed simultaneously with the operation period of PLC. At the end of a series of key scan, a time of 8 scans is needed. To prevent intake error due to filter delay of key input, you can utilize the function of "constant scan mode" or "timer interruption."
6. Output format Select and use the PLC of transistor output type.
7. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

Program examples

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 362)
Fig. 317 · Program examples

The wiring diagram below is an example of basic unit (sync input/sync output) of FX3U series. For the actual wiring connection, see the manual of the PLC.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 362)
Fig. 318 · Program examples
Page 363 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 363 · click to enlarge
Page 363

14 Applied Instructions (External FX I/O Device)

14.3 DSW / Digital Switch (Thumbwheel Input)

14.3 DSW / Digital Switch (Thumbwheel Input)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This is a command for reading in the set value of digital switch. You can read in the data of 4 digits and 1 set (n=K1), or 4 digits and 2 sets (n=K2).

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DSW EN s n

DSW 16 bits Continuous DSW(EN, s, n, d1, d2);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Beginning device for connecting digital switch (X) (4 points occupied) Bit

Number of sets of digital switch (4 digits/1 set) [n=1 or 2] ANY16

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Beginning device of output of strobe signal (Y) (4 points occupied) ARRAY [0..3] OF Bit

Device for storing numerical value of digital switch (n points occupied) ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Data Transfer 2)

z z z S1 S2 z z z

S: Refer to "Cautions".

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 18 more labels / short text on this page
Instruction · name Operation Execution · form · d1 d2 · Input variable · Output variable · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant · z z · z z · z z
Page 364 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Number of bits occupied
Page 364 · click to enlarge
Page 364

14 Applied Instructions (External FX I/O Device)

14.3 DSW / Digital Switch (Thumbwheel Input)

Function and operation explanation

1. 16-bit operation(DSW) The value of digital switch connected to the device designated in is processed by time division (entered sequentially from the first digit by output signals at 100 ms intervals), and stored in the device designated in
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 364)
Fig. 319 · Function and operation explanation

d2 Device for storing the numerical value of digital switch

1. Data - You can read up to 4 digits from 0 to 9,999. - Data is stored in BIN (binary value).

- First set is stored in , and second set in +1.

2) Designation of number of sets n - When using 4 digits and 1 set × 1 (n=K1) Digital switch of 4 digits in BCD connected to to +3 is sequentially read in by strobe signals to +3, and stored in as BIN value. - When using 4 digits and 1 set × 2 (n=K2) Digital switch of 4 digits in BCD connected to to +3 is sequentially read in by strobe signals to +3, and stored in as BIN value.

- Digital switch of 4 digits in BCD connected to +4 to +7 is sequentially read in by strobe signals to +3, and stored in +1 as BIN value.

Related devices

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

OFF : Scan continuous or command not executed from to +3.

ONON after one-cycle operation of to +3 output (scan of 1 to 4 digits)

Cautions

1. When command contact is turned OFF If turned OFF, the content of is not changed, but all of to +3 are turned OFF.

2. Number of bits occupied

1. When 4 digits and 2 sets (n=K2) are used, 2 points are occupied from .
2. occupies 4 points in the case of 4 digits and 1 set, and occupies 8 points in the case of 4 digits and 2 sets.
3. When connecting a digital switch of less than 4 digits The wiring of strobe signal is not needed in the digit not in use, but the output for digit not in use is occupied by this command, and cannot be used in other application. The output not in use must be always kept vacant.
4. We recommend to use the transistor output type. To take in the values of digital switch continuously, you must use the PLC of transistor output.

→ As for the relay output type, refer to the "Method of using by relay output type" shown later.

5. Digital switch Use the digital switch of BCD output.
6. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Device Name Content · M8029 Command execution · complete

Page 365 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y013
Page 365 · click to enlarge
Page 365

14 Applied Instructions (External FX I/O Device)

14.3 DSW / Digital Switch (Thumbwheel Input)

Program examples

This is an example of explaining connection of digital switch starting from the input X010 and starting from the digit designation output Y010.

1. Program

DSW(X000, X10, K1, Y10, D0); [Structured ladder/FBD] [ST]

Applied Instructions (High Speed Processing)

X000 DSW EN s n

d1 d2 X10 Y10

D0 K1

2. Wiring diagram This wiring connection diagram is an example of basic unit of FX 3U series (sync input/sync output). As for the actual wiring, see the manual of the PLC.

Applied Instructions (Handy Instruction)

103 102 101 100

103 102 101 100 Digital switch of BCD

Applied Instructions (External FX I/O Device)

Digital switch of BCD

Diode of 0.1 A, 50 V is needed.

4 3 2 1 To second set 8 4 2 1

Applied Instructions (External Device (optional device))

1 2 4 8

Second set input 24V 0V

S/S X010 X011 X012 X013 X015 X014 X016 X017

PLC

COM3 Y010 Y011 Y012 Y013

103 102 101 100

3. Timing chart

Applied Instructions (Data Transfer 2)

Repeated operation 0.1 sec 0.1 sec 0.1 sec

Y010

Y011

0.1 sec

Y012

0.1 sec

Y013

0.1 sec

Applied Instructions (Floating Point)

Y010 to Y013 are turned ON sequentially in every 100 ms while X000 is being turned ON, and when operation of one cycle is over, the execution complete flag M8029 is set up.

Applied Instructions (Positioning Control)

Show 4 more labels / short text on this page
To second set · First set input · Interrupt · M8029 Complete flag
Page 366 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — X010 Y010
Page 366 · click to enlarge
Page 366

14 Applied Instructions (External FX I/O Device)

14.3 DSW / Digital Switch (Thumbwheel Input)

4. Method of using by relay output type You can also use the relay output type PLC by providing with "digital switch reading input." When pushbutton (X000) is pressed, the DSW performs a series of operations. In the case of this program, if Y010 to Y013 are relay outputs, there is no problem in relay contact life.

[ST]

LDP EN ENO s X000

SET EN ENO

SET(LDP(TRUE, X000), M0); DSW(M0, X010, K1, Y010, D0); RST(M8029, M0);

M0

DSW EN s n

X010 Y010

D0 K1

M8029

RST EN ENO

M0

1. DSW is operating while the M0 (digital switch reading input) is being ON.
2. DSW continues to operate until operation of one cycle is over and execution complete flag (M8029) is set up.

[Structured ladder/FBD] · d M0 · d1 d2

Page 367 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 367 · click to enlarge
Page 367

14 Applied Instructions (External FX I/O Device)

14.4 SEGD / Seven Segment Decoder

14.4 SEGD / Seven Segment Decoder

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This is a command for lighting up the 7-segement display unit (1 digit) by decoding the data.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

SEGD 16 bits Continuous SEGD(EN, s, d);

SEGDP 16 bits Pulse SEGDP(EN, s, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Beginning word device to be decoded ANY16

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Word device for storing 7-segment display data ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S1 z

z S1 S1 z z z

S: Refer to "Cautions".

Applied Instructions (Data Transfer 2)

Function and operation explanation

1. 16-bit operation(SEGD, SEGDP) 0 to F (hexadecimal) of lower 4 bits (1 digit) of the device designated in are decoded into 7-segment display data, and stored in lower 8 bits of the device designated in .

Applied Instructions (Floating Point)

Command input SEGD EN s

d Word device for storing 7-segment display data Beginning word device to be decoded

Applied Instructions (Positioning Control)

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · SEGD EN s · SEGDP EN s · Input variable · Output variable · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant
Page 368 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 368 · click to enlarge
Page 368

14 Applied Instructions (External FX I/O Device)

14.4 SEGD / Seven Segment Decoder

2. 7-segement decoding table

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 7-segement decoding table diagram (page 368)
Fig. 320 · 2. 7-segement decoding table
  • segments Display data Hexadecimal b3 b2 b1 b0 B15
  • B8 B7 B6 B5 B4 B3 B2 B1 B0

0 - - 0 0 1

1 0 0 0 1 - - 0 1 1 0

2 0 0 1 0 - - 0 1 0 1 1 0 1 1

3 0 0 1 1 - - 0 1 0 0 1

4 0 1 0 0 - - 0 1 1 0 0 1 1 0

5 0 1 0 1 - - 0 1 1 0 1 1 0 1

6 0 1 1 0 - - 0 1 0 1

7 0 1 1 1 - - 0 0 1 0 0 1 1 1

8 1 0 0 0 - - 0 1

9 1 0 0 1 - - 0 1 1 0 1

A 1 0 1 0 - - 0 1 1 1 0 1 1 1

B 1 0 1 1 - - 0 1 0 0

C 1 1 0 0 - - 0 0 1 1 1 0 0 1

E 1 1 1 0 - - 0 1 0 0 1

F 1 - - 0 1 1 1 0 0 0 1

B0 is the beginning of bit device or the lowest bit of the word device.

Cautions

1. Number of bits occupied Lower 8 bits from the output of the device designated in are occupied, and the upper 8 bits are not changed.
2. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.
Page 369 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 369 · click to enlarge
Page 369

14 Applied Instructions (External FX I/O Device)

14.5 SEGL / Seven Segment With Latch

14.5 SEGL / Seven Segment With Latch

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This is a command for controlling the 7-segment display unit with latch of 4 digits and 1 set or 4 digits and 2 sets.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

SEGL EN s n

SEGL 16 bits Continuous SEGL(EN, s, n, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

  • Beginning word device for BCD conversion
  • n=K(H)0 to K(H)3: 1 point occupied
  • n=K(H)4 to K(H)7: 2 points occupied

ANY16

Applied Instructions (External Device (optional device))

ENO Execution state Bit

  • Beginning device to be output (Y)
  • n=K(H)0 to K(H)3: 8 points occupied
  • n=K(H)4 to K(H)7: 12 points occupied

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

Applied Instructions (Data Transfer 2)

S: Refer to "Cautions".

Function and operation explanation

Applied Instructions (Floating Point)

1. 16-bit operation(SEGL) The 4-digit numerical value of the device designated in is converted into BCD data, and is sequentially divided in time digit by digit, and is sent into the 7-segment display unit with BCD decoder.

Command input SEGL EN

d Word device for BCD operation

Beginning device to be output (Y)

Applied Instructions (Positioning Control)

Show 21 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Parameter ANY16 · Output variable · Bit · Operand · Special · unit Index Cons · Real number · Character · string Pointer · type · user · tant · z z · z z · s · Parameter · n
Page 370 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — When using 4 digits and 2 sets(n=K4 to K7)
Page 370 · click to enlarge
Page 370

14 Applied Instructions (External FX I/O Device)

14.5 SEGL / Seven Segment With Latch

When using 4 digits and 1 set(n=K0 to K3)

→ As for selection of "n", refer to section 14.5.2.

1. Data and strobe signal The 4-digit numerical value of is converted from BIN to BCD, and is issued sequentially by time division digit by digit from to +3. The strobe signal output ( +4 to +7) is also issued sequentially by time division, and the 7segment display of 4 digits and 1 set is latched.
2. In , BIN data in a range of 0 to 9,999 is valid.
3. Connection example of 7-segment display unit The following diagram show an example of FX 3U series basic unit (sync output). As for the actual wiring, see the manual of the PLC.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — When using 4 digits and 1 set(n=K0 to K3) diagram (page 370)
Fig. 321 · When using 4 digits and 1 set(n=K0 to K3)

d +2 d +1 d d COM +6 d +5 d +4 d +7 d

When using 4 digits and 2 sets(n=K4 to K7)

→ As for selection of "n", refer to section 14.5.2.

1. Data and strobe signal a) 4 digits, first set

The 4-digit numerical value of is converted from BIN to BCD, and is issued sequentially by time division digit by digit from to +3. The strobe signal output ( +4 to +7} is also issued sequentially by time division, and the 7- segment display of 4 digits and 1 set is latched. b) 4 digits, second set

The 4-digit numerical value of +1 is converted from BIN to BCD, and is issued sequentially by time division digit by digit from +10 to +13. The strobe signal output ( +4 to +7) is also issued sequentially by time division, and the 7- segment display of 4 digits and 2 sets is latched. (The strobe signal output ( +4 to +7) is common in each set.)

2. In and +1, BIN data in a range of 0 to 9,999 is valid.
Page 371 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 371 · click to enlarge
Page 371

14 Applied Instructions (External FX I/O Device)

14.5 SEGL / Seven Segment With Latch

3. Connection example of 7-segment display unit The following diagram show an example of FX 3U series basic unit (sync output). As for the actual wiring, see the manual of the PLC.

Applied Instructions (High Speed Processing)

+3 d +2 d +1 d d COM +6 d +5 d +4 d +7 d

COM +13 d +12 d +11 d +10 d

100 4 2 8 1

101 102 103

4 2 8 1

103 102 101 100

103 102 101 100

Applied Instructions (Handy Instruction)

V+

V+ 1 2 4 8

1 2 4 8

Applied Instructions (External FX I/O Device)

Related devices

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.

complete To be turned ON when output of 4 digits is over.

Applied Instructions (External Device (optional device))

Cautions

1. Time for updating 7-segement 4-digit display The time for updating the display of 4 digits (1 set or 2 sets) is required by 12 times of the scan time (operation time).
2. Operation when command input is turned OFF While the command input is ON, the operation is repeated, but once the command contact is turned OFF during operation, the operation is interrupted, and when turned ON again, the operation is resumed from the beginning.

3. Number of bits occupied When using 4 digits and 1 set : 1 point is occupied from the beginning device designated in . 8 points are occupied from the beginning device designated in . If the number of digits is smaller, the remainder cannot be used in other application. When using 4 digits and 2 sets: 2 points are occupied from the beginning device designated in . 12 points are occupied from the beginning device designated in . If the number of digits is smaller, the remainder cannot be used in other application.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

4. Scan time (operation period) and display timing SEGL command is executed in synchronism with the scan time (operation period) of the PLC. For a series of display, the scan time of the PLC is required by 10 ms or more. If less than 10 ms, you can operate in the scan time of 10 ms or more by using the constant scan mode.
5. Output format of PLC Use the PLC of transistor output type.
6. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

Show 5 more labels / short text on this page
PLC (transistor output) · First set · Second set · Device Name Content · M8029 Command execution
Page 372 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 14.5.2 Selection procedure of parameter n by specification of 7-segment display
Page 372 · click to enlarge
Page 372

14 Applied Instructions (External FX I/O Device)

14.5 SEGL / Seven Segment With Latch

14.5.1 Selection procedure of 7-segment display unit

You can select the 7-segment display unit depending on the electrical content by referring to the example below.

→ As for the actual wiring, see the hardware manual of the PLC main body.

1. Check points by 7-segment specification

1. Check if the data input, and input voltage and current characteristics of strobe signal are satisfying the output specification of the PLC or not. - Check if the input signal voltage (Lo) is about 1.5 V or less. - Check if the input voltage is DC 5 V to DC 30 V.
2. Check if the BCD decoding or latching function is provided or not.

14.5.2 Selection procedure of parameter n by specification of 7-segment display

The value to be set in parameter n varies with the signal logic of 7-segment display. Select in the following procedure. A check column is provided in the final line of the table. Check the corresponding positive or negative logic, and select the parameter accordingly.

1. Role of parameter n Parameter n is a number selected depending on the logic (positive or negative) of 7-segment data input, the logic (positive or negative) of strobe signal, or control of 4 digits and 1 set or control of 2 sets.
2. Check the output logic of the PLC The transistor output of the PLC is available in two types, sync output and source output. The specification is different as shown below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 14.5.2 Selection procedure of parameter n by specification of 7-segment display diagram (page 372)
Fig. 322 · 14.5.2 Selection procedure of parameter n by specifi…

Output format Sync output [- common] Source output [+ common]

Because of transistor output (sync), when the internal logic is 1 (ON output), the output is LOW level (0V). This is called the negative logic.

Because of transistor output (source), when the internal logic is 1 (ON output), the output is HIGH level (V+). This is called the positive logic.

3. Check the logic of the 7-segment display unit.
1. Data input
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 14.5.2 Selection procedure of parameter n by specification of 7-segment display diagram (page 372)
Fig. 323 · 14.5.2 Selection procedure of parameter n by specifi…

Explanation Becoming BCD data at LOW level Becoming BCD data at HIGH level

Page 373 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — H
Page 373 · click to enlarge
Page 373

14 Applied Instructions (External FX I/O Device)

14.5 SEGL / Seven Segment With Latch

2. Strobe signal

Logic Negative logic Positive logic

H

H

Applied Instructions (High Speed Processing)

H L H L +4 to

H +4 to H

Explanation Data latched at LOW level is held Data latched at HIGH level is held

Applied Instructions (Handy Instruction)

4. Selection of parameter n Select by referring to the table below depending on the positive or negative logic of the PLC side, and the positive or negative logic of the 7-segment display side.

PLC output logic Data input Strobe signal

4 digits × 1 set 4 digits × 2 sets

Applied Instructions (External FX I/O Device)

Negative logic (coinciding) 0 4

Positive logic (not coinciding) 1 5

Negative logic (coinciding) 2 6

Positive logic (not coinciding)

Positive logic (not coinciding) 3 7

Positive logic (coinciding) 0 4

Negative logic (not coinciding) 1 5

Positive logic (coinciding) 2 6

Applied Instructions (External Device (optional device))

Negative logic (not coinciding)

Negative logic (not coinciding) 3 7

5. Explanation of selection method of parameter n by exemplary cases When the following 7-segment display is connected, n=1 in the case of 4 digits × 1 set, and n=5 in the case of 4 digits × 2 sets.
1. Transistor output of PLC - Sync output = negative logic - Source output = positive logic
2. 7-segment display - Data input = negative logic - Strobe signal = positive logic

Applied Instructions (Data Transfer 2)

PLC output logic Data input Strobe signal

4 digits × 1 set 4 digits × 2 sets

Negative logic (coinciding) 0 4

Positive logic (not coinciding) 1 5

Negative logic (coinciding) 2 6

Positive logic (not coinciding)

Applied Instructions (Floating Point)

Positive logic (not coinciding) 3 7

Applied Instructions (Positioning Control)

Show 20 more labels / short text on this page
8 +3 · +3 · Timing chart · d d +7 · d d +7 · Strobe display change · Strobe display change · None None · None None · Latch · Latch · Logic check · Parameter n · Negative logic (coinciding) · Negative logic · Positive logic (coinciding) · Positive logic · Parameter n · Negative logic (coinciding) · Negative logic
Page 374 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 374 · click to enlarge
Page 374

14 Applied Instructions (External FX I/O Device)

14.6 ARWS / Arrow Switch

14.6 ARWS / Arrow Switch

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction enters data by arrow switches for digit move and increase and decrease of numerical value of each digit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 374)
Fig. 324 · 1. Format and operation, execution form

ARWS 16 bits Continuous ARWS(EN, s, n, d1, d2);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 374)
Fig. 325 · 2. Set data

Head bit device to be entered (4 points occupied) ARRAY [0..3] OF Bit

Word device in which BCD converted data is stored ANY16

Head bit device (Y) for connecting 7-segment display unit (8 points occupied) ARRAY [0..7] OF Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 374)
Fig. 326 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z z z S2 S2 z z z

S: Refer to "Cautions".

Function and operation explanation

Four arrow switches are connected to the input of the device specified by , the 7-segment display unit with BCD decoder is connected to the output of the device specified by , and the numeric value is entered in the device specified by .

1. 16-bit operation (ARWS) In the device specified by , 16-bit BIN value of 0 to 9,999 is stored, but for the convenience of explanation, BCD converted value is expressed. When the command input is ON, then ARWS instruction operates as follows.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 374)
Fig. 327 · Function and operation explanation

Word device in which BCD converted data is stored

Page 375 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Content of display and operation unit
Page 375 · click to enlarge
Page 375

14 Applied Instructions (External FX I/O Device)

14.6 ARWS / Arrow Switch

Content of display and operation unit

100 101 102 103

Applied Instructions (High Speed Processing)

Display for selected digit

7-segment display unit 7-segment display unit with latch for visual display of numeric value being set

Applied Instructions (Handy Instruction)

Numeric value output Switch

Applied Instructions (External FX I/O Device)

Carry over Carry down

Applied Instructions (External Device (optional device))

Arrow switch (arrow-mark switch) A switch for selecting each digit and increasing or decreasing the numeric value of selected digit.

1. Digit specification n of 7-segment display unit with BCD decoder In the following explanation of operation, four digits (10 3 digits) are supposed.
2. Operation of digit select switch ( +2, +3)

- Operation when carry-down switch +2 is ON Every time the switch is pressed, the digit specification changes in the sequence of 103 → 102 → 101 → 100 → 103.

- When carry-over switch +3 is ON Every time the switch is pressed, the digit specification changes in the sequence of 103 →100 → 101 → 102 → 103.

Applied Instructions (Data Transfer 2)

3. Operation of LED for selected digit display ( +4 to +7) The specified digit is displayed by LED by strobe signals +4 to +7.

4) Operation of data change switch of digit unit ( , +1) Data changes in the digit specified by the "digit select switch." - Operation when increment input is ON Every time the switch is pressed, the content of changes in the sequence of 0 → 1 → 2 → ... → 8 → 9 → 0 → 1. - Operation when decrement input is ON Every time the switch is pressed, the content of changes in the sequence of 0 → 9 → 8 → 7 ... → 1 → 0 → 9. The content can be displayed in 7-segment display unit. Thus, by a series of operations, desired numeric values can be written into while observing the 7- segment display unit.

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 29 more labels / short text on this page
Display, operation panel · +7 · Strobe output · +6 · To PLC · +5 · output · +4 · +3 · Increment · +2 · To PLC · output · +1 · s · +1 · s · +3 · s s · +2 +3 · s · s · +2 · To PLC · input · s · +1 · Decrement · s
Page 376 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 376 · click to enlarge
Page 376

14 Applied Instructions (External FX I/O Device)

14.6 ARWS / Arrow Switch

Cautions

1. Setting of parameter n Refer to the parameter setting of SEGL instruction. However, the setting range is 0 to 3.
2. Output format of PLC Use the PLC of transistor output type.
3. Scan time (operation period) and display timing ARWS instruction is executed in synchronism with the scan time (operation cycle) of the PLC. To execute a series of displays, 10 ms or more is needed in the scan time of the PLC. If less than 10 ms, you must use the constant scan mode and operate in scan time of 10 ms or more.

4. Number of bits occupied in device

1. The input of the device specified by occupies 4 bits.
2. The output of the device specified by occupies 8 bits.
5. Limit of times of use of instruction ARWS instruction can be used only once in the program. When using this instruction two or more times, use index function to program.
6. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

Program example

1. When changing the timer setting and displaying the current value

1. Specify the timer number by 3-digit digital switch
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 376)
Fig. 328 · Program example
2. Setting of constant value of timer by arrow switch
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 376)
Fig. 329 · Program example

Operation explanation Every time read/write key is pressed, the read and write LED is changed over and displayed.

  • When reading out Press the setting switch (X003) after setting the timer number by digital switch.
Page 377 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 14.6 ARWS / Arrow Switch
Page 377 · click to enlarge
Page 377
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 14.6 ARWS / Arrow Switch diagram (page 377)
Fig. 330 · 14.6 ARWS / Arrow Switch
  • When writing in Press the X003 by setting the numeric value while observing the 7-segment display by the arrow switch.

M0:= X000; M1:= X001; M2:= X002; M3:= NOT M8000; ALTP(X004, M100); Y014:= NOT M100; Y015:= M100; DSW(Y014 AND X003, X010, K1, Y010, Z); SEGL(Y014, T0Z, K1, Y000); MOVP(Y015, D300Z, D511); ARWS(Y015, M0, K1, D511, Y000); MOVP(Y015 AND X003, D511, D300Z);

4 digits, 1 set TOZ → 7-segment negative logic

(M0 to M3) → (D511) → (Y000 to Y007) → 7-segment 1 digit, 1 set

Page 378 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 44 (D) 43 (C) +1
Page 378 · click to enlarge
Page 378

14 Applied Instructions (External FX I/O Device)

14.7 ASC / ASCII Code Data Input

14.7 ASC / ASCII Code Data Input

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the 1-byte alphanumeric character string into ASCII code. This is used when selecting and displaying plural messages in the external display unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 378)
Fig. 331 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 378)
Fig. 332 · 2. Set data

1-byte alphanumerics of 8 characters entered from personal computer String(8)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 378)
Fig. 333 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation (ASC) 1-byte alphanumeric character string specified by is converted into ASCII code, and transferred sequentially to the device specified by .
  • In the device specified by , 1-byte characters of A to Z, 0 to 9, and symbols can be handled. (2-byte characters cannot be handled.) By the programming tool, the character string is entered when programming.
  • In the device specified by , converted ASCII code is stored by 2 characters/1 byte each in the sequence of lower 8 bits and higher 8 bits.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 378)
Fig. 334 · Function and operation explanation

Higher 8 bits Lower 8 bits

42 (B) 41 (A)

d 1-byte alphanumerics of 8 characters entered from personal computer

44 (D) 43 (C) +1

46 (F) 45 (E)

48 (H) 47 (G)

+2 · +3

Page 379 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 379 · click to enlarge
Page 379

14 Applied Instructions (External FX I/O Device)

14.7 ASC / ASCII Code Data Input

Extension function

When the extension function is validated by turning ON M8161, the 1-byte alphanumeric character string of the device specified by is converted into ASCII code, and sequentially transferred into the device specified by only in the lower 8 bits (1 byte). The extension function is not available when FXU PLC is V2.30 or earlier.

Applied Instructions (High Speed Processing)

M8161

d 1-byte alphanumerics of 8 characters entered from personal computer

Head device for storing ASCII code

ExampleABCDEFGH

M8000

M8161

Applied Instructions (Handy Instruction)

Higher 8 bits are H00.

Higher 8 bits Lower 8 bits Character string

00 41 A

Applied Instructions (External FX I/O Device)

+1 00 42 B

+2 00 43 C

+4 00 45 E

+5 00 46 F

+6 00 47 G

Applied Instructions (External Device (optional device))

+7 00 48 H

Related devices

8-bit processing mode of ASC, RS, ASCI, HEX, CCD instruction OFF : Every 2 characters are stored in the sequence of lower 8 bits, higher 8 bits (2 characters/

M8161 Function extension flag

word). ON : Characters are stored in lower 8 bits character by character (1 character/word).

Cautions

1. Number of bits occupied in device

Applied Instructions (Data Transfer 2)

1. When extension function is OFF

- The device specified by occpies 4 bits.

2. When extension function is ON

- The device specified by occpies 8 bits.

Applied Instructions (Floating Point)

2. Number of input characters The number of characters input to the device specified by is fixed in 8 digit. When ASCII code (7 characters or less) is input, the space (H20) is stored in the remaining device specified by .
3. When using RS, ASCI, HEX, CCD The extension function flag M8161 is a common flag used in other instructions. When above instructions are used together with ASC instruction, you must execute the program of turning ON or OFF the M8161 immediately before the ASC instruction so as to avoid its effect.
4. Object devices are limited. S 1: FX 3U , FX 3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

Command input · ASC EN s · Device Name Content

Page 380 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — A(H41) B(H42) C(H43) D(H44) E(H45) F(H46) G(H47) H(H48)
Page 380 · click to enlarge
Page 380

14 Applied Instructions (External FX I/O Device)

14.8 PR / Print (ASCII Code)

14.8 PR / Print (ASCII Code)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction performs parallel output of ASCII code data to the output (Y).

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 380)
Fig. 335 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 380)
Fig. 336 · 2. Set data

Head device for storing data of ASCII code. String

Head device for output data of ASCII code. Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 380)
Fig. 337 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation (PR) ASCII code stored in lower 8 bits (1 byte) of to +7 is issued to to +7 sequentially in time division character by character.

Command input PR EN s

d Head device for storing data of ASCII code.

Head device for output data of ASCII code.

The following timing chart explains the ASCII code stored in the device specified by . The transmission sequence begins from ="A", and ends with +7="H", and 8 bytes are transmitted in total.

+1 +2 +3 +4 +5 +6 +7

A(H41) B(H42) C(H43) D(H44) E(H45) F(H46) G(H47) H(H48)

Page 381 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — LG
Page 381 · click to enlarge
Page 381

14 Applied Instructions (External FX I/O Device)

14.8 PR / Print (ASCII Code)

2. Timing chart

s1

+1 +2 +3 +7

to +7 Data d d

A B C D H

Applied Instructions (High Speed Processing)

T0: Scan time (ms)

+9 Execution busy flag

Applied Instructions (Handy Instruction)

Type of output signal

  • to +7 : Transmission output is the lower bit side, and +7 is the higher bit side.
  • +8 : Strobe signal
  • +9 : Execution busy flag Operation conforms to the timing chart above.

Applied Instructions (External FX I/O Device)

Extension function

1. 16-byte serial output By ON/OFF control of special auxiliary relay M8027, the number of characters of output varies in every two times of instruction drive. In the case of M8027=OFF, the operation is 8-byte serial output (fixed in 8 characters), and in the case of M8027=ON, it is 16-byte serial output (1 to 16 characters). An example of display of 16 characters or less (1 character/byte) is explained by referring to a display device (example: A6FD type external display unit*1). The display data is supposed to be stored in hexadecimal code in D300 to D307.

Applied Instructions (External Device (optional device))

1. A6FD type external display unit *1 connection example The PLC shown below is an example of FX 2N -16EYT (sink output) connected to FX 3U -32M .

PLC

Y033 COM1 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027 COM2 Y030

Y031 Y032

Applied Instructions (Data Transfer 2)

NC

AC100/200V

COM

D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7

STR

AC AC

Applied Instructions (Floating Point)

A6FD type external display unit *1

LG

*1. A6FD type external display unit is out of production since November 2002.

Applied Instructions (Positioning Control)

Command input · +8 Strobe · ~

Page 382 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 382 · click to enlarge
Page 382

14 Applied Instructions (External FX I/O Device)

14.8 PR / Print (ASCII Code)

2. Timing chart (When M8027=ON)
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 14.8 PR / Print (ASCII Code) diagram (page 382)
Fig. 338 · 14.8 PR / Print (ASCII Code)
T T T TOperation cycle or interrupt time

* If H00 (NUL code) exists in the data (in 16 characters), one character before H00 (NUL code) is the end character.

Related devices

M8027*1 PR mode OFF : 8-byte serial output (fixed in 8 characters) ON : 16-byte serial output (1 to 16 characters)

*1. Cleared when changed from RUN to STOP.

Cautions

1. Command input and operation of instruction Command input=ON : Even in the midst of continuous ON or pulse instruction execution, when the output of

one cycle is over, the execution is terminated. M8029 operates only when M8027=ON. Command input=OFF:All outputs are OFF.

2. Relation with scan time (operation time) This instruction is executed in synchronism with the scan time. If the scan time is short, it is driven by constant scan mode, or if too long, it is driven by using the timer interrupt mode.
3. Output of PLC Use the transistor output for the output of the PLC.
4. If 00H (NUL) exists in the data (when M8027=ON) The instruction execution is completed, and the remaining data is not issued. M8029 remains ON during 1 operation cycle.
5. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

Device Name Content

Page 383 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Set data
Page 383 · click to enlarge
Page 383

14 Applied Instructions (External FX I/O Device)

14.9 FROM / Read From A Special Function Block

14.9 FROM / Read From A Special Function Block

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction reads out the content of buffer memory (BFM) of special extension unit/block to the PLC. If a large quantity of buffer memory (BFM) data is read out in batch by using this instruction, a watchdog timer error may occur. When there is no bad influence for the control if the data is divided and read out, you can use RBFM instruction.

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

FROM EN n1 n2

FROM 16 bits Continuous FROM(EN, n1, n2, n3, d);

Applied Instructions (External FX I/O Device)

FROMP EN n1 n2

FROMP 16 bits Pulse FROMP(EN, n1, n2, n3, d);

Applied Instructions (External Device (optional device))

DFROM EN n1 n2

DFROM 32 bits Continuous DFROM(EN, n1, n2, n3, d);

DFROMP EN n1 n2

DFROMP 32 bits Pulse DFROMP(EN, n1, n2, n3, d);

Applied Instructions (Data Transfer 2)

2. Set data

EN Execution condition Bit

Applied Instructions (Floating Point)

Unit No. of special extension unit/block ANY16 ANY32*1

Transfer origin buffer memory (BFM) number ANY16 ANY32*1

Number of transfer points ANY16 ANY32*1

ENO Execution state Bit

  • Transfer destination device
  • 16-bit operation: n 3 points occupied
  • 32-bit operation: 2 × n 3 points occupied ANY16 ANY32

*1. In the case of FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC series, the data type of DFROM, DFROMP of 32-bit operation is ANY16.

Applied Instructions (Positioning Control)

Show 13 more labels / short text on this page
Instruction · name Operation Execution · form · n3 · n3 · n3 · n3 · Data type · Variable Description · 16-bit operation · 32-bit operation · Input variable · Variable
Page 384 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 384 · click to enlarge
Page 384

14 Applied Instructions (External FX I/O Device)

14.9 FROM / Read From A Special Function Block

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System user Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S1 z z

S1 S1 z z

S1 S1 z z

z S1 z z z

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation (FROM, FROMP) → As for the common terms of FROM/TO instruction, refer to section 14.8.1.

From special extension (BFM) to PLC (word device) 16-bit data of n3 points starting from buffer memory (BFM) n2 in the special extension unit/block of unit number n1 is transferred (read out) by the portion of n3 points starting from the device specified by in the PLC.

Command input FROM EN

Transfer destination device Unit No. of special extension unit/block Transfer origin buffer memory (BFM) number

Number of transfer points

2. 32-bit operation (DFROM, DFROMP)

From special extension (BFM) to PLC (word device) 32-bit data of n3 points starting from buffer memory (BFM) [n2+1, n2] in the special extension unit/block of unit number n1 is transferred (read out) by the portion of n3 points starting from the device specified by in the PLC.

Command input DFROM EN

Transfer destination device Unit No. of special extension unit/block Transfer origin buffer memory (BFM) number

Number of transfer points

Related devices

Prohibit/permit interruption during execution of FROM/TO instruction.

→ As for the detail, refer to the following pages "Interrupt accept during

M8028 Interrupt permit flag

execution of FROM/TO (M8028)." OFFInterrupt prohibit (interrupt executed after FROM/TO instruction process) ON : Interrupt permit
Show 14 more labels / short text on this page
Operand · unit Index Cons · Real Number · Character · tant · String Pointer · type · n1 · n2 · n3 · n1 · n2 · n3 · Device Name Content
Page 385 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — U0¥G0
Page 385 · click to enlarge
Page 385

14 Applied Instructions (External FX I/O Device)

14.9 FROM / Read From A Special Function Block

Cautions

1. Bit device digits to be specified by should be K1 to K4 in the case of 16-bit operation instruction, and K1 to K8 in the case of 32-bit operation.
2. The instruction is provided in the FX U PLC Ver. 2.10 or later.
3. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.

Applied Instructions (High Speed Processing)

4. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. Program example

By using direct specification*1 of FROM instruction or buffer memory, you can transfer (read out) the content of buffer memory (BFM) of special extension unit/block to the digit specification of data register (D), extension register (R), or auxiliary relay (M).

Applied Instructions (Handy Instruction)

*1. FX3U, FX3UC PLCs only are available. Example) Program for reading out BFM#4 (abnormal station information) of CC-Link/LT master (unit No. 0

fixed) built in FX3UC-32MT-LT(-2) to D0. - In the case of FROM instruction

Applied Instructions (External FX I/O Device)

X001 FROM EN n1 n2

FROM(X001, K0, K4, K1, D0);

K0 K4

K1

Applied Instructions (External Device (optional device))

Number of transfer points

BFM #4 Unit No. 0

- In the case of MOV instruction

M8000

MOV(M8000, U0¥G4, D0);

U0¥G4

Unit No. 0 BFM #4

Program for reading out BFM#0 to #3 (remote station connection information) of CC-Link/LT master (unit No. 0 fixed) built in FX3UC-32MT-LT(-2) to D10 to D13. - In the case of FROM instruction

Applied Instructions (Data Transfer 2)

[ST]

M0

FROMP EN n1 n2

FROMP(M0, K0, K0, K4, D10);

K0 K0

Applied Instructions (Floating Point)

K4

Number of transfer points

BFM #0

Unit No. 0

- In the case of BMOV instruction

BMOV(M0, U0¥G0, K4, D10);

M0 BMOV EN s n

U0¥G0

K4

Applied Instructions (Positioning Control)

Number of transfer points

Unit No. 0 BFM #0

Show 7 more labels / short text on this page
n3 Transfer destination · MOV EN s · Transfer destination · [Structured ladder/FBD] · n3 · Transfer destination · Transfer destination
Page 386 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Interrupt accept during execution of FROM/TO (M8028)
Page 386 · click to enlarge
Page 386

14 Applied Instructions (External FX I/O Device)

14.9 FROM / Read From A Special Function Block

14.9.1 Common terms of FROM/TO instruction (detail)

Specification content of operand

1. Unit number n1 of special extension unit/block Unit number is used for specifying which equipment is the object of working for FROM/TO instruction. Setting range: K0 to K7

Unit No. 0 built-in CC-Link/LT

Unit No. 1

Unit No. 2

Unit No. 3

FX 3UC -32MT -LT(-2)

The unit number is assigned automatically to the special extension unit/block connected to the PLC. The unit number is given from the one closest to the basic unit in the sequence of No. 0, No. 1, No.2, etc. In the case of the FX3UC-32MT-LT(-2) PLC, since the CC-Link/LT master is built in, the unit number is given from the one closest to the basic unit in the sequence of No. 1, No.2, No. 3, etc.

2. Buffer memory (BFM) number "n2" In the special extension unit/block, 16-bit RAM is built in, and it is used as the buffer memory. The buffer memory numbers are #0 to #32766, and the content is determined depending on the control purpose of each equipment. Setting range: K0 to K32766
  • When BFM is handled in 32-bit instruction, the specified BFM is lower 16 bits, and the BFM of the next number is higher 16 bits.

BFM #10 BFM #9 Lower 16 bits Higher 16 bits

Specified BFM number ←

3. Transfer points "n3" Setting range: K1 to K32767

Number of transfer words is specified by n3. "n =2" in a 16-bit instruction indicates the same meaning with "n = 1" in a 32-bit instruction.

Specified device Specified BFM

Specified device Specified BFM

D100 D101 D102 D103 D104

BFM #5

D100 D101 D102 D103

BFM #5 #6 #7 #8

#6 #7 #8 #9

16-bit operation when n=5 32-bit operation when n=2

Interrupt accept during execution of FROM/TO (M8028)

Applicable to the FXU (at Ver. 2.30 or later), FX2C, FX2N, FX2NC, FX3G, FX3GC, FX3U and FX3UC PLCs only.

1. When M8028=OFF Interrupt is prohibited automatically during execution of FROM/TO instruction, and input interrupt or timer interrupt is not executed. An interrupt occurring in this period is executed immediately after completion of execution of FROM/TO instruction. FROM/TO instruction can be used also during the interrupt program.
2. When M8028=ON When an interrupt occurs during execution of FROM/TO instruction, the execution is suspended, and the interrupt program is executed. However, FROM/TO instruction cannot be used during interrupt program.
Show 13 more labels / short text on this page
Input/output · Special extension · Special extension · Input/output · Special extension · extension · extension · Basic unit · block · block · block · block · block
Page 387 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Handling of special extension unit/block
Page 387 · click to enlarge
Page 387

14 Applied Instructions (External FX I/O Device)

14.9 FROM / Read From A Special Function Block

Handling in the event of occurrence of watchdog timer error

1. Cause of occurrence of watchdog timer error Watchdog timer error may occur in the following cases.
1. When many special extension equipments are connected. In a configuration of a large number of connected units of special extension equipments (positioning, cam switch, link, analog, etc.), the initializing time of the buffer memory executed in PLC RUN mode is long, and the operation time is extended, and a watchdog timer error may occur.

Applied Instructions (High Speed Processing)

2. When FROM/TO instructions are driven simultaneously. When many FROM/TO instructions are executed, or when multiple buffer memories are transferred, the operation time is extended, and a watchdog timer error may occur.

2. Countermeasure

Applied Instructions (Handy Instruction)

1. Method of using RBFM, WBFM instruction

→ As for BFM divided reading [RBFM], refer to section 31.1.

→ As for BFM divided writing [WBFM], refer to section 31.2.

2. Method of changing the time of watchdog timer The detection time of the watchdog timer can be changed by rewriting the content of D8000 (watchdog timer time). By entering the following program, the subsequent sequence programs are monitored by the new watchdog timer time.

Applied Instructions (External FX I/O Device)

M8002

Watchdog timer time 300ms 0

D8000 K300

Applied Instructions (External Device (optional device))

WDT EN ENO

Watchdog timer refresh When WDT instruction is not programmed, the value of D8000 is valid during END process.

3. Change of execution timing of FROM/TO instruction Please shorten the operation time by deviating the execution of FROM/TO instruction.

Handling of special extension unit/block

As for the connection method of special extension unit/block, the number of units allowed to be connected, and handling of input and output numbers, please refer to the manual of the PLC main body or the manual of each special extension unit/block.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

MOV EN s · Initial pulse

Page 388 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Set data
Page 388 · click to enlarge
Page 388

14 Applied Instructions (External FX I/O Device)

14.10 TO / Write To A Special Function Block

14.10 TO / Write To A Special Function Block

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes data from PLC into the buffer memory (BFM) of special extension unit/block. By this instruction, when data is written into multiple buffer memories (BFM) in batch a watchdog timer error may occur. When there is no bad influence for the control if the data is divided and written in, you can use WBFM instruction.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 388)
Fig. 339 · 1. Format and operation, execution form

TO 16 bits Continuous TO(EN, s, n1, n2, n3);

TOP 16 bits Pulse TOP(EN, s, n1, n2, n3);

DTO 32 bits Continuous DTO(EN, s, n1, n2, n3);

DTOP 32 bits Pulse DTOP(EN, s, n1, n2, n3);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 388)
Fig. 340 · 2. Set data
  • Transfer source data or device
  • 16-bit operation: n3 points occupied
  • 32-bit operation: 2 × n3 points occupied ANY16 ANY32

Unit No. of special extension unit/block (Sequentially from the right side of basic unit, K0 to K7) ANY16 ANY32*1

Transfer destination buffer memory (BFM) number ANY16 ANY32*1

*1. In the case of FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC series, the data type of DTO, DTOP of 32-bit operation is ANY16.

Page 389 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 389 · click to enlarge
Page 389

14 Applied Instructions (External FX I/O Device)

14.10 TO / Write To A Special Function Block

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System user Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 z

Applied Instructions (High Speed Processing)

S1 S1 z z

S1 S1 z z

S1 S1 z z

S: Refer to "Cautions".

Applied Instructions (Handy Instruction)

Function and operation explanation

1. 16-bit operation (TO, TOP) → As for common terms of FROM/TO instruction, refer to section 14.8.1.

From PLC (word device) to special extension (BFM) You can transfer (write) 16-bit data for the portion of n3 points starting from buffer memory (BFM) n2 in special extension unit/block of unit number n1, and for the portion of n3 points starting from the device specified by in PLC.

Applied Instructions (External FX I/O Device)

Command input TO EN

Transfer source data or device

Applied Instructions (External Device (optional device))

Unit No. of special extension unit/block

Transfer destination buffer memory (BFM) number

n3 Number of transfer points

2. 32-bit operation (DTO, DTOP)

From PLC (word device) to special extension (BFM) You can transfer (write) 32-bit data for the portion of n3 points starting from buffer memory (BFM) [n2+1, n2] in special extension unit/block of unit number n1, and for the portion of n3 points starting from the device specified by in PLC.

Applied Instructions (Data Transfer 2)

Command input DTO EN

Transfer source data or device

Unit No. of special extension unit/block

Applied Instructions (Floating Point)

Transfer destination buffer memory (BFM) number

n3 Number of transfer points

Related devices

Prohibit/permit interruption during execution of FROM/TO instruction.

→ As for detail, refer to Subsection 14.8.1 "Interrupt accept during

M8028 Interrupt permit flag

execution of FROM/TO (M8028)" OFFInterrupt prohibit (interrupt executed after FROM/TO instruction process) ON : Interrupt permit

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Operand · unit Index Cons · Real Number · Character · tant · String Pointer · type · s · n1 · n2 · s · n1 · n2 · Device Name Content
Page 390 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST] MOVP(M1, H0, U0¥G27); M1
Page 390 · click to enlarge
Page 390

14 Applied Instructions (External FX I/O Device)

14.10 TO / Write To A Special Function Block

Cautions

1. About bit device digit specification to be specified by Specify K1 to K4 in the case of 16-bit operation instruction, or K1 to K8 in the case of 32-bit operation.
2. The instruction is provided in the FX U PLC Ver. 2.10 or later.
3. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
4. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

Program example

By using direct specification*1 of TO instruction or buffer memory, you can write in (transfer) the digit specification of data register (D), extension register (R), or auxiliary relay (M) or constants (K, H) to the buffer memory (BFM) of special extension unit/block.

*1. The FX3U and FX3UC PLCs only are available.

Example) Program for writing "H0" in BFM #27 (instruction) of CC-Link/LT master (unit No. 0 fixed) built in the

FX3UC-32MT-LT(-2). - In the case of TO instruction

[ST] TO(M1, H0, K0, K27, K1);

M1

H0 K0 K27

K1

- In the case of MOV instruction

[ST] MOVP(M1, H0, U0¥G27); M1

U0¥G27 H0

Show 5 more labels / short text on this page
[Structured ladder/FBD] · TO EN s · n1 n2 n3 · [Structured ladder/FBD] · MOVP EN s
Page 391 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — VRSC
Page 391 · click to enlarge
Page 391

15 Applied Instructions (External Device (optional device))

15. Applied Instructions (External Device (optional device))

This chapter introduces the instructions for special adapters mainly connected to serial ports.

Applied Instructions (High Speed Processing)

Instruction name Function Reference

RS Serial Communication Section 15.1

PRUN

Parallel Run (Octal Mode) Section 15.2 PRUNP

DPRUN

DPRUNP

Applied Instructions (Handy Instruction)

ASCI

Hexadecimal to ASCII Conversion Section 15.3 ASCIP

HEX

ASCII to Hexadecimal Conversion Section 15.4 HEXP

CCD

Check Code Section 15.5 CCDP

Applied Instructions (External FX I/O Device)

VRRD

Volume Read Section 15.6 VRRDP

VRSC

Volume Scale Section 15.7 VRSCP

RS2 Serial Communication 2 Section 15.8

PID PID Control Loop Section 15.9

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 392 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 392 · click to enlarge
Page 392

15 Applied Instructions (External Device (optional device))

15.1 RS / Serial Communication

15.1 RS / Serial Communication

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction sends and receives data in no-protocol communication by way of a serial port (only the ch1) in accordance with RS-232C or RS-485 provided in the main unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 392)
Fig. 341 · 1. Format and operation, execution form

RS 16 bits Continuous RS(EN, s, m, n, d);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 392)
Fig. 342 · 2. Set data

Number of bytes of data to be sent ANY16

Head device storing received data when receiving is completed ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 392)
Fig. 343 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 393 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Differences between RS instruction and RS2 instruction
Page 393 · click to enlarge
Page 393

15 Applied Instructions (External Device (optional device))

15.1 RS / Serial Communication

Function and operation explanation

1. 16-bit operation (RS) This instruction sends and receives data in no-protocol communication by way of serial ports in accordance with RS-232C or RS-485 provided in the main unit.

→ For detailed explanation, refer to the Data Communication Edition manual.

Applied Instructions (High Speed Processing)

Command input RS EN

Head device storing data to be sent

Head device storing received data when receiving is completed

Number of bytes of data to be sent

n Number of bytes to be received

Applied Instructions (Handy Instruction)

Related devices

→ For detailed explanation, refer to the Data Communication Edition manual.

Device Name Device Name

Applied Instructions (External FX I/O Device)

M8063 Serial communication error 1 D8120 Communication format setting

M8121 Sending wait flag D8122 Remaining number of data to be sent

M8122 Sending request D8123 Monitor for number of received data

M8123 Receiving complete flag D8124 Header

M8124*1 Carrier detection flag D8125 Terminator

M8129*2 Time-out check flag D8129*2 Time-out time setting

Applied Instructions (External Device (optional device))

M8161 8-bit processing mode D8063 Error code number of serial communication error 1

D8405*3 Communication parameter display

D8419*3 Operation mode display

*1. Not supported by the FX0N PLC.

*2. The FXU, FX2C PLCs are applicable at Ver.3.30 or later.

*3. Not supported by the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.

System configuration

To use this instruction, it is necessary to attach one of the products shown in the table below to the main unit.

→ For the system configuration, refer to the respective PLC Hardware Edition manual.

→ For detailed explanation, refer to the Data Communication Edition manual.

Applied Instructions (Data Transfer 2)

Differences between RS instruction and RS2 instruction

RS2 instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.

Item RS2 instruction RS instruction Remarks

Header size 1 to 4 characters (bytes) Up to 1 character (byte) For the RS2 instruction, up to 4 characters (bytes) can be specified as a header or terminator. Terminator size 1 to 4 characters (bytes) Up to 1 character (byte)

Applied Instructions (Floating Point)

For the RS2 instruction, the check sum can be automatically attached to the sent and received data. In this case, however, make sure to use a terminator with the communication frame to be sent and received.

The check sum should be attached by a user program.

Attachment of check sum

The check sum can be automatically attached.

For the RS2 instruction: Ch0 is available only in FX3G and FX3GC PLCs. Ch2 is not available in FX3G PLC (14-point and 24-point type) and FX3S PLCs.

Used channel number ch0, ch1, ch2 ch1

Applied Instructions (Positioning Control)

s · m

Page 394 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 394 · click to enlarge
Page 394

15 Applied Instructions (External Device (optional device))

15.1 RS / Serial Communication

Cautions

→ For other cautions, refer to the Data Communication Edition manual.

1. RS instruction can be used for ch1 only (cannot be used for ch0 *1 and ch2 *1 ).
2. Do not drive two or more RS and/or RS2 *2 instructions for the same port at the same time.
3. It is not permitted to use an "RS or RS2 *2 " instruction and a following instruction for the same port:

- "IVCK*2, IVDR*2, IVRD*2, IVWR*2, IVBWR*3 or IVMC*2" instruction

- "ADPRW*2" instruction

- "FLCRT*3, FLDEL*3, FLWR*3, FLRD*3, FLCMD*3 or FLSTRD*3" instruction

4. The instruction is provided in the FX U PLC Ver. 3.07 or later.
5. The instruction is provided in the FX 0N PLC Ver. 1.20 or later.
6. Number of bytes of data to be sent(m), Number of bytes to be received(n) a) For FX 2N , FX 2NC , FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs

m, n: 0 to 4096 points (However, "m + n" should not be more than 8000 points in FX2N and FX2NC PLCs.) b) For FX0N, FX1S, FX1N, FX1NC, FXU and FX2C PLCs

m, n0 to 256 points
7. Some restrictions to applicable devices. S 1: FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

*1. Ch0 is available only in FX3G and FX3GC PLCs. Ch2 is not available in FX3G PLC (14-point and 24-point type) and FX3S PLCs.

*2. The instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.

*3. The instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs.

Page 395 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 15.2 PRUN / Parallel Run (Octal Mode)
Page 395 · click to enlarge
Page 395
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.2 PRUN / Parallel Run (Octal Mode) diagram (page 395)
Fig. 344 · 15.2 PRUN / Parallel Run (Octal Mode)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction handles the device number specified by and specified by digits as octal number, and transfers data.

Specification of digits (the lowest digit of specified device number is 0.) ANY16 ANY32

Transfer destination device (the lowest digit of specified device number is 0.) ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 396 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — From decimal number bit device to octal number bit device
Page 396 · click to enlarge
Page 396

15 Applied Instructions (External Device (optional device))

15.2 PRUN / Parallel Run (Octal Mode)

Function and operation explanation

1. 16-bit operation(PRUN, PRUNP)

From octal number bit device to decimal number bit device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — From octal number bit device to decimal number bit device diagram (page 396)
Fig. 345 · From octal number bit device to decimal number bit d…

X000 ~ X017 → M0 ~ M7, M10 ~ M17

X17 X16 X15 X14 X13 X12 X11 X10 X7 X6 X5 X4 X3 X2 X1 X0

M15 M14 M13 M12 M11 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M17 M16 M10

From decimal number bit device to octal number bit device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — From decimal number bit device to octal number bit device diagram (page 396)
Fig. 346 · From decimal number bit device to octal number bit d…

M0 ~ M7, M10 ~ M17 → Y0 ~ Y17 Command input PRUN EN s

M15 M14 M13 M12 M11 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M17 M16 M10

Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0

2. 32-bit operation(DPRUN, DPRUNP)

From octal number bit device to decimal number bit device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — From octal number bit device to decimal number bit device diagram (page 396)
Fig. 347 · From octal number bit device to decimal number bit d…

X000 ~ X027 → M0 ~ M7, M10 ~ M17, M20 ~ M27

  • X27
  • X20 X17
  • X10 X7 X6 X5 X4 X3 X2 X1 X0
  • M19 M18 M17
  • M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M27

From decimal number bit device to octal number bit device

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — From decimal number bit device to octal number bit device diagram (page 396)
Fig. 348 · From decimal number bit device to octal number bit d…

M0 ~ M7, M10 ~ M17, M20 ~ M27 →Y000 ~ Y027

  • M19 M18 M17
  • M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M27
  • Y27
  • Y20 Y17
  • Y10 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
Page 397 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ASCI EN
Page 397 · click to enlarge
Page 397

15 Applied Instructions (External Device (optional device))

15.3 ASCI / Hexadecimal to ASCII Conversion

15.3 ASCI / Hexadecimal to ASCII Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction converts HEX code into ASCII code. Also available are BINDA instruction for converting BIN data into ASCII code, and DESTR instruction for converting binary floating decimal point data into ASCII code.

→ As for BINDA instruction, refer to section 29.6. → As for DESTR instruction, refer to section 18.4.

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

ASCI 16 bits Continuous ASCI(EN, s, n, d);

Applied Instructions (External FX I/O Device)

ASCIP 16 bits Pulse ASCIP(EN, s, n, d);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Head device in which HEX code to be converted is stored ANY16

Number of characters in HEX code to be converted (number of digits) ANY16

ENO Execution state Bit

Head device for storing converted ASCII code ANY16

3. Applicable devices

Bit Devices Word Devices Others

System User Digit designation System User Special

Unit Index Con stant

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

S1 S2 z z

z S2 S3 z

S: Refer to "Cautions".

Applied Instructions (Floating Point)

Function and operation

1. 16-bit operation(ASCI/ASCIP)

Of the HEX code stored after the device specified by , n characters (digits) are converted into ASCII code, and stored in the device after the one specified by . In this instruction, the mode usable when converting includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.

ASCI EN

Head device in which HEX code to be converted is stored

Head device for storing converted ASCII code

Applied Instructions (Positioning Control)

Number of characters in HEX code to be converted (number of digits)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · ASCI EN s · d n · ASCIP EN s · d n · Input variable · Output variable · Operand · Real Number · Character · String Pointer · type · Command input · s · n
Page 398 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Number of digits (characters) specified and result of conversion
Page 398 · click to enlarge
Page 398

15 Applied Instructions (External Device (optional device))

15.3 ASCI / Hexadecimal to ASCII Conversion

2. When M8161=OFF(M8161 is used commonly with RS, HEX, CCD, CRC instructions)

Each digit of HEX data stored after the device specified by is converted into ASCII code, and transferred to lower and higher 8 bits (bytes) each in each device after the one specified by . The number of digits (characters) to be converted is specified by n. The device specified by is divided into lower 8 bits and higher 8 bits, and ASCII data is stored. M8161 is used commonly with RS, HEX, CCD, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.3 ASCI / Hexadecimal to ASCII Conversion diagram (page 398)
Fig. 349 · 15.3 ASCI / Hexadecimal to ASCII Conversion

Head device in which HEX code to be converted is stored

Number of characters in HEX code to be converted (number of digits)

Operation In the case of the program shown below, the conversion is executed as follows.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.3 ASCI / Hexadecimal to ASCII Conversion diagram (page 398)
Fig. 350 · 15.3 ASCI / Hexadecimal to ASCII Conversion

Devices after (D100)=0ABCH (D101)=1234H (D102)=5678H

Number of digits (characters) specified and result of conversion

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Number of digits (characters) specified and result of conversion diagram (page 398)
Fig. 351 · Number of digits (characters) specified and result o…

K1 K2 K3 K4 K5 K6 K7 K8 K9

D 200 lower C) B) A) 0) 4) 3) 2) 1) 8)

D 200 higher C) B) A) 0) 4) 3) 2) 1)

D 201 lower C) B) A) 0) 4) 3) 2)

D 201 higher C) B) A) 0) 4) 3)

Page 399 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8000
Page 399 · click to enlarge
Page 399

15 Applied Instructions (External Device (optional device))

15.3 ASCI / Hexadecimal to ASCII Conversion

Bit composition in the case of n=K4

0 0 1 0 1 0 1 0 1 0 D 100=ABCH

0 A B C

0)=30H A)=41H B)=42H C)=43H

1)=31H 2)=32H 3)=33H 4)=34H

5)=35H 6)=36H 7)=37H 8)=38H

0 1 1 0 0 1 0 1 0

Applied Instructions (High Speed Processing)

A) 41H 0) 30H

0 1 0 1 0 1 1 0 1 0

C) 43H

B) 42H

  • When issuing as BCD data by printer or the like, before execution of this instruction, you must convert from BIN to BCD.

Applied Instructions (Handy Instruction)

3. When M8161=ON (M8161 is used commonly with RS, HEX, CCD, CRC instructions)

Each digit of HEX data stored after the device specified by is converted into ASCII, and stored in lower 8 bits (bytes) in each device after the one specified by . The number of digits (characters) to be converted is specified by n. In the device specified by , higher 8 bits are 0. M8161 is used commonly with RS, HEX, CCD, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.

Applied Instructions (External FX I/O Device)

M8000

When M8161=ON, 8-bit mode is established, and the conversion is executed as follows.

Applied Instructions (External Device (optional device))

ASCI EN

Head device in which HEX code to be converted is stored

Head device for storing converted ASCII code

Number of characters in HEX code to be converted (number of digits)

Operation In the case of the program shown below, the conversion is executed as follows.

M8000

Applied Instructions (Data Transfer 2)

X10 ASCI EN s

d n D100 D200 K4

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 9 more labels / short text on this page
ASCII code · 8-bit mode M8161 · 16 bits · Command input · Lower 8 bits · Destination · s · n · 8-bit mode M8161
Page 400 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 400 · click to enlarge
Page 400

15 Applied Instructions (External Device (optional device))

15.3 ASCI / Hexadecimal to ASCII Conversion

Devices after (D100)=0ABCH (D101)=1234H (D102)=5678H

Number of digits (characters) specified and result of conversion

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Number of digits (characters) specified and result of conversion diagram (page 400)
Fig. 352 · Number of digits (characters) specified and result o…

K1 K2 K3 K4 K5 K6 K7 K8 K9

D 200 C) B) A) 0) 4) 3) 2) 1) 8)

D 201 C) B) A) 0) 4) 3) 2) 1)

D 202 C) B) A) 0) 4) 3) 2)

Bit composition in the case of n=K2

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Bit composition in the case of n=K2 diagram (page 400)
Fig. 353 · Bit composition in the case of n=K2

0 0 1 0 1 0 1 0 1 0

0 1 0 1 0

1 1 0 1 0

  • When issuing as BCD data by printer or the like, before execution of this instruction, you must convert from BIN to BCD.

Cautions

1. The instruction is provided in the FX U PLC Ver. 3.07 or later. The instruction is provided in the FX 0N PLC Ver. 1.20 or later.
2. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. Some restrictions to applicable devices. S 1: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
Page 401 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — HEX EN
Page 401 · click to enlarge
Page 401

15 Applied Instructions (External Device (optional device))

15.4 HEX / ASCII to Hexadecimal Conversion

15.4 HEX / ASCII to Hexadecimal Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction converts ASCII code into HEX code. Also available are DABIN instruction for converting ASCII code into BIN data, and DEVAL instruction for converting ASCII code into binary floating decimal point data.

→ As for DABIN instruction, refer to section 29.5. → As for DEVAL instruction, refer to section 18.5.

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

HEX 16 bits Continuous HEX(EN, s, n, d);

Applied Instructions (External FX I/O Device)

HEXP 16 bits Pulse HEXP(EN, s, n, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Head device in which ASCII code to be converted is stored ANY16

Number of characters in ASCII code to be converted (number of bytes) ANY16

ENO Execution state Bit

Head device for storing converted HEX code ANY16

3. Applicable devices

Bit Devices Word Devices Others

System User Digit designation System User Special

Unit Index Con stant

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z z z

S1 S2 z z

z S2 S3 z z z

S: Refer to "Cautions".

Applied Instructions (Floating Point)

Function and operation explanation

1. 16-bit operation(HEX/HEXP)

Of the ASCII code stored after the device specified by , n characters are converted into HEX code, and stored in the device after the one specified by . In this instruction, the mode usable when converting includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.

HEX EN

Head device in which ASCII code to be converted is stored

Head device for storing converted HEX code

Applied Instructions (Positioning Control)

Number of characters in ASCII code to be converted (number of bytes)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · HEX EN s · d n · HEXP EN s · d n · Input variable · Output variable · Real Number · Character · Operand · String Pointer · type · Command input · s · n
Page 402 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Conversion source data
Page 402 · click to enlarge
Page 402

15 Applied Instructions (External Device (optional device))

15.4 HEX / ASCII to Hexadecimal Conversion

2. When M8161=OFF(M8161 is used commonly with RS, ASCI, CCD, CRC instructions)

ASCII characters stored in higher and lower 8 bits (bytes) in the device specified by are converted into HEX data, and transferred to the device specified by in every four digits. The number of characters to be converted is specified by n. M8161 is used commonly with RS, ASCI, CCD, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.4 HEX / ASCII to Hexadecimal Conversion diagram (page 402)
Fig. 354 · 15.4 HEX / ASCII to Hexadecimal Conversion

Head device in which ASCII code to be converted is stored

Number of characters in ASCII code to be converted (number of bytes)

Operation In the case of the program shown below, the conversion is executed as follows.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.4 HEX / ASCII to Hexadecimal Conversion diagram (page 402)
Fig. 355 · 15.4 HEX / ASCII to Hexadecimal Conversion

Conversion source data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Conversion source data diagram (page 402)
Fig. 356 · Conversion source data
Page 403 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8000
Page 403 · click to enlarge
Page 403

15 Applied Instructions (External Device (optional device))

15.4 HEX / ASCII to Hexadecimal Conversion

Number of characters specified and result of conversion "." is 0.

In the case of n=K4

D 102 D 101 D 100

...0H

41H

A) 0)

30H

2 ..0AH

Applied Instructions (High Speed Processing)

3 .0ABH

4 0ABCH

43H

B) C)

42H

5 ...0H ABC1H

6 ..0AH BC12H

7 .0ABH C123H

0 A B C

8 0ABCH 1234H

Applied Instructions (Handy Instruction)

9 ...0H ABC1H 2345H

  • When the input data is BCD, after execution of this instruction, you must convert from BCD to BIN.
  • In the case of HEX instruction, if the data stored in the device specified by is not ASCII code, it is an operation error, and HEX conversion is disabled. In particular, if M8161 is OFF, you must store the ASCII code also in the higher 8 bits of the device specified by .

Applied Instructions (External FX I/O Device)

3. When M8161=ON(M8161 is used commonly with RS, ASCI, CCD, CRC instructions)

ASCII characters stored in lower 8 bits in are converted into HEX data, and transferred to in every four digits. The number of characters to be converted is specified by n. M8161 is used commonly with RS, ASCI, CCD, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.

Applied Instructions (External Device (optional device))

M8000

Ignored Lower 8 bits

HEX EN

Head device in which ASCII code to be converted is stored

Head device for storing converted HEX code

Number of characters in ASCII code to be converted (number of bytes)

Applied Instructions (Data Transfer 2)

Operation In the case of the program shown below, the conversion is executed as follows.

M8000

Applied Instructions (Floating Point)

X010 HEX EN s

d n D200 D100 K4

Applied Instructions (Positioning Control)

Show 8 more labels / short text on this page
Not changed · 8-bit mode M8161 · 16 bits · Source data · Command input · s · n · 8-bit mode M8161
Page 404 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 404 · click to enlarge
Page 404

15 Applied Instructions (External Device (optional device))

15.4 HEX / ASCII to Hexadecimal Conversion

Conversion source data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Conversion source data diagram (page 404)
Fig. 357 · Conversion source data

Number of characters specified and result of conversion "." is 0.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Conversion source data diagram (page 404)
Fig. 358 · Conversion source data
  • When the input data is BCD, after execution of this instruction, you must convert from BCD to BIN.

Cautions

1. The instruction is provided in the FX U PLC Ver. 3.07 or later. The instruction is provided in the FX 0N PLC Ver. 1.20 or later.
2. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.
3. Some restrictions to applicable devices. S 1: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
Page 405 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CCD EN
Page 405 · click to enlarge
Page 405

15 Applied Instructions (External Device (optional device))

15.5 CCD / Check Code

15.5 CCD / Check Code

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction calculates the horizontal parity value or check sum value of error check method used in communication or the like. The error check method also includes cyclic redundancy check (CRC). Use the CRC instruction when determining the CRC value.

→ As for CRC instruction, refer to section 24.4. → As for complementary number [NEG instruction], refer to section 9.10.

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

CCD 16 bits Continuous CCD(EN, s, n, d);

Applied Instructions (External FX I/O Device)

CCDP 16 bits Pulse CCDP(EN, s, n, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Head object device ANY16

Number of data (n=1 to 256) ANY16

ENO Execution state Bit

Head storage destination device of calculated data (2 points occupied) ARRAY [0..1] OF ANY16

3. Applicable devices

Bit Devices Word Devices Others

System User Digit designation System User Special

Unit Index Con stant

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 z z

z S1 z

Applied Instructions (Floating Point)

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation(CCD/CCDP)

The addition data and horizontal parity of the data stored in the device specified by are calculated, and the addition data and the horizontal parity are stored in the device specified by . In this instruction, the mode usable when calculating includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.

CCD EN

Applied Instructions (Positioning Control)

Head storage destination device of calculated data

Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · CCD EN s · d n · CCDP EN s · d n · Input variable · Output variable · Operand · Real Number · Character · String Pointer · type · Command input · Head object device · s · Number of data · n
Page 406 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 15.5 CCD / Check Code
Page 406 · click to enlarge
Page 406

15 Applied Instructions (External Device (optional device))

15.5 CCD / Check Code

2. When M8161=OFF(M8161 is used commonly with RS, ASCI, HEX, CRC instructions)

Of the data of n points starting from the device specified by , the addition data and the horizontal parity data of higher and lower 8 bits are stored in the device specified by . M8161 is used commonly with RS, ASCI, HEX, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.5 CCD / Check Code diagram (page 406)
Fig. 359 · 15.5 CCD / Check Code

Head object device Head storage destination device of calculated data Number of data

Example of 16-bit conversion In the case of the program shown below, the conversion is executed as follows.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.5 CCD / Check Code diagram (page 406)
Fig. 360 · 15.5 CCD / Check Code
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 15.5 CCD / Check Code diagram (page 406)
Fig. 361 · 15.5 CCD / Check Code

Horizontal parity 1000010 ←When the number of "1" is an odd number, the horizontal parity is 1.

When the number of "1" is an even number, the horizontal parity is 0.

1 1 0 1 0 0 0 1 0 D 0 1091 in BCD.

Horizontal parity 1 0 1 0 1 0 D 1

Page 407 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 407 · click to enlarge
Page 407

15 Applied Instructions (External Device (optional device))

15.5 CCD / Check Code

3. When M8161=ON(M8161 is used commonly with RS, ASCI, HEX, CRC instructions)

Of the data of n points (lower 8 bits only) starting from the device specified by , the addition data and the horizontal parity data are stored in the device specified by . M8161 is used commonly with RS, ASCI, HEX, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.

Applied Instructions (High Speed Processing)

M8000

Ignored Lower 8 bits

CCD EN

Applied Instructions (Handy Instruction)

Head storage destination device of calculated data

Example of 8-bit conversion In the case of the program shown below, the conversion is executed as follows.

Applied Instructions (External FX I/O Device)

M8000

X010 CCD EN s

Applied Instructions (External Device (optional device))

K10

Example of data content

D 100 K100 = 01100100

D 101 K111 = 0110111 ←

D 102 K100 = 01100100 D 103 K 98 = 01100010

D 104 K123 = 0111101 ←

D 105 K 66 = 01000010 D 106 K100 = 01100100

D 107 K 95 = 0101111 ←

D 108 K210 = 11010010 D 109 K 88 = 01011000

Applied Instructions (Data Transfer 2)

Horizontal parity 1000010 ← When the number of "1" is an odd number, the horizontal parity is 1. When the number of "1" is an even number, the horizontal parity is 0.

Applied Instructions (Floating Point)

1 1 0 1 0 0 0 1 0 D 0 1091 in BCD.

1 0 1 0 1 0 D 1 Horizontal parity

Cautions

1. The instruction is provided in the FX U PLC Ver. 3.07 or later. The instruction is provided in the FX 0N PLC Ver. 1.20 or later.
2. Instructions of pulse operation type are not provided in the FX 0N PLC. To execute pulse operation, make the instruction execution condition pulse type.

Applied Instructions (Positioning Control)

3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Show 11 more labels / short text on this page
8-bit mode M8161 · 16 bits · Source data · Command input · Head object device · s · Number of data · n · 8-bit mode M8161 · d n D100 · Total K1091
Page 408 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — TC0
Page 408 · click to enlarge
Page 408

15 Applied Instructions (External Device (optional device))

15.6 VRRD / Volume Read

15.6 VRRD / Volume Read

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads out the value determined by the variable resistor.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 408)
Fig. 362 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 408)
Fig. 363 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 408)
Fig. 364 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 z z z

S: Refer to "Cautions".

Function and operation explanation

The analog value of variable resistor No. is converted into BIN 8 bits, and 0 to 255 are transferred to D0. As an application example, D0 is used as timer preset value. The analog timer is obtained by this operation. As the timer constant value, if a value of more than 256 is necessary, the product of take-in value multiplied by the constant by MUL instruction is set indirectly as the timer constant.

X000 VRRD EN s

D0 K0

OUT_T EN TCoil TValue

TC0

Page 409 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 409 · click to enlarge
Page 409

15 Applied Instructions (External Device (optional device))

15.6 VRRD / Volume Read

Cautions

1. The FX 1NC , FX 2NC and FX 3GC PLCs are not provided with variable resistors for reading out by this instruction, and hence do not function even if programmed.
2. In FX 3S PLCs, the variable analog potentiometer board can be connected to the option connector. In this case, the communication function is not available when the VRRD or VRSC instruction is used.
3. In 14-point and 24-point type FX 3G PLCs, the variable analog potentiometer board can be connected to the option connector 1, and occupies communication channel ch1. In this case, the communication function using communication channel ch1 is not available when the VRRD or VRSC instruction is used.

Applied Instructions (High Speed Processing)

4. In 40-point and 60-point type FX 3G PLCs, the variable analog potentiometer board can be connected only to the option connector 2, and occupies communication channel ch2. In this case, the communication function using communication channel ch2 is not available when the VRRD or VRSC instruction is used.

Applied Instructions (Handy Instruction)

5. The communication function is not available for ch1 when the VRRD or VRSC instruction is used in the program in FX 3S , FX 3U and FX 3UC PLCs.

→ For details, refer to the Communication Control Edition manual.

6. FX 3S and FX 3G PLCs support the FX 3G -8AV-BD.
7. FX 3U and FX 3UC -32MT-LT(-2) PLCs support the FX 3U -8AV-BD.

Applied Instructions (External FX I/O Device)

8. The instruction is provided in the FX 3G PLC Ver. 1.10 or later. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.70 or later.
9. Some restrictions to applicable devices. S 1: The FX 3S , FX 3G , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3G , FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 410 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — OUT_T(X007, TC7, D207); OUT(TS7, Y007);
Page 410 · click to enlarge
Page 410

15 Applied Instructions (External Device (optional device))

15.6 VRRD / Volume Read

Program example

Variable resistor values are read out sequentially. Depending on variable resistors VR0 to VR7, the specified values of VRRD instruction are K0 to K7. In the example below, being decorated by index (Z = 0 to 7), K0Z is K0 to K7.

M8000

Reset of index register (Z) = 0

RST EN ENO

Z

Range of FOR to NEXT is repeated 8 times.

ENO K8

Variable resistor value is stored in data register.

FOR instruction is repeated 8 times as specified. In this period, the value of index register Z is increased sequentially from 0 to 1, 2, ..., 7, and the value is transferred 8 times, from VR0 to D200, VR1 to D201,..., VR7 to D20

M8000 VRRD EN s

INC EN ENO

(Z)+1

(Z)

NEXT EN ENO

OUT_T EN TCoil TValue

TC0 D200

TS0

Y000

This is a timer circuit. Depending on graduations 0 to 10 of the variable resistor, values of 0 to 255 are stored in the data register. T0 to T7 are 100 ms timers, and 0 to 25.5 sec are obtained corresponding to the set values of 0 to 255.

OUT_T EN TCoil TValue

TC1 D201

TS1

Y001

OUT_T EN TCoil TValue

TC7 D207

TS7

Y007

[ ST ]

RST(M8000, Z); FOR(TRUE, K8); VRRD(M8000, K0Z, D200Z); INC(M8000, Z); NEXT(TRUE); OUT_T(X000, TC0, D200); OUT(TS0, Y000); OUT_T(X001, TC1, D201); OUT(TS1, Y001);

OUT_T(X007, TC7, D207); OUT(TS7, Y007);

Show 5 more labels / short text on this page
[Structured ladder/FBD] · RUN monitor · FOR EN n · d K0Z D200Z · d Z
Page 411 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — X000 VRSC EN ENO
Page 411 · click to enlarge
Page 411

15 Applied Instructions (External Device (optional device))

15.7 VRSC / Volume Scale

15.7 VRSC / Volume Scale

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction reads out the value determined in the variable resistor graduations.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

VRRD 16 bits Continuous VRSC(EN, s, d);

VRRDP 16 bits Pulse VRSCP(EN, s, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Variable resistor number for reading out the graduations ANY16

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Storage destination of variable resistor graduations ANY16

3. Applicable devices

Bit Devices Word Devices Others

System User Digit designation System User Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 S2 z z z

z S2 z z z

S: Refer to "Cautions".

Applied Instructions (Data Transfer 2)

Function and operation explanation

This instruction reads the value of a variable analog potentiometer on the variable analog potentiometer board attached to the main unit as a numeric value in the range from 0 to 10. However, the actual scale value does not always correspond to the switching position of the variable analog potentiometer scale (0 to 10). This instruction converts into a binary value the scale value of a variable analog potentiometer specified in , and transfers the converted binary value to .

X000 VRSC EN ENO

d D1 s K1

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Instruction · name Operation Execution · form · VRSC EN s · VRSCP EN s · Input variable · Output variable · Operand · Unit Index Cons · Real Number · Character · String Pointer · type · tant
Page 412 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M10
Page 412 · click to enlarge
Page 412

15 Applied Instructions (External Device (optional device))

15.7 VRSC / Volume Scale

Cautions

1. The FX 1NC , FX 2NC and FX 3GC PLCs are not provided with variable resistors for reading out by this instruction, and hence do not function even if programmed.
2. In FX 3S PLCs, the variable analog potentiometer board can be connected to the option connector. In this case, the communication function is not available when the VRRD or VRSC instruction is used.
3. In 14-point and 24-point type FX 3G PLCs, the variable analog potentiometer board can be connected to the option connector 1, and occupies communication channel ch1. In this case, the communication function using communication channel ch1 is not available when the VRRD or VRSC instruction is used.
4. In 40-point and 60-point type FX 3G PLCs, the variable analog potentiometer board can be connected only to the option connector 2, and occupies communication channel ch2. In this case, the communication function using communication channel ch2 is not available when the VRRD or VRSC instruction is used.
5. The communication function is not available for ch1 when the VRRD or VRSC instruction is used in the program in FX 3S , FX 3U and FX 3UC PLCs.

→ For details, refer to the Communication Control Edition manual.

6. FX 3S and FX 3G PLCs support the FX 3G -8AV-BD.
7. FX 3U and FX 3UC -32MT-LT(-2) PLCs support the FX 3U -8AV-BD.
8. The instruction is provided in the FX 3G PLC Ver. 1.10 or later. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.70 or later.
9. Some restrictions to applicable devices. S 1: The FX 3S , FX 3G , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3G , FX 3U and FX 3UC PLCs only are applicable.

Program example

This is an example of use as rotary switch. Depending on variable resistor graduations 0 to 10, any one of auxiliary relays M0 to M10 is turned ON. By DECO instruction, the auxiliary relays are occupied from M0 to M15.

[ ST ]

X000 VRSC EN ENO

VRSC(X000, K1, D1); DECO(X001, D1, K4, M0); OUT(M0, ···); OUT(M1, ···);

DECO EN s n

OUT(M10, ···);

D1 K4 d M0

M0

ON at graduation 0

M1

ON at graduation 1

M10

ON at graduation 10

[Structured ladder/FBD] · s K1 · d D1

Page 413 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — X Y M T C S D .b KnX KnY Kn
Page 413 · click to enlarge
Page 413

15 Applied Instructions (External Device (optional device))

15.8 RS2 / Serial Communication 2

15.8 RS2 / Serial Communication 2

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction transmits and receives data by no-procedure communication via serial port of RS-232C or RS-485 installed in the basic unit. In the case of FX3G and FX3GC PLCs, data can be transmitted and received by no-procedure communication also via standard built-in port (RS-422).

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

RS2 16 bits Continuous RS2(EN, s, m, n, n1, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Applied Instructions (External Device (optional device))

Head device in which transmission data is stored

  • 16-bit processing mode: m ÷ 2 points *1 occupied ANY16

Number of transmission data bytes [Setting range: 0 to 4096] ANY16

Number of reception data bytes [Setting range: 0 to 4096] ANY16

Used channel number [Setting contentK0: ch0, K1: ch1, K2: ch2] *2 ANY16

ENO Execution state Bit

Head device for storing reception data upon completion of reception

  • 16-bit processing mode: n ÷ 2 points *1 occupied ANY16

*1. Rounding up below the decimal point

*2. Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System User Digit designation System

Applied Instructions (Floating Point)

X Y M T C S D .b KnX KnY Kn

M KnS T C D R U \G V Z Modifier K H E " " P

z S1 z

z S1 z z

z S1 z z

z S1 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · RS2 EN s · m n n1 · Input variable · Output variable · Special · Unit Index Cons · Real Number · Character · Operand · User · tant · String Pointer · type · z z
Page 414 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 414 · click to enlarge
Page 414

15 Applied Instructions (External Device (optional device))

15.8 RS2 / Serial Communication 2

Function and operation explanation

1. 16-bit operation(RS2) This instruction transmits and receives data by no-procedure communication via serial port of RS-232C or RS-485 installed in the basic unit.

→ As for the detailed explanation, refer to the communication control manual.

Command input RS2 EN

d Head device in which transmission data is stored

Head device for storing reception data upon completion of reception

Number of transmission data bytes

Number of reception data bytes

Related devices

→ As for the detailed explanation, refer to the communication control manual.

Name ch0*1 ch1 ch2*1 ch0*1 ch1 ch2*1

M8371 M8401 M8421 Transmission waiting flag*2 D8370 D8400 D8420 Communication format setting

M8372 M8402 M8422 Transmission request*2 -

M8373 M8403 M8423 Reception complete flag*2 D8372 D8402 D8422 Transmission data remainder points*2

- M8404 M8424 Carrier detection flag D8373 D8403 D8423 Reception points monitor*2

- M8405 M8425 Data set ready (DSR) flag*3 - D8405 D8425 Communication parameter display

- D8379 D8409 D8429 Time out time setting

M8379 M8409 M8429 Time out judging flag D8380 D8410 D8430 Headers 1, 2

D8381 D8411 D8431 Headers 3, 4

D8382 D8412 D8432 Terminators 1, 2

D8383 D8413 D8433 Terminators 3, 4

-

D8384 D8414 D8434 Reception sum (reception data)

D8385 D8415 D8435 Reception sum (calculation result)

D8386 D8416 D8436 Transmission sum

D8389 D8419 D8439 Operation mode display

M8062 M8063 M8438 Serial communication error*4 D8062 D8063 D8438 Error code number of serial

*1. Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.

*2. Cleared when changed from RUN to STOP.

*3. The FX3U, FX3UC PLCs are applicable at Ver.2.30 or later.

*4. Cleared when PLC power supply is turned from OFF to ON.

Show 9 more labels / short text on this page
s · m · n · ch used · n1 · Device · Device · Name · communication error*4
Page 415 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 415 · click to enlarge
Page 415

15 Applied Instructions (External Device (optional device))

15.8 RS2 / Serial Communication 2

System configuration

In order to use this instruction, you must install any one of the following products in the basic unit.

→ As for the system configuration, refer to the hardware manual of the corresponding

PLC main unit. → As for the detailed explanation, refer to the communication control manual.

PLC Type of communication Option

RS-232C communication FX3U-232-BD or FX3U-232ADP(-MB)

Applied Instructions (High Speed Processing)

FX 3U , FX 3UC -32MT-LT(-2)

RS-485 communication FX3U-485-BD or FX3U-485ADP(-MB)

RS-232C communication FX3U-232ADP(-MB)

FX 3UC (D, DS, DSS)

RS-485 communication FX3U-485ADP(-MB)

RS-232C communication FX3G-232-BD or FX3U-232ADP(-MB) (FX3G-CNV-ADP is needed)

FX 3G

RS-232C/RS-422 converter*1 (FX-232AW, FX-232AWC and FX-232AWC-H)

RS-485 communication FX3G-485-BD(-RJ) or FX3U-485ADP(-MB) (FX3G-CNV-ADP is needed)

Applied Instructions (Handy Instruction)

RS-232C communication FX3U-232ADP(-MB)

FX 3GC

RS-232C/RS-422 converter*1 (FX-232AW, FX-232AWC and FX-232AWC-H)

RS-485 communication FX3U-485ADP(-MB)

RS-232C communication FX3G-232-BD or FX3U-232ADP(-MB) (FX3S-CNV-ADP is needed)

FX 3S

RS-485 communication FX3G-485-BD(-RJ) or FX3U-485ADP(-MB) (FX3S-CNV-ADP is needed)

*1. Required to use ch0 (standard built-in RS-422 port) in FX3G and FX3GC PLCs.

Applied Instructions (External FX I/O Device)

Difference between RS instruction and RS2 instruction

Item RS2 instruction RS instruction Remarks

Header size 1 to 4 characters (bytes) Up to 1 character (byte) For the RS2 instruction, up to 4 characters (bytes) can be specified as a header or terminator. Terminator size 1 to 4 characters (bytes) Up to 1 character (byte)

For the RS2 instruction, the check sum can be automatically attached to the sent and received data. In this case, however, make sure to use a terminator with the communication frame to be sent and received.

Applied Instructions (External Device (optional device))

Attachment of check sum

The check sum can be automatically attached.

The check sum should be attached by a user program.

For the RS2 instruction: Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.

Used channel number ch0, ch1, ch2 ch1

Function change by version

Item Outline of function FX3S FX3G FX3GC FX3U FX3UC

ch1 Data set ready (DSR) flag

When DR (DSR) signal of ch1 is ON, special device M8405 is turned ON.

Applied Instructions (Data Transfer 2)

Ver. 1.00

Ver. 1.00

Ver. 1.40

Ver. 2.30

Ver. 2.30

ch2 Data set ready (DSR) flag

When DR (DSR) signal of ch2 is ON, special device M8425 is turned ON.

Cautions

→ As for other cautions, refer to the communication control manual.

Applied Instructions (Floating Point)

1. With RS, RS2 instructions, do not drive the same port simultaneously by plural instructions.
2. It is not permitted to use an "RS or RS2" instruction and a following instruction for the same port:

- "IVCK, IVDR, IVRD, IVWR, IVBWR*1 or IVMC" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

3. When using the header or terminator, please set the data of the header or terminator in the special D before driving the RS2 instruction. Do not change the values of the header or terminator during driving of RS2 instruction.
4. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Positioning Control)

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

Show 6 more labels / short text on this page
Corresponding version · or later · or later · or later · or later · or later
Page 416 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 416 · click to enlarge
Page 416

15 Applied Instructions (External Device (optional device))

15.9 PID / PID Control Loop

15.9 PID / PID Control Loop

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes PID control for changing the output values depending on the change value of the input.

→ As for the detail, refer to the analog control manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 416)
Fig. 365 · 1. Format and operation, execution form

PID 16 bits Continuous PID(EN, s1, s2, s3, d);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 416)
Fig. 366 · 2. Set data

Data register for storing the target value (SV) ANY16

Data register for storing the measured value (PV). ANY16

Data register for storing the parameter [29 points occupied]*1 ANY16

Data register for storing the output value (MV) ANY16

*1. Variable depending on the setting content of the parameter.

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 416)
Fig. 367 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation(PID)

When the program is executed by setting the target value of the device specified by , the measured value of the device specified by , and the parameter of the device specified by , at every sampling time of the device specified by , the calculation result (MV) is stored in the output value of the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 416)
Fig. 368 · Function and operation explanation
Page 417 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. List of parameters to +28
Page 417 · click to enlarge
Page 417

15 Applied Instructions (External Device (optional device))

15.9 PID / PID Control Loop

2. Setting items

Setting items Content No. of points

  • To set the target value (SV).
  • PID instruction does not change the contents of setting.
  • Cautions when using auto-tuning (limit cycle method) If the target value for auto-tuning and the target value for PID control are different, the value to which the bias value is added is set, and the actual target value must be stored when the auto-tuning flag is turned OFF.

Applied Instructions (High Speed Processing)

Measured value(PV) Input value of PID operation. 1 point

1. Auto-tuning: In the case of limit cycle method

The devices are occupied by 29 points from the head device specified by . 2) Auto-tuning: In the case of step response method a) Action setting (ACT) setting: When all of bit1, bit2, bit5 are other than "0"

Applied Instructions (Handy Instruction)

The devices are occupied by 25 points from the head device specified by . b) Action setting (ACT) setting: When all of bit1, bit2, bit5 are "0"

The devices are occupied by 20 points from the head device specified by .

1) In the case of PID control (in ordinary processing) The initial output value is set at the user side before instruction drive. Thereafter, operation results are stored. 2) Auto-tuning: In the case of limit cycle method ULV value or LLV value is automatically issued during auto-tuning, and specified MV value is set after auto-tuning. 3) Auto-tuning: In the case of step response method Please set the step output value at the user side before instruction drive. During auto-tuning, the MV output cannot be changed at the PID instruction side.

Applied Instructions (External FX I/O Device)

*1. When the auto-tuning is not used, the same number of points as in the step response method are occupied.

Applied Instructions (External Device (optional device))

3. List of parameters to +28

Setting items Content of setting Remarks

Sampling time(TS) 1 to 32767 [ms] Value shorter than operation cycle cannot be executed.

bit0 0Normal action 1:Reverse action Direction of action
bit1 0Input change amount alarm absent 1: Input change amount alarm valid

bit2 0: Output change amount alarm absent 1: Output change amount alarm valid Do not turn ON bit2 and bit5 simultaneously.

bit3 Not usable.

bit4 *2 0Auto-tuning inaction 1: Auto-tuning execute
0. Output value upper and lower limit setting absent 1: Output value upper and lower limit setting valid

Do not turn ON bit2 and bit5 simultaneously.

Applied Instructions (Data Transfer 2)

bit6 *2,*3 0Step response method 1: Limit cycle method Selection of auto-tuning mode

bit7 to bit15 Not usable.

+2 Input filter constant (α) 0 to 99 [%] No input filter in the case of 0

+3 Proportional gain (KP) 1 to 32767 [%]

Applied Instructions (Floating Point)

+4 Integral time(TI) 0 to 32767 [×100ms] Handled as ∞ in the case of 0 (No integral)

+5 Differential gain (KD) 0 to 100 [%] No differential gain in the case of 0

+6 Differential time(TD) 0 to 32767 [×10ms] No differentiation in the case of 0

+7 :

Occupied by the internal processing of PID operation. Do not change the data.

+20*1 Input change amount (increase side) alarm setting value 0 to 32767 Direction of action(ACT): valid if + 1 bit1 is 1

+21*1 Input change amount (decrease side) alarm setting value 0 to 32767 Direction of action(ACT): valid if + 1 bit1 is 1

*1. + 20 to + 24 will be occupied in the case of bit1 = 1, bit2 = 1, or bit5 = 1 of + 1 action setting (ACT)

Applied Instructions (Positioning Control)

*2. FXU, FX2C PLCs are not usable.

*3. FX1S, FX1N, FX1NC, FX2N, FX2NC PLCs are not usable.

Show 13 more labels / short text on this page
occupied · Target value(SV) · 1 point · 29 points · Parameter*1 · 25 points · 20 points · Output value(MV) · 1 point · Action setting (ACT) · +1 · bit5*2 · +19
Page 418 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. When specifying a device in power failure hold region
Page 418 · click to enlarge
Page 418

15 Applied Instructions (External Device (optional device))

15.9 PID / PID Control Loop

Setting items Content of setting Remarks

Output change amount (increase side) alarm setting value 0 to 32767 Direction of action (ACT):

+1 bit2 = 1, bit5 = 0; valid

Output upper limit setting value -32768 to 32767 Direction of action (ACT):

+1 bit2 = 0, bit5 = 1; valid

Output change amount (decrease side) alarm setting value 0 to 32767 Direction of action (ACT):

+1 bit2 = 1, bit5 = 0; valid

Output lower limit setting value -32768 to 32767 Direction of action (ACT):

+1 bit2 = 0, bit5 = 1; valid

bit0 0Input change amount (increase side) not over 1: Input change amount (increase side) over
bit1 0Input change amount (decrease side) not over 1: Input change amount (decrease side) over

Direction of action (ACT):

+24*1 Alarm output

bit2 0Output change amount (increase side) not over 1: Output change amount (increase side) over

+1 bit1 = 1 or bit2 = 1; valid

bit3 0Output change amount (decrease side) not over 1: Output change amount (decrease side) over

The following setting is required when using the limit cycle method (in the case of action direction (ACT) b6: ON).

+25*2 PV value threshold (hysteresis) width (SHPV)

To be set according to fluctuation of measured value (PV).

+26*2 Output value upper limit (ULV) Setting of maximum output value (ULV) of output value (MV)

Action setting (ACT) b6: Occupied when limit cycle method (ON) is selected.

+27*2 Output value lower limit (LLV) Setting of minimum output value (LLV) of output value (MV)

Weight setting parameter from end of tuning cycle to start of PID control (KW)

*1. + 20 to + 24 will be occupied in the case of bit1 = 1, bit2 = 1, or bit5 = 1 of + 1 action setting (ACT)

*2. FX2N, FX2NC, FX1N, FX1NC, FX1S, FXU, FX2C PLCs are not usable.

Cautions

1. Cautions when using a plurality of instructions Possible to execute plural times simultaneously (the number of loops is not limited), but you must be careful so that the device numbers may not be overlapped in the devices used in or used in operation.

2. Number of parameters occupied

1. In the case of limit cycle method

- Devices are occupied by 29 points from the head device specified by .

2. In the case of step response method - Action setting (ACT) setting: when all of bit1, bit2, bit5 are other than "0" Devices are occupied by 25 points from the head device specified by . - Action setting (ACT) setting: when all of bit1, bit2, bit5 are "0" Devices are occupied by 20 points from the head device specified by .

3. When specifying a device in power failure hold region

As for the output value (MV) of PID instruction, specify the data register excluding the power failure hold region. (When specifying the data register in the power failure hold region, you must clear the content of backup while the PLC is ON by the following program.)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. When specifying a device in power failure hold region diagram (page 418)
Fig. 369 · 3. When specifying a device in power failure hold re…

Data register number of battery backup region specified by

Show 4 more labels / short text on this page
+22*1 · +23*1 · +28*2 · -50 to 32717%
Page 419 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 419 · click to enlarge
Page 419

15 Applied Instructions (External Device (optional device))

15.9 PID / PID Control Loop

4. The instruction is provided in the FX U and FX 2C PLCs Ver. 2.70 or later.
5. FX 2N PLC supports the upper and lower limit setting functions of the auto-tuning and output value at Ver. 2.00 or later.
6. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (High Speed Processing)

Error

If an operation error occurs, special auxiliary relay M8067 is turned ON, and the error code is stored in special data register D8067.

Applied Instructions (Handy Instruction)

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 420 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — MCDE
Page 420 · click to enlarge
Page 420

This chapter introduces the instructions for control of F2 PLC special extension equipment.

Instruction name Function Reference

MNET

F-16NP/NT communication Section 16.1 MNETP

ANRD

Read from F2-6A Section 16.2 ANRDP

ANWR

Write to F2-6A Section 16.3 ANWRP

RMST F2-32RM start Section 16.4

RMWR

Write to F2-32RM Section 16.5 RMWRP

DRMWR

DRMWRP

RMRD

Read from F2-32RM Section 16.6 RMRDP

DRMRD

DRMRDP

RMMN

F2-32RM monitor Section 16.7 RMMNP

BLK

Specify F2-30GM Section 16.8 BLKP

MCDE

F2-30GM code Section 16.9 MCDEP

Page 421 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 16.1 MNET / F-16NP/NT communication
Page 421 · click to enlarge
Page 421
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 16.1 MNET / F-16NP/NT communication diagram (page 421)
Fig. 370 · 16.1 MNET / F-16NP/NT communication

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction exchanges ON/OFF signals between the FXU, FX2C PLCs, and F-16NP/NT type interface unit.

Head input number of FX2-24EI connected to F-16NP/NT (16 points occupied) Bit

Head output number of FX2-24EI connected to F-16NP/NT (8 points occupied) Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

  • Head input and output numbers are determined by the connection position of FX 2 -24EI type special block.

The following signals are exchanged by the above instruction.

FXU PLC FX2C PLC F-16NP/NT type interface unit

Page 422 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 422 · click to enlarge
Page 422

16.1 MNET / F-16NP/NT communication

Cautions

1. In the case of FX-16NP/NT, FX-16NP/NT-S3 type interface block, this instruction is not used, and FX 2 - 24EI is not needed.
2. The instruction is not provided in the FX U and FX 2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.
Page 423 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 423 · click to enlarge
Page 423

16.2 ANRD / Read from F2-6A

16.2 ANRD / Read from F 2 -6A

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction writes the analog input of F2-6A type analog input and output unit.

1. Format and operation, execution form

Expression in each language

ANRD EN s n

Applied Instructions (Handy Instruction)

ANRD 16 bits Continuous ANRD(EN, s, n, d1, d2);

ANRDP EN s n

ANRDP 16 bits Pulse ANRDP(EN, s, n, d1, d2);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Head input number of FX2-24EI connected to F2-6A (16 points occupied) Bit

Applied Instructions (External Device (optional device))

Channel number of analog input (n=10,11,12,13) ANY16

ENO Execution state Bit

Head output number of FX2-24EI connected to F2-6A (8 points occupied) Bit

Device storing analog input value (8-bit binary) ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Data Transfer 2)

z

Function and operation explanation

Applied Instructions (Floating Point)

  • To read in analog input of F 2 -6A type analog input and output unit.

ANRD EN s n

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.

Y030 X040

d1 d2 K10 D300

  • In the device specified by , 8-bit binary analog data is stored.

To read out from analog input CH10 to D300.

Caution

The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.

Applied Instructions (Positioning Control)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · d1 d2 · d1 d2 · Input variable · Output variable · Operand · Special · Real Number · Character · user · String Pointer · type · z · z z · z
Page 424 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]
Page 424 · click to enlarge
Page 424

16.2 ANRD / Read from F2-6A

Program example

This is intended to determine the average of three points of time series data in 100 ms unit in order to suppress fluctuations of the analog input.

M8000

ANRD EN s n

To store the data of input channel 10 of F2-6A type analog input and output unit connected from X040, Y030, in the D20.

Y030 X040

d1 d2 K10 D20

M8012

WSFLP EN s n1

The content of D20 is shifted to D0, D1, D2 in 100 ms unit.

D0 D20

K3 K1

MEANP EN s n

The average of D0, D1, D2 is stored in the D10.

[ ST ]

ANRD(M8000, X040, K10, Y030, D20); WSFLP(M8012, D20, K3, K1, D0); MEANP(M8012, D0, K3, D10);

Show 5 more labels / short text on this page
[Structured ladder/FBD] · RUN monitor · 100 ms clock · n2 · d1 K3
Page 425 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 425 · click to enlarge
Page 425

16.3 ANWR / Write to F2-6A

16.3 ANWR / Write to F 2 -6A

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction writes data from the PLC in the F2-6A type analog input and output unit, and issues as analog data.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

ANWR EN s1 s2

ANWR 16 bits Continuous ANWR(EN, s1, s2, n, d);

Applied Instructions (External FX I/O Device)

ANWRP EN s1 s2

ANWRP 16 bits Pulse ANWRP(EN, s1, s2, n, d);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Device for storing analog output data (8-bit binary) ANY16

Head input number of FX2-24EI connected to F2-6A Bit

Channel number of analog output ANY16

ENO Execution state Bit

Head output number of FX2-24EI connected to F2-6A Bit

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

unit Index Con stant

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Applied Instructions (Floating Point)

Function and operation explanation

  • Data is written in from PLC into F 2 -6A type analog input and output unit, and issued as analog data.

ANWR EN s1 s2

Y030 D310 X040

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.

To write in from D310 into analog input CN0

  • In the device specified by , 8-bit binary data is stored.

Caution

Applied Instructions (Positioning Control)

The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.

Show 18 more labels / short text on this page
Instruction · name Operation Execution · form · n · n · Input variable · Output variable · Special · Real Number · Character · Operand · String Pointer · type · user · z z · z z · z · n K0
Page 426 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — OFF BANK0
Page 426 · click to enlarge
Page 426

16.4 RMST / F2-32RM start

16.4 RMST / F 2 -32RM start

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction gives start signal from the PLC or receives status information, in the F2-32RM type programmable cam switch.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 426)
Fig. 371 · 1. Format and operation, execution form

RMST 16 bits Continuous RMST(EN, s, n, d1, d2);

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 426)
Fig. 372 · 2. Set data

Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit

Program (bank) number of F2-32RM (n = 0, 1). ANY16

Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit

Head of device storing status information (8 points occupied) Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 426)
Fig. 373 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

  • This instruction gives start command from the PLC or receives status information, in the F 2 -32RM type programmable cam switch.

RMST EN s n

Y030 X040

d1 d2 K0 M300

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.

FXU→FX2-32RM Start command F2-32RM→FXU Status information

  • In the device specified by , the status information is stored as follows.

M307 M306 M305 M304 M303 M302 M301 M300

ON

Normal Normal CW Normally

ON 1.0° START BANK1

OFF

S/W error H/W error CCW 0.5° STOP Normally

OFF BANK0

As for the meaning of each status, please refer to the user's manual of F2-32RM type programmable cam switch.

Page 427 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 16.5 RMWR / Write to F2-32RM
Page 427 · click to enlarge
Page 427
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 16.5 RMWR / Write to F2-32RM diagram (page 427)
Fig. 374 · 16.5 RMWR / Write to F2-32RM

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction sends output prohibit information from the PLC to the F2-32RM type programmable cam switch.

  • Head bit device of output prohibit table
  • 16-bit operation: 16 points occupied
  • 32-bit operation: 32 points occupied Bit

Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit

Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 428 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y030 M500
Page 428 · click to enlarge
Page 428

16.5 RMWR / Write to F2-32RM

Function and operation explanation

  • This instruction sends output prohibit information from the PLC to the F 2 -32RM type programmable cam switch.

RMWR EN s1 s2

Y030 M500

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.
  • The device specified by is an output prohibit table, and is handled as octagonal number as shown in the example below.

Writing of output prohibit information

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Y030 M500 diagram (page 428)
Fig. 375

M507 M506 M505 M504 M503 M502 M501 M500 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000

M517 M516 M515 M514 M513 M512 M511 M510 Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010

For example, when M500 is turned ON, Y000 is output prohibited, and cannot be turned ON.

M527 M526 M525 M524 M523 M522 M521 M520 Y027 Y026 Y025 Y024 Y023 Y022 Y021 Y020

M537 M536 M535 M534 M533 M532 M531 M530 Y037 Y036 Y035 Y034 Y033 Y032 Y031 Y030

Auxiliary relay number of FXU, FX2C

d X040

Page 429 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 16.6 RMRD / Read from F2-32RM
Page 429 · click to enlarge
Page 429
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 16.6 RMRD / Read from F2-32RM diagram (page 429)
Fig. 376 · 16.6 RMRD / Read from F2-32RM

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads out the ON/OFF state of output of the F2-32RM type programmable cam switch to the PLC.

Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit

Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit

  • Bit device for storing output status (ON/OFF).
  • 16-bit operation: 16 points occupied
  • 32-bit operation: 32 points occupied Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 430 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M660
Page 430 · click to enlarge
Page 430

16.6 RMRD / Read from F2-32RM

Function and operation explanation

  • This instruction reads out the ON/OFF state of output of the F 2 -32RM type programmable cam switch to the PLC.

Y030

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.

M660

  • If X000 is turned OFF, the content of the device specified by is not changed.

Reading of ON/OFF information

  • The ON/OFF information being read out is stored in the device specified by , and is handled as octagonal number as shown in the example below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — M660 diagram (page 430)
Fig. 377

M617 M616 M615 M614 M613 M612 M611 M610 Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010

For example, if the Y000 is ON, the M600 is turned ON.

M627 M626 M625 M624 M623 M622 M621 M620 Y027 Y026 Y025 Y024 Y023 Y022 Y021 Y020

M637 M636 M635 M634 M633 M632 M631 M630 Y037 Y036 Y035 Y034 Y033 Y032 Y031 Y030

Auxiliary relay number of FXU, FX2C

RMRD EN s · d1 d2 X040

Page 431 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y030
Page 431 · click to enlarge
Page 431

16.7 RMMN / F2-32RM monitor

16.7 RMMN / F 2 -32RM monitor

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction reads out the rotating speed (rpm) or present angle of the resolver connected to the F2-32RM type programmable cam switch to the PLC.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

RMMN 16 bits Continuous RMMN(EN, s, d1, d2);

Applied Instructions (External FX I/O Device)

RMMNP 16 bits Pulse RMMNP(EN, s, d1, d2);

2. Set data

Variable Description Data type

Applied Instructions (External Device (optional device))

EN Execution condition Bit

Head input number of FX2-24EI connected to F2-32RM. Bit

ENO Execution state Bit

Head output number of FX2-24EI connected to F2-32RM. Bit

Device for storing data of rotating speed and present angle (2 points occupied) ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Data Transfer 2)

z

Function and operation explanation

Applied Instructions (Floating Point)

  • The rotating speed (rpm) or present angle of the resolver connected to the F 2 -32RM type programmable cam switch is read out to the PLC. Whether the rotating speed or the present angle is determined by the setting switch #4 of F 2 -32RM, whether OFF or ON.

Y030

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special adapter.

Monitor of rotating speed or present angle

  • In the device specified by , the data of the rotating speed or the present angle being read out is stored.

In the case of rotating speed (rpm) (actually binary value)

Applied Instructions (Positioning Control)

In the case of present angle (deg) (binary value by rounding down 0.5°)

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · RMMN EN s · d1 d2 · RMMNP EN s · d1 d2 · Input variable · Output variable · Operand · Special · Real Number · Character · String Pointer · type · user · z · z · RMMN EN s · d1 d2 X040
Page 432 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 432 · click to enlarge
Page 432

16.8 BLK / Specify F2-30GM

16.8 BLK / Specify F 2 -30GM

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction specifies the block number for the F2-30GM type pulse output unit from the PLC.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 432)
Fig. 378 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 432)
Fig. 379 · 2. Set data

Head input number of FX2-24EI connected to F2-30GM Bit

Head output number of FX2-24EI connected to F2-30GM Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 432)
Fig. 380 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Page 433 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 433 · click to enlarge
Page 433

16.8 BLK / Specify F2-30GM

Function and operation explanation

  • The block number is specified from the PLC to the F 2 -30GM type pulse output unit. The block number is the content of the device specified by , and the value is BIN, but is valid in a range of 0 to 31 as converted to BCD.

d s2 K0 X040

Y030

  • When using the BCD digital switch as , it is converted to BIN value, and the result must be specified. (Constant K is automatically converted into BIN value, and 0 to 31 can be directly entered.)

Applied Instructions (High Speed Processing)

FXU, FX2C→FX2-30GM Block numbers 0 to 31 (decimal)

  • The content of the device specified by and is determined by the connection position of the FX 2 - 24EI type special block.
  • You must always use this instruction when using the F 2 -30GM. If block number specification is not needed from FX U , FX 2C PLCs to F 2 -30GM, please program as follows.

Applied Instructions (Handy Instruction)

M8000

d s2 K0 X040

Y030

Applied Instructions (External FX I/O Device)

  • In the FX-1GM type pulse output unit, TO instruction is used instead of BLK instruction, and the FX 2 -24EI type interface block is not needed.

Caution

The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

BLK EN s1 · BLK EN s1

Page 434 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 434 · click to enlarge
Page 434

16.9 MCDE / F2-30GM code

16.9 MCDE / F 2 -30GM code

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction sends the M code numbers M0 to M77 to the PLC from the F2-30GM type pulse output unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 434)
Fig. 381 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 434)
Fig. 382 · 2. Set data

Head input number of FX2-24EI connected to F2-30GM Bit

Head output number of FX2-24EI connected to F2-30GM Bit

Bit device for issuing M code number (78 points occupied) Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 434)
Fig. 383 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

  • From F 2 -30GM type pulse output unit, M code number M0 to M77 is sent out to the PLC.

Y030

  • The content of the device specified by , is determined by the connection position of FX 2 -24EI type special block.

M500

FX2-30GM→FXU,FX2C M code number M0 to 77 (octal)

  • When M code output instruction is executed at the F 2 -30GM side, input X is operated according to the value 0 to 77 (octal), and the result is stored in M500 to M577 in octal notation. For example, in the case of M code 23, M523 is turned ON.
  • For the ease of understanding of correspondence of M code number between the PLC side and the F 2 - 30GM side, it is recommended to set 00 in the lower two digits of device M, S specified by .
  • In the FX-1GM type pulse output unit, FROM instruction is used instead of MCDE instruction.

Cautions

The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.

MCDE EN s · d1 d2 X040

Page 435 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ZPOP
Page 435 · click to enlarge
Page 435

17 Applied Instructions (Data Transfer 2)

17. Applied Instructions (Data Transfer 2)

This chapter introduces the instructions for executing complicated processing for fundamental applied instructions and for executing special processing.

Applied Instructions (High Speed Processing)

Instruction name Function Reference

ZPUSH

Batch Store of Index Register Section 17.1 ZPUSHP

ZPOP

Batch POP of Index Register Section 17.2 ZPOPP

Applied Instructions (Handy Instruction)

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 436 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 436 · click to enlarge
Page 436

17 Applied Instructions (Data Transfer 2)

17.1 ZPUSH / Batch Store of Index Register

17.1 ZPUSH / Batch Store of Index Register

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction temporarily retracts the present values of index registers V0 to V7, Z0 to Z7. To return the retracted present values to the original values, use the ZPOP instruction.

→ As for ZPOP instruction, refer to section 17.2.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 436)
Fig. 384 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 436)
Fig. 385 · 2. Set data

Head device for retracting contents of index registers V0 to V7, Z0 to Z7 temporarily [(1+16 × times of retraction) occupied] ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 436)
Fig. 386 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 437 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 437 · click to enlarge
Page 437

17 Applied Instructions (Data Transfer 2)

17.1 ZPUSH / Batch Store of Index Register

Function and operation explanation

1. 16-bit operation (ZPUSH/ZPUSHP)

Command input ZPUSH EN ENO

d Head device for retracting the contents of index register

Applied Instructions (High Speed Processing)

1. Contents of index registers V0 to V7, Z0 to Z7 are temporarily retracted in and after the device specified by . When the contents of index registers are retracted, the number of retracting of the device specified by is incremented by +1.
2. To restore the data, use ZPOP instruction. Use ZPUSH, ZPOP instructions in pair.

Applied Instructions (Handy Instruction)

3. By specifying by the same device, ZPUSH and ZPOP instructions can be used as nesting. In this case, every time the ZPUSH instruction is executed, the region to be used after the device specified by

is added by 16 points each. Hence, you must preliminarily reserve the region for the number of times to be used by nesting.

4. The composition of the data to be retracted after the device specified by is as shown below.

Applied Instructions (External FX I/O Device)

No action of nesting Index register

With action of nesting Index register

Z0 V0 Z1 V1 Z2 V2

Times of retraction +1 +0

Z0 V0 Z1 V1 Z2

Times of retraction +1 +0

+1 to number of times of retraction by ZPUSH instruction

Z0 V0 Z1 V1 Z2 V2

1. ZPUSH instruction

Z0 V0 Z1 V1

Applied Instructions (External Device (optional device))

First time of nesting Times of retraction

Portion of one nesting16 points

Z2

4. ZPOP instruction
2. -1 to number of times of retraction by ZPOP instruction

Z7 V7

Z7 V7

Z7 V7

Z7 V7

2. ZPUSH instruction

Z0 V0 Z1 V1

Second time of nesting Times of retraction

3. ZPOP instruction

Related instructions

Applied Instructions (Data Transfer 2)

ZPOP This instruction restores the index registers V0 to V7, Z0 to Z7 once retracted by ZPUSH instruction.

Cautions

  • Without action of nesting, please clear the number of retraction of the device specified by before execution of ZPUSH instruction.

Applied Instructions (Floating Point)

  • With action of nesting, please clear the number of retraction of the device specified by before first execution.
  • The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

It is an operation error in the following case, and error flag M8067 is turned ON, and error code is stored in D8067.

  • When the range of the number of points used after the device specified by by ZPUSH exceeds the range of the corresponding device. (Error code: K6706)

Applied Instructions (Positioning Control)

  • In ZPUSH instruction execution, when the number of retraction of the device specified by is negative. (Error code: K6707)
Show 15 more labels / short text on this page
Retraction data · Retraction data · 1) · +3 +2 · Times of retraction · +3 +2 · +5 +4 · +5 +4 · +6 · +16 +15 · +16 +15 · +17 · +19 +18 · +20 · Instruction Content
Page 438 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 438 · click to enlarge
Page 438

17 Applied Instructions (Data Transfer 2)

17.1 ZPUSH / Batch Store of Index Register

Program example

This is a program for retracting the contents of index registers Z0 to Z7, V0 to V7 before execution of subroutine program after D0, when using the index register in the subroutine after pointer P0.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 438)
Fig. 387 · Program example

RST(M8002, D0); MOVP(X005, K5, V0); MOVP(NOT X005, K10, V0); OUT(X000V0, Y000); ZPUSH(M8000, D0);

FBDD( ); Function block of the function corresponding to the subroutine program.

Page 439 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 439 · click to enlarge
Page 439

17 Applied Instructions (Data Transfer 2)

17.2 ZPOP / Batch POP of Index Register

17.2 ZPOP / Batch POP of Index Register

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction returns the contents of index registers V0 to V7, Z0 to Z7 once retracted by the ZPUSH instruction to the original state.

→ As for ZPUSH instruction, refer to section 17.1.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

ZPOP EN ENO

ZPOP 16 bits Continuous ZPOP(EN, d);

ZPOPP EN ENO

Applied Instructions (External FX I/O Device)

ZPOPP 16 bits Pulse ZPOPP(EN, d);

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Head device once retracting the contents of index registers V0 to V7, Z0 to Z7 [(1+16 × times of retraction) occupied] ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Data Transfer 2)

Function and operation explanation

1. 16-bit operation (ZPOP/ZPOPP) → As for the function and operation, refer to section 17.1.

Command input ZPOP EN ENO

Applied Instructions (Floating Point)

d Head device once retracting the contents of index registers

1. The contents of index registers Z0 to Z7, V0 to V7 once retracted after the device specified by by ZPUSH instruction are restored in the original index register. When the contents of the index register are restored, the number of retraction of the device specified by is processed by -1.
2. Use ZPUSH instruction for temporary retraction of data. Use ZPUSH, ZPOP instructions in pair.

Applied Instructions (Positioning Control)

Show 12 more labels / short text on this page
Instruction · name Operation Execution · form · Output variable · Special · Real Number · Character · Operand · String Pointer · type · user · z z
Page 440 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 440 · click to enlarge
Page 440

17 Applied Instructions (Data Transfer 2)

17.2 ZPOP / Batch POP of Index Register

Related instructions

ZPUSH This instruction temporarily retracts the present values of index registers V0 to V7, Z0 to Z7.

Caution

  • The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

It is an operation error in the following case, and error flag M8067 is turned ON, and error code is stored in D8067.

  • When the content of the number of retraction of the device specified by during execution of ZPOP instruction is 0 or negative. (Error code: K6706)

Program example

→ As for program examples, refer to section 17.1.

Instruction Content

Page 441 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DATAN
Page 441 · click to enlarge
Page 441

18 Applied Instructions (Floating Point)

18. Applied Instructions (Floating Point)

This chapter introduces the instructions for conversion, comparison, arithmetic operations, square root operation, trigonometry, etc. for floating point operations.

Applied Instructions (High Speed Processing)

Instruction name Function Reference

DECMP

Floating Point Compare Section 18.1 DECMPP

DEZCP

Floating Point Zone Compare Section 18.2 DEZCPP

DEMOV

Applied Instructions (Handy Instruction)

Floating Point Move Section 18.3 DEMOVP

DESTR

Floating Point to Character String Conversion Section 18.4 DESTRP

DEVAL

Character String to Floating Point Conversion Section 18.5 DEVALP

Applied Instructions (External FX I/O Device)

DEBCD

Floating Point to Scientific Notation Conversion Section 18.6 DEBCDP

DEBIN

Scientific Notation to Floating Point Conversion Section 18.7 DEBINP

DEADD

Floating Point Addition Section 18.8 DEADDP

Applied Instructions (External Device (optional device))

DESUB

Floating Point Subtraction Section 18.9 DESUBP

DEMUL

Floating Point Multiplication Section 18.10 DEMULP

DEDIV

Floating Point Division Section 18.11 DEDIVP

DEXP

Floating Point Exponent Section 18.12 DEXPP

DLOGE

Floating Point Natural Logarithm Section 18.13 DLOGEP

DLOG10

Floating Point Common Logarithm Section 18.14 DLOG10P

Applied Instructions (Data Transfer 2)

DESQR

Floating Point Square Root Section 18.15 DESQRP

DENEG

Floating Point Negation Section 18.16 DENEGP

INT

Floating Point to Integer Conversion Section 18.17 INTP

Applied Instructions (Floating Point)

DINT

DINTP

DSIN

Floating Point Sine Section 18.18 DSINP

DCOS

Floating Point Cosine Section 18.19 DCOSP

DTAN

Floating Point Tangent Section 18.20 DTANP

DASIN

Floating Point Arc Sine Section 18.21 DASINP

DACOS

Floating Point Arc Cosine Section 18.22 DACOSP

Applied Instructions (Positioning Control)

DATAN

Floating Point Arc Tangent Section 18.23 DATANP

Page 442 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DDEG
Page 442 · click to enlarge
Page 442

18 Applied Instructions (Floating Point) FXCPU Structured Programming Manual [Basic & Applied Instruction]

Instruction name Function Reference

DRAD

Floating Point Degrees to Radians Conversion Section 18.24 DRADP

DDEG

Floating Point Radians to Degrees Conversion Section 18.25 DDEGP

Page 443 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 443 · click to enlarge
Page 443

18 Applied Instructions (Floating Point)

18.1 DECMP / Floating Point Compare

18.1 DECMP / Floating Point Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction compares two data (binary floating decimal point), and issues the result of greater, smaller, or equal to the bit device (3 points).

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DECMP EN s1 s2

DECMP 32 bits Continuous DECMP(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

DECMPP EN s1 s2

DECMPP 32 bits Pulse DECMPP(EN, s1, s2, d);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating point data to be compared FLOAT(Single Precision)

Device for storing binary floating point data to be compared FLOAT(Single Precision)

ENO Execution state Bit

Head bit device for output of result (3 points occupied) ARRAY [0..2] OF Bit

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System user Special

unit Index Con stant

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S4

z S1 S2 z S4

z z z S3 z

Applied Instructions (Floating Point)

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 10 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Real Number · Character · Operand · String Pointer · type
Page 444 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 444 · click to enlarge
Page 444

18.1 DECMP / Floating Point Compare FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DECMP, DECMPP)

The compared value specified by and the comparison source specified by are compared as floating decimal point data, and depending on the result of greater, smaller, or equal, any bit of devices ( , +1, and +2) specified by is turned ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 444)
Fig. 388 · Function and operation explanation

Device for storing binary floating decimal point data (data 1) to be compared Device for storing binary floating decimal point data (data 2) to be compared

To define the device for storing binary floating decimal point data (data 1) to be compared. *1.

To define the device for storing binary floating decimal point data (data 2) to be compared. *2.

If the command input is OFF and DECMP instruction cannot be executed, the device specified by holds the state before the command input is turned OFF.

Cautions

1. Number of devices occupied

occupies 3 points. Be careful not to overlap with the devices used in other applications.

2. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.

However, index decoration is not applicable. S4: The FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.

Page 445 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 445 · click to enlarge
Page 445

18 Applied Instructions (Floating Point)

18.2 DEZCP / Floating Point Zone Compare

18.2 DEZCP / Floating Point Zone Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction compares the comparison range of upper and lower two points and the data (binary floating decimal point), and issues the result to the bit device (3 points) depending on the greater, smaller or the band.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DEZCP EN s1 s2

DEZCP 32 bits Continuous DEZCP(EN, s1, s2, s3, d);

Applied Instructions (External FX I/O Device)

DEZCPP EN s1 s2

DEZCPP 32 bits Pulse DEZCPP(EN, s1, s2, s3, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating point data to be compared FLOAT(Single Precision)

Device for storing binary floating point data to be compared FLOAT(Single Precision)

Device for storing binary floating point data to be compared FLOAT(Single Precision)

ENO Execution state Bit

Head bit device for output of result (3 points occupied) ARRAY [0..2] OF Bit

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System user Special

unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Floating Point)

z S1 S1 z S1

z S1 S1 z S1

z S1 S1 z S1

z z z S2 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 12 more labels / short text on this page
Instruction · name Operation Execution · form · s3 · s3 · Input variable · Output variable · Operand · Real Number · Character · String Pointer · type
Page 446 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Comparison data of and
Page 446 · click to enlarge
Page 446

18.2 DEZCP / Floating Point Zone Compare FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEZCP, DEZCPP)

The compared value specified by , and the comparison source specified by are compared as floating decimal point data, and depending on the result of smaller, within range, or greater, any bit of devices ( , +1, and +2) specified by is turned ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 446)
Fig. 389 · Function and operation explanation

Head bit device for output of result Device for storing binary floating decimal point data (data 1) to be compared Device for storing binary floating decimal point data (data 2) to be compared Device for storing binary floating decimal point data (data 3) to be compared

If the command input is OFF and DEZCP instruction cannot be executed, the device specified by holds the state before the command input is turned OFF.

Cautions

1. Number of devices occupied

occupies 3 points. Be careful not to overlap with the devices used in other applications.

2. Comparison data of and

The magnitude relation of comparison data is £ . In the case of > , the value of is regarded to be same as , and is compared.

3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

However, index decoration is not applicable.

Page 447 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.3 DEMOV / Floating Point Move
Page 447 · click to enlarge
Page 447
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.3 DEMOV / Floating Point Move diagram (page 447)
Fig. 390 · 18.3 DEMOV / Floating Point Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Binary floating decimal point data of transfer source, or device storing the data

Transfer destination device of binary floating decimal point data FLOAT(Single Precision)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 448 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 448 · click to enlarge
Page 448

18.3 DEMOV / Floating Point Move FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEMOV/DEMOVP)

The content (binary floating decimal point data) of transfer source of device specified by is transferred to the device specified by . Real number (E) can be directly specified in the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 448)
Fig. 391 · Function and operation explanation

Program example

1. This is a program for storing the real number of D11, D10 in D1, D0 when X007 is turned ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 448)
Fig. 392 · Program example

36.475 36.475 D1 D0 D11 D10 X007 DEMOVP EN ENO

2. This is a program for storing the real number -1.23 in D11, D10 when X007 is turned ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 448)
Fig. 393 · Program example

Cautions

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Page 449 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 449 · click to enlarge
Page 449

18 Applied Instructions (Floating Point)

18.4 DESTR / Floating Point to Character String Conversion

18.4 DESTR / Floating Point to Character String Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction converts the binary floating decimal point data into character string (ASCII code) in a specified number of digits. You can also use the STR instruction for converting BIN data into character string (ASCII code).

→ As for character string, refer to FX Structured Programming Manual [Device & Common]. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common]. → As for STR instruction, see section 26.1.

Applied Instructions (Handy Instruction)

1. Format and operation, execution form

Expression in each language

DESTR EN s1 s2

Applied Instructions (External FX I/O Device)

DESTR 32 bits Continuous DESTR(EN, s1, s2, d1);

DESTRP EN s1 s2

DESTRP 32 bits Pulse DESTRP(EN, s1, s2, d1);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Binary floating decimal point data to be converted, or device storing the data FLOAT(Single

Head device storing the display specification of the numeric value to be converted (3 points occupied).

ARRAY [0..2] OF ANY16

ENO Execution state Bit

Head of the storing destination device of the converted character string (all digits + 1) ÷2 points occupied (fractions are rounded up). String

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System user Special

unit Index Con stant

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Applied Instructions (Floating Point)

z

z

z

Applied Instructions (Positioning Control)

Show 11 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Precision) · Output variable · Operand · Real Number · Character · String Pointer · type
Page 450 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. In the case of decimal point type
Page 450 · click to enlarge
Page 450

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DESTR/DESTRP)

The content (binary floating decimal point data) of the device specified by is converted into character string depending on the content of the device specified by , and stored in or after the device specified by . Real number can be directly specified in the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 450)
Fig. 394 · Function and operation explanation

d1 Binary floating decimal point data to be converted Head of the storing destination device of the converted character string Head device storing the display specification of the numeric value to be converted.

  • The converted data differs depending on the display specification specified by .

The converted data differs depending on the type of .

2. In the case of decimal point type

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. In the case of decimal point type diagram (page 450)
Fig. 395 · 2. In the case of decimal point type

ASCII code of digit number (all digits specified value - 1)

ASCII code of digit number (all digits specified value - 3)

ASCII code of digit number (all digits specified value - 2)

ASCII code of digit number (all digits specified value - 5)

ASCII code of digit number (all digits specified value - 7)

ASCII code of digit number (all digits specified value - 6)

To be stored automatically at the end of character string.

  • The number of all digits that can be specified by +1 is as follows. (Maximum: 24 digits) When the number of digits below decimal point is "0" . . . . . . . . . . . .All digits ≥ 2 When the number of digits below decimal point is other than "0". . . .All digits ≥ (decimal digits + 3)
  • Decimal digits that can be specified by +2 is 0 to 7 digits. However, please set in the range of decimal digits ≤ (all digits - 3).
Page 451 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 32H(2)
Page 451 · click to enlarge
Page 451

18 Applied Instructions (Floating Point)

18.4 DESTR / Floating Point to Character String Conversion

For example, in the case of all digits of 8 and decimal digits of 3, when -1.23456 is specified, the data after

is stored as follows.

Number of digits below decimal point

2DH(-)

Applied Instructions (High Speed Processing)

31H(1)

1 2 3 5

32H(2)

2EH(.)

35H(5)

33H(3)

0000H

Applied Instructions (Handy Instruction)

-1.23456

To be stored automatically at the end of character string.

Binary floating decimal point (real number)

  • The converted character string data is stored in the device after as follows. - For the sign, "20H" (space) is stored when the binary floating decimal point data is positive, and "2DH" (-) is stored when negative. - When the decimal part of binary floating decimal point data does not settle within the decimal digits, the lower decimal digits are rounded off.

Applied Instructions (External FX I/O Device)

0. Decimal point type

Applied Instructions (External Device (optional device))

2 (Number of digits below decimal point)

Number of digits below decimal point

Rounded off. +1

-1.23456

- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the specified decimal digits + 1 digit. However, when the number of decimal digits is "0", "2EH" (.) is not stored.

0. Decimal point type

2 (Number of digits below decimal point)

Applied Instructions (Data Transfer 2)

Added automatically. +1

Number of digits below decimal point

-1.23456

- When the number of digits subtracting the sign, decimal point, and decimal part from the total number of digits is greater than the integer part of the binary floating decimal point data, "20H" (space) is inserted between the sign and the integer part.

Applied Instructions (Floating Point)

"20H" (space) is inserted. +1

Number of digits below decimal point

-1.23456

- "00H" or "0000H" is automatically stored at the end of the converted character string.

Applied Instructions (Positioning Control)

Show 44 more labels / short text on this page
s2 · All digits · s2 · +1 · b15 · b8 b7 b0 · s2 · +2 · 20H(space) · +1 · 20H(space) · +2 · Sign · +3 · s1 · +1 · d s1 · +4 · s2 · s2 · +1 · 8 (All digits) · All digits · s2 · +2 · s1 · s1 · s2 · s2 · +1 · 8 (All digits) · All digits · s2 · +2 · s1 · s1 · s2 · s2 · +1 · All digits · s2 · +2 · s1 · s1
Page 452 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. In the case of exponential type
Page 452 · click to enlarge
Page 452

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

3. In the case of exponential type

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. In the case of exponential type diagram (page 452)
Fig. 396 · 3. In the case of exponential type

ASCII code of digit number (all digits specified value - 1)

ASCII code of digit number (all digits specified value - 2)

ASCII code of digit number (all digits specified value - 5)

ASCII code of digit number (all digits specified value - 4)

ASCII code of digit number (all digits specified value - 7)

ASCII code of digit number (all digits specified value - 6)

ASCII code of digit number (all digits specified value - 11)

ASCII code of digit number (all digits specified value - 10)

To be stored automatically at the end of character string.

  • The number of all digits that can be specified by +1 is as follows. (Maximum: 24 digits) When the number of digits below decimal point is "0" . . . . . . . . . . . .No. of digits ≥ 6 When the number of digits below decimal point is other than "0". . . .No. of digits ≥ (decimal digits + 7)
  • Decimal digits that can be specified by +2 is 0 to 7 digits. Please set within the range of decimal digits ≤ (total digits - 7).

For example, in the case of all digits of 12 and decimal digits of 4, when -12.34567 is specified, the data after

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. In the case of exponential type diagram (page 452)
Fig. 397 · 3. In the case of exponential type

To be stored automatically at the end of character string.

Page 453 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related instructions
Page 453 · click to enlarge
Page 453

18 Applied Instructions (Floating Point)

18.4 DESTR / Floating Point to Character String Conversion

  • The converted character string data is stored in the device after as follows. - For the sign of integer part, "20H" (space) is stored when the binary floating decimal point data is positive, and "2DH" (-) is stored when negative. - The integer part is fixed in one digit. Between the integer part and the sign, "20H" (space) is inserted.

Applied Instructions (High Speed Processing)

2 3 4 6 E + 1 1

"20H" (space) is inserted.

-12.34567

Applied Instructions (Handy Instruction)

- When the decimal part of binary floating decimal point data does not settle within the decimal digits, the lower decimal digits are rounded off.

Applied Instructions (External FX I/O Device)

0 2 3 4 6 E + 1 1 6 7

Rounded and discarded. +1

Number of digits below decimal point (4)

-12.34567

- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the specified decimal digits + 1 digit. However, when the number of decimal digits is "0", "2EH" (.) is not stored.

Applied Instructions (External Device (optional device))

0 2 3 4 6 E + 1 1

Number of digits below decimal point (4)

Added automatically. +1

-12.34567

- For the sign of exponential part, "2BH" (+) is stored when the index is positive, and "2DH" (-) is stored when negative. - The exponential part is fixed in two digits. When the exponential part is one digit, between the exponential part and the sign, "30H" (0) is inserted.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

2 3 4 6 E + 1 1

"30H" (0) is inserted.

-12.34567

- "00H" or "0000H" is automatically stored at the end of the converted character string.

Related instructions

EVAL This instruction converts the character string (ASCII code) data into binary floating decimal point data.

STR This instruction converts BIN data into character string (ASCII code).

Applied Instructions (Positioning Control)

VAL This instruction converts the character string (ASCII code) data into BIN data.

Show 37 more labels / short text on this page
s2 · All digits (12) · s2 · +1 · 1 digit fixed · s2 · +2 · +1 · s1 · s1 · s2 · s2 · +1 · All digits (12) · +2 · s2 · s1 · s1 · s2 · s2 · +1 · All digits (12) · s2 · +2 · s1 · s1 · All digits (12) · s2 · s2 · +1 · 2 digits fixed · s2 · +2 · s1 · +1 · s1 · Instruction Content
Page 454 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 454 · click to enlarge
Page 454

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Error

In the following cases, it is an operation error, and error flag (M8067) is turned ON, and error code is stored in D8067.

  • When is not within the following range. (Error code: K6706) 0, ±2 -126 ≤ < ±2 128
  • When the type specification specified by is other than 0, 1. (Error code: K6706)
  • When the all digits specification specified by +1 is out of the following range. (Error code: K6706) In the case of decimal point type

When the number of digits below decimal point is "0" All digits ≥ 2 When the number of digits below decimal point is other than "0" . . All digits ≥ (decimal digits + 3) In the case of exponential type

When the number of digits below decimal point is "0" All digits ≥ 6 When the number of digits below decimal point is other than "0" . . All digits ≥ (decimal digits + 7)

  • When the decimal digits specification specified by +2 is out of the following range. (Error code: K6706) In the case of decimal point type: Decimal digits ≤ (all digits - 3) In the case of index type: Decimal digits ≤ (all digits - 7)
  • When the device range for storing the character string specified by is over the range of the corresponding device. (Error code: K6706)
  • When the result of conversion exceeds the specified all digits. (Error code: K6706)
Page 455 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.4 DESTR / Floating Point to Character String Conversion
Page 455 · click to enlarge
Page 455
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.4 DESTR / Floating Point to Character String Conversion diagram (page 455)
Fig. 398 · 18.4 DESTR / Floating Point to Character String Conv…

18.4 DESTR / Floating Point to Character String Conversion

1. This is a program for converting the content (binary floating decimal point data) of R0, R1 depending on the content specified by R10 to R12 when the X000 is turned ON, and storing after the D0.
2. This is a program for converting the content (binary floating decimal point data) of R0, R1 depending on the content specified by R10 to R12 when the X000 is turned ON, and storing after the D10.

Number of digits below decimal point Space R1 R0 0.0327457 20H(space)

Page 456 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 456 · click to enlarge
Page 456

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.5 DEVAL / Character String to Floating Point Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the character string (ASCII code) into binary floating decimal point data. You can also use the VAL instruction for converting the character string (ASCII code) into BIN data.

→ As for character string, refer to FX Structured Programming Manual [Device & Common]. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common]. → As for VAL instruction, refer to section 26.2.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 456)
Fig. 399 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 456)
Fig. 400 · 2. Set data

Head device storing the character string to be converted into binary floating point decimal data. String

Device for storing the converted binary floating point decimal data. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 456)
Fig. 401 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Function and operation explanation

1. 32-bit operation (EVAL/EVALP) The character string stored after the device specified by is converted into binary decimal floating point data, and stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 456)
Fig. 402 · Function and operation explanation

d s Head device storing the character string to be converted into binary floating point decimal data

Device for storing the converted binary floating point decimal data

Page 457 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.5 DEVAL / Character String to Floating Point Conversion
Page 457 · click to enlarge
Page 457
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.5 DEVAL / Character String to Floating Point Conversion diagram (page 457)
Fig. 403 · 18.5 DEVAL / Character String to Floating Point Conv…

18.5 DEVAL / Character String to Floating Point Conversion

The character string specified can be converted into binary floating point decimal data whether in decimal point type or in specified type.

3 2 0 1 1 + 1 0 E

  • When the character string to be converted into the binary floating decimal point specified by is more than 7 digits excluding the sign, decimal point, and the exponential part, the data after the seventh digit is cut off.

3 0 1 1 5 8 1 2 6

Page 458 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.5 DEVAL / Character String to Floating Point Conversion
Page 458 · click to enlarge
Page 458

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

b) In the case of exponential type

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.5 DEVAL / Character String to Floating Point Conversion diagram (page 458)
Fig. 404 · 18.5 DEVAL / Character String to Floating Point Conv…

5 0 3 3 4 2 E 1 1 0 2

  • To be converted as positive value when "2BH" (+) is specified by the sign or the sign is omitted in the decimal point type. To be converted as negative value when "2DH" (-) is specified by the sign.
  • To be converted as positive value when "2BH" (+) is specified in the exponential part sign or the sign is omitted in the exponential type. To be converted as negative value when "2DH" (-) is specified in the exponential part sign.
  • When "20H" (space) or "30H" (0) is present among the numeric values except for the first "0" in the character string specified by , "20H" or "30H" is ignored in the converting operation.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.5 DEVAL / Character String to Floating Point Conversion diagram (page 458)
Fig. 405 · 18.5 DEVAL / Character String to Floating Point Conv…
  • When "30H" (0) is present between "E" and the numeric value in the character string in the exponential type, "30H" is ignored in the converting operation.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.5 DEVAL / Character String to Floating Point Conversion diagram (page 458)
Fig. 406 · 18.5 DEVAL / Character String to Floating Point Conv…

4 5 3 0 E 0 3 + 1

  • The character string can be set in a maximum of 24 characters. In the character string, "20H" (space) or "30H" (0) is counted as one character.
Page 459 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 459 · click to enlarge
Page 459

18 Applied Instructions (Floating Point)

18.5 DEVAL / Character String to Floating Point Conversion

Related devices

→ As for the manner of using the zero, borrow, or carry flag, refer to the FX Structured Programming

Manual [Device & Common].

The conversion result is really zero (when the mantissa part is "0")

Applied Instructions (High Speed Processing)

Zero flag (M8020) is ON.

M8021 Borrow Absolute value of conversion

The value of is the smallest value (2-126) of 32-bit real number, and borrow flag (M8021) is ON.

result < 2-126

M8022 Carry Absolute value of conversion

The value of is the largest value (2128) of 32-bit real number, and carry flag (M8022) is ON.

result ≥ 2128

Applied Instructions (Handy Instruction)

Related instructions

ESTR This instruction converts the binary floating decimal point data into character string (ASCII code).

STR This instruction converts BIN data into character string (ASCII code).

VAL This instruction converts the character string (ASCII code) data into BIN data.

Applied Instructions (External FX I/O Device)

Error

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When other characters than "30H" (0) to "39H" (9) are present in the integer part or the decimal part. (Error code : K6706)

Applied Instructions (External Device (optional device))

  • When two or more "2EH" (.) are present in the character string specified by . (Error code : K6706)
  • When other characters than "45H" (E), "2BH" (+), or "2DH" (-) are present in the exponential part, or when there are plural exponential parts. (Error code : K6706)
  • When "00H" is not present in the corresponding device range from . (Error code : K6706)
  • When the number of characters after is 0 or exceeds 24 characters. (Error code : K6706)

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 5 more labels / short text on this page
Content · Device Name · Condition Operation · M8020 Zero · Instruction Content
Page 460 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 460 · click to enlarge
Page 460

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Program example

1. This is a program for converting the character string stored after R0 when the X000 is turned ON, into binary floating decimal point, and storing in D0, D1.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 460)
Fig. 407 · Program example
2. This is a program for converting the character string stored after D10 when the X000 is turned ON, into binary floating decimal point, and storing in D100, D101.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 460)
Fig. 408 · Program example

Operation in overflow, underflow, zero mode

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 460)
Fig. 409 · Program example

The value of is the smallest value (2-126) of 32-bit real number, and borrow flag (M8021) is ON.

≥ 2128 The value of is the largest value (2128) of 32-bit real number, and carry flag (M8022) is ON.

The conversion result is really zero (when the mantissa part is "0") Zero flag (M8020) is ON.

Page 461 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.6 DEBCD / Floating Point to Scientific Notation Conversion
Page 461 · click to enlarge
Page 461
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.6 DEBCD / Floating Point to Scientific Notation Conversion diagram (page 461)
Fig. 410 · 18.6 DEBCD / Floating Point to Scientific Notation C…

18.6 DEBCD / Floating Point to Scientific Notation Conversion

18.6 DEBCD / Floating Point to Scientific Notation Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the binary floating decimal point in the device into decimal floating decimal point.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Device for storing binary floating decimal point data. FLOAT(Single Precision)

Device for storing the converted decimal floating decimal point data. ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 462 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 462 · click to enlarge
Page 462

18.6 DEBCD / Floating Point to Scientific Notation Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEBCD, DEBCDP) The binary floating decimal point of the device specified by is converted into decimal floating decimal point, and is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 462)
Fig. 411 · Function and operation explanation

[ +1, ] → [ +1, ] DEBCD EN ENO

d s s d Device for storing the binary floating decimal point data

Device for storing the converted decimal floating decimal point data

b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 Before execution Mantissa part (23 bits)

Lower position b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Higher position

b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 After execution Mantissa part Exponential part

Cautions

1. In the floating decimal point operation, all operations are executed at the binary floating decimal point. However, since the binary floating decimal point is a difficult numeric value (exclusive monitor method), by converting it into decimal floating decimal point, it is easier for monitoring by peripheral devices or the like. Meanwhile, GX Works 2 or GOT is provided with a function for monitoring or displaying the binary floating decimal point directly.
2. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.
Page 463 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.7 DEBIN / Scientific Notation to Floating Point Conversion
Page 463 · click to enlarge
Page 463
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.7 DEBIN / Scientific Notation to Floating Point Conversion diagram (page 463)
Fig. 412 · 18.7 DEBIN / Scientific Notation to Floating Point C…

18.7 DEBIN / Scientific Notation to Floating Point Conversion

18.7 DEBIN / Scientific Notation to Floating Point Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the decimal floating decimal point in the device into binary floating decimal point.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Device for storing decimal floating decimal point data. ANY32

Device for storing the converted binary floating decimal point data. FLOAT(Single Precision)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 464 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 464 · click to enlarge
Page 464

18.7 DEBIN / Scientific Notation to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEBIN, DEBINP)

The decimal floating decimal point of the device specified by is converted into binary floating decimal point, and is transferred to the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 464)
Fig. 413 · Function and operation explanation

[ +1, ] → [ +1, ] DEBIN EN ENO

d s s d Device for storing the decimal floating decimal point data

Device for storing the converted binary floating decimal point data

Lower position b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Higher position

b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 Before execution Mantissa part Exponential part

b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 After execution

Cautions

1. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

Program example

By using the DEBIN instruction, the numeric value including the decimal point can be directly converted into the binary floating decimal point.

ExampleBinary floating decimal point conversion of 3.14

3.14=314×10-2 (Decimal floating decimal point)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 464)
Fig. 414 · Program example

→ As for program example of floating decimal point operation, refer to section 11.10.

Page 465 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DEADD EN
Page 465 · click to enlarge
Page 465

18 Applied Instructions (Floating Point)

18.8 DEADD / Floating Point Addition

18.8 DEADD / Floating Point Addition

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction adds two binary floating decimal points.

→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DEADD EN s1 s2

DEADD 32 bits Continuous DEADD(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

DEADDP EN s1 s2

DEADDP 32 bits Pulse DEADDP(EN, s1, s2, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating decimal point data to be added. FLOAT(Single Precision)

Device for storing binary floating decimal point data to be added. FLOAT(Single Precision)

ENO Execution state Bit

Device for storing the added binary floating decimal point data. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

Applied Instructions (Data Transfer 2)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S3

z S1 S2 z S3

z S1 S2 z

Applied Instructions (Floating Point)

S: Refer to "Cautions".

Function and operation explanation

1. 32-bit operation (DEADD, DEADDP)

The binary floating decimal point data in the device specified by and in the device specified by are added, and the result is transferred to the device specified by in binary floating decimal point.

DEADD EN

Device for storing binary floating decimal point data to be added Device for storing binary floating decimal point data to be added

Device for storing the added binary floating decimal point data

[ +1, ] + [ +1, ] → [ +1, ]

d s1 s2 s1 s2 d

Applied Instructions (Positioning Control)

Binary floating decimal point

Binary floating decimal point

Binary floating decimal point

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · Command input · s1 · s2
Page 466 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 466 · click to enlarge
Page 466

18.8 DEADD / Floating Point Addition FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Cautions

1. When the same devices are specified, the same device numbers can be specified in and and . In this case, when the continuous execution type instruction (DEADD) is used, it must be noted that the addition result changes in every operation cycle.
2. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
Page 467 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 467 · click to enlarge
Page 467

18 Applied Instructions (Floating Point)

18.9 DESUB / Floating Point Subtraction

18.9 DESUB / Floating Point Subtraction

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction subtracts two binary floating decimal points.

→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &

Common].

Applied Instructions (Handy Instruction)

1. Format and operation, execution form

Expression in each language

DESUB EN s1 s2

DESUB 32 bits Continuous DESUB(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

DESUBP EN s1 s2

DESUBP 32 bits Pulse DESUBP(EN, s1, s2, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating decimal point data to be subtracted. FLOAT(Single Precision)

Device for storing binary floating decimal point data to be subtracted. FLOAT(Single Precision)

ENO Execution state Bit

Device for storing the subtracted binary floating decimal point data. FLOAT(Single Precision)

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S3

Applied Instructions (Floating Point)

z S1 S2 z S3

z S1 S2 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type
Page 468 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 468 · click to enlarge
Page 468

18.9 DESUB / Floating Point Subtraction FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DESUB, DESUBP)

The binary floating decimal point data in the device specified by are subtracted from the device specified by , and the result is transferred to the device specified by in binary floating decimal point.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 468)
Fig. 415 · Function and operation explanation

Device for storing binary floating decimal point data to be subtracted

Device for storing the subtracted binary floating decimal point data

Device for storing binary floating decimal point data to be subtracted

[ +1, ] - [ +1, ] → [ +1, ]

Cautions

1. When the same devices are specified, the same device numbers can be specified in and and . In this case, when the continuous execution type instruction (DESUB) is used, it must be noted that the subtraction result changes in every operation cycle.
2. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
Page 469 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 469 · click to enlarge
Page 469

18 Applied Instructions (Floating Point)

18.10 DEMUL / Floating Point Multiplication

18.10 DEMUL / Floating Point Multiplication

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction multiplies two binary floating decimal points.

→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DEMUL EN s1 s2

DEMUL 32 bits Continuous DEMUL(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

DEMULP EN s1 s2

DEMULP 32 bits Pulse DEMULP(EN, s1, s2, d);

2. Set data

Applied Instructions (External Device (optional device))

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating decimal point data to be multiplied. FLOAT(Single Precision)

Device for storing binary floating decimal point data to be multiplied. FLOAT(Single Precision)

ENO Execution state Bit

Device for storing the multiplied binary floating decimal point data. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

Applied Instructions (Data Transfer 2)

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S3

z S1 S2 z S3

Applied Instructions (Floating Point)

z S1 S2 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant
Page 470 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 470 · click to enlarge
Page 470

18.10 DEMUL / Floating Point Multiplication FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEMUL, DEMULP)

The binary floating decimal point data in the device specified by and in the device specified by are multiplied, and the result is transferred to the device specified by in binary floating decimal point.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 470)
Fig. 416 · Function and operation explanation

Device for storing binary floating decimal point data to be multiplied Device for storing binary floating decimal point data to be multiplied

Device for storing the multiplied binary floating decimal point data

[ +1, ] × [ +1, ] → [ +1, ]

Cautions

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
Page 471 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 471 · click to enlarge
Page 471

18 Applied Instructions (Floating Point)

18.11 DEDIV / Floating Point Division

18.11 DEDIV / Floating Point Division

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction divides two binary floating decimal points.

→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &

Common].

Applied Instructions (Handy Instruction)

1. Format and operation, execution form

Expression in each language

DEDIV EN s1 s2

DEDIV 32 bits Continuous DEDIV(EN, s1, s2, d);

Applied Instructions (External FX I/O Device)

DEDIVP EN s1 s2

DEDIV 32 bits Pulse DEDIVP(EN, s1, s2, d);

Applied Instructions (External Device (optional device))

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating decimal point data to be divided. FLOAT(Single Precision)

Device for storing binary floating decimal point data to be divided. FLOAT(Single Precision)

ENO Execution state Bit

Device for storing the divided binary floating decimal point data. FLOAT(Single Precision)

Applied Instructions (Data Transfer 2)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S3

Applied Instructions (Floating Point)

z S1 S2 z S3

z S1 S2 z

S: Refer to "Cautions".

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type
Page 472 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 472 · click to enlarge
Page 472

18.11 DEDIV / Floating Point Division FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Function and operation explanation

1. 32-bit operation (DEDIV, DEDIVP)

The binary floating decimal point data in the device specified by and in the device specified by are divided, and the result is transferred to the device specified by in binary floating decimal point.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 472)
Fig. 417 · Function and operation explanation

Device for storing binary floating decimal point data to be divided

Device for storing the divided binary floating decimal point data

Device for storing binary floating decimal point data to be divided

[ +1, ] ÷ [ +1, ] → [ +1, ]

Cautions

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
Page 473 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Binary floating decimal point (real number) e
Page 473 · click to enlarge
Page 473

18 Applied Instructions (Floating Point)

18.12 DEXP / Floating Point Exponent

18.12 DEXP / Floating Point Exponent

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction executes exponential operation whose base is "e (2.71828)".

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DEXP EN ENO

DEXP 32 bits Continuous DEXP(EN, s, d);

DEXPP EN ENO

Applied Instructions (External FX I/O Device)

DEXPP 32 bits Pulse DEXPP(EN, s, d);

2. Set data

Variable Description Data type

EN Execution condition Bit

Applied Instructions (External Device (optional device))

Head device for storing binary floating decimal point data for exponential operation.

ENO Execution state Bit

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Applied Instructions (Data Transfer 2)

z

Function and operation explanation

1. 32-bit operation (DEXP/DEXPP)

Applied Instructions (Floating Point)

By exponential operation of the device specified by , the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .

Command input DEXP EN ENO

Head device for storing binary floating decimal point data for exponential operation

Head device for storing the operation result

  • In exponential operation, the bottom (e) is supposed to be 2.71828.

d s d s

Binary floating decimal point (real number) e

Binary floating decimal point (real number)

Applied Instructions (Positioning Control)

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · d s · d s · Input variable · FLOAT(Single Precision) · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · d s · +1 · +1
Page 474 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10 = e
Page 474 · click to enlarge
Page 474

18.12 DEXP / Floating Point Exponent FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Error

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When the operation result is out of the following range. (Error code: K6706) 2 -126 ≤ | Operation result | < 2 128

Program example

This is a program for executing exponential operation of the values set in BCD two digits in X020 to X027 when the X000 is turned ON, and storing in binary floating decimal points D0, D1.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 474)
Fig. 418 · Program example

Checking of range of operation values (see the following check point 1).

Input data is converted into binary floating decimal point (real number).(2))

The Load compare instruction (LD>) is not available in ST.

Operation when 13 is specified in X020 to X027.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 474)
Fig. 419 · Program example
2. Conversion of binary floating decimal point (real number) 3) EXP conversion

Points

1. The operation result is less than 2 128 only when the BCD value of X020 to X027 is smaller than 88, because log e 2 128 = 88.7. When a value greater than 89 is specified, it is an operation error, and therefore when a value greater than 89 is specified, M0 is turned ON, so that the operation is not carried out.
2. Conversion from natural logarithm into common logarithm The CPU operates in natural logarithm. To determine value in common logarithm, please specify the value of common logarithm divided by 0.4342945 in +1, .

10 = e

0.4342945

Page 475 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 475 · click to enlarge
Page 475

18 Applied Instructions (Floating Point)

18.13 DLOGE / Floating Point Natural Logarithm

18.13 DLOGE / Floating Point Natural Logarithm

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction executes natural logarithm operation.

1. Format and operation, execution form

Expression in each language

DLOGE EN ENO

Applied Instructions (Handy Instruction)

DLOGE 32 bits Continuous DLOGE(EN, s, d);

DLOGEP EN ENO

DLOGEP 32 bits Pulse DLOGEP(EN, s, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Head device for storing the binary floating decimal point data for natural logarithm operation.

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Applied Instructions (Data Transfer 2)

Function and operation explanation

1. 32-bit operation (DLOGE/DLOGEP)

By natural logarithm operation of the device specified by (logarithm supposing e (2.71828) to be the bottom), the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .

Applied Instructions (Floating Point)

Command input DLOGE EN ENO

Head device for storing the binary floating decimal point data for natural logarithm operation

Head device for storing the operation result

d s s d

Binary floating decimal point (real number)

Binary floating decimal point (real number)

  • The value to be specified by can be set in positive number only. (Negative number cannot be operated.)

Applied Instructions (Positioning Control)

Show 21 more labels / short text on this page
Instruction · name Operation Execution · form · d s · d s · Input variable · FLOAT(Single Precision) · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · d s · +1 · +1 · loge
Page 476 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — LOGE
Page 476 · click to enlarge
Page 476

18.13 DLOGE / Floating Point Natural Logarithm FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Error

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When the value specified by is negative. (Error code: K6706)
  • When the value specified by is 0. (Error code: K6706)

Program example

This is a program for determining the natural logarithm of "10" set in D50 when the X000 is turned ON, and storing in D30, D31.

ENO K10 D50

Setting of data for natural logarithm operation.(1))

Conversion of operation data into binary floating decimal point (real number).(2))

Operation of natural logarithm.(3))

[ST]

MOV(X000,K10,D50); FLT(X000,D50,D40); DLOGE(X000,D40,D30);

2. Conversion of binary floating decimal point (real number)
3. LOG operation

D41 D40

2.302585 D31 D30

MOV

FLT

Value of binary floating decimal point (real number)

LOGE

Value of binary floating decimal point (real number)

Show 8 more labels / short text on this page
[Structured ladder/FBD] · MOV EN s · FLT EN s · d D40 D50 · DLOGE EN s · 10 10 1) · 10 b15 b0 · BIN value
Page 477 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 477 · click to enlarge
Page 477

18 Applied Instructions (Floating Point)

18.14 DLOG10 / Floating Point Common Logarithm

18.14 DLOG10 / Floating Point Common Logarithm

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction executes common logarithm operation.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DLOG10 EN ENO

DLOG10 32 bits Continuous DLOG10(EN, s ,d);

DLOG10P EN ENO

Applied Instructions (External FX I/O Device)

DLOG10P 32 bits Pulse DLOG10P(EN ,s ,d);

2. Set data

Variable Description Data type

Applied Instructions (External Device (optional device))

EN Execution condition Bit

Head device for storing the binary floating decimal point data for common logarithm operation.

ENO Execution state Bit

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Applied Instructions (Data Transfer 2)

z

Function and operation explanation

1. 32-bit operation (DLOG10/DLOG10P)

Applied Instructions (Floating Point)

By common logarithm operation of the device specified by (logarithm supposing 10 to be the bottom), the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .

Command input DLOG10 EN ENO

Head device for storing the binary floating decimal point data for common logarithm operation

Head device for storing the operation result

+1 +1 d s

Binary floating decimal point (real number)

Binary floating decimal point (real number))

Applied Instructions (Positioning Control)

  • The value to be specified by can be set in positive number only. (Negative number cannot be operated.)
Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · d s · d s · Input variable · FLOAT(Single Precision) · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · d s · s d · log10
Page 478 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DLOG10
Page 478 · click to enlarge
Page 478

18.14 DLOG10 / Floating Point Common Logarithm FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Error

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When the value specified by is negative. (Error code: K6706)
  • When the value specified by is 0. (Error code: K6706)

Program example

This is a program for determining the common logarithm of "15" set in D50 when the X000 is ON, and storing in D30, D31.

ENO K15 D50

Setting of data for common logarithm operation. (1))

Conversion of operation data into binary floating decimal point (real number). (2))

Operation of common logarithm (3))

[ST]

MOV(X000,K15,D50); FLT(X000,D50,D40); DLOG10(X000,D40,D30);

2. Conversion of binary floating decimal point (real number)
3. LOG operation

D41 D40

1.176091 D31 D30

MOV

FLT

Value of binary floating decimal point (real number)

DLOG10

Value of binary floating decimal point (real number)

Show 8 more labels / short text on this page
[Structured ladder/FBD] · MOV EN s · FLT EN s · d D40 D50 · DLOG10 EN s · 15 10 1) · 15 b15 b0 · BIN value
Page 479 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 479 · click to enlarge
Page 479

18 Applied Instructions (Floating Point)

18.15 DESQR / Floating Point Square Root

18.15 DESQR / Floating Point Square Root

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction executes the square root operation of binary floating decimal point.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Expression in each language Structured ladder/FBD ST

Applied Instructions (Handy Instruction)

DESQR EN ENO

DESQR 32 bits Continuous DESQR(EN, s, d);

DESQRP EN ENO

DESQRP 32 bits Pulse DESQRP(EN, s, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing binary floating decimal point data for square root operation

Applied Instructions (External Device (optional device))

ENO Execution state Bit Device for storing binary floating decimal point data after square root operation

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z S3

z S1 S2 z

Applied Instructions (Data Transfer 2)

S: Refer to "Cautions".

Function and operation explanation

1. 32-bit operation (DESQR, DESQRP)

The data in the device specified by is operated by square root (binary floating decimal point), and the result is transferred to the device specified by .

Applied Instructions (Floating Point)

Command input DESQR EN ENO

Device for storing binary floating decimal point data for square root operation

Device for storing binary floating decimal point data after square root operation

[ +1, ] d s Binary floating decimal point

s [ +1, ] d →

Binary floating decimal point

Related devices

→ As for the manner of using the zero flag, refer to the FX Structured Programming Manual [Device &

Common].

Applied Instructions (Positioning Control)

M8020 Zero To be turned ON when the operation result is true 0.

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · d s · d s · Input variable · FLOAT(Single Precision) · Output variable · FLOAT(Single Precision) · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · d s · Device Name Content
Page 480 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 480 · click to enlarge
Page 480

18.15 DESQR / Floating Point Square Root FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

Cautions

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

Error

The content of the device specified by is valid only in positive number, and negative number leads to operation error (M8067), and the instruction is not executed.

Page 481 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]
Page 481 · click to enlarge
Page 481

18 Applied Instructions (Floating Point)

18.16 DENEG / Floating Point Negation

18.16 DENEG / Floating Point Negation

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction inverts the sign of binary floating decimal point (real number) data.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DENEG EN ENO

DENEG 32 bits Continuous DENEG(EN, d);

DENEGP EN ENO

DENEGP 32 bits Pulse DENEGP(EN, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Head device for storing the binary floating decimal point data of which sign is to be inverted.

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Function and operation explanation

Applied Instructions (Data Transfer 2)

1. 32-bit operation (DENEG/DENEGP) The sign of the binary floating decimal point data of the device specified by is inverted, and stored in the device specified by .

Command input DENEG EN ENO

Applied Instructions (Floating Point)

d Head device for storing the binary floating decimal point data of which sign is to be inverted

Program example

This is a program for inverting the sign of the binary floating decimal point data of D100, D101 when the X000 is turned ON, and storing in D100, D101.

D101 D100 D101 D100 X000 DENEGP EN ENO

1.2345 -1.2345

Applied Instructions (Positioning Control)

[ST]

DENEGP(X000,D100);

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · Output variable · FLOAT(Single Precision) · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · [Structured ladder/FBD] · d D100
Page 482 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 482 · click to enlarge
Page 482

18.17 INT / Floating Point to Integer Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.17 INT / Floating Point to Integer Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the binary floating decimal point into BIN integer in normal data type in the PLC. (From binary floating decimal point data to BIN integer)

→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 482)
Fig. 420 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 482)
Fig. 421 · 2. Set data

Device for storing the binary floating decimal point data to be converted into BIN integer. FLOAT(Single Precision)

Device for storing the converted BIN integer. ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 482)
Fig. 422 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 483 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 483 · click to enlarge
Page 483

18 Applied Instructions (Floating Point)

18.17 INT / Floating Point to Integer Conversion

Function and operation explanation

1. 16-bit operation (INT, INTP)

The binary floating decimal point of the device specified by is converted into BIN integer, and is transferred to the device specified by .

Command input INT EN ENO

Applied Instructions (High Speed Processing)

+1, d s s →

d s Binary floating decimal point

The device for storing the converted data.

To discard below the decimal point of 16-bit BIN integer.

Device for storing the data to be converted into BIN integer

Instruction of reverse converting operation Reverse converting operation of the operation of this instruction is FLT.

→ As for FLT instruction, refer to 11.10.

Applied Instructions (Handy Instruction)

2. 32-bit operation (DINT, DINTP)

The binary floating decimal point of the device specified by is converted into BIN integer, and is transferred to the device specified by .

+1, s s → +1, d d DINT EN ENO

Applied Instructions (External FX I/O Device)

Device for storing the data to be converted into BIN integer

The device for storing the converted data.

Binary floating decimal point

To discard below the decimal point of 32-bit BIN integer.

Instruction of reverse converting operation Reverse converting operation of the operation of this instruction is DFLT(FNC49) instruction.

→ As for FLT instruction, refer to 11.10.

Applied Instructions (External Device (optional device))

Related devices

→ As for the manner of using the zero, borrow, and carry flag, refer to the FX Structured Programming

Manual [Device & Common].

M8020 Zero To be turned ON when the operation result is 0.

M8021 Borrow To be turned ON when less than 1 is discarded in convertion.

To be turned ON when the operation result overflows by exceeding the range of -32, 768 to 32, 767 (in 16-bit operation), or -2, 147, 483, 583 to 2, 147, 483, 583 (in 32-bit operation). (Operation result is not reflected.)

Cautions

Applied Instructions (Data Transfer 2)

1. Fractions below the decimal point are discarded in operation.
2. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 4 more labels / short text on this page
Command input · d s · Device Name Content · M8022 Carry
Page 484 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 484 · click to enlarge
Page 484

18.18 DSIN / Floating Point Sine FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.18 DSIN / Floating Point Sine

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction determines the SIN value of angle (RAD).

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 484)
Fig. 423 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 484)
Fig. 424 · 2. Set data

Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)

Device for storing the SIN value of binary floating decimal point. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 484)
Fig. 425 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 32-bit operation (DINT, DINTP)

The value of angle (binary floating decimal point) specified by is converted into SIN value, and is transferred to the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 484)
Fig. 426 · Function and operation explanation

[ +1, ]RAD d s s [ +1, ]SIN d → DSIN EN ENO

RAD value (angle × π/180) Binary floating decimal point value is specified.

Page 485 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.18 DSIN / Floating Point Sine
Page 485 · click to enlarge
Page 485
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.18 DSIN / Floating Point Sine diagram (page 485)
Fig. 427 · 18.18 DSIN / Floating Point Sine
1. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.

(D5, D4) angle × (π/180) →(D31, D30)RAD Binary floating point multiplication

Page 486 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 486 · click to enlarge
Page 486

18.19 DCOS / Floating Point Cosine FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.19 DCOS / Floating Point Cosine

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction determines the COS value of angle (RAD).

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 486)
Fig. 428 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 486)
Fig. 429 · 2. Set data

Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)

Device for storing the COS value of binary floating decimal point. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 486)
Fig. 430 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

1. 32-bit operation (DCOS, DCOSP) The value of angle (binary floating decimal point) specified by is converted into COS value, and is transferred to the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 486)
Fig. 431 · Function and operation explanation

[ +1, ]RAD → [ +1, ]COS DCOS EN ENO

RAD value (angle × π/180) Binary floating decimal point value is specified.

Cautions

1. Some restrictions to applicable devices. S : The FX 3U and FX 3UC PLCs only are applicable.
Page 487 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 487 · click to enlarge
Page 487

18 Applied Instructions (Floating Point)

18.20 DTAN / Floating Point Tangent

18.20 DTAN / Floating Point Tangent

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction determines the TAN value of angle (RAD).

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DTAN EN ENO

DTAN 32 bits Continuous DTAN(EN, s, d);

DTANP EN ENO

DTANP 32 bits Pulse DTANP(EN, s, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Device for storing the TAN value of binary floating decimal point. FLOAT(Single Precision)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S1 z S1

z S1 S1 z

S: Refer to "Cautions".

Applied Instructions (Data Transfer 2)

Function and operation explanation

1. 32-bit operation (DTAN, DTANP) The value of angle (binary floating decimal point) specified by is converted into TAN value, and is transferred to the device specified by .

Applied Instructions (Floating Point)

DTAN EN ENO

[ +1, ]RAD → [ +1, ]TAN d s s d

Binary floating decimal point value

Device for storing RAD (angle)

Device for storing the TAN value

RAD value (angle × π/180) Binary floating decimal point value is specified.

TAN value Binary floating decimal point value

Cautions

Applied Instructions (Positioning Control)

1. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.
Show 24 more labels / short text on this page
Instruction · name Operation Execution · form · d s · d s · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · Command input · Binary floating · d s · decimal point value · s · +1 · s · s
Page 488 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 488 · click to enlarge
Page 488

18.21 DASIN / Floating Point Arc Sine FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.21 DASIN / Floating Point Arc Sine

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes SIN-1 operation.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 488)
Fig. 432 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 488)
Fig. 433 · 2. Set data

Head device for storing the SIN value for SIN-1 (reverse sine) operation. FLOAT(Single Precision)

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 488)
Fig. 434 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 32-bit operation (DASIN/DASINP) The angle is determined from the SIN value specified by , and the operation result is stored in the device specified by . In the device specified by , real number can be directly specified.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 488)
Fig. 435 · Function and operation explanation

Head device for storing the SIN value for SIN-1 operation

  • The SIN value specified by can be set in a range of -1.0 to 1.0.
  • The angle (operation result) to be stored in the device specified by stores the value of radian (- π /2 to π /2). As for conversion from radian to angle or vice versa, refer to DRAD instruction or DDEG instruction.

→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.

Page 489 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.21 DASIN / Floating Point Arc Sine
Page 489 · click to enlarge
Page 489
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.21 DASIN / Floating Point Arc Sine diagram (page 489)
Fig. 436 · 18.21 DASIN / Floating Point Arc Sine

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When the value specified by is out of the range of -1.0 to 1.0. (Error code: K6706)

This is a program for determining SIN-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.

Calculation of angle (radian) by SIN-1 operation. (1))

Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))

Output of angle converted to integer (BIN) to display unit. (4))

Operation when the value of D0, D1 is 0.5.

Page 490 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 490 · click to enlarge
Page 490

18.22 DACOS / Floating Point Arc Cosine FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.22 DACOS / Floating Point Arc Cosine

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes COS-1 operation.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 490)
Fig. 437 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 490)
Fig. 438 · 2. Set data

Head device for storing the COS value for COS-1 (reverse cosine) operation.

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 490)
Fig. 439 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 32-bit operation (DACOS/DACOSP) The angle is calculated from the COS value specified by , and the operation result is stored in the device specified by . Real number can be directly specified by the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 490)
Fig. 440 · Function and operation explanation

Head device for storing the COS value for COS-1 operation

  • The COS value specified by can be set in a range of -1.0 to 1.0.
  • The angle (operation result) to be stored in the device specified by stores the value 0 to π in the radian unit. As for conversion from radian to angle or vice versa, refer to DRAD instruction or DDEG instruction.

→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.

Page 491 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.22 DACOS / Floating Point Arc Cosine
Page 491 · click to enlarge
Page 491
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.22 DACOS / Floating Point Arc Cosine diagram (page 491)
Fig. 441 · 18.22 DACOS / Floating Point Arc Cosine

In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.

  • When the value specified by is out of the range of -1.0 to 1.0. (Error code: K6706)

This is a program for determining COS-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.

Calculation of angle (radian) by COS-1 operation. (1))

Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))

Output of angle converted to integer to display unit. (4))

Operation when the value of D0, D1 is 0.5.

Page 492 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 492 · click to enlarge
Page 492

18.23 DATAN / Floating Point Arc Tangent FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.23 DATAN / Floating Point Arc Tangent

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes TAN-1 operation.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 492)
Fig. 442 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 492)
Fig. 443 · 2. Set data

Head device for storing the TAN value for TAN-1 operation (reverse tangent).

Head device for storing the operation result. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 492)
Fig. 444 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 32-bit operation (DATAN/DATANP) The angle is calculated from the TAN value specified by , and the operation result is stored in the device specified by . Real number can be directly specified by the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 492)
Fig. 445 · Function and operation explanation

Head device for storing the TAN value for TAN-1 operation

  • The angle (operation result) to be stored in the device specified by stores the value larger than ( −π /2) and smaller than ( π /2) in the radian unit. As for conversion from radian to angle or vice versa, refer to DRAD instruction or DDEG instruction.

→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.

Page 493 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.23 DATAN / Floating Point Arc Tangent
Page 493 · click to enlarge
Page 493
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.23 DATAN / Floating Point Arc Tangent diagram (page 493)
Fig. 446 · 18.23 DATAN / Floating Point Arc Tangent

This is a program for determining TAN-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.

Calculation of angle (radian) by TAN-1 operation. (1))

Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))

Output of angle converted to integer (BIN) to display unit. (4))

Operation when the value of D0, D1 is 1.

Page 494 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 494 · click to enlarge
Page 494

18.24 DRAD / Floating Point Degrees to Radians Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.24 DRAD / Floating Point Degrees to Radians Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the value of angle unit to the radian unit.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 494)
Fig. 447 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 494)
Fig. 448 · 2. Set data

Head device for storing the angle to be converted to radian unit. FLOAT(Single Precision)

Head device for storing the value having been converted to radian unit FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 494)
Fig. 449 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 32-bit operation (DRAD/DRADP)

The angle specified by is converted from the degree unit to the radian unit, and is stored in the device specified by . Real number can be directly specified in the device specified by .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 494)
Fig. 450 · Function and operation explanation

Head device for storing the angle to be converted to the radian unit

Head device for storing the value having been converted to the radian unit

  • Conversion from degree unit to radian unit is as follows.

Radian unit = degree unit × 180

π

Page 495 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.24 DRAD / Floating Point Degrees to Radians Conversion
Page 495 · click to enlarge
Page 495
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.24 DRAD / Floating Point Degrees to Radians Conversion diagram (page 495)
Fig. 451 · 18.24 DRAD / Floating Point Degrees to Radians Conve…

18.24 DRAD / Floating Point Degrees to Radians Conversion

This is a program for converting the angle set in BCD four digits in X020 to X037 when the X000 is ON, and storing in binary floating decimal point in D20, D21.

Input of angle to be converted to radian value. (1))

Conversion of input angle to binary floating decimal point (negative number).) (2))

Operation when 120 is specified in X020 to X037.

2. Conversion of binary floating decimal point (real number)
Page 496 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 496 · click to enlarge
Page 496

18.25 DDEG / Floating Point Radians to Degrees Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]

18 Applied Instructions (Floating Point)

18.25 DDEG / Floating Point Radians to Degrees Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the radian unit value into the angle (DEG) unit.

→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &

Common].

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 496)
Fig. 452 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 496)
Fig. 453 · 2. Set data

Head device for storing the radian angle to be converted to degree unit. FLOAT(Single Precision)

Head device for storing the value having been converted to degree unit. FLOAT(Single Precision)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 496)
Fig. 454 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 32-bit operation (DDEG/DDEGP) (DDEG/DDEGP) The unit of the angle specified by is converted from the radian unit to the degree unit, and is stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 496)
Fig. 455 · Function and operation explanation

Head device for storing the radian angle to be converted to degree unit

Head device for storing the value having been converted to degree unit

  • Conversion from radian unit to degree unit is as follows.

Degree unit = radian unit × π 180

Page 497 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 18.25 DDEG / Floating Point Radians to Degrees Conversion
Page 497 · click to enlarge
Page 497
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 18.25 DDEG / Floating Point Radians to Degrees Conversion diagram (page 497)
Fig. 456 · 18.25 DDEG / Floating Point Radians to Degrees Conve…

18.25 DDEG / Floating Point Radians to Degrees Conversion

This is a program for converting the radian value set in binary floating decimal point in D20, D21 to the angle when the X000 is ON, and issuing to the Y040 to Y057 in BCD value.

Angle of binary floating decimal point (real number) is converted to integer. (2))

The converted integer value is issued to the display unit. (3))

Operation when the value of D20, D21 is 1.435792.

Page 498 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DSWAP
Page 498 · click to enlarge
Page 498

This chapter introduces the instructions for executing complicated processing for fundamental applied instructions and for executing special processing.

Instruction name Function Reference

WSUM

Sum of Word Data Section 19.1 WSUMP

DWSUM

DWSUMP

WTOB

WORD to BYTE Section 19.2 WTOBP

BTOW

BYTE to WORD Section 19.3 BTOWP

UNI

4-bit Linking of Word Data Section 19.4 UNIP

DIS

4-bit Grouping of Word Data Section 19.5 DISP

SWAP

Byte Swap Section 19.6 SWAPP

DSWAP

DSWAPP

SORT2

Sort Tabulated Data 2 Section 19.7 DSORT2

Page 499 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 19.1 WSUM / Sum of Word Data
Page 499 · click to enlarge
Page 499
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.1 WSUM / Sum of Word Data diagram (page 499)
Fig. 457 · 19.1 WSUM / Sum of Word Data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction calculates the total value of continuous 16-bit data or 32-bit data. Please use the CCD when calculating the sum data (total value) in byte (8-bit) unit.

→ As for the CCD, refer to section 15.5.

Head device for storing the data for calculating the total value (n points occupied). ANY16 ANY32

Head device for storing the total value. ANY32 ARRAY [1..4] OF ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 500 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 500 · click to enlarge
Page 500

19.1 WSUM / Sum of Word Data

Function and operation explanation

1. 16-bit operation (WSUM/WSUMP) The total value of n points of 16-bit data from the device specified by is stored in the device specified by as 32-bit data.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 500)
Fig. 458 · Function and operation explanation
2. 32-bit operation (DWSUM/DWSUMP) The total value of n points of 32-bit data from the device specified by is stored in the device specified by as 64-bit data.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 500)
Fig. 459 · Function and operation explanation

d [ ] +3, +2, +1,

Related instructions

CCD Check code This instruction calculates the total value and the horizontal parity of 16-bit data in byte (8-bit) unit.

Cautions

1. In 32-bit operation, the total value becomes 64-bit data. FX 3U , FX 3UC PLCs cannot handle 64-bit data. However, when the total value is in the numeric value range of 32-bit data (K-2,147,483,648 to K2,147,483,647), higher 32-bit data is ignored, and the lower 32-bit data can be handled as the total value.
2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.

1. When n devices from the device specified by exceed the device range. (Error code: K6706)
2. When n ≤ 0. (Error code: K6706)
3. When the device specified by exceeds the range. (Error code: K6706)

Instruction Content

Page 501 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K14948
Page 501 · click to enlarge
Page 501

19.1 WSUM / Sum of Word Data

Program example

This is a program for storing the total value of 16-bit data of D10 to D14 when the X010 is turned ON to [D101, D100].

K4500 K2500 K-3276

WSUMP EN s n

D11 D12 D13 D14

Applied Instructions (High Speed Processing)

K14948

K5

K6780 K4444

[ST]

WSUMP(X10,D10,K5,D100);

Applied Instructions (Handy Instruction)

Applied Instructions (External FX I/O Device)

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

[Structured ladder/FBD] · [D101,D100] WSUMP instruction

Page 502 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 502 · click to enlarge
Page 502

19.2 WTOB / WORD to BYTE

19.2 WTOB / WORD to BYTE

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction separates continuous 16-bit data in byte (8-bit) unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 502)
Fig. 460 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 502)
Fig. 461 · 2. Set data

Head device for storing the data to be separated in byte unit. ANY16

Number of byte data to be separated. (0≤n) ANY16

Head device for storing the result separated in byte unit. ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 502)
Fig. 462 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 503 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D13 D14 D14 D15 D16
Page 503 · click to enlarge
Page 503

19.2 WTOB / WORD to BYTE

Function and operation explanation

1. 16-bit operation (WTOB/WTOBP)

1. This instruction separates n/2 points of 16-bit data stored after the device specified by into n bytes, and stores into n devices starting from the device specified by as explained below.

WTOB EN s n

Applied Instructions (High Speed Processing)

Head device for storing the result separated in byte unit. Head device of the data to be separated.

Number of byte data to be separated.

b15 b8 b7 b0 +0 +1

b15 b8 b7 b0

Higher byte Higher byte

Lower byte Lower byte

00H 00H Lower byte Higher byte 00H 00H Lower byte Higher byte

Applied Instructions (Handy Instruction)

00H 00H Lower byte Higher byte

* If n is an odd number, fractions are rounded up. In the case of n=5, the result is +3.

Applied Instructions (External FX I/O Device)

00H is stored.

2. 00H is stored in the higher byte (8 bits) of the device for storing the separated byte data (after the device specified by ).
3. In the case of n = odd number, the final data of separation source is applicable only to the data in the lower byte (8 bits) as shown below. For example, in the case of n=5, data of lower byte (8 bits) of to +2 is stored in to +4.

Applied Instructions (External Device (optional device))

b15 b8 b7 b0 d s

b15 b8 b7 b0 +0 +1 +2

12H 56H FEH

39H 78H DCH

00H 00H 39H 12H 00H 00H 78H 56H 00H DCH

In the case of n=5

Ignored when n=5.

00H is stored.

4. Instruction is not processed in the case of n=0.

Related instructions

Applied Instructions (Data Transfer 2)

BTOW This instruction couples the lower 8 bits (lower byte) of continuous 16-bit data.

Cautions

1. The device storing the separation source data and the device storing the separated data can be used in overlap. However, in the case of n = odd number, it must be noted that the data of the higher byte (8 bits) of the final data of the separation source may be overwritten and erased as shown below.

Applied Instructions (Floating Point)

b15 b8 b7 b0 b15 b8 b7 b0 s d

32H 34H 36H

31H 33H 35H

00H 00H 31H 32H 00H 00H 33H 34H 00H 35H

D13 D14 D14 D15 D16

In the case of n=5

Ignored when n=5, and devices and are overlapped, and "36H" is overwritten and erased.

00H is stored.

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Applied Instructions (Positioning Control)

Show 14 more labels / short text on this page
Command input · s d · +0 +1 · +2 +3 · +n/2* · Higher byte · Lower byte · n bytes · +n-2 +n-1 · s · +0 +1 · +2 +3 +4 · Instruction Content · d s
Page 504 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 504 · click to enlarge
Page 504

19.2 WTOB / WORD to BYTE

Error

In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.

1. When devices to +n/2 of separation source exceed the device range of specified devices. When n is an odd number, the devices are required in the number by rounding up. (Error code: K6706)
2. When devices to +n-1 for storing the separated data exceed the device range of specified devices. (Error code: K6706)

Program example

This is a program for separating the data of D10 to D12 into byte unit when the X000 is turned ON, and storing in D20 to D25.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 504)
Fig. 463 · Program example

00H 00H 58H FDH 00H 00H E2H 57H 00H 44H

Page 505 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 505 · click to enlarge
Page 505

19.3 BTOW / BYTE to WORD

19.3 BTOW / BYTE to WORD

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction couples the lower 8 bits (lower byte) of continuous 16-bit data.

1. Format and operation, execution form

Expression in each language

BTOW EN s n

Applied Instructions (Handy Instruction)

BTOW 16 bits Continuous BTOW(EN, s, n, d);

BTOWP EN s n

BTOWP 16 bits Pulse BTOWP(EN, s, n, d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Head device for storing the data to be coupled in byte unit. ANY16

Applied Instructions (External Device (optional device))

Number of byte data to be coupled (0≤n) ANY16

ENO Execution state Bit

Head device for storing the coupled result in byte unit. ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Applied Instructions (Data Transfer 2)

z

Function and operation explanation

1. 16-bit operation (BTOW/BTOWP)

Applied Instructions (Floating Point)

1. This instruction stores the 16-bit data coupling lower byte (8 bit) of 16-bit data of n points from the device specified by , into n/2 devices starting from as follows.

BTOWP EN s n

Head device of data to be coupled Number of byte data to be coupled

d Head device for storing the coupled result in byte unit.

b15 b8 b7 b0 +0 +1

b15 b8 b7 b0

First byte data Second byte data Third byte data

First byte Third bytes

Applied Instructions (Positioning Control)

* If n is an odd number, refer to 3).

Higher bytes are ignored.

Show 26 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · Command input · d s · +0 +1 · Second byte · Fourth byte · n bytes · +2 · +n/2* · n-th byte · n-1-th byte · +n-1 · n-th byte data
Page 506 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 506 · click to enlarge
Page 506

19.3 BTOW / BYTE to WORD

2. Higher byte (8 bits) of 16-bit data (after ) in the coupling source is ignored.
3. When n is an odd number, as shown below, higher byte (8 bits) of the data coupled in the last place is set to 00H. For example, in the case of n=5, data of lower byte (8 bits) of to +4 is stored in to +2. Higher byte (8 bits) of +2 is 00H.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.3 BTOW / BYTE to WORD diagram (page 506)
Fig. 464 · 19.3 BTOW / BYTE to WORD

CDH 9AH +3 +4 In the case of n=5, "H00" is set.

4. Instruction is not processed in the case of n=0.

Related instructions

WTOB This instruction separates continuous 16-bit data in byte (8-bit) unit.

Cautions

1. The device storing the coupling source data and the device storing the coupled data can be used in overlap. However, it must be noted that the higher byte (8 bits) of the coupling source data stored in the device used in overlap is erased because the data of the higher byte (8 bits) is overwritten by the coupled data.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 506)
Fig. 465 · Cautions

=D10 34H 78H 12H 56H 9AH D13 D14 D15

Not changed. Since devices are overlapped, "ABH" and "CDH" are overwritten and erased.

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.

1. When the devices to ( +n-1) at the coupling source exceeds the device range of the specified devices. (Error code: K6706)
2. When the devices to ( +n/2) for storing the coupled data exceeds the device range of the specified devices. When n is an odd number, the devices are required in the number by rounding up. (Error code: K6706)

Instruction Content

Page 507 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 19.3 BTOW / BYTE to WORD
Page 507 · click to enlarge
Page 507
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.3 BTOW / BYTE to WORD diagram (page 507)
Fig. 466 · 19.3 BTOW / BYTE to WORD

This is a program for coupling the data of lower byte (8 bits) of D20 to D25 when the X000 is turned ON, and storing into D10 to D12.

Page 508 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 508 · click to enlarge
Page 508

19.4 UNI / 4-bit Linking of Word Data

19.4 UNI / 4-bit Linking of Word Data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction couples lower 4 bits of continuous 16-bit data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 508)
Fig. 467 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 508)
Fig. 468 · 2. Set data

Head device for storing the data to be coupled. ANY16

Number of couples [0 to 4](When "n" is "0", UNI instruction is not executed.) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 508)
Fig. 469 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 16-bit operation (UNI/UNIP)

1. 16-bit data coupling lower 4 bits of 16-bit data of n points from the device specified by is stored in the device specified by as shown below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 508)
Fig. 470 · Function and operation explanation

Head device of data to be coupled Head device for storing the coupled data. Number of couples

Lower 4 bits Lower 4 bits Lower 4 bits Lower 4 bits

Page 509 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]
Page 509 · click to enlarge
Page 509

19.4 UNI / 4-bit Linking of Word Data

2. Any one of 1 to 4 is specified by n. In the case of n=0, instruction is not processed.
3. In the case of 1 ≤ n ≤ 3, higher (4 × (4-n)) bits of the device specified by are 0. For example, in the case of n=3, lower 4 bits of to ( +2) are stored in b0 to b11 of , and higher 4 bits of are 0.

Applied Instructions (High Speed Processing)

b15 b4 b3 b0 +0 +1 +2

Lower 4 bits Lower 4 bits Lower 4 bits

b15 b12b11 b8 b7 b4 b3 b0

Ignored. Data to be coupled

In the case of n=3, b12 to b15 are 0.

Applied Instructions (Handy Instruction)

Related instructions

DIS This instruction separates 16-bit data in 4-bit unit.

Applied Instructions (External FX I/O Device)

Cautions

The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

Error

In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.

Applied Instructions (External Device (optional device))

1. When to ( +n) exceeds the device range of the specified devices. (Error code: K6706)
2. When n is specified other than 0 to 4. (Error code: K6706)

Program example

This is a program for coupling lower 4 bits of D0 to D2 when the X000 is turned ON, and storing in D10.

UNIP EN s n

D0 K3

Applied Instructions (Data Transfer 2)

b15 b4 b3 b0 D0

b15 b12 b11 b4 b3 b0

1 0 0 0 1 0 1 0 1 0 0 1 0 1 0

1 0 1 0

1 0 0 1 0

Applied Instructions (Floating Point)

Data to be coupled

0 is set because n=K3.

[ST]

UNIP(X000,D0,K3,D10);

Applied Instructions (Positioning Control)

s · Instruction Content · [Structured ladder/FBD]

Page 510 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 510 · click to enlarge
Page 510

19.5 DIS / 4-bit Grouping of Word Data

19.5 DIS / 4-bit Grouping of Word Data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction separates 16-bit data in 4-bit unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 510)
Fig. 471 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 510)
Fig. 472 · 2. Set data

Device for storing the data to be separated. ANY16

Number of separates [0 to 4](When "n" is "0", UNI instruction is not executed.) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 510)
Fig. 473 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 511 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K4
Page 511 · click to enlarge
Page 511

19.5 DIS / 4-bit Grouping of Word Data

Function and operation explanation

1. 16-bit operation (DIS/DISP)

1. This instruction separates 16-bit data of the device specified by in 4-bit unit, and storing in the device specified by as follows.

DISP EN s n

Applied Instructions (High Speed Processing)

d Device for storing the data to be separated.

Head device for storing the separated data.

b15 b12 b11 b8 b7 b4 b3 b0 s d

b15 b4 b3 b0 +0 +1 +2

Lower 4 bits Lower 4 bits Lower 4 bits Lower 4 bits

Applied Instructions (Handy Instruction)

To be set in 0.

2. Any one of 1 to 4 is specified by n. In the case of n=0, instruction is not processed.

Applied Instructions (External FX I/O Device)

3. 0 is set in higher 12 bits in the device of n points from the device specified by .

Related instructions

Applied Instructions (External Device (optional device))

UNI This instruction couples lower 4 bits of 16-bit data.

Cautions

The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

Error

In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.

1. When the range of n points from the device specified by exceeds the device range of specified device. (Error code: K6706)
2. When n is specified other than 0 to 4. (Error code: K6706)

Applied Instructions (Data Transfer 2)

Program example

This is a program for separating D0 in 4 bits each when the X000 is turned ON, and storing in D10 to D13.

[ST]

Applied Instructions (Floating Point)

DISP(X000,D0,K4,D10);

DISP EN s n

K4

b15 b4 b3 b0 b2 b1 D0

b15 b12 b11 b4 b3 b0 0 0 1 1 0

1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0

1 0 1 0

1 0 0 1 0

0 0 1 1 0

Applied Instructions (Positioning Control)

To be set in 0.

Show 10 more labels / short text on this page
Command input · Number of separates · n points · +3 · Storing area · Instruction Content · [Structured ladder/FBD] · d D0 · b8 b7 · Storing area
Page 512 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SWAPP EN ENO
Page 512 · click to enlarge
Page 512

19.6 SWAP / Byte Swap

19.6 SWAP / Byte Swap

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction swaps higher 8 bits and lower 8 bits of word data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 512)
Fig. 474 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 512)
Fig. 475 · 2. Set data

Device for swapping higher and lower bytes. ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 512)
Fig. 476 · 3. Applicable devices

System user Digit designation Special unit Index Index Cons

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S1 z z z

S: Refer to "Cautions".

Function and operation explanation

1. 16-bit operation (SWAP, SWAPP, DSWAP, DSWAPP) This instruction swaps lower 8 bits and higher 8 bits.

SWAPP EN ENO

Higher 8 bits Lower 8 bits

Device for swapping higher and lower bytes.

Command input · s

Page 513 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 19.6 SWAP / Byte Swap
Page 513 · click to enlarge
Page 513
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.6 SWAP / Byte Swap diagram (page 513)
Fig. 477 · 19.6 SWAP / Byte Swap
2. 32-bit operation (DSWAP, DSWAPP) In the case of 32-bit instruction, too, lower 8 bits and higher 8 bits are swapped individually.

+1 DSWAPP EN ENO Device for swapping higher and lower bytes

Higher 8 bits Lower 8 bits , Higher 8 bits Lower 8 bits

1. When the continuous execution instruction is used, it must be noted that the swap takes place in every operation cycle.
2. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable.
Page 514 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 514 · click to enlarge
Page 514

19.7 SORT2 / Sort Tabulated Data 2

19.7 SORT2 / Sort Tabulated Data 2

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction sorts the data table composed of data (rows) and group data (columns) in the ascending order/descending order in row unit on the basis of the specified group data (rows). In this instruction, data (row direction) is stored in continuous devices, and it is easy to add the data (row). In SORT, sorting is in ascending order only, and data composition is different (data is composed in devices continuous in row direction).

→ As for SORT, refer to section 13.10.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 514)
Fig. 478 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 514)
Fig. 479 · 2. Set data

Head device for storing data table [m1 × m2 points occupied] ANY16 ANY32

Number of data (rows) [1 to 32] ANY16 ANY32

Number of group data (columns) [1 to 6] ANY16 ANY32

Columns of group data (columns) as reference for sorting [1 to m2] ANY16 ANY32

Head device for storing operation result [m1 × m2 points occupied] ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 514)
Fig. 480 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 515 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 515 · click to enlarge
Page 515

19.7 SORT2 / Sort Tabulated Data 2

Function and operation explanation

1. 16-bit operation (SORT2) This instruction sorts the data rows of data table (sorting source) of (m1 × m2) points from the device specified by in the ascending order/descending order on the basis of group data of n rows, and stores in data table (after sorting) of (m1 × m2) points from the device specified by . → As for operation example, refer to 3. Operation examples.

Applied Instructions (High Speed Processing)

SORT2 EN s m1

Head device for storing data table.

Head device for storing the operation result.

Number of data (rows)

Number of group data (columns)

Columns of group data (columns) as reference for sorting

Applied Instructions (Handy Instruction)

Instruction execution complete flag

M8029

M

The data table is composed of m1=K3, m2=K4 in the sorting source as explained in this case. In the data table after sorting, exchange and .

Applied Instructions (External FX I/O Device)

Number of groups m2 (in the case of m2=K4)

Column number 1 2 3 4

Row number Management number Height Body weight Age

In the case of number of data m1=3

1 +1 +2 +3

Applied Instructions (External Device (optional device))

2 +4 +5 +6 +7

3 +8 +9 +10 +11

1. Sorting is set depending on the ON/OFF state of M8165.

Setting of sorting order

2. Data sorting is started when the instruction input is ON, and is completed after m1 scan, and instruction execution complete flag M8029 is turned ON.

→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 4 more labels / short text on this page
Command input · m2 n · M8165=ON Descending · M8165=OFF Ascending
Page 516 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 19.7 SORT2 / Sort Tabulated Data 2
Page 516 · click to enlarge
Page 516

19.7 SORT2 / Sort Tabulated Data 2

2. 32-bit operation (DSORT2) This instruction sorts the data rows of data table (sorting source) of (m1 × m2) points from the device specified by in the ascending order/descending order on the basis of group data of n rows, and stores in data table (after sorting) of (m1 × m2) points from the device specified by . → As for operation example, refer to 3. Operation examples.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.7 SORT2 / Sort Tabulated Data 2 diagram (page 516)
Fig. 481 · 19.7 SORT2 / Sort Tabulated Data 2

Number of group data (columns) Columns of group data (columns) as reference for sorting

The data table is composed of m1=K3, m2=K4 in the sorting source as explained in this case. In the data table after sorting, exchange and .

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 19.7 SORT2 / Sort Tabulated Data 2 diagram (page 516)
Fig. 482 · 19.7 SORT2 / Sort Tabulated Data 2

Number of groups m2 (in the case of m2=K4)

1 [ +1, ] [ +3, +2] [ +5, +4] [ +7, +6]

2 [ +9, +8] [ +11, +10] [ +13, +12] [ +15, +14]

3 [ +17, +16] [ +19, +18] [ +21, +20] [ +23, +22]

1. Sorting is set depending on the ON/OFF state of M8165.
2. When using data register D or extension register R for m1, the data length is 32 bits. For example, when m1 is specified by D0, m1 is 32-bit data of [D1, D0].
3. Data sorting is started when the instruction input is ON, and is completed after m1 scan, and instruction execution complete flag M8029 is turned ON.

→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.

Sorting order · M8165=ON Descending · M8165=OFF Ascending

Page 517 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Sorting source data
Page 517 · click to enlarge
Page 517

19.7 SORT2 / Sort Tabulated Data 2

3. Operation example The operation is as follows when the following sorting source data is executed in "n=K2 (column number 2)", "n=K3 (column number 3)". The operation example is a case of 16-bit operation. In the case of 32-bit operation, the data table should be composed of BIN 32 bits. When a serial number such as management number is entered in the first column, it is convenient because the original row number can be judged from its content.

Applied Instructions (High Speed Processing)

Sorting source data

Number of groups m2 (in the case of m2=K4)

Column number 1 2 3 4

number Height Body weight Age

Applied Instructions (Handy Instruction)

1 +1 +2 +3

1 150 45 20

2 +4 +5 +6 +7

2 180 50 40

In the case of number of data m1=5

3 +8 +9 +10 +11

Applied Instructions (External FX I/O Device)

3 160 70 30

4 +12 +13 +14 +15

4 100 20 8

5 +16 +17 +18 +19

5 150 50 45

Applied Instructions (External Device (optional device))

1. Sorting result when instruction is executed in n=K2 (column number 2) (ascending order)

Column number 1 2 3 4

number Height Body weight Age

1 +1 +2 +3

4 100 20 8

2 +4 +5 +6 +7

1 150 45 20

3 +8 +9 +10 +11

5 150 50 45

4 +12 +13 +14 +15

Applied Instructions (Data Transfer 2)

3 160 70 30

5 +16 +17 +18 +19

2 180 50 40

2. Sorting result when instruction is executed in n=K3 (column number 3) (descending order)

Applied Instructions (Floating Point)

Column number 1 2 3 4

number Height Body weight Age

1 +1 +2 +3

3 160 70 30

2 +4 +5 +6 +7

2 180 50 40

3 +8 +9 +10 +11

5 150 50 45

4 +12 +13 +14 +15

1 150 45 20

Applied Instructions (Positioning Control)

5 +16 +17 +18 +19

4 100 20 8

Show 6 more labels / short text on this page
Row number · Management · Row number · Management · Row number · Management
Page 518 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 518 · click to enlarge
Page 518

19.7 SORT2 / Sort Tabulated Data 2

Related devices

→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related devices diagram (page 518)
Fig. 483 · Related devices

complete Turned ON when data sorting instruction is complete.

M8165 Descending order Sorted in descending order when M8165=ON. Sorted in ascending order when M8165=OFF.

Related instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instructions diagram (page 518)
Fig. 484 · Related instructions

Data sorting This instruction sorts the data table composed of data (rows) and group data (columns) in ascending order in row unit on the basis of the specified group data (columns). In this instruction, the group data (column direction) is stored in continuous devices.

Cautions

1. During operation, do not change the content of the operand or data.
2. When executing again, once turn OFF the command input.
3. Limitation of times of instruction Up to two instructions can be driven simultaneously in the program.
4. The circuit block including this instruction cannot be written during RUN.
5. When specifying same device in and The original data is sorted in the data order after sorting. In particular, be careful not to change the content of until instruction execution is complete.
6. Be careful not to allow overlap of original data and sorted data due to deviation.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Cautions diagram (page 518)
Fig. 485 · Cautions
7. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
Page 519 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DRVA
Page 519 · click to enlarge
Page 519

20 Applied Instructions (Positioning Control)

20. Applied Instructions (Positioning Control)

This chapter introduces the instructions using the built-in pulse output function of the PLC.

Applied Instructions (High Speed Processing)

Instruction name Function Reference

DSZR Dog Search Zero Return Section 20.1

DVIT

Interrupt Positioning Section 20.2 DDVIT

DTBL Batch Data Positioning Mode Section 20.3

DABS Absolute Current Value Read Section 20.4

Applied Instructions (Handy Instruction)

ZRN

Zero Return Section 20.5 DZRN

PLSV

Variable Speed Pulse Output Section 20.6 DPLSV

DRVI

Drive to Increment Section 20.7 DDRVI

Applied Instructions (External FX I/O Device)

DRVA

Drive to Absolute Section 20.8 DDRVA

Applied Instructions (External Device (optional device))

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Page 520 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 520 · click to enlarge
Page 520

20 Applied Instructions (Positioning Control)

20.1 DSZR / Dog Search Zero Return

20.1 DSZR / Dog Search Zero Return

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction matches the mechanical position and the current value register in the PLC by zero return. This instruction can perform following operation which is not supported by ZRN.

  • Corresponding action of DOG search function
  • Zero return is possible by using near-point DOG and zero-point signal. Zero point cannot be determined by counting the zero-point signals.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 520)
Fig. 486 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 520)
Fig. 487 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 520)
Fig. 488 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Function and operation explanation

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 520)
Fig. 489 · Function and operation explanation

Device for issuing pulse Device of rotating direction signal

Page 521 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function changes by version
Page 521 · click to enlarge
Page 521

20 Applied Instructions (Positioning Control)

20.1 DSZR / Dog Search Zero Return

Cautions

1. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 2: Please specify X000 to X007, in the case of FX 3G , FX 3GC , FX 3U and FX 3UC PLCs.

Please specify X000 to X005, in the case of FX3S PLC. S3: Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3

  • of high speed output special adapter *2 . *1. The pulse output destination Y002 is not available in FX 3S , FX 3G (14-point and 24-point type) and FX 3GC PLCs. *2. High speed output special adapter can be connected only in FX 3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. S 4: When high speed output special adapter is used at the pulse output destination in the FX 3U PLC, as

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

the rotating direction signal, use the output shown in the table below.

Connection position of high speed output special adapter Pulse output Rotating direction signal

Applied Instructions (External FX I/O Device)

=Y000 =Y004

=Y001 =Y005

=Y002 =Y006

=Y003 =Y007

When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output.

Applied Instructions (External Device (optional device))

2. Output number of rotating direction signal Operation changes as follows depending on polarity of output pulse frequency. [+ (Positive)] → : ON [- (Negative)] → : OFF

Cautions about writing during RUN

  • Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

Applied Instructions (Data Transfer 2)

DPLSV,DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC. *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.

Applied Instructions (Floating Point)

Function changes by version

This instruction includes the function changes as shown in the table below depending on the version.

→ As for the explanation of the instruction and contents of function changes, refer to the positioning

control manual.

Item Outline of function FX3S FX3G FX3GC FX3U FX3UC

Clear signal output destination designating function

When special auxiliary relay corresponding to is turned ON, the clear signal output specification is changed to the output number specified by special data register corresponding

Applied Instructions (Positioning Control)

Ver. 1.00

Ver. 1.00

Ver. 1.40

Ver. 2.20

Ver. 2.20

Show 9 more labels / short text on this page
First unit · Second unit · Corresponding version · or later · or later · or later · or later · or later · to
Page 522 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — S : Refer to "Cautions". Function and operation explanation
Page 522 · click to enlarge
Page 522

20 Applied Instructions (Positioning Control)

20.2 DVIT / Interrupt Positioning

20.2 DVIT / Interrupt Positioning

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes one-speed interrupt inching.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 522)
Fig. 490 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 522)
Fig. 491 · 2. Set data

Number of output pulses after interrupt (relative address) ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 522)
Fig. 492 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

S : Refer to "Cautions". Function and operation explanation

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — S : Refer to "Cautions". Function and operation explanation diagram (page 522)
Fig. 493 · S : Refer to "Cautions". Function and operation expl…

Output pulse frequency Number of output pulses after interrupt

Device of rotating direction signal Device for issuing pulse (Y)

Page 523 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function changes by version
Page 523 · click to enlarge
Page 523

20 Applied Instructions (Positioning Control)

20.2 DVIT / Interrupt Positioning

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.

Applied Instructions (High Speed Processing)

  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV,DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3U or FX3UC PLC.

Applied Instructions (Handy Instruction)

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Applied Instructions (External FX I/O Device)

Function changes by version

This instruction includes the function changes as shown in the table below depending on the version.

→ As for the explanation of the instruction and contents of function changes, refer to the positioning

control manual.

Item Outline of function FX3U FX3UC

Applied Instructions (External Device (optional device))

Ver. 2.20 or

Ver. 1.30 or

Interrupt input signal designating function

When M8336 is turned ON, the interrupt input signal corresponding to Y000 to Y003 is changed to input number (X000 to X007) specified by D8336. However, Y003 cannot be specified when transistor output of basic unit is used.

When 8 is specified by D8336 in interrupt input signal corresponding to Y000 to Y003 and M8336 is turned ON, the interrupt input signal is changed to special auxiliary relay. When the changed special auxiliary relay is changed from OFF to ON by input interrupt program, the interrupt operation is started. However, when this function is used, the logic of interrupt input cannot be inverted. However, Y003 cannot be specified when transistor output of basic unit is used.

Ver. 2.20 or

Ver. 2.20 or

later User interrupt mode

Applied Instructions (Data Transfer 2)

Applied Instructions (Floating Point)

Applied Instructions (Positioning Control)

Show 4 more labels / short text on this page
Corresponding version · later · later · later
Page 524 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — =Y000 =Y004
Page 524 · click to enlarge
Page 524

20 Applied Instructions (Positioning Control)

20.2 DVIT / Interrupt Positioning

Cautions

1. Some restrictions to applicable devices. S 1: Please specify Y000, Y001, Y002 of transistor output of basic unit, or Y000, Y001, Y002 *2 , Y003 *2 of

high speed output special adapter*1. *1. High speed output special adapter can be connected only in FX3U PLC. *2. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. S 2: When high speed output special adapter is used at the pulse output destination in the FX 3U PLC, as

the rotating direction signal, use the output shown in the table below.

Connection position of high speed

output special adapter Pulse output Rotating direction

=Y000 =Y004

=Y001 =Y005

=Y002 =Y006

=Y003 =Y007

When built-in transistor output is ussed at the pulse output destination in the FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: In D .b, index (V, Z) decoration is disabled.

2. Number of output pulses after interrupt is specified (specified by ). The setting range is as follows. a) In the case of 16-bit operation

-32,768 to +32,767 (excluding 0) b) In the case of 32-bit operation

-999,999 to +999,999 (excluding 0)

3. Output pulse frequency is specified (specified by ). The setting range is as follows. a) In the case of 16-bit operation

10 to 32,767 (Hz)

b) In the case of 32-bit operation

Pulse output destination Setting range

FX3U PLC High speed output special adapter 10 to 200,000 (HZ)

FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)

4. Output number of rotating direction signal Operation changes as follows depending on polarity of output pulse frequency. [+ (Positive)] → : ON [- (Negative)] → : OFF

signal · First unit · Second unit

Page 525 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions about writing during RUN
Page 525 · click to enlarge
Page 525

20 Applied Instructions (Positioning Control)

20.3 DTBL / Batch Data Positioning Mode

20.3 DTBL / Batch Data Positioning Mode

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

Instructions should be set in a data table beforehand using GX Works2. This instruction specifies one table and operates instructions in that table.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Handy Instruction)

DTBL EN ENO

DTBL 32 bits Continuous DTBL(EN,n,d);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Table number to be executed (n=1 to 100) ANY32

ENO Execution state Bit

Device for issuing pulse (Y) Bit

Applied Instructions (External Device (optional device))

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S 1

S: Refer to "Cautions".

Function and operation explanation

Applied Instructions (Data Transfer 2)

DTBL EN ENO

Table number to be executed

d n Device for issuing pulse (Y)

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

Applied Instructions (Floating Point)

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction.

This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA

Applied Instructions (Positioning Control)

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · d n · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type · z z · Command input
Page 526 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 526 · click to enlarge
Page 526

20 Applied Instructions (Positioning Control)

20.3 DTBL / Batch Data Positioning Mode

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
2. Some restrictions to applicable devices. S 1: Please specify Y000, Y001, Y002 *1 of transistor output of basic unit, or Y000, Y001, Y002 *3 , Y003 *3

of high speed output special adapter*2. *1. Y002 is not available in FX3G PLC (14-point and 24-point type) and FX3GC PLC. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

  • When using a relay output type or triac output type FX 3U PLC, a special high-speed output adapter is required.
  • The output of high speed output special adapter is a differential line driver.
Page 527 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DABS EN
Page 527 · click to enlarge
Page 527

20 Applied Instructions (Positioning Control)

20.4 DABS / Absolute Current Value Read

20.4 DABS / Absolute Current Value Read

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing)

This instruction connects with our company's MR-J4 A, MR-J3 A, MR-J2(S) A, or MR-H A type servo amplifier (with absolute position detecting function), and reads out the absolute position (ABS) data. The data is read out in pulse converted value.

→ As for explanation of the instruction, see the positioning control manual.

1. Format and operation, execution form

Applied Instructions (Handy Instruction)

Expression in each language

DABS 32 bits Continuous DABS(EN,s,d1,d2);

Applied Instructions (External FX I/O Device)

2. Set data

Variable Description Data type

EN Execution condition Bit

Head device for entering the output signal for absolute value (ABS) data from the servo amplifier (3 points occupied). Bit

Applied Instructions (External Device (optional device))

ENO Execution state Bit

Head device for issuing the control signal for absolute value (ABS) data to the servo amplifier (3 points occupied). Bit

Storing destination device of absolute value (ABS) data (32-bit value) ANY32

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 z

S1 z z S2 z

Applied Instructions (Data Transfer 2)

z S3 S4 z z

S: Refer to "Cautions".

Function and operation explanation

Applied Instructions (Floating Point)

DABS EN

Head device for issuing the control signal for absolute value (ABS) data to the servo amplifier

Head device for entering the output signal for absolute value (ABS) data from the servo amplifier

d2 Storing destination device of absolute value (ABS) data

Applied Instructions (Positioning Control)

Show 18 more labels / short text on this page
Instruction · name Operation Execution · form · DABS EN s · d1 d2 · Input variable · Output variable · Special · unit Index Cons · Real Number · Character · Operand · String Pointer · type · user · tant · Command input · s
Page 528 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 528 · click to enlarge
Page 528

20 Applied Instructions (Positioning Control)

20.4 DABS / Absolute Current Value Read

Cautions

1. The instruction is provided in the FX 2N and FX 2NC PLCs Ver. 3.00 or later.
2. Since ABS data is read out in pulse converted value, please specify "Motor system" for parameter setting (BFM#3) of FX 2N -1PG. (FX 2N , FX 2NC , FX 3U , FX 3UC PLCs.)
3. Writing of ABS data into FX 2N -10PG should be addressed to the current value registers (BFM#40, #39) in which the pulse converted values are stored. (FX 2N , FX 2NC , FX 3U , FX 3UC PLCs.)
4. Some restrictions to applicable devices. S 1: Please designate the transistor output. S 2: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 3: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 4: The FX 3U and FX 3UC PLCs only are applicable.
Page 529 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 20.5 ZRN / Zero Return
Page 529 · click to enlarge
Page 529
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 20.5 ZRN / Zero Return diagram (page 529)
Fig. 494 · 20.5 ZRN / Zero Return

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction matches the mechanical position and the current value register in the PLC by zero return. Please use DSZR when DOG search function is necessary.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S3 S2 z

z S3 S2 z

Page 530 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function changes by version
Page 530 · click to enlarge
Page 530

20 Applied Instructions (Positioning Control)

20.5 ZRN / Zero Return

Function and operation explanation

Speed when starting to zero return

d s2 s3 Device for entering the near-point signal (DOG)

Device for issuing pulse

d Speed when starting to zero return

Device for issuing pulse

Creep speed Device for entering the near-point signal (DOG)

Cautions about writing during RUN

  • Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC. *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.

Function changes by version

This instruction includes the function changes as shown in the table below depending on the version.

→ As for the explanation of the instruction and contents of function changes, refer to the positioning

control manual.

1. FX 3S PLC, FX 3G PLC, FX 3GC PLC, FX 3U PLC, FX 3UC PLC [V2.20 or later] When the special auxiliary relay corresponding to is turned ON, the output destination of clear signal is changed to the output number specified by the special data register corresponding to .

2. FX1S PLC [Before V2.00] After resetting the "rotating direction signal" (normal rotation output) used in other positioning instruction by RST, start to zero return. When started to zero return while the "rotating direction signal" is in normal rotation output state, the motor moves to the normal rotation, not zero return. [After V2.00] When driving of other positioning instruction is turned OFF, the rotating direction signal is turned OFF at the same time, and processing of before V2.00 is not required.

3. FX 1S , FX 1N PLCs [Before V2.00] If the zero return speed does not reach the speed specified by the instruction, change the acceleration or deceleration speed (D8148) to other value than given below. (For example, if the current value is 150, change to 149 or 151.) 50, 75, 90, 100, 125, 150, 225, 250, 375, 450, 500, 750, 900, 1120, 1500, 2250, 4499, 4500 [After V2.00] The above processing is not required.
Show 6 more labels / short text on this page
Command input · ZRN EN s1 · Creep speed · Command input · DZRN EN s1 · s2 s3
Page 531 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 531 · click to enlarge
Page 531

20 Applied Instructions (Positioning Control)

20.5 ZRN / Zero Return

Cautions

1. Instruction driving timing (FX 1S , FX 1N , FX 1NC PLCs) This is an instruction allowed to program as many times as desired, but you are advised to design the instruction driving timing according to the following cautions. a) Do not drive simultaneously the positioning instruction using the same output relay (Y000 or Y001).

If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is

Applied Instructions (High Speed Processing)

established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse

output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the

Applied Instructions (Handy Instruction)

positioning instruction according to the cautions mentioned above.

2. Not applicable to DOG search function, please start the zero return operation from the front side of the near-point signal. (FX 1S , FX 1N , FX 1NC PLCs.)
3. Not applicable to zero-point signal of servo motor, please adjust to the position of near-point signal (DOG) when fine adjustment of zero point is necessary. (FX 1S , FX 1N , FX 1NC PLCs.)

Applied Instructions (External FX I/O Device)

4) While zero return, the numeric values of the current value registers (Y000: [D8141, D8140], Y001: [D8143, D8142]) move in the decreasing direction. (FX1S, FX1N, FX1NC PLCs) When zero return in reverse direction, please control the output relay (Y) wired as "rotating direction signal" by the program in the following procedure. 1) Set (ON) Y (rotating direction signal). 2) Execute zero return instruction. 3) Reset (OFF) Y (rotating direction signal) by execution complete flag (M8012) of zero return instruction.

Applied Instructions (External Device (optional device))

5. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 2: The FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 4:

Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3

of high speed output special adapter*2. *1 The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2 High speed output special adapter can be connected only in FX3U PLC. *3 When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

Applied Instructions (Data Transfer 2)

  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. <FX 1S , FX 1N , FX 1NC PLCs>

Applied Instructions (Floating Point)

Specify Y000 or Y001. As the output of the PLC, please use the transistor output.

Applied Instructions (Positioning Control)

Page 532 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 20.5 ZRN / Zero Return
Page 532 · click to enlarge
Page 532

20 Applied Instructions (Positioning Control)

20.5 ZRN / Zero Return

6. Specify the speed of return zero point in . The setting range is as follows. a) In the case of 16-bit operation
  • FX 3S , FX 3G , FX 3GC , FX 3U , FX 3UC PLCs 10 to 32,767 (Hz)
  • FX 1S , FX 1N PLCs 10 to 32,767 (Hz)
  • FX 1NC PLC 10 to 10,000 (Hz) b) In the case of 32-bit operation
  • FX 3S , FX 3G , FX 3GC , FX 3U , FX 3UC PLCs

Pulse output destination Setting range

FX3U PLC High speed output special adapter 10 to 200,000 (HZ)

FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)

  • FX 1S , FX 1N PLCs 10 to 100,000 (Hz)
  • FX 1NC PLC 10 to 10,000 (Hz)
Page 533 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 20.6 PLSV / Variable Speed Pulse Output
Page 533 · click to enlarge
Page 533
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 20.6 PLSV / Variable Speed Pulse Output diagram (page 533)
Fig. 495 · 20.6 PLSV / Variable Speed Pulse Output

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction issues a variable speed pulse with the rotating direction.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S4 S5 z

Output pulse frequency Device for issuing pulse(Y) Device of rotating direction signal

Page 534 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 534 · click to enlarge
Page 534

20 Applied Instructions (Positioning Control)

20.6 PLSV / Variable Speed Pulse Output

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will become as shown below when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.

Operation of FX3S, FX3G, FX3GC, FX3U or FX3UC PLC when writing during RUN is attempted while a corresponding instruction is executed

acceleration or deceleration*3 Pulse output slows down and stops.

When operating without acceleration or deceleration Pulse output stops immediately.

*1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC. *3. Only available for FX3UC (Ver.2.20 or later), FX3S, FX3G, FX3GC and FX3U PLCs.

Function changes by version

This instruction includes the function changes as shown in the table below depending on the version.

→ As for the explanation of the instruction and contents of function changes, refer to the positioning

control manual.

Added function Outline of function FX3S FX3G FX3GC FX3U FX3UC

When M8338 is turned ON, the operation accelerates or

Ver. 1.00

Ver. 1.00

Ver. 1.40

Ver. 2.20

Ver. 2.20

decelerates up to by setting of acceleration time or

deceleration time corresponding to when is changed.

FX1S, FX1N, FX1NC are not applicable to this function.

Cautions

1. Instruction driving timing (FX 1S , FX 1N , FX 1NC PLCs) This is an instruction allowed to program as many times as desired, but you are advised to design the instruction driving timing according to the following cautions. a) Do not drive simultaneously the positioning instruction using the same output relay (Y000 or Y001).

If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is

established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse

output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the

positioning instruction according to the cautions mentioned above.

2. When output pulse frequency is changed to K0 during pulse output (FX 1S , FX 1N , FX 1NC PLCs), the PLC stops the pulse output. When sending output again, once turn OFF the flag during pulse output (Y000: [M8147], Y001: [M8148]), and after lapse of one operation cycle, set again (change) the output pulse frequen cy to other value than K0.
Show 9 more labels / short text on this page
When operating with · Corresponding version · Acceleration or · deceleration operation function · or later · or later · or later · or later · or later
Page 535 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — =Y003 =Y007
Page 535 · click to enlarge
Page 535

20 Applied Instructions (Positioning Control)

20.6 PLSV / Variable Speed Pulse Output

a) Within one operation cycle, if the value is changed to other value than K0, the output maintains the

stop function. In this case, write K0 again for more than one operation cycle, or once turn OFF the command input. 3) Some restrictions to applicable devices. S1:

Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3

  • of high speed output special adapter *2 . *1. The pulse output destination Y002 is not available in FX 3S , FX 3G (14-point and 24-point type) and FX 3GC PLCs. *2. High speed output special adapter can be connected only in FX 3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. <FX 1S , FX 1N , FX 1NC PLCs>

Applied Instructions (High Speed Processing)

Applied Instructions (Handy Instruction)

Specify Y000 or Y001. As the output of the PLC, please use the transistor output. S2:

Applied Instructions (External FX I/O Device)

When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.

Connection position of high speed

output special adapter Pulse output Rotating direction

First unit =Y000 =Y004

=Y001 =Y005

Applied Instructions (External Device (optional device))

Second unit =Y002 =Y006

=Y003 =Y007

When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.

4. The output pulse frequency is specified by . The setting range is as follows. a) In the case of 16-bit operation
  • FX 3S , FX 3G , FX 3GC , FX 3U , FX 3UC PLCs -32,768 to -1, +1 to 32,767 (Hz) *4

Applied Instructions (Data Transfer 2)

  • FX 1S , FX 1N PLCs -32,768 to -1, +1 to 32,767 (Hz)
  • FX 1NC PLC -10,000 to -1, +1 to 10,000 (Hz) b) In the case of 32-bit operation
  • FX 3S , FX 3G , FX 3GC , FX 3U , FX 3UC PLCs

Applied Instructions (Floating Point)

Pulse output destination Setting range

FX3U PLC High speed output special adapter -200,000 to -1, +1 to 200,000 (HZ)

FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) -100,000 to -1, +1 to 100,000 (HZ)*5

  • FX 1S , FX 1N PLCs -100,000 to -1, +1 to 100,000 (Hz)
  • FX 1NC PLC -10,000 to -1, +1 to 10,000 (Hz) *4. When operation without acceleration/deceleration (M8338 = OFF), setting range of FX 3S / FX 3G /FX 3GC PLC is -32,768 to -10 Hz, +10 to 32,767 Hz. *5. When operation without acceleration/deceleration (M8338 = OFF), setting range of FX 3S / FX 3G /FX 3GC PLC is -100,000 to -10 Hz, +10 to 100,000 Hz.
5. Output number of rotating direction signal Operation changes as follows depending on polarity of output pulse frequency. [+ (Positive)] → : ON [- (Negative)] → : OFF

Applied Instructions (Positioning Control)

signal

Page 536 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 536 · click to enlarge
Page 536

20 Applied Instructions (Positioning Control)

20.7 DRVI / Drive to Increment

20.7 DRVI / Drive to Increment

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction performs one-speed positioning by relative drive. The moving distance from the present position is specified together with plus or minus sign, and this is also called increment (relative) driving method.

→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 536)
Fig. 496 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 536)
Fig. 497 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 536)
Fig. 498 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S4 S5 z

z S4 S5 z

S: Refer to "Cautions".

Page 537 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 537 · click to enlarge
Page 537

20 Applied Instructions (Positioning Control)

20.7 DRVI / Drive to Increment

Function and operation explanation

d1 d2 s2 Number of output pulses (relative address)

Device for issuing pulse (Y) Device of rotating direction signal

Applied Instructions (High Speed Processing)

Number of output pulses (relative address)

Device for issuing pulse (Y) Device of rotating direction signal

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

Applied Instructions (Handy Instruction)

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

Applied Instructions (External FX I/O Device)

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.

Applied Instructions (External Device (optional device))

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Cautions

1. Instruction driving timing (FX 1S , FX 1N , FX 1NC PLCs) This is an instruction allowed to program as many times as desired, but you are advised to design the instruction driving timing according to the following cautions. a) Do not drive simultaneously the positioning instruction using the same output relay (Y000 or Y001).

If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is

Applied Instructions (Data Transfer 2)

established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse

output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the

Applied Instructions (Floating Point)

positioning instruction according to the cautions mentioned above.

Applied Instructions (Positioning Control)

Show 7 more labels / short text on this page
Command input · DRVI EN s1 · Output pulse frequency · Command input · DDRVI EN s1 · d1 d2 s2 · Output pulse frequency
Page 538 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — =Y003 =Y007
Page 538 · click to enlarge
Page 538

20 Applied Instructions (Positioning Control)

20.7 DRVI / Drive to Increment

2. Some restrictions to applicable devices. S 1:

Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3

of high speed output special adapter*2. *1. The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. <FX 1S , FX 1N , FX 1NC PLCs>

Specify Y000 or Y001. As the output of the PLC, please use the transistor output. S2:

When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.

Connection position of high speed

output special adapter Pulse output Rotating direction

First unit =Y000 =Y004

=Y001 =Y005

Second unit =Y002 =Y006

=Y003 =Y007

When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.

3. Number of output pulses is specified by . The setting range is as follows. a) In the case of 16-bit operation

-32,768 to +32,767 (excluding 0) b) In the case of 32-bit operation

-999,999 to +999,999 (excluding 0)

4. The output pulse frequency is specified by . The setting range is as follows. a) In the case of 16-bit operation
  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs 10 to 32,767 (Hz)
  • In the case of FX 1S and FX 1N PLCs 10 to 32,767 (Hz)
  • In the case of FX 1NC PLC 10 to 10,000 (Hz) b) In the case of 32-bit operation
  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs

Pulse output destination Setting range

FX3U PLC High speed output special adapter 10 to 200,000 (HZ)

FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)

  • In the case of FX 1S and FX 1N PLCs 10 to 100,000 (Hz)
  • In the case of FX 1NC PLC 10 to 10,000 (Hz)
5. Output number of rotating direction signal Operation changes as follows depending on polarity of output pulse frequency. [+ (Positive)] → : ON [- (Negative)] → : OFF

signal

Page 539 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 20.8 DRVA / Drive to Absolute
Page 539 · click to enlarge
Page 539
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 20.8 DRVA / Drive to Absolute diagram (page 539)
Fig. 499 · 20.8 DRVA / Drive to Absolute

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction performs one-speed positioning by absolute drive. The moving distance from the origin (0 point) is specified, and this is also called absolute driving method.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S4 S5 z

z S4 S5 z

Device for issuing pulse (Y) Number of output pulses (absolute address)

Device for issuing pulse (Y) Device of rotating direction signal

Page 540 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 540 · click to enlarge
Page 540

20 Applied Instructions (Positioning Control)

20.8 DRVA / Drive to Absolute

Cautions about writing during RUN

Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.

  • Changing a program for a circuit block including a corresponding instruction.
  • Changing a program for a circuit block just before or after a circuit block including a corresponding instruction.
  • Deleting or adding a circuit block just before or after a circuit block including a corresponding instruction. This caution about the above operations is applicable to the following PLCs and instructions. FX 1S , FX 1N and FX 1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,

DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,

DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.

*1. Not available for the FX3S, FX3G or FX3GC PLC.

*2. Not available for the FX3S PLC.

Cautions

1. Instruction driving timing (FX 1S , FX 1N , FX 1NC PLCs) This is an instruction allowed to program as many times as desired, but you are advised to design the instruction driving timing according to the following cautions. a) Do not drive simultaneously the positioning instruction using the same output relay (Y000 or Y001).

If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is

established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse

output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the

positioning instruction according to the cautions mentioned above. If, during pulse output, writing during RUN is attempted in circuit block including this instruction, it must be noted that the pulse output slows down and stops.

2. Some restrictions to applicable devices. S 1:

Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3

of high speed output special adapter*2. *1. The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

  • When using FX 3U PLC of relay output type or triac output type, high speed output special adapter is needed.
  • The output of high speed output special adapter is a differential line driver. <FX 1S , FX 1N , FX 1NC PLCs>

Specify Y000 or Y001. As the output of the PLC, please use the transistor output.

Page 541 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — =Y002 =Y006
Page 541 · click to enlarge
Page 541

20 Applied Instructions (Positioning Control)

20.8 DRVA / Drive to Absolute

S2:

When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.

Connection position of high speed

output special adapter Pulse output Rotating direction

=Y000 =Y004

=Y001 =Y005

Applied Instructions (High Speed Processing)

=Y002 =Y006

=Y003 =Y007

When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.

Applied Instructions (Handy Instruction)

3. Number of output pulses is specified by . The setting range is as follows. a) In the case of 16-bit operation
  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs -32,768 to +32,767

Applied Instructions (External FX I/O Device)

  • In the case of FX 1S , FX 1N and FX 1NC PLCs -32,768 to +32,767 b) In the case of 32-bit operation
  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs -999,999 to +999,999

Applied Instructions (External Device (optional device))

  • In the case of FX 1S , FX 1N and FX 1NC PLCs -999,999 to +999,999
4. The output pulse frequency is specified by . The setting range is as follows. a) In the case of 16-bit operation
  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs 10 to 32,767 (Hz)
  • In the case of FX 1S and FX 1N PLCs 10 to 32,767 (Hz)
  • In the case of FX 1NC PLC 10 to 10,000 (Hz) b) In the case of 32-bit operation

Applied Instructions (Data Transfer 2)

  • In the case of FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs

Pulse output destination Setting range

FX3U PLC High speed output special adapter 10 to 200,000 (HZ)

FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)

Applied Instructions (Floating Point)

  • In the case of FX 1S and FX 1N PLCs 10 to 100,000 (Hz)
  • In the case of FX 1NC PLC 10 to 10,000 (Hz)
5. Output number of rotating direction signal Operation is as follows by judging the difference between the output pulse frequency (target position) and present position. [+ (Positive)] → : ON [- (Negative)] → : OFF

Applied Instructions (Positioning Control)

signal · First unit · Second unit

Page 542 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — HOUR
Page 542 · click to enlarge
Page 542

21 Applied Instructions (Real Time Clock Control)

21. Applied Instructions (Real Time Clock Control)

This chapter introduces operation and comparison instructions for the time data.

Instruction name Function Reference

TCMP

RTC Data Compare Section 21.1 TCMPP

TZCP

RTC Data Zone Compare Section 21.2 TZCPP

TADD

RTC Data Addition Section 21.3 TADDP

TSUB

RTC Data Subtraction Section 21.4 TSUBP

HTOS

Hour to Second Conversion Section 21.5 HTOSP

DHTOS

DHTOSP

STOH

Second to Hour Conversion Section 21.6 STOHP

DSTOH

DSTOHP

TRD

Read RTC data Section 21.7 TRDP

TWR

Set RTC data Section 21.8 TWRP

HOUR

Hour Meter Section 21.9 DHOUR

Page 543 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 543 · click to enlarge
Page 543

21 Applied Instructions (Real Time Clock Control)

21.1 TCMP / RTC Data Compare

21.1 TCMP / RTC Data Compare

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The comparison time and the time data are compared, and the bit device is turned ON or OFF depending on the magnitude of difference.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension Function)

TCMP EN s1 s2

TCMP 16 bits Continuous TCMP(EN,s1,s2,s3,s,d);

TCMPP EN s1 s2

TCMPP 16 bits Pulse TCMPP(EN,s1,s2,s3,s,d);

Applied Instructions (Block Data Operation)

2. Set data

Variable Description Data type

EN Execution condition Bit

Comparison time "hour" (Setting range0 to 23) ANY16

Applied Instructions (Character String Control)

Comparison time "minute" (Setting range0 to 59) ANY16
Comparison time "second" (Setting range0 to 59) ANY16

Time data (hour, minute, second) "hour" (3 points occupied) ARRAY [0..2] OF ANY16

ENO Execution state Bit

Device to be turned ON or OFF depending on the comparison result. (3 points occupied) ARRAY [0..2] OF Bit

3. Applicable devices

Bit Devices Word Devices Others

System user Digit designation System

Applied Instructions (Data Comparison)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

z S2 S3 z

z S2 S3 z

z z z S2 S3 z

z z z S1 z

Applied Instructions (Data Table Operation)

S: Refer to "Cautions".

Applied Instructions (External Device Communication)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · s3 s · Applied Instructions (Others) · s3 s · Input variable · Output variable · Special · unit Index Cons · Real Number · Character · Operand · String Pointer · type · user · tant
Page 544 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 544 · click to enlarge
Page 544

21 Applied Instructions (Real Time Clock Control)

21.1 TCMP / RTC Data Compare

Function and operation explanation

1. 16-bit operation (TCMP) The time of comparison time (hour, minute, second) , , is compared with the time data (hour, minute, second) of the device specified by , and the device specified by is turned ON or OFF depending on the magnitude of difference.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 544)
Fig. 500 · Function and operation explanation

Device to be turned ON or OFF depending on the comparison result.

If TCMP is not executed when command contact is changed from ON to OFF, , +1, +2 are holding the state before the command contact is turned OFF.

Cautions

1. Number of devices occupied Three devices are occupied each in and . Be careful not to overlap with the devices used in machine control.
2. When using the time (hour, minute, second) of the clock data of the real time clock built in the PLC, first read out the value of the special data register by using TRD, TRDP, and specify the word device in each operand.
3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
Page 545 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.1 TCMP / RTC Data Compare
Page 545 · click to enlarge
Page 545
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.1 TCMP / RTC Data Compare diagram (page 545)
Fig. 501 · 21.1 TCMP / RTC Data Compare

:Three bit devices are turned ON or OFF depending on the comparison result.

If TCMP is not executed when X000=OFF, M0 to M2 are holding the state before X000 is turned OFF.

Page 546 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 546 · click to enlarge
Page 546

21 Applied Instructions (Real Time Clock Control)

21.2 TZCP / RTC Data Zone Compare

21.2 TZCP / RTC Data Zone Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The comparison time of higher and lower points and the time data are compared, and the bit device is turned ON or OFF depending on the magnitude of difference.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 546)
Fig. 502 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 546)
Fig. 503 · 2. Set data

Comparison lower limit time (hour, minute, second) "hour" (3 points occupied)

Comparison higher limit time (hour, minute, second) "hour" (3 points occupied)

Time data (hour, minute, second) "hour" (3 points occupied) ARRAY [0..2] OF ANY16

Device to be turned ON or OFF depending on the comparison result. (3 points occupied) ARRAY [0..2] OF Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 546)
Fig. 504 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 547 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 547 · click to enlarge
Page 547

21 Applied Instructions (Real Time Clock Control)

21.2 TZCP / RTC Data Zone Compare

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (TZCP, TZCPP) The comparison time (hour, minute, second) of higher and lower points and the time data (hour, minute, second) of the device specified by are compared, and the device specified by is turned ON or OFF depending on the magnitude of difference.

Magnitude comparison function of specified time at two points and time data

TZCP EN s1 s2

Device to be turned ON or OFF depending on the comparison result.

Comparison lower limit time (hour, minute, second) "hour"

Comparison upper limit time (hour, minute, second) "hour"

Applied Instructions (Extension Function)

Time data (hour, minute, second) "hour"

>

and then turned ON

≤ ≤

and then turned ON

>

and then turned ON

Applied Instructions (Block Data Operation)

↑

d d d If TZCP is not executed when command contact is changed from ON to OFF, , +1, +2 are holding the state before the command contact is turned OFF.

Cautions

Applied Instructions (Character String Control)

1. Number of devices occupied Three devices are occupied each in , , and . Be careful not to overlap with the devices used in machine control.
2. When using the time (hour, minute, second) of the clock data of the real time clock built in the PLC, first read out the value of the special data register by using TRD, TRDP, and specify the word device in each operand.
3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 46 more labels / short text on this page
Command input · s · s1 · (hour) · s · (hour) · s1 · +1 (minute) · s · +1 (minute) · s1 · +2 (second) · s · +2 (second) · Applied Instructions (Others) · +1 · s1 · (hour) · s2 s · (hour) · (hour) · s1 · +1 (minute) · s · +1 (minute) · s2 · +1 (minute) · s1 · +2 (second) · s · +2 (second) · s2 · +2 (second) · (hour) · (hour) · +2 · s · s2 · s · +1 (minute) · s2 · +1 (minute) · s · +2 (second) · s2 · +2 (second)
Page 548 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 548 · click to enlarge
Page 548

21 Applied Instructions (Real Time Clock Control)

21.2 TZCP / RTC Data Zone Compare

Program example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 548)
Fig. 505 · Program example

If TZCP instruction is not executed when X000 is changed from ON to OFF, M3 to M5 are holding the state before X000 is turned OFF.

:Comparison time lower limit is specified by "hour," "minute," "second."

:Comparison time upper limit is specified by "hour," "minute," "second."

:Three bit devices are turned ON or OFF depending on the comparison result.

Page 549 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.3 TADD / RTC Data Addition
Page 549 · click to enlarge
Page 549
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.3 TADD / RTC Data Addition diagram (page 549)
Fig. 506 · 21.3 TADD / RTC Data Addition

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Two time data are added and stored in the word device.

Device for storing "hour" of addition time data (hour, minute, second) (3 points occupied) ARRAY [0..2]

Device for storing "hour" of addition time data (hour, minute, second) (3 points occupied) ARRAY [0..2]

Device for storing the added result of two time data (hour, minute, second) (3 points occupied)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 550 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — If the operation result exceeds 24 hours
Page 550 · click to enlarge
Page 550

21 Applied Instructions (Real Time Clock Control)

21.3 TADD / RTC Data Addition

Function and operation explanation

1. 16-bit operation (TADD) Time data (hour, minute, second) of the device specified by , and time data (hour, minute, second) of the device specified by are added, and the result is stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 550)
Fig. 507 · Function and operation explanation

Device for storing "hour" of addition time data (hour, minute, second) *1.

*2 Device for storing the added result of two time data (hour, minute, second)

1. If the operation result exceeds 24 hours, the carry flag is turned ON, and the time by subtracting 24 hours from the simple sum is stored as the operation result.
2. If the operation result is 0 (0 hour, 0 minute, 0 second), the zero flag is turned ON.

Cautions

1. Number of devices occupied Three devices are occupied each in , and . Be careful not to overlap with the devices used in machine control.
2. When using the time (hour, minute, second) of the clock data of the real time clock built in the PLC, first read out the value of the special data register by using TRD, TRDP, and specify the word device in each operand.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Program example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 550)
Fig. 508 · Program example

10 hours, 30 minutes, 10 seconds 3 hours, 10 minutes, 5 seconds 13 hours, 40 minutes, 15 seconds

If the operation result exceeds 24 hours

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — If the operation result exceeds 24 hours diagram (page 550)
Fig. 509 · If the operation result exceeds 24 hours

4 hours, 30 minutes, 35 seconds 10 hours, 20 minutes, 5 seconds 18 hours, 10 minutes, 30 seconds

Page 551 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.4 TSUB / RTC Data Subtraction
Page 551 · click to enlarge
Page 551
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.4 TSUB / RTC Data Subtraction diagram (page 551)
Fig. 510 · 21.4 TSUB / RTC Data Subtraction

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Two time data are subtracted and stored in the word device.

"Hour" of subtraction time data (hour, minute, second) (3 points occupied) ARRAY [0..2] OF ANY16

"Hour" of subtraction time data (hour, minute, second) (3 points occupied) ARRAY [0..2] OF ANY16

The subtracting result of two time data (hour, minute, second) is stored (3 points occupied)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 552 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — If the operation result is less than 0 hour
Page 552 · click to enlarge
Page 552

21 Applied Instructions (Real Time Clock Control)

21.4 TSUB / RTC Data Subtraction

Function and operation explanation

1. 16-bit operation (TSUB, TSUBP) From the time data (hour, minute, second) of the device specified by , the time data (hour, minute, second) of the device specified by is subtracted, and the result is stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 552)
Fig. 511 · Function and operation explanation

Device for storing "hour" of subtraction time data (hour, minute, second) *1.

*1 *2 Device for storing the subtracted result of two time data (hour, minute, second)

( , +1, +2) - ( , +1, +2)

If the operation result is less than 0 hour, the borrow flag is turned ON, and the time by adding 24 hours to the simple difference is stored as the operation result. If the operation result is 0 (0 hour, 0 minute, 0 second), the zero flag is turned ON.

Cautions

1. Number of devices occupied Three devices are occupied each in , and . Be careful not to overlap with the devices used in machine control.
2. When using the time (hour, minute, second) of the clock data of the real time clock built in the PLC, first read out the value of the special data register by using TRD, TRDP, and specify the word device in each operand.
3. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Program example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 552)
Fig. 512 · Program example

10 hours, 30 minutes, 10 seconds 3 hours, 10 minutes, 5 seconds 7 hours, 20 minutes, 5 seconds

If the operation result is less than 0 hour

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — If the operation result is less than 0 hour diagram (page 552)
Fig. 513 · If the operation result is less than 0 hour

11 hours, 10 minutes, 35 seconds 18 hours, 10 minutes, 5 seconds 5 hours, 20 minutes, 40 seconds

Page 553 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.5 HTOS / Hour to Second Conversion
Page 553 · click to enlarge
Page 553
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.5 HTOS / Hour to Second Conversion diagram (page 553)
Fig. 514 · 21.5 HTOS / Hour to Second Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the "hour, minute, second" unit (time) data into second unit data.

Head device for storing the time data (hour, minute, second) before conversion (3 points occupied) ARRAY [0..2] OF ANY16

Device for storing the time data (hour, minute, second) after conversion ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 554 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 554 · click to enlarge
Page 554

21 Applied Instructions (Real Time Clock Control)

21.5 HTOS / Hour to Second Conversion

Function and operation explanation

1. 16-bit operation (HTOS/HTOSP) The time data (hour, minute, second) of the device specified by is converted into the second unit, and the result is stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 554)
Fig. 515 · Function and operation explanation

d Head device for storing the time data (hour, minute, second) before conversion

Device for storing the time data (hour, minute, second) after conversion

For example, when 4 hours, 29 minutes, 31 seconds is specified, the operation is as follows.

2. 32-bit operation (DHTOS/DHTOSP) The time data (hour, minute, second) of the device specified by is converted into the second unit, and the result is stored in the device specified by
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 554)
Fig. 516 · Function and operation explanation

Head device for storing the time data (hour, minute, second) before conversion

d Device for storing the time data (hour, minute, second) after conversion

For example, when 35 hours, 10 minutes, 58 seconds is specified, the operation is as follows.

Error

In the following case, it is an operation error, and the error flag (M8067) is turned ON, and the error code is stored in D8067.

1. When the data of the device specified by is out of the range. (Error code: K6706)
Show 10 more labels / short text on this page
s · s · 16171 +1 · +2 s · d d s · +1 · s · +1 · s · +2
Page 555 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.5 HTOS / Hour to Second Conversion
Page 555 · click to enlarge
Page 555
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.5 HTOS / Hour to Second Conversion diagram (page 555)
Fig. 517 · 21.5 HTOS / Hour to Second Conversion

This is a program for converting the time data being read out from the real-time clock built in the PLC, when the X020 is ON, into the second unit, and storing in D100, D101.

Page 556 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 556 · click to enlarge
Page 556

21 Applied Instructions (Real Time Clock Control)

21.6 STOH / Second to Hour Conversion

21.6 STOH / Second to Hour Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts the time data in second unit into time data in "hour, minute, second" unit.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 556)
Fig. 518 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 556)
Fig. 519 · 2. Set data

Device for storing the time data in second unit before conversion ANY16 ANY32

Device for storing the time data in "hour, minute, second" unit after conversion (3 points occupied) ARRAY [0..2] OF ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 556)
Fig. 520 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 557 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 557 · click to enlarge
Page 557

21 Applied Instructions (Real Time Clock Control)

21.6 STOH / Second to Hour Conversion

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation The second unit data of the device specified by is converted into "hour, minute, second" unit, and the result is stored in the device specified by .

Device for storing the time data in second unit before conversion

Device for storing the time data in "hour, minute, second" unit after conversion

second (0 to 32767)

Applied Instructions (Extension Function)

For example, when 29011 seconds is specified, the operation is as follows.

2. 32-bit operation The second unit data of the device specified by is converted into "hour, minute, second" unit, and the result is stored in the device specified by .

Applied Instructions (Block Data Operation)

d Device for storing the time data in

Device for storing the time data in "hour, minute, second" unit after conversion

second unit before conversion

Applied Instructions (Character String Control)

second (0 to 117964799)

For example, when 45325 seconds is specified, the operation is as follows.

Applied Instructions (Data Comparison)

Error

In the following case, it is an operation error, and the error flag (M8067) is turned ON, and the error code is stored in D8067.

1. When the data of the device specified by is out of the range. (Error code: K6706)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 30 more labels / short text on this page
Command input · STOH EN s · s · hour · (0 to 9) · +1 · minute · (0 to 59) · +2 · second · (0 to 59) · s d · +1 · Applied Instructions (Others) · +2 · Command input · DSTOH EN s · s · +1 s · hour · (0 to 32767) · +1 · minute · (0 to 59) · +2 · second · (0 to 59) · s s · +1 · +2
Page 558 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 40000 D1,D0
Page 558 · click to enlarge
Page 558

21 Applied Instructions (Real Time Clock Control)

21.6 STOH / Second to Hour Conversion

Program example

This is a program for converting the second unit data stored in D0, D1 when the X020 is turned ON, into the "hour, minute, second" unit, and storing the result in D100, D101, D102.

[ST]

DSTOH(X020,D0,D100);

Operation

1. Conversion into the "hour, minute, second" unit by STOHP instruction (when 40000 seconds is specified by D1, D0)

40000 D1,D0

[Structured ladder/FBD] · DSTOH EN s · d D100 D0

Page 559 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.7 TRD / Read RTC data
Page 559 · click to enlarge
Page 559
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.7 TRD / Read RTC data diagram (page 559)
Fig. 521 · 21.7 TRD / Read RTC data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The clock data is read out in the real-time clock built in the PLC. When using FX2NC PLC, optional memory board for Real time clock is required.

The reading destination of clock data and the head device are specified (7 points occupied).

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 560 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 560 · click to enlarge
Page 560

21 Applied Instructions (Real Time Clock Control)

21.7 TRD / Read RTC data

Function and operation explanation

1. 16-bit operation (TRD) The clock data (D8013 to D8019) of the real-time clock built in the PLC is read out into the device specified by

in the following format.

This instruction reads out the real-time clock data of the PLC into seven data registers.

TRD(X000,D0);

TRD EN ENO

Device Item Clock data Device Item

D8018 Year (solar calendar) 0 to 99 (Lower 2 digits of year) → D 0 Year (solar calendar)

D8017 Month 1 to 12 → D 1 Month

D8016 Day 1 to 31 → D 2 Day

D8015 hour 0 to 23 → D 3 hour

D8014 minute 0 to 59 → D 4 minute

D8013 second 0 to 59 → D 5 second

D8019 Day of week 0 (Sunday) to 6 (Saturday) → D 6 Day of week

Cautions

1. Number of devices occupied Seven devices specified by are occupied. Be careful not to overlap with the devices used in machine control.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Special data register

Page 561 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.8 TWR / Set RTC data
Page 561 · click to enlarge
Page 561
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.8 TWR / Set RTC data diagram (page 561)
Fig. 522 · 21.8 TWR / Set RTC data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The clock data is written into the real-time clock built in the PLC. When using FX2NC PLC, optional memory board for Real time clock is required.

The writing source of clock data and the head device are specified (7 points occupied).

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 562 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 562 · click to enlarge
Page 562

21 Applied Instructions (Real Time Clock Control)

21.8 TWR / Set RTC data

Function and operation explanation

The setting clock data stored in the device specified by is written into the clock data (D8013 to D8019) of the real-time clock built in the PLC.

TWRP EN ENO X000

1. D8018 (year data) can be also changed over to four-digit mode. (See Program example.)

Device Item Clock data Device Item

of year) → D8018 Year (solar calendar)

D 10 Year (solar calendar) 0 to 99 (Lower 2 digits

D 11 Month 1 to 12 → D8017 Month

D 12 Day 1 to 31 → D8016 Day

D 13 hour 0 to 23 → D8015 hour

D 14 minute 0 to 59 → D8014 minute

D 15 second 0 to 59 → D8013 second

D 16 Day of week 0 (Sunday) to 6 (Saturday) → D8019 Day of week

2. When TWR or TWRP is executed, the clock data of the real-time clock is changed immediately. Therefore, in the device to be specified by , you are advised to transfer the clock data of several minutes ahead, and execute the instruction when reaching the exact time.
3. When setting the clock data (time setting) by this instruction, you are not required to control the special auxiliary relay M8015 (time stopping and time setting).
4. The day of week of FX 1S , FX 1N , FX 1NC , FX 3S , FX 3G , FX 3GC , FX 3U and FX 3UC PLCs is set automatically depending on the content of the date regardless of the written numeric value.
5. If a numeric value of non-existing date is entered, the clock data is not changed. Enter correct clock data, and write again.

Cautions

1. Number of devices occupied The device specified by occupies the subsequent seven devices. Be careful not to overlap with the devices used in machine control.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

s D10 · Special data register · Time setting data

Page 563 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8002
Page 563 · click to enlarge
Page 563

21 Applied Instructions (Real Time Clock Control)

21.8 TWR / Set RTC data

Program example

Applied Instructions (Real Time Clock Control)

1. Setting example of clock data (time) To set the real-time clock. In the case of 15 hours, 20 minutes, 30 seconds, Tuesday, April 25, 2001.

M0:=LDP(TRUE,X000); MOV(M0,K1,D0); MOV(M0,K4,D1); MOV(M0,K25,D2); MOV(M0,K15,D3); MOV(M0,K20,D4); MOV(M0,K30,D5); MOV(M0,K2,D6); TWR(M0,D0); M8017:=X001;

M0

M0

Year (lower 2 digits)

Applied Instructions (Extension Function)

Applied Instructions (Block Data Operation)

Applied Instructions (Character String Control)

TWR EN ENO s D0

Updating of current value of built-in real-time clock

M8017 X001

Correction of 30 seconds ±

1. When setting the time, first set the time of several minutes ahead, and turn ON the X000 when reaching the exact time, then the set time is written into the real-time clock, and the clock data is updated.

Applied Instructions (Data Comparison)

2. Every time the X001 is turned ON, ± 30 seconds can be corrected.
3. When handling the year in four digits, please add the following program. D8018 operates in four-digit year mode from the second scan after RUN of PLC.

M8002

Applied Instructions (Data Table Operation)

a) Usually, the PLC operates in two-digit year mode. After RUN of PLC, by executing the above

instruction, and transferring K2000 (fixed value) to D8018 (year) for one operation cycle only, the operation is changed to four-digit mode. b) This program must be executed every time the PLC is set to RUN. By transferring K2000, only the

year display is changed to four-digit mode, and the present time is not changed. c) In the case of four-digit mode of the year, 80 to 99 correspond to 1980 to 1999, and 00 to 79

Applied Instructions (External Device Communication)

correspond to 2000 to 2079. Example: 80=1980, 99=1999, 00=2000, 79=2079

Show 26 more labels / short text on this page
LDP EN s · d X000 · MOV EN s · d D0 K1 · MOV EN s · Month · d D1 K4 · MOV EN s · Day · d D2 K25 · Applied Instructions (Others) · MOV EN s · hour · d D3 K15 · MOV EN s · minute · d D4 K20 · MOV EN s · second · d D5 K30 · MOV EN s · Day of week · d D6 K2 · MOV EN s · Initial pulse · d D8018 K2000
Page 564 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.8 TWR / Set RTC data
Page 564 · click to enlarge
Page 564

21 Applied Instructions (Real Time Clock Control)

21.8 TWR / Set RTC data

4. When connecting with the data access unit of FX-10DU, FX-20DU, FX-25DU types, please set the year in two-digit mode. If set in four-digit mode, the year is not displayed correctly in the present versions of these DU types. When the PLC is in four-digit mode, if the clock is set from FX-10DU, 20DU, 25DU, it must be noted that the mode is changed to two-digit mode.
Page 565 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 21.9 HOUR / Hour Meter
Page 565 · click to enlarge
Page 565
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 21.9 HOUR / Hour Meter diagram (page 565)
Fig. 523 · 21.9 HOUR / Hour Meter

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction adds and measures the ON time duration of input contact in one-hour unit.

ON time duration of d2 (set in one-hour unit) ANY16 ANY32

Present value of one-hour unit (data register for power failure hold is specified)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S2 S3 z

Page 566 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation
Page 566 · click to enlarge
Page 566

21 Applied Instructions (Real Time Clock Control)

21.9 HOUR / Hour Meter

Function and operation explanation

1. 16-bit operation When the cumulative total of ON time duration of command input exceeds the time of the device specified by , the device specified by is turned ON. In +1, the present value of less than one hour is stored in one-second unit.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 566)
Fig. 524 · Function and operation explanation

: The time until is turned ON is specified in one-hour unit. : Present value of one-hour unit +1 : Present value of less than one hour (one-second unit) : Device of alarm output destination It turns ON when the current value reaches or exceeds the time specified in .

1. To use the present value data continuously after the PLC power source is turned OFF, please specify the data register for power failure hold in the device specified by . When the data register for general purpose is used, the present value data is cleared when the PLC power source is turned OFF, or when changed from STOP to RUN.
2. Measurement continues even after the alarm output (device specified by ) is turned ON. When measures the ON time beginning again, clear the current value stored in and +1. When the current value is clear, alarm output is turned OFF.
3. Measurement stops when the present value of the device specified by reaches the maximum value of 16-bit figure. When desired to measure continuously, please clear the present values of to +1.

2. 32-bit operation

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation diagram (page 566)
Fig. 525 · 2. 32-bit operation

Present value of one-hour unit Device of alarm output destination

[ +1, ] : Time setting until is turned ON Specify by +1 (upper digit), (lower digit). [ +1, ] : Present value of one-hour unit Store in +1 (upper digit), (lower digit). +2 : Present value of less than one hour (one-second unit) : Specification of alarm output It turns ON when the current value , reaches or exceeds the time specified in .

1. To use the present value data continuously after the PLC power source is turned OFF, please specify the data register for power failure hold in the device specified by . When the data register for general purpose is used, the present value data is cleared when the PLC power source is turned OFF, or when changed from STOP to RUN.
2. Measurement continues even after the alarm output (device specified by ) is turned ON. When measures the ON time beginning again, clear the current value stored in to +2. When the current value is clear, alarm output is turned OFF.
3. Measurement stops when the present value of the device specified by reaches the maximum value of 32-bit figure. When desired to measure continuously, please clear the present values of to +2.
Page 567 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — HOUR(X000,K300,D200,Y005); HOUR EN ENO
Page 567 · click to enlarge
Page 567

21 Applied Instructions (Real Time Clock Control)

21.9 HOUR / Hour Meter

Cautions

Applied Instructions (Real Time Clock Control)

1. The instruction is provided in the FX 2N and FX 2NC PLCs Ver. 3.00 or later.
2. Number of devices occupied The device specified by occupies two devices (16-bit operation) or three devices (32-bit operation). Be careful not to overlap with the devices used in machine control.
3. Some restrictions to applicable devices. S 1: The FX 3U and FX 3UC PLCs only are applicable, index (V, Z) decoration is disabled. S 2: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 3: The FX 3U and FX 3UC PLCs only are applicable.
4. When the DHOUR instruction is used for 32-bit operation in the FX 2N or FX 2NC PLC. A device specified for alarm output may turn ON before the time specified by the DHOUR instruction is reached. For avoiding such turning ON, add the circuit inside in the program example shown below to the program.

Applied Instructions (Extension Function)

A *1

DHOUR EN ENO

M0 turns ON when the cumulative total (D210 and D211) of ON time duration of X000 exceeds 40,000 hours.

K40000

ANDD

SET EN

M0 is set when the current value of D210 and D211 is 40,000 hours or more.

M0 *4

Applied Instructions (Block Data Operation)

ANDD> EN ENO s1 s2 K40000*2

RST EN

M0 is reset when the current value of D210 and D211 is less than 40,000 hours.

M0 *4

M0

Y007

Applied Instructions (Character String Control)

*1: Program the part in the interrupt disabled range when a device specified for alarm output is used in the interrupt program. (Lay out the program part between the DI instruction and the EI instruction.) *2: Set a value set in of the DHOUR instruction. *3: Set a value set in of the DHOUR instruction. *4: Set a value set in of the DHOUR instruction.

A

A s d1 d2

Program example

When the cumulative total of ON time duration of X000 exceeds 300 hours, Y005 is turned ON. In D201, the present time of less than one hour is stored in one-second unit.

Applied Instructions (Data Comparison)

HOUR(X000,K300,D200,Y005); HOUR EN ENO

K300

Y005

: Time setting for turning ON Specified in one-hour unit. : Present value of one-hour unit +1 : Present value of less than one hour (one-second unit) : Specification of alarm output It turns ON when the current value reaches or exceeds the time specified in . (In this example, to be turned ON when reaching 300 hours.)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 8 more labels / short text on this page
Input specification · s D210 M0 · Applied Instructions (Others) · d ENO · d ENO · Alarm notice · Alarm output · d1 d2 s
Page 568 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — WR3A
Page 568 · click to enlarge
Page 568

This chapter introduces conversion instructions for gray codes used in absolute type rotary encoders and instructions dedicated to analog blocks.

Instruction name Function Reference

GRY

Decimal to Gray Code Conversion Section 22.1 GRYP

DGRY

DGRYP

GBIN

Gray Code to Decimal Conversion Section 22.2 GBINP

DGBIN

DGBINP

RD3A

Read form Dedicated Analog Block Section 22.3 RD3AP

WR3A

Write to Dedicated Analog Block Section 22.4 WR3AP

Page 569 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 22.1 GRY / Decimal to Gray Code Conversion
Page 569 · click to enlarge
Page 569
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 22.1 GRY / Decimal to Gray Code Conversion diagram (page 569)
Fig. 526 · 22.1 GRY / Decimal to Gray Code Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts a binary value into a gray code, and transfers it.

Conversion source data or word device storing conversion source data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

Page 570 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 570 · click to enlarge
Page 570

22.1 GRY / Decimal to Gray Code Conversion

Function and operation explanation

1. 16-bit operation (GRY, GRYP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 570)
Fig. 527 · Function and operation explanation

d s Conversion source data or word device storing conversion source data

This instruction converts and transfers data from the source (binary) to the destination (gray code).

When the data specified by is K1234 and the device specified by is K3Y10

BIN 1234 0 1 0 0 1 0 1 1 0 0 1 0

1 1 0 1 1 1 0 1 0 1 1 0

1. The device specified by can store a value from 0 to 32,767.

2. 32-bit operation (DGRY, DGRYP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DGRY, DGRYP) diagram (page 570)
Fig. 528 · 2. 32-bit operation (DGRY, DGRYP)

Conversion source data or word device storing conversion source data

1. A binary value can be converted into a gray code of up to 32 bits.
2. The device specified by can store a value from 0 to 2,147,483,647.

Cautions

1. The data conversion speed depends on the scan time of the PLC.
2. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Page 571 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 22.2 GBIN / Gray Code to Decimal Conversion
Page 571 · click to enlarge
Page 571
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 22.2 GBIN / Gray Code to Decimal Conversion diagram (page 571)
Fig. 529 · 22.2 GBIN / Gray Code to Decimal Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts a gray code into a binary value, and transfers it.

Conversion source data or word device storing conversion source data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z z z

Page 572 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 572 · click to enlarge
Page 572

22.2 GBIN / Gray Code to Decimal Conversion

Function and operation explanation

1. 16-bit operation (GBIN, GBINP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 572)
Fig. 530 · Function and operation explanation

Conversion source data or word device storing conversion source data

This instruction converts and transfers data from the source (gray code) to the destination (binary).

When the device specified by is K3X000 and the device specified by is D10

1 1 0 1 1 1 0 1 0 1 1 0

0 1 0 0 1 0 1 1 0 0 1 0 b0 b15

1. This instruction can be used for detecting an absolute position by a gray code type encoder.
2. The device specified by can store a value from 0 to 32,767.

2. 32-bit operation (DGBIN, DGBINP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DGBIN, DGBINP) diagram (page 572)
Fig. 531 · 2. 32-bit operation (DGBIN, DGBINP)

Conversion source data or word device storing conversion source data

1. A gray code can be converted into a binary value of up to 32 bits.
2. The device specified by can store a value from 0 to 2,147,483,647.

Cautions

1. When an input relay (X) is specified as , the response delay will be "Scan time of PLC + Input filter constant." The input filter value can be changed in X000 to X017 using REFF, REFFP or D8020 (filter adjustment) so that the filter constant delay is eliminated.

*1. The FX2N-16M , FX2NC-16M , FX3G and FX3GC PLCs use X000 to X007.

2. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
Page 573 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 22.3 RD3A / Read form Dedicated Analog Block
Page 573 · click to enlarge
Page 573
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 22.3 RD3A / Read form Dedicated Analog Block diagram (page 573)
Fig. 532 · 22.3 RD3A / Read form Dedicated Analog Block

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.

  • Special block number
  • FX 1N , FX 1NC , FX 2N , FX 2NC , FX 3G , FX 3GC , FX 3U and FX 3UC (D, DS, DSS) series PLCs: K0 to K7
  • FX 3UC -32MT-LT (-2) series PLC: K1 to K7

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 z

z S1 z

z S1 z z z

Page 574 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 574 · click to enlarge
Page 574

22.3 RD3A / Read form Dedicated Analog Block

Function and operation explanation

1. 16-bit operation (RD3A, RD3AP)

[ST]

RD3A EN m1 m2

d Word device storing the read data

This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.

: Special block number FX3G, FX3GC, FX3U and FX3UC (D, DS, DSS) series PLCs: K0 to K7 FX3UC-32MT-LT(-2) : K1 to K7 (K0 indicates the built-in CC-Link/LT master.) : Analog input channel number FX0N-3A*1 : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A*1 : 0 to 255 (8 bits) FX2N-2AD : 0 to 4095 (12 bits)

*1. The FX0N-3A is available only for the FX3U and FX3UC PLCs.

This instruction reads an analog input value from the analog block FX0N-3A.

: Special block number K0 to K7 : Analog input channel number FX0N-3A : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A : 0 to 255 (8 bits)

This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.

: Special block number K0 to K7 : Analog input channel number FX0N-3A : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A : 0 to 255 (8 bits) FX2N-2AD : 0 to 4095 (12 bits)

Cautions

1. RD3A instruction is provided in the FX 2N and FX 2NC PLCs Ver.3.00 or later.
2. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.
Show 5 more labels / short text on this page
[Structured ladder/FBD] · Command input · RD3A(EN,m1,m2,d); · Special block number · Analog input channel
Page 575 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 22.4 WR3A / Write to Dedicated Analog Block
Page 575 · click to enlarge
Page 575
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 22.4 WR3A / Write to Dedicated Analog Block diagram (page 575)
Fig. 533 · 22.4 WR3A / Write to Dedicated Analog Block

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes a digital value to the analog block FX0N-3A and FX2N-2DA.

  • Special block number
  • FX 1N , FX 1NC , FX 2N , FX 2NC , FX 3G , FX 3GC , FX 3U and FX 3UC (D, DS, DSS) series PLCs: K0 to K7
  • FX 3UC -32MT-LT (-2) series PLC: K1 to K7

Data to be written or word device storing data to be written. ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 z

z S1 z

z S1 z z z

Page 576 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 576 · click to enlarge
Page 576

22.4 WR3A / Write to Dedicated Analog Block

Function and operation explanation

1. 16-bit operation (WR3A, WR3AP)

[ST]

WR3A EN m1 m2

Special block number Analog output channel

s Data to be written or word device storing data to be written.

This instruction writes a digital value to the analog block FX0N-3A or FX2N-2DA.

: Special block number FX3G, FX3GC, FX3U and FX3UC (D, DS, DSS) series PLCs: K0 to K7 FX3UC-32MT-LT(-2) : K1 to K7 (K0 indicates the built-in CC-Link/LT master.) : Analog output channel number FX0N-3A*1 : K1(ch1) FX2N-2DA : K21(ch1), K22(ch2) : Data to be written This specifies the value to be written to the analog block. FX0N-3A*1 : 0 to 255 (8 bits) FX2N-2DA : 0 to 4095 (12 bits)

*1. The FX0N-3A is available only for the FX3U and FX3UC PLCs.

This instruction writes a digital value to the analog block FX0N-3A.

: Special block number K0 to K7 : Analog output channel number FX0N-3A : K1(ch1) : Data to be written This specifies the value to be written to the analog block. FX0N-3A : 0 to 255 (8 bits)

This instruction writes a digital value to the analog block FX0N-3A or FX2N-2DA.

: Special block number K0 to K7 : Analog output channel number FX0N-3A : K1(ch1) FX2N-2DA : K21(ch1), K22(ch2) : Data to be written This specifies the value to be written to the analog block. FX0N-3A : 0 to 255 (8 bits) FX2N-2DA : 0 to 4095 (12 bits)

Cautions

1. RD3A instruction is provided in the FX 2N and FX 2NC PLCs V3.00 or later.
2. Some restrictions to applicable devices. S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable.

[Structured ladder/FBD] · Command input · WR3A(EN,m1,m2,s);

Page 577 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — EXTR_OUT
Page 577 · click to enlarge
Page 577

23 Applied Instructions (Extension Function)

Applied Instructions (Real Time Clock Control)

23. Applied Instructions (Extension Function)

This chapter introduces inverter instructions for the FX2N and FX2NC PLCs.

Instruction name Function Reference

EXTR_IN

External ROM function Section 23.1 EXTRP_IN

EXTR_OUT

External ROM function Section 23.2 EXTRP_OUT

Applied Instructions (Extension Function)

Applied Instructions (Block Data Operation)

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 578 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 578 · click to enlarge
Page 578

23 Applied Instructions (Extension Function)

23.1 EXTR_IN / External ROM function

23.1 EXTR_IN / External ROM function

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes the operation control instructions and parameters of the memory for extension function.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 578)
Fig. 534 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 578)
Fig. 535 · 2. Set data
  • Function number
  • K11: Inverter operation control instruction
  • K13: Writing inverter parameter
  • When issuing inverter operation control instruction: inverter instruction code (hexadecimal)
  • When writing inverter parameter: Inverter parameter number (decimal)

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 578)
Fig. 536 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

Page 579 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Related devices
Page 579 · click to enlarge
Page 579

23 Applied Instructions (Extension Function)

23.1 EXTR_IN / External ROM function

Function and operation explanation1 (Inverter operation control)

Applied Instructions (Real Time Clock Control)

→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K11 is set to the device specified by , the control values necessary for inverter operation are written in the PLC.

1. 16-bit operation (EXTR_IN, EXTRP_IN)

As for the inverter*1 of the station number specified by , the control values (contents of the device specified by ) are written to the "instruction code" (contents of the device specified by )*2.

EXTR_IN EN s sd1

ENO K11

Applied Instructions (Extension Function)

Inverter station number Inverter instruction code (hexadecimal)

Value written in inverter

*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation

*2. Refer to the "Instruction code List" described later. Also refer to the pages describing in detail the computer links from the inverter manual.

2. Inverter instruction codes

The table below shows the inverter instruction codes and their functions of the device specified by . For the instruction codes, refer to the pages describing in detail the computer links from the inverter manual.

Applied Instructions (Block Data Operation)

Instruction codes of inverter specified by

Contents to be written

A500 E500 S500

HFB Operation mode 3 3 3

HF3 Special monitor selection No. 3

HFA Operation command 3 3 3

Applied Instructions (Character String Control)

HEE Writing set frequency (EEPROM) 3 3 3

HED Writing set frequency (RAM) 3 3 3

HFD Inverter reset 3 3 3

HF4 Batch-clearing error contents 3 3 3

HFC Clearing all parameters 3 3 3

HFC User clear 3

3. Related devices

M8104 ON when installing extended ROM cassette D8104 Extended ROM type code

Applied Instructions (Data Comparison)

D8105 Extended ROM version

M8154 Function to be defined for each EXTR instruction D8154 Time waiting for EXTR instruction response

M8155 Communications port being used by EXTR instruction D8155 Step number of instruction occupying communications port

Applied Instructions (Data Table Operation)

M8156 Communication error by EXTR instruction D8156 Communication error by EXTR instruction

M8157 Communication error by EXTR instruction

(Latch)*1 D8157 Communication error by EXTR instruction (Latch)*1

K1 if no error

*1. Cleared when changing from STOP to RUN.

Applied Instructions (External Device Communication)

Show 9 more labels / short text on this page
Command input · sd2 sd3 · Applied Instructions (Others) · Applicable inverters · (hexadecimal) · Special auxiliary · Function Special data · register Function · relays
Page 580 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 580 · click to enlarge
Page 580

23 Applied Instructions (Extension Function)

23.1 EXTR_IN / External ROM function

Function and operation explanation2 (Writing inverter parameters)

→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K13 is set to device specified by , the inverter parameter is written.

1. 16-bit operation (EXTR-IN, EXTRP-IN)

The value (contents of the device specified by ) is written to the parameter (contents of the device specified by ) of the inverter of the station number specified by .

EXTR_IN EN s sd1

ENO K13

Inverter station number Inverter parameter number (decimal)

Value written in inverter

*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation

2. Related devices The same as the inverter operation control described above.

Caution

1. EXTR_IN instruction is provided in the FX 2N and FX 2NC PLCs V3.00 or later.

Command input · sd2 sd3

Page 581 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 581 · click to enlarge
Page 581

23 Applied Instructions (Extension Function)

23.2 EXTR_OUT / External ROM function

23.2 EXTR_OUT / External ROM function

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction is for the short mail transmission of the memory for extension function, inverter operation monitoring instruction, and parameter readout.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension Function)

EXTR_OUT EN s sd1

EXTR_OUT 16 bits Continuous EXTR_OUT(EN,s,sd1,sd2,sd3);

EXTRP_OUT EN s sd1

EXTRP_OUT 16 bits Pulse EXTRP_OUT(EN,s,sd1,sd2,sd3);

2. Set data

Applied Instructions (Block Data Operation)

Variable Description Data type

EN Execution condition Bit

  • Function number
  • K0: Short mail transmission
  • K10: Inverter operation monitoring instruction
  • K12: Inverter parameter readout

ANY16

Applied Instructions (Character String Control)

  • When transmitting short mail: Mail center, phone number of transmission destination and waiting time
  • When issuing inverter operation monitoring instruction and reading parameter: Inverter station number

ANY

  • When transmitting short mail: Transmission message format and message text
  • When issuing inverter operation monitoring instruction: inverter instruction code (hexadecimal)
  • When reading inverter parameter: Inverter parameter number (decimal)

ANY

ENO Execution state Bit

  • When transmitting short mail: operation status
  • When issuing inverter operation monitoring instruction and reading parameter: Destination device storing readout value

ANY

Applied Instructions (Data Comparison)

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

Applied Instructions (Data Table Operation)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

Applied Instructions (External Device Communication)

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · sd3 · sd2 · Applied Instructions (Others) · sd3 · sd2 · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · z z
Page 582 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Related devices
Page 582 · click to enlarge
Page 582

23 Applied Instructions (Extension Function)

23.2 EXTR_OUT / External ROM function

Function and operation explanation1 (Transmitting short mail)

→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension function. When K0 is set to the device specified by , the PLC transmits the short mail. The short mail is transmitted by the PLC. The NTT DoCoMo and other firms mobile phones capable of receiving the short mail are notified. The PLC connects to the NTT DoCoMo short mail center through the modem.

1. 16-bit operation (EXTR_OUT, EXTRP_OUT)

Message (contents of the device specified by ) is transmitted to the mail center (mail center specified by ).

EXTR_OUT EN s sd1

K0 Mail center, phone number of transmission destination, waiting time

Transmission message format and message text

2. Contents of message The message should be as follows.
  • Number of characters : Up to 50 half width characters (25 full width characters)
  • Type of characters : Numbers, Kanji, Katakana, Hiragana, symbols, etc.
  • Available characters : Use the character codes specified by the short mail service
  • Receiving message : Received automatically.

3. Related devices

M8104 ON when installing extended ROM cassette D8104 Extended ROM type code

D8105 Extended ROM version

M8154 Function to be defined for each EXTR instruction D8154 Time waiting for EXTR instruction response

M8155 Communications port being used by EXTR instruction D8155 Step number of instruction occupying communications port

M8156 Communication error by EXTR instruction D8156 Communication error by EXTR instruction

M8157 Communication error by EXTR instruction

(Latch)*1 D8157 Communication error by EXTR instruction (Latch)*1

K1 if no error

*1. Cleared when changing from STOP to RUN.

Show 8 more labels / short text on this page
Command input · sd3 · Operation status · sd2 · Special auxiliary · Function Special data · register Function · relays
Page 583 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — A500 E500 S500
Page 583 · click to enlarge
Page 583

23 Applied Instructions (Extension Function)

23.2 EXTR_OUT / External ROM function

Function and operation explanation2 (Monitoring inverter operation)

Applied Instructions (Real Time Clock Control)

→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K10 is set to the device specified by , the inverter operation is monitored.

1. 16-bit operation (EXTR_OUT, EXTRP_OUT)

As for the inverter*1 of the station number specified by , the operation condition of the inverter corresponding to the "instruction code"*2 (contents of the device specified by ) is read to the device specified by .

EXTR_OUT EN s sd1

K10 Inverter station number Inverter instruction code

Destination device storing readout value.

Applied Instructions (Extension Function)

*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation

*2. Refer to the instruction code list described later. Also refer to the pages describing in detail the computer links from the inverter manual.

2. Inverter instruction code

The table below shows the inverter instruction codes and their functions of the device specified by . For the instruction codes, refer to the pages describing in detail the computer links from the inverter manual.

Contents to be read out

Applied Instructions (Block Data Operation)

A500 E500 S500

H7B Operation mode 3 3 3

H6F Output frequency [rotational speed] 3 3 3

H70 Output current 3 3 3

H71 Output voltage 3 3

Applied Instructions (Character String Control)

H72 Special monitor 3

H73 Special monitor selection number 3

H74 Error contents 3 3 3

H75 Error contents 3 3 3

H76 Error contents 3 3

H77 Error contents 3 3

H7A Inverter status monitor 3 3 3

H6E Set frequency (E2PROM) readout 3 3 3

H6D Set frequency (RAM) readout 3 3 3

H7F Link parameter extension setting Not commanded by for this instruction. Use EXTR K12 instruction to set "second parameter specification code" for automatic processing. H6C Second parameter switchover

Applied Instructions (Data Comparison)

3. Related devices The same as the short mail transmission described above.

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 7 more labels / short text on this page
Command input · sd3 · sd2 · Applied Instructions (Others) · Applicable inverters · Inverter instruction code · (hexadecimal)
Page 584 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 584 · click to enlarge
Page 584

23 Applied Instructions (Extension Function)

23.2 EXTR_OUT / External ROM function

Function and operation explanation3 (Reading inverter parameters)

→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K12 is set to the device specified by , the inverter parameter is read out to the PLC.

1. 16-bit operation (EXTR_OUT, EXTRP_OUT)

The value of the parameter specified by is read out from the inverter*1 of the station number specified by to the device specified by .

EXTR_OUT EN s sd1

K13 Inverter station number

Destination device storing readout value.

*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation

2. Related devices The same as the short mail transmission described above.

Caution

EXTR_IN instruction is provided in the FX2N and FX2NC PLCs V3.00 or later.

Show 4 more labels / short text on this page
Command input · sd3 · Inverter parameter number · sd2
Page 585 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CRC
Page 585 · click to enlarge
Page 585

24 Applied Instructions (Others)

Applied Instructions (Real Time Clock Control)

24. Applied Instructions (Others)

This chapter introduces the instructions for generating random numbers, executing CRC data operations, and processing data in high-speed counter operations.

Instruction name Function Reference

COMRD

Read Device Comment Data Section 24.1 COMRDP

RND

Random Number Generation Section 24.2 RNDP

DUTY Timing Pulse Generation Section 24.3

Applied Instructions (Extension Function)

CRC

Cyclic Redundancy Check Section 24.4 CRCP

DHCMOV High Speed Counter Move Section 24.5

Applied Instructions (Block Data Operation)

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 586 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 586 · click to enlarge
Page 586

24 Applied Instructions (Others)

24.1 COMRD / Read Device Comment Data

24.1 COMRD / Read Device Comment Data

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads the comment data for registered devices written to the PLC by programming software such as GX Works2.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 586)
Fig. 537 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 586)
Fig. 538 · 2. Set data

Device for which comment to be read is registered ANY_SIMPLE

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 586)
Fig. 539 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Page 587 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 587 · click to enlarge
Page 587

24 Applied Instructions (Others)

24.1 COMRD / Read Device Comment Data

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (COMRD/COMRDP)

1. The comment registered for the device specified by is read, and stored in ASCII code in the device specified by .

COMRDP EN ENO

d s Device for which comment to be read is registered

Head device storing read comment

b15 b8 b7 b0

ASCII code of 2nd character

ASCII code of 1st character

Applied Instructions (Extension Function)

ASCII code of 4th character

ASCII code of 3rd character

Comment of device specified in . 16 characters can be stored.

ASCII code of 6th character

ASCII code of 5th character

ASCII code of 8th character ASCII code of 7th character

ASCII code of 14th character ASCII code of 13th character

ASCII code of 16th character

ASCII code of 15th character 0000H

When the comment is made up of an even number of characters:

When M8091 is OFF, "0000H" is stored to the device following the last character. When M8091 is ON, the device following the last character does not change.

For example, when the comment of the device specified by is "Line No.1 Start", it is stored in the device specified by as shown below.

Applied Instructions (Block Data Operation)

b15 b8 b7 b0

69H(i) 65H(e) 4CH(L) 6EH(n) 4EH(N) 31H(1) 2EH(.

Applied Instructions (Character String Control)

74H(t) 72H(r) 53H(S) 61H(a) 74H(t)

LineNo.1Start

20H(space) 20H(space) 0000H 20H(space)

When the comment is made up of an odd number of characters:

When M8091 is OFF, "00H" is written to the high order byte of the device that stores the last character. When M8091 is ON, the high order byte of the device that stores the last character does not change.

2. The last data of the device specified by is as follows depending on the ON/OFF status of M8091.

ON/OFF status Contents of processing

  • When the comment is made up of an odd number of characters, "00H" is written to the high order one byte (8 bits) of the device storing the last character of the comment.
  • When the comment is made up of an even number of characters, "00H" is written to the device that follows the device storing the last character of the comment.

Applied Instructions (Data Comparison)

M8091=OFF

  • When the comment is made up of an odd number of characters, the high order one byte (8 bits) of the device storing the last character of the comment does not change.
  • When the comment is made up of an even number of characters, the device that follows the device storing the last character of the comment does not change.

M8091=ON

Applied Instructions (Data Table Operation)

Related devices

M8091 Output character number

selector signal Refer to the above explanation.

Applied Instructions (External Device Communication)

Show 14 more labels / short text on this page
Command input · +0 +1 +2 · s · +3 · +7 +8 · Applied Instructions (Others) · +0 +1 +2 · 6FH(o) · +3 Comment of · ) · s · +4 +5 +6 · +7 +8 · Device Name Description
Page 588 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D4 D5 D6 D7 D8
Page 588 · click to enlarge
Page 588

24 Applied Instructions (Others)

24.1 COMRD / Read Device Comment Data

Cautions

1. Specify a device number in the device specified by for which a comment is registered in the PLC. If a comment is not registered for the device specified by , "20H" (space) is stored in the device specified by for the number of characters in the comment (16 half-width characters).
2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When a comment is not registered for the device specified by (error code: K6706)
2. When the range of points used from the device specified by for the comment exceeds the corresponding device range (error code: K6706) The comment, however, is written up to that point.

Program examples

In the program shown below, the comment "Target Line A" registered to D100 is stored in ASCII code in D0 and later when X010 is set to ON. (When M8091 is OFF)

RST EN ENO

RST(X010,M8091);

COMRDP(X010,D100,D0);

M8091

COMRDP EN ENO

b15 b8 b7 b0

D0 D1 D2

61H(a) 67H(g) 54H(T) 72H(r) 65H(e) 4CH(L) 20H(space)

D3 Comment of D100

D4 D5 D6 D7 D8

6EH(n) 20H(space) 69H(i) 65H(e) 41H(A)

20H(space) 20H(space) 0000H 20H(space)

d s D100 · 74H(t) · Target Line A

Page 589 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RND EN ENO
Page 589 · click to enlarge
Page 589

24 Applied Instructions (Others)

24.2 RND / Random Number Generation

24.2 RND / Random Number Generation

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction generates random numbers.

1. Format and operation, execution form

Expression in each language

RND EN ENO

Applied Instructions (Extension Function)

RND 16 bits Continuous RND(EN,d);

RNDP EN ENO

RNDP 16 bits Pulse RNDP(EN,d);

2. Set data

Variable Description Data type

Input variable EN Execution condition Bit

ENO Execution state Bit

Applied Instructions (Block Data Operation)

Head device storing a random number ANY16

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

Applied Instructions (Character String Control)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Function and operation explanation

1. 16-bit operation (RND/RNDP) This instruction generates a pseudo-random number within the range from 0 to 32767, and stores it as a random number to the device specified by . In the pseudo-random number sequence, the source value of a random number is calculated at every time, and this instruction calculates a pseudo-random number using the source value.

Applied Instructions (Data Comparison)

RND EN ENO

d Head device storing a random number

Pseudo-random number calculation equation: (D8311, D8310) = (D8311, D8310)*1 × 103515245+12345...1) d = "[D8311, D8310]>>16)& Logical product > 00007FFFh"

Applied Instructions (Data Table Operation)

*1. To (D8311, D8310), write a non-negative value (0 to 2,147,483,647) only once when the PLC mode switches from STOP to RUN. [K1 is written to (D8311, D8310) as the initial value when the power is restored.]

Applied Instructions (External Device Communication)

Show 15 more labels / short text on this page
Instruction · name Operation Execution · form · Applied Instructions (Others) · Output variable · Special · unit Index Cons · Real Number · Character · Operand · String Pointer · type · user · tant · Command input
Page 590 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D14 D12
Page 590 · click to enlarge
Page 590

24 Applied Instructions (Others)

24.2 RND / Random Number Generation

Program examples

In the program example shown below, a random number is stored to D100 every time X010 turns ON. When the PLC mode switches from STOP to RUN, the time data converted into seconds and added by the value "(Year + Month) × Day" is written to (D8311 and D8310).

[ST]

TRD(M8002,D0);

M8002

TRD EN ENO

The clock data is read.

DHTOS(M8002,D3,D14);

ADD_E(M8002,D0,D1,D10);

MUL_E(M8002,D10,D2,D12);

Data in hour, minute and second → Data in second

DADD(M8002,D14,D12,D8310);

RNDP(X010,D100);

D3 D14

ADD_E EN _IN _IN

D10 D0 D1

MUL_E EN _IN _IN

The data in second is added by the value "(Year + Month) ´ Day", and written to D8311 and D8310.

ENO D10

DADD EN s1 s2

D14 D12

RNDP EN ENO

Show 4 more labels / short text on this page
[Structured ladder/FBD] · d D0 · DHTOS EN s · d D100
Page 591 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 24.3 DUTY / Timing Pulse Generation
Page 591 · click to enlarge
Page 591
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 24.3 DUTY / Timing Pulse Generation diagram (page 591)
Fig. 540 · 24.3 DUTY / Timing Pulse Generation

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction generates the timing signal whose one cycle corresponds to the specified number of operation cycles.

Number of scans (operation cycles) to remain ON ANY16

Number of scans (operation cycles) to remain OFF ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 592 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 592 · click to enlarge
Page 592

24 Applied Instructions (Others)

24.3 DUTY / Timing Pulse Generation

Function and operation explanation

1. 16-bit operation (DUTY)

1. The timing clock output of the device specified by is set to ON and OFF with the ON duration for "n1" scans and OFF duration for "n2" scans.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 592)
Fig. 541 · Function and operation explanation
2. Specify either one among M8330 to M8334 as the timing clock output destination device specified by
3. The counted number of scans is stored in either one among D8330 to D8334 in accordance with the timing clock output destination device specified by . The counted number of scans stored in either one among D8330 to D8334 is reset when the counted value reaches "n1 + n2" or when the command input (instruction) is set to ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 592)
Fig. 542 · Function and operation explanation
4. When the command input is set to ON, the operation is started. The timing clock output destination device specified by is set to ON or OFF by END instruction. Even if the command input is set to OFF, the operation is not stopped. In the STOP mode, the operation is suspended. When the power of the PLC is turned OFF, the operation is stopped.
5. When "n1" and "n2" are set to "0", the device specified by is set to the following status:

n1, n2 status ON/OFF status of (d)

n1 = 0,n2 ≥ 0 d = fixed to OFF

n1 > 0,n2 = 0 d = fixed to ON

Related devices

M8330 Timing clock output 1

M8331 Timing clock output 2

M8332 Timing clock output 3

Timing clock output in DUTY instruction

M8333 Timing clock output 4

M8334 Timing clock output 5

D8330 Counted number of scans for timing clock output 1 Counted number of scans for timing clock output 1 in DUTY instruction

D8331 Counted number of scans for timing clock output 2 Counted number of scans for timing clock output 2 in DUTY instruction

D8332 Counted number of scans for timing clock output 3 Counted number of scans for timing clock output 3 in DUTY instruction

D8333 Counted number of scans for timing clock output 4 Counted number of scans for timing clock output 4 in DUTY instruction

D8334 Counted number of scans for timing clock output 5 Counted number of scans for timing clock output 5 in DUTY instruction

Device Name Description

Page 593 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ON X000
Page 593 · click to enlarge
Page 593

24 Applied Instructions (Others)

24.3 DUTY / Timing Pulse Generation

Cautions

Applied Instructions (Real Time Clock Control)

1. DUTY instruction can be used up to 5 times (points). It is not permitted, however, to use the same timing clock output destination device (device specified by

) for two or more DUTY instructions.

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
3. Some restrictions to applicable devices S 1: Specify M8330 to M8334.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "n1" and/or "n2" is less than "0" (error code: K6706)

Applied Instructions (Extension Function)

2. When any device other than M8330 to M8334 is set to the device specified by . (error code: K6705)

Program examples

In the program shown below, when X000 is set to ON, M8330 is set to ON for 1 scan and OFF for 3 scans.

[ST]

DUTY EN ENO

DUTY(X000,K1,K3,M8330);

K1 K3

M8330

Applied Instructions (Block Data Operation)

ON X000

OFF

M8330

OFF ON

1 scan 3 scans

Applied Instructions (Character String Control)

0 1 2 3

0 1 D8330 current value

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others) · [Structured ladder/FBD] · d n1 n2

Page 594 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 594 · click to enlarge
Page 594

24 Applied Instructions (Others)

24.4 CRC / Cyclic Redundancy Check

24.4 CRC / Cyclic Redundancy Check

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This CRC instruction calculates the CRC (cyclic redundancy check) value which is an error check method used in communication. In addition to CRC value, there are other error check methods such as parity check and sum check. For obtaining the horizontal parity value and sum check value, CCD instruction is available. For the generation of CRC value (CRC-16), the CRC instruction uses "X16 + X15 + X2 + 1" as a polynomial and uses "FFFFH" as a default value.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 594)
Fig. 543 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 594)
Fig. 544 · 2. Set data

Head device storing data for which the CRC value is generated ANY16

Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 594)
Fig. 545 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S1 z

S1 S1 S1 z

SRefer to "Cautions"
Page 595 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — CRC EN ENO
Page 595 · click to enlarge
Page 595

24 Applied Instructions (Others)

24.4 CRC / Cyclic Redundancy Check

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation

CRC value is generated for "n" 8-bit data (unit: byte) starting from a device specified in , and stored to the device specified by . The 8-bit conversion mode and 16-bit conversion mode are available in this instruction, and the mode can be switched by turning ON or OFF M8161. For the operation in each mode, refer to the later descriptions.

CRC EN ENO

Head device storing data for which the CRC value is generated *1.

Applied Instructions (Extension Function)

*2.

Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data

Device storing the generated CRC value *3.

1. 16-bit conversion mode [M8161 = OFF] In this mode, the operation is executed for high-order 8 bits (byte) and low-order 8 bits (byte) of a device specified in . The operation result is stored to one 16-bit device specified in .

M8161 M8000

Applied Instructions (Block Data Operation)

CRC EN ENO

d s n *1 *2 *3

Applied Instructions (Character String Control)

Head device storing data for which the CRC value is generated *1.

Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data *2.

Device storing the generated CRC value *3.

Example= D100

= D0 n = 6

Contents of target data

8 bits 16 bits

Low-order byte Low-order bits of D100 01H 0301H High-order byte High-order bits of D100 03H

Applied Instructions (Data Comparison)

Low-order byte Low-order bits of D101 03H 0203H High-order byte High-order bits of D101 02H

Device storing data for which the CRC value is generated

Low-order byte Low-order bits of D102 00H 1400H High-order byte High-order bits of D102 14H

Applied Instructions (Data Table Operation)

Device storing the generated CRC value

Low-order byte Low-order bits of D0 E4H

41E4H High-order byte High-order bits of D0 41H

Applied Instructions (External Device Communication)

Show 12 more labels / short text on this page
Command input · *1 *2 *3 · d s n · Applied Instructions (Others) · 16-bit conversion mode · Command input · Device · +1 · +2 · Low-order byte · +n/2-1 · - High-order byte
Page 596 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Reference: Major polynomials for generating the CRC value
Page 596 · click to enlarge
Page 596

24 Applied Instructions (Others)

24.4 CRC / Cyclic Redundancy Check

2. 8-bit conversion mode [M8161 = ON] In this mode, the operation is executed only for low-order 8 bits (low-order byte) of device specified by

. With regard to the operation result, low-order 8 bits (byte) are stored to a device specified by , and high-order 8 bits (byte) are stored to a device specified by +1.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 24.4 CRC / Cyclic Redundancy Check diagram (page 596)
Fig. 546 · 24.4 CRC / Cyclic Redundancy Check

Head device storing data for which the CRC value is generated *1.

Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data *2.

Device storing data for which the CRC value is generated

2. Related devices

M8161*1 ON CRC instruction operates in the 8-bit mode.

OFF CRC instruction operates in the 16-bit mode.

*1. Cleared when the PLC mode is changed from RUN to STOP.

Cautions

1. In this instruction, "X 16 + X 15 + X 2 + 1" is used as a polynomial for generating the CRC value (CRC-16). There are many other standard polynomials for generating the CRC value. Note that the CRC value completely differs if an adopted polynomial is different.

Reference: Major polynomials for generating the CRC value

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Reference: Major polynomials for generating the CRC value diagram (page 596)
Fig. 547 · Reference: Major polynomials for generating the CRC…

CRC-12 X12 + X11 + X3 + X2 + X + 1

CRC-16 X16 + X15 + X2 + 1

CRC-32 X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 + X2 + X + 1

CRC-CCITT X16 + X12 + X5 + 1

2. Some restrictions to applicable devices S 1: Be sure to specify four digits for the bit devices (K4 ).

Related devices Description

Page 597 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8161:=M8000;
Page 597 · click to enlarge
Page 597

24 Applied Instructions (Others)

24.4 CRC / Cyclic Redundancy Check

Error

Applied Instructions (Real Time Clock Control)

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When any digits other than 4 digits are specified as the devices specified as or in digit specification of bit device (error code: K6706)
2. When n is outside the allowable range (1 to 256) (error code: K6706)
3. When a device specified by +n-1 or +1 is outside the allowable range (error code: K6706)

Program examples

In the program example shown below, the CRC value of the ASCII code "0123456" stored in D100 to D106 is generated and stored to D0 when M0 turns ON.

Applied Instructions (Extension Function)

1. In the case of 16-bit mode

CRC(LDP(TRUE,M0),D100,K7,D0); M8161 M8000 16-bit conversion mode

M8161:=NOT M8000;

LDP EN ENO

CRC EN ENO

d D0 D100 s K7 n

Applied Instructions (Block Data Operation)

D100 3130H Low-order byte 30H

D101 3332H Low-order byte 32H

Device storing data for which the CRC value is generated

D102 3534H Low-order byte 34H

Applied Instructions (Character String Control)

D103 3736H Low-order byte 36H

Device storing the generated CRC value D0 2ACFH Low-order byte CFH

2. In the case of 8-bit mode

[ST]

8-bit conversion mode M8161 M8000

M8161:=M8000;

LDP(TRUE,M0);

CRC(TRUE,D100,K7,D0);

LDP EN ENO

CRC EN ENO

Applied Instructions (Data Comparison)

d D0 D100 s K7 n

Contents of target data

D100 Low-order byte 30H

D101 Low-order byte 31H

Applied Instructions (Data Table Operation)

D102 Low-order byte 32H

Device storing data for which the CRC value is generated

D103 Low-order byte 33H

D104 Low-order byte 34H

D105 Low-order byte 35H

D106 Low-order byte 36H

D0 Low-order byte CFH

Device storing the generated CRC value

Applied Instructions (External Device Communication)

D1 Low-order byte 2AH

Show 10 more labels / short text on this page
Applied Instructions (Others) · d s M0 · Contents of data · Target data · High-order byte 31H · High-order byte 33H · High-order byte 35H · High-order byte 2AH · [Structured ladder/FBD] · d s M0
Page 598 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 598 · click to enlarge
Page 598

24 Applied Instructions (Others)

24.5 DHCMOV / High Speed Counter Move

24.5 DHCMOV / High Speed Counter Move

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction transfers the current value of a specified high speed counter or ring counter. The function of this instruction varies depending on the PLC version.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 598)
Fig. 548 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 598)
Fig. 549 · 2. Set data

Device of high speed counter or ring counter handled as transfer source ANY32

Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer [clear (k1), no processing (K0)] ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 598)
Fig. 550 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

SRefer to "Cautions"

Function and operation explanation

1. 32-bit operation (DHCMOV)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 598)
Fig. 551 · Function and operation explanation

Device of high speed counter or ring counter handled as transfer source Device handled as transfer destination

d s n Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer

1. The current value of a high speed counter or ring counter specified by is transferred to the device specified by .

High speed counter C235 to C255 Current value of high speed counter → [ +1, ]

D8398 Current value of [D8399, D8398] → [ +1, ]

Page 599 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DHCMOV EN ENO
Page 599 · click to enlarge
Page 599

24 Applied Instructions (Others)

24.5 DHCMOV / High Speed Counter Move

2. After transfer, the current value of the high speed counter or ring counter is processed as shown in the table below depending on the set value of "n".

Applied Instructions (Real Time Clock Control)

"n" set value Operation

K0(H0) Does not clear the current value (no processing).

K1(H1) Clears the current value to "0".

*1. Ring counters (D8099 and D8398) cannot be specified in FX3UC PLCs earlier than Ver. 2.20 (not inclusive).

2. High speed counter current value update timing and the effect of DHCMOV instruction
1. High speed counter current value update timing When a pulse is input to an input terminal for a high speed counter (C235 to C255), the high speed counter executes up-counting or down-counting. If the current value of a high speed counter is handled in an instruction such as the normal MOV instruction, the current value is updated at the timing shown in the table below. As a result, it is affected by the program scan time.

Applied Instructions (Extension Function)

Current value update timing

Hardware counter When OUT instruction for the counter is executed

Software counter Every time a pulse is input

By using DHCMOV instruction, the current value can be updated and transferred when it is executed.

2. Effect of DHCMOV instruction a) By using both input interrupt and DHCMOV instruction, the current value of a high speed counter can

be received at the rising edge or falling edge of an external input (at reception of input interrupt).

→ Refer to the Program example 2. b) When DHCMOV instruction is used just before a comparison instruction (CMP, ZCP or comparison

contact instruction), the latest value of a high speed counter is used in comparison. Unlike the comparison instruction for high speed counters (DHSCS, DHSCR or DHSZ), the following points must be kept in mind when using the DHCMOV instruction. - When the current value of a hardware counter is compared using CMP, ZCP or comparison contact instruction (not using a designated high speed counter comparison instruction), a hardware counter does not change into a software counter.

Applied Instructions (Block Data Operation)

→ FX Structured Programming Manual [Device & Common] - When the number of high speed software counter comparison instructions is reduced, the total frequency limitation is decreased.

Applied Instructions (Character String Control)

→ FX Structured Programming Manual [Device & Common] - When it is necessary to execute comparison and change an output contact (Y) as soon as the current value of a high speed counter changes, use a designated high seed counter comparison instruction (DHSCS, DHSCR or DHSZ) - DHCMOV instruction can be used as many times as necessary.

Cautions

When programming DHCMOV instruction in an input interrupt program, the following points should be observed. For assignment of pointers for input interrupt and inputs, refer to the table shown in 5) below.

1. Program EI and FEND instructions in the main program. They are necessary to execute an input interrupt program.

→ For EI and FEND, refer to Sections 7.6 and 7.7.

Applied Instructions (Data Comparison)

2. When programming DHCMOV instruction in the first line in an input interrupt program, be sure to use the pattern program shown below. Be sure to use the command contact M8394.
(EventI )

DHCMOV EN ENO

M8394 Pattern program for using the DHCMOV instruction in an interrupt program.

Applied Instructions (Data Table Operation)

Device of high speed counter or ring counter handled as transfer source Device handled as transfer destination

d s n Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer

Program to be processed as input interrupt

Applied Instructions (External Device Communication)

Applied Instructions (Others) · [Interrupt program]

Page 600 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 24.5 DHCMOV / High Speed Counter Move
Page 600 · click to enlarge
Page 600

24 Applied Instructions (Others)

24.5 DHCMOV / High Speed Counter Move

3. If two or more DHCMOV instructions are used in one input interrupt program, only the first instruction (just after the interrupt pointer) is executed when the interrupt is generated. The rest of the interrupt, including additional instructions, is executed according to normal interrupt processing. Do not use M8394 as the command contact for the DHCMOV instructions following the first.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 24.5 DHCMOV / High Speed Counter Move diagram (page 600)
Fig. 552 · 24.5 DHCMOV / High Speed Counter Move

When the input X003 turns from OFF to ON (that is, when input interrupt is accepted)

Device of high speed counter or ring counter handled as transfer source

Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer

M8000 When this instruction is executed in interrupt program

Device of high speed counter or ring counter handled as transfer source

'→ [ '+1, '] s d d Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer

4. It is not permitted to use DHCMOV instruction for the same counter in two or more input interrupt programs.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 24.5 DHCMOV / High Speed Counter Move diagram (page 600)
Fig. 553 · 24.5 DHCMOV / High Speed Counter Move
5. While input interrupts are disabled by the interrupt disable flags (shown in the table below), DHCMOV instructions are not executed when they are placed inside a corresponding interrupt.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 24.5 DHCMOV / High Speed Counter Move diagram (page 600)
Fig. 554 · 24.5 DHCMOV / High Speed Counter Move

Interrupt disable flag Corresponding interrupt pointer Input number corresponding to interrupt pointer

*1. When the PLC mode is changed from RUN to STOP, if an input interrupt is generated while input interrupts are disabled by something other than the interrupt disable flags M8050 to M8055 (after execution of DI instruction and before execution of EI instruction), DHCMOV instruction is immediately executed, but execution of the interrupt program is held. The interrupt program will be executed after EI instruction is executed and interrupt are enabled.

6. Some restrictions to the applicable devices S 1: Only the high speed counters (C235 to C255) and ring counters (D8099, D8398) *1 can be specified.

*1. The FX3UC PLCs of before Ver. 2.20 (not inclusive) cannot specify the ring counter (D8099, D8398).

Page 601 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DHCMOV EN ENO
Page 601 · click to enlarge
Page 601

24 Applied Instructions (Others)

24.5 DHCMOV / High Speed Counter Move

Function change depending on the version

Applied Instructions (Real Time Clock Control)

The function of this instruction changes depending on the version as shown in the table below.

Item Outline of function FX3U FX3UC

Ver. 2.20 or later Ver. 2.20 or later Target device Ring counter (D8099 and D8398) can be specified in the device specified by

Error

An operation error occurs in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When a device specified in or is outside the allowable range (error code: K6705)

Program examples

Applied Instructions (Extension Function)

1. Program examples 1 In the program example below, the current value of the high speed counter C235 is compared in each operation cycle, and then the output Y000 is set to ON if the current value is "K500" or more (when the current value of C235 is not cleared.)

The AND compare instruction (ANDD>=) is not available in S M8000 DHCMOV EN ENO

d s n C235 D0

K0 *1

Applied Instructions (Block Data Operation)

ANDD>= EN s1 s2

Y000

K500

when DHCMOV instruction is executed. *1.

K0The current value of the high speed counter is not cleared

Applied Instructions (Character String Control)

K1The current value of the high speed counter is cleared when

DHCMOV instruction is executed.

2. Program examples 2 In the program example below, the current value of C235 is transferred to D201 and D200, and the current value of C235 is cleared when X001 turns from OFF to ON.

[ST]

[Main program] [Main program]

EI EN ENO

EI(TRUE);

Applied Instructions (Data Comparison)

DHCMOV(M8394,C235,K1,D200);

(EventI101)

M8394

Applied Instructions (Data Table Operation)

DHCMOV EN ENO

d s n C235 K1*1

Applied Instructions (External Device Communication)

*1. K0: The current value of the high speed counter is not cleared when DHCMOV instruction is executed. K1: The current value of the high speed counter is cleared when DHCMOV instruction is executed.

Show 5 more labels / short text on this page
Applicable version · Applied Instructions (Others) · [Structured ladder/FBD] · [Interrupt program] · [Interrupt program]
Page 602 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DBKCMP=
Page 602 · click to enlarge
Page 602

25 Applied Instructions (Block Data Operation)

25. Applied Instructions (Block Data Operation)

This chapter introduces the instructions for adding, subtracting and comparing block data.

Instruction name Function Reference

BK+

Block Data Addition Section 25.1 BK+P

DBK+

DBK+P

BK-

Block Data Subtraction Section 25.2 BK-P

DBK-

DBK-P

BKCMP=

BKCMP>

BKCMP<

BKCMP<>

BKCMP<=

BKCMP>=

BKCMP=P

BKCMP>P

BKCMP<P

BKCMP<>P

BKCMP<=P

BKCMP>=P

Block Data Compare Section 25.3

DBKCMP=

DBKCMP>

DBKCMP<

DBKCMP<>

DBKCMP<=

DBKCMP>=

DBKCMP=P

DBKCMP>P

DBKCMP<P

DBKCMP<>P

DBKCMP<=P

DBKCMP>=P

Page 603 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 25.1 BK+ / Block Data Addition
Page 603 · click to enlarge
Page 603
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 25.1 BK+ / Block Data Addition diagram (page 603)
Fig. 555 · 25.1 BK+ / Block Data Addition

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Added constant or head device storing addition data ANY16 ANY32

Page 604 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DBK+/DBK+P)
Page 604 · click to enlarge
Page 604

25 Applied Instructions (Block Data Operation)

25.1 BK+ / Block Data Addition

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 604)
Fig. 556 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

1. 16-bit operation (BK+/BK+P)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 604)
Fig. 557 · Function and operation explanation

s2 n Added constant or head device storing addition data

1. "n" 16-bit binary data starting from the device specified by are added to "n" 16-bit binary data starting from the device specified by , and the operation result is stored in "n" points starting from the device specified by .
2. A (16-bit) constant from -32768 to 32767 can be directly specified in the device specified by .

2. 32-bit operation (DBK+/DBK+P)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DBK+/DBK+P) diagram (page 604)
Fig. 558 · 2. 32-bit operation (DBK+/DBK+P)
Page 605 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K2,147,483,647(H7FFFFFFF) + K2(H00000002) → K-2,147,483,647(H80000001)
Page 605 · click to enlarge
Page 605

25 Applied Instructions (Block Data Operation)

25.1 BK+ / Block Data Addition

1. "2n" 32-bit binary data starting from the device specified by are added to "2n" 32-bit binary data starting from the device specified by , and the operation result is stored in "2n" points starting from the device specified by .

Applied Instructions (Real Time Clock Control)

s1 ] +1, [ s1 s1 ] +3, [ s1

K1234 K40000

s2 ] +1, [ s2 s2 ] +3, [ s2

K4000 K1234

+2 s1 ] +5, [ s1 +4

+2 s2 ] +5, [ s2 +4

K-2000

"2n" points +

K-1234

s1 ] +2n-3, [ s1

+2n-4 s1 ] +2n-1, [ s1 +2n-2

K-1234

s2 ] +2n-3, [ s2

+2n-4 s2 ] +2n-1, [ s2 +2n-2

K5000

K4000

K4321

d ] +1, [ d d ] +3, [ d

K5234 K41234

+2 d ] +5, [ d +4

Applied Instructions (Extension Function)

K-3234

d ] +2n-3, [ d

+2n-4 d ] +2n-1, [ d +2n-2

K3766

K8321

2. A (32-bit) constant from -2,147,483,648 to 2,147,483,647 can be directly specified in the device specified by .

s1 ] +1, [ s1 s1 ] +3, [ s1

K1234 K40000

+2 s1 ] +5, [ s1 +4

"2n" points +

K-2000

s2 ] +1, [ s2 K4312

s1 ] +2n-3, [ s1

+2n-4 s1 ] +2n-1, [ s1 +2n-2

K-1234

Applied Instructions (Block Data Operation)

K4000

d ] +1, [ d d ] +3, [ d

K5555 K44321

+2 d ] +5, [ d +4

K2321

Applied Instructions (Character String Control)

d ] +2n-3, [ d

+2n-4 d ] +2n-1, [ d +2n-2

K3087

K8321

Related instruction

BK- Subtracts binary block data.

Cautions

1. When underflow or overflow occurs in the operation result, the following processing is executed. At this time, the carry flag does not turn ON. a) In the case of 16-bit operation

Applied Instructions (Data Comparison)

K32767(H7FFF) + K2(H0002) → K-32767(H8001)

K-32768(H8000) + K-2(HFFFE) → K32766(H7FFE)

b) In the case of 32-bit operation

K2,147,483,647(H7FFFFFFF) + K2(H00000002) → K-2,147,483,647(H80000001)

K-2,147,483,648(H80000000) + K-2(HFFFFFFFE) → K2,147,483,646(H7FFFFFFE)

Applied Instructions (Data Table Operation)

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
3. The Block data addition instruction is not available in ST.

Applied Instructions (External Device Communication)

Show 10 more labels / short text on this page
b31 b0 · b31 b0 · "2n" points · b31 b0 · "2n" points · Applied Instructions (Others) · b31 b0 · b31 b0 · "2n" points · Instruction Description
Page 606 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 606 · click to enlarge
Page 606

25 Applied Instructions (Block Data Operation)

25.1 BK+ / Block Data Addition

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "n" ("2n" in 32-bit operation) devices starting from the devices specified by , and/or exceed the corresponding device range (error code: K6706).
2. When "n" ("2n" in 32-bit operation) devices starting from the device specified by overlap "n" ("2n" in 32-bit operation) devices starting from the device specified by (error code: K6706.)
3. When "n" ("2n" in 32-bit operation) devices starting from the device specified by overlap "n" ("2n" in 32-bit operation) devices starting from the device specified by (error code: K6706.)

Program examples

In the program shown below, the specified number of pieces of data stored in D150 to D0 are added to the specified number of pieces of data stored in D100 to D0 when X020 is set to ON, and the operation result is stored in D200 and later

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 606)
Fig. 559 · Program examples
Page 607 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 25.2 BK- / Block Data Subtraction
Page 607 · click to enlarge
Page 607
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 25.2 BK- / Block Data Subtraction diagram (page 607)
Fig. 560 · 25.2 BK- / Block Data Subtraction

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Subtracted constant or head device storing subtraction data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

Page 608 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DBK-/DBK-P)
Page 608 · click to enlarge
Page 608

25 Applied Instructions (Block Data Operation)

25.2 BK- / Block Data Subtraction

Function and operation explanation

1. 16-bit operation (BK-/BK-P)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 608)
Fig. 561 · Function and operation explanation

n Subtracted constant or head device storing subtraction data

1. "n" 16-bit binary data starting from the device specified by are subtracted from "n" 16-bit binary data starting from the device specified by , and the operation result is stored in "n" points starting from the device specified by .
2. A (16-bit) constant from -32768 to 32767 can be directly specified in .

2. 32-bit operation (DBK-/DBK-P)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DBK-/DBK-P) diagram (page 608)
Fig. 562 · 2. 32-bit operation (DBK-/DBK-P)

Head device storing subtraction data Subtracted constant or head device storing subtraction data

1. "2n" 32-bit binary data starting from the device specified by are subtracted from "2n" 32-bit binary data starting from the device specified by , and the operation result is stored in "2n" points starting from the device specified by .

s1 ] +1, [ s1 s1 ] +3, [ s1

s2 ] +1, [ s2 s2 ] +3, [ s2

d ] +1, [ d d ] +3, [ d

Page 609 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 609 · click to enlarge
Page 609

25 Applied Instructions (Block Data Operation)

25.2 BK- / Block Data Subtraction

2. A (32-bit) constant from -2,147,483,648 to 2,147,483,647 can be directly specified in the device specified by .

Applied Instructions (Real Time Clock Control)

s1 ] +1, [ s1 s1 ] +3, [ s1

K8765 K8888

+2 s1 ] +5, [ s1 +4

K9325

"2n" points —

s2 ] +1, [ s2 K8880

s1 ] +2n-3, [ s1

+2n-4 s1 ] +2n-1, [ s1 +2n-2

K50000

K4352

d ] +1, [ d d ] +3, [ d

K-115

+2 d ] +5, [ d +4

K8

Applied Instructions (Extension Function)

K445

d ] +2n-3, [ d

+2n-4 d ] +2n-1, [ d +2n-2

K41120

K-4528

Related instruction

BK+ Adds binary block data.

Cautions

1. When underflow or overflow occurs in the operation result, the following processing is executed. At this time, the carry flag does not turn ON. a) In the case of 16-bit operation

Applied Instructions (Block Data Operation)

K-32768(H8000) - K2(H0002) → K32766(H7FFE)

K32767(H7FFF) - K-2(HFFFE) → K-32767(H8001)

b) In the case of 32-bit operation

Applied Instructions (Character String Control)

K-2,147,483,648(H80000000) - K2(H00000002) → K2,147,483,646(H7FFFFFFE)

K2,147,483,647(H7FFFFFFF) - K-2(HFFFFFFFE) → K-2,147,483,647(H80000001)

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
3. The Block data subtraction instruction is not available in ST.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "n" ("2n" in 32-bit operation) devices starting from the devices specified by , and/or exceed the corresponding device range (error code: K6706).

Applied Instructions (Data Comparison)

2. When "n" ("2n" in 32-bit operation) devices starting from the device specified by overlap "n" ("2n" in 32-bit operation) devices starting from the device specified by (error code: K6706.)
3. When "n" ("2n" in 32-bit operation) devices starting from the device specified by overlap "n" ("2n" in 32-bit operation) devices starting from the device specified by (error code: K6706.)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 5 more labels / short text on this page
b31 b0 · b31 b0 · "2n" points · Applied Instructions (Others) · Instruction Description
Page 610 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K3
Page 610 · click to enlarge
Page 610

25 Applied Instructions (Block Data Operation)

25.2 BK- / Block Data Subtraction

Program examples

In the program shown below, the constant "8765" is subtracted from the data stored in D100 to D102 when X010 is set to ON, and the operation result is stored in D200 and later.

X020 BKEN ENO

D100 K8765

d s1 s2 n

K3

D100 D101 D102

K8701 K3502

D201 D202

K-64 K-5263

Show 4 more labels / short text on this page
[Structured ladder/FBD] · b15 b0 K12345 · b15 b0 K3580 · b15 b0 K8765
Page 611 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Page 611 · click to enlarge
Page 611
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare diagram (page 611)
Fig. 563 · 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

These instructions compare block data in the comparison condition set in each instruction.

Page 612 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Page 612 · click to enlarge
Page 612

25 Applied Instructions (Block Data Operation)

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare diagram (page 612)
Fig. 564 · 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

*1. Refer to "Cautions".

Page 613 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Page 613 · click to enlarge
Page 613
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare diagram (page 613)
Fig. 565 · 25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

Comparison value or device storing comparison value ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

Page 614 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 614 · click to enlarge
Page 614

25 Applied Instructions (Block Data Operation)

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

Function and operation explanation

1. 16-bit operation (BKCMP=, BKCMP>, BKCMPP, BKCMP
1. "n" 16-bit binary data starting from the device specified by are compared with "n" 16-bit binary data starting from the device specified by , and the comparison result is stored in "n" points starting from the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 614)
Fig. 566 · Function and operation explanation

*1. BKCMP=, BKCMP>, BKCMPP, BKCMP

2. A constant can be directly specified in the device specified by .

*3. An operation example of BKCMP= instruction is shown here.

3. The table below shows the comparison result in each instruction.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 614)
Fig. 567 · Function and operation explanation

Instruction Comparison result ON (1) condition Comparison result OFF (0) condition

4. When the comparison result is ON (1) in all of "n" points starting from the device specified by , M8090 (block comparison signal) turns ON.
Page 615 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K5678
Page 615 · click to enlarge
Page 615

25 Applied Instructions (Block Data Operation)

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

2. 32-bit operation (DBKCMP=, DBKCMP>, DBKCMPP, DBKCMP

Applied Instructions (Real Time Clock Control)

1. "2n" 32-bit binary data starting from the device specified by are compared with "2n" 32-bit binary data starting from the device specified by , and the comparison result is stored in "2n" points starting from the device specified by .

DBKCMP= *1

EN ENO

Head device storing comparison source data Comparison value or device storing comparison value

d s1 s2 n

Head device storing comparison result

Number of pieces of comparison data

Applied Instructions (Extension Function)

s1 ] +1, [ s1 s1 ] +3, [ s1

K1234 K5678

s2 ] +1, [ s2 s2 ] +3, [ s2

K5321 K3399

+2 s1 ] +5, [ s1 +4

+2 s2 ] +5, [ s2 +4

K5000

K5678

s1 ] +2n-3, [ s1

+2n-4 s1 ] +2n-1, [ s1 +2n-2

K40000

s2 ] +2n-3, [ s2

+2n-4 s2 ] +2n-1, [ s2 +2n-2

K6543

K4321

K1200

*2 An example of DBKCMP>.

OFF(0)

ON(1)

OFF(0)

ON(1)

Applied Instructions (Block Data Operation)

ON(1)

2. A constant can be directly specified in the device specified by .

s2 [ +1, ] s2

K32000

+2] s2 s2 [

K4321

+4] s2 s2 [

K32000

s1 [ +1, ] s1

=

Applied Instructions (Character String Control)

*3 An operation example of DBKCMP= instruction is shown here.

+2n-4] s2 s2 [

K1234

+2n-1, +2n-2] s2 s2 [

K5678

ON(1) OFF(0)

ON(1)

OFF(0)

OFF(0)

3. The table below shows the comparison result for each instruction.

Instruction Comparison result ON (1) condition Comparison result OFF (0) condition

Applied Instructions (Data Comparison)

DBKCMP= [ +1, ] = [ +1, ] [ +1, ] ≠ [ +1, ]

DBKCMP> [ +1, ] > [ +1, ] [ +1, ] ≤ [ +1, ]

DBKCMP< [ +1, ] < [ +1, ] [ +1, ] ≥ [ +1, ]

DBKCMP +1, ] ≠ [ +1, ] [ +1, ] = [ +1, ]

DBKCMP [ +1, ]

Applied Instructions (Data Table Operation)

DBKCMP>= [ +1, ] ≥ [ +1, ] [ +1, ] < [ +1, ]

4. When the comparison result is ON (1) in all of "n" points starting from the device specified by , the M8090 (block comparison signal) turns ON.

Applied Instructions (External Device Communication)

Show 21 more labels / short text on this page
Command input · *2 · "n" points · > · "n" points · Applied Instructions (Others) · Comparison result · +0 · +1 +2 · "n" points · +n-2 +n-1 · +3, · *3 · +5, · K32000 "n" points · +2n-3, · Comparison result · +0 · +1 +2 · "n" points · +n-2
Page 616 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 616 · click to enlarge
Page 616

25 Applied Instructions (Block Data Operation)

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

Related device

M8090 Block comparison signal Turns ON when all comparison results are "ON (1)" in a block data instruction. DBKCMP=, DBKCMP>, DBKCMP

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
2. When using 32-bit counters (high speed counters) For comparing 32-bit counters (C200 to C255), be sure to use an instruction for 32-bit operation (such as DBKCMP= and DBKCMP>). If an instruction for 16-bit operation (such as BKCMP= and BKCMP>) is used, an operation error is caused (error code: K6705)
3. Some restrictions to applicable devices S 1: D .b cannot be indexed (v, z).
4. The Block data compare instruction is not available in ST.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "n" ("2n" in 32-bit operation) devices starting from the devices specified by , and/or ) exceed the corresponding device range (error code: K6706).
2. When data registers starting from the device specified by specified as "D .b" overlap "n" ("2n" in

32-bit operation) points starting from the device specified by (error code: K6706).

3. When data registers starting from the device specified by specified as "D .b" overlap "n" ("2n" in

32-bit operation) points starting from the device specified by (error code: K6706).

4. When a 32-bit counter (C200 to C255) is specified in the devices specified by and/or in 16-bit operation (error code: K6705). For comparing 32-bit counters, be sure to use an instruction for 32-bit operation (such as DBKCMP=, DBKCMP> and DBKCMP

Device Name Description

Page 617 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K2000 K1000
Page 617 · click to enlarge
Page 617

25 Applied Instructions (Block Data Operation)

25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

Program examples

Applied Instructions (Real Time Clock Control)

1. In the program shown below, four 16-bit binary data starting from D100 are compared with four 16-bit binary data starting from D200 by BKCMP= instruction when X020 is set to ON, and the comparison result is stored in four points starting from M10. When the comparison result is "ON (1)" in all of the four points starting from M10, Y000 is set to ON.

BKCMP= EN ENO

D100 D200

d s1 s2 n

M10

K4

Applied Instructions (Extension Function)

Y000 M8090

K1000 K2000

D200 D201 D202 D203

K1000 K2000

M10 ON ON

D101 D102 D103

ON OFF M11 M12 M13

=

K4000 K3000

K4000 K5000

OFF Y000

Applied Instructions (Block Data Operation)

(When all of M10 to M13 are ON, Y000 is set to ON.)

2. In the program shown below, the constant K1000 is compared with four data starting from D10 when X010 is set to ON, and the comparison result is stored in b4 to b7 of D0.

Applied Instructions (Character String Control)

X010 BKCMP<> EN ENO

d s1 s2 n

K1000

K4

b15 b7 b4 b0

D0 before operation 0 1 0 0 0 1 0 1 0

Applied Instructions (Data Comparison)

K2000 K1000

D11 D12 D13

<> K1000

K2222 K1000

b15 b7 b4 b0 D0 after operation 0 1 0 0 1 0 1 0 1 0

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 5 more labels / short text on this page
[Structured ladder/FBD] · Block comparison signal · Comparison result · Applied Instructions (Others) · [Structured ladder/FBD]
Page 618 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — $MOV
Page 618 · click to enlarge
Page 618

26 Applied Instructions (Character String Control)

26. Applied Instructions (Character String Control)

This chapter introduces the instructions for controlling character strings such as linking character string data, replacing some characters and extracting character string data.

Instruction name Function Reference

STR

BIN to Character String Conversion Section 26.1 STRP

DSTR

DSTRP

VAL

Character String to BIN Conversion Section 26.2 VALP

DVAL

DVALP

Link Character Strings Section 26.3 $+P

LEN

Character String Length Detection Section 26.4 LENP

RIGHT

Extracting Character String Data from the Right Section 26.5 RIGHTP

LEFT

Extracting Character String Data from the Left Section 26.6 LEFTP

MIDR

Random Selection of Character Strings Section 26.7 MIDRP

MIDW

Random Replacement of Character Strings Section 26.8 MIDWP

INSTR

Character string search Section 26.9 INSTRP

$MOV

Character String Transfer Section 26.10 $MOVP

$+

Page 619 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 26.1 STR / BIN to Character String Conversion
Page 619 · click to enlarge
Page 619
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.1 STR / BIN to Character String Conversion diagram (page 619)
Fig. 568 · 26.1 STR / BIN to Character String Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts binary data into character strings (ASCII codes). On the other hand, the ESTR instruction converts floating point data into character strings.

Head device storing the number of digits of a numeric value to be converted (2 points occupied) ARRAY [0..1] OF ANY16

Device storing binary data to be converted ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

z

Page 620 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 620 · click to enlarge
Page 620

26 Applied Instructions (Character String Control)

26.1 STR / BIN to Character String Conversion

Function and operation explanation

1. 16-bit operation (STR/STRP)

1. All digits (specified by ) of 16-bit binary data of the device specified by are converted into character string while the decimal point is added to the position specified by the device storing the number of digits of the decimal part ( + 1), and stored in the device specified by and later.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 620)
Fig. 569 · Function and operation explanation

Head device storing the number of digits of a numeric value to be converted

+1 For number of all digits For value stored in

0000H is automatically stored at the end of a character string.

00H is automatically stored at the end of a character string.

2. Set the number of all digits in the range from 2 to 8.
3. Set the number of digits of the decimal part + 1 in the range from 0 to 5. Be sure to satisfy "(number of digits of decimal part) ≤ (number of all digits - 3)".
4. 16-bit binary data to be converted stored in should be within the range from -32768 to 32767.
5. Converted character string data is stored in and later as shown below.

a) As the sign, "space" (20H) is stored when the 16-bit binary data stored in is positive, and "-" (2DH) is stored when the 16-bit binary data stored in is negative. b) When the number of digits of the

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 620)
Fig. 570 · Function and operation explanation

decimal part + 1 is set to any value other than "0", the decimal point "." (2EH) is automatically added in "number of digits of decimal part + 1"th digit. When the number of digits of the decimal part + 1 is set to "0", the decimal point is not added. c) When the number of digits of the

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 620)
Fig. 571 · Function and operation explanation

decimal part + 1 is larger than the number of digits of 16-bit binary data stored in , "0" (30H) is automatically added, and the data is shifted to the right end during conversion.

Page 621 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 0000H
Page 621 · click to enlarge
Page 621

26 Applied Instructions (Character String Control)

26.1 STR / BIN to Character String Conversion

d) When the number of all digits stored

Applied Instructions (Real Time Clock Control)

Number of all digits

in excluding the sign and decimal point is larger than the number of digits of 16-bit binary data stored in , "space" (20H) is stored in each digit between the sign and the numeric value. When the number of all digits stored in excluding the sign and decimal point is smaller than the number of digits of 16-bit binary data stored in , an error is caused. e) "00H" indicating the end of a character string is automatically stored at the end of a converted

Number of digits of decimal part

"20H" (space) is stored in each digit

Applied Instructions (Extension Function)

character string. When the number of all digits is even, "0000H" is stored in the device after the last character. When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing the last character.

2. 32-bit operation (DSTR/DSTRP)

1. All digits (specified by ) of 32-bit binary data stored in the device specified by are converted into ASCII codes while the decimal point is added to the position specified by the device storing the number of digits of the decimal part ( + 1), and stored in the device specified by and later.

DSTR EN ENO

Head device storing the number of digits of a numeric value to be converted

Head device storing converted character string Device storing binary data to be converted

Applied Instructions (Block Data Operation)

Number of all digits Number of digits

ASCII code in "(Value

ASCII code indicating sign

all digits - 1)"th digit ASCII code in "(Value

Applied Instructions (Character String Control)

ASCII code in "(Value

all digits - 3)"th digit

all digits - 2)"th digit

ASCII code in "(Value

ASCII code in "(Value

For number of all digits For value stored in

all digits - 5)"th digit ASCII code in "(Value

all digits - 4)"th digit ASCII code in "(Value

all digits - 7)"th digit ASCII code in "(Value

all digits - 6)"th digit ASCII code in "(Value

High order 16 bits Low order 16 bits b31 b16 b15 b0 +1

all digits - 9)"th digit

all digits - 8)"th digit ASCII code in "(Value

00H

specifying number of all digits - 10)"th digit

00H is automatically stored at the end of a character string.

Applied Instructions (Data Comparison)

36H(6)

2DH(-)

+1 For number of all digits

34H(4)

35H(5)

4 3 2 1

33H(3)

2EH(.)

+3 31H(1)

32H(2)

-654321 32-bit binary data

0000H

Applied Instructions (Data Table Operation)

0000H is automatically stored at the end of a character string.

2. Set the number of all digits in the range from 2 to 13.
3. Set the number of digits of the decimal part + 1 in the range from 0 to 10. Be sure to satisfy "(Number of digits of decimal part) ≤ (Number of all digits - 3)".

Applied Instructions (External Device Communication)

4. 32-bit binary data to be converted stored in should be within the range from -2,147,483,648 to +2,147,483,647.
Show 41 more labels / short text on this page
16-bit binary data · Applied Instructions (Others) · Command input · d s1 s2 · b15 · b8 b7 b0 · s1 · +0 · +0 · specifying number of · +1 · of decimal part · +1 · specifying number of · specifying number of · +2 · specifying number of · specifying number of · +3 · specifying number of · specifying number of · Sign · s1 · s2 s2 · +4 · specifying number of · specifying number of · s2 · +5 · 32-bit binary data · +0 +1 · s1 · b15 · b8 b7 b0 · +0 · +2 · s1 · s2 s2 · +1 · =8 · +4
Page 622 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related instruction
Page 622 · click to enlarge
Page 622

26 Applied Instructions (Character String Control)

26.1 STR / BIN to Character String Conversion

5. Converted character string data is stored in and later as shown below.

a) For the sign, "space" (20H) is stored when the 32-bit binary data stored in is positive, and "-" (2DH) is stored when the 32-bit binary data stored in is negative. b) When the number of digits of the

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.1 STR / BIN to Character String Conversion diagram (page 622)
Fig. 572 · 26.1 STR / BIN to Character String Conversion

decimal part + 1 is set to any value other than "0", the decimal point "." (2EH) is automatically added in "number of digits of decimal part + 1"th digit. When the number of digits of the decimal part + 1 is set to "0", the decimal point is not added. c) When the number of digits of the

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.1 STR / BIN to Character String Conversion diagram (page 622)
Fig. 573 · 26.1 STR / BIN to Character String Conversion

decimal part + 1 is larger than the number of digits of 32-bit binary data stored in , "0" (30H) is automatically added, and the data is shifted to the right end during conversion. d) When the number of all digits stored in

excluding the sign and decimal point is larger than the number of digits of 32-bit binary data stored in

Number of all digits Number of digits of decimal part

0 5 4 3 1

, "space" (20H) is stored in each digit between the sign and the numeric value. When the number of all digits stored in

"20H" (space) is stored in each digit

excluding the sign and decimal point is smaller than the number of digits of binary data stored in , an error is caused. e) "00H" indicating the end of a character string is automatically stored at the end of a converted

character string. When the number of all digits is even, "0000H" is stored in the device after the last character. When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing the last character.

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Related instruction

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instruction diagram (page 622)
Fig. 574 · Related instruction

DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.

DEVAL Converts a character string (ASCII codes) into binary floating point data.

VAL Converts a character string (ASCII codes) into binary data.

32-bit binary data · -543210

Page 623 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D0 D1
Page 623 · click to enlarge
Page 623

26 Applied Instructions (Character String Control)

26.1 STR / BIN to Character String Conversion

Error

Applied Instructions (Real Time Clock Control)

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the number of all digits stored in is outside the following range (error code: K6706).

16-bit operation 2 to 8

32-bit operation 2 to 13

2. When the number of digits of the decimal part stored in + 1 is outside the following range (error code: K6706).

16-bit operation 0 to 5

Applied Instructions (Extension Function)

32-bit operation 0 to 10

3. When the relationship between the number of all digits stored in and the number of digits of the decimal part stored in + 1 does not satisfy the following (error code: K6706). (Number of all digits - 3) ≥ number of digits of decimal part
4. When the number of all digits stored in including the digit for sign and the digit for decimal point is smaller than the number of digits of the binary data stored in (error code: K6706).
5. When the devices and later storing a character string exceed the corresponding device range (error code: K6707).

Program examples

In the program below, the 16-bit binary data stored in D10 is converted into a character string in accordance with the digit specification by D0 and D1 when X000 is set to ON, and then stored in D20 to D23.

Applied Instructions (Block Data Operation)

MOVP(X000,K12672,D10);

Data to be converted is set.

MOVP(X000,K6,D0);

Applied Instructions (Character String Control)

MOVP(X000,K0,D1);

STRP(X000,D0,D10,D20);

The number of all digits is set.

The number of digits of the decimal part is set.

STRP EN ENO

Applied Instructions (Data Comparison)

D0 D20

b15 b8 b7 b0 D20 31H(1) 36H(6)

Applied Instructions (Data Table Operation)

16-bit binary data 12672" "

20H(Space) 34H(2) 32H(2) 37H(7) D21 D22 D23

Number of all digits Number of digits of decimal part

D0 D1

0000H

Applied Instructions (External Device Communication)

Show 10 more labels / short text on this page
Setting range · Setting range · Applied Instructions (Others) · MOVP EN s · d D10 K12672 · MOVP EN s · d D0 K6 · MOVP EN s · d D1 K0 · d s1 s2
Page 624 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 624 · click to enlarge
Page 624

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

26.2 VAL / Character String to BIN Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts a character string (ASCII codes) into binary data. On the other hand, EVAL instruction converts a character string (ASCII codes) into floating point data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 624)
Fig. 575 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 624)
Fig. 576 · 2. Set data

Head device storing a character string to be converted into binary data. String

Head device storing the number of digits of the binary data acquired by conversion. (2 points occupied) ARRAY [0..1] OF ANY16

Head device storing the binary data acquired by conversion. ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 624)
Fig. 577 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

z

Page 625 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 00H
Page 625 · click to enlarge
Page 625

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (VAL/VALP)

1. A character string stored in the device specified by and later is converted into 16-bit binary data. The number of all digits of the binary data acquired by conversion is stored in the device specified by

, the number of digits of the decimal part is stored in the device specified by + 1, and the converted binary data is stored in the device specified by . In conversion from a character string into binary data, the data from the device specified by to a device number storing "00H" is handled as a character string in byte units.

VAL EN ENO

Head device storing a character string to be converted into binary data

Head device storing the number of digits of the binary data acquired by conversion.

Applied Instructions (Extension Function)

Head device storing the binary data acquired by conversion.

Number of all digits Number of digits of decimal part

ASCII code of 1st character

ASCII code indicating sign

ASCII code of 3rd character

ASCII code of 2nd character

Integer value in which decimal point is ignored.

ASCII code of 5th character

ASCII code of 4th character

ASCII code of 7th character

ASCII code of 6th character

00H

1st character 2nd character

Applied Instructions (Block Data Operation)

It indicates the end of character string.

For example, when a character string "-123.45" is specified in the device specified by and later, the conversion result is stored in the devices specified by and as shown below.

Applied Instructions (Character String Control)

31H(1)

2DH(-)

33H(3)

32H(2)

34H(4)

2EH( )

- 1 2 3 4 5

00H

35H(5)

It indicates the end of character string.

2. Character string to be converted a) Number of characters of character string and the numeric range when the decimal point is ignored.

Number of all characters (digits) 2 to 8

Number of characters (digits) of decimal part 0 to 5 and smaller than "number of all digits - 3"

Applied Instructions (Data Comparison)

Numeric range when decimal point is ignored -32768 to 32767 Example) "123.45" → "12345"

b) Character types used in characters to be converted

Positive numeric value "Space (20H)"

Negative numeric value "-(2DH)"

Applied Instructions (Data Table Operation)

Decimal point ".(2EH)"

Number "0(30H)" to 9(39H)"

Applied Instructions (External Device Communication)

Show 25 more labels / short text on this page
Command input · d1 d2 s · +0 · +1 b15 · b8 b7 b0 · s · +0 · Applied Instructions (Others) · +1 · +2 · +3 · Sign · 7th character · +4 · 16-bit binary data · +0 +1 b15 · b8 b7 b0 · s · +0 · -12345 +1 · +2 · +3 · Description · Character type · Sign
Page 626 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DVAL/DVALP)
Page 626 · click to enlarge
Page 626

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

3. The device specified by stores the number of all digits. The number of all digits indicates the number of all characters (including the number, sign and decimal point).
4. The device specified by + 1 stores the number of digits of the decimal part. The number of digits of the decimal part indicates the number of all characters after the decimal point "." (2EH).
5. The device specified by stores 16-bit binary data converted from a character string with the decimal point ignored. In the character string located in the device specified by and later, "space" (20H) and "0" (30H) characters between the sign and the first number other than "0" are ignored in the conversion to 16-bit binary data.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.2 VAL / Character String to BIN Conversion diagram (page 626)
Fig. 578 · 26.2 VAL / Character String to BIN Conversion

Number of digits of decimal part 16-bit binary data

2. 32-bit operation (DVAL/DVALP)

1. A character string stored in the device specified by and later is converted into 32-bit binary data. The number of all digits of the binary data acquired by conversion is stored in the device specified by

, the number of digits of the decimal part is stored in the device specified by + 1, and the binary data is stored in the device specified by . In conversion from a character string into binary data, the data from the device specified by to a device number storing "00H" is handled as a character string in byte units.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DVAL/DVALP) diagram (page 626)
Fig. 579 · 2. 32-bit operation (DVAL/DVALP)

d1 d2 s Head device storing a character string to be converted into binary data Head device storing the number of digits of the binary data acquired by conversion.

Head device storing the binary data acquired by conversion.

Number of all digits Number of digits of decimal part

8th character ASCII code of 10th character ASCII code of 12th character

For example, when a character string "-12345.678" is specified in the device specified by and later, the conversion result is stored in the devices specified by and as shown below.

Page 627 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 627 · click to enlarge
Page 627

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

2. Character string to be converted a) Number of characters of character string and the numeric range when the decimal point is ignored.

Applied Instructions (Real Time Clock Control)

Number of all characters (digits) 2 to 13

Number of characters (digits) of decimal part 0 to 10 and smaller than "number of all digits - 3"

Numeric range when decimal point is ignored

-2,147,483,648 to 2,147,483,647 Example) "12345.678" to "12345678"

b) Character types used in characters to be converted

Positive numeric value "Space (20H)"

Negative numeric value "-(2DH)"

Decimal point ".(2EH)"

Applied Instructions (Extension Function)

Number "0(30H)" to "9(39H)"

3. The device specified by stores the number of all digits. The number of all digits indicates the number of all characters (including the number, sign and decimal point).
4. The device specified by + 1 stores the number of digits of the decimal part. The number of digits of the decimal part indicates the number of all characters after the decimal point "." (2EH).
5. The device specified by stores 32-bit binary data converted from a character string with the decimal point ignored. For the character string located in the device specified by and later, the "space" (20H) and "0" (30H) characters between the sign and the first number other than "0" are ignored in the conversion to 32-bit binary data.

Applied Instructions (Block Data Operation)

Number of all digits

2 4 2 1 - 3

Number of digits of decimal part

Number of all digits

Applied Instructions (Character String Control)

Number of digits of decimal part

8 4 2 1 3

Related instruction

DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.

DEVAL Converts a character string (ASCII codes) into binary floating point data.

STR Converts binary data into a character string (ASCII codes).

Applied Instructions (Data Comparison)

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

2) Sign data "space (20H)" or "- (2DH)" must be stored in the first byte (lower order 8 bits of the head device set in the device specified by ). Only the ASCII code data "0 (30H)" to "9 (39H)", "space (20H)" and "decimal point (2EH)" can be stored from the second byte to the "00H" at the end of the character string of the device specified by . If "- (2DH)" is stored in the second byte or later, an operation error occurs (error code: K6706).

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 11 more labels / short text on this page
Description · Character type · Sign · Applied Instructions (Others) · Ignored · 32-bit binary data · -654321 · 32-bit binary data · Ignored · Sign · Instruction Description
Page 628 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 628 · click to enlarge
Page 628

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the number of characters of the character string to be converted (device specified by and later) is outside the following ranges. (Error code: K6706)

16-bit operation 2 to 8

32-bit operation 2 to 13

2. When the number of characters after the decimal point of the character string to be converted (device specified by and later) is outside the following ranges. (Error code: K6706)

16-bit operation 0 to 5

32-bit operation 0 to 10

3. When the relationship between the number of all characters in the character string to be converted (device specified by and later) and the number of characters after the decimal point does not satisfy the following (error code: K6706). (Number of all characters - 3) ≥ Number of characters after the decimal point
4. When the sign is set to any ASCII code other than "space" (20H) and "-" (2DH). (Error code: K6706)
5. When a digit of a number is set to any ASCII code other than "0" (30H) to "9" (39H) or a decimal point "." (2EH). (Error code: K6706)
6. When the decimal point "." (2EH) is set two or more times in the character string to be converted (device specified by and later). (Error code: K6706)
7. When the binary data acquired by conversion is outside the following ranges. (Error code: K6706)

16-bit operation -32768 to 32767

32-bit operation -2,147,483,648 to 2,147,483,647

8. When "00H" is not present in the location from the device specified by to the final device number. (Error code: K6706)

Setting range · Setting range · Setting range

Page 629 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 00H
Page 629 · click to enlarge
Page 629

26 Applied Instructions (Character String Control)

26.2 VAL / Character String to BIN Conversion

Program examples

Applied Instructions (Real Time Clock Control)

1. In the program below, the character string data stored in D20 to D22 is regarded as an integer value, converted into a binary value, and stored in D0 when X000 is set to ON.

VALP EN ENO

VALP(X000,D20,D10,D0);

d1 d2 s D20 D10

b15 b8 b7 b0 D20 31H(1) 2EH(.) 2DH(-) 36H(6) 34H(4) 35H(5)

D21 D22 D23

Applied Instructions (Extension Function)

Number of all digits Number of digits of decimal part

00H

"00H" is stored here.

2. In the program below, the character string data stored in D20 to D24 is regarded as an integer value, converted into a binary value, and stored in D0 when X000 is set to ON.

DVALP(X000,D20,D10,D0);

DVALP EN ENO

d1 d2 s D20 D10

Applied Instructions (Block Data Operation)

b15 b8 b7 b0 D20 37H(7) 31H(1) 20H(Space) 39H(9) 30H(0) 30H(0)

79100611 D1 D0

D21 D22 D23 D24 D25

D10 Number of all digits Number of digits of decimal part 36H(6) 2EH(.) 31H(1) 31H(1)

Applied Instructions (Character String Control)

00H

"00H" is stored here.

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 630 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 630 · click to enlarge
Page 630

26 Applied Instructions (Character String Control)

26.3 $+ / Link Character Strings

26.3 $+ / Link Character Strings

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction links a character string to another character string.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 630)
Fig. 580 · 1. Format and operation, execution form

*1. Refer to "Cautions".

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 630)
Fig. 581 · 2. Set data

Head device storing the link source data (character string) or directly specified character string String

Head device storing the link data (character string) or directly specified character string String

Head device storing the linked data (character string) String

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 630)
Fig. 582 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

z

z

z

Page 631 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 631 · click to enlarge
Page 631

26 Applied Instructions (Character String Control)

26.3 $+ / Link Character Strings

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation ($+/$+P)

The character string data stored in the device specified by and later is linked to the end of the character string data stored in the device specified by and later, and the linked data is stored to devices starting from the device specified by . A character string specified by and indicates the data from the specified device to the first "00H" in units of byte.

$+ EN ENO

Head device storing the link source data (character string) or directly specified character string

Head device storing the linked data (character string)

Head device storing the link data (character string) or directly specified character string

Applied Instructions (Extension Function)

b15---b8 b7 b0 b15---b8 b7 b0 b15---b8 b7 b0

d s1 s2 s1

46H(F) 48H(H)

35H(5) 31H(1)

46H(F) 48H(H)

2DH(-) 41H(A) + +1

39H(9) 33H(3)

00H 41H(A) +1

2DH(-) 41H(A)

00H

+2 35H(5) 31H(1)

39H(9) 33H(3)

+2 "00H" is automatically stored.

00H 41H(A)

1. In linking, "00H" indicating the end of a character string specified in is ignored, and a character string specified in is linked to the last character specified in . When a character string is linked, "00H" is automatically added at the end. a) When the number of characters after linking is odd, "00H" is stored in the high-order byte of the device

Applied Instructions (Block Data Operation)

storing the last character. b) When the number of characters after linking is even, "0000H" is stored in the device after the last

character.

Applied Instructions (Character String Control)

Cautions

1. When directly specifying a character string, up to 32 characters can be specified (input). However, this limitation in the number of characters is not applied when a word device is specified in or .
2. When the number of characters in both devices specified by and start from "00H" (that is, when the number of characters is "0"), "0000H" is stored in the device specified by .
3. The Link character strings instruction is not available in ST.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

Applied Instructions (Data Comparison)

1. When the number of devices after a device number specified by is smaller than the number of devices required to store all linked character strings (that is, when "00H" cannot be stored after all character strings and the last character). (Error code: K6706)
2. When the same device is specified in , and as a device for storing a character string. (Error code: K6706)

Applied Instructions (Data Table Operation)

3. When "00H" is not set within the corresponding device range after the device specified by or . (Error code: K6706)

Applied Instructions (External Device Communication)

Show 15 more labels / short text on this page
Command input · d1 s1 s2 · +0 +0 +0 · +1 · s1 · +1 · Applied Instructions (Others) · +2 · +2 · s2 · +3 · s2 · +1 · +4 · s2
Page 632 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — "ABCD"
Page 632 · click to enlarge
Page 632

26 Applied Instructions (Character String Control)

26.3 $+ / Link Character Strings

Program examples

In the program example shown below, a character string stored in D10 to D12 (abcde) is linked to the character string "ABCD", and the result is stored to D100 and later when X000 turns ON.

$+ EN ENO

D100 D10 "ABCD"

b15---b8 b7 b0 b15---b8 b7 b0

00H +

"ABCD"

43H(C)

42H(B)

00H

44H(D)

"00H" is automatically stored.

Show 9 more labels / short text on this page
[Structured ladder/FBD] · d1 s1 s2 · 62H(b) 61H(a) · 62H(b) 61H(a) · 64H(d · 63H(c) · 63H(c) 64H(d) · 41H(A) 65H(e) · 65H(e)
Page 633 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 26.4 LEN / Character String Length Detection
Page 633 · click to enlarge
Page 633
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.4 LEN / Character String Length Detection diagram (page 633)
Fig. 583 · 26.4 LEN / Character String Length Detection

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction detects the number of characters (bytes) of a specified character string.

Head device storing a character string whose number of characters is to be detected String

Device storing the detected character string length (number of bytes) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 634 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Errors
Page 634 · click to enlarge
Page 634

26 Applied Instructions (Character String Control)

26.4 LEN / Character String Length Detection

Function and operation explanation

1. 16-bit operation (LEN/LENP)

The length of a character string stored in the device specified by and later is detected, and stored to the device specified by . Data starting from the device specified by until the first device storing "00H" is handled as a character string in units of byte.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 634)
Fig. 584 · Function and operation explanation

d s Head device storing a character string whose number of characters is to be detected

Device storing the detected character string length (number of bytes)

For example, when "ABCDEFGHI" is stored in the device specified by and later as shown below, K9 is stored in the device specified by .

Caution

1. This instruction can handle character codes other than ASCII codes, but the character string length is handled in byte units (8 bits). Accordingly, in the case of character codes in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2".

Errors

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "00H" is not set within the corresponding device range after a device specified by . (Error code: K6706)
2. When the detected number of characters is "32768" or more. (Error code: K6706)
Page 635 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 26.4 LEN / Character String Length Detection
Page 635 · click to enlarge
Page 635
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.4 LEN / Character String Length Detection diagram (page 635)
Fig. 585 · 26.4 LEN / Character String Length Detection

In the program example shown below, the length of a character string stored in D0 and later is output in 4-digit BCD to Y040 to Y057 when X000 turns ON.

The length of the character string is output to the display unit.

49H(I) "MITSUBISHI" (Characters "ABC ..." after "00H" are ignored.) 49H(I)

Page 636 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 636 · click to enlarge
Page 636

26 Applied Instructions (Character String Control)

26.5 RIGHT / Extracting Character String Data from the Right

26.5 RIGHT / Extracting Character String Data from the Right

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction extracts a specified number of characters from the right end of a specified character string.

→ For handling of character strings, refer to "FX Structured Programming Manual [Device &

Common]."

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Common]." diagram (page 636)
Fig. 586 · Common]."

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 636)
Fig. 587 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 636)
Fig. 588 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 637 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 00H "ABCDEF12345"
Page 637 · click to enlarge
Page 637

26 Applied Instructions (Character String Control)

26.5 RIGHT / Extracting Character String Data from the Right

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (RIGHT/RIGHTP) "n" characters are extracted from the right end (that is, from the end) of the character string data stored in the device specified by and later, and stored to the device specified by and later. If the number of characters specified by "n" is "0", the NULL code (0000H) is stored to the device specified by

. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.

1. When the number of extracted characters is odd, "00H" is stored in the high-order byte of a device storing the last character.
2. When the number of extracted characters is even, "0000H" is stored in the device after the last character.

Applied Instructions (Extension Function)

RIGHT EN ENO

Head device storing a character string Head device storing extracted character string

Number of characters to be extracted

b15 b8 b7 b0 b15 b8 b7 b0

ASCII code for "(last character

ASCII code for "(last character

+0 +0 s d

2nd character ASCII code for

1st character ASCII code for

- n + 2)"th character

- n + 1)"th character

ASCII code for "(last character

ASCII code for "(last character

- n + 4)"th character

- n + 3)"th character

ASCII code for "(last character

ASCII code for "(last character

ASCII code for "(last character

ASCII code for "(last character

Applied Instructions (Block Data Operation)

- n + 2)"th character

- n + 1)"th character

00H ASCII code for

ASCII code for "(last character

ASCII code for "(last character

- n + 4)"th character

- n + 3)"th character

ASCII code for "(last character

ASCII code for "(last character

Applied Instructions (Character String Control)

00H ASCII code for

In the case of "n = 5"

+0 +0 s d b15 b8 b7 b0 b15 b8 b7 b0

42H(B) 41H(A)

32H(2) 31H(1)

44H(D) 43H(C)

34H(4)

33H(3)

46H(F) 45H(E)

+2 00H "12345"

35H(5)

31H(1) 32H(2)

34H(4) 33H(3)

35H(5) ASCII code for 5th character

00H "ABCDEF12345"

Applied Instructions (Data Comparison)

ASCII code for 1st character

a) A character string stored in the device specified by and later indicates data stored in devices from the specified device until "00H" is first detected in byte units.

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 21 more labels / short text on this page
Command input · d s n · Applied Instructions (Others) · ASCII code for · ASCII code for · +1 · +1 · 4th character · 3rd character · - 1)"th character · - 2)"th character · last character · - 1)"th characte · - 2)"th character · last character · +1 · +1 · +2 · +3 · +4 · +5
Page 638 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 638 · click to enlarge
Page 638

26 Applied Instructions (Character String Control)

26.5 RIGHT / Extracting Character String Data from the Right

Cautions

1. When handling character codes other than ASCII codes, note the following contents: a) The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes

in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes

express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "00H" is not set within the corresponding device range after a device specified by . (Error code: K6706)
2. When "n" exceeds the number of characters specified by . (Error code: K6706)
3. When the number of devices after a device number specified by is smaller than the number of devices required to store extracted "n" characters (that is, when "00H" cannot be stored after all character strings and the last character). (Error code: K6706)
4. When "n" is a negative value. (Error code: K6706)

Program examples

In the program example shown below, 4 characters are extracted from the right end of the character string data stored in R0 and later, and stored to D0 and later when X000 turns ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 638)
Fig. 589 · Program examples
Page 639 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 26.6 LEFT / Extracting Character String Data from the Left
Page 639 · click to enlarge
Page 639
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.6 LEFT / Extracting Character String Data from the Left diagram (page 639)
Fig. 590 · 26.6 LEFT / Extracting Character String Data from th…

26.6 LEFT / Extracting Character String Data from the Left

26.6 LEFT / Extracting Character String Data from the Left

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction extracts a specified number of characters from the left end of a specified character string.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y M K H E " " P

z

z

Page 640 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 640 · click to enlarge
Page 640

26 Applied Instructions (Character String Control)

26.6 LEFT / Extracting Character String Data from the Left

Function and operation explanation

1. 16-bit operation (LEFT/LEFTP) "n" characters are extracted from the left end (that is, from the head) of the character string data stored in the device specified by and later and stored to the device specified by and later. If the number of characters specified by "n" is "0", the NULL code (0000H) is stored to the device specified by

. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.

1. When the number of extracted characters is odd, "00H" is stored in the high-order byte of a device storing the last character.
2. When the number of extracted characters is even, "0000H" is stored in the device after the last character.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 640)
Fig. 591 · Function and operation explanation

Head device storing a character string Head device storing extracted character string Number of characters to be extracted

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 640)
Fig. 592 · Function and operation explanation

+0 +0 s d b15 b8 b7 b0 b15 b8 b7 b0 b15 b8 b7 b0

a) A character string stored in the device specified by and later indicates data stored in devices from the specified device until "00H" is first detected in byte units.

Page 641 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 00H
Page 641 · click to enlarge
Page 641

26 Applied Instructions (Character String Control)

26.6 LEFT / Extracting Character String Data from the Left

Cautions

Applied Instructions (Real Time Clock Control)

1. When handling character codes other than ASCII codes, note the following contents: a) The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes

in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes

express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

Applied Instructions (Extension Function)

1. When "00H" is not set within the corresponding device range after a device specified by . (Error code: K6706)
2. When "n" exceeds the number of characters specified by . (Error code: K6706)
3. When the number of devices after a device number specified by is smaller than the number of devices required to store extracted "n" characters (that is, when "00H" cannot be stored after all character strings and the last character). (Error code: K6706)
4. When "n" is a negative value. (Error code: K6706)

Program examples

Applied Instructions (Block Data Operation)

In the program example shown below, the number of characters which is equivalent to the number stored in D0 is extracted from the left end of the character string data stored in D100 and later, and stored to R10 and later when X010 turns ON.

[ST]

LEFT(X010,D100,D0,R10); X010 LEFT EN ENO

Applied Instructions (Character String Control)

d s n D100 R10 D0

ASCII code for 1st character

b15 b8 b7 b0 b15 b8 b7 b0

D100 R10

51H(Q) 53H(S)

51H(Q) 53H(S)

R11

4EH(N) 4FH(O)

4EH(N) 4FH(O)

48H(H) 44H(D)

R12

44H(D) 48H(H)

42H(B) 41H(A)

R13

0000H "SQONHD"

Applied Instructions (Data Comparison)

00H

"SQONHDAB"

ASCII code for 6th character

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others) · [Structured ladder/FBD]

Page 642 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 642 · click to enlarge
Page 642

26 Applied Instructions (Character String Control)

26.7 MIDR / Random Selection of Character Strings

26.7 MIDR / Random Selection of Character Strings

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction extracts a specified number of characters from arbitrary positions of a specified character string.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 642)
Fig. 593 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 642)
Fig. 594 · 2. Set data
  • Head device specifying the head position and number of characters to be extracted (2 points occupied)
  • s2 : Head character position
  • s2+1 : Number of characters

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 642)
Fig. 595 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

Page 643 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — "EFGHIJK"
Page 643 · click to enlarge
Page 643

26 Applied Instructions (Character String Control)

26.7 MIDR / Random Selection of Character Strings

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (MIDR/MIDRP)

" + 1" characters are extracted leftward from the position specified by of the character string data stored in the device specified by and later, and stored to the device specified by and later. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.

1. When the number of extracted characters of the device specified by " +1" is odd, "00H" is stored in the high-order byte of a device storing the last character.
2. When the number of extracted characters of the device specified by " + 1" is even, "0000H" is stored in the device after the last character.

MIDR EN ENO

Applied Instructions (Extension Function)

Head device storing a character string Head device specifying the head position and number of characters to be extracted

Head device storing extracted character string

1st character Target character string (extraction source) Extracted character string

b15 b8 b7 b0 b15 b8 b7 b0

42H(B) 41H(A)

46H(F) 45H(E)

44H(D) 43H(C)

48H(H) 47H(G)

46H(F) 45H(E)

00H "EFGHI"

49H(I)

48H(H)

47H(G)

4AH(J)

Applied Instructions (Block Data Operation)

00H 4BH(K)

5 characters starting from 5th character +1

"ABCDEFGHIJK"

a) A character string specified by indicates data stored in devices from the specified device until "00H" is first detected in units of byte.

Applied Instructions (Character String Control)

b) When the number of characters to be extracted specified by " + 1" is "0", the extraction processing is not executed.

c) When the number of characters to be extracted specified by " + 1" is "-1", the entire character string specified by is stored to the device specified by and later.

b15 b8 b7 b0 b15 b8 b7 b0

42H(B) 41H(A)

46H(F) 45H(E)

44H(D) 43H(C)

48H(H) 47H(G)

46H(F) 45H(E)

4AH(J) 49H(I)

48H(H)

47H(G)

00H +3

4BH(K)

Applied Instructions (Data Comparison)

"EFGHIJK"

4AH(J) 49H(I)

00H

4BH(K)

"ABCDEFGHIJK"

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 32 more labels / short text on this page
Command input · d s1 s2 · Applied Instructions (Others) · +0 d s1 · +0 · +1 · +1 · +2 · +2 · +3 · 49H(I) 5th character · s2 · +4 · +5 · s2 · s2 · +0 · +1 5 · +0 d s1 · +0 · +1 · +1 · +2 · +2 · +3 · +4 · 5th character position · s2 · +5 · s2 · +0 · +1 -1
Page 644 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 644 · click to enlarge
Page 644

26 Applied Instructions (Character String Control)

26.7 MIDR / Random Selection of Character Strings

Cautions

1. When handling character codes other than ASCII codes, note the following contents: a) The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes

in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes

express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "00H" is not set within the corresponding device range after a device specified by . (Error code: K6706)
2. When the value specified by exceeds the number of characters specified by . (Error code: K6706)
3. When the number of characters specified by " +1" from the position specified by the device specified by exceeds the device range specified by . (Error code: K6706)
4. When the number of devices after a device number specified by is smaller than the number of devices required to store extracted characters as many as the number specified by " +1" (that is, when "00H" cannot be stored after all character strings and the last character) (Error code: K6706)
5. When the contents of the device specified by is a negative value. (Error code: K6706)
6. When the contents of the device specified by " + 1" is "-2" or less. (Error code: K6706)
7. When the contents of the device specified by " + 1" is a number larger than the number of characters specified by . (Error code: K6706)

Program examples

In the program example shown below, four characters are extracted from the third character from the left end of the character string data stored in D10 and later, and then stored to D0 and later when X000 turns ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 644)
Fig. 596 · Program examples
Page 645 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 645 · click to enlarge
Page 645

26 Applied Instructions (Character String Control)

26.8 MIDW / Random Replacement of Character Strings

26.8 MIDW / Random Replacement of Character Strings

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction replaces the characters in arbitrary positions inside designated character string with a specified character string.

→ For handling of character strings, refer to "FX Structured Programming Manual [Device &

Common]."

1. Format and operation, execution form

Applied Instructions (Extension Function)

Expression in each language

MIDW EN ENO

MIDW 16 bits Continuous MIDW(EN,s1,s2,d);

MIDWP EN ENO

MIDWP 16 bits Pulse MIDWP(EN,s1,s2,d);

2. Set data

Applied Instructions (Block Data Operation)

Variable Description Data type

EN Execution condition Bit

Head device storing a character string used in overwriting String

  • Head device specifying the head position and number of characters to be overwritten (2 points occupied)
  • s2 : Head character position to be overwritten
  • s2+1 : Number of characters to be overwritten

Applied Instructions (Character String Control)

ARRAY [1..2] OF ANY16

ENO Execution state Bit

Head device storing a character string overwritte String

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Applied Instructions (Data Comparison)

z

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 17 more labels / short text on this page
Instruction · name Operation Execution · form · d s1 s2 · Applied Instructions (Others) · d s1 s2 · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant
Page 646 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 646 · click to enlarge
Page 646

26 Applied Instructions (Character String Control)

26.8 MIDW / Random Replacement of Character Strings

Function and operation explanation

1. 16-bit operation (MIDW/MIDWP)

Character data specified by " + 1" are extracted from the left end (that is, the head) of the character string data stored in the device specified by and later, and stored to the position specified by and later of the character string data stored in the device specified by and later.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 646)
Fig. 597 · Function and operation explanation

Head device storing a character string used in overwriting

Head device specifying the head position and number of characters to be overwritten

3 Position from the left end in the character string stored in and later Number of characters from the left end in the character string stored in and later

Six characters starting from 3rd character (overwritten character string)

1. The character string specified by or indicates data stored in devices from the specified device until "00H" is first detected in byte units.
2. When the number of characters to be overwritten specified by " + 1" is "0", the overwriting processing is not executed.
3. When the number of characters to be overwritten specified by " + 1" exceeds the last character of the character string stored in the device specified by and later, data is stored up to the last character.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 646)
Fig. 598 · Function and operation explanation

Position from the left end in the character string stored in and later d

Number of characters from the left end in the character string stored in and later s1

Characters from the 5th character to the last character are overwritten. Excessive characters, "35H (5)" to "37H (7)", are not stored.

Page 647 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 647 · click to enlarge
Page 647

26 Applied Instructions (Character String Control)

26.8 MIDW / Random Replacement of Character Strings

4. When " + 1" (the number of characters to be overwritten) is "-1", the entire character string stored in and later is stored to the device specified by and later.

Applied Instructions (Real Time Clock Control)

b15 b8 b7 b0

b15 b8 b7 b0

31H(1) 30H(0)

41H(A)

33H(3) 32H(2) +1

44H(D) 43H(C)

35H(5) 34H(4)

46H(F) 45H(E)

00H

48H(H)

47H(G)

4AH(J) 49H(I)

2 Position from the left end in the character string stored in and later Number of characters from the left end in the character string stored in and later

+5 00H 4BH(K)

"ABCDEFGHIJK"

Applied Instructions (Extension Function)

b15 b8 b7 b0

30H(0)

41H(A)

32H(2) 31H(1)

34H(4) 33H(3)

48H(H)

35H(5)

+4 4AH(J) 49H(I)

+5 00H 4BH(K)

"A012345HIJK"

Six characters from the 2nd character are overwritten.

Applied Instructions (Block Data Operation)

Cautions

1. When handling character codes other than ASCII codes, note the following contents: a) The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes

in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes

Applied Instructions (Character String Control)

express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "00H" is not set within the corresponding device range after a device specified by or . (Error code: K6706)
2. When the value of the device specified by exceeds the number of characters specified by . (Error code: K6706)

Applied Instructions (Data Comparison)

3. When the value of the device specified by " + 1" exceeds the number of characters specified by . (Error code: K6706)
4. When the value of the device specified by is a negative value (Error code: K6706)

Applied Instructions (Data Table Operation)

5. When the value of the device specified by " + 1" is "-2" or less

Applied Instructions (External Device Communication)

Show 24 more labels / short text on this page
2nd character · Before execution · s1 42H(B) · +0 · 1st character · 1st character · +1 · +2 · +2 · +3 · +3 · "012345" · +4 · Last character · s2 · +0 · +1 -1 · s1 · 2nd character · After execution · +1 · +2 · +3 · Applied Instructions (Others)
Page 648 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 648 · click to enlarge
Page 648

26 Applied Instructions (Character String Control)

26.8 MIDW / Random Replacement of Character Strings

Program examples

In the program example shown below, four characters are extracted from the character string data stored in D0 and later, and stored to the third character (from the left end) and later for the character string data stored in D100 and later when X010 turns ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 648)
Fig. 599 · Program examples
Page 649 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 26.9 INSTR / Character string search
Page 649 · click to enlarge
Page 649
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 26.9 INSTR / Character string search diagram (page 649)
Fig. 600 · 26.9 INSTR / Character string search

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction searches a specified character string within another character string.

Head device storing a character string to search for String

Head device storing a character string to be searched String

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 650 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 650 · click to enlarge
Page 650

26 Applied Instructions (Character String Control)

26.9 INSTR / Character string search

Function and operation explanation

1. 16-bit operation (INSTR/INSTRP)

1. The character string stored in the device specified by and later is searched for within the character string of the device specified by and later. The search begins at the "n"th character from the left end (head character) of the device specified by and the search result is stored in the device specified by . The search result provides the first matching character (located from the left end (head character)) in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 650)
Fig. 601 · Function and operation explanation

Head device storing search result Head device storing a character string to search for Head device storing a character string to be searched

Character string to search for Character string to be searched

Search is started from the 3rd character. (n=3) 5th character from the head character 46H(F) 48H(H) 45H(E) 47H(G)

5 Stores the position where the first detected character is located from the head character in the character string data stored in .

2. When the searched character string is not detected, "0" is stored in the device specified by .
3. When the search start position "n" is a negative number or "0", search processing is not executed.
4. A character string can be directly specified in the character string to search for specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 650)
Fig. 602 · Function and operation explanation

Character string to search for Character string to be searched

Search is started from the 3rd character. (n=3) 5th character from he head character

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
Page 651 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — "CI2312CIM"
Page 651 · click to enlarge
Page 651

26 Applied Instructions (Character String Control)

26.9 INSTR / Character string search

Error

Applied Instructions (Real Time Clock Control)

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the search start position "n" exceeds the number of characters stored in (Error code: K6706)
2. When "00H (NULL)" is not located within the corresponding device range starting from the device specified by . (Error code: K6706)
3. When "00H (NULL)" is not located within the corresponding device range starting from the device specified by . (Error code: K6706)

Applied Instructions (Extension Function)

Program examples

1. In the program example below, the character string "C123" (D0 and later) is searched from the fifth character from the left end (head character) of the character string "CI2312CIM" (R0 and later) when X000 is set to ON. The search result is stored in D100.

INSTR(X000,D0,R0,K5,D100);

X000 INSTR EN ENO

D100 D0 R0

d s1 s2 n

K5

Character string to search for Character string to be searched

Applied Instructions (Block Data Operation)

b15 b8 b7 b0

These characters are not searched because the search start position is "5". Searched from the 5th character. 32H(2) 49H(I) 31H(1) 43H(C)

R0

49H(I) 33H(3) 43H(C) 32H(2)

49H(I) 33H(3) 43H(C) 32H(2) 00H

R1

D1 D2

R2 R3 R4

"CI23"

00H 4DH(M)

Applied Instructions (Character String Control)

"CI2312CIM"

0 Because the searched character string is not detected, "0" is stored.

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others) · b15 · b8 b7 b0

Page 652 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 652 · click to enlarge
Page 652

26 Applied Instructions (Character String Control)

26.10 $MOV / Character String Transfer

26.10 $MOV / Character String Transfer

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction transfers character string data.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 652)
Fig. 603 · 1. Format and operation, execution form

*1. Refer to "Cautions".

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 652)
Fig. 604 · 2. Set data

Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source String

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 652)
Fig. 605 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 653 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 42H(B)
Page 653 · click to enlarge
Page 653

26 Applied Instructions (Character String Control)

26.10 $MOV / Character String Transfer

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation ($MOV/$MOVP)

The character string data stored in the device specified by and later is transferred to the device specified by and later. From the device number specified by to a device after that which stores "00H" in its high-order or low- order byte are transferred at one time.

$MOV EN ENO

Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source

Head device storing transferred character string

Applied Instructions (Extension Function)

b15 b8 b7 b0 b15 b8 b7 b0

"00H" indicates the end of character string.

Even if the device range storing the character string data to be transferred overlaps the device range storing the transferred character string data, transfer is executed. For example, when a character string stored in D10 to D13 is transferred to D11 to D14, the transfer is executed as shown below.

Applied Instructions (Block Data Operation)

$MOV EN ENO

b15 b8 b7 b0

b15 b8 b7 b0

Applied Instructions (Character String Control)

D10 32H(2)

31H(1)

D10 32H(2)

31H(1)

It is same as the character string before transfer.

34H(4)

33H(3)

32H(2) 31H(1)

36H(6)

35H(5)

34H(4)

33H(3)

00H

36H(6)

35H(5)

00H 00H

Cautions

1. When "00H" is stored in the low-order byte of the device specified by " + n", "00H" is stored to both the high-order byte and low-order byte of the device specified by " + n".

Applied Instructions (Data Comparison)

$MOV EN ENO

Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source

d s Head device storing transferred character string

Applied Instructions (Data Table Operation)

b15 b8 b7 b0 b15 b8 b7 b0

d s +0 +0

42H(B)

41H(A)

42H(B)

41H(A)

44H(D)

43H(C)

44H(D)

43H(C)

45H(E)

00H

00H

00H

The high-order byte is not transferred.

"00H" is automatically stored in the high-order byte.

Applied Instructions (External Device Communication)

2. The Character string transfer instruction is not available in ST.
Show 29 more labels / short text on this page
Command input · d s · d s · +0 +0 · 2nd character · 1st character · 2nd character · 1st character · +1 · 4th character · 3rd character · +1 · 4th character · 3rd character · +2 · 6th character · 5th character · +2 · 6th character · 5th character · Applied Instructions (Others) · 00H "n"th character · 00H "n"th character · Command input · d s · Command input · +1 · +1 · +2 +2
Page 654 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D10 4DH(M)
Page 654 · click to enlarge
Page 654

26 Applied Instructions (Character String Control)

26.10 $MOV / Character String Transfer

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When "00H" does not exist in the range specified from device specified by to the last device (Error code: K6706)
2. When the specified character string cannot be stored in devices from the device specified by to the last device. (Error code: K6706)

Program examples

In the program example shown below, character string data stored in D10 to D12 is transferred to D20 through D22 when X000 is set to ON.

$MOV EN ENO

D20 D10

b15 b8 b7 b0 b15 b8 b7 b0

D10 4DH(M)

2AH(*) D20

4DH(M)

2AH(*)

45H(E) D11

45H(E)

45H(E)

45H(E)

00H 00H 00H

[Structured ladder/FBD] · d s

Page 655 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SFL
Page 655 · click to enlarge
Page 655

Applied Instructions (Real Time Clock Control)

This chapter introduces the instructions for reading last-in data and controlling leftward/rightward shift instructions with carry.

Instruction name Function Reference

FDEL

Deleting Data from Tables Section 27.1 FDELP

FINS

Inserting Data to Tables Section 27.2 FINSP

POP

Applied Instructions (Extension Function)

Shift Last Data Read [FILO Control] Section 27.3 POPP

SFR

Bit Shift Right with Carry Section 27.4 SFRP

SFL

Bit Shift Left with Carry Section 27.5 SFLP

Applied Instructions (Block Data Operation)

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 656 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 656 · click to enlarge
Page 656

27.1 FDEL / Deleting Data from Tables

27.1 FDEL / Deleting Data from Tables

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction deletes an arbitrary piece of data from a data table.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 656)
Fig. 606 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 656)
Fig. 607 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 656)
Fig. 608 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 657 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 657 · click to enlarge
Page 657

27.1 FDEL / Deleting Data from Tables

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (FDEL/FDELP) "n"th data is deleted from a data table (stored in the device specified by and later), and the deleted data is stored in the device specified by . "n + 1"th data and later in the data table are shifted forward one by one, and the number of stored data is subtracted by "1".

FDEL EN s n

d Device storing deleted data

Head device in data table

Position of deleted data in table

Applied Instructions (Extension Function)

Number of stored data Number of stored data

Data table (having the number of stored pieces of data starting from " + 1") d

When "n" is "2"

Device range used in data table

"0" is stored.

Applied Instructions (Block Data Operation)

Cautions

1. The device range used in a data table should be controlled by the user. The data table has the number of pieces of data, which is stored in , starting from the next device ( + 1) after the device storing the number of pieces of data . → Refer to the program example below.

Applied Instructions (Character String Control)

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Related instruction

FINS Inserts data into an arbitrary position in a data table

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the table position "n" from the device specified by exceeds the "amount of data stored plus one" (Error code: K6706)

Applied Instructions (Data Comparison)

2. When the value "n" exceeds the range of the number of pieces of data specified by . (Error code: K6706)
3. When the FDEL instruction is executed under the condition "n ≤ 0" (Error code: K6706)
4. When the amount of data stored specified by is "0". (Error code: K6706)
5. When the data table range exceeds the corresponding device range (Error code: K6706)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 20 more labels / short text on this page
Command input · Data table · Data table · d d · +0 · +0 · +1 · +1 · +2 +3 +4 · 3333 4444 · +2 +3 +4 · 4444 1234 · Data table range · 1234 5678 · Applied Instructions (Others) · +5 · +5 · Deleted data · s · Instruction Description
Page 658 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program examples
Page 658 · click to enlarge
Page 658

27.1 FDEL / Deleting Data from Tables

Program examples

In the program example shown below, the second data is deleted from the data table stored in D100 to D105, and the deleted data is stored in D0 when X010 is set to ON. When the amount of data stored is "0", however, the FDEL instruction is not executed. (The device range used in the data table is D100 to D107.)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program examples diagram (page 658)
Fig. 609 · Program examples

The AND compare instruction (ANDD< , ANDD

Number of stored data D101 D102 D103 D104 D105 D106 D107

Data table range Device range used in data table

Page 659 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 27.2 FINS / Inserting Data to Tables
Page 659 · click to enlarge
Page 659
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 27.2 FINS / Inserting Data to Tables diagram (page 659)
Fig. 610 · 27.2 FINS / Inserting Data to Tables

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction inserts data into an arbitrary position in a data table.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 660 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 660 · click to enlarge
Page 660

27.2 FINS / Inserting Data to Tables

Function and operation explanation

1. 16-bit operation (FINS/FINSP)

1. 16-bit data of the device specified by is inserted in "n"th position in a data table (stored in the device specified by and later). "n"th data and later in the data table are shifted backward one by one, and the number of stored data is added by "1".
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 660)
Fig. 611 · Function and operation explanation

Device storing inserted data Head device in data table

Cautions

1. The device range used in a data table should be controlled by the user. The data table has the number of pieces of data, which is stored in , starting from the device after the device that indicates the number of stored data .

→ Refer to the program example below.

2. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Related instruction

FDEL Deletes an arbitrary data from a data table.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the table position "n" from the device specified by exceeds the "amount of data stored plus one" (Error code: K6706)
2. When the value "n" exceeds the device range of the data table specified by (Error code: K6706)
3. When the FDEL instruction is executed under the condition "n ≤ 0" (Error code: K6706)
4. When the data table range exceeds the corresponding device range (Error code: K6706)

Instruction Description

Page 661 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 27.2 FINS / Inserting Data to Tables
Page 661 · click to enlarge
Page 661
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 27.2 FINS / Inserting Data to Tables diagram (page 661)
Fig. 612 · 27.2 FINS / Inserting Data to Tables

In the program example shown below, data stored in D100 is inserted into the third position of the data table stored in D0 to D4 when X010 is set to ON. When the amount of data stored exceeds "7", however, the FINS instruction is not executed. (The device range used in the data table is D0 to D7.)

The AND compare instruction (AND

Number of stored data D0 D1 D2 D3 D4 D5 D6 D7

Data table range Device range used in data table

Page 662 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 662 · click to enlarge
Page 662

27.3 POP / Shift Last Data Read [FILO Control]

27.3 POP / Shift Last Data Read [FILO Control]

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads the last data written by the shift write (SFWR) instruction for the first-in first-out and first- in last-out control

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 662)
Fig. 613 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 662)
Fig. 614 · 2. Set data

Head device storing first-in data (including pointer data) ANY16

Number of pieces of data stored (Add "1" because pointer data is also included.) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 662)
Fig. 615 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 663 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K4 → K3
Page 663 · click to enlarge
Page 663

27.3 POP / Shift Last Data Read [FILO Control]

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (POP/POPP)

d n Head device storing the first-in data

Device storing last-out data

Number of pieces of data stored

Data for FILO control

Pointer data (amount of data stored)

Applied Instructions (Extension Function)

Data area (First-in data written by shift write (SFWR) instruction)

1. Every time the instruction is executed for the word devices specified by " to + n-1", a device " + Pointer data" is read to the device specified by . (The last data entry written by the shift write (SFWR) instruction for first-in first-out control is read to the device specified by .) Specify "n" in the range from "2" to "512".

Applied Instructions (Block Data Operation)

2. Subtract "1" from the value of the pointer data of the device specified by .

s

+n-2 +n-1 +6 +5 +3 +2 +1

In the case of K4

Applied Instructions (Character String Control)

No changes in the data area Pointer

+4 d s

+n-2 +n-1 +6 +5 +3 +2 +1

K4 → K3

Related device

→ for the zero flag use method, refer to Section 1.3.4.

M8020 Zero flag Turns ON when the instruction is executed while the pointer is "0".

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 13 more labels / short text on this page
Command input · POP EN s · Description · +1 · +2 · +3 · +n-3 · +n-2 · Applied Instructions (Others) · +n-1 · Data area Pointer · +4 · Device Name Description
Page 664 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 664 · click to enlarge
Page 664

27.3 POP / Shift Last Data Read [FILO Control]

Related instruction

SFWR Shift write [for FIFO/FILO control]

SFRD Shift read [for FIFO control]

Cautions

1. When this instruction is programmed in the continuous operation type, the instruction is executed in every operation cycle. As a result, an expected operation may not be achieved. Usually, program this instruction in the "pulse operation type", or let this instruction be executed by a "pulsed command contact.
2. When the current value of the pointer specified by is "0", the zero flag M8020 turns ON and the instruction is not executed. Check in advance using a comparison instruction whether the current value of the device specified by

satisfies "1 ≤ current value ≤ (n-1)", and then execute this instruction.

3. When the current value of the pointer specified by is "1", "0" is written to the pointer and the zero flag M8020 turns ON.

Error

1. An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067. a) When the pointer is larger than "n-1". (Error code: K6706) b) When the pointer is smaller than "0". (Error code: K6706)

Instruction Description

Page 665 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 27.3 POP / Shift Last Data Read [FILO Control]
Page 665 · click to enlarge
Page 665
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 27.3 POP / Shift Last Data Read [FILO Control] diagram (page 665)
Fig. 616 · 27.3 POP / Shift Last Data Read [FILO Control]

27.3 POP / Shift Last Data Read [FILO Control]

In the program example shown below, among value stored in D20 input first to D101 to D106, the last value input is stored to D10, and "1" is subtracted from the number of stored data (pointer D100) every time X000 turns ON.

When the first-in data is as shown in the table below

H0000 H0000 H0000 HABCD H5678 H1234 K3→K2

Page 666 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 666 · click to enlarge
Page 666

27.4 SFR / Bit Shift Right with Carry

27.4 SFR / Bit Shift Right with Carry

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts 16 bits stored in a word device rightward by "n" bits.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 666)
Fig. 617 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 666)
Fig. 618 · 2. Set data

Number of times of shift (0 ≤ n ≤ 15) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 666)
Fig. 619 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Function and operation explanation

1. 16-bit operation (SFR/SFRP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 666)
Fig. 620 · Function and operation explanation
1. 16 bits stored in a word device specified by are shifted rightward by "n" bits. Specify a value in the range from "0" to "15" as "n". If "16" or larger value is specified as "n", 16 bits are shifted rightward by the remainder of "(n) divided by (16)". For example, when "n" is set to "18", 16 bits are shifted rightward by 2 bits as "2" remains when "18" is divided by "16".
2. The ON (1) or OFF (0) status of the "n"th bit (bit "n-1") in the word device specified by is transferred to the carry flag M8022.
Page 667 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y23 Y20 Y17 Y14 Y13 Y10
Page 667 · click to enlarge
Page 667

27.4 SFR / Bit Shift Right with Carry

3. "0" is set to "n" bits from the most significant bit.

Applied Instructions (Real Time Clock Control)

In the case of "n = 6"

M8022

Becomes "0".

When a bit device is specified by digit specification (4 × K ) bits are shifted according to the data bit specification.)

Applied Instructions (Extension Function)

LDP EN

SFRP EN

K3M0

1 M11

0 1 0 M8

M7 M4 M3 M0

1 0 1 0 1 0 1 0

M11 M8 M7 M4 M3 M0

M8022

0 1 0 1 0 1 0 1 0

Applied Instructions (Block Data Operation)

Becomes "0".

Related device

→ For the carry flag use method, refer to Section 1.3.4.

Applied Instructions (Character String Control)

M8022 Carry flag Shifts the ON/OFF status of bit "n-1"

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067. 1) When a negative value is set to "n" (Error code: 6706)

Program examples

In the program example shown below, the contents of Y010 to Y023 are shifted rightward by the number of bits specified by D0 when X020 turns ON.

X020 SFRP EN n

SFRP(X020,D0,K3Y010);

Applied Instructions (Data Comparison)

Y23 Y20 Y17 Y14 Y13 Y10

Applied Instructions (Data Table Operation)

1 0 1 0 1 0 1 0 1 0 1 0

Y23 Y20 Y17 Y14 Y13 Y10

M8022

Applied Instructions (External Device Communication)

0 1 0 1 0 1 0 1 0

Becomes "0".

Show 42 more labels / short text on this page
1 b15 · 1 b14 · 1 b13 · 0 b12 · 1 b11 · 1 b10 · 1 b9 · 0 b8 · 1 b7 · 1 b6 · 1 b5 · 0 b4 · 1 b3 · 1 b2 · 1 b1 · 0 b0 · Carry flag · 0 b15 · 0 b14 · 0 b13 · 0 b12 · 0 b11 · 0 b10 · 1 b9 · 1 b8 · 1 b7 · 0 b6 · 1 b5 · 1 b4 · 1 b3 · 0 b2 · 1 b1 · 1 b0 · Command input · s · K4 d · n · Applied Instructions (Others) · Carry flag · Device Name Description · d K3Y010 D0 · Carry flag
Page 668 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 668 · click to enlarge
Page 668

27.5 SFL / Bit Shift Left with Carry

27.5 SFL / Bit Shift Left with Carry

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction shifts 16 bits stored in a word device leftward by "n" bits.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 668)
Fig. 621 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 668)
Fig. 622 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 668)
Fig. 623 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Function and operation explanation

1. 16-bit operation (SFL/SFLP)

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 668)
Fig. 624 · Function and operation explanation
1. 16 bits stored in a word device specified by are shifted leftward by "n" bits. Specify a value in the range from "0" to "15" as "n". If "16" or larger value is specified as "n", 16 bits are shifted leftward by the remainder of "(n) divided by (16)". For example, when "n" is set to "18", 16 bits are shifted leftward by 2 bits as "2" remains when "18" is divided by "16".
2. The ON (1) or OFF (0) status of the "n + 1"th bit (bit "n") in the word device specified by is transferred to the carry flag M8022.
Page 669 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8022
Page 669 · click to enlarge
Page 669

27.5 SFL / Bit Shift Left with Carry

3. "0" is set to "n" bits from the least significant bit.

Applied Instructions (Real Time Clock Control)

In the case of "n = 8"

M8022

When a bit device is specified by digit specification (4 × K ) bits are shifted according to the data bit specification.)

Applied Instructions (Extension Function)

LDP EN

SFL EN

K2M10

M17 M14M13 M10

0 0 1 1 0 0 1 1

M8022

M17 M14M13 M10 M12

1 0 0 1 1 0 0 0 1

Applied Instructions (Block Data Operation)

Becomes "0".

Related device

→ For the carry flag use method, refer to Section 1.3.4.

Applied Instructions (Character String Control)

M8022 Carry flag Shifts the ON/OFF status of bit "n"

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When a negative value is set to "n" (Error code: 6706)

Program examples

In the program example shown below, the contents of Y010 to Y017 are shifted leftward by the number of bits specified by D0 when X020 turns ON.

Applied Instructions (Data Comparison)

SFLP(X020,D0,K2Y10);

X020 SFLP EN n

Y17 Y14 Y13 Y10

Applied Instructions (Data Table Operation)

0 0 1 1 0 0 1 1

M8022

Y17 Y14 Y13 Y10 Y12

Applied Instructions (External Device Communication)

1 0 0 1 1 0 0 0 1

Becomes "0".

Show 43 more labels / short text on this page
1 b15 · 1 b14 · 1 b13 · 1 b12 · 0 b11 · 0 b10 · 1 b9 · 1 b8 · 0 b7 · 0 b6 · 0 b5 · 0 b4 · 1 b3 · 1 b2 · 1 b1 · 1 b0 · Carry flag · 0 b15 · 0 b14 · 0 b13 · 0 b12 · 1 b11 · 1 b10 · 1 b9 · 1 b8 · 0 b7 · 0 b6 · 0 b5 · 0 b4 · 0 b3 · 0 b2 · 0 b1 · 0 b0 · Becomes "0" · Command input · s · K3 d · n · Applied Instructions (Others) · Carry flag · Device Name Description · d K2Y10 D0 · Carry flag
Page 670 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ORD=
Page 670 · click to enlarge
Page 670

28 Applied Instructions (Data Comparison)

28. Applied Instructions (Data Comparison)

This chapter introduces data comparison instructions which can be handled as contact symbols in programming such as LD, AND and OR.

Instruction name Function Reference

LD=

LD>

LD<

LD<>

LD<=

LD>=

Data Comparison Section 28.1

LDD=

LDD>

LDD<

LDD<>

LDD<=

LDD>=

AND=

AND>

AND<

AND<>

AND<=

AND>=

Data Comparison Section 28.2

ANDD=

ANDD>

ANDD<

ANDD<>

ANDD<=

ANDD>=

OR=

OR>

OR<

OR<>

OR<=

OR>=

Data Comparison Section 28.3

ORD=

ORD>

ORD<

OR<>

ORD<=

ORD>=

Page 671 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 28.1 LD =, >, <, <>, <=, >= / Data Comparison
Page 671 · click to enlarge
Page 671
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 28.1 LD =, >, <, <>, <=, >= / Data Comparison diagram (page 671)
Fig. 625 · 28.1 LD =, >, <, <>, <=, >= / Data Comparison

28.1 LD =, >, <, <>, <=, >= / Data Comparison

28.1 LD =, >, <, <>, <=, >= / Data Comparison

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

These instructions compare numeric values, and set a contact to ON when the condition agrees so that an operation started.

Page 672 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 672 · click to enlarge
Page 672

28 Applied Instructions (Data Comparison)

28.1 LD =, >, <, <>, <=, >= / Data Comparison

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 28.1 LD =, >, <, <>, <=, >= / Data Comparison diagram (page 672)
Fig. 626 · 28.1 LD =, >, <, <>, <=, >= / Data Comparison

*1. Refer to "Cautions".

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 672)
Fig. 627 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 672)
Fig. 628 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

SRefer to "Cautions"

Function and operation explanation

These data comparison instructions are connected to bus lines. The contents of the devices specified by are compared with the contents of the device specified by in the binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 672)
Fig. 629 · Function and operation explanation
Page 673 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M50
Page 673 · click to enlarge
Page 673

28 Applied Instructions (Data Comparison)

28.1 LD =, >, <, <>, <=, >= / Data Comparison

Cautions

Applied Instructions (Real Time Clock Control)

1. Negative values When the most significant bit is "1" in the data stored in the device specified by or , it is regarded as a negative value in comparison. a) In the 16-bit operation: bit 15 b) In the 32-bit operation: bit 31
2. When using 32-bit counters (including 32-bit high speed counters) Be sure to execute the 32-bit operation (such as LDD=, LDD> and LDD and LD
3. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Extension Function)

4. The Load compare instruction is not available in ST.

Program examples

When the current value of the counter C10 is "200", Y010 is driven.

LD= EN s1 s2

Y10

K200

Applied Instructions (Block Data Operation)

When the contents of D200 are "-29" or more and X001 is ON, Y011 is set.

LD> EN s1 s2

Y11

Applied Instructions (Character String Control)

K-30

When the contents of the counter C200 are less than "K678,493" or when M3 turns ON, M50 is driven.

LDD> EN s1 s2

M50

C200 K678493

M3

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others) · [Structured ladder/FBD]

Page 674 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1. Format and operation, execution form
Page 674 · click to enlarge
Page 674

28 Applied Instructions (Data Comparison)

28.2 AND=, >, <, < >, <=, >= / Data Comparison

28.2 AND=, >, <, < >, <=, >= / Data Comparison

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

These instructions compare numeric values, and set a contact to ON when the condition agrees.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 674)
Fig. 630 · 1. Format and operation, execution form

*1. Refer to "Cautions".

Page 675 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 28.2 AND=, >, <, < >, <=, >= / Data Comparison
Page 675 · click to enlarge
Page 675
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 28.2 AND=, >, <, < >, <=, >= / Data Comparison diagram (page 675)
Fig. 631 · 28.2 AND=, >, <, < >, <=, >= / Data Comparison

28.2 AND=, >, <, < >, <=, >= / Data Comparison

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

These data comparison instructions are connected to other contacts in series. The contents of the device specified by are compared with the contents of the device specified by in binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.

Page 676 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y11
Page 676 · click to enlarge
Page 676

28 Applied Instructions (Data Comparison)

28.2 AND=, >, <, < >, <=, >= / Data Comparison

Cautions

1. Negative values When the most significant bit is "1" in the data stored in the device specified by or , it is regarded as a negative value in comparison. a) In the 16-bit operation: bit 15 b) In the 32-bit operation: bit 31
2. When using 32-bit counters (including 32-bit high speed counters) Be sure to execute the 32-bit operation (such as ANDD=, ANDD> and ANDD and AND
3. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
4. The AND compare instruction is not available in ST.

Program examples

When X000 is ON and the current value of the counter C10 is "200" Y010 is driven.

Y10 X000

AND= EN s1 s2

C10 K200

When X001 is OFF and the contents of the data register D0 are not "-10", Y011 is set.

AND EN s1 s2

M40

K-10

M40 SET EN

Y11

When X002 is ON, and the contents of the data registers D11 and D10 are less than "K678,493", or when M3 turns ON, M50 is driven.

ANDD> EN s1 s2

Y11

K678493

M3

[Structured ladder/FBD]

Page 677 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 28.3 OR=, >, <, < >, <=, >= / Data Comparison
Page 677 · click to enlarge
Page 677
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 28.3 OR=, >, <, < >, <=, >= / Data Comparison diagram (page 677)
Fig. 632 · 28.3 OR=, >, <, < >, <=, >= / Data Comparison

28.3 OR=, >, <, < >, <=, >= / Data Comparison

28.3 OR=, >, <, < >, <=, >= / Data Comparison

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

These instructions compare numeric values, and set a contact to ON when the condition agrees.

Page 678 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 678 · click to enlarge
Page 678

28 Applied Instructions (Data Comparison)

28.3 OR=, >, <, < >, <=, >= / Data Comparison

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 28.3 OR=, >, <, < >, <=, >= / Data Comparison diagram (page 678)
Fig. 633 · 28.3 OR=, >, <, < >, <=, >= / Data Comparison

*1. Refer to "Cautions".

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 678)
Fig. 634 · 2. Set data

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 678)
Fig. 635 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

z S1 S2 z

SRefer to "Cautions"
Page 679 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D100 K100000
Page 679 · click to enlarge
Page 679

28 Applied Instructions (Data Comparison)

28.3 OR=, >, <, < >, <=, >= / Data Comparison

Function and operation explanation

Applied Instructions (Real Time Clock Control)

These data comparison instructions are connected to other contacts in parallel. The contents of the device specified by is compared with the contents of the device specified by in binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.

16-bit instruction 32-bit instruction ON condition OFF condition

OR= ORD= = ≠

OR> ORD> > ≤

OR< ORD< < ≥

OR<> OR<> ≠ =

OR<= ORD<= ≤ >

Applied Instructions (Extension Function)

OR>= ORD>= ≥ <

Cautions

1. Negative values When the most significant bit is "1" in the data stored in the device specified by or , it is regarded as a negative value in comparison. a) In the 16-bit operation: bit 15 b) In the 32-bit operation: bit 31
2. When using 32-bit counters (including 32-bit high speed counters) Be sure to execute the 32-bit operation (such as ORD=, ORD> and ORD and OR

Applied Instructions (Block Data Operation)

3. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.
4. The OR compare instruction is not available in ST.

Applied Instructions (Character String Control)

Program examples

When X001 turns ON or when the current value of the counter C10 is "200", Y000 is driven.

Y000 X001

OR= EN s1 s2

K200

Applied Instructions (Data Comparison)

When X002 and M30 turn ON or when the contents of the data registers D101 and D100 are more than "K100,000", M60 is driven.

M60 M30 X002

Applied Instructions (Data Table Operation)

ORD= EN s1 s2

D100 K100000

Applied Instructions (External Device Communication)

Applied Instructions (Others) · [Structured ladder/FBD]

Page 680 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DSCL2
Page 680 · click to enlarge
Page 680

29 Applied Instructions (Data Table Operation)

29. Applied Instructions (Data Table Operation)

Instruction name Function Reference

LIMIT

Limit Control Section 29.1 LIMITP

DLIMIT

DLIMITP

BAND

Dead Band Control Section 29.2 BANDP

DBAND

DBANDP

ZONE

Zone Control Section 29.3 ZONEP

DZONE

DZONEP

SCL

Scaling (Coordinate by Point Data) Section 29.4 SCLP

DSCL

DSCLP

DABIN

Decimal ASCII to BIN Conversion Section 29.5 DABINP

DDABIN

DDABINP

BINDA

BIN to Decimal ASCII Conversion Section 29.6 BINDAP

DBINDA

DBINDAP

SCL2

Scaling 2 (Coordinate by X/Y Data) Section 29.7 SCL2P

DSCL2

DSCL2P

Page 681 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 29.1 LIMIT / Limit Control
Page 681 · click to enlarge
Page 681
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 29.1 LIMIT / Limit Control diagram (page 681)
Fig. 636 · 29.1 LIMIT / Limit Control

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction provides the upper limit value and lower limit value for an input numeric value, and control the output value using these limit values.

Input value controlled by the upper and lower limit values ANY16 ANY32

Head device storing the output value controlled by the upper and lower limit values ANY16 ANY32

Page 682 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — LIMIT EN ENO
Page 682 · click to enlarge
Page 682

29 Applied Instructions (Data Table Operation)

29.1 LIMIT / Limit Control

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 682)
Fig. 637 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

z

Function and operation explanation

1. 16-bit operation (LIMIT/LIMITP)

Depending on how the input value (16-bit binary value) of the device specified by compares to the upper and lower limit range between the devices specified by and , the output value stored in the device specified by is controlled. The output value is controlled as shown below.

LIMIT EN ENO

d s1 s2 s3 Input value controlled by the upper and lower limit values

Lower limit value Upper limit value

Head device storing the output value controlled by the upper and lower limit values

d s1 s1 1) In the case of " > " → lower limit

s2 s2 d 2) In the case of " < " → upper limit

value d 3) In the case of " ≤ ≤ " ... → input value input value

value s2 upper limit

Output value ( )

Input value ( )

When controlling the output value using only the upper limit value, set "-32768" to the lower limit value of the device specified by . s1 4)

When controlling the output value using only the lower limit value, set "32767" to the upper limit value of the device specified by . s2 5)

Show 21 more labels / short text on this page
Command input · value input value · lower limit · output · value s3 · value · value s3 · value input value · upper limit · output · value · s1 lower limit · output · value s3 s3 · Output value d · s2 · Specified value · Input value · s3 · s1 · Specified value
Page 683 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 683 · click to enlarge
Page 683

29 Applied Instructions (Data Table Operation)

29.1 LIMIT / Limit Control

2. 32-bit operation (DLIMIT/DLIMITP)

Applied Instructions (Real Time Clock Control)

Depending on how the input value (32-bit binary value) of the device specified by compares to the range between the upper and lower limits specified by and , the output value to be stored in the device specified by is controlled.

DLIMIT EN ENO

Lower limit value Upper limit value Input value controlled by the upper and lower limit values

d s1 s2 s3

Head device storing the output value controlled by the upper and lower limit values

1. output value

In the case of " > " →

Applied Instructions (Extension Function)

In the case of " < " →

In the case of " ≤ ≤ " →

Output value ( )

Applied Instructions (Block Data Operation)

When controlling the output value using only the upper limit value, set "-2,147,483,648" to the lower limit value specified in . s1

Applied Instructions (Character String Control)

s2 When controlling the output value using only the lower limit value, set "2,147,483,647" to the upper limit value specified in . 5)

Error

An operation error is caused when the instruction is executed in the setting status shown below. The error flag M8067 turns ON, and the error code (K6706) is stored in D8067. "(Contents of the device specified by ) > (contents of the device specified by )

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 36 more labels / short text on this page
Command input · s1 · s3 · s1 · lower limit value · input value · lower limit value · s2 · s3 · s2 · 2) · input value · output value · upper limit value · upper limit value · s1 · s3 · s2 · s3 · 3) · lower limit value · input value · upper limit value · input value · output value · Applied Instructions (Others) · Output value d · s2 · Specified value · Input value · Input value · ( ) · s3 · s1 · Specified value · 4)
Page 684 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation 1
Page 684 · click to enlarge
Page 684

29 Applied Instructions (Data Table Operation)

29.1 LIMIT / Limit Control

Program example

1. Program example 1 In the program example shown below, the BCD data set in X020 to X037 is controlled by the limit values "500" to "5000", and the controlled value is output to D1 when X000 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 684)
Fig. 638 · Program example

Operation

1. In the case of "D0 < 500", "500" is output to D1.
2. In the case of "500 ≤ D0 ≤ 5000", the value of D0 is output to D1.
3. In the case of "5000 < D0", "5000" is output to D1.
2. Program example 2 In the program example shown below, the BCD data set in X020 to X057 is controlled by the limit values "10000" and "1,000,000", and the controlled value is output to D11 and D10 when X000 turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation diagram (page 684)
Fig. 639 · Operation

Operation 1

1. In the case of "(D1, D0) < 10000", "10000" is set to (D11, D10).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation 1 diagram (page 684)
Fig. 640 · Operation 1
2. In the case of "10000 ≤ (D1, D0) ≤ 1,000,000", the value of (D1, D0) is output to (D11, D10).
3. In the case of "1,000,000 < (D1, D0)", "1,000,000" is output to (D11, D10)
Show 4 more labels / short text on this page
Output(D1) · 500 5000 · Input(D0) · 500 5000
Page 685 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 685 · click to enlarge
Page 685

29 Applied Instructions (Data Table Operation)

29.2 BAND / Dead Band Control

29.2 BAND / Dead Band Control

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction provides the upper limit value and lower limit value of the dead band for an input numeric value, and controls the output value using these limit values.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension Function)

BAND EN ENO

BAND 16 bits Continuous BAND(EN,s1,s2,s3,d);

d s1 s2 s3

BANDP EN ENO

BANDP 16 bits Pulse BANDP(EN,s1,s2,s3,d);

d s1 s2 s3

DBAND EN ENO

Applied Instructions (Block Data Operation)

DBAND 32 bits Continuous DBAND(EN,s1,s2,s3,d);

d s1 s2 s3

DBANDP EN ENO

Applied Instructions (Character String Control)

DBANDP 32 bits Pulse DBANDP(EN,s1,s2,s3,d);

d s1 s2 s3

2. Set data

EN Execution condition Bit

Lower limit value of the dead band (no-output band) ANY16 ANY32

Upper limit value of the dead band (no-output band) ANY16 ANY32

Input value controlled by the dead band ANY16 ANY32

Applied Instructions (Data Comparison)

ENO Execution state Bit

Device storing the output value controlled by the dead band. ANY16 ANY32

3. Applicable devices

Bit Devices Word Devices Others

Applied Instructions (Data Table Operation)

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

Applied Instructions (External Device Communication)

z

Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · Applied Instructions (Others) · Data type · Variable Description · 16-bit operation · 32-bit operation · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant
Page 686 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 686 · click to enlarge
Page 686

29 Applied Instructions (Data Table Operation)

29.2 BAND / Dead Band Control

Function and operation explanation

1. 16-bit operation (BAND/BANDP) Depending on how the input value (16-bit binary value) of the device specified by compares to the upper and lower limit dead band range between the devices specified by and , the output value to be stored in the device specified by is controlled. The output value is controlled as shown below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 686)
Fig. 641 · Function and operation explanation

Lower limit value of dead band Upper limit value of dead band Input value controlled by the dead band

Device storing the output value controlled by the dead band.

d s1 s1 1) In the case of " > " - → lower limit

s2 s2 d 2) In the case of " < " - → upper limit

value 3) In the case of " ≤ ≤ " 0 → input value d output

2. 32-bit operation (DBAND/DBANDP) Depending on how the input value (32-bit binary value) specified by compares to the upper and lower limit dead band range between the devices specified by and , the output value to be stored in the device specified by is controlled. The output value is controlled as shown below.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 686)
Fig. 642 · Function and operation explanation

Lower limit value of the dead band Upper limit value of the dead band Input value controlled by the dead band

Device storing the output value controlled by the dead band.

In the case of " > " - →

In the case of " < " - →

In the case of " ≤ ≤ " 0 →

Page 687 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K1000
Page 687 · click to enlarge
Page 687

29 Applied Instructions (Data Table Operation)

29.2 BAND / Dead Band Control

Cautions

Applied Instructions (Real Time Clock Control)

1. When the output value overflows, it is handled as follows: a) In the 16-bit operation

The output value is a 16-bit binary value with sign. Accordingly, if the operation result is outside the range from -32768 to 32767, it is handled as follows:

Lower limit value of dead band =10

=8000H-AH =7FF6H =32,758

b) In the 32-bit operation

The output value is a 32-bit binary value with sign. Accordingly, if the operation result is outside the range from -2,147,483,648 to 2,147,483,647, it is handled as follows:

Lower limit value of dead band =1000 s1

Applied Instructions (Extension Function)

=8000000H-000003E8H =7FFFFC18H =2,147,482,648

Input value =-2,147,483,648 s3

Error

An operation error is caused when the instruction is executed in the setting status shown below. The error flag M8067 turns ON, and the error code (K6706) is stored in D8067. (Contents of the device specified by ) > (contents of the device specified by )

Program example

1. Program example 1 In the program example shown below, the BCD data set in X020 to X037 is controlled by the dead band from "-1000" to "1000", and a controlled value is output to D1 when X000 turns ON.

Applied Instructions (Block Data Operation)

X000 BIN EN s

BIN(X000,K4X020,D0);

BAND(X000,K-1000,K1000,D0,D1);

Applied Instructions (Character String Control)

BAND EN ENO

K-1000

d s1 s2 s3

K1000

Operation

1. In the case of "D0 < (-1000)", "D0 - (-1000)" is set to D1.
2. In the case of "(-1000 ≤ D0 ≤ 1000", "0" is output to D1.
3. In the case of "1000 < D0", "D0 - 1000" is output to D1.

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 11 more labels / short text on this page
s1 · Output value=-32,768-10 · Input value =-32,768 · s3 · Output value=-2,147,483,648-1000 · Applied Instructions (Others) · d K4X020 D0 · Output · Input · Output · Input 0
Page 688 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K10000
Page 688 · click to enlarge
Page 688

29 Applied Instructions (Data Table Operation)

29.2 BAND / Dead Band Control

2. Program example 2 In the program example shown below, the BCD data set in X020 to X057 is controlled by the dead band from "-10000" to "10000", and a controlled value is output to D11 and D10 when X000 turns ON.

DBIN(X000,K8X020,D0);

X000 DBIN EN s

DBAND(X000,K-10000,K10000,D0,D10);

K8X020 D0

DBAND EN ENO

K-10000

d s1 s2 s3

K10000

Operation

1. In the case of "(D1, D0) < (-10000)", "(D1, D0) - (-10000)" is set to (D11, D10).
2. In the case of "(-10000 ≤ (D1, D0) ≤ 10000", "0" is output to (D11, D10).
3. In the case of "10000 < (D1, D0)", "(D1, D0) - 10000" is output to (D11, D10).
Show 5 more labels / short text on this page
Output · Input · Output · Input 0 · +10000
Page 689 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 29.3 ZONE / Zone Control
Page 689 · click to enlarge
Page 689
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 29.3 ZONE / Zone Control diagram (page 689)
Fig. 643 · 29.3 ZONE / Zone Control

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Depending on whether the input value is positive or negative, the output value is controlled by the bias value specified.

Negative bias value to be added to the input value ANY16 ANY32

Positive bias value to be added to the input value ANY16 ANY32

Head device storing the output value controlled by the zone ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

z

Page 690 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DZONE/DZONEP)
Page 690 · click to enlarge
Page 690

29 Applied Instructions (Data Table Operation)

29.3 ZONE / Zone Control

Function and operation explanation

1. 16-bit operation (ZONE/ZONEP)

The bias value specified by or is added to the input value specified by , and output to the device specified by . The bias value is added as shown below.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 690)
Fig. 644 · Function and operation explanation

Negative bias value to be added to the input value

Head device storing the output value controlled by the zone

Positive bias value to be added to the input value

s1 1) In the case of " < 0 " + → negative bias value input value d output

2. In the case of " = 0 " 0 → input value d output

s1 positive bias value 3) In the case of " > 0 " + → input value d output

2. 32-bit operation (DZONE/DZONEP)

The bias value specified by or is added to the input value of the device specified by , and output to the device specified by . The bias value is added as shown below:

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DZONE/DZONEP) diagram (page 690)
Fig. 645 · 2. 32-bit operation (DZONE/DZONEP)

Negative bias value to be added to the input value

Head device storing the output value controlled by the zone

Positive bias value to be added to the input value

In the case of " < 0 " + → 1) output value

In the case of " = 0 " 0 → input value

In the case of " > 0 " + → input value

Page 691 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K-1000 K1000
Page 691 · click to enlarge
Page 691

29 Applied Instructions (Data Table Operation)

29.3 ZONE / Zone Control

Cautions

Applied Instructions (Real Time Clock Control)

1. When the output value overflows, it is handled as follows: a) In the 16-bit operation

The output value is a 16-bit binary value with sign. Accordingly, if the operation result is outside the range from -32768 to 32767, it is handled as follows:

Negative bias value =-100 s1

=8000H+FF9CH =7F9CH =32,668

Input value =-32,768 s3

b) In the 32-bit operation

The output value is a 32-bit binary value with sign. Accordingly, if the operation result is outside the range from -2,147,483,648 to 2,147,483,647, it is handled as follows:

Applied Instructions (Extension Function)

Negative bias value =-1000

=-2,147,483,648+(-1000) =80000000H+FFFFFC18H =7FFFFC18 =2,147,482,648

Program example

1. Program example 1 In the program example shown below, the BCD data set in X020 to X037 is controlled by the zone from "-1000" to "1000", and the controlled value is output to D1 when X000 turns ON.

Applied Instructions (Block Data Operation)

X000 BIN EN s

BIN(X000,K4X020,D0);

ZONEP(X000,K-1000,K1000,D0,D1);

ZONEP EN ENO

Applied Instructions (Character String Control)

d s1 s2 s3

K-1000 K1000

Operation

1. In the case of "D0 < 0", "D0 + (-1000)" is output to D1.
2. In the case of "D = 0", "0" is output to D1.
3. In the case of "0 < D0", "D0 + 1000" is output to D1.

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 8 more labels / short text on this page
Output value =-32,768+(-100) · Output value s1 · Input value =-2,147,483,648 · s3 · Applied Instructions (Others) · d K4X020 D0 · Output · Input 0
Page 692 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — K-10000
Page 692 · click to enlarge
Page 692

29 Applied Instructions (Data Table Operation)

29.3 ZONE / Zone Control

2. Program example 2 In the program example below, the BCD data set in X020 to X057 is controlled by the zone from "-10000" to "10000", and the controlled value is output to D11 and D10 when X000 turns ON.

X000 DBIN EN s

DBIN(X000,K8X020,D0);

DZONEP(X000,K-10000,K10000,D0,D1);

K8X020 D0

DZONEP EN ENO

d s1 s2 s3

K-10000

K10000

Operation

1. In the case of "(D1, D0) < 0", "(D1, D0) + (-10000)" is output to (D11, D10).
2. In the case of "(D1, D0) = 0", "0" is output to (D11, D10).
3. In the case of "0 < (D1, D0)", "(D1, D0) + 10000" is output to (D11, D10)

Output · Input 0

Page 693 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 29.4 SCL / Scaling (Coordinate by Point Data)
Page 693 · click to enlarge
Page 693
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 29.4 SCL / Scaling (Coordinate by Point Data) diagram (page 693)
Fig. 646 · 29.4 SCL / Scaling (Coordinate by Point Data)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes scaling of the input value using a specified data table, and outputs the result. SCL2 is also available with a different data table configuration for scaling.

Input value used in scaling or device storing the input value ANY16 ANY32

Head device storing the conversion table used in scaling ANY16 ANY32

Device storing the output value controlled by scaling ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 694 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DSCL/DSCLP)
Page 694 · click to enlarge
Page 694

29 Applied Instructions (Data Table Operation)

29.4 SCL / Scaling (Coordinate by Point Data)

Function and operation explanation

1. 16-bit operation (SCL/SCLP)

The input value of the device specified by is processed by scaling for the specified conversion characteristics, and stored to a device number specified by . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.

→ For the method to set the conversion table for scaling, refer to the next page.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 694)
Fig. 647 · Function and operation explanation

Number of coordinate points ("5" in the case shown in the left figure)

*1. Input value used in scaling or device storing the input value

*2. Head device storing the conversion table used in scaling

*3. Device storing the output value controlled by scaling

2. 32-bit operation (DSCL/DSCLP)

The input value specified by is processed by scaling for the specified conversion table, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DSCL/DSCLP) diagram (page 694)
Fig. 648 · 2. 32-bit operation (DSCL/DSCLP)

Number of coordinate points ("5" in the case shown in the left figure) [ +1, ]

*1. Input value used in scaling or device storing the input value

*2. Head device storing the conversion table used in scaling

*3. Device storing the output value controlled by scaling

Page 695 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Setting the conversion setting data table for scaling
Page 695 · click to enlarge
Page 695

29 Applied Instructions (Data Table Operation)

29.4 SCL / Scaling (Coordinate by Point Data)

3. Setting the conversion table for scaling

Applied Instructions (Real Time Clock Control)

The conversion table for scaling is set based on the data table stored in a device specified in and later. The data table has the following configuration:

Device assignment in setting data table

16-bit operation 32-bit operation

Number of coordinate points [ +1, ]

X coordinate +1 [ +3, +2]

Y coordinate +2 [ +5, +4]

X coordinate +3 [ +7, +6]

Y coordinate +4 [ +9, +8]

Applied Instructions (Extension Function)

X coordinate +2n-1 [ +4n-1, +4n-2]

Y coordinate +2n [ +4n+1, +4n]

4. Setting example of the conversion table for scaling A setting example for the 16-bit operation is shown below. For the 32-bit operation, set each item using a 32-bit binary value. In the case of the conversion characteristics for scaling shown in the figure below, set the following data table.

Y

Point 7 (250,90) Point 8 (350,90)

Applied Instructions (Block Data Operation)

Point 9 (350,30) Point 10 (400,7)

Setting the conversion setting data table for scaling

Applied Instructions (Character String Control)

Setting device and setting contents

Remarks When R0 is specified in

Number of coordinate points R0 K10

X coordinate +1 R1 K5

Y coordinate +2 R2 K7

X coordinate +3 R3 K20

Y coordinate +4 R4 K30

X coordinate +5 R5 K50

Y coordinate +6 R6 K100

X coordinate +7 R7 K200

Applied Instructions (Data Comparison)

Y coordinate +8 R8 K25

When coordinates are specified using three points in this way, the output value can be set to an intermediate value. In this example, the output value (intermediate value) is specified by the Y coordinate of the point 5. If the x coordinate is the same at three points or more, the value at the second point is also output.

X coordinate +9 R9 K200

Y coordinate +10 R10 K70

X coordinate +11 R11 K200

Y coordinate +12 R12 K250

X coordinate +13 R13 K250

Applied Instructions (Data Table Operation)

Y coordinate +14 R14 K90

X coordinate +15 R15 K350

When coordinates are specified using two points in this way, the output value is the Y coordinate at the next point. In this example, the output value is specified by the Y coordinate of the point 9.

Y coordinate +16 R16 K90

X coordinate +17 R17 K350

Y coordinate +18 R18 K30

Applied Instructions (External Device Communication)

X coordinate +19 R19 K400

Y coordinate +20 R20 K7

Show 23 more labels / short text on this page
Set item · Point 1 · Point 2 · Point n (last) · Applied Instructions (Others) · Point 6 (200,250) · Point 3 (50,100) · Point 5 (200,70) · Point 2 (20,30) · Point 1 (5,7) · Point 4 (200,25) · Set item · Setting contents · Point 1 · Point 2 · Point 3 · Point 4 · Point 5 · Point 6 · Point 7 · Point 8 · Point 9 · Point 10
Page 696 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SCL (M8000, D0, R0, D10);
Page 696 · click to enlarge
Page 696

29 Applied Instructions (Data Table Operation)

29.4 SCL / Scaling (Coordinate by Point Data)

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1) When the Xn data is not set in the ascending order in the data table (error code: K6706) The data table is searched from the low-order side of device numbers in the data table in the operation. Accordingly, even if only some Xn data is set in the ascending order in the data table, the instruction is executed without operation error up to the area of the data table in which the Xn data is set in the ascending order.

2. When the device specified by is outside the data table range (error code: K6706)
3. When the value exceeds the 32-bit data range in the middle of operation (error code: K6706) In this case, check whether the distance between points is not "65535" or more. If the distance is "65535" or more, reduce the distance between points.

Program example

In the program example shown below, the value input to D0 is processed by scaling based on the conversion table for scaling set in R0 and later, and output to D10.

Program

M8000 SCL EN s1

SCL (M8000, D0, R0, D10);

R0

Operation

Y

Conversion setting data table for scaling

Set item Device Setting contents

Number of coordinate points R0 K6

X coordinate R1 K0

Y coordinate R2 K0

X coordinate R3 K10

Y coordinate R4 K50

X coordinate R5 K30

Y coordinate R6 K100

X coordinate R7 K40

Y coordinate R8 K45

X coordinate R9 K50

Y coordinate R10 K30

X coordinate R11 K60

Y coordinate R12 K0

Show 17 more labels / short text on this page
s2 · Point 3 (30,100) · Point 4 (40,45) · Point 1 · Point 2 (10,50) · Output value (D10)=35 · Point 5 (50,30) · Point 2 · Point 1 · (0,0) · Point 3 · Input value(D0)=7 · Point 6 · (60,0) · Point 4 · Point 5 · Point 6
Page 697 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 29.5 DABIN / Decimal ASCII to BIN Conversion
Page 697 · click to enlarge
Page 697
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 29.5 DABIN / Decimal ASCII to BIN Conversion diagram (page 697)
Fig. 649 · 29.5 DABIN / Decimal ASCII to BIN Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts numeric data expressed in decimal ASCII codes (30H to 39H) into binary data.

Head device storing data (ASCII codes) to be converted into binary data String String

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Page 698 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. 32-bit operation (DDABIN/DDABINP)
Page 698 · click to enlarge
Page 698

29 Applied Instructions (Data Table Operation)

29.5 DABIN / Decimal ASCII to BIN Conversion

Function and operation explanation

1. 16-bit operation (DABIN/DABINP)

1. Data expressed in decimal ASCII codes (30H to 39H) and stored in the device specified by is converted into 16-bit binary data, and stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 698)
Fig. 650 · Function and operation explanation

d s Head device storing data (ASCII codes) to be converted into binary data

16-bit binary data(BIN) ASCII code for 1's digit ASCII code for 10's digit

For example, when the device specified by stores ASCII codes expressing "-25108", 16-bit binary data is stored in the device specified by as follows:

2. The numeric range of data stored in the device specified by is from "-32768" to "32767".
3. As "sign data", "20H (space)" is set when the data to be converted is positive, and "2DH (-)" is set when the data to be converted is negative.
4. An ASCII code for each digit is within the range from 30H to 39H.
5. When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".

2. 32-bit operation (DDABIN/DDABINP)

1. Data expressed in decimal ASCII codes (30H to 39H) and stored in the device specified by is converted into 32-bit binary data, and stored in the device specified by .
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DDABIN/DDABINP) diagram (page 698)
Fig. 651 · 2. 32-bit operation (DDABIN/DDABINP)

Head device storing data (ASCII codes) to be converted into binary data

ASCII code for 100,000's digit ASCII code for 1,000,000's digit

For example, when the device specified by stores ASCII codes expressing "-1,234,543,210", 32-bit binary data is stored in the device specified by as follows:

Page 699 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D21 D20
Page 699 · click to enlarge
Page 699

29 Applied Instructions (Data Table Operation)

29.5 DABIN / Decimal ASCII to BIN Conversion

2. The numeric range of data stored in the device specified by is from "-2,147,483,648" to "2,147,483,647". The high-order byte of + 5 is ignored.

Applied Instructions (Real Time Clock Control)

3. As "sign data", "20H (space)" is set when the data to be converted is positive, and "2DH (-)" is set when the data to be converted is negative.
4. An ASCII code for each digit is within the range from 30H to 39H.
5. When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".

Related instructions

ASCI Converts hexadecimal codes into ASCII codes.

HEX Converts ASCII codes into hexadecimal codes.

Applied Instructions (Extension Function)

STR Converts binary data into a character string (ASCII codes).

VAL Converts a character string (ASCII codes) into binary data.

BINDA Converts binary data into decimal ASCII codes (30H to 39H).

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the sign data is any value other than "20H (space)" or "2DH (-)". (Error code: K6706)

Applied Instructions (Block Data Operation)

2. When an ASCII code for each digit stored in to + 2 (5) is any value other than "30H" to "39H", "20H (space)", or "00H (NULL)". (Error code: K6706)
3. When the numeric range of to + 2 (5) is outside the following range. (Error code: K6706)

Applied Instructions (Character String Control)

16-bit operation -32768 to 32767

32-bit operation -2,147,483,648 to 2,147,483,647

4. When the device specified by exceeds the device range. (Error code: K6706)

Program example

In the program example below, the sign and decimal ASCII codes in five digits stored in D20 to D22 are converted into a binary value and stored in D0 when X000 turns ON.

X000 DABINP EN ENO

DABINP(X000, D20, D0);

Applied Instructions (Data Comparison)

d s D20 D0

b15 b8 b7 b0

20H(space) 32H(2) 2DH(-) 20H(space) D22 (It is regarded as "-00276".) "- 276"

D21 D20

Binary value 36H(6) 37H(7)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Instruction Description · Applied Instructions (Others) · Setting range

Page 700 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 700 · click to enlarge
Page 700

29 Applied Instructions (Data Table Operation)

29.6 BINDA / BIN to Decimal ASCII Conversion

29.6 BINDA / BIN to Decimal ASCII Conversion

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction converts binary data into decimal ASCII codes (30H to 39H).

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 700)
Fig. 652 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 700)
Fig. 653 · 2. Set data

Device storing binary data to be converted into ASCII codes ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 700)
Fig. 654 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

Page 701 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 31H(1) 33H(3) 2DH(-) 32H(2)
Page 701 · click to enlarge
Page 701

29 Applied Instructions (Data Table Operation)

29.6 BINDA / BIN to Decimal ASCII Conversion

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (BINDA/BINDAP)

1. Each digit of 16-bit binary data stored in the device specified by is converted into an ASCII code (30H to 39H), and stored in the device specified by and later.

BINDAP EN ENO

d s Device storing binary data to be converted into ASCII codes

Head device storing conversion result

ASCII code for 10000's digit

Sign data ASCII code for 1000's digit

Applied Instructions (Extension Function)

ASCII code for 100's digit

ASCII code for 1's digit ASCII code for 10's digit

16-bit binary data +3

0000H or source data M8091=OFF:0000H M8091=ON:Does not

change.

For example, when the device specified by stores "-12345", the conversion result is stored in the device specified by and later as follows:

31H(1) 33H(3) 2DH(-) 32H(2)

35H(5) 34H(4)

0000H or source data +3 M8091=OFF:0000H M8091=ON:Does not change.

Applied Instructions (Block Data Operation)

2. The numeric range of 16-bit binary data stored in the device specified by is from "-32768" to "32767".
3. The conversion result stored in the device specified by is as follows:

a) As "sign data", "20H (space)" is set when the 16-bit binary data stored in the device specified by

Applied Instructions (Character String Control)

is positive, and "2DH (-)" is set when 16-bit binary data stored in the device specified by is negative. b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).

0 0 3 2 5

c) + 3 is set as follows depending on the ON/OFF status of M8091.

ON/OFF status Contents of processing

M8091=OFF +3 is set to "0000H (NULL)".

Applied Instructions (Data Comparison)

M8091=ON +3 does not change

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 16 more labels / short text on this page
Command input · b15 · b8 b7 b0 · +0 · +1 b0 b15 · s · +2 · Applied Instructions (Others) · b15 · b8 b7 b0 · +0 · b0 b15 · +1 -12345 · s · +2 · 20H Effective digits
Page 702 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Related devices
Page 702 · click to enlarge
Page 702

29 Applied Instructions (Data Table Operation)

29.6 BINDA / BIN to Decimal ASCII Conversion

2. 32-bit operation (DBINDA/DBINDAP)

1. Each digit of 32-bit binary data stored in the device specified by is converted into an ASCII code (30H to 39H), and stored in the device specified by and later.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DBINDA/DBINDAP) diagram (page 702)
Fig. 655 · 2. 32-bit operation (DBINDA/DBINDAP)

Device storing binary data to be converted into ASCII codes

ASCII code for 100,000's digit ASCII code for 1,000,000's digit

For example, when the device specified by stores "-12,345,678", the conversion result is stored in the device specified by and later as follows:

2. The numeric range of 32-bit binary data stored in the device specified bay is from "-2,147,483,648" to "2,147,483,647".
3. The conversion result stored in the device specified by is as follows:

a) As "sign data", "20H (space)" is set when the 32-bit binary data stored in the device specified by

is positive, and "2DH (-)" is set when 32-bit binary data stored in the device specified by is negative. b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. 32-bit operation (DBINDA/DBINDAP) diagram (page 702)
Fig. 656 · 2. 32-bit operation (DBINDA/DBINDAP)

0 0 1 2 0 3 4 5 6 0

c) The high-order byte of + 5 is set as follows depending on the ON/OFF status of M8091.

M8091=OFF The high-order byte of + 5 is set to "00H (NULL)".

M8091=ON The high-order byte of + 5 is set to "20H (space)".

Related devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related devices diagram (page 702)
Fig. 657 · Related devices

- When M8091 is OFF, + 3 is set to "0000H (NULL)".

- When M8091 is ON, + 3 does not change. • For 32-bit operation

- When M8091 is OFF, the high-order byte of + 5 is set to "00H (NULL)".

- When M8091 is ON, the high-order byte of + 5 is set to "20H (space)".

Page 703 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 0000H D3
Page 703 · click to enlarge
Page 703

29 Applied Instructions (Data Table Operation)

29.6 BINDA / BIN to Decimal ASCII Conversion

Related instructions

Applied Instructions (Real Time Clock Control)

ASCI Converts hexadecimal codes into ASCII codes.

HEX Converts ASCII codes into hexadecimal codes.

DESTR Converts binary floating point data into a character string data (ASCII code) with the specified number of digits.

DEVAL Converts character string data (ASCII code) into binary floating point data.

DABIN Converts numeric value data expressed in decimal ASCII codes (30H to 39H) into binary data.

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
2. Occupied device points The table below shows the occupied device points of the device specified by for 16-bit operation (BINDA/BINDAP) when M8091 is ON or OFF and 32-bit operation (DBINDA/DBINDAP).

Applied Instructions (Extension Function)

16-bit operation M8091=ON 3

M8091=OFF 4

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the occupied device points of the ASCII code character string in the device specified by exceed the corresponding device range. (Error code: K6706)

Applied Instructions (Block Data Operation)

Program example

In the program example below, 16-bit binary data stored in D1000 is converted into decimal ASCII codes when X000 is set to ON, and the ASCII codes converted by PR (FNC77) instruction are output one by one in the time division method to Y040 to Y051. By setting to OFF the output character selector signal M8091 and setting to ON PR mode flag M8027, ASCII codes up to "00H" are output.

Applied Instructions (Character String Control)

→ For PR mode flag and PR instruction, refer to Section 14.8.

RST EN ENO

RST(X000,M8091);

SET(X000,M8027);

M8091

BINDA(X000,D1000,D0);

PR(X000,D0,Y040);

SET EN ENO

M8027

Applied Instructions (Data Comparison)

BINDA EN ENO

D1000 D0

Applied Instructions (Data Table Operation)

b15 b8 b7 b0

PR (FNC77)

20H(space) 31H(1) 20H(space) 35H(5) D1 D2

Y040 to Y051 "__5126" is output.

36H(6) 32H(2)

Applied Instructions (External Device Communication)

0000H D3

(BIN)

M8091=OFF

Show 9 more labels / short text on this page
Instruction Description · Occupied points of · 32-bit operation 6 · Applied Instructions (Others) · d s · PR EN s · d D0 Y040 · instruction · 16-bit binary data
Page 704 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 704 · click to enlarge
Page 704

29 Applied Instructions (Data Table Operation)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction executes scaling of the input value using a specified data table, and outputs the result. SCL instruction is also available with a different data table configuration for scaling.

→ For SCL instruction, refer to Section 29.4.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 704)
Fig. 658 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 704)
Fig. 659 · 2. Set data

Input value used in scaling or device storing the input value ANY16 ANY32

Head device storing the conversion table used in scaling ANY16 ANY32

Device storing the output value controlled by scaling ANY16 ANY32

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 704)
Fig. 660 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Page 705 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y
Page 705 · click to enlarge
Page 705

29 Applied Instructions (Data Table Operation)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

Function and operation explanation

Applied Instructions (Real Time Clock Control)

1. 16-bit operation (SCL2/SCL2P)

The input value specified in is processed by scaling for the specified conversion characteristics, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.

→ For the method to set the conversion table for scaling, refer to the next page.

Conversion setting data table for scaling

SCL2 EN ENO

Set item Device assignment in

Number of coordinate points ("5" in the case shown in the left figure)

Applied Instructions (Extension Function)

Input value used in scaling or device storing the input value *1.

Head device storing the conversion table used in scaling *2.

Device storing the output value controlled by scaling *3.

Y

Output value ( )

Applied Instructions (Block Data Operation)

Operation is enabled.

Applied Instructions (Character String Control)

2. 32-bit operation (DSCL2/DSCL2P)

The input value specified by is processed by scaling for the specified conversion table, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.

Conversion setting data table for scaling

DSCL2 EN ENO

Set item Conversion setting data table for scaling

Number of coordinate points ("5" in the case shown in the left figure) [ +1, ]

Input value used in scaling or device storing the input value *1.

Point 1 [ +3, +2]

Applied Instructions (Data Comparison)

Head device storing the conversion table used in scaling *2.

Point 2 [ +5, +4]

Point 3 [ +7, +6]

Device storing the output value controlled by scaling *3.

Point 4 [ +9, +8]

Point 5 [ +11, +10]

Y

Output value ( )

Point 1 [ +13, +12]

Applied Instructions (Data Table Operation)

Point 2 [ +15, +14]

Point 3 [ +17, +16]

Point 4 [ +19, +18]

Point 5 [ +21, +20]

Applied Instructions (External Device Communication)

Input value ( )

Operation is enabled.

Show 39 more labels / short text on this page
Command input · setting data table · *1 *2 *3 · d s1 s2 · Point 1 +1 · Point 2 +2 · X coordinate · Point 3 +3 · Point 4 +4 · Point 5 +5 · Applied Instructions (Others) · Point 1 +6 · Point 2 · Point 2 +7 · Point 5 · Y coordinate · Point 3 +8 · Point 3 · Point 4 +9 · Point 5 +10 · Point 4 · Point 1 · Input value( ) · s1 · Operation error · Operation error · Command input · *1 *2 *3 · d s1 s2 · X coordinate · Point 2 · Point 5 · Point 3 · Y coordinate · Point 4 · Point 1 · s1 · Operation error · Operation error
Page 706 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Setting the conversion table for scaling
Page 706 · click to enlarge
Page 706

29 Applied Instructions (Data Table Operation)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

3. Setting the conversion table for scaling

The conversion table for scaling is set based on the data table stored in a device specified in and later. The data table has the following configuration:

→ For a setting example, refer to the next page.

Device assignment in setting data table

16-bit operation 32-bit operation

Number of coordinate points [ +1, ]

Point 1 +1 [ +3, +2]

Point 2 +2 [ +5, +4]

Point n (last) +n [ +2n+1, +2n]

Point 1 +n+1 [ +2n+3, +2n+2]

Point 2 +n+2 [ +2n+5, +2n+4]

Point n (last) +2n [ +4n+1, +4n]

Set item · X coordinate · Y coordinate

Page 707 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Setting the conversion setting data table for scaling
Page 707 · click to enlarge
Page 707

29 Applied Instructions (Data Table Operation)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

Setting example of the conversion table for scaling A setting example for the 16-bit operation is shown below. For the 32-bit operation, set each item using a 32-bit binary value. In the case of the conversion characteristics for scaling shown in the figure below, set the following data table.

Applied Instructions (Real Time Clock Control)

Y

Point 7 (250,90) Point 8(350,90)

Point 9 (350,30) Point 10(400,7)

Applied Instructions (Extension Function)

Setting the conversion setting data table for scaling

Setting device and setting contents

Remarks When R0 is specified in

Number of coordinate points R0 K10

Point 1 +1 R1 K5

Point 2 +2 R2 K20

Point 3 +3 R3 K50

Point 4 +4 R4 K200

Refer to *1. Point 5 +5 R5 K200

Point 6 +6 R6 K200

Applied Instructions (Block Data Operation)

Point 7 +7 R7 K250

Point 8 +8 R8 K350

Refer to *2. Point 9 +9 R9 K350

Point 10 +10 R10 K400

Point 1 +11 R11 K7

Applied Instructions (Character String Control)

Point 2 +12 R12 K30

Point 3 +13 R13 K100

Point 4 +14 R14 K25

Refer to *1. Point 5 +15 R15 K70

Point 6 +16 R16 K250

Point 7 +17 R17 K90

Point 8 +18 R18 K90

Refer to *2. Point 9 +19 R19 K30

Point 10 +20 R20 K7

*1. When coordinates are specified using three points as shown in the points 4, 5 and 6, the output value can be set to an intermediate value. In this example, the output value (intermediate value) is specified by the Y coordinate of the point 5. If the X coordinate is same at three points or more, the value at the second point is output also.

Applied Instructions (Data Comparison)

*2. When coordinates are specified using two points as shown in the points 8 and 9, the output value is the Y coordinate at the next point. In this example, the output value is specified by the Y coordinate of the point 9.

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 12 more labels / short text on this page
Point 6(200,250) · Point 3 (50,100) · Point 5 (200,70) · Point 2 · (20,30) · Point 1 (5,7) · Point 4(200,25) · Set item · Setting contents · Applied Instructions (Others) · X coordinate · Y coordinate
Page 708 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — R0
Page 708 · click to enlarge
Page 708

29 Applied Instructions (Data Table Operation)

29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1) When the Xn data is not set in the ascending order in the data table (error code: K6706) The data table is searched from the low-order side of device numbers in the data table in the operation. Accordingly, even if only some Xn data is set in the ascending order in the data table, the instruction is executed without operation error up to the area of the data table in which the Xn data is set in the ascending order.

2. When the device specified by is outside the data table range (error code: K6706)
3. When the value exceeds the 32-bit data range in the middle of operation (error code: K6706) In this case, check whether the distance between points is not "65535" or more. If the distance is "65535" or more, reduce the distance between points.

Program example

In the program example shown below, the value input to D0 is processed by scaling based on the conversion table for scaling set in R0 and later, and output to D10.

Program

SCL2(M8000,D0,R0,D10);

M8000 SCL2 EN s1

R0

Operation

Y

Conversion setting data table for scaling

Set item Device Setting contents

Number of coordinate points R0 K6

Point 1 R1 K0

Point 2 R2 K10

Point 3 R3 K30

Point 4 R4 K40

Point 5 R5 K50

Point 6 R6 K60

Point 1 R7 K0

Point 2 R8 K50

Point 3 R9 K100

Point 4 R10 K45

Point 5 R11 K30

Point 6 R12 K0

Show 13 more labels / short text on this page
s2 · Point 3 (30,100) · Point 4 (40,45) · Point 2 (10,50) · Output value (D10)=35 · Point 5 (50,30) · X coordinate · Point 1 · (0,0) · Input value(D0)=7 · Point 6 · (60,0) · Y coordinate
Page 709 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 30. Applied Instructions (External Device Communication)
Page 709 · click to enlarge
Page 709

30 Applied Instructions (External Device Communication)

Applied Instructions (Real Time Clock Control)

30. Applied Instructions (External Device Communication)

This chapter introduces the instructions for executing inverter communication and MODBUS communication.

Instruction name Function Reference

IVCK Inverter Status Check Section 30.1

IVDR Inverter Drive Section 30.2

IVRD Inverter Parameter Read Section 30.3

IVWR Inverter Parameter Write Section 30.4

IVBWR Inverter Parameter Block Write Section 30.5

Applied Instructions (Extension Function)

IVMC Inverter Multi Command Section 30.6

ADPRW MODBUS Read / Write Section 30.7

Applied Instructions (Block Data Operation)

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 710 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 710 · click to enlarge
Page 710

30 Applied Instructions (External Device Communication)

30.1 IVCK / Inverter Status Check

30.1 IVCK / Inverter Status Check

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads the operation status of an inverter to a PLC using the computer link operation function of the inverter. Applicable inverters vary depending on the version. This instruction corresponds to the EXTR (K10) instruction in the FX2N and FX2NC series.

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 710)
Fig. 661 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 710)
Fig. 662 · 2. Set data

*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 710)
Fig. 663 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z

S: Refer to "Cautions".

Page 711 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — IVCK EN ENO
Page 711 · click to enlarge
Page 711

30 Applied Instructions (External Device Communication)

30.1 IVCK / Inverter Status Check

Function and operation explanation

Applied Instructions (Real Time Clock Control)

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. 16-bit operation (IVCK)

The operation status corresponding to the instruction code*1 specified in the device specified by of an inverter connected to communication port n whose station number is specified in the device specified by is read and transferred to the device specified by .

IVCK EN ENO

Inverter station number Inverter instruction code

d s1 s2 n

Device storing the read value

Channel to be used

*1. Refer to the instruction code list. Refer to the pages in the inverter manual on which the computer link function is explained in detail.

Applied Instructions (Extension Function)

2. Instruction codes of inverters The table below shows the inverter instruction codes specified in along with their functions. Only use the instruction codes shown below. Use of instruction codes not shown below may cause communication errors. Do not use instruction codes not shown in the table below. They may cause communication errors. For instruction codes, refer to the pages in the inverter manual where the computer link function is explained in detail.

specified in Read contents

F700 A700 E700 D700 V500 F500 A500 E500 S500

H7B Operation mode 3

H6F Output frequency (number of rotations) 3*1 3

Applied Instructions (Block Data Operation)

H70 Output current 3

H71 Output voltage 3 -

H72 Special monitor 3 - -

H73 Special monitor selection number 3 - -

H74 Abnormal contents 3

H75 Abnormal contents 3

Applied Instructions (Character String Control)

H76 Abnormal contents 3 -

H77 Abnormal contents 3 -

H79 Inverter status monitor (extension) 3 -

H7A Inverter status monitor 3

H6E Set frequency (read from E2PROM) 3*1 3

H6D Set frequency (read from RAM) 3*1 3

H7F Link parameter extended setting These codes cannot be specified in of the IVCK instruction. They are automatically processed when a "second parameter specification code" is specified the IVRD instruction. H6C Second parameter changing

*1. Please write "0" to instruction code HFF (Link parameter expansion setting) just before the IVCK instruction when reading frequency. When "0" is not written, reading of the frequency may not be executed normally.

Applied Instructions (Data Comparison)

3. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Number Description Number Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

Applied Instructions (Data Table Operation)

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2

M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence

M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

Applied Instructions (External Device Communication)

*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1

Show 5 more labels / short text on this page
Command input · Applied Instructions (Others) · Instruction code · Corresponding inverter · step*2*3
Page 712 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700
Page 712 · click to enlarge
Page 712

30 Applied Instructions (External Device Communication)

30.1 IVCK / Inverter Status Check

Cautions

→ For other cautions, refer to the Data Communication Edition manual.

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR *1 or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

3. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR *1 and IVMC) can be driven for the same port at the same time.
4. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

PLC applicable version

The table below shows PLC versions applicable to each inverter.

PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700

FX3S Ver.1.00 or later

FX3G Ver.1.10 or later

FX3GC Ver.1.40 or later

FX3U Ver.2.20 or later Ver.2.32 or later

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

Page 713 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 713 · click to enlarge
Page 713

30 Applied Instructions (External Device Communication)

30.2 IVDR / Inverter Drive

30.2 IVDR / Inverter Drive

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes a inverter operation required control value to the PLC using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K11) instruction in the FX2N and FX2NC series PLCs.

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. Format and operation, execution form

Applied Instructions (Extension Function)

Expression in each language

IVDR EN ENO s1 s2 s3 n

IVDR 16 bits Continuous IVDR(EN,s1,s2,s3,n);

2. Set data

Variable Description Data type

EN Execution condition Bit

Applied Instructions (Block Data Operation)

Inverter station number ANY16

Inverter instruction code ANY16

Set value to be written to the inverter parameter or device storing the data to be set. ANY16

Channel to be used (K1:ch1, K2:ch2*1) ANY16

Applied Instructions (Character String Control)

Output variable ENO Execution state Bit

*1. "ch2" is not available for use for FX3S and FX3G (14-point and 24-point type) PLCs.

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System user Special

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

z S1 S2 z z z

Applied Instructions (Data Comparison)

S: Refer to "Cautions".

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 13 more labels / short text on this page
Instruction · name Operation Execution · form · Applied Instructions (Others) · Input variable · Operand · unit Index Cons · Real Number · Character · String Pointer · type · tant · z z
Page 714 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 1. 16-bit operation (IVDR)
Page 714 · click to enlarge
Page 714

30 Applied Instructions (External Device Communication)

30.2 IVDR / Inverter Drive

Function and operation explanation

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. 16-bit operation (IVDR)

The control value specified in the device specified by is written to the instruction code*1 in the device specified by of an inverter connected to a communication port n whose station number is specified in the device specified by .

IVDR EN ENO s1 s2 s3

Inverter station number Inverter instruction code Set value to be written to the inverter parameter

or device storing the data to be set.

Channel to be used

*1. Refer to the instruction code list. Refer to the pages in the inverter manual on which the computer link function is explained in detail.

2. Instruction codes of inverters The table below shows the inverter instruction codes specified in along with their functions. For instruction codes, refer to the pages in the inverter manual where the computer link function is explained in detail.

F700 A700 E700 D700 V500 F500 A500 E500 S500

HFB Operation mode 3

HF3 Special monitor selection number 3 - -

HF9 Operation command (extension) 3 -

HFA Operation command 3

HEE Set frequency (written to EEPROM) 3*3

HED Set frequency (written to RAM) 3*3

HFD*1 Inverter reset*2 3

HF4 Abnormal contents all clear 3 - 3

HFC Parameter all clear 3

HFC User clear - 3 3 - -

HFF Link parameter extended setting 3

*1. The instruction code "HFD (inverter reset)" does not request a response from the inverter. Accordingly, even if inverter reset is executed to a station number at which an inverter is not connected, error does not occur. It takes about 2.2 seconds to complete execution of inverter reset. *2. When resetting the inverter, please specify H9696 as . Do not use H9966. *3. Please write "0" to instruction code HFF (Link parameter expansion setting) just before the IVDR instruction when writing frequency. When "0" is not written, writing of the frequency may not be executed normally.

3. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2

M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence

M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1

Show 11 more labels / short text on this page
Command input · n · Hexadecimal instruction · Corresponding inverter · code of inverter · Written contents · specified in · Number · Number · Description · step*2*3
Page 715 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700
Page 715 · click to enlarge
Page 715

30 Applied Instructions (External Device Communication)

30.2 IVDR / Inverter Drive

Cautions

Applied Instructions (Real Time Clock Control)

→ For other cautions, refer to the Data Communication Edition manual.

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR *1 or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

3. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR *1 and IVMC) can be driven for the same port at the same time.
4. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Extension Function)

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

PLC applicable version

The table below shows PLC versions applicable to each inverter.

PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700

FX3S Ver.1.00 or later

FX3G Ver.1.10 or later

FX3GC Ver.1.40 or later

FX3U Ver.2.20 or later Ver.2.32 or later

Applied Instructions (Block Data Operation)

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 716 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 716 · click to enlarge
Page 716

30 Applied Instructions (External Device Communication)

30.3 IVRD / Inverter Parameter Read

30.3 IVRD / Inverter Parameter Read

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads an inverter parameter to the PLC using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K12) instruction in the FX2N and FX2NC series PLCs.

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 716)
Fig. 664 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 716)
Fig. 665 · 2. Set data

*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 716)
Fig. 666 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 717 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700
Page 717 · click to enlarge
Page 717

30 Applied Instructions (External Device Communication)

30.3 IVRD / Inverter Parameter Read

Function and operation explanation

Applied Instructions (Real Time Clock Control)

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. 16-bit operation (IVRD) The value of the parameter in the device specified by is read from an inverter connected to a communication port n whose station number is in the device specified by , and output to the device specified by .

IVRD EN ENO

Inverter station number Inverter parameter number

d s1 s2 n

Device storing the read value

Channel to be used

Applied Instructions (Extension Function)

2. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*1

M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence

M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

Applied Instructions (Block Data Operation)

*1. Cleared when PLC power supply is turned from OFF to ON.

*2. Cleared when the PLC mode switches from STOP to RUN.

*3. Initial value-1

Applied Instructions (Character String Control)

Cautions

→ For other cautions, refer to the Data Communication Edition manual.

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR *1 or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

3. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR *1 and IVMC) can be driven for the same port at the same time.
4. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Data Comparison)

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

PLC applicable version

Applied Instructions (Data Table Operation)

The table below shows PLC versions applicable to each inverter.

PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700

FX3S Ver.1.00 or later

FX3G Ver.1.10 or later

FX3GC Ver.1.40 or later

FX3U Ver.2.20 or later Ver.2.32 or later

Applied Instructions (External Device Communication)

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

Show 6 more labels / short text on this page
Command input · Number · Number · Description · Applied Instructions (Others) · step*2*3
Page 718 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 718 · click to enlarge
Page 718

30 Applied Instructions (External Device Communication)

30.4 IVWR / Inverter Parameter Write

30.4 IVWR / Inverter Parameter Write

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes a parameter of an inverter using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K13) instruction in the FX2N and FX2NC series PLCs.

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 718)
Fig. 667 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 718)
Fig. 668 · 2. Set data

Set value to be written to the inverter parameter or device storing the data to be set ANY16

*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 718)
Fig. 669 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 719 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 719 · click to enlarge
Page 719

30 Applied Instructions (External Device Communication)

30.4 IVWR / Inverter Parameter Write

Function and operation explanation

Applied Instructions (Real Time Clock Control)

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. 16-bit operation (IVWR)

A value specified in the device specified by is written to a parameter in the device specified by in an inverter connected to a communication port n whose station number is in the device specified by .

IVWR EN ENO s1 s2

Inverter station number Inverter parameter number

Set value to be written to the inverter parameter

or device storing the data to be set

n Channel to be used

Applied Instructions (Extension Function)

*1. Mitsubishi Electric's FREQROL - F700, A700, E700, D700, V500, F500, A500, E500 and S500 series general purpose inverters

2. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2

Applied Instructions (Block Data Operation)

M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence

M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

*1. Cleared when PLC power supply is turned from OFF to ON.

*2. Cleared when the PLC mode switches from STOP to RUN.

Applied Instructions (Character String Control)

*3. Initial value-1

Cautions

→ For other cautions, refer to the Data Communication Edition manual.

1. The instruction is provided in the FX 3G PLC Ver. 1.10 or later.
2. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR *1 or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

Applied Instructions (Data Comparison)

3. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR *1 and IVMC) can be driven for the same port at the same time.
4. Cautions on using the password function in the D700 Series. a) When a communication error occurs

When a communication error occurs in an inverter communication instruction, the FX PLC automatically retries communication up to 3 times*2. Accordingly, note that the number of times of password reset error displayed in accordance with the setting of Pr297 may not agree with the actual number of times of password input error as described below when a password reset error occurs in the D700 Series in which "display of the number of times of password reset error"*3 is made valid using Pr297. Do not execute automatic retry (re-driving of an inverter instruction) using a sequence program when writing data to Pr297.

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 7 more labels / short text on this page
Command input · s3 · Applied Instructions (Others) · Number · Number · Description · step*2*3
Page 720 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700
Page 720 · click to enlarge
Page 720

30 Applied Instructions (External Device Communication)

30.4 IVWR / Inverter Parameter Write

Cases in which a password reset error occurs in an inverter communication instruction, and the actual number of times of reset error in such cases. - When a wrong password is written to Pr297 due to a password input error When the writing instruction is executed once, a password reset error occurs 3 times. - When the password cannot be written correctly to Pr297 due to noise, etc. A password reset error occurs up to 3 times. b) When registering the password

When registering the password in the D700 Series inverter using an inverter communication instruction, write the password to Pr297, read Pr297, and then confirm that registration of the password is completed normally*4. If writing of the password to Pr297 is not completed normally due to noise, etc., the FX PLC automatically retries writing, and the registered password may be reset by the retry.

5. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

*2. The FX PLC executes the first communication, and then retries communication twice (3 time in total).

*3. When "display of the number of times of password reset error" is made valid in the D700 Series using Pr297 and when a password reset error occurs 5 times, the "reading/writing restriction" cannot be reset even if the right password is input. For recovery from this status, it is necessary to all-clear all parameters in the D700 Series.

*4. When the value given as a result of reading Pr297 is "0" to "4", registration of the password is completed normally.

PLC applicable version

The table below shows PLC versions applicable to each inverter.

PLC FREQROL-V500/F500/A500/E500/S500 FREQROL-F700/A700 FREQROL-E700/D700

FX3S Ver.1.00 or later

FX3G Ver.1.10 or later

FX3GC Ver.1.40 or later

FX3U Ver.2.20 or later Ver.2.32 or later

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

Page 721 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 30.5 IVBWR / Inverter Parameter Block Write
Page 721 · click to enlarge
Page 721
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 30.5 IVBWR / Inverter Parameter Block Write diagram (page 721)
Fig. 670 · 30.5 IVBWR / Inverter Parameter Block Write

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes parameters of an inverter at one time using the computer link operation function of the inverter.

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.

Number of parameters in an inverter to be written at one time. ANY16

Head device of a parameter table to be written to an inverter ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 722 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — PLC pplicable version
Page 722 · click to enlarge
Page 722

30 Applied Instructions (External Device Communication)

30.5 IVBWR / Inverter Parameter Block Write

Function and operation explanation

→ For detailed explanation of the instruction, refer to the Data Communication Edition manual. 1. 16-bit operation (IVBWR)

A data table*1 (parameter numbers and set values) specified in and is written to an inverter connected to a communication port n whose station number is in the device specified by all at once.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 722)
Fig. 671 · Function and operation explanation

Number of parameters in an inverter to be written at one time. Head address of a parameter table to be written to an inverter

*1. The table below shows the data table format.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 722)
Fig. 672 · Function and operation explanation

: Number of parameters to be written : Head device number of data table

Device Parameter numbers to be written and set values

2. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Number Description Number Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2

M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence

M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1

Cautions

→ For other cautions, refer to the Data Communication Edition manual.

1. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction
2. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR and IVMC) can be driven for the same port at the same time.

PLC pplicable version

The table below shows PLC versions applicable to each inverter.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — PLC pplicable version diagram (page 722)
Fig. 673 · PLC pplicable version

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

step*2*3

Page 723 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 723 · click to enlarge
Page 723

30 Applied Instructions (External Device Communication)

30.6 IVMC / Inverter Multi Command

30.6 IVMC / Inverter Multi Command

Applied Instructions (Real Time Clock Control)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes 2 types of settings (operation command and set frequency) to the inverter, and reads 2 types of data (inverter status monitor, output frequency, etc.) from the inverter at the same time. → For detailed explanation of the instruction, refer to the Data Communication Edition manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension Function)

IVMC EN ENO

IVMC 16 bits Continuous IVMC(EN,s1,s2,s3,n,d);

d s1 s2 s3 n

2. Set data

Variable Description Data type

EN Execution condition Bit

Inverter station number (K0 to K31) ANY16

Applied Instructions (Block Data Operation)

Multiple instructions for inverterSend/receive data type specification ANY16

Head device which stores data to be written to the inverter (Occupies 2 points.)

ARRAY[0..1] OF ANY16

Channel to be used (K1ch1, K2: ch2 *1 ) ANY16

ENO Execution state Bit

Applied Instructions (Character String Control)

Head device which stores values to be read from the inverter (Occupies 2 points.)

ARRAY[0..1] OF ANY16

*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z S1 S2 z z z

z S1 S2 z z z

z S1 S2 z

Applied Instructions (Data Comparison)

z S1 S2 z

S: Refer to "Cautions".

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · Applied Instructions (Others) · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · z z
Page 724 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — H0000
Page 724 · click to enlarge
Page 724

30 Applied Instructions (External Device Communication)

30.6 IVMC / Inverter Multi Command

Function and operation explanation

1. 16-bit operation This instruction executes multiple commands of an inverter connected to a communication port n whose station number is specified by the device specified in . Specify the send/receive data type using , the head device which stores data to be written to the inverter using , and the head device which stores values to be read from the inverter using . → For detailed explanation of the instruction, refer to the Data Communication Edition manual.

IVMC EN ENO s1 d s2 s3 n

Head device which stores values to be read from the inverter

Send/receive data type Head device which stores data to be written to the inverter

Channel to be used

2. Send/recive data type The table below shows valid send data 1 and 2 and receive data 1 and 2 specified by the send/receive data type specified in .

Send data (Write contents to Inverter)

Recive data (Read contents from Inverter)

Data 1 ( ) Data 2 ( +1) Data 1 ( ) Data 2 ( +1)

H0000

H0010 Set frequency (RAM, EEPROM)

3. Related devices → For the instruction execution complete flag use method, refer to Section 1.3.4.

Description ch1 ch2 ch1 ch2

M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1

M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1

M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3

M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2

Latch of inverter communication error occurrence

M8153 M8158 Inverter communication error latch*2 D8153 D8158

M8154 M8159 IVBWR inverter instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3

*1. Cleared when PLC power supply is turned from OFF to ON.

*2. Cleared when the PLC mode switches from STOP to RUN.

*3. Initial value-1
Show 17 more labels / short text on this page
Command input · Inverter station number · Send/receive data type · specified in · Output frequency (speed) · Set frequency (RAM) · H0001 Special monitor · Run command · Inverter status monitor · (expansion) · (expansion) · Output frequency (speed) · H0011 Special monitor · Number · Number · Description · step*2*3
Page 725 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Applicable inverters
Page 725 · click to enlarge
Page 725

30 Applied Instructions (External Device Communication)

30.6 IVMC / Inverter Multi Command

Cautions

Applied Instructions (Real Time Clock Control)

1. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.70 or later. The instruction is provided in the FX 3G PLC Ver. 1.40 or later.
2. It is not permitted to use an "IVCK, IVDR, IVRD, IVWR, IVBWR *1 or IVMC" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction.

3. Two or more inverter communication instructions (IVCK, IVDR, IVRD, IVWR, IVBWR *1 and IVMC) can be driven for the same port at the same time.
4. Two devices are occupied respectively from the devices specified in and . Make sure not to use such devices as to be used for other controls.

Applied Instructions (Extension Function)

5. If a device number outside the allowable range due to indexing, etc. is specified in , the receive data from the inverter is not stored in devices specified in . However, values set in and +1 may be written to the inverter.
6. If any unspecified value is set in , unexpected data may be written to or read from the inverter, and values stored in and +1 may be updated.
7. IVMC instruction reads the inverter status at the time of communication with the inverter, and stores the read status to the device specified in . Accordingly, the status written by IVMC instruction can be read by a next or later read instruction (IVCK or IVMC).
8. Some restrictions to applicable devices S 1: The FX 3G , FX 3GC , FX 3U and FX 3UC PLCs only are applicable. S 2: The FX 3U and FX 3UC PLCs only are applicable.

Applied Instructions (Block Data Operation)

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

Applicable inverters

This instruction is applicable to the following inverters:

- FREQROL-E700 (February 2009 and later) - FREQROL-D700 (Applicable in all)

Applied Instructions (Character String Control)

Applied Instructions (Data Comparison)

Applied Instructions (Data Table Operation)

Applied Instructions (External Device Communication)

Applied Instructions (Others)

Page 726 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 726 · click to enlarge
Page 726

30 Applied Instructions (External Device Communication)

30.7 ADPRW / MODBUS Read/Write

30.7 ADPRW / MODBUS Read/Write

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction allows the MODBUS Master to communicate (read/write data) with its associated Slaves.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 726)
Fig. 674 · 1. Format and operation, execution form

ADPRW 16 bits Continuous ADPRW (EN, s, s1, s2, s3, s4)

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 726)
Fig. 675 · 2. Set data

Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY16

Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY16

Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY_SIMPLE

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 726)
Fig. 676 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z z S1 z S1 S2 z z z

S : Refer to "Cautions".

Function and operation explanation

1. 16-bit operation

Command Code is operated on Slave Node according to Parameters , and . Use 0 as the Slave Node Address for Broadcast commands.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 726)
Fig. 677 · Function and operation explanation

Slave Node Address K0 to K32 (00H to 20H)

Command Parameters depending on the Command Code s3 s4

Page 727 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 30.7.1 Command Code and Parameters
Page 727 · click to enlarge
Page 727

30 Applied Instructions (External Device Communication)

30.7 ADPRW / MODBUS Read/Write

Cautions

Applied Instructions (Real Time Clock Control)

1. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.40 or later. The instruction is provided in the FX 3G PLC Ver. 1.30 or later.
2. It is not permitted to use an "ADPRW" instruction and a following instruction for the same port: - "RS or RS2" instruction

- "IVCK, IVDR, IVRD, IVWR, IVBWR*1, IVMC" instruction

- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction

3. Some restrictions to applicable devices S 1: Excluding special auxiliary relays (M) and Special data register (D). S 2: The FX 3U and FX 3UC PLCs only are applicable.

*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

Applied Instructions (Extension Function)

30.7.1 Command Code and Parameters

The following table shows the required command parameters for each command code.

PLC Destination Device (head address)

MODBUS Address0000H to FFFFH Device Count: 1 to 2000

Applicable Devices D, R, M, Y, S

Block Length ( +15) ÷16*2

2H Read Discrete Inputs

PLC Destination Device (head address)

MODBUS Address0000H to FFFFH Device Count: 1 to 2000

Applicable Devices D, R, M, Y, S

Block Length ( +15) ÷16*2

PLC Destination Device (head address)

Applied Instructions (Block Data Operation)

3H Read Holding Register

MODBUS Address0000H to FFFFH Device Count: 1 to 125

Applicable Devices D, R

PLC Destination Device (head address)

4H Read Input Register

MODBUS Address0000H to FFFFH Device Count: 1 to 125

Applicable Devices D, R

Applied Instructions (Character String Control)

PLC Sourse Device (head address)

D, R, K, H, X, Y, M, S (D, R, X, Y, M, S can be indexed.)

5H Write Single Coil

MODBUS Address0000H to FFFFH 0 (fixed)

Block Length 1 Point

PLC Source Device (head address)

6H Write Single Register

MODBUS Address0000H to FFFFH 0 (fixed)

Applicable Devices D, R, K, H (D, R can be indexed.)

Block Length 1 Point

7H Read Exception State (Available only in FX3U and FX3UC PLCs)

PLC Destination Device (head address)

0 (fixed) 0 (fixed)

Applicable Devices D, R

Block Length 1 Point

Applied Instructions (Data Comparison)

Sub-function0H Loop-back Test
Sub-function Data (loop-back data)0 to 65535
(Slave responseecho of )

Applicable Devices D, R

Block Length 1 Point

8H Diagnosis (Available only in FX3U and FX3UC PLCs)

Sub-function Data0x0000: Do Not Reset Event Log 0xFF00: Reset Event Log
Sub-function1H Restart Communication
(Slave responseecho of )

Applicable Devices D, R

Applied Instructions (Data Table Operation)

Block Length 1 Point

Sub-function2H Return Diagnostic Register

PLC Destination Device (head address)

Applicable Devices D, R

Block Length 1 Point *2. This calculation formula is applicable when the applicable device is D or R.

Applied Instructions (External Device Communication)

Show 7 more labels / short text on this page
Applied Instructions (Others) · 1H Read Coils · Block Length · Block Length · Applicable Devices · Loop-back Test Data · 0 (fixed)
Page 728 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 30.7.1 Command Code and Parameters
Page 728 · click to enlarge
Page 728

30 Applied Instructions (External Device Communication)

30.7 ADPRW / MODBUS Read/Write

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 30.7.1 Command Code and Parameters diagram (page 728)
Fig. 678 · 30.7.1 Command Code and Parameters

Sub-function Data (ASCII Mode End of Message Character): 00H to FFH

8H Diagnosis (Available only in FX3U and FX3UC PLCs)

BH Get Comm. Event Counter (Available only in FX3U and FX3UC PLCs)

CH Get Comm. Event Log (Available only in FX3U and FX3UC PLCs)

  • +4 to 35: Up to 64 Bytes Event Log

D, R, K, H, M, X, Y, S (D, R, M, X, Y, S can be indexed.)

MODBUS Address0000H to FFFFH Device Count: 1 to 1968

*1. This calculation formula is applicable when the applicable device is D or R.

Page 729 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 30.7.1 Command Code and Parameters
Page 729 · click to enlarge
Page 729
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 30.7.1 Command Code and Parameters diagram (page 729)
Fig. 679 · 30.7.1 Command Code and Parameters
MODBUS Address0000H to FFFFH Device Count: 1 to 123

Applicable Devices D, R, K, H (D, R can be indexed.)

11H Report Slave ID (Available only in FX3U and FX3UC PLCs)

16H Mask Write Register (Available only in FX3U and FX3UC PLCs)

MODBUS Address0000H to FFFFH AND Mask: 0000H to FFFFH

Applicable Devices D, R, K, H (D, R can be indexed.)

17H Read/Write Multiple Registers (Available only in FX3U and FX3UC PLCs)

Page 730 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 31. Applied Instructions (Data Transfer 3)
Page 730 · click to enlarge
Page 730

31 Applied Instructions (Data Transfer 3)

31. Applied Instructions (Data Transfer 3)

This chapter introduces the instructions for executing more complicated processing for fundamental applied instructions and for special processing.

Instruction name Function Reference

RBFM Divided BFM Read Section 31.1

WBFM Divided BFM Write Section 31.2

Page 731 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 731 · click to enlarge
Page 731

31 Applied Instructions (Data Transfer 3)

31.1 RBFM / Divided BFM Read

31.1 RBFM / Divided BFM Read

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

This instruction reads data from continuous buffer memories (BFM) in a special function block and unit over several operation cycles by the time division method. This instruction is convenient for reading received data, etc. stored in buffer memories in a special function block and unit for communication by the time division method. FROM instruction is also available to read the buffer memory (BFM) data.

→ For FROM instruction, refer to Section 14.8.

1. Format and operation, execution form

Applied Instructions (Extension File Register Control)

Expression in each language

RBFM EN ENO m1 m2 n1 n2

RBFM 16 bits Continuous BFM(EN,m1,m2,n1,n2,d);

Applied Instructions (FX3U-CF-ADP)

2. Set data

Variable Description Data type

Interrupt Function and Pulse Catch Function

EN Execution condition Bit

Unit number [0 to 7] ANY16

Head buffer memory (BFM) number ANY16

Number of all buffer memories (BFM) to be read [1 to 32767] ANY16

A

Number of points transferred in one operation cycle [1 to 32767] ANY16

Relationships between devices and addresses

ENO Execution state Bit

Head device storing data to be read from buffer memory (BFM) ANY16

3. Applicable devices

B

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

z

z

S1 z z

S: Refer to "Cautions".

Show 15 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · Applied Instruction List · type · user · tant
Page 732 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 732 · click to enlarge
Page 732

31 Applied Instructions (Data Transfer 3)

31.1 RBFM / Divided BFM Read

Function and operation explanation

1. 16-bit operation (RBFM) "n1" buffer memory (BFM) units at location No. "m2" in special function block/unit No. "m1" are transferred (read) to the device specified by in the PLC. While transferring, "n1" is divided by "n2" so n1/n2 buffer memories (rounded up when there is a remainder) are transferred per scan time.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 732)
Fig. 680 · Function and operation explanation

Head device storing data to be read from buffer memory (BFM)

Number of all buffer memories (BFM) to be read Number of points transferred in one

"n2" buffer memories are read in each operation cycle. Reading is executed in "n1/n2" times. ("n1/n2" is rounded up if it is not an integer.)

1. When the instruction is finished normally, the instruction execution complete flag M8029 turns ON. When the instruction is finished abnormally, the instruction execution abnormally complete flag M8329 turns ON.
2. When RBFM or WBFM instruction in another step is executed for the same unit number, the instruction non-execution flag M8328 is set to ON, and execution of such an instruction is paused. When execution of the other target instruction is complete, the paused instruction resumes.

Related devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related devices diagram (page 732)
Fig. 681 · Related devices

M8029 Instruction execution complete Turns ON when an instruction is finished normally.

M8328 Instruction non-execution Turns ON when RBFM or WBFM instruction in another step is executed for the same unit number.

mally complete Turns ON when an instruction is finished abnormally.

Related instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instructions diagram (page 732)
Fig. 682 · Related instructions

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
2. Some restrictions to applicable devices S 1: Except special data register D

Error

An operation error is caused in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the unit number "m1" does not exist. (Error code: K6708)
Page 733 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 733 · click to enlarge
Page 733

31 Applied Instructions (Data Transfer 3)

31.1 RBFM / Divided BFM Read

31.1.1 Common items between RBFM instruction and WBFM instruction

Applied Instructions (Data Transfer 3)

Specification of unit number of special function block and unit and buffer memory → For the connection method of special extension units and blocks, number of connectable units and

blocks, and handling of I/O numbers, refer to the manual of the PLC used and special function block

and unit.

1. Unit number "m1" of a special extension unit and block Use the unit number to specify to which equipment the RBFM and/or WBFM instruction works. Setting range: K0 to K7

Applied Instructions (High Speed Processing 2)

Unit No.0 Built-in CC-Link/LT

Unit No.1

Unit No.2

Unit No.3

Applied Instructions (Extension File Register Control)

FX3UC-32MT-LT(-2) Main unit

A unit number is automatically assigned to each special extension unit and block connected to the PLC. The unit number is assigned in the way "No. 0 → No. 1 → No. 2 ..." starting from the equipment nearest to the main unit. Since the FX3UC-32MT-LT(-2) PLC has a built-in CC-Link/LT master, the unit number is given "No. 1 → No. 2 → No. 3 ..." from the equipment nearest to the main unit.

Applied Instructions (FX3U-CF-ADP)

2. Buffer memory (BFM) number "m2" Up to 32767 16-bit RAM memories are built in a special extension unit and block, and they are called buffer memories (BFM). The buffer memory number is from "0" to "32766", and the contents are determined according to each special function unit and block. Setting range: K0 to K32766

Interrupt Function and Pulse Catch Function

→ For the contents of buffer memories, refer to the manual of the special function block and unit

used.

A

Relationships between devices and addresses

B

Show 11 more labels / short text on this page
I/O extension · Special extension · Special extension · I/O extension · Special extension · block · block · block · block · block · Applied Instruction List
Page 734 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 734 · click to enlarge
Page 734

31 Applied Instructions (Data Transfer 3)

31.1 RBFM / Divided BFM Read

Cautions

1. A watchdog timer error may occur when many numbers of points are transferred in one operation cycle. In such a case, take either of the following countermeasures. a) Change the watchdog timer time

By overwriting the contents of D8000 (watchdog timer time), the watchdog timer detection time is changed (initial value: K200). When the program shown below is input, the sequence program will be monitored with the new watchdog timer time.

M8002

Watchdog timer time300ms

K300 D8000

WDT EN ENO

Watchdog timer refresh When WDT (FNC07) instruction is not programmed, the value of D8000 becomes valid during END processing.

b) Change the number of transferred points "n2" in each operation cycle.

Change the number of transferred points "n2" in each operation cycle to a smaller value.

2. Do not stop the driving of the instruction while it is being executed. If driving is stopped, the buffer memory (BFM) reading/writing processing is suspended, but the data acquired in the middle of reading/ writing processing is stored in the device specified by and later and buffer memories (BFM).

SET EN ENO

M

M

RBFM EN ENO m1 m2

Unit number Head BFM number

Head device storing data to be read from buffer memory (BFM)

Number of all buffer memories

(BFM) to be read

Number of points transferred

in one operation cycle

M8029

RST EN ENO

M

3. When indexing is executed, the contents of index registers at the beginning of execution are used. Even if the contents of index registers are changed after the instruction is executed, such changes do not affect the process of the instruction.
4. The contents of "n1" devices starting from the device specified by change while RBFM instruction is executed. After execution of the instruction is completed, execute another instruction for "n1" devices starting from the device specified by .
5. Do not update (change) the contents of "n1" devices starting from the device specified by while WBFM instruction is executed. If the contents are updated, the intended data may not be written to the buffer memories (BFM).
6. Do not update (change) the contents of "n1" buffer memories (BFM) starting from the buffer memory NO. "m2" while RBFM instruction is executed. If the contents are updated, the intended data may not be read.
7. RBFM instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
Show 7 more labels / short text on this page
MOV EN s · Initial pulse · LDP EN s · ENO Command input · n1 · n2 · Instruction execution complete
Page 735 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 31.1.1 Common items between RBFM instruction and WBFM instruction
Page 735 · click to enlarge
Page 735
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 31.1.1 Common items between RBFM instruction and WBFM instruction diagram (page 735)
Fig. 683 · 31.1.1 Common items between RBFM instruction and WBF…

In the program example shown below, data is read from and written to the buffer memories (BFM) in the unit No. 2 as follows:

1. When X000 is set to ON, data stored in D100 to D179 (80 points) are written to the buffer memories (BFM) #1001 to #1080 in the special function block and unit whose unit number is No. 2 by 16 points in each operation cycle.

The BFM write start flag is set to ON.

M0 WBFM EN ENO m1 m2 s n1 n2

D100 to D179 (80 points) are written to the buffer memories #1001 to #1080 in the unit No. 2 (in 5 operation cycles).

The BFM write start flag is set to OFF.

The BFM write start flag is set to OFF.

Page 736 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8329
Page 736 · click to enlarge
Page 736

31 Applied Instructions (Data Transfer 3)

31.1 RBFM / Divided BFM Read

2. When X001 is set to ON, the buffer memories (BFM) #2001 to #2080 (80 points) in the special function block and unit whose unit number is No. 2 are written to D200 to D279 by 16 points in each operation cycle.

[ST]

SET(LDP(TRUE,X001),M5);

SET EN ENO

RBFM(M5,K2,K2001,K80,K16,D200);

RST(M5 AND M8029,M5);

The BFM read start flag is set to ON.

Y001:=M5 AND M8328;

RST(M5 AND M8329,M5);

M5 RBFM EN ENO m1 m2 n1 n2

K2 K2001

K80 K16

The buffer memories #2001 to #2080 (80 points) in the unit No. 2 are read to D200 to D279 (in 5 operation cycles).

RST EN ENO

M8029

The BFM read start flag is set to OFF.

M8328

Execution of the RBFM instruction is waited.

M8329

RST EN ENO

Instruction execution abnormally complete

The BFM read start flag is set to OFF.

Show 10 more labels / short text on this page
[Structured ladder/FBD] · LDP EN s · d M5 · BFM read start · d D200 · BFM read start · Instruction execution complete · d M5 · Y001 Instruction non-execution · d M5
Page 737 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 737 · click to enlarge
Page 737

31 Applied Instructions (Data Transfer 3)

31.2 WBFM / Divided BFM Write

31.2 WBFM / Divided BFM Write

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

This instruction writes data to continuous buffer memories (BFM) in a special function block and unit over several operation cycles by the time division method. This instruction is convenient for writing send data, etc. to buffer memories in a special function block and unit for communication by the time division method. TO instruction is also available for writing data to the buffer memory (BFM).

→ For TO instruction, refer to Section 14.9.

1. Format and operation, execution form

Applied Instructions (Extension File Register Control)

Expression in each language

WBFM EN ENO m1 m2 s n1 n2

Applied Instructions (FX3U-CF-ADP)

WBFM 16 bits Continuous WBFM(EN,m1,m2,s,n1,n2);

2. Set data

Interrupt Function and Pulse Catch Function

Variable Description Data type

EN Execution condition Bit

Head buffer memory (BFM) number ANY16

A

Head device storing data to be written to buffer memory (BFM) ANY16

Relationships between devices and addresses

Number of all buffer memories (BFM) to be written ANY16

Number of points transferred in one operation cycle ANY16

Output variable ENO Execution state ANY16

B

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

S1 z z

z

z

S: Refer to "Cautions".

Show 15 more labels / short text on this page
Instruction · name Operation Execution · form · Unit number ANY16 · Input variable · Applied Instruction List · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant
Page 738 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 738 · click to enlarge
Page 738

31 Applied Instructions (Data Transfer 3)

31.2 WBFM / Divided BFM Write

Function and operation explanation

1. 16-bit operation (WBFM)

"n1" word units from the device specified by in the PLC are transferred (written) to buffer memory (BFM) location No. "m2" in special function unit and block No. "m1". While transferring, "n1" is divided by "n2" so n1/ n2 words (rounded up when there is a remainder) are transferred per scan time.

→ For the unit number, buffer memory (BFM) number, cautions and program example, refer to

Section 31.1.1.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 738)
Fig. 684 · Function and operation explanation

Unit number Head BFM number Number of all buffer memories

"n2" points are written in each operation cycle. Writing is executed in "n1/n2" times. ("n1/n2" is rounded up if it is not an integer.)

1. When the instruction is finished normally, the instruction execution complete flag M8029 turns ON. When the instruction is finished abnormally, the instruction execution abnormally complete flag M8329 turns ON.
2. When RBFM or WBFM instruction in another step is executed for the same unit number, the instruction non-execution flag M8328 is set to ON, and execution of such an instruction is paused. When execution of the other target instruction is complete, the paused instruction resumes.

Related devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related devices diagram (page 738)
Fig. 685 · Related devices

M8029 Instruction execution complete Turns ON when an instruction is finished normally.

M8328 Instruction non-execution Turns ON when RBFM or WBFM instruction in another step is executed for the same unit number.

mally complete Turns ON when an instruction is finished abnormally.

Related instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Related instructions diagram (page 738)
Fig. 686 · Related instructions

Cautions

1. The instruction is provided in the FX 3UC PLC Ver. 2.20 or later.
2. Some restrictions to applicable devices S 1: Except special data register D

Error

An operation error is caused in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the unit number "m1" does not exist. (Error code: K6708)
Page 739 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 739 · click to enlarge
Page 739

32 Applied Instructions (High Speed Processing 2)

Applied Instructions (Data Transfer 3)

32. Applied Instructions (High Speed Processing 2)

Instruction name Function Reference

DHSCT High Speed Counter Compare With Data Table Section 32.1

Applied Instructions (High Speed Processing 2)

Applied Instructions (Extension File Register Control)

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

A

Relationships between devices and addresses

B

Applied Instruction List

Page 740 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 740 · click to enlarge
Page 740

32 Applied Instructions (High Speed Processing 2)

32.1 DHSCT / High Speed Counter Compare With Data Table

32.1 DHSCT / High Speed Counter Compare With Data Table

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction compares the current value of a high speed counter with a data table of comparison points, and then sets or resets up to 16 output devices.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 740)
Fig. 687 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 740)
Fig. 688 · 2. Set data

Number of comparison points in data table (1 ≤ m ≤ 128) ANY32

Number of devices to which the operation status is output ANY32

Head device to which the operation status is output Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 740)
Fig. 689 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

S: Refer to "Cautions".

Page 741 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — :ON :OFF
Page 741 · click to enlarge
Page 741

32 Applied Instructions (High Speed Processing 2)

32.1 DHSCT / High Speed Counter Compare With Data Table

Function and operation explanation

Applied Instructions (Data Transfer 3)

1. 32-bit operation (DHSCT)

The current value of a high speed counter specified in is compared with the data table shown below which has "m" points stored in the device specified by and later, and the operation output set value (ON or OFF) specified in the data table is output to the devices specified by .

Applied Instructions (High Speed Processing 2)

DHSCT EN ENO s1 m s2 n

Head device storing the data table Number of comparison points in data table

Head device to which the operation status is output

High speed counte (C235 to C255)

Number of devices to which the operation status is output

Applied Instructions (Extension File Register Control)

Data table used for comparison

Comparison point number Comparison data Operation output set value

(SET [1] or RESET [0]) Operation output destination

Applied Instructions (FX3U-CF-ADP)

1 +4, +3 +5

2 +7, +6 +8

m-2 +3m-5, +3m-6 +3m-4

m-1 +3m-2, +3m-3 +3m-1

Interrupt Function and Pulse Catch Function

Operation output set value (SET [1] or RESET [0]) [Up to 16 points]

A 7 1 6

Operation output setting 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0

A

Operation output setting = HA716 When the current value of the high speed counter becomes equivalent to the comparison value, the operation output setting pattern is output. In the case of " = Y000, n = K10"

Relationships between devices and addresses

:ON :OFF

Y 0 1 1

Y 0 1 0

Y 0 0 7

Y 0 0 6

Y 0 0 5

Y 0 0 4

Y 0 0 3

Y 0 0 2

Y 0 0 1

Y 0 0 0

B

+ n-1 d d

1. When this instruction is executed, the uppermost data table of the data tables is set as the comparison target.

2) When the current value of the high speed counter, specified in , becomes equivalent to the comparison value in the data table, the corresponding operation output specified in the data table is output to the device specified by . If an output (Y) is specified in , the output processing is executed immediately without waiting for the output refresh executed by the END instruction. When specifying and output (Y), make sure that the least significant digit of the device number is "0". Examples: Y000, Y010 and Y020

3. Immediately after step 2), "1" is added to the current table counter value D8138.
4. The next comparison point is set as the comparison target data.
5. Steps 2) and 3) are repeated until the current value of the table counter D8138 becomes "m". When the current value becomes "m", the instruction execution complete flag M8138 turns ON, and the execution returns to step 1). At this time, the table counter D8138 is reset to "0".
6. When the command contact is set to OFF, execution of the instruction is stopped and the table counter D8138 is reset to "0".
Show 4 more labels / short text on this page
Command input · 0 +1, +2 · to +n-1 · Applied Instruction List
Page 742 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation example
Page 742 · click to enlarge
Page 742

32 Applied Instructions (High Speed Processing 2)

32.1 DHSCT / High Speed Counter Compare With Data Table

Operation example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation example diagram (page 742)
Fig. 690 · Operation example

4 D213, D212 K800 D214 H0003 4↓ (repeated from "0")

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation example diagram (page 742)
Fig. 691 · Operation example

Because DHSCT instruction is not executed, the operation outputs are not changed by this instruction.

*1. If this instruction is not executed, no processing is executed for outputs. In the operation example shown above, the command contact is "OFF".

Page 743 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 743 · click to enlarge
Page 743

32 Applied Instructions (High Speed Processing 2)

32.1 DHSCT / High Speed Counter Compare With Data Table

2. Related devices

Applied Instructions (Data Transfer 3)

M8138 DHSCT Instruction execution complete flag Turns ON when the operation for the final table No. "m-1" is completed.

D8138 DHSCT Table counter Stores the comparison point number handled as the comparison target.

Cautions

Applied Instructions (High Speed Processing 2)

1. This instruction can be executed only once in a program. If this instruction is programmed two or more times, an operation error is caused by the second instruction and later, and the instruction will not be executed.
2. This instruction constructs the data table at the END instruction after the first execution of the instruction. Accordingly, the operation output works after the second scan and later.
3. With regard to DHSCT, DHSCS, DHSCR and DHSZ instructions, up to 32 instructions can be executed in one operation cycle. An operation error is caused by the 33rd instruction and later, and the instruction will not be executed.

Applied Instructions (Extension File Register Control)

4. If an output (Y) is specified in , the output processing is executed immediately without waiting for the output refresh executed by END instruction. When specifying an output (Y), make sure that the least significant digit of the device number is "0". Examples: Y000, Y010 and Y020

Applied Instructions (FX3U-CF-ADP)

5. When a high speed counter specified in is indexed with index, all high speed counters are handled as software counters.

6) For this instruction, only one comparison point (one line) is handled as the comparison target at one time. Processing will not move to the next comparison point until the current counter value becomes equivalent to the comparison point currently selected as the comparison target. If the current value of a high speed counter executes up counting using the comparison data table shown in the operation example on the previous page, be sure to execute the instruction while the current value of the high speed counter is smaller than the comparison value in comparison point No. 1.

Interrupt Function and Pulse Catch Function

7. When this instruction operates in the FX 3U and FX 3UC PLCs, the hardware counters (C235, C236, C237, C238, C239, C240, C244(OP), C245(OP), C246, C248(OP), C251 and C253) switches automatically to software counters, and the maximum frequency and total frequency are affected.

A

Relationships between devices and addresses

8. Some restrictions to applicable devices S 1: Only high speed counters C235 to C255 are available for use.

Error

B

An operation error occurs in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When any devices other than high speed counters C235 to C255 are specified in . (Error code: K6706)
2. When the "3m-1"th device from a device specified in exceeds the last number of the device. (Error code: K6706)
3. When the "n"th device from a device specified in exceeds the last number of the device. (Error code: K6706)
4. When this instruction is used two or more times in a program. (Error code: K6705)
5. With regard to DHSCT, DHSCS, DHSCR and DHSZ instructions, up to 32 instructions can be executed in one operation cycle. An operation error is caused by the 33rd instruction and later, and the instruction will not be executed. (Error code: K6705)

Device Name Description · Applied Instruction List

Page 744 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation example
Page 744 · click to enlarge
Page 744

32 Applied Instructions (High Speed Processing 2)

32.1 DHSCT / High Speed Counter Compare With Data Table

Program example

In the program example shown below, the current value of C235 (counting X000) is compared with the comparison data table set in R0 and later, and a specified pattern is output to Y010 to Y013.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 744)
Fig. 692 · Program example

Operation example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation example diagram (page 744)
Fig. 693 · Operation example

4 R13, R12 K300 R14 H0008 4 ↓ (repeated from "0")

Page 745 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 745 · click to enlarge
Page 745

33 Applied Instructions (Extension File Register Control)

Applied Instructions (Data Transfer 3)

33. Applied Instructions (Extension File Register Control)

Instruction name Function Reference

LOADR

Applied Instructions (High Speed Processing 2)

Load From ER Section 33.1 LOADRP

SAVER Save to ER Section 33.2

INITR

Initialize R and ER Section 33.3 INITRP

LOGR

Logging R and ER Section 33.4 LOGRP

Applied Instructions (Extension File Register Control)

RWER

Rewrite to ER Section 33.5 RWERP

INITER

Initialize ER Section 33.6 INITERP

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

A

Relationships between devices and addresses

B

Applied Instruction List

Page 746 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 746 · click to enlarge
Page 746

33 Applied Instructions (Extension File Register Control)

33.1 LOADR / Load From ER

33.1 LOADR / Load From ER

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction reads the current values of extension file registers (ER) stored in a memory cassette (flash memory and EEPROM) or the file registers (ER) in the PLC's built-in EEPROM, and transfers them to extension registers (R) stored in the PLC's built-in RAM.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 746)
Fig. 694 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 746)
Fig. 695 · 2. Set data

Device of extension register (transfer destination) to which data is to be transferred. (The extension file register having the same number is handled as the transfer source.)

Number of points to be read (transferred) (FX3G/FX3GC: 1 ≤ n ≤ 24000, FX3U/FX3UC: 0 ≤ n ≤ 32767) ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 746)
Fig. 696 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 747 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — E
Page 747 · click to enlarge
Page 747

33 Applied Instructions (Extension File Register Control)

33.1 LOADR / Load From ER

Function and operation explanation

Applied Instructions (Data Transfer 3)

1. 16-bit operation (LOADR/LOADRP)

LOADRP EN ENO s n

Device of extension register to which data is to be transferred

Applied Instructions (High Speed Processing 2)

Number of points to be read (transferred)

1. For the FX 3U and FX 3UC PLCs The contents (current values) of extension file registers (ER) stored in a memory cassette (flash memory) having the same numbers with the extension registers specified by to +n-1 are read, and transferred to the extension registers (R) specified by to +n-1 stored in the PLC's built-in RAM.

Applied Instructions (Extension File Register Control)

Extension file registers (ER) inside memory cassette

Extension registers (R) inside built-in RAM

E

E +1

E +2

Applied Instructions (FX3U-CF-ADP)

E +3

Interrupt Function and Pulse Catch Function

- Reading and transfer are executed in units of device. Up to 32768 devices can be read and transferred. - Different from SAVER, INITR and LOGR instructions, it is not necessary to execute this instruction in units of sector. - If "n" is set to "0", it is handled as "32768" when the instruction is executed.

2. For the FX 3G and FX 3GC PLCs a) When connecting to a memory cassette (A memory cassette cannot be connected to FX 3GC PLC.)

A

The contents (current values) of extension file registers (ER) stored in a memory cassette (EEPROM) having the same numbers with the extension registers (R) specified by to +n-1 are read, and transferred to the extension registers specified by to +n-1 stored in the PLC's built-in RAM.

Relationships between devices and addresses

Extension file registers (ER) inside memory cassette

Extension registers (R) inside built-in RAM

B

E

E +1

E +2

E +3

- Reading and transfer are executed in units of device. Up to 24000 devices can be read and transferred.

Show 40 more labels / short text on this page
Command input · Read (transfer) · s s · s · s · +1 · +2 · s · s · s · s · +3 · E +n-2 · s · s · +n-2 · E +n-1 · s · s · +n-1 · Read (transfer) · Applied Instruction List · s s · +1 · s · s · s · s · +2 · s · s · +3 · E +n-2 · s · s · +n-2 · E +n-1 · s · s · +n-1
Page 748 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 748 · click to enlarge
Page 748

33 Applied Instructions (Extension File Register Control)

33.1 LOADR / Load From ER

b) When not connecting to a memory cassette

The contents (current values) of extension file registers (ER) stored in PLC's built-in EEPROM having the same numbers with the extension registers specified by to +n-1 are read, and transferred to the extension registers (R) specified by to +n-1 stored in the PLC's built-in RAM.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.1 LOADR / Load From ER diagram (page 748)
Fig. 697 · 33.1 LOADR / Load From ER

- Reading and transfer are executed in units of device. Up to 24000 devices can be read and transferred.

Cautions

1. About the allowable number of times of writing operations in memory Note the following when accessing the extension file registers:
  • For the FX 3U and FX 3UC PLCs The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions. The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.
  • For the FX 3G and FX 3GC PLCs The memory cassette (EEPROM) and PLC's built-in memory (EEPROM) allow up to 10,000 times and 20,000 times of writing operations, respectively. The number of times of writing operations counts up each time the RWER instruction is executed. Do not exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions. The number of times of writing operations does not count up when the LOADR instruction is executed.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the last device number to be transferred exceeds "32767" (error code: K6706). At this time, devices up to the last one (R32767) are read and transferred.
2. When a memory cassette is not connected. (Error code: K6771) *1

*1. This does not cause an error with the FX3G PLCs because the PLCs read the contents of the extension file registers stored in the PLC's built-in EEPROM when a memory cassette is not connected.

Page 749 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.1 LOADR / Load From ER
Page 749 · click to enlarge
Page 749
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.1 LOADR / Load From ER diagram (page 749)
Fig. 698 · 33.1 LOADR / Load From ER

In the program example shown below, the contents (current values) of 4000 extension file registers ER1 to ER4000 inside the memory cassette are read, and transferred to 4000 extension registers R1 to R4000 inside the built-in RAM.

Page 750 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 750 · click to enlarge
Page 750

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

33.2 SAVER / Save to ER

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction writes the current values of extension registers (R) stored in the PLC's built-in RAM to extension file registers (ER) stored in a memory cassette (flash memory) in units of sector (2048 points). RWER instruction provided in FX3UC PLCs Ver. 1.30 or later and FX3U PLCs writes (transfers) only arbitrary number of points. It is not necessary to execute INITR or INITER instruction every time when RWER instruction is used.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 750)
Fig. 699 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 750)
Fig. 700 · 2. Set data

Device of extension register to which data is to be written (Only the head device of a sector of extension registers can be specified.) ANY16

Number of points written (transferred) in one operation cycle. ANY16

Device storing the number of already written points ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 750)
Fig. 701 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 751 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 2. Related devices
Page 751 · click to enlarge
Page 751

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

Function and operation explanation

Applied Instructions (Data Transfer 3)

1. 16-bit operation (SAVER)

The contents (current values) of 2,048 extension registers (R) starting from the device specified by are written (transferred) to extension file registers (ER) inside a memory cassette (flash memory) having the same device numbers in "2048/n" operation cycles ("2048/n +1" cycles if there is the remainder). When the instruction is being executed, the number of already written points is stored in .

Applied Instructions (High Speed Processing 2)

d Device of extension register to which data is to be transferred

Device storing the number of already written points

Number of points written

in one operation cycle

Applied Instructions (Extension File Register Control)

M M8029 Operation execution complete flag

SAVER instruction operation complete flag

Applied Instructions (FX3U-CF-ADP)

Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM

E

E +1

E +2

Interrupt Function and Pulse Catch Function

E +2047

*1. "n" points are written (transferred) in each operation cycle.

A

(Number of points specified by ) n

Relationships between devices and addresses

1. Extension file registers are written in units of sector (2048 points). The table below shows the head device number in each sector.

Sector number Head device number Written device range Sector number Head device number Written device range

B

Sector 0 R0 ER0 to ER2047 Sector 8 R16384 ER16384 to ER18431

Sector 1 R2048 ER2048 to ER4095 Sector 9 R18432 ER18432 to ER20479

Sector 2 R4096 ER4096 to ER6143 Sector 10 R20480 ER20480 to ER22527

Sector 3 R6144 ER6144 to ER8191 Sector 11 R22528 ER22528 to ER24575

Sector 4 R8192 ER8192 to ER10239 Sector 12 R24576 ER24576 to ER26623

Sector 5 R10240 ER10240 to ER12287 Sector 13 R26624 ER26624 to ER28671

Sector 6 R12288 ER12288 to ER14335 Sector 14 R28672 ER28672 to ER30719

Sector 7 R14336 ER14336 to ER16383 Sector 15 R30720 ER30720 to ER32767

2. If "n" is set to "0", it is handled as "2048" when the instruction is executed.
3. When writing (transfer) of 2048 points is finished, execution of the instruction is completed and the instruction execution complete flag M8029 turns ON.
4. The number of already written points is stored in the device specified by .

2. Related devices

Device number Name Description

When execution of the target instruction is completed, the instruction execution complete flag M8028 turns ON. In a program, however, there may be two or more instructions which can use the flag M8029. To avoid confusion, be sure to use the NO (normally open) contact of this flag immediately under SAVER instruction so that this flag works only for SAVER instruction

Show 17 more labels / short text on this page
Command input · SAVER EN s · n · Write (transfer)*1 · s · s · s · +1 · s · s · +2 · s · s s · +2047 · Applied Instruction List · M8029 Instruction execution · complete
Page 752 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 752 · click to enlarge
Page 752

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

Cautions

1. Cautions on writing data to a memory cassette Memory cassettes adopt flash memory. Note the following contents when writing data to extension file registers in a memory cassettes with the SAVER instruction.
1. It takes about 340 ms to write all points (2048 points). If "n" is set to K0 or K2048, the operation cycle for executing this instruction becomes about 340 ms longer than normal. If the operation cycle is severely affected, write data in two or more operation cycles. When writing data in two or more operation cycles, set "n" in the range from K1 to K1024.
2. Do not abort execution of this instruction in the middle of operation. If execution is aborted, unexpected data may be written to extension file registers. If execution of this instruction is aborted by turning OFF the power, execute the instruction again using step [2] described on the next page after turning ON the power again.

SET EN ENO

M

M

INITERP EN ENO s

The same extension register device number as the extension file register device to be initialized

The number of sectors for the extension register

to be initialized and the extension file register

SAVER

Device of extension register to which data

Device storing the number of already written points

is to be transferred

Number of points written in one operation cycle

Operation execution complete flag

M8029

RST EN ENO

M

3. Execute INITER or INITR instruction to target extension file registers (ER) before executing SAVER instruction. If SAVER instruction is driven before INITER or INITR instruction is executed, an operation error (error code: K6770) may be caused. To avoid such an operation error, make a program for executing SAVER instruction in the following sequence

When the FX3U and FX3UC PLCs are Ver. 1.30 or later [1] When storing data of 2048 extension registers (R) in one sector to extension file register (ER).

a) Execute INITER instruction to extension file registers (ER) specified as targets in SAVER instruction. b) Execute SAVER instruction. [2] When storing the contents of an arbitrary number of extension registers (R) to extension file

registers (ER) Use RWER instruction.

→ For RWER instruction, refer to Section 33.5.

When the FX3UC PLCs are former than Ver. 1.30. [1] When storing data of 2048 extension registers (R) in one sector to extension file registers (ER)

If the extension registers (R) have data to be stored in extension file registers (ER), use the procedure [2]. a) Execute INITR instruction to extension registers (R) and extension file registers (ER) specified as

targets in SAVER instruction. b) Store data to extension registers (R) specified as targets. c) Execute SAVER instruction.

Show 4 more labels / short text on this page
Write command · n · EN ENO s · n
Page 753 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 753 · click to enlarge
Page 753

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

[2] When storing data of 2048 extension registers (R) in one sector to extension file registers (ER)

Applied Instructions (Data Transfer 3)

a) Temporarily withdraw the data of extension registers (R) specified as targets in SAVER instruction to

data registers or unused 2048 extension registers (R) by using BMOV instruction. b) Execute INITR instruction to extension registers (R) and extension file registers (ER) specified as

targets in SAVER instruction. c) Return the data of 2048 points temporarily withdrawn in step a) to extension registers (R) specified as

targets by using BMOV instruction. d) Execute SAVER instruction.

Applied Instructions (High Speed Processing 2)

2. About the allowable number of times of writing operations in memory Note the following when accessing the extension file registers:
  • The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions.

Applied Instructions (Extension File Register Control)

  • The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.

Applied Instructions (FX3U-CF-ADP)

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

Interrupt Function and Pulse Catch Function

1. When any device number other than the head device number of a sector of extension file registers is set to . (Error code: K6706)

A

2. When a memory cassette is not connected. (Error code: K6771)

Relationships between devices and addresses

3. When the protect switch of the memory cassette is set to ON. (Error code: K6770)
4. When the collation result after data writing is "mismatch" due to omission of initialization or for another reason. (Error code: K6770)

B

Applied Instruction List

Page 754 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Operation example
Page 754 · click to enlarge
Page 754

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

Program example

1. In the case of FX 3UC PLCs Ver. 1.30 or later and FX 3U PLCs Ver. 2.20 or later In the program example shown below, the changed contents of extension registers R10 to R19 (sector 0) used for setting data are reflected on the extension file registers (ER) when X000 is set to ON. (128 points are written in one operation cycle.)

Program

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program diagram (page 754)
Fig. 702 · Program

Operation example

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Operation example diagram (page 754)
Fig. 703 · Operation example
Page 755 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.2 SAVER / Save to ER
Page 755 · click to enlarge
Page 755
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.2 SAVER / Save to ER diagram (page 755)
Fig. 704 · 33.2 SAVER / Save to ER
Page 756 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 756 · click to enlarge
Page 756

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

2. In the case of FX 3UC PLCs former than Ver. 1.30 In the program example shown below, the changed contents of the extension registers R10 to R19 (sector 0) used for setting data are reflected on extension file registers (ER) when X000 is set to ON. (128 points are written in one operation cycle.)

Program

SET EN ENO

M0

M0

BMOVP EN s n

R0 K100

R30720

INITRP EN s n

R0 K1

WDT EN ENO

BMOVP EN s n

R0

K100

R0

K128

Operation execution complete flag

M8029

RST EN ENO

M0

Show 8 more labels / short text on this page
[Structured ladder/FBD] · 1) · 2) · 3) · d R30720 · SAVER EN s · 4) · n
Page 757 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.2 SAVER / Save to ER
Page 757 · click to enlarge
Page 757
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.2 SAVER / Save to ER diagram (page 757)
Fig. 705 · 33.2 SAVER / Save to ER

Use unused devices as an area to which data is temporarily withdrawn.

Page 758 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.2 SAVER / Save to ER
Page 758 · click to enlarge
Page 758

33 Applied Instructions (Extension File Register Control)

33.2 SAVER / Save to ER

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.2 SAVER / Save to ER diagram (page 758)
Fig. 706 · 33.2 SAVER / Save to ER
Page 759 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 759 · click to enlarge
Page 759

33 Applied Instructions (Extension File Register Control)

33.3 INITR / Initialize R and ER

33.3 INITR / Initialize R and ER

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

This instruction initializes (to "HFFFF ") extension registers (R) in the RAM built in a PLC and extension file registers in a memory cassette (flash memory) before data logging by LOGR instruction. In FX3UC PLCs former than Ver. 1.30, use this instruction to initialize extension file registers (ER) before writing data to them using SAVER instruction. In FX3UC PLCs Ver. 1.30 or later, INITER instruction is also provided to initialize (to "HFFFF" ) only extension file registers (ER) in a memory cassette (flash memory) in units of sector.

→ For SAVER instruction, refer to Section 33.2.

Applied Instructions (Extension File Register Control)

→ For LOGR instruction, refer to Section 33.4. → For INITER instruction, refer to Section 33.6.

1. Format and operation, execution form

Expression in each language

Applied Instructions (FX3U-CF-ADP)

INITR EN s n

INITR 16 bits Continuous INITR(EN,s,n);

Interrupt Function and Pulse Catch Function

INITRP EN s n

INITRP 16 bits Pulse INITRP(EN,s,n);

A

Relationships between devices and addresses

2. Set data

Variable Description Data type

EN Execution condition Bit

Device of extension register and extension file register to be initialized It is possible to specify only the head device in a sector of extension registers.

B

ANY16

Number of sectors of extension registers and extension file registers to be initialized. ANY16

Output variable ENO Execution state Bit

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 759)
Fig. 707 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Show 5 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Applied Instruction List
Page 760 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — H0010 HFFFF H1234 HFFFF
Page 760 · click to enlarge
Page 760

33 Applied Instructions (Extension File Register Control)

33.3 INITR / Initialize R and ER

Function and operation explanation

1. 16-bit operation (INITR/INITRP)

"n" sectors of extension registers in the PLC's built-in RAM starting from the one specified by and "n" sectors of extension file registers in a memory cassette (flash memory) having the same device numbers are initialized (initial value "HFFFF" is written.). Initialization is executed in units of sector.

Extension registers to be initialized

and extension file register device Number of sectors of extension registers and

extension file registers to be initialized.

The table below shows the head device number in each sector.

Initialized device range Sector number

Sector 0 R0 R0 to R2047, ER0 to ER2047 Sector 8 R16384 R16384 to R18431, ER16384 to ER18431

Sector 1 R2048 R2048 to R4095, ER2048 to ER4095 Sector 9 R18432 R18432 to R20479, ER18432 to ER20479

Sector 2 R4096 R4096 to R6143, ER4096 to ER6143 Sector 10 R20480 R20480 to R22527, ER20480 to ER22527

Sector 3 R6144 R6144 to R8191, ER6144 to ER8191 Sector 11 R22528 R22528 to R24575, ER22528 to ER24575

Sector 4 R8192 R8192 to R10239, ER8192 to ER10239 Sector 12 R24576 R24576 to R26623, ER24576 to ER26623

Sector 5 R10240 R10240 to R12287, ER10240 to ER12287 Sector 13 R26624 R26624 to R28671, ER26624 to ER28671

Sector 6 R12288 R12288 to R14335, ER12288 to ER14335 Sector 14 R28672 R28672 to R30719, ER28672 to ER30719

Sector 7 R14336 R14336 to R16383, ER14336 to ER16383 Sector 15 R30720 R30720 to R32767, ER30720 to ER32767

Operation (when a memory cassette is used)

1. Extension registers (R) [inside the built-in RAM memory]
2. Extension file registers (ER) [inside the memory cassette]

H0010 HFFFF H1234 HFFFF

+1 H0020 HFFFF +1 H5678 HFFFF

+2 H0011 HFFFF +2 H90AB HFFFF

+(2048×n)-1 HABCD HFFFF +(2048×n)-1 HCDEF HFFFF

Show 15 more labels / short text on this page
Command input · INITR EN s · n · Head device number · Head device number · Sector number · Initialized device range · Current value · Current value · Device number · Before execution · After execution · Device number · Before execution · After execution
Page 761 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — WDT EN ENO
Page 761 · click to enlarge
Page 761

33 Applied Instructions (Extension File Register Control)

33.3 INITR / Initialize R and ER

Cautions

Applied Instructions (Data Transfer 3)

1. Initializing two or more sectors When a memory cassette is attached, 18 ms is required to initialize one sector. (When a memory cassette is not attached, only 1 ms is required to initialize one sector.) When initializing two or more sectors, take either measures shown below.
1. Set a large value to the watchdog timer D8000 using the following program.

Applied Instructions (High Speed Processing 2)

Guideline of the watchdog timer set value

Applied Instructions (Extension File Register Control)

A value acquired by the following procedure can be regarded as the guideline of the watchdog timer set value. If an acquired value is 200 ms or less, however, it is not necessary to change the watchdog timer set value.

a) Write a program to be executed from GX Works2 to the PLC.

[Online] → [Write to PLC ...] b) Set the current value of D8000 (unit: ms) to "1000" using the modify value function in GX Works2.

Select [Online] → [Monitor] → [Monitor Mode] to switch the [PRG] MAIN screen. [Debug] → [Modify Value] c) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.) d) Monitor the maximum scan time D8012 (unit: 0.1 ms) using the device/buffer Memory Batch function

Applied Instructions (FX3U-CF-ADP)

in GX Works2. [Online] → [Device/Buffer Memory Batch] e) Set the watchdog timer to the maximum scan time (D8012) or more.

Interrupt Function and Pulse Catch Function

D8012 stores the maximum scan time in increments of 0.1 ms. Rough guide to the watchdog timer set value D8000 (unit: ms) is the "value stored in D8012 divided by 10" added by 50 to 100.

2. Setting WDT instruction just before and after INITR instruction as shown below.

A

WDT EN ENO LDP EN ENO s

Relationships between devices and addresses

The watchdog timer is reset.

B

*1. Device of registers to be initialized

*2. Number of sectors of registers to be initialized

WDT EN ENO

The watchdog timer is reset.

If the processing time of the INITR instruction exceeds 200 ms, set the value of D8000 (unit: ms) to the processing time or more.

2. About the allowable number of times of writing operations in memory Note the following when accessing the extension file registers:
  • The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions.
  • The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.
Show 9 more labels / short text on this page
M8002 Initial pulse · MOV EN s · d K D8000 · Command input · INITR EN s · *1 · *2 · n · Applied Instruction List
Page 762 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — RO H1234 HFFFF
Page 762 · click to enlarge
Page 762

33 Applied Instructions (Extension File Register Control)

33.3 INITR / Initialize R and ER

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When any device number other than the head device number of a sector of extension file registers is set to . (Error code: K6706)
2. When a device number to be initialized exceeds "32767". In this case, devices up to R32767 (ER32767) are initialized. (Error code: K6706)
3. When the protect switch of the memory cassette is set to ON. (Error code: K6770)

Program example

In the program example shown below, the extension registers R0 to R2047 in the sector 0 are initialized. Note that the extension file registers ER0 to ER2047 are also initialized if a memory cassette is attached.

WDT EN ENO LDP EN ENO s

WDT(LDP(TRUE,X000));

INITR(LDP(TRUE,X000),R0,K1);

WDT(LDP(TRUE,X000));

ENO R0

K1

WDT EN ENO

1. Extension registers (R) [inside the built-in RAM memory]

RO H1234 HFFFF

R1 H5678 HFFFF

R2 H90AB HFFFF

R2047 HCDEF HFFFF

Show 6 more labels / short text on this page
INITR EN s · n · Current value · Device number · Before execution · After execution
Page 763 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.4 LOGR / Logging R and ER
Page 763 · click to enlarge
Page 763
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.4 LOGR / Logging R and ER diagram (page 763)
Fig. 708 · 33.4 LOGR / Logging R and ER

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction logs specified devices, and stores the logged data to extension registers (R) and extension file registers (ER) in a memory cassette.

Number of devices to be logged (1≤ m ≤ 8000) ANY16

Number of sectors of devices used in logging (1 ≤ n ≤ 16) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 764 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Logging data format
Page 764 · click to enlarge
Page 764

33 Applied Instructions (Extension File Register Control)

33.4 LOGR / Logging R and ER

Function and operation explanation

1. 16-bit operation (LOGR/LOGRP)

While the instruction is driven, "m" devices starting from the device specified by are logged until "n" sectors of extension registers (R) starting from the device specified by and extension file registers (ER) in a memory cassette are filled. The number of pieces of logged data is stored to the device specified by . If a memory cassette is not used, data is not written to extension file registers (ER).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 764)
Fig. 709 · Function and operation explanation

Head device to be logged Number of devices to be logged Number of sectors of devices used in logging

Head device used in logging Number of pieces of logged data

Logging data format

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Logging data format diagram (page 764)
Fig. 710 · Logging data format

Writing position control area (Every time one word is used in the data writing area, bits are set to OFF (0) from ON (1) in turn from bit 0 of [ + (1926 n) - 1]. After bit 15 of [ + (1926 n) - 1] is set to OFF (0), bit 0 of the next device [ + (1926 n)] is set to OFF (0) in the next logging.)

The table below shows the head device number in each sector.

Written device range Sector number

Sector 0 R0 R0 to R2047, ER0 to ER2047 Sector 8 R16384 R16384 to R18431, ER16384 to ER18431

Sector 1 R2048 R2048 to R4095, ER2048 to ER4095 Sector 9 R18432 R18432 to R20479, ER18432 to ER20479

Sector 2 R4096 R4096 to R6143, ER4096 to ER6143 Sector 10 R20480 R20480 to R22527, ER20480 to ER22527

Sector 3 R6144 R6144 to R8191, ER6144 to ER8191 Sector 11 R22528 R22528 to R24575, ER22528 to ER24575

Sector 4 R8192 R8192 to R10239, ER8192 to ER10239 Sector 12 R24576 R24576 to R26623, ER24576 to ER26623

Sector 5 R10240 R10240 to R12287, ER10240 to ER12287 Sector 13 R26624 R26624 to R28671, ER26624 to ER28671

Sector 6 R12288 R12288 to R14335, ER12288 to ER14335 Sector 14 R28672 R28672 to R30719, ER28672 to ER30719

Sector 7 R14336 R14336 to R16383, ER14336 to ER16383 Sector 15 R30720 R30720 to R32767, ER30720 to ER32767

Show 4 more labels / short text on this page
Head device number · Head device number · Sector number · Written device range
Page 765 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 765 · click to enlarge
Page 765

33 Applied Instructions (Extension File Register Control)

33.4 LOGR / Logging R and ER

Cautions

Applied Instructions (Data Transfer 3)

1. About LOGR instruction LOGR instruction executes logging in each operation in the continuous operation type. When logging should be executed only once by one input, use the pulse operation type.
2. Cautions on using a memory cassette Flash memory is adopted in a memory cassette. Be sure to initialize the data storage area in units of sector before starting logging. If this instruction is executed without initialization, an operation error (error code: K6770) may be caused.

Applied Instructions (High Speed Processing 2)

Logging data storage area initialization command input

INITR EN s n

Applied Instructions (Extension File Register Control)

Device of registers to be initialized*1

Number of sectors of registers to be initialized*2

*1. Specify the same device as in LOGR instruction.

*2. Specify the same number as (n) in LOGR instruction.

Applied Instructions (FX3U-CF-ADP)

3. About the allowable number of times of writing operations in memory

  • Note the following when accessing the extension file registers: The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions.

Interrupt Function and Pulse Catch Function

  • The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.

A

Relationships between devices and addresses

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

B

1. When any number other than the head device number of a sector of extension file registers is set to the device specified by . (Error code: K6706)
2. While data is written, the remaining area and the data quantity to be written are compared with each other. If the remaining storage area is insufficient, only a limited amount of data is written. (Error code: K6706)
3. When the protect switch of the memory cassette is set to ON. (Error code: K6770)
4. When the collation result after data writing is "mismatch" due to omission of initialization or for another reason. (Error code: K6770)

Applied Instruction List

Page 766 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Program example
Page 766 · click to enlarge
Page 766

33 Applied Instructions (Extension File Register Control)

33.4 LOGR / Logging R and ER

Program example

In the program example shown below, D1 and D2 are logged to the area from R2048 to R6143 every time X001 turns ON.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Program example diagram (page 766)
Fig. 711 · Program example

Because two words are used, low-order two bits are set to OFF (0).

Because two words are used, low-order two bits are set to OFF (0).

Page 767 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 767 · click to enlarge
Page 767

33 Applied Instructions (Extension File Register Control)

33.5 RWER / Rewrite to ER

33.5 RWER / Rewrite to ER

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

This instruction writes the current values of an arbitrary number of extension registers (R) in the PLC's built-in RAM to extension file registers (ER) in a memory cassette (flash memory or EEPROM) or to the extension file registers (ER) in the PLC's built-in EEPROM. Because RWER instruction is not provided in the FX3UC PLC earlier than Ver. 1.30, use SAVER instruction instead.

1. Format and operation, execution form

Applied Instructions (Extension File Register Control)

Expression in each language

RWER EN ENO s n

RWER 16 bits Continuous RWER(EN,s,n);

Applied Instructions (FX3U-CF-ADP)

RWERP EN ENO s n

RWERP 16 bits Pulse RWERP(EN,s,n);

Interrupt Function and Pulse Catch Function

2. Set data

Variable Description Data type

EN Execution condition Bit

A

Device of extension register storing data ANY16

Number of written (transferred) devices [FX3G/FX3GC: 1 ≤ n ≤ 24000, FX3U/FX3UC: 0 ≤ n ≤ 32767] ANY16

Relationships between devices and addresses

Output variable ENO Execution state Bit

3. Applicable devices

B

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Applied Instruction List · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type · z z · z z z
Page 768 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 768 · click to enlarge
Page 768

33 Applied Instructions (Extension File Register Control)

33.5 RWER / Rewrite to ER

Function and operation explanation

1. 16-bit operation (RWER)

RWERP EN ENO s n

Device of extension register storing data

Number of written (transferred) devices

1. For the FX 3U and FX 3UC PLCs The contents (current values) of "n" extension registers (R) starting from are written (transferred) to extension file registers having the same device numbers in a memory cassette (flash memory).
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 768)
Fig. 712 · Function and operation explanation

Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM

*1. All points specified by the instruction are written (transferred).

- When "n" is set to "0", it is handled as "32768" when the instruction is executed.

2. For the FX 3G and FX 3GC PLCs a) When connecting a memory cassette (A memory cassette cannot be connected to FX 3GC PLC.)

The contents (current values) of the "n" points of extension registers (R) starting from are written (transferred) to the extension file registers (ER) having the same numbers as the extension registers (R) in the memory cassette (EEPROM).

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 768)
Fig. 713 · Function and operation explanation

Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM

*1. All points specified by the instruction are written (transferred).

b) When not connecting a memory cassette

The contents (current values) of the "n" points of extension registers (R) starting from are written (transferred) to the extension file registers (ER) having the same numbers as the extension registers (R) in the PLC's built-in EEPROM.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Function and operation explanation diagram (page 768)
Fig. 714 · Function and operation explanation

Extension file registers (ER) inside PLC's built-in EEPROM Extension registers (R) inside built-in RAM

*1. All points specified by the instruction are written (transferred).

Command input

Page 769 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — WDT EN ENO
Page 769 · click to enlarge
Page 769

33 Applied Instructions (Extension File Register Control)

33.5 RWER / Rewrite to ER

Cautions

Applied Instructions (Data Transfer 3)

1. Cautions on writing data to the memory cassette (flash memory) for the FX 3U and FX 3UC PLCs Memory cassettes adopt flash memory. Note the following contents when writing data to extension file registers in a memory cassette with the RWER instruction.
1. Though extension file registers to be written can be specified arbitrarily, writing is executed in units of sector. It takes about 47 ms to write one sector. If the extension file registers to be written are located in two sectors, the instruction execution time will be about 94 ms. Be sure to change the set value of the watchdog timer D8000 before executing this instruction.

Applied Instructions (High Speed Processing 2)

PLS EN ENO

Applied Instructions (Extension File Register Control)

M100

ADD_E EN _IN _IN

Applied Instructions (FX3U-CF-ADP)

D8000 D8000

*1. Number of sectors to be written 47 ms

K47 *1

WDT EN ENO

Interrupt Function and Pulse Catch Function

RWER EN ENO s n

The contents of R1000 to R1099 in the sector 0 are written to ER1000 to ER1099.

R1000

K100

A

Relationships between devices and addresses

WDT EN ENO

B

The table below shows the device range in each sector.

Sector number Device range Sector number Device range

Sector 0 ER0 to ER2047 Sector 8 ER16384 to ER18431

Sector 1 ER2048 to ER4095 Sector 9 ER18432 to ER20479

Sector 2 ER4096 to ER6143 Sector 10 ER20480 to ER22527

Sector 3 ER6144 to ER8191 Sector 11 ER22528 to ER24575

Sector 4 ER8192 to ER10239 Sector 12 ER24576 to ER26623

Sector 5 ER10240 to ER12287 Sector 13 ER26624 to ER28671

Sector 6 ER12288 to ER14335 Sector 14 ER28672 to ER30719

Sector 7 ER14336 to ER16383 Sector 15 ER30720 to ER32767

2. Do not turn OFF the power while this instruction is being executed. If the power is turned OFF, execution of this instruction may be aborted. If execution is aborted, the data may be lost. Be sure to back up the data before executing this instruction.

→ For the backup method, refer to the next page.

3. RWER instruction is provided in the FX 3UC PLC Ver. 1.30 or later.
Show 7 more labels / short text on this page
Writing command input · d M100 · MOV EN s · d D200 D8000 · MOV EN s · d D8000 D200 · Applied Instruction List
Page 770 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Error
Page 770 · click to enlarge
Page 770

33 Applied Instructions (Extension File Register Control)

33.5 RWER / Rewrite to ER

2. Cautions on writing data to the memory cassette (EEPROM) for the FX 3G PLCs Memory cassettes adopt EEPROM. Note the following contents when writing data to extension file registers in a memory cassette with the RWER instruction.
  • Do not turn OFF the power while this instruction is being executed. If the power is turned OFF, execution of this instruction may be aborted. If execution is aborted, the data may be lost. Be sure to back up the data before executing this instruction.
3. About the allowable number of times of writing operations in memory Note the following when accessing the extension file registers:
  • For the FX 3U and FX 3UC PLCs The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions. The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.
  • For the FX 3G and FX 3GC PLCs The memory cassette (EEPROM) and PLC's built-in memory (EEPROM) allow up to 10,000 times and 20,000 times of writing operations, respectively. The number of times of writing operations counts up each time the RWER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions. The number of times of writing operations does not count up when the LOADR instruction is executed.

Error

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When the last device number to be transferred exceeds "32767" (Error code: K6706). At this time, the data up to the last device number of "R32767" *1 is read (transferred).
2. When a memory cassette is not connected. (Error code: K6771) *2
3. When the protect switch of the memory cassette is set to ON. (Error code: K6770)

*1. For the FX3G and FX3GC PLCs, the last device number is "23999".

*2. This does not cause an error with the FX3G PLCs because the PLCs read the contents of the extension file registers stored in the PLC's built-in EEPROM even if a memory cassette is not connected.

Page 771 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 33.5 RWER / Rewrite to ER
Page 771 · click to enlarge
Page 771
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 33.5 RWER / Rewrite to ER diagram (page 771)
Fig. 715 · 33.5 RWER / Rewrite to ER

In the program example shown below, the changed contents of extension registers R10 to R19 (sector 0) used for setting data are reflected on extension file registers (ER) when X000 turns ON.

Page 772 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 772 · click to enlarge
Page 772

33 Applied Instructions (Extension File Register Control)

33.6 INITER / Initialize ER

33.6 INITER / Initialize ER

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

This instruction initializes extension file registers (ER) to "HFFFF" () in a memory cassette (flash memory) before executing the SAVER instruction. Because INITER instruction is not provided in the FX3UC PLC earlier than Ver. 1.30, use INITR instruction instead.

→ For SAVER instruction, refer to Section 33.2.

→ For INITR instruction, refer to Section 33.3.

1. Format and operation, execution form

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 1. Format and operation, execution form diagram (page 772)
Fig. 716 · 1. Format and operation, execution form

2. Set data

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 2. Set data diagram (page 772)
Fig. 717 · 2. Set data

Device number of extension register sector with the same device number as the extension file register to be initialized. It is possible to specify only the head device in a sector of extension registers.

Number of sectors of extension registers and extension file registers to be initialized. ANY16

3. Applicable devices

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Applicable devices diagram (page 772)
Fig. 718 · 3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 773 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — H1234 HFFFF
Page 773 · click to enlarge
Page 773

33 Applied Instructions (Extension File Register Control)

33.6 INITER / Initialize ER

Function and operation explanation

Applied Instructions (Data Transfer 3)

1. 16-bit operation (INITER/INITERP) "n" sectors of extension file registers (ER) in a memory cassette (flash memory) with the same device number as the device specified by are initialized (initial value "HFFFF" () is writen.). Initialization is executed in sectors.

Applied Instructions (High Speed Processing 2)

Extension register sector with the same device number

as the extension file register to be initialized. Number of sectors of extension registers and

extension file registers to be initialized.

The table below shows the head device number in each sector.

Applied Instructions (Extension File Register Control)

Sector number Head device

number Initialized device range Sector number Head device

number Initialized device range

Sector 0 R0 ER0 to ER2047 Sector 8 R16384 ER16384 to ER18431

Sector 1 R2048 ER2048 to ER4095 Sector 9 R18432 ER18432 to ER20479

Sector 2 R4096 ER4096 to ER6143 Sector 10 R20480 ER20480 to ER22527

Applied Instructions (FX3U-CF-ADP)

Sector 3 R6144 ER6144 to ER8191 Sector 11 R22528 ER22528 to ER24575

Sector 4 R8192 ER8192 to ER10239 Sector 12 R24576 ER24576 to ER26623

Sector 5 R10240 ER10240 to ER12287 Sector 13 R26624 ER26624 to ER28671

Sector 6 R12288 ER12288 to ER14335 Sector 14 R28672 ER28672 to ER30719

Sector 7 R14336 ER14336 to ER16383 Sector 15 R30720 ER30720 to ER32767

Interrupt Function and Pulse Catch Function

Operation example

1. Extension file registers (ER) [inside the memory cassette]

A

Relationships between devices and addresses

H1234 HFFFF

+1 H5678 HFFFF

+2 H90AB HFFFF

B

+(2048×n)-1 HCDEF HFFFF

Show 8 more labels / short text on this page
Command input · INITER EN s · n · Current value · Device number · Before execution · After execution · Applied Instruction List
Page 774 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Guideline of the watchdog timer set value
Page 774 · click to enlarge
Page 774

33 Applied Instructions (Extension File Register Control)

33.6 INITER / Initialize ER

Cautions

1. About 25 ms is required to initialize one sector. When initializing two or more sectors, take either measure shown below.
1. Set a large value to the watchdog timer D8000 using the following program.

Guideline of the watchdog timer set value

A value acquired by the following procedure can be regarded as the guideline of the watchdog timer set value. If an acquired value is 200 ms or less, however, it is not necessary to change the watchdog timer set value.

a) Write a program to be executed from GX Works2 to the PLC.

[Online] → [Write to PLC ...] b) Set the current value of D8000 (unit: ms) to "1000" using the modify value function in GX Works2.

Select [Online] → [Monitor] → [Monitor Mode] to switch the [PRG] MAIN screen. [Debug] → [Modify Value] c) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.) d) Monitor the maximum scan time D8012 (unit: 0.1 ms) using the device/buffer Memory Batch function

in GX Works2. [Online] → [Device/Buffer Memory Batch] e) Set the watchdog timer to the maximum scan time (D8012) or more.

D8012 stores the maximum scan time in increments of 0.1 ms. Rough guide to the watchdog timer set value D8000 (unit: ms) is the "value stored in D8012 divided by 10" added by 50 to 100.

2. Setting WDT instruction just before and after INITER instruction as shown below:

WDT EN ENO LDP EN ENO s

The watchdog timer is reset.

*1. Device number of the extension registers to be initialized *2. Device number of the extension registers to be initialized WDT EN ENO

The watchdog timer is reset.

If the processing time of the INITR instruction exceeds 200 ms, set the value of D8000 (unit: ms) to the processing time or more.

2. About the allowable number of times of writing operations in memory Note the following when accessing the extension file registers:
  • The memory cassette (flash memory) allows up to 10,000 times of writing operations. The number of times of writing operations counts up each time the INITR, RWER or INITER instruction is executed. Do not let the number of times of writing operations exceed the allowable number of times of writing operations. When a continuous operation type instruction is executed, writing operation to the memory occurs for each operation cycle of the PLC. To avoid this, be sure to use pulse operation type instructions.
  • The number of times of writing operations does not count up when the LOADR, SAVER or LOGR instruction is executed. However, the SAVER and LOGR instructions require the target write sectors to be initialized before executing the instructions. Note that, when initializing by using the INITR or INITER instruction, the number of times of writing operations in the memory counts up every time the NITR or INITER instruction is executed.
3. RWER instruction is provided in the FX 3UC PLC Ver. 1.30 or later.
Show 8 more labels / short text on this page
M8002 Initial pulse · MOV EN s · d D8000 K · Command input · INITER EN s · *1 · *2 · n
Page 775 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ERO H1234 HFFFF
Page 775 · click to enlarge
Page 775

33 Applied Instructions (Extension File Register Control)

33.6 INITER / Initialize ER

Error

Applied Instructions (Data Transfer 3)

An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.

1. When any device number other than the head device number of a sector of extension file registers (ER) is set to . (Error code: K6706)

Applied Instructions (High Speed Processing 2)

2. When a device number to be initialized exceeds "32767". In this case, devices up to ER32767 are initialized. (Error code: K6706)
3. When the protect switch of the memory cassette is set to ON. (Error code: K6770)
4. When a memory cassette is not connected. (Error code: K6771)

Program example

Applied Instructions (Extension File Register Control)

In the program example shown below, the extension file registers ER0 to ER2047 in sector 0 are initialized.

WDT EN ENO LDP EN ENO s

Applied Instructions (FX3U-CF-ADP)

The watchdog timer is reset.

R0

K1

Interrupt Function and Pulse Catch Function

WDT EN ENO

The watchdog timer is reset.

A

Relationships between devices and addresses

[ST]

WDT(LDP(TRUE,X000));

INITER(LDP(TRUE,X000),R0,K1);

WDT(LDP(TRUE,X000));

B

1. Extension file registers (ER) [inside the memory cassette]

ERO H1234 HFFFF

ER1 H5678 HFFFF

ER2 H90AB HFFFF

ER2047 HCDEF HFFFF

Show 8 more labels / short text on this page
[Structured ladder/FBD] · INITER EN s · n · Applied Instruction List · Current value · Device number · Before execution · After execution
Page 776 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 34. Applied Instructions (FX 3U -CF-ADP)
Page 776 · click to enlarge
Page 776

34 Applied Instructions (FX3U-CF-ADP)

34. Applied Instructions (FX 3U -CF-ADP)

Instruction name Function Reference

FLCRT File create • check Section 34.1

FLDEL File delete • CF card format Section 34.2

FLWR Data write Section 34.3

FLRD Data read Section 34.4

FLCMD FX3U-CF-ADP command Section 34.5

FLSTRD FX3U-CF-ADP status read Section 34.6

Page 777 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Applicable devices
Page 777 · click to enlarge
Page 777

34 Applied Instructions (FX3U-CF-ADP)

34.1 FLCRT / File create • check

34.1 FLCRT / File create • check

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

The FLCRT instruction creates a file inside the CompactFlashTM card mounted in the FX3U-CF-ADP. When executed after creation of a new file, the FLCRT instruction checks the association with the file ID, and evaluates it.

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

1. Format and operation, execution form

Applied Instructions (Extension File Register Control)

Expression in each language

FLCRT EN ENO s1 s2 s3 n

FLCRT 16 bits Continuous FLCRT(EN,s1,s2,s3,n);

Applied Instructions (FX3U-CF-ADP)

2. Set data

Variable Description Data type

Interrupt Function and Pulse Catch Function

EN Execution condition Bit

File ID (Refer to Detailed explanation of setting data) ANY16

File name (Refer to Detailed explanation of setting data) String

File creation parameter (Refer to Detailed explanation of setting data) ARRAY [0..3] OF ANY16

A

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

Relationships between devices and addresses

Output variable ENO Execution state Bit

3. Applicable devices

B

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Show 16 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · Applied Instruction List · type · user · tant · z z z · z z
Page 778 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 778 · click to enlarge
Page 778

34 Applied Instructions (FX3U-CF-ADP)

34.1 FLCRT / File create • check

Function and operation explanation

1. 16-bit operation (FLCRT)

FLCRT EN ENO s1 s2 s3 n

File ID File name File creation parameter

1. When the file ID is "K0" When is "K0", the FLCRT instruction creates a FIFO file. When the PLC creates two or more files for FIFO file, and executes FIFO (first in, first out) in units of files. The PLC keeps the latest file, and deletes older files so that the total capacity of FIFO files and other files does not exceed the specified capacity.

2) When the file ID is "K1" to "K63" When is "K1" to "K63", the FLCRT instruction creates a file having the specified file name. Sequence programs use the file ID for specifying a file. Accordingly, each file name saved in the CompactFlashTM card is associated with the file ID, and controlled by the file ID table. If a file having the specified file name already exists and is registered in the file ID table, the PLC finishes the FLCRT instruction without executing any processing. If a file having the specified name already exists but is not registered in the file ID table, the PLC only registers the existing file to the file ID table.

Command input · Used channel number

Page 779 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ANY16
Page 779 · click to enlarge
Page 779

34 Applied Instructions (FX3U-CF-ADP)

34.1 FLCRT / File create • check

Detailed explanation of setting data

Applied Instructions (Data Transfer 3)

Details of the setting data in the FLCRT instruction are as shown below.

Setting items Description Data Type

File ID This ID number is associated with the file name. The FLCRT instruction creates a file, and associates the file name with the file ID at the same time. The user should use the file ID for specifying a file after that. Allowable setting range : K0 to K63 ("K0" indicates "FIFO file".)

ANY16

Applied Instructions (High Speed Processing 2)

When is "K0 (FIFO file)" Not used (ignored) Use an unused device. (D or R)

When is "K1" to "K63" Specify the file name in up to 8 characters until "null" or "null + null". Half-width alphanumeric characters and half-width symbols permitted in the MS-DOS are available. Half-width symbols : !, #, $, %, &, ', (, ), +, -, @, ^, _, ', ~ The extension is fixed to "CSV"

Applied Instructions (Extension File Register Control)

Time stamp setting Set whether or not the time stamp is added to the file. Specify the format when adding the time stamp. K0 : None (NULL) K1 : yyyy/mm/dd hh:mm:ss K2 : yy/mm/dd hh:mm:ss K3 : dd/mm/yyyy hh:mm:ss K4 : dd/mm/yy hh:mm:ss K5 : mm/dd/yyyy hh:mm:ss K6 : mm/dd/yy hh:mm:ss K7 : hh:mm:ss

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

Data type Set the data type to be saved. K0 : No data type specification (mixed type) K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type (32-bit) K7 : Character string

A

ARRAY [0..3]

OF ANY16

Relationships between devices and addresses

Maximum number of lines Set the maximum number of lines.

Allowable setting rangeK1 to K32767 *1

B

When is "K0 (FIFO file)"

Set the CompactFlashTM card use ratio.

Specify the ratio (%) out of the whole CompactFlashTM card capacity to be used. Allowable setting range : 10 to 90 (%)

When is "K1" to "K63" File processing to be executed when the specified maximum number of lines is reached. Set the file processing method to be executed when the number of lines reaches the specified maximum value. K0 : Stops execution. (The line position remains the specified maximum line position.) K1 : Returns to the head (ring buffer file).

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

ANY16

*1. Adjust the maximum number of lines to specify the file size available in the used application software used. For the file size calculation formula, refer to FX3U-CF-ADP User's Manual

Show 7 more labels / short text on this page
File name · String · File creation parameter · +1 · +2 · Applied Instruction List · +3
Page 780 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 780 · click to enlarge
Page 780

34 Applied Instructions (FX3U-CF-ADP)

34.1 FLCRT / File create • check

Cautions

1. When the file ID is "K0"

a) The CF-ADP can create up to 1000 files (within the CompactFlashTM card capacity). b) The file name is set to "FILE0000.CSV" to "FILE0999.CSV".

2. When the file ID is "K1" to "K63"

a) The user can create up to 63 files (within the CompactFlashTM card capacity). b) The FLCRT instruction is completed abnormally if different file names are specified for the same file ID

or if the same file name is specified for different file IDs.

3. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction
4. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.
Page 781 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 34.2 FLDEL / File delete • CF card format
Page 781 · click to enlarge
Page 781
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 34.2 FLDEL / File delete • CF card format diagram (page 781)
Fig. 719 · 34.2 FLDEL / File delete • CF card format

34.2 FLDEL / File delete • CF card format

34.2 FLDEL / File delete • CF card format

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

The FLDEL instruction deletes files stored in the CompactFlashTM card, or formats the CompactFlashTM

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

File ID (Refer to Detailed explanation of setting data) ANY16

File delete method (Refer to Detailed explanation of setting data) ANY16

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Page 782 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ANY16
Page 782 · click to enlarge
Page 782

34 Applied Instructions (FX3U-CF-ADP)

34.2 FLDEL / File delete • CF card format

Function and operation explanation

1. 16-bit operation (FLDEL)

FLDEL EN ENO s1 s2 n

File ID File delete method Used channel number

The FLDEL instruction deletes files stored in the CompactFlashTM card, or formats the CompactFlashTM card in the following method.

1. Specify file deletion or file formatting using .

a) When is "K-1 (H0FFFF)", the FLDEL instruction deletes all files whose ID is 0 to 63.

b) When is "K0" to "K63", the FLDEL instruction deletes the file associated with the specified file ID.

c) When is "K512 (H200)", the FLDEL instruction formats the CompactFlashTM card.

2. Specify the file deletion method or format type using .

a) When is "K-1 (H0FFFF)" or "K0" to "K63", specify the deletion method K0: The FLDEL instruction deletes the specified file. K1: The FLDEL instruction deletes the association between the file name and the file ID (, but does

not delete the file itself). However, when the file ID specified in is "0", the FLDEL instruction deletes the file without regard to the setting of .

b) When is "K512 (H200)", specify the format type. k256(H100) : The FLDEL instruction formats the CompactFlashTM card in FAT16 format. For details, refer to Detailed explanation of setting data.

Detailed explanation of setting data

Details of the setting data in the FLDEL instruction are as shown below.

Setting items Description Data Type

File ID K-1(H0FFFF) : The FLDEL instruction deletes all files. K0 to K63 : The FLDEL instruction deletes a file associated with the specified file ID.

ANY16

K512(H200) : The FLDEL instruction formats the CompactFlashTM card.

When is "K-1 (H0FFFF)" or "K0" to "K63" Specify the deletion method. K0 : The FLDEL instruction deletes the specified file. K1 : The FLDEL instruction deletes the association between the file name and the file ID

(but does not delete the file itself).

However, when the file ID specified in is "0", the FLDEL instruction deletes the file

ANY16

itself without regard to the setting of .

When is "K512 (H200)" Specify the format type.

K256(H100) : The FLDEL instruction formats the CompactFlashTM card in the FAT16 format.

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

ANY16

Cautions

1. When the file ID "K0 (FIFO file)" or "K-1 (all files)" is specified, it may take approximately 1 minute to delete the files depending on the number of stored files.
2. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.
3. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction

Command input

Page 783 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 783 · click to enlarge
Page 783

34 Applied Instructions (FX3U-CF-ADP)

34.3 FLWR / Data write

34.3 FLWR / Data write

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

The FLWR instruction writes data to the CompactFlashTM card or to the buffer inside the FX3U-CF-ADP.

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension File Register Control)

FLWR EN ENO

d s1 s2 s3 n

FLWR 16 bits Continuous FLWR(EN,s1,s2,s3,n,d);

Applied Instructions (FX3U-CF-ADP)

2. Set data

Variable Description Data type

EN Execution condition Bit

File ID (Refer to Detailed explanation of setting data) ANY16

Interrupt Function and Pulse Catch Function

Head of devices which store data to be written (Refer to Detailed explanation of setting data) ANY_SIMPLE

Data write parameter (Refer to Detailed explanation of setting data) ARRAY [0..4] OF ANY16

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

A

ENO Execution state Bit

Relationships between devices and addresses

Position after data writing (Refer to Detailed explanation of setting data) ARRAY [0..1] OF ANY16

3. Applicable devices

Bit Devices Word Devices Others

B

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

z

Show 18 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type · Applied Instruction List · z z z · z z · z z z
Page 784 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FLWR EN ENO
Page 784 · click to enlarge
Page 784

34 Applied Instructions (FX3U-CF-ADP)

34.3 FLWR / Data write

Function and operation explanation

1. 16-bit operation (FLWR)

FLWR EN ENO

File ID Position after data writing Head of devices which store data to be written

d s1 s2 s3 n

Data write parameter Used channel number

The FLWR instruction writes data specified by the device to a file stored in the CompactFlashTM card specified by the file ID or to the buffer inside the CF-ADP. The FLWR instruction can overwrite data in the line position specified by the device +1, and can write additional data (K-1). When the writing destination is the buffer inside the CF-ADP, the FLWR instruction can only execute additional writing. When writing is completed, the line position and column position after writing are as follows.

  • When data in 1 line is written additionally - Line position after writing : Written line position + K1 - Column position after writing : K1
  • When a line having existing data is overwritten - Line position after writing : Written line position if data is not written to the final column position of the specified the line position Line position next to the written line position if data is written to the final column position of the line - Column position after writing: Column position next to the final written data point K1 if data is written to the final data point in the line "K1" if data is written to the final data point in the line

Both additional writing and overwriting are executed to the maximum number of lines specified during file creation. If data is written up to the final column position, the line position after writing varies depending on the file type and setting.

  • When the processing is stopped by the maximum line position in a normal file Line position after writing = Maximum line position + K1 K-32768 when the maximum line position is "K32767"
  • In the case of a normal file in which processing returns to the head of the file from the end of the file (ring buffer file) Line position after writing = K1
  • In the case of FIFO file Line position after writing = K1

In either case, the column position after writing is "K1".

Command input

Page 785 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 785 · click to enlarge
Page 785

34 Applied Instructions (FX3U-CF-ADP)

34.3 FLWR / Data write

Detailed explanation of setting data

Applied Instructions (Data Transfer 3)

Details of the setting data in the FLWR instruction are as shown below.

Setting items Description Data Type

File ID K0 to K63 ANY16

Head of devices which store data to be written.

Specify the head of devices which store the data to be written to the CompactFlashTM

ANY_SIMPLE

Applied Instructions (High Speed Processing 2)

card.

Specify the data writing type K0 : Mixed type K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type (32-bit) K7 : Character string (512 half-width/full-width characters maximum) K8 : Data name :Character string consisting of up to 32 half-width/full-width

Applied Instructions (Extension File Register Control)

characters. Index, DATE TIME are added automatically. ARRAY [0..4]

Specify the line position of the writing destination, or specify additional writing. Line position of the writing destination : K1 to specified maximum number of lines Additional writing : K-1

OF ANY16 +1

Applied Instructions (FX3U-CF-ADP)

Specify the data column position in the writing destination. Column position : K1 to K254 Additional writing : K-1

Number of written data points K1 to K254

K0CompactFlash TM card K1 : Buffer inside the CF-ADP

Interrupt Function and Pulse Catch Function

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

ANY16

Line position after writing K1 to specified maximum number of lines ARRAY [0..1]

A

OF ANY16 +1

Column position after writing K1 to K254

Relationships between devices and addresses

B

Show 6 more labels / short text on this page
Data write parameter · +2 · +3 · Writing destination · +4 · Applied Instruction List
Page 786 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Cautions
Page 786 · click to enlarge
Page 786

34 Applied Instructions (FX3U-CF-ADP)

34.3 FLWR / Data write

Cautions

1. The FLWR instruction is completed abnormally if a CompactFlash TM card is not mounted.
2. The user should pay close attention to the number of times data is written when the writing destination is set to the CompactFlash TM card because data is written every time the FLWR instruction is executed. For example, if data is written to the CompactFlash TM card every one minute, data is written 100,000 times in approximately 2 months.
3. Even if the writing destination is set to the buffer inside the CF-ADP, data is written to the CompactFlash TM card in the case of overwriting.
4. The FLWR instruction writes data to the CompactFlash TM card after the internal buffer inside the CF-ADP becomes full when the writing destination is set to the buffer. Data stored in the internal buffer inside the CF-ADP is erased when a (instantaneous or long) power interruption occurs.
5. When the data type is a data name (K8), the user can specify only the head line position before writing other data. Index and DATE TIME are added automatically.
6. The FLWR instruction may require several scans to acquire data. Take proper measures such as saving acquired data in another device if data consistency is required.
7. It is necessary to set the device number in multiples of 16 when a bit device is specified in and the data type is set to anything other than bit type. When a word device is specified in and the data type is set to bit, the FLWR instruction acquires data to be written from the least significant bit of the specified device.
8. When is "K7" or "K8", 00H, which indicates the end of the string, must be added to the end of the character string.
9. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction
10. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.
Page 787 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FLRD EN
Page 787 · click to enlarge
Page 787

34 Applied Instructions (FX3U-CF-ADP)

34.4 FLRD / Data read

34.4 FLRD / Data read

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

The FLRD instruction reads data from the CompactFlashTM card.

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension File Register Control)

FLRD EN ENO s1 s2 n

FLRD 16 bits Continuous FLRD(EN,s1,s2,n,d1,d2);

Applied Instructions (FX3U-CF-ADP)

2. Set data

Variable Description Data type

EN Execution condition Bit

File ID (Refer to Detailed explanation of setting data) ANY16

Data read parameter (Refer to Detailed explanation of setting data) ARRAY [0..3] OF ANY16

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

Interrupt Function and Pulse Catch Function

ENO Execution state Bit

Device which stores the read data (Refer to Detailed explanation of setting data) ANY_SIMPLE

Number of data points existing in the specified line ANY16

A

3. Applicable devices

Relationships between devices and addresses

Bit Devices Word Devices Others

System user Digit specification System

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

B

z

z

Function and operation explanation

1. 16-bit operation (FLRD)

FLRD EN

Device which stores the read data Number of data points existing in the specified line Used channel number

File ID Data read parameter

d1 d2 s1 s2 n

The FLRD instruction reads corresponding number of data from the position determined by the line position and column position in the file specified by the file ID, and stores the read data to a device specified in .

When reading data from a file in which only the same type of data exists in one line, refer to FX3U-CF-ADP User's Manual. When reading data from a file in which different types of data exist in one line, refer to FX3U-CF-ADP User's Manual.

Show 20 more labels / short text on this page
Instruction · name Operation Execution · form · d1 d2 · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · String Pointer · type · user · tant · Applied Instruction List · z z z · z z · z z z · Command input
Page 788 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ANY16
Page 788 · click to enlarge
Page 788

34 Applied Instructions (FX3U-CF-ADP)

34.4 FLRD / Data read

Detailed explanation of setting data

Details of the setting data in the FLRD instruction are as shown below.

Setting items Description Data Type

File ID K0 to K63 ANY16

Specify the data reading type K0 : Mixed type K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type K7 : Character string (512 half-width/full-width characters maximum)

ARRAY [0..3]

OF ANY16

Specify the line position from which data is read. Line position : K1 to specified maximum number of lines

Specify the column position from which data is read. Column position : K1 to K254

Read points K1 to K254

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

ANY16

Device which stores the read data

Specify the head of devices which store the data read from the CompactFlashTM card. ANY_SIMPLE

Number of data points existing in the specified line K1 to K254 K0 : No data

ANY16

Cautions

1. The FLRD instruction is completed abnormally if a CompactFlash TM card is not mounted.
2. The FLRD instruction may require several scans to acquire data. Use the acquired data only after confirming completion of the FLRD instruction if data consistency is required.
3. It is necessary to set the device number in a multiple of 16 when a bit device is specified in and the read data type is anything other than bit. When a word device is specified in and the read data type is bit, the FLRD instruction stores data read from the least significant bit of the specified word device.
4. When the data type is anything other than character string and the number of devices which store the read data is insufficient, the FLRD instruction does not read data from the CF-ADP. An error occurs.
5. When the data type is a character string, the character string length is unknown. The PLC stores as much read data as possible. When reading is not completed even after the final device is reached, an error occurs.
6. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction
7. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.
Show 4 more labels / short text on this page
Data read parameter · +1 · +2 · +3
Page 789 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FLCMD EN
Page 789 · click to enlarge
Page 789

34 Applied Instructions (FX3U-CF-ADP)

34.5 FLCMD / FX3U-CF-ADP command

34.5 FLCMD / FX 3U -CF-ADP command

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

The FLCMD instruction gives instruction for operation to the FX3U-CF-ADP.

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension File Register Control)

FLCMD EN ENO s n

FLCMD 16 bits Continuous FLCMD(EN,s,n);

2. Set data

Applied Instructions (FX3U-CF-ADP)

Variable Description Data type

EN Execution condition Bit

Instruction for operation (Refer to Detailed explanation of setting data) ANY16

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

Output variable ENO Execution state Bit

Interrupt Function and Pulse Catch Function

3. Applicable devices

Bit Devices Word Devices Others

System user Digit specification System

A

Relationships between devices and addresses

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

B

Function and operation explanation

1. 16-bit operation (FLCMD)

FLCMD EN

The FLCMD instruction gives instruction for operation to the CF-ADP. The contents of instruction are as follows.

1. When is "K-1", the FLCMD instruction forcibly writes all buffered data (stored in the buffer inside the CF-ADP) to the CompactFlash TM card.
2. When is "K0" to "K63", the FLCMD instruction forcibly writes the buffered data of the specified file ID (stored in the buffer inside the CF-ADP) to the CompactFlash TM card.
3. When is "K256 (H100)", the FLCMD instruction sets the CompactFlash TM card to the mounted status if it is in the unmounted status.
4. When is "K512 (H200)", the FLCMD instruction sets the CompactFlash TM card to the unmounted status if it is in the mounted status.
5. When is "K1280 (H500)", the FLCMD instruction clears error codes stored in the CF-ADP.

For details, refer to Detailed explanation of setting data.

Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · Input variable · Special · unit Index Cons · Real Number · Character · Operand · String Pointer · type · user · tant · z z · Applied Instruction List · Command input · ENO s n · Instruction for operation · Used channel number
Page 790 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Caution
Page 790 · click to enlarge
Page 790

34 Applied Instructions (FX3U-CF-ADP)

34.5 FLCMD / FX3U-CF-ADP command

Detailed explanation of setting data

Details of the setting data in the FLCMD instruction are as shown below.

Setting items Description Data Type

Contents of instruction for operation

K-1 : Forcibly writes all buffered data to the CompactFlashTM card.

K0 to K63Forcibly writes the buffered data of the specified file ID to the CompactFlash TM

card.

ANY16

K256(H100) : Sets the CompactFlashTM card to the mounted status*1.

K512(H200) : Sets the CompactFlashTM card to the unmounted status*2. K1280(H500) : Clears error codes stored in the CF-ADP.

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

ANY16

*1. The CompactFlashTM card is available in the "mounted" status.

*2. The CompactFlashTM card is unavailable in the "unmounted" status.

Caution

1. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction
2. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.
Page 791 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Function and operation explanation
Page 791 · click to enlarge
Page 791

34 Applied Instructions (FX3U-CF-ADP)

34.6 FLSTRD / FX3U-CF-ADP status read

34.6 FLSTRD / FX 3U -CF-ADP status read

Applied Instructions (Data Transfer 3)

FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)

Applied Instructions (High Speed Processing 2)

The FLSTRD instruction reads the status (including the error information and file information) of the FX3U- CFADP.

→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.

1. Format and operation, execution form

Expression in each language

Applied Instructions (Extension File Register Control)

FLSTRD EN ENO

FLSTRD 16 bits Continuous FLSTRD(EN,s,n,d);

2. Set data

Applied Instructions (FX3U-CF-ADP)

Variable Description Data type

EN Execution condition Bit

Contents of status to be read (Refer to Detailed explanation of setting data) ANY16

Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16

ENO Execution state Bit

Interrupt Function and Pulse Catch Function

Head device to which the read status is written (Refer to Detailed explanation of setting data) ANY16

3. Applicable devices

A

Bit Devices Word Devices Others

System user Digit specification System

Relationships between devices and addresses

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

z

B

Function and operation explanation

1. 16-bit operation (FLSTRD)

Command input FLSTRD EN

Contents of status to be read Head device to which the read status is written Used channel number

The FLSTRD instruction reads the status information of the CF-ADP. The following contents can be read. The number of data stored in varies depending on the contents of the read status.

1. When is "K0" to "K63" the FLSTRD instruction reads the final line number and final column position of each file.
2. When is "K256 (H100)" the FLSTRD instruction reads file IDs stored in the CompactFlash TM card.
3. When is "K512 (H200)" the FLSTRD instruction reads the data capacity.
4. When is "K768 (H300)" the FLSTRD instruction reads the version information of the CF-ADP.
5. When is "K1024 (H400)" the FLSTRD instruction reads the error information (error flag) for errors having occurred in the CF-ADP.
6. When is "K1280 (H500)" the FLSTRD instruction reads error codes and error code details. Up to 5 of the latest error codes and error code details can be stored. For details, refer to Detailed explanation of setting data.
Show 19 more labels / short text on this page
Instruction · name Operation Execution · form · d s n · Input variable · Output variable · Operand · Special · unit Index Cons · Real Number · Character · user · tant · String Pointer · type · z z · z z z · Applied Instruction List · d s n
Page 792 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Detailed explanation of setting data
Page 792 · click to enlarge
Page 792

34 Applied Instructions (FX3U-CF-ADP)

34.6 FLSTRD / FX3U-CF-ADP status read

Detailed explanation of setting data

Details of the setting data in the FLSTRD instruction are as shown below.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Detailed explanation of setting data diagram (page 792)
Fig. 720 · Detailed explanation of setting data

Contents of status to be read K0 to K63 : Final line position of each file

K256(H100)File IDs stored in the CompactFlash TM card

K512(H200) : Capacity of the CompactFlashTM card K768(H300) : Version of the CF-ADP K1024(H400) : Error information (error flag) K1280(H500) : Error codes

Channel number used by the CF-ADP K1 : ch1 K2 : ch2

Head device to which the read status is written

The number of data points stored in varies depending on the contents of the read status.

  • When is "K0" to "K63" The FLSTRD instruction reads the final line position and final column position of each file.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Detailed explanation of setting data diagram (page 792)
Fig. 721 · Detailed explanation of setting data

Final line position K1 to the specified maximum line position

  • When is "K256 (H100)" The FLSTRD instruction reads file IDs stored in the CompactFlash TM card. For a file ID corresponding to the read data, refer to the file ID correspondence table shown below. When a file exists, a bit corresponding to the file ID turns ON.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Detailed explanation of setting data diagram (page 792)
Fig. 722 · Detailed explanation of setting data

File ID correspondence table

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Detailed explanation of setting data diagram (page 792)
Fig. 723 · Detailed explanation of setting data

items b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

+1 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16

+2 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32

+3 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48

  • When is "K512 (H200)" The FLSTRD instruction reads the data capacity, used space and free space of the CompactFlash TM card to the following devices respectively.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Detailed explanation of setting data diagram (page 792)
Fig. 724 · Detailed explanation of setting data

+1, Data capacity of the CompactFlashTM card (kB) Units, If the data capacity is less than 1 kB, "1" is stored.

+3, +2 Used space of the CompactFlashTM card (kB) Units, If the data size is less than 1 kB, "1" is stored.

+5, +4 Free space of the CompactFlashTM card (kB) Units, If the data size is less than 1 kB, "1" is stored.

  • When is "K768 (H300)" The FLSTRD instruction reads the version information of the CF-ADP.

Stores the version of CF-ADP. (Example) K100 = Ver.1.00

Setting items Description

Page 793 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 793 · click to enlarge
Page 793

34 Applied Instructions (FX3U-CF-ADP)

34.6 FLSTRD / FX3U-CF-ADP status read

  • When is "K1024 (H400)" The FLSTRD instruction reads the error information (error flag).

Applied Instructions (Data Transfer 3)

b0 : The CompactFlashTM card is not mounted.

b1 : The CompactFlashTM card is full. b2 : An error has occurred in the CF-ADP. b3 : CF-ADP H/W error

Applied Instructions (High Speed Processing 2)

b4CompactFlash TM card error b5 to b15 : Not used
  • When is "K1280 (H500)" The FLSTRD instruction reads the error code and error code details for errors having occurred in the CFADP. Up to 5 of the latest error codes and error code details can be stored.

Applied Instructions (Extension File Register Control)

+1 Error code details 1

+2 Error code 2

+3 Error code details 2

Applied Instructions (FX3U-CF-ADP)

+4 Error code 3

+5 Error code details 3

+6 Error code 4

+7 Error code details 4

+8 Error code 5

Interrupt Function and Pulse Catch Function

+9 Error code details 5

Caution

A

1. It is not permitted to use an "FLCRT, FLDEL, FLWR, FLRD, FLCMD or FLSTRD" instruction and a following instruction for the same port: - "RS or RS2" instruction - "ADPRW" instruction - "IVCK, IVDR, IVRD, IVWR, IVBWR or IVMC" instruction

Relationships between devices and addresses

2. The instruction is provided in the FX 3U and FX 3UC PLCs Ver. 2.61 or later.

B

Show 5 more labels / short text on this page
Setting items Description · Error detection signal · Setting items Description · Error code 1 · Applied Instruction List
Page 794 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35. Interrupt Function and Pulse Catch Function
Page 794 · click to enlarge
Page 794

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.1 Outline

35 Interrupt Function and Pulse Catch Function

35. Interrupt Function and Pulse Catch Function

This chapter explains the built-in interrupt function and pulse catch function in FX PLCs. The input, special devices and timers in the explanations relate to the FX3U and FX3UC PLCs. Note that these differ from one model of PLC to another.

→ FX Structured Programming Manual [Device & Common]

This section explains the function to immediately execute an interrupt program (interrupt routine) without being affected by the operation cycle of the sequence program (main) while using an interrupt function as a trigger. The delay by operation cycle and machine operation affected by uneven time intervals in normal sequence program process can be improved.

1. Input interrupt function (interrupt of external signal input (X)) By the input signal from an input (X000 to X005), the normal sequence program is paused, and an interrupt routine program is executed with priority. The input interrupt execution timing can be specified on the rising edge or falling edge of the signal by the pointer number.

→ For details, refer to Section 35.3.

2. Input interrupt delay function (interrupt of external signal input (X)) By the input signal from an input (X000 to X005), the normal sequence program is paused, and an interrupt routine program is executed with priority after the delay time (set in units of 1 ms). The input interrupt execution timing can be specified on the rising edge or falling edge of the signal by the pointer number.

→ For details, refer to Section 35.4.

3. Timer interrupt function (timer interrupt activated in a constant cycle) The normal sequence program is paused in a constant cycle of 10 to 99 ms, and an interrupt routine program is executed with priority.

→ For details, refer to Section 35.5.

4. High speed counter interrupt function (interrupt function given at counting up) When the current value of a high speed counter reaches a specified value, the normal sequence program is paused and an interrupt routine program is executed with priority.

→ For details, refer to Section 35.6.

5. Pulse catch function When the input signal from an input (X000 to X007) turns ON from OFF, a special auxiliary relay ;M8170 to M8177 is set in the interrupt processing. By a relay M8170 to M8177 in a normal sequence program, a signal that remains ON longer than the receivable range with regular input processing can be easily received. When processing such a signal that turns ON and OFF several times in one operation cycle, however, use the input interrupt function.

→ For details, refer to Section 35.7.

6. Pulse width/Pulse period measurement function When the input signal from an input (X000, X001, X003 or X004) turns from OFF to ON, the value of the 1/6 μs ring counter at the input signal rising edge is stored in special data registers. When the input signal turns OFF from ON, the value of the 1/6 μs ring counter at the input signal falling edge is stored in special data registers. At the same time, the difference in the counter value between the rising edge and the falling edge is divided by "60", and the pulse width in units of 10 μs is stored in special data registers. In the pulse period measurement mode, when the input signal turns from OFF to ON, the difference between the previous rising of the input signal and the current rising of the input signal is divided by "60", and then the pulse period in units of 10 μs is stored in special data registers.

→ For details, refer to Section 35.8.

Page 795 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 795 · click to enlarge
Page 795

35 Interrupt Function and Pulse Catch Function

35.2 Common items

35.2 Common items

Applied Instructions (Data Transfer 3)

35.2.1 Interrupt function

Three types of interrupt, namely, input interrupt, timer interrupt and counter interrupt, are available. Observe the following in creating an interrupt program.

Applied Instructions (High Speed Processing 2)

1. Create a task for interrupt and main program.
2. Set an interrupt pointer in the event box for the interrupt program.

Applied Instructions (Extension File Register Control)

Set an interrupt pointer

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

For the interrupt pointers set in the event box, refer to their respective explanations.

3. The IRET instruction does not need to be programmed because, at the time of compilation, it is automatically added to the end of the program registered for the interrupt program task.

A

Relationships between devices and addresses

B

Applied Instruction List

Page 796 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DI EN
Page 796 · click to enlarge
Page 796

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.2 Common items

35 Interrupt Function and Pulse Catch Function

35.2.2 How to disable interrupt function and pulse catch function

This section describes how to disable the interrupt function and pulse catch function.

1. Limiting the program interrupt range [interrupt function and pulse catch function]

1. Programming method Program the DI instruction to set the interrupt disabled zone. Even if an interrupt is generated between the DI instruction and EI instruction (interrupt disabled zone), the interrupt is executed after the EI instruction.
2. Program example

EI EN EO

Interrupts are enabled.

DI EN

EO

Interrupts are disabled.

3. Cautions a) The interrupt inputs with special auxiliary relay for interrupt disable (M8050 to M8059) turned ON are

excluded. This special auxiliary relay is not available for pulse catch function. b) When the disabled zone is long, interrupts are accepted, but the interrupt processing is started after

considerable time. When the interrupt disabling setting is not required, program only EI instruction. It is not always necessary to program DI instruction.

[Main program]

Page 797 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.2.3 Related items
Page 797 · click to enlarge
Page 797

35 Interrupt Function and Pulse Catch Function

35.2 Common items

2. Disabling interrupt pointers (for each interrupt routine) [interrupt function]

Applied Instructions (Data Transfer 3)

1. Programming method The special auxiliary relays M8050 to M8059 for disabling interrupt are provided. While an interrupt disable flag (M8050 to M8059) is ON, a corresponding interrupt program is not executed even if the interrupt disable flag is set to OFF after a corresponding interrupt is generated.

Input interrupt The input interrupts X000 to X005 correspond to M8050 to M8055*1 respectively. When a relay M8050 to M8055 turns ON, a corresponding input interrupt is disabled.

Applied Instructions (High Speed Processing 2)

Timer interrupt The timer interrupts 16 to 18 correspond to M8056 to M8058*1 respectively. When a relay M8056 to M8058 turns ON, a corresponding timer interrupt is disabled.

High speed counter interrupt When M8059*1 turns ON, all of the high speed counter interrupts 1010 to 1060 are disabled.

*1. Cleared when the PLC mode is changed from RUN to STOP.

2. Program example In the program example shown below, when M8053 is set to ON by M20, the interrupt input I301 triggered by X003 is disabled.

Applied Instructions (Extension File Register Control)

EI EN ENO

Applied Instructions (FX3U-CF-ADP)

M20

M8053

Interrupts are enabled.

Command to disable an interrupt triggered by X003

Interrupt Function and Pulse Catch Function

[Interrupt program] (EventI301)

When the rising edge of X003 is detected

A

Relationships between devices and addresses

35.2.3 Related items

B

1. Using the I/O refresh function (REF instruction) When controlling an input relay or output relay in an interrupt program, the I/O refresh instruction REF can be used to acquire the latest input information and immediately output the operation result. As a result, high speed control is achieved without being affected by the operation cycle of the PLC.
2. Interrupt operation while FROM/TO instruction is executed. The interrupt operation is executed as follows depending on the ON/OFF status of the special auxiliary relay M8028.
1. While M8028 is OFF While FROM/TO instructions are being executed, interrupts are automatically disabled. Input interrupts and timer interrupts are not executed. Interrupts generated during this period are immediately executed when the execution of FROM/TO instructions are completed. FROM/TO instruction can be used in an interrupt program when M8028 is OFF.
2. While M8028 is ON When an interrupt is generated while FROM/TO instruction is being executed, execution of the FROM/TO instruction is paused and the interrupt program is executed. FROM/TO instructions cannot be used in an interrupt routine program when M8028 is ON.

[Main program] · Interrupt routine · Applied Instruction List

Page 798 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8000
Page 798 · click to enlarge
Page 798

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.2 Common items

35 Interrupt Function and Pulse Catch Function

35.2.4 Cautions on use (common)

This section explains common cautions on using the interrupt function or pulse catch function. Specific cautions on each interrupt function are explained in the description of each interrupt function.

1. Processing when many interrupts are generated When many interrupts are generated in turn, priority is given to the first one. When many interrupts are generated at the same time, priority is given to the one having the smallest pointer number. While an interrupt routine is being executed, other interrupts are disabled.
2. When double interrupt (interrupt during another interrupt) is required [interrupt function] Usually, interrupts are disabled in an interrupt routine (program). When EI and DI instructions are programmed in an interrupt routine, up to two interrupts can be accepted. The FX 1S , FX 1N , FX 1NC , FX 3S , FX 3G or FX 3GC PLC does not support this function.
3. Operation when a timer is used [interrupt function] Note that counting using a general timer is disabled, even a 1 ms retentive type timer. In an interrupt routine, use timers for routine program T192 to T199 *1 .

*1. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S or FX3G PLC does not support the timers for routine programs.

4. Non-overlap of input [input interrupt (with or without delay function) and pulse catch function] The inputs X000 to X007 can be used for high speed counters, input interrupts, pulse catch, SPD, ZRN, DSZR and DVIT instructions and for general purpose inputs. Make sure that input terminals do not overlap with each other.

5. Operation of devices latched in the ON status [interrupt function] Devices which were set to ON in an interrupt routine are held in the ON status even after the interrupt routine is finished. When RST instruction for a timer or counter is executed, the reset status of the timer or counter is also held. To turn OFF a device held in the ON status or for canceling such a timer or counter held in the reset status, reset such a device or deactivate RST instruction respectively inside or outside routine.

Example in which outputs are latched In the program example shown below, the counter C0 is provided to count X001. When X000 turns ON from OFF, the interrupt program I001 is executed only in one scan, and then the counter C0 is reset and Y007 is output.

1. Program example

EI EN ENO

OUT_C EN ENO CCoil CValue

K10

[Interrupt program] (EventI001)

M8000

RST EN ENO

Y007

[Main program]

Page 799 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.2.4 Cautions on use (common)
Page 799 · click to enlarge
Page 799
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.2.4 Cautions on use (common) diagram (page 799)
Fig. 725 · 35.2.4 Cautions on use (common)

Current value of C0 1 2 3 Counter is reset.

Because the C0 reset instruction is valid, the current value of C0 remains unchanged even if pulses are input.

Program to deactivate the preceding C0 RST instruction inside the subroutine.

2. Timing chart
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.2.4 Cautions on use (common) diagram (page 799)
Fig. 726 · 35.2.4 Cautions on use (common)

Counter reset instruction is deactivated (part in above program). B

Page 800 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — X000 I001 I000 M8050 *2
Page 800 · click to enlarge
Page 800

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

35 Interrupt Function and Pulse Catch Function

35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

35.3.1 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

1. Outline An interrupt routine is executed by the input signal from an input X000 to X005.
2. Application Because the external input signal can be processed without being affected by the operation cycle of the PLC, this interrupt is suitable to high speed control and receiving of short pulses.

3. Basic program (programming procedure)

EI EN ENO

Interrupts are enabled.

Interrupt inputs are accepted after EI instruction. It is not necessary to program DI (disable interrupt) instruction if there is no zone where input interrupts should be disabled.

[Interrupt program] (EventI001)
[Interrupt program] (EventI001)

When the rising edge of X000 is detected

When X000 turns ON, its rising edge is detected, and the interrupt routine 1) is executed. The program execution returns to the main program after executing routine 1).

Interrupt routine 1) (Interrupt program)

[Interrupt program] (EventI100)

When the falling edge of X001 is detected

When X001 turns OFF, its falling edge is detected, and the interrupt routine 2) is executed. The program execution returns to the main program after executing routine 2).

Interrupt routine 2) (Interrupt program)

4. Number and operation of (six) interrupt pointers

0:Interrupt at falling edge 1:Interrupt at rising edge

0 to 5 according to the inputs X000 to X005

Input number*1 Pointer number

Interrupt disable command Interrupt at rising edge Interrupt at falling edge

X000 I001 I000 M8050 *2

X001 I101 I100 M8051 *2

X002 I201 I200 M8052 *2

X003 I301 I300 M8053 *2

X004 I401 I400 M8054 *2

X005 I501 I500 M8055 *2

*1. The input numbers differ from one type of PLC to another. FX0, FX0S and FX0N PLCs: supports X000 to X003 only.

*2. Cleared when the PLC mode is changed from RUN to STOP.

[Main program] · [Main program] · Main program

Page 801 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — FX 2N , FX 2NC
Page 801 · click to enlarge
Page 801

35 Interrupt Function and Pulse Catch Function

35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

5. How to disable each interrupt input When either one among M8050 to M8055 is set to ON in a program, interrupts from the corresponding input number are disabled. (Refer to the previous page for the correspondence.)

Applied Instructions (Data Transfer 3)

6. Cautions

1. Do not use an input two or more times. Make sure that an input relay number used as an interrupt pointer is not used in high speed counters, pulse catch functions and pulse density instructions which use the same input range.

Applied Instructions (High Speed Processing 2)

2. Automatic adjustment of the input filter When an input interrupt pointer I 0 is specified, the input filter of the input relay is automatically changed to the input filter for high speed receiving. Accordingly, it is not necessary to change the filter value using REFF instruction or special data register D8020 (input filter adjustment). The input filter of an input relay not being used as an input interrupt pointer operates at 10 ms (initial value).

Applied Instructions (Extension File Register Control)

3. Pulse width of input interrupt For executing input interrupt by an external signal, it is necessary to input the ON or OFF signal having the duration shown in the table below or more.

Applied Instructions (FX3U-CF-ADP)

For the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs

PLC Input number Input filter value when "0" is set

FX3U, FX3UC X000 to X005 5μs*1

X000, X001, X003, X004 10μs

FX 3G , FX 3GC

X002, X005 50μs

Interrupt Function and Pulse Catch Function

X000, X001 10μs

FX 3S

X002, X003, X004, X005 50μs

*1. When using the input filter at the filter value of 5 μs or when receiving a pulse whose response frequency is 50 k to 100 kHz using a high speed counter, perform the following. - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 Ω (1 W or more) to an input terminal, and make sure that the load current of the open collector transistor output in the counterpart equipment is 20 mA or more including the input current in the main unit.

A

Relationships between devices and addresses

For the FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs

B

PLC Input number Pulse width

X000, X001 10μs

FX 1S , FX 1N , FX 1NC

X002 to X005 50μs

X000, X001 20μs

FX 2N , FX 2NC

X002 to X005 50μs

For the FX0S, FX0, FX0N, FXU and FX2C PLCs

PLC Input number Pulse width

FX0S, FX0, FX0N X000 to X003 100μs

FXU, FX2C X000 to X005 200μs

4. Using a pointer number two or more times It is not possible to program an interrupt at the rising edge and an interrupt at the falling edge for an input such as I001 or I000.

Applied Instruction List

Page 802 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — SET EN ENO
Page 802 · click to enlarge
Page 802

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

35 Interrupt Function and Pulse Catch Function

7. Program example

1. When using both an external input interrupt at the rising edge and the output refresh (REF instruction) In the program example shown below, the output Y000 immediately turns ON when the rising edge of the external input X000 is detected.

EI EN ENO

Interrupts are enabled by EI instruction. The main program is described.

[Interrupt program] (EventI001)

When the rising edge of X000 is detected

When an interrupt routine is executed by turning ON of X000, Y000 is reset unconditionally.

SET EN ENO

M8000

Y000

The outputs Y000 to Y007 are overwritten with the latest information by the output refresh instruction. If the output refresh instruction is not provided, Y000 turns ON after END instruction after the program execution returned to the main routine.

REF EN d n

Y000

K8 *1

If "SET Y000" is changed to "RST Y000", Y000 is immediately set to OFF by turning ON of X000.

*1. Be sure to specify a multiple of "8" for the number of inputs/outputs to be refreshed by REF instruction. If any value other than a multiple of "8" is specified, an operation error occurs and REF instruction is not executed.

2. When using both an input interrupt and the input refresh (REF instruction) In the program example shown below, an interrupt is executed using the latest input information.

EI EN ENO

Interrupts are enabled by EI instruction. The main program is described.

[Interrupt program] (EventI101)

When the rising edge of X001 is detected

REF EN d n

When an interrupt routine is executed by turning X001 to ON, the input refresh is executed unconditionally, and the ON/OFF information of X010 to X017 at the current time is received.

M8000

ENO RUN monitor X010

K8 *1

Y001 is set to ON or OFF according to the ON/OFF status of X010.

SET EN ENO

Y001

RST EN ENO

Y001

*1. Be sure to specify a multiple of "8" for the number of inputs/outputs to be refreshed by REF instruction. If any value other than a multiple of "8" is specified, an operation error occurs and REF instruction is not executed.

[Main program] · RUN monitor · [Main program]

Page 803 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8000
Page 803 · click to enlarge
Page 803

35 Interrupt Function and Pulse Catch Function

35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

3. When counting the number of times of input generation (in the same way as single phase high speed counter) In the program example shown below, external inputs are counted.

Applied Instructions (Data Transfer 3)

Interrupts are enabled by EI instruction. The main program is described.

EI EN ENO

Applied Instructions (High Speed Processing 2)

[Interrupt program] (EventI201)

When the rising edge of X002 is detected

When X002 turns ON, "1" is added to the value of D0. INC instruction executes increment in every operation cycle, but the interrupt routine is executed only once by an input signal. Accordingly, it is not necessary to use INCP (pulse operation type) instruction.

INC EN ENO

Applied Instructions (Extension File Register Control)

M8000

4. When catching a short pulse In the program example shown below, the ON status is held for a certain period of time after a short pulse turns ON.

Applied Instructions (FX3U-CF-ADP)

M0 ON ON

TO TO

Interrupt Function and Pulse Catch Function

EI EN ENO

Interrupts are enabled by EI instruction.

A

M0

Relationships between devices and addresses

The period of time to hold M0 is specified.

M0

OUT_T EN ENO TCoil TValue

B

T0

RST EN ENO

After the timer time, M0 is reset.

M0

[Interrupt program] (EventI301)

When the rising edge of X003 is detected

M8000

SET EN ENO

When X003 turns ON and the interrupt routine is executed, M0 is set to ON unconditionally.

Show 9 more labels / short text on this page
[Main program] · RUN monitor · d D0 · Pulse input X003 · [Main program] · Preparation for measurement · TCo K10 · Applied Instruction List · RUN monitor M0
Page 804 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.3.2 Examples of practical programs (programs to measure short pulse width)
Page 804 · click to enlarge
Page 804

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

35 Interrupt Function and Pulse Catch Function

35.3.2 Examples of practical programs (programs to measure short pulse width)

By using a 1 ms retentive type timer or the special data register D8099 (high speed ring counter), the short pulse width can be measured in 1 ms or 0.1 ms units.

1. Example of measuring short pulse width with retentive 1 ms timer The sequence diagram below takes the FX 3U PLC (sink input) as an example.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.3.2 Examples of practical programs (programs to measure short pulse width) diagram (page 804)
Fig. 727 · 35.3.2 Examples of practical programs (programs to m…

Interrupts are enabled by EI instruction. The main program is described.

When X000 turns ON, the 1 ms timer T246 is started up by the interrupt I001.

When X001 turns OFF, the current value of T246 is transferred to the data register D0 for storing the measured value by the interrupt I100, and M0 for the complete signal is set to ON.

Page 805 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 805 · click to enlarge
Page 805

35 Interrupt Function and Pulse Catch Function

35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]

2. Example of program to measure the short pulse width using a high speed ring counter (For FX 3U and FX 3UC PLCs only)

Applied Instructions (Data Transfer 3)

EI EN ENO

Interrupts are enabled by EI instruction. The main program is described.

Applied Instructions (High Speed Processing 2)

M8099 D8099 X010

The ring counter is set to ON.

Applied Instructions (Extension File Register Control)

[Interrupt program] (EventI001)

When the rising edge of X000 is detected

When X000 turns ONThe ring counter is reset to OFF, and measurement is started. RST EN ENO

Applied Instructions (FX3U-CF-ADP)

RST EN ENO

M0

[Interrupt program] (EventI100)

When the rising edge of X001 is detected

Interrupt Function and Pulse Catch Function

When X001 turns OFF: The ring counter value is transferred to D0, and measurement is completed.

SET EN ENO

A

Relationships between devices and addresses

The special data register M8099 up-counts the 0.1 ms clock from the next operation cycle after being driven. When the count value exceeds "32,767", it is returned to "0".

B

Show 5 more labels / short text on this page
[Main program] · MOV EN s · d D0 D8099 · d M0 · Applied Instruction List
Page 806 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Timing chart
Page 806 · click to enlarge
Page 806

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.4 Input Interrupt (Interrupt by External Signal) [With Delay function]

35 Interrupt Function and Pulse Catch Function

35.4 Input Interrupt (Interrupt by External Signal) [With Delay function]

1. Outline An input interrupt has the function to delay execution of an interrupt routine in units of 1 ms. The delay time can be specified using the pattern program shown below. By using the delay function, the mounting position of a sensor used for input interrupts can be adjusted electrically without changing the actual position. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G or FX3GC PLC does not support this function.

2. Programming procedure

[Interrupt program] (EventI )

Contact for setting delay time

M8393 MOV EN s

Delay time specification program Be sure to describe the delay time specification program shown on the left at the head of an interrupt routine program. Because this program is a pattern program, change only the delay time 1). Only a constant (K) or data register (D) is available for specifying the time here *.

K *

1. Delay time (unit: ms)

Program to be executed as input interrupt

3. Timing chart

Because the previous interrupt processing is not completed, the interrupt processing is not executed here.

Interrupt input(X000 to X005)

Interrupt input is executed

Delay time (ms) IRET instruction

Valid

Page 807 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 5. Cautions
Page 807 · click to enlarge
Page 807

35 Interrupt Function and Pulse Catch Function

35.5 Timer Interrupt (Interrupt in Constant Cycle)

35.5 Timer Interrupt (Interrupt in Constant Cycle)

Applied Instructions (Data Transfer 3)

35.5.1 Timer Interrupt (Interrupt in Constant Cycle)

1. Outline An interrupt routine is executed at every 10 to 99 ms without being affected by the operation cycle of a PLC. The FX 0S , FX 0 , FX 0N , FX 1S , FX 1N or FX 1NC PLC does not support the timer interrupt function.

Applied Instructions (High Speed Processing 2)

2. Application This type of interrupt is suitable when a certain program should be executed at high speed while the main program operation time is long or when a program should be executed at a constant time interval in sequence operations.

Applied Instructions (Extension File Register Control)

3. Basic program (programming procedure)

Interrupts are enabled. EI EN ENO

Timer interrupts are enabled after EI instruction. It is not necessary to program DI (disable interrupt) if there is no zone where timer interrupts should be disabled.

Applied Instructions (FX3U-CF-ADP)

[Interrupt program] (EventI620)

When interrupt is given at every 20 ms.

Interrupt Function and Pulse Catch Function

The interrupt routine is executed at every 20 ms. Create a program to be executed as interrupt. IRET instruction returns the program execution to the main program.

A

Relationships between devices and addresses

4. Number and operation of (three) timer interrupt pointers

B

Timer time 10 to 99 (ms)

Timer interrupt pointer 6,7,8

An interrupt program is executed at every specified interrupt cycle time (10 to 99 ms). Use this type of interrupt in control requiring cyclic interrupt processing regardless of the operation cycle of a PLC.

Input number Interrupt cycle (ms) Interrupt disable flag

M8056 *1

I7 M8057 *1

An integer in the range from 10 to 99 is put in " " in the pointer name. Example: "I610" indicates a timer interrupt at every 10 ms.

I8 M8058 *1

*1. Cleared when the PLC mode is changed from RUN to STOP.

Caution

If the timer interrupt time is set to 9 ms or less, the timer interrupt processing may not be executed in an accurate cycle in the following cases. Therefore, using a time that is over 10 ms is recommended.

  • When the interrupt program processing time is long.
  • When the main program contains an applied instruction whose processing time is long.

5. Cautions

  • Each pointer number (I6, I7 or I8) can be used only once.
  • When M8056 to M8058 is set to ON in a program, a corresponding timer interrupt is disabled.
Show 6 more labels / short text on this page
[Main program] · Main program · Main program · Interrupt program · Interrupt routine · Applied Instruction List
Page 808 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ENO Y000
Page 808 · click to enlarge
Page 808

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.5 Timer Interrupt (Interrupt in Constant Cycle)

35 Interrupt Function and Pulse Catch Function

6. Program example In the program example shown below, data is added and addition result is compared with the set value at every 10 ms.
1. Program example

Interrupts are enabled by EI instruction. The main program is described.

EI EN ENO

SET EN ENO

When M3 is set to ON, INC instruction becomes valid.

M3

[Interrupt program] (EventI610)

When interrupt is given at every 10 ms

INC EN ENO

"1" is added to the current value of D0 at every 10 ms.

M3

When the current value of D0 reaches "1000", M3 is reset.

LD-EQ EN s1 s2

RST EN ENO

M3

The current value of D0 is ramp data which changes from "0" to "1000" in 10 seconds. In the program example using RAMP instruction shown later, the ramp data is made using a dedicated instruction.

35.5.2 Example of practical program (timer interrupt program using instruction)

RAMP, HKY, SEGL, ARWS and PR instructions execute a series of operations in synchronization with the scan time. Because the total time may be too long or time fluctuation may cause a problem in these instructions, it is recommended to execute these instructions at a constant time interval using the timer interrupt function. When not using the timer interrupt function, use the constant scan mode.

1. Timer interrupt processing of HKY instruction

EI EN ENO

Interrupts are enabled by EI instruction. The main program is described.

[Interrupt program] (EventI620)

M8000

REF EN d n

ENO X000

K8

Y000 D0 M0

REF EN d n

ENO Y000

K8

Show 5 more labels / short text on this page
[Main program] · d K1000 · [Main program] · HKY EN s · d3 d2
Page 809 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8029
Page 809 · click to enlarge
Page 809

35 Interrupt Function and Pulse Catch Function

35.5 Timer Interrupt (Interrupt in Constant Cycle)

2. Timer interrupt processing of RAMP instruction The ramp signal output circuit shown below is programmed using the timer interrupt function executed every 10 ms.

Applied Instructions (Data Transfer 3)

1. Ramp output pattern D4 is occupied as a register for counting the number of times of execution.

Applied Instructions (High Speed Processing 2)

While M8026 is ON

While M8026 is OFF 10 seconds

X000 = ON

Applied Instructions (Extension File Register Control)

2. Program

EI EN ENO

Interrupts are enabled by EI instruction. The main program is described.

Applied Instructions (FX3U-CF-ADP)

With M8026 turned ON, when the value of (D3) reaches the final value (D2), the value of Y is latched.

M8026

As soon as the start command is given, the initial value (D1) and target value (D2) are transferred.

K1

Interrupt Function and Pulse Catch Function

K255

PLS EN ENO

A

M0

Relationships between devices and addresses

SET EN ENO

M0

B

[Interrupt program] (EventI610)

When interrupt is given at every 10 ms

RAMP EN s1 s2

While the instruction is executed 1000 times (in 10 seconds), the contents of D3 are changed from the value of D1 to the value of D2.

M1

(Initial value)D1 D3 (Current value)

n (Number of times of transfer)K1000

When the instruction execution complete flag M8029 turns ON, RAMP instruction drive input is set to OFF. If RAMP instruction is continuously executed while M8026 is OFF, the value of D3 returns to the initial value (D1) immediately after it reaches the final value (D2), and then the same operation is repeated. This program is not necessary when M8026 is ON.

M8029

RST EN ENO

M1

Show 10 more labels / short text on this page
M8029 Execution completed · [Main program] · MOV EN s · Start · d D1 · MOV EN s · d D2 · d M1 · Applied Instruction List · (Target value)D2
Page 810 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Y000
Page 810 · click to enlarge
Page 810

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.5 Timer Interrupt (Interrupt in Constant Cycle)

35 Interrupt Function and Pulse Catch Function

3. Cautions

1. When the HKY, SEGL or PR instruction is used in an interrupt program, the instruction turns ON M8029 in the interrupt program. When M8029 is referred to in the main program as shown below, M8029 may be changed by an interrupt program depending on the interrupt timing, even if M8029 is referred to immediately after an instruction. As a result, whether the instruction is executed completely cannot be determined properly.

EI EN ENO

IVCK EN ENO

IVCKInstruction to use M8029

M100

K6 H6F

d s1 s2 n

K1

When an interrupt occurs at this timing, whether the instruction is executed completely cannot be determined properly.

M8029

RST EN ENO

[Interrupt program] (EventI620)

When interrupt is given at every 20 ms.

REF EN d n

M8000

K8

Y000 D0 M0

REF EN d n

Y000

K8

Show 5 more labels / short text on this page
Program examples · [Main program] · RUN monitor · HKY EN s · d1 d2 d3
Page 811 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.5.2 Example of practical program (timer interrupt program using instruction)
Page 811 · click to enlarge
Page 811
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.5.2 Example of practical program (timer interrupt program using instruction) diagram (page 811)
Fig. 728 · 35.5.2 Example of practical program (timer interrupt…
2. Countermeasures Disable interrupts using the DI instruction in the section from the instruction which uses M8029 in the main program to the point after M8029 is referred to.
Page 812 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — M8059 *1
Page 812 · click to enlarge
Page 812

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counter

35 Interrupt Function and Pulse Catch Function

35.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counter

1. Outline This type of interrupt utilizes the current value of a high speed counter. The FX 0S , FX 0 , FX 0N , FX 1S , FX 1N , FX 1NC , FX 3S , FX 3G or FX 3GC PLC does not support the counter interrupt function. The FX U PLC of V 3.07 or later supports the counter interrupt function.
2. Application This type of interrupt is used together with the DHSCS_I instruction (high speed counter interrupt) to execute an interrupt routine when the current value of a high speed counter reaches the specified value.

3. Basic program (programming procedure)

Main program Interrupts are enabled by EI instruction. The main program is described.

EI EN ENO

M8000

OUT_C EN ENO CCoil CValue

The coil of a high speed counter is driven, and an interrupt pointer is specified in DHSCS_I instruction.

CC255 K2,147,483,647

DHSCS EN ENO DHSCS_I EN s1

ENO K1000

Interrupt point number is specified.

When counter interrupt is specified [Interrupt program] (Event: I010)

When the current value of C255 changes from "999" to "1000" or from "1001" to "1000", the PLC executes the interrupt routine. For use examples of interrupt program, refer to the above description of input interrupt pointers.

Interrupt subroutine (Interrupt program)

*1. When the comparison value specified by a data register, etc. is changed, the current value is actually changed to the specified value when END instruction is executed.

4. Number and operation of (six) counter interrupt pointers

Counter interrupt pointer (1 to 6)

Pointer No. Interrupt disable flag

M8059 *1

*1. Cleared when the PLC mode is changed from RUN to STOP.

RUN monitor · *1 · s2 i CN255

Page 813 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — X004 M8174 *2
Page 813 · click to enlarge
Page 813

35 Interrupt Function and Pulse Catch Function

35.7 Pulse Catch Function[M8170 to M8177]

5. When setting an interrupt output (Y or M) to ON or OFF using a high speed counter When only controlling the ON/OFF status of an output relay (Y) or auxiliary relay (M) according to the current value of a high speed counter, a required program can be easily created using DHSCS, DHSCR or DHSZ instruction.

Applied Instructions (Data Transfer 3)

6. Cautions

1. Pointer number Pointer numbers cannot overlap with each other.

Applied Instructions (High Speed Processing 2)

2. Disabling interrupts When the special auxiliary relay M8059 is set to ON in a program, all counter interrupts are disabled.

35.7 Pulse Catch Function[M8170 to M8177]

Applied Instructions (Extension File Register Control)

When the input relay X000 to X007 turns ON from OFF after the EI instruction is executed, the special auxiliary relay M8170 to M8177 is set for interrupt processing. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC does not require the EI instruction.

1. Assignment of input numbers and special auxiliary relays

Applied Instructions (FX3U-CF-ADP)

Pulse catch input*1 Pulse catch relay

M8170 *2

(M8065*2 in the FX0S, FX0 and FX0N PLCs)

M8171 *2

(M8057*2 in the FX0S, FX0 and FX0N PLCs)

Interrupt Function and Pulse Catch Function

M8172 *2

(M8058*2 in the FX0S, FX0 and FX0N PLCs)

M8173 *2

A

(M8059*2 in the FX0S, FX0 and FX0N PLCs)

Relationships between devices and addresses

X004 M8174 *2

X005 M8175 *2

X006 M8176 *2

B

X007 M8177 *2

*1. Differs from one PLC to another. FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC: Supports X000 to X005 only. FX0S, FX0, FX0N : Supports X000 to X003 only.

*2. Cleared when the PLC mode is changed from STOP to RUN.

Applied Instruction List

Page 814 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 3. Cautions on use
Page 814 · click to enlarge
Page 814

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.7 Pulse Catch Function[M8170 to M8177]

35 Interrupt Function and Pulse Catch Function

2. Program example

The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC does not require the EI instruction.

When the rising edge of X000 is detected, M8170 is set as interrupt. The pulse catch result is reset.

EI

Input pulse width (shown below)

M8170

PLC Input number Pulse width

X000 to X005 5 μs or more*1

FX 3U , FX 3UC

X006, X007 50 μs or more

X000, X001, X003, X004 10 μs or more

FX 3G , FX 3GC

X002, X005 50 μs or more

X000, X001 10 μs or more

FX 3S

X002 to X005 50 μs or more

X000, X001 20 μs or more

FX 2N , FX 2NC

X002, X005 50 μs or more

X000, X001 10 μs or more

FX 1S , FX 1N , FX 1NC

X002, X005 50 μs or more

FX2, FX2C X000 to X005 50 μs or more

FX0S, FX0, FX0N X000 to X003 50 μs or more

*1. When using the pulse catch function at 5μs or when receiving a pulse whose response frequency is 50 kHz to 100 kHz using a high speed counter, perform the following: - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 Ω (1 W or more) to an input terminal, and make sure that the load current of the open collector transistor output in the counterpart equipment is 20 mA or more including the input current in the main unit.

3. Cautions on use

1. When receiving an input again, it is necessary to reset the device which was once set using a program. Accordingly, until a device is reset, a new input cannot be received.
2. When it is necessary to receive continuous short pulses (input signals), use the external input interrupt function or high speed counter function.
3. A filter adjustment program is not required.
4. The pulse catch function is executed regardless of the operations of the special auxiliary relays M8050 to M8055 for respectively disabling interrupts.

Reset input · X000 (Input) · X002 (Reset)

Page 815 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — EN ENO
Page 815 · click to enlarge
Page 815

35 Interrupt Function and Pulse Catch Function

35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

Applied Instructions (Data Transfer 3)

This function is supported only in FX3G PLC (Ver.1.10 or later) and FX3GC.

The pulse width/pulse period measurement function stores the values of 1/6 μs ring counters at the input signal rising edge and falling edge to special data registers. This function also divides by "60" the difference in the counter value (pulse width) between the rising edge and the falling edge or the difference in the counter value (pulse period) between the previous rising edge and the current rising edge, and stores the obtained pulse width or pulse period in units of 10 μs to special data registers.

Applied Instructions (High Speed Processing 2)

The pulse width/pulse period measurement function becomes valid when a program is described using M8075 as a contact. Specify the pulse width measurement flag in the subsequent OUT instruction, and set an input terminal to be used. When the pulse width/pulse period measurement function is valid, it always operates while the PLC mode is RUN.

Applied Instructions (Extension File Register Control)

Assignment of special auxiliary relays and special data registers

Pulse width/ Pulse period measurement

Applied Instructions (FX3U-CF-ADP)

for rising edge*1

for falling edge*1

period *1*2 [Unit10 μ s]
[Unit1/6 μ s]
[Unit1/6 μ s]

X000 M8076 M8080 D8075, D8074 D8077, D8076 D8079, D8078

X001 M8077 M8081 D8081, D8080 D8083, D8082 D8085, D8084

X003 M8078 M8082 D8087, D8086 D8089, D8088 D8091, D8090

X004 M8079 M8083 D8093, D8092 D8095, D8094 D8097, D8096

Interrupt Function and Pulse Catch Function

*1. Cleared when the PLC mode switches from STOP to RUN.

*2. The measurable pulse width is 10 μs minimum and 100 s maximum. The measurable pulse period is 20 μs minimum and 100 s maximum.

1. Program example

A

1. Pulse width measurement The pulse width of the input signal from X000 is measured.

Relationships between devices and addresses

ON

OFF X000

B

This duration is measured.

EI

EN ENO

M8075

M8076

X000 is used for the pulse width/pulse period measurement function.

Pulse width/Pulse period measurement setting flag

[Interrupt program] (EventI000)

X000 Falling edge interrupt

M8000

DMOV

When the interrupt routine is executed at the falling edge of the input signal from X000, the pulse width of input signal from X000 stored in D8078 and D8079 is transferred to D1 and D0.

EN ENO

VAR_01 *1 VAR_02 *2

*1. VAR_01 is a global label and is defined as D8078. *2. VAR_02 is a global label and is defined as D0.

Show 12 more labels / short text on this page
Ring counter value · Ring counter value · Pulse width /Pulse · Pulse period · Pulse input · measurement mode · flag · [Main program] · Applied Instruction List · RUN monitor · s d · User program
Page 816 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
Page 816 · click to enlarge
Page 816

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

35 Interrupt Function and Pulse Catch Function

2. Pulse period measurement The pulse period of the input signal from X000 is measured.
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097] diagram (page 816)
Fig. 729 · 35.8 Pulse width/Pulse period measurement function […

X000 is used for the pulse width/pulse period measurement function.

When X002 turns ON, the pulse period measurement mode is actuated.

When the interrupt routine is executed at the rising edge of the input signal from X000, the pulse period of input signal from X000 stored in D8078 and D8079 is transferred to D1 and D0.

*1. VAR_01 is a global label and is defined as D8078. *2. VAR_02 is a global label and is defined as D0.

- Timing chart The pulse period is not measured when the input signal rises for the first time after the PLC mode is changed from STOP to RUN, or when the input signal rises for the first time after the pulse period measurement mode (M8080) is set to ON from OFF. (Accordingly, D8078 and D8079 are not updated.) The pulse period is measured when the input signal rises at the next time. (As a result, D8078 and D8079 are updated.)

Make the pulse width/pulse period measurement setting flag (M8080) remain OFF for 1 operation cycle or more when discontinuing the pulse input. If M8080 does not remain OFF for 1 operation cycle or more, the "a" period shown below is stored as the pulse period.

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097] diagram (page 816)
Fig. 730 · 35.8 Pulse width/Pulse period measurement function […

The pulse period is measured. (D8078 and D8079 are updated.)

The pulse period is measured. (D8078 and D8079 are updated.)

Page 817 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 817 · click to enlarge
Page 817

35 Interrupt Function and Pulse Catch Function

35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

3. Signal delay time measurement The delay time from the rising edge of the input signal from X000 to the rising edge of the input signal from X001 is measured.

Applied Instructions (Data Transfer 3)

OFF ON

OFF ON

Applied Instructions (High Speed Processing 2)

This duration is measured.

EI

Applied Instructions (Extension File Register Control)

EN ENO

M8075

M8076 X000 is used for the pulse width/pulse period measurement function.

Pulse width/Pulse period measurement setting flag

M8077 X001 is used for the pulse width/pulse period measurement function.

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

A

Relationships between devices and addresses

B

[Main program] · Applied Instruction List

Page 818 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — D8 D10
Page 818 · click to enlarge
Page 818

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

35 Interrupt Function and Pulse Catch Function

The interrupt routine is executed at the rising edge of the input signal from X001. [Interrupt program] (Event: I101)

X001 Rising edge interrupt

DMOV M8000

EN ENO

The ring counter value at the rising edge of the input signal from X000 stored in D8074 and D8075 is transferred to D1 and D0.

D8074 D0

DMOV

EN ENO

The ring counter value at the rising edge of the input signal from X001 stored in D8080 and D8081 is transferred to D3 and D2.

D8080 D2

DSUB

EN ENO

The value "Ring counter value at the rising edge of the input signal from X001 - Ring counter value at the rising edge of the input signal from X000" is stored in D9 and D8.

D2 D8

When either one between the ring counter value at the rising edge of the input signal from X000 and the ring counter value at the rising edge of the input signal from X001 is located within the range from H80000000 to HFFFFFFFF, the following process is executed, and the value "Ring counter value at the rising edge of the input signal from X001 - Ring counter value at the rising edge of the input signal from X000" is stored in D9 and D8*1.

LDD>=

ANDD<

DSUB

EN ENO

EN ENO

H7FFFFFFF D4 EN ENO s1 d

DSUB

X000 Rising edge ring counter value: H0 to H7FFFFFFF X001 Rising edge ring counter value: H80000000 to HFFFFFFFF

D2 D6 EN ENO s1 d

DADD

D4 D8 EN ENO s1 d

DINC

D8 EN ENO

LDD<

ANDD>=

DSUB

EN ENO

EN ENO

HFFFFFFFF D4 EN ENO s1 d

DSUB

X000 Rising edge ring counter value: H80000000 to HFFFFFFFF X001 Rising edge ring counter value: H0 to H7FFFFFFF

D2 D8 EN ENO s1 d

DINC

D8 EN ENO

M8000 DDIV

EN ENO

The obtained value is converted into a value in units of 10 μs.

D8 D10

*1. The ring counter offers 32-bit data including the most significant bit. The DSUB instruction does not give a correct value because it handles the most significant bit as the sign bit. To obtain a correct value, add the processing inside the dotted frame.

Show 21 more labels / short text on this page
RUN monitor · s d · s d · s1 d · D0 s2 · s1 · s1 · D0 s2 · K0 s2 · K0 s2 · H80000000 s2 · D6 s2 · s1 · s1 · D0 s2 · K0 s2 · K0 s2 · D4 s2 · s1 d · K60 s2 · User program
Page 819 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 819 · click to enlarge
Page 819

35 Interrupt Function and Pulse Catch Function

35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]

2. Cautions on use

Applied Instructions (Data Transfer 3)

  • The pulse width/pulse period measurement function and input interrupts can be used at the same time in a same input terminal.
  • When a same input terminal is used by the pulse width/pulse period measurement function and the SPD, DSZR or ZRN instruction, an operation error occurs when the instruction is executed.
  • The input terminal used for the pulse width/pulse period measurement function cannot be used for the pulse catch function.

Applied Instructions (High Speed Processing 2)

  • When a same input terminal is used by the pulse width/pulse period measurement function and a high speed counter, a grammatical error occurs.
  • Make sure that the total frequency of four input channels is 50 kHz or less when using the pulse width/ pulse period measurement function.
  • When the pulse width/pulse period measurement function and a high speed counter are used together, the overall frequency of the high speed counter is affected.

Applied Instructions (Extension File Register Control)

→ FX Structured Programming Manual [Device & Common]

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

A

Relationships between devices and addresses

B

Applied Instruction List

Page 820 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Z7 Z6
Page 820 · click to enlarge
Page 820
Appendix ARelationships between devices and addresses

Appendix A: Relationships between devices and addresses

The table below shows the relationships between devices and addresses.

Device and address Example of corresponding device and

Device Address Device Address

Input relay X Xn %IXn X367 %IX247

Output relay Y Yn %QXn Y367 %QX247

Auxiliary relay M Mn %MX0.n M499 %MX0.499

Contact TS Tn %MX3.n TS191 %MX3.191

Coil TC Tn %MX5.n TC191 %MX5.191

Current value TN Tn %MW3.n %MD3.n

TN191 T190

%MW3.191 %MD3.190

Contact CS Cn %MX4.n CS99 %MX4.99

Coil CC Cn %MX6.n CC99 %MX6.99

Current value CN Cn %MW4.n %MD4.n

CN99 C98

%MW4.99 %MD4.98

Data register D Dn %MW0.n %MD0.n

D199 D198

%MW0.199 %MD0.198

device G Ux\Gn %MW14.x.n %MD14.x.n U0\G09 %MW14.0.10 %MD14.0.9

Extension register R Rn %MW2.n %MD2.n

R32767 R32766

%MW2.32767 %MD2.32766

Extension file register ER ERn Not corresponding - -

Pointer P Pn " "(blank) P4095 Not corresponding

Interrupt pointer I In Not corresponding - -

Nesting N Nn Not corresponding - -

Z Zn %MW7.n %MD7.n

Z7 Z6

%MW7.7 %MD7.6

V Vn %MV6.n V7 %MW6.7

State S Sn %MX2.n S4095 %MX2.4095

Show 6 more labels / short text on this page
Device · address · Timer · Counter · Intelligent function unit · Index register
Page 821 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — B
Page 821 · click to enlarge
Page 821
Appendix ARelationships between devices and addresses

MEMO

Applied Instructions (Data Transfer 3)

Applied Instructions (High Speed Processing 2)

Applied Instructions (Extension File Register Control)

Applied Instructions (FX3U-CF-ADP)

Interrupt Function and Pulse Catch Function

A

Relationships between devices and addresses

B

Applied Instruction List

Page 822 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — DFLTP
Page 822 · click to enlarge
Page 822
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-1 Applied instructions [by instruction type]

Appendix B: Applied Instruction List

[by Instruction Type / in Alphabetic Order]

Appendix B-1 Applied instructions [by instruction type]

Applied instructions are classified into the following twenty-one types:

1 Data transfer instructions 11 Program flow control instructions

2 Data conversion instructions 12 I/O refresh instructions

3 Comparison instructions 13 Real time clock control instructions

4 Arithmetic operation instructions 14 Pulse output / positioning control instructions

5 Logical operation instructions 15 Serial communication instructions

6 Special function instructions 16 Special block / unit control instructions

7 Rotation instructions 17 Extension register / extension file register control instructions

8 Shift instructions 18 FX3U-CF-ADP instructions

9 Data operation instructions 19 Other handy instructions

10 Character string operation instructions 20 External Device

1. Data move instructions

Mnemonic Function Ref. Page

Mnemonic Function Ref. Page

MOV

DEMOV

Floating Point Move 445 DEMOVP

DMOV

DHCMOV High Speed Counter Move 596

DMOVP

2. Data conversion instructions

SMOV

Shift Move 143 SMOVP

Mnemonic Function Ref. Page

CML

BCD

Conversion to Binary Coded Decimal 159 BCDP

DCML

DCMLP

DBCD

DBCDP

BMOV

Block Move 149 BMOVP

BIN

Conversion to Binary 163 BINP

FMOV

DBIN

Fill Move 154 FMOVP

DBINP

DFMOV

GRY

DFMOVP

Decimal to Gray Code Conversion 567 GRYP

PRUN

DGRY

Parallel Run (Octal Mode) 393 PRUNP

DGRYP

DPRUN

GBIN

DPRUNP

Gray Code to Decimal Conversion 569 GBINP

XCH

DGBIN

DGBINP

DXCH

FLT

DXCHP

Conversion to Floating Point 250 FLTP

SWAP

DFLT

Byte Swap 510 SWAPP

DFLTP

DSWAP

DSWAPP

Show 4 more labels / short text on this page
21 Extension Function · Move 139 MOVP · Complement 146 CMLP · Exchange 157 XCHP
Page 823 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]
Page 823 · click to enlarge
Page 823
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 823)
Fig. 731 · Appendix B: Applied Instruction List [by Instruction…

DEBCD Floating Point to Scientific Notation Conversion 459 DEBCDP

DEBIN Scientific Notation to Floating Point Conversion 461 DEBINP

DRAD Floating Point Degree to Radian Conversion 492 DRADP

DDEG Floating Point Radian to Degree Conversion 494 DDEGP

High Speed Counter Set/ High Speed Interrupt Counter Set 267

DHSCT High Speed Counter Compare With Data Table 738

Page 824 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6. Special function instructions
Page 824 · click to enlarge
Page 824
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-1 Applied instructions [by instruction type]

3. Comparison instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Comparison instructions diagram (page 824)
Fig. 732 · 3. Comparison instructions
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 3. Comparison instructions diagram (page 824)
Fig. 733 · 3. Comparison instructions

5. Logical operation instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 5. Logical operation instructions diagram (page 824)
Fig. 734 · 5. Logical operation instructions

4. Arithmetic operation instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 4. Arithmetic operation instructions diagram (page 824)
Fig. 735 · 4. Arithmetic operation instructions

6. Special function instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 6. Special function instructions diagram (page 824)
Fig. 736 · 6. Special function instructions
Page 825 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]
Page 825 · click to enlarge
Page 825
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 825)
Fig. 737 · Appendix B: Applied Instruction List [by Instruction…
Page 826 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 12. I/O refresh instructions
Page 826 · click to enlarge
Page 826
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-1 Applied instructions [by instruction type]

9. Data operation instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9. Data operation instructions diagram (page 826)
Fig. 738 · 9. Data operation instructions

Mnemonic Function Ref. Page Mnemonic Function Ref. Page

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 9. Data operation instructions diagram (page 826)
Fig. 739 · 9. Data operation instructions

Scaling 2 (Coordinate by X / Y Data) 702 SCL2P

RIGHT Extracting Character String Data From the Right 634 RIGHTP

LEFT Extracting Character String Data from the Left 637 LEFTP

11. Program flow control instructions

10. Character string operation instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11. Program flow control instructions diagram (page 826)
Fig. 740 · 11. Program flow control instructions
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 11. Program flow control instructions diagram (page 826)
Fig. 741 · 11. Program flow control instructions

DESTR Floating Point to Character String Conversion 447 DESTRP

DEVAL Character String to Floating Point Conversion 454 DEVALP

12. I/O refresh instructions

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 12. I/O refresh instructions diagram (page 826)
Fig. 742 · 12. I/O refresh instructions
Page 827 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]
Page 827 · click to enlarge
Page 827
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 827)
Fig. 743 · Appendix B: Applied Instruction List [by Instruction…
Page 828 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — VRSC
Page 828 · click to enlarge
Page 828
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-1 Applied instructions [by instruction type]

19. Other handy instructions

20. External Device

Mnemonic Function Ref. Page

Mnemonic Function Ref. Page

WDT

MNET

Watchdog Timer Refresh 125 WDTP

F-16NP / NT communication 419 MNETP

ALT

ANRD

Alternate State 340 ALTP

Read from F2-6A 421 ANRDP

ANS Timed Annunciator Set 244

ANWR

ANR

Write to F2-6A 423 ANWRP

Annunciator Reset 246 ANRP

RMST F2-32RM start 424

HOUR

RMWR

Hour Meter 563 DHOUR

Write to F2-32RM 425 RMWRP

RAMP Ramp Variable Value 343

DRMWR

SPD

DRMWRP

Speed Detection 292 DSPD

RMRD

PWM Pulse Width Modulation 303

Read from F2-32RM 427 RMRDP

DUTY Timing Pulse Generation 589

DRMRD

PID PID Control Loop 414

DRMRDP

ZPUSH

RMMN

Batch Store of Index Register 434 ZPUSHP

F2-32RM monitor 429 RMMNP

ZPOP

BLK

Batch POP of Index Register 437 ZPOPP

Specify F2-30GM 430 BLKP

TTMR Teaching Timer 334

MCDE

F2-30GM code 432 MCDEP

STMR Special Timer 337

ABSD

Absolute Drum Sequencer 327 DABSD

21. Extension Function

Mnemonic Function Ref. Page

INCD Incremental Drum Sequencer 331

ROTC Rotary Table Control 346

EXTR_IN

IST Initial State 312

576 EXTRP_IN

MTR Input Matrix 263

EXTR_OUT

TKY

Ten Key Input 353 DTKY

579 EXTRP _OUT

HKY

Hexadecimal Input 357 DHKY

DSW Digital Switch (Thumbwheel Input) 361

SEGD

Seven Segment Decoder 365 SEGDP

SEGL Seven Segment With Latch 367

ARWS Arrow Switch 372

ASC ASCII code data input 376

PR Print (ASCII Code) 378

VRRD

Volume Read 406 VRRDP

VRSC

Volume Scale 409 VRSCP

External ROM function

Page 829 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 829 · click to enlarge
Page 829
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 829)
Fig. 744 · Appendix B-2 Applied instructions [in alphabetical o…
Page 830 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 830 · click to enlarge
Page 830
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-2 Applied instructions [in alphabetical order]

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 830)
Fig. 745 · Appendix B-2 Applied instructions [in alphabetical o…
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 830)
Fig. 746 · Appendix B-2 Applied instructions [in alphabetical o…

DEBCD Floating Point to Scientific Notation Conversion 459 DEBCDP

DEBIN Scientific Notation to Floating Point Conversion 461 DEBINP

DESTR Floating Point to Character String Conversion 447 DESTRP

DEVAL Character String to Floating Point Conversion 454 DEVALP

Page 831 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 831 · click to enlarge
Page 831
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 831)
Fig. 747 · Appendix B-2 Applied instructions [in alphabetical o…

High Speed Counter Set/ High Speed Interrupt Counter Set 267

DHSCT High Speed Counter Compare With Data Table 738

Scaling 2 (Coordinate by X / Y Data) 702 DSCL2P

Page 832 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 832 · click to enlarge
Page 832
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-2 Applied instructions [in alphabetical order]

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 832)
Fig. 748 · Appendix B-2 Applied instructions [in alphabetical o…
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 832)
Fig. 749 · Appendix B-2 Applied instructions [in alphabetical o…

LEFT Extracting Character String Data from the Left 637 LEFTP

Page 833 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 833 · click to enlarge
Page 833
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 833)
Fig. 750 · Appendix B-2 Applied instructions [in alphabetical o…

RIGHT Extracting Character String Data From the Right 634 RIGHTP

Scaling 2 (Coordinate by X / Y Data) 702 SCL2P

Page 834 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]
Page 834 · click to enlarge
Page 834
Appendix BApplied Instruction List [by Instruction Type / in Alphabetic Order]

Appendix B-2 Applied instructions [in alphabetical order]

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 834)
Fig. 751 · Appendix B-2 Applied instructions [in alphabetical o…
Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 834)
Fig. 752 · Appendix B-2 Applied instructions [in alphabetical o…
Page 835 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 6. Product application
Page 835 · click to enlarge
Page 835

Warranty FXCPU Structured Programming Manual [Basic & Applied Instruction]

Warranty

Please confirm the following product warranty details before using this product. 1. Gratis Warranty Term and Gratis Warranty Range

2. Onerous repair term after discontinuation of production

If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company. However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module.

Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued. Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc.

Product supply (including repair parts) is not available after production is discontinued. 2)

3. Overseas service

Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA Center may differ. The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place. Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs. [Gratis Warranty Range]

[Gratis Warranty Term]

4. Exclusion of loss in opportunity and secondary loss from warranty liability

Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user or third person by Failures of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks.

The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product.

5. Changes in product specifications

Even within the gratis warranty term, repairs shall be charged for in the following cases. 2)

The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.

Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design.

6. Product application

In using the Mitsubishi MELSEC programmable logic controller, the usage conditions shall be that the application will not lead to a major accident even if any problem or fault should occur in the programmable logic controller device, and that backup and fail-safe functions are systematically provided outside of the device for any problem or fault.

Failure caused by unapproved modifications, etc., to the product by the user. b)

When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided.

The Mitsubishi programmable logic controller has been designed and manufactured for applications in general industries, etc. Thus, applications in which the public could be affected such as in nuclear power plants and other power plants operated by respective power companies, and applications in which a special quality assurance system is required, such as for Railway companies or Public service purposes shall be excluded from the programmable logic controller applications. In addition, applications in which human life or property that could be greatly affected, such as in aircraft, medical applications, incineration and fuel devices, manned transportation, equipment for recreation and amusement, and safety devices, shall also be excluded from the programmable logic controller range of applications. However, in certain cases, some applications may be possible, providing the user consults their local Mitsubishi representative outlining the special requirements of the project, and providing that all parties concerned agree to the special circumstances, solely at the users discretion.

Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced.

Relay failure or output contact failure caused by usage beyond the specified Life of contact (cycles).

Failure caused by external irresistible forces such as fires or abnormal voltages, and failure caused by force majeure such as earthquakes, lightning, wind and water damage.

Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi.

Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.

Show 10 more labels / short text on this page
1) · 1) · a) · 1) · c) · 2) · e) · f) · g) · h)
Page 836 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Date created Revision Description
Page 836 · click to enlarge
Page 836

Revised History FXCPU Structured Programming Manual [Basic & Applied Instruction]

Revised History

Date created Revision Description

1/2009 A First edition

  • 7/2009 B
  • Instructions was added: INV, MEP, MEF, RS,FLCRT, FLDEL, FLWR, FLRD, FLCMD, FLSTRD
  • The following instructions are provided in the FX 3G series. RD3A, RD3AP, WR3A, WR3AP

2/2010 C • Manual name of a related manual was changed.

  • 4/2010 D
  • Operands in sequence instructions was changed into array type.
  • Appendix B was added.
  • 9/2010 E
  • Applicable device lists were updated. (The operand type sequence was changed.)
  • Errors are corrected.
  • 1/2011 F
  • Instructions was added: IVMC
  • The following instructions are provided in the FX 3U and FX 3UC series. VRRD, VRSC
  • 7/2011 G
  • FBD language was added.
  • The following instructions are provided in the FX 3G series. IVMC

2/2012 H • FX3GC was added.

  • 5/2012 J
  • Instructions was added: DHSCS_I
  • Cautions on the DHOUR instruction are added.
  • 5/2013 K
  • FX 3S was added.
  • Instructions was added: ADPRW, ASC

9/2013 L • FX3G-485-BD-RJ connection was added.

Page 837 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Revised History
Page 837 · click to enlarge
Page 837
Page 837 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Revised History
Page 838 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — JY997D34701L (MEE)
Page 838 · click to enlarge
Page 838

FXCPU

Structured Programming Manual

Basic & Applied Instruction

HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN

MODEL FX-KP-SM-E

MODEL CODE 09R926

JY997D34701L (MEE)

Effective Sep. 2013 Specifications are subject to change without notice.

Display codes

Error codes

What the fault codes shown on the display mean and how to clear them.

CodeMeaningFix
S1The FX3U and FX3UC PLCs only are applicable. p.58
S2Only the FX3U and FX3UC PLCs are capable of indexing applicable devices. p.58
S3Only the FX3U and FX3UC PLCs are capable of indexing applicable devices. p.86
X007Every time X007 is set to ON, an operation p.247
IS0(Error code: K6706) p.476
TO00HFor example, in the case of n=5, data of lower byte (8 bits) of p.506
K1The current value of the high speed counter is cleared when p.601
K0The current value of the high speed counter is not cleared p.601
K-1Forcibly writes all buffered data to the CompactFlashTM card. p.790
B0The CompactFlashTM card is not mounted. p.793
B1The CompactFlashTM card is full. p.793
B2An error has occurred in the CF-ADP. p.793
B3CF-ADP H/W error p.793

Ask about the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU)

Owners and our team usually reply within a day — and your question helps the next person too.

Add your email to get notified when it’s answered — no spam, ever.

0 questions
No questions yet about the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU)

Be the first to ask — other owners or our team will answer.

Original document

Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) manual PDF

838 pages·27.8 MB·Video Game Controller·PDF
Click any page above to open it here
Page 1 / …
100%
Loading pages…