Mitsubishi Electric MELSEC FX Series Structured Programming Manual

Mitsubishi Electric MELSEC FX Series Structured Programming Manual

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

Advertisement

MITSUBISHI ELECTRIC
Programmable Controllers
Structured Programming Manual
[Application Functions]
FXCPU
01 07 2009
INDUSTRIAL AUTOMATION
MITSUBISHI ELECTRIC
JY997D34801
Version B

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC FX Series

  • Page 1 MITSUBISHI ELECTRIC Programmable Controllers Structured Programming Manual [Application Functions] FXCPU 01 07 2009 INDUSTRIAL AUTOMATION MITSUBISHI ELECTRIC JY997D34801 Version B...
  • Page 3 This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
  • Page 4 • 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.
  • Page 5: Table Of Contents

    FXCPU Structured Programming Manual (Application Functions) Table of Contents Table of Contents Positioning of This Manual....................... 7 Related Manuals ........................10 Generic Names and Abbreviations Used in Manuals ............13 1. Outline 1.1 Outline of Structured Programs and Programming Languages ............ 14 1.1.1 Outline of structured programs ......................
  • Page 6 FXCPU Structured Programming Manual (Application Functions) Table of Contents 5. Applied Functions 5.1 Type Conversion Functions ......................36 5.1.1 BOOL_TO_INT(_E) ........................36 5.1.2 BOOL_TO_DINT(_E) ........................38 5.1.3 BOOL_TO_STR(_E)........................40 5.1.4 BOOL_TO_WORD(_E) ......................... 42 5.1.5 BOOL_TO_DWORD(_E)....................... 44 5.1.6 BOOL_TO_TIME(_E) ........................46 5.1.7 INT_TO_DINT(_E).........................
  • Page 7 FXCPU Structured Programming Manual (Application Functions) Table of Contents 5.2 Standard Functions Of One Numeric Variable................134 5.2.1 ABS(_E)............................134 5.3 Standard Arithmetic Functions ....................136 5.3.1 ADD_E............................136 5.3.2 SUB_E............................138 5.3.3 MUL_E............................140 5.3.4 DIV_E ............................142 5.3.5 MOD(_E) ............................. 144 5.3.6 EXPT(_E) ............................
  • Page 8 FXCPU Structured Programming Manual (Application Functions) Table of Contents 6. Standard Function Blocks 6.1 R_TRIG(_E) ..........................206 6.2 F_TRIG(_E)..........................208 6.3 CTU(_E) ............................210 6.4 CTD(_E) ............................212 6.5 CTUD(_E) ........................... 214 6.6 TP(_E)............................217 6.7 TON(_E)............................219 6.8 TOF(_E) ............................221 6.9 COUNTER_FB_M........................
  • Page 9: Positioning Of This Manual

    FXCPU Structured Programming Manual (Application Functions) 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.
  • Page 10 FXCPU Structured Programming Manual (Application Functions) 2. When using FX PLCs QCPU/FXCPU Structured Programming Manual (Fundamentals) (Additional Manual) This manual explains programming methods, specifications, functions, etc. required to create Q/FX structured programs. Structured FXCPU Structured Programming Manual (Device & Common) (Additional Manual) This manual explains devices and parameters for structured programs provided by GX Works2.
  • Page 11 FXCPU Structured Programming Manual (Application Functions) 3. When using FX PLCs QCPU/FXCPU Structured Programming Manual (Fundamentals) (Additional Manual) This manual explains programming methods, specifications, functions, etc. required to create Q/FX structured programs. Structured FXCPU Structured Programming Manual (Device & Common) (Additional Manual) This manual explains devices and parameters for structured programs provided by GX Works2.
  • Page 12: Related Manuals

    FXCPU Structured Programming Manual (Application Functions) 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.
  • Page 13 FXCPU Structured Programming Manual (Application Functions) Supplied with product Model Manual name Manual number Contents or Additional Manual name code Programming Detaileds about the analog special function block User's Manual- -4AD, FX -4DA, FX -4AD) and analog JY997D16701 Additional Manual 09R619 Analog Control Edition special adapter...
  • Page 14 FXCPU Structured Programming Manual (Application Functions) PLCs [whose production is finished] Supplied with product Model Manual name Manual number Contents or Additional Manual name code PLC main unit Details about the hardware including I/O HARDWARE MANUAL JY992D47501 Supplied with product specifications, wiring, installation and maintenance of the FX PLC main unit.
  • Page 15: Generic Names And Abbreviations Used In Manuals

    FXCPU Structured Programming Manual (Application Functions) Generic Names and Abbreviations Used in Manuals Abbreviation/generic name Name PLCs Series or FX Generic name of FX Series PLCs Series or FX Generic name of FX Series PLCs Series or FX Generic name of FX Series PLCs Series or FX Generic name of FX...
  • Page 16: Outline

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 1.1 Outline of Structured Programs and Programming Outline 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: →...
  • Page 17: Programming Languages

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 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.
  • Page 18: Cautions On Creation Of Fundamental Programs

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 1.3 Cautions on Creation of Fundamental Programs 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: →...
  • Page 19: Double Output (Double Coil) Operation And Countermeasures

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 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.
  • Page 20: Circuits Not Available In Structured Ladder Programs And Countermeasures

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 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).
  • Page 21 FXCPU Structured Programming Manual 1 Outline (Application Functions) 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.
  • Page 22 FXCPU Structured Programming Manual 1 Outline (Application Functions) 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.
  • Page 23: Handling Of Operation Error Flag

    FXCPU Structured Programming Manual 1 Outline (Application Functions) 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.
  • Page 24: Function List

    FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.1 Type Conversion Functions Function List This chapter introduces a list of functions available in programming. Type Conversion Functions Applicable PLC Function name Function Reference Subsection BOOL_TO_INT(_E) Converts bit data into word [signed] data. 5.1.1 Subsection BOOL_TO_DINT(_E)
  • Page 25 FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.1 Type Conversion Functions Applicable PLC Function name Function Reference Converts float (single precision) data into word Subsection REAL_TO_INT(_E) [signed] data. 5.1.23 Converts float (single precision) data into double Subsection REAL_TO_DINT(_E) word [signed] data.
  • Page 26: Standard Functions Of One Numeric Variable

    FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.2 Standard Functions Of One Numeric Variable Standard Functions Of One Numeric Variable Applicable PLC Function name Function Reference Subsection ABS(_E) Obtains the absolute value. 5.2.1 Standard Arithmetic Functions Applicable PLC Function name Function Reference...
  • Page 27: Standard Bit Shift Functions

    FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.4 Standard Bit Shift Functions Standard Bit Shift Functions Applicable PLC Function name Function Reference Subsection SHL(_E) Shifts bits leftward. 5.4.1 Subsection SHR(_E) Shifts bits rightward. 5.4.2 Standard Bitwise Boolean Functions Applicable PLC Function name Function...
  • Page 28: Standard Comparison Functions

    FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.7 Standard Comparison Functions Standard Comparison Functions Applicable PLC Function name Function Reference Subsection GT_E Compares data with regard to "> (larger)". 5.7.1 Compares data with regard to "≥ (larger or Subsection GE_E equal)".
  • Page 29: Standard Function Blocks

    FXCPU Structured Programming Manual 2 Function List (Application Functions) 2.10 Standard Function Blocks 2.10 Standard Function Blocks Applicable PLC Function name Function Reference Detects the rising edge of a signal, and outputs R_TRIG(_E) Section 6.1 pulse signal. Detects the falling edge of a signal, and outputs F_TRIG(_E) Section 6.2 pulse signal.
  • Page 30: Function Construction

    FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 3.1 Applied Function Expression and Execution Type Function Construction This chapter explains the construction of applied functions. 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)"...
  • Page 31: Labels

    FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 3.2 Labels 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.
  • Page 32 FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 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 Input "TRUE" or "FALSE". Or input "0" or "1". TRUE, FALSE Binary number Add "2#"...
  • Page 33 FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 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". ANY_SIMPLE Array Structure ANY_NUM ANY_BIT Time String Word...
  • Page 34: Device And Address

    FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 3.3 Device and Address 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. D 100 Device name Device number...
  • Page 35: And Eno

    FXCPU Structured Programming Manual 3 Function Construction (Application Functions) 3.4 EN and ENO 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. •...
  • Page 36: How To Read Explanation Of Functions

    FXCPU Structured Programming Manual 4 How to Read Explanation of Functions (Application Functions) How to Read Explanation of Functions Function explanation pages have the following configuration. * The above page is prepared for explanation, and is different from the actual page.
  • Page 37 FXCPU Structured Programming Manual 4 How to Read Explanation of Functions (Application Functions) 1) Indicates the chapter/section/subsection number and instruction name. 2) Indicates PLCs which support the function. Item Description The PLC Series supports the function from its first product. The supporting status varies on the version.
  • Page 38: Applied Functions

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Applied Functions 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: →...
  • Page 39 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 40: Bool_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.2 BOOL_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts bit data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder BOOL_TO_DINT(_BOOL);...
  • Page 41 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 42: Bool_To_Str(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.3 BOOL_TO_STR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts bit data into string data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder BOOL_TO_STR(_BOOL);...
  • Page 43 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 44: Bool_To_Word(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.4 BOOL_TO_WORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts bit data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 45 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 46: Bool_To_Dword(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.5 BOOL_TO_DWORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts bit data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 47 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] g_bool1...
  • Page 48: Bool_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.6 BOOL_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts bit data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder BOOL_TO_TIME(_BOOL);...
  • Page 49 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 50: Int_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.7 INT_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 51 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 52: Dint_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.8 DINT_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 53 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 54: Int_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.9 INT_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder INT_TO_BOOL(_INT);...
  • Page 55 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 56: Dint_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.10 DINT_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder DINT_TO_BOOL(_DINT);...
  • Page 57 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DINT_TO_BOOL...
  • Page 58: Int_To_Real(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.11 INT_TO_REAL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into float (single precision) data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 59 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 60: Dint_To_Real(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.12 DINT_TO_REAL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into float (single precision) data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 61 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DINT_TO_REAL...
  • Page 62: Int_To_Str(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.13 INT_TO_STR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into string data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder INT_TO_STR(_INT);...
  • Page 63 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 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) Program example...
  • Page 64: Dint_To_Str(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.14 DINT_TO_STR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into string data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder DINT_TO_STR(_DINT);...
  • Page 65 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Cautions 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.
  • Page 66: Int_To_Word(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.15 INT_TO_WORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 67 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] INT_TO_WORD...
  • Page 68: Dint_To_Word(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.16 DINT_TO_WORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion. 1.
  • Page 69 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DINT_TO_WORD...
  • Page 70: Int_To_Dword(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.17 INT_TO_DWORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion. 1.
  • Page 71 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] INT_TO_DWORD...
  • Page 72: Dint_To_Dword(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.18 DINT_TO_DWORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion. 1.
  • Page 73 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DINT_TO_DWORD...
  • Page 74: Int_To_Bcd(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.19 INT_TO_BCD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into BCD data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder INT_TO_BCD(_INT);...
  • Page 75 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] INT_TO_BCD...
  • Page 76: Dint_To_Bcd(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.20 DINT_TO_BCD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into BCD data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder DINT_TO_BCD(_DINT);...
  • Page 77 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Error An operation error occurs when the value stored in a device specified in is outside the range from "0" to "99,999,999". Program example 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)
  • Page 78: Int_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.21 INT_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [signed] data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder INT_TO_TIME(_INT);...
  • Page 79 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 80: Dint_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.22 DINT_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [signed] data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder DINT_TO_TIME(_DINT);...
  • Page 81 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] [ST]...
  • Page 82: Real_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.23 REAL_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts float (single precision) data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 83 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] REAL_TO_INT...
  • Page 84: Real_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.24 REAL_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts float (single precision) data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 85 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] REAL_TO_DINT...
  • Page 86: Real_To_Str(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.25 REAL_TO_STR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts float (single precision) data into string data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder REAL_TO_STR(_REAL);...
  • Page 87 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 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 (.)"...
  • Page 88 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion 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 outside the following range: -126 ≤...
  • Page 89: Word_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.26 WORD_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [unsigned]/bit string [16-bit] data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 90 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] WORD_TO_BOOL...
  • Page 91: Dword_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.27 DWORD_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [unsigned]/bit string [32-bit] data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 92 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DWORD_TO_BOOL...
  • Page 93: Word_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.28 WORD_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [unsigned]/bit string [16-bit] data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 94 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] WORD_TO_INT...
  • Page 95: Word_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.29 WORD_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [unsigned]/bit string [16-bit] data into double word [signed] data, and outputs the data obtained by conversion. 1.
  • Page 96 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] WORD_TO_DINT...
  • Page 97: Dword_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.30 DWORD_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [unsigned]/bit string [32-bit] data into word [signed] data, and outputs the data obtained by conversion. 1.
  • Page 98 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DWORD_TO_INT...
  • Page 99: Dword_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.31 DWORD_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [unsigned]/bit string [32-bit] data into double word [signed] data, and outputs the data obtained by conversion. 1.
  • Page 100 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DWORD_TO_DINT...
  • Page 101: Word_To_Dword(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.32 WORD_TO_DWORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline 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. 1.
  • Page 102 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder]...
  • Page 103: Dword_To_Word(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.33 DWORD_TO_WORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline 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. 1.
  • Page 104 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder]...
  • Page 105: Word_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.34 WORD_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts word [unsigned]/bit string [16-bit] data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 106 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] WORD_TO_TIME...
  • Page 107: Dword_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.35 DWORD_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts double word [unsigned]/bit string [32-bit] data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 108 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] DWORD_TO_TIME...
  • Page 109: Str_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.36 STR_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts string data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder STR_TO_BOOL(_STRING);...
  • Page 110 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] STR_TO_BOOL...
  • Page 111: Str_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.37 STR_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts string data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder STR_TO_INT(_STRING);...
  • Page 112 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 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 +2 is any other than "30H"...
  • Page 113: Str_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.38 STR_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts string data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder STR_TO_DINT(_STRING);...
  • Page 114 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 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 +5 is any other than "30H"...
  • Page 115: Str_To_Real(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.39 STR_TO_REAL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts string data into float (single precision) data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder STR_TO_REAL(_STRING);...
  • Page 116 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions b) In the case of exponent format High-order byte Low-order byte 1st word String 31H (1) 2DH (-) 2nd word 33H (3) 2EH (3) 3rd word 30H (0) 35H (5) 4th word 34H (4)
  • Page 117 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 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 (.)"...
  • Page 118: Str_To_Time(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.40 STR_TO_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts string data into time data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder STR_TO_TIME(_STRING);...
  • Page 119 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion 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 sign data of numeric data specified in is any other than "20H (space)"...
  • Page 120: Bcd_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.41 BCD_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts BCD data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder BCD_TO_INT(_BCD);...
  • Page 121 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] BCD_TO_INT...
  • Page 122: Bcd_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.42 BCD_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts BCD data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder BCD_TO_DINT(_BCD);...
  • Page 123 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] BCD_TO_DINT...
  • Page 124: Time_To_Bool(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.43 TIME_TO_BOOL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into bit data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder TIME_TO_BOOL(_TIME);...
  • Page 125 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_BOOL...
  • Page 126: Time_To_Int(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.44 TIME_TO_INT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder TIME_TO_INT(_TIME);...
  • Page 127 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_INT...
  • Page 128: Time_To_Dint(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.45 TIME_TO_DINT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder TIME_TO_DINT(_TIME);...
  • Page 129 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_DINT...
  • Page 130: Time_To_Str(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.46 TIME_TO_STR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into string data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder TIME_TO_STR(_TIME);...
  • Page 131 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_STR...
  • Page 132: Time_To_Word(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.47 TIME_TO_WORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 133 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_WORD...
  • Page 134: Time_To_Dword(_E)

    FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions 5.1.48 TIME_TO_DWORD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function converts time data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion. 1. Format Expression in each language Function name Structured ladder...
  • Page 135 FXCPU Structured Programming Manual 5 Applied Functions (Application Functions) 5.1 Type Conversion Functions Program example 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) [Structured ladder] TIME_TO_DWORD...
  • Page 136: Standard Functions Of One Numeric Variable

    FXCPU Structured Programming Manual (Application Functions) 5.2 Standard Functions Of One Numeric Variable Standard Functions Of One Numeric Variable 5.2.1 ABS(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains the absolute value, and outputs it. 1. Format Expression in each language Function name Structured ladder ABS(_IN);...
  • Page 137 FXCPU Structured Programming Manual (Application Functions) 5.2 Standard Functions Of One Numeric Variable Program example 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)
  • Page 138: Standard Arithmetic Functions

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Standard Arithmetic Functions 5.3.1 ADD_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs addition using two values (A + B = C), and outputs the operation result. 1. Format Expression in each language Function name Structured ladder ADD_E(EN,_IN,_IN,Output...
  • Page 139 FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Cautions 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.
  • Page 140: Sub_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.2 SUB_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs subtraction using two values (A - B = C), and outputs the operation result. 1. Format Expression in each language Function name Structured ladder SUB_E(EN,_IN1,_IN2,Output...
  • Page 141 FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Cautions 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.
  • Page 142: Mul_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.3 MUL_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs multiplication using two values (A × B = C), and outputs the operation result. 1. Format Expression in each language Function name Structured ladder MUL_E(EN,_IN,_IN,Output...
  • Page 143 FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Program example In this program, multiplication is performed using double word [signed] data stored in devices specified in , and the operation result is output to a device specified in [Structured ladder] g_bool1 MUL_E...
  • Page 144: Div_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.4 DIV_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs division using two values (A / B = C … remainder), and outputs the quotient. 1. Format Expression in each language Function name Structured ladder DIV_E(EN,_IN1,_IN2,Output...
  • Page 145 FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Program example In this program, division is performed using double word [signed] data stored in devices specified in , and the operation result is output to a device specified in using the data type of data stored in devices specified in [Structured ladder]...
  • Page 146: Mod_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.5 MOD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs division using two values (A / B = C … remainder), and outputs the remainder. 1. Format Expression in each language Function name Structured ladder _IN1 MOD _IN2;...
  • Page 147 FXCPU Structured Programming Manual (Application Functions) 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"...
  • Page 148: Expt_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.6 EXPT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains raised result, and outputs it. 1. Format Expression in each language Function name Structured ladder EXPT(In1,In2); EXPT Example: EXPT Label 1 Label 2 Label 2:= EXPT(Label 1,D10);...
  • Page 149 FXCPU Structured Programming Manual (Application Functions) 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...
  • Page 150: Move_E

    FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 5.3.7 MOVE(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function transfers data stored in a device to another device. 1. Format Expression in each language Function name Structured ladder MOVE(_IN); Example: MOVE MOVE D10:=...
  • Page 151 FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions Program example 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) [Structured ladder] MOVE g_int2 g_int1 [ST] g_int2:=MOVE(g_int1);...
  • Page 152: Standard Bit Shift Functions

    FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions Standard Bit Shift Functions 5.4.1 SHL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function shifts data of specified bit length leftward by the specified number of bits. 1. Format Expression in each language Function name Structured ladder SHL(_IN,_N);...
  • Page 153 FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions Cautions 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.
  • Page 154: Shr_E

    FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions 5.4.2 SHR(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function shifts data of specified bit length rightward by the specified number of bits. 1. Format Expression in each language Function name Structured ladder SHR(_IN,_K);...
  • Page 155 FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions Cautions 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.
  • Page 156: Standard Bitwise Boolean Functions

    FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions Standard Bitwise Boolean Functions 5.5.1 AND_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains the logical product of two or more bits, and outputs it. 1. Format Expression in each language Function name Structured ladder AND_E(EN,_IN,_IN,Output...
  • Page 157 FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions Program example 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 the operation result is output to a device specified in using the data type of data stored in devices specified in [Structured ladder]...
  • Page 158: Or_E

    FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 5.5.2 OR_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains the logical sum of two or more bits, and outputs it. 1. Format Expression in each language Function name Structured ladder OR_E(EN,_IN,_IN,Output label);...
  • Page 159 FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions Program example 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 the operation result is output to a device specified in using the data type of data stored in devices specified in [Structured ladder]...
  • Page 160: Xor_E

    FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 5.5.3 XOR_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains the exclusive logical sum of two or more bits, and outputs it. 1. Format Expression in each language Function name Structured ladder XOR_E(EN,_IN,_IN,Output X000...
  • Page 161 FXCPU Structured Programming Manual (Application Functions) 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 If there is , the exclusive logical sum is obtained using the "exclusive logical sum of "exclusive logical sum of "...
  • Page 162: Not_E

    FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 5.5.4 NOT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains the logical negation of bits, and outputs it. 1. Format Expression in each language Function name Structured ladder NOT(_IN); Example: M10:= NOT(M0);...
  • Page 163 FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions Program example 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)
  • Page 164: Standard Selection Functions

    FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Standard Selection Functions 5.6.1 SEL(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function selects either one between two data in accordance with the input condition, and outputs the selection result. 1. Format Expression in each language Function name Structured ladder...
  • Page 165 FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Cautions 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.
  • Page 166: Maximum_E

    FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 5.6.2 MAXIMUM(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function searches the maximum value among data, and outputs the maximum value. 1. Format Expression in each language Function name Structured ladder MAXIMUM(_IN,_IN);...
  • Page 167 FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Program example In this program, the maximum value among word [signed] data stored in devices specified in output to a device specified in using the data type of data stored in devices specified in 1) Function without EN/ENO(MAXIMUM) [Structured ladder] MAXIMUM...
  • Page 168: Minimum_E

    FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 5.6.3 MINIMUM(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function searches the minimum value among data, and outputs the minimum value. 1. Format Expression in each language Function name Structured ladder MINIMUM(_IN,_IN);...
  • Page 169 FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Program example In this program, the minimum value among word [signed] data stored in devices specified in output to a device specified in using the data type of data stored in devices specified in 1) Function without EN/ENO(MINIMUM) [Structured ladder] MINIMUM...
  • Page 170: Limitation_E

    FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 5.6.4 LIMITATION(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function judges whether data is located within the range between the upper limit value and the lower limit value. 1. Format Expression in each language Function name Structured ladder LIMITATION(_MN,_IN,_MX);...
  • Page 171 FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Cautions 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.
  • Page 172: Mux_E

    FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 5.6.5 MUX(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function selects data, and outputs the selected data. 1. Format Expression in each language Function name Structured ladder MUX(_K,_IN,_IN); Example: D30:= MUX(D0,D10,D20); MUX_E(EN,_K,_IN,_IN,Output MUX_E X000...
  • Page 173 FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions Cautions 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.
  • Page 174: Standard Comparison Functions

    FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions Standard Comparison Functions 5.7.1 GT_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "> (larger)". 1. Format Expression in each language Function name Structured ladder GT_E(EN,_IN,_IN,Output label); Example: GT_E X000...
  • Page 175 FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions Program example In this program, the contents of devices specified in are compared, and the operation result is output to a device specified in [Structured ladder] GT_E g_bool1 g_bool3 g_int1 g_bool2 g_int2 [ST]...
  • Page 176: Ge_E

    FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 5.7.2 GE_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "≥ (larger or equal)". 1. Format Expression in each language Function name Structured ladder GE_E(EN,_IN,_IN,Output label); Example: X000 GE_E...
  • Page 177: Eq_E

    FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 5.7.3 EQ_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "= (equal)". 1. Format Expression in each language Function name Structured ladder EQ_E(EN,_IN,_IN,Output label); X000 EQ_E Example: EQ_E(X000,D0,D10,M0);...
  • Page 178: Le_E

    FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 5.7.4 LE_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "≤ (smaller or equal)". 1. Format Expression in each language Function name Structured ladder LE_E(EN,_IN,_IN,Output label); Example: X000 LE_E...
  • Page 179 FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions Program example In this program, the contents of devices specified in are compared, and the operation result is output to a device specified in [Structured ladder] LE_E g_bool1 g_bool3 g_int1 g_bool2 g_int2 [ST]...
  • Page 180 FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 5.7.5 LT_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "< (smaller)". 1. Format Expression in each language Function name Structured ladder LT_E(EN,_IN,_IN,Output label); Example: X000 LT_E LT_E(X000,D0,D10,M0);...
  • Page 181: Ne_E

    FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 5.7.6 NE_E 3U(C) 2N(C) 1N(C) 0(S) Outline This function compares data with regard to "≠ (unequal)". 1. Format Expression in each language Function name Structured ladder NE_E(EN,_IN1,_IN2,Output label); Example: X000 NE_E NE_E(X000,D0,D10,M0);...
  • Page 182 FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions Program example In this program, the contents of devices specified in are compared, and the operation result is output to a device specified in [Structured ladder] NE_E g_bool1 g_bool3 g_int1 _IN1 g_bool2 g_int2...
  • Page 183: Standard Character String Functions

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Standard Character String Functions 5.8.1 MID(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function obtains a character string from a specified position. 1. Format Expression in each language Function name Structured ladder MID(_IN,_L ,_P);...
  • Page 184 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Explanation of function and operation 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 .
  • Page 185 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Program example 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) [Structured ladder] g_string2="EF123"...
  • Page 186: Concat_E

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 5.8.2 CONCAT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function connects character strings. 1. Format Expression in each language Function name Structured ladder CONCAT(_IN,_IN); Example: CONCAT Label 3:= CONCAT Label 1 Label 3 CONCAT(Label 1,Label 2);...
  • Page 187 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Explanation of function and operation 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"...
  • Page 188 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Program example 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) [Structured ladder]...
  • Page 189: Insert_E

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 5.8.3 INSERT(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function inserts a character string. 1. Format Expression in each language Function name Structured ladder INSERT(_IN1,_IN2,_P); INSERT Example: Label 1 _IN1 Label 3 Label 3:= INSERT...
  • Page 190 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Explanation of function and operation 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...
  • Page 191 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Program example 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)
  • Page 192: Delete_E

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 5.8.4 DELETE(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function deletes a character string. 1. Format Expression in each language Function name Structured ladder DELETE(_IN,_L ,_P); DELETE Example: Label 1 Label 2 Label 2:= DELETE...
  • Page 193 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Cautions 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.
  • Page 194: Replace(_E)

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 5.8.5 REPLACE(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function replaces a character string. 1. Format Expression in each language Function name Structured ladder REPLACE(_IN1,_IN2,_L ,_P); REPLACE Example: Label 1 _IN1 Label 3 Label 3:=...
  • Page 195 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Explanation of function and operation 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...
  • Page 196 FXCPU Structured Programming Manual (Application Functions) 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 (Error code: K6706) 2) When the value specified in exceeds the number of characters of a character string stored in...
  • Page 197: Find(_E)

    FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 5.8.6 FIND(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function searches a character string. 1. Format Expression in each language Function name Structured ladder FIND(_IN1,_IN2); FIND Example: FIND Label 1 _IN1 D20:= FIND(Label 1,Label 2);...
  • Page 198 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Explanation of function and operation 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.
  • Page 199 FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Program example 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) [Structured ladder] FIND...
  • Page 200: Functions Of Time Data Types

    FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types Functions Of Time Data Types 5.9.1 ADD_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function adds time data. 1. Format Expression in each language Function name Structured ladder ADD_TIME(_IN1,_IN2); ADD_TIME Example: ADD_TIME...
  • Page 201 FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types Cautions 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.
  • Page 202: Sub_Time(_E)

    FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 5.9.2 SUB_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs subtraction of time data. 1. Format Expression in each language Function name Structured ladder SUB_TIME(_IN1,_IN2); SUB_TIME Example: SUB_TIME Label 1 _IN1 Label 3...
  • Page 203 FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types Cautions 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.
  • Page 204: Mul_Time(_E)

    FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 5.9.3 MUL_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs multiplication of time data. 1. Format Expression in each language Function name Structured ladder MUL_TIME(_IN1,_IN2); MUL_TIME Example: MUL_TIME Label 1 _IN1 Label 3...
  • Page 205 FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types Program example × In this program, multiplication ( ) is performed using time data stored in devices specified in , and the operation result expressed as time data is output to devices specified in 1) Function without EN/ENO(MUL_TIME) [Structured ladder] MUL_TIME...
  • Page 206: Div_Time(_E)

    FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 5.9.4 DIV_TIME(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function performs division using time data. 1. Format Expression in each language Function name Structured ladder DIV_TIME(_IN1,_IN2); DIV_TIME Example: DIV_TIME Label 1 _IN1 Label 3...
  • Page 207 FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types Program example In this program, division ( ) is performed using time data stored in devices specified in , and the operation result expressed as time data is output to devices specified in 1) Function without EN/ENO(DIV_TIME) [Structured ladder] DIV_TIME...
  • Page 208: Standard Function Blocks

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.1 R_TRIG(_E) Standard Function Blocks R_TRIG(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block detects the rising edge of a signal, and outputs pulse signal. 1. Format Expression in each language Function name Structured ladder R_TRIG(_CLK);...
  • Page 209 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.1 R_TRIG(_E) Program example 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.
  • Page 210: F_Trig_E

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.2 F_TRIG(_E) F_TRIG(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block detects the falling edge of a signal, and outputs pulse signal. 1. Format Expression in each language Function name Structured ladder F_TRIG(_CLK);...
  • Page 211 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.2 F_TRIG(_E) Program example 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.
  • Page 212: Ctu(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.3 CTU(_E) CTU(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block counts up the number of times of rising of a signal. 1. Format Expression in each language Function name Structured ladder CTU(CU,RESET,PV);...
  • Page 213 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.3 CTU(_E) Program example 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) [Structured ladder] CTU_Instance...
  • Page 214: Ctd(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.4 CTD(_E) CTD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block counts down the number of times of rising of a signal. 1. Format Expression in each language Function name Structured ladder CTD(CD,LOAD,PV);...
  • Page 215 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.4 CTD(_E) Program example 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".
  • Page 216: Ctud(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.5 CTUD(_E) CTUD(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block counts up/down the number of times of rising of a signal. 1. Format Expression in each language Function name Structured ladder CTUD(CU,CD,RESET,LOAD,PV);...
  • Page 217 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.5 CTUD(_E) This function block resets the count value of a device specified in when a device specified in turns This function block sets the value stored in to a device specified in when a device specified in turns ON.
  • Page 218 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.5 CTUD(_E) Program example 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.
  • Page 219: Tp(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.6 TP(_E) TP(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block keeps ON a signal for specified duration. 1. Format Expression in each language Function name Structured ladder TP(IN,PT); *1 Instance name Example: Instance name(IN:=M0,...
  • Page 220 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.6 TP(_E) Program example 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) [Structured ladder] TP_Instance...
  • Page 221: Ton(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.7 TON(_E) TON(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline This function block turns ON after specified time. 1. Format Expression in each language Function name Structured ladder TON(IN,PT); *1 Instance name Example: Instance name(IN:=M0, PT:=Label 1);...
  • Page 222 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.7 TON(_E) Program example 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) [Structured ladder] TON_Instance...
  • Page 223: Tof(_E)

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.8 TOF(_E) TOF(_E) 3U(C) 2N(C) 1N(C) 0(S) Outline When the input signal turns OFF, this function block turns OFF the output signal after the specified time. 1. Format Expression in each language Function name Structured ladder TOF(IN,PT);...
  • Page 224 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.8 TOF(_E) Program example 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.
  • Page 225: Counter_Fb_M

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.9 COUNTER_FB_M COUNTER_FB_M 3U(C) 2N(C) 1N(C) 0(S) Outline 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.
  • Page 226 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.9 COUNTER_FB_M Cautions 1) Expression in each language of function block 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: Timer_10_Fb_M

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.10 TIMER_10_FB_M 6.10 TIMER_10_FB_M 3U(C) 2N(C) 1N(C) 0(S) Outline 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. 1.
  • Page 228: Timer_Cont_Fb_M

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.11 TIMER_CONT_FB_M 6.11 TIMER_CONT_FB_M 3U(C) 2N(C) 1N(C) 0(S) Outline 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. 1.
  • Page 229 FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.11 TIMER_CONT_FB_M Cautions 1) Expression in each language of function block 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: Timer_100_Fb_M

    FXCPU Structured Programming Manual 6 Standard Function Blocks (Application Functions) 6.12 TIMER_100_FB_M 6.12 TIMER_100_FB_M 3U(C) 2N(C) 1N(C) 0(S) Outline 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. 1.
  • Page 231: Appendix A: Correspondence Between Devices And Addresses

    FXCPU Structured Programming Manual Appendix A: Correspondence between Devices and (Application Functions) Appendix A: Correspondence between Devices and Addresses The table below shows the correspondence between devices and addresses. Example of correspondence between device Notation and address Device Device Address Device Address Input relay...
  • Page 232: Warranty

    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 2. Onerous repair term after discontinuation of If any faults or defects (hereinafter "Failure") found to be production the responsibility of Mitsubishi occurs during use of the Mitsubishi shall accept onerous product repairs for...
  • Page 233: Revision History

    FXCPU Structured Programming Manual (Application Functions) Revision History Revision History Date of preparation Revision Description 1/2009 First Edition. 7/2009 • Equivalent circuits are deleted. • Following instructions are not supported in FX and FX PLCs. CTD(_E), CTU(_E), CTUD(_E), TOF(_E), TON(_E), TP(_E) •...
  • Page 234 FXCPU Structured Programming Manual (Application Functions) Revision History MEMO...
  • Page 235 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 FX-KP-OK-E MODEL 09R927 MODEL CODE JY997D34801B Effective Jul. 2009 (MEE) Specifications are subject to change without notice.
  • Page 236 Phone: +380 (0)44 / 494 33 55 Fax: +380 (0)44 / 494-33-66 Mitsubishi Electric Europe B.V. /// FA - European Business Group /// Gothaer Straße 8 /// D-40880 Ratingen /// Germany Tel.: +49(0)2102-4860 /// Fax: +49(0)2102-4861120 /// info@mitsubishi-automation.com /// www.mitsubishi-automation.com...

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents