EN
Mitsubishi Electronics logo
Official user manual

Mitsubishi Electronics FXCPU

236 pages·3.6 MB·Welding System·PDF·ENDEFRITNLJA
Mitsubishi Electronics FXCPU
Table of Contents 144 sections Front Cover · Manual number · Table of Contents · Positioning of This Manual · … ShowHide
Front Coverp.1Manual numberp.3Table of Contentsp.5Positioning of This Manualp.9Related Manualsp.12Generic Names and Abbreviations Used in Manualsp.151. Outlinep.161.1 Outline of Structured Programs and Programming Languagesp.161.1.1 Outline of structured programsp.161.1.2 Programming languagesp.171.2 PLC Series and Programming Software Versionp.171.3 Cautions on Creation of Fundamental Programsp.181.3.1 I/O processing and response delayp.181.3.2 Double output (double coil) operation and countermeasuresp.191.3.3 Circuits not available in structured ladder programs and countermeasuresp.201.3.4 Handling of general flagsp.201.3.5 Handling of operation error flagp.232. Function Listp.242.1 Type Conversion Functionsp.242.2 Standard Functions Of One Numeric Variablep.262.3 Standard Arithmetic Functionsp.262.4 Standard Bit Shift Functionsp.272.5 Standard Bitwise Boolean Functionsp.272.6 Standard Selection Functionsp.272.7 Standard Comparison Functionsp.282.8 Standard Character String Functionsp.282.9 Functions Of Time Data Typesp.282.10 Standard Function Blocksp.293. Function Constructionp.303.1 Applied Function Expression and Execution Typep.303.2 Labelsp.313.3 Device and Addressp.343.4 EN and ENOp.354. How to Read Explanation of Functionsp.365. Applied Functionsp.385.1 Type Conversion Functionsp.385.1.1 BOOL_TO_INT(_E)p.385.1.2 BOOL_TO_DINT(_E)p.405.1.3 BOOL_TO_STR(_E)p.425.1.4 BOOL_TO_WORD(_E)p.445.1.5 BOOL_TO_DWORD(_E)p.465.1.6 BOOL_TO_TIME(_E)p.485.1.7 INT_TO_DINT(_E)p.505.1.8 DINT_TO_INT(_E)p.525.1.9 INT_TO_BOOL(_E)p.545.1.10 DINT_TO_BOOL(_E)p.565.1.11 INT_TO_REAL(_E)p.585.1.12 DINT_TO_REAL(_E)p.605.1.13 INT_TO_STR(_E)p.625.1.14 DINT_TO_STR(_E)p.645.1.15 INT_TO_WORD(_E)p.665.1.16 DINT_TO_WORD(_E)p.685.1.17 INT_TO_DWORD(_E)p.705.1.18 DINT_TO_DWORD(_E)p.725.1.19 INT_TO_BCD(_E)p.745.1.20 DINT_TO_BCD(_E)p.765.1.21 INT_TO_TIME(_E)p.785.1.22 DINT_TO_TIME(_E)p.805.1.23 REAL_TO_INT(_E)p.825.1.24 REAL_TO_DINT(_E)p.845.1.25 REAL_TO_STR(_E)p.865.1.26 WORD_TO_BOOL(_E)p.895.1.27 DWORD_TO_BOOL(_E)p.915.1.28 WORD_TO_INT(_E)p.935.1.29 WORD_TO_DINT(_E)p.955.1.30 DWORD_TO_INT(_E)p.975.1.31 DWORD_TO_DINT(_E)p.995.1.32 WORD_TO_DWORD(_E)p.1015.1.33 DWORD_TO_WORD(_E)p.1035.1.34 WORD_TO_TIME(_E)p.1055.1.35 DWORD_TO_TIME(_E)p.1075.1.36 STR_TO_BOOL(_E)p.1095.1.37 STR_TO_INT(_E)p.1115.1.38 STR_TO_DINT(_E)p.1135.1.39 STR_TO_REAL(_E)p.1155.1.40 STR_TO_TIME(_E)p.1185.1.41 BCD_TO_INT(_E)p.1205.1.42 BCD_TO_DINT(_E)p.1225.1.43 TIME_TO_BOOL(_E)p.1245.1.44 TIME_TO_INT(_E)p.1265.1.45 TIME_TO_DINT(_E)p.1285.1.46 TIME_TO_STR(_E)p.1305.1.47 TIME_TO_WORD(_E)p.1325.1.48 TIME_TO_DWORD(_E)p.1345.2 Standard Functions Of One Numeric Variablep.1365.2.1 ABS(_E)p.1365.3 Standard Arithmetic Functionsp.1385.3.1 ADD_Ep.1385.3.2 SUB_Ep.1405.3.3 MUL_Ep.1425.3.4 DIV_Ep.1445.3.5 MOD(_E)p.1465.3.6 EXPT(_E)p.1485.3.7 MOVE(_E)p.1505.4 Standard Bit Shift Functionsp.1525.4.1 SHL(_E)p.1525.4.2 SHR(_E)p.1545.5 Standard Bitwise Boolean Functionsp.1565.5.1 AND_Ep.1565.5.2 OR_Ep.1585.5.3 XOR_Ep.1605.5.4 NOT(_E)p.1625.6 Standard Selection Functionsp.1645.6.1 SEL(_E)p.1645.6.2 MAXIMUM(_E)p.1665.6.3 MINIMUM(_E)p.1685.6.4 LIMITATION(_E)p.1705.6.5 MUX(_E)p.1725.7 Standard Comparison Functionsp.1745.7.1 GT_Ep.1745.7.2 GE_Ep.1765.7.3 EQ_Ep.1775.7.4 LE_Ep.1785.7.5 LT_Ep.1805.7.6 NE_Ep.1815.8 Standard Character String Functionsp.1835.8.1 MID(_E)p.1835.8.2 CONCAT(_E)p.1865.8.3 INSERT(_E)p.1895.8.4 DELETE(_E)p.1925.8.5 REPLACE(_E)p.1945.8.6 FIND(_E)p.1975.9 Functions Of Time Data Typesp.2005.9.1 ADD_TIME(_E)p.2005.9.2 SUB_TIME(_E)p.2025.9.3 MUL_TIME(_E)p.2045.9.4 DIV_TIME(_E)p.2066. Standard Function Blocksp.2086.1 R_TRIG(_E)p.2086.2 F_TRIG(_E)p.2106.3 CTU(_E)p.2126.4 CTD(_E)p.2146.5 CTUD(_E)p.2166.6 TP(_E)p.2196.7 TON(_E)p.2216.8 TOF(_E)p.2236.9 COUNTER_FB_Mp.2256.10 TIMER_10_FB_Mp.2276.11 TIMER_CONT_FB_Mp.2286.12 TIMER_100_FB_Mp.230Appendix A: Correspondence between Devices and Addressesp.231Warrantyp.232Revision Historyp.233Back Coverp.236
Page 1 of the Mitsubishi Electronics FXCPU user manual — FXCPU
Page 1 · click to enlarge
Page 1
Mitsubishi Electronics FXCPU — Front Cover diagram (page 1)
Fig. 1 · Front Cover

FXCPU

Structured Programming Manual [Application Functions]

Page 2 of the Mitsubishi Electronics FXCPU user manual — Front Cover
Page 2 · click to enlarge
Page 2
Page 2 of the Mitsubishi Electronics FXCPU user manual — Front Cover
Page 3 of the Mitsubishi Electronics FXCPU user manual — © 2009 MITSUBISHI ELECTRIC CORPORATION
Page 3 · click to enlarge
Page 3

FXCPU Structured Programming Manual

(Application Functions)

Manual number Manual revision DateJY997D34801 B 7/2009 Manual numberJY997D34801 Manual revisionB Date7/2009

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 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 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;

a) 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 regards to automated equipment. b) Any commissioning or service engineer must be of a competent nature, trained and qualified to the

local and national standards required to fulfill that job. These engineers should also be trained in the use and maintenance of the completed product. This includes being completely familiar with all associated documentation for the said product. All maintenance should be carried out in accordance with established safety practices. c) All operators of the completed equipment should be trained to use that product in a safe and

coordinated manner in compliance to established safety practices. The operators should also be familiar with documentation which is connected with the actual operation of the completed equipment. Note: the term 'completed equipment' refers to a third party constructed device which 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 in the system.
  • When combining this product with other products, please confirm the standard and the code, or regulations with which the user should follow. Moreover, please confirm the compatibility of this product to the system, machine, and apparatus with which a user is using.
  • If in doubt at any stage during the installation of the product, always consult a professional electrical engineer who is qualified and trained to the local and national standards. If in doubt about the operation or use, please consult the nearest Mitsubishi Electric distributor.
  • Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference, please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will accept no responsibility for actual use of the product based on these illustrative examples.
  • This manual content, specification etc. may be changed without a notice for improvement.
  • The information in this manual has been carefully checked and is believed to be accurate; however, you have noticed a doubtful point, a doubtful error, etc., please contact the nearest Mitsubishi Electric distributor.

Registration

  • Microsoft ® and Windows ® 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.
  • 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 FXCPU user manual — Table of Contents
Page 5 · Contents
Contents

Contents

Front Coverp.1Manual numberp.3Table of Contentsp.5Positioning of This Manualp.9Related Manualsp.12Generic Names and Abbreviations Used in Manualsp.151. Outlinep.161.1 Outline of Structured Programs and Programming Languagesp.161.1.1 Outline of structured programsp.161.1.2 Programming languagesp.171.2 PLC Series and Programming Software Versionp.171.3 Cautions on Creation of Fundamental Programsp.181.3.1 I/O processing and response delayp.181.3.2 Double output (double coil) operation and countermeasuresp.191.3.3 Circuits not available in structured ladder programs and countermeasuresp.201.3.4 Handling of general flagsp.201.3.5 Handling of operation error flagp.232. Function Listp.242.1 Type Conversion Functionsp.242.2 Standard Functions Of One Numeric Variablep.262.3 Standard Arithmetic Functionsp.262.4 Standard Bit Shift Functionsp.272.5 Standard Bitwise Boolean Functionsp.272.6 Standard Selection Functionsp.272.7 Standard Comparison Functionsp.282.8 Standard Character String Functionsp.282.9 Functions Of Time Data Typesp.282.10 Standard Function Blocksp.293. Function Constructionp.303.1 Applied Function Expression and Execution Typep.303.2 Labelsp.313.3 Device and Addressp.343.4 EN and ENOp.354. How to Read Explanation of Functionsp.365. Applied Functionsp.385.1 Type Conversion Functionsp.385.1.1 BOOL_TO_INT(_E)p.385.1.2 BOOL_TO_DINT(_E)p.405.1.3 BOOL_TO_STR(_E)p.425.1.4 BOOL_TO_WORD(_E)p.445.1.5 BOOL_TO_DWORD(_E)p.465.1.6 BOOL_TO_TIME(_E)p.485.1.7 INT_TO_DINT(_E)p.505.1.8 DINT_TO_INT(_E)p.525.1.9 INT_TO_BOOL(_E)p.545.1.10 DINT_TO_BOOL(_E)p.565.1.11 INT_TO_REAL(_E)p.585.1.12 DINT_TO_REAL(_E)p.605.1.13 INT_TO_STR(_E)p.625.1.14 DINT_TO_STR(_E)p.645.1.15 INT_TO_WORD(_E)p.665.1.16 DINT_TO_WORD(_E)p.685.1.17 INT_TO_DWORD(_E)p.705.1.18 DINT_TO_DWORD(_E)p.725.1.19 INT_TO_BCD(_E)p.745.1.20 DINT_TO_BCD(_E)p.765.1.21 INT_TO_TIME(_E)p.785.1.22 DINT_TO_TIME(_E)p.805.1.23 REAL_TO_INT(_E)p.825.1.24 REAL_TO_DINT(_E)p.845.1.25 REAL_TO_STR(_E)p.865.1.26 WORD_TO_BOOL(_E)p.895.1.27 DWORD_TO_BOOL(_E)p.915.1.28 WORD_TO_INT(_E)p.935.1.29 WORD_TO_DINT(_E)p.955.1.30 DWORD_TO_INT(_E)p.975.1.31 DWORD_TO_DINT(_E)p.995.1.32 WORD_TO_DWORD(_E)p.1015.1.33 DWORD_TO_WORD(_E)p.1035.1.34 WORD_TO_TIME(_E)p.1055.1.35 DWORD_TO_TIME(_E)p.1075.1.36 STR_TO_BOOL(_E)p.1095.1.37 STR_TO_INT(_E)p.1115.1.38 STR_TO_DINT(_E)p.1135.1.39 STR_TO_REAL(_E)p.1155.1.40 STR_TO_TIME(_E)p.1185.1.41 BCD_TO_INT(_E)p.1205.1.42 BCD_TO_DINT(_E)p.1225.1.43 TIME_TO_BOOL(_E)p.1245.1.44 TIME_TO_INT(_E)p.1265.1.45 TIME_TO_DINT(_E)p.1285.1.46 TIME_TO_STR(_E)p.1305.1.47 TIME_TO_WORD(_E)p.1325.1.48 TIME_TO_DWORD(_E)p.1345.2 Standard Functions Of One Numeric Variablep.1365.2.1 ABS(_E)p.1365.3 Standard Arithmetic Functionsp.1385.3.1 ADD_Ep.1385.3.2 SUB_Ep.1405.3.3 MUL_Ep.1425.3.4 DIV_Ep.1445.3.5 MOD(_E)p.1465.3.6 EXPT(_E)p.1485.3.7 MOVE(_E)p.1505.4 Standard Bit Shift Functionsp.1525.4.1 SHL(_E)p.1525.4.2 SHR(_E)p.1545.5 Standard Bitwise Boolean Functionsp.1565.5.1 AND_Ep.1565.5.2 OR_Ep.1585.5.3 XOR_Ep.1605.5.4 NOT(_E)p.1625.6 Standard Selection Functionsp.1645.6.1 SEL(_E)p.1645.6.2 MAXIMUM(_E)p.1665.6.3 MINIMUM(_E)p.1685.6.4 LIMITATION(_E)p.1705.6.5 MUX(_E)p.1725.7 Standard Comparison Functionsp.1745.7.1 GT_Ep.1745.7.2 GE_Ep.1765.7.3 EQ_Ep.1775.7.4 LE_Ep.1785.7.5 LT_Ep.1805.7.6 NE_Ep.1815.8 Standard Character String Functionsp.1835.8.1 MID(_E)p.1835.8.2 CONCAT(_E)p.1865.8.3 INSERT(_E)p.1895.8.4 DELETE(_E)p.1925.8.5 REPLACE(_E)p.1945.8.6 FIND(_E)p.1975.9 Functions Of Time Data Typesp.2005.9.1 ADD_TIME(_E)p.2005.9.2 SUB_TIME(_E)p.2025.9.3 MUL_TIME(_E)p.2045.9.4 DIV_TIME(_E)p.2066. Standard Function Blocksp.2086.1 R_TRIG(_E)p.2086.2 F_TRIG(_E)p.2106.3 CTU(_E)p.2126.4 CTD(_E)p.2146.5 CTUD(_E)p.2166.6 TP(_E)p.2196.7 TON(_E)p.2216.8 TOF(_E)p.2236.9 COUNTER_FB_Mp.2256.10 TIMER_10_FB_Mp.2276.11 TIMER_CONT_FB_Mp.2286.12 TIMER_100_FB_Mp.230Appendix A: Correspondence between Devices and Addressesp.231Warrantyp.232Revision Historyp.233Back Coverp.236
Page 9 of the Mitsubishi Electronics FXCPU user manual — Individual manuals
Page 9 · click to enlarge
Page 9

Positioning of This Manual

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

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

QCPU/FXCPU Structured Programming Manual (Fundamentals)

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

FXCPU Structured Programming Manual (Device & Common)

FX

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

FXCPU Structured Programming Manual (Basic & Applied Instruction)

FX

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

(This manual)

FX

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

FX 3G /FX 3U /FX 3UC User's ManualAnalog Control Edition

FX 3U FX 3UC FX 3G

This manual explains details of analog special function blocks and analog special adapters for FX3U/FX3UC/FX3G 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

FX 3G /FX 3U /FX 3UC Series User's Manual -Positioning Edition

FX 3U FX 3UC FX 3G

This manual explains details of wiring, instructions and operations of the positioning function built in FX3U/FX3UC/FX3G 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 10 of the Mitsubishi Electronics FXCPU user manual — Individual manuals
Page 10 · click to enlarge
Page 10
2. When using FX 1S /FX 1N /FX U /FX 1NC /FX 2NC PLCs

(Additional Manual) QCPU/FXCPU Structured Programming Manual (Fundamentals)

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

FXCPU Structured Programming Manual (Device & Common)

FX

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

FXCPU Structured Programming Manual (Basic & Applied Instruction)

FX

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

(This manual)

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 11 of the Mitsubishi Electronics FXCPU user manual — Individual manuals
Page 11 · click to enlarge
Page 11
3. When using FX 0 /FX 0S /FX 0N /FX U /FX 2C PLCs

(Additional Manual) QCPU/FXCPU Structured Programming Manual (Fundamentals)

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

FXCPU Structured Programming Manual (Device & Common)

FX

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

FXCPU Structured Programming Manual (Basic & Applied Instruction)

FX

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

(This manual)

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 12 of the Mitsubishi Electronics FXCPU user manual — FX 3U /FX 3UC /FX 3G PLCs
Page 12 · click to enlarge
Page 12

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 distributor for acquiring required manuals.

Common among FX PLCs [structured]

Manual nameManual numberSupplied with product or Additional ManualContentsModel name code QCPU/FXCPU Structured Programming Manual (Fundamentals)SH-080782Additional ManualProgramming methods, specifications, functions, etc. required to create structured programs13JW06 FXCPU Structured Programming Manual (Device & Common)JY997D26001Additional ManualDevices, parameters, etc. provided in structured projects of GX Works209R920 FXCPU Structured Programming Manual (Basic & Applied Instruction)JY997D34701Additional ManualSequence instructions provided in structured projects of GX Works209R921 FXCPU Structured Programming Manual (Application Functions)JY997D34801Additional ManualApplication functions provided in structured projects of GX Works209R922

FX 3U /FX 3UC /FX 3G PLCs

Manual nameManual numberSupplied with product or Additional ManualContentsModel name code PLC main unit FX3U Series Hardware ManualJY997D18801Supplied with productI/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 User's ManualHardware EditionJY997D16501Additional ManualDetails about the hardware including I/O specifications, wiring, installation and maintenance of the FX3U PLC main unit.09R516 FX3UC (D, DSS) Series Hardware ManualJY997D28601Supplied with productI/O specifications, wiring and installation of the PLC main unit FX3UC (D, 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-32MT-LT-2 Hardware ManualJY997D31601Supplied with productI/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 Series User's Manual - Hardware EditionJY997D28701Additional ManualDetails about the hardware including I/O specifications, wiring, installation and maintenance of the FX3UC PLC main unit.09R519 FX3G Series Hardware ManualJY997D33401Supplied with productI/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 User's ManualHardware EditionJY997D31301Additional ManualDetails about the hardware including I/O specifications, wiring, installation and maintenance of the FX3G PLC main unit.09R521
Page 13 of the Mitsubishi Electronics FXCPU user manual — 09R715
Page 13 · click to enlarge
Page 13

Manual name Manual number Supplied with product

or Additional Manual Contents Model name code

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

FX3G/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

FX3G/FX3U/FX3UC Series User's Manual -Positioning Edition JY997D16801 Additional Manual Details about the positioning function built in the FX3G/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

FX 1S /FX 1N /FX 2N /FX 1NC /FX 2NC PLCs

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

Programming · PLC main unit · Programming

Page 14 of the Mitsubishi Electronics FXCPU user manual — 09R715
Page 14 · click to enlarge
Page 14

FX0/FX0S/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 FX0/FX0S/FX0N/FXU/FX2C PLCs.

PLC main unit · Programming

Page 15 of the Mitsubishi Electronics FXCPU user manual — CF-ADP FX 3U -CF-ADP
Page 15 · click to enlarge
Page 15

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

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

Q/FX Structured Programming Manual (Fundamentals) Abbreviation of QCPU/FXCPU 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 FX3G/FX3U/FX3UC Series User's Manual-ANALOG CONTROL EDITION

POSITIONING CONTROL EDITION Abbreviation of FX3G/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 16 of the Mitsubishi Electronics FXCPU user manual — Advantages of program consisting of program blocks
Page 16 · click to enlarge
Page 16

1.1 Outline of Structured Programs and Programming

This manual explains applied functions for structured programs provided by GX Works2. Refer to a different manual for devices, parameters and sequence instructions. Refer to the following manual for labels, data types and programming languages for structured programs:

→ Q/FX 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 efficiently create a program for a large system.

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

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 17 of the Mitsubishi Electronics FXCPU user manual — 1.2 PLC Series and Programming Software Version
Page 17 · click to enlarge
Page 17

1.2 PLC Series and Programming Software Version

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. Any circuit always starts from the bus line located on the leftmost. 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

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

Text language

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;

1.2 PLC Series and Programming Software Version

Mitsubishi Electronics FXCPU — 1.2 PLC Series and Programming Software Version diagram (page 17)
Fig. 2 · 1.2 PLC Series and Programming Software Version

Output Y000

Page 18 of the Mitsubishi Electronics FXCPU user manual — 1.3.1 I/O processing and response delay
Page 18 · click to enlarge
Page 18

1.3 Cautions on Creation of Fundamental Programs

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/FX 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 response 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 FXCPU — 1.3.1 I/O processing and response delay diagram (page 18)
Fig. 3 · 1.3.1 I/O processing and response delay

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.

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)

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

2. Short pulses cannot be received. The ON duration and OFF duration of inputs in PLCs require longer time than "PLC cycle time + Input filter response delay". When the response delay "10 ms" of the input filter is considered and the cycle 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)) or more. However, the situation can be improved by PLC special functions and applied instructions.

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

Mitsubishi Electronics FXCPU — 1.3.1 I/O processing and response delay diagram (page 18)
Fig. 4 · 1.3.1 I/O processing and response delay
  • High speed counter function
  • Input interrupt function
  • Pulse catch function
  • Input filter value adjustment function
Page 19 of the Mitsubishi Electronics FXCPU user manual — A B
Page 19 · click to enlarge
Page 19

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 outputs When a coil (output variable) is used twice (double coils) in another program block to be executed or in the same program block, the PLC gives priority to the latter coil.

Suppose that the same coil Y003 is used in two positions as shown in the right figure. 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 is set to ON and the output Y004 is also set to ON 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

As a result, the actual output to the outside is "Y003: OFF, Y004: ON".

Y003

Output processing Y003=OFF Y004=ON

2. Countermeasures against double outputs Double outputs (double coils) do not cause an illegal input error (program error), but the operation is complicated as described above. Change the program as shown in the example below.

A B

Y000

A B

Y000

C E

C E

Y000

A B

M100

C E

M101

Y000

M100

M101

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

Show 4 more labels / short text on this page
First · Second · Ignored · Or
Page 20 of the Mitsubishi Electronics FXCPU user manual — 1.3.4 Handling of general flags
Page 20 · click to enlarge
Page 20

1.3 Cautions on Creation of Fundamental Programs

1.3.3 Circuits not available in 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 right figure (so that a circuit without D and a circuit without B are connected in parallel).
Mitsubishi Electronics FXCPU — 1.3.3 Circuits not available in structured ladder programs and countermeasures diagram (page 20)
Fig. 5 · 1.3.3 Circuits not available in structured ladder pr…

2. Coil connection position

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

1.3.4 Handling of general flags

The following flags are valid in general sequence instructions: (Examples) 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 M8329:Instruction execution abnormal complete flag*2

M8304:Zero flag*1 M8306:Carry flag*1

*1. Supported only in FX3U/FX3UC PLCs.

*2. Supported only in FX3U/FX3UC/FX3G PLCs.

Each of these flags turns ON or OFF every time the PLC executes a corresponding instruction. These flags do not turn ON or OFF when the PLC does not execute a corresponding instruction or when an error occurs. Because these flags are related to many sequence instructions, their ON/OFF status changes every time the PLC executes each corresponding instruction. Refer to examples in the next page, and program a flag contact just under the target sequence instruction.

Page 21 of the Mitsubishi Electronics FXCPU user manual — ENO
Page 21 · click to enlarge
Page 21

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 complete flag M8029 twice or more together 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

ENO

d1 Y010 s2 d2

M8029

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

ENO

Execution is completed.

Number of output pulses

X000 M0

M0

ENO

1000 Y000

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

Number of output pulses

M8029

M0

R

Execution is completed.

M8029

M0

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

R

Program for DPLSY (on the upper side)

Execution is completed.

ENO

d1 Y010 s2 d2 D0

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

M0

M0

DPLSY(on the upper side)

ENO

1000 Y000

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

Number of output pulses

M8029

ENO

Execution is completed.

Number of output pulses

M1

DPLSY(on the lower side)

ENO

1000 Y001

Number of output pulses2

Show 15 more labels / short text on this page
Good example · DSW EN s1 · MUL EN s1 · d s2 · DPLSY EN s1 · d s2 · Bad example · DSW EN s1 · DPLSY EN s1 · d s2 · MUL EN s1 · Program for DSW · d s2 · DPLSY EN s1 · d s2
Page 22 of the Mitsubishi Electronics FXCPU user manual — 1.3.3 Circuits not available in structured ladder programs and countermeasures
Page 22 · click to enlarge
Page 22

1.3 Cautions on Creation of Fundamental Programs

2. Introduction of a method to use flags in any positions other than positions just under sequence instructions If two or more sequence instructions are programmed, general flags turn ON or OFF when each corresponding instruction is executed. Accordingly, when using a general flag in any position other than a position just under a sequence instruction, set to ON or OFF another device (variable) just under the sequence instruction, and then use the contact of such device (variable) as the command contact.

Mitsubishi Electronics FXCPU — 1.3.3 Circuits not available in structured ladder programs and countermeasures diagram (page 22)
Fig. 7 · 1.3.3 Circuits not available in structured ladder pr…

DSW execution complete flag M8029 is changed to M100.

DPLSY execution complete flag M8029 is changed to M200.

Page 23 of the Mitsubishi Electronics FXCPU user manual — M8068 - D8068 *2 D8313, D8312
Page 23 · click to enlarge
Page 23

1.3 Cautions on Creation of Fundamental Programs

1.3.5 Handling of operation error flag

When there is an error in the instruction construction, 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 stored.

1. Operation error

Device which stores error occurrence step

Error flag Device which stores

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

M8067 D8067 D8069 *1 D8315, D8314

*1. When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the error occurrence step also in D8069 (16 bits).

  • When an operation error has occurred, M8067 turns ON, D8067 stores the operation error code, and the specified device (shown in the table above) stores the error occurrence step.
  • When 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 changes from STOP to RUN, these devices are cleared instantaneously, and then turn ON again if errors have not been cleared.

2. Operation error latch

Device which stores error occurrence step

Error flag Device which stores

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

M8068 - D8068 *2 D8313, D8312

*2. When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the error occurrence step also in D8068 (16 bits).

  • When an operation error has occurred, M8068 turns ON, and the device shown in the table above stores the error occurrence step.
  • Even if another error occurs in another step, the stored data is not updated and remains held until these devices are forcibly set to OFF or until the power is turned OFF.

error code · error code

Page 24 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_DWORD (_E)
Page 24 · click to enlarge
Page 24

This chapter introduces a list of functions available in programming.

FX U /FX 2C

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3G

FX 1S

FX 0N

BOOL_TO_INT(_E) Converts bit data into word [signed] data. 3 Subsection 5.1.1

BOOL_TO_DINT(_E) Converts bit data into double word [signed] data. 3 Subsection 5.1.2

BOOL_TO_STR(_E) Converts bit data into string data. 3 Subsection 5.1.3

BOOL_TO_WORD(_E) Converts bit data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.4

BOOL_TO_DWORD (_E)

Converts bit data into double word [unsigned]/bit string [32-bit] data. 3 Subsection 5.1.5

BOOL_TO_TIME(_E) Converts bit data into time data. 3 Subsection 5.1.6

INT_TO_DINT(_E) Converts word [signed] data into double word [signed] data 3 Subsection 5.1.7

DINT_TO_INT(_E) Converts double word [signed] data into word [signed] data. 3 Subsection 5.1.8

INT_TO_BOOL(_E) Converts word [signed] data into bit data. 3 Subsection 5.1.9

DINT_TO_BOOL(_E) Converts double word [signed] data into bit data. 3 Subsection 5.1.10

INT_TO_REAL(_E) Converts word [signed] data into float (single precision) data. 3 *1 3 Subsection 5.1.11

