

Structured Programming Manual [Application Functions]



(Application Functions)
This manual contains text, diagrams and explanations which will guide the reader through the safe and correct installation, use, and operation of the FX Series function for structured programs. It should be read and understood before attempting to install or use the unit. Store this manual in a safe place so that you can take it out and read it whenever necessary. Always forward it to the end user.
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.

a) Any engineer who is responsible for the planning, design and construction of automatic equipment
using the product associated with this manual should be of a competent nature, trained and qualified to the local and national standards required to fulfill that role. These engineers should be fully aware of all aspects of safety with regards to automated equipment. b) Any commissioning or service engineer must be of a competent nature, trained and qualified to the
local and national standards required to fulfill that job. These engineers should also be trained in the use and maintenance of the completed product. This includes being completely familiar with all associated documentation for the said product. All maintenance should be carried out in accordance with established safety practices. c) All operators of the completed equipment should be trained to use that product in a safe and
coordinated manner in compliance to established safety practices. The operators should also be familiar with documentation which is connected with the actual operation of the completed equipment. Note: the term 'completed equipment' refers to a third party constructed device which contains or uses


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.
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/FX
FX
This manual explains devices and parameters for structured programs provided by GX Works2.
FX
This manual explains sequence instructions for structured programs provided by GX Works2.
FX
This manual explains application functions for structured programs provided by GX Works2.
FX 3U FX 3UC FX 3G
This manual explains details of analog special function blocks and analog special adapters for FX3U/FX3UC/FX3G PLCs and PID instruction. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
This manual explains details of simple N:N link, parallel link, computer link, no-protocol communication (RS and RS2 instructions), programming communication and inverter communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
FX 3G /FX 3U /FX 3UC Series User's Manual -Positioning Edition
FX 3U FX 3UC FX 3G
This manual explains details of wiring, instructions and operations of the positioning function built in FX3U/FX3UC/FX3G PLC main units. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
(Manual supplied with product or additional Manual ) *1
This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
*1. Detailed explanation may be provided by a separate manual in some products.

(Additional Manual) QCPU/FXCPU Structured Programming Manual (Fundamentals)
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/FX
FX
This manual explains devices and parameters for structured programs provided by GX Works2.
FX
This manual explains sequence instructions for structured programs provided by GX Works2.
FX
This manual explains application functions for structured programs provided by GX Works2.
FX
This manual explains details of simple N:N link, parallel link, computer link, no-protocol communication (RS instruction), programming communication and inverter communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.
(Manual supplied with product or additional Manual ) *1
This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.

(Additional Manual) QCPU/FXCPU Structured Programming Manual (Fundamentals)
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/FX
FX
This manual explains devices and parameters for structured programs provided by GX Works2.
FX
This manual explains sequence instructions for structured programs provided by GX Works2.
FX
This manual explains application functions for structured programs provided by GX Works2.
FX
This manual explains details of parallel link, computer link, no-protocol communication (RS instruction) and programming communication for FX PLCs. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.
(Manual supplied with product or additional Manual ) *1
This manual explains details of each special unit/block. Explanation of instructions and instructions used in program examples are expressed for GX Developer and FX-PCS/WIN.
*1. Detailed explanation may be provided by a separate manual in some products.

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

Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
Detaileds about the analog special function block (FX3U-4AD, FX3U-4DA, FX3UC-4AD) and analog special adapter (FX3U-****-ADP).
FX3G/FX3U/FX3UC User's Manual- Analog Control Edition JY997D16701 Additional Manual
Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).
FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual
FX3G/FX3U/FX3UC Series User's Manual -Positioning Edition JY997D16801 Additional Manual Details about the positioning function built in the FX3G/FX3U/FX3UC Series. 09R620
FX3U-CF-ADP User's Manual JY997D35401 Additional Manual Describes details of the FX3U-CF-ADP CF card special adapter. 09R720
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1S PLC main unit.
FX1S HARDWARE MANUAL JY992D83901 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1N PLC main unit.
FX1N HARDWARE MANUAL JY992D89301 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX2N PLC main unit.
FX2N HARDWARE MANUAL JY992D66301 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1NC PLC main unit. (Japanese only)
FX1NC HARDWARE MANUAL JY992D92101 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX2NC PLC main unit.
FX2NC HARDWARE MANUAL JY992D76401 Additional Manual
Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).
FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual
Programming · PLC main unit · Programming

FX0/FX0S/FX0N/FXU/FX2C PLCs [whose production is finished]
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0/FX0N PLC main unit.
FX0/FX0N HARDWARE MANUAL JY992D47501 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0S PLC main unit.
FX0S HARDWARE MANUAL JY992D55301 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FXU/FX2C PLC main unit.
FX/FX2C HARDWARE MANUAL JY992D47401 Supplied with product
Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).
FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual
Manuals of models whose production is finished
Production is finished for FX0/FX0S/FX0N/FXU/FX2C PLCs.
PLC main unit · Programming

FX3U Series or FX3U PLC Generic name of FX3U Series PLCs
FX3UC Series or FX3UC PLC Generic name of FX3UC Series PLCs
FX3G Series or FX3G PLC Generic name of FX3G Series PLCs
FX2N Series or FX2N PLC Generic name of FX2N Series PLCs
FX2NC Series or FX2NC PLC Generic name of FX2NC Series PLCs
FX1N Series or FX1N PLC Generic name of FX1N Series PLCs
FX1NC Series or FX1NC PLC Generic name of FX1NC Series PLCs These products can only used in Japan.
FX1S Series or FX1S PLC Generic name of FX1S Series PLCs
FXU Series or FXU PLC Generic name of FXU(FX,FX2) Series PLCs
FX2C Series or FX2C PLC Generic name of FX2C Series PLCs
FX0N Series or FX0N PLC Generic name of FX0N Series PLCs
FX0S Series or FX0S PLC Generic name of FX0S Series PLCs
FX0 Series or FX0 PLC Generic name of FX0 Series PLCs
CF card special adapter Generic name of CF card special adapters
ST Abbreviation of structured text language
Structured ladder Abbreviation of ladder diagram language
Q/FX Structured Programming Manual (Fundamentals) Abbreviation of QCPU/FXCPU Structured Programming Manual (Fundamentals)
FX Structured Programming Manual (Device & Common) Abbreviation of FXCPU Structured Programming Manual (Device & Common)
FX Structured Programming Manual (Basic & Applied Instruction) Abbreviation of FXCPU Structured Programming Manual (Basic & Applied Instruction)
FX Structured Programming Manual (Application Functions) Abbreviation of FXCPU Structured Programming Manual (Application Functions)
COMMUNICATION CONTROL EDITION Abbreviation of FX Series User's Manual-DATA COMMUNICATION CONTROL EDITION
ANALOG CONTROL EDITION Abbreviation of FX3G/FX3U/FX3UC Series User's Manual-ANALOG CONTROL EDITION
POSITIONING CONTROL EDITION Abbreviation of FX3G/FX3U/FX3UC Series User's Manual-POSITIONING CONTROL EDITION

1.1 Outline of Structured Programs and Programming
This manual explains applied functions for structured programs provided by GX Works2. Refer to a different manual for devices, parameters and sequence instructions. Refer to the following manual for labels, data types and programming languages for structured programs:
→ Q/FX Structured Programming Manual (Fundamentals)
You can construct two or more programs (program blocks) into one program. Because you can divide the entire machine processing into small sub processes and create a program for each sub process, you can efficiently create a program for a large system.

1.2 PLC Series and Programming Software Version
The following programming languages can be used in each program block.
Y000
MOV EN ENO s d D0 D2
When X001 is ON, the contents of D0 are transferred to D2.
Y000:=(X000 OR Y000) AND NOT X001; IF X001 THEN D2:=D0; (When X001 is ON, the contents of D0 are transferred to D2.) END_IF; IF X002 THEN D4:=D4+1; (When X002 is ON, the contents of D4 are added by "1".) ELSE D6:=D6+1; (When X002 is OFF, the contents of D6 are added by "1".) END_IF;

Output Y000

1.3 Cautions on Creation of Fundamental Programs
This section explains cautions on programming. Refer to the following manual for cautions on structured programs and programming languages:
→ Q/FX Structured Programming Manual (Fundamentals) Refer to the following programming manual for detailed operations of and cautions on devices and parameters:
→ FX Structured Programming Manual (Device & Common)

The ON/OFF status of input terminals is received at one time.
Input image is read, and operation is executed according to program.
[Program processing] Image memory of each device is updated.
Acquiring the latest I/O information For acquiring the latest input information or immediately outputting the operation result in the middle of the operation cycle shown above, the I/O refresh instruction (REF) is available.
Output devices are driven. Batch I/O method (Refresh method)
[Output processing] Result is transferred to output latch memory.
2. Short pulses cannot be received. The ON duration and OFF duration of inputs in PLCs require longer time than "PLC cycle time + Input filter response delay". When the response delay "10 ms" of the input filter is considered and the cycle time is supposed as "10 ms", the ON duration and OFF duration should be at least 20 ms respectively. Accordingly, PLCs cannot handle input pulses at 25 Hz (= 1000 /(20 + 20)) or more. However, the situation can be improved by PLC special functions and applied instructions.
Convenient functions for improvement By using the following functions, PLCs can receive pulses shorter than the operation cycle:


1.3 Cautions on Creation of Fundamental Programs
This subsection explains the double output (double coil) operation and countermeasures.
Suppose that the same coil Y003 is used in two positions as shown in the right figure. For example, suppose that X001 is ON and X002 is OFF.
Input processing X001=ON X002=OFF
In the first coil Y003, the image memory is set to ON and the output Y004 is also set to ON because the input X001 is ON.
In the second coil Y003, however, the image memory is set to OFF because the input X002 is OFF.
Y004
As a result, the actual output to the outside is "Y003: OFF, Y004: ON".
Output processing Y003=OFF Y004=ON
Y000
A B
Y000
C E
C E
Y000
A B
M100
C E
M101
Y000
M100
M101
The SET and RST instructions or jump instruction can be used instead, or a same output coil can be programmed at each state using step ladder instructions STL and RET. When you use the step ladder instructions STL and RET, note that the PLC regards it as double coils if you program, inside the state, an output coil located outside the RET instruction from another program block or the STL instruction.

1.3 Cautions on Creation of Fundamental Programs


The following flags are valid in general sequence instructions: (Examples) M8020:Zero flag M8021:Borrow flag M8022:Carry flag M8029:Instruction execution complete flag M8090:Block comparison signal*1
M8328:Instruction non-execution flag*1 M8329:Instruction execution abnormal complete flag*2
M8304:Zero flag*1 M8306:Carry flag*1
*1. Supported only in FX3U/FX3UC PLCs.
*2. Supported only in FX3U/FX3UC/FX3G PLCs.
Each of these flags turns ON or OFF every time the PLC executes a corresponding instruction. These flags do not turn ON or OFF when the PLC does not execute a corresponding instruction or when an error occurs. Because these flags are related to many sequence instructions, their ON/OFF status changes every time the PLC executes each corresponding instruction. Refer to examples in the next page, and program a flag contact just under the target sequence instruction.

1.3 Cautions on Creation of Fundamental Programs
1. Program containing many flags (Example of instruction execution complete flag M8029) If you program the instruction execution complete flag M8029 twice or more together for two or more sequence instructions which actuate the flag M8029, you cannot judge easily by which sequence instruction the flag M8029 is controlled. In addition, the flag M8029 does not turn ON or OFF correctly for each corresponding sequence instruction. Refer to the next page when you would like to use the flag M8029 in any position other than the position just under the corresponding sequence instruction.
ENO
d1 Y010 s2 d2
M8029 works as a flag to indicate that execution of DSW is completed.
Execution is completed.
Number of output pulses
M0
ENO
1000 Y000
M8029 works as a flag to indicate that execution of DPLSY is completed.
Number of output pulses
M0
R
Execution is completed.
M0
M8029 works as a flag to indicate that execution of DPLSY (on the lower side) is completed. M8000
Program for DPLSY (on the upper side)
Execution is completed.
d1 Y010 s2 d2 D0
M8029 works as a flag to indicate that execution of DSW is completed.
M0
DPLSY(on the upper side)
1000 Y000
M8029 works as a flag to indicate that execution of DPLSY (on the upper side) is completed.
Number of output pulses
ENO
Execution is completed.
Number of output pulses
DPLSY(on the lower side)
1000 Y001
Number of output pulses2

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

DSW execution complete flag M8029 is changed to M100.
DPLSY execution complete flag M8029 is changed to M200.

1.3 Cautions on Creation of Fundamental Programs
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.
Device which stores error occurrence step
Error flag Device which stores
FX0/FX0S/FX0N/FXU/FX2C/FX1S /FX1N/FX2N/FX1NC/FX2NC/FX3G FX3U/FX3UC
*1. When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the error occurrence step also in D8069 (16 bits).
Device which stores error occurrence step
Error flag Device which stores
FX0/FX0S/FX0N/FXU/FX2C/FX1S /FX1N/FX2N/FX1NC/FX2NC/FX3G FX3U/FX3UC
*2. When an error occurs in a step up to the step No. 32767 in the FX3U/FX3UC PLC, you can check the error occurrence step also in D8068 (16 bits).
error code · error code

This chapter introduces a list of functions available in programming.
FX 3U(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3G
FX 1S
FX 0N
BOOL_TO_INT(_E) Converts bit data into word [signed] data. 3 Subsection 5.1.1
BOOL_TO_DINT(_E) Converts bit data into double word [signed] data. 3 Subsection 5.1.2
BOOL_TO_STR(_E) Converts bit data into string data. 3 Subsection 5.1.3
BOOL_TO_WORD(_E) Converts bit data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.4
Converts bit data into double word [unsigned]/bit string [32-bit] data. 3 Subsection 5.1.5
BOOL_TO_TIME(_E) Converts bit data into time data. 3 Subsection 5.1.6
INT_TO_DINT(_E) Converts word [signed] data into double word [signed] data 3 Subsection 5.1.7
DINT_TO_INT(_E) Converts double word [signed] data into word [signed] data. 3 Subsection 5.1.8
INT_TO_BOOL(_E) Converts word [signed] data into bit data. 3 Subsection 5.1.9
DINT_TO_BOOL(_E) Converts double word [signed] data into bit data. 3 Subsection 5.1.10
INT_TO_REAL(_E) Converts word [signed] data into float (single precision) data. 3 *1 3 Subsection 5.1.11
DINT_TO_REAL(_E) Converts double word [signed] data into float (single precision) data. 3 *1 3 Subsection 5.1.12
INT_TO_STR(_E) Converts word [signed] data into string data. 3 Subsection 5.1.13
DINT_TO_STR(_E) Converts double word [signed] data into string data. 3 Subsection 5.1.14
INT_TO_WORD(_E) Converts word [signed] data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.15
DINT_TO_WORD(_E) Converts double word [signed] data into word [unsigned]/bit string [16-bit] data. 3 Subsection 5.1.16
INT_TO_DWORD(_E) Converts word [signed] data into double word [unsigned]/bit string [32-bit] data. 3 Subsection 5.1.17
Converts double word [signed] data into double word [unsigned]/bit string[32-bit] data. 3 Subsection 5.1.18
INT_TO_BCD(_E) Converts word [signed] data into BCD data. 3 Subsection 5.1.19
DINT_TO_BCD(_E) Converts double word [signed] data into BCD data. 3 Subsection 5.1.20
INT_TO_TIME(_E) Converts word [signed] data into time data. 3 Subsection 5.1.21
DINT_TO_TIME(_E) Converts double word [signed] data into time data. 3 Subsection 5.1.22
*1. The function is provided in the FX3G Series Ver.1.10 or later.
Applicable PLC · Function name Function · Reference

FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
REAL_TO_INT(_E) Converts float (single precision) data into word [signed] data. 3 *1 3 Subsection 5.1.23
REAL_TO_DINT(_E) Converts float (single precision) data into double word [signed] data. 3 *1 3 Subsection 5.1.24
REAL_TO_STR(_E) Converts float (single precision) data into string data. 3 Subsection 5.1.25
WORD_TO_BOOL(_E) Converts word [unsigned]/bit string [16-bit] data into bit data. 3 Subsection 5.1.26
Converts double word [unsigned]/bit string [32- bit] data into bit data. 3 Subsection 5.1.27
WORD_TO_INT(_E) Converts word [unsigned]/bit string [16-bit] data into word [signed] data. 3 Subsection 5.1.28
WORD_TO_DINT(_E) Converts word [unsigned]/bit string [16-bit] data into double word [signed] data. 3 Subsection 5.1.29
DWORD_TO_INT(_E) Converts double word [unsigned]/bit string [32- bit] data into word [signed] data. 3 Subsection 5.1.30
Converts double word [unsigned]/bit string [32- bit] data into double word [signed] data. 3 Subsection 5.1.31
Converts word [unsigned]/bit string [16-bit] data into double word [unsigned]/bit string [32-bit]. 3 Subsection 5.1.32
Converts double word [unsigned]/bit string [32- bit] data into word [unsigned]/bit string [16- bit]data.
3 Subsection 5.1.33
WORD_TO_TIME(_E) Converts word [unsigned]/bit string [16-bit] data into time data. 3 Subsection 5.1.34
Converts double word [unsigned]/bit string [32- bit] data into time data. 3 Subsection 5.1.35
STR_TO_BOOL(_E) Converts string data into bit data. 3 Subsection 5.1.36
STR_TO_INT(_E) Converts string data into word [signed] data. 3 Subsection 5.1.37
STR_TO_DINT(_E) Converts string data into double word [signed] data. 3 Subsection 5.1.38
STR_TO_REAL(_E) Converts string data into float (single precision) data. 3 Subsection 5.1.39
STR_TO_TIME(_E) Converts string data into time data. 3 Subsection 5.1.40
BCD_TO_INT(_E) Converts BCD data into word [signed] data. 3 Subsection 5.1.41
BCD_TO_DINT(_E) Converts BCD data into double word [signed] data. 3 Subsection 5.1.42
TIME_TO_BOOL(_E) Converts time data into bit data. 3 Subsection 5.1.43
TIME_TO_INT(_E) Converts time data into word [signed] data. 3 Subsection 5.1.44
TIME_TO_DINT(_E) Converts time data into double word [signed] data. 3 Subsection 5.1.45
TIME_TO_STR(_E) Converts time data into string data. 3 Subsection 5.1.46
TIME_TO_WORD(_E) Converts time data into word [unsigned]/bit string [16-bit]data. 3 Subsection 5.1.47
Converts time data into double word [unsigned]/ bit string [32-bit] data. 3 Subsection 5.1.48
*1. The function is provided in the FX3G Series Ver.1.10 or later.
Applicable PLC · Function name Function · Reference

2.2 Standard Functions Of One Numeric Variable
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
ABS(_E) Obtains the absolute value. 3 Subsection 5.2.1
FX 3U(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3G
FX 1S
FX 0N
ADD_E Adds data. 3 Subsection 5.3.1
SUB_E Subtracts data. 3 Subsection 5.3.2
MUL_E Multiplies data. 3 Subsection 5.3.3
DIV_E Divides data (, and outputs the quotient). 3 Subsection 5.3.4
MOD(_E) Divides data (, and outputs the remainder). 3 Subsection 5.3.5
EXPT(_E) Obtains the raised result. 3 Subsection 5.3.6
MOVE(_E) Transfers data. 3 Subsection 5.3.7

2.4 Standard Bit Shift Functions
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
SHL(_E) Shifts bits leftward. 3 Subsection 5.4.1
SHR(_E) Shifts bits rightward. 3 Subsection 5.4.2
FX 3U(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3G
FX 1S
FX 0N
AND_E Obtains the logical product. 3 Subsection 5.5.1
OR_E Obtains the logical sum. 3 Subsection 5.5.2
XOR_E Obtains the exclusive logical sum. 3 Subsection 5.5.3
NOT(_E) Obtains the logical not. 3 Subsection 5.5.4
FX 3U(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3G
FX 1S
FX 0N
SEL(_E) Selects data in accordance with the input condition. 3 Subsection 5.6.1
MAXIMUM(_E) Searches the maximum value. 3 Subsection 5.6.2
MINIMUM(_E) Searches the minimum value. 3 Subsection 5.6.3
Judges whether data is located within the range between the upper limit value and the lower limit value.
3 Subsection 5.6.4
MUX(_E) Selects data, and outputs it. 3 Subsection 5.6.5

2.7 Standard Comparison Functions
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
GT_E Compares data with regard to "> (larger)". 3 Subsection 5.7.1
GE_E Compares data with regard to "≥ (larger or equal)". 3 Subsection 5.7.2
EQ_E Compares data with regard to "= (equal)". 3 Subsection 5.7.3
LE_E Compares data with regard to "≤ (smaller or equal)". 3 Subsection 5.7.4
LT_E Compares data with regard to "< (smaller)". 3 Subsection 5.7.5
NE_E Compares data with regard to "≠ (unequal)". 3 Subsection 5.7.6
FX 3U(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3G
FX 1S
FX 0N
MID(_E) Obtains a character string from a specified position. 3 Subsection 5.8.1
CONCAT(_E) Connects character strings. 3 Subsection 5.8.2
INSERT(_E) Inserts a character string. 3 Subsection 5.8.3
DELETE(_E) Deletes a character string. 3 Subsection 5.8.4
REPLACE(_E) Replaces a character string. 3 Subsection 5.8.5
FIND(_E) Searches a character string. 3 Subsection 5.8.6
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
ADD_TIME(_E) Adds time data. 3 Subsection 5.9.1
SUB_TIME(_E) Subtracts time data. 3 Subsection 5.9.2
MUL_TIME(_E) Multiplies time data. 3 Subsection 5.9.3
DIV_TIME(_E) Divides time data. 3 Subsection 5.9.4

FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3G
FX 1S
FX 0N
FX 0(S)
R_TRIG(_E) Detects the rising edge of a signal, and outputs pulse signal. 3 Section 6.1
F_TRIG(_E) Detects the falling edge of a signal, and outputs pulse signal. 3 Section 6.2
CTU(_E) Counts up the number of times of rising of a signal. 3 Section 6.3
CTD(_E) Counts down the number of times of rising of a signal. 3 Section 6.4
CTUD(_E) Counts up/down the number of times of rising of a signal. 3 Section 6.5
TP(_E) Keeps ON a signal during specified time duration. 3 Section 6.6
TON(_E) Keeps OFF a signal during specified time duration. 3 Section 6.7
TOF(_E) Turns OFF the output signal at specified time after the input signal turned OFF. 3 Section 6.8
COUNTER_FB_M Counter drive 3 Section 6.9
TIMER_10_FB_M 10ms timer drive 3 Section 6.10
TIMER_CONT_FB_M Retentive timer drive 3 Section 6.11
TIMER_100_M 100ms timer drive 3 Section 6.12
Applicable PLC · Function name Function · Reference

3.1 Applied Function Expression and Execution Type
This chapter explains the construction of applied functions.
*1 D10 D0 _IN _N K1
_IN ( ) : An argument whose contents do not change even if the function is executed is called
"source", and expressed in this symbol. *1 ( ) : An argument whose contents change when the function is executed is called "destination",
and expressed in this symbol. K1 ( ) : Arguments not regarded as source or destination are expressed in "m", "n", etc.
→ FX Structured Programming Manual (Device & Common)
n

3.2 Labels
Labels are classified into two types, global and local.
The label class indicates how each label can be used from which program component. The table below shows label classes.
VAR_GLOBAL Common label available in all program components 3 3
VAR_GLOBAL_CONSTANT Common constant available in all program components 3 3
VAR Label available within declared program components, and not available in any other program component 3 3 3
VAR_CONSTANT Constant available within declared program components, and not available in any other program component 3 3 3
VAR_INPUT Label which receives a value, and cannot be changed in program components 3 3
VAR_OUTPUT Label output from a function block 3
VAR_IN_OUT Local label which receives a value, outputs it from a program component, and can be changed in program components 3
It is necessary to define a label to use the label. An error will occur when a program in which labels are not defined is converted (compiled).
In the example below, the label "VAR_D10" is set for the function "BOOL_TO_STR_E".
_BOOL M0
VAR_D10



3.2 Labels
The table below the description method required to set a constant to a label.
Constant type Description method Example
Bit Input "TRUE" or "FALSE". Or input "0" or "1". TRUE, FALSE
Binary number Add "2#" before a binary number. 2#0010, 2#01101010
Octal number Add "8#" before an octal number. 8#0, 8#337
Decimal number Input a decimal number directly. Or add "K" before a decimal number. 123, K123
Hexadecimal number Add "16#" or "H" before a hexadecimal number. 16#FF, HFF
Real number Input a real number directly. Or add "E" before a real number. 2.34, E2.34
Character string Surround a character string with single quotations (') or double quotations ("). 'ABC', "ABC"
The label data type is basic or universal.
Data type Description Value range Bit length
Bit Boolean data 0(FALSE), 1(TRUE) 1 bit
Word [signed] Integer -32768 to 32767 16 bits
Double Word [signed] Double precision integer -2147483648 to 2147483647 32 bits
Word [unsigned]/Bit String [16-bit] 16-bit data 0 to 65535 16 bits
Double Word [unsigned]/Bit String [32-bit] 32-bit data 0 to 4294967295 32 bits
E ±1.175495-38 to
FLOAT (Single Precision) Real number
String Character string (50 characters maximum) Variable
Time Time value T#-24d-0h31m23s648.00ms to T#24d20h31m23s647.00ms 32 bits
32 bits


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

3.3 Device and Address
Devices can be described in two methods, device method and address method.
In this method, a device is described using the device name and device number.
Device name Device number
This method is defined in IEC61131-3, and used as shown in the table below.
This decimal number corresponds to the device number. Q Output X Bit
I Input (Omitted) Bit This number is provided for detailed classification. Period (.) is used to delimit the subsequent "Number". The characters for classification may be omitted.
M Internal W Word (16 bits)
D Double word (32 bits)
L Long Word (64 bits)
→ 7.3 Appendix A
% · Memory area position · Size Classification Number

3.4 EN and ENO
Execution of an instruction can be controlled when the instruction contains "EN" in its name.
EN ENO Operation result
TRUE(Operation error did not occur.) Operation output value
TRUE(Executes operation.)
FALSE(Operation error occurred.) Indefinite value
FALSE(Stops operation.) FALSE Indefinite value
M1
_BOOL
VAR_D10
In the above example, the function "BOOL_TO_STR_E" is executed only when X000 is "TRUE". When the function is executed normally, "TRUE" is output to M1.

Function explanation pages have the following configuration.

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

The PLC Series supports the function from its first product.
The supporting status varies on the version. Applicable versions are explained in "Cautions".
The PLC Series does not support the function.
Structured ladder Indicates the instruction expression in the structured ladder language.
ST Indicates the instruction expression in the ST language.
→ Q/FX Structured Programming Manual (Fundamentals)
Item Description · Item Description

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)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function coverts bit data into word [signed] data, and outputs the data obtained by conversion.
BOOL_TO_INT _BOOL *1 D0 M0
BOOL_TO_INT_E(EN,_BOOL, Output label Example: BOOL_TO_INT_E(X000,M0, D0);
BOOL_TO_INT_E
M0 _BOOL
_BOOL ( ) Conversion source bit data Bit
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts bit data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0" as the word [signed] data value. When the input value is "TRUE", this function outputs "1" as the word [signed] data value.
TRUE 1
Bit data Word [signed] data
Use the function having "_E" in its name to connect a bus.

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 .
g_int1 := BOOL_TO_INT(g_bool1);
g_bool3 := BOOL_TO_INT_E(g_bool1, g_bool2, g_int1);
g_int1 g_bool1 · g_bool2 _BOOL · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts bit data into double word [signed] data, and outputs the data obtained by conversion.
BOOL_TO_DINT _BOOL *1 Label
BOOL_TO_DINT_E(EN, _BOOL, Output label); Example: BOOL_TO_DINT_E(X000,M0, Label);
BOOL_TO_DINT_E EN ENO
M0 _BOOL
_BOOL ( ) Conversion source bit data Bit
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts bit data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
TRUE 1
Bit data Double word [signed] data
*1 Label

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 .
g_dint1 := BOOL_TO_DINT(g_bool1);
g_bool3 := BOOL_TO_DINT_E(g_bool1, g_bool2, g_dint1);
g_dint1 g_bool1 · g_bool2 _BOOL · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts bit data into string data, and outputs the data obtained by conversion.
BOOL_TO_STR _BOOL *1 Label M0
BOOL_TO_STR_E(EN, _BOOL, Output label); Example: BOOL_TO_STR_E(X000,M0, Label);
BOOL_TO_STR_ E
M0 _BOOL
_BOOL ( ) Conversion source bit data Bit
*1 ( ) String data after conversion String
This function converts bit data input to a deice specified in into string data, and outputs the data obtained by conversion to a device specified in .
TRUE "1"
Bit data String data
*1 Label

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 .
g_string1 := BOOL_TO_STR(g_bool1);
_BOOL
g_bool3 := BOOL_TO_STR_E(g_bool1, g_bool2, g_string1);
g_string1 g_bool1 · g_bool2 _BOOL · g_string1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts bit data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.
BOOL_TO_WORD _BOOL *1 M0 D0
BOOL_TO_WORD_E(EN, _BOOL, Output label); Example: BOOL_TO_WORD_E(X000, M0,D0);
BOOL_TO_WOR D_E
EN ENO
M0 _BOOL
_BOOL ( ) Conversion source bit data Bit
*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts bit data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0H" as the word [unsigned]/bit string [16-bit] data value. When the input value is "TRUE", this function outputs "1H" as the word [unsigned]/bit string [16-bit] data value.
TRUE 1H
Bit data Word [unsigned]/ bit string [16-bit] data
Use the function having "_E" in its name to connect a bus.

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 .
g_word1 := BOOL_TO_WORD(g_bool1);
_BOOL
g_bool3 := BOOL_TO_WORD_E(g_bool1, g_bool2, g_word1);
g_word1 g_bool1 · g_bool2 _BOOL · g_word1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts bit data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.
BOOL_TO_DWORD _BOOL *1 M0 Label
BOOL_TO_DWORD_E(EN, _BOOL, Output label); Example: BOOL_TO_DWORD_E(X000, M0, Label);
BOOL_TO_DWORD_E
EN ENO
M0 _BOOL *1
_BOOL ( ) Conversion source bit data Bit
*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]
This function converts bit data stored in a device specified in into double word [unsigned]/bit string [32- bit] data, and outputs the data obtained by conversion to a device specified in . When the input value is "FALSE", this function outputs "0H" as the double word [unsigned]/bit string [32- bit]data value. When the input value is "TRUE", this function outputs "1H" as the double word [unsigned]/bit string [32-bit] data value.
TRUE 1H
Bit data Double Word [unsigned]/
Bit string [32-bit] data
Label

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 .
_BOOL
g_dword1 := BOOL_TO_DWORD(g_bool1);
g_bool3 := BOOL_TO_DWORD_E(g_bool1, g_bool2, g_dword1);
g_dword1 g_bool1 · g_bool2 _BOOL · g_dword1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts bit data into time data, and outputs the data obtained by conversion.
BOOL_TO_TIME _BOOL *1 M0 Label
BOOL_TO_TIME_E(EN,_BOOL, Output label); Example: BOOL_TO_TIME_E(X000,M0, Label);
BOOL_TO_TIME_E EN ENO
M0 _BOOL
_BOOL ( ) Conversion source bit data Bit
*1 ( ) Time data after conversion Time
This function converts bit data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .
Bit data Time data
*1 Label · TRUE 1ms

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 .
g_time1 := BOOL_TO_TIME(g_bool1);
g_bool3 := BOOL_TO_TIME_E(g_bool1, g_bool2, g_time1);
g_time1 g_bool1 · g_bool2 _BOOL · g_time1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into double word [signed] data, and outputs the data obtained by conversion.
INT_TO_DINT _INT *1 D0 Label
INT_TO_DINT_E(EN,_INT, Output label); Example: INT_TO_DINT_E(X000,D0, Label);
INT_TO_DINT_E
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts word [signed] data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
Word [signed] data Double word [signed] data
*1 Label · 1234 1234

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 .
g_dint1 := INT_TO_DINT(g_int1);
g_bool3 := INT_TO_DINT_E(g_bool1, g_int1, g_dint1);
g_dint1=5923 g_int1=5923 _INT · g_int1 _INT · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into word [signed] data, and outputs the data obtained by conversion.
DINT_TO_INT _DINT *1 Label D10
DINT_TO_INT_E(EN,_DINT, Output label); Example: DINT_TO_INT_E(X000, Label, D10);
DINT_TO_INT_E
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts double word [signed] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data Word [signed] data
Label _DINT · 1234 1234

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 .
g_int1 := DINT_TO_INT(g_dint1);
g_bool3 := DINT_TO_INT_E(g_bool1, g_dint1, g_int1);
g_int1=5923 g_dint1=5923 _DINT · g_dint1 _DINT · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into bit data, and outputs the data obtained by conversion.
INT_TO_BOOL
M0 D0 *1 _INT
INT_TO_BOOL_E(EN,_INT, Output label); Example: INT_TO_BOOL_E(X000,D0,M0);
INT_TO_BOOL_E
D0 _INT
*1 M0
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Bit data after conversion Bit
This function converts word [signed] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in . When the input value is "0", this function outputs "FALSE". When the input value is any value other than "0", this function outputs "TRUE".
1567 TRUE
Word [signed] data Bit data
Use the function having "_E" in its name to connect a bus.

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 .
g_bool1 := INT_TO_BOOL(g_int1);
g_bool3 := INT_TO_BOOL_E(g_bool1, g_int1, g_bool2);
g_bool1 g_int1=5923 _INT · g_int1 _INT

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into bit data, and outputs the data obtained by conversion.
DINT_TO_BOOL _DINT *1 Label M0
DINT_TO_BOOL_E(EN,_DINT, Output label); Example: DINT_TO_BOOL_E(X000, Label, M0);
DINT_TO_BOOL_E EN ENO
*1 M0
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Bit data after conversion Bit
This function converts double word [signed] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in . When the input value is "0", this function outputs "FALSE". When the input value is any value other than "0", this function outputs "TRUE".
12345678 TRUE
Double word [signed] data Bit data
Label _DINT

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 .
g_bool1 := DINT_TO_BOOL(g_dint1);
g_bool3 := DINT_TO_BOOL_E(g_bool1, g_dint1, g_bool2);
g_bool1 g_dint1=0 _DINT · g_dint1 _DINT

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into float (single precision) data, and outputs the data obtained by conversion.
INT_TO_REAL a_Int *1 Label D0
INT_TO_REAL_E(EN,a_Int, Output label); Example: INT_TO_REAL_E(X000,D0,Label);
INT_TO_REAL_E
a_Int ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)
This function converts word [signed] data stored in a device specified in into float (single precision) data, and outputs the data obtained by conversion to a device specified in .
1234 1234.0
Word [signed] data Float (single precision) data
D0 a_Int · *1 Label

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 .
g_real1=5923.0 INT_TO_REAL g_int1=5923 a_Int
g_real1 := INT_TO_REAL(g_int1);
g_bool3 := INT_TO_REAL_E(g_bool1, g_int1, g_real1);
g_int1 a_Int · g_real1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into float (single precision) data, and outputs the data obtained by conversion.
DINT_TO_REAL a_Dint *1 Label 1 Label 2
DINT_TO_REAL_E(EN,a_Dint, Output label); Example: DINT_TO_REAL_E(X000, Label 1, Label 2);
DINT_TO_REAL_E EN ENO
a_Dint ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)
This function converts double word [signed] data stored in a device specified in into float (single precision) data, and outputs the data obtained by conversion to a device specified in .
16543521 16543521.0
Double word [signed] data Float (single precision) data
Label 1 a_Dint · *1 Label 2

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 .
g_real1=65000.0 DINT_TO_REAL g_dint1=65000 a_Dint
g_real1 := DINT_TO_REAL(g_dint1);
g_bool3 := DINT_TO_REAL_E(g_bool1, g_dint1, g_real1);
g_dint1 a_Dint · g_real1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into string data, and outputs the data obtained by conversion.
INT_TO_STR _INT *1 Label D0
INT_TO_STR_E(EN,_INT, Output label); Example: INT_TO_STR_E(X000, D0, Label);
INT_TO_STR_E
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) String data after conversion String
Sign data Low-order byte
ASCII code for ten-thousands place
String 1st word 2nd word 3rd word 4th word
ASCII code for hundreds place ASCII code for thousands place
ASCII code for tens place ASCII code for ones place
Automatically stored at the end of the character string
20H (space) High-order byte
2DH (-) Low-order byte
String 1st word 2nd word 3rd word 4th word Word [signed] data
31H (1) 20H (space) 32H (2) 33H (3)
*1 Label · High-order byte · Word [signed] data

An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, word [signed] data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .
g_string1 := INT_TO_STR(g_int1);
g_string='-12345' INT_TO_STR g_int1=-12345 _INT
g_bool3 := INT_TO_STR_E(g_bool1, g_int1, g_string1);
g_int1 _INT · g_string1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into string data, and outputs the data obtained by conversion.

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

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

String 1st word 2nd word 3rd word 4th word 5th word 6th word
ASCII code for ten-millions place ASCII code for hundred-millions place
ASCII code for millions place ASCII code for hundred-thousands place
ASCII code for ten-thousands place ASCII code for thousands place
ASCII code for hundreds place ASCII code for tens place
Automatically stored at the end of the character string

String 1st word 2nd word 3rd word 4th word 5th word 6th word
20H (space) 20H (space) 20H (space) 31H (1) 32H (2) 33H (3) 34H (4) 35H (5) 36H (6) 00H

An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, double word [signed] data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .
g_string1='-12345678' DINT_TO_STR g_dint1=-12345678 _DINT
g_string1 := DINT_TO_STR(g_dint1);
g_bool3 := DINT_TO_STR_E(g_bool1, g_dint1, g_string1);
g_dint1 _DINT · g_string1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.
INT_TO_WORD _INT D10 D0 *1
INT_TO_WORD_E(EN,_INT, Output label); Example: INT_TO_WORD_E(X000,D0,D10);
INT_TO_WORD_ E
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Word [unsigned]/Bit String [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts word [signed] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .
Word [signed] data Word [unsigned]/ bit string [16-bit] data
Use the function having "_E" in its name to connect a bus.

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 .
g_word1=16#1723 INT_TO_WORD g_int1=5923 _INT
g_word1 := INT_TO_WORD(g_int1);
g_bool3 := INT_TO_WORD_E(g_bool1, g_int1, g_word1);
g_int1 _INT · g_word1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.
DINT_TO_WORD _DINT *1 Label D10
DINT_TO_WORD_E(EN,_DINT, Output label); Example: DINT_TO_WORD_E(X000, Label, D10);
DINT_TO_WORD_E EN ENO
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts double word [signed] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data
Word [unsigned]/ bit string [16-bit] data
0
1 0
1 0
The information stored in high-order 16 bits is discarded.
Label _DINT · 12345678

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 .
g_word1=16#614E DINT_TO_WORD g_dint1=12345678 _DINT
g_word1 := DINT_TO_WORD(g_dint1);
g_bool3 := DINT_TO_WORD_E(g_bool1, g_dint1, g_word1);
g_dint1 _DINT · g_word1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.
INT_TO_DWORD _INT *1 D0 Label
INT_TO_DWORD_E(EN,_INT, Output label); Example: INT_TO_DWORD_E(X000,D0, Label);
INT_TO_DWORD_E EN ENO
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]
This function converts word [signed] data stored in a device specified in into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion to a device specified in .
Word [signed] data Double word [unsigned]/
bit string [32-bit] data
1 0 0 0
1 0
Each of high-order 16 bits becomes "0" after data conversion.
*1 Label · Data conversion

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 .
g_dword1=16#0000000A INT_TO_DWORD g_int1=10 _INT
g_dword1 := INT_TO_DWORD(g_int1);
g_bool3 := INT_TO_DWORD_E(g_bool1, g_int1, g_dword1);
g_int1 _INT · g_dword1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.
DINT_TO_DWORD _DINT *1 Label 1 Label 2
DINT_TO_DWORD_E(EN,_DINT, Output label); Example: DINT_TO_DWORD_E(X000, Label 1, Label 2);
DINT_TO_DWORD_E EN ENO
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]
This function converts double word [signed] data stored in a device specified in into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data Double word [unsigned]/
bit string [32-bit] data
Label 1 _DINT · *1 Label 2

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 .
g_dword1=16#00012345 DINT_TO_DWORD g_dint1=74565 _DINT
g_dword1 := DINT_TO_DWORD(g_dint1);
g_bool3 := DINT_TO_DWORD_E(g_bool1, g_dint1, g_dword1);
g_dint1 _DINT · g_dword1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into BCD data, and outputs the data obtained by conversion.
INT_TO_BCD _INT *1 D10 D0
INT_TO_BCD_E(EN,_INT, Output label); Example: INT_TO_BCD_E(X000,D0,D10);
INT_TO_BCD_E
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) BCD data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts word [signed] data stored in a device specified in into BCD data, and outputs the data obtained by conversion to a device specified in .
Word [signed] data Word [unsigned]/ bit string [16-bit] data
3276816384 128 256 512 64 32 16 8 4 2 1
8192 4096 2048 1024
0 0 1 0 0 1 1 1 0 1
Conversion into BCD data Make sure to set them to "0".
8 4 2 1 8000 4000 2000 1000 800 400 200 100 80 40 20 10
0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Thousands place Hundreds place Tens place Ones place
Use the function having "_E" in its name to connect a bus.
An operation error occurs when the value stored in a device specified in is outside the range from "0" to "9,999".

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 .
g_word=16#5923 INT_TO_BCD g_int1=5923 _INT
g_word1 := INT_TO_BCD(g_int1);
g_bool3 := INT_TO_BCD_E(g_bool1, g_int1, g_word1);
g_int1 _INT · g_word1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into BCD data, and outputs the data obtained by conversion.
DINT_TO_BCD _DINT *1 Label 1 Label 2
DINT_TO_BCD_E(EN,_DINT, Output label); Example: DINT_TO_BCD_E(X000, Label 1, Label 2);
DINT_TO_BCD_E
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) BCD data after conversion ANY_BIT
This function converts double word [signed] data stored in a device specified in into BCD data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data ANY_BIT data
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
0 1 0 1 0 1 0 1 0 1 1 1 0 1 99999999
Conversion into BCD data Make sure to set them to "0".
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1

