FXCPU Structured Programming Manual [Application Functions]
FXCPU Structured Programming Manual (Application Functions) FXCPU Structured Programming Manual (Application Functions) Manual number JY997D34801 Manual revision B Date 7/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.
FXCPU Structured Programming Manual (Application Functions) 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.
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 14 1.
FXCPU Structured Programming Manual (Application Functions) 5. Applied Functions Table of Contents 36 5.1 Type Conversion Functions .......................................................................................................... 36 5.1.1 BOOL_TO_INT(_E) ....................................................................................................................... 36 5.1.2 BOOL_TO_DINT(_E) ..................................................................................................
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 5.3.
FXCPU Structured Programming Manual (Application Functions) Table of Contents 6. Standard Function Blocks 206 6.1 R_TRIG(_E) ................................................................................................................................ 206 6.2 F_TRIG(_E)................................................................................................................................. 208 6.3 CTU(_E) ..........................................................................................
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. 1.
FXCPU Structured Programming Manual (Application Functions) 2. When using FX1S/FX1N/FXU/FX1NC/FX2NC PLCs QCPU/FXCPU Structured Programming Manual (Fundamentals) (Additional Manual) Q/FX This manual explains programming methods, specifications, functions, etc. required to create structured programs. Structured FXCPU Structured Programming Manual (Device & Common) (Additional Manual) FX This manual explains devices and parameters for structured programs provided by GX Works2.
FXCPU Structured Programming Manual (Application Functions) 3. When using FX0/FX0S/FX0N/FXU/FX2C PLCs QCPU/FXCPU Structured Programming Manual (Fundamentals) (Additional Manual) Q/FX This manual explains programming methods, specifications, functions, etc. required to create structured programs. Structured FXCPU Structured Programming Manual (Device & Common) (Additional Manual) FX This manual explains devices and parameters for structured programs provided by GX Works2.
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. Manuals not introduced here may be required in some applications.
FXCPU Structured Programming Manual (Application Functions) Manual number Supplied with product or Additional Manual Contents Model name code FX3G/FX3U/FX3UC User's ManualAnalog Control Edition JY997D16701 Additional Manual Detaileds about the analog special function block (FX3U-4AD, FX3U-4DA, FX3UC-4AD) and analog special adapter (FX3U-****-ADP).
FXCPU Structured Programming Manual (Application Functions) FX0/FX0S/FX0N/FXU/FX2C PLCs [whose production is finished] Manual number Supplied with product or Additional Manual FX0/FX0N HARDWARE MANUAL JY992D47501 Supplied with product Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0/FX0N PLC main unit.
FXCPU Structured Programming Manual (Application Functions) Generic Names and Abbreviations Used in Manuals Abbreviation/generic name Name PLCs 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
FXCPU Structured Programming Manual (Application Functions) 1. 1 Outline 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: → Q/FX Structured Programming Manual (Fundamentals) 1.
FXCPU Structured Programming Manual (Application Functions) 1.2 PLC Series and Programming Software Version 1 Programming languages Outline 1.1.2 1 Outline The following programming languages can be used in each program block. Graphic languages 2 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.
FXCPU Structured Programming Manual (Application Functions) 1.3 1 Outline 1.3 Cautions on Creation of Fundamental Programs Cautions on Creation of Fundamental Programs This section explains cautions on programming.
FXCPU Structured Programming Manual (Application Functions) 1.3 Cautions on Creation of Fundamental Programs 1 Double output (double coil) operation and countermeasures Outline 1.3.2 1 Outline This subsection explains the double output (double coil) operation and countermeasures. 1. Operation of double outputs 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.
FXCPU Structured Programming Manual (Application Functions) 1.3.3 1 Outline 1.3 Cautions on Creation of Fundamental Programs 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). A F B C B E D F A E A C E D C 2.
FXCPU Structured Programming Manual (Application Functions) 1 Outline 1.3 Cautions on Creation of Fundamental Programs Good example M8000 D0 10 EN s1 s2 M8029 M8029 works as a flag to indicate that execution of DSW is completed. Execution is completed.
FXCPU Structured Programming Manual (Application Functions) 1 Outline 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.
FXCPU Structured Programming Manual (Application Functions) 1.3 Cautions on Creation of Fundamental Programs 1 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 2 Error flag Device which stores error code M8067 D8067 Function List *1.
FXCPU Structured Programming Manual (Application Functions) 2. 2 Function List 2.1 Type Conversion Functions Function List This chapter introduces a list of functions available in programming. 2.1 Type Conversion Functions Applicable PLC FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) BOOL_TO_INT(_E) Converts bit data into word [signed] data. 3 3 3 3 3 3 3 3 Subsection 5.1.1 BOOL_TO_DINT(_E) Converts bit data into double word [signed] data.
FXCPU Structured Programming Manual (Application Functions) 2 Function List 2.1 Type Conversion Functions 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 WORD_TO_BOOL(_E) Converts word [unsigned]/bit string [16-bit] data into bit data. 3 3 3 3 3 3 3 3 Subsection 5.1.
FXCPU Structured Programming Manual (Application Functions) 2.2 2 Function List 2.2 Standard Functions Of One Numeric Variable Standard Functions Of One Numeric Variable Applicable PLC FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2.3 Obtains the absolute value. FX3G ABS(_E) Function FX3U(C) Function name 3 3 3 3 3 3 3 3 Reference Subsection 5.2.1 Standard Arithmetic Functions Applicable PLC FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) ADD_E Adds data.
FXCPU Structured Programming Manual (Application Functions) 2.4 Standard Bit Shift Functions 1 Standard Bit Shift Functions Outline 2.4 2 Function List Applicable PLC FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Shifts bits leftward. 3 3 3 3 3 3 3 3 Subsection 5.4.1 SHR(_E) Shifts bits rightward. 3 3 3 3 3 3 3 3 Subsection 5.4.2 Function Reference 2 Function List FX3U(C) SHL(_E) Function name 3 Standard Bitwise Boolean Functions Function Construction 2.
FXCPU Structured Programming Manual (Application Functions) 2.7 2 Function List 2.7 Standard Comparison Functions Standard Comparison Functions Applicable PLC FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) GT_E Compares data with regard to "> (larger)". 3 3 3 3 3 3 3 3 Subsection 5.7.1 GE_E Compares data with regard to "≥ (larger or equal)". 3 3 3 3 3 3 3 3 Subsection 5.7.2 EQ_E Compares data with regard to "= (equal)". 3 3 3 3 3 3 3 3 Subsection 5.7.
FXCPU Structured Programming Manual (Application Functions) 2.10 Standard Function Blocks 1 Standard Function Blocks Outline 2.10 2 Function List Applicable PLC FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Reference R_TRIG(_E) Detects the rising edge of a signal, and outputs pulse signal. 3 3 3 3 3 3 3 3 Section 6.1 F_TRIG(_E) Detects the falling edge of a signal, and outputs pulse signal. 3 3 3 3 3 3 3 3 Section 6.
FXCPU Structured Programming Manual (Application Functions) 3. 3 Function Construction 3.1 Applied Function Expression and Execution Type Function Construction 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.
FXCPU Structured Programming Manual (Application Functions) 3.2 Labels 1 Labels Outline 3.2 3 Function Construction Label types Labels are classified into two types, global and local. 2 Function List • 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.
FXCPU Structured Programming Manual (Application Functions) 3 Function Construction 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.
FXCPU Structured Programming Manual (Application Functions) 3 Function Construction 3.2 Labels 1 Outline • The universal data type indicates data type of a label which combines several basic data types. The data type name begins with "ANY". ANY 2 ANY_NUM Time ANY_BIT Structure *1 String 3 ANY_INT Word [signed] FLOAT (Double Precision) Double word [signed] The "ANY" type on a higher layer contains types on the lower layer. The "ANY" type on the top layer contains all types.
FXCPU Structured Programming Manual (Application Functions) 3.3 3 Function Construction 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. X0 D 100 Device name Device number Address method This method is defined in IEC61131-3, and used as shown in the table below.
FXCPU Structured Programming Manual (Application Functions) 3.4 EN and ENO 1 EN and ENO Outline 3.4 3 Function Construction Execution of an instruction can be controlled when the instruction contains "EN" in its name. • "EN" inputs the instruction execution condition. 2 • "ENO" outputs the instruction execution status. EN TRUE(Executes operation.) X000 Operation result TRUE(Operation error did not occur.) Operation output value FALSE(Operation error occurred.
FXCPU Structured Programming Manual (Application Functions) 4. 4 How to Read Explanation of Functions How to Read Explanation of Functions Function explanation pages have the following configuration. 1) 2) 3) 4) 5) 6) 7) * The above page is prepared for explanation, and is different from the actual page.
FXCPU Structured Programming Manual (Application Functions) 4 How to Read Explanation of Functions 1 Item Outline 1) Indicates the chapter/section/subsection number and instruction name. 2) Indicates PLCs which support the function. Description The PLC Series supports the function from its first product. The supporting status varies on the version. Applicable versions are explained in "Cautions". 2 Function List The PLC Series does not support the function.
FXCPU Structured Programming Manual (Application Functions) 5. 5 Applied 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: → Q/FX Structured Programming Manual (Fundamentals) 5.1 Type Conversion Functions 5.1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a device specified in s is converted into word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.2 5 Applied Functions 5.1 Type Conversion Functions BOOL_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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_TO_DINT_ E M0 X000 M0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.3 5 Applied Functions 5.1 Type Conversion Functions BOOL_TO_STR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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_TO_STR_ E *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a deice specified in by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.4 5 Applied Functions 5.1 Type Conversion Functions BOOL_TO_WORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 BOOL_TO_WOR D BOOL_TO_WOR D_E M0 X000 M0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a device specified in s is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.5 5 Applied Functions 5.1 Type Conversion Functions BOOL_TO_DWORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 BOOL_TO_DWO RD BOOL_TO_DWO RD_E M0 X000 M0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a device specified in s is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.6 5 Applied Functions 5.1 Type Conversion Functions BOOL_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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_TO_TIME_ E M0 X000 M0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, bit data stored in a device specified in by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.7 5 Applied Functions 5.1 Type Conversion Functions INT_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 INT_TO_DINT D0 X000 INT_TO_DINT_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.8 5 Applied Functions 5.1 Type Conversion Functions DINT_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 DINT_TO_INT Label X000 DINT_TO_INT_E Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in s is converted into word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.1.9 5 Applied Functions 5.1 Type Conversion Functions INT_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 X000 INT_TO_BOOL_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.10 DINT_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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_TO_BOOL_ E Label X000 Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.11 INT_TO_REAL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 INT_TO_REAL D0 X000 INT_TO_REAL_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in s is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in d . 1) Function without EN/ENO(INT_TO_REAL) [Structured ladder] 2 [ST] INT_TO_REAL a_Int Function List g_int1=5923 g_real1 := INT_TO_REAL(g_int1); g_real1=5923.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.12 DINT_TO_REAL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 DINT_TO_REAL DINT_TO_REAL_ E Structured ladder Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in s is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in d . 1) Function without EN/ENO(DINT_TO_REAL) 2 DINT_TO_REAL a_Dint Function List [Structured ladder] g_dint1=65000 Outline Program example g_real1=65000.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.13 INT_TO_STR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 X000 INT_TO_STR_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code. d ) 2 Program example In this program, word [signed] data stored in a device specified in s data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.14 DINT_TO_STR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 Label 1 X000 DINT_TO_STR_E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 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.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.15 INT_TO_WORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 INT_TO_WORD D0 X000 INT_TO_WORD_ E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in s is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.16 DINT_TO_WORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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. Format Expression in each language Function name Structured ladder DINT_TO_WORD Label X000 DINT_TO_WORD _E Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in s is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.17 INT_TO_DWORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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. Format Expression in each language Function name Structured ladder INT_TO_DWORD D0 X000 INT_TO_DWORD _E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in s is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.18 DINT_TO_DWORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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. Format Expression in each language Function name DINT_TO_DWOR D DINT_TO_DWOR D_E Structured ladder Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in s is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.19 INT_TO_BCD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function converts word [signed] data into BCD data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in s data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.20 DINT_TO_BCD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function converts double word [signed] data into BCD data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 An operation error occurs when the value stored in a device specified in "99,999,999".
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.21 INT_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 X000 INT_TO_TIME_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, word [signed] data stored in a device specified in data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.22 DINT_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 DINT_TO_TIME DINT_TO_TIME_ E Structured ladder Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, double word [signed] data stored in a device specified in the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.23 REAL_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 REAL_TO_INT Label X000 REAL_TO_INT_E Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, float (single precision) data stored in a device specified in s is converted into word [signed] data, and the data obtained by conversion is output to a device specified in d . 1) Function without EN/ENO(REAL_TO_INT) 2 REAL_TO_INT a_real Function List [Structured ladder] g_real1=5923.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.24 REAL_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 REAL_TO_DINT Label 1 X000 REAL_TO_DINT_ E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, float (single precision) data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d . 1) Function without EN/ENO(REAL_TO_DINT) 2 REAL_TO_DINT a_real Function List [Structured ladder] g_real1=65000.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.25 REAL_TO_STR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 REAL_TO_STR Structured ladder Label 1 X000 REAL_TO_STR_E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Total number of digits (12 digits) -12.3456 Float (single precision) data - Decimal part (5 digits) Exponent part (2 digits) 1 . 2 3 4 5 6 E + 0 1 3 Total number of digits (12 digits) 4 How to Read Explanation of Functions 7 Float (single precision) data - 1 . 2 3 4 5 6 7 8 E + 0 1 Number of digits of decimal part (5) These digits are rounded.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.26 WORD_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts word [unsigned]/bit string [16-bit] data into bit data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.27 DWORD_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts double word [unsigned]/bit string [32-bit] data into bit data, and outputs the data obtained by conversion. 1. Format Label X000 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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 into bit data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.28 WORD_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts word [unsigned]/bit string [16-bit] data into word [signed] data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in s is converted into word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.29 WORD_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts word [unsigned]/bit string [16-bit] data into double word [signed] data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.30 DWORD_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts double word [unsigned]/bit string [32-bit] data into word [signed] data, and outputs the data obtained by conversion. 1. Format Label X000 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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 s is converted into word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.31 DWORD_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts double word [unsigned]/bit string [32-bit] data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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 s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.32 WORD_TO_DWORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 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. Format D0 X000 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in s is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.33 DWORD_TO_WORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 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.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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 s is converted into word [unsigned]/bit string [16-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.34 WORD_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts word [unsigned]/bit string [16-bit] data into time data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in time data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.35 DWORD_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts double word [unsigned]/bit string [32-bit] data into time data, and outputs the data obtained by conversion. 1. Format Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied 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 into time data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.36 STR_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List 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_ E Label X000 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions Program example In this program, string data stored in a device specified in obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.37 STR_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts string data into word [signed] data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.38 STR_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts string data into double word [signed] data, and outputs the data obtained by conversion. 1. Format Structured ladder Label 1 X000 STR_TO_DINT_E *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 Outline 5.1.39 STR_TO_REAL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 This function converts string data into float (single precision) data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions b) In the case of exponent format Low-order byte 2DH (-) 2EH (3) 35H (5) 33H (3) 45H (E) 31H (1) High-order byte 31H (1) 33H (3) 30H (0) 34H (4) 2DH (-) 30H (0) 1st word 2nd word 3rd word 4th word 5th word 6th word 7th word String 0000H -1.35034E-10 Float (single precision) data - 1 .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.40 STR_TO_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 STR_TO_TIME Structured ladder Label 1 X000 STR_TO_TIME_E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.41 BCD_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function converts BCD data into word [signed] data, and outputs the data obtained by conversion. 1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this example, BCD data stored in a device specified in s data obtained by conversion is output to a device specified in is converted into word [signed] data, and the .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.42 BCD_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 Label 1 X000 BCD_TO_DINT_E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this example, BCD data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.43 TIME_TO_BOOL(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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_TO_BOOL_ E Label X000 Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.44 TIME_TO_INT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 Label X000 TIME_TO_INT_E Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in s data obtained by conversion is output to a device specified in is converted into word [signed] data, and the d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.45 TIME_TO_DINT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 TIME_TO_DINT TIME_TO_DINT_ E Structured ladder Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in s is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.46 TIME_TO_STR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 TIME_TO_STR Structured ladder Label 1 X000 TIME_TO_STR_E Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in s obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.47 TIME_TO_WORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 TIME_TO_WORD TIME_TO_WORD _E Label X000 Label *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in s is converted into word [unsigned]/bit string [16bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 5.1.48 TIME_TO_DWORD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 TIME_TO_DWOR D TIME_TO_DWOR D_E Structured ladder Label 1 X000 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 5 Applied Functions 5.1 Type Conversion Functions 1 In this program, time data stored in a device specified in s is converted into double word [unsigned]/bit string [32-bit] data, and the data obtained by conversion is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 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) Outline This function obtains the absolute value, and outputs it. 1. Format Expression in each language Function name Structured ladder ABS ABS D0 X000 ABS_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5.2 Standard Functions Of One Numeric Variable 1 In this program, the absolute value is obtained for word [signed] data stored in a device specified in s , and the operation result is output to a device specified in d using the data type same as the data stored in a device specified in s .
FXCPU Structured Programming Manual (Application Functions) 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) 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 X000 ADD_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 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. Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
FXCPU Structured Programming Manual (Application Functions) 5.3.2 5.3 Standard Arithmetic Functions SUB_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 X000 SUB_E *1. D0 D10 SUB_E EN ENO _IN1 *1 _IN2 ST D20 SUB_E(EN,_IN1,_IN2,Output label); Example: SUB_E(X000,D0,D10,D20); Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 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. Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
FXCPU Structured Programming Manual (Application Functions) 5.3.3 5.3 Standard Arithmetic Functions MUL_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 X000 MUL_E *1. D0 D10 MUL_E EN ENO *1 _IN _IN ST D20 MUL_E(EN,_IN,_IN,Output label); Example: MUL_E(X000,D0,D10,D20); Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 In this program, multiplication is performed using double word [signed] data stored in devices specified in s1 and s2 , and the operation result is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.3.4 5.3 Standard Arithmetic Functions DIV_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 X000 DIV_E *1. D0 D10 DIV_E EN ENO _IN1 *1 _IN2 ST D20 DIV_E(EN,_IN1,_IN2,Output label); Example: DIV_E(X000,D0,D10,D20); Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 In this program, division is performed using double word [signed] data stored in devices specified in s1 and s2 , and the operation result is output to a device specified in d using the data type of data stored in devices specified in s1 and s2 .
FXCPU Structured Programming Manual (Application Functions) 5.3.5 5.3 Standard Arithmetic Functions MOD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 MOD Label 1 Label 2 X000 MOD_E Label 1 Label 2 *1. Output variable *2.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 1) An operation error occurs when the divisor stored in a device specified in s2 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).
FXCPU Structured Programming Manual (Application Functions) 5.3.6 5.3 Standard Arithmetic Functions EXPT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function obtains raised result, and outputs it. 1. Format Expression in each language Function name Structured ladder ST EXPT EXPT EXPT_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
FXCPU Structured Programming Manual (Application Functions) 5.3.7 5.3 Standard Arithmetic Functions MOVE(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function transfers data stored in a device to another device. 1. Format Expression in each language Function name Structured ladder MOVE D0 X000 MOVE_E D0 *1.
FXCPU Structured Programming Manual (Application Functions) 5.3 Standard Arithmetic Functions 1 In this program, word [signed] data stored in a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 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) 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 ST SHL(_IN,_N); Example: D10:= SHL(D0,K1); SHL SHL D0 K1 _IN _N SHL_E EN ENO _IN *1 _N X000 SHL_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 5.4.2 5.4 Standard Bit Shift Functions SHR(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST SHR(_IN,_K); Example: D10:= SHR(D0,K1); SHR SHR D0 K1 _IN _K SHR_E EN ENO _IN *1 _N X000 SHR_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.4 Standard Bit Shift Functions 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 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) 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 X000 AND_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 1 In this program, the logical product is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in s1 and s2 , and the operation result is output to a device specified in d using the data type of data stored in devices specified in s1 and s2 .
FXCPU Structured Programming Manual (Application Functions) 5.5.2 5.5 Standard Bitwise Boolean Functions OR_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 X000 OR_E *1. M0 M10 ST OR_E(EN,_IN,_IN,Output label); Example: OR_E(X000,M0,M10,M20); OR_E EN ENO *1 _IN _IN M20 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 1 In this program, the logical sum is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in s1 and s2 , and the operation result is output to a device specified in d using the data type of data stored in devices specified in s1 and s2 .
FXCPU Structured Programming Manual (Application Functions) 5.5.3 5.5 Standard Bitwise Boolean Functions XOR_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ENO *1 _IN _IN X000 XOR_E *1. ST M0 M10 XOR_E(EN,_IN,_IN,Output label); Example: XOR_E(X000,M0,M10,M20); M20 Output variable 2. .
FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 1 s1 s2 When the number of "_IN" is 4 When the number of "_IN" is 5 FALSE TRUE FALSE TRUE XOR XOR XOR XOR TRUE TRUE Result FALSE s4 TRUE Result TRUE s5 3 TRUE After that, the exclusive logical sum is obtained the required number of Result FALSE times.
FXCPU Structured Programming Manual (Application Functions) 5.5.4 5.5 Standard Bitwise Boolean Functions NOT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function obtains the logical negation of bits, and outputs it. 1. Format Expression in each language Function name Structured ladder NOT NOT M0 X000 NOT_E M0 *1.
FXCPU Structured Programming Manual (Application Functions) 5.5 Standard Bitwise Boolean Functions 1 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 s , and the operation result is output to a device specified in d using the data type of data stored in a device specified in s .
FXCPU Structured Programming Manual (Application Functions) 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) 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 M0 D0 D10 SEL X000 SEL_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 5.6.2 5.6 Standard Selection Functions MAXIMUM(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 D10 X000 MAXIMUM_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 1 In this program, the maximum value among word [signed] data stored in devices specified in s1 and s2 is output to a device specified in d using the data type of data stored in devices specified in s1 and s2 .
FXCPU Structured Programming Manual (Application Functions) 5.6.3 5.6 Standard Selection Functions MINIMUM(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 D10 X000 MINIMUM_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 1 In this program, the minimum value among word [signed] data stored in devices specified in s1 and s2 is output to a device specified in d using the data type of data stored in devices specified in s1 and s2 .
FXCPU Structured Programming Manual (Application Functions) 5.6.4 5.6 Standard Selection Functions LIMITATION(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 D0 D10 D20 LIMITATION X000 LIMITATION_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 1 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. 2 An operation error occurs when this function is executed in the following setting status.
FXCPU Structured Programming Manual (Application Functions) 5.6.5 5.6 Standard Selection Functions MUX(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function selects data, and outputs the selected data. 1. Format Expression in each language Function name Structured ladder ST MUX(_K,_IN,_IN); Example: D30:= MUX(D0,D10,D20); MUX D0 D10 D20 MUX X000 MUX_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.6 Standard Selection Functions 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 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) Outline This function compares data with regard to "> (larger)". 1. Format Expression in each language Function name Structured ladder X000 GT_E *1. D0 D10 EN _IN _IN GT_E ENO *1 ST GT_E(EN,_IN,_IN,Output label); Example: GT_E(X000,D0,D10,M0); M0 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 1 In this program, the contents of devices specified in s1 and s2 are compared, and the operation result is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.7.2 5.7 Standard Comparison Functions GE_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function compares data with regard to "≥ (larger or equal)". 1. Format Expression in each language Function name Structured ladder X000 GE_E *1. D0 D10 EN _IN _IN GE_E ENO *1 ST GE_E(EN,_IN,_IN,Output label); Example: GE_E(X000,D0,D10,M0); M0 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 1 EQ_E Outline 5.7.3 5.7 Standard Comparison Functions FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function compares data with regard to "= (equal)". 1. Format Expression in each language Function name Structured ladder EQ_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.7.4 5.7 Standard Comparison Functions LE_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function compares data with regard to "≤ (smaller or equal)". 1. Format Expression in each language Function name Structured ladder X000 LE_E *1. D0 D10 EN _IN _IN LE_E ENO *1 ST LE_E(EN,_IN,_IN,Output label); Example: LE_E(X000,D0,D10,M0); M0 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions 1 In this program, the contents of devices specified in s1 and s2 are compared, and the operation result is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.7.5 5.7 Standard Comparison Functions LT_E FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function compares data with regard to "< (smaller)". 1. Format Expression in each language Function name Structured ladder X000 LT_E *1. D0 D10 EN _IN _IN LT_E ENO *1 ST LT_E(EN,_IN,_IN,Output label); Example: LT_E(X000,D0,D10,M0); M0 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 1 NE_E Outline 5.7.6 5.7 Standard Comparison Functions FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function compares data with regard to "≠ (unequal)". 1. Format Expression in each language Function name Structured ladder NE_E M0 4 Output variable 2.
FXCPU Structured Programming Manual (Application Functions) 5.7 Standard Comparison Functions Program example In this program, the contents of devices specified in s1 and s2 are compared, and the operation result is output to a device specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions Standard Character String Functions 5.8.1 MID(_E) FX3U(C) FX3G FX2N(C) Outline 5.8 1 FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Function List Outline This function obtains a character string from a specified position. 3 Function Construction 1.
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 s , and outputs the obtained data to devices specified in d . The value specified in n1 specifies the number of characters to be extracted. The value specified in n2 specifies the head character position of characters to be extracted.
FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 1 In this program, specified number of characters are extracted from an arbitrary position of a character string stored in devices specified in s , and the obtained data is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.8.2 5.8 Standard Character String Functions CONCAT(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N Outline This function connects character strings. 1. Format Expression in each language Function name Structured ladder ST CONCAT CONCAT Label 1 Label 2 X000 CONCAT_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.
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 s2 is connected after a character string stored in devices specified in s1 , and the character string obtained by connection is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 1 INSERT(_E) Outline 5.8.3 5.8 Standard Character String Functions FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function inserts a character string. 1. Format Expression in each language Function name Structured ladder *1.
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 s2 into an arbitrary position (counted from the head) of a character string stored in devices specified in s1 , and outputs the character string obtained by insertion to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 1 In this program, a character string stored in devices specified in s2 is inserted into an arbitrary position (counted from the head) of a character string stored in devices specified in s1 , and the character string obtained by insertion is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.8.4 5.8 Standard Character String Functions DELETE(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function deletes a character string. 1. Format Expression in each language Function name Structured ladder ST DELETE DELETE Label 1 D10 D20 _IN _L _P X000 DELETE_E EN ENO _IN *1 _L _P DELETE_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 1 Outline 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. Use labels when handling character string data. Use global labels when specifying labels. 2 An operation error occurs in the following cases.
FXCPU Structured Programming Manual (Application Functions) 5.8.5 5.8 Standard Character String Functions REPLACE(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function replaces a character string. 1. Format Expression in each language Function name Structured ladder Label 1 Label 2 D20 D30 REPLACE X000 Label 1 Label 2 D20 D30 REPLACE_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.
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.
FXCPU Structured Programming Manual (Application Functions) 1 FIND(_E) Outline 5.8.6 5.8 Standard Character String Functions FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function searches a character string. 1. Format Expression in each language Function name Structured ladder Label 1 Label 2 X000 *1.
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 s2 from the beginning of a character string stored in devices specified in s1 , and outputs the search result to devices specified in d . This function outputs the head character position of the searched character string detected first as the search result.
FXCPU Structured Programming Manual (Application Functions) 5.8 Standard Character String Functions 1 In this program, a character string stored in devices specified in s2 is searched from the beginning of a character string stored in devices specified in s1 , and the search result is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 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) Outline This function adds time data. 1. Format Expression in each language Function name Structured ladder ADD_TIME Label 1 Label 2 X000 ADD_TIME_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 5.9.2 5.9 Functions Of Time Data Types SUB_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function performs subtraction of time data. 1. Format Expression in each language Function name Structured ladder SUB_TIME Label 1 Label 2 X000 SUB_TIME_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 1 1) Use the function having "_E" in its name to connect a bus. Outline Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 5.9.3 5.9 Functions Of Time Data Types MUL_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function performs multiplication of time data. 1. Format Expression in each language Function name Structured ladder MUL_TIME Label 1 Label 2 X000 MUL_TIME_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 1 In this program, multiplication ( s1 × s2 ) is performed using time data stored in devices specified in s1 and s2 , and the operation result expressed as time data is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 5.9.4 5.9 Functions Of Time Data Types DIV_TIME(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) Outline This function performs division using time data. 1. Format Expression in each language Function name Structured ladder DIV_TIME Label 1 Label 2 X000 DIV_TIME_E *1.
FXCPU Structured Programming Manual (Application Functions) 5.9 Functions Of Time Data Types 1 In this program, division ( s1 / s2 ) is performed using time data stored in devices specified in s1 and s2 , and the operation result expressed as time data is output to devices specified in d .
FXCPU Structured Programming Manual (Application Functions) 6. 6 Standard Function Blocks 6.1 R_TRIG(_E) Standard Function Blocks 6.1 R_TRIG(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST M10 R_TRIG(_CLK); *1 Example: Instance name(_CLK:=M0); M10:=Instance name.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.1 R_TRIG(_E) 1 In this program, a device specified in d turns ON when the bit data stored in a device specified in turns ON from OFF, and the device specified in d remains ON only for 1 operation cycle. s 1) Function without EN/ENO(R_TRIG) 2 [Structured ladder] Function List R_TRIG_Instance R_TRIG _CLK g_bool1 Q g_bool2 [ST] 3 R_TRIG_Instance(_CLK:=g_bool1);g_bool2:=R_TRIG_Instance.
FXCPU Structured Programming Manual (Application Functions) 6.2 6 Standard Function Blocks 6.2 F_TRIG(_E) F_TRIG(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST M10 F_TRIG(_CLK); *1 Example: Instance name(_CLK:=M0); M10:=Instance name.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.2 F_TRIG(_E) 1 In this program, a device specified in d turns ON when the bit data stored in a device specified in turns OFF from ON, and the device specified in d remains ON only for 1 operation cycle. s 1) Function without EN/ENO(F_TRIG) 2 [Structured ladder] Function List F_TRIG_Instance F_TRIG _CLK g_bool1 Q g_bool2 [ST] 3 F_TRIG_Instance(_CLK:=g_bool1);g_bool2:=F_TRIG_Instance.
FXCPU Structured Programming Manual (Application Functions) 6.3 6 Standard Function Blocks 6.3 CTU(_E) CTU(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST CTU(CU,RESET,PV); *1 Example: Instance name(CU:=M0, RESET=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.3 CTU(_E) 1 In this program, the number of times the bit data stored in a device specified in s1 turns ON from OFF is counted, and the count value is output to a device specified in d2 .
FXCPU Structured Programming Manual (Application Functions) 6.4 6 Standard Function Blocks 6.4 CTD(_E) CTD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST CTD(CD,LOAD,PV); *1 Example: Instance name(CD:=M0, LOAD=M10, PV=D0); M20:=Instance name.Q; D10:=Instance name.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.4 CTD(_E) 1 In this program, the number of times the bit data stored in a device specified in s1 turns ON from OFF is counted, and a device specified in d1 turns ON when the value stored in a device specified in d2 becomes "0".
FXCPU Structured Programming Manual (Application Functions) 6.5 6 Standard Function Blocks 6.5 CTUD(_E) CTUD(_E) FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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 ST 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.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.5 CTUD(_E) 1 2 Cautions Function List 1) Use the function having "_E" in its name to connect a bus. 2) Expression of function blocks in each language *1. Outline This function block resets the count value of a device specified in d3 when a device specified in s3 turns ON. This function block sets the value stored in n to a device specified in d3 when a device specified in s4 turns ON.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.5 CTUD(_E) Program example In this program, the number of times the bit data stored in a device specified in s1 turns ON from OFF is counted up (added by "1"). When the value stored in a device specified in d3 reaches the value specified in n , a device specified in d1 turns ON. At the same time, the number of times the bit data stored in a device specified in s2 turns ON from OFF is counted down (subtracted by "1").
FXCPU Structured Programming Manual (Application Functions) 6.6 TP(_E) 1 TP(_E) Outline 6.6 6 Standard Function Blocks FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function block keeps ON a signal for specified duration. 1. Format Expression in each language Function name Structured ladder TP M0 Label 1 IN PT Q ET M10 Label 2 Instance name M0 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.6 TP(_E) Program example In this program, when bit data stored in a device specified in specified in d1 turns ON and remains ON for 10 seconds. 1) Function without EN/ENO(TP) [Structured ladder] TP_Instance TP g_bool1 IN PT T#10s Q ET g_bool2 g_time1 [ST] TP_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TP_Instance.Q; g_time1:=TP_Instance.
FXCPU Structured Programming Manual (Application Functions) 6.7 TON(_E) 1 TON(_E) Outline 6.7 6 Standard Function Blocks FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List Outline This function block turns ON after specified time. 1. Format Expression in each language Function name Structured ladder TON M0 Label 1 IN PT Q ET M10 Label 2 Instance name M0 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.7 TON(_E) Program example In this program, when bit data stored in a device specified in specified in d1 turns ON 10 seconds later. 1) Function without EN/ENO(TON) [Structured ladder] TON_Instance TON g_bool1 IN PT T#10s Q ET g_bool2 g_time1 [ST] TON_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TON_Instance.Q; g_time1:=TON_Instance.
FXCPU Structured Programming Manual (Application Functions) 6.8 TOF(_E) 1 TOF(_E) Outline 6.8 6 Standard Function Blocks FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 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 IN PT Q ET M10 Label 2 Instance name M0 Label 1 *1.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.8 TOF(_E) Program example In this program, when bit data stored in a device specified in s turns ON, bit data stored in a device specified in d1 turns ON. When bit data stored in a device specified in s turns OFF, bit data stored in a device specified in d1 turns OFF 10 seconds later.
FXCPU Structured Programming Manual (Application Functions) 6.9 COUNTER_FB_M 1 COUNTER_FB_M Outline 6.9 6 Standard Function Blocks FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 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. 1.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.9 COUNTER_FB_M Cautions 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.
FXCPU Structured Programming Manual (Application Functions) 6.10 TIMER_10_FB_M 1 TIMER_10_FB_M Outline 6.10 6 Standard Function Blocks FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S) 2 Function List 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.
FXCPU Structured Programming Manual (Application Functions) 6.11 6 Standard Function Blocks 6.11 TIMER_CONT_FB_M TIMER_CONT_FB_M FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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. Format Function name ST Instance name TIMER_CONT_FB_M Coil ValueOut Preset Status ValueIn TIMER_ CONT_FB_M *1.
FXCPU Structured Programming Manual (Application Functions) 6 Standard Function Blocks 6.11 TIMER_CONT_FB_M 1 Outline Cautions 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 Function List 2) For the function block, the automatic allocation device needs to be set as the timer numbers are allocated automatically.
FXCPU Structured Programming Manual (Application Functions) 6.12 6 Standard Function Blocks 6.12 TIMER_100_FB_M TIMER_100_FB_M FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(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. Format Function name TIMER_100_FB_M *1.
FXCPU Structured Programming Manual (Application Functions) Appendix A: Correspondence between Devices and 1 Outline Appendix A: Correspondence between Devices and Addresses 2 Example of correspondence between device and address Notation Device Device Address Device Address X Xn %IXn X367 %IX247 Output relay Y Yn %QXn Y367 %QX247 Timer 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 TN190 T190 %MW3.
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.
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 FX0,FX0S and FX0N PLCs. CTD(_E), CTU(_E), CTUD(_E), TOF(_E), TON(_E), TP(_E) • Function blocks (SR(_E), RS(_E)) are deleted.
FXCPU Structured Programming Manual (Application Functions) Revision History MEMO 232
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.