DINT_TO_REAL(_E) Converts double word [signed] data into float (single precision) data. 3 *1 3 Subsection 5.1.12

INT_TO_STR(_E) Converts word [signed] data into string data. 3 Subsection 5.1.13

DINT_TO_STR(_E) Converts double word [signed] data into string data. 3 Subsection 5.1.14

INT_TO_WORD(_E) Converts word [signed] data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.15

DINT_TO_WORD(_E) Converts double word [signed] data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.16

INT_TO_DWORD(_E) Converts word [signed] data into double word [unsigned]/bit string [32-bit] data. 3 Subsection 5.1.17

DINT_TO_DWORD (_E)

Converts double word [signed] data into double word [unsigned]/bit string[32-bit] data. 3 Subsection 5.1.18

INT_TO_BCD(_E) Converts word [signed] data into BCD data. 3 Subsection 5.1.19

DINT_TO_BCD(_E) Converts double word [signed] data into BCD data. 3 Subsection 5.1.20

INT_TO_TIME(_E) Converts word [signed] data into time data. 3 Subsection 5.1.21

DINT_TO_TIME(_E) Converts double word [signed] data into time data. 3 Subsection 5.1.22

*1. The function is provided in the FX3G Series Ver.1.10 or later.

Applicable PLC · Function name Function · Reference

Page 25 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_DWORD (_E)
Page 25 · click to enlarge
Page 25

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

REAL_TO_INT(_E) Converts float (single precision) data into word [signed] data. 3 *1 3 Subsection 5.1.23

REAL_TO_DINT(_E) Converts float (single precision) data into double word [signed] data. 3 *1 3 Subsection 5.1.24

REAL_TO_STR(_E) Converts float (single precision) data into string data. 3 Subsection 5.1.25

WORD_TO_BOOL(_E) Converts word [unsigned]/bit string [16-bit] data into bit data. 3 Subsection 5.1.26

DWORD_TO_BOOL (_E)

Converts double word [unsigned]/bit string [32- bit] data into bit data. 3 Subsection 5.1.27

WORD_TO_INT(_E) Converts word [unsigned]/bit string [16-bit] data into word [signed] data. 3 Subsection 5.1.28

WORD_TO_DINT(_E) Converts word [unsigned]/bit string [16-bit] data into double word [signed] data. 3 Subsection 5.1.29

DWORD_TO_INT(_E) Converts double word [unsigned]/bit string [32- bit] data into word [signed] data. 3 Subsection 5.1.30

DWORD_TO_DINT (_E)

Converts double word [unsigned]/bit string [32- bit] data into double word [signed] data. 3 Subsection 5.1.31

WORD_TO_DWORD (_E)

Converts word [unsigned]/bit string [16-bit] data into double word [unsigned]/bit string [32-bit]. 3 Subsection 5.1.32

Converts double word [unsigned]/bit string [32- bit] data into word [unsigned]/bit string [16- bit]data.

DWORD_TO_WORD (_E)

3 Subsection 5.1.33

WORD_TO_TIME(_E) Converts word [unsigned]/bit string [16-bit] data into time data. 3 Subsection 5.1.34

DWORD_TO_TIME (_E)

Converts double word [unsigned]/bit string [32- bit] data into time data. 3 Subsection 5.1.35

STR_TO_BOOL(_E) Converts string data into bit data. 3 Subsection 5.1.36

STR_TO_INT(_E) Converts string data into word [signed] data. 3 Subsection 5.1.37

STR_TO_DINT(_E) Converts string data into double word [signed] data. 3 Subsection 5.1.38

STR_TO_REAL(_E) Converts string data into float (single precision) data. 3 Subsection 5.1.39

STR_TO_TIME(_E) Converts string data into time data. 3 Subsection 5.1.40

BCD_TO_INT(_E) Converts BCD data into word [signed] data. 3 Subsection 5.1.41

BCD_TO_DINT(_E) Converts BCD data into double word [signed] data. 3 Subsection 5.1.42

TIME_TO_BOOL(_E) Converts time data into bit data. 3 Subsection 5.1.43

TIME_TO_INT(_E) Converts time data into word [signed] data. 3 Subsection 5.1.44

TIME_TO_DINT(_E) Converts time data into double word [signed] data. 3 Subsection 5.1.45

TIME_TO_STR(_E) Converts time data into string data. 3 Subsection 5.1.46

TIME_TO_WORD(_E) Converts time data into word [unsigned]/bit string [16-bit]data. 3 Subsection 5.1.47

TIME_TO_DWORD (_E)

Converts time data into double word [unsigned]/ bit string [32-bit] data. 3 Subsection 5.1.48

*1. The function is provided in the FX3G Series Ver.1.10 or later.

Applicable PLC · Function name Function · Reference

Page 26 of the Mitsubishi Electronics FXCPU user manual — FX U /FX 2C
Page 26 · click to enlarge
Page 26

2.2 Standard Functions Of One Numeric Variable

2.2 Standard Functions Of One Numeric Variable

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

ABS(_E) Obtains the absolute value. 3 Subsection 5.2.1

2.3 Standard Arithmetic Functions

FX U /FX 2C

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3G

FX 1S

FX 0N

ADD_E Adds data. 3 Subsection 5.3.1

SUB_E Subtracts data. 3 Subsection 5.3.2

MUL_E Multiplies data. 3 Subsection 5.3.3

DIV_E Divides data (, and outputs the quotient). 3 Subsection 5.3.4

MOD(_E) Divides data (, and outputs the remainder). 3 Subsection 5.3.5

EXPT(_E) Obtains the raised result. 3 Subsection 5.3.6

MOVE(_E) Transfers data. 3 Subsection 5.3.7

Show 6 more labels / short text on this page
Applicable PLC · Function name Function · Reference · Applicable PLC · Function name Function · Reference
Page 27 of the Mitsubishi Electronics FXCPU user manual — LIMITATION(_E)
Page 27 · click to enlarge
Page 27

2.4 Standard Bit Shift Functions

2.4 Standard Bit Shift Functions

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

SHL(_E) Shifts bits leftward. 3 Subsection 5.4.1

SHR(_E) Shifts bits rightward. 3 Subsection 5.4.2

2.5 Standard Bitwise Boolean Functions

FX U /FX 2C

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3G

FX 1S

FX 0N

AND_E Obtains the logical product. 3 Subsection 5.5.1

OR_E Obtains the logical sum. 3 Subsection 5.5.2

XOR_E Obtains the exclusive logical sum. 3 Subsection 5.5.3

NOT(_E) Obtains the logical not. 3 Subsection 5.5.4

2.6 Standard Selection Functions

FX U /FX 2C

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3G

FX 1S

FX 0N

SEL(_E) Selects data in accordance with the input condition. 3 Subsection 5.6.1

MAXIMUM(_E) Searches the maximum value. 3 Subsection 5.6.2

MINIMUM(_E) Searches the minimum value. 3 Subsection 5.6.3

Judges whether data is located within the range between the upper limit value and the lower limit value.

3 Subsection 5.6.4

LIMITATION(_E)

MUX(_E) Selects data, and outputs it. 3 Subsection 5.6.5

Show 9 more labels / short text on this page
Applicable PLC · Function name Function · Reference · Applicable PLC · Function name Function · Reference · Applicable PLC · Function name Function · Reference
Page 28 of the Mitsubishi Electronics FXCPU user manual — FX 3U(C)
Page 28 · click to enlarge
Page 28

2.7 Standard Comparison Functions

2.7 Standard Comparison Functions

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

GT_E Compares data with regard to "> (larger)". 3 Subsection 5.7.1

GE_E Compares data with regard to "≥ (larger or equal)". 3 Subsection 5.7.2

EQ_E Compares data with regard to "= (equal)". 3 Subsection 5.7.3

LE_E Compares data with regard to "≤ (smaller or equal)". 3 Subsection 5.7.4

LT_E Compares data with regard to "< (smaller)". 3 Subsection 5.7.5

NE_E Compares data with regard to "≠ (unequal)". 3 Subsection 5.7.6

2.8 Standard Character String Functions

FX U /FX 2C

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX 0(S)

FX 3G

FX 1S

FX 0N

MID(_E) Obtains a character string from a specified position. 3 Subsection 5.8.1

CONCAT(_E) Connects character strings. 3 Subsection 5.8.2

INSERT(_E) Inserts a character string. 3 Subsection 5.8.3

DELETE(_E) Deletes a character string. 3 Subsection 5.8.4

REPLACE(_E) Replaces a character string. 3 Subsection 5.8.5

FIND(_E) Searches a character string. 3 Subsection 5.8.6

2.9 Functions Of Time Data Types

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

ADD_TIME(_E) Adds time data. 3 Subsection 5.9.1

SUB_TIME(_E) Subtracts time data. 3 Subsection 5.9.2

MUL_TIME(_E) Multiplies time data. 3 Subsection 5.9.3

DIV_TIME(_E) Divides time data. 3 Subsection 5.9.4

Show 9 more labels / short text on this page
Applicable PLC · Function name Function · Reference · Applicable PLC · Function name Function · Reference · Applicable PLC · Function name Function · Reference
Page 29 of the Mitsubishi Electronics FXCPU user manual — FX 3U(C)
Page 29 · click to enlarge
Page 29

FX 3U(C)

FX 2N(C)

FX 1N(C)

FX U /FX 2C

FX 3G

FX 1S

FX 0N

FX 0(S)

R_TRIG(_E) Detects the rising edge of a signal, and outputs pulse signal. 3 Section 6.1

F_TRIG(_E) Detects the falling edge of a signal, and outputs pulse signal. 3 Section 6.2

CTU(_E) Counts up the number of times of rising of a signal. 3 Section 6.3

CTD(_E) Counts down the number of times of rising of a signal. 3 Section 6.4

CTUD(_E) Counts up/down the number of times of rising of a signal. 3 Section 6.5

TP(_E) Keeps ON a signal during specified time duration. 3 Section 6.6

TON(_E) Keeps OFF a signal during specified time duration. 3 Section 6.7

TOF(_E) Turns OFF the output signal at specified time after the input signal turned OFF. 3 Section 6.8

COUNTER_FB_M Counter drive 3 Section 6.9

TIMER_10_FB_M 10ms timer drive 3 Section 6.10

TIMER_CONT_FB_M Retentive timer drive 3 Section 6.11

TIMER_100_M 100ms timer drive 3 Section 6.12

Applicable PLC · Function name Function · Reference

Page 30 of the Mitsubishi Electronics FXCPU user manual — Argument target devices
Page 30 · click to enlarge
Page 30

3.1 Applied Function Expression and Execution Type

This chapter explains the construction of applied functions.

3.1 Applied Function Expression and Execution Type

Applied function and argument

  • The name expressing the contents is given to each function. For example, the function name "SHL (bit shift left)" is given.
  • Each function consists of arguments which indicate I/O data used in the function.

SHL_E EN ENO

*1 D10 D0 _IN _N K1

_IN ( ) : An argument whose contents do not change even if the function is executed is called

"source", and expressed in this symbol. *1 ( ) : An argument whose contents change when the function is executed is called "destination",

and expressed in this symbol. K1 ( ) : Arguments not regarded as source or destination are expressed in "m", "n", etc.

Argument target devices

  • The input variable (label or device) specifies the target.
  • Bit device themselves such as X, Y, M and S may be handled.
  • Bit devices may be combined in a way "KnX", "KnY", "KnM" and "KnS" to express numeric data.

→ FX Structured Programming Manual (Device & Common)

  • Current value registers of data registers (D), timers (T) and counters (C) may be handled.
  • When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they have 32-bit length. Use global labels when specifying devices. When 32-bit data is handled, two consecutive 16-bit data registers D are combined. For example, when data register D0 is defined as an argument of a 32-bit instruction by a label, 32-bit data stored in D1 and D0 is handled. (D1 offers high-order 16 bits, and D0 offers low-order 16-bits.) When the current value register of a timer or counter is used as a general data register, it is handled in the same way.

n

Page 31 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_STR_E EN ENO
Page 31 · click to enlarge
Page 31

3.2 Labels

3.2 Labels

Label types

Labels are classified into two types, global and local.

  • Global labels can be used in program components and function blocks.
  • Local labels can be used only in declared program blocks.

Label class

The label class indicates how each label can be used from which program component. The table below shows label classes.

VAR_GLOBAL Common label available in all program components 3 3

VAR_GLOBAL_CONSTANT Common constant available in all program components 3 3

VAR Label available within declared program components, and not available in any other program component 3 3 3

VAR_CONSTANT Constant available within declared program components, and not available in any other program component 3 3 3

VAR_INPUT Label which receives a value, and cannot be changed in program components 3 3

VAR_OUTPUT Label output from a function block 3

VAR_IN_OUT Local label which receives a value, outputs it from a program component, and can be changed in program components 3

Label definition

It is necessary to define a label to use the label. An error will occur when a program in which labels are not defined is converted (compiled).

  • When defining a global label, set the label name, class and data type, and assigns a device.
  • When defining a local label, set the label name, class and data type. You do not have to specify devices for local labels. Assignment of devices is automatically executed during compiling.

In the example below, the label "VAR_D10" is set for the function "BOOL_TO_STR_E".

BOOL_TO_STR_E EN ENO

_BOOL M0

VAR_D10

  • When using "VAR_D10" as a global label Set the class, label name, data type and device (or address).
Mitsubishi Electronics FXCPU — BOOL_TO_STR_E EN ENO diagram (page 31)
Fig. 8
  • When using "VAR_D10" as a local label Set the class, label name and data type.
Mitsubishi Electronics FXCPU — BOOL_TO_STR_E EN ENO diagram (page 31)
Fig. 9
Show 5 more labels / short text on this page
Applicable program component · Class Description · Program · block Function Function · block
Page 32 of the Mitsubishi Electronics FXCPU user manual — E ± 3.402823 +38
Page 32 · click to enlarge
Page 32

3.2 Labels

Constant description method

The table below the description method required to set a constant to a label.

Constant type Description method Example

Bit Input "TRUE" or "FALSE". Or input "0" or "1". TRUE, FALSE

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

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

Decimal number Input a decimal number directly. Or add "K" before a decimal number. 123, K123

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

Real number Input a real number directly. Or add "E" before a real number. 2.34, E2.34

Character string Surround a character string with single quotations (') or double quotations ("). 'ABC', "ABC"

Data type

The label data type is basic or universal.

  • The table below shows a list of 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

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)

String Character string (50 characters maximum) Variable

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

32 bits

Page 33 of the Mitsubishi Electronics FXCPU user manual — 3.2 Labels
Page 33 · click to enlarge
Page 33
Mitsubishi Electronics FXCPU — 3.2 Labels diagram (page 33)
Fig. 10 · 3.2 Labels
  • The universal data type indicates data type of a label which combines several basic data types. The data type name begins with "ANY".

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

Page 34 of the Mitsubishi Electronics FXCPU user manual — %I X 0 %M X 1 . 863
Page 34 · click to enlarge
Page 34

3.3 Device and Address

3.3 Device and Address

Devices can be described in two methods, device method and address method.

Device method

In this method, a device is described using the device name and device number.

X 0 D 100

Device name Device number

Address method

This method is defined in IEC61131-3, and used as shown in the table below.

Head 1st characterPosition 2nd character: Size 3rd and later characters: Classification Number

This decimal number corresponds to the device number. Q Output X Bit

I Input (Omitted) Bit This number is provided for detailed classification. Period (.) is used to delimit the subsequent "Number". The characters for classification may be omitted.

M Internal W Word (16 bits)

D Double word (32 bits)

L Long Word (64 bits)

%I X 0 %M X 1 . 863

  • Memory area position The memory area position in which data is assigned is classified into "input", "output" or "internal". X(X Device method) : I(Input) Y(Y Device method) : Q(Output) Any other device : M(Internal)
  • Size The principle of the description method corresponding to the device method (MELSEC description method) is as follows: Bit device : X(Bit) Word device: W(Word (16 bits)), D(Double word (32 bits))
  • Classification The 3rd and later characters indicate the device type which cannot be specified only by the position and size explained above. The classification is not required for devices "X" and "Y". Refer to the following for the device description method:

→ 7.3 Appendix A

% · Memory area position · Size Classification Number

Page 35 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_STR_E EN ENO
Page 35 · click to enlarge
Page 35

3.4 EN and ENO

3.4 EN and ENO

Execution of an instruction can be controlled when the instruction contains "EN" in its name.

  • "EN" inputs the instruction execution condition.
  • "ENO" outputs the instruction execution status.
  • The table below shows the "ENO" status corresponding to the "EN" status and the operation result.

EN ENO Operation result

TRUE(Operation error did not occur.) Operation output value

TRUE(Executes operation.)

FALSE(Operation error occurred.) Indefinite value

FALSE(Stops operation.) FALSE Indefinite value

BOOL_TO_STR_E EN ENO

M1

_BOOL

VAR_D10

In the above example, the function "BOOL_TO_STR_E" is executed only when X000 is "TRUE". When the function is executed normally, "TRUE" is output to M1.

Page 36 of the Mitsubishi Electronics FXCPU user manual — 4. How to Read Explanation of Functions
Page 36 · click to enlarge
Page 36

Function explanation pages have the following configuration.

Mitsubishi Electronics FXCPU — 4. How to Read Explanation of Functions diagram (page 36)
Fig. 11 · 4. How to Read Explanation of Functions

* The above page is prepared for explanation, and is different from the actual page.

Show 7 more labels / short text on this page
1) · 2) · 3) · 4) · 5) · 6) · 7)
Page 37 of the Mitsubishi Electronics FXCPU user manual — 4. How to Read Explanation of Functions
Page 37 · click to enlarge
Page 37
1. Indicates the chapter/section/subsection number and instruction name. 2) Indicates PLCs which support the function.

The PLC Series supports the function from its first product.

The supporting status varies on the version. Applicable versions are explained in "Cautions".

The PLC Series does not support the function.

3. Indicates the expression of each function.

Structured ladder Indicates the instruction expression in the structured ladder language.

ST Indicates the instruction expression in the ST language.

4. Indicates the input variable name and output variable name of the function as well as the contents and data type of each variable. Refer to the following for detailed data types:

→ Q/FX Structured Programming Manual (Fundamentals)

5. Explanation of function and operation The function executed by this function is explained. In explanation, the structured ladder language is used as the representative.
6. Cautions Cautions on using the function are described.
7. Program example Program examples are explained in each language.

Item Description · Item Description

Page 38 of the Mitsubishi Electronics FXCPU user manual — FALSE 0
Page 38 · click to enlarge
Page 38

This chapter explains the operation outline of each applied function, symbols, I/O data type, equivalent circuit in sequence instructions, target models, cautions and program examples. Refer to the following manual for variables, operators, data types and program languages:

→ Q/FX Structured Programming Manual (Fundamentals)

5.1.1 BOOL_TO_INT(_E)

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

This function coverts bit data into word [signed] data, and outputs the data obtained by conversion.

BOOL_TO_INT(_BOOL); ExampleD0:= BOOL_TO_INT(M0);

BOOL_TO_INT

BOOL_TO_INT _BOOL *1 D0 M0

BOOL_TO_INT_E(EN,_BOOL, Output label Example: BOOL_TO_INT_E(X000,M0, D0);

BOOL_TO_INT_E EN ENO

BOOL_TO_INT_E

M0 _BOOL

_BOOL ( ) Conversion source bit data Bit

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts bit data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0" as the word [signed] data value. When the input value is "TRUE", this function outputs "1" as the word [signed] data value.

FALSE 0

TRUE 1

Bit data Word [signed] data

Use the function having "_E" in its name to connect a bus.

Page 39 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_INT_E EN ENO
Page 39 · click to enlarge
Page 39

In this program, bit data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_INT)

BOOL_TO_INT

g_int1 := BOOL_TO_INT(g_bool1);

_BOOL

2. Function with EN/ENO(BOOL_TO_INT_E)

BOOL_TO_INT_E EN ENO

g_bool3 := BOOL_TO_INT_E(g_bool1, g_bool2, g_int1);

g_int1 g_bool1 · g_bool2 _BOOL · g_int1

Page 40 of the Mitsubishi Electronics FXCPU user manual — FALSE 0
Page 40 · click to enlarge
Page 40

5.1.2 BOOL_TO_DINT(_E)

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

This function converts bit data into double word [signed] data, and outputs the data obtained by conversion.

BOOL_TO_DINT(_BOOL); ExampleLabel:= BOOL_TO_DINT(M0);

BOOL_TO_DINT

BOOL_TO_DINT _BOOL *1 Label

M0

BOOL_TO_DINT_E(EN, _BOOL, Output label); Example: BOOL_TO_DINT_E(X000,M0, Label);

BOOL_TO_DINT_ E

BOOL_TO_DINT_E EN ENO

M0 _BOOL

_BOOL ( ) Conversion source bit data Bit

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts bit data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

FALSE 0

TRUE 1

Bit data Double word [signed] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label

Page 41 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_DINT_E EN ENO
Page 41 · click to enlarge
Page 41

In this program, bit data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_DINT)

BOOL_TO_DINT

g_dint1 := BOOL_TO_DINT(g_bool1);

_BOOL

2. Function with EN/ENO(BOOL_TO_DINT_E)

g_bool3 := BOOL_TO_DINT_E(g_bool1, g_bool2, g_dint1);

BOOL_TO_DINT_E EN ENO

g_dint1 g_bool1 · g_bool2 _BOOL · g_dint1

Page 42 of the Mitsubishi Electronics FXCPU user manual — FALSE "0"
Page 42 · click to enlarge
Page 42

5.1.3 BOOL_TO_STR(_E)

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

This function converts bit data into string data, and outputs the data obtained by conversion.

BOOL_TO_STR(_BOOL); ExampleLabel:= BOOL_TO_STR(M0);

BOOL_TO_STR

BOOL_TO_STR _BOOL *1 Label M0

BOOL_TO_STR_E(EN, _BOOL, Output label); Example: BOOL_TO_STR_E(X000,M0, Label);

BOOL_TO_STR_E EN ENO

BOOL_TO_STR_ E

M0 _BOOL

_BOOL ( ) Conversion source bit data Bit

*1 ( ) String data after conversion String

This function converts bit data input to a deice specified in into string data, and outputs the data obtained by conversion to a device specified in .

FALSE "0"

TRUE "1"

Bit data String data

1. Use the function having "_E" in its name to connect a bus.
2. When handling string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data. Use global labels when specifying labels.

*1 Label

Page 43 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_STR_E EN ENO
Page 43 · click to enlarge
Page 43

In this program, bit data stored in a deice specified in is converted into string data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_STR)

g_string1 := BOOL_TO_STR(g_bool1);

BOOL_TO_STR

_BOOL

2. Function with EN/ENO(BOOL_TO_STR_E)

BOOL_TO_STR_E EN ENO

g_bool3 := BOOL_TO_STR_E(g_bool1, g_bool2, g_string1);

g_string1 g_bool1 · g_bool2 _BOOL · g_string1

Page 44 of the Mitsubishi Electronics FXCPU user manual — FALSE 0H
Page 44 · click to enlarge
Page 44

5.1.4 BOOL_TO_WORD(_E)

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

This function converts bit data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.

BOOL_TO_WORD(_BOOL); ExampleD0:= BOOL_TO_WORD(M0);

BOOL_TO_WOR D

BOOL_TO_WORD _BOOL *1 M0 D0

BOOL_TO_WORD_E(EN, _BOOL, Output label); Example: BOOL_TO_WORD_E(X000, M0,D0);

BOOL_TO_WORD_E

BOOL_TO_WOR D_E

EN ENO

M0 _BOOL

_BOOL ( ) Conversion source bit data Bit

*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts bit data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0H" as the word [unsigned]/bit string [16-bit] data value. When the input value is "TRUE", this function outputs "1H" as the word [unsigned]/bit string [16-bit] data value.

FALSE 0H

TRUE 1H

Bit data Word [unsigned]/ bit string [16-bit] data

Use the function having "_E" in its name to connect a bus.

Page 45 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_WORD_E EN ENO
Page 45 · click to enlarge
Page 45

In this program, bit data stored in a device specified in is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_WORD)

g_word1 := BOOL_TO_WORD(g_bool1);

BOOL_TO_WORD

_BOOL

2. Function with EN/ENO(BOOL_TO_WORD_E)

BOOL_TO_WORD_E EN ENO

g_bool3 := BOOL_TO_WORD_E(g_bool1, g_bool2, g_word1);

g_word1 g_bool1 · g_bool2 _BOOL · g_word1

Page 46 of the Mitsubishi Electronics FXCPU user manual — FALSE 0H
Page 46 · click to enlarge
Page 46

5.1.5 BOOL_TO_DWORD(_E)

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

This function converts bit data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.

BOOL_TO_DWORD(_BOOL); ExampleLabel:= BOOL_TO_DWORD(M0);

BOOL_TO_DWO RD

BOOL_TO_DWORD _BOOL *1 M0 Label

BOOL_TO_DWORD_E(EN, _BOOL, Output label); Example: BOOL_TO_DWORD_E(X000, M0, Label);

BOOL_TO_DWO RD_E

BOOL_TO_DWORD_E

EN ENO

M0 _BOOL *1

_BOOL ( ) Conversion source bit data Bit

*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]

This function converts bit data stored in a device specified in into double word [unsigned]/bit string [32- bit] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0H" as the double word [unsigned]/bit string [32- bit]data value. When the input value is "TRUE", this function outputs "1H" as the double word [unsigned]/bit string [32-bit] data value.

FALSE 0H

TRUE 1H

Bit data Double Word [unsigned]/

Bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label

Page 47 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_DWORD_E EN ENO
Page 47 · click to enlarge
Page 47

In this program, bit data stored in a device specified in is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_DWORD)

BOOL_TO_DWORD

_BOOL

g_dword1 := BOOL_TO_DWORD(g_bool1);

2. Function with EN/ENO(BOOL_TO_DWORD_E)

BOOL_TO_DWORD_E EN ENO

g_bool3 := BOOL_TO_DWORD_E(g_bool1, g_bool2, g_dword1);

g_dword1 g_bool1 · g_bool2 _BOOL · g_dword1

Page 48 of the Mitsubishi Electronics FXCPU user manual — FALSE 0
Page 48 · click to enlarge
Page 48

5.1.6 BOOL_TO_TIME(_E)

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

This function converts bit data into time data, and outputs the data obtained by conversion.

BOOL_TO_TIME(_BOOL); ExampleLabel:= BOOL_TO_TIME(M0);

BOOL_TO_TIME

BOOL_TO_TIME _BOOL *1 M0 Label

BOOL_TO_TIME_E(EN,_BOOL, Output label); Example: BOOL_TO_TIME_E(X000,M0, Label);

BOOL_TO_TIME_ E

BOOL_TO_TIME_E EN ENO

M0 _BOOL

_BOOL ( ) Conversion source bit data Bit

*1 ( ) Time data after conversion Time

This function converts bit data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

FALSE 0

Bit data Time data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label · TRUE 1ms

Page 49 of the Mitsubishi Electronics FXCPU user manual — BOOL_TO_TIME_E EN ENO
Page 49 · click to enlarge
Page 49

In this program, bit data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BOOL_TO_TIME)

BOOL_TO_TIME

g_time1 := BOOL_TO_TIME(g_bool1);

_BOOL

2. Function with EN/ENO(BOOL_TO_TIME_E)

g_bool3 := BOOL_TO_TIME_E(g_bool1, g_bool2, g_time1);

BOOL_TO_TIME_E EN ENO

g_time1 g_bool1 · g_bool2 _BOOL · g_time1

Page 50 of the Mitsubishi Electronics FXCPU user manual — INT_TO_DINT_E EN ENO
Page 50 · click to enlarge
Page 50

5.1.7 INT_TO_DINT(_E)

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

This function converts word [signed] data into double word [signed] data, and outputs the data obtained by conversion.

INT_TO_DINT(_INT); ExampleLabel:= INT_TO_DINT(D0);

INT_TO_DINT

INT_TO_DINT _INT *1 D0 Label

INT_TO_DINT_E(EN,_INT, Output label); Example: INT_TO_DINT_E(X000,D0, Label);

INT_TO_DINT_E EN ENO

INT_TO_DINT_E

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts word [signed] data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

Word [signed] data Double word [signed] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label · 1234 1234

Page 51 of the Mitsubishi Electronics FXCPU user manual — INT_TO_DINT_E EN ENO
Page 51 · click to enlarge
Page 51

In this program, word [signed] data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_DINT)

INT_TO_DINT

g_dint1 := INT_TO_DINT(g_int1);

2. Function with EN/ENO(INT_TO_DINT_E)

g_bool3 := INT_TO_DINT_E(g_bool1, g_int1, g_dint1);

INT_TO_DINT_E EN ENO