An operation error occurs when the value stored in a device specified in is outside the range from "0" to "99,999,999".
In this program, double word [signed] data stored in a device specified in is converted into BCD data, and the data obtained by conversion is output to a device specified in .
g_dword1=16#00020000 DINT_TO_BCD g_dint1=20000 _DINT
g_dword1 := DINT_TO_BCD(g_dint1);
g_bool3 := DINT_TO_BCD_E(g_bool1, g_dint1, g_dword1);
g_dint1 _DINT · g_dword1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [signed] data into time data, and outputs the data obtained by conversion.
INT_TO_TIME _INT *1 Label D0
INT_TO_TIME_E(EN,_INT, Output label); Example: INT_TO_TIME_E(X000,D0,Label);
INT_TO_TIME_E
D0 _INT
_INT ( ) Conversion source word [signed] data Word [signed]
*1 ( ) Time data after conversion Time
This function converts word [signed] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .
Word [signed] data Time data
*1 Label · FFFFh 1m5s535ms

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 .
g_time1 INT_TO_TIME g_int1 _INT
g_time1 := INT_TO_TIME(g_int1);
g_bool3 := INT_TO_TIME_E(g_bool1, g_int1, g_time1);
g_int1 _INT · g_time1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [signed] data into time data, and outputs the data obtained by conversion.
DINT_TO_TIME _DINT *1 Label 1 Label 2
DINT_TO_TIME_E(EN,_DINT, Output label); Example: DINT_TO_TIME_E(X000, Label 1, Label 2);
DINT_TO_TIME_E EN ENO
_DINT ( ) Conversion source double word [signed] data Double Word [signed]
*1 ( ) Time data after conversion Time
This function converts double word [signed] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data Time data
Label 1 _DINT · *1 Label 2 · 7FFFFFFFh 24d20h31m23s647ms

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 .
g_time1 DINT_TO_TIME g_dint1 _DINT
g_time1 := DINT_TO_TIME(g_dint1);
g_bool3 := DINT_TO_TIME_E(g_bool1, g_dint1, g_time1);
g_dint1 _DINT · g_time1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts float (single precision) data into word [signed] data, and outputs the data obtained by conversion.
REAL_TO_INT a_real *1 D10 Label
REAL_TO_INT_E(EN,a_real, Output label); Example: REAL_TO_INT_E(X000, Label, D10);
REAL_TO_INT_E
a_real ( ) Conversion source float (single precision) data FLOAT (Single Precision)
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts float (single precision) data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
1234.0 1234
Float (single precision) data Word [signed] data The portion after the decimal
point is rounded off.
Label a_real

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 .
g_int1=5923 REAL_TO_INT g_real1=5923.5 a_real
g_int1 := REAL_TO_INT(g_real1);
g_bool3 := REAL_TO_INT_E(g_bool1, g_real1, g_int1);
g_real1 a_real · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts float (single precision) data into double word [signed] data, and outputs the data obtained by conversion.
REAL_TO_DINT a_real *1 Label 2 Label 1
REAL_TO_DINT_E(EN,a_real, Output label); Example: REAL_TO_DINT_E(X000, Label 1, Label 2);
REAL_TO_DINT_E EN ENO
a_real ( ) Conversion source float (single precision) data FLOAT (Single Precision)
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts float (single precision) data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
16543521.0 16543521
FLOAT (single precision) data Double word [signed] data The portion after the decimal
point is rounded off.
Label 1 a_real · *1 Label 2

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 .
g_dint1=65000 REAL_TO_DINT g_real1=65000.5 a_real
g_dint1 := REAL_TO_DINT(g_real1);
g_bool3 := REAL_TO_DINT_E(g_bool1, g_real1, g_dint1);
g_real1 a_real · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts float (single precision) data into string data, and outputs the data obtained by conversion.

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

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