g_dint1=5923 g_int1=5923 _INT · g_int1 _INT · g_dint1

Page 52 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_INT_E EN ENO
Page 52 · click to enlarge
Page 52

5.1.8 DINT_TO_INT(_E)

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

This function converts double word [signed] data into word [signed] data, and outputs the data obtained by conversion.

DINT_TO_INT(_DINT); ExampleD10:= DINT_TO_INT(Label);

DINT_TO_INT

DINT_TO_INT _DINT *1 Label D10

DINT_TO_INT_E(EN,_DINT, Output label); Example: DINT_TO_INT_E(X000, Label, D10);

DINT_TO_INT_E EN ENO

DINT_TO_INT_E

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts double word [signed] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

Double word [signed] data Word [signed] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DINT · 1234 1234

Page 53 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_INT_E EN ENO
Page 53 · click to enlarge
Page 53

In this program, double word [signed] data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_INT)

DINT_TO_INT

g_int1 := DINT_TO_INT(g_dint1);

2. Function with EN/ENO(DINT_TO_INT_E)

g_bool3 := DINT_TO_INT_E(g_bool1, g_dint1, g_int1);

DINT_TO_INT_E EN ENO

g_int1=5923 g_dint1=5923 _DINT · g_dint1 _DINT · g_int1

Page 54 of the Mitsubishi Electronics FXCPU user manual — 0 FALSE
Page 54 · click to enlarge
Page 54

5.1.9 INT_TO_BOOL(_E)

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

This function converts word [signed] data into bit data, and outputs the data obtained by conversion.

INT_TO_BOOL(_INT); ExampleM0:= INT_TO_BOOL(D0);

INT_TO_BOOL

INT_TO_BOOL

M0 D0 *1 _INT

INT_TO_BOOL_E(EN,_INT, Output label); Example: INT_TO_BOOL_E(X000,D0,M0);

INT_TO_BOOL_E EN ENO

INT_TO_BOOL_E

D0 _INT

*1 M0

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Bit data after conversion Bit

This function converts word [signed] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in . When the input value is "0", this function outputs "FALSE". When the input value is any value other than "0", this function outputs "TRUE".

0 FALSE

1567 TRUE

Word [signed] data Bit data

Use the function having "_E" in its name to connect a bus.

Page 55 of the Mitsubishi Electronics FXCPU user manual — INT_TO_BOOL_E EN ENO
Page 55 · click to enlarge
Page 55

In this program, word [signed] data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_BOOL)

INT_TO_BOOL

g_bool1 := INT_TO_BOOL(g_int1);

2. Function with EN/ENO(INT_TO_BOOL_E)

g_bool3 := INT_TO_BOOL_E(g_bool1, g_int1, g_bool2);

INT_TO_BOOL_E EN ENO

g_bool1 g_int1=5923 _INT · g_int1 _INT

Page 56 of the Mitsubishi Electronics FXCPU user manual — 0 FALSE
Page 56 · click to enlarge
Page 56

5.1.10 DINT_TO_BOOL(_E)

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

This function converts double word [signed] data into bit data, and outputs the data obtained by conversion.

DINT_TO_BOOL(_DINT); ExampleM0:= DINT_TO_BOOL(Label);

DINT_TO_BOOL

DINT_TO_BOOL _DINT *1 Label M0

DINT_TO_BOOL_E(EN,_DINT, Output label); Example: DINT_TO_BOOL_E(X000, Label, M0);

DINT_TO_BOOL_ E

DINT_TO_BOOL_E EN ENO

*1 M0

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Bit data after conversion Bit

This function converts double word [signed] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in . When the input value is "0", this function outputs "FALSE". When the input value is any value other than "0", this function outputs "TRUE".

0 FALSE

12345678 TRUE

Double word [signed] data Bit data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DINT

Page 57 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_BOOL_E EN ENO
Page 57 · click to enlarge
Page 57

In this program, double word [signed] data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_BOOL)

DINT_TO_BOOL

g_bool1 := DINT_TO_BOOL(g_dint1);

2. Function with EN/ENO(DINT_TO_BOOL_E)

DINT_TO_BOOL_E EN ENO

g_bool3 := DINT_TO_BOOL_E(g_bool1, g_dint1, g_bool2);

g_bool1 g_dint1=0 _DINT · g_dint1 _DINT

Page 58 of the Mitsubishi Electronics FXCPU user manual — INT_TO_REAL_E EN ENO
Page 58 · click to enlarge
Page 58

5.1.11 INT_TO_REAL(_E)

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

This function converts word [signed] data into float (single precision) data, and outputs the data obtained by conversion.

INT_TO_REAL(a_Int); ExampleLabel:= INT_TO_REAL(D0);

INT_TO_REAL

INT_TO_REAL a_Int *1 Label D0

INT_TO_REAL_E(EN,a_Int, Output label); Example: INT_TO_REAL_E(X000,D0,Label);

INT_TO_REAL_E EN ENO

INT_TO_REAL_E

a_Int ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)

This function converts word [signed] data stored in a device specified in into float (single precision) data, and outputs the data obtained by conversion to a device specified in .

1234 1234.0

Word [signed] data Float (single precision) data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. The function is provided in the FX 3G Series Ver.1.10 or later.

D0 a_Int · *1 Label

Page 59 of the Mitsubishi Electronics FXCPU user manual — INT_TO_REAL_E EN ENO
Page 59 · click to enlarge
Page 59

In this program, word [signed] data stored in a device specified in is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_REAL)

g_real1=5923.0 INT_TO_REAL g_int1=5923 a_Int

g_real1 := INT_TO_REAL(g_int1);

2. Function with EN/ENO(INT_TO_REAL_E)

INT_TO_REAL_E EN ENO

g_bool3 := INT_TO_REAL_E(g_bool1, g_int1, g_real1);

g_int1 a_Int · g_real1

Page 60 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_REAL_ E
Page 60 · click to enlarge
Page 60

5.1.12 DINT_TO_REAL(_E)

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

This function converts double word [signed] data into float (single precision) data, and outputs the data obtained by conversion.

DINT_TO_REAL(a_Dint); ExampleLabel 2:= DINT_TO_REAL(Label 1);

DINT_TO_REAL

DINT_TO_REAL a_Dint *1 Label 1 Label 2

DINT_TO_REAL_E(EN,a_Dint, Output label); Example: DINT_TO_REAL_E(X000, Label 1, Label 2);

DINT_TO_REAL_ E

DINT_TO_REAL_E EN ENO

a_Dint ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)

This function converts double word [signed] data stored in a device specified in into float (single precision) data, and outputs the data obtained by conversion to a device specified in .

16543521 16543521.0

Double word [signed] data Float (single precision) data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. The function is provided in the FX 3G Series Ver.1.10 or later.

Label 1 a_Dint · *1 Label 2

Page 61 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_REAL_E EN ENO
Page 61 · click to enlarge
Page 61

In this program, double word [signed] data stored in a device specified in is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_REAL)

g_real1=65000.0 DINT_TO_REAL g_dint1=65000 a_Dint

g_real1 := DINT_TO_REAL(g_dint1);

2. Function with EN/ENO(DINT_TO_REAL_E)

DINT_TO_REAL_E EN ENO

g_bool3 := DINT_TO_REAL_E(g_bool1, g_dint1, g_real1);

g_dint1 a_Dint · g_real1

Page 62 of the Mitsubishi Electronics FXCPU user manual — 0000H
Page 62 · click to enlarge
Page 62

5.1.13 INT_TO_STR(_E)

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

This function converts word [signed] data into string data, and outputs the data obtained by conversion.

INT_TO_STR(_INT); ExampleLabel:= INT_TO_STR(D0);

INT_TO_STR

INT_TO_STR _INT *1 Label D0

INT_TO_STR_E(EN,_INT, Output label); Example: INT_TO_STR_E(X000, D0, Label);

INT_TO_STR_E EN ENO

INT_TO_STR_E

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) String data after conversion String

1. This function converts word [signed] data stored in a device specified in into string data, and outputs the data obtained by conversion to a device specified in .

Sign data Low-order byte

ASCII code for ten-thousands place

String 1st word 2nd word 3rd word 4th word

ASCII code for hundreds place ASCII code for thousands place

ASCII code for tens place ASCII code for ones place

0000H

Automatically stored at the end of the character string

2. In "Sign data", "20H (space)" is stored when the input value is positive, and "2DH (-)" is stored when the input value is negative.
3. "20H (space)" is stored in high-order digits when the number of significant figures is small. Example: When "-123" is input

20H (space) High-order byte

2DH (-) Low-order byte

String 1st word 2nd word 3rd word 4th word Word [signed] data

31H (1) 20H (space) 32H (2) 33H (3)

0000H

4. "00H" is automatically stored at the end (4th word) of the character string.
1. Use the function having "_E" in its name to connect a bus.
2. When handling string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data. Use global labels when specifying labels.

*1 Label · High-order byte · Word [signed] data

Page 63 of the Mitsubishi Electronics FXCPU user manual — INT_TO_STR_E EN ENO
Page 63 · click to enlarge
Page 63

Error

An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the number of points occupied by the string data storage destination (device specified in ) exceeds the range of the corresponding device (Error code: K6706)

In this program, word [signed] data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_STR)

g_string1 := INT_TO_STR(g_int1);

g_string='-12345' INT_TO_STR g_int1=-12345 _INT

2. Function with EN/ENO(INT_TO_STR_E)

INT_TO_STR_E EN ENO

g_bool3 := INT_TO_STR_E(g_bool1, g_int1, g_string1);

g_int1 _INT · g_string1

Page 64 of the Mitsubishi Electronics FXCPU user manual — 5.1.14 DINT_TO_STR(_E)
Page 64 · click to enlarge
Page 64

5.1.14 DINT_TO_STR(_E)

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

This function converts double word [signed] data into string data, and outputs the data obtained by conversion.

Mitsubishi Electronics FXCPU — 5.1.14 DINT_TO_STR(_E) diagram (page 64)
Fig. 12

DINT_TO_STR_E(EN,_DINT, Output label); Example: DINT_TO_STR_E(X000, Label 1, Label 2);

Mitsubishi Electronics FXCPU — 5.1.14 DINT_TO_STR(_E) diagram (page 64)
Fig. 13

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

1. This function converts double word [signed] data stored in a device specified in into string data, and outputs the data obtained by conversion to a device specified in .
Mitsubishi Electronics FXCPU — 5.1.14 DINT_TO_STR(_E) diagram (page 64)
Fig. 14

String 1st word 2nd word 3rd word 4th word 5th word 6th word

ASCII code for ten-millions place ASCII code for hundred-millions place

ASCII code for millions place ASCII code for hundred-thousands place

ASCII code for ten-thousands place ASCII code for thousands place

ASCII code for hundreds place ASCII code for tens place

Automatically stored at the end of the character string

2. In "Sign data", "20H (space)" is stored when the input value is positive, and "2DH (-)" is stored when the input value is negative. 3) "20H (space)" is stored in high-order digits when the number of significant figures is small. Example: When "-123456" is input
Mitsubishi Electronics FXCPU — 5.1.14 DINT_TO_STR(_E) diagram (page 64)
Fig. 15

String 1st word 2nd word 3rd word 4th word 5th word 6th word

20H (space) 20H (space) 20H (space) 31H (1) 32H (2) 33H (3) 34H (4) 35H (5) 36H (6) 00H

4. "00H" is automatically stored at the end (high-order byte of the 6th word) of the character string.
Page 65 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_STR_E EN ENO
Page 65 · click to enlarge
Page 65
1. Use the function having "_E" in its name to connect a bus. 2) When handling string data and 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data and 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Error

An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the number of points occupied by the string data storage destination (device specified in ) exceeds the range of the corresponding device (Error code: K6706)

In this program, double word [signed] data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_STR)

g_string1='-12345678' DINT_TO_STR g_dint1=-12345678 _DINT

g_string1 := DINT_TO_STR(g_dint1);

2. Function with EN/ENO(DINT_TO_STR_E)

DINT_TO_STR_E EN ENO

g_bool3 := DINT_TO_STR_E(g_bool1, g_dint1, g_string1);

g_dint1 _DINT · g_string1

Page 66 of the Mitsubishi Electronics FXCPU user manual — 22136 5678H
Page 66 · click to enlarge
Page 66

5.1.15 INT_TO_WORD(_E)

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

This function converts word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.

INT_TO_WORD(_INT); ExampleD10:= INT_TO_WORD(D0);

INT_TO_WORD

INT_TO_WORD _INT D10 D0 *1

INT_TO_WORD_E(EN,_INT, Output label); Example: INT_TO_WORD_E(X000,D0,D10);

INT_TO_WORD_E EN ENO

INT_TO_WORD_ E

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Word [unsigned]/Bit String [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts word [signed] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .

22136 5678H

Word [signed] data Word [unsigned]/ bit string [16-bit] data

Use the function having "_E" in its name to connect a bus.

Page 67 of the Mitsubishi Electronics FXCPU user manual — INT_TO_WORD_E EN ENO
Page 67 · click to enlarge
Page 67

In this program, word [signed] data stored in a device specified in is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_WORD)

g_word1=16#1723 INT_TO_WORD g_int1=5923 _INT

g_word1 := INT_TO_WORD(g_int1);

2. Function with EN/ENO(INT_TO_WORD_E)

INT_TO_WORD_E EN ENO

g_bool3 := INT_TO_WORD_E(g_bool1, g_int1, g_word1);

g_int1 _INT · g_word1

Page 68 of the Mitsubishi Electronics FXCPU user manual — 614E
Page 68 · click to enlarge
Page 68

5.1.16 DINT_TO_WORD(_E)

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

This function converts double word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.

DINT_TO_WORD(_DINT); ExampleD10:= DINT_TO_WORD(Label);

DINT_TO_WORD

DINT_TO_WORD _DINT *1 Label D10

DINT_TO_WORD_E(EN,_DINT, Output label); Example: DINT_TO_WORD_E(X000, Label, D10);

DINT_TO_WORD _E

DINT_TO_WORD_E EN ENO

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts double word [signed] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .

12345678 614EH

Double word [signed] data

Word [unsigned]/ bit string [16-bit] data

0

1 0

614E

1 0

The information stored in high-order 16 bits is discarded.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DINT · 12345678

Page 69 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_WORD_E EN ENO
Page 69 · click to enlarge
Page 69

In this program, double word [signed] data stored in a device specified in is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_WORD)

g_word1=16#614E DINT_TO_WORD g_dint1=12345678 _DINT

g_word1 := DINT_TO_WORD(g_dint1);

2. Function with EN/ENO(DINT_TO_WORD_E)

DINT_TO_WORD_E EN ENO

g_bool3 := DINT_TO_WORD_E(g_bool1, g_dint1, g_word1);

g_dint1 _DINT · g_word1

Page 70 of the Mitsubishi Electronics FXCPU user manual — 0000FEBBH
Page 70 · click to enlarge
Page 70

5.1.17 INT_TO_DWORD(_E)

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

This function converts word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.

INT_TO_DWORD(_INT); ExampleLabel:= INT_TO_DWORD(D0);

INT_TO_DWORD

INT_TO_DWORD _INT *1 D0 Label

INT_TO_DWORD_E(EN,_INT, Output label); Example: INT_TO_DWORD_E(X000,D0, Label);

INT_TO_DWORD _E

INT_TO_DWORD_E EN ENO

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]

This function converts word [signed] data stored in a device specified in into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion to a device specified in .

-325 0000FEBBH

Word [signed] data Double word [unsigned]/

bit string [32-bit] data

1 0 0 0

0000FEBBH

1 0

Each of high-order 16 bits becomes "0" after data conversion.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices.

*1 Label · Data conversion

Page 71 of the Mitsubishi Electronics FXCPU user manual — INT_TO_DWORD_E EN ENO
Page 71 · click to enlarge
Page 71

In this program, word [signed] data stored in a device specified in is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_DWORD)

g_dword1=16#0000000A INT_TO_DWORD g_int1=10 _INT

g_dword1 := INT_TO_DWORD(g_int1);

2. Function with EN/ENO(INT_TO_DWORD_E)

INT_TO_DWORD_E EN ENO

g_bool3 := INT_TO_DWORD_E(g_bool1, g_int1, g_dword1);

g_int1 _INT · g_dword1

Page 72 of the Mitsubishi Electronics FXCPU user manual — 12345678 BC614EH
Page 72 · click to enlarge
Page 72

5.1.18 DINT_TO_DWORD(_E)

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

This function converts double word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.

DINT_TO_DWORD(_DINT); ExampleLabel 2:= DINT_TO_DWORD(Label 1);

DINT_TO_DWOR D

DINT_TO_DWORD _DINT *1 Label 1 Label 2

DINT_TO_DWORD_E(EN,_DINT, Output label); Example: DINT_TO_DWORD_E(X000, Label 1, Label 2);

DINT_TO_DWOR D_E

DINT_TO_DWORD_E EN ENO

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]

This function converts double word [signed] data stored in a device specified in into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion to a device specified in .

12345678 BC614EH

Double word [signed] data Double word [unsigned]/

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label 1 _DINT · *1 Label 2

Page 73 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_DWORD_E EN ENO
Page 73 · click to enlarge
Page 73

In this program, double word [signed] data stored in a device specified in is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_DWORD)

g_dword1=16#00012345 DINT_TO_DWORD g_dint1=74565 _DINT

g_dword1 := DINT_TO_DWORD(g_dint1);

2. Function with EN/ENO(DINT_TO_DWORD_E)

DINT_TO_DWORD_E EN ENO

g_bool3 := DINT_TO_DWORD_E(g_bool1, g_dint1, g_dword1);

g_dint1 _DINT · g_dword1

Page 74 of the Mitsubishi Electronics FXCPU user manual — Error
Page 74 · click to enlarge
Page 74

5.1.19 INT_TO_BCD(_E)

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

This function converts word [signed] data into BCD data, and outputs the data obtained by conversion.

INT_TO_BCD(_INT); ExampleD10:= INT_TO_BCD(D0);

INT_TO_BCD

INT_TO_BCD _INT *1 D10 D0

INT_TO_BCD_E(EN,_INT, Output label); Example: INT_TO_BCD_E(X000,D0,D10);

INT_TO_BCD_E EN ENO

INT_TO_BCD_E

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) BCD data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts word [signed] data stored in a device specified in into BCD data, and outputs the data obtained by conversion to a device specified in .

9999 9999H

Word [signed] data Word [unsigned]/ bit string [16-bit] data

3276816384 128 256 512 64 32 16 8 4 2 1

8192 4096 2048 1024

0 0 1 0 0 1 1 1 0 1

Conversion into BCD data Make sure to set them to "0".

8 4 2 1 8000 4000 2000 1000 800 400 200 100 80 40 20 10

9999H

0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1

Thousands place Hundreds place Tens place Ones place

Use the function having "_E" in its name to connect a bus.

Error

An operation error occurs when the value stored in a device specified in is outside the range from "0" to "9,999".

Page 75 of the Mitsubishi Electronics FXCPU user manual — INT_TO_BCD_E EN ENO
Page 75 · click to enlarge
Page 75

In this program, word [signed] data stored in a device specified in is converted into BCD data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_BCD)

g_word=16#5923 INT_TO_BCD g_int1=5923 _INT

g_word1 := INT_TO_BCD(g_int1);

2. Function with EN/ENO(INT_TO_BCD_E)

INT_TO_BCD_E EN ENO

g_bool3 := INT_TO_BCD_E(g_bool1, g_int1, g_word1);

g_int1 _INT · g_word1

Page 76 of the Mitsubishi Electronics FXCPU user manual — 99999999H
Page 76 · click to enlarge
Page 76

5.1.20 DINT_TO_BCD(_E)

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

This function converts double word [signed] data into BCD data, and outputs the data obtained by conversion.

DINT_TO_BCD(_DINT); ExampleLabel 2:= DINT_TO_BCD(Label 1);

DINT_TO_BCD

DINT_TO_BCD _DINT *1 Label 1 Label 2

DINT_TO_BCD_E(EN,_DINT, Output label); Example: DINT_TO_BCD_E(X000, Label 1, Label 2);

DINT_TO_BCD_E EN ENO

DINT_TO_BCD_E

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) BCD data after conversion ANY_BIT

This function converts double word [signed] data stored in a device specified in into BCD data, and outputs the data obtained by conversion to a device specified in .

99999999 99999999H

Double word [signed] data ANY_BIT data

216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231

215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20

0 1 0 1 0 1 0 1 0 1 1 1 0 1 99999999

Conversion into BCD data Make sure to set them to "0".

8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1

99999999H

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Show 16 more labels / short text on this page
Label 1 _DINT · *1 Label 2 · Ten-millions · Millions · Hundred- thousands · Ten- thousands · Thousands · Hundreds · Tens place · Ones place · place · place · place · place · place · place
Page 77 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_BCD_E EN ENO
Page 77 · click to enlarge
Page 77

Error

An operation error occurs when the value stored in a device specified in is outside the range from "0" to "99,999,999".

In this program, double word [signed] data stored in a device specified in is converted into BCD data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_BCD)

g_dword1=16#00020000 DINT_TO_BCD g_dint1=20000 _DINT

g_dword1 := DINT_TO_BCD(g_dint1);

2. Function with EN/ENO(DINT_TO_BCD_E)

DINT_TO_BCD_E EN ENO

g_bool3 := DINT_TO_BCD_E(g_bool1, g_dint1, g_dword1);

g_dint1 _DINT · g_dword1

Page 78 of the Mitsubishi Electronics FXCPU user manual — INT_TO_TIME_E EN ENO
Page 78 · click to enlarge
Page 78

5.1.21 INT_TO_TIME(_E)

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

This function converts word [signed] data into time data, and outputs the data obtained by conversion.

INT_TO_TIME(_INT); ExampleLabel:= INT_TO_TIME(D0);

INT_TO_TIME

INT_TO_TIME _INT *1 Label D0

INT_TO_TIME_E(EN,_INT, Output label); Example: INT_TO_TIME_E(X000,D0,Label);

INT_TO_TIME_E EN ENO

INT_TO_TIME_E

D0 _INT

_INT ( ) Conversion source word [signed] data Word [signed]

*1 ( ) Time data after conversion Time

This function converts word [signed] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

Word [signed] data Time data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label · FFFFh 1m5s535ms

Page 79 of the Mitsubishi Electronics FXCPU user manual — INT_TO_TIME_E EN ENO
Page 79 · click to enlarge
Page 79

In this program, word [signed] data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(INT_TO_TIME)

g_time1 INT_TO_TIME g_int1 _INT

g_time1 := INT_TO_TIME(g_int1);

2. Function with EN/ENO(INT_TO_TIME_E)

INT_TO_TIME_E EN ENO

g_bool3 := INT_TO_TIME_E(g_bool1, g_int1, g_time1);

g_int1 _INT · g_time1

Page 80 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_TIME_ E
Page 80 · click to enlarge
Page 80

5.1.22 DINT_TO_TIME(_E)

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

This function converts double word [signed] data into time data, and outputs the data obtained by conversion.

DINT_TO_TIME(_DINT); ExampleLabel 2:= DINT_TO_TIME(Label 1);

DINT_TO_TIME

DINT_TO_TIME _DINT *1 Label 1 Label 2

DINT_TO_TIME_E(EN,_DINT, Output label); Example: DINT_TO_TIME_E(X000, Label 1, Label 2);

DINT_TO_TIME_ E

DINT_TO_TIME_E EN ENO

_DINT ( ) Conversion source double word [signed] data Double Word [signed]

*1 ( ) Time data after conversion Time

This function converts double word [signed] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

Double word [signed] data Time data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label 1 _DINT · *1 Label 2 · 7FFFFFFFh 24d20h31m23s647ms

Page 81 of the Mitsubishi Electronics FXCPU user manual — DINT_TO_TIME_E EN ENO
Page 81 · click to enlarge
Page 81

In this program, double word [signed] data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DINT_TO_TIME)

g_time1 DINT_TO_TIME g_dint1 _DINT

g_time1 := DINT_TO_TIME(g_dint1);

2. Function with EN/ENO(DINT_TO_TIME_E)

DINT_TO_TIME_E EN ENO

g_bool3 := DINT_TO_TIME_E(g_bool1, g_dint1, g_time1);

g_dint1 _DINT · g_time1

Page 82 of the Mitsubishi Electronics FXCPU user manual — REAL_TO_INT_E EN ENO
Page 82 · click to enlarge
Page 82

5.1.23 REAL_TO_INT(_E)

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

This function converts float (single precision) data into word [signed] data, and outputs the data obtained by conversion.

REAL_TO_INT(a_real); ExampleD10:= REAL_TO_INT(Label);

REAL_TO_INT

REAL_TO_INT a_real *1 D10 Label

REAL_TO_INT_E(EN,a_real, Output label); Example: REAL_TO_INT_E(X000, Label, D10);

REAL_TO_INT_E EN ENO

REAL_TO_INT_E

a_real ( ) Conversion source float (single precision) data FLOAT (Single Precision)

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts float (single precision) data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

1234.0 1234

Float (single precision) data Word [signed] data The portion after the decimal

point is rounded off.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. The function is provided in the FX 3G Series Ver.1.10 or later.
4. In the data obtained by conversion, the portion after the decimal point of the float (single precision) data (source data) is rounded off.

Label a_real

Page 83 of the Mitsubishi Electronics FXCPU user manual — REAL_TO_INT_E EN ENO
Page 83 · click to enlarge
Page 83

In this program, float (single precision) data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(REAL_TO_INT)

g_int1=5923 REAL_TO_INT g_real1=5923.5 a_real

g_int1 := REAL_TO_INT(g_real1);

2. Function with EN/ENO(REAL_TO_INT_E)

REAL_TO_INT_E EN ENO

g_bool3 := REAL_TO_INT_E(g_bool1, g_real1, g_int1);

g_real1 a_real · g_int1

Page 84 of the Mitsubishi Electronics FXCPU user manual — REAL_TO_DINT_ E
Page 84 · click to enlarge
Page 84

5.1.24 REAL_TO_DINT(_E)

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

This function converts float (single precision) data into double word [signed] data, and outputs the data obtained by conversion.

REAL_TO_DINT(a_real); ExampleLabel 2:= REAL_TO_DINT(Label 1);

REAL_TO_DINT

REAL_TO_DINT a_real *1 Label 2 Label 1

REAL_TO_DINT_E(EN,a_real, Output label); Example: REAL_TO_DINT_E(X000, Label 1, Label 2);

REAL_TO_DINT_ E

REAL_TO_DINT_E EN ENO

a_real ( ) Conversion source float (single precision) data FLOAT (Single Precision)

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts float (single precision) data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

16543521.0 16543521

FLOAT (single precision) data Double word [signed] data The portion after the decimal

point is rounded off.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. The function is provided in the FX 3G Series Ver.1.10 or later.
4. In the data obtained by conversion, the portion after the decimal point of the float (single precision) data (source data) is rounded off.

Label 1 a_real · *1 Label 2

Page 85 of the Mitsubishi Electronics FXCPU user manual — REAL_TO_DINT_E EN ENO
Page 85 · click to enlarge
Page 85

In this program, float (single precision) data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(REAL_TO_DINT)

g_dint1=65000 REAL_TO_DINT g_real1=65000.5 a_real

g_dint1 := REAL_TO_DINT(g_real1);

2. Function with EN/ENO(DINT_TO_TIME_E)

REAL_TO_DINT_E EN ENO

g_bool3 := REAL_TO_DINT_E(g_bool1, g_real1, g_dint1);

g_real1 a_real · g_dint1

Page 86 of the Mitsubishi Electronics FXCPU user manual — 5.1.25 REAL_TO_STR(_E)
Page 86 · click to enlarge
Page 86

5.1.25 REAL_TO_STR(_E)

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

This function converts float (single precision) data into string data, and outputs the data obtained by conversion.

Mitsubishi Electronics FXCPU — 5.1.25 REAL_TO_STR(_E) diagram (page 86)
Fig. 16

REAL_TO_STR_E(EN,_REAL, Output label); Example: REAL_TO_STR_E(X000, Label 1, Label 2);

Mitsubishi Electronics FXCPU — 5.1.25 REAL_TO_STR(_E) diagram (page 86)
Fig. 17

_REAL ( ) Conversion source float (single precision) data FLOAT (Single Precision)

1. This function converts float (single precision) data stored in a device specified in into string (exponent) data, and outputs the data obtained by conversion to a device specified in .
Mitsubishi Electronics FXCPU — 5.1.25 REAL_TO_STR(_E) diagram (page 86)
Fig. 18

Float (single precision) data ASCII code for integer part

Automatically stored at the end of the character string

Page 87 of the Mitsubishi Electronics FXCPU user manual — 5.1.25 REAL_TO_STR(_E)
Page 87 · click to enlarge
Page 87
2. The string data obtained by conversion is output to a device specified in as follows: a) The number of digits is fixed respectively for the integer part, decimal part and exponent part as

follows: Integer part: 1, decimal part: 5, exponent part: 2 "2EH (.)" is automatically stored in the 3rd byte, and "45H (E)" is automatically stored in the 9th byte.

Total number of digits (12 digits)

Integer part (1 digit)

Decimal part (5 digits)

Exponent part (2 digits)

-12.3456

E - 1 . 2 3 4 5 6 + 0 1

Float (single precision) data

"45H (E)" is stored.

"2EH (.)" is stored.

b) In "Sign data (integer part)", "20H (space)" is stored when the input value is positive, and "2DH (-)" is

stored when the input value is negative. c) The 6th and later digits of the decimal part are rounded.

Total number of digits (12 digits)

-12.345678

E - 1 . 2 3 4 5 7 8 6

Float (single precision) data

Number of digits of decimal part (5)

These digits are rounded.

d) "30H (0)" is stored in the decimal part when the number of significant figures is small.

Total number of digits (12 digits)

E - 1 . 2 3 4 0 0 + 0 1

Float (single precision) data

"30H (0)" is stored.

Number of digits of decimal part (5)

e) In "Sign data (exponent part)", "2BH (+)" is stored when the input value is positive, and "2DH (-)" is

stored when the input value is negative. f) "30H (0)" is stored in the tens place of the exponent part when the exponent part consists of 1 digit.

Total number of digits (12 digits)

Number of digits of exponent part (2)

-12.3456

E - 1 . 2 3 4 5 6 + 0 1

Float (single precision) data

"30H (0)" is stored.

3. "00H" is automatically stored at the end (7th word) of the character string.
1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data and 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data and 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

+ 0 1

Page 88 of the Mitsubishi Electronics FXCPU user manual — REAL_TO_STR_E EN ENO
Page 88 · click to enlarge
Page 88

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the value stored in a device specified in is outside the following range: 0, ±2 -126 ≤ (Value of device specified in ) ≤ ±2 128
(Error codeK6706)
2. When the range of a device which will store the character string obtained by conversion (device specified in ) exceeds the range of the corresponding device (Error code: K6706)
3. When the conversion result exceeds the specified total number of digits (Error code: K6706)

In this program, float (single precision) data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(REAL_TO_STR)

g_string1="-1.23457E+01" REAL_TO_STR g_real1=-12.34567 _REAL

g_string1 := REAL_TO_STR(g_real1);

2. Function with EN/ENO(REAL_TO_STR_E)

REAL_TO_STR_E EN ENO

g_bool3 := REAL_TO_STR_E(g_bool1, g_real1, g_string1);

g_real1 _REAL · g_string1

Page 89 of the Mitsubishi Electronics FXCPU user manual — 5.1.26 WORD_TO_BOOL(_E)
Page 89 · click to enlarge
Page 89
Mitsubishi Electronics FXCPU — 5.1.26 WORD_TO_BOOL(_E) diagram (page 89)
Fig. 19

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

This function converts word [unsigned]/bit string [16-bit] data into bit data, and outputs the data obtained by conversion.

_WORD ( ) Conversion source word [unsigned]/bit String [16-bit] data Word [unsigned]/ Bit String [16-bit]

This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .

Use the function having "_E" in its name to connect a bus.

Page 90 of the Mitsubishi Electronics FXCPU user manual — WORD_TO_BOOL_E EN ENO
Page 90 · click to enlarge
Page 90

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_BOOL)

g_bool1 WORD_TO_BOOL g_word1=16#0001 _WORD

g_bool1 := WORD_TO_BOOL(g_word1);

2. Function with EN/ENO(WORD_TO_BOOL_E)

WORD_TO_BOOL_E EN ENO

g_bool3 := WORD_TO_BOOL_E(g_bool1, g_word1, g_bool2);

g_word1 _WORD

Page 91 of the Mitsubishi Electronics FXCPU user manual — 0H FALSE
Page 91 · click to enlarge
Page 91

5.1.27 DWORD_TO_BOOL(_E)

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

This function converts double word [unsigned]/bit string [32-bit] data into bit data, and outputs the data obtained by conversion.

DWORD_TO_BOOL(_DWORD); ExampleM0:= DWORD_TO_BOOL(Label);

DWORD_TO_BO OL

DWORD_TO_BOOL _DWORD *1 Label M0

DWORD_TO_BOOL_E(EN, _DWORD, Output label); Example: DWORD_TO_BOOL_E(X000, Label, M0);

DWORD_TO_BO OL_E

DWORD_TO_BOOL_E EN ENO

*1 M0

_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]

*1 ( ) Bit data after conversion Bit

This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .

0H FALSE

12345678H TRUE

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DWORD · Double word [unsigned]/ · Bit data

Page 92 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_BOOL_E EN ENO
Page 92 · click to enlarge
Page 92

In this program, double word [unsigned]/bit string [32-bit] data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DWORD_TO_BOOL)

g_bool1 DWORD_TO_BOOL g_dword1=16#00000001 _DWORD

g_bool1 := DWORD_TO_BOOL(g_dword1);

2. Function with EN/ENO(DWORD_TO_BOOL_E)

DWORD_TO_BOOL_E EN ENO

g_bool3 := DWORD_TO_BOOL_E(g_bool1, g_dword1, g_bool2);

g_dword1 _DWORD

Page 93 of the Mitsubishi Electronics FXCPU user manual — 5678H 22136
Page 93 · click to enlarge
Page 93

5.1.28 WORD_TO_INT(_E)

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

This function converts word [unsigned]/bit string [16-bit] data into word [signed] data, and outputs the data obtained by conversion.

WORD_TO_INT(_WORD); ExampleD10:= WORD_TO_INT(D0);

WORD_TO_INT

WORD_TO_INT _WORD *1 D0 D10

WORD_TO_INT_E(EN,_WORD, Output label); Example: WORD_TO_INT_E(X000,D0, D10);

WORD_TO_INT_ E

WORD_TO_INT_E EN ENO

D0 _WORD

_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

5678H 22136

Word [unsigned]/ bit string [16-bit] data

Use the function having "_E" in its name to connect a bus.

Word [signed] data

Page 94 of the Mitsubishi Electronics FXCPU user manual — WORD_TO_INT_E EN ENO
Page 94 · click to enlarge
Page 94

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_INT)

g_int1=10 WORD_TO_INT g_word1=16#000A _WORD

g_int1 := WORD_TO_INT(g_word1);

2. Function with EN/ENO(WORD_TO_INT_E)

WORD_TO_INT_E EN ENO

g_bool3 := WORD_TO_INT_E(g_bool1, g_word1, g_int1);

g_word1 _WORD · g_int1

Page 95 of the Mitsubishi Electronics FXCPU user manual — 5678H
Page 95 · click to enlarge
Page 95

5.1.29 WORD_TO_DINT(_E)

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

This function converts word [unsigned]/bit string [16-bit] data into double word [signed] data, and outputs the data obtained by conversion.

WORD_TO_DINT(_WORD); ExampleLabel:= WORD_TO_DINT(D0);

WORD_TO_DINT

WORD_TO_DINT _WORD *1 D0 Label

WORD_TO_DINT_E(EN,_WORD, Output label); Example: WORD_TO_DINT_E(X000,D0, Label);

WORD_TO_DINT _E

WORD_TO_DINT_E EN ENO

D0 _WORD

_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts word [unsigned]/bit string [16-bit] data storeds in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

5678H 22136

Word [unsigned]/ bit string [16-bit] data

Double word [signed] data

5678H

0 1 0 1 0 1 1 0 0 1 0 0 0

0 1 0 1 0 1 1 0 0 1 0 0 0

Each of high-order 16 bits becomes "0" after data conversion.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label · Data conversion

Page 96 of the Mitsubishi Electronics FXCPU user manual — WORD_TO_DINT_E EN ENO
Page 96 · click to enlarge
Page 96

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_DINT)

g_dint1=4660 WORD_TO_DINT g_word1=16#1234 _WORD

g_dint1 := WORD_TO_DINT(g_word1);

2. Function with EN/ENO(WORD_TO_DINT_E)

WORD_TO_DINT_E EN ENO

g_bool3 := WORD_TO_DINT_E(g_bool1, g_word1, g_dint1);

g_word1 _WORD · g_dint1

Page 97 of the Mitsubishi Electronics FXCPU user manual — BC614EH
Page 97 · click to enlarge
Page 97

5.1.30 DWORD_TO_INT(_E)

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

This function converts double word [unsigned]/bit string [32-bit] data into word [signed] data, and outputs the data obtained by conversion.

DWORD_TO_INT(_DWORD); ExampleD10:= DWORD_TO_INT(Label);

DWORD_TO_INT

DWORD_TO_INT _DWORD *1 Label D10

DWORD_TO_INT_E(EN, _DWORD, Output label); Example: DWORD_TO_INT_E(X000,Label, D10);

DWORD_TO_INT _E

DWORD_TO_INT_E EN ENO

_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

BC614EH 24910

bit string [32-bit] data

BC614EH

0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 1 0

0 1 1 0 1 0 1 0 0 1 1 1 0

The information stored in high-order 16 bits is discarded.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DWORD · Double word [unsigned]/ · Word [signed] data

Page 98 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_INT_E EN ENO
Page 98 · click to enlarge
Page 98

In this program, double word [unsigned]/bit string [32-bit] data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DWORD_TO_INT)

g_int1=9029 DWORD_TO_INT g_dword1=16#00012345 _DWORD

g_int1 := DWORD_TO_INT(g_dword1);

2. Function with EN/ENO(DWORD_TO_INT_E)

DWORD_TO_INT_E EN ENO

g_bool3 := DWORD_TO_INT_E(g_bool1, g_dword1, g_int1);

g_dword1 _DWORD · g_int1

Page 99 of the Mitsubishi Electronics FXCPU user manual — BC614EH 12345678
Page 99 · click to enlarge
Page 99

5.1.31 DWORD_TO_DINT(_E)

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

This function converts double word [unsigned]/bit string [32-bit] data into double word [signed] data, and outputs the data obtained by conversion.

DWORD_TO_DINT(_DWORD); ExampleLabel 2:= DWORD_TO_DINT(Label 1);

DWORD_TO_DIN T

DWORD_TO_DINT _DWORD *1 Label 1 Label 2

DWORD_TO_DINT_E(EN, _DWORD, Output label); Example: DWORD_TO_DINT_E(X000, Label 1, Label 2);

DWORD_TO_DIN T_E

DWORD_TO_DINT_E EN ENO

_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

BC614EH 12345678

Double word [signed] data

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label 1 _DWORD · *1 Label 2 · Double word [unsigned]/

Page 100 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_DINT_E EN ENO
Page 100 · click to enlarge
Page 100

In this program, double word [unsigned]/bit string [32-bit] data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DWORD_TO_DINT)

g_dint1=74565 DWORD_TO_DINT g_dword1=16#00012345 _DWORD

g_dint1 := DWORD_TO_DINT(g_dword1);

2. Function with EN/ENO(DWORD_TO_DINT_E)

DWORD_TO_DINT_E EN ENO

g_bool3 := DWORD_TO_DINT_E(g_bool1, g_dword1, g_dint1);

g_dword1 _DWORD · g_dint1

Page 101 of the Mitsubishi Electronics FXCPU user manual — 5678H 00005678H
Page 101 · click to enlarge
Page 101

5.1.32 WORD_TO_DWORD(_E)

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

This function converts word [unsigned]/bit string [16-bit] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.

WORD_TO_DWORD(_WORD); ExampleLabel:= WORD_TO_DWORD(D0);

WORD_TO_DWORD _WORD *1 D0 Label

WORD_TO_DWO RD

WORD_TO_DWORD_E(EN, _WORD, Output label); Example: WORD_TO_DWORD_E(X000,D0, Label);

WORD_TO_DWO RD_E

WORD_TO_DWORD_E

EN ENO

D0 _WORD

_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]

*1 ( ) Double word[unsigned]/bit string[32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]

This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into double word [unsigned]/bit [32-bit] data, and outputs the data obtained by conversion to a device specified in . Each of high-order 16 bits becomes "0" after data conversion.

5678H 00005678H

Word [unsigned]/ bit string [16-bit] data

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

*1 Label · Double word [unsigned]/

Page 102 of the Mitsubishi Electronics FXCPU user manual — WORD_TO_DWORD_E EN ENO
Page 102 · click to enlarge
Page 102

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_DWORD)

g_dword1=16#00001234 WORD_TO_DWORD g_word1=16#1234 _WORD

g_dword1 := WORD_TO_DWORD(g_word1);

2. Function with EN/ENO(WORD_TO_DWORD_E)

WORD_TO_DWORD_E EN ENO

g_bool3 := WORD_TO_DWORD_E(g_bool1, g_word1, g_dword1);

g_word1 _WORD · g_dword1

Page 103 of the Mitsubishi Electronics FXCPU user manual — 5678H
Page 103 · click to enlarge
Page 103

5.1.33 DWORD_TO_WORD(_E)

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

This function converts double word [unsigned]/bit string[32-bit] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.

DWORD_TO_WORD(_DWORD); ExampleD10:= DWORD_TO_WORD(Label);

DWORD_TO_WO RD

DWORD_TO_WORD _DWORD *1 Label D10

DWORD_TO_WORD_E(EN, _DWORD, Output label); Example: DWORD_TO_WORD_E(X000, Label, D10);

DWORD_TO_WO RD_E

DWORD_TO_WORD_E EN ENO

_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned] /Bit string [32-bit]

*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in

12345678H 5678H

Word [unsigned]/ bit string [16-bit] data

bit string [32-bit] data

1 2 3 4 5 6 7 8

12345678H

0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0

5678H

0 1 0 1 0 1 1 0 0 1 0 0 0

The information stored in high-order 16 bits is discarded.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _DWORD · Double word [unsigned]/

Page 104 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_WORD_E EN ENO
Page 104 · click to enlarge
Page 104

In this program, double word [unsigned]/bit string [32-bit] data stored in a device specified in is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_DWORD)

g_word1=16#5678 DWORD_TO_WORD g_dword1=16#12345678 _DWORD

g_word1 := DWORD_TO_WORD(g_dword1);

2. Function with EN/ENO(WORD_TO_DWORD_E)

DWORD_TO_WORD_E EN ENO

g_bool3 := DWORD_TO_WORD_E(g_bool1, g_dword1, g_word1);

g_dword1 _DWORD · g_word1

Page 105 of the Mitsubishi Electronics FXCPU user manual — 5.1.34 WORD_TO_TIME(_E)
Page 105 · click to enlarge
Page 105
Mitsubishi Electronics FXCPU — 5.1.34 WORD_TO_TIME(_E) diagram (page 105)
Fig. 20

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

This function converts word [unsigned]/bit string [16-bit] data into time data, and outputs the data obtained by conversion.

_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String[ 16-bit]

This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Page 106 of the Mitsubishi Electronics FXCPU user manual — WORD_TO_TIME_E EN ENO
Page 106 · click to enlarge
Page 106

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(WORD_TO_TIME)

g_time1 WORD_TO_TIME g_word1 _WORD

g_time1 := WORD_TO_TIME(g_word1);

2. Function with EN/ENO(WORD_TO_TIME_E)

WORD_TO_TIME_E EN ENO

g_bool3 := WORD_TO_TIME_E(g_bool1, g_word1, g_time1);

g_word1 _WORD · g_time1

Page 107 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_TIM E_E
Page 107 · click to enlarge
Page 107

5.1.35 DWORD_TO_TIME(_E)

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

This function converts double word [unsigned]/bit string [32-bit] data into time data, and outputs the data obtained by conversion.

DWORD_TO_TIME(_DWORD); ExampleLabel 2:= DWORD_TO_TIME(Label 1);

DWORD_TO_TIM E

DWORD_TO_TIME _DWORD *1 Label 1 Label 2

DWORD_TO_TIME_E(EN,_ DWORD, Output label); Example: DWORD_TO_TIME_E(X000, Label 1, Label 2);

DWORD_TO_TIM E_E

DWORD_TO_TIME_E

EN ENO

_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]

*1 ( ) Time data after conversion Time

This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Show 6 more labels / short text on this page
Label 1 _DWORD · *1 Label 2 · 0 0ms · 1234567 20m34s567ms · Double word [unsigned]/ · Time data
Page 108 of the Mitsubishi Electronics FXCPU user manual — DWORD_TO_TIME_E EN ENO
Page 108 · click to enlarge
Page 108

In this program, double word [unsigned]/bit string [32-bit] data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(DWORD_TO_TIME)

g_time1 DWORD_TO_TIME g_dword1 _DWORD

g_time1 := DWORD_TO_TIME(g_dword1);

2. Function with EN/ENO(DWORD_TO_TIME_E)

DWORD_TO_TIME_E EN ENO

g_bool3 := DWORD_TO_TIME_E(g_bool1, g_dword1, g_time1);

g_dword1 _DWORD · g_time1

Page 109 of the Mitsubishi Electronics FXCPU user manual — 5.1.36 STR_TO_BOOL(_E)
Page 109 · click to enlarge
Page 109
Mitsubishi Electronics FXCPU — 5.1.36 STR_TO_BOOL(_E) diagram (page 109)
Fig. 21

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

This function converts string data into bit data, and outputs the data obtained by conversion.

This function converts string data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .

1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data. Use global labels when specifying labels.
Page 110 of the Mitsubishi Electronics FXCPU user manual — STR_TO_BOOL_E EN ENO
Page 110 · click to enlarge
Page 110

In this program, string data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(STR_TO_BOOL)

g_bool1 STR_TO_BOOL g_string1 _STRING

g_bool1 := STR_TO_BOOL(g_string1);

2. Function with EN/ENO(STR_TO_BOOL_E)

STR_TO_BOOL_E EN ENO

g_bool3 := STR_TO_BOOL_E(g_bool1, g_string1, g_bool2);

g_string1 _STRING

Page 111 of the Mitsubishi Electronics FXCPU user manual — 5.1.37 STR_TO_INT(_E)
Page 111 · click to enlarge
Page 111
Mitsubishi Electronics FXCPU — 5.1.37 STR_TO_INT(_E) diagram (page 111)
Fig. 22

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

This function converts string data into word [signed] data, and outputs the data obtained by conversion.

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts string data (3 words) stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

Sign data Low-order byte String 1st word 2nd word 3rd word Word [signed] data

ASCII code for hundreds place ASCII code for thousands place

ASCII code for tens place ASCII code for ones place

1. Use the function having "_E" in its name to connect a bus.
2. When handling string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data. Use global labels when specifying labels.
Page 112 of the Mitsubishi Electronics FXCPU user manual — STR_TO_INT_E EN ENO
Page 112 · click to enlarge
Page 112

Error

1. When the sign data (low-order byte) of the 1st word stored in a device specified in is any other than "20H (space)" or "2DH (-)" (Error code: K6706)
2. When the ASCII code for each place (digit) stored in to +2 is any other than "30H" to "39H", "20H (space)" or "00H (NULL)" (Error code: K6706)
3. When the value stored in to +2 is outside the following range: -32768 to +32767 (Error code: K6706)
4. When any of devices to +2 exceeds the device range (Error code: K6706)

In this program, string data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(STR_TO_INT)

g_int1=-12345 STR_TO_INT g_string1="-12345" _STRING

g_int1 := STR_TO_INT(g_string1);

2. Function with EN/ENO(STR_TO_INT_E)

STR_TO_INT_E EN ENO

g_bool3 := STR_TO_INT_E(g_bool1, g_string1, g_int1);

Show 5 more labels / short text on this page
s s · s s · s s · g_string1 _STRING · g_int1
Page 113 of the Mitsubishi Electronics FXCPU user manual — STR_TO_DINT_E EN ENO
Page 113 · click to enlarge
Page 113

5.1.38 STR_TO_DINT(_E)

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

This function converts string data into double word [signed] data, and outputs the data obtained by conversion.

STR_TO_DINT(_STRING); ExampleLabel 2:= STR_TO_DINT(Label 1);

STR_TO_DINT

STR_TO_DINT _STRING *1 Label 1 Label 2

STR_TO_DINT_E(EN,_STRING, Output label); Example: STR_TO_DINT_E(X000, Label 1, Label 2);

STR_TO_DINT_E EN ENO

STR_TO_DINT_E

_STRING ( ) Conversion source string data String

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts string data (6 words) stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

Sign data Low-order byte String 1st word 2nd word 3rd word 4th word 5th word 6th word

ASCII code for billions place

ASCII code for ten-millions place ASCII code for hundred-millions place

ASCII code for millions place ASCII code for hundred-thousands place ASCII code for thousands place

ASCII code for ten-thousands place

Double word [signed] data

ASCII code for tens place ASCII code for hundreds place

ASCII code for ones place

1. Use the function having "_E" in its name to connect a bus.
2. When handling string data and 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data and 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Show 4 more labels / short text on this page
Label 1 _STRING · *1 Label 2 · High-order byte · (Ignore)
Page 114 of the Mitsubishi Electronics FXCPU user manual — STR_TO_DINT_E EN ENO
Page 114 · click to enlarge
Page 114

Error

1. When the sign data (low-order byte) of the 1st word stored in a device specified in is any other than "20H (space)" or "2DH (-)" (Error code: K6706)
2. When the ASCII code for each place (digit) stored in to +5 is any other than "30H" to "39H", "20H (space)" or "00H (NULL)" (Error code: K6706)
3. When the value stored in to +5 is outside the following range: -2,147,483,648 to +2,147,483,647 (Error code: K6706)
4. When any of devices to +5 exceeds the device range (Error code: K6706)

In this program, string data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(STR_TO_DINT)

g_dint1=65000 STR_TO_DINT g_string1="_ _65000" _STRING

g_dint1 := STR_TO_DINT(g_string1);

2. Function with EN/ENO(STR_TO_DINT_E)

STR_TO_DINT_E EN ENO

g_bool3 := STR_TO_DINT_E(g_bool1, g_string1, g_dint1);

Show 5 more labels / short text on this page
s s · s s · s s · g_string1 _STRING · g_dint1
Page 115 of the Mitsubishi Electronics FXCPU user manual — 0000H
Page 115 · click to enlarge
Page 115

5.1.39 STR_TO_REAL(_E)

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

This function converts string data into float (single precision) data, and outputs the data obtained by conversion.

STR_TO_REAL(_STRING); ExampleLabel 2:= STR_TO_REAL(Label 1);

STR_TO_REAL

STR_TO_REAL _STRING *1 Label 1 Label 2

STR_TO_REAL_E(EN,_STRING, Output label); Example: STR_TO_REAL_E(X000, Label 1, Label 2);

STR_TO_REAL_E EN ENO

STR_TO_REAL_E

_STRING ( ) Conversion source string data String

*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)

1. This function converts string data (in the decimal format or exponent format) stored in a device specified in into float (single precision) data, and outputs the data obtained by conversion to a device specified in .

Sign data Low-order byte String 1st word 2nd word 3rd word 4th word 5th word 6th word 7th word 0000H (Indicates the end of the character string.)

ASCII code for 1st character

ASCII code for 3rd character ASCII code for 2nd character

ASCII code for 4th character ASCII code for 5th character ASCII code for 7th character ASCII code for 9th character ASCII code for 11th character

ASCII code for 8th character ASCII code for 6th character

ASCII code for 10th character

Float (single precision) data

2. The conversion source string data can be in the decimal format or exponent format. a) In the case of decimal format

2DH (-) Low-order byte String 1st word 2nd word 3rd word 4th word 5th word Float (single precision) data

31H (1) High-order byte

33H (3) 2EH (.) 35H (5) 30H (0) 34H (4) 33H (3) -1.35034

0000H

- 1 . 3 5 0 3 4

Label 1 _STRING · *1 Label 2 · High-order byte

Page 116 of the Mitsubishi Electronics FXCPU user manual — 33H (3) 45H (E) 31H (1)
Page 116 · click to enlarge
Page 116

b) In the case of exponent format

2DH (-) Low-order byte String

31H (1) High-order byte

1st word 2nd word 3rd word 4th word 5th word 6th word 7th word

33H (3) 2EH (3) 35H (5) 30H (0) 34H (4) 2DH (-) 30H (0)

33H (3) 45H (E) 31H (1)

-1.35034E-10

Float (single precision) data 0000H

- 1 . 3 5 0 3 4 E - 1 0

3. With regard to string data, six digits excluding the sign, decimal point and exponent part are valid, and the 7th and later digits are discarded during conversion. a) In the case of decimal format

- 1 . 3 5 0 3 4 1 2 0 2 3 -1.35034

Float (single precision) data Discarded

b) In the case of exponent format

- 1 . 3 5 0 3 4 1 2 E - 1 0 -1.35034E-10

Float (single precision) data Discarded

4. String data in the decimal format is handled as positive value during conversion when the sign is set to "2BH (+)" or when the sign is omitted. It is handled as negative value during conversion when the sign is set to "2DH (-)".
5. String data in the exponent format is handled as positive value during conversion when the sign of the exponent part is set to "2BH (+)" or when the sign is omitted. It is handled as negative value during conversion when the sign is set to "2DH (-)".
6. When "20H (space)" or "30H (0)" exists between the sign and the first number except "0" in string data, "20H (space)" or "30H (0)" is ignored during conversion. a) In the case of decimal format
1. 3 - 0 5 0 3 4 -1.35034

Float (single precision) data Ignored

b) In the case of exponent format

- 0 1 . 3 5 0 3 4 E - 1 0 -1.35034E-10

Float (single precision) data Ignored

7. When "30H (0)" exists between "E" and a number in character string data (in the exponent format), "30H (0)" is ignored during conversion.

- 1 . 3 5 0 3 4 E - 0 2 -1.35034E-2

Float (single precision) data Ignored

8. When "20H (space)" is contained in character string, "20H (space)" is ignored during conversion.
9. Up to 24 characters can be input as string data. Each of "20H (space)" and "30H (0)" contained in string is counted as 1 character respectively.
1. Use the function having "_E" in its name to connect a bus.
2. When handling string data and 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data and 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Page 117 of the Mitsubishi Electronics FXCPU user manual — STR_TO_REAL_E EN ENO
Page 117 · click to enlarge
Page 117

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When any character other than "30H (0)" to "39H (9)" exists in the integer or decimal part (Error code: K6706)
2. When "2EH (.)" exists in two or more positions inside the character string specified in (Error code: K6706)
3. When any character other than "45H (E)", "2BH (+)" or "2DH (-)" exists in the exponent part, or when two or more exponent parts exist (Error code: K6706)
4. When the number of characters after is "0" or any value larger than "24" (Error code: K6706)

In this program, string data stored in a device specified in is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(STR_TO_REAL)

g_real1 STR_TO_REAL g_string1 _STRING

g_real1 := STR_TO_REAL(g_string1);

2. Function with EN/ENO(STR_TO_REAL_E)

STR_TO_REAL_E EN ENO

g_bool3 := STR_TO_REAL_E(g_bool1, g_string1, g_real1);

g_string1 _STRING · g_real1

Page 118 of the Mitsubishi Electronics FXCPU user manual — STR_TO_TIME_E EN ENO
Page 118 · click to enlarge
Page 118

5.1.40 STR_TO_TIME(_E)

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

This function converts string data into time data, and outputs the data obtained by conversion.

STR_TO_TIME(_STRING); ExampleLabel 2:= STR_TO_TIME(Label 1);

STR_TO_TIME

STR_TO_TIME _STRING *1 Label 1 Label 2

STR_TO_TIME_E(EN,_STRING, Output label); Example: STR_TO_TIME_E(X000, Label 1, Label 2);

STR_TO_TIME_E EN ENO

STR_TO_TIME_E

_STRING ( ) Conversion source string data String

*1 ( ) Time data after conversion Time

This function converts string data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

String data Time data

1. Use the function having "_E" in its name to connect a bus.
2. When handling string data and 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling string data and 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Show 4 more labels / short text on this page
Label 1 _STRING · *1 Label 2 · '0' 0ms · '1234567' 20m34s567ms
Page 119 of the Mitsubishi Electronics FXCPU user manual — STR_TO_TIME_E EN ENO
Page 119 · click to enlarge
Page 119

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the sign data of numeric data specified in is any other than "20H (space)" or "2DH (-)" (Error code: K6706)
2. When the ASCII code for each digit of character string data specified in is any other than "30H (0)" to "39H (9)", "20H (space)" or "00H (NULL)" (Error code: K6706)
3. When the numeric value specified in is outside the following range: -2,147,483,648 to +2,147,483,647 (Error code: K6706)