Float (single precision) data ASCII code for integer part
Automatically stored at the end of the character string

follows: Integer part: 1, decimal part: 5, exponent part: 2 "2EH (.)" is automatically stored in the 3rd byte, and "45H (E)" is automatically stored in the 9th byte.
Total number of digits (12 digits)
Integer part (1 digit)
Decimal part (5 digits)
Exponent part (2 digits)
-12.3456
E - 1 . 2 3 4 5 6 + 0 1
Float (single precision) data
"45H (E)" is stored.
"2EH (.)" is stored.
b) In "Sign data (integer part)", "20H (space)" is stored when the input value is positive, and "2DH (-)" is
stored when the input value is negative. c) The 6th and later digits of the decimal part are rounded.
Total number of digits (12 digits)
-12.345678
E - 1 . 2 3 4 5 7 8 6
Float (single precision) data
Number of digits of decimal part (5)
These digits are rounded.
d) "30H (0)" is stored in the decimal part when the number of significant figures is small.
Total number of digits (12 digits)
E - 1 . 2 3 4 0 0 + 0 1
Float (single precision) data
"30H (0)" is stored.
Number of digits of decimal part (5)
e) In "Sign data (exponent part)", "2BH (+)" is stored when the input value is positive, and "2DH (-)" is
stored when the input value is negative. f) "30H (0)" is stored in the tens place of the exponent part when the exponent part consists of 1 digit.
Total number of digits (12 digits)
Number of digits of exponent part (2)
-12.3456
E - 1 . 2 3 4 5 6 + 0 1
Float (single precision) data
"30H (0)" is stored.
+ 0 1

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, float (single precision) data stored in a device specified in is converted into string data, and the data obtained by conversion is output to a device specified in .
g_string1="-1.23457E+01" REAL_TO_STR g_real1=-12.34567 _REAL
g_string1 := REAL_TO_STR(g_real1);
g_bool3 := REAL_TO_STR_E(g_bool1, g_real1, g_string1);
g_real1 _REAL · g_string1


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [unsigned]/bit string [16-bit] data into bit data, and outputs the data obtained by conversion.
_WORD ( ) Conversion source word [unsigned]/bit String [16-bit] data Word [unsigned]/ Bit String [16-bit]
This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .
Use the function having "_E" in its name to connect a bus.

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 .
g_bool1 WORD_TO_BOOL g_word1=16#0001 _WORD
g_bool1 := WORD_TO_BOOL(g_word1);
g_bool3 := WORD_TO_BOOL_E(g_bool1, g_word1, g_bool2);
g_word1 _WORD

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [unsigned]/bit string [32-bit] data into bit data, and outputs the data obtained by conversion.
DWORD_TO_BOOL _DWORD *1 Label M0
DWORD_TO_BOOL_E(EN, _DWORD, Output label); Example: DWORD_TO_BOOL_E(X000, Label, M0);
DWORD_TO_BOOL_E EN ENO
*1 M0
_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]
*1 ( ) Bit data after conversion Bit
This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .
12345678H TRUE
bit string [32-bit] data
Label _DWORD · Double word [unsigned]/ · Bit data

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 .
g_bool1 DWORD_TO_BOOL g_dword1=16#00000001 _DWORD
g_bool1 := DWORD_TO_BOOL(g_dword1);
g_bool3 := DWORD_TO_BOOL_E(g_bool1, g_dword1, g_bool2);
g_dword1 _DWORD

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [unsigned]/bit string [16-bit] data into word [signed] data, and outputs the data obtained by conversion.
WORD_TO_INT _WORD *1 D0 D10
WORD_TO_INT_E(EN,_WORD, Output label); Example: WORD_TO_INT_E(X000,D0, D10);
WORD_TO_INT_E EN ENO
D0 _WORD
_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
Word [unsigned]/ bit string [16-bit] data
Use the function having "_E" in its name to connect a bus.
Word [signed] data

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 .
g_int1=10 WORD_TO_INT g_word1=16#000A _WORD
g_int1 := WORD_TO_INT(g_word1);
g_bool3 := WORD_TO_INT_E(g_bool1, g_word1, g_int1);
g_word1 _WORD · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [unsigned]/bit string [16-bit] data into double word [signed] data, and outputs the data obtained by conversion.
WORD_TO_DINT _WORD *1 D0 Label
WORD_TO_DINT_E(EN,_WORD, Output label); Example: WORD_TO_DINT_E(X000,D0, Label);
WORD_TO_DINT_E EN ENO
D0 _WORD
_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts word [unsigned]/bit string [16-bit] data storeds in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
Word [unsigned]/ bit string [16-bit] data
Double word [signed] data
0 1 0 1 0 1 1 0 0 1 0 0 0
0 1 0 1 0 1 1 0 0 1 0 0 0
Each of high-order 16 bits becomes "0" after data conversion.
*1 Label · Data conversion

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 .
g_dint1=4660 WORD_TO_DINT g_word1=16#1234 _WORD
g_dint1 := WORD_TO_DINT(g_word1);
g_bool3 := WORD_TO_DINT_E(g_bool1, g_word1, g_dint1);
g_word1 _WORD · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [unsigned]/bit string [32-bit] data into word [signed] data, and outputs the data obtained by conversion.
DWORD_TO_INT _DWORD *1 Label D10
DWORD_TO_INT_E(EN, _DWORD, Output label); Example: DWORD_TO_INT_E(X000,Label, D10);
DWORD_TO_INT_E EN ENO
_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
bit string [32-bit] data
0 1 0 1 0 1 1 0 1 0 1 0 0 1 1 1 0
0 1 1 0 1 0 1 0 0 1 1 1 0
The information stored in high-order 16 bits is discarded.
Label _DWORD · Double word [unsigned]/ · Word [signed] data

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 .
g_int1=9029 DWORD_TO_INT g_dword1=16#00012345 _DWORD
g_int1 := DWORD_TO_INT(g_dword1);
g_bool3 := DWORD_TO_INT_E(g_bool1, g_dword1, g_int1);
g_dword1 _DWORD · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [unsigned]/bit string [32-bit] data into double word [signed] data, and outputs the data obtained by conversion.
DWORD_TO_DINT _DWORD *1 Label 1 Label 2
DWORD_TO_DINT_E(EN, _DWORD, Output label); Example: DWORD_TO_DINT_E(X000, Label 1, Label 2);
DWORD_TO_DINT_E EN ENO
_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
Double word [signed] data
bit string [32-bit] data
Label 1 _DWORD · *1 Label 2 · Double word [unsigned]/

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 .
g_dint1=74565 DWORD_TO_DINT g_dword1=16#00012345 _DWORD
g_dint1 := DWORD_TO_DINT(g_dword1);
g_bool3 := DWORD_TO_DINT_E(g_bool1, g_dword1, g_dint1);
g_dword1 _DWORD · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [unsigned]/bit string [16-bit] data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.
WORD_TO_DWORD _WORD *1 D0 Label
WORD_TO_DWORD_E(EN, _WORD, Output label); Example: WORD_TO_DWORD_E(X000,D0, Label);
WORD_TO_DWORD_E
EN ENO
D0 _WORD
_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String [16-bit]
*1 ( ) Double word[unsigned]/bit string[32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]
This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into double word [unsigned]/bit [32-bit] data, and outputs the data obtained by conversion to a device specified in . Each of high-order 16 bits becomes "0" after data conversion.
Word [unsigned]/ bit string [16-bit] data
bit string [32-bit] data
*1 Label · Double word [unsigned]/

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 .
g_dword1=16#00001234 WORD_TO_DWORD g_word1=16#1234 _WORD
g_dword1 := WORD_TO_DWORD(g_word1);
g_bool3 := WORD_TO_DWORD_E(g_bool1, g_word1, g_dword1);
g_word1 _WORD · g_dword1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [unsigned]/bit string[32-bit] data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.
DWORD_TO_WORD _DWORD *1 Label D10
DWORD_TO_WORD_E(EN, _DWORD, Output label); Example: DWORD_TO_WORD_E(X000, Label, D10);
DWORD_TO_WORD_E EN ENO
_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned] /Bit string [32-bit]
*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in
Word [unsigned]/ bit string [16-bit] data
bit string [32-bit] data
1 2 3 4 5 6 7 8
0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0
0 1 0 1 0 1 1 0 0 1 0 0 0
The information stored in high-order 16 bits is discarded.
Label _DWORD · Double word [unsigned]/

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 .
g_word1=16#5678 DWORD_TO_WORD g_dword1=16#12345678 _DWORD
g_word1 := DWORD_TO_WORD(g_dword1);
g_bool3 := DWORD_TO_WORD_E(g_bool1, g_dword1, g_word1);
g_dword1 _DWORD · g_word1


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts word [unsigned]/bit string [16-bit] data into time data, and outputs the data obtained by conversion.
_WORD ( ) Conversion source word [unsigned]/bit string [16-bit] data Word [unsigned]/ Bit String[ 16-bit]
This function converts word [unsigned]/bit string [16-bit] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .

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 .
g_time1 WORD_TO_TIME g_word1 _WORD
g_time1 := WORD_TO_TIME(g_word1);
g_bool3 := WORD_TO_TIME_E(g_bool1, g_word1, g_time1);
g_word1 _WORD · g_time1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts double word [unsigned]/bit string [32-bit] data into time data, and outputs the data obtained by conversion.
DWORD_TO_TIME _DWORD *1 Label 1 Label 2
DWORD_TO_TIME_E(EN,_ DWORD, Output label); Example: DWORD_TO_TIME_E(X000, Label 1, Label 2);
DWORD_TO_TIME_E
EN ENO
_DWORD ( ) Conversion source double word [unsigned]/bit string [32-bit] data Double Word [unsigned]/ Bit string [32-bit]
*1 ( ) Time data after conversion Time
This function converts double word [unsigned]/bit string [32-bit] data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .
bit string [32-bit] data

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 .
g_time1 DWORD_TO_TIME g_dword1 _DWORD
g_time1 := DWORD_TO_TIME(g_dword1);
g_bool3 := DWORD_TO_TIME_E(g_bool1, g_dword1, g_time1);
g_dword1 _DWORD · g_time1


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts string data into bit data, and outputs the data obtained by conversion.
This function converts string data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .

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 .
g_bool1 STR_TO_BOOL g_string1 _STRING
g_bool1 := STR_TO_BOOL(g_string1);
g_bool3 := STR_TO_BOOL_E(g_bool1, g_string1, g_bool2);
g_string1 _STRING


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts string data into word [signed] data, and outputs the data obtained by conversion.
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts string data (3 words) stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
Sign data Low-order byte String 1st word 2nd word 3rd word Word [signed] data
ASCII code for hundreds place ASCII code for thousands place
ASCII code for tens place ASCII code for ones place

In this program, string data stored in a device specified in is converted into word [signed] data, and the data obtained by conversion is output to a device specified in .
g_int1=-12345 STR_TO_INT g_string1="-12345" _STRING
g_int1 := STR_TO_INT(g_string1);
g_bool3 := STR_TO_INT_E(g_bool1, g_string1, g_int1);

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts string data into double word [signed] data, and outputs the data obtained by conversion.
STR_TO_DINT _STRING *1 Label 1 Label 2
STR_TO_DINT_E(EN,_STRING, Output label); Example: STR_TO_DINT_E(X000, Label 1, Label 2);
STR_TO_DINT_E
_STRING ( ) Conversion source string data String
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts string data (6 words) stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
Sign data Low-order byte String 1st word 2nd word 3rd word 4th word 5th word 6th word
ASCII code for billions place
ASCII code for ten-millions place ASCII code for hundred-millions place
ASCII code for millions place ASCII code for hundred-thousands place ASCII code for thousands place
ASCII code for ten-thousands place
Double word [signed] data
ASCII code for tens place ASCII code for hundreds place
ASCII code for ones place

In this program, string data stored in a device specified in is converted into double word [signed] data, and the data obtained by conversion is output to a device specified in .
g_dint1=65000 STR_TO_DINT g_string1="_ _65000" _STRING
g_dint1 := STR_TO_DINT(g_string1);
g_bool3 := STR_TO_DINT_E(g_bool1, g_string1, g_dint1);

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts string data into float (single precision) data, and outputs the data obtained by conversion.
STR_TO_REAL _STRING *1 Label 1 Label 2
STR_TO_REAL_E(EN,_STRING, Output label); Example: STR_TO_REAL_E(X000, Label 1, Label 2);
STR_TO_REAL_E
_STRING ( ) Conversion source string data String
*1 ( ) Float (single precision) data after conversion FLOAT (Single Precision)
Sign data Low-order byte String 1st word 2nd word 3rd word 4th word 5th word 6th word 7th word 0000H (Indicates the end of the character string.)
ASCII code for 1st character
ASCII code for 3rd character ASCII code for 2nd character
ASCII code for 4th character ASCII code for 5th character ASCII code for 7th character ASCII code for 9th character ASCII code for 11th character
ASCII code for 8th character ASCII code for 6th character
ASCII code for 10th character
Float (single precision) data
2DH (-) Low-order byte String 1st word 2nd word 3rd word 4th word 5th word Float (single precision) data
31H (1) High-order byte
33H (3) 2EH (.) 35H (5) 30H (0) 34H (4) 33H (3) -1.35034
- 1 . 3 5 0 3 4
Label 1 _STRING · *1 Label 2 · High-order byte

b) In the case of exponent format
2DH (-) Low-order byte String
31H (1) High-order byte
1st word 2nd word 3rd word 4th word 5th word 6th word 7th word
33H (3) 2EH (3) 35H (5) 30H (0) 34H (4) 2DH (-) 30H (0)
-1.35034E-10
Float (single precision) data 0000H
- 1 . 3 5 0 3 4 E - 1 0
- 1 . 3 5 0 3 4 1 2 0 2 3 -1.35034
Float (single precision) data Discarded
b) In the case of exponent format
- 1 . 3 5 0 3 4 1 2 E - 1 0 -1.35034E-10
Float (single precision) data Discarded
Float (single precision) data Ignored
b) In the case of exponent format
- 0 1 . 3 5 0 3 4 E - 1 0 -1.35034E-10
Float (single precision) data Ignored
- 1 . 3 5 0 3 4 E - 0 2 -1.35034E-2
Float (single precision) data Ignored

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, string data stored in a device specified in is converted into float (single precision) data, and the data obtained by conversion is output to a device specified in .
g_real1 STR_TO_REAL g_string1 _STRING
g_real1 := STR_TO_REAL(g_string1);
g_bool3 := STR_TO_REAL_E(g_bool1, g_string1, g_real1);
g_string1 _STRING · g_real1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts string data into time data, and outputs the data obtained by conversion.
STR_TO_TIME _STRING *1 Label 1 Label 2
STR_TO_TIME_E(EN,_STRING, Output label); Example: STR_TO_TIME_E(X000, Label 1, Label 2);
STR_TO_TIME_E
_STRING ( ) Conversion source string data String
*1 ( ) Time data after conversion Time
This function converts string data stored in a device specified in into time data, and outputs the data obtained by conversion to a device specified in .
String data Time data

An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, string data stored in a device specified in is converted into time data, and the data obtained by conversion is output to a device specified in .
g_time1 STR_TO_TIME g_string1 _STRING
g_time1 := STR_TO_TIME(g_string1);
g_bool3 := STR_TO_TIME_E(g_bool1, g_string1, g_time1);
g_string1 _STRING · g_time1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts BCD data into word [signed] data, and outputs the data obtained by conversion.
BCD_TO_INT _BCD *1 D0 D10
BCD_TO_INT_E(EN,_BCD, Output label); Example: BCD_TO_INT_E(X000,D0,D10);
BCD_TO_INT_E
D0 _BCD
_BCD ( ) Conversion source BCD data Word [unsigned]/ Bit String [16-bit]
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts BCD data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
Word [unsigned]/ bit string [16-bit] data
8000 4000 2000 1000 800 400 200 100 80 40 20 10 8 4 2 1
9999H 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Thousands place Hundreds place Tens place Ones place
Conversion into word [signed] data
3276516354 8192 4095 2048 1024 512 256 128 64 32 16 8 4 2 1
0 1 0 0 1 1 1 0 1 9999
Always becomes "0".
Use the function having "_E" in its name to connect a bus.
When the source data is not BCD (decimal number), M8067 (operation error) turns ON.
Word [signed] data

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 .
g_int1=1234 BCD_TO_INT g_word1=16#1234 _BCD
g_int1 := BCD_TO_INT(g_word1);
g_bool3 := BCD_TO_INT_E(g_bool1, g_word1, g_int1);
g_word1 _BCD · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts BCD data into double word [signed] data, and outputs the data obtained by conversion.
BCD_TO_DINT _BCD *1 Label 2 Label 1
BCD_TO_DINT_E(EN,_BCD, Output label); Example: BCD_TO_DINT_E(X000, Label 1, Label 2);
BCD_TO_DINT_E
_BCD ( ) Conversion source BCD data ANY_BIT
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts BCD data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
ANY_BIT data Double word [signed] data
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Conversion into DINT data
231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
0 1 0 1 0 1 0 1 0 1
Always becomes "0".
Use the function having "_E" in its name to connect a bus.
When the source data is not BCD (decimal number), M8067 (operation error) turns ON.

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 .
g_dint1=0 BCD_TO_DINT g_word1=16#0000 _BCD
g_dint1 := BCD_TO_DINT(g_word1);
g_bool3 := BCD_TO_DINT_E(g_bool1, g_word1, g_dint1);
g_word1 _BCD · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into bit data, and outputs the data obtained by conversion.
TIME_TO_BOOL _TIME *1 Label M0
TIME_TO_BOOL_E(EN,_TIME, Output label); Example: TIME_TO_BOOL_E(X000, Label, M0);
TIME_TO_BOOL_E EN ENO
*1 M0
_TIME ( ) Conversion source time data Time
*1 ( ) Bit data after conversion Bit
This function converts time data stored in a device specified in into bit data, and outputs the data obtained by conversion to a device specified in .
TRUE
Time data Bit data
Label _TIME · 0ms · 20m34s567ms

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 .
g_bool1 TIME_TO_BOOL g_time1 _TIME
g_bool1 := TIME_TO_BOOL(g_time1);
g_bool3 := TIME_TO_BOOL_E(g_bool1, g_time1, g_bool2);
g_time1 _TIME

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into word [signed] data, and outputs the data obtained by conversion.
TIME_TO_INT _TIME *1 Label D10
TIME_TO_INT_E(EN,_TIME, Output label); Example: TIME_TO_INT_E(X000, Label, D10);
TIME_TO_INT_E
_TIME ( ) Conversion source time data Time
*1 ( ) Word [signed] data after conversion Word [signed]
This function converts time data stored in a device specified in into word [signed] data, and outputs the data obtained by conversion to a device specified in .
Time data Word [signed] data
Label _TIME · 1234 1s234ms

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 .
g_int1 TIME_TO_INT g_time1 _TIME
g_int1 := TIME_TO_INT(g_time1);
g_bool3 := TIME_TO_INT_E(g_bool1, g_time1, g_int1);
g_time1 _TIME · g_int1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into double word [signed] data, and outputs the data obtained by conversion.
TIME_TO_DINT _TIME *1 Label 1 Label 2
TIME_TO_DINT_E(EN,_TIME, Output label); Example: TIME_TO_DINT_E(X000,Label 1, Label 2);
TIME_TO_DINT_E EN ENO
_TIME ( ) Conversion source time data Time
*1 ( ) Double word [signed] data after conversion Double Word [signed]
This function converts time data stored in a device specified in into double word [signed] data, and outputs the data obtained by conversion to a device specified in .
Time data Double word [signed] data
Label 1 _TIME · *1 Label 2 · 1234567 20m34s567ms

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 .
g_dint1 TIME_TO_DINT g_time1 _TIME
g_dint1 := TIME_TO_DINT(g_time1);
g_bool3 := TIME_TO_DINT_E(g_bool1, g_time1, g_dint1);
g_time1 _TIME · g_dint1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into string data, and outputs the data obtained by conversion.
TIME_TO_STR _TIME *1 Label 1 Label 2
TIME_TO_STR_E(EN,_TIME, Output label); Example: TIME_TO_STR_E(X000, Label 1, Label 2);
TIME_TO_STR_E
_TIME ( ) Conversion source time data Time
*1 ( ) String data after conversion String
This function converts time data stored in a device specified in into string data, and outputs the data obtained by conversion to a device specified in .
Time data String data
An operation error occurs in the following case. The error flag M8067 turns ON, and D8067 stores the error code.
Label 1 _TIME · *1 Label 2 · "1234567" 20m34s567ms

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 .
g_string1 TIME_TO_STR g_time1 _TIME
g_string1 := TIME_TO_STR(g_time1);
g_bool3 := TIME_TO_STR_E(g_bool1, g_time1, g_string1);
g_time1 _TIME · g_string1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion.
TIME_TO_WORD _TIME *1 Label D10
TIME_TO_WORD_E(EN,_TIME, Output label); Example: TIME_TO_WORD_E(X000, Label, D10);
TIME_TO_WORD_E EN ENO
_TIME ( ) Conversion source time data Time
*1 ( ) Word [unsigned]/bit string [16-bit] data after conversion Word [unsigned]/ Bit String [16-bit]
This function converts time data stored in a device specified in into word [unsigned]/bit string [16-bit] data, and outputs the data obtained by conversion to a device specified in .
Time data Word [unsigned]/ bit string [16-bit] data
Label _TIME · 1234 1s234ms

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 .
g_word1 TIME_TO_WORD g_time1 _TIME
g_word1 := TIME_TO_WORD(g_time1);
g_bool3 := TIME_TO_WORD_E(g_bool1, g_time1, g_word1);
g_time1 _TIME · g_word1

FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function converts time data into double word [unsigned]/bit string [32-bit] data, and outputs the data obtained by conversion.
TIME_TO_DWORD _TIME *1 Label 1 Label 2
TIME_TO_DWORD_E(EN,_TIME, Output label); Example: TIME_TO_DWORD_E(X000, Label 1, Label 2);
TIME_TO_DWORD_E
EN ENO
_TIME ( ) Conversion source time data Time
*1 ( ) Double word [unsigned]/bit string [32-bit] data after conversion Double Word [unsigned]/ Bit string [32-bit]
This function converts time data stored in a device specified in into double word [unsigned]/bit string [32- bit] data, and outputs the data obtained by conversion to a device specified in .
Time data Double word [unsigned]/
bit string [32-bit] data
Label 1 _TIME · *1 Label 2 · 1234567 12m34s567ms

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 .
g_dword1 TIME_TO_DWORD g_time1 _TIME
g_dword1 := TIME_TO_DWORD(g_time1);
g_dword1 := TIME_TO_DWORD(g_time1);
g_time1 _TIME · g_dword1

5.2 Standard Functions Of One Numeric Variable
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains the absolute value, and outputs it.
ABS
*1 D10 D0 _IN
ABS_E
D0 _IN
_IN ( ) Data whose absolute value is to be obtained, or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result ANY_NUM
2) When the data type stored in a device specified in is word [signed] and the stored data is "-32768", this function outputs "-32768" to a device specified in . (The maximum absolute value handled by this function is "32,767".) When the data type stored in a device specified in is double word [signed] and the stored data is "- 2147483648", this function outputs "-2147483648" to a device specified in . (The maximum absolute value handled by this function is "2147483647".)
Use the function having "_E" in its name to connect a bus.
s d

5.2 Standard Functions Of One Numeric Variable
In this program, the absolute value is obtained for word [signed] data stored in a device specified in , and the operation result is output to a device specified in using the data type same as the data stored in a device specified in .
g_int2=5923 ABS g_int1=-5923 _IN
g_int2 := ABS(g_int1);
g_bool3 := ABS_E(g_bool1, g_int1, g_int2);
g_int1 _IN · g_int2

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs addition using two values (A + B = C), and outputs the operation result.
ADD_E
D0 _IN _IN D10
_IN ( …) Data for addition or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result ANY_NUM
+ 1234 5678 6912
s2 (Word [signed] data)
s1 (Word [signed] data)

5.3 Standard Arithmetic Functions
Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"
bit operation) or more
-2 , -1 , 0 , -32,768
-1 , 0 , 1
32,767 , 0 , 1 , 2
The most significant bit of data is "1".
The most significant bit of data is "0".
-1 , 0 , 1
-2 , -1 , 0 , -2,147,483,648
2,147,483,647 , 0 , 1 , 2
In this program, addition is performed using double word [signed] data stored in devices specified in and , and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=ADD_E(g_bool1,g_dint1,g_dint2,g_dint3);

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs subtraction using two values (A - B = C), and outputs the operation result.
SUB_E(EN,_IN1,_IN2,Output label); Example: SUB_E(X000,D0,D10,D20);
SUB_E
D0 _IN1 _IN2 D10
_IN1 ( ) Data to be subtracted or word device which stores such data ANY_NUM
_IN2 ( ) Data for subtraction or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result ANY_NUM
12345 - 6789 5556
s2 (Word [signed] data)
s1 (Word [signed] data)

5.3 Standard Arithmetic Functions
Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"
bit operation) or more
-2 , -1 , 0 , -32,768
-1 , 0 , 1
32,767 , 0 , 1 , 2
The most significant bit of data is "1".
The most significant bit of data is "0".
-2 , -1 , 0 , -2,147,483,648
-1 , 0 , 1
2,147,483,647 , 0 , 1 , 2
In this program, subtraction is performed using word [signed] data stored in devices specified in and , and the operation result is output to a device specified in .
_IN1
_IN2
g_bool3:=SUB_E(g_bool1,g_int1,g_int2,g_int3);

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs multiplication using two values (A × B = C), and outputs the operation result.
MUL_E
D0 _IN _IN D10
_IN ( …) Data for multiplication or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result ANY_NUM
s2 (Word [signed] data)
s1 (Word [signed] data)

5.3 Standard Arithmetic Functions
In this program, multiplication is performed using double word [signed] data stored in devices specified in
and , and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=MUL_E(g_bool1,g_dint1,g_dint2,g_dint3);
s1 s2 d · g_dint1 g_dint2 · g_dint3

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs division using two values (A / B = C … remainder), and outputs the quotient.
DIV_E(EN,_IN1,_IN2,Output label); Example: DIV_E(X000,D0,D10,D20);
DIV_E
D0 _IN1 _IN2 D10
_IN1 ( ) Data to be divided, or word device which stores such data ANY_NUM
_IN2 ( ) Data for division (divisor), or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result ANY_NUM
This function performs division ( / ) using word [signed]/double word [signed]/float (single precision) data stored in devices specified in and , and outputs the operation result to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]
5 / 2 2 (Quotient)
(Word [signed] data) s2 (Word [signed] data)
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