In this program, string data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(STR_TO_TIME)

g_time1 STR_TO_TIME g_string1 _STRING

g_time1 := STR_TO_TIME(g_string1);

2. Function with EN/ENO(STR_TO_TIME_E)

STR_TO_TIME_E EN ENO

g_bool3 := STR_TO_TIME_E(g_bool1, g_string1, g_time1);

g_string1 _STRING · g_time1

Page 120 of the Mitsubishi Electronics FXCPU user manual — Error
Page 120 · click to enlarge
Page 120

5.1.41 BCD_TO_INT(_E)

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

This function converts BCD data into word [signed] data, and outputs the data obtained by conversion.

BCD_TO_INT(_BCD); ExampleD10:= BCD_TO_INT(D0);

BCD_TO_INT

BCD_TO_INT _BCD *1 D0 D10

BCD_TO_INT_E(EN,_BCD, Output label); Example: BCD_TO_INT_E(X000,D0,D10);

BCD_TO_INT_E EN ENO

BCD_TO_INT_E

D0 _BCD

_BCD ( ) Conversion source BCD data Word [unsigned]/ Bit String [16-bit]

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts BCD data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

9999H 9999

Word [unsigned]/ bit string [16-bit] data

8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 1

9999H 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1

Thousands place Hundreds place Tens place Ones place

Conversion into word [signed] data

3276516354 8192 4095 2048 1024 512 256 128 64 32 16 8 4 2 1

0 1 0 0 1 1 1 0 1 9999

Always becomes "0".

Use the function having "_E" in its name to connect a bus.

Error

When the source data is not BCD (decimal number), M8067 (operation error) turns ON.

Word [signed] data

Page 121 of the Mitsubishi Electronics FXCPU user manual — BCD_TO_INT_E EN ENO
Page 121 · click to enlarge
Page 121

In this example, BCD data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BCD_TO_INT)

g_int1=1234 BCD_TO_INT g_word1=16#1234 _BCD

g_int1 := BCD_TO_INT(g_word1);

2. Function with EN/ENO(BCD_TO_INT_E)

BCD_TO_INT_E EN ENO

g_bool3 := BCD_TO_INT_E(g_bool1, g_word1, g_int1);

g_word1 _BCD · g_int1

Page 122 of the Mitsubishi Electronics FXCPU user manual — Error
Page 122 · click to enlarge
Page 122

5.1.42 BCD_TO_DINT(_E)

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

This function converts BCD data into double word [signed] data, and outputs the data obtained by conversion.

BCD_TO_DINT(_BCD); ExampleLabel 2:= BCD_TO_DINT(Label 1);

BCD_TO_DINT

BCD_TO_DINT _BCD *1 Label 2 Label 1

BCD_TO_DINT_E(EN,_BCD, Output label); Example: BCD_TO_DINT_E(X000, Label 1, Label 2);

BCD_TO_DINT_E EN ENO

BCD_TO_DINT_E

_BCD ( ) Conversion source BCD data ANY_BIT

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts BCD data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

99999999H 99999999

ANY_BIT data Double word [signed] data

8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1

99999999H

1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1

Conversion into DINT data

231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20

0 1 0 1 0 1 0 1 0 1

Always becomes "0".

Use the function having "_E" in its name to connect a bus.

Error

When the source data is not BCD (decimal number), M8067 (operation error) turns ON.

Show 18 more labels / short text on this page
Label 1 _BCD · *1 Label 2 · Ten- millions · Millions · Hundred- thousands · Ten- thousands · Thousands · Hundreds · Tens place · Ones · place · place · place · place · place · place · place · 99999999
Page 123 of the Mitsubishi Electronics FXCPU user manual — BCD_TO_DINT_E EN ENO
Page 123 · click to enlarge
Page 123

In this example, BCD data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(BCD_TO_DINT)

g_dint1=0 BCD_TO_DINT g_word1=16#0000 _BCD

g_dint1 := BCD_TO_DINT(g_word1);

2. Function with EN/ENO(BCD_TO_DINT_E)

BCD_TO_DINT_E EN ENO

g_bool3 := BCD_TO_DINT_E(g_bool1, g_word1, g_dint1);

g_word1 _BCD · g_dint1

Page 124 of the Mitsubishi Electronics FXCPU user manual — FALSE
Page 124 · click to enlarge
Page 124

5.1.43 TIME_TO_BOOL(_E)

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

This function converts time data into bit data, and outputs the data obtained by conversion.

TIME_TO_BOOL(_TIME); ExampleM0:= TIME_TO_BOOL(Label);

TIME_TO_BOOL

TIME_TO_BOOL _TIME *1 Label M0

TIME_TO_BOOL_E(EN,_TIME, Output label); Example: TIME_TO_BOOL_E(X000, Label, M0);

TIME_TO_BOOL_ E

TIME_TO_BOOL_E EN ENO

*1 M0

_TIME ( ) Conversion source time data Time

*1 ( ) Bit data after conversion Bit

This function converts time data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .

FALSE

TRUE

Time data Bit data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _TIME · 0ms · 20m34s567ms

Page 125 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_BOOL_E EN ENO
Page 125 · click to enlarge
Page 125

In this program, time data stored in a device specified in is converted into bit data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_BOOL)

g_bool1 TIME_TO_BOOL g_time1 _TIME

g_bool1 := TIME_TO_BOOL(g_time1);

2. Function with EN/ENO(TIME_TO_BOOL_E)

TIME_TO_BOOL_E EN ENO

g_bool3 := TIME_TO_BOOL_E(g_bool1, g_time1, g_bool2);

g_time1 _TIME

Page 126 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_INT_E EN ENO
Page 126 · click to enlarge
Page 126

5.1.44 TIME_TO_INT(_E)

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

This function converts time data into word [signed] data, and outputs the data obtained by conversion.

TIME_TO_INT(_TIME); ExampleD10:= TIME_TO_INT(Label);

TIME_TO_INT

TIME_TO_INT _TIME *1 Label D10

TIME_TO_INT_E(EN,_TIME, Output label); Example: TIME_TO_INT_E(X000, Label, D10);

TIME_TO_INT_E EN ENO

TIME_TO_INT_E

_TIME ( ) Conversion source time data Time

*1 ( ) Word [signed] data after conversion Word [signed]

This function converts time data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .

Time data Word [signed] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _TIME · 1234 1s234ms

Page 127 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_INT_E EN ENO
Page 127 · click to enlarge
Page 127

In this program, time data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_INT)

g_int1 TIME_TO_INT g_time1 _TIME

g_int1 := TIME_TO_INT(g_time1);

2. Function with EN/ENO(TIME_TO_INT_E)

TIME_TO_INT_E EN ENO

g_bool3 := TIME_TO_INT_E(g_bool1, g_time1, g_int1);

g_time1 _TIME · g_int1

Page 128 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_DINT_ E
Page 128 · click to enlarge
Page 128

5.1.45 TIME_TO_DINT(_E)

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

This function converts time data into double word [signed] data, and outputs the data obtained by conversion.

TIME_TO_DINT(_TIME); ExampleLabel 2:= TIME_TO_DINT(Label 1);

TIME_TO_DINT

TIME_TO_DINT _TIME *1 Label 1 Label 2

TIME_TO_DINT_E(EN,_TIME, Output label); Example: TIME_TO_DINT_E(X000,Label 1, Label 2);

TIME_TO_DINT_ E

TIME_TO_DINT_E EN ENO

_TIME ( ) Conversion source time data Time

*1 ( ) Double word [signed] data after conversion Double Word [signed]

This function converts time data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .

Time data Double word [signed] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label 1 _TIME · *1 Label 2 · 1234567 20m34s567ms

Page 129 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_DINT_E EN ENO
Page 129 · click to enlarge
Page 129

In this program, time data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_DINT)

g_dint1 TIME_TO_DINT g_time1 _TIME

g_dint1 := TIME_TO_DINT(g_time1);

2. Function with EN/ENO(TIME_TO_DINT_E)

TIME_TO_DINT_E EN ENO

g_bool3 := TIME_TO_DINT_E(g_bool1, g_time1, g_dint1);

g_time1 _TIME · g_dint1

Page 130 of the Mitsubishi Electronics FXCPU user manual — Error
Page 130 · click to enlarge
Page 130

5.1.46 TIME_TO_STR(_E)

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

This function converts time data into string data, and outputs the data obtained by conversion.

TIME_TO_STR(_TIME); ExampleLabel 2:= TIME_TO_STR(Label 1);

TIME_TO_STR

TIME_TO_STR _TIME *1 Label 1 Label 2

TIME_TO_STR_E(EN,_TIME, Output label); Example: TIME_TO_STR_E(X000, Label 1, Label 2);

TIME_TO_STR_E EN ENO

TIME_TO_STR_E

_TIME ( ) Conversion source time data Time

*1 ( ) String data after conversion String

This function converts time data stored in a device specified in into string data, and outputs the data obtained by conversion to a device specified in .

Time data String data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Error

An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the number of points occupied by the device specified in exceeds the range of the corresponding device.

Label 1 _TIME · *1 Label 2 · "1234567" 20m34s567ms

Page 131 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_STR_E EN ENO
Page 131 · click to enlarge
Page 131

In this program, time data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_STR)

g_string1 TIME_TO_STR g_time1 _TIME

g_string1 := TIME_TO_STR(g_time1);

2. Function with EN/ENO(TIME_TO_STR_E)

TIME_TO_STR_E EN ENO

g_bool3 := TIME_TO_STR_E(g_bool1, g_time1, g_string1);

g_time1 _TIME · g_string1

Page 132 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_WORD _E
Page 132 · click to enlarge
Page 132

5.1.47 TIME_TO_WORD(_E)

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

This function converts time data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.

TIME_TO_WORD(_TIME); ExampleD10:= TIME_TO_WORD(Label);

TIME_TO_WORD

TIME_TO_WORD _TIME *1 Label D10

TIME_TO_WORD_E(EN,_TIME, Output label); Example: TIME_TO_WORD_E(X000, Label, D10);

TIME_TO_WORD _E

TIME_TO_WORD_E EN ENO

_TIME ( ) Conversion source time data Time

*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]

This function converts time data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .

Time data Word [unsigned]/ bit string [16-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label _TIME · 1234 1s234ms

Page 133 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_WORD_E EN ENO
Page 133 · click to enlarge
Page 133

In this program, time data stored in a device specified in is converted into word [unsigned]/bit string [16- bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_WORD)

g_word1 TIME_TO_WORD g_time1 _TIME

g_word1 := TIME_TO_WORD(g_time1);

2. Function with EN/ENO(TIME_TO_WORD_E)

TIME_TO_WORD_E EN ENO

g_bool3 := TIME_TO_WORD_E(g_bool1, g_time1, g_word1);

g_time1 _TIME · g_word1

Page 134 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_DWOR D_E
Page 134 · click to enlarge
Page 134

5.1.48 TIME_TO_DWORD(_E)

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

This function converts time data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.

TIME_TO_DWORD(_TIME); ExampleLabel 2:= TIME_TO_DWORD(Label 1);

TIME_TO_DWOR D

TIME_TO_DWORD _TIME *1 Label 1 Label 2

TIME_TO_DWORD_E(EN,_TIME, Output label); Example: TIME_TO_DWORD_E(X000, Label 1, Label 2);

TIME_TO_DWOR D_E

TIME_TO_DWORD_E

EN ENO

_TIME ( ) Conversion source time data Time

*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]

This function converts time data stored in a device specified in into double word [unsigned]/bit string [32- bit] data, and outputs the data obtained by conversion to a device specified in .

Time data Double word [unsigned]/

bit string [32-bit] data

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Label 1 _TIME · *1 Label 2 · 1234567 12m34s567ms

Page 135 of the Mitsubishi Electronics FXCPU user manual — TIME_TO_DWORD_E EN ENO
Page 135 · click to enlarge
Page 135

In this program, time data stored in a device specified in is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in .

1. Function without EN/ENO(TIME_TO_DWORD)

g_dword1 TIME_TO_DWORD g_time1 _TIME

g_dword1 := TIME_TO_DWORD(g_time1);

2. Function with EN/ENO(TIME_TO_DWORD_E)

TIME_TO_DWORD_E EN ENO

g_dword1 := TIME_TO_DWORD(g_time1);

g_time1 _TIME · g_dword1

Page 136 of the Mitsubishi Electronics FXCPU user manual — B= A
Page 136 · click to enlarge
Page 136

5.2 Standard Functions Of One Numeric Variable

5.2 Standard Functions Of One Numeric Variable

5.2.1 ABS(_E)

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

This function obtains the absolute value, and outputs it.

ABS(_IN); ExampleD10:= ABS(D0);

ABS

ABS

*1 D10 D0 _IN

ABS_E(EN,_IN,Output label); ExampleABS_E(X000,D0,D10);

ABS_E EN ENO

ABS_E

D0 _IN

_IN ( ) Data whose absolute value is to be obtained, or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result ANY_NUM

1. This function obtains the absolute value of word [signed]/double word [signed]/float (single precision) data stored in a device specified in , and outputs the operation result to a device specified in using the data type of data stored in devices specified in a device specified in . This function is expressed as follows when the input value is "A" and the output operation result is "B".

B= A

2) When the data type stored in a device specified in is word [signed] and the stored data is "-32768", this function outputs "-32768" to a device specified in . (The maximum absolute value handled by this function is "32,767".) When the data type stored in a device specified in is double word [signed] and the stored data is "- 2147483648", this function outputs "-2147483648" to a device specified in . (The maximum absolute value handled by this function is "2147483647".)

Use the function having "_E" in its name to connect a bus.

s d

Page 137 of the Mitsubishi Electronics FXCPU user manual — ABS_E EN ENO
Page 137 · click to enlarge
Page 137

5.2 Standard Functions Of One Numeric Variable

In this program, the absolute value is obtained for word [signed] data stored in a device specified in , and the operation result is output to a device specified in using the data type same as the data stored in a device specified in .

1. Function without EN/ENO(ABS)

g_int2=5923 ABS g_int1=-5923 _IN

g_int2 := ABS(g_int1);

2. Function with EN/ENO(ABS_E)

ABS_E EN ENO

g_bool3 := ABS_E(g_bool1, g_int1, g_int2);

g_int1 _IN · g_int2

Page 138 of the Mitsubishi Electronics FXCPU user manual — ADD_E EN ENO
Page 138 · click to enlarge
Page 138

5.3 Standard Arithmetic Functions

5.3 Standard Arithmetic Functions

5.3.1 ADD_E

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

This function performs addition using two values (A + B = C), and outputs the operation result.

ADD_E(EN,_IN,_IN,Output label); ExampleADD_E(X000,D0,D10,D20);

ADD_E EN ENO

ADD_E

D0 _IN _IN D10

_IN ( …) Data for addition or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result ANY_NUM

1. This function performs addition ( + ) using word [signed]/double word [signed]/float (single precision) data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

+ 1234 5678 6912

s2 (Word [signed] data)

s1 (Word [signed] data)

Show 4 more labels / short text on this page
s1 s2 · s1 s2 · d s1 s2 · (Word [signed] data)
Page 139 of the Mitsubishi Electronics FXCPU user manual — ADD_E EN ENO
Page 139 · click to enlarge
Page 139

5.3 Standard Arithmetic Functions

1. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
2. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. "TRUE" is output from ENO. However, note that the obtained operation result is not accurate in this case.

Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.

M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"

ONWhen the operation result is less than "-32,768" (16-bit operation) or less than "-
2,147,483,648" (32-bit operation) OFFWhen the operation result is "-32,768" (16-bit operation) or more or "-2,147,483,648" (32-

bit operation) or more

ONWhen the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit
operation) OFFWhen the operation result is "32,767" (16-bit operation) or less or "2,147,483,647" (32-bit

-2 , -1 , 0 , -32,768

-1 , 0 , 1

32,767 , 0 , 1 , 2

The most significant bit of data is "1".

The most significant bit of data is "0".

-1 , 0 , 1

-2 , -1 , 0 , -2,147,483,648

2,147,483,647 , 0 , 1 , 2

In this program, addition is performed using double word [signed] data stored in devices specified in and , and the operation result is output to a device specified in .

ADD_E EN ENO

_IN

_IN

g_bool3:=ADD_E(g_bool1,g_dint1,g_dint2,g_dint3);

Show 17 more labels / short text on this page
Device Name Description · M8021 Borrow · M8022 Carry · operation) or less · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag · s2 d · g_dint1 g_dint2 · g_dint3
Page 140 of the Mitsubishi Electronics FXCPU user manual — SUB_E EN ENO
Page 140 · click to enlarge
Page 140

5.3 Standard Arithmetic Functions

5.3.2 SUB_E

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

This function performs subtraction using two values (A - B = C), and outputs the operation result.

SUB_E(EN,_IN1,_IN2,Output label); Example: SUB_E(X000,D0,D10,D20);

SUB_E EN ENO

SUB_E

D0 _IN1 _IN2 D10

_IN1 ( ) Data to be subtracted or word device which stores such data ANY_NUM

_IN2 ( ) Data for subtraction or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result ANY_NUM

1. This function performs subtraction ( - ) using word [signed]/double word [signed]/float (single precision) data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

12345 - 6789 5556

s2 (Word [signed] data)

s1 (Word [signed] data)

Show 4 more labels / short text on this page
s1 s2 · s1 s2 · d s1 s2 · (Word [signed] data)
Page 141 of the Mitsubishi Electronics FXCPU user manual — SUB_E EN ENO
Page 141 · click to enlarge
Page 141

5.3 Standard Arithmetic Functions

1. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
2. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. "TRUE" is output from ENO. However, note that the obtained operation result is not accurate in this case.

Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.

M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"

ONWhen the operation result is less than "-32,768" (16-bit operation) or less than "-
2,147,483,648" (32-bit operation) OFFWhen the operation result is "-32,768" (16-bit operation) or more or "-2,147,483,648" (32-

bit operation) or more

ONWhen the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit
operation) OFFWhen the operation result is "32,767" (16-bit operation) or less or "2,147,483,647" (32-bit

-2 , -1 , 0 , -32,768

-1 , 0 , 1

32,767 , 0 , 1 , 2

The most significant bit of data is "1".

The most significant bit of data is "0".

-2 , -1 , 0 , -2,147,483,648

-1 , 0 , 1

2,147,483,647 , 0 , 1 , 2

In this program, subtraction is performed using word [signed] data stored in devices specified in and , and the operation result is output to a device specified in .

SUB_E EN ENO

_IN1

_IN2

g_bool3:=SUB_E(g_bool1,g_int1,g_int2,g_int3);

Show 17 more labels / short text on this page
Device Name Description · M8021 Borrow · M8022 Carry · operation) or less · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag · s2 d · g_int1 g_int2 · g_int3
Page 142 of the Mitsubishi Electronics FXCPU user manual — MUL_E EN ENO
Page 142 · click to enlarge
Page 142

5.3 Standard Arithmetic Functions

5.3.3 MUL_E

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

This function performs multiplication using two values (A × B = C), and outputs the operation result.

MUL_E(EN,_IN,_IN,Output label); ExampleMUL_E(X000,D0,D10,D20);

MUL_E EN ENO

MUL_E

D0 _IN _IN D10

_IN ( …) Data for multiplication or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result ANY_NUM

1. This function performs multiplication ( × ) using word [signed]/double word [signed]/float (single precision) data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

s2 (Word [signed] data)

s1 (Word [signed] data)

1. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
2. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. "TRUE" is output from ENO. However, note that the obtained operation result is not accurate in this case.
Show 5 more labels / short text on this page
s1 s2 · s1 s2 · d s1 s2 · 100 15 1500 · (Word [signed] data)
Page 143 of the Mitsubishi Electronics FXCPU user manual — MUL_E EN ENO
Page 143 · click to enlarge
Page 143

5.3 Standard Arithmetic Functions

In this program, multiplication is performed using double word [signed] data stored in devices specified in

and , and the operation result is output to a device specified in .

MUL_E EN ENO

_IN

_IN

g_bool3:=MUL_E(g_bool1,g_dint1,g_dint2,g_dint3);

s1 s2 d · g_dint1 g_dint2 · g_dint3

Page 144 of the Mitsubishi Electronics FXCPU user manual — Error
Page 144 · click to enlarge
Page 144

5.3 Standard Arithmetic Functions

5.3.4 DIV_E

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

This function performs division using two values (A / B = C … remainder), and outputs the quotient.

DIV_E(EN,_IN1,_IN2,Output label); Example: DIV_E(X000,D0,D10,D20);

DIV_E EN ENO

DIV_E

D0 _IN1 _IN2 D10

_IN1 ( ) Data to be divided, or word device which stores such data ANY_NUM

_IN2 ( ) Data for division (divisor), or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result ANY_NUM

This function performs division ( / ) using word [signed]/double word [signed]/float (single precision) data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

5 / 2 2 (Quotient)

(Word [signed] data) s2 (Word [signed] data)

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Error

1. An operation error occurs when the divisor stored in a device specified in is "0", and the function is not executed.
2. An operation error occurs when the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit operation).
Show 5 more labels / short text on this page
s1 s2 · s1 s2 · d s1 s2 · s1 d · (Word [signed] data)
Page 145 of the Mitsubishi Electronics FXCPU user manual — DIV_E EN ENO
Page 145 · click to enlarge
Page 145

5.3 Standard Arithmetic Functions

In this program, division is performed using double word [signed] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .

DIV_E EN ENO

_IN1

_IN2

g_bool3:=DIV_E(g_bool1,g_dint1,g_dint2,g_dint3);

Show 4 more labels / short text on this page
s2 d · s1 s2 · g_dint1 g_dint2 · g_dint3
Page 146 of the Mitsubishi Electronics FXCPU user manual — 5.3.5 MOD(_E)
Page 146 · click to enlarge
Page 146

5.3 Standard Arithmetic Functions

5.3.5 MOD(_E)

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

This function performs division using two values (A / B = C … remainder), and outputs the remainder.

Mitsubishi Electronics FXCPU — 5.3.5 MOD(_E) diagram (page 146)
Fig. 23
_IN1 MOD _IN2; *2 ExampleLabel 3:= Label 1 MOD Label 2;

*1 Label 3 Label 1 _IN1 Label 2 _IN2

MOD_E(EN,_IN1,_IN2,Output label; *2 Example: MOD_E(X000,Label 1, Label 2,Label 3);

*2. Refer to the Cautions

Mitsubishi Electronics FXCPU — 5.3.5 MOD(_E) diagram (page 146)
Fig. 24

_IN1 ( ) Data to be divided, or word device which stores such data ANY_INT

_IN2 ( ) Data for division (divisor), or word device which stores such data ANY_INT

*1 ( ) Word device which will store the operation result ANY_INT

This function performs division ( / ) using word [signed]/double word [signed] data stored in devices specified in and , and outputs the remainder to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

Mitsubishi Electronics FXCPU — 5.3.5 MOD(_E) diagram (page 146)
Fig. 25
1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Note that the "MOD" description method is different from other function description methods in the ST language.

s1 s2 · s1 s2 d · s1 s2

Page 147 of the Mitsubishi Electronics FXCPU user manual — MOD_E EN ENO
Page 147 · click to enlarge
Page 147

5.3 Standard Arithmetic Functions

Error

1. An operation error occurs when the divisor stored in a device specified in is "0", and the function is not executed.
2. An operation error occurs when the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit operation).

In this program, division is performed using double word [signed] data stored in devices specified in and , and the remainder is output to a device specified in using the data type of data stored in devices specified in and .

1. Function without EN/ENO(MOD)

_IN1

_IN2

g_dint3:=g_dint1 MOD g_dint2;

2. Function with EN/ENO(MOD_E)

MOD_E EN ENO

_IN1

_IN2

g_bool3 := MOD_E(g_bool1, g_dint1, g_dint2, g_dint3);

Show 6 more labels / short text on this page
s2 d · s1 s2 · MOD g_dint1=5678 g_dint2=1234 · g_dint3=742 · g_dint1 g_dint2 · g_dint3
Page 148 of the Mitsubishi Electronics FXCPU user manual — EXPT_E EN ENO
Page 148 · click to enlarge
Page 148

5.3 Standard Arithmetic Functions

5.3.6 EXPT(_E)

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

This function obtains raised result, and outputs it.

EXPT(In1,In2); ExampleLabel 2:= EXPT(Label 1,D10);

EXPT

EXPT

*1 Label 2 Label 1 In1 D10 In2

EXPT_E(EN,In1,In2,Output label); ExampleEXPT_E(X000,Label 1,D10, Label 2);

EXPT_E EN ENO

EXPT_E

Label 1 In1 D10 In2

In1 ( ) Data to be raised, or word device which stores such data FLOAT (Single Precision)

In2 ( ) Power data, or word device which stores such data ANY_NUM

*1 ( ) Word device which will store the operation result FLOAT (Single Precision)

This function raises float (single precision) data stored in a device specified in (to the power of the value stored in a device specified in ), and outputs the operation result to a device specified in .

16.0 s2 Float (single

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
Show 6 more labels / short text on this page
*1 Label 2 · s2 d · Word [signed] data · s1 Float (single · precision) data · precision) data
Page 149 of the Mitsubishi Electronics FXCPU user manual — EXPT_E EN ENO
Page 149 · click to enlarge
Page 149

5.3 Standard Arithmetic Functions

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the value stored in a device specified in is negative (Error code: K6706)
2. When the value stored in a device specified in is "0" (Error code: K6706)
3. When the operation result is outside the following range: (Error code: K6706) 2 -126 ≤⏐ Operation result ⏐< 2 128

In this program, the value stored in a device specified in is raised to the power of the value stored in a device specified in , and the operation result is output to a device specified in using the data type of data stored in a device specified in .

1. Function without EN/ENO(EXPT)

g_real2:=EXPT(g_real1,g_int1);

2. Function with EN/ENO(EXPT_E)

EXPT_E EN ENO

g_bool3:=EXPT_E(g_bool1,g_real1,g_int1,g_real2);

Show 11 more labels / short text on this page
s2 d · EXPT g_real1 · g_real2 · In1 · g_int1 · In2 · g_real1 · In1 · g_real2 · g_int1 · In2
Page 150 of the Mitsubishi Electronics FXCPU user manual — MOVE_E EN ENO
Page 150 · click to enlarge
Page 150

5.3 Standard Arithmetic Functions

5.3.7 MOVE(_E)

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

This function transfers data stored in a device to another device.

MOVE(_IN); ExampleD10:= MOVE(D0);

MOVE

MOVE

*1 D10 D0 _IN

MOVE_E(EN,_IN,Output label); ExampleMOVE_E(X000,D0,D10);

MOVE_E EN ENO

MOVE_E

D0 _IN

_IN ( ) Transfer source data, or word device which stores such data ANY

*1 ( ) Transfer destination word device ANY

This function transfers data stored in a device specified in to a device specified in .

Word [signed] data s Word [signed] data d

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

s d

Page 151 of the Mitsubishi Electronics FXCPU user manual — MOVE_E EN ENO
Page 151 · click to enlarge
Page 151

5.3 Standard Arithmetic Functions

In this program, word [signed] data stored in a device specified in is transferred to a device specified in .

1. Function without EN/ENO(MOVE)

MOVE g_int1 _IN g_int2

g_int2:=MOVE(g_int1);

2. Function with EN/ENO(MOVE_E)

MOVE_E EN ENO

g_bool3:=MOVE_E(g_bool1,g_int1,g_int2);

g_int1 _IN · g_int2

Page 152 of the Mitsubishi Electronics FXCPU user manual — 5.4.1 SHL(_E)
Page 152 · click to enlarge
Page 152

5.4 Standard Bit Shift Functions

5.4 Standard Bit Shift Functions

5.4.1 SHL(_E)

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

This function shifts data of specified bit length leftward by the specified number of bits.

Mitsubishi Electronics FXCPU — 5.4.1 SHL(_E) diagram (page 152)
Fig. 26
Mitsubishi Electronics FXCPU — 5.4.1 SHL(_E) diagram (page 152)
Fig. 27

_IN ( ) Word device which stores data to be shifted leftward ANY_BIT

*1 ( ) Word device which will store data obtained by shift ANY_BIT

1. This function shifts word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in a device specified in leftward by "n" bits, and outputs the obtained data to a device specified in using the data type of data stored in a device specified in . Data is shifted leftward by "n" bits specified in . Example: When word [unsigned]/bit string [16-bit] data is stored in a device specified in , and "8" is specified in
Mitsubishi Electronics FXCPU — 5.4.1 SHL(_E) diagram (page 152)
Fig. 28

270FH 0 0 1 0 0 1 1 1 0 1

0 1 0 F00H

2. "n" bits from the least significant bit become "0".

d s · n