5.3 Standard Arithmetic Functions
In this program, division is performed using double word [signed] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .
_IN1
_IN2
g_bool3:=DIV_E(g_bool1,g_dint1,g_dint2,g_dint3);

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs division using two values (A / B = C … remainder), and outputs the remainder.

*1 Label 3 Label 1 _IN1 Label 2 _IN2
MOD_E(EN,_IN1,_IN2,Output label; *2 Example: MOD_E(X000,Label 1, Label 2,Label 3);
*2. Refer to the Cautions

_IN1 ( ) Data to be divided, or word device which stores such data ANY_INT
_IN2 ( ) Data for division (divisor), or word device which stores such data ANY_INT
*1 ( ) Word device which will store the operation result ANY_INT
This function performs division ( / ) using word [signed]/double word [signed] data stored in devices specified in and , and outputs the remainder to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]

s1 s2 · s1 s2 d · s1 s2

5.3 Standard Arithmetic Functions
In this program, division is performed using double word [signed] data stored in devices specified in and , and the remainder is output to a device specified in using the data type of data stored in devices specified in and .
_IN2
g_dint3:=g_dint1 MOD g_dint2;
_IN1
_IN2
g_bool3 := MOD_E(g_bool1, g_dint1, g_dint2, g_dint3);

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains raised result, and outputs it.
EXPT
*1 Label 2 Label 1 In1 D10 In2
EXPT_E
Label 1 In1 D10 In2
In1 ( ) Data to be raised, or word device which stores such data FLOAT (Single Precision)
In2 ( ) Power data, or word device which stores such data ANY_NUM
*1 ( ) Word device which will store the operation result FLOAT (Single Precision)
This function raises float (single precision) data stored in a device specified in (to the power of the value stored in a device specified in ), and outputs the operation result to a device specified in .
16.0 s2 Float (single

5.3 Standard Arithmetic Functions
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, the value stored in a device specified in is raised to the power of the value stored in a device specified in , and the operation result is output to a device specified in using the data type of data stored in a device specified in .
g_real2:=EXPT(g_real1,g_int1);
g_bool3:=EXPT_E(g_bool1,g_real1,g_int1,g_real2);

5.3 Standard Arithmetic Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function transfers data stored in a device to another device.
MOVE
*1 D10 D0 _IN
MOVE_E
D0 _IN
_IN ( ) Transfer source data, or word device which stores such data ANY
*1 ( ) Transfer destination word device ANY
This function transfers data stored in a device specified in to a device specified in .
Word [signed] data s Word [signed] data d
s d

5.3 Standard Arithmetic Functions
In this program, word [signed] data stored in a device specified in is transferred to a device specified in .
MOVE g_int1 _IN g_int2
g_int2:=MOVE(g_int1);
g_bool3:=MOVE_E(g_bool1,g_int1,g_int2);
g_int1 _IN · g_int2

5.4 Standard Bit Shift Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function shifts data of specified bit length leftward by the specified number of bits.


_IN ( ) Word device which stores data to be shifted leftward ANY_BIT
*1 ( ) Word device which will store data obtained by shift ANY_BIT

270FH 0 0 1 0 0 1 1 1 0 1
0 1 0 F00H
d s · n

5.4 Standard Bit Shift Functions
In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is shifted leftward by "n" bits, and the obtained data is output to a device specified in using the data type of data stored in a device specified in .
_N
g_word2:=SHL(g_word1,g_const_word1);
_IN
_N
g_bool3:=SHL_E(g_bool1,g_word1,g_const_word1,g_word2);

5.4 Standard Bit Shift Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function shifts data of specified bit length rightward by the specified number of bits.
SHR
*1 D10 D0 _IN _K K1
SHR_E
D0 _IN _N K1
_IN ( ) Word device which stores data to be shifted rightward ANY_BIT
_K,_N ( ) Number of shifted bits ANY_BIT
*1 ( ) Word device which will store data obtained by shift ANY_BIT
d s (Word [unsigned]/ bit string [16-bit] data)
(Word [unsigned]/ bit string [16-bit] data)
270FH 0 0 1 0 0 1 1 1 0 1
0 1 0 0 1 1 1 27H
These bits become "0".

5.4 Standard Bit Shift Functions
In this program, word [unsigned]/bit string [16-bit] data stored in a device specified in is shifted rightward by "n" bits, and the obtained data is output to a device specified in using the data type of data stored in a device specified in .
_K
g_word2:=SHR(g_word1,g_const_word1);
_IN
_N
g_bool3:=SHR_E(g_bool1,g_word1,g_const_word1,g_word2);

5.5 Standard Bitwise Boolean Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains the logical product of two or more bits, and outputs it.
AND_E
M0 _IN _IN M10
*1 M20
2. Variable
_IN ( …) Device used to obtain the logical product ANY_BIT
*1 ( ) Device which will store the operation result ANY_BIT
1 0 1
0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0 0 0 1 0 0 1 0 1 0 0
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
s1 s2 · s1 s2 · Logical product

5.5 Standard Bitwise Boolean Functions
In this program, the logical product is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .
AND_E EN ENO g_bool1
g_bool3:=AND_E(g_bool1,g_word1,g_word2,g_word3);

5.5 Standard Bitwise Boolean Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains the logical sum of two or more bits, and outputs it.
OR_E
M0 _IN _IN M10
*1 M20
_IN ( …) Device used to obtain the logical sum ANY_BIT
*1 ( ) Device which will store the operation result ANY_BIT
1 1 0 0 1 0 1
0 1 0 0 0 1 1 0 1 0 0
1 1 0 0 1 0 0 1
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
s1 s2 · d s1 · Logical sum

5.5 Standard Bitwise Boolean Functions
In this program, the logical sum is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .
OR_E EN ENO g_bool1
g_bool3:=OR_E(g_bool1,g_word1,g_word2,g_word3);

5.5 Standard Bitwise Boolean Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains the exclusive logical sum of two or more bits, and outputs it.
XOR_E
M0 _IN _IN M10
*1 M20
_IN ( …) Device used to obtain the exclusive logical sum ANY_BIT
*1 ( ) Device which will store the operation result ANY_BIT
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 0 0 1 1 0 1 0
1 0 1 1 0 0 0 1 0 1 0 1 1 0 1 0
s1 s2 · s1 s2 · Exclusive logical sum

5.5 Standard Bitwise Boolean Functions
s1 s2 s3 s4
When the number of "_IN" is 3
When the number of "_IN" is 4
When the number of "_IN" is 5
TRUE
FALSE
TRUE
XOR
XOR
XOR
XOR
TRUE
TRUE
TRUE
TRUE
s2 s3 s4 s5
After that, the exclusive logical sum is obtained the required number of times.
FALSE
TRUE
FALSE
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
In this program, the exclusive logical sum is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in devices specified in and , and the operation result is output to a device specified in using the data type of data stored in devices specified in and .
XOR_E EN ENO g_bool1
g_bool3:=XOR_E(g_bool1,g_word1,g_word2,g_word3);

5.5 Standard Bitwise Boolean Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains the logical negation of bits, and outputs it.
NOT
M10 _IN M0 *1
NOT_E
M0 _IN
*1 M10
_IN ( ) Device used to obtain the logical negation ANY_BIT
*1 ( ) Device which will store the operation result ANY_BIT
This function obtains the logical negation using each bit of bit/word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored in a device specified in , and outputs the operation result to a device specified in using the data type of data stored in a device specified in . Example: When the data type is word [unsigned]/bit string [16-bit]
0 1 1 0 1 0 1 1 0 1
1 0 0 1 0 1 0 0 1 0
d s · Logical negation

5.5 Standard Bitwise Boolean Functions
In this program, the logical negation is obtained using each bit of word [unsigned]/bit string [16-bit] data stored in a device specified in , and the operation result is output to a device specified in using the data type of data stored in a device specified in .
NOT g_word1=16#AAAA _IN g_word2=16#5555
g_word2:= NOT(g_word1);
g_bool3:=NOT_E(g_bool1,g_word1,g_word2);
s d · g_word1 _IN · g_word2

5.6 Standard Selection Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function selects either one between two data in accordance with the input condition, and outputs the selection result.


_G ( ) Bit data used as the selection condition Bit
_IN0 ( ) Selectable data, or word device which stores such data ANY
_IN1 ( ) Selectable data, or word device which stores such data ANY
*1 ( ) Word device which will store the selection result ANY
This function outputs either one between the values stored in devices specified in and in accordance with the value stored in a device specified in to a device specified in using the data type of data stored in a device specified in and . When the value stored in a device specified in is "FALSE", this function outputs the value stored in a device specified in to a device specified in . When the value stored in a device specified in is "TRUE", this function outputs the value stored in a device specified in to a device specified in . Example: When the data type of input variables and is word [signed]
SEL G _IN0 _IN1 1234 Word [signed] data
1234 Word [signed] data

5.6 Standard Selection Functions
In this program, either one between the values stored in devices specified in and is output in accordance with the value stored in a device specified in to a device specified in using the data type of data stored in devices specified in and .
_IN0
_IN1
g_word3:=SEL(g_bool1,g_word1,g_word2);
_G
_IN0
g_bool3:=SEL_E(g_bool1,g_bool2,g_word1,g_word2,g_word3);

5.6 Standard Selection Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function searches the maximum value among data, and outputs the maximum value.
MAXIMUM
*1 D20 D0 _IN _IN D10
MAXIMUM_E(EN,_IN,_IN,Output label); Example: MAXIMUM_E(X000,D0,D10,D20);
MAXIMUM_E
EN ENO
D0 _IN _IN D10
_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Word device which will store the maximum value ANY_SIMPLE
and to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]
s1 s2 d s1
5678 5678 Word [signed] data
Word [signed] data · Word [signed] data

5.6 Standard Selection Functions
In this program, the maximum value among word [signed] data stored in devices specified in and is output to a device specified in using the data type of data stored in devices specified in and .
_IN
g_int3:=MAXIMUM(g_int1,g_int2);
_IN
_IN
g_bool3:=MAXIMUM_E(g_bool1,g_int1,g_int2,g_int3);

5.6 Standard Selection Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function searches the minimum value among data, and outputs the minimum value.
MINIMUM
*1 D20 D0 _IN _IN D10
MINIMUM_E(EN,_IN,_IN,Output label); Example: MINIMUM_E(X000,D0,D10,D20);
MINIMUM_E
D0 _IN _IN D10
_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Word device which will store the minimum value ANY_SIMPLE
and to a device specified in using the data type of data stored in devices specified in and . Example: When the data type is word [signed]
s1 s2 d s1
1234 Word [signed] data
1234 Word [signed] data 5678
Word [signed] data

5.6 Standard Selection Functions
In this program, the minimum value among word [signed] data stored in devices specified in and is output to a device specified in using the data type of data stored in devices specified in and .
_IN
g_int3:=MINIMUM(g_int1,g_int2);
_IN
_IN
g_bool3:=MINIMUM_E(g_bool1,g_int1,g_int2,g_int3);

5.6 Standard Selection Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function judges whether data is located within the range between the upper limit value and the lower limit value.


_MN ( ) Lower limit data, or word device which stores such data ANY_SIMPLE
_IN ( ) Input data, or word device which stores such data ANY_SIMPLE
_MX ( ) Upper limit data, or word device which stores such data ANY_SIMPLE
*1 ( ) Word device which will store the output data ANY_SIMPLE
This function outputs data whose type is same as the data stored in devices specified in , and to a device specified in in accordance with ANY_SIMPLE type data stored in devices specified in , and .


5.6 Standard Selection Functions
An operation error occurs when this function is executed in the following setting status. The error flag M8067 turns ON, and D8067 stores the error code K6706. Contents of a device specified in > Contents of a device specified in (Lower limit data) (Upper limit data)
In this program, data whose type is same as the data stored in devices specified in , and is output to a device specified in in accordance with ANY_SIMPLE type data stored in devices specified in , and .
_IN
g_int4:=LIMITATION(g_int1,g_int2,g_int3);
_MN
_IN
g_bool3:=LIMITATION_E(g_bool1,g_int1,g_int2,g_int3,g_int4);

5.6 Standard Selection Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function selects data, and outputs the selected data.


_K ( ) Selection data, or word device which stores such data Word [signed]
_IN ( …) Selectable data, or word device which stores such data ANY
*1 Word device which will store the selected data ANY
a) When the value specified in is "1", this function outputs the value stored in a device specified in to a device specified in .
b) When the value specified in is "n", this function outputs the value stored in a device specified in to a device specified in . Example: When the data type is word [signed]


5.6 Standard Selection Functions
In this example, either one among values stored in devices specified in … is output to a device specified in in accordance with the value specified in using the data type of data stored in devices specified in ….
_IN
g_int4:=MUX(g_int1,g_int2,g_int3);
_K
_IN
g_bool3:=MUX_E(g_bool1,g_int1,g_int2,g_int3,g_int4);

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "> (larger)".
GT_E
_IN D0
*1 M0
_IN D10
_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
s1 s2 s2 s3 sn sn
a) This function outputs "TRUE" when all comparison results are " (n-1) > (n)".
b) This function outputs "FALSE" when any comparison result is " (n-1) ≤ (n)".
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
s s · s s

5.7 Standard Comparison Functions
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=GT_E(g_bool1,g_int1,g_int2,g_bool2);
s1 s2 · g_int1 g_int2

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "≥ (larger or equal)".


_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
s1 s2 s2 s3 sn sn
a) This function outputs "TRUE" when all comparison results are " (n-1) ≥ (n)".
b) This function outputs "FALSE" when any comparison result is " (n-1) < (n)".
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=GE_E(g_bool1,g_int1,g_int2,g_bool2);

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "= (equal)".
EQ_E
_IN D0
*1 M0
_IN D10
_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
s1 s2 s2 s3 sn sn
a) This function outputs "TRUE" when all comparison results are " (n-1) = (n)".
b) This function outputs "FALSE" when any comparison result is " (n-1) ≠ (n)".
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=EQ_E(g_bool1,g_int1,g_int2,g_bool2);

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "≤ (smaller or equal)".
LE_E
_IN D0
*1 M0
_IN D10
_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
s1 s2 s2 s3 sn sn
a) This function outputs "TRUE" when all comparison results are " (n-1) ≤ (n)".
b) This function outputs "FALSE" when any comparison result is " (n-1) > (n)".
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
s s · s s

5.7 Standard Comparison Functions
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=LE_E(g_bool1,g_int1,g_int2,g_bool2);
s1 s2 · g_int1 g_int2

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "< (smaller)".


_IN ( …) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
s1 s2 s2 s3 sn sn
a) This function outputs "TRUE" when all comparison results are " (n-1) < (n)".
b) This function outputs "FALSE" when any comparison result is " (n-1) ≥ (n)".
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN
_IN
g_bool3:=LT_E(g_bool1,g_int1,g_int2,g_bool2);

5.7 Standard Comparison Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function compares data with regard to "≠ (unequal)".
NE_E
_IN1 D0
*1 M0
_IN2 D10
_IN1 ( ) Compared data, or word device which stores such data ANY_SIMPLE
_IN2 ( ) Compared data, or word device which stores such data ANY_SIMPLE
*1 ( ) Device which will store the comparison result Bit
This function compares the contents of devices specified in and , and outputs the operation result expressed as the bit type data to a device specified in . This function executes comparison [ ≠ ].
a) This function outputs "TRUE" when in the case of " ≠ "
b) This function outputs "FALSE" when in the case of " = "
When handling 32-bit data in structured programs, you cannot specify 16-bit devices directly, different from simple projects. Use labels when handling 32-bit data. You can specify 32-bit counters directly, however, because they are 32-bit devices. Use global labels when specifying labels.

5.7 Standard Comparison Functions
In this program, the contents of devices specified in and are compared, and the operation result is output to a device specified in .
_IN1
_IN2
g_bool3:=NE_E(g_bool1,g_int1,g_int2,g_bool2);
s1 s2 · g_int1 g_int2


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function obtains a character string from a specified position.
Label 2 Label 1 _IN D10 _L D20 _P
_IN ( ) Head word device which stores a character string String
_L ( ) Word device which stores the number of characters to be obtained Word [signed]
_P ( ) Word device which stores the head character position of a character string to be obtained Word [signed]
*1 ( ) Head word device which will store the obtained character string String

5.8 Standard Character String Functions
"EF123"
High-order byte Low-order byte
High-order byte Low-order byte
Head character position of a character string to be extracted = 5th character
44H(D)
43H(C)
31H(1) 32H(2)
46H(F) 45H(E)
00H 33H(3)
32H(2)
31H(1)
34H(4)
33H(3)
00H
35H(5)
Number of characters to be extracted = 5
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

5.8 Standard Character String Functions
In this program, specified number of characters are extracted from an arbitrary position of a character string stored in devices specified in , and the obtained data is output to devices specified in .
_L
g_string2:=MID(g_string1,g_int1,g_int2);
_IN
_L
g_bool3:=MID_E(g_bool1,g_string1,g_int1,g_int2,g_string2);

5.8 Standard Character String Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function connects character strings.
CONCAT
Label 3 Label 1 Label 2
CONCAT_E(EN,_IN,_IN,Output label); Example: CONCAT_E(X000,Label 1,Label 2, Label 3);
CONCAT_E
Label 1 _IN _IN Label 2
Head word device which stores the data (character string) to be connected, or directly specified character string String
*1 ( ) Head word device which will store the connected data (character string) String
*1 Label 3

5.8 Standard Character String Functions
"ABCDE123456"
High-order byte Low-order byte
High-order byte Low-order byte High-order byte Low-order byte
32H(2) 31H(1)
42H(B)
41H(A)
43H(C) 44H(D)
33H(3) 34H(4)
44H(D)
43H(C)
00H 45H(E)
36H(6)
35H(5)
31H(1) 45H(E)
0000H
33H(3)
32H(2)
35H(5)
34H(4)
00H
36H(6)
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

5.8 Standard Character String Functions
In this program, a character string stored in devices specified in is connected after a character string stored in devices specified in , and the character string obtained by connection is output to devices specified in .
_IN
g_string3:=CONCAT(g_string1,g_string2);
_IN
_IN
g_bool3:=CONCAT_E(g_bool1,g_string1,g_string2,g_string3);


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
*1 Label 3 Label 1 _IN1 _IN2 Label 2
INSERT_E(EN,_IN1,_IN2,_P, Output label); Example: INSERT_E(X000,Label 1,Label 2, D20,Label 3);
_IN1 ( ) Head word device which stores a character string to get insertion String
_IN2 ( ) Head word device which stores a character string to be inserted String
_P ( ) Word device which stores a character position to get insertion Word [signed]
*1 ( ) Head word device which will store a character string obtained by insertion String

5.8 Standard Character String Functions
1) This function inserts a character string stored in devices specified in into an arbitrary position (counted from the head) of a character string stored in devices specified in , and outputs the character string obtained by insertion to devices specified in . The value specified in specifies the position from which the character string stored in devices specified in is inserted. After inserting a character string stored in devices specified in into a character string stored in devices specified in , this function ignores "00H" which indicates the end of a character string stored in devices specified in . Example: When "4" is specified in
High-order byte Low-order byte
High-order byte Low-order byte
42H(B)
41H(A)
Insertion start position = 4th character
31H(1)
43H(C)
00H 45H(E)
33H(3) 32H(2)
35H(5)
34H(4)
44H(D)
36H(6)
00H
45H(E)
High-order byte Low-order byte
33H(3) 34H(4)
36H(6)
35H(5)
0000H
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

5.8 Standard Character String Functions
In this program, a character string stored in devices specified in is inserted into an arbitrary position (counted from the head) of a character string stored in devices specified in , and the character string obtained by insertion is output to devices specified in .
_IN2
g_string3:=INSERT(g_string1,g_string2,g_int1);
_IN1
_IN2
g_bool3:=INSERT_E(g_bool1,g_string1,g_string2,g_int1,g_string3);

5.8 Standard Character String Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function deletes a character string.

DELETE_E(EN,_IN,_L ,_P, Output label); Example: DELETE_E(X000, Label 1, D10, D20, Label 2);

_IN ( ) Head word device which stores a character string to get deletion String
_L ( ) Number of characters to be deleted Word [signed]
_P ( ) Head position to get deletion Word [signed]
*1 ( ) Head word device which will store a character string remaining after deletion String

n1 · n2

5.8 Standard Character String Functions
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, specified number of characters are deleted from an arbitrary position of a character string stored in devices specified in , and the character string remaining after deletion is output to devices specified in .
_L
g_string2:=DELETE(g_string1,g_int1,g_int2);
_L
_P
g_bool3:=DELETE_E(g_bool1,g_string1,g_int1,g_int2,g_string2);

5.8 Standard Character String Functions
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function replaces a character string.
*1 Label 3 Label 1 _IN1 _IN2 Label 2
D20 _L _P D30
REPLACE_E(EN,_IN1,_IN2, _L ,_P,Output label); Example: REPLACE_E(X000,Label 1, Label 2,D20,D30,Label 3);
Label 1 _IN1 _IN2 Label 2
D20 _L _P D30
_IN1 ( ) Head word device which stores a character string to be replaced String
_IN2 ( ) Head word device which stores a replacement character string String
_L ( ) Word device which stores the number of characters to be replaced Word [signed]
_P ( ) Word device which stores the head character position to be replaced in a character string to be replaced Word [signed]
*1 ( ) Head word device which will store a character string obtained by replacement String
*1 Label 3 · n1 · n2

5.8 Standard Character String Functions
High-order byte Low-order byte
High-order byte Low-order byte
41H(A)
42H(B)
41H(A)
44H(D)
43H(C)
44H(D)
43H(C)
46H(F) 45H(E)
Replacement start position = 5th character
48H(H)
47H(G)
34H(4)
33H(3)
32H(2)
31H(1)
32H(2)
35H(5)
00H
33H(3)
00H
33H(3)
s2 Number of characters to be replaced = 5 n1
High-order byte Low-order byte
33H(3) 34H(4)
36H(6)
35H(5)
0000H

5.8 Standard Character String Functions
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.
In this program, specified number of characters starting from an arbitrary position of a character string stored in devices specified in are replaced with a character string stored in devices specified in , and the character string obtained by replacement is output to devices specified in .
_IN2
g_int1=6 _L g_int2=3 _P
g_string3:=REPLACE(g_string1,g_string2,g_int1,g_int2);
_IN1
_IN2
g_bool3:=REPLACE_E(g_bool1,g_string1,g_string2,g_int1,g_int2,g_string3);


FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
_IN1 ( ) Head word device which stores a character string to get search String
_IN2 ( ) Head word device which stores a character string to be searched String
*1 ( ) Head word device which will store the search result Word [signed]

5.8 Standard Character String Functions
High-order byte Low-order byte
41H(A)
44H(D)
43H(C)
32H(2) 31H(1)
34H(4)
33H(3)
36H(6)
35H(5)
00H
37H(7)
Search of character string
High-order byte Low-order byte
33H(3) 34H(4)
0000H
An operation error occurs in the following cases. The error flag M8067 turns ON, and D8067 stores the error code.

5.8 Standard Character String Functions
In this program, a character string stored in devices specified in is searched from the beginning of a character string stored in devices specified in , and the search result is output to devices specified in .
_IN2
g_int1:=FIND(g_string1,g_string2);
_IN1
_IN2
g_bool3:=FIND_E(g_bool1,g_string1,g_string2,g_int1);

5.9 Functions Of Time Data Types
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function adds time data.
ADD_TIME
*1 Label 3 Label 1 _IN1 Label 2 _IN2
ADD_TIME_E(EN,_IN1,_IN2, Output label); Example: ADD_TIME_E(X000,Label 1, Label 2,Label 3);
ADD_TIME_E
Label 1 _IN1 Label 2 _IN2
_IN1 ( ) Head word device which stores time data to get addition Time
_IN2 ( ) Head word device which stores addition time data Time
*1 ( ) Head word device which will store the operation result Time
This function performs addition ( + ) of time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .
s1 s2 s1 s2
*1 Label 3