Page 153 of the Mitsubishi Electronics FXCPU user manual — SHL_E EN ENO
Page 153 · click to enlarge
Page 153

5.4 Standard Bit Shift Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is shifted leftward by "n" bits, and the obtained data is output to a device specified in using the data type of data stored in a device specified in .

1. Function without EN/ENO(SHL)

_IN

_N

g_word2:=SHL(g_word1,g_const_word1);

2. Function with EN/ENO(SHL_E)

SHL_E EN ENO

_IN

_N

g_bool3:=SHL_E(g_bool1,g_word1,g_const_word1,g_word2);

Show 4 more labels / short text on this page
SHL g_word1=16#F30F g_const_word1=16#0008 · g_word2=16#0F00 · g_word1 g_const_word1 · g_word2
Page 154 of the Mitsubishi Electronics FXCPU user manual — 270FH 27H
Page 154 · click to enlarge
Page 154

5.4 Standard Bit Shift Functions

5.4.2 SHR(_E)

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

This function shifts data of specified bit length rightward by the specified number of bits.

SHR(_IN,_K); ExampleD10:= SHR(D0,K1);

SHR

SHR

*1 D10 D0 _IN _K K1

SHR_E(EN,_IN,_N,Output label); ExampleSHR_E(X000,D0,K1,D10);

SHR_E EN ENO

SHR_E

D0 _IN _N K1

_IN ( ) Word device which stores data to be shifted rightward ANY_BIT

_K,_N ( ) Number of shifted bits ANY_BIT

*1 ( ) Word device which will store data obtained by shift ANY_BIT

1. This function shifts word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in a device specified in rightward by "n" bits, and outputs the obtained data to a device specified in using the data type of data stored in a device specified in . Data is shifted rightward by "n" bits specified in . Example: When word [unsigned]/bit string [16-bit] data is stored in a device specified in , and "8" is specified in

270FH 27H

d s (Word [unsigned]/ bit string [16-bit] data)

(Word [unsigned]/ bit string [16-bit] data)

270FH 0 0 1 0 0 1 1 1 0 1

0 1 0 0 1 1 1 27H

These bits become "0".

2. "n" bits from the most significant bit become "0".
Show 4 more labels / short text on this page
n · d s · n · n
Page 155 of the Mitsubishi Electronics FXCPU user manual — SHR_E EN ENO
Page 155 · click to enlarge
Page 155

5.4 Standard Bit Shift Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is shifted rightward by "n" bits, and the obtained data is output to a device specified in using the data type of data stored in a device specified in .

1. Function without EN/ENO(SHR)

_IN

_K

g_word2:=SHR(g_word1,g_const_word1);

2. Function with EN/ENO(SHR_E)

SHR_E EN ENO

_IN

_N

g_bool3:=SHR_E(g_bool1,g_word1,g_const_word1,g_word2);

Show 4 more labels / short text on this page
SHR g_word1=16#EEEE g_const_word1=16#0006 · g_word2=16#03BB · g_word1 g_const_word1 · g_word2
Page 156 of the Mitsubishi Electronics FXCPU user manual — AND_E EN ENO
Page 156 · click to enlarge
Page 156

5.5 Standard Bitwise Boolean Functions

5.5 Standard Bitwise Boolean Functions

5.5.1 AND_E

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

This function obtains the logical product of two or more bits, and outputs it.

AND_E(EN,_IN,_IN,Output label); ExampleAND_E(X000,M0,M10,M20);

AND_E EN ENO

AND_E

M0 _IN _IN M10

*1 M20

2. Variable

_IN ( …) Device used to obtain the logical product ANY_BIT

*1 ( ) Device which will store the operation result ANY_BIT

1. This function obtains the logical product using each bit of bit/word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [unsigned]/bit string [16-bit]

1 0 1

0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0

0 0 0 1 0 0 1 0 1 0 0

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

s1 s2 · s1 s2 · Logical product

Page 157 of the Mitsubishi Electronics FXCPU user manual — _IN
Page 157 · click to enlarge
Page 157

5.5 Standard Bitwise Boolean Functions

In this program, the logical product is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .

AND_E EN ENO g_bool1

_IN

g_bool3:=AND_E(g_bool1,g_word1,g_word2,g_word3);

Show 5 more labels / short text on this page
s1 s2 d · s1 s2 · g_word3=16#1204 g_bool3 _IN · g_word1=16#FF0F · g_word2=16#1234
Page 158 of the Mitsubishi Electronics FXCPU user manual — OR_E EN ENO
Page 158 · click to enlarge
Page 158

5.5 Standard Bitwise Boolean Functions

5.5.2 OR_E

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

This function obtains the logical sum of two or more bits, and outputs it.

OR_E(EN,_IN,_IN,Output label); ExampleOR_E(X000,M0,M10,M20);

OR_E EN ENO

OR_E

M0 _IN _IN M10

*1 M20

_IN ( …) Device used to obtain the logical sum ANY_BIT

*1 ( ) Device which will store the operation result ANY_BIT

1. This function obtains the logical sum using each bit of bit/word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [unsigned]/bit string [16-bit]]

1 1 0 0 1 0 1

0 1 0 0 0 1 1 0 1 0 0

1 1 0 0 1 0 0 1

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

s1 s2 · d s1 · Logical sum

Page 159 of the Mitsubishi Electronics FXCPU user manual — _IN
Page 159 · click to enlarge
Page 159

5.5 Standard Bitwise Boolean Functions

In this program, the logical sum is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .

OR_E EN ENO g_bool1

_IN

g_bool3:=OR_E(g_bool1,g_word1,g_word2,g_word3);

Show 4 more labels / short text on this page
s1 s2 d · s1 s2 · g_word3=16#DFCF g_bool3 _IN · g_word1=16#5F03 g_word2=16#9CCC
Page 160 of the Mitsubishi Electronics FXCPU user manual — XOR_E EN ENO
Page 160 · click to enlarge
Page 160

5.5 Standard Bitwise Boolean Functions

5.5.3 XOR_E

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

This function obtains the exclusive logical sum of two or more bits, and outputs it.

XOR_E(EN,_IN,_IN,Output label); ExampleXOR_E(X000,M0,M10,M20);

XOR_E EN ENO

XOR_E

M0 _IN _IN M10

*1 M20

_IN ( …) Device used to obtain the exclusive logical sum ANY_BIT

*1 ( ) Device which will store the operation result ANY_BIT

1. This function obtains the exclusive logical sum using each bit of bit/word [unsigned]/bit string [16-bit]/ double word [unsigned]/bit string [32-bit] data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [unsigned]/bit string [16-bit]

1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0

0 0 0 1 1 0 1 0

1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 0

2. The number of pins in can be changed.

s1 s2 · s1 s2 · Exclusive logical sum

Page 161 of the Mitsubishi Electronics FXCPU user manual — _IN
Page 161 · click to enlarge
Page 161

5.5 Standard Bitwise Boolean Functions

3. If there are 3 or more , the exclusive logical sum is obtained using the "exclusive logical sum of and " and . If there is , the exclusive logical sum is obtained using the "exclusive logical sum of "exclusive logical sum of and " and " "" and . In this way, the exclusive logical sum is obtained the required number of times for all input labels … Example: When the data type is bit

s1 s2 s3 s4

When the number of "_IN" is 3

When the number of "_IN" is 4

When the number of "_IN" is 5

FALSE

TRUE

FALSE

TRUE

XOR

XOR

XOR

XOR

TRUE

TRUE

TRUE

TRUE

s2 s3 s4 s5

After that, the exclusive logical sum is obtained the required number of times.

TRUE

FALSE

TRUE

FALSE

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, the exclusive logical sum is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .

XOR_E EN ENO g_bool1

_IN

g_bool3:=XOR_E(g_bool1,g_word1,g_word2,g_word3);

Show 10 more labels / short text on this page
s s1 · s2 s3 · s5 s6 · Result Result Result · Result · s1 s2 d · s1 s2 · g_word3=16#B15A g_bool3 _IN · g_word1=16#AAAA · g_word2=16#1BF0
Page 162 of the Mitsubishi Electronics FXCPU user manual — NOT_E EN ENO
Page 162 · click to enlarge
Page 162

5.5 Standard Bitwise Boolean Functions

5.5.4 NOT(_E)

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

This function obtains the logical negation of bits, and outputs it.

NOT(_IN); ExampleM10:= NOT(M0);

NOT

NOT

M10 _IN M0 *1

NOT_E(EN,_IN,Output label); ExampleNOT_E(X000,M0,M10);

NOT_E EN ENO

NOT_E

M0 _IN

*1 M10

_IN ( ) Device used to obtain the logical negation ANY_BIT

*1 ( ) Device which will store the operation result ANY_BIT

This function obtains the logical negation using each bit of bit/word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in a device specified in , and outputs the operation result to a device specified in using the data type of data stored in a device specified in . Example: When the data type is word [unsigned]/bit string [16-bit]

0 1 1 0 1 0 1 1 0 1

1 0 0 1 0 1 0 0 1 0

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

d s · Logical negation

Page 163 of the Mitsubishi Electronics FXCPU user manual — NOT_E EN ENO
Page 163 · click to enlarge
Page 163

5.5 Standard Bitwise Boolean Functions

In this program, the logical negation is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in a device specified in , and the operation result is output to a device specified in using the data type of data stored in a device specified in .

1. Function without EN/ENO(NOT)

NOT g_word1=16#AAAA _IN g_word2=16#5555

g_word2:= NOT(g_word1);

2. Function with EN/ENO(NOT_E)

NOT_E EN ENO

g_bool3:=NOT_E(g_bool1,g_word1,g_word2);

s d · g_word1 _IN · g_word2

Page 164 of the Mitsubishi Electronics FXCPU user manual — 5.6.1 SEL(_E)
Page 164 · click to enlarge
Page 164

5.6 Standard Selection Functions

5.6 Standard Selection Functions

5.6.1 SEL(_E)

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

This function selects either one between two data in accordance with the input condition, and outputs the selection result.

Mitsubishi Electronics FXCPU — 5.6.1 SEL(_E) diagram (page 164)
Fig. 29
Mitsubishi Electronics FXCPU — 5.6.1 SEL(_E) diagram (page 164)
Fig. 30

_G ( ) Bit data used as the selection condition Bit

_IN0 ( ) Selectable data, or word device which stores such data ANY

_IN1 ( ) Selectable data, or word device which stores such data ANY

*1 ( ) Word device which will store the selection result ANY

This function outputs either one between the values stored in devices specified in and in accordance with the value stored in a device specified in to a device specified in using the data type of data stored in a device specified in and . When the value stored in a device specified in is "FALSE", this function outputs the value stored in a device specified in to a device specified in . When the value stored in a device specified in is "TRUE", this function outputs the value stored in a device specified in to a device specified in . Example: When the data type of input variables and is word [signed]

SEL G _IN0 _IN1 1234 Word [signed] data

1234 Word [signed] data

Show 8 more labels / short text on this page
s2 s3 · s1 d · s2 s3 · s2 d · s3 d · s2 s3 · FALSE Bit data · Word [signed] data
Page 165 of the Mitsubishi Electronics FXCPU user manual — SEL_E EN ENO
Page 165 · click to enlarge
Page 165

5.6 Standard Selection Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, either one between the values stored in devices specified in and is output in accordance with the value stored in a device specified in to a device specified in using the data type of data stored in devices specified in and .

1. Function without EN/ENO(SEL)

_G

_IN0

_IN1

g_word3:=SEL(g_bool1,g_word1,g_word2);

2. Function with EN/ENO(SEL_E)

SEL_E EN ENO

_G

_IN0

g_bool3:=SEL_E(g_bool1,g_bool2,g_word1,g_word2,g_word3);

Show 9 more labels / short text on this page
s2 s3 · s1 d · s2 s3 · SEL g_bool1 g_word1 · g_word3 · g_word2 · g_bool2 g_word1 · g_word3 · g_word2 _IN1
Page 166 of the Mitsubishi Electronics FXCPU user manual — MAXIMUM _IN _IN
Page 166 · click to enlarge
Page 166

5.6 Standard Selection Functions

5.6.2 MAXIMUM(_E)

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

This function searches the maximum value among data, and outputs the maximum value.

MAXIMUM(_IN,_IN); ExampleD20:= MAXIMUM(D0,D10);

MAXIMUM

MAXIMUM

*1 D20 D0 _IN _IN D10

MAXIMUM_E(EN,_IN,_IN,Output label); Example: MAXIMUM_E(X000,D0,D10,D20);

MAXIMUM_E

MAXIMUM_E

EN ENO

D0 _IN _IN D10

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Word device which will store the maximum value ANY_SIMPLE

1. This function outputs the maximum value among ANY_SIMPLE type data stored in devices specified in

and to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

s1 s2 d s1

MAXIMUM _IN _IN

5678 5678 Word [signed] data

2. The number of pins in can be changed.
1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Word [signed] data · Word [signed] data

Page 167 of the Mitsubishi Electronics FXCPU user manual — MAXIMUM_E EN ENO
Page 167 · click to enlarge
Page 167

5.6 Standard Selection Functions

In this program, the maximum value among word [signed] data stored in devices specified in and is output to a device specified in using the data type of data stored in devices specified in and .

1. Function without EN/ENO(MAXIMUM)

_IN

_IN

g_int3:=MAXIMUM(g_int1,g_int2);

2. Function with EN/ENO(MAXIMUM_E)

MAXIMUM_E EN ENO

_IN

_IN

g_bool3:=MAXIMUM_E(g_bool1,g_int1,g_int2,g_int3);

Show 6 more labels / short text on this page
s1 s2 · d s1 s2 · MAXIMUM g_int1=5678 g_int2=1234 · g_int3=5678 · g_int1 g_int2 · g_int3
Page 168 of the Mitsubishi Electronics FXCPU user manual — MINIMUM _IN _IN
Page 168 · click to enlarge
Page 168

5.6 Standard Selection Functions

5.6.3 MINIMUM(_E)

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

This function searches the minimum value among data, and outputs the minimum value.

MINIMUM(_IN,_IN); ExampleD20:= MINIMUM(D0,D10);

MINIMUM

MINIMUM

*1 D20 D0 _IN _IN D10

MINIMUM_E(EN,_IN,_IN,Output label); Example: MINIMUM_E(X000,D0,D10,D20);

MINIMUM_E EN ENO

MINIMUM_E

D0 _IN _IN D10

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Word device which will store the minimum value ANY_SIMPLE

1. This function outputs the minimum value among ANY_SIMPLE type data stored in devices specified in

and to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

s1 s2 d s1

1234 Word [signed] data

MINIMUM _IN _IN

1234 Word [signed] data 5678

2. The number of pins in can be changed.
1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Word [signed] data

Page 169 of the Mitsubishi Electronics FXCPU user manual — MINIMUM_E EN ENO
Page 169 · click to enlarge
Page 169

5.6 Standard Selection Functions

In this program, the minimum value among word [signed] data stored in devices specified in and is output to a device specified in using the data type of data stored in devices specified in and .

1. Function without EN/ENO(MINIMUM)

_IN

_IN

g_int3:=MINIMUM(g_int1,g_int2);

2. Function with EN/ENO(MINIMUM_E)

MINIMUM_E EN ENO

_IN

_IN

g_bool3:=MINIMUM_E(g_bool1,g_int1,g_int2,g_int3);

Show 6 more labels / short text on this page
s1 s2 · d s1 s2 · MINIMUM g_int1=5678 g_int2=1234 · g_int3=1234 · g_int1 g_int2 · g_int3
Page 170 of the Mitsubishi Electronics FXCPU user manual — 5.6.4 LIMITATION(_E)
Page 170 · click to enlarge
Page 170

5.6 Standard Selection Functions

5.6.4 LIMITATION(_E)

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

This function judges whether data is located within the range between the upper limit value and the lower limit value.

Mitsubishi Electronics FXCPU — 5.6.4 LIMITATION(_E) diagram (page 170)
Fig. 31
Mitsubishi Electronics FXCPU — 5.6.4 LIMITATION(_E) diagram (page 170)
Fig. 32

_MN ( ) Lower limit data, or word device which stores such data ANY_SIMPLE

_IN ( ) Input data, or word device which stores such data ANY_SIMPLE

_MX ( ) Upper limit data, or word device which stores such data ANY_SIMPLE

*1 ( ) Word device which will store the output data ANY_SIMPLE

This function outputs data whose type is same as the data stored in devices specified in , and to a device specified in in accordance with ANY_SIMPLE type data stored in devices specified in , and .

1. In the case of "Contents of a device specified in > Contents of a device specified in ", this function outputs the contents of a device specified in to a device specified in .
2. In the case of "Contents of a device specified in < Contents of a device specified in ", this function outputs the contents of a device specified in to a device specified in .
3. In the case of "Contents of a device specified in ≤ Contents of a device specified in ≤ Contents of a device specified in ", this function outputs the contents of a device specified in to a device specified in . Example: When the data type is word [signed]
Mitsubishi Electronics FXCPU — 5.6.4 LIMITATION(_E) diagram (page 170)
Fig. 33
Show 9 more labels / short text on this page
s1 s2 s3 · d s1 · s2 s3 · s2 s3 · s3 d · s2 s1 · s1 d · s1 s2 · s3 s2
Page 171 of the Mitsubishi Electronics FXCPU user manual — LIMITATION_E EN ENO
Page 171 · click to enlarge
Page 171

5.6 Standard Selection Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Error

An operation error occurs when this function is executed in the following setting status. The error flag M8067 turns ON, and D8067 stores the error code K6706. Contents of a device specified in > Contents of a device specified in (Lower limit data) (Upper limit data)

In this program, data whose type is same as the data stored in devices specified in , and is output to a device specified in in accordance with ANY_SIMPLE type data stored in devices specified in , and .

1. Function without EN/ENO(LIMITATION)

_MN

_IN

g_int4:=LIMITATION(g_int1,g_int2,g_int3);

2. Function with EN/ENO(LIMITATION_E)

LIMITATION_E EN ENO

_MN

_IN

g_bool3:=LIMITATION_E(g_bool1,g_int1,g_int2,g_int3,g_int4);

Show 9 more labels / short text on this page
s1 s3 · s1 s2 s3 · s1 s2 s3 · LIMITATION g_int1=500 g_int2=1300 · g_int4=1300 · g_int3=5000 _MX · g_int1 g_int2 · g_int4 · g_int3 _MX
Page 172 of the Mitsubishi Electronics FXCPU user manual — 5.6.5 MUX(_E)
Page 172 · click to enlarge
Page 172

5.6 Standard Selection Functions

5.6.5 MUX(_E)

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

This function selects data, and outputs the selected data.

Mitsubishi Electronics FXCPU — 5.6.5 MUX(_E) diagram (page 172)
Fig. 34
Mitsubishi Electronics FXCPU — 5.6.5 MUX(_E) diagram (page 172)
Fig. 35

_K ( ) Selection data, or word device which stores such data Word [signed]

_IN ( …) Selectable data, or word device which stores such data ANY

*1 Word device which will store the selected data ANY

1. This function outputs either one among values stored in devices specified in … to a device specified in in accordance with the value specified in using the data type of data stored in devices specified in … .

a) When the value specified in is "1", this function outputs the value stored in a device specified in to a device specified in .

b) When the value specified in is "n", this function outputs the value stored in a device specified in to a device specified in . Example: When the data type is word [signed]

Mitsubishi Electronics FXCPU — 5.6.5 MUX(_E) diagram (page 172)
Fig. 36
2. When a value input to is outside the pin number range for … , this function outputs an indefinite value to a device specified in . (An operation error does not occur. "MUX_E" outputs "FALSE" from ENO.)
3. The number of pins in can be changed.
Show 5 more labels / short text on this page
d n · n · s1 d · n · sn d
Page 173 of the Mitsubishi Electronics FXCPU user manual — MUX_E EN ENO
Page 173 · click to enlarge
Page 173

5.6 Standard Selection Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this example, either one among values stored in devices specified in … is output to a device specified in in accordance with the value specified in using the data type of data stored in devices specified in ….

1. Function without EN/ENO(MUL)

_K

_IN

g_int4:=MUX(g_int1,g_int2,g_int3);

2. Function with EN/ENO(MUL_E)

MUX_E EN ENO

_K

_IN

g_bool3:=MUX_E(g_bool1,g_int1,g_int2,g_int3,g_int4);

Show 7 more labels / short text on this page
d n · MUX g_int1=2 g_int2=1234 · g_int4=5678 · g_int3=5678 _IN · g_int1 g_int2 · g_int4 · g_int3 _IN
Page 174 of the Mitsubishi Electronics FXCPU user manual — GT_E EN ENO
Page 174 · click to enlarge
Page 174

5.7 Standard Comparison Functions

5.7 Standard Comparison Functions

5.7.1 GT_E

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

This function compares data with regard to "> (larger)".

GT_E(EN,_IN,_IN,Output label); ExampleGT_E(X000,D0,D10,M0);

GT_E EN ENO

GT_E

_IN D0

*1 M0

_IN D10

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

1. This function compares the contents of devices specified in … , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ > ] & [ > ] & … & [ -1 > ].

s1 s2 s2 s3 sn sn

a) This function outputs "TRUE" when all comparison results are " (n-1) > (n)".

b) This function outputs "FALSE" when any comparison result is " (n-1) ≤ (n)".

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

s s · s s

Page 175 of the Mitsubishi Electronics FXCPU user manual — GT_E EN ENO
Page 175 · click to enlarge
Page 175

5.7 Standard Comparison Functions

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

GT_E EN ENO

_IN

_IN

g_bool3:=GT_E(g_bool1,g_int1,g_int2,g_bool2);

s1 s2 · g_int1 g_int2

Page 176 of the Mitsubishi Electronics FXCPU user manual — GE_E EN ENO
Page 176 · click to enlarge
Page 176

5.7 Standard Comparison Functions

5.7.2 GE_E

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

This function compares data with regard to "≥ (larger or equal)".

Mitsubishi Electronics FXCPU — 5.7.2 GE_E diagram (page 176)
Fig. 37
Mitsubishi Electronics FXCPU — 5.7.2 GE_E diagram (page 176)
Fig. 38

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

1. This function compares the contents of devices specified in … , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ ≥ ] & [ ≥ ] & … & [ -1 ≥ ].

s1 s2 s2 s3 sn sn

a) This function outputs "TRUE" when all comparison results are " (n-1) ≥ (n)".

b) This function outputs "FALSE" when any comparison result is " (n-1) < (n)".

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

GE_E EN ENO

_IN

_IN

g_bool3:=GE_E(g_bool1,g_int1,g_int2,g_bool2);

Show 4 more labels / short text on this page
s s · s s · s1 s2 · g_int1 g_int2
Page 177 of the Mitsubishi Electronics FXCPU user manual — EQ_E EN ENO
Page 177 · click to enlarge
Page 177

5.7 Standard Comparison Functions

5.7.3 EQ_E

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

This function compares data with regard to "= (equal)".

EQ_E(EN,_IN,_IN,Output label); ExampleEQ_E(X000,D0,D10,M0);

EQ_E EN ENO

EQ_E

_IN D0

*1 M0

_IN D10

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

1. This function compares the contents of devices specified in … , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ = ] & [ = ] & … & [ -1 = ].

s1 s2 s2 s3 sn sn

a) This function outputs "TRUE" when all comparison results are " (n-1) = (n)".

b) This function outputs "FALSE" when any comparison result is " (n-1) ≠ (n)".

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

EQ_E EN ENO

_IN

_IN

g_bool3:=EQ_E(g_bool1,g_int1,g_int2,g_bool2);

Show 4 more labels / short text on this page
s s · s s · s1 s2 · g_int1 g_int2
Page 178 of the Mitsubishi Electronics FXCPU user manual — LE_E EN ENO
Page 178 · click to enlarge
Page 178

5.7 Standard Comparison Functions

5.7.4 LE_E

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

This function compares data with regard to "≤ (smaller or equal)".

LE_E(EN,_IN,_IN,Output label); ExampleLE_E(X000,D0,D10,M0);

LE_E EN ENO

LE_E

_IN D0

*1 M0

_IN D10

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

1. This function compares the contents of devices specified in … , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ ≤ ] & [ ≤ ] & … & [ -1 ≤ ].

s1 s2 s2 s3 sn sn

a) This function outputs "TRUE" when all comparison results are " (n-1) ≤ (n)".

b) This function outputs "FALSE" when any comparison result is " (n-1) > (n)".

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

s s · s s

Page 179 of the Mitsubishi Electronics FXCPU user manual — LE_E EN ENO
Page 179 · click to enlarge
Page 179

5.7 Standard Comparison Functions

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

LE_E EN ENO

_IN

_IN

g_bool3:=LE_E(g_bool1,g_int1,g_int2,g_bool2);

s1 s2 · g_int1 g_int2

Page 180 of the Mitsubishi Electronics FXCPU user manual — LT_E EN ENO
Page 180 · click to enlarge
Page 180

5.7 Standard Comparison Functions

5.7.5 LT_E

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

This function compares data with regard to "< (smaller)".

Mitsubishi Electronics FXCPU — 5.7.5 LT_E diagram (page 180)
Fig. 39
Mitsubishi Electronics FXCPU — 5.7.5 LT_E diagram (page 180)
Fig. 40

_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

1. This function compares the contents of devices specified in … , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ < ] & [ < ] & … & [ -1 < ].

s1 s2 s2 s3 sn sn

a) This function outputs "TRUE" when all comparison results are " (n-1) < (n)".

b) This function outputs "FALSE" when any comparison result is " (n-1) ≥ (n)".

2. The number of pins in can be changed.

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

LT_E EN ENO

_IN

_IN

g_bool3:=LT_E(g_bool1,g_int1,g_int2,g_bool2);

Show 4 more labels / short text on this page
s s · s s · s1 s2 · g_int1 g_int2
Page 181 of the Mitsubishi Electronics FXCPU user manual — NE_E EN ENO
Page 181 · click to enlarge
Page 181

5.7 Standard Comparison Functions

5.7.6 NE_E

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

This function compares data with regard to "≠ (unequal)".

NE_E(EN,_IN1,_IN2,Output label); ExampleNE_E(X000,D0,D10,M0);

NE_E EN ENO

NE_E

_IN1 D0

*1 M0

_IN2 D10

_IN1 ( ) Compared data, or word device which stores such data ANY_SIMPLE

_IN2 ( ) Compared data, or word device which stores such data ANY_SIMPLE

*1 ( ) Device which will store the comparison result Bit

This function compares the contents of devices specified in and , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ ≠ ].

a) This function outputs "TRUE" when in the case of " ≠ "

b) This function outputs "FALSE" when in the case of " = "

When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Show 4 more labels / short text on this page
s1 s2 · s1 s2 · s1 s2 · s1 s2
Page 182 of the Mitsubishi Electronics FXCPU user manual — NE_E EN ENO
Page 182 · click to enlarge
Page 182

5.7 Standard Comparison Functions

In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .

NE_E EN ENO

_IN1

_IN2

g_bool3:=NE_E(g_bool1,g_int1,g_int2,g_bool2);

s1 s2 · g_int1 g_int2

Page 183 of the Mitsubishi Electronics FXCPU user manual — 5.8 Standard Character String Functions
Page 183 · click to enlarge
Page 183
Mitsubishi Electronics FXCPU — 5.8 Standard Character String Functions diagram (page 183)
Fig. 41 · 5.8 Standard Character String Functions

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

This function obtains a character string from a specified position.

Label 2 Label 1 _IN D10 _L D20 _P

_IN ( ) Head word device which stores a character string String

_L ( ) Word device which stores the number of characters to be obtained Word [signed]

_P ( ) Word device which stores the head character position of a character string to be obtained Word [signed]

*1 ( ) Head word device which will store the obtained character string String

Page 184 of the Mitsubishi Electronics FXCPU user manual — Error
Page 184 · click to enlarge
Page 184

5.8 Standard Character String Functions

1. This function extracts specified number of characters from an arbitrary position of a character string stored in devices specified in , and outputs the obtained data to devices specified in . The value specified in specifies the number of characters to be extracted. The value specified in specifies the head character position of characters to be extracted. Example: When "5" is specified in and

"ABCDEF12345"

"EF123"

High-order byte Low-order byte

High-order byte Low-order byte

42H(B) 41H(A)

Head character position of a character string to be extracted = 5th character

46H(F) 45H(E)

44H(D)

43H(C)

31H(1) 32H(2)

46H(F) 45H(E)

00H 33H(3)

32H(2)

31H(1)

34H(4)

33H(3)

00H

35H(5)

Number of characters to be extracted = 5

2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.
3. When the number of characters to be extracted specified in is "0", this function does not execute processing.
4. When the number of characters to be extracted specified in is "-1", this function outputs the final character of a character string specified in to devices specified in .
1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When "00H" is not set in the corresponding device range after the device specified in (Error code: K6706)
2. When the head character position specified in exceeds the number of characters of a character string stored in devices specified in (Error code: K6706)
3. When the number of characters specified in exceeds the range of devices specified in (Error code: K6706)
4. When the number of devices after the device number specified in is smaller than the number of devices required for storing an extracted character string (In this case, "00H" cannot be stored after all character strings and the final character.) (Error code: K6706)
5. When the value specified in is negative (Error code: K6706)
6. When the value specified in is "-2" or less (Error code: K6706)
7. When the value specified in exceeds the number of characters of a character string stored in devices specified in (Error code: K6706)
Show 23 more labels / short text on this page
s d · n1 · n2 · n1 n2 · 1st word · 1st word · 2nd word · 2nd word · 3rd word · n2 · 3rd word · 4th word · 5th word · 6th word · n1 · n1 · n1 · s d · n2 · n1 d · n2 · n1 · n1
Page 185 of the Mitsubishi Electronics FXCPU user manual — MID_E EN ENO
Page 185 · click to enlarge
Page 185

5.8 Standard Character String Functions

In this program, specified number of characters are extracted from an arbitrary position of a character string stored in devices specified in , and the obtained data is output to devices specified in .

1. Function without EN/ENO(MID)

_IN

_L

g_string2:=MID(g_string1,g_int1,g_int2);

2. Function with EN/ENO(MID_E)

MID_E EN ENO

_IN

_L

g_bool3:=MID_E(g_bool1,g_string1,g_int1,g_int2,g_string2);

Show 9 more labels / short text on this page
s d · MID g_string1="ABCDEF12345" · g_string2="EF123" · g_int1=5 · g_int2=5 _P · g_string1 · g_string2 · g_int1 · g_int2 _P
Page 186 of the Mitsubishi Electronics FXCPU user manual — _IN ( )
Page 186 · click to enlarge
Page 186

5.8 Standard Character String Functions

5.8.2 CONCAT(_E)

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

This function connects character strings.

CONCAT(_IN,_IN); ExampleLabel 3:= CONCAT(Label 1,Label 2);

CONCAT _IN *1 _IN

CONCAT

Label 3 Label 1 Label 2

CONCAT_E(EN,_IN,_IN,Output label); Example: CONCAT_E(X000,Label 1,Label 2, Label 3);

CONCAT_E EN ENO

CONCAT_E

Label 1 _IN _IN Label 2

_IN ( )

Head word device which stores the data (character string) to be connected, or directly specified character string String

_IN ( )

*1 ( ) Head word device which will store the connected data (character string) String

*1 Label 3

Page 187 of the Mitsubishi Electronics FXCPU user manual — Error
Page 187 · click to enlarge
Page 187

5.8 Standard Character String Functions

1. This function connects a character string stored in devices specified in after a character string stored in devices specified in , and outputs the character string obtained by connection to devices specified in . When connecting a character string stored in devices specified in , this function ignores "00H" which indicates the end of a character string stored in devices specified in . After two character strings are connected, "00H" is automatically added at the end.

"ABCDE"

"ABCDE123456"

High-order byte Low-order byte

High-order byte Low-order byte High-order byte Low-order byte

42H(B) 41H(A)

32H(2) 31H(1)

42H(B)

41H(A)

43H(C) 44H(D)

33H(3) 34H(4)

44H(D)

43H(C)

00H 45H(E)

36H(6)

35H(5)

31H(1) 45H(E)

0000H

33H(3)

32H(2)

35H(5)

34H(4)

00H

36H(6)

2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.
3. For direct specification, up to 32 characters can be specified (input). When word devices are specified in and , this restriction (up to 32 characters) is not applicable.
4. When both a character string stored in devices specified in and a character string stored in devices specified in begin with "00H" (when character = 0), this function stores "0000H" in devices specified in .
1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the number of devices after the device number specified in is smaller than the number of devices required for storing the character string obtained by connection (In this case, "00H" cannot be stored after all character strings and final character.) (Error code: K6706)
2. When devices which store character strings specified in and overlap device numbers specified in which will store the character string obtained by connection (Error code: K6706)
3. When "00H" does not exist in the corresponding device range after devices specified in and (Error code: K6706)
Show 17 more labels / short text on this page
"123456" · 1st word · 1st word · 1st word · 2nd word · 2nd word · 2nd word · 3rd word · 3rd word · 3rd word · 4th word · 4th word · 5th word · 6th word · s1 s2 · s1 s2 · s1 s2
Page 188 of the Mitsubishi Electronics FXCPU user manual — CONCAT_E EN ENO
Page 188 · click to enlarge
Page 188

5.8 Standard Character String Functions

In this program, a character string stored in devices specified in is connected after a character string stored in devices specified in , and the character string obtained by connection is output to devices specified in .

1. Function without EN/ENO(CONCAT)

_IN

_IN

g_string3:=CONCAT(g_string1,g_string2);

2. Function with EN/ENO(CONCAT_E)

CONCAT_E EN ENO

_IN

_IN

g_bool3:=CONCAT_E(g_bool1,g_string1,g_string2,g_string3);

Show 5 more labels / short text on this page
CONCAT g_string1="ABCDEF" · g_string3="ABCDEF12345" · g_string2="12345" · g_string1 g_string2 · g_string3
Page 189 of the Mitsubishi Electronics FXCPU user manual — 5.8.3 INSERT(_E)
Page 189 · click to enlarge
Page 189
Mitsubishi Electronics FXCPU — 5.8.3 INSERT(_E) diagram (page 189)
Fig. 42

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

*1 Label 3 Label 1 _IN1 _IN2 Label 2

INSERT_E(EN,_IN1,_IN2,_P, Output label); Example: INSERT_E(X000,Label 1,Label 2, D20,Label 3);

_IN1 ( ) Head word device which stores a character string to get insertion String

_IN2 ( ) Head word device which stores a character string to be inserted String

_P ( ) Word device which stores a character position to get insertion Word [signed]

*1 ( ) Head word device which will store a character string obtained by insertion String

Page 190 of the Mitsubishi Electronics FXCPU user manual — Error
Page 190 · click to enlarge
Page 190

5.8 Standard Character String Functions

1) This function inserts a character string stored in devices specified in into an arbitrary position (counted from the head) of a character string stored in devices specified in , and outputs the character string obtained by insertion to devices specified in . The value specified in specifies the position from which the character string stored in devices specified in is inserted. After inserting a character string stored in devices specified in into a character string stored in devices specified in , this function ignores "00H" which indicates the end of a character string stored in devices specified in . Example: When "4" is specified in

"ABCDE"

High-order byte Low-order byte

High-order byte Low-order byte

42H(B) 41H(A)

42H(B)

41H(A)

Insertion start position = 4th character

43H(C) 44H(D)

31H(1)

43H(C)

00H 45H(E)

33H(3) 32H(2)

35H(5)

34H(4)

44H(D)

36H(6)

00H

45H(E)

High-order byte Low-order byte

32H(2) 31H(1)

33H(3) 34H(4)

36H(6)

35H(5)

0000H

2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.
1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When the number of devices after the device number specified in is smaller than the number of devices required for storing the output data obtained by insertion (Error code: K6706)
2. When devices which store character strings specified in and overlap device numbers specified in which will store the character string obtained by connection (Error code: K6706)
3. When "00H" does not exist in the corresponding device range after devices specified in and (Error code: K6706)
4. When the number of characters of a character string stored in devices specified in is 32768 or more (Error code: K6706)
5. When the value specified in is negative (Error code: K6706)
Show 23 more labels / short text on this page
n · n · Input value to · Output value "ABC123456DE" · 1st word · 1st word · 2nd word · 2nd word · n · 3rd word · 3rd word · 4th word · Input value to · 5th word · "123456" · 6th word · 1st word · 2nd word · 3rd word · 4th word · s1 s2 · s1 s2 · n
Page 191 of the Mitsubishi Electronics FXCPU user manual — INSERT_E EN ENO
Page 191 · click to enlarge
Page 191

5.8 Standard Character String Functions

In this program, a character string stored in devices specified in is inserted into an arbitrary position (counted from the head) of a character string stored in devices specified in , and the character string obtained by insertion is output to devices specified in .

1. Function without EN/ENO(INSERT)

_IN1

_IN2

g_string3:=INSERT(g_string1,g_string2,g_int1);

2. Function with EN/ENO(INSERT_E)

INSERT_E EN ENO

_IN1

_IN2

g_bool3:=INSERT_E(g_bool1,g_string1,g_string2,g_int1,g_string3);

Show 7 more labels / short text on this page
INSERT g_string1="ABCDEF" · g_string3="AB12345CDEF" · g_string2="12345" · g_int1=3 _P · g_string1 g_string2 · g_string3 · g_int1 _P
Page 192 of the Mitsubishi Electronics FXCPU user manual — 5.8.4 DELETE(_E)
Page 192 · click to enlarge
Page 192

5.8 Standard Character String Functions

5.8.4 DELETE(_E)

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

This function deletes a character string.

Mitsubishi Electronics FXCPU — 5.8.4 DELETE(_E) diagram (page 192)
Fig. 43

DELETE_E(EN,_IN,_L ,_P, Output label); Example: DELETE_E(X000, Label 1, D10, D20, Label 2);

Mitsubishi Electronics FXCPU — 5.8.4 DELETE(_E) diagram (page 192)
Fig. 44

_IN ( ) Head word device which stores a character string to get deletion String

_L ( ) Number of characters to be deleted Word [signed]

_P ( ) Head position to get deletion Word [signed]

*1 ( ) Head word device which will store a character string remaining after deletion String

1. This function deletes specified number of characters from an arbitrary position of a character string stored in devices specified in , and outputs the character string remaining after deletion to devices specified in . The value specified in specifies the number of characters to be deleted. The value specified in specifies the position from which specified number of characters are deleted. Example: When "5" is specified in and
Mitsubishi Electronics FXCPU — 5.8.4 DELETE(_E) diagram (page 192)
Fig. 45
2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.

n1 · n2

Page 193 of the Mitsubishi Electronics FXCPU user manual — DELETE_E EN ENO
Page 193 · click to enlarge
Page 193

5.8 Standard Character String Functions

1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When "00H" does not exist in the corresponding device range after the device specified in (Error code: K6706)
2. When the number of characters of a character string stored in devices specified in is 32768 or more (Error code: K6706)
3. When the number of devices after the device number specified in is smaller than the number of devices required for storing the character string remaining after deletion of specified number of characters (Error code: K6706)
4. When the value specified in is negative (Error code: K6706)

In this program, specified number of characters are deleted from an arbitrary position of a character string stored in devices specified in , and the character string remaining after deletion is output to devices specified in .

1. Function without EN/ENO(DELETE)

_IN

_L

g_string2:=DELETE(g_string1,g_int1,g_int2);

2. Function with EN/ENO(DELETE_E)

DELETE_E EN ENO

_L

_P

g_bool3:=DELETE_E(g_bool1,g_string1,g_int1,g_int2,g_string2);

Show 9 more labels / short text on this page
n2 · DELETE g_string1="ABCDEF12345" · g_string2="AB12345" · g_int1="4" · g_int2="3" _P · g_string1 _IN · g_string2 · g_int1 · g_int2
Page 194 of the Mitsubishi Electronics FXCPU user manual — REPLACE_E
Page 194 · click to enlarge
Page 194

5.8 Standard Character String Functions

5.8.5 REPLACE(_E)

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

This function replaces a character string.

REPLACE(_IN1,_IN2,_L ,_P); ExampleLabel 3:= REPLACE(Label 1,Label 2, D20,D30);

REPLACE

*1 Label 3 Label 1 _IN1 _IN2 Label 2

REPLACE

D20 _L _P D30

REPLACE_E(EN,_IN1,_IN2, _L ,_P,Output label); Example: REPLACE_E(X000,Label 1, Label 2,D20,D30,Label 3);

REPLACE_E EN ENO

Label 1 _IN1 _IN2 Label 2

REPLACE_E

D20 _L _P D30

_IN1 ( ) Head word device which stores a character string to be replaced String

_IN2 ( ) Head word device which stores a replacement character string String

_L ( ) Word device which stores the number of characters to be replaced Word [signed]

_P ( ) Word device which stores the head character position to be replaced in a character string to be replaced Word [signed]

*1 ( ) Head word device which will store a character string obtained by replacement String

*1 Label 3 · n1 · n2

Page 195 of the Mitsubishi Electronics FXCPU user manual — 32H(2) 31H(1)
Page 195 · click to enlarge
Page 195

5.8 Standard Character String Functions

1. This function replaces specified number of characters from an arbitrary position of a character string stored in devices specified in with a character string stored in devices specified in , and outputs the character string obtained by replacement to devices specified in . The value specified in specifies the number of characters to be replaced. The value specified in specifies the position from which specified number of characters are replaced. Example: When "5" is specified in and

"ABCDEFGH123"

High-order byte Low-order byte

High-order byte Low-order byte

42H(B)

41H(A)

42H(B)

41H(A)

44H(D)

43H(C)

44H(D)

43H(C)

46H(F) 45H(E)

Replacement start position = 5th character

32H(2) 31H(1)

48H(H)

47H(G)

34H(4)

33H(3)

32H(2)

31H(1)

32H(2)

35H(5)

00H

33H(3)

00H

33H(3)

s2 Number of characters to be replaced = 5 n1

High-order byte Low-order byte

32H(2) 31H(1)

33H(3) 34H(4)

36H(6)

35H(5)

0000H

2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.
3. When "n1+n2" exceeds the number of characters of a character string stored in devices specified in , excessive characters are not output to devices specified in .
4. When "-1" is specified in , the number of characters of a character string stored in devices specified in is regarded as the value specified in .
1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.
Show 27 more labels / short text on this page
s1 s2 · n1 · n2 · n1 n2 · Input value to · Output value "ABCD1234523" · 1st word · 1st word · 2nd word · 2nd word · 3rd word · 3rd word · n2 · 4th word · 4th word · 5th word · 5th word · 6th word · 6th word · Input value to · "123456" · 1st word · 2nd word · 3rd word · 4th word · n1 · s2 n1
Page 196 of the Mitsubishi Electronics FXCPU user manual — REPLACE_E EN ENO
Page 196 · click to enlarge
Page 196

5.8 Standard Character String Functions

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When "00H" does not exist in the corresponding device range after the devices specified in and
(Error codeK6706)
2. When the value specified in exceeds the number of characters of a character string stored in devices specified in (Error code: K6706)
3. When the value specified in is negative (Error code: K6706)
4. When the value specified in is "-2" or less (Error code: K6706)
5. When the value specified in exceeds the number of characters of a character string stored in devices specified in (Error code: K6706)

In this program, specified number of characters starting from an arbitrary position of a character string stored in devices specified in are replaced with a character string stored in devices specified in , and the character string obtained by replacement is output to devices specified in .

1. Function without EN/ENO(REPLACE)

_IN1

_IN2

g_int1=6 _L g_int2=3 _P

g_string3:=REPLACE(g_string1,g_string2,g_int1,g_int2);

2. Function with EN/ENO(REPLACE_E)

REPLACE_E EN ENO

_IN1

_IN2

g_bool3:=REPLACE_E(g_bool1,g_string1,g_string2,g_int1,g_int2,g_string3);

Show 12 more labels / short text on this page
n1 · n2 · n1 · n2 · s1 s2 · REPLACE g_string1="ABCDEFGH" · g_string3="AB012345" · g_string2="012345678" · g_string1 g_string2 · g_string3 · g_int1 _L · g_int2 _P
Page 197 of the Mitsubishi Electronics FXCPU user manual — 5.8.6 FIND(_E)
Page 197 · click to enlarge
Page 197
Mitsubishi Electronics FXCPU — 5.8.6 FIND(_E) diagram (page 197)
Fig. 46

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

_IN1 ( ) Head word device which stores a character string to get search String

_IN2 ( ) Head word device which stores a character string to be searched String

*1 ( ) Head word device which will store the search result Word [signed]

Page 198 of the Mitsubishi Electronics FXCPU user manual — Error
Page 198 · click to enlarge
Page 198

5.8 Standard Character String Functions

1. This function searches a character string stored in devices specified in from the beginning of a character string stored in devices specified in , and outputs the search result to devices specified in . This function outputs the head character position of the searched character string detected first as the search result.
2. A character string (data) stored in devices specified in indicates the data until "00H" is detected first in units of byte in the range starting from the specified device.
3. If a character string stored in devices specified in cannot be detected in a character string stored in devices specified in , this function outputs "0".

"ABCD1234567"

High-order byte Low-order byte

42H(B)

41H(A)

44H(D)

43H(C)

32H(2) 31H(1)

34H(4)

33H(3)

36H(6)

35H(5)

00H

37H(7)

Search of character string

High-order byte Low-order byte

32H(2) 31H(1)

33H(3) 34H(4)

0000H

1. Use the function having "_E" in its name to connect a bus.
2. When handling character string data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling character string data. Use global labels when specifying labels.

Error

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

1. When "00H (NULL)" does not exist in the corresponding device range specified in (Error code: K6706)
2. When "00H (NULL)" does not exist in the corresponding device range specified in (Error code: K6706)
Show 14 more labels / short text on this page
Input value to · Output value · Word [signed] · 1st word · 2nd word · 3rd word · 4th word · 5th word · 6th word · Input value to · "1234" · 1st word · 2nd word · 3rd word
Page 199 of the Mitsubishi Electronics FXCPU user manual — FIND_E EN ENO
Page 199 · click to enlarge
Page 199

5.8 Standard Character String Functions

In this program, a character string stored in devices specified in is searched from the beginning of a character string stored in devices specified in , and the search result is output to devices specified in .

1. Function without EN/ENO(FIND)

_IN1

_IN2

g_int1:=FIND(g_string1,g_string2);

2. Function with EN/ENO(FIND_E)

FIND_E EN ENO

_IN1

_IN2

g_bool3:=FIND_E(g_bool1,g_string1,g_string2,g_int1);

Show 5 more labels / short text on this page
FIND g_string1="ABCDEFGHIJK" · g_int1=5 · g_string2="EFGHIJK" · g_string1 g_string2 · g_int1
Page 200 of the Mitsubishi Electronics FXCPU user manual — ADD_TIME_E EN ENO
Page 200 · click to enlarge
Page 200

5.9 Functions Of Time Data Types

5.9 Functions Of Time Data Types

5.9.1 ADD_TIME(_E)

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

This function adds time data.

ADD_TIME(_IN1,_IN2); ExampleLabel 3:= ADD_TIME(Label 1,Label 2);

ADD_TIME

ADD_TIME

*1 Label 3 Label 1 _IN1 Label 2 _IN2

ADD_TIME_E(EN,_IN1,_IN2, Output label); Example: ADD_TIME_E(X000,Label 1, Label 2,Label 3);

ADD_TIME_E EN ENO

ADD_TIME_E

Label 1 _IN1 Label 2 _IN2

_IN1 ( ) Head word device which stores time data to get addition Time

_IN2 ( ) Head word device which stores addition time data Time

*1 ( ) Head word device which will store the operation result Time

This function performs addition ( + ) of time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .

s1 s2 s1 s2

*1 Label 3

Page 201 of the Mitsubishi Electronics FXCPU user manual — ADD_TIME_E EN ENO
Page 201 · click to enlarge
Page 201

5.9 Functions Of Time Data Types

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. However, note that the accurate operation result cannot be obtained in this case. ("ADD_TIME_E" outputs "TRUE" from ENO.)

Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.

M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"

ONWhen the operation result is less than "-32,768" (16-bit operation) or less than "-
2,147,483,648" (32-bit operation) OFFWhen the operation result is "-32,768" (16-bit operation) or more or "-2,147,483,648" (32-

bit operation) or more

ONWhen the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit
operation) OFFWhen the operation result is "32,767" (16-bit operation) or less or "2,147,483,647" (32-bit

-2 , -1 , 0 , -32,768

-1 , 0 , 1

32,767 , 0 , 1 , 2

The most significant bit of data is "1".

The most significant bit of data is "0".

-2 , -1 , 0 , -2,147,483,648

-1 , 0 , 1

2,147,483,647 , 0 , 1 , 2

In this program, addition ( + ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .

1. Function without EN/ENO(ADD_TIME)

ADD_TIME g_time1 _IN1 g_time3 g_time2 _IN2

g_time3:=ADD_TIME(g_time1,g_time2);

2. Function with EN/ENO(ADD_TIME_E)

ADD_TIME_E EN ENO

g_time1 _IN1 g_time2 _IN2

g_bool3:=ADD_TIME_E(g_bool1,g_time1,g_time2,g_time3);

Show 18 more labels / short text on this page
Device Name Description · M8021 Borrow · M8022 Carry · operation) or less · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag · s1 s2 s1 · s2 d · g_bool3 g_bool1 · g_time3
Page 202 of the Mitsubishi Electronics FXCPU user manual — SUB_TIME_E EN ENO
Page 202 · click to enlarge
Page 202

5.9 Functions Of Time Data Types

5.9.2 SUB_TIME(_E)

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

This function performs subtraction of time data.

SUB_TIME(_IN1,_IN2); ExampleLabel 3:= SUB_TIME(Label 1,Label 2);

SUB_TIME

SUB_TIME

*1 Label 3 Label 1 _IN1 Label 2 _IN2

SUB_TIME_E(EN,_IN1,_IN2, Output label); Example: SUB_TIME_E(X000,Label 1, Label 2,Label 3);

SUB_TIME_E EN ENO

SUB_TIME_E

Label 1 _IN1 Label 2 _IN2

_IN1 ( ) Head word device which stores time data to get subtraction Time

_IN2 ( ) Head word device which stores subtraction data Time

*1 ( ) Head word device which will store the operation result Time

This function performs subtraction ( - ) of time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .

s1 s2 s1 s2

*1 Label 3

Page 203 of the Mitsubishi Electronics FXCPU user manual — SUB_TIME_E EN ENO
Page 203 · click to enlarge
Page 203

5.9 Functions Of Time Data Types

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. However, note that the accurate operation result cannot be obtained in this case. ("SUB_TIME_E" outputs "TRUE" from ENO.)

Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.

M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"

ONWhen the operation result is less than "-32,768" (16-bit operation) or less than "-
2,147,483,648" (32-bit operation) OFFWhen the operation result is "-32,768" (16-bit operation) or more or "-2,147,483,648" (32-

bit operation) or more