5.9 Functions Of Time Data Types
Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"
bit operation) or more
-2 , -1 , 0 , -32,768
-1 , 0 , 1
32,767 , 0 , 1 , 2
The most significant bit of data is "1".
The most significant bit of data is "0".
-2 , -1 , 0 , -2,147,483,648
-1 , 0 , 1
2,147,483,647 , 0 , 1 , 2
In this program, addition ( + ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .
ADD_TIME g_time1 _IN1 g_time3 g_time2 _IN2
g_time3:=ADD_TIME(g_time1,g_time2);
g_time1 _IN1 g_time2 _IN2
g_bool3:=ADD_TIME_E(g_bool1,g_time1,g_time2,g_time3);

5.9 Functions Of Time Data Types
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs subtraction of time data.
SUB_TIME
*1 Label 3 Label 1 _IN1 Label 2 _IN2
SUB_TIME_E(EN,_IN1,_IN2, Output label); Example: SUB_TIME_E(X000,Label 1, Label 2,Label 3);
SUB_TIME_E
Label 1 _IN1 Label 2 _IN2
_IN1 ( ) Head word device which stores time data to get subtraction Time
_IN2 ( ) Head word device which stores subtraction data Time
*1 ( ) Head word device which will store the operation result Time
This function performs subtraction ( - ) of time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .
s1 s2 s1 s2
*1 Label 3

5.9 Functions Of Time Data Types
Either of the flags shown in the table below turns ON or OFF in accordance with the operation result.
M8020 Zero ON : When the operation result is "0" OFF: When the operation result is any other than "0"
bit operation) or more
-2 , -1 , 0 , -32,768
-1 , 0 , 1
32,767 , 0 , 1 , 2
The most significant bit of data is "1".
The most significant bit of data is "0".
-2 , -1 , 0 , -2,147,483,648
-1 , 0 , 1
2,147,483,647 , 0 , 1 , 2
In this program, subtraction ( - ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .
SUB_TIME g_time1 _IN1 g_time3 g_time2 _IN2
g_time3:=SUB_TIME(g_time1,g_time2);
g_time1 _IN1 g_time2 _IN2
g_bool3:=SUB_TIME_E(g_bool1,g_time1,g_time2,g_time3);

5.9 Functions Of Time Data Types
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs multiplication of time data.
MUL_TIME
*1 Label 3 Label 1 _IN1 Label 2 _IN2
MUL_TIME_E(EN,_IN1,_IN2, Output label); Example: MUL_TIME_E(X000,Label 1, Label 2,Label 3);
MUL_TIME_E
Label 1 _IN1 Label 2 _IN2
_IN1 ( ) Head word device which stores time data to get multiplication Time
_IN2 ( ) Multiplication data, or head word device which stores such data ANY_NUM
*1 ( ) Head word device which will store the operation result Time
This function performs multiplication( × ) using time data stored in devices specified in and , and outputs the operation result expressed as time data to devices specified in .
*1 Label 3 · s1 s2 s1 · s2 d

5.9 Functions Of Time Data Types
In this program, multiplication ( × ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .
MUL_TIME g_time1 _IN1 g_time2 g_int1 _IN2
g_time2:=MUL_TIME(g_time1,g_int1);
g_time1 _IN1 g_int1 _IN2
g_bool3:=MUL_TIME_E(g_bool1,g_time1,g_int1,g_time2);

5.9 Functions Of Time Data Types
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function performs division using time data.
DIV_TIME
*1 Label 3 Label 1 _IN1 Label 2 _IN2
DIV_TIME_E(EN,_IN1,_IN2, Output label); Example: DIV_TIME_E(X000,Label 1, Label 2,Label 3);
DIV_TIME_E
Label 1 _IN1 Label 2 _IN2
_IN1 ( ) Head word device which stores time data to get division Time
_IN2 ( ) Division data, or head word device which stores such data ANY_NUM
*1 ( ) Head word device which will store the operation result Time
s1 s2 s1 s2
*1 Label 3

5.9 Functions Of Time Data Types
In this program, division ( / ) is performed using time data stored in devices specified in and , and the operation result expressed as time data is output to devices specified in .
DIV_TIME g_time1 _IN1 g_time2 g_int1 _IN2
g_time2:=DIV_TIME(g_time1,g_int1);
g_time1 _IN1 g_int1 _IN2
g_bool3:=DIV_TIME_E(g_bool1,g_time1,g_int1,g_time2);

6.1 R_TRIG(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block detects the rising edge of a signal, and outputs pulse signal.
R_TRIG
Q M10 _CLK M0
R_TRIG_E
_CLK M0
Q M10
*1. Refer to caution points.
_CLK ( ) Input signal whose rising edge is to be detected Bit
Q ( ) Output signal Bit
This function block sets to ON a device specified in when a device specified in turns ON, and keeps ON the device specified in only for 1 operation cycle.
*1. Set the instance when using a function block. Describe the instance name when programming a function block.
Instance name · Instance name · d s

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.
g_bool1 _CLK Q g_bool2
R_TRIG_Instance(_CLK:=g_bool1);g_bool2:=R_TRIG_Instance.Q;
EN ENO
R_TRIG_E_Instance(EN:=X000,_CLK:=g_bool1);Y010=R_TRIG_E_Instance.ENO; g_bool2:=R_TRIG_E_Instance.Q;

6.2 F_TRIG(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block detects the falling edge of a signal, and outputs pulse signal.
F_TRIG
Q M10 _CLK M0
F_TRIG_E
_CLK M0
Q M10
*1. Refer to caution points.
_CLK ( ) Input signal whose falling edge is to be detected Bit
Q ( ) Output signal Bit
This function block sets to ON a device specified in when a device specified in turns OFF, and keeps ON the device specified in only for 1 operation cycle.
*1. Set the instance when using a function block. Describe the instance name when programming a function block.
Instance name · Instance name · d s

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.
g_bool1 _CLK Q g_bool2
F_TRIG_Instance(_CLK:=g_bool1);g_bool2:=F_TRIG_Instance.Q;
EN ENO
F_TRIG_E_Instance(EN:=X000,_CLK:=g_bool1);Y010=F_TRIG_E_Instance; g_bool2:=F_TRIG_E_Instance.Q;

6.3 CTU(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block counts up the number of times of rising of a signal.

*1. Refer to caution points.

CV ( ) Number of times of rising Word [signed]
This function block counts up (adds "1" to) the value stored in a device specified in when a device specified in turns ON. When the count value reaches a value specified in , a device specified in turns ON. When a device specified in turns ON, this function block turns OFF a device specified in , and resets the count value of a device specified in .
*1. Set the instance when using a function block. Describe the instance name when programming a function block.
n d1 · s2 d1

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 .
g_bool1 CU Q g_bool3 g_int2 g_bool2 RESET CV
CTU_Instance(CU:=g_bool1,RESET:=g_bool2,PV:=g_int1); g_bool3:=CTU_Instance.Q; g_int2:=CTU_Instance.CV;
CTU_E
EN ENO
CV g_int2 g_bool2 RESET g_int1 PV
CTU_E_Instance(EN:=M10,CU:=g_bool1,RESET:=g_bool2,PV:=g_int1); M11:=CTU_E_Instance.ENO; g_bool3:=CTU_E_Instance.Q; g_int2:=CTU_E_Instance.CV;

6.4 CTD(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block counts down the number of times of rising of a signal.

*1. Refer to caution points.

Q ( ) Output signal (which turns ON when the current counter value becomes "0" or less) Bit
CV ( ) Number of times of rising Word [signed]
This function block counts down (subtracts "1" from) the value stored in a device specified in when a device specified in turns ON. The value specifies the initial value for subtraction. This function block turns ON a device specified in when the count value becomes "0". When a device specified in turns ON, this function block turns OFF a device specified in , and sets the initial value for subtraction specified in to the count value of a device specified in .
*1. Set the instance when using a function block. Describe the instance name when programming a function block.
n · s2 d1 · n d2

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".
g_bool1 CD Q g_bool3 g_int2 g_bool2 LOAD CV
CTD_Instance(CD:=g_bool1,LOAD:=g_bool2,PV:=g_int1); g_bool3:=CTD_Instance.Q; g_int2:=CTD_Instance.CV;
CTD_E
EN ENO
CV g_int2 g_bool2 LOAD g_int1 PV
CTD_E_Instance(EN:=M10,CD:=g_bool1,LOAD:=g_bool2,PV:=g_int1); M11:=CTD_E_Instance.ENO; g_bool3:=CTD_E_Instance.Q; g_int2:=CTD_E_Instance.CV;

6.5 CTUD(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block counts up/down the number of times of rising of a signal.

CTUD(CU,CD,RESET,LOAD,PV); *1 Example: Instance name(CU:=M0, CD:=M10,RESET:=M20,LOAD:= M30,PV:=D0); M40:=Instance name.QU; M50:=Instance name.QD; D10:=Instance name.CV;
CTUD_E(EN,CU,CD,RESET,LOA D,PV); *1 Example: Instance name(EN=X000, CU:=M0,CD:=M10,RESET:=M20, LOAD:=M30,PV:=D0); M40:=Instance name.QU; M50:=Instance name.QD; D10:=Instance name.CV;
*1. Refer to caution points.

QD ( ) Output signal (which turns ON when the current counter value becomes "0" or less) Bit
This function block counts up (adds "1" to) the value stored in a device specified in when a device specified in turns ON. This function block counts down (subtracts "1" from) the value stored in a device specified in when a device specified in turns ON. specifies the maximum value of the counter. When the value stored in a device specified in reaches the maximum value of the counter, a device specified in turns ON. When the value stored in a device specified in becomes "0", a device specified in turns ON.
n · d3 n · d3 d2

This function block resets the count value of a device specified in when a device specified in turns ON. This function block sets the value stored in to a device specified in when a device specified in turns ON.
*1. Set the instance when using a function block. Describe the instance name when programming a function block.
d3 s3 · n d3 s4

In this program, the number of times the bit data stored in a device specified in turns ON from OFF is counted up (added by "1"). When the value stored in a device specified in reaches the value specified in , a device specified in turns ON. At the same time, the number of times the bit data stored in a device specified in turns ON from OFF is counted down (subtracted by "1"). When the value stored in a device specified in becomes "0", a device specified in turns ON.
g_bool1 CU QU g_bool5 g_bool6 g_bool2 CD QD
g_int2 CV g_bool3 RESET
CTUD_Instance(CU:=g_bool1,CD:=g_bool2,RESET:=g_bool3,LOAD:=g_bool4,PV:=g_int1); g_bool5:=CTUD_Instance.QU; g_bool6:=CTUD_Instance.QD; g_int2:=CTUD_Instance.CV;
CTUD_E
EN ENO
QD g_bool6 g_bool2 CD g_bool3 RESET
CV g_int2 g_bool4 LOAD g_int1 PV
CTUD_E_Instance(EN:=M0,CU:=g_bool1,CD:=g_bool2,RESET:=g_bool3,LOAD:=g_bool4,PV:=g_int1); M10:=CTUD_E_Instance.ENO; g_bool5:=CTUD_E_Instance.QU; g_bool6:=CTUD_E_Instance.QD; g_int2:=CTUD_E_Instance.CV;

6.6 TP(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block keeps ON a signal for specified duration.
TP
Q M10 IN M0
PT Label 1 ET Label 2
TP_E
Q M10 IN M0
PT Label 1 ET Label 2
*1. Refer to caution points.
IN ( ) ON start input signal Bit
PT ( ) ON duration data Time
Q ( ) Output signal Bit
ET ( ) ON duration current value Time
When a device specified in turns ON, this function block turns ON a device specified in , and keeps it ON for duration specified in . The elapsed time while a device specified in remains ON is set to a device specified in . A device specified in turns OFF when the elapsed time reaches the set value. Even if a device specified in turns OFF, this function block does not reset the elapsed time. When a device specified in turns ON from OFF next time, this function block resets the elapsed time and turns ON again a device specified in .
*1. Set the instance when using a function block. Describe the instance name when programming a function block.

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.
g_bool2 PT T#10s g_time1
TP_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TP_Instance.Q; g_time1:=TP_Instance.ET;
EN ENO
T#10s g_time1 PT ET
TP_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TP_E_Instance.ENO; g_bool2:=TP_E_Instance.Q; g_time1:=TP_E_Instance.ET;

6.7 TON(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block turns ON after specified time.
TON
Q M10 IN M0
PT Label 1 ET Label 2
TON_E
Q M10 IN M0
PT Label 1 ET Label 2
*1. Refer to caution points.
IN ( ) Input signal Bit
PT ( ) ON start time data Time
Q ( ) Output signal Bit
ET ( ) ON start time current value Time
When a device specified in turns ON, this function block turns ON a device specified in after the time specified in . The delay elapsed time until a device specified in turns ON is set to a device specified in . When a device specified in turns OFF, this function block turns OFF a device specified in and resets the delay elapsed time.
*1. Set the instance when using a function block. Describe the instance name when programming a function block.

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.
g_bool2 PT T#10s g_time1
TON_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TON_Instance.Q; g_time1:=TON_Instance.ET;
EN ENO
T#10s g_time1 PT ET
TON_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TON_E_Instance.ENO; g_bool2:=TON_E_Instance.Q; g_time1:=TON_E_Instance.ET;

6.8 TOF(_E)
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
When the input signal turns OFF, this function block turns OFF the output signal after the specified time.
TOF
Q M10 IN M0
PT Label 1 ET Label 2
TOF_E
Q M10 IN M0
PT Label 1 ET Label 2
*1. Refer to caution points.
IN ( ) Input signal Bit
PT ( ) OFF duration data Time
Q ( ) Output signal Bit
ET ( ) OFF duration current value Time
When a device specified in turns ON, this function block turns ON a device specified in . When a device specified in turns OFF from ON, this function block turns OFF a device specified in after the time specified in . The elapsed time until a device specified in turns OFF is set to a device specified in . When a device specified in turns ON again, this function block turns ON a device specified in and resets the elapsed time.
*1. Set the instance when using a function block. Describe the instance name when programming a function block.

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.
g_bool2 PT T#10s g_time1
TOF_Instance(IN:=g_bool1,PT:=T#10s); g_bool2:=TOF_Instance.Q; g_time1:=TOF_Instance.ET;
EN ENO
T#10s g_time1 PT ET
TOF_E_Instance(EN:=M0,IN:=g_bool1,PT:=T#10s); M10:=TOF_E_Instance.ENO; g_bool2:=TOF_E_Instance.Q; g_time1:=TOF_E_Instance.ET;

6.9 COUNTER_FB_M
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This counter starts counting when the condition turns ON from OFF and generates an output when counting up to the set value. A counter initial value can be set.
COUNTER_FB_M Coil ValueOut Preset ValueIn
*1. Refer to "Cautions".
Coil Execution condition Bit
Preset Counter set value Word [signed]
ValueIn Counter initial value Word [signed]
ValueOut Counter current value ANY16
Status Counter output contact Bit
The counter starts counting when detecting the rising edge (from OFF to ON) of the input argument Coil. It does not start counting if the Coil remains ON. The counter starts counting from the value of input argument ValueIn. When the input argument Preset value is reached, the output argument Status turns ON. The current count value is stored in the output argument ValueOut.
COUNTER_FB_M Coil ValueOut Preset ValueIn
Value of Var_D10 1
Instance name (Coil:= Var_M0,Preset:=10,Valueln:=1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;
*1. Var_D10 is a global label and is defined as D10.
*2. Var_M10 is a global label and is defined as M10.

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

6.10 TIMER_10_FB_M
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block generates an output when the condition continues for the specified time. The initial value and setting value of the timer is multiplied by 10 ms.
TIMER_10_FB_M Coil ValueOut Preset ValueIn
TIMER_10_FB_M TIMER_10_FB_M(Coil,Preset, ValueIn); *1
*1. Refer to "Cautions".
Coil Execution condition Bit
Preset Timer set value Word [signed]
ValueIn Initial timer value Word [signed]
ValueOut Current timer value ANY16
Status Timer output contact Bit
Status Var_M10*2 Var_M0
10 Preset ValueIn 1
Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:= Instance name.Status;
*1. Var_D10 is a global label and is defined as D10.
*2. Var_M10 is a global label and is defined as M10.
*1. Set the instance when using the function block. Describe the instance name when programming the function block.

6.11 TIMER_CONT_FB_M
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block counts the period of time while the condition is satisfied, and generates an output when the timer counts up the specified time.

*1. Refer to "Cautions".


Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;
*1. Var_D10 is a global label and is defined as D10.
*2. Var_M10 is a global label and is defined as M10.

*1. Set the instance when using the function block. Describe the instance name when programming the function block.

6.12 TIMER_100_FB_M
FX3U(C) FX3G FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This function block generates an output when the condition continues for the specified time. The initial value and setting value of the timer is multiplied by 100 ms.

*1. Refer to "Cautions".


Instance name (Coil:= Var_M0,Preset:= 10,Valueln:= 1); Var_D10:=Instance name.ValueOut; Var_M10:=Instance name.Status;
*1. Var_D10 is a global label and is defined as D10.
*2. Var_M10 is a global label and is defined as M10.
*1. Set the instance when using the function block. Describe the instance name when programming the function block.

Addresses
The table below shows the correspondence between devices and addresses.
Device Address Device Address
Input relay X Xn %IXn X367 %IX247
Output relay Y Yn %QXn Y367 %QX247
Auxiliary relay M Mn %MX0.n M499 %MX0.499
Contact TS Tn %MX3.n TS191 %MX3.191
Coil TC Tn %MX5.n TC191 %MX5.191
Current value TN Tn %MW3.n %MD3.n
%MW3.191 %MD3.190
Contact CS Cn %MX4.n CS99 %MX4.99
Coil CC Cn %MX6.n CC99 %MX6.99
Current value CN Cn %MW4.n %MD4.n
%MW4.99 %MD4.98
Data register D Dn %MW0.n %MD0.n
%MW0.199 %MD0.198
Intelligent function unit device G Ux\Gn %MW14.x.n %MD14.x.n
%MW14.0.10 %MD14.0.9
Extension register R Rn %MW2.n %MD2.n
%MW2.32767 %MD2.32766
Extension file register ER ERn No correspondence - -
Pointer P Pn " "(NULL character) P4095 No correspondence
Interrupt pointer I In No correspondence - -
Nesting N Nn No correspondence - -
Z Zn %MW7.n %MD7.n
%MW7.7 %MD7.6
V Vn %MW6.n V7 %MW6.7
State S Sn %MX2.n S4095 %MX2.4095

Warranty
Please confirm the following product warranty details before using this product.
1. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company. However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module.
[Gratis Warranty Term] The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place. Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs.
4. Exclusion of loss in opportunity and secondary loss from warranty liability Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user or third person by Failures of Mitsubishi products, special damages and secondary damages whether foreseeable or not , compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks.
2) Even within the gratis warranty term, repairs shall be charged for in the following cases. a) Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design. b) Failure caused by unapproved modifications, etc., to the product by the user. c) When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided. d) Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced. e) Relay failure or output contact failure caused by usage beyond the specified Life of contact (cycles). f) Failure caused by external irresistible forces such as fires or abnormal voltages, and failure caused by force majeure such as earthquakes, lightning, wind and water damage. g) Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. h) Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.
2) The Mitsubishi programmable logic controller has been designed and manufactured for applications in general industries, etc. Thus, applications in which the public could be affected such as in nuclear power plants and other power plants operated by respective power companies, and applications in which a special quality assurance system is required, such as for Railway companies or Public service purposes shall be excluded from the programmable logic controller applications. In addition, applications in which human life or property that could be greatly affected, such as in aircraft, medical applications, incineration and fuel devices, manned transportation, equipment for recreation and amusement, and safety devices, shall also be excluded from the programmable logic controller range of applications. However, in certain cases, some applications may be possible, providing the user consults their local Mitsubishi representative outlining the special requirements of the project, and providing that all parties concerned agree to the special circumstances, solely at the users discretion.

Revision History
1/2009 A First Edition.

MEMO



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 CODE 09R927
Effective Jul. 2009 Specifications are subject to change without notice.
Owners and our team usually reply within a day — and your question helps the next person too.
Be the first to ask — other owners or our team will answer.