ONWhen the operation result exceeds "32,767" (16-bit operation) or "2,147,483,647" (32-bit
operation) OFFWhen the operation result is "32,767" (16-bit operation) or less or "2,147,483,647" (32-bit

-2 , -1 , 0 , -32,768

-1 , 0 , 1

32,767 , 0 , 1 , 2

The most significant bit of data is "1".

The most significant bit of data is "0".

-2 , -1 , 0 , -2,147,483,648

-1 , 0 , 1

2,147,483,647 , 0 , 1 , 2

In this program, subtraction ( - ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .

1. Function without EN/ENO(SUB_TIME)

SUB_TIME g_time1 _IN1 g_time3 g_time2 _IN2

g_time3:=SUB_TIME(g_time1,g_time2);

2. Function with EN/ENO(SUB_TIME_E)

SUB_TIME_E EN ENO

g_time1 _IN1 g_time2 _IN2

g_bool3:=SUB_TIME_E(g_bool1,g_time1,g_time2,g_time3);

Show 18 more labels / short text on this page
Device Name Description · M8021 Borrow · M8022 Carry · operation) or less · Zero flag · Zero flag · Zero flag · Borrow flag · Carry flag · Zero flag · Zero flag · Borrow flag · Zero flag · Carry flag · s1 s2 s1 · s2 d · g_bool3 g_bool1 · g_time3
Page 204 of the Mitsubishi Electronics FXCPU user manual — MUL_TIME_E EN ENO
Page 204 · click to enlarge
Page 204

5.9 Functions Of Time Data Types

5.9.3 MUL_TIME(_E)

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

This function performs multiplication of time data.

MUL_TIME(_IN1,_IN2); ExampleLabel 3:= MUL_TIME(Label 1,Label 2);

MUL_TIME

MUL_TIME

*1 Label 3 Label 1 _IN1 Label 2 _IN2

MUL_TIME_E(EN,_IN1,_IN2, Output label); Example: MUL_TIME_E(X000,Label 1, Label 2,Label 3);

MUL_TIME_E EN ENO

MUL_TIME_E

Label 1 _IN1 Label 2 _IN2

_IN1 ( ) Head word device which stores time data to get multiplication Time

_IN2 ( ) Multiplication data, or head word device which stores such data ANY_NUM

*1 ( ) Head word device which will store the operation result Time

This function performs multiplication( × ) using time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Even if underflow or overflow occurs in the operation result, it is not regarded as an operation error. However, note that the accurate operation result cannot be obtained in this case. ("MUL_TIME_E" outputs "TRUE" from ENO.)

*1 Label 3 · s1 s2 s1 · s2 d

Page 205 of the Mitsubishi Electronics FXCPU user manual — MUL_TIME_E EN ENO
Page 205 · click to enlarge
Page 205

5.9 Functions Of Time Data Types

In this program, multiplication ( × ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .

1. Function without EN/ENO(MUL_TIME)

MUL_TIME g_time1 _IN1 g_time2 g_int1 _IN2

g_time2:=MUL_TIME(g_time1,g_int1);

2. Function with EN/ENO(MUL_TIME_E)

MUL_TIME_E EN ENO

g_time1 _IN1 g_int1 _IN2

g_bool3:=MUL_TIME_E(g_bool1,g_time1,g_int1,g_time2);

Show 4 more labels / short text on this page
s1 s2 s1 · s2 d · g_bool3 g_bool1 · g_time2
Page 206 of the Mitsubishi Electronics FXCPU user manual — Error
Page 206 · click to enlarge
Page 206

5.9 Functions Of Time Data Types

5.9.4 DIV_TIME(_E)

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

This function performs division using time data.

DIV_TIME(_IN1,_IN2); ExampleLabel 3:= DIV_TIME(Label 1,Label 2);

DIV_TIME

DIV_TIME

*1 Label 3 Label 1 _IN1 Label 2 _IN2

DIV_TIME_E(EN,_IN1,_IN2, Output label); Example: DIV_TIME_E(X000,Label 1, Label 2,Label 3);

DIV_TIME_E EN ENO

DIV_TIME_E

Label 1 _IN1 Label 2 _IN2

_IN1 ( ) Head word device which stores time data to get division Time

_IN2 ( ) Division data, or head word device which stores such data ANY_NUM

*1 ( ) Head word device which will store the operation result Time

1. This function performs division ( / ) using time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .

s1 s2 s1 s2

2. The contents of devices specified in are ANY_NUM type data except "0".
1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

Error

1. An operation error occurs when the divisor stored in devices specified in is "0", and the function is not executed.
2. An operation error occurs when the operation result exceeds "2,147,483,647".

*1 Label 3

Page 207 of the Mitsubishi Electronics FXCPU user manual — DIV_TIME_E EN ENO
Page 207 · click to enlarge
Page 207

5.9 Functions Of Time Data Types

In this program, division ( / ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .

1. Function without EN/ENO(DIV_TIME)

DIV_TIME g_time1 _IN1 g_time2 g_int1 _IN2

g_time2:=DIV_TIME(g_time1,g_int1);

2. Function with EN/ENO(DIV_TIME_E)

DIV_TIME_E EN ENO

g_time1 _IN1 g_int1 _IN2

g_bool3:=DIV_TIME_E(g_bool1,g_time1,g_int1,g_time2);

Show 4 more labels / short text on this page
s1 s2 s1 · s2 d · g_bool3 g_bool1 · g_time2
Page 208 of the Mitsubishi Electronics FXCPU user manual — Error
Page 208 · click to enlarge
Page 208

6.1 R_TRIG(_E)

6.1 R_TRIG(_E)

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

This function block detects the rising edge of a signal, and outputs pulse signal.

R_TRIG(_CLK); *1 ExampleInstance name(_CLK:=M0); M10:=Instance name.Q;

R_TRIG

R_TRIG

Q M10 _CLK M0

R_TRIG_E(EN,_CLK); *1 ExampleInstance name(EN:=X000, _CLK:=M0); M10:=Instance name.Q;

R_TRIG_E EN ENO

R_TRIG_E

_CLK M0

Q M10

*1. Refer to caution points.

_CLK ( ) Input signal whose rising edge is to be detected Bit

Q ( ) Output signal Bit

This function block sets to ON a device specified in when a device specified in turns ON, and keeps ON the device specified in only for 1 operation cycle.

1. Use the function having "_E" in its name to connect a bus.
2. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

Error

1. When an output number is specified in and the specified output number does not exist due to indexing, M8316 (I/O inexistence error) turns ON. (Applicable to the FX 3U and FX 3UC PLCs only)
2. When a device (M, T or C) other than I/O number is specified in and the specified device number does not exist due to indexing, an operation error (Error code: 6706) occurs.

Instance name · Instance name · d s

Page 209 of the Mitsubishi Electronics FXCPU user manual — Y010 X000
Page 209 · click to enlarge
Page 209

6.1 R_TRIG(_E)

In this program, a device specified in turns ON when the bit data stored in a device specified in turns ON from OFF, and the device specified in remains ON only for 1 operation cycle.

1. Function without EN/ENO(R_TRIG)

R_TRIG

g_bool1 _CLK Q g_bool2

R_TRIG_Instance(_CLK:=g_bool1);g_bool2:=R_TRIG_Instance.Q;

2. Function with EN/ENO(R_TRIG_E)

Y010 X000

EN ENO

R_TRIG_E_Instance(EN:=X000,_CLK:=g_bool1);Y010=R_TRIG_E_Instance.ENO; g_bool2:=R_TRIG_E_Instance.Q;

Show 5 more labels / short text on this page
d s · R_TRIG_Instance · R_TRIG_E R_TRIG_E_Instance · g_bool1 _CLK · Q g_bool2
Page 210 of the Mitsubishi Electronics FXCPU user manual — Error
Page 210 · click to enlarge
Page 210

6.2 F_TRIG(_E)

6.2 F_TRIG(_E)

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

This function block detects the falling edge of a signal, and outputs pulse signal.

F_TRIG(_CLK); *1 ExampleInstance name(_CLK:=M0); M10:=Instance name.Q;

F_TRIG

F_TRIG

Q M10 _CLK M0

F_TRIG_E(EN,_CLK); *1 ExampleInstance name(EN:=X000, _CLK:=M0); M10:=Instance name.Q;

F_TRIG_E EN ENO

F_TRIG_E

_CLK M0

Q M10

*1. Refer to caution points.

_CLK ( ) Input signal whose falling edge is to be detected Bit

Q ( ) Output signal Bit

This function block sets to ON a device specified in when a device specified in turns OFF, and keeps ON the device specified in only for 1 operation cycle.

1. Use the function having "_E" in its name to connect a bus.
2. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

Error

1. When an output number is specified in and the specified output number does not exist due to indexing, M8316 (I/O inexistence error) turns ON. (Applicable to the FX 3U and FX 3UC PLCs only)
2. When a device (M, T or C) other than I/O number is specified in and the specified device number does not exist due to indexing, an operation error (Error code: 6706) occurs.

Instance name · Instance name · d s

Page 211 of the Mitsubishi Electronics FXCPU user manual — Y010 X000
Page 211 · click to enlarge
Page 211

6.2 F_TRIG(_E)

In this program, a device specified in turns ON when the bit data stored in a device specified in turns OFF from ON, and the device specified in remains ON only for 1 operation cycle.

1. Function without EN/ENO(F_TRIG)

F_TRIG

g_bool1 _CLK Q g_bool2

F_TRIG_Instance(_CLK:=g_bool1);g_bool2:=F_TRIG_Instance.Q;

2. Function with EN/ENO(F_TRIG_E)

Y010 X000

EN ENO

F_TRIG_E_Instance(EN:=X000,_CLK:=g_bool1);Y010=F_TRIG_E_Instance; g_bool2:=F_TRIG_E_Instance.Q;

Show 5 more labels / short text on this page
d s · F_TRIG_Instance · F_TRIG_E F_TRIG_E_Instance · g_bool1 _CLK · Q g_bool2
Page 212 of the Mitsubishi Electronics FXCPU user manual — 6.3 CTU(_E)
Page 212 · click to enlarge
Page 212

6.3 CTU(_E)

6.3 CTU(_E)

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

This function block counts up the number of times of rising of a signal.

Mitsubishi Electronics FXCPU — 6.3 CTU(_E) diagram (page 212)
Fig. 47
CTU(CU,RESET,PV); *1 ExampleInstance name(CU:=M0, RESET=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.CV;
CTU_E(EN,CU,RESET,PV); *1 ExampleInstance name(EN=X000, CU:=M0, RESET=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.CV;

*1. Refer to caution points.

Mitsubishi Electronics FXCPU — 6.3 CTU(_E) diagram (page 212)
Fig. 48

CV ( ) Number of times of rising Word [signed]

This function block counts up (adds "1" to) the value stored in a device specified in when a device specified in turns ON. When the count value reaches a value specified in , a device specified in turns ON. When a device specified in turns ON, this function block turns OFF a device specified in , and resets the count value of a device specified in .

1. Use the function having "_E" in its name to connect a bus.
2. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

n d1 · s2 d1

Page 213 of the Mitsubishi Electronics FXCPU user manual — M11 M10
Page 213 · click to enlarge
Page 213

6.3 CTU(_E)

In this program, the number of times the bit data stored in a device specified in turns ON from OFF is counted, and the count value is output to a device specified in .

1. Function without EN/ENO(CTU)

CTU

g_bool1 CU Q g_bool3 g_int2 g_bool2 RESET CV

CTU_Instance(CU:=g_bool1,RESET:=g_bool2,PV:=g_int1); g_bool3:=CTU_Instance.Q; g_int2:=CTU_Instance.CV;

2. Function with EN/ENO(CTU_E)

M11 M10

CTU_E

EN ENO

CV g_int2 g_bool2 RESET g_int1 PV

CTU_E_Instance(EN:=M10,CU:=g_bool1,RESET:=g_bool2,PV:=g_int1); M11:=CTU_E_Instance.ENO; g_bool3:=CTU_E_Instance.Q; g_int2:=CTU_E_Instance.CV;

Show 5 more labels / short text on this page
CTU_Instance · g_int1 PV · CTU_E_Instance · g_bool1 CU · Q g_bool3
Page 214 of the Mitsubishi Electronics FXCPU user manual — 6.4 CTD(_E)
Page 214 · click to enlarge
Page 214

6.4 CTD(_E)

6.4 CTD(_E)

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

This function block counts down the number of times of rising of a signal.

Mitsubishi Electronics FXCPU — 6.4 CTD(_E) diagram (page 214)
Fig. 49
CTD(CD,LOAD,PV); *1 ExampleInstance name(CD:=M0, LOAD=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.CV;
CTD_E(EN,CD,LOAD,PV); *1 ExampleInstance name(EN=X000, CD:=M0, LOAD=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.CV;

*1. Refer to caution points.

Mitsubishi Electronics FXCPU — 6.4 CTD(_E) diagram (page 214)
Fig. 50

Q ( ) Output signal (which turns ON when the current counter value becomes "0" or less) Bit

CV ( ) Number of times of rising Word [signed]

This function block counts down (subtracts "1" from) the value stored in a device specified in when a device specified in turns ON. The value specifies the initial value for subtraction. This function block turns ON a device specified in when the count value becomes "0". When a device specified in turns ON, this function block turns OFF a device specified in , and sets the initial value for subtraction specified in to the count value of a device specified in .

1. Use the function having "_E" in its name to connect a bus.
2. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

n · s2 d1 · n d2

Page 215 of the Mitsubishi Electronics FXCPU user manual — M11 M10
Page 215 · click to enlarge
Page 215

6.4 CTD(_E)

In this program, the number of times the bit data stored in a device specified in turns ON from OFF is counted, and a device specified in turns ON when the value stored in a device specified in becomes "0".

1. Function without EN/ENO(CTD)

CTD

g_bool1 CD Q g_bool3 g_int2 g_bool2 LOAD CV

CTD_Instance(CD:=g_bool1,LOAD:=g_bool2,PV:=g_int1); g_bool3:=CTD_Instance.Q; g_int2:=CTD_Instance.CV;

2. Function with EN/ENO(CTD_E)

M11 M10

CTD_E

EN ENO

CV g_int2 g_bool2 LOAD g_int1 PV

CTD_E_Instance(EN:=M10,CD:=g_bool1,LOAD:=g_bool2,PV:=g_int1); M11:=CTD_E_Instance.ENO; g_bool3:=CTD_E_Instance.Q; g_int2:=CTD_E_Instance.CV;

Show 6 more labels / short text on this page
d1 d2 · CTD_Instance · g_int1 PV · CTD_E_Instance · g_bool1 CD · Q g_bool3
Page 216 of the Mitsubishi Electronics FXCPU user manual — 6.5 CTUD(_E)
Page 216 · click to enlarge
Page 216

6.5 CTUD(_E)

6.5 CTUD(_E)

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

This function block counts up/down the number of times of rising of a signal.

Mitsubishi Electronics FXCPU — 6.5 CTUD(_E) diagram (page 216)
Fig. 51

CTUD(CU,CD,RESET,LOAD,PV); *1 Example: Instance name(CU:=M0, CD:=M10,RESET:=M20,LOAD:= M30,PV:=D0); M40:=Instance name.QU; M50:=Instance name.QD; D10:=Instance name.CV;

CTUD_E(EN,CU,CD,RESET,LOA D,PV); *1 Example: Instance name(EN=X000, CU:=M0,CD:=M10,RESET:=M20, LOAD:=M30,PV:=D0); M40:=Instance name.QU; M50:=Instance name.QD; D10:=Instance name.CV;

*1. Refer to caution points.

Mitsubishi Electronics FXCPU — 6.5 CTUD(_E) diagram (page 216)
Fig. 52

QD ( ) Output signal (which turns ON when the current counter value becomes "0" or less) Bit

This function block counts up (adds "1" to) the value stored in a device specified in when a device specified in turns ON. This function block counts down (subtracts "1" from) the value stored in a device specified in when a device specified in turns ON. specifies the maximum value of the counter. When the value stored in a device specified in reaches the maximum value of the counter, a device specified in turns ON. When the value stored in a device specified in becomes "0", a device specified in turns ON.

n · d3 n · d3 d2

Page 217 of the Mitsubishi Electronics FXCPU user manual — 6.5 CTUD(_E)
Page 217 · click to enlarge
Page 217

6.5 CTUD(_E)

This function block resets the count value of a device specified in when a device specified in turns ON. This function block sets the value stored in to a device specified in when a device specified in turns ON.

1. Use the function having "_E" in its name to connect a bus.
2. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

d3 s3 · n d3 s4

Page 218 of the Mitsubishi Electronics FXCPU user manual — M10 M0
Page 218 · click to enlarge
Page 218

6.5 CTUD(_E)

In this program, the number of times the bit data stored in a device specified in turns ON from OFF is counted up (added by "1"). When the value stored in a device specified in reaches the value specified in , a device specified in turns ON. At the same time, the number of times the bit data stored in a device specified in turns ON from OFF is counted down (subtracted by "1"). When the value stored in a device specified in becomes "0", a device specified in turns ON.

1. Function without EN/ENO(CTUD)

CTUD

g_bool1 CU QU g_bool5 g_bool6 g_bool2 CD QD

g_int2 CV g_bool3 RESET

CTUD_Instance(CU:=g_bool1,CD:=g_bool2,RESET:=g_bool3,LOAD:=g_bool4,PV:=g_int1); g_bool5:=CTUD_Instance.QU; g_bool6:=CTUD_Instance.QD; g_int2:=CTUD_Instance.CV;

2. Function with EN/ENO(CTUD_E)

M10 M0

CTUD_E

EN ENO

QD g_bool6 g_bool2 CD g_bool3 RESET

CV g_int2 g_bool4 LOAD g_int1 PV

CTUD_E_Instance(EN:=M0,CU:=g_bool1,CD:=g_bool2,RESET:=g_bool3,LOAD:=g_bool4,PV:=g_int1); M10:=CTUD_E_Instance.ENO; g_bool5:=CTUD_E_Instance.QU; g_bool6:=CTUD_E_Instance.QD; g_int2:=CTUD_E_Instance.CV;

Show 7 more labels / short text on this page
n d1 · CTUD_Instance · g_bool4 LOAD · g_int1 PV · CTUD_E_Instance · g_bool1 CU · QU g_bool5
Page 219 of the Mitsubishi Electronics FXCPU user manual — TP_E EN ENO X000
Page 219 · click to enlarge
Page 219

6.6 TP(_E)

6.6 TP(_E)

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

This function block keeps ON a signal for specified duration.

TP(IN,PT); *1 ExampleInstance name(IN:=M0, PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name. ET;

TP

TP

Q M10 IN M0

PT Label 1 ET Label 2

TP_E(EN,IN,PT); *1 ExampleInstance name(EN:=X000, IN:=M0,PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name. ET;

TP_E EN ENO X000

TP_E

Q M10 IN M0

PT Label 1 ET Label 2

*1. Refer to caution points.

IN ( ) ON start input signal Bit

PT ( ) ON duration data Time

Q ( ) Output signal Bit

ET ( ) ON duration current value Time

When a device specified in turns ON, this function block turns ON a device specified in , and keeps it ON for duration specified in . The elapsed time while a device specified in remains ON is set to a device specified in . A device specified in turns OFF when the elapsed time reaches the set value. Even if a device specified in turns OFF, this function block does not reset the elapsed time. When a device specified in turns ON from OFF next time, this function block resets the elapsed time and turns ON again a device specified in .

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

Show 6 more labels / short text on this page
Instance name · Instance name · n · s d1 · n · d1 d2
Page 220 of the Mitsubishi Electronics FXCPU user manual — M10 M0
Page 220 · click to enlarge
Page 220

6.6 TP(_E)

In this program, when bit data stored in a device specified in turns ON, bit data stored in a device specified in turns ON and remains ON for 10 seconds.

1. Function without EN/ENO(TP)

TP

g_bool2 PT T#10s g_time1

ET

TP_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TP_Instance.Q; g_time1:=TP_Instance.ET;

2. Function with EN/ENO(TP_E)

M10 M0

EN ENO

T#10s g_time1 PT ET

TP_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TP_E_Instance.ENO; g_bool2:=TP_E_Instance.Q; g_time1:=TP_E_Instance.ET;

Show 5 more labels / short text on this page
TP_Instance · g_bool1 IN Q · TP_E TP_E_Instance · g_bool1 IN · Q g_bool2
Page 221 of the Mitsubishi Electronics FXCPU user manual — TON_E EN ENO X000
Page 221 · click to enlarge
Page 221

6.7 TON(_E)

6.7 TON(_E)

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

This function block turns ON after specified time.

TON(IN,PT); *1 ExampleInstance name(IN:=M0, PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name. ET;

TON

TON

Q M10 IN M0

PT Label 1 ET Label 2

TON_E(EN,IN,PT); *1 ExampleInstance name(EN:=X000, IN:=M0,PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name.ET;

TON_E EN ENO X000

TON_E

Q M10 IN M0

PT Label 1 ET Label 2

*1. Refer to caution points.

IN ( ) Input signal Bit

PT ( ) ON start time data Time

Q ( ) Output signal Bit

ET ( ) ON start time current value Time

When a device specified in turns ON, this function block turns ON a device specified in after the time specified in . The delay elapsed time until a device specified in turns ON is set to a device specified in . When a device specified in turns OFF, this function block turns OFF a device specified in and resets the delay elapsed time.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

Show 7 more labels / short text on this page
Instance name · Instance name · n · s d1 · n · d1 d2 · s d1
Page 222 of the Mitsubishi Electronics FXCPU user manual — M10 M0
Page 222 · click to enlarge
Page 222

6.7 TON(_E)

In this program, when bit data stored in a device specified in turns ON, bit data stored in a device specified in turns ON 10 seconds later.

1. Function without EN/ENO(TON)

TON

g_bool2 PT T#10s g_time1

ET

TON_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TON_Instance.Q; g_time1:=TON_Instance.ET;

2. Function with EN/ENO(TON_E)

M10 M0

EN ENO

T#10s g_time1 PT ET

TON_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TON_E_Instance.ENO; g_bool2:=TON_E_Instance.Q; g_time1:=TON_E_Instance.ET;

Show 5 more labels / short text on this page
TON_Instance · g_bool1 IN Q · TON_E TON_E_Instance · g_bool1 IN · Q g_bool2
Page 223 of the Mitsubishi Electronics FXCPU user manual — TOF_E EN ENO X000
Page 223 · click to enlarge
Page 223

6.8 TOF(_E)

6.8 TOF(_E)

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

When the input signal turns OFF, this function block turns OFF the output signal after the specified time.

TOF(IN,PT); *1 ExampleInstance name(IN:=M0, PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name. ET;

TOF

TOF

Q M10 IN M0

PT Label 1 ET Label 2

TON_F(EN,IN,PT); *1 ExampleInstance name(EN:=X000, IN:=M0,PT:=Label 1); M10:=Instance name.Q; Label 2:=Instance name.ET;

TOF_E EN ENO X000

TOF_E

Q M10 IN M0

PT Label 1 ET Label 2

*1. Refer to caution points.

IN ( ) Input signal Bit

PT ( ) OFF duration data Time

Q ( ) Output signal Bit

ET ( ) OFF duration current value Time

When a device specified in turns ON, this function block turns ON a device specified in . When a device specified in turns OFF from ON, this function block turns OFF a device specified in after the time specified in . The elapsed time until a device specified in turns OFF is set to a device specified in . When a device specified in turns ON again, this function block turns ON a device specified in and resets the elapsed time.

1. Use the function having "_E" in its name to connect a bus.
2. When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
3. Expression of function blocks in each language

*1. Set the instance when using a function block. Describe the instance name when programming a function block.

Show 8 more labels / short text on this page
Instance name · Instance name · n · s d1 · s d1 · n · d1 d2 · s d1
Page 224 of the Mitsubishi Electronics FXCPU user manual — M10 M0
Page 224 · click to enlarge
Page 224

6.8 TOF(_E)

In this program, when bit data stored in a device specified in turns ON, bit data stored in a device specified in turns ON. When bit data stored in a device specified in turns OFF, bit data stored in a device specified in turns OFF 10 seconds later.

1. Function without EN/ENO(TOF)

TOF

g_bool2 PT T#10s g_time1

ET

TOF_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TOF_Instance.Q; g_time1:=TOF_Instance.ET;

2. Function with EN/ENO(TOF_E)

M10 M0

EN ENO

T#10s g_time1 PT ET

TOF_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TOF_E_Instance.ENO; g_bool2:=TOF_E_Instance.Q; g_time1:=TOF_E_Instance.ET;

Show 6 more labels / short text on this page
d1 s · TOF_Instance · g_bool1 IN Q · TOF_E TOF_E_Instance · g_bool1 IN · Q g_bool2
Page 225 of the Mitsubishi Electronics FXCPU user manual — ON
Page 225 · click to enlarge
Page 225

6.9 COUNTER_FB_M

6.9 COUNTER_FB_M

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

This counter starts counting when the condition turns ON from OFF and generates an output when counting up to the set value. A counter initial value can be set.

ExampleInstance name (Coil:=X000,Preset:=D0, ValueIn:=D10); D20:=Instance name ValueOut; M0:=Instance name Status;

COUNTER_FB_M Coil ValueOut Preset ValueIn

COUNTER_FB_M

*1. Refer to "Cautions".

Coil Execution condition Bit

Preset Counter set value Word [signed]

ValueIn Counter initial value Word [signed]

ValueOut Counter current value ANY16

Status Counter output contact Bit

Function and operation explanation

The counter starts counting when detecting the rising edge (from OFF to ON) of the input argument Coil. It does not start counting if the Coil remains ON. The counter starts counting from the value of input argument ValueIn. When the input argument Preset value is reached, the output argument Status turns ON. The current count value is stored in the output argument ValueOut.

ON ON ON

COUNTER_FB_M Coil ValueOut Preset ValueIn

Value of Var_D10 1

Instance name (Coil:= Var_M0,Preset:=10,Valueln:=1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;

ON

*1. Var_D10 is a global label and is defined as D10.

*2. Var_M10 is a global label and is defined as M10.

Show 10 more labels / short text on this page
COUNTER_FB_M(Coil,Preset, ValueIn); *1 · Instance name · Status · timing chart · Instance name · Var_M0 · Var_M10*2 Var_M0 · Var_D10 *1 · Status 3 · Var_M10
Page 226 of the Mitsubishi Electronics FXCPU user manual — 6.9 COUNTER_FB_M
Page 226 · click to enlarge
Page 226

6.9 COUNTER_FB_M

1. Expression in each language of function block

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

2. For the function block, the automatic allocation device needs to be set as the counter numbers are allocated automatically.
Page 227 of the Mitsubishi Electronics FXCPU user manual — ON
Page 227 · click to enlarge
Page 227

6.10 TIMER_10_FB_M

6.10 TIMER_10_FB_M

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

This function block generates an output when the condition continues for the specified time. The initial value and setting value of the timer is multiplied by 10 ms.

TIMER_10_FB_M Coil ValueOut Preset ValueIn

TIMER_10_FB_M TIMER_10_FB_M(Coil,Preset, ValueIn); *1

*1. Refer to "Cautions".

Coil Execution condition Bit

Preset Timer set value Word [signed]

ValueIn Initial timer value Word [signed]

ValueOut Current timer value ANY16

Status Timer output contact Bit

Function and operation explanation

1. When the execution condition of the input argument Coil turns ON, counting the current value starts. The timer starts counting from "ValueIn × 10 ms". When it counts up to "Preset × 10 ms", the output argument Status turns ON. The current measurement value is outputted into ValueOut.
2. When the execution condition of the input argument Coil turns OFF, the current value takes on the value of ValueIn and the output argument Status also turns OFF.

ON

Status Var_M10*2 Var_M0

10 Preset ValueIn 1

Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:= Instance name.Status;

ON

*1. Var_D10 is a global label and is defined as D10.

*2. Var_M10 is a global label and is defined as M10.

1. Expression in each language of function block

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

2. For the function block, the automatic allocation device needs to be set as the timer numbers are allocated automatically.
Show 10 more labels / short text on this page
Instance name · Status · timing chart · Instance name · Var_M0 · TIMER_10_FB_M Coil ValueOut · Var_D10 *1 · Value of Var_D10 · 90ms · Var_M10
Page 228 of the Mitsubishi Electronics FXCPU user manual — Function and operation explanation
Page 228 · click to enlarge
Page 228

6.11 TIMER_CONT_FB_M

6.11 TIMER_CONT_FB_M

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

This function block counts the period of time while the condition is satisfied, and generates an output when the timer counts up the specified time.

Mitsubishi Electronics FXCPU — 6.11 TIMER_CONT_FB_M diagram (page 228)
Fig. 53

*1. Refer to "Cautions".

Mitsubishi Electronics FXCPU — 6.11 TIMER_CONT_FB_M diagram (page 228)
Fig. 54

Function and operation explanation

1. This is a retentive timer that counts the time when the variable is ON. It starts counting the current value when the execution condition of the input argument Coil turns ON. The timer starts counting from "ValueIn × 1 to 1000 ms". When it counts up to "Preset × 1 to 1000 ms", the output argument Status turns ON. The current measurement value is outputted into ValueOut.
2. The condition of measurement ValueOut and output argument ON/OFF status is maintained even if the execution condition of the input argument Coil turns OFF. When the execution condition of the input argument Coil turns ON, the timer resume counting from the measurement it holds.
Mitsubishi Electronics FXCPU — Function and operation explanation diagram (page 228)
Fig. 55 · Function and operation explanation

Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;

*1. Var_D10 is a global label and is defined as D10.

*2. Var_M10 is a global label and is defined as M10.

Page 229 of the Mitsubishi Electronics FXCPU user manual — 6.11 TIMER_CONT_FB_M
Page 229 · click to enlarge
Page 229

6.11 TIMER_CONT_FB_M

1. Expression in each language of function block

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

2. For the function block, the automatic allocation device needs to be set as the timer numbers are allocated automatically.
Page 230 of the Mitsubishi Electronics FXCPU user manual — Function and operation explanation
Page 230 · click to enlarge
Page 230

6.12 TIMER_100_FB_M

6.12 TIMER_100_FB_M

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

This function block generates an output when the condition continues for the specified time. The initial value and setting value of the timer is multiplied by 100 ms.

Mitsubishi Electronics FXCPU — 6.12 TIMER_100_FB_M diagram (page 230)
Fig. 56

*1. Refer to "Cautions".

Mitsubishi Electronics FXCPU — 6.12 TIMER_100_FB_M diagram (page 230)
Fig. 57

Function and operation explanation

1. When the execution condition of the input argument Coil turns ON, counting the current value starts. The timer starts counting from "ValueIn × 100 ms". When it counts up to "Preset × 100 ms", the output argument Status turns ON. The current measurement value is outputted into ValueOut.
2. When the execution condition of the input argument Coil turns OFF, the current value takes on the value of ValueIn and the output argument Status also turns OFF.
Mitsubishi Electronics FXCPU — Function and operation explanation diagram (page 230)
Fig. 58 · Function and operation explanation

Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;

*1. Var_D10 is a global label and is defined as D10.

*2. Var_M10 is a global label and is defined as M10.

1. Expression in each language of function block

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

2. For the function block, the automatic allocation device needs to be set as the timer numbers are allocated automatically.
Page 231 of the Mitsubishi Electronics FXCPU user manual — Z6 Z6
Page 231 · click to enlarge
Page 231
Appendix ACorrespondence between Devices and

Appendix A: Correspondence between Devices and

Addresses

The table below shows the correspondence between devices and addresses.

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

TN190 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

CN98 C98

%MW4.99 %MD4.98

Data register D Dn %MW0.n %MD0.n

D198* D198

%MW0.199 %MD0.198

Intelligent function unit device G Ux\Gn %MW14.x.n %MD14.x.n

U0\G09 U0\G09

%MW14.0.10 %MD14.0.9

Extension register R Rn %MW2.n %MD2.n

R32766 R32766

%MW2.32767 %MD2.32766

Extension file register ER ERn No correspondence - -

Pointer P Pn " "(NULL character) P4095 No correspondence

Interrupt pointer I In No correspondence - -

Nesting N Nn No correspondence - -

Z Zn %MW7.n %MD7.n

Z6 Z6

%MW7.7 %MD7.6

V Vn %MW6.n V7 %MW6.7

State S Sn %MX2.n S4095 %MX2.4095

Show 5 more labels / short text on this page
Device · and address · Timer · Counter · Index register
Page 232 of the Mitsubishi Electronics FXCPU user manual — 6. Product application
Page 232 · click to enlarge
Page 232

FXCPU Structured Programming Manual (Application Functions) Warranty

Warranty

Please confirm the following product warranty details before using this product.

1. Gratis Warranty Term and Gratis Warranty Range 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.

2. Onerous repair term after discontinuation of production

1. 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.
2. Product supply (including repair parts) is not available after production is discontinued.
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.

[Gratis Warranty Term] 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.

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.

[Gratis Warranty Range]

1. 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 The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.

2) Even within the gratis warranty term, repairs shall be charged for in the following cases. a) Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design. b) Failure caused by unapproved modifications, etc., to the product by the user. c) 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. d) Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced. e) Relay failure or output contact failure caused by usage beyond the specified Life of contact (cycles). f) 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. g) Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. h) Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.

6. Product application

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

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

Page 233 of the Mitsubishi Electronics FXCPU user manual — Date of preparation Revision Description
Page 233 · click to enlarge
Page 233

FXCPU Structured Programming Manual (Application Functions) Revision History

Revision History

Date of preparation Revision Description

1/2009 A First Edition.

  • 7/2009 B
  • Equivalent circuits are deleted.
  • Following instructions are not supported in FX 0 ,FX 0S and FX 0N PLCs. CTD(_E), CTU(_E), CTUD(_E), TOF(_E), TON(_E), TP(_E)
  • Function blocks (SR(_E), RS(_E)) are deleted.
Page 234 of the Mitsubishi Electronics FXCPU user manual — FXCPU Structured Programming Manual (Application Functions) Revision History
Page 234 · click to enlarge
Page 234

FXCPU Structured Programming Manual (Application Functions) Revision History

MEMO

Page 235 of the Mitsubishi Electronics FXCPU user manual — Revision History
Page 235 · click to enlarge
Page 235
Page 235 of the Mitsubishi Electronics FXCPU user manual — Revision History
Page 236 of the Mitsubishi Electronics FXCPU user manual — JY997D34801B (MEE)
Page 236 · click to enlarge
Page 236

FXCPU

Structured Programming Manual [Application Functions]

HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN

MODEL FX-KP-OK-E

MODEL CODE 09R927

JY997D34801B (MEE)

Effective Jul. 2009 Specifications are subject to change without notice.

Ask about the Mitsubishi Electronics 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 FXCPU

Be the first to ask — other owners or our team will answer.

Original document

Mitsubishi Electronics FXCPU manual PDF

236 pages·3.6 MB·Welding System·PDF
Click any page above to open it here
Page 1 / …
100%
Loading pages…