

Structured Programming Manual
Basic & Applied Instruction



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

product associated with this manual.


This manual explains sequence instructions for structured programs provided by GX Works2. Refer to other manuals for devices, parameters and application functions. Refer to each corresponding manual for analog, communication, positioning control and special units and blocks.
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F
This manual explains devices and parameters for structured programs provided by GX Works2. FX
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.
FX3S/FX3G/FX3GC/FX3U/FX3UC User's Manual- Analog Control Edition
FX3S FX3G FX3GC FX3U FX3UC
This manual explains details of analog special function blocks and analog special adapters for FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs and PID instruction. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
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.
FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual -Positioning Edition
FX3S FX3G FX3GC FX3U FX3UC
This manual explains details of wiring, instructions and operations of the positioning function built in FX3S/FX3G/FX3GC/FX3U/FX3UC PLC main units. Explanation of instructions and instructions used in program examples are expressed for GX Developer.
(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) MELSEC-Q/L/F Structured Programming Manual (Fundamentals)
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F
This manual explains devices and parameters for structured programs provided by GX Works2. FX
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) MELSEC-Q/L/F Structured Programming Manual (Fundamentals)
This manual explains programming methods, specifications, functions, etc. required to create structured programs. Q/L/F
This manual explains devices and parameters for structured programs provided by GX Works2. FX
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 representative for acquiring required manuals.
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
MELSEC-Q/L/F Structured Programming Manual (Fundamentals) SH-080782 Additional Manual Programming methods, specifications, functions, etc. required to create structured programs 13JW06
FXCPU Structured Programming Manual [Device & Common] JY997D26001 Additional Manual Devices, parameters, etc. provided in structured projects of GX Works2 09R925
FXCPU Structured Programming Manual [Basic & Applied Instruction] JY997D34701 Additional Manual Sequence instructions provided in structured projects of GX Works2 09R926
FXCPU Structured Programming Manual [Application Functions] JY997D34801 Additional Manual Application functions provided in structured projects of GX Works2 09R927
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
I/O specifications, wiring and installation of the PLC main unit FX3U extracted from the FX3U Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3U Series User’s Manual - Hardware Edition.
FX3U Series Hardware Manual JY997D18801 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3U PLC main unit.
FX3U Series User's Manual- Hardware Edition JY997D16501 Additional Manual
I/O specifications, wiring and installation of the PLC main unit FX3UC (D, DS, DSS) extracted from the FX3UC Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3UC Series User’s Manual - Hardware Edition.
FX3UC (D, DS, DSS) Series Hardware Manual JY997D28601 Supplied with product
I/O specifications, wiring and installation of the PLC main unit FX3UC-32MT-LT-2 extracted from the FX3UC Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3UC Series User’s Manual - Hardware Edition.
FX3UC-32MT-LT-2 Hardware Manual JY997D31601 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3UC PLC main unit.
FX3UC Series User's Manual - Hardware Edition JY997D28701 Additional Manual
I/O specifications, wiring and installation of the PLC main unit FX3G extracted from the FX3G Series User’s Manual - Hardware Edition. For detailed explanation, refer to the FX3G Series User’s Manual - Hardware Edition.
FX3G Series Hardware Manual JY997D46001 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3G PLC main unit.
FX3G Series User's Manual- Hardware Edition JY997D31301 Additional Manual
I/O specifications, wiring and installation of the PLC main unit FX3GC extracted from the FX3GC Series User's Manual - Hardware Edition. For detailed explanation, refer to the FX3GC Series User's Manual - Hardware Edition.
FX3GC Series Hardware Manual JY997D45201 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3GC PLC main unit.
FX3GC Series User's Manual- Hardware Edition JY997D45401 Additional Manual
PLC main unit

Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
I/O specifications, wiring and installation of the PLC main unit FX3S extracted from the FX3S Series User's Manual - Hardware Edition. For detailed explanation, refer to the FX3S Series User's Manual - Hardware Edition.
FX3S Series Hardware Manual JY997D48301 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX3S PLC main unit.
FX3S Series User's Manual- Hardware Edition JY997D48601 Additional Manual
Details about the analog special function block (FX3U-4AD, FX3U-4DA, FX3UC-4AD) and analog special adapter (FX3U-****-ADP).
FX3S/FX3G/FX3GC/FX3U/FX3UC User's Manual- Analog Control Edition JY997D16701 Additional Manual
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
FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual - MODBUS Serial Communication Edition
JY997D26201 Additional Manual Explains the MODBUS serial communication network in FX3S/FX3G/FX3GC/FX3U/FX3UC PLCs. 09R626
FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual -Positioning Edition JY997D16801 Additional Manual Details about the positioning function built in the FX3S/FX3G/FX3GC/FX3U/FX3UC Series. 09R620
FX3U-CF-ADP User's Manual JY997D35401 Additional Manual Describes details of the FX3U-CF-ADP CF card special adapter. 09R720
FX1S/FX1N/FX1NC PLCs FX2N/FX2NC PLCs [whose production is finished]
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1S PLC main unit.
FX1S HARDWARE MANUAL JY992D83901 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX1N PLC main unit.
FX1N HARDWARE MANUAL JY992D89301 Additional Manual
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX2N PLC main unit.
FX2N HARDWARE MANUAL JY992D66301 Additional Manual
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

FX0S/FX0/FX0N/FXU/FX2C PLCs [whose production is finished]
Manual name Manual number Supplied with product
or Additional Manual Contents Model name code
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0/FX0N PLC main unit.
FX0/FX0N HARDWARE MANUAL JY992D47501 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FX0S PLC main unit.
FX0S HARDWARE MANUAL JY992D55301 Supplied with product
Details about the hardware including I/O specifications, wiring, installation and maintenance of the FXU/FX2C PLC main unit.
FX/FX2C HARDWARE MANUAL JY992D47401 Supplied with product
Details about simple N : N link, parallel link, computer link and no-protocol communication (RS instruction and FX2N-232IF).
FX Series User's Manual -Data Communication Edition JY997D16901 Additional Manual
Manuals of models whose production is finished
Production is finished for FX0S/FX0/FX0N/FXU/FX2C/FX2N/FX2NC 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
FX3GC Series or FX3GC PLC Generic name of FX3GC Series PLCs
FX3S Series or FX3S PLC Generic name of FX3S Series PLCs
FX2N Series or FX2N PLC Generic name of FX2N Series PLCs
FX2NC Series or FX2NC PLC Generic name of FX2NC Series PLCs
FX1N Series or FX1N PLC Generic name of FX1N Series PLCs
FX1NC Series or FX1NC PLC Generic name of FX1NC Series PLCs These products can only used in Japan.
FX1S Series or FX1S PLC Generic name of FX1S Series PLCs
FXU Series or FXU PLC Generic name of FXU(FX,FX2) Series PLCs
FX2C Series or FX2C PLC Generic name of FX2C Series PLCs
FX0N Series or FX0N PLC Generic name of FX0N Series PLCs
FX0S Series or FX0S PLC Generic name of FX0S Series PLCs
FX0 Series or FX0 PLC Generic name of FX0 Series PLCs
CF card special adapter Generic name of CF card special adapters
ST Abbreviation of structured text language
Structured ladder Abbreviation of ladder diagram language
FBD Abbreviation of function block diagram language
Q/L/F Structured Programming Manual (Fundamentals) Abbreviation of MELSEC-Q/L/F Structured Programming Manual (Fundamentals)
FX Structured Programming Manual [Device & Common] Abbreviation of FXCPU Structured Programming Manual [Device & Common]
FX Structured Programming Manual [Basic & Applied Instruction] Abbreviation of FXCPU Structured Programming Manual [Basic & Applied Instruction]
FX Structured Programming Manual [Application Functions] Abbreviation of FXCPU Structured Programming Manual [Application Functions]
COMMUNICATION CONTROL EDITION Abbreviation of FX Series User's Manual-DATA COMMUNICATION CONTROL EDITION
ANALOG CONTROL EDITION Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-ANALOG CONTROL EDITION
POSITIONING CONTROL EDITION Abbreviation of FX3S/FX3G/FX3GC/FX3U/FX3UC Series User's Manual-POSITIONING CONTROL EDITION

1.1 Outline of Structured Programs and Programming languages FXCPU Structured Programming Manual [Basic & Applied Instruction]
This manual explains setting of sequence instructions for structured programs provided by GX Works2. Refer to another manuals for device, parameter, and application functions for structured programs. Refer to the following manual for label, data types and programming languages for structured programs.
→ Q/L/F Structured Programming Manual (Fundamentals)
You can construct two or more programs (program blocks) into one program. Because you can divide the entire machine processing into small sub processes and create a program for each sub process, you can create a program for a large system efficiently.

1.1 Outline of Structured Programs and Programming languages
The following programming languages can be used in each program block.
Y000
MOV EN ENO s d D0 D2
How to Read Explanation of Instructions
When X001 is ON, the contents of D0 are transferred to D2.
AND INT_TO_WORD_E EN ENO _INT
X000 X001 X002
K4X010
When the contents of D0 are equivalent to the contents of D2, EQ turns ON.
D30 D20
Text language
Applied Instructions (Program Flow)
Y000:=(X000 OR Y000) AND NOT X001; IF X001 THEN D2:=D0; (* When X001 is ON, the contents of D0 are transferred to D2.*) END_IF; IF X002 THEN D4:=D4+1; (* When X002 is ON, the contents of D4 are added by "1". *) ELSE D6:=D6+1; (* When X002 is OFF, the contents of D6 are added by "1". *) END_IF;
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

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

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

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


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 figure on the right. For example, suppose that X001 is ON and X002 is OFF.
Input processing X001=ON X002=OFF
In the first coil Y003, the image memory turns ON and the output Y004 turns ON also because the input X001 is ON.
In the second coil Y003, however, the image memory is set to OFF because the input X002 is OFF.
Y004
Accordingly, the actual output to the outside is "Y003 = OFF, Y004 = ON".
How to Read Explanation of Instructions
Output processing Y003=OFF Y004=ON
Y000
A B
Y000
C E
C E
Y000
Applied Instructions (Program Flow)
M100
C E
M101
Applied Instructions (Move and Compare)
M100
Applied Instructions (Arithmetic and Logical Operation)
SET, RST or jump instruction can be used instead, or a same output coil can be programmed at each state by using step ladder instructions STL or RET. When you use the step ladder instruction STL or RET, note that the PLC regards it as double coils if you program, inside the state, an output coil located outside the RET from another program block or the STL instruction.
Applied Instructions (Rotation and Shift Operation)

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


In some types of sequence instructions, the following flags operate: M8020: Zero flag M8021: Borrow flag M8022: Carry flag M8029: Instruction execution complete flag M8090: Block comparison signal*1 M8328: Instruction non-execution flag*1
*1. Supported only by FX3U and FX3UC PLCs.
*2. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Each of these flags turns ON or OFF every time the PLC executes a corresponding function. These flags do not turn ON or OFF when the PLC does not execute a corresponding function or when an error occurs. Because these flags turn ON or OFF in many sequence instructions, the ON/OFF status of flags changes every time such instructions are executed. Refer to the examples in the next page, and program a flag contact just under the target sequence instruction.

1.3 Cautions on Creation of Fundamental Programs
1. Program containing many flags (example of instruction execution complete flag M8029) If you program the instruction execution completion flag M8029 for two or more sequence instructions which actuate the flag M8029, you cannot judge easily by which sequence instruction the flag M8029 is controlled. In addition, the flag M8029 does not turn ON or OFF correctly for each corresponding sequence instruction. Refer to the next page when you would like to use the flag M8029 in any position other than the position just under the corresponding sequence instruction.
d1 Y010 n d2
M8029 works as a flag to indicate that execution of DSW is completed.
Execution is completed.
Number of output pulses
How to Read Explanation of Instructions
S
M0
1000 Number of output pulses
M8029 works as a flag to indicate that execution of DPLSY is completed.
M8029
R
Execution is completed.
M0
M8029 works as a flag to indicate that execution of DPLSY (on the lower side) is completed.
Program for DPLSY (on the upper side)
Execution is completed.
Applied Instructions (Program Flow)
M8029 works as a flag to indicate that execution of DSW is completed.
d1 Y010 n d2 D0
S
Applied Instructions (Move and Compare)
DPLSY (on the upper side)
1000 Number of output pulses
M8029 works as a flag to indicate that execution of DPLSY (on the upper side) is completed.
MUL_E EN _IN
Applied Instructions (Arithmetic and Logical Operation)
Execution is completed.
Number of output pulses
M1
DPLSY (on the lower side)
1000 Number of output pulses 2
Applied Instructions (Rotation and Shift Operation)

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

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 sequence instruction configuration, target device or target device number range and an error occurs while operation is executed, the following flag turns ON and the error information is store.
Device storing error occurrence step
Error flag Device storing error code
FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/ FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC FX3U/FX3UC
*1. When the error occurrence step is up to the 32767th step in FX3U and FX3UC PLCs, the error occurrence step can be checked in D8069 (16 bits).
How to Read Explanation of Instructions
Device storing error occurrence step
Error flag Device storing error code
FX0S/FX0/FX0N/FX1S/FX1N/FX1NC/ FXU/FX2C/FX2N/FX2NC/FX3S/FX3G/FX3GC FX3U/FX3UC
*2. When the error occurrence step is up to the 32767th step in FX3U and FX3UC PLCs, the error occurrence step can be checked in D8068 (16 bits).
Applied Instructions (Program Flow)
In some sequence instructions, the function can be extended by combining a specific special auxiliary relay determined for each sequence instruction. An example is explained below.
Applied Instructions (Move and Compare)
d1 D10 d2 D11
Function extension flag for the XCH instruction
Applied Instructions (Arithmetic and Logical Operation)
d1 D10 d2 D10
Applied Instructions (Rotation and Shift Operation)
When using an instruction requiring the function extension flag in an interrupt program, program DI function (for disabling interrupt) before driving the function extension flag, and program EI function (for enabling interrupt) after turning OFF the function extension flag.

1.3 Cautions on Creation of Fundamental Programs FXCPU Structured Programming Manual [Basic & Applied Instruction]
1.3.7 Limitation in the number of instructions and limitation in simultaneous instruction instances
Each sequence instruction has a limitation in the number of using the instruction and the number of simultaneous instances of instructions. The limitation, however, differs from one PLC to another.
Some instructions can be used only up to the specified number of times. As for the instructions having a limited number of times of use and whose operands allow indexing, device numbers and numeric values in such instructions can be changed by index registers. By indexing, when driving multiple instances simultaneously is required, such instruction can be used as if they were used beyond the allowable number of times.
→ FX Structured Programming Manual [Device & Common] Note that some PLCs do not provide some instructions.
→ 2. Instruction List
FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs
Allowable number of times of
Pay attention so that this instruction does not overlap the input numbers in interrupt input in DVIT instruction, DOG inputs in ZRN instruction, zero point signal in DSZR instruction, input interrupt numbers and high speed counter input numbers. IST 1 - SORT 1 FX3S, FX3G or FX3GC PLCs are not provided. TKY 1 FX3S, FX3G or FX3GC PLCs are not provided. HKY 1 FX3S, FX3G or FX3GC PLCs are not provided. ARWS 1 FX3S, FX3G or FX3GC PLCs are not provided. PR 2 FX3S, FX3G or FX3GC PLCs are not provided. SORT2 2 FX3S, FX3G or FX3GC PLCs are not provided.
SPD 8 (1 instruction / 1 input or fewer)
DUTY 5 (1 instruction / 1 output or fewer) FX3S, FX3G or FX3GC PLCs are not provided.
DHSCT 1 FX3S, FX3G or FX3GC PLCs are not provided.
FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs
Allowable number of times of use
FX1S, FX1N, FX1NC FX2N, FX2NC
SPD 1 1
PWM 1 1
IST 1 1
ABSD 1 1
INCD 1 1
ROTC FX1S, FX1N or FX1NC PLCs are not provided. 1
SORT FX1S, FX1N or FX1NC PLCs are not provided. 1
TKY FX1S, FX1N or FX1NC PLCs are not provided. 1
HKY FX1S, FX1N or FX1NC PLCs are not provided. 1
DSW No limit 2
SEGL No limit 2
ARWS FX1S, FX1N or FX1NC PLCs are not provided. 1
PR FX1S, FX1N or FX1NC PLCs are not provided. 2

1.3 Cautions on Creation of Fundamental Programs
FX0S, FX0, FX0N, FXU and FX2C PLCs
times of use Remarks
MTR 1 FX0, FX0S or FX0N PLCs are not provided.
IST 1 -
ABSD 1
INCD 1
ROTC 1
SORT 1
TKY 1
FX0S, FX0 or FX0N PLCs are not provided.
DSW 2
SEGL 2
ARWS 1
PR 2
Limitation in simultaneous instances of instructions
How to Read Explanation of Instructions
Some instructions can be programmed two or more times, but the number of simultaneous instances is limited. Even in instructions not shown below, if two or more instructions are driven at the same time for a same I/O number, it is regarded as double outputs. In some combinations of instructions, the operation may be disrupted, or the instructions cannot be executed. For details, refer to the caution described in each instruction page.
RS, RS2, IVCK, IVDR, IVRD, IVWR, IVBWR*1, IVMC FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1, FLSTRD*1
*1. FX3S, FX3G and FX3GC PLCs are not compatible.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

2.1 Basic Instructions
This chapter introduces a list of instructions available in programming.
FX 3U(C)
FX 3G(C)
FX 3S
FX 2N(C)
FX 1N(C)
FX 1S
FX 0N
FX 0(S)
LD Initial logical operation contact type NO (normally open)
LDI Initial logical operation contact type NC (normally closed)
AND Serial connection of NO contacts
3 Section 5.1
ANI Serial connection of NC contacts
OR Parallel connection of NO contacts
ORI Parallel connection of NC contacts
LDP Initial logical operation of rising edge pulse
LDF Initial logical operation of falling edge pulse
ANDP Serial connection of rising edge pulse
3 Section 5.2
ANDF Serial connection of falling edge pulse
ORP Parallel connection of rising edge pulse
ORF Parallel connection of falling edge pulse
OUT Coil drive 3 Section 5.3
OUT_T Timer drive 3 Section 5.4.1
Counter drive 3 Section 5.5.1 OUT_C_32
3 Section 5.6 OR(···) Parallel connection of circuit block
3 Section 5.7 MRD Stack read
INV Invert the current result of the internal PLC operations 3 Section 5.8
MEP Conversion of operation result to leading edge pulse
*1 3 3 Section 5.9
MEF Conversion of operation result to trailing edge pulse
SET Set bit device latch ON
3 Section 5.10 RST Reset bit device OFF and clear current value and resister
PLS Rising edge pulse differential output
3 Section 5.11 PLF Falling edge pulse differential output
MC Connection to common contact
3 Section 5.12 MCR Clear connection to common contact
END Program END, I/O refresh and return to step 0 3 Section 5.13
NOP No operation or null step Section 5.14
*1. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.30 or later.

2.2 Step Ladder Instructions
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3S
FX 1S
FX 0N
FX 0(S)
STL Starts step ladder 3 Section 6.2
RET Completes step ladder 3 Section 6.3
FX 3U(C)
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX 0(S)
FX 3S
FX 1S
FX 0N
How to Read Explanation of Instructions
3 Section 7.1 CJP Pulse 3
3 Section 7.2 CALLP Pulse 3
SRET Continuous Subroutine return 3 Section 7.3
IRET Continuous Interrupt return 3 Section 7.4
DI Continuous Disable interrupt 3 Section 7.5
EI Continuous Enable interrupt 3 Section 7.6
FEND Continuous Main routine program end 3 Section 7.7
3 Section 7.8 WDTP Pulse 3
FOR Continuous Start a FOR/NEXT loop 3 Section 7.9
NEXT Continuous End a FOR/NEXT loop 3 Section 7.10
3
Section 8.1 CMPP Pulse 3
DCMP Continuous 3
Applied Instructions (Program Flow)
DCMPP Pulse 3
3
Section 8.2 ZCPP Pulse 3
DZCP Continuous 3
DZCPP Pulse 3
Applied Instructions (Move and Compare)
3
Section 8.3 MOVP Pulse 3
DMOV Continuous 3
DMOVP Pulse 3
3 Section 8.4 SMOVP Pulse 3
Applied Instructions (Arithmetic and Logical Operation)
3
Section 8.5 CMLP Pulse 3
DCML Continuous 3
DCMLP Pulse 3
3 Section 8.6 BMOVP Pulse 3
Applied Instructions (Rotation and Shift Operation)

2.3 Applied Instructions
FX 3U(C)
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX 3S
FX 1S
FX 0N
FX 0(S)
3
Section 8.7 FMOVP Pulse 3
DFMOV Continuous 3 *1
DFMOVP Pulse 3 *1
Section 8.8 XCHP Pulse 3 3 3
DXCH Continuous 3 3 3
DXCHP Pulse 3 3 3
3
Section 8.9 BCDP Pulse 3
Conversion to binary coded decimal
DBCD Continuous 3
DBCDP Pulse 3
3
Section 8.10 BINP Pulse 3
DBIN Continuous 3
DBINP Pulse 3
Arithmetic and Logical Operation
3
Section 9.1 DADD Continuous 3
DADDP Pulse 3
3
Section 9.2 DSUB Continuous 3
DSUBP Pulse 3
3
Section 9.3 DMUL Continuous 3
DMULP Pulse 3
3
Section 9.4 DDIV Continuous 3
DDIVP Pulse 3
3
Section 9.5 INCP Pulse 3
DINC Continuous 3
DINCP Pulse 3
3
Section 9.6 DECP Pulse 3
DDEC Continuous 3
DDECP Pulse 3
3
Section 9.7 WANDP Pulse 3
DAND Continuous 3
DANDP Pulse 3
3
Section 9.8 WORP Pulse 3
DOR Continuous 3
DORP Pulse 3
*1. The instruction is provided in the FXU PLC Ver. 2.30 or later.


3
Section 9.9 WXORP Pulse 3
DXOR Continuous 3
DXORP Pulse 3
Section 10.1 RORP Pulse 3
Section 10.2 ROLP Pulse 3
3 Section 10.5 SFTRP Pulse 3
3 Section 10.6 SFTLP Pulse 3
3 Section 10.7 WSFRP Pulse 3
3 Section 10.8 WSFLP Pulse 3
3 Section 10.9 SFWRP Pulse 3
3 Section 10.10 SFRDP Pulse 3
3 Section 11.1 ZRSTP Pulse 3
3 Section 11.2 DECOP Pulse 3
3 Section 11.3 ENCOP Pulse 3
Section 11.4 SUMP Pulse 3

2.3 Applied Instructions
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3S
FX 1S
FX 0N
FX 0(S)
3
Section 11.5 BONP Pulse 3
Check specified bit status
DBON Continuous 3
DBONP Pulse 3
3
Section 11.6 MEANP Pulse 3
DMEAN Continuous 3 *1
DMEANP Pulse 3 *1
ANS Continuous Timed annunciator set 3 Section 11.7
3 Section 11.8 ANRP Pulse 3
Section 11.9 SQRP Pulse 3 3 3
DSQR Continuous 3 3 3
DSQRP Pulse 3 3 3
3 *2 3 3 *3
Section 11.10 FLTP Pulse 3 *2 3 3 *3
Conversion to floating point
DFLT Continuous 3 *2 3 3 *3
DFLTP Pulse 3 *2 3 3 *3
3 Section 12.1 REFP Pulse 3
3 3 3 Section 12.2 REFFP Pulse 3 3 3
Refresh and filter adjust
MTR Continuous Input matrix 3 Section 12.3
DHSCS Continuous High speed counter set 3 Section 12.4 DHSCS_I Continuous High Speed Interrupt Counter Set 3 3 3
DHSCR Continuous High speed counter reset 3 Section 12.5
DHSZ Continuous High speed counter zone compare 3 Section 12.6
3 Section 12.7 DSPD Continuous *4 3 3
3 Section 12.8 DPLSY Continuous 3
PWM Continuous Pulse width modulation 3 Section 12.9
3 Section 12.10 DPLSR Continuous 3
IST Continuous Initial state 3 Section 13.1
3 *3
Section 13.2 SERP Pulse 3 *3
Search a data stack
DSER Continuous 3 *3
DSERP Pulse 3 *3
3 Section 13.3 DABSD Continuous 3 *1
INCD Continuous Incremental drum sequencer 3 Section 13.4
TTMR Continuous Teaching timer 3 3 3 Section 13.5
*1. The instruction is provided in the FXU PLC Ver. 2.30 or later. *2. The instruction is provided in the FX3G PLC Ver. 1.10 or later. *3. The instruction is provided in the FXU PLC Ver. 3.07 or later. *4. The 32-bit operations are provided in the FX3UC PLC Ver. 2.20 or later.

2.3 Applied Instructions
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX U /FX 2C
FX 3S
FX 1S
FX 0N
FX 0(S)
STMR Continuous Special timer 3 3 3 Section 13.6
3 Section 13.7 ALTP Pulse 3
RAMP Pulse Ramp variable value 3 Section 13.8
ROTC Continuous Rotary table control 3 3 3 Section 13.9
SORT Continuous SORT tabulated data 3 3 *1 Section 13.10
External FX I/O Device
3 3 3 Section 14.1 DTKY Continuous 3 3 3
3 3 3 Section 14.2 DHKY Continuous 3 3 3
How to Read Explanation of Instructions
DSW Continuous Digital switch 3 Section 14.3
3 3 3 Section 14.4 SEGDP Pulse 3 3 3
SEGL Continuous Seven segment with latch 3 Section 14.5
ARWS Continuous Arrow switch 3 3 3 Section 14.6
ASC Continuous ASCII code data input 3 3 3 Section 14.7
PR Continuous Print (ASCII code) 3 3 3 Section 14.8
3 *2 3
Section 14.9 FROMP Pulse 3 *2
Read from a special function block
DFROM Continuous 3 *2 3
DFROMP Pulse 3 *2
3 *2 3
Section 14.10 TOP Pulse 3 *2
Write to a special function block
DTO Continuous 3 *2 3
DTOP Pulse 3 *2
External Device (optional devices)
RS Continuous Serial Communication 3 *1 *3 Section 15.1
Applied Instructions (Program Flow)
3
Section 15.2 PRUNP Pulse 3
Parallel run (octal mode)
DPRUN Continuous 3
DPRUNP Pulse 3
3 *1 *3 Section 15.3 ASCIP Pulse 3 *1
Hexadecimal to ASCII conversion
Applied Instructions (Move and Compare)
3 *1 *3 Section 15.4 HEXP Pulse 3 *1
ASCII to hexadecimal conversion
3 *1 *3 Section 15.5 CCDP Pulse 3 *1
*1. The instruction is provided in the FXU PLC Ver. 3.07 or later.
Applied Instructions (Arithmetic and Logical Operation)
*2. The instruction is provided in the FXU PLC Ver. 2.10 or later.
*3. The instruction is provided in the FX0N PLC Ver. 1.20 or later.
Applied Instructions (Rotation and Shift Operation)

2.3 Applied Instructions

*1 *2*3 3 *2 *2 3 3 Section 15.6 VRRDP Pulse *1 *2*3 3 *2 *2 3 3
*1 *2*3 3 *2 *2 3 3 Section 15.7 VRSCP Pulse *1 *2*3 3 *2 *2 3 3
RS2 Continuous Serial data communication 2 3 3 3 Section 15.8
PID Continuous PID control loop 3 *4 Section 15.9
3 *3 3 3 Section 18.1 DECMPP Pulse 3 *3 3 3
3 *3 3 Section 18.3 DEMOVP Pulse 3 *3 3
*1. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.70 or later.
*2. Though programmed, this instruction is not valid because the FX1NC, FX2NC or FX3GC PLC does not have a volume to read out under this instruction.
*3. The instruction is provided in the FX3G PLC Ver. 1.10 or later.
*4. The instruction is provided in the FXU and FX2C PLCs Ver. 3.30 or later.
*5. The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later.
2 Instruction List


3 *1 3 3 Section 18.8 DEADDP Pulse 3 *1 3 3
3 *1 3 3 Section 18.9 DESUBP Pulse 3 *1 3 3
3 *1 3 3 Section 18.10 DEMULP Pulse 3 *1 3 3
3 *1 3 3 Section 18.11 DEDIVP Pulse 3 *1 3 3
3 *1 3 3 Section 18.15 DESQRP Pulse 3 *1 3 3
*1. The instruction is provided in the FX3G PLC Ver. 1.10 or later.

2.3 Applied Instructions
FX 3U(C)
FX 3G(C)
FX 2N(C)
FX 1N(C)
FX 3S
FX 1S
FX 0N
FX 0(S)
Section 19.1 WSUMP Pulse *1
Sum of word data
*1 Section 19.2 WTOBP Pulse *1
*1 Section 19.3 BTOWP Pulse *1
4-bit linking of word data *1 Section 19.4 UNIP Pulse *1
4-bit grouping of word data *1 Section 19.5 DISP Pulse *1
Section 19.6 SWAPP Pulse 3 3
DSWAP Continuous 3 3
DSWAPP Pulse 3 3
*1 Section 19.7 DSORT2 Continuous *1
Sort tabulated data 2
DSZR Continuous Dog search zero return 3 3 3 Section 20.1
3 Section 20.2 DDVIT Continuous 3
DTBL Continuous Batch data positioning mode *1 3 Section 20.3
DABS Continuous Absolute current value read 3 3 3 *2 3 3 Section 20.4
3 Section 20.5 DZRN Continuous 3
3 Section 20.6 DPLSV Continuous 3
Variable speed pulse output
3 Section 20.7 DDRVI Continuous 3
3 Section 20.8 DDRVA Continuous 3
Real Time Clock Control
3 Section 21.1 TCMPP Pulse 3
3 Section 21.2 TZCPP Pulse 3
RTC data zone compare
3 Section 21.3 TADDP Pulse 3
3 Section 21.4 TSUBP Pulse 3
Section 21.5 HTOSP Pulse 3
Hour to second conversion
Section 21.6 STOHP Pulse 3
Second to hour conversion
*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later. *2. The instruction is provided in the FX2N and FX2NC PLCs Ver. 3.00 or later.


3 Section 21.7 TRDP Pulse 3
3 Section 21.8 TWRP Pulse 3
3 3 3 *1 3 3 Section 21.9 DHOUR Continuous 3 3 3 *1 3 3
3 3 3 *1 3 Section 22.3 RD3AP Pulse 3 3 3 *1 3
3 3 3 *1 3 Section 22.4 WR3AP Pulse 3 3 3 *1 3
DHCMOV Continuous High speed counter move 3 Section 24.5
*1. The instruction is provided in the FX2N and FX2NC PLCs Ver. 3.00 or later. *2. The instruction is provided in the FX3UC PLC Ver. 2.20 or later.

2.3 Applied Instructions

RIGHT Continuous Extracting character string data from the right
LEFT Continuous Extracting character string data from the left
*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later.
2 Instruction List


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

2.3 Applied Instructions

IVCK Continuous Inverter status check 3 *2 3 Section 30.1
IVDR Continuous Inverter drive 3 *2 3 Section 30.2
IVRD Continuous Inverter parameter read 3 *2 3 Section 30.3
IVWR Continuous Inverter parameter write 3 *2 3 Section 30.4
IVBWR Continuous Inverter parameter block write 3 Section 30.5
IVMC Continuous Inverter Multi Command *3 *4 3 Section 30.6
ADPRW Continuous MODBUS Read / Write *5 *6 3 Section 30.7
DHSCT Continuous High speed counter compare with data table 3 Section 32.1
*1. The instruction is provided in the FX3UC PLC Ver. 2.20 or later. *2. The instruction is provided in the FX3G PLC Ver. 1.10 or later. *3. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.70 or later. *4. The instruction is provided in the FX3G PLC Ver. 1.40 or later. *5. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.40 or later. *6. The instruction is provided in the FX3G PLC Ver. 1.30 or later.
2 Instruction List


FLCRT Continuous File create / check *2 Section 34.1
FLDEL Continuous File delete / CF card format *2 Section 34.2
*1. The instruction is provided in the FX3UC PLC Ver. 1.30 or later.
*2. The instruction is provided in the FX3U and FX3UC PLCs Ver. 2.61 or later.

3.1 Expression and Operation Form of Sequence Instructions FXCPU Structured Programming Manual [Basic & Applied Instruction]
3 Configuration of Instruction
This chapter explains the configuration of sequence instructions.
SMOV EN s m1
d D10 D0 K1
: This symbol indicates an argument called "source" that does not change its contents by the
execution of an instruction. : This symbol indicates an argument called "destination" that changes its contents by the
execution of an instruction. m, n : Symbols "m" and "n" indicate an argument that belongs to neither the source nor the
destination.
→ FX Structured Programming Manual [Device & Common]
Command input · m2 K2 · n K3

3 Configuration of Instruction
3.1 Expression and Operation Form of Sequence Instructions
Instructions are divided into "16-bit instructions" and "32-bit instructions" depending on the size of values they handle. The instructions also have characteristics of either a "continuous execution" or "pulse execution" depending on the form of execution. Some of the instructions have all these combinations.
Instruction that transfers the D10 contents to D12
Instruction that transfers the contents of (D21, D20) to (D23, D22).
How to Read Explanation of Instructions
Pulse operation In an example shown on the right, when X000 changes from OFF to ON, the instruction is executed only once. No other execution takes place. It is therefore suggested that the instructions of pulse operation be used if not executed all the time. Symbol "P" indicates that the instruction is of pulse operation. The same is applied to DMOVP.
Continuous operation The instruction in the figure on the right is of continuous operation. It is executed in each cycle of operation while X001 is ON.
Applied Instructions (Program Flow)
Where continuous execution instructions such as INC and DEC are used, some instructions have the destination contents be changed in each cycle of operation.
In either cases, the instruction is not executed if the drive input X000 or X001 is OFF. The destination does not change either if the instruction is not specified otherwise.
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

3 Configuration of Instruction
Labels are either global labels or local labels.
The label classes indicate how they are used in which program parts. The table below shows the label classes.
Program parts available for use
VAR_GLOBAL A common label that can be used in all program parts. 3 3
VAR_GLOBAL_CONSTANT A common constant that can be used in all program parts. 3 3
VAR A label used within declared program parts. It cannot be used in other program parts. 3 3 3
VAR_CONSTANT A constant used within declared program parts. It cannot be used in other program parts. 3 3 3
VAR_INPUT A label that receives values. It cannot be changed within program parts. 3 3
VAR_OUTPUT A label for output from a function block. 3
VAR_IN_OUT A local label that receives values and outputs from a program part. 3
Before using a label, the label needs to be defined. An error is generated if attempting to convert (compile) a program where the label is not defined.


3 Configuration of Instruction
3.2 Labels

The following describes the method of expression when setting constant to a label.
Type of constant Method of expression Example
Bit Enter either "FALSE" or "TRUE", or either "0" or "1". TRUE, FALSE
Binary number Add "2#" before the binary number. 2#0010, 2#01101010
How to Read Explanation of Instructions
Octal number Add "8#" before the octal number. 8#0, 8#337
Decimal number Enter the decimal number directly. Or, add "K" before the decimal number 123, K123
Hexadecimal number Add "16#" or "H" before the hexadecimal number. 16#FF, HFF
Real number Enter the real number directly. Or, add "E" before the real number. 2.34, E2.34
Character string Put the character string between single quotations ('') or double quotations (""). 'ABC', "ABC"
The data type of label is either basic data type or universal data type.
Data type Description Value range Bit length
Bit Boolean data 0(FALSE), 1(TRUE) 1 bit
Word [signed] Integer -32768 to 32767 16 bits
Double Word [signed] Double precision integer -2147483648 to 2147483647 32 bits
Word [unsigned]/Bit String [16-bit] 16-bit data 0 to 65535 16 bits
Applied Instructions (Program Flow)
Double Word [unsigned]/Bit String [32-bit] 32-bit data 0 to 4294967295 32 bits
E ±1.175495-38 to
FLOAT (Single Precision) Real number
Applied Instructions (Move and Compare)
String Character string (50 characters maximum) Variable
Time Time value T#-24d-0h31m23s648.00ms to T#24d20h31m23s647.00ms 32 bits
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

3 Configuration of Instruction
ANY_SIMPLE
ANY_NUM ANY_BIT Time String
Word [unsigned]/ Bit String [16-bit]
The "ANY" type on a higher layer contains types on the lower layer. The "ANY" type on the top layer contains all types.
Double Word [unsigned]/ Bit String [32-bit]
ANY32
Word [unsigned]/ Bit String [16-bit]
Double Word [unsigned]/ Bit String [32-bit]
*1 Refer to the following manual for details.
Q/L/F Structured Programming Manual (Fundamentals)

3 Configuration of Instruction
3.3 Devices and Addresses
A device is expressed by a device or an address.
The device is expressed by a device name and a device number.
Device name Device number
An address is expressed by a method defined by IEC61131-3. It is expressed as follows according to IEC61131-3.
How to Read Explanation of Instructions
I Input (Omitted) Bit These are the numbers for detailed classification. This number is separated by "." (period) from subsequent numbers. This number may be omitted.
Q Output X Bit
The number that indicates a device number (decimal number).
M Internal W Word (16 bits)
D Double word (32 bits)
Position of memory area
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

3 Configuration of Instruction
The execution control is available for an instruction with "EN".
EN ENO Operation results
TRUE(Without operation error) Operation output value
FALSE(With operation error) Undefined value
FALSE(Stopping operation) FALSE Undefined value
In the instruction above, instruction MOV is executed only when X000 is TRUE.
TRUE(Executing operation) · MOV EN s · d D2 D0

3 Configuration of Instruction
3.4 EN and ENO
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

4 How to Read Explanation of Instructions
The following shows one of the pages that explains the instructions.

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

4 How to Read Explanation of Instructions
Supported by PLCs from the first release.
The support conditions depend on the versions. "Cautions" explains the applicable versions.
This particular series PLCs do not support the instruction.
16 bits An instruction of 16-bit data length
32 bits An instruction of 32-bit data length
Continuous This is a continuous execution instruction that is executed in each cycle of operation while the execution condition (EN) is being satisfied.
Pulse This is a pulse execution instruction that is executed only when the execution condition (EN) changes from the state of not established to the state of established.
Indicates the instruction expression in the structured ladder language adopted as the representative.
ST Indicates a ST language instruction.
How to Read Explanation of Instructions
Some PLCs do not support "16 bits / 32 bits" or "continuous / pulse" depending on their versions. Refer to "Cautions".
→ Q/L/F Structured Programming Manual (Fundamentals)
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

This chapter introduces the instructions for the structured project corresponding to the basic instructions for the simple project.
Instruction name Function Reference
LD Initial logical operation of NO (normally open) contacts Section 5.1
LDI Initial logical operation of NC (normally closed) contact type Section 5.1
AND Serial connection of NO (normally open) contacts Section 5.1
ANDI Serial connection of NC (normally closed) contacts Section 5.1
OR Parallel connection of NO (normally open) contacts Section 5.1
ORI Parallel connection of NC (normally closed) contacts Section 5.1
LDP Initial logical operation of rising edge pulse Section 5.2
LDF Initial logical operation of falling/trailing edge pulse Section 5.2
ANDP Serial connection of rising edge pulse Section 5.2
ANDF Serial connection of falling/trailing edge pulse Section 5.2
ORP Parallel connection of rising edge pulse Section 5.2
ORF Parallel connection of falling/trailing edge pulse Section 5.2
OUT Final logical operation type coil drive (Excluding timers and counters) Section 5.3
OUT_T Final logical operation type coil drive (timers) Section 5.4
OUT_C Final logical operation type coil drive (16-bit counter) Section 5.5
OUT_C_32 Final logical operation type coil drive (32-bit counter) Section 5.5
AND(...) Serial connection of multiple parallel circuits Section 5.6
OR(...) Parallel connection of multiple contact circuits Section 5.6
MPS Stores the current result of the internal PLC operations Section 5.7
MRD Reads the current result of the internal PLC operations Section 5.7
MPP Pops (recalls and removes) the currently stored result Section 5.7
INV Invert the current result of the internal PLC operations Section 5.8
MEP Conversion of operation result to leading edge pulse Section 5.9
MEF Conversion of operation result to trailing edge pulse Section 5.9
SET SET Bit device latch ON Section 5.10
RST RESET Bit device OFF Section 5.10
PLS Rising edge pulse Section 5.11
PLF Falling/trailing edge pulse Section 5.11
MC Denotes the start of a master control block Section 5.12
MCR Denotes the end of a master control block Section 5.12
END Program END, I/O refresh and Return to Step 0 Section 5.13
NOP No operation or null step Section 5.14
5 Basic Instruction

5.1 LD, LDI, AND, ANI, OR, ORI
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The LD and LDI instructions are contacts connected to bus lines. The AND and ANI instructions connect one contact in series. The OR and ORI instructions connect one contact in parallel.
Expression in each language
LD Continuous To become an assignment statement, operator, control syntax and so forth.
X000 X002
Y000
The ST language may not have the instructions (symbols) directly corresponding to the contacts of LD, AND and OR that are programmed in a simple project. The structured ladder shown on the left can be expressed as shown below. (When configuring with assignment statements)
Y001
How to Read Explanation of Instructions
X002 X000
Y002
Y000:=(X000 OR X001) AND X002; Y001:=(X000 OR X001) AND X002 AND NOT X003; Y002:=(NOT X000 OR NOT X001) AND NOT X002; Y003:=(NOT X000 OR NOT X001) AND NOT X002 AND X003;
Y003
AND
2. Set data
Variable Description Data type
Input variable - Variable that are applicable to AND and OR input. Bit
Output variable - Result of operation of AND and OR. Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
LD z S1 S2
Applied Instructions (Program Flow)
LDI z S1 S2
AND z S1 S2
ANI z S1 S2
OR z S1 S2
ORI z S1 S2
Applied Instructions (Move and Compare)
S: Refer to "Cautions".
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

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



5 Basic Instruction


5. OR (Parallel connection of NO (normally open) contacts)
6. ORI (Parallel connection of NC (normally closed) contacts)


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

LD contact is set to ON (becomes conductive) or OFF (becomes nonconductive) by X013.
When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.

LD contact is set to ON (becomes conductive) or OFF (becomes nonconductive) by the bit 3 of D0.
The following devices cannot be indexed.
5 Basic Instruction

5.2 LDP, LDF, ANDP, ANDF, ORP, ORF
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Contact instructions LDP, ANDP, and ORP detect the rising edge, and become active during one operation cycle only at the rising edge of a specified bit device (that is, when the bit device turns ON from OFF). Contact instructions LDF, ANDF and ORF detect the falling edge, and become active during one operation cycle only at the falling edge of a specified bit device (that is, when the bit device turns OFF from ON).
Expression in each language
Pulse (detecting rising pulse)
How to Read Explanation of Instructions
Pulse (detecting falling pulse)
Pulse (detecting rising pulse)
Pulse (detecting falling pulse)
Pulse (detecting rising pulse)
Pulse (detecting falling pulse)
Applied Instructions (Program Flow)
Variable Description Data type
Applied Instructions (Move and Compare)
Output variable ENO Execution state Bit
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

3. Applicable devices

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
LDP z S1
LDF z S1
ANDP z S1
ANDF z S1
ORP z S1
ORF z S1
S: Refer to "Cautions".

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

M0 ORF EN s
M8000 ANDF EN s
LDF X000
ON
ON
ON ON
ORF
ON during one operation cycle
How to Read Explanation of Instructions
ON
X002 ON ON ON
ANDF
ON during one operation cycle
In the example shown above, M0 or M1 is ON during only one operation cycle when X000 to X002 turn OFF from ON. 3. Bit specification of data register (D) A bit data register (D) can be specified as a device used in LDP, LDF, ANDP, ANDF, ORP and ORF instructions.
When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.
Y000
Applied Instructions (Program Flow)
contact turns ON (becomes conductive) or OFF (becomes nonconductive) when the bit 3 of D0 turns ON or OFF. 4. Output drive side The following two circuits offer the same operation.
Applied Instructions (Move and Compare)
PLS EN ENO
=
Applied Instructions (Arithmetic and Logical Operation)
In each circuit, M6 is ON during only one operation cycle when X010 turns ON from OFF.
Applied Instructions (Rotation and Shift Operation)
In each circuit, MOV instruction is executed only once when X020 turns ON from OFF.

(M0 to M2799 for the FX2N and FX2NC PLCs, M0 to M1535 for the FX3S PLC)
After M0 is driven by X000, all contacts 1) to 4) corresponding to M0 are activated.

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

5 Basic Instruction ·

Cautions
Programs executed two or more times - Program between FOR and NEXT instructions - Program which executes a same subroutine program from two or more CALL instructions during one operation cycle. - Program which jumps to a pointer number or ladder block label in a smaller ladder block number by CJ instruction.
Operation - When a device turns ON from OFF 1st time :LDP, ANDP or ORP instruction turns ON. 2nd time and later :When the device status is same as the time when the instruction was executed last, the instruction turns OFF. - When a device turns OFF from ON 1st time :LDF, ANDF or ORF instruction turns ON. 2nd time and later :When the device status is same as the time when the instruction was executed last, the instruction turns OFF.
How to Read Explanation of Instructions
2) When write during RUN is completed for a circuit including an instruction for falling edge pulse (LDF, ANDF, or ORF instruction), the instruction for falling edge pulse is not executed without regard to the ON/ OFF status of the target device of the instruction for falling edge pulse. When write during RUN is completed for a circuit including an instruction for falling edge pulse (PLF instruction), the instruction for falling edge pulse is not executed without regard to the ON/OFF status of the operation condition device. It is necessary to set to ON the target device or operation condition device once and then set it to OFF for executing the instruction for falling edge pulse.
Contact ON/OFF status (while write
during RUN is executed) Instruction for rising edge pulse Instruction for falling edge pulse
OFF Not executed Not executed
ON Executed*1 Not executed
Applied Instructions (Program Flow)
*1. PLS instruction is not executed.
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

5.3 OUT (Excluding timers and counters)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction outputs the operation result up to the execution of the OUT instruction to the specified device.



X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
5 Basic Instruction

5.3 OUT (Excluding timers and counters)
Drive contact of OUT instruction
Y000
OUT
OUT
M100
OUT
For assignment statement Y000:= X000; M100:= NOT X001; M101:= NOT X001;
How to Read Explanation of Instructions
OUT
ON Y000
ON
ON X001
ON
OUT
ON M100
ON M101 OUT
Applied Instructions (Program Flow)
When a used devices is an input (X) or output (Y), the value of an index register (V or Z) is converted into an octal number, and then added.
X000 Y000Z0
For assignment statement Y000Z0:= X000;
Y024 turns ON or OFF.
Applied Instructions (Move and Compare)
When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data resister is applicable. Specify a bit number as "0 1, 2, ..., 9, A, B, ..., F" from the least significant bit.
Applied Instructions (Arithmetic and Logical Operation)
For assignment statement D0.3:= X000;
Applied Instructions (Rotation and Shift Operation)
the bit 3 of D0 turns ON or OFF when X000 turns ON or OFF.

5.3 OUT (Excluding timers and counters)
The following devices cannot be indexed.
OUT_T Section 5.4.1
OUT_C Section 5.5.1
OUT_C_32 Section 5.5.1
1. When using bit device


5 Basic Instruction · Instruction name Reference


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
An output is generated when a set time expires.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

5.4 Operating Timer
1. OUT_T operation
NO (normally open) contact Timer is conductive.
NC (normally closed) contact Timer is not conductive.
Before time-up After time-up
Timer type Timer coil Current timer
NO (normally open) contact
NO (normally open) contact
100 ms timer 0.1 to 3276.7 seconds
OFF 0 Nonconductive Conductive Nonconductive Conductive 10 ms timer 0.01 to 327.67 seconds
1 ms timer*1
0.001 to 32.767 seconds
100 ms integrating timer*2
0.1 to 3276.7 seconds OFF Holding current value Nonconductive Conductive Nonconductive Conductive 1 ms integrating timer*2
0.001 to 32.767 seconds
*1. Not supported by the FX0S, FX0, FX1N, FX1NC, FXU, FX2C, FX2N or FX2NC PLC.
*2. Not supported by the FX0S, FX0, FX0N or FX1S PLC.
If the OUT_T instruction is skipped by an instruction such as JMP while the OUT_T instruction is ON, neither the current value is updated nor contacts are turned ON or OFF. When one particular OUT_T instruction operates more than once within the same scan, the current value is updated as many times as the timer operates.

5.4 Operating Timer
2) Use the timer T192 to T199 within a subroutine or interrupt routine. This timer counts the time when executing a coil instruction or END instruction. When the set value is reached, the output contact operates when the coil instruction or the END instruction is executed. A general purpose timer counts the time only when the coil instruction is executed. Such a timer does not operate normally because it does not count the time if used in a subroutine or an interrupt routine where the coil instruction is executed only under certain conditions.
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

5.4 Operating Timer


BCD data of X010 to X01F is converted to binary data and stored in D10.
When X002 turns ON, timer starts to count using data stored in D10 as set value.
When T2 timer completes counting up, Y015 turns on.

5 Basic Instruction

5.5 Operating Counters
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The counter starts counting when the condition turns ON from OFF. It generates an output when counting up to the set value.
Expression in each language
OUT_C EN ENO CCoil CValue
OUT_C 16 bits Continuous OUT_C(EN,CCoil,CValue);
How to Read Explanation of Instructions
OUT_C_32 EN ENO CCoil CValue
OUT_C_32 32 bits Continuous OUT_C_32(EN,CCoil,CValue);
16-bit operation 32-bit operation
EN Execution condition Bit
CCoil Target counter Bit
CValue Counter set value ANY16 ANY32
Output variable ENO Execution state Bit
Applied Instructions (Program Flow)
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
CValue z S1 S2 z
Applied Instructions (Move and Compare)
S: Refer to "Cautions".
1. OUT_C operation
Applied Instructions (Arithmetic and Logical Operation)
NO (normally open) contact Conductive
NC (normally closed) contac Nonconductive
Applied Instructions (Rotation and Shift Operation)

5.5 Operating Counters
A 32-bit counter cannot be indexed.


MOVP(X0 AND NOT X1,10,D0); MOVP(X1 AND NOT X0,20,D0); OUT_C(X3,CC10,D0); OUT(CS10,Y30);
C10 counts with the data stored in D0 as the set value.
5 Basic Instruction


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Use AND (...) instruction to connect a branch circuit (parallel circuit block) to the preceding circuit in series. Use OR (...) instruction to connect a series circuit block in parallel.
AND(...) The ladder diagram (or LD) is described as follows.
OR(...) The ladder diagram (or LD) is described as follows.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation

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

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


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
These PLCs have 11 memories called "Stack" which store the intermediate result (ON or OFF) of operations.
Input variable EN Execution condition MPS: Bit MRD, MPP: Always TRUE
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

Function and operation explanation
These instructions are convenient in programming branched multi-output circuits.

[ ST ] Y002:= X005 AND MPS(X004); Y003:= MRD(TRUE) AND X006; Y004:= MRD(TRUE); Y005:= MPP(TRUE) AND X007;
MPS instruction can be used two or more times. However, the difference between the number of MPS instructions and the number of MPP instructions should be 11 or less, and should be 0 at the end.
When a circuit is programmed as shown on the left, it is compiled in fact as the program on the right that does not use MPS, MRD or MPP instruction.

5 Basic Instruction


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

3. Program example 3 (Two stacks)

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

Y000:= (((MPS(X000) AND MPS(X001)) AND MPS(X002)) AND MPS(X003)) AND X004; Y001:= MPP(TRUE); Y002:= MPP(TRUE); Y003:= MPP(TRUE); Y004:= MPP(TRUE);
Y004:= X000; Y003:= Y004 AND X001; Y002:= Y003 AND X002; Y001:= Y002 AND X003; Y000:= Y001 AND X004;
In programming a circuit on the upper side, it is necessary to use MPS instruction three times. By changing the circuit on the upper side into the circuit on the lower side, the same contents can be programmed easily without MPS instruction.
5 Basic Instruction

5.8 INV
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
INV instruction inverts the operation result up to just before INV instruction.
Expression in each language
2. Set data
Variable Description Data type
Input variable EN Execution condition Bit
How to Read Explanation of Instructions
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
INV There are no applicable devices.
1. INV(inverts the result of operations)
Y000 X000
OFF
OFF
INV EN ENO
Applied Instructions (Program Flow)
ON
Y000
[ ST ]
Operation result until just
Operation result after INV
OFF ON
ON OFF
Applied Instructions (Move and Compare)
In the figure above, Y000 turns ON when X000 is OFF, and Y000 turns OFF when X000 is ON. INV instruction can be used in a same position as serial contact instructions (AND, ANI, ANDP and ANDF). Different from LD, LDI, LDP and LDF instructions shown in the list, INV instruction cannot execute connection to bus lines. Different from OR, ORI, ORP and ORF instructions, INV instruction cannot be used independently in parallel to a contact instruction.
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)


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

5.9 MEP, MEF
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
MEP and MEF commands are instructions that change the operation results to pulses so that device numbers do not have to be specified.
How to Read Explanation of Instructions
Expression in each language
MEF EN ENO
2. Set data
Variable Description Data type
Input variable EN Execution condition Bit
Output variable ENO Execution state Bit
Applied Instructions (Program Flow)
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
There are no applicable devices.s MEF
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

Function and operation explanation
1. MEP(ON during rising edge of driving contacts results)
X000 X001 MEP EN ENO
SET EN ENO
ON X000
OFF
M0
ON X001 OFF
[ ST ]
SET(MEP(X000 AND X001),M0);
ON M0 OFF
2. MEF(ON during falling edge of driving contacts results)
X000 X001 MEF EN ENO
SET EN ENO
ON X000
OFF
OFF
OFF M0
ON X001 OFF
[ ST ]
SET(MEF(X000 AND X001),M0);
ON M0 OFF
Cautions
After writing to the circuit with MEP instructions during RUN, the MEP instruction result turns ON (conductive) while the operation results up to the MEP instruction are ON. b) Pulse instruction during falling edge of operation (MEF command) results
After writing to the circuit with MEF instructions during RUN , the MEF instruction result turns OFF (nonconductive), regardless of the operation results up to the MEF instruction. The operation results of MEF instruction turns ON (conductive) when the operation results up to the MEF instruction turn OFF.
Operation Results up to MEP/MEF Instruction
(while writing is excuted during RUN) MEP MEF
OFF OFF (non-conductive) OFF (non-conductive)
ON ON (conductive) OFF (non-conductive)

5.10 SET, RST
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
3) Clearing the current value of a word device (RST instruction [Clearing current value and resister]) RST instruction clears the current value data of a timer (T), counter (C), data register (D), extension register or (R)index register (V) (Z). (The same result can be obtained by MOV instruction which transfers the constant K0.) RST instruction can be used also to reset the current value and return the contact of retentive type timers. SET and RST instructions can be used for a same device as many times as necessary in an arbitrary order.
How to Read Explanation of Instructions
Expression in each language
Y000
S
RST EN ENO
Applied Instructions (Program Flow)
R
*1. This symbol is applicable to the bit type data only.
Applied Instructions (Move and Compare)
Variable Description Data type
Input variable EN Execution condition Bit
ENO Execution state Bit
Applicable device or variable SET Bit RST ANY_SIMPLE
Applied Instructions (Arithmetic and Logical Operation)
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
SET z z z S1 S3
Applied Instructions (Rotation and Shift Operation)
RST z S1 z z z S2 z z S3
S: Refer to "Cautions".

Function and operation explanation
SET instruction drives the coil for an output relay (Y), auxiliary relay (M), state relay (S) and bit specification of data register (D).
[Structured ladder/FBD] [ ST ] timing chart
SET EN ENO
SET(X000,Y000); RST(X001,Y000);
ON
RST EN ENO
Y000
ON

C0 up-counts the number of turning ON from OFF at X011. When the counting result reaches the set value K10, the output contact C0 is activated. Even if X011 changes from OFF to ON after that, the current value of the counter remains unchanged and the output contact remains activated. For clearing the counter and returning the output contact, X010 is set to ON.
OUT_C EN ENO CC0
In case of latched (battery backed) type counters, the current value and the operation status and reset status of the output contact are latched even after power failure.
Y003
For one-phase one-input counters, use special auxiliary relays for specifying the counting direction. X010 in ON status: specifies down counting. X010 in OFF status: Specifies up counting When X011 turns ON, the output contact of the counter CUUU is returned and the current value of the counter is reset to "0". In counters with reset input, the same situation is achieved by interrupt operation when the corresponding reset input turns ON, but any program is not required for this operation. When X012 turns ON, turning ON/OFF of a counting input X000 to X005 determined according to the counter number is counted. In counters having start input, counting is started only after the corresponding start input turns ON. When the current value of a counter increases and reaches the set value (K or contents of D), the output contact is set. When the current value decreases and reaches the set value, the output contact is reset.
How to Read Explanation of Instructions
X012 CC
CS Y002
As a contact driving the counting coil of a high speed counter, program a contact which is normally ON when high speed counting is executed. If an input relay (X000 to X005) assigned for high speed counters is used for driving the counting coil, accurate counting cannot be achieved.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
→ For a jumped program, refer to section 7.1. → For a subroutine program, refer to section 7.2.
→ For an interrupt program, refer to section 7.3.
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

When a used device is an input (X) or output (Y), the value of an index register (V, Z) is converted into octal, and then added. Example: When Z0 is "20", Y024 turns ON or
SET(X000,Y000Z0); RST(X001,Y000Z0);
OFF.
Y000Z0
When specifying a bit in data register, input "." after a data register (D) number, and then input a bit number (0 to F) consecutively. Only 16-bit data registers are available. Specify a bit number as "0, 1,2, ..., 9, A, B, ..., F" from the least significant bit. Example: In the example shown on the left,
SET(X000,D0.3); RST(X001,D0.3);
d D0.3
when X000 turns ON once, the bit 3 of D0 turns ON. When X001 turns ON, the bit 3 of D0 turns OFF.
d D0.3
The following devices cannot be indexed.
5 Basic Instruction · d Y000Z0

5.11 PLS, PLF
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
When PLS instruction is executed, an applicable device is activated during only one operation cycle after a drive input turns ON. When PLF instruction is executed, an applicable device is activated during only one operation cycle after a drive input turns OFF. For example, when PLC mode is changed in the way "RUN → STOP → RUN while a drive input remains ON, "PLS(**, M0) operates, but "PLS (**, M600) (backed up by the battery)" does not operate (when the PLC mode switches from STOP to RUN) because the status of M600 is latched even while the PLC is in the STOP mode.
Expression in each language
How to Read Explanation of Instructions
2. Set data
Variable Description Data type
Input variable EN Execution condition Bit
ENO Execution state Bit
Applicable device or variable Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Program Flow)
PLS z S1 S2
PLF z S1 S2
S: Refer to "Cautions".
Applied Instructions (Move and Compare)
[Structured ladder/FBD] [ ST ] timing chart
ON
X000 PLS EN ENO
ON during one operation cycle
M 0 PLS instruction
Applied Instructions (Arithmetic and Logical Operation)
In the figure above, M0 is ON during only one operation cycle when X000 changes from OFF to ON.
PLF(X000, M1); X000 PLF EN ENO
Applied Instructions (Rotation and Shift Operation)
ON during one operation cycle
M 1 PLF instruction
In the figure above, M1 is ON during only one operation cycle when X000 changes from ON to OFF.


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

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

Instruction for rising edge pulse Instruction for falling edge pulse
*1. PLS instruction is not executed.
The following devices cannot be indexed.
5 Basic Instruction


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
When MC instruction is executed, instructions from MC to MCR are executed. Thereby, efficient ladder switching sequence programs can be created.
Nesting level (0 to 7) When adopting a nesting structure, use it in order of 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7. If not adopting a nesting structure, it is always "0".
Device number to be turned ON when executing the MC instruction. Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
![Page 90 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-90.webp?w=400)
Function and operation explanation
When MC instruction is executed, instructions from MC to MCR are executed. When MC instruction is not executed, the operation with the contact OFF is executed. In the program example below, the instructions from MC to MCR are executed as they are while the input X000 is ON. However, while the input X000 is OFF, each drive device offers the following operation.
Timers (except retentive type timers) and devices driven by OUT instruction: Turn OFF Retentive type timers, counters and devices driven by SET/RST instruction : Hold the current status.
0 M100
Y000
Y001
MCR EN ENO n
MC(X000,0,M100); Y000:= X001; Y001:= X002; MCR(TRUE,0);
Caution
→ Refer to a program example for the details.
5 Basic Instruction · [Structured ladder/FBD] · d n


When not adopting the nesting structure, use nesting level "0" again to program. There is no limitation in the number of nesting level "0". Only in the nesting structure, increase the nesting level 0 1 ... 6 7 as shown in the example 2 on the next page.
MC(X000,0,M100); Y000:= X001; Y001:= X002; MCR(TRUE,0); MC(X003,0,M150); Y002:= X004; Y003:= X005; MCR(TRUE,0);

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

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

5.13 END
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
END instruction specifies the end of a program. (Do not write the END instruction in the middle of a program.) END instruction for ending a program and input/output processing and returning to 0 step is automatically written at the end of the program. It cannot be programmed into program structural elements (POU).
PLCs repeat "input processing → program execution → output processing". When END instruction is written at the end of a program, PLCs immediately execute the output processing without executing steps after END instruction. If END instruction is not written at the end of a program, PLCs execute the program until the final step, and then execute the output processing. At the first execution after the PLC mode was changed from STOP to RUN, PLCs start from END instruction. When END instruction is executed, the watchdog timer (which checks to see if the operation cycle is too long) is refreshed.
How to Read Explanation of Instructions
Step000 001 002
OUT Y000 END NOP NOP
NOP
Cautions
Do not write END instruction in the middle of a program.
Applied Instructions (Program Flow)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (Move and Compare)
This instruction is available for use only in the simple project. It cannot be programmed in the structured project.
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

6 Step Ladder Instructions
6.1 Step Ladder
6.1 Step Ladder
This chapter introduces the instructions of structured project that correspond to the MELSEC-LD step ladder instructions.
In programs using step ladder instructions, a state relay S is assigned to each process based on machine operations, and input condition and output control are programmed as sequences connected to the state output.
In step ladder program, a state S is regarded as one control process, and a sequence of input condition and output control are programmed in a state relay. Because the preceding process is not performed any more when the program execution proceeds to the next process, a machine can be controlled using simple sequences for each process.

6 Step Ladder Instructions
6.1 Step Ladder
STL EN ENO s
S31
SET EN ENO
When X001 turns ON, S32 turns ON and S31 is automatically reset.
STL EN ENO s
S32
Y032
SET EN ENO
How to Read Explanation of Instructions
STL EN ENO s
S31
SET EN ENO
Y31 programmed in SET instruction remains ON even if S31 is reset.
STL EN ENO s
S32
Y032
SET EN ENO
Applied Instructions (Program Flow)
*1. Output coils can be used again in different state relays.
Applied Instructions (Move and Compare)
ANB/ORB/MPS/MRD/
MPP MC/MCR
SET/RST, PLS/PLF
Initial/general state relay Available Available*1 Not available
Drive processing Available Available*1 Not available
Applied Instructions (Arithmetic and Logical Operation)
Transfer processing Available Not available Not available
- STL instruction cannot be used in interrupt program and subroutine programs. - It is not prohibited to use jump instructions in state relays. But it is not recommended to use jump instructions because complicated movements will be resulted.
Applied Instructions (Rotation and Shift Operation)
*1. MPS instruction cannot be used immediately after an STL instruction, even in a drive processing circuit.

6 Step Ladder Instructions
6.1 Step Ladder
Device number Name Function and application
This relay is normally ON while the PLC is in the RUN mode. Use this relay as the program input condition requiring the normally driven status or for indicating the PLC operation status.
This relay turns ON and remains ON only instantaneously (during one operation cycle) when the PLC mode is changed from STOP to RUN. Use this relay for the initial setting of a program or for setting the initial state relay.
When this relay is set to ON, transfer of the ON status is disabled among all state relays. Because programs in state relays are operating even in the transfer disabled status, output coils do not turn OFF automatically.
M8040 STL transfer disable
Use this relay to prevent simultaneous startup of another flow or as a process ON/OFF flag. When M8047 is OFF, M8046 is normally OFF. When M8047 is ON, M8046 operates as follows: FX3S PLC When at least one among the state relays S0 to S255 is ON: ON When all of the state relays S0 to S255 are OFF: OFF FX3G/FX3GC/FX3U/FX3UC PLCs When at least one among the state relays S0 to S899 and S1000 to S4095 is ON: ON When all of the state relays S0 to S899 and S1000 to S4095 are OFF: OFF
M8046*1 STL state ON
When this relay is driven, the device number of a state relay in the ON status having the smallest device number among S0 to S255 (FX3S PLC), S0 to S899 and S1000 to S4095 (FX3G/FX3GC/FX3U/FX3UC PLCs) is stored to D8040, and the state relay number in the ON status having the next smallest device number is stored to D8041. In this way, up to eight state relays in the ON status are stored in registers up to D8047.
M8047*1 Enable STL monitoring
*1. Processed when END instruction is executed.
M8002
SET EN ENO
STL EN ENO s
Step ladder is started by STL instruction.
SET EN ENO
STL EN ENO s X001 S0
It can be omitted.
Step ladder is finished by RET instruction
STL EN ENO s
Step ladder is started by STL instruction.
SET EN ENO
STL EN ENO s X003 S1
S30
Step ladder is finished by RET instruction

6 Step Ladder Instructions
6.1 Step Ladder
STL EN ENO s Y002
S20
Y003
STL EN ENO s Y003
STL EN ENO s Y002
S20
S20
Y002 X005
M8000
Y003
Move the position.
How to Read Explanation of Instructions
Insert "always ON" contact.
STL EN ENO s SET EN ENO
Transfer to the next state relay (SET instruction)
Transfer to a separate state relay (OUT instruction)
Applied Instructions (Program Flow)
STL EN ENO s
Applied Instructions (Move and Compare)
SET EN ENO
Transfer processing SET EN ENO
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

6 Step Ladder Instructions
6.1 Step Ladder

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


6 Step Ladder Instructions
6.1 Step Ladder
STL EN ENO s
S29
STL EN ENO s
S39
STL EN ENO s
S49
STL EN ENO s
How to Read Explanation of Instructions
STL EN ENO s
STL EN ENO s
X010 X011 X012
SET EN ENO
Before recombination, program the drive processing of state relays first. After that, program only the transfer processing to recombination state relays continuously.
Applied Instructions (Program Flow)
STL EN ENO s
S20
STL EN ENO s
Applied Instructions (Move and Compare)
STL EN ENO s
S100
SET EN ENO
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

6 Step Ladder Instructions
6.1 Step Ladder






6 Step Ladder Instructions
6.2 STL
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
In programs using step ladder instructions, a state relay State S is assigned to each process based on machine operations, and input condition and output control are programmed as sequences connected to the state output.
STL instruction for step ladder programs is expressed as follows in each language.
Expression in each language
STL 16 bits Continuous STL(EN,s);
Variable Description Data type
Input variable EN Execution condition Always TRUE
Target device or variable Bit
ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
→ Section 6.3 RET


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
RET instruction for step ladder programs is expressed as follows in each language.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

6 Step Ladder Instructions


Expressing step ladder in structured program

SET(M8002, S0); STL(TRUE, S0);
Y000:=TRUE; SET(X000, S20); STL(TRUE, S20);
S0:=X001; RET(TRUE);

7 Applied Instructions (Program Flow)
This chapter introduces the instructions mainly related to control flow of sequence programs such as conditional program execution and priority processing.
Instruction name Function Reference
Conditional Jump Section 7.1 CJP
Call Subroutine Section 7.2 CALLP
SRET Subroutine Return Section 7.3
IRET Interrupt Return Section 7.4
DI Disable Interrupt Section 7.5
EI Enable Interrupt Section 7.6
FEND Main Routine Program End Section 7.7
WDT Watchdog Timer Refresh Section 7.8
How to Read Explanation of Instructions
FOR Start a FOR/NEXT Loop Section 7.9
NEXT End a FOR/NEXT Loop Section 7.10
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
CJ or CJP instruction jumps to the specified pointer number or ladder block label. The sequence program steps between CJ or CJP instruction and the pointer are not executed.

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

Pointer number or ladder block label for the jump destination ANY16

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

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump
CJ EN ENO p P10
Jumps to the pointer while the command is ON.
Executed in every scan
User program Which is skipped and is not executed when the command turns ON.
How to Read Explanation of Instructions
ON CJP EN ENO p P10
Jumps to the pointer only in one operation while the command is ON.
User program Which is skipped and is not executed in one operation
Executed in one scan
cycle when the command turns ON.
Cautions
Applied Instructions (Program Flow)
CJ EN ENO p
Applied Instructions (Move and Compare)
Y011
P20:
Applied Instructions (Arithmetic and Logical Operation)
X022 CJ EN ENO p P10
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump




7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump
CJ EN ENO p P5
User program (It is skipped, and is not executed.)
Pointer type Jumping range
Pointer number Pointer numbers within the same program file
Ladder block label Ladder block labels within the same POU
How to Read Explanation of Instructions
In one operation cycle after X023 changes to ON from OFF, CJ P7 instruction becomes valid. By using this method, jump can be executed after all outputs between CJ P7 instruction and the pointer P7 turn OFF.
M0
CJ EN ENO p P7
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump
In the program example shown below, when X000 turns ON, the program execution jumps from CJ instruction in the first circuit to the pointer P8. While X000 is OFF, jump is executed. The program is sequentially executed from first step, and jumps from 11th circuit to the pointer P9. The jumped instruction is not executed.
CJ EN ENO p
Y001
M1
X003 S1
OUT_T EN ENO TCoil TValue
TN246
OUT_T EN ENO TCoil TValue TC246 K1000
OUT_C EN ENO CCoil CValue
When each input changes during jump in the program shown on the left, each coil executes the following operation:
Classification Contact status before
X001, X002, X003 OFF Y001, M1, S1 OFF
X001, X002, X003 ON Y001, M1, S1 ON
P8:
X004 OFF Timer is not activated.
10 ms timer and 100 ms timer (T0)
Counting is paused (and is restarted after X000 turns OFF).
CJ EN ENO p P9
Timer is not activated. The deactivation status is reset when X013 turns ON.
X012 Y001
1 ms timer (T246)
Counting is continued (and the contact is activated after X000 turns OFF).
P9:
RST EN ENO
X007 OFF X010 OFF
Countint is not activated. The deactivation status is reset when X013 turns ON.
X007 OFF X010 ON
Counting is paused (and is restarted after X000 turns OFF).
X011 OFF Instruction is not executed during jump. But MTR, HSCS, HSCR, HSZ, SPD, PLSY and PWM instructions continue their operations.
X011 ON

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump
When X011 turns ON while the RST instruction for the counter C0 is operating (X010 is ON), the program execution jumps past the RST instruction due to the CJ instruction. In this jump status, the counter C0 remains reset. Accordingly, the current value of C0 remains "0" even if X012 turns ON. To clear this reset status, it is necessary to turn OFF the RST instruction for counter C0. (Refer to the program shown below.)
OUT_C EN ENO CCoil CValue
X011 CJ EN ENO p
RST EN ENO
CN0
P0:
Timing chart
Jump operation by CJ instruction driven by X011
How to Read Explanation of Instructions
Because C0 remains reset, its current value remains unchanged even if X012 turns ON.
Current value of C0 1 2 3 Counter is reset.
RST C0
Program example for activating a timer and counter even during a jump
OUT_C EN ENO CCoil CValue
X011 CJ EN ENO p
Applied Instructions (Program Flow)
RST EN ENO
CN0
P0:
Applied Instructions (Move and Compare)
M8000 Clears the reset status of counter C0 during jump
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.1 CJ / Conditional Jump

Current value of C0 1 2 3 Counter is reset.
In the same operating cycle as the reset, the reset status of counter C0 is cleared.
The figure below shows the contents of operation and the relationship between the master control instruction. Avoid using 2), 4) and 5) because the operation will be complicated.

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

7 Applied Instructions (Program Flow)
7.2 CALL / Call Subroutine
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction calls and executes a program which should be processed commonly in a sequence program. This instruction saves the number of program steps, and achieves efficient program design. For creating a subroutine program, FEND and SRET instructions are required. A similar processing is available by creating a function block and read it out from the program block. Refer to the following manual for creating function blocks.
→ GX Works2 Version 1 Operating Manual (Structured Project)
→ Q/L/F Structured Programming Manual (Fundamentals)
Expression in each language
CALL EN ENO p
How to Read Explanation of Instructions
Use a subroutine program by reading out the function block made of other program parts.
CALLP EN ENO p
Variable Description Data type
EN Execution condition Bit
Pointer number or ladder block label of subroutine program to be executed. ANY16
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.2 CALL / Call Subroutine

Main program Program area from the step 0 to FEND instruction
Subroutine program Program area from a pointer Pn to SRET instruction
Be sure to program in combination with the SRET and FEND functions.
→ Refer to Section 7.3 for SRET. → Refer to Section 7.7 for FEND.


7 Applied Instructions (Program Flow)
7.2 CALL / Call Subroutine
1. Example of fundamental use (no nesting)
X000 CALL EN ENO p
Main program While X000 is ON, the program execution jumps to a step with the label P10.
P10:
Subroutine program When SRET instruction is executed after the subroutine program has executed, the program execution returns to the original step +1.
How to Read Explanation of Instructions
CALLP EN ENO p
Main program When X001 turns ON from OFF, the program execution jumps to the pointer P11 only once.
P11:
Subroutine program1 When SRET instruction is executed, the program execution returns to the main program. If X002 is ON while the subroutine program 1 is executed, the program execution jumps to a step with the pointer P12.
CALL EN ENO p
Applied Instructions (Program Flow)
P12:
The subroutine program with P12 is executed, and then the program execution returns to the subroutine program with P11 by SRET instruction.
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.2 CALL / Call Subroutine
This section explains cautions on creating programs in subroutines and interrupt routines. The explanation below is given for subroutines, but the situation also applies to interrupt routines.
1. When using timers in subroutines (or interrupt routines) Use retentive type timers T192 to T199 in subroutines. These timers execute counting when the coil instruction or END instruction is executed. After a timer reaches the set value, the output contact is activated when the coil instruction or END instruction is executed. Because general timers execute counting only when the coil instruction is executed, they do not execute counting if they are used in subroutines in which the coil instruction is executed only under some conditions.
3. Countermeasures against latches of devices used in subroutines (or interrupt routines) Devices which were set to ON in a subroutine are latched in the ON status even after the subroutine is finished. (Refer to the program described later.) When RST instruction for a timer or counter is executed, the reset status of the timer or counter is latched also. For turning OFF such a device latched in the ON status or for canceling such a timer or counter latched in the reset status, reset such a device in the main program after the routine is finished, or program a sequence for resetting such a device or for deactivating RST instruction in the routine. (Refer to the program described later.)

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


The preceding RST C0 instruction is deactivated in the subroutine.
Counter reset instruction is deactivated (part in above program). B Counter is reset (part in above program). A

7 Applied Instructions (Program Flow)
7.3 SRET / Subroutine Return
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction returns the program execution from a subroutine to the main program.
Expression in each language
SRET 16 bits Continuous Use a subroutine program by reading out the function block made of other program parts.
2. Set data
Variable Description Data type
Input variable EN Execution condition Always TRUE
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
- No target device is available.
When CALL instruction in the main program is executed, the program execution jumps to a subroutine. SRET instruction returns the program execution to the main routine.
→ Refer to Section 7.2.

7 Applied Instructions (Program Flow)
7.4 IRET / Interrupt Return
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction returns the program execution from an interrupt routine to the main program.
Expression in each language
IRET 16 bits Continuous IRET(EN);
Variable Description Data type
How to Read Explanation of Instructions
Input variable EN Execution condition Always TRUE
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
- No target device is available.
When an interrupt (input, timer or counter) is generated while the main program is executed, the program execution jumps to an interrupt (I) routine. IRET instruction returns the program execution to the main routine. The table below shows the three types of jump to an interrupt routine.
Applied Instructions (Program Flow)
Input interrupt Executes the interrupt processing when an input(X) signal turns ON or OFF.
Timer interrupt Executes the interrupt processing at a specified time interval (constant cycle).
Counter interrupt *1 Executes the interrupt processing when a high speed counter reaches its set value.
*1. This function is provided only in the FX3U, FX3UC and FX2C PLCs Ver. 3.07 or later.
→ For the interrupt function, refer to Chapter 35.
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.4 IRET / Interrupt Return
→ For the interrupt pointer, refer to Chapter 35.

Set an interrupt pointer
INC EN ENO
IRET EN ENO
Do not program IRET instruction because it is automatically added during the compilation.
Range of interrupt enabled
If necessary, program the DI instruction as it is a interrupt disabled function.
Do not program the FEND instruction as it is automatically added during the compilation.

7 Applied Instructions (Program Flow)
7.4 IRET / Interrupt Return
Task for main program
Interrupts are usually disabled in PLCs. Use EI instruction to enable interrupts. When X000 turns ON while the main program is executed,instructions after the interrupt routine pointer I001 are executed, and the program execution returns to the original main program by IRET instruction.
OUT_C EN ENO CCoil CValue CC255
Task for interrupt program(Interrupt pointer I001 is set by event.)
I001:The rising edge of X000 is detected.
How to Read Explanation of Instructions
Task for interrupt program(Interrupt pointer I620 is set by event.)
The timer interrupt of the pointer I620 is executed every timer time of 20 ms, and the program execution is returned to the original main program by IRET instruction each time.
I620:Interrupt every 20 ms.
Task for interrupt program(Interrupt pointer I010 is set by event.)
The high speed counter interrupt of the pointer I010 is executed when the current value of a high speed counter becomes equivalent to a value specified by DHSCS instruction, and the program execution returns to the original main program by IRET.
I010:High speed counter interrupt
High speed counter routine
Task for main program
Interrupts are usually disabled in PLCs. Use EI instruction to enable interrupts. When X000 turns ON while the main program is executed,instructions after the interrupt routine pointer I001 are executed, and the program execution returns to the original main program by IRET instruction.
Task for interrupt program(Interrupt pointer I001 is set by event.)
I001:The rising edge of X000 is detected.
Applied Instructions (Program Flow)
Task for interrupt program(Interrupt pointer I620 is set by event.)
I620:Interrupt every 20 ms.
Applied Instructions (Move and Compare)
The timer interrupt of the pointer I620 is executed every timer time of 20 ms, and the program execution is returned to the original main program by IRET instruction each time.
Task for interrupt program(Interrupt pointer I010 is set by event.)
I010:High speed counter interrupt
The high speed counter interrupt of the pointer I010 is executed when the current value of a high speed counter becomes equivalent to a value specified by DHSCS instruction, and the program execution returns to the original main program by IRET.
Applied Instructions (Arithmetic and Logical Operation)
High speed counter routine
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.5 DI / Disable Interrupt
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction disables interrupts after interrupts were enabled by EI instruction.
Expression in each language
DI 16 bits Continuous DI(EN);
Variable Description Data type
Input variable EN Execution condition Always TRUE
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
- No target device is available.
DI instruction is the independent type, and does not require command (drive) contact.
Interrupts (requests) generated after DI instruction are processed after EI instruction is executed.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Interrupts are usually disabled in PLCs. This instruction enables interrupts in PLCs. Use this instruction for using the input interrupt, timer interrupt and counter interrupt functions.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
EI instruction is the independent type, and does not require command (drive) contact.

7 Applied Instructions (Program Flow)
7.6 EI / Enable Interrupt
→ Refer to Section 7.4.
2) Use the EI instruction as follows when the FXU, FX2C, FX2N, FX2NC, FX3U and FX3UC PLCs use the pulse catch function. The IE instruction does not need to be programmed when the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC uses the pulse catch function. For the details of special auxiliary relays and other devices used with the pulse catch function, refer to the following manual.
→ FX Structured Programming Manual [Device & Common] When using the FX3U PLC
EI(TRUE)
EI EN ENO
Y000:=M8170; *1
RST(X002, M8170); *1
M8170 *1
Y000
With the rising edge of X000 detected, M8170 is reset by interrupt.
Resets pulse catch results.
*1. A special auxiliary relay for the X000 pulse catch function used in the FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. The special auxiliary relay depends on the PLC used and input number. For the pulse catch function, refer to Chapter 35.
[Structured ladder/FBD] · d M8170


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction indicates the end of the main program.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
When FEND instruction is executed, output processing, input processing and watchdog timer refresh are executed, and then the program execution returns to the step 0. FEND instruction is required in creating subroutine programs and interrupt programs.
*1. The function FEND instruction is added automatically during compilation, and does not require to be programmed. Refer to "Cautions".

7 Applied Instructions (Program Flow)
7.7 FEND / Main Routine Program End

*1. If task names other than "MELSEC_MAIN" are used, FEND instruction is added automatically, and cause an error. Refer to item 6 of "Cautions".
→ Refer to Section 7.2.
6) When CALL instruction is used, set the registered task name to "MELSEC_MAIN". Any other task names add FEND instruction automatically at the end of the program block (*1 in "2. In the case of CALL instruction") during compilation, and cause an error during writing to the PLC (due to already existing FEND instruction located at the end of the main program (*2 in "2. In the case of CALL instruction")). It is not possible to use CALL instruction in multiple tasks. Use function blocks.

7 Applied Instructions (Program Flow)
7.8 WDT / Watchdog Timer Refresh
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction refreshes the watchdog timer in a sequence program.
Expression in each language
WDT
WDTP EN ENO
2. Set data
How to Read Explanation of Instructions
Variable Description Data type
Input variable EN Execution condition Bit
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
- No target device is available.
When the operation cycle (time until END or FEND instruction is executed after the step 0) of a PLC exceeds 200 ms, a watchdog timer error (indicating abnormal operation) occurs. The CPU error LED lights, and the PLC stops. When the operation cycle is long, insert WDT instruction in the middle of the program to avoid the watchdog timer error.
Applied Instructions (Program Flow)
Command contact WDTP EN ENO
One scan is executed.
Command contact WDT EN ENO
Applied Instructions (Move and Compare)
Each scan is executed.
Applied Instructions (Arithmetic and Logical Operation)
D8000 Watchdog timer time Up to 32767 ms can be set in units of ms (initial value: 200 ms).
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.8 WDT / Watchdog Timer Refresh
In such configuration that many special extension devices (such as positioning units, cam switches, analog units and link units) are connected, the buffer memory initialization time may become longer, thus the operation time may become longer, and a watchdog timer error may occur. - Caution when many FROM/TO instructions are driven at one time.
When many FROM/TO instructions are executed or when many buffer memories are transferred, the operation time may become longer, and a watchdog timer error may occur. - Caution when there are many high speed counters (software counters).
When many high speed counters are provided and high frequency are counted at one time, the operation time may become longer, and a watchdog timer error may occur.

Watchdog timer refresh If WDT (FNC 07) instruction is not programmed, the value of D8000 is valid during END processing.

If an input relay (X) is used as the command contact, input refresh is disabled, so the program execution cannot be returned from the area between Pn and CJ. As the command contact, use such device that can be set to OFF in a program being jumped.


7 Applied Instructions (Program Flow)
7.8 WDT / Watchdog Timer Refresh
WDT EN ENO
NEXT EN ENO
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.9 FOR / Start a FOR/NEXT Loop
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
FOR instruction specifies the number of repetition of the loop between FOR and NEXT instructions.
Expression in each language
Syntax such as condition sentence is used. Refer to the following manual for syntaxes.
FOR 16 bits Continuous
→ Q/L/F Structured Programming Manual
Variable Description Data type
EN Execution condition Always TRUE
Number of repetition of the loop between FOR and NEXT instructions ANY16
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
S: Refer to "Cautions".
→ Refer to Section 7.10 for details.
FOR instruction and NEXT instruction are set as a pair in programming.

7 Applied Instructions (Program Flow)
7.10 NEXT / End a FOR/NEXT Loop
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
FOR instruction specifies the number of repetition of the loop between FOR and NEXT instructions.
Expression in each language
Syntax such as condition sentence is used. Refer to the following manual for syntaxes.
NEXT 16 bits Continuous
→ Q/L/F Structured Programming Manual
Variable Description Data type
How to Read Explanation of Instructions
Input variable EN Execution condition Always TRUE
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
- No target device is available.
The loop between FOR and NEXT instruction is repeated "n" times (which is specified by the input variable (n)). After the loop is repeated by the specified number of times, steps after NEXT instruction are executed.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
NEXT instruction and FOR instruction are set as a pair in programming.
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

7 Applied Instructions (Program Flow)
7.10 NEXT / End a FOR/NEXT Loop
FOR-NEXT loop can be nested up to 5 levels.

→ For details on changing and resetting the watchdog timer, refer to Section 7.8.

When number of FOR instructions is not equivalent to the number of NEXT instructions.


When the data value (current value) of D0Z (D4 when Z is "4") is "6", the loop 2) is repeated 6 times.
When X010 is OFF When K1X000 is "7", the loop 1) is repeated 7 times.
When X010 is ON The program execution jumps to the pointer P22, and the loop 1) is skipped.
Number of times of repeating the loops 1), 2) and 3).
7 6 4 = 168 times 6 4 = 24 times

8 Applied Instructions (Move and Compare)
This chapter introduces fundamental data processing instructions such as data transfer and data comparison which are regarded as most important in applied instructions.
Instruction name Function Reference
Compare Section 8.1 CMPP
DCMPP
ZCP
Zone Compare Section 8.2 ZCPP
DZCPP
MOV
Move Section 8.3 MOVP
DMOVP
SMOV
Shift Move Section 8.4 SMOVP
Complement Section 8.5 CMLP
DCMLP
BMOV
Block Move Section 8.6 BMOVP
Fill Move Section 8.7 FMOVP
DFMOVP
XCH
Exchange Section 8.8 XCHP
DXCHP
BCD
Conversion to Binary Coded Decimal Section 8.9 BCDP
DBCDP
BIN
Conversion to Binary Section 8.10 BINP
DBINP


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction compares two values, and outputs the result (smaller, equal or larger) to bit devices (3 points).
→ For the contact comparison instruction, refer to Chapter 28.
→ For floating point comparison, refer to Section 18.1.
Data or device number handled as comparison value ANY16 ANY32
Data or device number handled as comparison source ANY16 ANY32
Head bit device to which comparison result is output. ARRAY [0..2] OF Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z

8 Applied Instructions (Move and Compare)
8.1 CMP / Compare

s1 s2 Turns on in the case of >
s1 s2 Turns on in the case of =
s1 s2 Turns on in the case of
Even if the command input turns OFF and CMP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON.

Turns on in the case of [ +1, ] > [ +1, ] s2 s1 s1 s2
Turns on in the case of [ +1, ] = [ +1, ] s2 s1 s1 s2
Turns on in the case of [ +1, ] < [ +1, ] s2 s1 s1 s2
Even if the command input turns OFF and DCMP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d

8 Applied Instructions (Move and Compare)
8.1 CMP / Compare
1. When comparing present value of a counter
CMP EN s1 s2
d M0 K100 CN20
How to Read Explanation of Instructions
CN20
Turns ON in the case of K100 > C 20 current value.
M1 Y001
Turns ON in the case of K100 = C 20 current value.
M2 Y002
Turns ON in the case of K100 < C 20 current value.
Latched in the ON status.
Latched in the ON status.
Latched in the ON status.
CMP(X000, K100, CN20, M0); Y000:=X000 AND M0; Y001:=X000 AND M1; Y002:=X000 AND M2;
If it is necessary to clear the comparison result when the instruction is not executed, add the following contents under the above program.
RST EN ENO
Applied Instructions (Program Flow)
RST(NOT X000, M0); RST(NOT X000, M1); RST(NOT X000, M2);
Applied Instructions (Move and Compare)
2) ZRST
Applied Instructions (Arithmetic and Logical Operation)
ZRST(NOT X000, M0, M2);
M0 M2
M0 to M2 are reset.
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.2 ZCP / Zone Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction compares two values (zone) with the comparison source, and outputs the result (upper, equal or lower) to bit devices (3 points).


Data or device handled as lower comparison value ANY16 ANY32
Data or device handled as upper comparison value ANY16 ANY32
Data or device number handled as comparison source ANY16 ANY32
Head bit device to which comparison result is output. ARRAY [0..2] OF Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
z S2 S3 z
S: Refer to "Cautions".

8 Applied Instructions (Move and Compare)
8.2 ZCP / Zone Compare
ZCP EN s1 s2
Lower comparison value M100
(Lower comparison value specified by ) > (Comparison source specified by )
(Lower comparison value specified by ) (Comparison source specified by ) (Upper comparison value specified by )
How to Read Explanation of Instructions
(Comparison source specified by ) > (Upper comparison value specified by ) s2
Even if the command input turns OFF and ZCP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d
DZCP EN s1 s2
Applied Instructions (Program Flow)
(Lower comparison value specified by ) > (Comparison source specified by ) s3
(Lower comparison value specified by ) (Comparison source specified by ) (Upper comparison value specified by )
(Comparison source specified by ) > (Upper comparison value specified by ) s2
Applied Instructions (Move and Compare)
Even if the command input turns OFF and DZCP instruction is not executed, to +2 latch the status just before the command input turns OFF from ON. d d
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.2 ZCP / Zone Compare

Turns ON in the case of "K100 > CN30 (current value)".
Turns ON in the case of "K100 CN30 (current value) K120"
Turns ON in the case of "K120 < CN30 (current value)".
Turns ON in the case of "K120 > CN30 (current value)".
Turns ON in the case of "K120 = CN30 (current value)".
Turns ON in the case of "K120 < CN30 (current value)".


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction transfers (copies) the contents of a device to another device.
MOV 16 bits Continuous MOV(EN,s,d); Or an assignment statement
MOVP 16 bits Pulse MOVP(EN,s,d); Or an assignment statement
DMOV 32 bits Continuous DMOV(EN,s,d); Or an assignment statement
DMOVP 32 bits Pulse DMOVP(EN,s,d); Or an assignment statement
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z

8 Applied Instructions (Move and Compare)
8.3 MOV / Move
Command input MOV EN s
When specifying digits of a bit device (K1X000 K1Y000) The bit device transfers a maximum of 16 points (multiple of 4).

When a word device is specified The word device transfers 1 point.


8 Applied Instructions (Move and Compare)
8.3 MOV / Move
Command input DMOV EN s
[ +1, ] [ +1, ] s s d d
data Transfer destination data
When specifying digits of a bit device (K8X000 K8Y000) The bit device transfers a maximum of 32 points (multiple of 4).
OFF X001
: K8Y000 : K8X000 d s Before execution
X37 to X1 X0
Y37 to Y1 Y0
How to Read Explanation of Instructions
ON OFF OFF ON
ON ON ON OFF
ON Y000 OFF
ON Y001 OFF
X37 to X1 X0
Y37 to Y1 Y0
ON OFF OFF ON
ON OFF
ON Y037
When a word device is specified The word device transfers 1 point.
: D51, D50 : D11, D10 d s
K500000 K4321
K500000 K500000
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.3 MOV / Move
1. When reading the current value of a timer and counter
X001 MOV EN s
(Current value of T0) (D20) The operation is the same as a counter.

D 10=K100(10-second timer) D 10=K50(5-second timer) When X002 is ON, When X002 is OFF,
MOV(X002, K100, D10); MOV(NOT X002, K50, D10); OUT_T(M0, TC20, D10);


d TN0 D20


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction distributes and composes data in units of digit (4 bits).
Word device storing data whose digits will be moved. ANY16
Word device storing data whose digits are moved ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z

8 Applied Instructions (Move and Compare)
8.4 SMOV / Shift Move

In the case of = 4, = 2, = 3 4th digit 1st digit 2nd digit 3rd digit

M8168 is available for other instructions also. After using M8168 for SMOV instruction, return it to OFF.
![Page 147 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-147.webp?w=400)
8 Applied Instructions (Move and Compare)
8.4 SMOV / Shift Move
The data on three-digit digital switches are composed, and stored as binary data to D2.
102 101 100
(X020 to X027)2-digit BCD
K2X020
8 1 8 1 8 1
(X000 to X003)1-digit BCD
X003 to X000 X027 to X020
SMOV EN s m1
1-digit BCD data of D1 is transferred to the 3rd digit (BCD data) of D2, and automatically converted into binary data.
D1 D2 K1 K1 K3
Data on three digital switches connected to non-consecutive input terminals are composed.
BIN(M8000, K2X020, D2); BIN(M8000, K1X000, D1); SMOV(M8000, D1, K1, K1, K3, D2);
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.5 CML / Complement
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction inverts data in units of bit, and then transfers (copies) the inverted data.


Data to be inverted or word device storing the data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z
S: Refer to "Cautions".

8 Applied Instructions (Move and Compare)
8.5 CML / Complement
Data having been inverted
b15 b14 b13 b12 b11 b11 b9 b8 b7 b6 n5 b4 b3 b2 b1 b0
0 1 0 1 1 1 0 0 0 1 0 1 0 1 0 1
sign bit (0=Positive number 1=Negative number)
0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1
Inverted data is transferred.
How to Read Explanation of Instructions
→ +1, d s s +1, d
Data having been inverted
b31 b30 b29 b28 b27 b26 b25 to b7 b6 n5 b4 b3 b2 b1 b0
0 1 0 1 1 1 0 0 1 0 1 0 1 0 1
sign bit (0=Positive number 1=Negative number)
0 1 0 1 0 1 0 1 1 0 0 0 1 0 1
Applied Instructions (Program Flow)
Inverted data is transferred.
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.5 CML / Complement


Y015 b14 b13 b12 b11 b11 b9 b8 b7 b6 n5 b4 b3 b2 b1 b0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction transfers (copies) a specified number of data at one time.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z

8 Applied Instructions (Move and Compare)
8.6 BMOV / Block Move
BMOV instruction transfers "n" points of data from the device specified by to the device specified by at one time.


By controlling the direction inverse flag M8024*1 for BMOV instruction, data can be transferred in two directions in one program.


D5D10 D6D11 D7D12
D5D10 D6D11 D7D12
M8001 BMOV direction inverse OFF Normally OFF during operation
*1. M8024 is cleared when the PLC mode is changed from RUN to STOP.



8 Applied Instructions (Move and Compare)
8.6 BMOV / Block Move
BMOV instruction has a special function to file registers (D1000 and later). The maximum number of file register differs from one PLC to another. This explanation here uses the FX3U and FX3UC PLCs as examples. For the details of the file registers, refer to the following manual.
→ FX Structured Programming Manual [Device & Common]
Instruction Contents of transfer Remarks
BMOV Can read from and write to the file register area [A] inside the program memory. -
Other applied instructions than BMOV
Can read from and write to the data register area [B] inside the image memory in the same way as general data registers.
Because the data register area [B] is provided inside the system RAM in PLCs, its contents can be arbitrarily changed without regard to the optional memory format.
When power is turned ON, data registers set as file registers are automatically copied from the file register area [A] to the data register area [B].
Inside system RAM Inside built-in memory
When power is turned ON When PLC mode is changed from STOP to RUN
Devices D1000 and later specified as operands in applied instructions other than BMOV, indirectly specified values for timers or counters or devices in RST instruction are read from and written to the area [B] in the same way as general data registers.
500 points 14 blocks maximum (7000 points maximum)
[B]
Remaining area can be used as data register for general purpose.

8 Applied Instructions (Move and Compare)
8.6 BMOV / Block Move
5) Handling of flash memory When changing the contents of file registers secured inside the flash memory, observe the following condition: - Set the protect switch to OFF in the optional memory. - When writing data using a continuous operation type instruction in a program, data is written to the flash memory in every operation cycle of the PLC. To prevent this, as the flash memory has a limit to the number of times of writing operations, be sure to use a pulse operation type instruction (BMOVP) so that the number of times of writing is reduced. - It takes 66 to 132 ms to write data of one serial block (500 points) to the flash memory. Execution of the program is paused during this period. Because the watchdog timer is not refreshed at this time, it is necessary to take proper countermeasures such as inserting the WDT instruction into the sequence program. - Do not turn OFF the power while the contents of file registers are changed. If the power is turned OFF during the change, the data stored in file registers may be filled with unexpected values, or a parameter error may occur.
6) Write to the EEPROM - It takes 80 ms to write data in one continuous block (500 points) to the EEPROM. Note that execution of the program is paused during this period, but the watchdog timer is automatically refreshed. - It takes 10 ms to write data in one point to the EEPROM. Note that execution of the program is paused during this period, and the watchdog timer is automatically refreshed. - Write to the EEPROM using peripheral equipment.
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
500 points 14 blocks maximum (7000 points maximum) [A]
Applied Instructions (Move and Compare)
When X000 is set to ON, the data register area [B] is read.
BMOVP EN s n
Applied Instructions (Arithmetic and Logical Operation)
A file register can be specified as . But if a same number with is specified, the same-number register update mode is selected. However, even if a file register having different number is specified for and respectively, data cannot be transferred from the file register area to another file register area. In such a case, read the contents of a file register specified as in the same-number register update mode to the data register area [B] once, and then write the data.
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.7 FMOV / Fill Move
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction transfers same data to specified number of devices.


Transfer source data or device storing data ANY16 ANY32
Head word device of transfer destination (Same data is transferred from the transfer source at one time.) ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
S: Refer to "Cautions".

8 Applied Instructions (Move and Compare)
8.7 FMOV / Fill Move
FMOV EN s n
d Transfer source data Number of points
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
s s Command input
DFMOV EN s n
+3, +2 d d
+5, +4 d d
Applied Instructions (Move and Compare)
+7, +6 d d
+9, +8 d d
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.7 FMOV / Fill Move
1. When writing specified data to two or more devices



FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S1 z z z
z S1 S1 z z z

8 Applied Instructions (Move and Compare)
8.8 XCH / Exchange


When the instruction is executed while M8160 is ON, high-order 8 bits (byte) and low-order 8 bits (byte) of a word device are exchanged each other. (The FXU PLC of V2.30 or earlier does not support the extension function.) This is the same operation as SWAP instruction, so use SWAP instruction for newly programming. In the case of 32-bit operation, high-order 8 bits (byte) and low-order 8 bits (byte) of a word device are changed.

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


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts binary (BIN) data into binary-coded decimal (BCD) data. Binary data is used in operations in PLCs. Use this instruction to display numeric values on the seven- segment display unit equipped with BCD decoder.
Word device storing the conversion source (binary) data ANY16 ANY32
Word device of the conversion destination (binary-coded decimal) data ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z

8 Applied Instructions (Move and Compare)
8.9 BCD / Conversion to Binary Coded Decimal



8 Applied Instructions (Move and Compare)
8.9 BCD / Conversion to Binary Coded Decimal
The FXU PLC of V2.30 or earlier does not support the extension function. When executing the instruction with M8023 ON, conversion takes place from binary float to decimal float.
D2 D0
M8000
M8023
D3 D2
For the float conversion, only data register (D) is applicable as the device for and .
BIN Converts binary-coded decimal (BCD) data into binary (BIN) data.
How to Read Explanation of Instructions
In BCD or BCDP (16-bit type) instructions, an operation error occurs when the value is outside the range from 0 to 9,999. In DBCD or DBCDP (32-bit type) instructions, an operation error occurs when the value is outside the range from 0 to 99,999,999.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.9 BCD / Conversion to Binary Coded Decimal
1. When the seven-segment display unit has 1 digit


In the case of 2 digits: K2 In the case of 3 digits: K3 In the case of 4 digits: K4

In the case of 5 digits: K5 In the case of 6 digits: K6 In the case of 7 digits: K7 In the case of 8 digits: K8

8 Applied Instructions (Move and Compare)
8.10 BIN / Conversion to Binary
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts binary-coded decimal (BCD) data into binary (BIN) data. Use this instruction to convert a binary-coded decimal (BCD) value such as a value set by a digital switch into binary (BIN) data and to receive the converted binary data so that the data can be handled in operations in PLCs.
Expression in each language
BIN 16 bits Continuous BIN(EN,s,d);
How to Read Explanation of Instructions
BINP 16 bits Pulse BINP(EN,s,d);
DBIN 32 bits Continuous DBIN(EN,s,d);
DBINP 32 bits Pulse DBINP(EN,s,d);
EN Execution condition Bit
Word device storing the conversion source (binary-coded decimal) data ANY16 ANY32
ENO Execution state Bit
Applied Instructions (Program Flow)
Word device of the conversion destination (binary) ANY16 ANY32
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
Applied Instructions (Move and Compare)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z
S: Refer to "Cautions".
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.10 BIN / Conversion to Binary


When "K8X000" is specified (sequence on the right) X034

8 Applied Instructions (Move and Compare)
8.10 BIN / Conversion to Binary
The FXU PLC of V2.30 or earlier does not support the extension function. When executing the instruction with M8023 ON, conversion takes place from binary-coded decimal float to binary float.
D6 D4
M8000
M8023
D7 D6 Binary float value
For the float conversion, only data register (D) is applicable as the device for and .
BCD Converts binary (BIN) data into binary-coded decimal (BCD) data.
How to Read Explanation of Instructions
When the data of specified by is not binary-coded decimal (BCD), M8067 (operation error) turns ON. But M8068 (operation error latch) does not turn ON.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

8 Applied Instructions (Move and Compare)
8.10 BIN / Conversion to Binary
1. When the digital switch has 1 digit


Output destination In the case of 2 digits: K2 In the case of 3 digits: K3 In the case of 4 digits: K4

Output destination In the case of 5 digits: K5 In the case of 6 digits: K6 In the case of 7 digits: K7 In the case of 8 digits: K8

9 Applied Instructions (Arithmetic and Logical Operation)
This chapter introduces the instructions for arithmetic operations and logical operations of numeric data.
Instruction name Function Reference
Addition Section 9.1 DADD
SUBP
Subtraction Section 9.2 DSUB
MULP
Multiplication Section 9.3 DMUL
DIVP
Division Section 9.4 DDIV
How to Read Explanation of Instructions
INC
Increment Section 9.5 INCP
DINCP
DEC
Decrement Section 9.6 DECP
DDECP
WAND
Logical Word AND Section 9.7 WANDP
DANDP
WOR
Logical Word OR Section 9.8 WORP
DORP
WXOR
Applied Instructions (Program Flow)
Logical Exclusive OR Section 9.9 WXORP
DXORP
NEG
Negation Section 9.10 NEGP
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.1 ADDP / Addition
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes addition by two values to obtain the result (A + B = C)
→ For the floating point addition instruction [DEADD], refer to Section 18.8.

Use application functions (ADD(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.

Data for addition or word device storing data ANY16 ANY32
Data for addition or word device storing data ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 z z z
S: Refer to "Cautions".

9 Applied Instructions (Arithmetic and Logical Operation)
9.1 ADDP / Addition
ADDP EN s1 s2
Addition data 1 Device storing the addition result
+ → d s1 s2
Command input DADD EN s1 s2
How to Read Explanation of Instructions
d Device storing the addition result
s1 s2 s2 [ +1, ] + [ +1, ] → [ +1, ] s1 d d
M8020 Zero ON : When the operation result is 0 OFF : When the operation result is not 0
32-bit operation), the borrow flag operates. OFF : When the operation result is not less than -32,768 (in 16-bit operation) or
-2,147,483,648 (in 32-bit operation)
Applied Instructions (Program Flow)
32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or
Applied Instructions (Move and Compare)
–1, 0, 1 –2, –1, 0, –32,768 32,767, 0, 1, 2
The most significant bit of data becomes "0".
bit of data becomes "1".
Applied Instructions (Arithmetic and Logical Operation)
–2, –1, 0, –2,147,483,648 –1, 0, 1 2,147,483,647, 0, 1, 2
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.1 ADDP / Addition
The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place. In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.
DADD EN s1 s2
D0 D0
K25
Flag (zero, borrow, carry) Operates Does not operate
+(+1)= +32,767 → 0 → +1 → +2 → +32,767 → -32,768 → -32,767
+(-1)= ← -2 ← -1 ← 0 ← -32,768 -
+(+1)= +2,147,483,647 → 0 → +1 → +2 → +2,147,483,647 → -2,147,483,648 → -2,147,483,647
+(-1)= ← -2 ← -1 ←0 ← -2,147,483,648 -
ADDP EN s1 s2
(D 0) +1 → ( D 0)
D0 D0
K1
INCP EN ENO
INCP(X001, D0); (D 0) +1 →( D 0)
Operation result · 16-bit operation · 32-bit operation


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes subtraction using two values to obtain the result (A -B = C).
→ For the floating point subtraction instruction [DESUB], refer to Section 18.9.
Use application functions (SUB(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.
Data for subtraction or word device storing data ANY16 ANY32
Data for subtraction or word device storing data ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 z z z

9 Applied Instructions (Arithmetic and Logical Operation)
9.2 SUBP / Subtraction


s1 s2 s2 [ +1, ] – [ +1, ] → [ +1, ] s1 d d Subtraction
The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place. In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.
M8020 Zero ON : When the operation result is 0 OFF : When the operation result is not 0
32-bit operation), the borrow flag operates. OFF : When the operation result is not less than -32,768 (in 16-bit operation) or
-2,147,483,648 (in 32-bit operation)
32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or
–1, 0, 1 –2, –1, 0, –32,768 32,767, 0, 1, 2
The most significant bit of data becomes "0".
bit of data becomes "1".
–2, –1, 0, –2,147,483,648 –1, 0, 1 2,147,483,647, 0, 1, 2

9 Applied Instructions (Arithmetic and Logical Operation)
9.2 SUBP / Subtraction
DSUB EN s1 s2
d (D1,D0) – 25 → (D1,D0)
How to Read Explanation of Instructions
SUBP/DSUB/DSUBP instructions DEC/DECP/DDEC/DDECP instructions
Flag (zero, borrow, carry) Operates Does not operate
-(+1)= ← -2 ← -1 ← 0 ← -32,768 -32,768 → +32,767 → +32,766
-(-1)= +32,767 → 0 → +1 → +2 → -
-(+1)= ← -2 ← -1 ←0 ← -2,147,483,648 -2,147,483,648 → +2,147,483,647 → +2,147,483,646
-(-1)= +2,147,483,647 → 0 → +1 → +2 → -
SUBP EN s1 s2
D0 D0
K1
Applied Instructions (Program Flow)
DECP(X001, D0); (D 0) – 1 → (D 0)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.3 MULP / Multiplication
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes multiplication by two values to obtain the result (A × B = C).
→ For the floating point multiplication instruction [DEMUL], refer to Section 18.10.

Use application functions (MUL(_E)) for 16-bit operation and continuous execution. For details, refer to the following manual.

Data for multiplication or word device storing the multiplication data ANY16 ANY32
Data for multiplication or word device storing the multiplication data ANY16 ANY32
Head word device storing the multiplication result ANY32 ARRAY [1..2] OF ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 S3 z
S: Refer to "Cautions".

9 Applied Instructions (Arithmetic and Logical Operation)
9.3 MULP / Multiplication
Command input MULP EN s1 s2
BIN BIN BIN ( ) × ( ) → ( +1, )
d Device storing the multiplication result
s1 s2 d d 16 bits 32 bits
MULP EN s1 s2
How to Read Explanation of Instructions
K53(H0035)
K15(H000F)
When command contact turns ON
Sign bit (0=Positive 1=Negative)
Y027 Y026 Y025 ··· Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
0 0 0 ··· 0 0 1 1 0 0 0 1 1 0 1 1
Operation result is output to K2Y000
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.3 MULP / Multiplication

→ [ +3, +2, +1, ] BIN BIN [ +1, ] × [ +1, ]
d s1 s2 s1 s2 d d d 32 bits 64 bits

D100 is output to Y017 to Y000 D101 is output to Y037 to Y020
D102 is output to Y057 to Y040 D103 is output to Y077 to Y060
The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place, for example, (D1, D0) × (D3, D2) = (D5, D4). In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.
1. Relationship between the flag operation and the sign
M8304*1 Zero ON : When the operation result is 0 OFF : When the operation result is not 0
*1. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Available in the FX3U and FX3UC PLCs of Ver. 2.30 or later.
→ For the floating point operation, refer to Chapter 18.
Device Name Description
![Page 179 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-179.webp?w=400)
9 Applied Instructions (Arithmetic and Logical Operation)
9.3 MULP / Multiplication
1. 16-bit operation
MULP EN s1 s2
(D 0) × (D 2) × (D 5, D 4) 8 9 72
MULP(X000, D0, D2, D4);
2. 32-bit operation
DMUL EN s1 s2
(D 1,D 0) × (D 3,D 2) → (D 7,D 6,D 5,D 4) 1,756 327 574,212
How to Read Explanation of Instructions
DMUL(X001, D0, D2, D4);
Function changes according to versions
Item Function summary FX3S FX3G FX3GC FX3U FX3UC
Ver. 1.00 or
Ver. 1.00 or
Ver. 1.40 or
Ver. 2.30 or
Ver. 2.30 or
later Zero flag Turns the special device M8304 ON when the operation result of MUL instruction is 0.
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.4 DIVP / Division
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes division by two values to obtain the result [A ÷ B =C...(remainder)].
→ For the floating point division instruction [DEDIV], refer to Section 18.11.

Use application functions (DIV(_E))) for 16-bit operation and continuous execution. For details, refer to the following manual.

Data for division or word device storing the data (dividend). ANY16 ANY32
Data for division or word device storing the data (divisor). ANY16 ANY32
Head word device storing the division result (quotient and remainder)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 S3 z
S: Refer to "Cautions".

9 Applied Instructions (Arithmetic and Logical Operation)
9.4 DIVP / Division
DIVP EN s1 s2
Device storing the division result
BIN ( ) ÷ ( ) → ( )··· ( +1)
16 bits s1 s2 d d 16 bits 16 bits 16 bits
How to Read Explanation of Instructions
Command input Dividend Divisor Quotient Remainder
DDIV EN s1 s2
s1 s2 s2 [ +1, ] ÷ [ +1, ] → [ +1, ] ··· [ +3, +2] s1 d BIN
Division data 1 Division data 2
d Device storing the division result 32 bits
32 bits 32 bits 32 bits
The FXU PLC of V2.30 or earlier does not support the extension function. When executing an instruction with M8023 ON, a binary float operation takes place, for example, (D1, D0) ÷ (D3, D2) = (D5, D4). In this case, K, H and D are valid as the object device for and and D is valid for . The source data needs to be converted into binary float value in advance by FLT instruction. Note, however, that constants K and H are automatically converted into binary float values.
Applied Instructions (Program Flow)
M8304*1 Zero ON : When the operation result is 0 OFF : When the operation result is not 0
Applied Instructions (Move and Compare)
32-bit operation), the carry flag operates. OFF : When the operation result is not more than 32,767 (in 16-bit operation) or
*1. Supported only by FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs. Available in the FX3U and FX3UC PLCs of Ver. 2.30 or later.
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)
![Page 182 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-182.webp?w=400)
9 Applied Instructions (Arithmetic and Logical Operation)
9.4 DIVP / Division
1. 16-bit operation
DIVP EN s1 s2
Dividend Divisor Quotient Remainder D4
(D 0) ÷ (D 2) → (D 4) ··· (D 5) 100 33 3 1
[ ST ]
DIVP(X000,D0,D2,D4);
2. 32-bit operation
DDIV EN s1 s2
Dividend Divisor Quotient Remainder
(D 1, D 0) ÷ (D 3, D 2) → (D 5, D 4) ··· (D 7, D 6) 100,000 3,333 30 10
DDIV(X001, D0, D2, D4);
Function changes according to versions
Item Function summary FX3S FX3G FX3GC FX3U FX3UC
Zero flag Turns M8304 ON when the operation result of DIV instruction is 0.
Turns M8306 ON when the operation result of DIV instruction overflows. 16-bit operation : Only when the maximum negative value (-32,768) is divided by "-1". 32-bit operation : Only when the maximum negative value (-2,147,483,648) is divided by "-1".
Ver. 1.00
Ver. 1.00
Ver. 1.40
Ver. 2.30
Ver. 2.30

9 Applied Instructions (Arithmetic and Logical Operation)
9.5 INC / Increment
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction increments the data of a specified device by "1" (+1 addition).
Expression in each language
INC 16 bits Continuous INC(EN,d);
INCP 16 bits Pulse INCP(EN,d);
How to Read Explanation of Instructions
DINC 32 bits Continuous DINC(EN,d);
DINCP 32 bits Pulse DINCP(EN,d);
Input variable EN Execution condition Bit
ENO Execution state Bit
Word device storing data to be incremented by "1" ANY16 ANY32
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
Applied Instructions (Program Flow)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
S: Refer to "Cautions".
Applied Instructions (Move and Compare)
+1 → d d INC EN ENO
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)
d d [ +1, ] +1 → [ +1, ] d d d

9 Applied Instructions (Arithmetic and Logical Operation)
9.5 INC / Increment
X010 MOVP EN s
Z is cleared by reset input X010.
d K0 Z M1
The current values of counter C0 to C9 are BCD converted, and the result is outputted into K4Y000.
Every time X011 turns ON, the current values are outputted one at a time in the order of C0, C1, ... and C9.
Z
CMPP EN s1 s2
When (Z) is 10 M 1=ON
Z
[ ST ]
MOVP(X010 OR M1, K0, Z); BCDP(X011, CN0Z, K4Y000); INCP(X011, Z); CMPP(X011, K10, Z, M0);

9 Applied Instructions (Arithmetic and Logical Operation)
9.6 DEC / Decrement
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction decrements the data of a specified device by "1" (-1 addition).
Expression in each language
DEC 16 bits Continuous DEC(EN,d);
DECP 16 bits Pulse DECP(EN,d);
How to Read Explanation of Instructions
DDEC 32 bits Continuous DDEC(EN,d);
DDECP 32 bits Pulse DDECP(EN,d);
Input variable EN Execution condition Bit
ENO Execution state Bit
Device storing data to be decremented by "1" ANY16 ANY32
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Constant Real Number
Applied Instructions (Program Flow)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
S: Refer to "Cautions".
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
– 1 → d d
Applied Instructions (Rotation and Shift Operation)
d [ +1, ] – 1 → [ +1, ] d d d

9 Applied Instructions (Arithmetic and Logical Operation)
9.6 DEC / Decrement


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes the logical product (AND) operation of two numeric values.
Data used for logical product or word device storing data ANY16 ANY32
Data used for logical product or word device storing data ANY16 ANY32
Word device storing the logical product result ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 z z z

9 Applied Instructions (Arithmetic and Logical Operation)
9.7 WAND / Logical Word AND



d +1, ∧ +1, → +1, d s1 s2 s1 s2 d



FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes the logical sum (OR) operation of two numeric values.
Data used for logical sum or word device storing data ANY16 ANY32
Data used for logical sum or word device storing data ANY16 ANY32
Word device storing the logical sum result. ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 z z z

9 Applied Instructions (Arithmetic and Logical Operation)
9.8 WOR / Logical Word OR



+1, ∨ +1, → +1, s1 s1 s2 s2 d d Logical sum



FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes the exclusive logical sum (XOR) operation of two numeric values.
Data used for exclusive logical sum or word device storing data ANY16 ANY32
Data used for exclusive logical sum or word device storing data ANY16 ANY32
Word device storing the exclusive logical sum result ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 S2 z z z

9 Applied Instructions (Arithmetic and Logical Operation)
9.9 WXOR / Logical Exclusive OR



+1, ∀ +1, → +1, d s1 s1 s2 s2 d XOR data 1


9 Applied Instructions (Arithmetic and Logical Operation)
9.9 WXOR / Logical Exclusive OR
By combining WXOR and CML instructions, the exclusive logical sum not (XORNOT) operation can be executed.
WXOR EN s1 s2
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.10 NEG / Negation
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction obtains the 2's complement of a numeric value (by inverting each bit and adding "1"). A sign of a numeric value can be converted by this instruction.
→ For the floating point sign inversion instruction [DENEG], refer to Section 18.16.


Word device which stores data for obtaining complement and will store the operation result. (The operation result will be stored in the same word device.)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S1 z z z
S: Refer to "Cautions".
![Page 195 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-195.webp?w=400)
9 Applied Instructions (Arithmetic and Logical Operation)
9.10 NEG / Negation
( ) +1 → d d
( +1, )+1 = ( +1, ) d
How to Read Explanation of Instructions
The program examples below are provided to obtain the absolute value of a negative binary value.
BON EN s n
In BON (ON bit check) instruction, M0 turns ON when the bit 15 (b15 among b0 to b15) of D10 is "1".
M0
NEGP EN ENO
D10 → D10
NEGP instruction is executed for D10 only when M0 turns ON.
BON(M8000, D0, K15, M0); NEGP(M0, D10);
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

9 Applied Instructions (Arithmetic and Logical Operation)
9.10 NEG / Negation

(D 10) > (D 20) (D10) = (D 20) (D 10) < (D 20) M 10=ON M 11=ON M 12=ON
In the case of "D10 D20", D10 - D20 D30
In the case of "D10 < D20", D20 - D10 D30
CMP(X000,D10, D20, M10); SUB_E(X000 AND (M10 OR M11), D10, D20, D30); SUB_E(X000 AND M12, D20, D10, D30);
In PLCs, a negative value is expressed in 2's complement. When the most significant bit is "1", it is a negative value, and its absolute value can be obtained by NEG instruction.

0 1 0
0 1
0
1
0 1
1 0
0 1 0
1 0 1
0 1
1 0
1 0
The absolute value can be obtained up to 32,767.

10 Applied Instructions (Rotation and Shift Operation)
This chapter introduces the instructions for rotating and shifting bit data and word data in specified directions.
Instruction name Function Reference
Rotation Right Section 10.1 RORP
DRORP
ROL
Rotation Left Section 10.2 ROLP
DROLP
RCR
Rotation Right with Carry Section 10.3 RCRP
How to Read Explanation of Instructions
RCL
Rotation Left with Carry Section 10.4 RCLP
DRCLP
SFTR
Bit Shift Right Section 10.5 SFTRP
Bit Shift Left Section 10.6 SFTLP
Word Shift Right Section 10.7 WSFRP
Word Shift Left Section 10.8 WSFLP
Shift Write [FIFO/FILO Control] Section 10.9 SFWRP
Shift Read [FIFO Control] Section 10.10 SFRDP
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.1 ROR / Rotation Right
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts and rotates the bit information rightward by the specified number of bits without the carry flag.


Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16
Word device storing data to be rotated rightward ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S1 S1 z z z S3 S4 z z z
S: Refer to "Cautions".

10 Applied Instructions (Rotation and Shift Operation)
10.1 ROR / Rotation Right
1. 16-bit operation (ROR, RORP)
"n" bits out of 16 bits of the device specified by are rotated rightward.
"n" bits (in the case of K4)
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Before execution
1 0
After the instruction is executed once.
b0 to b3 (n-1) are moved.
How to Read Explanation of Instructions
Rightward rotation "n-1" bits The status of the bit "n-1" is copied.
High order Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 1 0 Carry flag M8022
The contents of b3 are stored.
"n" bits out of 32 bits of the device specified by are rotated rightward.
"n" bits (in the case of K4)
Applied Instructions (Program Flow)
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 0
1 0
After the instruction is executed once.
The status of the bit "n-1" is copied.
b0 to b3 (n-1) are moved.
Applied Instructions (Move and Compare)
"n-1" bits The status of the bit "n-1" is copied.
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order
0 1 0
0 1 0 Carry flag M8022
Applied Instructions (Arithmetic and Logical Operation)
The contents of b3 are stored.
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.1 ROR / Rotation Right
→ For the carry flag use method, refer to Section 1.3.4.
M8022 Carry Turns ON when the bit shifted last from the lowest position is "1".
Device Name Description


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts and rotates the bit information leftward by the specified number of bits without the carry flag.
Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16
Word device storing data to be rotated leftward ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S1 S1 z z z S3 S4 z z z

10 Applied Instructions (Rotation and Shift Operation)
10.2 ROL / Rotation Left
1. 16-bit operation (ROL, ROLP)
"n" bits out of 16 bits of the device specified by are rotated leftward.

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 0
"n" bits The status of the bit "16-n" is copied.
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 Carry flag
1 0 1
"n" bits out of 32 bits of the device specified by are rotated leftward.

b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 0
1 0
b28 (32-n) to b31 are moved. The status of the bit "32-n" is copied
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1
1 0 1
1 0 1

10 Applied Instructions (Rotation and Shift Operation)
10.2 ROL / Rotation Left
→ For the carry flag use method, refer to Section 1.3.4.
M8022 Carry Turns ON when the bit shifted last from the highest position is "1".
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.3 RCR / Rotation Right with Carry
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts and rotates the bit information rightward by the specified number of bits together with the carry flag.


Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16
Word device storing data to be rotated rightward ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S1 S1 z z z S2 S2 z z z
S: Refer to "Cautions".

10 Applied Instructions (Rotation and Shift Operation)
10.3 RCR / Rotation Right with Carry
"n" bits (in the case of K4)
High order Low order
b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 0
When M8022 is ON
After the instruction is executed once.
b3 (n-1) to b0 are moved.
b2 (n-2) to b0 and the head bit indicating the carry flag ON/OFF status are moved.
The status of the final bit b3 (bit "n-1") is stored.
High order Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
How to Read Explanation of Instructions
0 0 0 1 0
Before shift b3 Carry flag
Before shift b15 to b4
Before shift Carry flagM8022
The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation instruction, the carry flag is transferred to the destination.
"n" bits (in the case of K4)
High order Low order
Applied Instructions (Program Flow)
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
1 0 1 0 0 0 1 0
b2 (n-2) to b0 and the head bit indicating the carry flag ON/OFF status are moved.
After the instruction is executed once.
Carry flagM8022 When M8022 is OFF
Applied Instructions (Move and Compare)
The status of the final bit b3 (bit "n-1") is stored.
Low order b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order
0 1 0 1 0
Before shift b31 to b4
Before shift Carry flagM8022
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.3 RCR / Rotation Right with Carry
→ For the carry flag use method, refer to Section 1.3.4.
M8022 Carry Turns ON when the bit shifted last from the lowest position is "1".
Device Name Description


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts and rotates the bit information leftward by the specified number of bits together with the carry flag.
Number of bits to be rotated [n≤16] (16-bit operation), [n≤32] (32-bit operation) ANY16
Word device storing data to be rotated leftward ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S1 S1 z z z S2 S2 z z z

10 Applied Instructions (Rotation and Shift Operation)
10.4 RCL / Rotation Left with Carry

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 0 1 0
b15 to b13 (16-n+1) and the head bit indicating the carry flag ON/OFF status are moved.
The status of the final bit b12 (bit "16-n") is stored.
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 0 1
Before shift b15 to b13 Before shift b11 to b0
The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation instruction, the carry flag is transferred to the destination.

b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 1 1 1 0 1 0
1 0
b31 to b29 (32-n+1) and the head bit indicating the carry flag ON/OFF status are moved.
The status of the final bit b28 (bit "32-n") is stored.
Low order b15b14b13b12b11b10b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 High order
1 0 1
1 0 1

10 Applied Instructions (Rotation and Shift Operation)
10.4 RCL / Rotation Left with Carry
→ For the carry flag use method, refer to Section 1.3.4.
M8022 Carry Turns ON when the bit shifted last from the highest position is "1".
How to Read Explanation of Instructions
Applied Instructions (Program Flow)
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.5 SFTR / Bit Shift Right
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts bit devices of the specified bit length rightward by the specified number of bits. After shift, the bit device specified by is transferred by "n2" bits from the most significant bit.


Head bit device to be stored to the shift data after rightward shift. Bit
Bit length of the shift data (see Caution). ANY16
Number of bits to be shifted rightward (see Caution) ANY16

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

10 Applied Instructions (Rotation and Shift Operation)
10.5 SFTR / Bit Shift Right
SFTR EN s n1
Stored data Shift data Bit data length Number of bits
n2 (in the case of "n2 = 3")
+1 +2 s s s
n1 (in the case of "n1 = 9")
How to Read Explanation of Instructions
+8 +7 +6 +5 +4 +3 d +2 +1 d d d
"n2" bits are shifted rightward (n2 = 3).
Overflow (data to be deleted)
+8 +7 +6 +5 +4 +3 +2 +1 d
+2 to before shift (n2 = 3). s s +8 to +3 before shift (n2 = 3). d d
Applied Instructions (Program Flow)
FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U, FX3UC n2≤n1≤1024
Applied Instructions (Move and Compare)
FX0S, FX0, FX0N, FX1S n2≤n1≤512
If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710). (Applicable only to the FX3U and FX3UC PLCs)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.6 SFTL / Bit Shift Left
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts bit devices of the specified bit length leftward by the specified number of bits. After shift, the bit device specified by is transferred by "n2" bits from the least significant bit.


Head bit device to be stored to the shift data after leftward shift Bit
Bit length of the shift data (see Caution). ANY16
Number of bits to be shifted leftward (see Caution). ANY16

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

10 Applied Instructions (Rotation and Shift Operation)
10.6 SFTL / Bit Shift Left
SFTL EN s n1
Stored data Shift data Bit data length Number of bits
n2 (in the case of "n2 = 3")
+1 +2 s s s
n1 (in the case of "n1 = 9")
How to Read Explanation of Instructions
+8 +7 +6 d d d +5 +4 +3 d d d +2 +1 d d d
+2 +1 +8 +7 +6 +5 +4 +3 d
+2 to before shift (n2 = 3). s s d to +5 before shift (n2 = 3) d
Applied Instructions (Program Flow)
FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC, FX3U, FX3UC n2≤n1≤1024
Applied Instructions (Move and Compare)
FX0S, FX0, FX0N, FX1S n2≤n1≤512
If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710). (Applicable only to the FX3U and FX3UC PLCs)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.6 SFTL / Bit Shift Left
By setting X000 to X007 to ON in turn, Y000 to Y007 are activated in turn. If the order is wrong, activation is disabled.

Bit 1 of M0 is regarded as the head input, and 8-bit shift register is constructed by S0 to S7.
*1:By using a state relay (S), the state under operation can be monitored by the dynamic monitoring function of the state relay.
Even if X000 is set to ON, Y000 is not activated.
M0:= X000 AND NOT M8046; SFTL((NOT M8046 AND X000) OR (S0 AND X001) ··· OR (S1 AND X002) R(S7 AND X000), M0, K8, K1, S0); MOV(M8000, K2S0, K2Y000); M8047:= M8000;


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts word devices with "n1" data length rightward by "n2" words.
Head device to be stored to the shift data after rightward shift ANY16
Word data length of the shift data (n2 ≤ n1 ≤ 512) ANY16
Number of words to be shifted rightward (n2 ≤ n1 ≤ 512) ANY16
Head word device storing data to be shifted rightward ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z

10 Applied Instructions (Rotation and Shift Operation)
10.7 WSFR / Word Shift Right

d
d
+2 to before shift (n2 = 3). s s +8 to +3 before shift (n2 = 3). d d
If the transfer source device specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710).


Specify a same digit for devices with digit specification.
Make sure that the number of digits is equivalent.(Kn )
Y017 Y016 Y015 Y014 Y013 Y012 Y011Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001Y000

10 Applied Instructions (Rotation and Shift Operation)
10.8 WSFL / Word Shift Left
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts the word data information leftward by the specified number of words.


Head device to be stored to the shift data after leftward shift ANY16
Word data length of the shift data (n2 ≤ n1 ≤ 512) ANY16
Number of words to be shifted leftward (n2 ≤ n1 ≤ 512) ANY16
Head word device storing data to be shifted leftward ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
S: Refer to "Cautions".

10 Applied Instructions (Rotation and Shift Operation)
10.8 WSFL / Word Shift Left
WSFL EN s n1
Stored data Shift data
n2 Word data length Number of words
n2 (in the case of "n2 = 3")
n1 (in the case of "n1 = 9")
How to Read Explanation of Instructions
+8 +7 +6 d d d +5 +4 +3 d d d +2 +1 d d d
Overflow (data to be deleted)
"n2" words are shifted leftward (n2 = 3).
+2 +1 +8 +7 +6 +5 +4 +3 d
+2 to before shift (n2 = 3). s s +5 to before shift (n2 = 3). d d
Applied Instructions (Program Flow)
If the transfer source specified by is equivalent to the shifted device specified by , an operation error occurs (error code: K6710).
Applied Instructions (Move and Compare)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.8 WSFL / Word Shift Left
1. Shifting devices with digit specification

Specify a same digit for devices with digit specification.
Make sure that the number of digits is equivalent.(Kn )
Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
![Page 221 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 10.9 SFWR / Shift Write [FIFO/FILO Control]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-221.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 10.9 SFWR / Shift Write [FIFO/FILO Control] diagram (page 221)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-221-1.webp)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes data for first-in first-out (FIFO) and first-in last-out (FILO) control.
Word device storing data to be put in first ANY16
Number of store points (for pointer, value is added by "+1".) 2 ≤ n ≤ 512 ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z

10 Applied Instructions (Rotation and Shift Operation)
10.9 SFWR / Shift Write [FIFO/FILO Control]
1. 16-bit operation (SFWR, SFWRP) The contents of the device specified by are written to "n-1" devices from the device specified by +1, and "1" is added to the number of data stored in the device specified by . For example, when the device specified by is "0", the contents of the device specified by are written to the device specified by +1. When the device specified by is "1", the contents of the device specified by are written to the device specified by +2.
SFWR EN s n
First-in data Storing device Number of pieces
d d+n ··· d+2 d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 d+1
Executed at the 1st time( = 0)
d d+n ··· d+2 d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 s
Executed at the 2nd time
d d+n ··· s d+10 d+9 d+8 d+7 d+6 d+5 d+4 d+3 s
2) When the contents of the device specified by are changed and then the command input is set to ON from OFF again, the new contents of the device specified by are stored to the device specified by +2. So the contents of the device specified by +2 become equivalent to the contents of the device specified by . (When the continuous operation type SFWR instruction is used, the contents are stored in each operation cycle. Use the pulse operation type SFWRP instruction in programming.)
→ For the carry flag use method, refer to Section 1.3.4.
M8022 Carry When the contents of the pointer specified by exceeds "n-1", no operation is executed (data is not written) and the carry flag M8022 turns ON.
SFRD Shift read (for FIFO control)
POP Last-in data read (for FILO control)

10 Applied Instructions (Rotation and Shift Operation)
10.9 SFWR / Shift Write [FIFO/FILO Control]
1. Example of first-in first-out control → For a program example of FILO, refer to Section 27.3. In the example below, the shift write (SFWR) and shift read (SFRD) instructions are used. 1) Contents of operation - In this circuit example, a product number to be taken out now is output according to "first-in first-out" rule while products which were put into a warehouse with their product numbers registered are taken out of the warehouse. - The product number is hexadecimal, and up to 4 digits. Up to 99 products can be stored in the warehouse. 2) Program
Button for request to put a product into warehouse
X020 MOVP EN s
The product number is input from X000 to X017, and transferred to D256.
SFWRP EN s n
How to Read Explanation of Instructions
Button for request to take a product out of warehouse
SFRDP EN s n
The product number of a product put into first is output to D357 in response to the request to take a product out of the warehouse.
M8000 MOV EN s
The product number to be taken out is output to Y000 to Y017 in a four-digit hexadecimal number.
MOVP(X020, K4X000, D256); SFWRP(X020, D256, K100, D257); SFRDP(X021, D257, K100, D357); MOV(M8000, D357, K4Y000);
Digital switch 0000 to FFFF Seven-segment display unit
Request to take a product out of warehouse
Applied Instructions (Program Flow)
Y017 to Y000 X017 to X000
Applied Instructions (Move and Compare)
D258 D259 D260 D261 D262 D263
0232 0462 0539 0142 0 0
2 3 4 5 6
0232 0462 0539 0142 1234
0232 0462 0539 0142 0
Applied Instructions (Arithmetic and Logical Operation)
SFWRP instruction is executed.
SFRDP instruction is executed.
Applied Instructions (Rotation and Shift Operation)

10 Applied Instructions (Rotation and Shift Operation)
10.10 SFRD / Shift Read [FIFO Control]
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads data for first-in first-out control.


Number of store points (for pointer, value is added by "+1".) 2 ≤ n ≤ 512 ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z
S: Refer to "Cautions".

10 Applied Instructions (Rotation and Shift Operation)
10.10 SFRD / Shift Read [FIFO Control]
SFRD EN s n
d Number of pieces
Readout data Storing device
s s+n ··· s+2 s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+1
Executed at the 1st time
How to Read Explanation of Instructions
s s+n ··· s+2 s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+n
Word data is shifted.
Executed at the 2nd time
s s+n ··· s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+n s+n
Word data is shifted.
→ For the zero flag use method, refer to Section 1.3.4.
Applied Instructions (Program Flow)
M8020 Zero Data is always read from the device specified by [ +1]. When the contents of the pointer specified by become "0", the zero flag M8020 turns ON.
Applied Instructions (Move and Compare)
SFWR Shift write (for FIFO/FILO control)
POP Last-in data read (for FILO control)
Applied Instructions (Arithmetic and Logical Operation)
Applied Instructions (Rotation and Shift Operation)
Refer to the program example provided for SFWR instruction.

This chapter introduces the instructions for executing complicated processing for applied instructions move, compare, arithmetic operations, rotation and shift operation instructions.
Instruction name Function Reference
Zone Reset Section 11.1 ZRSTP
Decode Section 11.2 DECOP
Encode Section 11.3 ENCOP
Sum of Active Bits Section 11.4 SUMP
DSUMP
BON
Check Specified Bit Status Section 11.5 BONP
DBONP
MEAN
Mean Section 11.6 MEANP
DMEANP
ANS Timed Annunciator Set Section 11.7
Annunciator Reset Section 11.8 ANRP
Square Root Section 11.9 SQRP
DSQRP
FLT
Conversion to Floating Point Section 11.10 FLTP
DFLTP


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction resets devices located in a zone between two specified devices at one time. Use this instruction for restarting operation from the beginning after pause or after resetting control data.
Head device to be reset at one time ANY_SIMPLE
Last device to be reset at one time ANY_SIMPLE
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z

11.1 ZRST / Zone Reset
1. 16-bit operation (ZRST, ZRSTP)
Same type of devices specified by to are reset at one time.
When the devices specified by and are bit devices "OFF (reset)" is written to the entire range from the devices specified by to at one time.

Devices through are reset at one time. d1 d2
··· +2 +9 +8 +7 +6 +5 +4 +3 +1 d1 d2 d1
OFF OFF ··· OFF
When the devices specified by and are word devices "K0" is written to the entire range from the devices specified by to at one time.

Devices through are reset at one time. d1 d2
··· +2 +9 +8 +7 +6 +5 +4 +3 +1 d1 d2 d1
K0 K0 ··· K0


11.1 ZRST / Zone Reset
FMOV EN s n
K0 is written to D0 to D99 at one time.
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
ZRST EN ENO
CN180
CN180
Applied Instructions (External Device (optional device))
CN199
ZRST EN ENO
CN200
CN230
Timing chart Structured ladder/FBD
ZRST EN ENO
Applied Instructions (Data Transfer 2)
one operation cycle one operation cycle
M0
PLS EN ENO ZRST instruction
Applied Instructions (Floating Point)
Please program in the following way to turn on M0 only once.
ZRST EN ENO
M0 M100
M0 MEP EN ENO
Applied Instructions (Positioning Control)

11.1 ZRST / Zone Reset

Program in the following way to disable counting after execution of the ZRST instruction.


CN235 to CN255 are reset at one time. ("0" is written to them, and their contacts are reset.)
ZRST(M8002, M500, M599); ZRST(M8002, CN235, CN255); ZRST(M8002, S500, S599);


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts numeric data into ON bit. A bit number which is set to ON by this instruction indicates a numeric value
Data to be decoded or word device storing data ANY_SIMPLE
Number of bits of device storing the decoding result [n = 1 to 8] (No processing is executed in the case of "n = 0".) ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z

11.2 DECO / Decode
1. 16-bit operation (DECO, DECOP)
One bit among the devices specified by [ to +2n-1] is set to ON according to the value of the device specified by .
- When all bits of the devices specified by are "0", the bit device specified by turns ON.
- When "n" is "8", the bit device specified by occupies maximum 28 = 256 bits.
DECO EN s n
when it is Y, M or S (1≤n≤8)
Ignored when "n" is "8"
b8 b9 b10 b11 b12 b13 b14 b15
b0 b1 b2 b3 b4 b5 b6 b7
0 1 1 1 0
Turns ON when all bits of are OFF.
Up to M31 Up to M63 Up to M127 Up to M255
0 1 0
M255 M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15
Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)
- When all bits of the device specified by are "0", b0 of the word device specified by turns ON.
- In the case of "n ≤ 3", all of high-order bits of the device specified by become "0" (turn OFF).

When it is T, C, D, R, U\G, V, Z, K or H (1≤ n≤ 4)
0 0 0 1 0 1 0 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
1 0 1 0 0 1
0 1
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15

11.2 DECO / Decode
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
DECO EN s n
Applied Instructions (External FX I/O Device)
Ignored 4 bits (D0 b0 to b3)
(D0 b4 to b15)
b15 ··· When the value of b0 to b3 of D0 is "14"
0 1 1 1 0 b0 1 2 3 4 5 6 7
Applied Instructions (External Device (optional device))
Turns ON when D0 is K0.
Up to M31 Up to M63 Up to M127 Up to M255
0 1 0
M255 M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15
Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

11.2 DECO / Decode

0 0 0 1 0
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction obtains positions in which bits are ON in data.
Data to be encoded or word device storing data ANY_SIMPLE
Number of bits of device storing the encoding result [n = 1 to 8] (When "n" is "0", no processing is executed.) ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z z z S1 S2 z z z

11.3 ENCO / Encode
1. 16-bit operation (ENCO, ENCOP)
The 2n bit of the data specified by is encoded, and the result value is stored to the device specified by . This instruction converts data into binary data according to a bit position in the ON status.
- When "n" is "8", the device specified by occupies 28 = 256 bits (which is the maximum value). - The encoding result of the device specified by is all "0" (OFF) from the most significant bit to the low-order bit "n".

when it is Y, M or S (1≤n≤8)
M17 M16 M15 M14 M13 M12 M11 M10 When "n" is 3
7 0 1 0 1 2 3) 4 5 6
1 1 0 b15 D10 1) 2) 4

When it is T, C, D, R, U\G, V or Z
0 0 0 1 0 1 0 1 0 1 0 1 0 b15
0 1 2 3) 4 5 6 7 Ignored
1 1 0 b15 1) 2) 4

11.3 ENCO / Encode
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

11.4 SUM / Sum of Active Bits
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction counts the number of "1" (ON) bits in the data of a specified device.



X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z
S: Refer to "Cautions".

11.4 SUM / Sum of Active Bits
Applied Instructions (High Speed Processing)
Number of bits in the ON status in d s
SUM data Resulting data
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
Applied Instructions (Handy Instruction)
1 2 3 ← 4 ← 5 ← 6 ← 7 ← 8 ← 9 (Number of "1" (ON))
0
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
Applied Instructions (External FX I/O Device)
32 16 8 4 2 1
1 0 0 1 0
Applied Instructions (External Device (optional device))
Number of bits in the ON status in [ +1, ]
d s s d
SUM data Resulting data
K0 is written.
b16 b17 b31 ··· b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0
1 2 3 ← 4 ← 5 ← 6 ← 7 ← 8 ← 9 (Number of "1" (ON))
K0
Applied Instructions (Data Transfer 2)
0
b16 b17 b31 ··· b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
32 16 8 4 2 1
K9
Applied Instructions (Floating Point)
1 0 0 1 0 1 0 0 1 0
Applied Instructions (Positioning Control)

11.4 SUM / Sum of Active Bits
M8020 Zero flag Bit device Word device
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Decimal Hexadecimal
0000 0 ON
0 1 1 0001 1 OFF
0 1 0 2 0002 1 OFF
0 1 1 3 0003 2 OFF
0 1 0 0 4 0004 1 OFF
0 1 0 1 5 0005 2 OFF
0 1 1 0 6 0006 2 OFF
0 1 1 1 7 0007 3 OFF
0 1 0 0 0 8 0008 1 OFF
0 1 0 0 1 9 0009 2 OFF
0 1 0 1 0 10 000A 2 OFF
0 1 0 1 1 11 000B 3 OFF
1 0 1 1 -5 FFFB 15 OFF
1 0 0 -4 FFFC 14 OFF
1 0 1 -3 FFFD 15 OFF
1 0 -2 FFFE 15 OFF
1 -1 FFFF 16 OFF
When X000 is ON, the number of bits in the ON status in D0 is counted, and stored to D2.

The number of "1" in D0 is stored to D2.
0
0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
0 1 0 0 1


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction checks whether a specified bit position in a device is ON or OFF.
Bit position to be checked [n=0 to 15 (16-bit instruction), n=0 to 31 (32-bit instruction)] ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S3 S4 z

11.5 BON / Check Specified Bit Status

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 0 1 0 1 0 1 0 0 0
K4 K5 K6 K7 K0 K1 K2 K3 K8 K9 K10 K11 K12 K13 K14 K15

b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
0 1 0 0 1 0 1 0 1 0 0 0
K4 K5 K6 K7 K0 K1 K2 K3 K8 K9 K10 K11 K12 K13 K14 K15


When the bit 9 (n=9) in D10 is "1" (ON), M0 is set to "1" (ON).
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1 0 1 0 0

11.6 MEAN / Mean
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction obtains the mean value of data.


Head word device storing data to be averaged ANY16 ANY32
Number of data to be averaged (n=1 to 64) ANY16
Word device storing the mean value result ANY16 ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z z z
S: Refer to "Cautions".

11.6 MEAN / Mean
Applied Instructions (High Speed Processing)
MEAN EN s n
+ +1+ + +n–1 s s s
Mean data Resulting data
Number of pieces of data
Applied Instructions (Handy Instruction)
DMEAN EN s n
Applied Instructions (External FX I/O Device)
d Number of pieces of data
d [ +1, ] + [ +3, +2] + + [{ +n × 2–1}], [{ +n × 2–2}] s
n [ +1, ]
Applied Instructions (External Device (optional device))
When "n" is any value outside the range from "1" to "64", an operation error (M8067) is caused.
Applied Instructions (Data Transfer 2)
The data of D0, D1 and D2 are summed, divided by "3", and then stored to D10.
MEAN EN s n
Applied Instructions (Floating Point)
D0 D10
K3
[ ST ]
MEAN(X000, D0, K3, D10);
Applied Instructions (Positioning Control)

11.7 ANS / Timed Annunciator Set
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction sets a state relay as an annunciator.


Evaluation time [m=1 to 32,767] (unit: 100 ms) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
1. 16-bit operation When the command input remains ON for equivalent to or longer than the evaluation time [ m × 100 ms, timer specified by ], the device specified by is set. When the command input remains ON for less than the evaluation time [m × 100 ms] and then turns OFF, the current value of the timer for evaluation specified by is reset and the device specified by is not set. When the command input turns OFF, the timer for evaluation is reset.

Equivalent to or longer than evaluation time (m 100 ms)

11.7 ANS / Timed Annunciator Set
M8049 Enable annunciator When M8049 is set to ON, M8048 and D8049 are valid.
M8048 Annunciator ON When M8049 is ON and one of the state relays S900 to S999 is ON, M8048 turns ON.
D8049 Smallest state relay number in ON status Among S900 to S999, the smallest state relay number in the ON status is stored.
Applied Instructions (High Speed Processing)
Some restrictions to applicable devices S1:T0 to T199 S2:S900 to 999 S3:The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
M8049
When M8049 turns ON, monitoring becomes valid.
Applied Instructions (External Device (optional device))
ANS EN s m
If the forward end detection input X000 does not turn ON within 1 second after the forward movement output Y005 is driven, S900 turns ON.
ANS EN s m
If both the upper limit input X001 and the lower limit input X002 are OFF for 2 seconds or more due to a DOG error, S901 turns ON.
ANS EN s m
The switch X004 is set to ON in one operation cycle of the machine. If the switch X004 is not set to ON while the continuous operation mode input X003 is ON in the machine whose tact time is less than 10 seconds, S902 turns ON.
Applied Instructions (Data Transfer 2)
M8048
Y006
When one among S900 to S999 turns ON, M8048 turns ON and the fault display output Y006 turns ON.
Annunciator ON Fault display
Applied Instructions (Floating Point)
A state relay which was set to ON by the external fault diagnosis program is set to OFF by the reset button X007. Every time X007 is set to ON, an operation state relay in the ON status with the smallest device number is reset (set to OFF) in turn.
[ ST ]
M8049:= M8000; ANS(Y005 AND NOT X000, T0, K10, S900); ANS(NOT X001 AND NOT X002,T1, K20, S901); ANS(X003 AND NOT X004, T2, K100, S902); Y005:=X005; Y006:=M8048; ANRP(X007);
Applied Instructions (Positioning Control)

11.8 ANR / Annunciator Reset
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction resets an annunciator in the ON status with the smallest number.



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

M8049 Enable annunciator When M8049 is set to ON, M8048 and D8049 are valid.
M8048 Annunciator ON When M8049 is ON and one of the state relays S900 to S999 is ON, M8048 turns ON.
D8049 Smallest state relay number in ON status Among S900 to S999, the smallest state relay number in the ON status is stored.

11.8 ANR / Annunciator Reset
1. Execution in each operation cycle
Applied Instructions (High Speed Processing)
Refer to ANS instruction
→ For a program example, refer to Section 11.7.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

11.9 SQR / Square Root
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction obtains the square root. The DESQR instruction obtains the square root in floating point operation.
→ For DESQR instruction, refer to Section 18.15.


Word device storing data whose square root is obtained. ANY16 ANY32
Data register storing the square root operation result ANY16 ANY32

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

11.9 SQR / Square Root
Applied Instructions (High Speed Processing)
Root data Resulting data
Applied Instructions (Handy Instruction)
+1, +1, d s d s
Root data Resulting data
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
The square root of D10 is stored to D12. The value of D10 is "100".
D10 D12
[ ST ]
SQR(X000, D10, D12);
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

11.10 FLT / Conversion to Floating Point
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts a binary integer into a binary floating point (real number).


Data register storing binary floating point (real number) ANY_SIMPLE

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

11.10 FLT / Conversion to Floating Point
( +1, ) d s d
Applied Instructions (High Speed Processing)
Binary integer Binary floating point (real number)
Device that stores the binary integer data
Device that stores the binary floating point data
Applied Instructions (Handy Instruction)
( +1, ) ( +1, )
d s d s
Device that stores the binary integer data
Device that stores the binary floating point data
Binary integer Binary floating point (real number)
Applied Instructions (External FX I/O Device)
INT It is inverse of FLT instruction, and converts binary floating point into binary integer.
→ For the method of the zero and borrow flags, refer to Section Section 1.3.4.
Applied Instructions (External Device (optional device))
M8020 Zero flag Turns ON when the value is true "0".
M8021 Borrow flag Turns ON when the floating point is rounded down..
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

11.10 FLT / Conversion to Floating Point
× K34.5 (D 0) (X017 to X010) 16-bit binary 2-digit BCD
(D 11, D 10) Binary floating point
(D 13, D 12) Decimal floating point operation for monitoring
(D 21, D 20) Binary floating point
(D 27, D 26) Binary floating point
(D 15, D 14) 32-bit binary integer
(D 25, D 24) Binary floating point
(D 29, D 28) Binary floating point


Binary floating point operation (D52, D51) (D55, D54) (D27, D26)
Binary floating point operation Decimal floating point operation for monitoring
FLT(M8000, D0, D20); BIN(M8000, K2X010, D22); FLT(M8000, D22, D24); MOV(M8000, K345, D50; FLT(M8000, D50, D51); MOV(M8000, K10, D53); FLT(M8000, D53, D54); DEDIV(M8000, D51, D54, D26); DEDIV(M8000, D20, D24, D28); DEMUL(M8000, D28, D26, D10); DEBCD(M8000, D10, D12); DINT(M8000, D10, D14);

12 Applied Instructions (High Speed Processing)
This chapter introduces interrupt processing type high-speed instructions that execute sequence control using the latest I/O information and utilize the high-speed processing performance of the PLC.
Instruction name Function Reference
Refresh Section 12.1 REFP
Refresh and Filter Adjust Section 12.2 REFFP
MTR Input Matrix Section 12.3
High Speed Counter Set, High Speed Interrupt Counter Set Section 12.4 DHSCS_I
DHSCR High Speed Counter Reset Section 12.5
DHSZ High Speed Counter Zone Compare Section 12.6
Speed Detection Section 12.7 DSPD
Pulse Y Output Section 12.8 DPLSY
PWM Pulse Width Modulation Section 12.9
Acceleration/Deceleration Setup Section 12.10 DPLSR


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction immediately outputs the latest input (X) information or the current output (Y) operation result in the middle of a sequence program operation.
Bit device (X or Y) to be refreshed Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

12 Applied Instructions (High Speed Processing)
1. 16-bit operation(REF, REFP)

* Refer to "Caution" for the head device number and the number of points.
- When this instruction is executed, the output latch memory is refreshed to the output status in the specified range.


* Refer to "Caution" for the head device number and the number of points.
- If the input information is turned ON approximately 10 ms (response delay time of the input filter) before the instruction is executed, the input image memory turns ON when the instruction is executed. - The response delay time of the input filter can be changed.
→ For details, refer to "what should be understood before using the REF instruction"
described later.

REF instruction + END instruction processing Only END instruction processing

12 Applied Instructions (High Speed Processing)
12.1 REF / Refresh
Applied Instructions (High Speed Processing)
Any number other than the above generates an error.
FX3U, FX3UC K8(H8), K16(H10), ..., K256(H100)
Applied Instructions (Handy Instruction)
FX3G, FX3GC K8(H8), K16(H10), ..., K128(H80)
FX3S K8(H8) or K16(H10)
FX1S, FX1N, FX1NC, FX2N, FX2NC K8(H8), K16(H10), ..., K256(H100)
FX0S, FX0 K8(H8) or K16(H10)
FXU, FX2C K8(H8), K16(H10), ..., K256(H100)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
X000 REF EN d n
REF(X000,X010,K8);
K 8
X001 REF EN d n
REF(X001,Y000,K24);
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
PLC n · [Structured ladder/FBD] · [Structured ladder/FBD]

12 Applied Instructions (High Speed Processing)
→ For details, refer to "FX Structured Programming Manual (Device & Common)."
→ For details, refer to the respective PLC Hardware Edition manuals.
- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) b) For FX3UC (D, DSS) PLC
- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) c) For FX3UC-32MT-LT (-2) PLC
- Y000, Y001, Y002, Y003: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y004 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) d) For FX3G PLC (14-point, 24-point types) and FX3GC PLCs
- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) e) For FX3G (40-point, 60-point types)
- Y000, Y001, Y002: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y003 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) f) For FX3GC PLC
- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 100 mA, 24 V DC) g) For FX3S PLC
- Y000, Y001: 5 μs or less (load current = 10 mA or more, 5 to 24 V DC) - Y002 and higher: 0.2 ms or less (load current = 200 mA, 24 V DC) h) For FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs
- Y000, Y001: 15 μs to 30 μs or less - Y002 and higher: 0.2 ms or less i) For FX0S, FX0, FX0N, FXU and FX2C PLCs - Y000 and higher: 0.2 ms or less

12 Applied Instructions (High Speed Processing)
12.2 REFF / Refresh and Filter Adjust
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
The digital input filter time of the inputs can be changed using this instruction or D8020. Using this instruction, the status of inputs can be refreshed at an arbitrary step in the program for the specified input filter time, and then transferred to the image memory.
Expression in each language
Applied Instructions (Handy Instruction)
REFF EN ENO n
REF 16 bits Continuous REF(EN, n);
Applied Instructions (External FX I/O Device)
REFP 16 bits Pulse REFP(EN, n);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Digital input filter time (1 ms increment) ANY16
Output variable ENO Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System User Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
S: Refer to "Cautions".
Applied Instructions (Floating Point)
X000 to X017 X000 to X007 in the FX3U-16M , and FX3UC-16M
FX2N, FX2NC X000 to X017 X000 to X007 in the 16-input basic units
FXU, FX2C X000 to X007
REFF EN ENO n
K0 to K60 (Filter constant from 0 to 60 ms)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.2 REFF / Refresh and Filter Adjust
12 Applied Instructions (High Speed Processing)
Input number Input filter value when set to "0"
X000 to X005 5μs*2
X006, X007 50μs
X010 to X017*3 200μs*3
*1. X000 to X007 in the FX3U-16M , and FX3UC-16M
*2. When setting the input filter time to "5 μs", perform the following actions. - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 kΩ (1 W or more) to the input terminal, and make sure that the load current in the open collector transistor output of the external equipment is 20 mA or more including the input current of the main unit.
*3. The filter time is fixed for 10 ms in X010 to X017 in 16-point type FX3U PLCs and 16-point type FX3UC PLCs.
Input number Input filter value when set to "0"
X000, X001 20μs
X002 to X017 50μs
Input number Input filter value when set to "0"
X000 to X007 50μs


When X010 is ON The image memory is refreshed with an input filter of 1 ms.
Set value of D8020 (Initial value: 10 ms) Sequence
END The image memory is refreshed with an input filter of 20 ms.
The image memory is refreshed with the input filter value set in D8020.

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.2 REFF / Refresh and Filter Adjust
12 Applied Instructions (High Speed Processing)
Generally, a C-R filter of approximately 10 ms is provided for inputs in PLCs as countermeasures against chattering and noise at the input contacts. A digital filter is provided for some inputs (*1). The digital filter value can be changed within the range from 0 to 60 ms using instructions.
When the command is ON
When the END instruction is executed
memory C-R filter Fixed to 10 ms
*1. Where a digital filter is used on an input terminal, refer to the descriptions on the functions and operations.
2. Instruction in which the digital filter is automatically changed Regardless of the change in the filter time executed by the REFF instruction, when the following functions and instructions are executed, the input filter value is automatically changed (as shown in the caution). However, if the digital filter is used in any other functions or instructions than the ones listed, the digital filter uses the time set in D8020. As a result, the program will not run correctly if the ON or OFF duration of the corresponding input signal is less than the input filter time.

12 Applied Instructions (High Speed Processing)
12.3 MTR / Input Matrix
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction reads matrix input as 8-point input × "n" output (transistor) in the time division method.
Expression in each language
MTR EN s n
Applied Instructions (Handy Instruction)
MTR 16 bits Continuous MTR(EN, s, n, d1, d2);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Head device (X) number of matrix signal input X000, X010, X020, ..., final input X number (Only "0" is allowed in the least significant digit of device numbers)
Number of columns in matrix input (K2 to K8/H2 to H8) ANY16
ENO Execution state Bit
Applied Instructions (External Device (optional device))
Head device (Y) number of matrix signal output Y000, Y010, Y020, ..., final output Y number (Only "0" is allowed in the least significant digit of device numbers.)
Head bit device (Y, M or S) number of ON output destination Y000, Y010, Y020, ..., final Y number, M000, M010, M020, ... , final M number or S000, S010, S020, ..., final S number (Only "0" is allowed in the least significant digit of device numbers.)
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.3 MTR / Input Matrix
12 Applied Instructions (High Speed Processing)
MTR EN s n
Input number Output number
ON output destination Number of
For each output, the I/O processing is executed immediately in turn in interrupt at every 20 ms under consideration of the input filter response delay of 10 ms. The figure below shows an example of the FX3U series main unit (sink input / sink output). For the wiring, refer to the manual of the PLC used.

0V 24V s
complete Turns ON after the first cycle operation
1. Number of occupied devices


n = Three outputs (Y020, Y021 and Y022) are set to ON in turn repeatedly. Every time an output is set to ON, eight inputs in the 1st, 2nd and 3rd columns are received in turn repeatedly, and stored to M30 to M37, M40 to M47, and M50 to M57 respectively. In this program example, the FX3U series main unit (sink input / sink output) is used. For the wiring, refer to the manual of the PLC used.
COM Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.3 MTR / Input Matrix
12 Applied Instructions (High Speed Processing)
1. Command input
MTR EN s n
K 8
M 0
2. Input numbers used in MTR instruction
Power supply used for pull-up resistors
AC power type PLC Service power supply
DC power type PLC Power supply for driving PLC
The figure below shows an example of the FX3U series main unit (sink input / sink output).

0V X000 X001 X002 X003 X004 X005 X006 X007
COM5 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027

*1. X000 to X007 for FXU, FX2C, FX1S, FX1N, FX1NC, FX3G and FX3GC PLCs.
*2. X010 and later for FXU, FX2C, FX1S, FX1N, FX1NC, FX3G, FX3GC PLCs.
M (Normally ON) · d1 d2 X020

12 Applied Instructions (High Speed Processing)
12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
DHSCS_I
Applied Instructions (High Speed Processing)
→ Refer to Section 35.6 for the counter interrupt using this (DHSCS_I) instruction. 1. Format and operation, execution form
Applied Instructions (Handy Instruction)
Expression in each language
DHSCS EN s1 s2
Applied Instructions (External FX I/O Device)
DHSCS 32 bits Continuous DHSCS(EN, s1, s2, d);
DHSCS EN ENO DHSCS_I EN s1
DHSCS_I 32 bits Continuous DHSCS_I(EN, s1, s2, i);
Applied Instructions (External Device (optional device))
name Variable Description Data type
EN Execution condition Bit
Data to be compared with the current value of a high-speed counter or word device storing the data to be compared ANY32
Device of a high speed counter ANY32
EN0 Execution state Bit
Bit device to be set to ON when the compared two values are equivalent to each other Bit
Applied Instructions (Data Transfer 2)
EN Execution condition Bit
Data to be compared with the current value of a high-speed counter or word device storing the data to be compared ANY32
Device of a high speed counter ANY32
Interrupt pointer (I) for executing an interrupt program when the compared two values agree. ANY16
Applied Instructions (Floating Point)
Output variable EN0 Execution state Bit
Bit Devices Word Devices Others
System User Digit Specification System
Unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z z z S1 z
z S2 S3 z
Applied Instructions (Positioning Control)
S: Refer to "Cautions".

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
12 Applied Instructions (High Speed Processing)
OUT_C_32 EN CCoil CValue
DHSCS EN s1 s2
= → Set to ON s1 s2 d
Comparison value Comparison source
When the current value of the high speed counter C235 changes from "99" to "100" or from "101" to "100", Y010 is set to ON (output refresh).
OUT_C_32 EN CCoil CValue
DHSCS EN s1 s2
Set to ON CN235 Y010
Related instruction
The following instructions can be combined with high speed counters.
DHSCS High speed counter set
DHSCR High speed counter reset
DHSZ High speed counter zone compare
DHCMOV High speed counter move
DHSCT High speed counter compare with data table

12 Applied Instructions (High Speed Processing)
12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
M8000 DHCMOV EN s n
Applied Instructions (External FX I/O Device)
LDD
K100
Y010
Applied Instructions (External Device (optional device))
REF EN d n
K8
For FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs
LDD
K40000
Y010
CN251
REF EN d n
K8
Applied Instructions (Data Transfer 2)
For FX0S, FX0, FX0N, FXU, and FX2C PLCs
CN251
GE
Y010
REF EN d n
Applied Instructions (Floating Point)
ENO Y010
K20000
K8
→ FX Structured Programming Manual [Device & Common]
→ Refer to Section 35.6 for the counter interrupt using this instruction.
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
12 Applied Instructions (High Speed Processing)
Not indexed (V, Z). S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable. S4: When executing counter interrupt, the interrupt pointer is specified using the DHSCS_I instruction.
(Not available for the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC.)
→ For the counter interrupt using this instruction, refer to Section 35.6.
described later.
described later.
described later.
With regard to the current value of a counter, different outputs (Y) are arbitrarily set to ON by two values.
OUT_C_32 EN CCoil CValue
Set the maximum counting value of high speed counter.
DHSCS EN s1 s2
K100
Y010
CN251
DHSCS EN s1 s2
K150
Y011
CN251
0 ... 99 100 101 ... 149 150 151
Y011
[ST]
OUT_C_32(M8000,CC251,K2147483647);
DHSCS(M8000,K100,CN251,Y010);
DHSCS(M8000,K150,CN251,Y011);
[Structured ladder/FBD] · RUN monitor

12 Applied Instructions (High Speed Processing)
12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
DHSCS, DHSCR, DHSZ and DHSCT instructions are provided for high speed counters. This section explains common cautions for these instructions.
Applied Instructions (High Speed Processing)
Instruction Limitation in number of instructions driven at same time
32 instructions including DHSCT instruction DHSCR
DHSCT Only 1 (This instruction can only be used once.)
Applied Instructions (Handy Instruction)
Instruction Limitation in number of instructions driven at same time
DHSZ *1
Applied Instructions (External FX I/O Device)
*1. The instruction is not provided in the FX0S, FX0, FX0N, FX1S, FX1N and FX1NC PLCs.
→ FX Structured Programming Manual [Device & Common]
Applied Instructions (External Device (optional device))
M8000 DHSCS EN s1 s2
Applied Instructions (Data Transfer 2)
DHSCS EN s1 s2
d Y010 K100 CN255
Applied Instructions (Floating Point)
When C255 reaches K100, the output Y000 is driven by interrupt. Y010 is driven when END processing is executed. If interrupt drive is required, use an output number in the range from Y001 to Y007 whose high-order two digits are equivalent.
Applied Instructions (Positioning Control)
6 instructions DHSCR · d K100 CN255

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
12 Applied Instructions (High Speed Processing)
5. Reset operation by an external terminal [M8025*1: DHSC (external reset) mode] For a high speed counter equipped with an external reset terminal (R) such as C241, an instruction is executed and the comparison result is output at the rising edge of the reset input signal. (The FXU PLC of V2.1 or later and produced February 1990 or later are compatible with this function. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC is not compatible.)
M8025 External reset mode *1
External reset terminal for C241 X001
OUT_C_32 EN CCoil CValue
K9999
DHSCR EN s1 s2
*1. It is not necessary to drive M8025 for the FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G and FX3GC PLCs. The above reset operation takes place as a basic function.
RUN monitor · d CN241

12 Applied Instructions (High Speed Processing)
12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
1) FX3U and FX3UC PLCs When the same comparison value is used for the same high speed counter in DHSCS, DHSCR and DHSZ instructions, high speed counter reset (self-reset) by DHSCR instruction is executed with the highest priority (as shown in the table below). In this case, the comparison results do not change in DHSCS, DHSCR and DHSZ instructions whose comparison value is programmed to be the same as the comparison value for self-reset by DHSCR instruction. To change the comparison results, set the comparison value to "K0".
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
DHSCS (1) DHSCR (6) (Self-reset) DHSCS (1) DHSCS (1)
DHSCR (3) DHSCS (1) DHSCR (3) DHSCR (3)
DHSZ (4) DHSCS (2) DHSZ (4) (Not supported)
Applied Instructions (External FX I/O Device)
DHSCR (6) (Self-reset) DHSCR (5) DHSCR (6) (Self-reset) DHSCR (6) (Self-reset)
OUT_C_32 EN CCoil CValue
Applied Instructions (External Device (optional device))
DHSCS EN s1 s2
CN235
DHSCS EN s1 s2
Y001
DHSCR EN s1 s2
K500
M8000
DHSZ EN s1 s2
Applied Instructions (Data Transfer 2)
Y003
DZCPP EN s1 s2
Applied Instructions (Floating Point)
Y003
M8000
DHSCR EN s1 s2
Y006
DHSCR EN s1 s2
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.4 DHSCS, DHSCS_I / High Speed Counter Set, High Speed Interrupt Counter Set
12 Applied Instructions (High Speed Processing)

*1. To change the comparison results by the instructions (1) to (3) and (5) in the previous page, change the comparison value "K500" in the instructions (1) to (3) and (5) in the previous page to "K0".
*2. To set Y005 to ON in the DHSZ instruction (4) in the previous page, set a value smaller than the comparison value "K500". However, due to the response delay at the output, the output may not operate within the short time before the counter's current value is reset to "0" (to K500 (K0)).
Y000 to Y002 and Y006 do not change.*1
Operation of FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs.

*1. Due to the response delay at the output, the output may not operate within the short time before the counter's current value is reset from "0" to "1".


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction compares the value counted by a high speed counter with a specified value at each count, and immediately resets an external output (Y) when both values become equivalent to each other.
Data to be compared with the current value of a high-speed counter or
word device storing the data to be compared*1 ANY32
Bit device to be set to ON when the compared two values are equivalent to each other Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.5 DHSCR / High Speed Counter Reset
12 Applied Instructions (High Speed Processing)
1. 32-bit operation (DHSCR) When the current value of the high speed counter of the device specified by becomes the comparison value of the device specified by (for example, when the current value changes from "199" to "200" or from "201" to "200" if the comparison value is K200), the bit device specified by is reset (set to OFF) regardless of the operation cycle. In this instruction, the comparison processing is executed after the counting processing in the high speed counter.
OUT_C_32 EN CCoil CValue
DHSCR EN s1 s2
Reset s1 s2 d
Comparison value Comparison source
When the current value of the high speed counter C255 changes (counts) from "99" to "100" or from "101" to "100", Y010 is reset (output refresh).
OUT_C_32 EN CCoil CValue
DHSCR EN s1 s2
Related instruction
The following instructions can be combined with high speed counters.
DHSCS High speed counter set
DHSCR High speed counter reset
DHSZ High speed counter zone compare
DHCMOV High speed counter move
DHSCT High speed counter compare with data table

12 Applied Instructions (High Speed Processing)
12.5 DHSCR / High Speed Counter Reset
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
M8000 DHCMOV EN s n
Applied Instructions (External FX I/O Device)
LDD
K100
Y010
Applied Instructions (External Device (optional device))
REF EN d n
K8
For FX1S, FX1N, FX1NC, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs
LDD
K40000
Y010
CN251
REF EN d n
Applied Instructions (Data Transfer 2)
For FX0S, FX0, FX0N, FXU and FX2C PLCs
CN251
GE
Y010
Applied Instructions (Floating Point)
REF EN d n
ENO Y010
K8
→ FX Structured Programming Manual [Device & Common]
Applied Instructions (Positioning Control)
Not indexed. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
d K0 · d ENO · d ENO
![Page 280 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-280.webp?w=400)
FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.5 DHSCR / High Speed Counter Reset
12 Applied Instructions (High Speed Processing)
S3: The FX3U and FX3UC PLCs only are applicable. S4: The same counter of the device specified by can be used. (See the program example.)
described in Section 12.4.
described in Section 12.4.
described in Section 12.4.
Reset value of DHSCR
OUT_C_32 EN CCoil CValue
K300
Current value of C255
DHSCR EN s1 s2
Output contact of C255
Comparison source Comparison value
OUT_C_32(M8000,CC255,K300);
DHSCR(M8000,K400,CN255,CC255);

12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction compares the current value of a high speed counter with two values (one zone), and outputs the comparison result to three bit devices (refresh).
Expression in each language
Applied Instructions (Handy Instruction)
DHSZ EN s1 s2
DHSZ 32 bits Continuous DHSZ(EN,s1,s2,s,d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Data to be compared with the current value of a high-speed counter or word device storing the data to be compared (Comparison value 1) ANY32
Data to be compared with the current value of a high-speed counter or word device storing the data to be compared (Comparison value 2) ANY32
Applied Instructions (External Device (optional device))
Device of a high speed counter ANY32
ENO Execution state Bit
Head device to which the comparison result is output based on upper and lower comparison values (3 points occupied) ARRAY [0..2] OF Bit
Bit Devices Word Devices Data type
System User Digit Specification System User Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
Applied Instructions (Data Transfer 2)
z S2 S3 z
z z z S1 z
S: Refer to "Cautions".
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)
1. 32-bit operation (DHSZ) The current value of the high speed counter of the device specified by is compared with two comparison points (comparison value 1 and comparison value 2). Based on the comparison result, "smaller than the lower comparison value", "inside the comparison zone" or "larger than the upper comparison value", one among the devices specified by is set to ON regardless of the operation cycle. In this instruction, the comparison processing is executed after the count processing in the high speed counter.

Comparison points Make sure that the comparison value 1 and the comparison value 2 have the following relationship:
Operation When the current value of the high speed counter C251 changes (counts) as shown below, the comparison result is output to one of the outputs Y000, Y001 or Y002.

Comparison pattern Current value of C251 Change of output contact (Y)
999→1000 ON→OFF OFF→ON OFF
999←1000 OFF→ON ON→OFF OFF
999→1000 ON→OFF OFF→ON OFF
999←1000 OFF→ON ON→OFF OFF
2000→2001 OFF ON→OFF OFF→ON
2000←2001 OFF OFF→ON ON→OFF
2000→2001 OFF ON→OFF OFF→ON
2000←2001 OFF OFF→ON ON→OFF
The following instructions can be combined with high speed counters.

≤

12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
DHCMOV EN s n
Applied Instructions (External FX I/O Device)
LDD> EN s1 s2
K10000
LDD
ANDD>= EN s1 s2
Applied Instructions (External Device (optional device))
Y011
K10000
LDD< EN s1 s2
K20000
M8000
REF EN d n
For FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs
Applied Instructions (Data Transfer 2)
LDD> EN s1 s2
K10000
CN251
Applied Instructions (Floating Point)
LDD
ANDD>= EN s1 s2
Y011
K10000
CN251
CN251
LDD< EN s1 s2
K20000
CN251
M8000
REF EN d n
Applied Instructions (Positioning Control)
d D100

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)
For FXU and FX2C PLCs
ENO CN251
Y010
INT_TO_DINT _INT K10000
GE_E EN _IN _IN
LE_E EN _IN _IN
ENO CN251
ENO CN251
Y011
INT_TO_DINT _INT K10000
INT_TO_DINT _INT K20000
GT_E EN _IN _IN
ENO CN251
Y012
INT_TO_DINT _INT K20000
M8000
REF EN d n
→ FX Structured Programming Manual [Device & Common]
Not indexed (V, Z). S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.
5. Relationship between the comparison timing and the result output 1) DHSZ instruction executes comparison and outputs the result only when a counting pulse is input to a high speed counter. (When is "1000" and is "1999", the output is set to ON as soon as the current value of C235 changes from "999" to "1000" or from "1999" to "2000".) 2) Because the comparison result cannot be obtained when restoring the power or when the PLC mode switches from STOP to RUN, the result is not output even if the comparison condition is provided. → For details, refer to "Program in which comparison result is set to ON when power is turned ON
[ZCP] instruction" that is described later.
described in Section 12.4.
described in Section 12.4. 8. Number of occupied devices 1) The comparison value occupies two devices from or respectively. 2) The output occupies three devices from . 9. When an output (Y) is specified in (D) (FX3G/FX3GC/FX3U/FX3UC) When Y 6 or Y 7 is specified as an output (Y), the refresh timing of the three outputs (Y) occupied by the DHSZ instruction is different for each output. To make the refresh timing of three points simultaneous, specify Y 0 to Y 5. Example: When Y006 is specified as an output (Y), the refresh timing is different between Y006, Y007 and Y010.

12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
12.6.1 Program in which comparison result is set to ON when power is turned ON [ZCP] instruction
DHSZ instruction outputs the comparison result only when a counting pulse is input. Even if the current value of C235 is "0", Y010 remains OFF at the time of startup. For initializing Y010, compare the current value of C235 with K1000 and K1200 and drive Y010 by DZCPP instruction (for general zone comparison) as pulse operation only at the time of startup. Refer to the program example shown below.
Applied Instructions (High Speed Processing)
The outputs Y010 to Y012 are as shown below.
Y010 = ON Y011 = ON Y012 = ON
Applied Instructions (Handy Instruction)
1,000 1,200 Current value of C235 0
Applied Instructions (External FX I/O Device)
ZRST EN ENO
Y010 Y012
Y010 to Y012 are reset.
Applied Instructions (External Device (optional device))
OUT_C_32 EN CCoil CValue
Immediately after start, comparison is executed only once. K1000 CN235 K1000 CN235 K1200 K1200 CN235
M8000 DZCPP EN s1 s2
K1000 K1200
CN235
Immediately after start, comparison is executed by interrupt when each pulse is input from X000. K1000 CN235 K1000 CN235 K1200 K1200 CN235
DHSZ EN s1 s2
Applied Instructions (Data Transfer 2)
:Y010 ON :Y011 ON :Y012 ON ≤ ≤ >
Y010
[ST]
Applied Instructions (Floating Point)
ZRST(NOT X010,Y010,Y012);
OUT_C_32(M8000,CC235,K999 );
DZCPP(X010,K1000,K1200,CN235,Y010);
DHSZ(X010,K1000,K1200,CN235,Y010);
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)
In the part 1) in the timing chart, Y010 remains OFF if the current value of a high speed counter (C235 in the example below) is "0" when restoring the power.


12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
This section explains the table high speed comparison mode (high speed pattern output) of the DHSZ instruction. When two or more outputs should be activated at one time, use the DHSCT instruction which can change up to 16 outputs. (Valid for the FXU PLC, V3.07 or later)
Applied Instructions (High Speed Processing)
Operand type Description Data type
Head word device number storing the data table (only data register D) ANY32
Number of lines in the table (only K or H) ... K1 to K128 or H1 to H80 ANY32
Device number of a high speed counter ANY32
Special auxiliary relay for declaring the table high speed comparison mode Bit
Applied Instructions (Handy Instruction)
in the DHSZ instruction, the special function shown below is provided.
Applied Instructions (External FX I/O Device)
Command input OUT_C_32 EN CCoil CValue
DHSZ EN s1 s2
Applied Instructions (External Device (optional device))
M8130 Head device Number of lines Comparison source
Table high speed comparison mode
number SET/RST Table counter (D8130)
+1, +2 +3 0 ↓
+5, +4 +6 +7 1 ↓
+9, +8 +10 +11 2 ↓
Applied Instructions (Data Transfer 2)
to
-1 ↓ Repeated from "0"
+5, +4 +6 +7
Applied Instructions (Floating Point)
When Specifying Y020, specify "H20".
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)

Output is set or reset K1: Output is set.
Output is set or reset K0: Output is set.
Output is set or reset K1: Output is set.
Output is set or reset K0: Output is set.
Output is set or reset K1: Output is set.

12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
OUT_C_32 EN CCoil CValue
K2147483647
DHSZ EN s1 s2
Applied Instructions (High Speed Processing)
K5
Table high speed comparison mode
Applied Instructions (Handy Instruction)
Y011
Applied Instructions (External FX I/O Device)
Current value of C251
number SET/RST Table counter
K123
H10
K1
A program to reset the counter is required.
K234
H10
K0
Applied Instructions (External Device (optional device))
K345
H11
K1
D213, D212
K456
H11
K0
4 ↓ Repeated from "0"
K567
H11
K1
A program to reset the output is required.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)

12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
When the special auxiliary relay M8132 for declaring the frequency control mode is specified as in the DHSZ instruction, the special function shown below is provided if DPLSY instruction is combined. At this time, only a data register D can be specified as , and a constant K or H can be specified as . The available range is limited to "1 ≤ K, H ≤ 128". A high speed counter can be specified as . This function is different from the zone comparison described above. PLSY instruction is as shown on the next page, and only the pulse output can be changed by users. (Valid for the FXU PLC, V3.07 or later)
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Comparison data Frequency Table counter (D8131)
D 302, D 303
K 20
K300
Head device (32 bits) specified as s1
D 306, D 307
K600
K500
D 309, D 308
D 310, D 311
Applied Instructions (External FX I/O Device)
Number of lines specified as s2
K200
D 313, D 312
D 314, D 315
K800
K100
D 317, D 316
D 318, D 319
K 0
K 0
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.6 DHSZ / High Speed Counter Zone Compare
12 Applied Instructions (High Speed Processing)


12 Applied Instructions (High Speed Processing)
12.6 DHSZ / High Speed Counter Zone Compare
Output pulse Frequency (Hz)
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
0 20 600 700 800
Current value of C251
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Data can be written to the table in a program as shown in this example or directly using keys in peripheral equipment.
Applied Instructions (Data Transfer 2)
according to the table counter D8131 count.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
200 300

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.7 SPD / Speed Detection
12 Applied Instructions (High Speed Processing)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction counts the input pulse for a specified period of time as interrupt input. The function of this instruction varies depending on the version.


Time data (ms) or word device storing the data ANY16 ANY32
Head word device storing the pulse density data ARRAY [0..2] OF ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
S: Refer to "Cautions".

12 Applied Instructions (High Speed Processing)
12.7 SPD / Speed Detection
Applied Instructions (High Speed Processing)
Command input SPD EN s1
d Device for pulse input
Applied Instructions (Handy Instruction)
The command contact is set to ON.
Applied Instructions (External FX I/O Device)
+1 counts "OFF to ON" operation of . ms later, the counting result is stored to . Accompanied by this operation, +1 is reset, and then counting of the "OFF to ON" operation of is started again.
Applied Instructions (External Device (optional device))
Counting time Counting time
+2 is used to measure the remaining time.
+2 Remaining time (ms)
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
N = nt 60 10 (r/min) 3
t: Measurement time duration specified as (ms). Proximity switch "n" pulses/rotation
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.7 SPD / Speed Detection
12 Applied Instructions (High Speed Processing)
2. 32-bit operation (DSPD) [FX3GC PLCs Ver. 1.40 or later, FX3UC PLCs Ver. 2.20 or later, and FX3S/FX3G/FX3U PLCs] The input pulse specified by is counted only for the period of "time specified by multiplied by 1 ms." The measured value is stored in [ +1, ], the current value is stored in [ +3, +2], and the remaining time is stored in [ +5, +4] (ms). By repeating this operation, the measured value [ +1, ] will store the pulse density (which is proportional to the rotation speed).
Command input DSPD EN s1
d Device for pulse input

[ +3, +2] counts "OFF to ON" operation of . [ +1, ] ms later, the counting result is stored to [ +1, ]. Accompanied by this operation, [ +3, +2] is reset, and then counting of the "OFF to ON" operation of is started again.
[ +5, +4] is used to measure the remaining time.
nt 60 [ +1, ] 3 10 (r/min) N =
t: Measurement time duration specified as [ +1, ] (ms).
Pulse density data · Time data · s2

12 Applied Instructions (High Speed Processing)
12.7 SPD / Speed Detection
1. Input specifications of the input specified by
1) can specify the following ranges. FX3G, FX3GC, FX3U and FX3UC PLCs: X000 to X007 FX1S, FX1N, FX1NC, FX2N, FX2NC and FX3S PLCs: X000 to X005 FXU and FX2C PLCs: X000 to X005 2) An input device X000 to X007 (X000 to X005) specified by cannot overlap the following functions or instructions: - High speed counter - DSZR - Input interrupt - DVIT - Pulse catch - ZRN - Pulse width measurement 3) For one input, this instruction can be used only once. 4) The maximum input frequency is shown below:
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Used input number FX3UC PLC
Main unit FX3U-4HSX-ADP
X000 to X005 100kHz*1 100kHz*1 200kHz X006 to X007 10kHz 10kHz
Applied Instructions (External FX I/O Device)
*1. When receiving pulses within the response frequency range of 50k to 100 kHz, perform the following actions: - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 kΩ (1 W or more) to the input terminal, and make sure that the load current in the open collector transistor output of the external equipment is 20 mA or more.
Used input number FX3G and FX3GC PLCs
X000, X001, X003, X004 60kHz
Applied Instructions (External Device (optional device))
X002, X005, X006, X007 10kHz
Used input number FX1S, FX1N, FX1NC, FX2N, FX2NC and FX3S PLCs
X002, X003, X004, X005 10kHz
Used input number FXU and FX2C PLCs
X000, X002, X003 10kHz
X001, X004, X005 7kHz
Applied Instructions (Data Transfer 2)
*2. The value is updated by interrupt processing from the CPU, not every scan time (operation cycle) of the PLC. 3. Restrictions to devices S1: X000 to X007 (X005) can be specified.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
X000, X001 60kHz

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output
12 Applied Instructions (High Speed Processing)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction generates a pulse signal.


Frequency data (Hz) or the word device storing the data ANY16 ANY32
Pulse quantity data or the word device storing the data ANY16 ANY32
Bit device (Y) from which pulses are output Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
S: Refer to "Cautions".

12 Applied Instructions (High Speed Processing)
12.8 PLSY / Pulse Y Output
Applied Instructions (High Speed Processing)
Frequency data Pulse quantity data
Bit device (Y) from which pulses are output
For setting , and , refer to the "cautions". s1 s2 d
Applied Instructions (Handy Instruction)
Command input DPLSY EN s1
s2 +1, Pulse quantity]
Bit device (Y) from which pulses are output Pulse quantity data
Applied Instructions (External FX I/O Device)
For setting , and , refer to the "cautions". s1 s2 d
Applied Instructions (External Device (optional device))
→ FX Structured Programming Manual [Device & Common]
ON : Generation of specified number of pulses is completed. OFF : Generation of pulses is paused before the specified number of pulses is reached or the
continuous pulse generation operation is stopped.
PLSY EN s1 s2
PLSY EN s1 s2
Applied Instructions (Data Transfer 2)
Y000
K1000
Y000
K0
K0
M8029
DPLSY EN s1 s2
Applied Instructions (Floating Point)
Y001
DPLSY EN s1 s2
Y000 K1000 Command input 1
K0
Changes by DPLSY instruction corresponding to the command input 2.
M8029
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output
12 Applied Instructions (High Speed Processing)
The number of pulses output from Y000 or Y001 is stored in the following special data resistors.
Description Contents of data High order Low order
D8141*1 D8140*1 Accumulated number of pulses
Accumulated number of pulses output from Y000 by PLSY and PLSR instructions
D8143*1 D8142*1 Accumulated number of pulses
Accumulated number of pulses output from Y001 by PLSY and PLSR instructions
D8137*2 D8136*2 Total accumulated number of pulses output from Y000 and Y001
Total accumulated number of pulses output from Y000 and Y001 by PLSY and PLSR instructions.
*1. The FX0S, FX0, FX0N, FXU or FX2C PLC is not compatible with this function.
*2. The FX0S, FX0 or FX0N PLC is not compatible with this function. The FXU PLC of V3.07 or later is compatible.
The contents of each data register can be cleared using the following program.
Command input DMOV EN s
d K0 Low order devices in the table above
Description FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC
M8349 M8145, M8349 M8145 Immediately stops pulse output from Y000.
M8359 M8146, M8359 M8146 Immediately stops pulse output from Y001.
To restart pulse output, set the device corresponding to the output signal to OFF, and then drive the pulse output instruction again.
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.

12 Applied Instructions (High Speed Processing)
12.8 PLSY / Pulse Y Output
32-bit instruction→1 to 200,000Hz (When using special high speed output adapter) →1 to 100,000Hz (When using main unit)
Applied Instructions (High Speed Processing)
32-bit instruction→1 to 100,000Hz
Applied Instructions (Handy Instruction)
32-bit instruction→1 to 100,000Hz
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
*1. Special high speed output adapters can be connected only to the FX3U PLC.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output
12 Applied Instructions (High Speed Processing)
When the load is smaller, connect a dummy resistor in parallel to the outside of a used output terminal (Y000 or Y001) as shown in the circuit diagram below so that the specified current shown below flows in the output transistor.


12 Applied Instructions (High Speed Processing)
12.8 PLSY / Pulse Y Output
Applied Instructions (High Speed Processing)
= Y000 Y004 While Y004 is ON, pulses are output from Y000 in the high speed output adapter. While Y004 is OFF, pulses are output from Y004 in the high speed output adapter.
= Y001 Y005 While Y005 is ON, pulses are output from Y001 in the high speed output adapter. While Y005 is OFF, pulses are output from Y005 in the high speed output adapter.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Setting name in each positioning
Status of output type
setting switch Signal name
1st unit 2nd unit
1st axis 2nd axis 3rd axis 4th axis
Applied Instructions (External Device (optional device))
tion Y000 Y001 Y002 Y003
"FP - RP" side
signal Y004 Y005 Y006 Y007
Pulse train Pulse output destina-
tion Y000 Y001 Y002 Y003
"PLS - DIR" side
signal Y004 Y005 Y006 Y007
Relay output type or triac output type main unit While instruction is activated, relevant output is ON. (LED is also ON.) Use special high speed output adapter.
Applied Instructions (Data Transfer 2)
Special high speed output adapter Operated (LED operated.) Set the output frequency to "200 kHz" or less.
Transistor output type main unit Operated (LED is also ON.) Set the output frequency to "100 kHz" or less.
1) When using the same output relay (Y000 or Y001) in several instructions. While a pulse output monitor (BUSY/READY) flag is ON a pulse output instruction and positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction drive contact is set to OFF, a pulse output instruction or positioning instruction for the same output relay cannot be executed. Before executing such an instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX1S, FX1N, FX1NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)
Applied Instructions (Floating Point)
Pulse output monitor flag
FX3U, FX3UC FX3S, FX3G, FX3GC FX1N, FX1NC, FX1S
Y001 M8350 M8350, M8148 M8148
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.8 PLSY / Pulse Y Output
12 Applied Instructions (High Speed Processing)
When the device specified by is set to K0, pulses are output without any limitation.
Command input DPLSY EN s1 s2
K1000
K0
[ST]
DPLSY(X000,K1000,K0,Y000);

12 Applied Instructions (High Speed Processing)
12.9 PWM / Pulse Width Modulation
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction outputs pulses with a specified period and ON duration.
Expression in each language
PWM EN s1 s2
Applied Instructions (Handy Instruction)
PWM 16 bits Continuous PWM(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Pulse width (ms) data or word device storing the data ANY16
Period data (ms) or word device storing the data ANY16
ENO Execution state Bit
Applied Instructions (External Device (optional device))
Device (Y) from which pulses are to be output Bit
Bit Devices Word Devices Others
System User Digit Specification System User Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
Applied Instructions (Data Transfer 2)
S: Refer to "Cautions".
Applied Instructions (Floating Point)
PWM EN s1 s2
d Device (Y) from which pulses are to be output
d t T0
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.9 PWM / Pulse Width Modulation
12 Applied Instructions (High Speed Processing)
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.
- When using special high speed output adapters*1: Y000, Y001, Y002*2, Y003*2
- When using transistor outputs on the main unit (that is, when not using special high speed output adapters): Y000, Y001, Y002*3
*1. Special high speed output adapters can be connected only to the FX3U PLC. When using the PWM instruction with a relay output type or triac output type FX3U PLC, a special highspeed output adapter is required.
*2. When specifying Y002 or Y003 on a special high speed output adapter, a second special high speed output adapter is required.
*3. "Y002 is not available in FX3S, FX3G PLC (14-point and 24-point type) and FX3GC PLC.
4) While a pulse output monitor (BUSY/READY) flag is ON, a pulse output or positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction derive contact is set to OFF, a pulse output or positioning instruction for the same output relay cannot be executed. Before executing a pulse output or positioning instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)
Pulse output destination device Pulse output monitor flag
Y001 M8350
Y002 M8360
Y003 M8370

12 Applied Instructions (High Speed Processing)
12.9 PWM / Pulse Width Modulation
Applied Instructions (High Speed Processing)
When the contents of D10 are changed in the range from "0" to "50" in the program example shown below, the average output from Y000 will be in the range from 0 to 100%. When the contents of D10 exceed "50", it becomes an error. In this program example, the FX3U series main unit (sink output) is used. For wiring details, refer to the manual of the PLC used.
Applied Instructions (Handy Instruction)
Y000 PWM EN s1 s2
Applied Instructions (External FX I/O Device)
PWM(X0,D10,K50,Y000);
Example of smoothing circuit
Applied Instructions (External Device (optional device))
PLC
P 22 Ω E
Y000 COM1 Y001 Y002 Y003
R>>P =R(k ) C(µF)=470ms>>To The time constant of the filter should be considerably larger than the pulse cycle T0.
Applied Instructions (Data Transfer 2)
The ripple value " e" in the mean output current "e" is approximately " ". e Δe Δ To
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup
12 Applied Instructions (High Speed Processing)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This pulse output instruction has the acceleration/deceleration function.

PLSR 16 bits Continuous PLSR(EN, s1, s2, s3, d);
DPLSR 32 bits Continuous DPLSR(EN, s1, s2, s3, d);

Maximum frequency data (Hz) or the word device storing the data ANY16 ANY32
Total number of output pulses (PLS) or word device storing the data ANY16 ANY32
Acceleration/deceleration time (ms) data or word device storing the data ANY16 ANY32
Device (Y) from which pulses are to be output Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
z S2 S3 z
S: Refer to "Cautions".

12 Applied Instructions (High Speed Processing)
12.10 PLSR / Acceleration/Deceleration Setup
Command input PLSR EN s1 s2
Applied Instructions (High Speed Processing)
Total number of output pulses(PLS) Acceleration/deceleration time(ms)
Total number of output pulses
Refer to "Cautions" for setting , , and .
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Command input DPLSR EN s1 s2
Maximum frequency(Hz) Total number of output pulses(PLS) Acceleration/deceleration time(ms)
Applied Instructions (External Device (optional device))
Refer to "Cautions" for setting , , and .
Applied Instructions (Data Transfer 2)
Total number of output pulses
Applied Instructions (Floating Point)
s3 Acceleration/ deceleration time
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup
12 Applied Instructions (High Speed Processing)
1. Instruction execution complete flag
OFF :The command input is OFF, or pulses are being output. (This flag does not turn ON if the pulse
output is interrupted in the middle of output.)
ON :Output of the number of pulses set in is completed.
The number of pulses output from Y000 or Y001 is stored in the following special data registers:
Description Contents of data High order
D8141 D8140 Accumulated number of pulses
Accumulated number of pulses output from Y000 by PLSY and PLSR instructions
D8143 D8142 Accumulated number of pulses
Accumulated number of pulses output from Y001 by PLSY and PLSR instructions
D8137 D8136 Total accumulated number of pulses output from Y000 and Y001
Total accumulated number of pulses output from Y000 and Y001 by PLSY and PLSR instructions
The contents of each data register can be cleared using the following program.
Command input DMOV EN s
d K0 Low order device in the table above
Description FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC
M8349 M8145, M8349 M8145 Immediately stops pulse output from Y000.
M8359 M8146, M8359 M8146 Immediately stops pulse output from Y001.
To restart pulse output again, set the device corresponding to the output number to OFF, and then drive the pulse output instruction again.
This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.

12 Applied Instructions (High Speed Processing)
12.10 PLSR / Acceleration/Deceleration Setup
32-bit instruction→10 to 100,000 Hz or less
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
32-bit instruction→1 to 2,147,483,647PLS
Applied Instructions (External FX I/O Device)
PLC version V3.00 or before : The pulses are not generated normally. PLC version V3.00 or later : One tenth of the maximum frequency is generated.
If the maximum frequency is 100 Hz or less, "10 Hz" is generated.
32-bit instruction→110 to 999,999(PLS) When setting a value less than "110", the pulses are not generated normally.
Applied Instructions (External Device (optional device))
Follow, however, the conditions a) through d). a) Make the acceleration/deceleration time be 10 times or more the PLC's maximum scan time (value of
D8012 or greater). If set to less than 10 times, the acceleration/deceleration timing becomes instable. b) The following equation defines the allowable minimum that can be set as the acceleration/
deceleration time.
s1 s3 5 ≥ ×
Applied Instructions (Data Transfer 2)
If setting a value less than the equation indicates, the error in the acceleration time becomes large. If set to less than "90000/ , operation takes place while rounding it up to "90000/ ". c) The following equation defines the allowable maximum that can be set as the acceleration/
deceleration time.
≤ × s1 s3 818 s2
Applied Instructions (Floating Point)
d) The number of speed changes (steps) for the acceleration/deceleration is fixed to "10 times" as shown
in the previous page.
If unable to set the PLC to these conditions, lower the maximum frequency specified by .
*1. Special high speed output adapters can be connected only to the FX3U PLC. When using the PLSR instruction with a relay output type or triac output type FX3U PLC, a special highspeed output adapter is required.
Applied Instructions (Positioning Control)

FXCPU Structured Programming Manual [Basic & Applied Instruction] 12.10 PLSR / Acceleration/Deceleration Setup
12 Applied Instructions (High Speed Processing)
turns OFF.
→ Refer to item 6 in 12.8 "Cautions".
1) When using the same output relay (Y000 or Y001) in several instructions. While a pulse output monitor (BUSY/READY) flag is ON a pulse output instruction and positioning instruction for the same output relay cannot be executed. While a pulse output monitor flag is ON even after the instruction drive contact is set to OFF, a pulse output instruction or positioning instruction for the same output relay cannot be executed. Before executing such an instruction, wait until the pulse output monitor flag turns OFF and one or more operation cycles pass. (Only the FX1S, FX1N, FX1NC, FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs are compatible with the pulse output monitor flags.)
Pulse output monitor flag
FX3U, FX3UC FX3S, FX3G, FX3GC FX1S, FX1N, FX1NC
Y001 M8350 M8350, M8148 M8148
minimum frequency of output pulse frequency
S1 S3 maximum frequency Hz (2 (acceleration or deceleration time ms 1000)) =
50000 (2 (100 1000)) = 500Hz ÷ ÷ ×
When setting 50000 Hz into the maximum frequency
→The actual output frequency is "500 Hz" at the first step of acceleration and the last step of
deceleration.
Pulse output destination · device · 500Hz 500Hz 500Hz

13 Applied Instructions (Handy Instruction)
This chapter introduces the instructions which achieve complicated control in a minimum sequence program.
Applied Instructions (High Speed Processing)
Instruction name Function Reference
IST Initial State Section 13.1
Search a Data Stack Section 13.2 SERP
DSERP
Applied Instructions (Handy Instruction)
Absolute Drum Sequencer Section 13.3 DABSD
INCD Incremental Drum Sequencer Section 13.4
TTMR Teaching Timer Section 13.5
STMR Special Timer Section 13.6
Alternate State Section 13.7 ALTP
Applied Instructions (External FX I/O Device)
RAMP Ramp Variable Value Section 13.8
ROTC Rotary Table Control Section 13.9
SORT SORT Tabulated Data Section 13.10
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for controlling the initial state and special auxiliary relay automatically in a program by stepladder.


Head bit device number of the selector switch in the operation mode (8 points occupied) ARRAY [0..7] OF Bit
Minimum state of practical state in automatic mode [d1
Maximum state of practical state in automatic mode [d1

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

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
Command input IST EN s
Minimum state Maximum state Head bit device number of the selector switch in the operation mode
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Source Device No.
(example) Switch function Source Device No.
X020 Individual operation +4 X024 Continuous operation
+1 X021 Return to home position +5 X025 Return home start
Applied Instructions (External FX I/O Device)
+2 X022 Stepping +6 X026 Automatic start
+3 X023 One-cycle operation +7 X027 Stop
Applied Instructions (External Device (optional device))
Device No. Operation function Device No. Operation function
M8040 Transfer ban S0 Initial state of individual operation
M8041*1 Transfer start S1 Initial state of return to home position
M8042 Start pulse S2 Initial state of automatic operation
M8043*1 Return home end
M8045 All output reset ban
M8047*2 STL monitor valid
*1. Cleared when changed from RUN to STOP
Applied Instructions (Data Transfer 2)
*2. Process during END command execution
The following states should not be programmed as general states.
Device No. Operation function
Applied Instructions (Floating Point)
S10 to S19 Occupied for return to home position.
If return home end (M8043) is not ON, all outputs are OFF if changed over to individual (X020), return to home position (X021), or automatic (X022, X023, X024). Automatic operation can be resumed after returning to home position completely.
→ Before introduction, refer to "IST command introduction examples (examples of work transfer
mechanism)" given below.
Applied Instructions (Positioning Control)
d1 d2 · (example) Switch function · S0 to S9

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
However, index modifier (V, Z) is not applicable. S2: The device range is limited as follows by the PLC.
S20 to S899, S1000 to S4095 (FX3G, FX3GC, FX3U and FX3UC PLCs) S20 to S255 (FX3S PLC) S20 to S899 (FX2N and FX2NC PLCs) (FXU and FX2C PLCs) S20 to S999 (FX1N and FX1NC PLCs) S20 to S127 (FX1S PLC) (FX0N PLC) S20 to S63 (FX0S and FX0 PLCs)

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
Detail of special auxiliary relay (M) or initial state (S0 to S9) controlled automatically by IST command is as shown in the following equivalent circuit. (Read as reference knowledge.) This equivalent circuit cannot create program.
M8041 Conti- nuous X027 M8041 is put in action when start button is pressed in automatic mode. In continuous mode, self-holding action is set, and it is canceled Stop
Applied Instructions (High Speed Processing)
Transfer start X026 Automatic start
when stop button is pressed.
X026 Automatic start X020
Individual X025 Return home
Applied Instructions (Handy Instruction)
M8040 is put in action in stepping mode, and is turned OFF every time start button is pressed. In return home or one-cycle mode, self-holding action is set when stop button is pressed, and it is canceled when start button is pressed.
Return home X027 Stop M8042
Start pulse X022 Stepping
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
M8044
Initial state is changed over depending on each mode input, and M8043 is also controlled. However, M8044 and M8043 must be also controlled by the user program.
M8043
RST EN ENO
S 1
M8043
Return home end signal reset
Transfer start S 2
Automatic Return home end
Applied Instructions (Data Transfer 2)
*1. Equivalent circuit is presented for explanation, and it cannot be actually programmed as shown herein.
Applied Instructions (Floating Point)
Return home X021 Automatic X022 to X024
Changeover to individual X020
Batch resetting of former states, and resetting of related OUT output.
Return home end S2
All output reset ban
Individual X020 Automatic X022 to X024
Changeover to return home X021
S2 All outputs Y are reset when M8045 is OFF.
Applied Instructions (Positioning Control)
If changed over from automatic to return home during action of S2, the states other than initial state and outputs are not reset.
*1. All outputs: outputs not driven from the state of the device designated in (Y), and outputs driven by OUT, SET commands from the state of the device designated in (Y).

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
1. Operation mode

Mechanism for transferring the work from point A to point B by robot hand
For individual operation of robot hand as shown on right
Pushbutton for external circuit for turning ON/OFF power of load
Operation mode Operation content
Individual operation: Mode for turning ON/OFF each load by individual pushbutton.
Return to home position: Mode for returning machine to home position automatically when return home pushbutton is pressed.
Stepping: To advance process by process every time start button is pressed.
When start button is pressed at home position, the machine is operated by one cycle automatically and stops at home position. If stop button is pressed on the way, the process stops immediately, and start button is pressed, the operation is resumed from the stopped position, and stops automatically at home position.
One-cycle operation:
Continuous operation:
When start button is pressed at home position, continuous repeating operation is started. When stop button is pressed, the machine operates to home position, and then stops.

Home position condition? Upper limit (X002=ON), left limit (X004=ON), unclamp (Y001=OFF).
The home position is the upper left corner, and the work is sequentially transferred from left to right in the sequence of descend, clamp, ascend, right move, descend, unclamp, ascend, and left move. Solenoid valve of double solenoid (two inputs: drive/non-drive) is used for descend/ascend, left move/right move, and solenoid of single solenoid (active only while energized) is used for clamp.
Manual · Automatic

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
- X020: Individual operation - X021: Return to home position - X022: Stepping - X023: One-cycle operation - X024: Continuous operation - X025: Return home start - X026: Automatic start - X027: Stop
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
When inputs are not serial numbers
In the case of continuous/return home mode only
In the case of continuous/ individual mode only
(Example) X030:Individual operation
(Example) X030:Return to home position
(Example) X030:Individual operation
X035:Return to home position X033:Stepping X040:One-cycle operation X032:Continuous operation X034:Return home start X026:Automatic start X041:Stop
X031:Continuous operation X032:Common for automatic
X031:Continuous operation X032:Automatic start X033:Stop
start and return home start X033:Stop
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
M 0 X030
M 0 Individual operation
M 0 Not active
M 1 Return to home position
M 1 Return to home position
M8000
M 2 Not active
M 3 One-cycle operation X032
M 3
Applied Instructions (Data Transfer 2)
M 4 Continuous operation
M 4 Continuous operation
M 4 Continuous operation
M 5 Return home start
M 5 Return home start
M 6 Automatic start
M 6 Automatic start
M 6 Automatic start
Applied Instructions (Floating Point)
In this example, M0 is used as the mode designation beginning input.
d1 d2 M0 S20 S29
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
When this auxiliary relay is put in action, transfer of all states is banned. individual : Always M8040 is active. Return home, one-cycle: When stop button is pressed, the operation is held until start button is
operation is stopped, and is transferred. Other : Operation is held when PLC is changed from STOP to RUN, and is
canceled when start button is pressed. In transfer ban state, the output in the state continues to operate. b) M8041: Transfer start
This is the auxiliary relay required as transfer condition from initial state S2 to next state. Individual, return home : Not active. Stepping, one-cycle : Active only while start button is pressed. Continuous : Operation is held when start button is pressed, and canceled when stop
Active momentarily only when start button is pressed. d) M8047: STL monitor valid
M8047 is turned ON when IST command is used. STL monitor is valid when M8047 is ON, and active state numbers (S0 to S899) are stored in the special data register D8040 to D8047 in numerical order. As a result, up to eight operation state numbers can be monitored. If any one of these states is active, the special auxiliary relay M8046 operates.
→ For detail of these controls, see next page. a) M8043: Return home end
In the return home mode, when the machine reaches the home position, operate this special auxiliary relay (M) from the user side program. b) M8044: Home position condition
You can drive this special auxiliary relay by detecting the home position condition of the machine. The signal is valid in all modes. c) M8045: All output reset ban
When the modes are changed over in individual, return home, and automatic modes, unless the machine is at home position, all outputs and operation states are reset. However, when the M8045 is driven, only the operation states are reset.

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
During operation of the machine, the operation can be changed over freely within the "automatic operation' mode (stepping/one-cycle/continuous). During operation of the machine, if changed over among "individual operation"/ "return home"/ "automatic operation", for safety precaution, all outputs are once reset, and the mode after changeover is valid. (You cannot reset when all outputs reset ban M8045 is turned ON.)
Applied Instructions (High Speed Processing)
The home position status is detected, and used as the condition for start of transfer to automatic operation.
M8044:= X004 AND X002 AND NOT Y001; IST(M8000, X020, S20, S27);
Applied Instructions (Handy Instruction)
Y001
M8000
Applied Instructions (External FX I/O Device)
d1 d2 X020 S20 S27
Program is not required when individual mode is not available.
Applied Instructions (External Device (optional device))
SET(X012, Y001); RST(X007, Y001); Y002:= X005 AND NOT Y000; Y000:= X010 AND NOT Y002; Y004:= X006 AND X002 AND NOT Y003; Y003:= X011 AND X002 AND NOT Y004;
RST EN ENO
Y002
Y000
Applied Instructions (Data Transfer 2)
Y003 X002
Right move Upper limit
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State
c) Return to home position
Program is not required when return home mode is not available. However, before automatic operation, return home end M8043 must be once set.

STL(TRUE, S1); SET(X025, S10); STL(TRUE, S10); RST(TRUE, Y001); RST(TRUE, Y000); OUT(TRUE, Y002); SET(X002, S11); STL(TRUE, S11); RST(TRUE, Y003); OUT(TRUE, Y004); SET(X004, S12); STL(TRUE, S12); SET(TRUE, M8043); RST(M8043, S12);
Use states S10 to S19 in operation of return home, and in final state, by driving M8043, you can self-reset.


STL(TRUE, S20); OUT(TRUE, Y000); SET(X001, S21); STL(TRUE, S21); SET(TRUE, Y001); OUT_T(TRUE, TC0, K10); SET(TS0, S22); STL(TRUE, S22); OUT(TRUE, Y002); SET(X002, S23); STL(TRUE, S23); OUT(TRUE, Y003); SET(X003, S24); STL(TRUE, S24); OUT(TRUE, Y000); SET(X001, S25); STL(TRUE, S25); RST(TRUE, Y001); OUT_T(TRUE, TC1, K10); SET(TS1, S26); STL(TRUE, S26); OUT(TRUE, Y002); SET(X002, S27); STL(TRUE, S27); OUT(TRUE, Y004); OUT(X004, S2);

13 Applied Instructions (Handy Instruction)
13.1 IST / Initial State

![Page 325 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — ARRAY [1..5] OF ANY16](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-325.webp?w=400)
13 Applied Instructions (Handy Instruction)
13.2 SER / Search a Data Stack
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This is a command for searching same data and maximum value, minimum value from the table of data.
Expression in each language
SER EN s1 s2
Applied Instructions (Handy Instruction)
SER 16 bits Continuous SER(E, s1, s2, n, d);
SERP EN s1 s2
Applied Instructions (External FX I/O Device)
SERP 16 bits Pulse SERP(EN, s1, s2, n, d);
DSER EN s1 s2
DSER 32 bits Continuous DSER(EN, s1, s2, n, d);
Applied Instructions (External Device (optional device))
DSERP EN s1 s2
DSERP 32 bits Pulse DSERP(EN, s1, s2, n, d);
Applied Instructions (Data Transfer 2)
EN Execution condition Bit
Beginning device for searching same data, maximum value, minimum value ANY16 ANY32
Value for searching same data, maximum value, minimum value, or its storage destination device ANY16 ANY32
The number for searching same data, maximum value, minimum value ANY16
Applied Instructions (Floating Point)
ENO Execution state Bit
Beginning device for storing the numbers after searching same data, maximum value, minimum value
ARRAY [1..5] OF ANY32
3. Applicable devices
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
z S1 z z
Applied Instructions (Positioning Control)
z S1 S2 z
S: Refer to "Cautions".

13 Applied Instructions (Handy Instruction)
13.2 SER / Search a Data Stack
1. 16-bit operation
In n pieces of data beginning from the device designated in , same data as the device designated in is searched, and the result is stored in the device designated in .

Beginning device for searching same data, maximum value, minimum value
Beginning device for storing the numbers after searching same data, maximum value, minimum value
Value for searching same data, maximum value, minimum value, or its storage destination device The number for searching same data, maximum value, minimum value
In five devices beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. b) When same data is not found
In five devices beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. However, 0 is stored in three devices beginning from the device designated in (number of same data, initial/final position).
a) Examples of composition of search result table and data

b) Search result table

![Page 327 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ +15, +14] K 95000 7](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-327.webp?w=400)
13 Applied Instructions (Handy Instruction)
13.2 SER / Search a Data Stack
Command input DSER EN
Beginning device for searching same data, maximum value, minimum value
Beginning device for storing the numbers after searching same data, maximum value, minimum value
Applied Instructions (High Speed Processing)
Value for searching same data, maximum value, minimum value, or its storage destination device
The number for searching same data, maximum value, minimum value
Applied Instructions (Handy Instruction)
In five points of 32-bit data beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. b) When same data is not found
In five points of 32-bit data beginning from the device designated in , the number of same data, initial/final position, and positions of maximum value and minimum value are stored. However, 0 is stored in three points of 32-bit data beginning from the device designated in (number of same data, initial/final position).
Applied Instructions (External FX I/O Device)
a) Examples of composition of search result table and data
Value of of searched data
Applied Instructions (External Device (optional device))
(ex.)
[ +3, +2] K110100 1
[ +5, +4] K100000 2 3
[ +7, +6] K 98000 3
[ +9, +8] K123000 4
K100000
[ +11, +10] K 66000 5 3
[ +13, +12] K100000 6 3(Final)
[ +17, +16] K910000 8 3
[ +19, +18] K910000 9 3
Applied Instructions (Data Transfer 2)
b) Search result table
Device No. Content Search result item
[ +1, ] 3 Number of same data
[ +3, +2] 0 Position of same data (initial)
Applied Instructions (Floating Point)
[ +5, +4] 6 Position of same data (final)
[ +7, +6] 5 Final position of minimum value
[ +9, +8] 9 Final position of maximum value
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.2 SER / Search a Data Stack
1. Comparison of magnitude To be calculated algebraically. (-10 < 2)


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for creating multiple output patterns corresponding to the present value of the counter.
ABSD 16 bits Continuous ABSD(EN, s1, s2, n, d);
DABSD 32 bits Continuous DABSD(EN, s1, s2, n, d);
Beginning device for storing table data (rise point, fall point) ANY16 ANY16
Counter for present value monitor to compare with table data ANY16 ANY16
Number of lines of table and number of points of bit device to be output ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z

13 Applied Instructions (Handy Instruction)
13.3 ABSD / Absolute Drum Sequencer
1. 16-bit operation(ABSD) This is an example for explaining the ON/OFF control of the output by one revolution of table (0 to 360 degrees). (Rotation angle signal one degree per pulse) Data table (occupying n lines × 2 points) of n lines from the device designated in is compared with the present value of the counter of the device designated in , and outputs of n points continuous from the device designated in are controlled to be ON/OFF during one revolution.

Beginning device for storing table data (rise point, fall point) Beginning bit device to be output
Counter for present value monitor to compare with table data (C )
n Number of lines of table and number of points of bit device to be output
For example, store rising point data and falling point data alternately.


13 Applied Instructions (Handy Instruction)
13.3 ABSD / Absolute Drum Sequencer
Applied Instructions (High Speed Processing)
Beginning device for storing table data (rise point, fall point) Beginning bit device to be output
Counter for present value monitor to compare with table data (C )
Applied Instructions (Handy Instruction)
n Number of lines of table and number of points of bit device to be output
RST EN ENO
Applied Instructions (External FX I/O Device)
OUT_C EN CCoil CValue
Applied Instructions (External Device (optional device))
Rotation angle signal one degree per pulse
Rise point Fall point
Object output Data value
[ +1, ] 40 [ +3, +2] 140
[ +5, +4] 100 [ +7, +6] 200 +1
[ +9, +8] 160 [ +11, +10] 60 +2
[ +13, +12] 240 [ +15, +14] 280 +3
Applied Instructions (Data Transfer 2)
[ +4n+1, +4n] [ +4n+3, +4n+2] +n-1
For example, store rising point data and falling point data alternately.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.3 ABSD / Absolute Drum Sequencer
However, index modifier (V, Z) is not applicable. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for creating multiple output patterns by using a pair of counters.
INCD 16 bits Continuous INCD(EN, s1, s2, n, d);
Beginning word device for storing the set value ANY16
Beginning device of counter for present value monitor (2 points occupied) ANY16
Beginning bit device to be output (n points occupied) Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z

13 Applied Instructions (Handy Instruction)
13.4 INCD / Incremental Drum Sequencer

Beginning word device for storing the set value Beginning device of counter for present value monitor Number of bit devices to be output



13 Applied Instructions (Handy Instruction)
13.4 INCD / Incremental Drum Sequencer
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
However, index modifier (V, Z) is not applicable. S2: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S3: The FX3U and FX3UC PLCs only are applicable.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.5 TTMR / Teaching Timer
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for measuring the ON duration of TTMR command. This is used when adjusting the timer setting time by pushbutton.


Multiplying factor number to be applied to teaching data ANY16
Device for storing teaching data (2 points occupied) ARRAY [0..1] OF ANY16

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

13 Applied Instructions (Handy Instruction)
13.5 TTMR / Teaching Timer
Command input TTMR EN n
Applied Instructions (High Speed Processing)
Multiplying factor number to be applied to teaching data
Device for storing teaching data
Applied Instructions (Handy Instruction)
τ0 τ0 Pushing duration (sec) Pushing duration (sec)
The time to be transferred to the device designated in depends on the multiplying factor of n, supposing the pushing duration to be τ0 (1 sec unit), and the value of the device actually designated in is as follows.
Applied Instructions (External FX I/O Device)
K0 τ0 ×1
K1 10τ0 ×10
K2 100τ0 ×100
Applied Instructions (External Device (optional device))
You can use such a convenient command.
HOUR The command to issue the ON time of HOUR command by the time added and designated in 1 hour unit.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
![Page 338 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-338.webp?w=400)
13 Applied Instructions (Handy Instruction)
13.5 TTMR / Teaching Timer
Write teaching time in ten data registers. Set values should be preliminarily written in D400 to D409.
OUT_T EN TCoil TValue
OUT_T EN TCoil TValue
Ten timers desired to be set
Timers (T0 to T9) are 100 ms timers, and 1/10 of the teaching data is the actual operation time (in seconds).
OUT_T EN TCoil TValue
Timer selection by digital switch The input of one-digit digital switch connected to X000 to X003 is converted to BIN, and transferred to Z.
Teaching measurement Pushing duration (seconds) of X010 is stored in D300. TTMR EN n
X010 Teaching button restore detection PLF EN ENO
M0 Writing set value of timer The teaching time (D300) is transferred to the setting register (D400Z) for the timer selected by digital switch.
OUT_T (X020, TC0, D400); OUT_T (X021, TC1, D401);
OUT_T (X032, TC9, D409); BIN(M8000, K1X000, Z); TTMR(X010, D300, K0); PLF(X010, M0); MOV(M0, D300, D400Z);


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is the command for creating the off-delay timer, one-shot timer or flicker timer easily.
Beginning bit device to be output [4 points occupied] ARRAY [0..3] OF Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

13 Applied Instructions (Handy Instruction)
13.6 STMR / Special Timer
Command input STMR EN s m
Beginning bit device to be output
d Timer to be used Set value of timer
Off-delay timer, one-shot timer When T10 is assigned in , K100 in m, and M0 in
Command input STMR EN s m
contact is turned OFF.
command contact is changed from ON to OFF.

Flicker The flicker is issued to +1, +2 by preparing the program for turning OFF this command by the b- contact of +3 as shown below. and +3 are occupied.

d T10 K100

13 Applied Instructions (Handy Instruction)
13.6 STMR / Special Timer
Applied Instructions (High Speed Processing)
Off-delay timer One-shot timer Flicker
Applied Instructions (Handy Instruction)
+1 One-shot timer Flicker(a-contact)
Applied Instructions (External FX I/O Device)
However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.7 ALT / Alternate State
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is the command for inverting the bit device (ON to OFF, OFF to ON) when the input is turned ON.



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

13 Applied Instructions (Handy Instruction)
13.7 ALT / Alternate State
1. 16-bit operation(ALT, ALTP)
Alternate output (one stage) Every time the command input is changed from OFF to ON, the bit device designated in is inverted from ON to OFF, from OFF to ON.
Applied Instructions (High Speed Processing)
Command input Command input
ON ON
Frequency dividing output (alternate output (two stages)) By combining and using a plurality of ALTP commands, the frequency can be divided and issued in multiple stages.
Applied Instructions (Handy Instruction)
ON
Applied Instructions (External FX I/O Device)
M0
ON ON
Same device is designated.
ALTP EN ENO
Applied Instructions (External Device (optional device))
ON
Cautions
Applied Instructions (Data Transfer 2)
However, index modifier (V, Z) is not applicable.
Applied Instructions (Floating Point)
X000 ALTP EN ENO
M0
M0
M0
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.7 ALT / Alternate State

5 sec 5 sec 5 sec 5 sec 5 sec 5 sec 5 sec
OUT_T(X006 AND NOT TS2, TC2, K50); ALT(X006 AND TS2,Y007);

OUT(X000 AND NOT M1, M0); OUT(X000); OUT((M0 OR NOT Y000) OR (NOT M0 AND Y000), Y000));


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for obtaining data changing n times when designated between the beginning (initial value) and the end (target value).
RAMP 16 bits Continuous RAMP(EN, s1, s2, n, d);
Device storing initial value of ramp, setting of target value ANY16
Device storing initial value of ramp, setting of target value ANY16
Device storing data of present value of ramp (2 points occupied) ANY16(0..1)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

13 Applied Instructions (Handy Instruction)
13.8 RAMP / Ramp Variable Value



13 Applied Instructions (Handy Instruction)
13.8 RAMP / Ramp Variable Value
2. Operation of mode flag (M8026) In FXU (V1.20 or higher), FX2C, FX2N, FX2NC, FX3U and FX3UC PLCs, by ON/OFF switching of mode flag M8026, the content of +1 is changed as follows. FX0S, FX0, FX0N, FX1S, FX1N, FX3S, FX3G and FX3GC PLCs operate same as when the M8026 is turned ON. FXU (V1.1 or lower) PLC operates same as when the M8026 is turned OFF.
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
(M8029)
Applied Instructions (External FX I/O Device)
→ As for the method of using the command execution complete flag, see paragraph 1.3.4.
After n operation periods, when becoming = , the device is turned ON.
Applied Instructions (External Device (optional device))
M8026*1 RAMP mode See the Operation of mode flag (M8026) explained above.
*1. Cleared when changed from RUN to STOP (applicable only in FX3U, FX3UC, FX2N, FX2NC, FX2C, FXU PLCs).
should be cleared beforehand.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.9 ROTC / Rotary Table Control
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command suited for turning the table by a shortcut route depending on the demanding window when putting on or taking out articles on the rotary table.

ROTC 16 bits Continuous ROTC(EN, s, m1, m2, d);

Data register for counting (3 points occupied) ARRAY [0..2] OF ANY16
Beginning bit device to be driven (8 points occupied) ARRAY [0..7] OF Bit

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


To be set preliminarily by transfer command +1 Setting of calling window number
Internal contact circuit to be driven is preliminarily composed of input signal (X).

13 Applied Instructions (Handy Instruction)
13.9 ROTC / Rotary Table Control
The condition necessary for using this command is as shown in the example below.
and switch X002 for operating when article number 0 comes to window number 0. b) Create sequence program as shown in the example below.

By X000 to X002, you can exchange with internal contacts of to +2. Beginning device number for designating or is arbitrary. d
is a counter for counting article of which number is coming to window number 0.
a) In +1, you can set the window number desired to be called.
b) In +2, you can set the article number desired to be called.
When the above condition is designated, the output of normal/reverse rotation, high speed/low speed/stop will be obtained in the output of +3 to +7 designated in the beginning device of the command.
1. Operation by ON/OFF of command input
However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

13 Applied Instructions (Handy Instruction)
13.10 SORT / SORT Tabulated Data
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This command reshuffles the data table composed of data (columns) and group data (rows) in the ascending order in column unit on the basis of designated group data (rows). In this command, the group data (rows) is stored in continuous devices. Similarly, in SORT2 command, data (columns) is stored in continuous devices, so that the data (columns) may be added easily, and reshuffling is applicable in both ascending order and descending order.
→ As for SORT2 command, see paragraph 19.7.
Applied Instructions (Handy Instruction)
Expression in each language
SORT EN s m1
Applied Instructions (External FX I/O Device)
SORT 16 bits Continuous SORT(EN, s, m1, m2, n, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Beginning device storing data table (m1xm2 points occupied) ANY16
Number of data (columns) ANY16
Number of group data (rows) ANY16
Row of group data (rows) as basis of reshuffling ANY16
ENO Execution state Bit
Beginning device storing arithmetic results (m1 × m2 points occupied) ANY16
Bit Devices Word Devices Others
System user Digit designation System
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Floating Point)
z S1 z z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

13 Applied Instructions (Handy Instruction)
13.10 SORT / SORT Tabulated Data

Beginning device storing data table Beginning device storing operation results Number of data (columns)
Row of group data (rows) as basis of reshuffling

→ As for the method of using the command execution complete flag, see paragraph 1.3.4.


13 Applied Instructions (Handy Instruction)
13.10 SORT / SORT Tabulated Data
Row number 1 2 3 4
number Height Weight Age
1 +5 +10 +15
4 100 20 8
Applied Instructions (High Speed Processing)
2 +1 +6 +11 +16
1 150 45 20
3 +2 +7 +12 +17
5 150 50 45
4 +3 +8 +13 +18
Applied Instructions (Handy Instruction)
3 160 70 30
5 +4 +9 +14 +19
2 180 50 40
Row number 1 2 3 4
Applied Instructions (External FX I/O Device)
number Height Weight Age
1 +5 +10 +15
4 100 20 8
2 +1 +6 +11 +16
1 150 45 20
Applied Instructions (External Device (optional device))
3 +2 +7 +12 +17
2 180 50 40
4 +3 +8 +13 +18
5 150 50 45
5 +4 +9 +14 +19
3 160 70 30
→ As for the method of using the command execution complete flag, see paragraph 1.3.4.
Applied Instructions (Data Transfer 2)
complete To be ON when data arraying is complete.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
This chapter introduces the instructions to receive data from and send data to external devices mainly using inputs and outputs in PLCs.
Instruction name Function Reference
Ten Key Input Section 14.1 DTKY
Hexadecimal Input Section 14.2 DHKY
DSW Digital Switch (Thumbwheel Input) Section 14.3
Seven Segment Decoder Section 14.4 SEGDP
SEGL Seven Segment With Latch Section 14.5
ARWS Arrow Switch Section 14.6
ASC ASCII Code Data Input Section 14.7
PR Print (ASCII Code) Section 14.8
Read From A Special Function Block Section 14.9 FROMP
DFROMP
TO
Write To A Special Function Block Section 14.10 TOP
DTOP


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This is a command for setting data in the timer or counter by the input of numeric keys 0 to 9.
Beginning bit device for entering numeric keys (10 points occupied) ARRAY [0..9] OF Bit
Beginning bit device for turning ON key pushing information (11 points occupied) ARRAY [0..10] OF Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S2 z z z

14 Applied Instructions (External FX I/O Device)
14.1 TKY / Ten Key Input


Beginning bit device for turning ON key pushing information
The diagram below shows an example of FX3U PLC (sync input). As for the wiring, see the manual of each PLC.

5 6 7 8 1 2 3 4 0 9 Numeric key

14 Applied Instructions (External FX I/O Device)
14.1 TKY / Ten Key Input
Applied Instructions (High Speed Processing)
Command input DTKY EN s
Applied Instructions (Handy Instruction)
d1 d2 Beginning bit device for entering numeric key
Word device for storing data
Beginning bit device for turning ON key pushing information
As for numeric key connection example and key pushing information, see the above explanation of 16-bit operation (TKY).
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
X030 TKY EN s
d1 d2 X000 D0
3. Number of bits occupied
Applied Instructions (Data Transfer 2)
- +10: Kept ON while any one of 0 to 9 is being pressed (key sense output).
Applied Instructions (Floating Point)
However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.1 TKY / Ten Key Input
This is an explanation of an example in which the input X000 is the beginning, and numeric keys 0 to 9 are connected.
X030 TKY EN s
d1 d2 X000 D0

S/S X000 X001 X002 X003 X005 X004 X006 X007


14 Applied Instructions (External FX I/O Device)
14.2 HKY / Hexadecimal Input
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This is a command for setting the input data of numerical value (0 to 9) or operation condition (function keys A to F), by the input of keys from 0 to F (16 keys). When the extension function is turned ON, the key input is entered in hexadecimal notation by keys 0 to F.
Expression in each language
Applied Instructions (Handy Instruction)
HKY 16 bits Continuous HKY(EN, s, d1, d2, d3);
Applied Instructions (External FX I/O Device)
DHKY 32 bits Continuous DHKY(EN, s, d1, d2, d3);
Applied Instructions (External Device (optional device))
EN Execution condition Bit
Beginning device for entering 16 keys (X) (4 points occupied) ARRAY [0..3] OF Bit
ENO Execution state Bit
Beginning device for sending output (Y) (4 points occupied) ARRAY [0..3] OF Bit
Device for storing numerical value entered from 16 keys ANY16 ANY32
Beginning bit device for turning ON key pushing information (8 points occupied) ARRAY [0..7] OF Bit
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Floating Point)
z z z S2 S2 z z z
z z z S1 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.2 HKY / Hexadecimal Input
) and the row output (device designated in ) and by pressing keys 0 to 9 is stored in the device designated in , and the key sense output is issued to the device designated in . When any one of keys A to F is pressed, the key pushing information corresponding to the key (device designated in ) is turned ON, and the key sense output (device designated in ) is issued.

Device for storing numerical value entered from 16 keys Beginning bit device for turning ON key pushing information

- The key sense output +6 is turned ON by pressing any one of keys A to F.
) and the row output (device designated in ) and by pressing keys 0 to 9 is stored in the device designated in , and the key sense output is issued to the device designated in . When any one of keys A to F is pressed, the key pushing information corresponding to the key (device designated in ) is turned ON, and the key sense output (device designated in ) is issued.

Device for storing numerical value entered from 16 keys
Beginning bit device for turning ON key pushing information

14 Applied Instructions (External FX I/O Device)
14.2 HKY / Hexadecimal Input
When the extension function is validated by turning ON the M8167, the hexadecimal key pushing data of 0 to F is stored in BIN. Except for the following, this is same as the "function and operation explanation" given above. FXU PLC: V2.30 or lower has no extension function.
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
HKY EN
Applied Instructions (External FX I/O Device)
Beginning device for entering 16 keys
Beginning device to be output
Device for storing numerical value entered from 16 keys
Beginning bit device for turning ON key pushing information
Applied Instructions (External Device (optional device))
DHKY EN
Applied Instructions (Data Transfer 2)
Beginning device for entering 16 keys
Beginning device to be output
Device for storing numerical value entered from 16 keys Beginning bit device for turning ON key pushing information
Applied Instructions (Floating Point)
→ As for the method of using the command execution complete flag, see paragraph 1.3.4.
HEX data handling function of HKY command OFF : numeric key + function key ON : hexadecimal key
M8167 Function extension flag
ON : To be turned ON after one-cycle operation of to +3 output (key scan of 0 to F).
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.2 HKY / Hexadecimal Input
4. Number of bits occupied 1) To occupy 4 points for connecting 16 keys from the beginning device of input (X). 2) To occupy 4 points for connecting 16 keys from the beginning device of output (Y). 3) To occupy 8 points from beginning device for output of key pushing information. Be careful not to overlap with the device used in control of the machine. - to +5 : Key pushing information of keys A to F - +6 : Key sense output of keys A to F. - +7 : Key sense output of keys 0 to 9
However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.

The wiring diagram below is an example of basic unit (sync input/sync output) of FX3U series. For the actual wiring connection, see the manual of the PLC.


14 Applied Instructions (External FX I/O Device)
14.3 DSW / Digital Switch (Thumbwheel Input)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This is a command for reading in the set value of digital switch. You can read in the data of 4 digits and 1 set (n=K1), or 4 digits and 2 sets (n=K2).
Expression in each language
Applied Instructions (Handy Instruction)
DSW EN s n
DSW 16 bits Continuous DSW(EN, s, n, d1, d2);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Beginning device for connecting digital switch (X) (4 points occupied) Bit
Number of sets of digital switch (4 digits/1 set) [n=1 or 2] ANY16
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Beginning device of output of strobe signal (Y) (4 points occupied) ARRAY [0..3] OF Bit
Device for storing numerical value of digital switch (n points occupied) ANY16
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
z z z S1 S2 z z z
S: Refer to "Cautions".
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.3 DSW / Digital Switch (Thumbwheel Input)

d2 Device for storing the numerical value of digital switch
- First set is stored in , and second set in +1.
2) Designation of number of sets n - When using 4 digits and 1 set × 1 (n=K1) Digital switch of 4 digits in BCD connected to to +3 is sequentially read in by strobe signals to +3, and stored in as BIN value. - When using 4 digits and 1 set × 2 (n=K2) Digital switch of 4 digits in BCD connected to to +3 is sequentially read in by strobe signals to +3, and stored in as BIN value.
- Digital switch of 4 digits in BCD connected to +4 to +7 is sequentially read in by strobe signals to +3, and stored in +1 as BIN value.
→ As for the method of using the command execution complete flag, see paragraph 1.3.4.
OFF : Scan continuous or command not executed from to +3.
→ As for the relay output type, refer to the "Method of using by relay output type" shown later.
Device Name Content · M8029 Command execution · complete

14 Applied Instructions (External FX I/O Device)
14.3 DSW / Digital Switch (Thumbwheel Input)
This is an example of explaining connection of digital switch starting from the input X010 and starting from the digit designation output Y010.
DSW(X000, X10, K1, Y10, D0); [Structured ladder/FBD] [ST]
Applied Instructions (High Speed Processing)
X000 DSW EN s n
d1 d2 X10 Y10
Applied Instructions (Handy Instruction)
103 102 101 100
103 102 101 100 Digital switch of BCD
Applied Instructions (External FX I/O Device)
Digital switch of BCD
Diode of 0.1 A, 50 V is needed.
4 3 2 1 To second set 8 4 2 1
Applied Instructions (External Device (optional device))
1 2 4 8
Second set input 24V 0V
S/S X010 X011 X012 X013 X015 X014 X016 X017
COM3 Y010 Y011 Y012 Y013
103 102 101 100
Applied Instructions (Data Transfer 2)
Repeated operation 0.1 sec 0.1 sec 0.1 sec
Y011
0.1 sec
0.1 sec
0.1 sec
Applied Instructions (Floating Point)
Y010 to Y013 are turned ON sequentially in every 100 ms while X000 is being turned ON, and when operation of one cycle is over, the execution complete flag M8029 is set up.
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.3 DSW / Digital Switch (Thumbwheel Input)
LDP EN ENO s X000
SET(LDP(TRUE, X000), M0); DSW(M0, X010, K1, Y010, D0); RST(M8029, M0);
DSW EN s n
D0 K1
M8029
RST EN ENO
M0
[Structured ladder/FBD] · d M0 · d1 d2

14 Applied Instructions (External FX I/O Device)
14.4 SEGD / Seven Segment Decoder
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This is a command for lighting up the 7-segement display unit (1 digit) by decoding the data.
Expression in each language
Applied Instructions (Handy Instruction)
SEGD 16 bits Continuous SEGD(EN, s, d);
SEGDP 16 bits Pulse SEGDP(EN, s, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Beginning word device to be decoded ANY16
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Word device for storing 7-segment display data ANY16
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S1 z
z S1 S1 z z z
S: Refer to "Cautions".
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Command input SEGD EN s
d Word device for storing 7-segment display data Beginning word device to be decoded
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.4 SEGD / Seven Segment Decoder

0 - - 0 0 1
1 0 0 0 1 - - 0 1 1 0
2 0 0 1 0 - - 0 1 0 1 1 0 1 1
3 0 0 1 1 - - 0 1 0 0 1
4 0 1 0 0 - - 0 1 1 0 0 1 1 0
5 0 1 0 1 - - 0 1 1 0 1 1 0 1
6 0 1 1 0 - - 0 1 0 1
7 0 1 1 1 - - 0 0 1 0 0 1 1 1
8 1 0 0 0 - - 0 1
9 1 0 0 1 - - 0 1 1 0 1
A 1 0 1 0 - - 0 1 1 1 0 1 1 1
B 1 0 1 1 - - 0 1 0 0
C 1 1 0 0 - - 0 0 1 1 1 0 0 1
E 1 1 1 0 - - 0 1 0 0 1
F 1 - - 0 1 1 1 0 0 0 1
B0 is the beginning of bit device or the lowest bit of the word device.

14 Applied Instructions (External FX I/O Device)
14.5 SEGL / Seven Segment With Latch
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This is a command for controlling the 7-segment display unit with latch of 4 digits and 1 set or 4 digits and 2 sets.
Expression in each language
Applied Instructions (Handy Instruction)
SEGL EN s n
SEGL 16 bits Continuous SEGL(EN, s, n, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
Applied Instructions (Data Transfer 2)
S: Refer to "Cautions".
Applied Instructions (Floating Point)
Command input SEGL EN
d Word device for BCD operation
Beginning device to be output (Y)
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.5 SEGL / Seven Segment With Latch
→ As for selection of "n", refer to section 14.5.2.

d +2 d +1 d d COM +6 d +5 d +4 d +7 d
→ As for selection of "n", refer to section 14.5.2.
The 4-digit numerical value of is converted from BIN to BCD, and is issued sequentially by time division digit by digit from to +3. The strobe signal output ( +4 to +7} is also issued sequentially by time division, and the 7- segment display of 4 digits and 1 set is latched. b) 4 digits, second set
The 4-digit numerical value of +1 is converted from BIN to BCD, and is issued sequentially by time division digit by digit from +10 to +13. The strobe signal output ( +4 to +7) is also issued sequentially by time division, and the 7- segment display of 4 digits and 2 sets is latched. (The strobe signal output ( +4 to +7) is common in each set.)

14 Applied Instructions (External FX I/O Device)
14.5 SEGL / Seven Segment With Latch
Applied Instructions (High Speed Processing)
+3 d +2 d +1 d d COM +6 d +5 d +4 d +7 d
COM +13 d +12 d +11 d +10 d
100 4 2 8 1
101 102 103
4 2 8 1
103 102 101 100
103 102 101 100
Applied Instructions (Handy Instruction)
V+ 1 2 4 8
1 2 4 8
Applied Instructions (External FX I/O Device)
→ As for the method of using the command execution complete flag, see paragraph 1.3.4.
complete To be turned ON when output of 4 digits is over.
Applied Instructions (External Device (optional device))
3. Number of bits occupied When using 4 digits and 1 set : 1 point is occupied from the beginning device designated in . 8 points are occupied from the beginning device designated in . If the number of digits is smaller, the remainder cannot be used in other application. When using 4 digits and 2 sets: 2 points are occupied from the beginning device designated in . 12 points are occupied from the beginning device designated in . If the number of digits is smaller, the remainder cannot be used in other application.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.5 SEGL / Seven Segment With Latch
You can select the 7-segment display unit depending on the electrical content by referring to the example below.
→ As for the actual wiring, see the hardware manual of the PLC main body.
The value to be set in parameter n varies with the signal logic of 7-segment display. Select in the following procedure. A check column is provided in the final line of the table. Check the corresponding positive or negative logic, and select the parameter accordingly.

Output format Sync output [- common] Source output [+ common]
Because of transistor output (sync), when the internal logic is 1 (ON output), the output is LOW level (0V). This is called the negative logic.
Because of transistor output (source), when the internal logic is 1 (ON output), the output is HIGH level (V+). This is called the positive logic.

Explanation Becoming BCD data at LOW level Becoming BCD data at HIGH level

14 Applied Instructions (External FX I/O Device)
14.5 SEGL / Seven Segment With Latch
Logic Negative logic Positive logic
H
Applied Instructions (High Speed Processing)
H L H L +4 to
H +4 to H
Explanation Data latched at LOW level is held Data latched at HIGH level is held
Applied Instructions (Handy Instruction)
PLC output logic Data input Strobe signal
4 digits × 1 set 4 digits × 2 sets
Applied Instructions (External FX I/O Device)
Negative logic (coinciding) 0 4
Positive logic (not coinciding) 1 5
Negative logic (coinciding) 2 6
Positive logic (not coinciding)
Positive logic (not coinciding) 3 7
Positive logic (coinciding) 0 4
Negative logic (not coinciding) 1 5
Positive logic (coinciding) 2 6
Applied Instructions (External Device (optional device))
Negative logic (not coinciding)
Negative logic (not coinciding) 3 7
Applied Instructions (Data Transfer 2)
PLC output logic Data input Strobe signal
4 digits × 1 set 4 digits × 2 sets
Negative logic (coinciding) 0 4
Positive logic (not coinciding) 1 5
Negative logic (coinciding) 2 6
Positive logic (not coinciding)
Applied Instructions (Floating Point)
Positive logic (not coinciding) 3 7
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.6 ARWS / Arrow Switch
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction enters data by arrow switches for digit move and increase and decrease of numerical value of each digit.

ARWS 16 bits Continuous ARWS(EN, s, n, d1, d2);

Head bit device to be entered (4 points occupied) ARRAY [0..3] OF Bit
Word device in which BCD converted data is stored ANY16
Head bit device (Y) for connecting 7-segment display unit (8 points occupied) ARRAY [0..7] OF Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z z z S2 S2 z z z
S: Refer to "Cautions".
Four arrow switches are connected to the input of the device specified by , the 7-segment display unit with BCD decoder is connected to the output of the device specified by , and the numeric value is entered in the device specified by .

Word device in which BCD converted data is stored

14 Applied Instructions (External FX I/O Device)
14.6 ARWS / Arrow Switch
100 101 102 103
Applied Instructions (High Speed Processing)
Display for selected digit
7-segment display unit 7-segment display unit with latch for visual display of numeric value being set
Applied Instructions (Handy Instruction)
Numeric value output Switch
Applied Instructions (External FX I/O Device)
Carry over Carry down
Applied Instructions (External Device (optional device))
Arrow switch (arrow-mark switch) A switch for selecting each digit and increasing or decreasing the numeric value of selected digit.
- Operation when carry-down switch +2 is ON Every time the switch is pressed, the digit specification changes in the sequence of 103 → 102 → 101 → 100 → 103.
- When carry-over switch +3 is ON Every time the switch is pressed, the digit specification changes in the sequence of 103 →100 → 101 → 102 → 103.
Applied Instructions (Data Transfer 2)
4) Operation of data change switch of digit unit ( , +1) Data changes in the digit specified by the "digit select switch." - Operation when increment input is ON Every time the switch is pressed, the content of changes in the sequence of 0 → 1 → 2 → ... → 8 → 9 → 0 → 1. - Operation when decrement input is ON Every time the switch is pressed, the content of changes in the sequence of 0 → 9 → 8 → 7 ... → 1 → 0 → 9. The content can be displayed in 7-segment display unit. Thus, by a series of operations, desired numeric values can be written into while observing the 7- segment display unit.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.6 ARWS / Arrow Switch
However, index modifier (V, Z) is not applicable. S2: The FX3U and FX3UC PLCs only are applicable.
1. When changing the timer setting and displaying the current value


Operation explanation Every time read/write key is pressed, the read and write LED is changed over and displayed.


M0:= X000; M1:= X001; M2:= X002; M3:= NOT M8000; ALTP(X004, M100); Y014:= NOT M100; Y015:= M100; DSW(Y014 AND X003, X010, K1, Y010, Z); SEGL(Y014, T0Z, K1, Y000); MOVP(Y015, D300Z, D511); ARWS(Y015, M0, K1, D511, Y000); MOVP(Y015 AND X003, D511, D300Z);
4 digits, 1 set TOZ → 7-segment negative logic
(M0 to M3) → (D511) → (Y000 to Y007) → 7-segment 1 digit, 1 set

14 Applied Instructions (External FX I/O Device)
14.7 ASC / ASCII Code Data Input
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the 1-byte alphanumeric character string into ASCII code. This is used when selecting and displaying plural messages in the external display unit.


1-byte alphanumerics of 8 characters entered from personal computer String(8)

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

Higher 8 bits Lower 8 bits
d 1-byte alphanumerics of 8 characters entered from personal computer
46 (F) 45 (E)
48 (H) 47 (G)
+2 · +3

14 Applied Instructions (External FX I/O Device)
14.7 ASC / ASCII Code Data Input
When the extension function is validated by turning ON M8161, the 1-byte alphanumeric character string of the device specified by is converted into ASCII code, and sequentially transferred into the device specified by only in the lower 8 bits (1 byte). The extension function is not available when FXU PLC is V2.30 or earlier.
Applied Instructions (High Speed Processing)
d 1-byte alphanumerics of 8 characters entered from personal computer
Head device for storing ASCII code
M8161
Applied Instructions (Handy Instruction)
Higher 8 bits are H00.
Higher 8 bits Lower 8 bits Character string
Applied Instructions (External FX I/O Device)
+2 00 43 C
+4 00 45 E
+5 00 46 F
+6 00 47 G
Applied Instructions (External Device (optional device))
Related devices
8-bit processing mode of ASC, RS, ASCI, HEX, CCD instruction OFF : Every 2 characters are stored in the sequence of lower 8 bits, higher 8 bits (2 characters/
M8161 Function extension flag
word). ON : Characters are stored in lower 8 bits character by character (1 character/word).
1. Number of bits occupied in device
Applied Instructions (Data Transfer 2)
- The device specified by occpies 4 bits.
- The device specified by occpies 8 bits.
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
Command input · ASC EN s · Device Name Content

14 Applied Instructions (External FX I/O Device)
14.8 PR / Print (ASCII Code)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction performs parallel output of ASCII code data to the output (Y).


Head device for storing data of ASCII code. String
Head device for output data of ASCII code. Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
Command input PR EN s
d Head device for storing data of ASCII code.
Head device for output data of ASCII code.
The following timing chart explains the ASCII code stored in the device specified by . The transmission sequence begins from ="A", and ends with +7="H", and 8 bytes are transmitted in total.
+1 +2 +3 +4 +5 +6 +7

14 Applied Instructions (External FX I/O Device)
14.8 PR / Print (ASCII Code)
s1
+1 +2 +3 +7
to +7 Data d d
Applied Instructions (High Speed Processing)
T0: Scan time (ms)
+9 Execution busy flag
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
1. 16-byte serial output By ON/OFF control of special auxiliary relay M8027, the number of characters of output varies in every two times of instruction drive. In the case of M8027=OFF, the operation is 8-byte serial output (fixed in 8 characters), and in the case of M8027=ON, it is 16-byte serial output (1 to 16 characters). An example of display of 16 characters or less (1 character/byte) is explained by referring to a display device (example: A6FD type external display unit*1). The display data is supposed to be stored in hexadecimal code in D300 to D307.
Applied Instructions (External Device (optional device))
Y033 COM1 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027 COM2 Y030
Applied Instructions (Data Transfer 2)
AC100/200V
COM
D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7
AC AC
Applied Instructions (Floating Point)
A6FD type external display unit *1
*1. A6FD type external display unit is out of production since November 2002.
Applied Instructions (Positioning Control)
Command input · +8 Strobe · ~

14 Applied Instructions (External FX I/O Device)
14.8 PR / Print (ASCII Code)

* If H00 (NUL code) exists in the data (in 16 characters), one character before H00 (NUL code) is the end character.
M8027*1 PR mode OFF : 8-byte serial output (fixed in 8 characters) ON : 16-byte serial output (1 to 16 characters)
*1. Cleared when changed from RUN to STOP.
one cycle is over, the execution is terminated. M8029 operates only when M8027=ON. Command input=OFF:All outputs are OFF.
Device Name Content

14 Applied Instructions (External FX I/O Device)
14.9 FROM / Read From A Special Function Block
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction reads out the content of buffer memory (BFM) of special extension unit/block to the PLC. If a large quantity of buffer memory (BFM) data is read out in batch by using this instruction, a watchdog timer error may occur. When there is no bad influence for the control if the data is divided and read out, you can use RBFM instruction.
Applied Instructions (Handy Instruction)
Expression in each language
FROM EN n1 n2
FROM 16 bits Continuous FROM(EN, n1, n2, n3, d);
Applied Instructions (External FX I/O Device)
FROMP EN n1 n2
FROMP 16 bits Pulse FROMP(EN, n1, n2, n3, d);
Applied Instructions (External Device (optional device))
DFROM EN n1 n2
DFROM 32 bits Continuous DFROM(EN, n1, n2, n3, d);
DFROMP EN n1 n2
DFROMP 32 bits Pulse DFROMP(EN, n1, n2, n3, d);
Applied Instructions (Data Transfer 2)
EN Execution condition Bit
Applied Instructions (Floating Point)
Unit No. of special extension unit/block ANY16 ANY32*1
Transfer origin buffer memory (BFM) number ANY16 ANY32*1
Number of transfer points ANY16 ANY32*1
ENO Execution state Bit
*1. In the case of FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC series, the data type of DFROM, DFROMP of 32-bit operation is ANY16.
Applied Instructions (Positioning Control)

14 Applied Instructions (External FX I/O Device)
14.9 FROM / Read From A Special Function Block
Bit Devices Word Devices Others
System user Digit designation System user Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S1 z z
S1 S1 z z
S1 S1 z z
z S1 z z z
S: Refer to "Cautions".
From special extension (BFM) to PLC (word device) 16-bit data of n3 points starting from buffer memory (BFM) n2 in the special extension unit/block of unit number n1 is transferred (read out) by the portion of n3 points starting from the device specified by in the PLC.
Command input FROM EN
Transfer destination device Unit No. of special extension unit/block Transfer origin buffer memory (BFM) number
Number of transfer points
From special extension (BFM) to PLC (word device) 32-bit data of n3 points starting from buffer memory (BFM) [n2+1, n2] in the special extension unit/block of unit number n1 is transferred (read out) by the portion of n3 points starting from the device specified by in the PLC.
Command input DFROM EN
Transfer destination device Unit No. of special extension unit/block Transfer origin buffer memory (BFM) number
Number of transfer points
Prohibit/permit interruption during execution of FROM/TO instruction.
→ As for the detail, refer to the following pages "Interrupt accept during
M8028 Interrupt permit flag

14 Applied Instructions (External FX I/O Device)
14.9 FROM / Read From A Special Function Block
Applied Instructions (High Speed Processing)
By using direct specification*1 of FROM instruction or buffer memory, you can transfer (read out) the content of buffer memory (BFM) of special extension unit/block to the digit specification of data register (D), extension register (R), or auxiliary relay (M).
Applied Instructions (Handy Instruction)
*1. FX3U, FX3UC PLCs only are available. Example) Program for reading out BFM#4 (abnormal station information) of CC-Link/LT master (unit No. 0
fixed) built in FX3UC-32MT-LT(-2) to D0. - In the case of FROM instruction
Applied Instructions (External FX I/O Device)
X001 FROM EN n1 n2
K0 K4
K1
Applied Instructions (External Device (optional device))
Number of transfer points
BFM #4 Unit No. 0
- In the case of MOV instruction
MOV(M8000, U0¥G4, D0);
U0¥G4
Unit No. 0 BFM #4
Program for reading out BFM#0 to #3 (remote station connection information) of CC-Link/LT master (unit No. 0 fixed) built in FX3UC-32MT-LT(-2) to D10 to D13. - In the case of FROM instruction
Applied Instructions (Data Transfer 2)
M0
FROMP EN n1 n2
K0 K0
Applied Instructions (Floating Point)
Number of transfer points
Unit No. 0
- In the case of BMOV instruction
M0 BMOV EN s n
K4
Applied Instructions (Positioning Control)
Number of transfer points
Unit No. 0 BFM #0

14 Applied Instructions (External FX I/O Device)
14.9 FROM / Read From A Special Function Block
Specification content of operand
Unit No. 0 built-in CC-Link/LT
Unit No. 1
Unit No. 2
Unit No. 3
The unit number is assigned automatically to the special extension unit/block connected to the PLC. The unit number is given from the one closest to the basic unit in the sequence of No. 0, No. 1, No.2, etc. In the case of the FX3UC-32MT-LT(-2) PLC, since the CC-Link/LT master is built in, the unit number is given from the one closest to the basic unit in the sequence of No. 1, No.2, No. 3, etc.
BFM #10 BFM #9 Lower 16 bits Higher 16 bits
Specified BFM number ←
Number of transfer words is specified by n3. "n =2" in a 16-bit instruction indicates the same meaning with "n = 1" in a 32-bit instruction.
Specified device Specified BFM
Specified device Specified BFM
BFM #5
D100 D101 D102 D103
BFM #5 #6 #7 #8
#6 #7 #8 #9
16-bit operation when n=5 32-bit operation when n=2
Applicable to the FXU (at Ver. 2.30 or later), FX2C, FX2N, FX2NC, FX3G, FX3GC, FX3U and FX3UC PLCs only.

14 Applied Instructions (External FX I/O Device)
14.9 FROM / Read From A Special Function Block
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
→ As for BFM divided reading [RBFM], refer to section 31.1.
→ As for BFM divided writing [WBFM], refer to section 31.2.
Applied Instructions (External FX I/O Device)
Watchdog timer time 300ms 0
Applied Instructions (External Device (optional device))
Watchdog timer refresh When WDT instruction is not programmed, the value of D8000 is valid during END process.
As for the connection method of special extension unit/block, the number of units allowed to be connected, and handling of input and output numbers, please refer to the manual of the PLC main body or the manual of each special extension unit/block.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
MOV EN s · Initial pulse

14 Applied Instructions (External FX I/O Device)
14.10 TO / Write To A Special Function Block
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes data from PLC into the buffer memory (BFM) of special extension unit/block. By this instruction, when data is written into multiple buffer memories (BFM) in batch a watchdog timer error may occur. When there is no bad influence for the control if the data is divided and written in, you can use WBFM instruction.

TO 16 bits Continuous TO(EN, s, n1, n2, n3);
TOP 16 bits Pulse TOP(EN, s, n1, n2, n3);
DTO 32 bits Continuous DTO(EN, s, n1, n2, n3);
DTOP 32 bits Pulse DTOP(EN, s, n1, n2, n3);

Unit No. of special extension unit/block (Sequentially from the right side of basic unit, K0 to K7) ANY16 ANY32*1
Transfer destination buffer memory (BFM) number ANY16 ANY32*1
*1. In the case of FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC series, the data type of DTO, DTOP of 32-bit operation is ANY16.

14 Applied Instructions (External FX I/O Device)
14.10 TO / Write To A Special Function Block
Bit Devices Word Devices Others
System user Digit designation System user Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 z
Applied Instructions (High Speed Processing)
S1 S1 z z
S1 S1 z z
S1 S1 z z
S: Refer to "Cautions".
Applied Instructions (Handy Instruction)
From PLC (word device) to special extension (BFM) You can transfer (write) 16-bit data for the portion of n3 points starting from buffer memory (BFM) n2 in special extension unit/block of unit number n1, and for the portion of n3 points starting from the device specified by in PLC.
Applied Instructions (External FX I/O Device)
Command input TO EN
Transfer source data or device
Applied Instructions (External Device (optional device))
Unit No. of special extension unit/block
Transfer destination buffer memory (BFM) number
n3 Number of transfer points
From PLC (word device) to special extension (BFM) You can transfer (write) 32-bit data for the portion of n3 points starting from buffer memory (BFM) [n2+1, n2] in special extension unit/block of unit number n1, and for the portion of n3 points starting from the device specified by in PLC.
Applied Instructions (Data Transfer 2)
Command input DTO EN
Transfer source data or device
Unit No. of special extension unit/block
Applied Instructions (Floating Point)
Transfer destination buffer memory (BFM) number
n3 Number of transfer points
Prohibit/permit interruption during execution of FROM/TO instruction.
→ As for detail, refer to Subsection 14.8.1 "Interrupt accept during
M8028 Interrupt permit flag
Applied Instructions (Positioning Control)
![Page 390 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST] MOVP(M1, H0, U0¥G27); M1](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-390.webp?w=400)
14 Applied Instructions (External FX I/O Device)
14.10 TO / Write To A Special Function Block
By using direct specification*1 of TO instruction or buffer memory, you can write in (transfer) the digit specification of data register (D), extension register (R), or auxiliary relay (M) or constants (K, H) to the buffer memory (BFM) of special extension unit/block.
*1. The FX3U and FX3UC PLCs only are available.
Example) Program for writing "H0" in BFM #27 (instruction) of CC-Link/LT master (unit No. 0 fixed) built in the
FX3UC-32MT-LT(-2). - In the case of TO instruction
M1
H0 K0 K27
K1
- In the case of MOV instruction
U0¥G27 H0

15 Applied Instructions (External Device (optional device))
This chapter introduces the instructions for special adapters mainly connected to serial ports.
Applied Instructions (High Speed Processing)
Instruction name Function Reference
RS Serial Communication Section 15.1
Parallel Run (Octal Mode) Section 15.2 PRUNP
DPRUNP
Applied Instructions (Handy Instruction)
Hexadecimal to ASCII Conversion Section 15.3 ASCIP
ASCII to Hexadecimal Conversion Section 15.4 HEXP
Check Code Section 15.5 CCDP
Applied Instructions (External FX I/O Device)
Volume Read Section 15.6 VRRDP
Volume Scale Section 15.7 VRSCP
RS2 Serial Communication 2 Section 15.8
PID PID Control Loop Section 15.9
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.1 RS / Serial Communication
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction sends and receives data in no-protocol communication by way of a serial port (only the ch1) in accordance with RS-232C or RS-485 provided in the main unit.

RS 16 bits Continuous RS(EN, s, m, n, d);

Number of bytes of data to be sent ANY16
Head device storing received data when receiving is completed ANY16

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

15 Applied Instructions (External Device (optional device))
15.1 RS / Serial Communication
→ For detailed explanation, refer to the Data Communication Edition manual.
Applied Instructions (High Speed Processing)
Command input RS EN
Head device storing data to be sent
Head device storing received data when receiving is completed
Number of bytes of data to be sent
n Number of bytes to be received
Applied Instructions (Handy Instruction)
→ For detailed explanation, refer to the Data Communication Edition manual.
Device Name Device Name
Applied Instructions (External FX I/O Device)
M8063 Serial communication error 1 D8120 Communication format setting
M8121 Sending wait flag D8122 Remaining number of data to be sent
M8122 Sending request D8123 Monitor for number of received data
M8123 Receiving complete flag D8124 Header
M8124*1 Carrier detection flag D8125 Terminator
M8129*2 Time-out check flag D8129*2 Time-out time setting
Applied Instructions (External Device (optional device))
M8161 8-bit processing mode D8063 Error code number of serial communication error 1
D8405*3 Communication parameter display
D8419*3 Operation mode display
*1. Not supported by the FX0N PLC.
*2. The FXU, FX2C PLCs are applicable at Ver.3.30 or later.
*3. Not supported by the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.
To use this instruction, it is necessary to attach one of the products shown in the table below to the main unit.
→ For the system configuration, refer to the respective PLC Hardware Edition manual.
→ For detailed explanation, refer to the Data Communication Edition manual.
Applied Instructions (Data Transfer 2)
RS2 instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.
Item RS2 instruction RS instruction Remarks
Header size 1 to 4 characters (bytes) Up to 1 character (byte) For the RS2 instruction, up to 4 characters (bytes) can be specified as a header or terminator. Terminator size 1 to 4 characters (bytes) Up to 1 character (byte)
Applied Instructions (Floating Point)
For the RS2 instruction, the check sum can be automatically attached to the sent and received data. In this case, however, make sure to use a terminator with the communication frame to be sent and received.
The check sum should be attached by a user program.
Attachment of check sum
The check sum can be automatically attached.
For the RS2 instruction: Ch0 is available only in FX3G and FX3GC PLCs. Ch2 is not available in FX3G PLC (14-point and 24-point type) and FX3S PLCs.
Used channel number ch0, ch1, ch2 ch1
Applied Instructions (Positioning Control)
s · m

15 Applied Instructions (External Device (optional device))
15.1 RS / Serial Communication
→ For other cautions, refer to the Data Communication Edition manual.
- "IVCK*2, IVDR*2, IVRD*2, IVWR*2, IVBWR*3 or IVMC*2" instruction
- "ADPRW*2" instruction
- "FLCRT*3, FLDEL*3, FLWR*3, FLRD*3, FLCMD*3 or FLSTRD*3" instruction
m, n: 0 to 4096 points (However, "m + n" should not be more than 8000 points in FX2N and FX2NC PLCs.) b) For FX0N, FX1S, FX1N, FX1NC, FXU and FX2C PLCs
*1. Ch0 is available only in FX3G and FX3GC PLCs. Ch2 is not available in FX3G PLC (14-point and 24-point type) and FX3S PLCs.
*2. The instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N and FX2NC PLCs.
*3. The instruction is not provided in the FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G and FX3GC PLCs.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction handles the device number specified by and specified by digits as octal number, and transfers data.
Specification of digits (the lowest digit of specified device number is 0.) ANY16 ANY32
Transfer destination device (the lowest digit of specified device number is 0.) ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

15 Applied Instructions (External Device (optional device))
15.2 PRUN / Parallel Run (Octal Mode)
1. 16-bit operation(PRUN, PRUNP)

X000 ~ X017 → M0 ~ M7, M10 ~ M17
X17 X16 X15 X14 X13 X12 X11 X10 X7 X6 X5 X4 X3 X2 X1 X0
M15 M14 M13 M12 M11 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M17 M16 M10

M0 ~ M7, M10 ~ M17 → Y0 ~ Y17 Command input PRUN EN s
M15 M14 M13 M12 M11 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0 M17 M16 M10
Y17 Y16 Y15 Y14 Y13 Y12 Y11 Y10 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0

X000 ~ X027 → M0 ~ M7, M10 ~ M17, M20 ~ M27

M0 ~ M7, M10 ~ M17, M20 ~ M27 →Y000 ~ Y027

15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction converts HEX code into ASCII code. Also available are BINDA instruction for converting BIN data into ASCII code, and DESTR instruction for converting binary floating decimal point data into ASCII code.
→ As for BINDA instruction, refer to section 29.6. → As for DESTR instruction, refer to section 18.4.
Applied Instructions (Handy Instruction)
Expression in each language
ASCI 16 bits Continuous ASCI(EN, s, n, d);
Applied Instructions (External FX I/O Device)
ASCIP 16 bits Pulse ASCIP(EN, s, n, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Head device in which HEX code to be converted is stored ANY16
Number of characters in HEX code to be converted (number of digits) ANY16
ENO Execution state Bit
Head device for storing converted ASCII code ANY16
Bit Devices Word Devices Others
System User Digit designation System User Special
Unit Index Con stant
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
S1 S2 z z
z S2 S3 z
S: Refer to "Cautions".
Applied Instructions (Floating Point)
1. 16-bit operation(ASCI/ASCIP)
Of the HEX code stored after the device specified by , n characters (digits) are converted into ASCII code, and stored in the device after the one specified by . In this instruction, the mode usable when converting includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.
Head device in which HEX code to be converted is stored
Head device for storing converted ASCII code
Applied Instructions (Positioning Control)
Number of characters in HEX code to be converted (number of digits)

15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
Each digit of HEX data stored after the device specified by is converted into ASCII code, and transferred to lower and higher 8 bits (bytes) each in each device after the one specified by . The number of digits (characters) to be converted is specified by n. The device specified by is divided into lower 8 bits and higher 8 bits, and ASCII data is stored. M8161 is used commonly with RS, HEX, CCD, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Head device in which HEX code to be converted is stored
Number of characters in HEX code to be converted (number of digits)
Operation In the case of the program shown below, the conversion is executed as follows.

Devices after (D100)=0ABCH (D101)=1234H (D102)=5678H

K1 K2 K3 K4 K5 K6 K7 K8 K9
D 200 lower C) B) A) 0) 4) 3) 2) 1) 8)
D 200 higher C) B) A) 0) 4) 3) 2) 1)
D 201 lower C) B) A) 0) 4) 3) 2)
D 201 higher C) B) A) 0) 4) 3)

15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
0 0 1 0 1 0 1 0 1 0 D 100=ABCH
0)=30H A)=41H B)=42H C)=43H
1)=31H 2)=32H 3)=33H 4)=34H
5)=35H 6)=36H 7)=37H 8)=38H
0 1 1 0 0 1 0 1 0
Applied Instructions (High Speed Processing)
0 1 0 1 0 1 1 0 1 0
B) 42H
Applied Instructions (Handy Instruction)
Each digit of HEX data stored after the device specified by is converted into ASCII, and stored in lower 8 bits (bytes) in each device after the one specified by . The number of digits (characters) to be converted is specified by n. In the device specified by , higher 8 bits are 0. M8161 is used commonly with RS, HEX, CCD, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.
Applied Instructions (External FX I/O Device)
When M8161=ON, 8-bit mode is established, and the conversion is executed as follows.
Applied Instructions (External Device (optional device))
Head device in which HEX code to be converted is stored
Head device for storing converted ASCII code
Number of characters in HEX code to be converted (number of digits)
Operation In the case of the program shown below, the conversion is executed as follows.
Applied Instructions (Data Transfer 2)
X10 ASCI EN s
d n D100 D200 K4
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.3 ASCI / Hexadecimal to ASCII Conversion
Devices after (D100)=0ABCH (D101)=1234H (D102)=5678H

K1 K2 K3 K4 K5 K6 K7 K8 K9
D 200 C) B) A) 0) 4) 3) 2) 1) 8)
D 201 C) B) A) 0) 4) 3) 2) 1)
D 202 C) B) A) 0) 4) 3) 2)

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

15 Applied Instructions (External Device (optional device))
15.4 HEX / ASCII to Hexadecimal Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction converts ASCII code into HEX code. Also available are DABIN instruction for converting ASCII code into BIN data, and DEVAL instruction for converting ASCII code into binary floating decimal point data.
→ As for DABIN instruction, refer to section 29.5. → As for DEVAL instruction, refer to section 18.5.
Applied Instructions (Handy Instruction)
Expression in each language
HEX 16 bits Continuous HEX(EN, s, n, d);
Applied Instructions (External FX I/O Device)
HEXP 16 bits Pulse HEXP(EN, s, n, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Head device in which ASCII code to be converted is stored ANY16
Number of characters in ASCII code to be converted (number of bytes) ANY16
ENO Execution state Bit
Head device for storing converted HEX code ANY16
Bit Devices Word Devices Others
System User Digit designation System User Special
Unit Index Con stant
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z z z
S1 S2 z z
z S2 S3 z z z
S: Refer to "Cautions".
Applied Instructions (Floating Point)
1. 16-bit operation(HEX/HEXP)
Of the ASCII code stored after the device specified by , n characters are converted into HEX code, and stored in the device after the one specified by . In this instruction, the mode usable when converting includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.
Head device in which ASCII code to be converted is stored
Head device for storing converted HEX code
Applied Instructions (Positioning Control)
Number of characters in ASCII code to be converted (number of bytes)

15 Applied Instructions (External Device (optional device))
15.4 HEX / ASCII to Hexadecimal Conversion
ASCII characters stored in higher and lower 8 bits (bytes) in the device specified by are converted into HEX data, and transferred to the device specified by in every four digits. The number of characters to be converted is specified by n. M8161 is used commonly with RS, ASCI, CCD, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Head device in which ASCII code to be converted is stored
Number of characters in ASCII code to be converted (number of bytes)
Operation In the case of the program shown below, the conversion is executed as follows.



15 Applied Instructions (External Device (optional device))
15.4 HEX / ASCII to Hexadecimal Conversion
Number of characters specified and result of conversion "." is 0.
D 102 D 101 D 100
...0H
41H
A) 0)
30H
2 ..0AH
Applied Instructions (High Speed Processing)
4 0ABCH
43H
B) C)
42H
5 ...0H ABC1H
6 ..0AH BC12H
7 .0ABH C123H
0 A B C
8 0ABCH 1234H
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
ASCII characters stored in lower 8 bits in are converted into HEX data, and transferred to in every four digits. The number of characters to be converted is specified by n. M8161 is used commonly with RS, ASCI, CCD, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.
Applied Instructions (External Device (optional device))
Ignored Lower 8 bits
Head device in which ASCII code to be converted is stored
Head device for storing converted HEX code
Number of characters in ASCII code to be converted (number of bytes)
Applied Instructions (Data Transfer 2)
Operation In the case of the program shown below, the conversion is executed as follows.
Applied Instructions (Floating Point)
X010 HEX EN s
d n D200 D100 K4
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.4 HEX / ASCII to Hexadecimal Conversion

Number of characters specified and result of conversion "." is 0.


15 Applied Instructions (External Device (optional device))
15.5 CCD / Check Code
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction calculates the horizontal parity value or check sum value of error check method used in communication or the like. The error check method also includes cyclic redundancy check (CRC). Use the CRC instruction when determining the CRC value.
→ As for CRC instruction, refer to section 24.4. → As for complementary number [NEG instruction], refer to section 9.10.
Applied Instructions (Handy Instruction)
Expression in each language
CCD 16 bits Continuous CCD(EN, s, n, d);
Applied Instructions (External FX I/O Device)
CCDP 16 bits Pulse CCDP(EN, s, n, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Head object device ANY16
Number of data (n=1 to 256) ANY16
ENO Execution state Bit
Head storage destination device of calculated data (2 points occupied) ARRAY [0..1] OF ANY16
Bit Devices Word Devices Others
System User Digit designation System User Special
Unit Index Con stant
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 z z
z S1 z
Applied Instructions (Floating Point)
S: Refer to "Cautions".
1. 16-bit operation(CCD/CCDP)
The addition data and horizontal parity of the data stored in the device specified by are calculated, and the addition data and the horizontal parity are stored in the device specified by . In this instruction, the mode usable when calculating includes 16-bit mode and 8-bit mode. As for the operation of each mode, refer to the following pages.
Applied Instructions (Positioning Control)
Head storage destination device of calculated data

15 Applied Instructions (External Device (optional device))
15.5 CCD / Check Code
Of the data of n points starting from the device specified by , the addition data and the horizontal parity data of higher and lower 8 bits are stored in the device specified by . M8161 is used commonly with RS, ASCI, HEX, CRC instructions. When using in 16 bits, you must keep always OFF. M8161 is cleared when changed from RUN to STOP.

Head object device Head storage destination device of calculated data Number of data
Example of 16-bit conversion In the case of the program shown below, the conversion is executed as follows.


Horizontal parity 1000010 ←When the number of "1" is an odd number, the horizontal parity is 1.
When the number of "1" is an even number, the horizontal parity is 0.
1 1 0 1 0 0 0 1 0 D 0 1091 in BCD.
Horizontal parity 1 0 1 0 1 0 D 1

15 Applied Instructions (External Device (optional device))
15.5 CCD / Check Code
Of the data of n points (lower 8 bits only) starting from the device specified by , the addition data and the horizontal parity data are stored in the device specified by . M8161 is used commonly with RS, ASCI, HEX, CRC instructions. When using in 8 bits, you must keep always ON. M8161 is cleared when changed from RUN to STOP.
Applied Instructions (High Speed Processing)
Ignored Lower 8 bits
Applied Instructions (Handy Instruction)
Head storage destination device of calculated data
Example of 8-bit conversion In the case of the program shown below, the conversion is executed as follows.
Applied Instructions (External FX I/O Device)
X010 CCD EN s
Applied Instructions (External Device (optional device))
Example of data content
D 101 K111 = 0110111 ←
D 102 K100 = 01100100 D 103 K 98 = 01100010
D 105 K 66 = 01000010 D 106 K100 = 01100100
D 108 K210 = 11010010 D 109 K 88 = 01011000
Applied Instructions (Data Transfer 2)
Horizontal parity 1000010 ← When the number of "1" is an odd number, the horizontal parity is 1. When the number of "1" is an even number, the horizontal parity is 0.
Applied Instructions (Floating Point)
1 1 0 1 0 0 0 1 0 D 0 1091 in BCD.
1 0 1 0 1 0 D 1 Horizontal parity
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.6 VRRD / Volume Read
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads out the value determined by the variable resistor.



X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 z z z
S: Refer to "Cautions".
The analog value of variable resistor No. is converted into BIN 8 bits, and 0 to 255 are transferred to D0. As an application example, D0 is used as timer preset value. The analog timer is obtained by this operation. As the timer constant value, if a value of more than 256 is necessary, the product of take-in value multiplied by the constant by MUL instruction is set indirectly as the timer constant.
X000 VRRD EN s
OUT_T EN TCoil TValue

15 Applied Instructions (External Device (optional device))
15.6 VRRD / Volume Read
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
→ For details, refer to the Communication Control Edition manual.
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.6 VRRD / Volume Read
Variable resistor values are read out sequentially. Depending on variable resistors VR0 to VR7, the specified values of VRRD instruction are K0 to K7. In the example below, being decorated by index (Z = 0 to 7), K0Z is K0 to K7.
Reset of index register (Z) = 0
Z
Range of FOR to NEXT is repeated 8 times.
Variable resistor value is stored in data register.
FOR instruction is repeated 8 times as specified. In this period, the value of index register Z is increased sequentially from 0 to 1, 2, ..., 7, and the value is transferred 8 times, from VR0 to D200, VR1 to D201,..., VR7 to D20
M8000 VRRD EN s
(Z)+1
(Z)
NEXT EN ENO
OUT_T EN TCoil TValue
TS0
Y000
This is a timer circuit. Depending on graduations 0 to 10 of the variable resistor, values of 0 to 255 are stored in the data register. T0 to T7 are 100 ms timers, and 0 to 25.5 sec are obtained corresponding to the set values of 0 to 255.
OUT_T EN TCoil TValue
TS1
Y001
OUT_T EN TCoil TValue
TS7
Y007
[ ST ]
RST(M8000, Z); FOR(TRUE, K8); VRRD(M8000, K0Z, D200Z); INC(M8000, Z); NEXT(TRUE); OUT_T(X000, TC0, D200); OUT(TS0, Y000); OUT_T(X001, TC1, D201); OUT(TS1, Y001);

15 Applied Instructions (External Device (optional device))
15.7 VRSC / Volume Scale
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction reads out the value determined in the variable resistor graduations.
Expression in each language
Applied Instructions (Handy Instruction)
VRRD 16 bits Continuous VRSC(EN, s, d);
VRRDP 16 bits Pulse VRSCP(EN, s, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Variable resistor number for reading out the graduations ANY16
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Storage destination of variable resistor graduations ANY16
Bit Devices Word Devices Others
System User Digit designation System User Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S1 S2 z z z
z S2 z z z
S: Refer to "Cautions".
Applied Instructions (Data Transfer 2)
This instruction reads the value of a variable analog potentiometer on the variable analog potentiometer board attached to the main unit as a numeric value in the range from 0 to 10. However, the actual scale value does not always correspond to the switching position of the variable analog potentiometer scale (0 to 10). This instruction converts into a binary value the scale value of a variable analog potentiometer specified in , and transfers the converted binary value to .
d D1 s K1
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.7 VRSC / Volume Scale
→ For details, refer to the Communication Control Edition manual.
This is an example of use as rotary switch. Depending on variable resistor graduations 0 to 10, any one of auxiliary relays M0 to M10 is turned ON. By DECO instruction, the auxiliary relays are occupied from M0 to M15.
X000 VRSC EN ENO
VRSC(X000, K1, D1); DECO(X001, D1, K4, M0); OUT(M0, ···); OUT(M1, ···);
DECO EN s n
D1 K4 d M0
ON at graduation 0
ON at graduation 1
ON at graduation 10
[Structured ladder/FBD] · s K1 · d D1

15 Applied Instructions (External Device (optional device))
15.8 RS2 / Serial Communication 2
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction transmits and receives data by no-procedure communication via serial port of RS-232C or RS-485 installed in the basic unit. In the case of FX3G and FX3GC PLCs, data can be transmitted and received by no-procedure communication also via standard built-in port (RS-422).
Applied Instructions (Handy Instruction)
Expression in each language
RS2 16 bits Continuous RS2(EN, s, m, n, n1, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Applied Instructions (External Device (optional device))
Head device in which transmission data is stored
Number of transmission data bytes [Setting range: 0 to 4096] ANY16
Number of reception data bytes [Setting range: 0 to 4096] ANY16
ENO Execution state Bit
Head device for storing reception data upon completion of reception
*1. Rounding up below the decimal point
*2. Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System User Digit designation System
Applied Instructions (Floating Point)
M KnS T C D R U \G V Z Modifier K H E " " P
z S1 z
z S1 z z
z S1 z z
z S1 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

15 Applied Instructions (External Device (optional device))
15.8 RS2 / Serial Communication 2
→ As for the detailed explanation, refer to the communication control manual.
Command input RS2 EN
d Head device in which transmission data is stored
Head device for storing reception data upon completion of reception
Number of transmission data bytes
Number of reception data bytes
→ As for the detailed explanation, refer to the communication control manual.
Name ch0*1 ch1 ch2*1 ch0*1 ch1 ch2*1
M8371 M8401 M8421 Transmission waiting flag*2 D8370 D8400 D8420 Communication format setting
M8372 M8402 M8422 Transmission request*2 -
M8373 M8403 M8423 Reception complete flag*2 D8372 D8402 D8422 Transmission data remainder points*2
- M8404 M8424 Carrier detection flag D8373 D8403 D8423 Reception points monitor*2
- M8405 M8425 Data set ready (DSR) flag*3 - D8405 D8425 Communication parameter display
- D8379 D8409 D8429 Time out time setting
M8379 M8409 M8429 Time out judging flag D8380 D8410 D8430 Headers 1, 2
D8381 D8411 D8431 Headers 3, 4
D8382 D8412 D8432 Terminators 1, 2
D8383 D8413 D8433 Terminators 3, 4
-
D8384 D8414 D8434 Reception sum (reception data)
D8385 D8415 D8435 Reception sum (calculation result)
D8386 D8416 D8436 Transmission sum
D8389 D8419 D8439 Operation mode display
M8062 M8063 M8438 Serial communication error*4 D8062 D8063 D8438 Error code number of serial
*1. Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.
*2. Cleared when changed from RUN to STOP.
*3. The FX3U, FX3UC PLCs are applicable at Ver.2.30 or later.
*4. Cleared when PLC power supply is turned from OFF to ON.

15 Applied Instructions (External Device (optional device))
15.8 RS2 / Serial Communication 2
In order to use this instruction, you must install any one of the following products in the basic unit.
→ As for the system configuration, refer to the hardware manual of the corresponding
PLC main unit. → As for the detailed explanation, refer to the communication control manual.
PLC Type of communication Option
RS-232C communication FX3U-232-BD or FX3U-232ADP(-MB)
Applied Instructions (High Speed Processing)
RS-485 communication FX3U-485-BD or FX3U-485ADP(-MB)
RS-232C communication FX3U-232ADP(-MB)
RS-485 communication FX3U-485ADP(-MB)
RS-232C communication FX3G-232-BD or FX3U-232ADP(-MB) (FX3G-CNV-ADP is needed)
RS-232C/RS-422 converter*1 (FX-232AW, FX-232AWC and FX-232AWC-H)
RS-485 communication FX3G-485-BD(-RJ) or FX3U-485ADP(-MB) (FX3G-CNV-ADP is needed)
Applied Instructions (Handy Instruction)
RS-232C communication FX3U-232ADP(-MB)
RS-232C/RS-422 converter*1 (FX-232AW, FX-232AWC and FX-232AWC-H)
RS-485 communication FX3U-485ADP(-MB)
RS-232C communication FX3G-232-BD or FX3U-232ADP(-MB) (FX3S-CNV-ADP is needed)
RS-485 communication FX3G-485-BD(-RJ) or FX3U-485ADP(-MB) (FX3S-CNV-ADP is needed)
*1. Required to use ch0 (standard built-in RS-422 port) in FX3G and FX3GC PLCs.
Applied Instructions (External FX I/O Device)
Item RS2 instruction RS instruction Remarks
Header size 1 to 4 characters (bytes) Up to 1 character (byte) For the RS2 instruction, up to 4 characters (bytes) can be specified as a header or terminator. Terminator size 1 to 4 characters (bytes) Up to 1 character (byte)
For the RS2 instruction, the check sum can be automatically attached to the sent and received data. In this case, however, make sure to use a terminator with the communication frame to be sent and received.
Applied Instructions (External Device (optional device))
Attachment of check sum
The check sum can be automatically attached.
The check sum should be attached by a user program.
For the RS2 instruction: Ch0 is applicable to FX3G and FX3GC PLCs only. In the case of FX3S and FX3G (14-point and 24-point type) PLCs, ch2 cannot be used.
Used channel number ch0, ch1, ch2 ch1
Item Outline of function FX3S FX3G FX3GC FX3U FX3UC
ch1 Data set ready (DSR) flag
When DR (DSR) signal of ch1 is ON, special device M8405 is turned ON.
Applied Instructions (Data Transfer 2)
Ver. 1.00
Ver. 1.00
Ver. 1.40
Ver. 2.30
Ver. 2.30
ch2 Data set ready (DSR) flag
When DR (DSR) signal of ch2 is ON, special device M8425 is turned ON.
→ As for other cautions, refer to the communication control manual.
Applied Instructions (Floating Point)
- "IVCK, IVDR, IVRD, IVWR, IVBWR*1 or IVMC" instruction - "ADPRW" instruction
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
Applied Instructions (Positioning Control)
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.

15 Applied Instructions (External Device (optional device))
15.9 PID / PID Control Loop
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes PID control for changing the output values depending on the change value of the input.
→ As for the detail, refer to the analog control manual.

PID 16 bits Continuous PID(EN, s1, s2, s3, d);

Data register for storing the target value (SV) ANY16
Data register for storing the measured value (PV). ANY16
Data register for storing the parameter [29 points occupied]*1 ANY16
Data register for storing the output value (MV) ANY16
*1. Variable depending on the setting content of the parameter.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
1. 16-bit operation(PID)
When the program is executed by setting the target value of the device specified by , the measured value of the device specified by , and the parameter of the device specified by , at every sampling time of the device specified by , the calculation result (MV) is stored in the output value of the device specified by .


15 Applied Instructions (External Device (optional device))
15.9 PID / PID Control Loop
Setting items Content No. of points
Applied Instructions (High Speed Processing)
Measured value(PV) Input value of PID operation. 1 point
The devices are occupied by 29 points from the head device specified by . 2) Auto-tuning: In the case of step response method a) Action setting (ACT) setting: When all of bit1, bit2, bit5 are other than "0"
Applied Instructions (Handy Instruction)
The devices are occupied by 25 points from the head device specified by . b) Action setting (ACT) setting: When all of bit1, bit2, bit5 are "0"
The devices are occupied by 20 points from the head device specified by .
1) In the case of PID control (in ordinary processing) The initial output value is set at the user side before instruction drive. Thereafter, operation results are stored. 2) Auto-tuning: In the case of limit cycle method ULV value or LLV value is automatically issued during auto-tuning, and specified MV value is set after auto-tuning. 3) Auto-tuning: In the case of step response method Please set the step output value at the user side before instruction drive. During auto-tuning, the MV output cannot be changed at the PID instruction side.
Applied Instructions (External FX I/O Device)
*1. When the auto-tuning is not used, the same number of points as in the step response method are occupied.
Applied Instructions (External Device (optional device))
Setting items Content of setting Remarks
Sampling time(TS) 1 to 32767 [ms] Value shorter than operation cycle cannot be executed.
bit2 0: Output change amount alarm absent 1: Output change amount alarm valid Do not turn ON bit2 and bit5 simultaneously.
bit3 Not usable.
Do not turn ON bit2 and bit5 simultaneously.
Applied Instructions (Data Transfer 2)
bit7 to bit15 Not usable.
+2 Input filter constant (α) 0 to 99 [%] No input filter in the case of 0
+3 Proportional gain (KP) 1 to 32767 [%]
Applied Instructions (Floating Point)
+4 Integral time(TI) 0 to 32767 [×100ms] Handled as ∞ in the case of 0 (No integral)
+5 Differential gain (KD) 0 to 100 [%] No differential gain in the case of 0
+6 Differential time(TD) 0 to 32767 [×10ms] No differentiation in the case of 0
+7 :
Occupied by the internal processing of PID operation. Do not change the data.
+20*1 Input change amount (increase side) alarm setting value 0 to 32767 Direction of action(ACT): valid if + 1 bit1 is 1
+21*1 Input change amount (decrease side) alarm setting value 0 to 32767 Direction of action(ACT): valid if + 1 bit1 is 1
*1. + 20 to + 24 will be occupied in the case of bit1 = 1, bit2 = 1, or bit5 = 1 of + 1 action setting (ACT)
Applied Instructions (Positioning Control)
*2. FXU, FX2C PLCs are not usable.
*3. FX1S, FX1N, FX1NC, FX2N, FX2NC PLCs are not usable.

15 Applied Instructions (External Device (optional device))
15.9 PID / PID Control Loop
Setting items Content of setting Remarks
Output change amount (increase side) alarm setting value 0 to 32767 Direction of action (ACT):
+1 bit2 = 1, bit5 = 0; valid
Output upper limit setting value -32768 to 32767 Direction of action (ACT):
+1 bit2 = 0, bit5 = 1; valid
Output change amount (decrease side) alarm setting value 0 to 32767 Direction of action (ACT):
+1 bit2 = 1, bit5 = 0; valid
Output lower limit setting value -32768 to 32767 Direction of action (ACT):
+1 bit2 = 0, bit5 = 1; valid
Direction of action (ACT):
+24*1 Alarm output
+1 bit1 = 1 or bit2 = 1; valid
The following setting is required when using the limit cycle method (in the case of action direction (ACT) b6: ON).
+25*2 PV value threshold (hysteresis) width (SHPV)
To be set according to fluctuation of measured value (PV).
+26*2 Output value upper limit (ULV) Setting of maximum output value (ULV) of output value (MV)
Action setting (ACT) b6: Occupied when limit cycle method (ON) is selected.
+27*2 Output value lower limit (LLV) Setting of minimum output value (LLV) of output value (MV)
Weight setting parameter from end of tuning cycle to start of PID control (KW)
*1. + 20 to + 24 will be occupied in the case of bit1 = 1, bit2 = 1, or bit5 = 1 of + 1 action setting (ACT)
*2. FX2N, FX2NC, FX1N, FX1NC, FX1S, FXU, FX2C PLCs are not usable.
- Devices are occupied by 29 points from the head device specified by .
As for the output value (MV) of PID instruction, specify the data register excluding the power failure hold region. (When specifying the data register in the power failure hold region, you must clear the content of backup while the PLC is ON by the following program.)

Data register number of battery backup region specified by

15 Applied Instructions (External Device (optional device))
15.9 PID / PID Control Loop
Applied Instructions (High Speed Processing)
If an operation error occurs, special auxiliary relay M8067 is turned ON, and the error code is stored in special data register D8067.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

This chapter introduces the instructions for control of F2 PLC special extension equipment.
Instruction name Function Reference
F-16NP/NT communication Section 16.1 MNETP
Read from F2-6A Section 16.2 ANRDP
Write to F2-6A Section 16.3 ANWRP
RMST F2-32RM start Section 16.4
Write to F2-32RM Section 16.5 RMWRP
DRMWRP
RMRD
Read from F2-32RM Section 16.6 RMRDP
DRMRDP
RMMN
F2-32RM monitor Section 16.7 RMMNP
Specify F2-30GM Section 16.8 BLKP
F2-30GM code Section 16.9 MCDEP


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction exchanges ON/OFF signals between the FXU, FX2C PLCs, and F-16NP/NT type interface unit.
Head input number of FX2-24EI connected to F-16NP/NT (16 points occupied) Bit
Head output number of FX2-24EI connected to F-16NP/NT (8 points occupied) Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
The following signals are exchanged by the above instruction.
FXU PLC FX2C PLC F-16NP/NT type interface unit

16.1 MNET / F-16NP/NT communication

16.2 ANRD / Read from F2-6A
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction writes the analog input of F2-6A type analog input and output unit.
Expression in each language
ANRD EN s n
Applied Instructions (Handy Instruction)
ANRD 16 bits Continuous ANRD(EN, s, n, d1, d2);
ANRDP EN s n
ANRDP 16 bits Pulse ANRDP(EN, s, n, d1, d2);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Head input number of FX2-24EI connected to F2-6A (16 points occupied) Bit
Applied Instructions (External Device (optional device))
Channel number of analog input (n=10,11,12,13) ANY16
ENO Execution state Bit
Head output number of FX2-24EI connected to F2-6A (8 points occupied) Bit
Device storing analog input value (8-bit binary) ANY16
Bit Devices Word Devices Others
System user Digit designation System
unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
z
Applied Instructions (Floating Point)
ANRD EN s n
d1 d2 K10 D300
To read out from analog input CH10 to D300.
The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.
Applied Instructions (Positioning Control)
![Page 424 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ ST ]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-424.webp?w=400)
16.2 ANRD / Read from F2-6A
This is intended to determine the average of three points of time series data in 100 ms unit in order to suppress fluctuations of the analog input.
ANRD EN s n
To store the data of input channel 10 of F2-6A type analog input and output unit connected from X040, Y030, in the D20.
d1 d2 K10 D20
WSFLP EN s n1
The content of D20 is shifted to D0, D1, D2 in 100 ms unit.
K3 K1
MEANP EN s n
The average of D0, D1, D2 is stored in the D10.
ANRD(M8000, X040, K10, Y030, D20); WSFLP(M8012, D20, K3, K1, D0); MEANP(M8012, D0, K3, D10);

16.3 ANWR / Write to F2-6A
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction writes data from the PLC in the F2-6A type analog input and output unit, and issues as analog data.
Expression in each language
Applied Instructions (Handy Instruction)
ANWR EN s1 s2
ANWR 16 bits Continuous ANWR(EN, s1, s2, n, d);
Applied Instructions (External FX I/O Device)
ANWRP EN s1 s2
ANWRP 16 bits Pulse ANWRP(EN, s1, s2, n, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing analog output data (8-bit binary) ANY16
Head input number of FX2-24EI connected to F2-6A Bit
Channel number of analog output ANY16
ENO Execution state Bit
Head output number of FX2-24EI connected to F2-6A Bit
Bit Devices Word Devices Others
System user Digit designation System
unit Index Con stant
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
Applied Instructions (Floating Point)
ANWR EN s1 s2
To write in from D310 into analog input CN0
Applied Instructions (Positioning Control)
The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.

16.4 RMST / F2-32RM start
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction gives start signal from the PLC or receives status information, in the F2-32RM type programmable cam switch.

RMST 16 bits Continuous RMST(EN, s, n, d1, d2);

Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit
Program (bank) number of F2-32RM (n = 0, 1). ANY16
Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit
Head of device storing status information (8 points occupied) Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
RMST EN s n
d1 d2 K0 M300
FXU→FX2-32RM Start command F2-32RM→FXU Status information
ON
Normal Normal CW Normally
OFF
S/W error H/W error CCW 0.5° STOP Normally
As for the meaning of each status, please refer to the user's manual of F2-32RM type programmable cam switch.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction sends output prohibit information from the PLC to the F2-32RM type programmable cam switch.
Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit
Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

16.5 RMWR / Write to F2-32RM
RMWR EN s1 s2
Writing of output prohibit information

M507 M506 M505 M504 M503 M502 M501 M500 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
M517 M516 M515 M514 M513 M512 M511 M510 Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010
For example, when M500 is turned ON, Y000 is output prohibited, and cannot be turned ON.
M527 M526 M525 M524 M523 M522 M521 M520 Y027 Y026 Y025 Y024 Y023 Y022 Y021 Y020
M537 M536 M535 M534 M533 M532 M531 M530 Y037 Y036 Y035 Y034 Y033 Y032 Y031 Y030
Auxiliary relay number of FXU, FX2C
d X040


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads out the ON/OFF state of output of the F2-32RM type programmable cam switch to the PLC.
Head input number of FX2-24EI connected to F2-32RM (16 points occupied) Bit
Head output number of FX2-24EI connected to F2-32RM (8 points occupied) Bit
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

16.6 RMRD / Read from F2-32RM
Reading of ON/OFF information

M617 M616 M615 M614 M613 M612 M611 M610 Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010
For example, if the Y000 is ON, the M600 is turned ON.
M627 M626 M625 M624 M623 M622 M621 M620 Y027 Y026 Y025 Y024 Y023 Y022 Y021 Y020
M637 M636 M635 M634 M633 M632 M631 M630 Y037 Y036 Y035 Y034 Y033 Y032 Y031 Y030
Auxiliary relay number of FXU, FX2C
RMRD EN s · d1 d2 X040

16.7 RMMN / F2-32RM monitor
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction reads out the rotating speed (rpm) or present angle of the resolver connected to the F2-32RM type programmable cam switch to the PLC.
Expression in each language
Applied Instructions (Handy Instruction)
RMMN 16 bits Continuous RMMN(EN, s, d1, d2);
Applied Instructions (External FX I/O Device)
RMMNP 16 bits Pulse RMMNP(EN, s, d1, d2);
Variable Description Data type
Applied Instructions (External Device (optional device))
EN Execution condition Bit
Head input number of FX2-24EI connected to F2-32RM. Bit
ENO Execution state Bit
Head output number of FX2-24EI connected to F2-32RM. Bit
Device for storing data of rotating speed and present angle (2 points occupied) ANY16
Bit Devices Word Devices Others
System user Digit designation System
unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
z
Applied Instructions (Floating Point)
Monitor of rotating speed or present angle
In the case of rotating speed (rpm) (actually binary value)
Applied Instructions (Positioning Control)
In the case of present angle (deg) (binary value by rounding down 0.5°)

16.8 BLK / Specify F2-30GM
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction specifies the block number for the F2-30GM type pulse output unit from the PLC.


Head input number of FX2-24EI connected to F2-30GM Bit
Head output number of FX2-24EI connected to F2-30GM Bit

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

16.8 BLK / Specify F2-30GM
d s2 K0 X040
Applied Instructions (High Speed Processing)
FXU, FX2C→FX2-30GM Block numbers 0 to 31 (decimal)
Applied Instructions (Handy Instruction)
d s2 K0 X040
Applied Instructions (External FX I/O Device)
The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
BLK EN s1 · BLK EN s1

16.9 MCDE / F2-30GM code
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction sends the M code numbers M0 to M77 to the PLC from the F2-30GM type pulse output unit.


Head input number of FX2-24EI connected to F2-30GM Bit
Head output number of FX2-24EI connected to F2-30GM Bit
Bit device for issuing M code number (78 points occupied) Bit

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
FX2-30GM→FXU,FX2C M code number M0 to 77 (octal)
The instruction is not provided in the FXU and FX2C PLCs Ver. 3.30 or later. This instruction is disused from V3.30 and later.
MCDE EN s · d1 d2 X040

17 Applied Instructions (Data Transfer 2)
This chapter introduces the instructions for executing complicated processing for fundamental applied instructions and for executing special processing.
Applied Instructions (High Speed Processing)
Instruction name Function Reference
Batch Store of Index Register Section 17.1 ZPUSHP
Batch POP of Index Register Section 17.2 ZPOPP
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

17 Applied Instructions (Data Transfer 2)
17.1 ZPUSH / Batch Store of Index Register
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction temporarily retracts the present values of index registers V0 to V7, Z0 to Z7. To return the retracted present values to the original values, use the ZPOP instruction.
→ As for ZPOP instruction, refer to section 17.2.


Head device for retracting contents of index registers V0 to V7, Z0 to Z7 temporarily [(1+16 × times of retraction) occupied] ANY16

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

17 Applied Instructions (Data Transfer 2)
17.1 ZPUSH / Batch Store of Index Register
1. 16-bit operation (ZPUSH/ZPUSHP)
Command input ZPUSH EN ENO
d Head device for retracting the contents of index register
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
is added by 16 points each. Hence, you must preliminarily reserve the region for the number of times to be used by nesting.
Applied Instructions (External FX I/O Device)
No action of nesting Index register
With action of nesting Index register
Times of retraction +1 +0
Times of retraction +1 +0
+1 to number of times of retraction by ZPUSH instruction
Applied Instructions (External Device (optional device))
First time of nesting Times of retraction
Z7 V7
Z7 V7
Z7 V7
Second time of nesting Times of retraction
Applied Instructions (Data Transfer 2)
ZPOP This instruction restores the index registers V0 to V7, Z0 to Z7 once retracted by ZPUSH instruction.
Applied Instructions (Floating Point)
It is an operation error in the following case, and error flag M8067 is turned ON, and error code is stored in D8067.
Applied Instructions (Positioning Control)

17 Applied Instructions (Data Transfer 2)
17.1 ZPUSH / Batch Store of Index Register
This is a program for retracting the contents of index registers Z0 to Z7, V0 to V7 before execution of subroutine program after D0, when using the index register in the subroutine after pointer P0.

RST(M8002, D0); MOVP(X005, K5, V0); MOVP(NOT X005, K10, V0); OUT(X000V0, Y000); ZPUSH(M8000, D0);
FBDD( ); Function block of the function corresponding to the subroutine program.

17 Applied Instructions (Data Transfer 2)
17.2 ZPOP / Batch POP of Index Register
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction returns the contents of index registers V0 to V7, Z0 to Z7 once retracted by the ZPUSH instruction to the original state.
→ As for ZPUSH instruction, refer to section 17.1.
Expression in each language
Applied Instructions (Handy Instruction)
ZPOP 16 bits Continuous ZPOP(EN, d);
Applied Instructions (External FX I/O Device)
ZPOPP 16 bits Pulse ZPOPP(EN, d);
Variable Description Data type
Input variable EN Execution condition Bit
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Head device once retracting the contents of index registers V0 to V7, Z0 to Z7 [(1+16 × times of retraction) occupied] ANY16
Bit Devices Word Devices Others
System user Digit designation System
unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Data Transfer 2)
Command input ZPOP EN ENO
Applied Instructions (Floating Point)
d Head device once retracting the contents of index registers
Applied Instructions (Positioning Control)

17 Applied Instructions (Data Transfer 2)
17.2 ZPOP / Batch POP of Index Register
ZPUSH This instruction temporarily retracts the present values of index registers V0 to V7, Z0 to Z7.
It is an operation error in the following case, and error flag M8067 is turned ON, and error code is stored in D8067.
→ As for program examples, refer to section 17.1.
Instruction Content

18 Applied Instructions (Floating Point)
This chapter introduces the instructions for conversion, comparison, arithmetic operations, square root operation, trigonometry, etc. for floating point operations.
Applied Instructions (High Speed Processing)
Instruction name Function Reference
Floating Point Compare Section 18.1 DECMPP
Floating Point Zone Compare Section 18.2 DEZCPP
Applied Instructions (Handy Instruction)
Floating Point Move Section 18.3 DEMOVP
Floating Point to Character String Conversion Section 18.4 DESTRP
Character String to Floating Point Conversion Section 18.5 DEVALP
Applied Instructions (External FX I/O Device)
Floating Point to Scientific Notation Conversion Section 18.6 DEBCDP
Scientific Notation to Floating Point Conversion Section 18.7 DEBINP
Floating Point Addition Section 18.8 DEADDP
Applied Instructions (External Device (optional device))
Floating Point Subtraction Section 18.9 DESUBP
Floating Point Multiplication Section 18.10 DEMULP
Floating Point Division Section 18.11 DEDIVP
Floating Point Exponent Section 18.12 DEXPP
Floating Point Natural Logarithm Section 18.13 DLOGEP
Floating Point Common Logarithm Section 18.14 DLOG10P
Applied Instructions (Data Transfer 2)
Floating Point Square Root Section 18.15 DESQRP
Floating Point Negation Section 18.16 DENEGP
Floating Point to Integer Conversion Section 18.17 INTP
Applied Instructions (Floating Point)
DINTP
DSIN
Floating Point Sine Section 18.18 DSINP
Floating Point Cosine Section 18.19 DCOSP
Floating Point Tangent Section 18.20 DTANP
Floating Point Arc Sine Section 18.21 DASINP
Floating Point Arc Cosine Section 18.22 DACOSP
Applied Instructions (Positioning Control)
Floating Point Arc Tangent Section 18.23 DATANP

18 Applied Instructions (Floating Point) FXCPU Structured Programming Manual [Basic & Applied Instruction]
Instruction name Function Reference
Floating Point Degrees to Radians Conversion Section 18.24 DRADP
Floating Point Radians to Degrees Conversion Section 18.25 DDEGP

18 Applied Instructions (Floating Point)
18.1 DECMP / Floating Point Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction compares two data (binary floating decimal point), and issues the result of greater, smaller, or equal to the bit device (3 points).
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DECMP EN s1 s2
DECMP 32 bits Continuous DECMP(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
DECMPP EN s1 s2
DECMPP 32 bits Pulse DECMPP(EN, s1, s2, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating point data to be compared FLOAT(Single Precision)
Device for storing binary floating point data to be compared FLOAT(Single Precision)
ENO Execution state Bit
Head bit device for output of result (3 points occupied) ARRAY [0..2] OF Bit
Bit Devices Word Devices Others
System user Digit designation System user Special
unit Index Con stant
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S4
z S1 S2 z S4
z z z S3 z
Applied Instructions (Floating Point)
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

18.1 DECMP / Floating Point Compare FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DECMP, DECMPP)
The compared value specified by and the comparison source specified by are compared as floating decimal point data, and depending on the result of greater, smaller, or equal, any bit of devices ( , +1, and +2) specified by is turned ON.

Device for storing binary floating decimal point data (data 1) to be compared Device for storing binary floating decimal point data (data 2) to be compared
To define the device for storing binary floating decimal point data (data 1) to be compared. *1.
To define the device for storing binary floating decimal point data (data 2) to be compared. *2.
If the command input is OFF and DECMP instruction cannot be executed, the device specified by holds the state before the command input is turned OFF.
1. Number of devices occupied
occupies 3 points. Be careful not to overlap with the devices used in other applications.
However, index decoration is not applicable. S4: The FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable.

18 Applied Instructions (Floating Point)
18.2 DEZCP / Floating Point Zone Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction compares the comparison range of upper and lower two points and the data (binary floating decimal point), and issues the result to the bit device (3 points) depending on the greater, smaller or the band.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DEZCP EN s1 s2
DEZCP 32 bits Continuous DEZCP(EN, s1, s2, s3, d);
Applied Instructions (External FX I/O Device)
DEZCPP EN s1 s2
DEZCPP 32 bits Pulse DEZCPP(EN, s1, s2, s3, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating point data to be compared FLOAT(Single Precision)
Device for storing binary floating point data to be compared FLOAT(Single Precision)
Device for storing binary floating point data to be compared FLOAT(Single Precision)
ENO Execution state Bit
Head bit device for output of result (3 points occupied) ARRAY [0..2] OF Bit
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System user Digit designation System user Special
unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Floating Point)
z S1 S1 z S1
z S1 S1 z S1
z S1 S1 z S1
z z z S2 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

18.2 DEZCP / Floating Point Zone Compare FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DEZCP, DEZCPP)
The compared value specified by , and the comparison source specified by are compared as floating decimal point data, and depending on the result of smaller, within range, or greater, any bit of devices ( , +1, and +2) specified by is turned ON.

Head bit device for output of result Device for storing binary floating decimal point data (data 1) to be compared Device for storing binary floating decimal point data (data 2) to be compared Device for storing binary floating decimal point data (data 3) to be compared
If the command input is OFF and DEZCP instruction cannot be executed, the device specified by holds the state before the command input is turned OFF.
1. Number of devices occupied
occupies 3 points. Be careful not to overlap with the devices used in other applications.
The magnitude relation of comparison data is £ . In the case of > , the value of is regarded to be same as , and is compared.
However, index decoration is not applicable.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Binary floating decimal point data of transfer source, or device storing the data
Transfer destination device of binary floating decimal point data FLOAT(Single Precision)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

18.3 DEMOV / Floating Point Move FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DEMOV/DEMOVP)
The content (binary floating decimal point data) of transfer source of device specified by is transferred to the device specified by . Real number (E) can be directly specified in the device specified by .


36.475 36.475 D1 D0 D11 D10 X007 DEMOVP EN ENO


18 Applied Instructions (Floating Point)
18.4 DESTR / Floating Point to Character String Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction converts the binary floating decimal point data into character string (ASCII code) in a specified number of digits. You can also use the STR instruction for converting BIN data into character string (ASCII code).
→ As for character string, refer to FX Structured Programming Manual [Device & Common]. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common]. → As for STR instruction, see section 26.1.
Applied Instructions (Handy Instruction)
Expression in each language
DESTR EN s1 s2
Applied Instructions (External FX I/O Device)
DESTR 32 bits Continuous DESTR(EN, s1, s2, d1);
DESTRP EN s1 s2
DESTRP 32 bits Pulse DESTRP(EN, s1, s2, d1);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Binary floating decimal point data to be converted, or device storing the data FLOAT(Single
Head device storing the display specification of the numeric value to be converted (3 points occupied).
ENO Execution state Bit
Head of the storing destination device of the converted character string (all digits + 1) ÷2 points occupied (fractions are rounded up). String
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System user Digit designation System user Special
unit Index Con stant
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
Applied Instructions (Floating Point)
z
z
z
Applied Instructions (Positioning Control)

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DESTR/DESTRP)
The content (binary floating decimal point data) of the device specified by is converted into character string depending on the content of the device specified by , and stored in or after the device specified by . Real number can be directly specified in the device specified by .

d1 Binary floating decimal point data to be converted Head of the storing destination device of the converted character string Head device storing the display specification of the numeric value to be converted.
The converted data differs depending on the type of .

ASCII code of digit number (all digits specified value - 1)
ASCII code of digit number (all digits specified value - 3)
ASCII code of digit number (all digits specified value - 2)
ASCII code of digit number (all digits specified value - 5)
ASCII code of digit number (all digits specified value - 7)
ASCII code of digit number (all digits specified value - 6)
To be stored automatically at the end of character string.

18 Applied Instructions (Floating Point)
18.4 DESTR / Floating Point to Character String Conversion
For example, in the case of all digits of 8 and decimal digits of 3, when -1.23456 is specified, the data after
is stored as follows.
Number of digits below decimal point
Applied Instructions (High Speed Processing)
1 2 3 5
2EH(.)
35H(5)
33H(3)
0000H
Applied Instructions (Handy Instruction)
-1.23456
To be stored automatically at the end of character string.
Binary floating decimal point (real number)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
2 (Number of digits below decimal point)
Number of digits below decimal point
Rounded off. +1
-1.23456
- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the specified decimal digits + 1 digit. However, when the number of decimal digits is "0", "2EH" (.) is not stored.
2 (Number of digits below decimal point)
Applied Instructions (Data Transfer 2)
Added automatically. +1
Number of digits below decimal point
-1.23456
- When the number of digits subtracting the sign, decimal point, and decimal part from the total number of digits is greater than the integer part of the binary floating decimal point data, "20H" (space) is inserted between the sign and the integer part.
Applied Instructions (Floating Point)
"20H" (space) is inserted. +1
Number of digits below decimal point
-1.23456
- "00H" or "0000H" is automatically stored at the end of the converted character string.
Applied Instructions (Positioning Control)

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)

ASCII code of digit number (all digits specified value - 1)
ASCII code of digit number (all digits specified value - 2)
ASCII code of digit number (all digits specified value - 5)
ASCII code of digit number (all digits specified value - 4)
ASCII code of digit number (all digits specified value - 7)
ASCII code of digit number (all digits specified value - 6)
ASCII code of digit number (all digits specified value - 11)
ASCII code of digit number (all digits specified value - 10)
To be stored automatically at the end of character string.
For example, in the case of all digits of 12 and decimal digits of 4, when -12.34567 is specified, the data after

To be stored automatically at the end of character string.

18 Applied Instructions (Floating Point)
18.4 DESTR / Floating Point to Character String Conversion
Applied Instructions (High Speed Processing)
"20H" (space) is inserted.
-12.34567
Applied Instructions (Handy Instruction)
- When the decimal part of binary floating decimal point data does not settle within the decimal digits, the lower decimal digits are rounded off.
Applied Instructions (External FX I/O Device)
0 2 3 4 6 E + 1 1 6 7
Rounded and discarded. +1
Number of digits below decimal point (4)
-12.34567
- When the number of decimal digits is set in other than "0", automatically "2EH" (.) is stored at the specified decimal digits + 1 digit. However, when the number of decimal digits is "0", "2EH" (.) is not stored.
Applied Instructions (External Device (optional device))
0 2 3 4 6 E + 1 1
Number of digits below decimal point (4)
Added automatically. +1
-12.34567
- For the sign of exponential part, "2BH" (+) is stored when the index is positive, and "2DH" (-) is stored when negative. - The exponential part is fixed in two digits. When the exponential part is one digit, between the exponential part and the sign, "30H" (0) is inserted.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
"30H" (0) is inserted.
-12.34567
- "00H" or "0000H" is automatically stored at the end of the converted character string.
EVAL This instruction converts the character string (ASCII code) data into binary floating decimal point data.
STR This instruction converts BIN data into character string (ASCII code).
Applied Instructions (Positioning Control)
VAL This instruction converts the character string (ASCII code) data into BIN data.

18.4 DESTR / Floating Point to Character String Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
In the following cases, it is an operation error, and error flag (M8067) is turned ON, and error code is stored in D8067.
When the number of digits below decimal point is "0" All digits ≥ 2 When the number of digits below decimal point is other than "0" . . All digits ≥ (decimal digits + 3) In the case of exponential type
When the number of digits below decimal point is "0" All digits ≥ 6 When the number of digits below decimal point is other than "0" . . All digits ≥ (decimal digits + 7)


18.4 DESTR / Floating Point to Character String Conversion
Number of digits below decimal point Space R1 R0 0.0327457 20H(space)

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the character string (ASCII code) into binary floating decimal point data. You can also use the VAL instruction for converting the character string (ASCII code) into BIN data.
→ As for character string, refer to FX Structured Programming Manual [Device & Common]. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common]. → As for VAL instruction, refer to section 26.2.


Head device storing the character string to be converted into binary floating point decimal data. String
Device for storing the converted binary floating point decimal data. FLOAT(Single Precision)

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

d s Head device storing the character string to be converted into binary floating point decimal data
Device for storing the converted binary floating point decimal data


18.5 DEVAL / Character String to Floating Point Conversion
The character string specified can be converted into binary floating point decimal data whether in decimal point type or in specified type.
3 2 0 1 1 + 1 0 E
3 0 1 1 5 8 1 2 6

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
b) In the case of exponential type

5 0 3 3 4 2 E 1 1 0 2


4 5 3 0 E 0 3 + 1

18 Applied Instructions (Floating Point)
18.5 DEVAL / Character String to Floating Point Conversion
→ As for the manner of using the zero, borrow, or carry flag, refer to the FX Structured Programming
Manual [Device & Common].
The conversion result is really zero (when the mantissa part is "0")
Applied Instructions (High Speed Processing)
Zero flag (M8020) is ON.
M8021 Borrow Absolute value of conversion
The value of is the smallest value (2-126) of 32-bit real number, and borrow flag (M8021) is ON.
result < 2-126
M8022 Carry Absolute value of conversion
The value of is the largest value (2128) of 32-bit real number, and carry flag (M8022) is ON.
result ≥ 2128
Applied Instructions (Handy Instruction)
ESTR This instruction converts the binary floating decimal point data into character string (ASCII code).
STR This instruction converts BIN data into character string (ASCII code).
VAL This instruction converts the character string (ASCII code) data into BIN data.
Applied Instructions (External FX I/O Device)
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

18.5 DEVAL / Character String to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)


Operation in overflow, underflow, zero mode

The value of is the smallest value (2-126) of 32-bit real number, and borrow flag (M8021) is ON.
≥ 2128 The value of is the largest value (2128) of 32-bit real number, and carry flag (M8022) is ON.
The conversion result is really zero (when the mantissa part is "0") Zero flag (M8020) is ON.


18.6 DEBCD / Floating Point to Scientific Notation Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the binary floating decimal point in the device into decimal floating decimal point.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Device for storing binary floating decimal point data. FLOAT(Single Precision)
Device for storing the converted decimal floating decimal point data. ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

18.6 DEBCD / Floating Point to Scientific Notation Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)

[ +1, ] → [ +1, ] DEBCD EN ENO
d s s d Device for storing the binary floating decimal point data
Device for storing the converted decimal floating decimal point data
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 Before execution Mantissa part (23 bits)
Lower position b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Higher position
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 After execution Mantissa part Exponential part


18.7 DEBIN / Scientific Notation to Floating Point Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the decimal floating decimal point in the device into binary floating decimal point.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Device for storing decimal floating decimal point data. ANY32
Device for storing the converted binary floating decimal point data. FLOAT(Single Precision)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

18.7 DEBIN / Scientific Notation to Floating Point Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DEBIN, DEBINP)
The decimal floating decimal point of the device specified by is converted into binary floating decimal point, and is transferred to the device specified by .

[ +1, ] → [ +1, ] DEBIN EN ENO
d s s d Device for storing the decimal floating decimal point data
Device for storing the converted binary floating decimal point data
Lower position b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 Higher position
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 Before execution Mantissa part Exponential part
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 After execution
By using the DEBIN instruction, the numeric value including the decimal point can be directly converted into the binary floating decimal point.
3.14=314×10-2 (Decimal floating decimal point)

→ As for program example of floating decimal point operation, refer to section 11.10.

18 Applied Instructions (Floating Point)
18.8 DEADD / Floating Point Addition
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction adds two binary floating decimal points.
→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DEADD EN s1 s2
DEADD 32 bits Continuous DEADD(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
DEADDP EN s1 s2
DEADDP 32 bits Pulse DEADDP(EN, s1, s2, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating decimal point data to be added. FLOAT(Single Precision)
Device for storing binary floating decimal point data to be added. FLOAT(Single Precision)
ENO Execution state Bit
Device for storing the added binary floating decimal point data. FLOAT(Single Precision)
Bit Devices Word Devices Others
System user Digit designation System
Applied Instructions (Data Transfer 2)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S3
z S1 S2 z S3
z S1 S2 z
Applied Instructions (Floating Point)
S: Refer to "Cautions".
1. 32-bit operation (DEADD, DEADDP)
The binary floating decimal point data in the device specified by and in the device specified by are added, and the result is transferred to the device specified by in binary floating decimal point.
Device for storing binary floating decimal point data to be added Device for storing binary floating decimal point data to be added
Device for storing the added binary floating decimal point data
[ +1, ] + [ +1, ] → [ +1, ]
d s1 s2 s1 s2 d
Applied Instructions (Positioning Control)
Binary floating decimal point
Binary floating decimal point
Binary floating decimal point

18.8 DEADD / Floating Point Addition FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)

18 Applied Instructions (Floating Point)
18.9 DESUB / Floating Point Subtraction
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction subtracts two binary floating decimal points.
→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DESUB EN s1 s2
DESUB 32 bits Continuous DESUB(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
DESUBP EN s1 s2
DESUBP 32 bits Pulse DESUBP(EN, s1, s2, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating decimal point data to be subtracted. FLOAT(Single Precision)
Device for storing binary floating decimal point data to be subtracted. FLOAT(Single Precision)
ENO Execution state Bit
Device for storing the subtracted binary floating decimal point data. FLOAT(Single Precision)
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S3
Applied Instructions (Floating Point)
z S1 S2 z S3
z S1 S2 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

18.9 DESUB / Floating Point Subtraction FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DESUB, DESUBP)
The binary floating decimal point data in the device specified by are subtracted from the device specified by , and the result is transferred to the device specified by in binary floating decimal point.

Device for storing binary floating decimal point data to be subtracted
Device for storing the subtracted binary floating decimal point data
Device for storing binary floating decimal point data to be subtracted
[ +1, ] - [ +1, ] → [ +1, ]

18 Applied Instructions (Floating Point)
18.10 DEMUL / Floating Point Multiplication
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction multiplies two binary floating decimal points.
→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DEMUL EN s1 s2
DEMUL 32 bits Continuous DEMUL(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
DEMULP EN s1 s2
DEMULP 32 bits Pulse DEMULP(EN, s1, s2, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating decimal point data to be multiplied. FLOAT(Single Precision)
Device for storing binary floating decimal point data to be multiplied. FLOAT(Single Precision)
ENO Execution state Bit
Device for storing the multiplied binary floating decimal point data. FLOAT(Single Precision)
Bit Devices Word Devices Others
Applied Instructions (Data Transfer 2)
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S3
z S1 S2 z S3
Applied Instructions (Floating Point)
z S1 S2 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

18.10 DEMUL / Floating Point Multiplication FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DEMUL, DEMULP)
The binary floating decimal point data in the device specified by and in the device specified by are multiplied, and the result is transferred to the device specified by in binary floating decimal point.

Device for storing binary floating decimal point data to be multiplied Device for storing binary floating decimal point data to be multiplied
Device for storing the multiplied binary floating decimal point data
[ +1, ] × [ +1, ] → [ +1, ]

18 Applied Instructions (Floating Point)
18.11 DEDIV / Floating Point Division
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction divides two binary floating decimal points.
→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common]. → As for the operation of the flag, refer to the FX Structured Programming Manual [Device &
Common].
Applied Instructions (Handy Instruction)
Expression in each language
DEDIV EN s1 s2
DEDIV 32 bits Continuous DEDIV(EN, s1, s2, d);
Applied Instructions (External FX I/O Device)
DEDIVP EN s1 s2
DEDIV 32 bits Pulse DEDIVP(EN, s1, s2, d);
Applied Instructions (External Device (optional device))
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating decimal point data to be divided. FLOAT(Single Precision)
Device for storing binary floating decimal point data to be divided. FLOAT(Single Precision)
ENO Execution state Bit
Device for storing the divided binary floating decimal point data. FLOAT(Single Precision)
Applied Instructions (Data Transfer 2)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S3
Applied Instructions (Floating Point)
z S1 S2 z S3
z S1 S2 z
S: Refer to "Cautions".
Applied Instructions (Positioning Control)

18.11 DEDIV / Floating Point Division FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
1. 32-bit operation (DEDIV, DEDIVP)
The binary floating decimal point data in the device specified by and in the device specified by are divided, and the result is transferred to the device specified by in binary floating decimal point.

Device for storing binary floating decimal point data to be divided
Device for storing the divided binary floating decimal point data
Device for storing binary floating decimal point data to be divided
[ +1, ] ÷ [ +1, ] → [ +1, ]

18 Applied Instructions (Floating Point)
18.12 DEXP / Floating Point Exponent
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction executes exponential operation whose base is "e (2.71828)".
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Expression in each language
Applied Instructions (Handy Instruction)
DEXP 32 bits Continuous DEXP(EN, s, d);
Applied Instructions (External FX I/O Device)
DEXPP 32 bits Pulse DEXPP(EN, s, d);
Variable Description Data type
EN Execution condition Bit
Applied Instructions (External Device (optional device))
Head device for storing binary floating decimal point data for exponential operation.
ENO Execution state Bit
Head device for storing the operation result. FLOAT(Single Precision)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
Applied Instructions (Data Transfer 2)
z
1. 32-bit operation (DEXP/DEXPP)
Applied Instructions (Floating Point)
By exponential operation of the device specified by , the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .
Command input DEXP EN ENO
Head device for storing binary floating decimal point data for exponential operation
Head device for storing the operation result
d s d s
Binary floating decimal point (real number)
Applied Instructions (Positioning Control)

18.12 DEXP / Floating Point Exponent FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
This is a program for executing exponential operation of the values set in BCD two digits in X020 to X027 when the X000 is turned ON, and storing in binary floating decimal points D0, D1.

Checking of range of operation values (see the following check point 1).
Input data is converted into binary floating decimal point (real number).(2))
The Load compare instruction (LD>) is not available in ST.
Operation when 13 is specified in X020 to X027.

0.4342945

18 Applied Instructions (Floating Point)
18.13 DLOGE / Floating Point Natural Logarithm
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction executes natural logarithm operation.
Expression in each language
Applied Instructions (Handy Instruction)
DLOGE 32 bits Continuous DLOGE(EN, s, d);
DLOGEP 32 bits Pulse DLOGEP(EN, s, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Head device for storing the binary floating decimal point data for natural logarithm operation.
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Head device for storing the operation result. FLOAT(Single Precision)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
Applied Instructions (Data Transfer 2)
1. 32-bit operation (DLOGE/DLOGEP)
By natural logarithm operation of the device specified by (logarithm supposing e (2.71828) to be the bottom), the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .
Applied Instructions (Floating Point)
Command input DLOGE EN ENO
Head device for storing the binary floating decimal point data for natural logarithm operation
Head device for storing the operation result
d s s d
Binary floating decimal point (real number)
Binary floating decimal point (real number)
Applied Instructions (Positioning Control)

18.13 DLOGE / Floating Point Natural Logarithm FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
This is a program for determining the natural logarithm of "10" set in D50 when the X000 is turned ON, and storing in D30, D31.
Setting of data for natural logarithm operation.(1))
Conversion of operation data into binary floating decimal point (real number).(2))
Operation of natural logarithm.(3))
MOV(X000,K10,D50); FLT(X000,D50,D40); DLOGE(X000,D40,D30);
2.302585 D31 D30
MOV
FLT
Value of binary floating decimal point (real number)
Value of binary floating decimal point (real number)

18 Applied Instructions (Floating Point)
18.14 DLOG10 / Floating Point Common Logarithm
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction executes common logarithm operation.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Expression in each language
Applied Instructions (Handy Instruction)
DLOG10 32 bits Continuous DLOG10(EN, s ,d);
Applied Instructions (External FX I/O Device)
DLOG10P 32 bits Pulse DLOG10P(EN ,s ,d);
Variable Description Data type
Applied Instructions (External Device (optional device))
EN Execution condition Bit
Head device for storing the binary floating decimal point data for common logarithm operation.
ENO Execution state Bit
Head device for storing the operation result. FLOAT(Single Precision)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
Applied Instructions (Data Transfer 2)
z
1. 32-bit operation (DLOG10/DLOG10P)
Applied Instructions (Floating Point)
By common logarithm operation of the device specified by (logarithm supposing 10 to be the bottom), the operation result is stored in the device specified by . Real number can be directly specified in the device specified by .
Command input DLOG10 EN ENO
Head device for storing the binary floating decimal point data for common logarithm operation
Head device for storing the operation result
+1 +1 d s
Binary floating decimal point (real number)
Binary floating decimal point (real number))
Applied Instructions (Positioning Control)

18.14 DLOG10 / Floating Point Common Logarithm FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
This is a program for determining the common logarithm of "15" set in D50 when the X000 is ON, and storing in D30, D31.
Setting of data for common logarithm operation. (1))
Conversion of operation data into binary floating decimal point (real number). (2))
Operation of common logarithm (3))
MOV(X000,K15,D50); FLT(X000,D50,D40); DLOG10(X000,D40,D30);
1.176091 D31 D30
MOV
FLT
Value of binary floating decimal point (real number)
Value of binary floating decimal point (real number)

18 Applied Instructions (Floating Point)
18.15 DESQR / Floating Point Square Root
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction executes the square root operation of binary floating decimal point.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Expression in each language Structured ladder/FBD ST
Applied Instructions (Handy Instruction)
DESQR 32 bits Continuous DESQR(EN, s, d);
DESQRP 32 bits Pulse DESQRP(EN, s, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Device for storing binary floating decimal point data for square root operation
Applied Instructions (External Device (optional device))
ENO Execution state Bit Device for storing binary floating decimal point data after square root operation
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z S3
z S1 S2 z
Applied Instructions (Data Transfer 2)
S: Refer to "Cautions".
1. 32-bit operation (DESQR, DESQRP)
The data in the device specified by is operated by square root (binary floating decimal point), and the result is transferred to the device specified by .
Applied Instructions (Floating Point)
Command input DESQR EN ENO
Device for storing binary floating decimal point data for square root operation
Device for storing binary floating decimal point data after square root operation
[ +1, ] d s Binary floating decimal point
s [ +1, ] d →
Binary floating decimal point
→ As for the manner of using the zero flag, refer to the FX Structured Programming Manual [Device &
Common].
Applied Instructions (Positioning Control)
M8020 Zero To be turned ON when the operation result is true 0.

18.15 DESQR / Floating Point Square Root FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
The content of the device specified by is valid only in positive number, and negative number leads to operation error (M8067), and the instruction is not executed.
![Page 481 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-481.webp?w=400)
18 Applied Instructions (Floating Point)
18.16 DENEG / Floating Point Negation
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction inverts the sign of binary floating decimal point (real number) data.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Expression in each language
Applied Instructions (Handy Instruction)
DENEG 32 bits Continuous DENEG(EN, d);
DENEGP 32 bits Pulse DENEGP(EN, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
Input variable EN Execution condition Bit
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Head device for storing the binary floating decimal point data of which sign is to be inverted.
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
Applied Instructions (Data Transfer 2)
Command input DENEG EN ENO
Applied Instructions (Floating Point)
d Head device for storing the binary floating decimal point data of which sign is to be inverted
This is a program for inverting the sign of the binary floating decimal point data of D100, D101 when the X000 is turned ON, and storing in D100, D101.
1.2345 -1.2345
Applied Instructions (Positioning Control)
DENEGP(X000,D100);

18.17 INT / Floating Point to Integer Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the binary floating decimal point into BIN integer in normal data type in the PLC. (From binary floating decimal point data to BIN integer)
→ As for program example of floating decimal point operation, refer to section 11.10. → As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Device for storing the binary floating decimal point data to be converted into BIN integer. FLOAT(Single Precision)
Device for storing the converted BIN integer. ANY16 ANY32

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

18 Applied Instructions (Floating Point)
18.17 INT / Floating Point to Integer Conversion
1. 16-bit operation (INT, INTP)
The binary floating decimal point of the device specified by is converted into BIN integer, and is transferred to the device specified by .
Command input INT EN ENO
Applied Instructions (High Speed Processing)
+1, d s s →
d s Binary floating decimal point
The device for storing the converted data.
To discard below the decimal point of 16-bit BIN integer.
Device for storing the data to be converted into BIN integer
Instruction of reverse converting operation Reverse converting operation of the operation of this instruction is FLT.
→ As for FLT instruction, refer to 11.10.
Applied Instructions (Handy Instruction)
The binary floating decimal point of the device specified by is converted into BIN integer, and is transferred to the device specified by .
+1, s s → +1, d d DINT EN ENO
Applied Instructions (External FX I/O Device)
Device for storing the data to be converted into BIN integer
The device for storing the converted data.
Binary floating decimal point
To discard below the decimal point of 32-bit BIN integer.
Instruction of reverse converting operation Reverse converting operation of the operation of this instruction is DFLT(FNC49) instruction.
→ As for FLT instruction, refer to 11.10.
Applied Instructions (External Device (optional device))
→ As for the manner of using the zero, borrow, and carry flag, refer to the FX Structured Programming
Manual [Device & Common].
M8020 Zero To be turned ON when the operation result is 0.
M8021 Borrow To be turned ON when less than 1 is discarded in convertion.
To be turned ON when the operation result overflows by exceeding the range of -32, 768 to 32, 767 (in 16-bit operation), or -2, 147, 483, 583 to 2, 147, 483, 583 (in 32-bit operation). (Operation result is not reflected.)
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

18.18 DSIN / Floating Point Sine FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction determines the SIN value of angle (RAD).
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)
Device for storing the SIN value of binary floating decimal point. FLOAT(Single Precision)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
1. 32-bit operation (DINT, DINTP)
The value of angle (binary floating decimal point) specified by is converted into SIN value, and is transferred to the device specified by .

[ +1, ]RAD d s s [ +1, ]SIN d → DSIN EN ENO
RAD value (angle × π/180) Binary floating decimal point value is specified.


(D5, D4) angle × (π/180) →(D31, D30)RAD Binary floating point multiplication

18.19 DCOS / Floating Point Cosine FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction determines the COS value of angle (RAD).
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)
Device for storing the COS value of binary floating decimal point. FLOAT(Single Precision)

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

[ +1, ]RAD → [ +1, ]COS DCOS EN ENO
RAD value (angle × π/180) Binary floating decimal point value is specified.

18 Applied Instructions (Floating Point)
18.20 DTAN / Floating Point Tangent
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction determines the TAN value of angle (RAD).
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].
Expression in each language
Applied Instructions (Handy Instruction)
DTAN 32 bits Continuous DTAN(EN, s, d);
DTANP 32 bits Pulse DTANP(EN, s, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Device for storing the RAD (angle) of binary floating decimal point. FLOAT(Single Precision)
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Device for storing the TAN value of binary floating decimal point. FLOAT(Single Precision)
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S1 z S1
z S1 S1 z
S: Refer to "Cautions".
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
[ +1, ]RAD → [ +1, ]TAN d s s d
Binary floating decimal point value
Device for storing RAD (angle)
Device for storing the TAN value
RAD value (angle × π/180) Binary floating decimal point value is specified.
TAN value Binary floating decimal point value
Applied Instructions (Positioning Control)

18.21 DASIN / Floating Point Arc Sine FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes SIN-1 operation.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Head device for storing the SIN value for SIN-1 (reverse sine) operation. FLOAT(Single Precision)
Head device for storing the operation result. FLOAT(Single Precision)

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

Head device for storing the SIN value for SIN-1 operation
→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.


In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
This is a program for determining SIN-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.
Calculation of angle (radian) by SIN-1 operation. (1))
Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))
Output of angle converted to integer (BIN) to display unit. (4))
Operation when the value of D0, D1 is 0.5.

18.22 DACOS / Floating Point Arc Cosine FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes COS-1 operation.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Head device for storing the COS value for COS-1 (reverse cosine) operation.
Head device for storing the operation result. FLOAT(Single Precision)

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

Head device for storing the COS value for COS-1 operation
→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.


In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in D8067.
This is a program for determining COS-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.
Calculation of angle (radian) by COS-1 operation. (1))
Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))
Output of angle converted to integer to display unit. (4))
Operation when the value of D0, D1 is 0.5.

18.23 DATAN / Floating Point Arc Tangent FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes TAN-1 operation.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Head device for storing the TAN value for TAN-1 operation (reverse tangent).
Head device for storing the operation result. FLOAT(Single Precision)

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

Head device for storing the TAN value for TAN-1 operation
→ As for DRAD instruction, refer to section 18.24. → As for DDEG instruction, refer to section 18.25.


This is a program for determining TAN-1 of D0, D1 (binary floating decimal point) when the X000 is ON, and sending the angle to Y040 to Y057 in BCD four digits.
Calculation of angle (radian) by TAN-1 operation. (1))
Conversion of angle of binary floating decimal point (real number) into integer (BIN). (3))
Output of angle converted to integer (BIN) to display unit. (4))
Operation when the value of D0, D1 is 1.

18.24 DRAD / Floating Point Degrees to Radians Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the value of angle unit to the radian unit.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Head device for storing the angle to be converted to radian unit. FLOAT(Single Precision)
Head device for storing the value having been converted to radian unit FLOAT(Single Precision)

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
1. 32-bit operation (DRAD/DRADP)
The angle specified by is converted from the degree unit to the radian unit, and is stored in the device specified by . Real number can be directly specified in the device specified by .

Head device for storing the angle to be converted to the radian unit
Head device for storing the value having been converted to the radian unit
Radian unit = degree unit × 180
π


18.24 DRAD / Floating Point Degrees to Radians Conversion
This is a program for converting the angle set in BCD four digits in X020 to X037 when the X000 is ON, and storing in binary floating decimal point in D20, D21.
Input of angle to be converted to radian value. (1))
Conversion of input angle to binary floating decimal point (negative number).) (2))
Operation when 120 is specified in X020 to X037.

18.25 DDEG / Floating Point Radians to Degrees Conversion FXCPU Structured Programming Manual [Basic & Applied Instruction]
18 Applied Instructions (Floating Point)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the radian unit value into the angle (DEG) unit.
→ As for handling of floating decimal point, refer to FX Structured Programming Manual [Device &
Common].


Head device for storing the radian angle to be converted to degree unit. FLOAT(Single Precision)
Head device for storing the value having been converted to degree unit. FLOAT(Single Precision)

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

Head device for storing the radian angle to be converted to degree unit
Head device for storing the value having been converted to degree unit
Degree unit = radian unit × π 180


18.25 DDEG / Floating Point Radians to Degrees Conversion
This is a program for converting the radian value set in binary floating decimal point in D20, D21 to the angle when the X000 is ON, and issuing to the Y040 to Y057 in BCD value.
Angle of binary floating decimal point (real number) is converted to integer. (2))
The converted integer value is issued to the display unit. (3))
Operation when the value of D20, D21 is 1.435792.

This chapter introduces the instructions for executing complicated processing for fundamental applied instructions and for executing special processing.
Instruction name Function Reference
Sum of Word Data Section 19.1 WSUMP
DWSUMP
WTOB
WORD to BYTE Section 19.2 WTOBP
BYTE to WORD Section 19.3 BTOWP
4-bit Linking of Word Data Section 19.4 UNIP
4-bit Grouping of Word Data Section 19.5 DISP
Byte Swap Section 19.6 SWAPP
DSWAPP
SORT2
Sort Tabulated Data 2 Section 19.7 DSORT2


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction calculates the total value of continuous 16-bit data or 32-bit data. Please use the CCD when calculating the sum data (total value) in byte (8-bit) unit.
→ As for the CCD, refer to section 15.5.
Head device for storing the data for calculating the total value (n points occupied). ANY16 ANY32
Head device for storing the total value. ANY32 ARRAY [1..4] OF ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

19.1 WSUM / Sum of Word Data


d [ ] +3, +2, +1,
CCD Check code This instruction calculates the total value and the horizontal parity of 16-bit data in byte (8-bit) unit.
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.
Instruction Content

19.1 WSUM / Sum of Word Data
This is a program for storing the total value of 16-bit data of D10 to D14 when the X010 is turned ON to [D101, D100].
WSUMP EN s n
Applied Instructions (High Speed Processing)
K5
K6780 K4444
[ST]
WSUMP(X10,D10,K5,D100);
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
[Structured ladder/FBD] · [D101,D100] WSUMP instruction

19.2 WTOB / WORD to BYTE
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction separates continuous 16-bit data in byte (8-bit) unit.


Head device for storing the data to be separated in byte unit. ANY16
Number of byte data to be separated. (0≤n) ANY16
Head device for storing the result separated in byte unit. ANY16

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

19.2 WTOB / WORD to BYTE
1. 16-bit operation (WTOB/WTOBP)
WTOB EN s n
Applied Instructions (High Speed Processing)
Head device for storing the result separated in byte unit. Head device of the data to be separated.
Number of byte data to be separated.
b15 b8 b7 b0 +0 +1
b15 b8 b7 b0
Higher byte Higher byte
Lower byte Lower byte
00H 00H Lower byte Higher byte 00H 00H Lower byte Higher byte
Applied Instructions (Handy Instruction)
00H 00H Lower byte Higher byte
* If n is an odd number, fractions are rounded up. In the case of n=5, the result is +3.
Applied Instructions (External FX I/O Device)
00H is stored.
Applied Instructions (External Device (optional device))
b15 b8 b7 b0 d s
b15 b8 b7 b0 +0 +1 +2
39H 78H DCH
00H 00H 39H 12H 00H 00H 78H 56H 00H DCH
In the case of n=5
Ignored when n=5.
00H is stored.
Applied Instructions (Data Transfer 2)
BTOW This instruction couples the lower 8 bits (lower byte) of continuous 16-bit data.
Applied Instructions (Floating Point)
b15 b8 b7 b0 b15 b8 b7 b0 s d
31H 33H 35H
00H 00H 31H 32H 00H 00H 33H 34H 00H 35H
In the case of n=5
Ignored when n=5, and devices and are overlapped, and "36H" is overwritten and erased.
00H is stored.
Applied Instructions (Positioning Control)

19.2 WTOB / WORD to BYTE
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.
This is a program for separating the data of D10 to D12 into byte unit when the X000 is turned ON, and storing in D20 to D25.

00H 00H 58H FDH 00H 00H E2H 57H 00H 44H

19.3 BTOW / BYTE to WORD
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction couples the lower 8 bits (lower byte) of continuous 16-bit data.
Expression in each language
BTOW EN s n
Applied Instructions (Handy Instruction)
BTOW 16 bits Continuous BTOW(EN, s, n, d);
BTOWP EN s n
BTOWP 16 bits Pulse BTOWP(EN, s, n, d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Head device for storing the data to be coupled in byte unit. ANY16
Applied Instructions (External Device (optional device))
Number of byte data to be coupled (0≤n) ANY16
ENO Execution state Bit
Head device for storing the coupled result in byte unit. ANY16
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
Applied Instructions (Data Transfer 2)
z
1. 16-bit operation (BTOW/BTOWP)
Applied Instructions (Floating Point)
BTOWP EN s n
Head device of data to be coupled Number of byte data to be coupled
d Head device for storing the coupled result in byte unit.
b15 b8 b7 b0 +0 +1
b15 b8 b7 b0
First byte data Second byte data Third byte data
First byte Third bytes
Applied Instructions (Positioning Control)
* If n is an odd number, refer to 3).
Higher bytes are ignored.

19.3 BTOW / BYTE to WORD

CDH 9AH +3 +4 In the case of n=5, "H00" is set.
WTOB This instruction separates continuous 16-bit data in byte (8-bit) unit.

=D10 34H 78H 12H 56H 9AH D13 D14 D15
Not changed. Since devices are overlapped, "ABH" and "CDH" are overwritten and erased.
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.
Instruction Content


This is a program for coupling the data of lower byte (8 bits) of D20 to D25 when the X000 is turned ON, and storing into D10 to D12.

19.4 UNI / 4-bit Linking of Word Data
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction couples lower 4 bits of continuous 16-bit data.


Head device for storing the data to be coupled. ANY16
Number of couples [0 to 4](When "n" is "0", UNI instruction is not executed.) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
1. 16-bit operation (UNI/UNIP)

Head device of data to be coupled Head device for storing the coupled data. Number of couples
Lower 4 bits Lower 4 bits Lower 4 bits Lower 4 bits
![Page 509 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — [ST]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-509.webp?w=400)
19.4 UNI / 4-bit Linking of Word Data
Applied Instructions (High Speed Processing)
b15 b4 b3 b0 +0 +1 +2
Lower 4 bits Lower 4 bits Lower 4 bits
b15 b12b11 b8 b7 b4 b3 b0
Ignored. Data to be coupled
In the case of n=3, b12 to b15 are 0.
Applied Instructions (Handy Instruction)
DIS This instruction separates 16-bit data in 4-bit unit.
Applied Instructions (External FX I/O Device)
The instruction is provided in the FX3UC PLC Ver. 2.20 or later.
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.
Applied Instructions (External Device (optional device))
This is a program for coupling lower 4 bits of D0 to D2 when the X000 is turned ON, and storing in D10.
UNIP EN s n
Applied Instructions (Data Transfer 2)
b15 b4 b3 b0 D0
b15 b12 b11 b4 b3 b0
1 0 0 0 1 0 1 0 1 0 0 1 0 1 0
1 0 1 0
1 0 0 1 0
Applied Instructions (Floating Point)
Data to be coupled
0 is set because n=K3.
UNIP(X000,D0,K3,D10);
Applied Instructions (Positioning Control)
s · Instruction Content · [Structured ladder/FBD]

19.5 DIS / 4-bit Grouping of Word Data
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction separates 16-bit data in 4-bit unit.


Device for storing the data to be separated. ANY16
Number of separates [0 to 4](When "n" is "0", UNI instruction is not executed.) ANY16

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

19.5 DIS / 4-bit Grouping of Word Data
1. 16-bit operation (DIS/DISP)
DISP EN s n
Applied Instructions (High Speed Processing)
d Device for storing the data to be separated.
Head device for storing the separated data.
b15 b12 b11 b8 b7 b4 b3 b0 s d
b15 b4 b3 b0 +0 +1 +2
Lower 4 bits Lower 4 bits Lower 4 bits Lower 4 bits
Applied Instructions (Handy Instruction)
To be set in 0.
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
UNI This instruction couples lower 4 bits of 16-bit data.
The instruction is provided in the FX3UC PLC Ver. 2.20 or later.
In the following case, it is an operation error, error flag M8067 is turned ON, and error code is stored in D8067.
Applied Instructions (Data Transfer 2)
This is a program for separating D0 in 4 bits each when the X000 is turned ON, and storing in D10 to D13.
Applied Instructions (Floating Point)
DISP EN s n
b15 b4 b3 b0 b2 b1 D0
b15 b12 b11 b4 b3 b0 0 0 1 1 0
1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0
1 0 1 0
1 0 0 1 0
0 0 1 1 0
Applied Instructions (Positioning Control)
To be set in 0.

19.6 SWAP / Byte Swap
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction swaps higher 8 bits and lower 8 bits of word data.


Device for swapping higher and lower bytes. ANY16 ANY32

System user Digit designation Special unit Index Index Cons
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S1 z z z
S: Refer to "Cautions".
Higher 8 bits Lower 8 bits
Device for swapping higher and lower bytes.
Command input · s


+1 DSWAPP EN ENO Device for swapping higher and lower bytes
Higher 8 bits Lower 8 bits , Higher 8 bits Lower 8 bits

19.7 SORT2 / Sort Tabulated Data 2
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction sorts the data table composed of data (rows) and group data (columns) in the ascending order/descending order in row unit on the basis of the specified group data (rows). In this instruction, data (row direction) is stored in continuous devices, and it is easy to add the data (row). In SORT, sorting is in ascending order only, and data composition is different (data is composed in devices continuous in row direction).
→ As for SORT, refer to section 13.10.


Head device for storing data table [m1 × m2 points occupied] ANY16 ANY32
Number of data (rows) [1 to 32] ANY16 ANY32
Number of group data (columns) [1 to 6] ANY16 ANY32
Columns of group data (columns) as reference for sorting [1 to m2] ANY16 ANY32
Head device for storing operation result [m1 × m2 points occupied] ANY16 ANY32

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

19.7 SORT2 / Sort Tabulated Data 2
Applied Instructions (High Speed Processing)
SORT2 EN s m1
Head device for storing data table.
Head device for storing the operation result.
Number of data (rows)
Number of group data (columns)
Columns of group data (columns) as reference for sorting
Applied Instructions (Handy Instruction)
Instruction execution complete flag
M
The data table is composed of m1=K3, m2=K4 in the sorting source as explained in this case. In the data table after sorting, exchange and .
Applied Instructions (External FX I/O Device)
Number of groups m2 (in the case of m2=K4)
Column number 1 2 3 4
Row number Management number Height Body weight Age
In the case of number of data m1=3
1 +1 +2 +3
Applied Instructions (External Device (optional device))
2 +4 +5 +6 +7
3 +8 +9 +10 +11
Setting of sorting order
→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

19.7 SORT2 / Sort Tabulated Data 2

Number of group data (columns) Columns of group data (columns) as reference for sorting
The data table is composed of m1=K3, m2=K4 in the sorting source as explained in this case. In the data table after sorting, exchange and .

Number of groups m2 (in the case of m2=K4)
1 [ +1, ] [ +3, +2] [ +5, +4] [ +7, +6]
2 [ +9, +8] [ +11, +10] [ +13, +12] [ +15, +14]
3 [ +17, +16] [ +19, +18] [ +21, +20] [ +23, +22]
→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.
Sorting order · M8165=ON Descending · M8165=OFF Ascending

19.7 SORT2 / Sort Tabulated Data 2
Applied Instructions (High Speed Processing)
Number of groups m2 (in the case of m2=K4)
Column number 1 2 3 4
number Height Body weight Age
Applied Instructions (Handy Instruction)
1 +1 +2 +3
1 150 45 20
2 +4 +5 +6 +7
2 180 50 40
In the case of number of data m1=5
3 +8 +9 +10 +11
Applied Instructions (External FX I/O Device)
3 160 70 30
4 +12 +13 +14 +15
4 100 20 8
5 +16 +17 +18 +19
5 150 50 45
Applied Instructions (External Device (optional device))
Column number 1 2 3 4
number Height Body weight Age
1 +1 +2 +3
4 100 20 8
2 +4 +5 +6 +7
1 150 45 20
3 +8 +9 +10 +11
5 150 50 45
4 +12 +13 +14 +15
Applied Instructions (Data Transfer 2)
3 160 70 30
5 +16 +17 +18 +19
2 180 50 40
Applied Instructions (Floating Point)
Column number 1 2 3 4
number Height Body weight Age
1 +1 +2 +3
3 160 70 30
2 +4 +5 +6 +7
2 180 50 40
3 +8 +9 +10 +11
5 150 50 45
4 +12 +13 +14 +15
1 150 45 20
Applied Instructions (Positioning Control)
5 +16 +17 +18 +19
4 100 20 8

19.7 SORT2 / Sort Tabulated Data 2
→ As for the manner of using the instruction execution complete flag, refer to section 1.3.4.

complete Turned ON when data sorting instruction is complete.
M8165 Descending order Sorted in descending order when M8165=ON. Sorted in ascending order when M8165=OFF.

Data sorting This instruction sorts the data table composed of data (rows) and group data (columns) in ascending order in row unit on the basis of the specified group data (columns). In this instruction, the group data (column direction) is stored in continuous devices.


20 Applied Instructions (Positioning Control)
This chapter introduces the instructions using the built-in pulse output function of the PLC.
Applied Instructions (High Speed Processing)
Instruction name Function Reference
DSZR Dog Search Zero Return Section 20.1
Interrupt Positioning Section 20.2 DDVIT
DTBL Batch Data Positioning Mode Section 20.3
DABS Absolute Current Value Read Section 20.4
Applied Instructions (Handy Instruction)
Zero Return Section 20.5 DZRN
Variable Speed Pulse Output Section 20.6 DPLSV
Drive to Increment Section 20.7 DDRVI
Applied Instructions (External FX I/O Device)
Drive to Absolute Section 20.8 DDRVA
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

20 Applied Instructions (Positioning Control)
20.1 DSZR / Dog Search Zero Return
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction matches the mechanical position and the current value register in the PLC by zero return. This instruction can perform following operation which is not supported by ZRN.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.



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

Device for issuing pulse Device of rotating direction signal

20 Applied Instructions (Positioning Control)
20.1 DSZR / Dog Search Zero Return
Please specify X000 to X005, in the case of FX3S PLC. S3: Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
the rotating direction signal, use the output shown in the table below.
Connection position of high speed output special adapter Pulse output Rotating direction signal
Applied Instructions (External FX I/O Device)
=Y001 =Y005
=Y002 =Y006
=Y003 =Y007
When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output.
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
DPLSV,DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC. *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.
Applied Instructions (Floating Point)
This instruction includes the function changes as shown in the table below depending on the version.
→ As for the explanation of the instruction and contents of function changes, refer to the positioning
control manual.
Item Outline of function FX3S FX3G FX3GC FX3U FX3UC
Clear signal output destination designating function
When special auxiliary relay corresponding to is turned ON, the clear signal output specification is changed to the output number specified by special data register corresponding
Applied Instructions (Positioning Control)
Ver. 1.00
Ver. 1.00
Ver. 1.40
Ver. 2.20
Ver. 2.20

20 Applied Instructions (Positioning Control)
20.2 DVIT / Interrupt Positioning
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes one-speed interrupt inching.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.


Number of output pulses after interrupt (relative address) ANY16 ANY32

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

Output pulse frequency Number of output pulses after interrupt
Device of rotating direction signal Device for issuing pulse (Y)

20 Applied Instructions (Positioning Control)
20.2 DVIT / Interrupt Positioning
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
Applied Instructions (High Speed Processing)
DPLSV,DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3U or FX3UC PLC.
Applied Instructions (Handy Instruction)
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.
Applied Instructions (External FX I/O Device)
This instruction includes the function changes as shown in the table below depending on the version.
→ As for the explanation of the instruction and contents of function changes, refer to the positioning
control manual.
Item Outline of function FX3U FX3UC
Applied Instructions (External Device (optional device))
Ver. 2.20 or
Ver. 1.30 or
Interrupt input signal designating function
When M8336 is turned ON, the interrupt input signal corresponding to Y000 to Y003 is changed to input number (X000 to X007) specified by D8336. However, Y003 cannot be specified when transistor output of basic unit is used.
When 8 is specified by D8336 in interrupt input signal corresponding to Y000 to Y003 and M8336 is turned ON, the interrupt input signal is changed to special auxiliary relay. When the changed special auxiliary relay is changed from OFF to ON by input interrupt program, the interrupt operation is started. However, when this function is used, the logic of interrupt input cannot be inverted. However, Y003 cannot be specified when transistor output of basic unit is used.
Ver. 2.20 or
Ver. 2.20 or
later User interrupt mode
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)

20 Applied Instructions (Positioning Control)
20.2 DVIT / Interrupt Positioning
high speed output special adapter*1. *1. High speed output special adapter can be connected only in FX3U PLC. *2. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
the rotating direction signal, use the output shown in the table below.
Connection position of high speed
output special adapter Pulse output Rotating direction
=Y001 =Y005
=Y002 =Y006
=Y003 =Y007
When built-in transistor output is ussed at the pulse output destination in the FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: In D .b, index (V, Z) decoration is disabled.
-32,768 to +32,767 (excluding 0) b) In the case of 32-bit operation
-999,999 to +999,999 (excluding 0)
10 to 32,767 (Hz)
b) In the case of 32-bit operation
Pulse output destination Setting range
FX3U PLC High speed output special adapter 10 to 200,000 (HZ)
FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)
signal · First unit · Second unit

20 Applied Instructions (Positioning Control)
20.3 DTBL / Batch Data Positioning Mode
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
Instructions should be set in a data table beforehand using GX Works2. This instruction specifies one table and operates instructions in that table.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.
Expression in each language
Applied Instructions (Handy Instruction)
DTBL 32 bits Continuous DTBL(EN,n,d);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Table number to be executed (n=1 to 100) ANY32
ENO Execution state Bit
Device for issuing pulse (Y) Bit
Applied Instructions (External Device (optional device))
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
S: Refer to "Cautions".
Applied Instructions (Data Transfer 2)
Table number to be executed
d n Device for issuing pulse (Y)
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
Applied Instructions (Floating Point)
This caution about the above operations is applicable to the following PLCs and instructions. FX1S, FX1N and FX1NC PLCs : PLSY, DPLSY, PWM, PLSR, DPLSR, ZRN, DZRN, PLSV,
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA
Applied Instructions (Positioning Control)
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.

20 Applied Instructions (Positioning Control)
20.3 DTBL / Batch Data Positioning Mode
of high speed output special adapter*2. *1. Y002 is not available in FX3G PLC (14-point and 24-point type) and FX3GC PLC. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points

20 Applied Instructions (Positioning Control)
20.4 DABS / Absolute Current Value Read
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing)
This instruction connects with our company's MR-J4 A, MR-J3 A, MR-J2(S) A, or MR-H A type servo amplifier (with absolute position detecting function), and reads out the absolute position (ABS) data. The data is read out in pulse converted value.
→ As for explanation of the instruction, see the positioning control manual.
Applied Instructions (Handy Instruction)
Expression in each language
DABS 32 bits Continuous DABS(EN,s,d1,d2);
Applied Instructions (External FX I/O Device)
Variable Description Data type
EN Execution condition Bit
Head device for entering the output signal for absolute value (ABS) data from the servo amplifier (3 points occupied). Bit
Applied Instructions (External Device (optional device))
ENO Execution state Bit
Head device for issuing the control signal for absolute value (ABS) data to the servo amplifier (3 points occupied). Bit
Storing destination device of absolute value (ABS) data (32-bit value) ANY32
Bit Devices Word Devices Others
System user Digit designation System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 z
S1 z z S2 z
Applied Instructions (Data Transfer 2)
z S3 S4 z z
S: Refer to "Cautions".
Applied Instructions (Floating Point)
Head device for issuing the control signal for absolute value (ABS) data to the servo amplifier
Head device for entering the output signal for absolute value (ABS) data from the servo amplifier
d2 Storing destination device of absolute value (ABS) data
Applied Instructions (Positioning Control)

20 Applied Instructions (Positioning Control)
20.4 DABS / Absolute Current Value Read


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction matches the mechanical position and the current value register in the PLC by zero return. Please use DSZR when DOG search function is necessary.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S3 S2 z
z S3 S2 z

20 Applied Instructions (Positioning Control)
20.5 ZRN / Zero Return
Speed when starting to zero return
d s2 s3 Device for entering the near-point signal (DOG)
Device for issuing pulse
d Speed when starting to zero return
Device for issuing pulse
Creep speed Device for entering the near-point signal (DOG)
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC. *1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC.
This instruction includes the function changes as shown in the table below depending on the version.
→ As for the explanation of the instruction and contents of function changes, refer to the positioning
control manual.
2. FX1S PLC [Before V2.00] After resetting the "rotating direction signal" (normal rotation output) used in other positioning instruction by RST, start to zero return. When started to zero return while the "rotating direction signal" is in normal rotation output state, the motor moves to the normal rotation, not zero return. [After V2.00] When driving of other positioning instruction is turned OFF, the rotating direction signal is turned OFF at the same time, and processing of before V2.00 is not required.

20 Applied Instructions (Positioning Control)
20.5 ZRN / Zero Return
If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is
Applied Instructions (High Speed Processing)
established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse
output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the
Applied Instructions (Handy Instruction)
positioning instruction according to the cautions mentioned above.
Applied Instructions (External FX I/O Device)
4) While zero return, the numeric values of the current value registers (Y000: [D8141, D8140], Y001: [D8143, D8142]) move in the decreasing direction. (FX1S, FX1N, FX1NC PLCs) When zero return in reverse direction, please control the output relay (Y) wired as "rotating direction signal" by the program in the following procedure. 1) Set (ON) Y (rotating direction signal). 2) Execute zero return instruction. 3) Reset (OFF) Y (rotating direction signal) by execution complete flag (M8012) of zero return instruction.
Applied Instructions (External Device (optional device))
Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3
of high speed output special adapter*2. *1 The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2 High speed output special adapter can be connected only in FX3U PLC. *3 When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Specify Y000 or Y001. As the output of the PLC, please use the transistor output.
Applied Instructions (Positioning Control)

20 Applied Instructions (Positioning Control)
20.5 ZRN / Zero Return
Pulse output destination Setting range
FX3U PLC High speed output special adapter 10 to 200,000 (HZ)
FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction issues a variable speed pulse with the rotating direction.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S4 S5 z
Output pulse frequency Device for issuing pulse(Y) Device of rotating direction signal

20 Applied Instructions (Positioning Control)
20.6 PLSV / Variable Speed Pulse Output
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will become as shown below when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.
Operation of FX3S, FX3G, FX3GC, FX3U or FX3UC PLC when writing during RUN is attempted while a corresponding instruction is executed
acceleration or deceleration*3 Pulse output slows down and stops.
When operating without acceleration or deceleration Pulse output stops immediately.
*1. Not available for the FX3S, FX3G or FX3GC PLC. *2. Not available for the FX3S PLC. *3. Only available for FX3UC (Ver.2.20 or later), FX3S, FX3G, FX3GC and FX3U PLCs.
This instruction includes the function changes as shown in the table below depending on the version.
→ As for the explanation of the instruction and contents of function changes, refer to the positioning
control manual.
Added function Outline of function FX3S FX3G FX3GC FX3U FX3UC
When M8338 is turned ON, the operation accelerates or
Ver. 1.00
Ver. 1.00
Ver. 1.40
Ver. 2.20
Ver. 2.20
decelerates up to by setting of acceleration time or
deceleration time corresponding to when is changed.
FX1S, FX1N, FX1NC are not applicable to this function.
If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is
established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse
output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the
positioning instruction according to the cautions mentioned above.

20 Applied Instructions (Positioning Control)
20.6 PLSV / Variable Speed Pulse Output
a) Within one operation cycle, if the value is changed to other value than K0, the output maintains the
stop function. In this case, write K0 again for more than one operation cycle, or once turn OFF the command input. 3) Some restrictions to applicable devices. S1:
Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3
Applied Instructions (High Speed Processing)
Applied Instructions (Handy Instruction)
Specify Y000 or Y001. As the output of the PLC, please use the transistor output. S2:
Applied Instructions (External FX I/O Device)
When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.
Connection position of high speed
output special adapter Pulse output Rotating direction
First unit =Y000 =Y004
Applied Instructions (External Device (optional device))
Second unit =Y002 =Y006
When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.
Applied Instructions (Data Transfer 2)
Applied Instructions (Floating Point)
Pulse output destination Setting range
FX3U PLC High speed output special adapter -200,000 to -1, +1 to 200,000 (HZ)
FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) -100,000 to -1, +1 to 100,000 (HZ)*5
Applied Instructions (Positioning Control)
signal

20 Applied Instructions (Positioning Control)
20.7 DRVI / Drive to Increment
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction performs one-speed positioning by relative drive. The moving distance from the present position is specified together with plus or minus sign, and this is also called increment (relative) driving method.
→ As for explanation of the instruction, see the positioning control manual. → As for cautions of use of high speed output special adapter, see the positioning control manual.



X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S4 S5 z
z S4 S5 z
S: Refer to "Cautions".

20 Applied Instructions (Positioning Control)
20.7 DRVI / Drive to Increment
d1 d2 s2 Number of output pulses (relative address)
Device for issuing pulse (Y) Device of rotating direction signal
Applied Instructions (High Speed Processing)
Number of output pulses (relative address)
Device for issuing pulse (Y) Device of rotating direction signal
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.
Applied Instructions (External Device (optional device))
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.
If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is
Applied Instructions (Data Transfer 2)
established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse
output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the
Applied Instructions (Floating Point)
positioning instruction according to the cautions mentioned above.
Applied Instructions (Positioning Control)

20 Applied Instructions (Positioning Control)
20.7 DRVI / Drive to Increment
Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3
of high speed output special adapter*2. *1. The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
Specify Y000 or Y001. As the output of the PLC, please use the transistor output. S2:
When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.
Connection position of high speed
output special adapter Pulse output Rotating direction
First unit =Y000 =Y004
Second unit =Y002 =Y006
When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.
-32,768 to +32,767 (excluding 0) b) In the case of 32-bit operation
-999,999 to +999,999 (excluding 0)
Pulse output destination Setting range
FX3U PLC High speed output special adapter 10 to 200,000 (HZ)
FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)
signal


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction performs one-speed positioning by absolute drive. The moving distance from the origin (0 point) is specified, and this is also called absolute driving method.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S4 S5 z
z S4 S5 z
Device for issuing pulse (Y) Number of output pulses (absolute address)
Device for issuing pulse (Y) Device of rotating direction signal

20 Applied Instructions (Positioning Control)
20.8 DRVA / Drive to Absolute
Avoid writing during RUN after either of the following operations in a circuit block including the pulse output instruction or positioning instruction.
DPLSV, DRVI, DDRVI, DRVA and DDRVA FX2N and FX2NC PLCs : PLSY, DPLSY, PWM, PLSR and DPLSR FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs: DSZR, DVIT*1, DDVIT*1, DTBL*2, ZRN, DZRN, PLSV, DPLSV,
DRVI, DDRVI, DRVA and DDRVA Note that the pulse output will decelerate and stop when writing during RUN is executed in the FX3S, FX3G, FX3GC, FX3U or FX3UC PLC.
*1. Not available for the FX3S, FX3G or FX3GC PLC.
*2. Not available for the FX3S PLC.
If driven simultaneously, it is handled as double coil, and normal function is disabled. b) After turning OFF the direction input of the instruction, drive again after the following condition is
established. Condition:Re-driving is allowed after one operation cycle or more from the OFF moment of "pulse
output mode monitor (Y000: [M8147], Y001: [M8148]" of the positioning instruction driven previous time. This is because one or more OFF operation is required for re-driving of the positioning instruction. c) We recommend the step-ladder instruction (STL) as a method of programming correctly the
positioning instruction according to the cautions mentioned above. If, during pulse output, writing during RUN is attempted in circuit block including this instruction, it must be noted that the pulse output slows down and stops.
Please specify Y000, Y001, Y002*1 of transistor output of basic unit, or Y000, Y001, Y002*3, Y003*3
of high speed output special adapter*2. *1. The pulse output destination Y002 is not available in FX3S, FX3G (14-point and 24-point type) and FX3GC PLCs. *2. High speed output special adapter can be connected only in FX3U PLC. *3. When using Y002, Y003 in high speed output special adapter, a second high speed output special adapter is needed. Points
Specify Y000 or Y001. As the output of the PLC, please use the transistor output.

20 Applied Instructions (Positioning Control)
20.8 DRVA / Drive to Absolute
S2:
When high speed output special adapter is used at the pulse output destination in the FX3U PLC, as the rotating direction signal, use the output shown in the table below.
Connection position of high speed
output special adapter Pulse output Rotating direction
=Y001 =Y005
Applied Instructions (High Speed Processing)
=Y003 =Y007
When built-in transistor output is used at the pulse output destination in the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs, as the rotating direction signal, use the transistor output. S3: The FX3U and FX3UC PLCs only are applicable, index (V, Z) decoration is disabled. S4: The FX3G, FX3GC, FX3U and FX3UC PLCs only are applicable. S5: The FX3U and FX3UC PLCs only are applicable.
Applied Instructions (Handy Instruction)
Applied Instructions (External FX I/O Device)
Applied Instructions (External Device (optional device))
Applied Instructions (Data Transfer 2)
Pulse output destination Setting range
FX3U PLC High speed output special adapter 10 to 200,000 (HZ)
FX3S, FX3G, FX3GC, FX3U, FX3UC PLCs Basic unit (transistor output) 10 to 100,000 (HZ)
Applied Instructions (Floating Point)
Applied Instructions (Positioning Control)
signal · First unit · Second unit

21 Applied Instructions (Real Time Clock Control)
This chapter introduces operation and comparison instructions for the time data.
Instruction name Function Reference
RTC Data Compare Section 21.1 TCMPP
RTC Data Zone Compare Section 21.2 TZCPP
RTC Data Addition Section 21.3 TADDP
RTC Data Subtraction Section 21.4 TSUBP
Hour to Second Conversion Section 21.5 HTOSP
DHTOSP
STOH
Second to Hour Conversion Section 21.6 STOHP
DSTOHP
TRD
Read RTC data Section 21.7 TRDP
Set RTC data Section 21.8 TWRP
Hour Meter Section 21.9 DHOUR

21 Applied Instructions (Real Time Clock Control)
21.1 TCMP / RTC Data Compare
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The comparison time and the time data are compared, and the bit device is turned ON or OFF depending on the magnitude of difference.
Expression in each language
Applied Instructions (Extension Function)
TCMP EN s1 s2
TCMP 16 bits Continuous TCMP(EN,s1,s2,s3,s,d);
TCMPP EN s1 s2
TCMPP 16 bits Pulse TCMPP(EN,s1,s2,s3,s,d);
Applied Instructions (Block Data Operation)
Variable Description Data type
EN Execution condition Bit
Applied Instructions (Character String Control)
Time data (hour, minute, second) "hour" (3 points occupied) ARRAY [0..2] OF ANY16
ENO Execution state Bit
Device to be turned ON or OFF depending on the comparison result. (3 points occupied) ARRAY [0..2] OF Bit
Bit Devices Word Devices Others
System user Digit designation System
Applied Instructions (Data Comparison)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z
z S2 S3 z
z S2 S3 z
z z z S2 S3 z
z z z S1 z
Applied Instructions (Data Table Operation)
S: Refer to "Cautions".
Applied Instructions (External Device Communication)

21 Applied Instructions (Real Time Clock Control)
21.1 TCMP / RTC Data Compare

Device to be turned ON or OFF depending on the comparison result.
If TCMP is not executed when command contact is changed from ON to OFF, , +1, +2 are holding the state before the command contact is turned OFF.


:Three bit devices are turned ON or OFF depending on the comparison result.
If TCMP is not executed when X000=OFF, M0 to M2 are holding the state before X000 is turned OFF.

21 Applied Instructions (Real Time Clock Control)
21.2 TZCP / RTC Data Zone Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The comparison time of higher and lower points and the time data are compared, and the bit device is turned ON or OFF depending on the magnitude of difference.


Comparison lower limit time (hour, minute, second) "hour" (3 points occupied)
Comparison higher limit time (hour, minute, second) "hour" (3 points occupied)
Time data (hour, minute, second) "hour" (3 points occupied) ARRAY [0..2] OF ANY16
Device to be turned ON or OFF depending on the comparison result. (3 points occupied) ARRAY [0..2] OF Bit

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

21 Applied Instructions (Real Time Clock Control)
21.2 TZCP / RTC Data Zone Compare
Applied Instructions (Real Time Clock Control)
Magnitude comparison function of specified time at two points and time data
TZCP EN s1 s2
Device to be turned ON or OFF depending on the comparison result.
Comparison lower limit time (hour, minute, second) "hour"
Comparison upper limit time (hour, minute, second) "hour"
Applied Instructions (Extension Function)
Time data (hour, minute, second) "hour"
and then turned ON
and then turned ON
and then turned ON
Applied Instructions (Block Data Operation)
d d d If TZCP is not executed when command contact is changed from ON to OFF, , +1, +2 are holding the state before the command contact is turned OFF.
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

21 Applied Instructions (Real Time Clock Control)
21.2 TZCP / RTC Data Zone Compare

If TZCP instruction is not executed when X000 is changed from ON to OFF, M3 to M5 are holding the state before X000 is turned OFF.
:Comparison time lower limit is specified by "hour," "minute," "second."
:Comparison time upper limit is specified by "hour," "minute," "second."
:Three bit devices are turned ON or OFF depending on the comparison result.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Two time data are added and stored in the word device.
Device for storing "hour" of addition time data (hour, minute, second) (3 points occupied) ARRAY [0..2]
Device for storing "hour" of addition time data (hour, minute, second) (3 points occupied) ARRAY [0..2]
Device for storing the added result of two time data (hour, minute, second) (3 points occupied)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

21 Applied Instructions (Real Time Clock Control)
21.3 TADD / RTC Data Addition

Device for storing "hour" of addition time data (hour, minute, second) *1.
*2 Device for storing the added result of two time data (hour, minute, second)

10 hours, 30 minutes, 10 seconds 3 hours, 10 minutes, 5 seconds 13 hours, 40 minutes, 15 seconds

4 hours, 30 minutes, 35 seconds 10 hours, 20 minutes, 5 seconds 18 hours, 10 minutes, 30 seconds


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Two time data are subtracted and stored in the word device.
"Hour" of subtraction time data (hour, minute, second) (3 points occupied) ARRAY [0..2] OF ANY16
"Hour" of subtraction time data (hour, minute, second) (3 points occupied) ARRAY [0..2] OF ANY16
The subtracting result of two time data (hour, minute, second) is stored (3 points occupied)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

21 Applied Instructions (Real Time Clock Control)
21.4 TSUB / RTC Data Subtraction

Device for storing "hour" of subtraction time data (hour, minute, second) *1.
*1 *2 Device for storing the subtracted result of two time data (hour, minute, second)
( , +1, +2) - ( , +1, +2)
If the operation result is less than 0 hour, the borrow flag is turned ON, and the time by adding 24 hours to the simple difference is stored as the operation result. If the operation result is 0 (0 hour, 0 minute, 0 second), the zero flag is turned ON.

10 hours, 30 minutes, 10 seconds 3 hours, 10 minutes, 5 seconds 7 hours, 20 minutes, 5 seconds

11 hours, 10 minutes, 35 seconds 18 hours, 10 minutes, 5 seconds 5 hours, 20 minutes, 40 seconds


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the "hour, minute, second" unit (time) data into second unit data.
Head device for storing the time data (hour, minute, second) before conversion (3 points occupied) ARRAY [0..2] OF ANY16
Device for storing the time data (hour, minute, second) after conversion ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z

21 Applied Instructions (Real Time Clock Control)
21.5 HTOS / Hour to Second Conversion

d Head device for storing the time data (hour, minute, second) before conversion
Device for storing the time data (hour, minute, second) after conversion
For example, when 4 hours, 29 minutes, 31 seconds is specified, the operation is as follows.

Head device for storing the time data (hour, minute, second) before conversion
d Device for storing the time data (hour, minute, second) after conversion
For example, when 35 hours, 10 minutes, 58 seconds is specified, the operation is as follows.
In the following case, it is an operation error, and the error flag (M8067) is turned ON, and the error code is stored in D8067.


This is a program for converting the time data being read out from the real-time clock built in the PLC, when the X020 is ON, into the second unit, and storing in D100, D101.

21 Applied Instructions (Real Time Clock Control)
21.6 STOH / Second to Hour Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts the time data in second unit into time data in "hour, minute, second" unit.


Device for storing the time data in second unit before conversion ANY16 ANY32
Device for storing the time data in "hour, minute, second" unit after conversion (3 points occupied) ARRAY [0..2] OF ANY16

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

21 Applied Instructions (Real Time Clock Control)
21.6 STOH / Second to Hour Conversion
Applied Instructions (Real Time Clock Control)
Device for storing the time data in second unit before conversion
Device for storing the time data in "hour, minute, second" unit after conversion
second (0 to 32767)
Applied Instructions (Extension Function)
For example, when 29011 seconds is specified, the operation is as follows.
Applied Instructions (Block Data Operation)
d Device for storing the time data in
Device for storing the time data in "hour, minute, second" unit after conversion
second unit before conversion
Applied Instructions (Character String Control)
second (0 to 117964799)
For example, when 45325 seconds is specified, the operation is as follows.
Applied Instructions (Data Comparison)
In the following case, it is an operation error, and the error flag (M8067) is turned ON, and the error code is stored in D8067.
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

21 Applied Instructions (Real Time Clock Control)
21.6 STOH / Second to Hour Conversion
This is a program for converting the second unit data stored in D0, D1 when the X020 is turned ON, into the "hour, minute, second" unit, and storing the result in D100, D101, D102.
DSTOH(X020,D0,D100);
Operation
[Structured ladder/FBD] · DSTOH EN s · d D100 D0


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The clock data is read out in the real-time clock built in the PLC. When using FX2NC PLC, optional memory board for Real time clock is required.
The reading destination of clock data and the head device are specified (7 points occupied).
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

21 Applied Instructions (Real Time Clock Control)
21.7 TRD / Read RTC data
in the following format.
This instruction reads out the real-time clock data of the PLC into seven data registers.
TRD EN ENO
Device Item Clock data Device Item
D8018 Year (solar calendar) 0 to 99 (Lower 2 digits of year) → D 0 Year (solar calendar)
D8016 Day 1 to 31 → D 2 Day
D8015 hour 0 to 23 → D 3 hour
D8014 minute 0 to 59 → D 4 minute
D8013 second 0 to 59 → D 5 second
D8019 Day of week 0 (Sunday) to 6 (Saturday) → D 6 Day of week
Special data register


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The clock data is written into the real-time clock built in the PLC. When using FX2NC PLC, optional memory board for Real time clock is required.
The writing source of clock data and the head device are specified (7 points occupied).
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

21 Applied Instructions (Real Time Clock Control)
21.8 TWR / Set RTC data
The setting clock data stored in the device specified by is written into the clock data (D8013 to D8019) of the real-time clock built in the PLC.
Device Item Clock data Device Item
D 10 Year (solar calendar) 0 to 99 (Lower 2 digits
D 12 Day 1 to 31 → D8016 Day
D 13 hour 0 to 23 → D8015 hour
D 14 minute 0 to 59 → D8014 minute
D 15 second 0 to 59 → D8013 second
D 16 Day of week 0 (Sunday) to 6 (Saturday) → D8019 Day of week
s D10 · Special data register · Time setting data

21 Applied Instructions (Real Time Clock Control)
21.8 TWR / Set RTC data
Applied Instructions (Real Time Clock Control)
M0:=LDP(TRUE,X000); MOV(M0,K1,D0); MOV(M0,K4,D1); MOV(M0,K25,D2); MOV(M0,K15,D3); MOV(M0,K20,D4); MOV(M0,K30,D5); MOV(M0,K2,D6); TWR(M0,D0); M8017:=X001;
M0
Year (lower 2 digits)
Applied Instructions (Extension Function)
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
TWR EN ENO s D0
Updating of current value of built-in real-time clock
Correction of 30 seconds ±
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
a) Usually, the PLC operates in two-digit year mode. After RUN of PLC, by executing the above
instruction, and transferring K2000 (fixed value) to D8018 (year) for one operation cycle only, the operation is changed to four-digit mode. b) This program must be executed every time the PLC is set to RUN. By transferring K2000, only the
year display is changed to four-digit mode, and the present time is not changed. c) In the case of four-digit mode of the year, 80 to 99 correspond to 1980 to 1999, and 00 to 79
Applied Instructions (External Device Communication)
correspond to 2000 to 2079. Example: 80=1980, 99=1999, 00=2000, 79=2079

21 Applied Instructions (Real Time Clock Control)
21.8 TWR / Set RTC data


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction adds and measures the ON time duration of input contact in one-hour unit.
ON time duration of d2 (set in one-hour unit) ANY16 ANY32
Present value of one-hour unit (data register for power failure hold is specified)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S2 S3 z

21 Applied Instructions (Real Time Clock Control)
21.9 HOUR / Hour Meter

: The time until is turned ON is specified in one-hour unit. : Present value of one-hour unit +1 : Present value of less than one hour (one-second unit) : Device of alarm output destination It turns ON when the current value reaches or exceeds the time specified in .

Present value of one-hour unit Device of alarm output destination
[ +1, ] : Time setting until is turned ON Specify by +1 (upper digit), (lower digit). [ +1, ] : Present value of one-hour unit Store in +1 (upper digit), (lower digit). +2 : Present value of less than one hour (one-second unit) : Specification of alarm output It turns ON when the current value , reaches or exceeds the time specified in .

21 Applied Instructions (Real Time Clock Control)
21.9 HOUR / Hour Meter
Applied Instructions (Real Time Clock Control)
Applied Instructions (Extension Function)
DHOUR EN ENO
M0 turns ON when the cumulative total (D210 and D211) of ON time duration of X000 exceeds 40,000 hours.
ANDD
M0 is set when the current value of D210 and D211 is 40,000 hours or more.
Applied Instructions (Block Data Operation)
ANDD> EN ENO s1 s2 K40000*2
M0 is reset when the current value of D210 and D211 is less than 40,000 hours.
M0
Y007
Applied Instructions (Character String Control)
*1: Program the part in the interrupt disabled range when a device specified for alarm output is used in the interrupt program. (Lay out the program part between the DI instruction and the EI instruction.) *2: Set a value set in of the DHOUR instruction. *3: Set a value set in of the DHOUR instruction. *4: Set a value set in of the DHOUR instruction.
A s d1 d2
When the cumulative total of ON time duration of X000 exceeds 300 hours, Y005 is turned ON. In D201, the present time of less than one hour is stored in one-second unit.
Applied Instructions (Data Comparison)
K300
Y005
: Time setting for turning ON Specified in one-hour unit. : Present value of one-hour unit +1 : Present value of less than one hour (one-second unit) : Specification of alarm output It turns ON when the current value reaches or exceeds the time specified in . (In this example, to be turned ON when reaching 300 hours.)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

This chapter introduces conversion instructions for gray codes used in absolute type rotary encoders and instructions dedicated to analog blocks.
Instruction name Function Reference
Decimal to Gray Code Conversion Section 22.1 GRYP
DGRYP
GBIN
Gray Code to Decimal Conversion Section 22.2 GBINP
DGBINP
RD3A
Read form Dedicated Analog Block Section 22.3 RD3AP
Write to Dedicated Analog Block Section 22.4 WR3AP


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts a binary value into a gray code, and transfers it.
Conversion source data or word device storing conversion source data ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z

22.1 GRY / Decimal to Gray Code Conversion
1. 16-bit operation (GRY, GRYP)

d s Conversion source data or word device storing conversion source data
This instruction converts and transfers data from the source (binary) to the destination (gray code).
When the data specified by is K1234 and the device specified by is K3Y10
BIN 1234 0 1 0 0 1 0 1 1 0 0 1 0
1 1 0 1 1 1 0 1 0 1 1 0

Conversion source data or word device storing conversion source data


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts a gray code into a binary value, and transfers it.
Conversion source data or word device storing conversion source data ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z z z

22.2 GBIN / Gray Code to Decimal Conversion
1. 16-bit operation (GBIN, GBINP)

Conversion source data or word device storing conversion source data
This instruction converts and transfers data from the source (gray code) to the destination (binary).
When the device specified by is K3X000 and the device specified by is D10
1 1 0 1 1 1 0 1 0 1 1 0
0 1 0 0 1 0 1 1 0 0 1 0 b0 b15

Conversion source data or word device storing conversion source data
*1. The FX2N-16M , FX2NC-16M , FX3G and FX3GC PLCs use X000 to X007.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 z
z S1 z
z S1 z z z

22.3 RD3A / Read form Dedicated Analog Block
1. 16-bit operation (RD3A, RD3AP)
RD3A EN m1 m2
d Word device storing the read data
This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.
: Special block number FX3G, FX3GC, FX3U and FX3UC (D, DS, DSS) series PLCs: K0 to K7 FX3UC-32MT-LT(-2) : K1 to K7 (K0 indicates the built-in CC-Link/LT master.) : Analog input channel number FX0N-3A*1 : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A*1 : 0 to 255 (8 bits) FX2N-2AD : 0 to 4095 (12 bits)
*1. The FX0N-3A is available only for the FX3U and FX3UC PLCs.
This instruction reads an analog input value from the analog block FX0N-3A.
: Special block number K0 to K7 : Analog input channel number FX0N-3A : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A : 0 to 255 (8 bits)
This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.
: Special block number K0 to K7 : Analog input channel number FX0N-3A : K1(ch1), K2(ch2) FX2N-2AD : K21(ch1), K22(ch2) : Read data A value read from the analog block is stored. FX0N-3A : 0 to 255 (8 bits) FX2N-2AD : 0 to 4095 (12 bits)


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes a digital value to the analog block FX0N-3A and FX2N-2DA.
Data to be written or word device storing data to be written. ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 z
z S1 z
z S1 z z z

22.4 WR3A / Write to Dedicated Analog Block
1. 16-bit operation (WR3A, WR3AP)
WR3A EN m1 m2
Special block number Analog output channel
s Data to be written or word device storing data to be written.
This instruction writes a digital value to the analog block FX0N-3A or FX2N-2DA.
: Special block number FX3G, FX3GC, FX3U and FX3UC (D, DS, DSS) series PLCs: K0 to K7 FX3UC-32MT-LT(-2) : K1 to K7 (K0 indicates the built-in CC-Link/LT master.) : Analog output channel number FX0N-3A*1 : K1(ch1) FX2N-2DA : K21(ch1), K22(ch2) : Data to be written This specifies the value to be written to the analog block. FX0N-3A*1 : 0 to 255 (8 bits) FX2N-2DA : 0 to 4095 (12 bits)
*1. The FX0N-3A is available only for the FX3U and FX3UC PLCs.
This instruction writes a digital value to the analog block FX0N-3A.
: Special block number K0 to K7 : Analog output channel number FX0N-3A : K1(ch1) : Data to be written This specifies the value to be written to the analog block. FX0N-3A : 0 to 255 (8 bits)
This instruction writes a digital value to the analog block FX0N-3A or FX2N-2DA.
: Special block number K0 to K7 : Analog output channel number FX0N-3A : K1(ch1) FX2N-2DA : K21(ch1), K22(ch2) : Data to be written This specifies the value to be written to the analog block. FX0N-3A : 0 to 255 (8 bits) FX2N-2DA : 0 to 4095 (12 bits)
[Structured ladder/FBD] · Command input · WR3A(EN,m1,m2,s);

23 Applied Instructions (Extension Function)
Applied Instructions (Real Time Clock Control)
This chapter introduces inverter instructions for the FX2N and FX2NC PLCs.
Instruction name Function Reference
External ROM function Section 23.1 EXTRP_IN
External ROM function Section 23.2 EXTRP_OUT
Applied Instructions (Extension Function)
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

23 Applied Instructions (Extension Function)
23.1 EXTR_IN / External ROM function
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes the operation control instructions and parameters of the memory for extension function.



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

23 Applied Instructions (Extension Function)
23.1 EXTR_IN / External ROM function
Applied Instructions (Real Time Clock Control)
→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K11 is set to the device specified by , the control values necessary for inverter operation are written in the PLC.
As for the inverter*1 of the station number specified by , the control values (contents of the device specified by ) are written to the "instruction code" (contents of the device specified by )*2.
EXTR_IN EN s sd1
Applied Instructions (Extension Function)
Inverter station number Inverter instruction code (hexadecimal)
Value written in inverter
*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation
*2. Refer to the "Instruction code List" described later. Also refer to the pages describing in detail the computer links from the inverter manual.
The table below shows the inverter instruction codes and their functions of the device specified by . For the instruction codes, refer to the pages describing in detail the computer links from the inverter manual.
Applied Instructions (Block Data Operation)
Instruction codes of inverter specified by
Contents to be written
HFB Operation mode 3 3 3
HF3 Special monitor selection No. 3
HFA Operation command 3 3 3
Applied Instructions (Character String Control)
HEE Writing set frequency (EEPROM) 3 3 3
HED Writing set frequency (RAM) 3 3 3
HFD Inverter reset 3 3 3
HF4 Batch-clearing error contents 3 3 3
HFC Clearing all parameters 3 3 3
HFC User clear 3
M8104 ON when installing extended ROM cassette D8104 Extended ROM type code
Applied Instructions (Data Comparison)
D8105 Extended ROM version
M8154 Function to be defined for each EXTR instruction D8154 Time waiting for EXTR instruction response
M8155 Communications port being used by EXTR instruction D8155 Step number of instruction occupying communications port
Applied Instructions (Data Table Operation)
M8156 Communication error by EXTR instruction D8156 Communication error by EXTR instruction
M8157 Communication error by EXTR instruction
(Latch)*1 D8157 Communication error by EXTR instruction (Latch)*1
K1 if no error
*1. Cleared when changing from STOP to RUN.
Applied Instructions (External Device Communication)

23 Applied Instructions (Extension Function)
23.1 EXTR_IN / External ROM function
→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K13 is set to device specified by , the inverter parameter is written.
The value (contents of the device specified by ) is written to the parameter (contents of the device specified by ) of the inverter of the station number specified by .
EXTR_IN EN s sd1
Inverter station number Inverter parameter number (decimal)
Value written in inverter
*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation
Command input · sd2 sd3

23 Applied Instructions (Extension Function)
23.2 EXTR_OUT / External ROM function
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction is for the short mail transmission of the memory for extension function, inverter operation monitoring instruction, and parameter readout.
Expression in each language
Applied Instructions (Extension Function)
EXTR_OUT EN s sd1
EXTR_OUT 16 bits Continuous EXTR_OUT(EN,s,sd1,sd2,sd3);
EXTRP_OUT EN s sd1
EXTRP_OUT 16 bits Pulse EXTRP_OUT(EN,s,sd1,sd2,sd3);
Applied Instructions (Block Data Operation)
Variable Description Data type
EN Execution condition Bit
Applied Instructions (Character String Control)
ENO Execution state Bit
Applied Instructions (Data Comparison)
Bit Devices Word Devices Others
System user Digit specification System
Applied Instructions (Data Table Operation)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
z
Applied Instructions (External Device Communication)

23 Applied Instructions (Extension Function)
23.2 EXTR_OUT / External ROM function
→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension function. When K0 is set to the device specified by , the PLC transmits the short mail. The short mail is transmitted by the PLC. The NTT DoCoMo and other firms mobile phones capable of receiving the short mail are notified. The PLC connects to the NTT DoCoMo short mail center through the modem.
Message (contents of the device specified by ) is transmitted to the mail center (mail center specified by ).
EXTR_OUT EN s sd1
K0 Mail center, phone number of transmission destination, waiting time
Transmission message format and message text
M8104 ON when installing extended ROM cassette D8104 Extended ROM type code
D8105 Extended ROM version
M8154 Function to be defined for each EXTR instruction D8154 Time waiting for EXTR instruction response
M8155 Communications port being used by EXTR instruction D8155 Step number of instruction occupying communications port
M8156 Communication error by EXTR instruction D8156 Communication error by EXTR instruction
M8157 Communication error by EXTR instruction
(Latch)*1 D8157 Communication error by EXTR instruction (Latch)*1
K1 if no error
*1. Cleared when changing from STOP to RUN.

23 Applied Instructions (Extension Function)
23.2 EXTR_OUT / External ROM function
Applied Instructions (Real Time Clock Control)
→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K10 is set to the device specified by , the inverter operation is monitored.
As for the inverter*1 of the station number specified by , the operation condition of the inverter corresponding to the "instruction code"*2 (contents of the device specified by ) is read to the device specified by .
EXTR_OUT EN s sd1
K10 Inverter station number Inverter instruction code
Destination device storing readout value.
Applied Instructions (Extension Function)
*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation
*2. Refer to the instruction code list described later. Also refer to the pages describing in detail the computer links from the inverter manual.
The table below shows the inverter instruction codes and their functions of the device specified by . For the instruction codes, refer to the pages describing in detail the computer links from the inverter manual.
Contents to be read out
Applied Instructions (Block Data Operation)
H7B Operation mode 3 3 3
H6F Output frequency [rotational speed] 3 3 3
H70 Output current 3 3 3
H71 Output voltage 3 3
Applied Instructions (Character String Control)
H72 Special monitor 3
H73 Special monitor selection number 3
H74 Error contents 3 3 3
H75 Error contents 3 3 3
H76 Error contents 3 3
H77 Error contents 3 3
H7A Inverter status monitor 3 3 3
H6E Set frequency (E2PROM) readout 3 3 3
H6D Set frequency (RAM) readout 3 3 3
H7F Link parameter extension setting Not commanded by for this instruction. Use EXTR K12 instruction to set "second parameter specification code" for automatic processing. H6C Second parameter switchover
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

23 Applied Instructions (Extension Function)
23.2 EXTR_OUT / External ROM function
→ For the details of the instruction, refer to Communication Control Manual. This instruction is for using the optional memory for extension functions. When K12 is set to the device specified by , the inverter parameter is read out to the PLC.
The value of the parameter specified by is read out from the inverter*1 of the station number specified by to the device specified by .
EXTR_OUT EN s sd1
K13 Inverter station number
Destination device storing readout value.
*1. General purpose inverters FREQROL-A500/E500/S500 (with communications functions) series made by Mitsubishi Electric Corporation
EXTR_IN instruction is provided in the FX2N and FX2NC PLCs V3.00 or later.

24 Applied Instructions (Others)
Applied Instructions (Real Time Clock Control)
This chapter introduces the instructions for generating random numbers, executing CRC data operations, and processing data in high-speed counter operations.
Instruction name Function Reference
Read Device Comment Data Section 24.1 COMRDP
Random Number Generation Section 24.2 RNDP
DUTY Timing Pulse Generation Section 24.3
Applied Instructions (Extension Function)
Cyclic Redundancy Check Section 24.4 CRCP
DHCMOV High Speed Counter Move Section 24.5
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

24 Applied Instructions (Others)
24.1 COMRD / Read Device Comment Data
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads the comment data for registered devices written to the PLC by programming software such as GX Works2.


Device for which comment to be read is registered ANY_SIMPLE

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

24 Applied Instructions (Others)
24.1 COMRD / Read Device Comment Data
Applied Instructions (Real Time Clock Control)
d s Device for which comment to be read is registered
Head device storing read comment
b15 b8 b7 b0
ASCII code of 2nd character
ASCII code of 1st character
Applied Instructions (Extension Function)
ASCII code of 4th character
ASCII code of 3rd character
Comment of device specified in . 16 characters can be stored.
ASCII code of 6th character
ASCII code of 5th character
ASCII code of 8th character ASCII code of 7th character
ASCII code of 14th character ASCII code of 13th character
ASCII code of 16th character
ASCII code of 15th character 0000H
When the comment is made up of an even number of characters:
When M8091 is OFF, "0000H" is stored to the device following the last character. When M8091 is ON, the device following the last character does not change.
For example, when the comment of the device specified by is "Line No.1 Start", it is stored in the device specified by as shown below.
Applied Instructions (Block Data Operation)
b15 b8 b7 b0
69H(i) 65H(e) 4CH(L) 6EH(n) 4EH(N) 31H(1) 2EH(.
Applied Instructions (Character String Control)
74H(t) 72H(r) 53H(S) 61H(a) 74H(t)
LineNo.1Start
20H(space) 20H(space) 0000H 20H(space)
When the comment is made up of an odd number of characters:
When M8091 is OFF, "00H" is written to the high order byte of the device that stores the last character. When M8091 is ON, the high order byte of the device that stores the last character does not change.
ON/OFF status Contents of processing
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
M8091 Output character number
selector signal Refer to the above explanation.
Applied Instructions (External Device Communication)

24 Applied Instructions (Others)
24.1 COMRD / Read Device Comment Data
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program shown below, the comment "Target Line A" registered to D100 is stored in ASCII code in D0 and later when X010 is set to ON. (When M8091 is OFF)
RST(X010,M8091);
COMRDP(X010,D100,D0);
M8091
COMRDP EN ENO
b15 b8 b7 b0
61H(a) 67H(g) 54H(T) 72H(r) 65H(e) 4CH(L) 20H(space)
D3 Comment of D100
6EH(n) 20H(space) 69H(i) 65H(e) 41H(A)
20H(space) 20H(space) 0000H 20H(space)
d s D100 · 74H(t) · Target Line A

24 Applied Instructions (Others)
24.2 RND / Random Number Generation
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction generates random numbers.
Expression in each language
Applied Instructions (Extension Function)
RND 16 bits Continuous RND(EN,d);
RNDP 16 bits Pulse RNDP(EN,d);
Variable Description Data type
Input variable EN Execution condition Bit
ENO Execution state Bit
Applied Instructions (Block Data Operation)
Head device storing a random number ANY16
Bit Devices Word Devices Others
System user Digit specification System
Applied Instructions (Character String Control)
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
Applied Instructions (Data Comparison)
d Head device storing a random number
Pseudo-random number calculation equation: (D8311, D8310) = (D8311, D8310)*1 × 103515245+12345...1) d = "[D8311, D8310]>>16)& Logical product > 00007FFFh"
Applied Instructions (Data Table Operation)
*1. To (D8311, D8310), write a non-negative value (0 to 2,147,483,647) only once when the PLC mode switches from STOP to RUN. [K1 is written to (D8311, D8310) as the initial value when the power is restored.]
Applied Instructions (External Device Communication)

24 Applied Instructions (Others)
24.2 RND / Random Number Generation
In the program example shown below, a random number is stored to D100 every time X010 turns ON. When the PLC mode switches from STOP to RUN, the time data converted into seconds and added by the value "(Year + Month) × Day" is written to (D8311 and D8310).
TRD(M8002,D0);
M8002
TRD EN ENO
The clock data is read.
ADD_E(M8002,D0,D1,D10);
MUL_E(M8002,D10,D2,D12);
Data in hour, minute and second → Data in second
RNDP(X010,D100);
D3 D14
ADD_E EN _IN _IN
D10 D0 D1
MUL_E EN _IN _IN
The data in second is added by the value "(Year + Month) ´ Day", and written to D8311 and D8310.
DADD EN s1 s2
RNDP EN ENO


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction generates the timing signal whose one cycle corresponds to the specified number of operation cycles.
Number of scans (operation cycles) to remain ON ANY16
Number of scans (operation cycles) to remain OFF ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

24 Applied Instructions (Others)
24.3 DUTY / Timing Pulse Generation
1. 16-bit operation (DUTY)


n1, n2 status ON/OFF status of (d)
n1 = 0,n2 ≥ 0 d = fixed to OFF
n1 > 0,n2 = 0 d = fixed to ON
M8330 Timing clock output 1
M8331 Timing clock output 2
M8332 Timing clock output 3
Timing clock output in DUTY instruction
M8333 Timing clock output 4
M8334 Timing clock output 5
D8330 Counted number of scans for timing clock output 1 Counted number of scans for timing clock output 1 in DUTY instruction
D8331 Counted number of scans for timing clock output 2 Counted number of scans for timing clock output 2 in DUTY instruction
D8332 Counted number of scans for timing clock output 3 Counted number of scans for timing clock output 3 in DUTY instruction
D8333 Counted number of scans for timing clock output 4 Counted number of scans for timing clock output 4 in DUTY instruction
D8334 Counted number of scans for timing clock output 5 Counted number of scans for timing clock output 5 in DUTY instruction
Device Name Description

24 Applied Instructions (Others)
24.3 DUTY / Timing Pulse Generation
Applied Instructions (Real Time Clock Control)
) for two or more DUTY instructions.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Extension Function)
In the program shown below, when X000 is set to ON, M8330 is set to ON for 1 scan and OFF for 3 scans.
DUTY EN ENO
DUTY(X000,K1,K3,M8330);
K1 K3
M8330
Applied Instructions (Block Data Operation)
OFF
M8330
OFF ON
1 scan 3 scans
Applied Instructions (Character String Control)
0 1 2 3
0 1 D8330 current value
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others) · [Structured ladder/FBD] · d n1 n2

24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This CRC instruction calculates the CRC (cyclic redundancy check) value which is an error check method used in communication. In addition to CRC value, there are other error check methods such as parity check and sum check. For obtaining the horizontal parity value and sum check value, CCD instruction is available. For the generation of CRC value (CRC-16), the CRC instruction uses "X16 + X15 + X2 + 1" as a polynomial and uses "FFFFH" as a default value.


Head device storing data for which the CRC value is generated ANY16
Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data ANY16

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

24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
Applied Instructions (Real Time Clock Control)
CRC value is generated for "n" 8-bit data (unit: byte) starting from a device specified in , and stored to the device specified by . The 8-bit conversion mode and 16-bit conversion mode are available in this instruction, and the mode can be switched by turning ON or OFF M8161. For the operation in each mode, refer to the later descriptions.
Head device storing data for which the CRC value is generated *1.
Applied Instructions (Extension Function)
*2.
Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data
Device storing the generated CRC value *3.
Applied Instructions (Block Data Operation)
d s n *1 *2 *3
Applied Instructions (Character String Control)
Head device storing data for which the CRC value is generated *1.
Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data *2.
Device storing the generated CRC value *3.
= D0 n = 6
Contents of target data
8 bits 16 bits
Low-order byte Low-order bits of D100 01H 0301H High-order byte High-order bits of D100 03H
Applied Instructions (Data Comparison)
Low-order byte Low-order bits of D101 03H 0203H High-order byte High-order bits of D101 02H
Device storing data for which the CRC value is generated
Low-order byte Low-order bits of D102 00H 1400H High-order byte High-order bits of D102 14H
Applied Instructions (Data Table Operation)
Device storing the generated CRC value
Low-order byte Low-order bits of D0 E4H
41E4H High-order byte High-order bits of D0 41H
Applied Instructions (External Device Communication)

24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
. With regard to the operation result, low-order 8 bits (byte) are stored to a device specified by , and high-order 8 bits (byte) are stored to a device specified by +1.

Head device storing data for which the CRC value is generated *1.
Number of 8-bit (byte) data for which the CRC value is generated or the device storing the number of data *2.
Device storing data for which the CRC value is generated
M8161*1 ON CRC instruction operates in the 8-bit mode.
OFF CRC instruction operates in the 16-bit mode.
*1. Cleared when the PLC mode is changed from RUN to STOP.

CRC-12 X12 + X11 + X3 + X2 + X + 1
CRC-16 X16 + X15 + X2 + 1
CRC-32 X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 + X2 + X + 1
CRC-CCITT X16 + X12 + X5 + 1
Related devices Description

24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
Applied Instructions (Real Time Clock Control)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, the CRC value of the ASCII code "0123456" stored in D100 to D106 is generated and stored to D0 when M0 turns ON.
Applied Instructions (Extension Function)
CRC(LDP(TRUE,M0),D100,K7,D0); M8161 M8000 16-bit conversion mode
LDP EN ENO
CRC EN ENO
d D0 D100 s K7 n
Applied Instructions (Block Data Operation)
D100 3130H Low-order byte 30H
D101 3332H Low-order byte 32H
Device storing data for which the CRC value is generated
D102 3534H Low-order byte 34H
Applied Instructions (Character String Control)
D103 3736H Low-order byte 36H
Device storing the generated CRC value D0 2ACFH Low-order byte CFH
8-bit conversion mode M8161 M8000
LDP(TRUE,M0);
CRC(TRUE,D100,K7,D0);
LDP EN ENO
CRC EN ENO
Applied Instructions (Data Comparison)
d D0 D100 s K7 n
Contents of target data
D100 Low-order byte 30H
D101 Low-order byte 31H
Applied Instructions (Data Table Operation)
D102 Low-order byte 32H
Device storing data for which the CRC value is generated
D103 Low-order byte 33H
D104 Low-order byte 34H
D105 Low-order byte 35H
D106 Low-order byte 36H
D0 Low-order byte CFH
Device storing the generated CRC value
Applied Instructions (External Device Communication)
D1 Low-order byte 2AH

24 Applied Instructions (Others)
24.5 DHCMOV / High Speed Counter Move
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction transfers the current value of a specified high speed counter or ring counter. The function of this instruction varies depending on the PLC version.


Device of high speed counter or ring counter handled as transfer source ANY32
Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer [clear (k1), no processing (K0)] ANY32

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
1. 32-bit operation (DHCMOV)

Device of high speed counter or ring counter handled as transfer source Device handled as transfer destination
d s n Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer
High speed counter C235 to C255 Current value of high speed counter → [ +1, ]
D8398 Current value of [D8399, D8398] → [ +1, ]

24 Applied Instructions (Others)
24.5 DHCMOV / High Speed Counter Move
Applied Instructions (Real Time Clock Control)
"n" set value Operation
K0(H0) Does not clear the current value (no processing).
K1(H1) Clears the current value to "0".
*1. Ring counters (D8099 and D8398) cannot be specified in FX3UC PLCs earlier than Ver. 2.20 (not inclusive).
Applied Instructions (Extension Function)
Current value update timing
Hardware counter When OUT instruction for the counter is executed
Software counter Every time a pulse is input
By using DHCMOV instruction, the current value can be updated and transferred when it is executed.
be received at the rising edge or falling edge of an external input (at reception of input interrupt).
→ Refer to the Program example 2. b) When DHCMOV instruction is used just before a comparison instruction (CMP, ZCP or comparison
contact instruction), the latest value of a high speed counter is used in comparison. Unlike the comparison instruction for high speed counters (DHSCS, DHSCR or DHSZ), the following points must be kept in mind when using the DHCMOV instruction. - When the current value of a hardware counter is compared using CMP, ZCP or comparison contact instruction (not using a designated high speed counter comparison instruction), a hardware counter does not change into a software counter.
Applied Instructions (Block Data Operation)
→ FX Structured Programming Manual [Device & Common] - When the number of high speed software counter comparison instructions is reduced, the total frequency limitation is decreased.
Applied Instructions (Character String Control)
→ FX Structured Programming Manual [Device & Common] - When it is necessary to execute comparison and change an output contact (Y) as soon as the current value of a high speed counter changes, use a designated high seed counter comparison instruction (DHSCS, DHSCR or DHSZ) - DHCMOV instruction can be used as many times as necessary.
When programming DHCMOV instruction in an input interrupt program, the following points should be observed. For assignment of pointers for input interrupt and inputs, refer to the table shown in 5) below.
→ For EI and FEND, refer to Sections 7.6 and 7.7.
Applied Instructions (Data Comparison)
M8394 Pattern program for using the DHCMOV instruction in an interrupt program.
Applied Instructions (Data Table Operation)
Device of high speed counter or ring counter handled as transfer source Device handled as transfer destination
d s n Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer
Program to be processed as input interrupt
Applied Instructions (External Device Communication)
Applied Instructions (Others) · [Interrupt program]

24 Applied Instructions (Others)
24.5 DHCMOV / High Speed Counter Move

When the input X003 turns from OFF to ON (that is, when input interrupt is accepted)
Device of high speed counter or ring counter handled as transfer source
Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer
M8000 When this instruction is executed in interrupt program
Device of high speed counter or ring counter handled as transfer source
'→ [ '+1, '] s d d Specification to clear the current value of high speed counter or ring counter (transfer source) after transfer


Interrupt disable flag Corresponding interrupt pointer Input number corresponding to interrupt pointer
*1. When the PLC mode is changed from RUN to STOP, if an input interrupt is generated while input interrupts are disabled by something other than the interrupt disable flags M8050 to M8055 (after execution of DI instruction and before execution of EI instruction), DHCMOV instruction is immediately executed, but execution of the interrupt program is held. The interrupt program will be executed after EI instruction is executed and interrupt are enabled.
*1. The FX3UC PLCs of before Ver. 2.20 (not inclusive) cannot specify the ring counter (D8099, D8398).

24 Applied Instructions (Others)
24.5 DHCMOV / High Speed Counter Move
Applied Instructions (Real Time Clock Control)
The function of this instruction changes depending on the version as shown in the table below.
Item Outline of function FX3U FX3UC
Ver. 2.20 or later Ver. 2.20 or later Target device Ring counter (D8099 and D8398) can be specified in the device specified by
An operation error occurs in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Extension Function)
The AND compare instruction (ANDD>=) is not available in S M8000 DHCMOV EN ENO
d s n C235 D0
Applied Instructions (Block Data Operation)
ANDD>= EN s1 s2
K500
when DHCMOV instruction is executed. *1.
Applied Instructions (Character String Control)
DHCMOV instruction is executed.
[Main program] [Main program]
EI(TRUE);
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
d s n C235 K1*1
Applied Instructions (External Device Communication)
*1. K0: The current value of the high speed counter is not cleared when DHCMOV instruction is executed. K1: The current value of the high speed counter is cleared when DHCMOV instruction is executed.

25 Applied Instructions (Block Data Operation)
This chapter introduces the instructions for adding, subtracting and comparing block data.
Instruction name Function Reference
Block Data Addition Section 25.1 BK+P
DBK+P
BK-
Block Data Subtraction Section 25.2 BK-P
DBK-P
BKCMP=
BKCMP>
BKCMP<
BKCMP<>
BKCMP<=
BKCMP>=
BKCMP=P
BKCMP>P
BKCMP<P
BKCMP<>P
BKCMP<=P
BKCMP>=P
Block Data Compare Section 25.3
DBKCMP>
DBKCMP<
DBKCMP<>
DBKCMP<=
DBKCMP>=
DBKCMP=P
DBKCMP>P
DBKCMP<P
DBKCMP<>P
DBKCMP<=P
DBKCMP>=P


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Added constant or head device storing addition data ANY16 ANY32

25 Applied Instructions (Block Data Operation)
25.1 BK+ / Block Data Addition

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
1. 16-bit operation (BK+/BK+P)

s2 n Added constant or head device storing addition data


25 Applied Instructions (Block Data Operation)
25.1 BK+ / Block Data Addition
Applied Instructions (Real Time Clock Control)
s1 ] +1, [ s1 s1 ] +3, [ s1
s2 ] +1, [ s2 s2 ] +3, [ s2
+2 s1 ] +5, [ s1 +4
+2 s2 ] +5, [ s2 +4
"2n" points +
K-1234
s1 ] +2n-3, [ s1
+2n-4 s1 ] +2n-1, [ s1 +2n-2
s2 ] +2n-3, [ s2
+2n-4 s2 ] +2n-1, [ s2 +2n-2
K4000
K4321
d ] +1, [ d d ] +3, [ d
+2 d ] +5, [ d +4
Applied Instructions (Extension Function)
d ] +2n-3, [ d
+2n-4 d ] +2n-1, [ d +2n-2
K8321
s1 ] +1, [ s1 s1 ] +3, [ s1
+2 s1 ] +5, [ s1 +4
s2 ] +1, [ s2 K4312
s1 ] +2n-3, [ s1
+2n-4 s1 ] +2n-1, [ s1 +2n-2
Applied Instructions (Block Data Operation)
d ] +1, [ d d ] +3, [ d
+2 d ] +5, [ d +4
Applied Instructions (Character String Control)
d ] +2n-3, [ d
+2n-4 d ] +2n-1, [ d +2n-2
K8321
Related instruction
BK- Subtracts binary block data.
Applied Instructions (Data Comparison)
K-32768(H8000) + K-2(HFFFE) → K32766(H7FFE)
b) In the case of 32-bit operation
K-2,147,483,648(H80000000) + K-2(HFFFFFFFE) → K2,147,483,646(H7FFFFFFE)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

25 Applied Instructions (Block Data Operation)
25.1 BK+ / Block Data Addition
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program shown below, the specified number of pieces of data stored in D150 to D0 are added to the specified number of pieces of data stored in D100 to D0 when X020 is set to ON, and the operation result is stored in D200 and later



FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Subtracted constant or head device storing subtraction data ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

25 Applied Instructions (Block Data Operation)
25.2 BK- / Block Data Subtraction
1. 16-bit operation (BK-/BK-P)

n Subtracted constant or head device storing subtraction data

Head device storing subtraction data Subtracted constant or head device storing subtraction data
s1 ] +1, [ s1 s1 ] +3, [ s1
s2 ] +1, [ s2 s2 ] +3, [ s2
d ] +1, [ d d ] +3, [ d

25 Applied Instructions (Block Data Operation)
25.2 BK- / Block Data Subtraction
Applied Instructions (Real Time Clock Control)
s1 ] +1, [ s1 s1 ] +3, [ s1
+2 s1 ] +5, [ s1 +4
"2n" points —
s2 ] +1, [ s2 K8880
s1 ] +2n-3, [ s1
+2n-4 s1 ] +2n-1, [ s1 +2n-2
K4352
d ] +1, [ d d ] +3, [ d
+2 d ] +5, [ d +4
Applied Instructions (Extension Function)
d ] +2n-3, [ d
+2n-4 d ] +2n-1, [ d +2n-2
K-4528
Related instruction
BK+ Adds binary block data.
Applied Instructions (Block Data Operation)
K32767(H7FFF) - K-2(HFFFE) → K-32767(H8001)
b) In the case of 32-bit operation
Applied Instructions (Character String Control)
K2,147,483,647(H7FFFFFFF) - K-2(HFFFFFFFE) → K-2,147,483,647(H80000001)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

25 Applied Instructions (Block Data Operation)
25.2 BK- / Block Data Subtraction
In the program shown below, the constant "8765" is subtracted from the data stored in D100 to D102 when X010 is set to ON, and the operation result is stored in D200 and later.
D100 K8765
d s1 s2 n
D100 D101 D102
K8701 K3502
D201 D202
K-64 K-5263


25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
These instructions compare block data in the comparison condition set in each instruction.

25 Applied Instructions (Block Data Operation)
25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

*1. Refer to "Cautions".


25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Comparison value or device storing comparison value ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P

25 Applied Instructions (Block Data Operation)
25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare

*1. BKCMP=, BKCMP>, BKCMPP, BKCMP
*3. An operation example of BKCMP= instruction is shown here.

Instruction Comparison result ON (1) condition Comparison result OFF (0) condition

25 Applied Instructions (Block Data Operation)
25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Applied Instructions (Real Time Clock Control)
EN ENO
Head device storing comparison source data Comparison value or device storing comparison value
d s1 s2 n
Head device storing comparison result
Number of pieces of comparison data
Applied Instructions (Extension Function)
s1 ] +1, [ s1 s1 ] +3, [ s1
s2 ] +1, [ s2 s2 ] +3, [ s2
+2 s1 ] +5, [ s1 +4
+2 s2 ] +5, [ s2 +4
K5678
s1 ] +2n-3, [ s1
+2n-4 s1 ] +2n-1, [ s1 +2n-2
s2 ] +2n-3, [ s2
+2n-4 s2 ] +2n-1, [ s2 +2n-2
K4321
K1200
*2 An example of DBKCMP>.
ON(1)
OFF(0)
ON(1)
Applied Instructions (Block Data Operation)
s2 [ +1, ] s2
+2] s2 s2 [
+4] s2 s2 [
s1 [ +1, ] s1
Applied Instructions (Character String Control)
*3 An operation example of DBKCMP= instruction is shown here.
+2n-4] s2 s2 [
+2n-1, +2n-2] s2 s2 [
ON(1) OFF(0)
ON(1)
OFF(0)
OFF(0)
Instruction Comparison result ON (1) condition Comparison result OFF (0) condition
Applied Instructions (Data Comparison)
DBKCMP= [ +1, ] = [ +1, ] [ +1, ] ≠ [ +1, ]
DBKCMP> [ +1, ] > [ +1, ] [ +1, ] ≤ [ +1, ]
DBKCMP< [ +1, ] < [ +1, ] [ +1, ] ≥ [ +1, ]
DBKCMP +1, ] ≠ [ +1, ] [ +1, ] = [ +1, ]
DBKCMP [ +1, ]
Applied Instructions (Data Table Operation)
DBKCMP>= [ +1, ] ≥ [ +1, ] [ +1, ] < [ +1, ]
Applied Instructions (External Device Communication)

25 Applied Instructions (Block Data Operation)
25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
M8090 Block comparison signal Turns ON when all comparison results are "ON (1)" in a block data instruction. DBKCMP=, DBKCMP>, DBKCMP
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
32-bit operation) points starting from the device specified by (error code: K6706).
32-bit operation) points starting from the device specified by (error code: K6706).
Device Name Description

25 Applied Instructions (Block Data Operation)
25.3 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Applied Instructions (Real Time Clock Control)
D100 D200
d s1 s2 n
K4
Applied Instructions (Extension Function)
K1000 K2000
D200 D201 D202 D203
K1000 K2000
M10 ON ON
D101 D102 D103
ON OFF M11 M12 M13
=
K4000 K3000
K4000 K5000
OFF Y000
Applied Instructions (Block Data Operation)
(When all of M10 to M13 are ON, Y000 is set to ON.)
Applied Instructions (Character String Control)
d s1 s2 n
K4
b15 b7 b4 b0
D0 before operation 0 1 0 0 0 1 0 1 0
Applied Instructions (Data Comparison)
D11 D12 D13
<> K1000
K2222 K1000
b15 b7 b4 b0 D0 after operation 0 1 0 0 1 0 1 0 1 0
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
This chapter introduces the instructions for controlling character strings such as linking character string data, replacing some characters and extracting character string data.
Instruction name Function Reference
BIN to Character String Conversion Section 26.1 STRP
DSTRP
VAL
Character String to BIN Conversion Section 26.2 VALP
DVALP
Link Character Strings Section 26.3 $+P
Character String Length Detection Section 26.4 LENP
Extracting Character String Data from the Right Section 26.5 RIGHTP
Extracting Character String Data from the Left Section 26.6 LEFTP
Random Selection of Character Strings Section 26.7 MIDRP
Random Replacement of Character Strings Section 26.8 MIDWP
Character string search Section 26.9 INSTRP
Character String Transfer Section 26.10 $MOVP
$+


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts binary data into character strings (ASCII codes). On the other hand, the ESTR instruction converts floating point data into character strings.
Head device storing the number of digits of a numeric value to be converted (2 points occupied) ARRAY [0..1] OF ANY16
Device storing binary data to be converted ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y Modifier K H E " " P
z

26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
1. 16-bit operation (STR/STRP)

Head device storing the number of digits of a numeric value to be converted
+1 For number of all digits For value stored in
0000H is automatically stored at the end of a character string.
00H is automatically stored at the end of a character string.
a) As the sign, "space" (20H) is stored when the 16-bit binary data stored in is positive, and "-" (2DH) is stored when the 16-bit binary data stored in is negative. b) When the number of digits of the

decimal part + 1 is set to any value other than "0", the decimal point "." (2EH) is automatically added in "number of digits of decimal part + 1"th digit. When the number of digits of the decimal part + 1 is set to "0", the decimal point is not added. c) When the number of digits of the

decimal part + 1 is larger than the number of digits of 16-bit binary data stored in , "0" (30H) is automatically added, and the data is shifted to the right end during conversion.

26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
d) When the number of all digits stored
Applied Instructions (Real Time Clock Control)
Number of all digits
in excluding the sign and decimal point is larger than the number of digits of 16-bit binary data stored in , "space" (20H) is stored in each digit between the sign and the numeric value. When the number of all digits stored in excluding the sign and decimal point is smaller than the number of digits of 16-bit binary data stored in , an error is caused. e) "00H" indicating the end of a character string is automatically stored at the end of a converted
Number of digits of decimal part
"20H" (space) is stored in each digit
Applied Instructions (Extension Function)
character string. When the number of all digits is even, "0000H" is stored in the device after the last character. When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing the last character.
Head device storing the number of digits of a numeric value to be converted
Head device storing converted character string Device storing binary data to be converted
Applied Instructions (Block Data Operation)
Number of all digits Number of digits
ASCII code in "(Value
ASCII code indicating sign
all digits - 1)"th digit ASCII code in "(Value
Applied Instructions (Character String Control)
ASCII code in "(Value
all digits - 3)"th digit
all digits - 2)"th digit
ASCII code in "(Value
ASCII code in "(Value
For number of all digits For value stored in
all digits - 5)"th digit ASCII code in "(Value
all digits - 4)"th digit ASCII code in "(Value
all digits - 7)"th digit ASCII code in "(Value
all digits - 6)"th digit ASCII code in "(Value
High order 16 bits Low order 16 bits b31 b16 b15 b0 +1
all digits - 9)"th digit
all digits - 8)"th digit ASCII code in "(Value
specifying number of all digits - 10)"th digit
00H is automatically stored at the end of a character string.
Applied Instructions (Data Comparison)
2DH(-)
+1 For number of all digits
35H(5)
4 3 2 1
2EH(.)
+3 31H(1)
32H(2)
-654321 32-bit binary data
Applied Instructions (Data Table Operation)
0000H is automatically stored at the end of a character string.
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
a) For the sign, "space" (20H) is stored when the 32-bit binary data stored in is positive, and "-" (2DH) is stored when the 32-bit binary data stored in is negative. b) When the number of digits of the

decimal part + 1 is set to any value other than "0", the decimal point "." (2EH) is automatically added in "number of digits of decimal part + 1"th digit. When the number of digits of the decimal part + 1 is set to "0", the decimal point is not added. c) When the number of digits of the

decimal part + 1 is larger than the number of digits of 32-bit binary data stored in , "0" (30H) is automatically added, and the data is shifted to the right end during conversion. d) When the number of all digits stored in
excluding the sign and decimal point is larger than the number of digits of 32-bit binary data stored in
Number of all digits Number of digits of decimal part
0 5 4 3 1
, "space" (20H) is stored in each digit between the sign and the numeric value. When the number of all digits stored in
"20H" (space) is stored in each digit
excluding the sign and decimal point is smaller than the number of digits of binary data stored in , an error is caused. e) "00H" indicating the end of a character string is automatically stored at the end of a converted
character string. When the number of all digits is even, "0000H" is stored in the device after the last character. When the number of all digits is odd, "00H" is stored in the high-order byte (8 bits) of the device storing the last character.

DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.
DEVAL Converts a character string (ASCII codes) into binary floating point data.
VAL Converts a character string (ASCII codes) into binary data.
32-bit binary data · -543210

26 Applied Instructions (Character String Control)
26.1 STR / BIN to Character String Conversion
Applied Instructions (Real Time Clock Control)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
16-bit operation 2 to 8
32-bit operation 2 to 13
16-bit operation 0 to 5
Applied Instructions (Extension Function)
32-bit operation 0 to 10
In the program below, the 16-bit binary data stored in D10 is converted into a character string in accordance with the digit specification by D0 and D1 when X000 is set to ON, and then stored in D20 to D23.
Applied Instructions (Block Data Operation)
Data to be converted is set.
Applied Instructions (Character String Control)
STRP(X000,D0,D10,D20);
The number of all digits is set.
The number of digits of the decimal part is set.
Applied Instructions (Data Comparison)
b15 b8 b7 b0 D20 31H(1) 36H(6)
Applied Instructions (Data Table Operation)
16-bit binary data 12672" "
20H(Space) 34H(2) 32H(2) 37H(7) D21 D22 D23
Number of all digits Number of digits of decimal part
0000H
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts a character string (ASCII codes) into binary data. On the other hand, EVAL instruction converts a character string (ASCII codes) into floating point data.


Head device storing a character string to be converted into binary data. String
Head device storing the number of digits of the binary data acquired by conversion. (2 points occupied) ARRAY [0..1] OF ANY16
Head device storing the binary data acquired by conversion. ANY16 ANY32

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

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
Applied Instructions (Real Time Clock Control)
, the number of digits of the decimal part is stored in the device specified by + 1, and the converted binary data is stored in the device specified by . In conversion from a character string into binary data, the data from the device specified by to a device number storing "00H" is handled as a character string in byte units.
Head device storing a character string to be converted into binary data
Head device storing the number of digits of the binary data acquired by conversion.
Applied Instructions (Extension Function)
Head device storing the binary data acquired by conversion.
Number of all digits Number of digits of decimal part
ASCII code of 1st character
ASCII code indicating sign
ASCII code of 3rd character
ASCII code of 2nd character
Integer value in which decimal point is ignored.
ASCII code of 5th character
ASCII code of 4th character
ASCII code of 7th character
ASCII code of 6th character
1st character 2nd character
Applied Instructions (Block Data Operation)
It indicates the end of character string.
For example, when a character string "-123.45" is specified in the device specified by and later, the conversion result is stored in the devices specified by and as shown below.
Applied Instructions (Character String Control)
2DH(-)
33H(3)
32H(2)
34H(4)
2EH( )
- 1 2 3 4 5
35H(5)
It indicates the end of character string.
Number of all characters (digits) 2 to 8
Number of characters (digits) of decimal part 0 to 5 and smaller than "number of all digits - 3"
Applied Instructions (Data Comparison)
Numeric range when decimal point is ignored -32768 to 32767 Example) "123.45" → "12345"
b) Character types used in characters to be converted
Positive numeric value "Space (20H)"
Negative numeric value "-(2DH)"
Applied Instructions (Data Table Operation)
Decimal point ".(2EH)"
Number "0(30H)" to 9(39H)"
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion

Number of digits of decimal part 16-bit binary data
, the number of digits of the decimal part is stored in the device specified by + 1, and the binary data is stored in the device specified by . In conversion from a character string into binary data, the data from the device specified by to a device number storing "00H" is handled as a character string in byte units.

d1 d2 s Head device storing a character string to be converted into binary data Head device storing the number of digits of the binary data acquired by conversion.
Head device storing the binary data acquired by conversion.
Number of all digits Number of digits of decimal part
8th character ASCII code of 10th character ASCII code of 12th character
For example, when a character string "-12345.678" is specified in the device specified by and later, the conversion result is stored in the devices specified by and as shown below.

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
Applied Instructions (Real Time Clock Control)
Number of all characters (digits) 2 to 13
Number of characters (digits) of decimal part 0 to 10 and smaller than "number of all digits - 3"
Numeric range when decimal point is ignored
-2,147,483,648 to 2,147,483,647 Example) "12345.678" to "12345678"
b) Character types used in characters to be converted
Positive numeric value "Space (20H)"
Negative numeric value "-(2DH)"
Decimal point ".(2EH)"
Applied Instructions (Extension Function)
Number "0(30H)" to "9(39H)"
Applied Instructions (Block Data Operation)
Number of all digits
2 4 2 1 - 3
Number of digits of decimal part
Number of all digits
Applied Instructions (Character String Control)
Number of digits of decimal part
8 4 2 1 3
DESTR Converts binary floating point data into a character string (ASCII codes) with a specified number of digits.
DEVAL Converts a character string (ASCII codes) into binary floating point data.
STR Converts binary data into a character string (ASCII codes).
Applied Instructions (Data Comparison)
2) Sign data "space (20H)" or "- (2DH)" must be stored in the first byte (lower order 8 bits of the head device set in the device specified by ). Only the ASCII code data "0 (30H)" to "9 (39H)", "space (20H)" and "decimal point (2EH)" can be stored from the second byte to the "00H" at the end of the character string of the device specified by . If "- (2DH)" is stored in the second byte or later, an operation error occurs (error code: K6706).
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
16-bit operation 2 to 8
32-bit operation 2 to 13
16-bit operation 0 to 5
32-bit operation 0 to 10
16-bit operation -32768 to 32767
32-bit operation -2,147,483,648 to 2,147,483,647
Setting range · Setting range · Setting range

26 Applied Instructions (Character String Control)
26.2 VAL / Character String to BIN Conversion
Applied Instructions (Real Time Clock Control)
VALP(X000,D20,D10,D0);
d1 d2 s D20 D10
b15 b8 b7 b0 D20 31H(1) 2EH(.) 2DH(-) 36H(6) 34H(4) 35H(5)
Applied Instructions (Extension Function)
Number of all digits Number of digits of decimal part
"00H" is stored here.
DVALP EN ENO
d1 d2 s D20 D10
Applied Instructions (Block Data Operation)
b15 b8 b7 b0 D20 37H(7) 31H(1) 20H(Space) 39H(9) 30H(0) 30H(0)
D21 D22 D23 D24 D25
D10 Number of all digits Number of digits of decimal part 36H(6) 2EH(.) 31H(1) 31H(1)
Applied Instructions (Character String Control)
"00H" is stored here.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

26 Applied Instructions (Character String Control)
26.3 $+ / Link Character Strings
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction links a character string to another character string.

*1. Refer to "Cautions".

Head device storing the link source data (character string) or directly specified character string String
Head device storing the link data (character string) or directly specified character string String
Head device storing the linked data (character string) String

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

26 Applied Instructions (Character String Control)
26.3 $+ / Link Character Strings
Applied Instructions (Real Time Clock Control)
The character string data stored in the device specified by and later is linked to the end of the character string data stored in the device specified by and later, and the linked data is stored to devices starting from the device specified by . A character string specified by and indicates the data from the specified device to the first "00H" in units of byte.
Head device storing the link source data (character string) or directly specified character string
Head device storing the linked data (character string)
Head device storing the link data (character string) or directly specified character string
Applied Instructions (Extension Function)
b15---b8 b7 b0 b15---b8 b7 b0 b15---b8 b7 b0
d s1 s2 s1
35H(5) 31H(1)
46H(F) 48H(H)
2DH(-) 41H(A) + +1
39H(9) 33H(3)
00H 41H(A) +1
2DH(-) 41H(A)
00H
+2 35H(5) 31H(1)
39H(9) 33H(3)
+2 "00H" is automatically stored.
Applied Instructions (Block Data Operation)
storing the last character. b) When the number of characters after linking is even, "0000H" is stored in the device after the last
character.
Applied Instructions (Character String Control)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.3 $+ / Link Character Strings
In the program example shown below, a character string stored in D10 to D12 (abcde) is linked to the character string "ABCD", and the result is stored to D100 and later when X000 turns ON.
D100 D10 "ABCD"
b15---b8 b7 b0 b15---b8 b7 b0
43H(C)
42H(B)
00H
44H(D)
"00H" is automatically stored.


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction detects the number of characters (bytes) of a specified character string.
Head device storing a character string whose number of characters is to be detected String
Device storing the detected character string length (number of bytes) ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z

26 Applied Instructions (Character String Control)
26.4 LEN / Character String Length Detection
1. 16-bit operation (LEN/LENP)
The length of a character string stored in the device specified by and later is detected, and stored to the device specified by . Data starting from the device specified by until the first device storing "00H" is handled as a character string in units of byte.

d s Head device storing a character string whose number of characters is to be detected
Device storing the detected character string length (number of bytes)
For example, when "ABCDEFGHI" is stored in the device specified by and later as shown below, K9 is stored in the device specified by .
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.


In the program example shown below, the length of a character string stored in D0 and later is output in 4-digit BCD to Y040 to Y057 when X000 turns ON.
The length of the character string is output to the display unit.
49H(I) "MITSUBISHI" (Characters "ABC ..." after "00H" are ignored.) 49H(I)

26 Applied Instructions (Character String Control)
26.5 RIGHT / Extracting Character String Data from the Right
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction extracts a specified number of characters from the right end of a specified character string.
→ For handling of character strings, refer to "FX Structured Programming Manual [Device &
1. Format and operation, execution form
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Common]." diagram (page 636)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-636-1.webp)


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

26 Applied Instructions (Character String Control)
26.5 RIGHT / Extracting Character String Data from the Right
Applied Instructions (Real Time Clock Control)
. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.
Applied Instructions (Extension Function)
Head device storing a character string Head device storing extracted character string
Number of characters to be extracted
b15 b8 b7 b0 b15 b8 b7 b0
ASCII code for "(last character
ASCII code for "(last character
+0 +0 s d
2nd character ASCII code for
1st character ASCII code for
- n + 2)"th character
- n + 1)"th character
ASCII code for "(last character
ASCII code for "(last character
- n + 4)"th character
- n + 3)"th character
ASCII code for "(last character
ASCII code for "(last character
ASCII code for "(last character
ASCII code for "(last character
Applied Instructions (Block Data Operation)
- n + 2)"th character
- n + 1)"th character
00H ASCII code for
ASCII code for "(last character
ASCII code for "(last character
- n + 4)"th character
- n + 3)"th character
ASCII code for "(last character
ASCII code for "(last character
Applied Instructions (Character String Control)
00H ASCII code for
In the case of "n = 5"
+0 +0 s d b15 b8 b7 b0 b15 b8 b7 b0
32H(2) 31H(1)
44H(D) 43H(C)
34H(4)
33H(3)
46H(F) 45H(E)
+2 00H "12345"
35H(5)
31H(1) 32H(2)
34H(4) 33H(3)
35H(5) ASCII code for 5th character
Applied Instructions (Data Comparison)
ASCII code for 1st character
a) A character string stored in the device specified by and later indicates data stored in devices from the specified device until "00H" is first detected in byte units.
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.5 RIGHT / Extracting Character String Data from the Right
in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes
express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, 4 characters are extracted from the right end of the character string data stored in R0 and later, and stored to D0 and later when X000 turns ON.



26.6 LEFT / Extracting Character String Data from the Left
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction extracts a specified number of characters from the left end of a specified character string.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G X Y M K H E " " P
z
z

26 Applied Instructions (Character String Control)
26.6 LEFT / Extracting Character String Data from the Left
. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.

Head device storing a character string Head device storing extracted character string Number of characters to be extracted

+0 +0 s d b15 b8 b7 b0 b15 b8 b7 b0 b15 b8 b7 b0
a) A character string stored in the device specified by and later indicates data stored in devices from the specified device until "00H" is first detected in byte units.

26 Applied Instructions (Character String Control)
26.6 LEFT / Extracting Character String Data from the Left
Applied Instructions (Real Time Clock Control)
in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes
express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Extension Function)
Applied Instructions (Block Data Operation)
In the program example shown below, the number of characters which is equivalent to the number stored in D0 is extracted from the left end of the character string data stored in D100 and later, and stored to R10 and later when X010 turns ON.
LEFT(X010,D100,D0,R10); X010 LEFT EN ENO
Applied Instructions (Character String Control)
d s n D100 R10 D0
ASCII code for 1st character
b15 b8 b7 b0 b15 b8 b7 b0
51H(Q) 53H(S)
51H(Q) 53H(S)
R11
4EH(N) 4FH(O)
4EH(N) 4FH(O)
48H(H) 44H(D)
R12
44H(D) 48H(H)
42H(B) 41H(A)
R13
0000H "SQONHD"
Applied Instructions (Data Comparison)
"SQONHDAB"
ASCII code for 6th character
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others) · [Structured ladder/FBD]

26 Applied Instructions (Character String Control)
26.7 MIDR / Random Selection of Character Strings
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction extracts a specified number of characters from arbitrary positions of a specified character string.



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

26 Applied Instructions (Character String Control)
26.7 MIDR / Random Selection of Character Strings
Applied Instructions (Real Time Clock Control)
" + 1" characters are extracted leftward from the position specified by of the character string data stored in the device specified by and later, and stored to the device specified by and later. When characters are extracted from a character string, "00H" is automatically added at the end of the extracted characters.
Applied Instructions (Extension Function)
Head device storing a character string Head device specifying the head position and number of characters to be extracted
Head device storing extracted character string
1st character Target character string (extraction source) Extracted character string
b15 b8 b7 b0 b15 b8 b7 b0
46H(F) 45H(E)
44H(D) 43H(C)
48H(H) 47H(G)
46H(F) 45H(E)
00H "EFGHI"
49H(I)
48H(H)
47H(G)
4AH(J)
Applied Instructions (Block Data Operation)
5 characters starting from 5th character +1
a) A character string specified by indicates data stored in devices from the specified device until "00H" is first detected in units of byte.
Applied Instructions (Character String Control)
b) When the number of characters to be extracted specified by " + 1" is "0", the extraction processing is not executed.
c) When the number of characters to be extracted specified by " + 1" is "-1", the entire character string specified by is stored to the device specified by and later.
b15 b8 b7 b0 b15 b8 b7 b0
46H(F) 45H(E)
44H(D) 43H(C)
48H(H) 47H(G)
46H(F) 45H(E)
4AH(J) 49H(I)
48H(H)
47H(G)
00H +3
4BH(K)
Applied Instructions (Data Comparison)
4AH(J) 49H(I)
00H
4BH(K)
"ABCDEFGHIJK"
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.7 MIDR / Random Selection of Character Strings
in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes
express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, four characters are extracted from the third character from the left end of the character string data stored in D10 and later, and then stored to D0 and later when X000 turns ON.


26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction replaces the characters in arbitrary positions inside designated character string with a specified character string.
→ For handling of character strings, refer to "FX Structured Programming Manual [Device &
1. Format and operation, execution form
Applied Instructions (Extension Function)
Expression in each language
MIDW 16 bits Continuous MIDW(EN,s1,s2,d);
MIDWP 16 bits Pulse MIDWP(EN,s1,s2,d);
Applied Instructions (Block Data Operation)
Variable Description Data type
EN Execution condition Bit
Head device storing a character string used in overwriting String
Applied Instructions (Character String Control)
ENO Execution state Bit
Head device storing a character string overwritte String
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
Applied Instructions (Data Comparison)
z
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
1. 16-bit operation (MIDW/MIDWP)
Character data specified by " + 1" are extracted from the left end (that is, the head) of the character string data stored in the device specified by and later, and stored to the position specified by and later of the character string data stored in the device specified by and later.

Head device storing a character string used in overwriting
Head device specifying the head position and number of characters to be overwritten
3 Position from the left end in the character string stored in and later Number of characters from the left end in the character string stored in and later
Six characters starting from 3rd character (overwritten character string)

Position from the left end in the character string stored in and later d
Number of characters from the left end in the character string stored in and later s1
Characters from the 5th character to the last character are overwritten. Excessive characters, "35H (5)" to "37H (7)", are not stored.

26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
Applied Instructions (Real Time Clock Control)
b15 b8 b7 b0
b15 b8 b7 b0
41H(A)
33H(3) 32H(2) +1
44H(D) 43H(C)
35H(5) 34H(4)
46H(F) 45H(E)
00H
48H(H)
47H(G)
4AH(J) 49H(I)
2 Position from the left end in the character string stored in and later Number of characters from the left end in the character string stored in and later
"ABCDEFGHIJK"
Applied Instructions (Extension Function)
b15 b8 b7 b0
41H(A)
32H(2) 31H(1)
34H(4) 33H(3)
48H(H)
35H(5)
+4 4AH(J) 49H(I)
+5 00H 4BH(K)
"A012345HIJK"
Six characters from the 2nd character are overwritten.
Applied Instructions (Block Data Operation)
in which two bytes express one character such as shift JIS codes, the length of one character is detected as "2". b) When extracting characters from a character string including character codes in which two bytes
Applied Instructions (Character String Control)
express one character such as shift JIS codes, consider the number of characters to be extracted in units of character codes for one character. Note that the expected character code is not given if only one byte is extracted out of a 2-byte character code.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.8 MIDW / Random Replacement of Character Strings
In the program example shown below, four characters are extracted from the character string data stored in D0 and later, and stored to the third character (from the left end) and later for the character string data stored in D100 and later when X010 turns ON.



FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction searches a specified character string within another character string.
Head device storing a character string to search for String
Head device storing a character string to be searched String
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

26 Applied Instructions (Character String Control)
26.9 INSTR / Character string search
1. 16-bit operation (INSTR/INSTRP)

Head device storing search result Head device storing a character string to search for Head device storing a character string to be searched
Character string to search for Character string to be searched
Search is started from the 3rd character. (n=3) 5th character from the head character 46H(F) 48H(H) 45H(E) 47H(G)
5 Stores the position where the first detected character is located from the head character in the character string data stored in .

Character string to search for Character string to be searched
Search is started from the 3rd character. (n=3) 5th character from he head character

26 Applied Instructions (Character String Control)
26.9 INSTR / Character string search
Applied Instructions (Real Time Clock Control)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Extension Function)
X000 INSTR EN ENO
D100 D0 R0
d s1 s2 n
Character string to search for Character string to be searched
Applied Instructions (Block Data Operation)
b15 b8 b7 b0
These characters are not searched because the search start position is "5". Searched from the 5th character. 32H(2) 49H(I) 31H(1) 43H(C)
49H(I) 33H(3) 43H(C) 32H(2)
49H(I) 33H(3) 43H(C) 32H(2) 00H
R1
D1 D2
R2 R3 R4
"CI23"
00H 4DH(M)
Applied Instructions (Character String Control)
0 Because the searched character string is not detected, "0" is stored.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others) · b15 · b8 b7 b0

26 Applied Instructions (Character String Control)
26.10 $MOV / Character String Transfer
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction transfers character string data.

*1. Refer to "Cautions".

Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source String

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

26 Applied Instructions (Character String Control)
26.10 $MOV / Character String Transfer
Applied Instructions (Real Time Clock Control)
The character string data stored in the device specified by and later is transferred to the device specified by and later. From the device number specified by to a device after that which stores "00H" in its high-order or low- order byte are transferred at one time.
Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source
Head device storing transferred character string
Applied Instructions (Extension Function)
b15 b8 b7 b0 b15 b8 b7 b0
"00H" indicates the end of character string.
Even if the device range storing the character string data to be transferred overlaps the device range storing the transferred character string data, transfer is executed. For example, when a character string stored in D10 to D13 is transferred to D11 to D14, the transfer is executed as shown below.
Applied Instructions (Block Data Operation)
b15 b8 b7 b0
b15 b8 b7 b0
Applied Instructions (Character String Control)
31H(1)
D10 32H(2)
31H(1)
It is same as the character string before transfer.
33H(3)
32H(2) 31H(1)
36H(6)
35H(5)
34H(4)
33H(3)
00H
36H(6)
35H(5)
00H 00H
Cautions
Applied Instructions (Data Comparison)
Directly specified character string (up to 32 characters) or head device storing character string which is handled as the transfer source
d s Head device storing transferred character string
Applied Instructions (Data Table Operation)
b15 b8 b7 b0 b15 b8 b7 b0
d s +0 +0
41H(A)
42H(B)
41H(A)
44H(D)
43H(C)
44H(D)
43H(C)
45H(E)
00H
00H
00H
The high-order byte is not transferred.
"00H" is automatically stored in the high-order byte.
Applied Instructions (External Device Communication)

26 Applied Instructions (Character String Control)
26.10 $MOV / Character String Transfer
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, character string data stored in D10 to D12 is transferred to D20 through D22 when X000 is set to ON.
D20 D10
b15 b8 b7 b0 b15 b8 b7 b0
2AH(*) D20
4DH(M)
2AH(*)
45H(E) D11
45H(E)
45H(E)
45H(E)
00H 00H 00H
[Structured ladder/FBD] · d s

Applied Instructions (Real Time Clock Control)
This chapter introduces the instructions for reading last-in data and controlling leftward/rightward shift instructions with carry.
Instruction name Function Reference
Deleting Data from Tables Section 27.1 FDELP
Inserting Data to Tables Section 27.2 FINSP
Applied Instructions (Extension Function)
Shift Last Data Read [FILO Control] Section 27.3 POPP
Bit Shift Right with Carry Section 27.4 SFRP
Bit Shift Left with Carry Section 27.5 SFLP
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

27.1 FDEL / Deleting Data from Tables
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction deletes an arbitrary piece of data from a data table.



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

27.1 FDEL / Deleting Data from Tables
Applied Instructions (Real Time Clock Control)
FDEL EN s n
d Device storing deleted data
Head device in data table
Position of deleted data in table
Applied Instructions (Extension Function)
Number of stored data Number of stored data
Data table (having the number of stored pieces of data starting from " + 1") d
When "n" is "2"
Device range used in data table
"0" is stored.
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
FINS Inserts data into an arbitrary position in a data table
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

27.1 FDEL / Deleting Data from Tables
In the program example shown below, the second data is deleted from the data table stored in D100 to D105, and the deleted data is stored in D0 when X010 is set to ON. When the amount of data stored is "0", however, the FDEL instruction is not executed. (The device range used in the data table is D100 to D107.)

The AND compare instruction (ANDD< , ANDD
Number of stored data D101 D102 D103 D104 D105 D106 D107
Data table range Device range used in data table


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction inserts data into an arbitrary position in a data table.
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

27.2 FINS / Inserting Data to Tables
1. 16-bit operation (FINS/FINSP)

Device storing inserted data Head device in data table
→ Refer to the program example below.
FDEL Deletes an arbitrary data from a data table.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Instruction Description


In the program example shown below, data stored in D100 is inserted into the third position of the data table stored in D0 to D4 when X010 is set to ON. When the amount of data stored exceeds "7", however, the FINS instruction is not executed. (The device range used in the data table is D0 to D7.)
The AND compare instruction (AND
Number of stored data D0 D1 D2 D3 D4 D5 D6 D7
Data table range Device range used in data table

27.3 POP / Shift Last Data Read [FILO Control]
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads the last data written by the shift write (SFWR) instruction for the first-in first-out and first- in last-out control


Head device storing first-in data (including pointer data) ANY16
Number of pieces of data stored (Add "1" because pointer data is also included.) ANY16

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

27.3 POP / Shift Last Data Read [FILO Control]
Applied Instructions (Real Time Clock Control)
d n Head device storing the first-in data
Device storing last-out data
Number of pieces of data stored
Pointer data (amount of data stored)
Applied Instructions (Extension Function)
Data area (First-in data written by shift write (SFWR) instruction)
Applied Instructions (Block Data Operation)
s
+n-2 +n-1 +6 +5 +3 +2 +1
In the case of K4
Applied Instructions (Character String Control)
No changes in the data area Pointer
+4 d s
+n-2 +n-1 +6 +5 +3 +2 +1
Related device
→ for the zero flag use method, refer to Section 1.3.4.
M8020 Zero flag Turns ON when the instruction is executed while the pointer is "0".
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

27.3 POP / Shift Last Data Read [FILO Control]
SFWR Shift write [for FIFO/FILO control]
SFRD Shift read [for FIFO control]
satisfies "1 ≤ current value ≤ (n-1)", and then execute this instruction.
Instruction Description
![Page 665 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 27.3 POP / Shift Last Data Read [FILO Control]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-665.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 27.3 POP / Shift Last Data Read [FILO Control] diagram (page 665)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-665-1.webp)
27.3 POP / Shift Last Data Read [FILO Control]
In the program example shown below, among value stored in D20 input first to D101 to D106, the last value input is stored to D10, and "1" is subtracted from the number of stored data (pointer D100) every time X000 turns ON.
When the first-in data is as shown in the table below
H0000 H0000 H0000 HABCD H5678 H1234 K3→K2

27.4 SFR / Bit Shift Right with Carry
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts 16 bits stored in a word device rightward by "n" bits.


Number of times of shift (0 ≤ n ≤ 15) ANY16

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
1. 16-bit operation (SFR/SFRP)


27.4 SFR / Bit Shift Right with Carry
Applied Instructions (Real Time Clock Control)
In the case of "n = 6"
Becomes "0".
When a bit device is specified by digit specification (4 × K ) bits are shifted according to the data bit specification.)
Applied Instructions (Extension Function)
SFRP EN
K3M0
1 M11
0 1 0 M8
M7 M4 M3 M0
1 0 1 0 1 0 1 0
M8022
0 1 0 1 0 1 0 1 0
Applied Instructions (Block Data Operation)
Becomes "0".
→ For the carry flag use method, refer to Section 1.3.4.
Applied Instructions (Character String Control)
M8022 Carry flag Shifts the ON/OFF status of bit "n-1"
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067. 1) When a negative value is set to "n" (Error code: 6706)
In the program example shown below, the contents of Y010 to Y023 are shifted rightward by the number of bits specified by D0 when X020 turns ON.
X020 SFRP EN n
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
1 0 1 0 1 0 1 0 1 0 1 0
M8022
Applied Instructions (External Device Communication)
0 1 0 1 0 1 0 1 0
Becomes "0".

27.5 SFL / Bit Shift Left with Carry
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction shifts 16 bits stored in a word device leftward by "n" bits.



X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
1. 16-bit operation (SFL/SFLP)


27.5 SFL / Bit Shift Left with Carry
Applied Instructions (Real Time Clock Control)
In the case of "n = 8"
When a bit device is specified by digit specification (4 × K ) bits are shifted according to the data bit specification.)
Applied Instructions (Extension Function)
SFL EN
K2M10
M17 M14M13 M10
0 0 1 1 0 0 1 1
M17 M14M13 M10 M12
1 0 0 1 1 0 0 0 1
Applied Instructions (Block Data Operation)
Becomes "0".
→ For the carry flag use method, refer to Section 1.3.4.
Applied Instructions (Character String Control)
M8022 Carry flag Shifts the ON/OFF status of bit "n"
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, the contents of Y010 to Y017 are shifted leftward by the number of bits specified by D0 when X020 turns ON.
Applied Instructions (Data Comparison)
X020 SFLP EN n
Applied Instructions (Data Table Operation)
0 0 1 1 0 0 1 1
Y17 Y14 Y13 Y10 Y12
Applied Instructions (External Device Communication)
1 0 0 1 1 0 0 0 1
Becomes "0".

28 Applied Instructions (Data Comparison)
This chapter introduces data comparison instructions which can be handled as contact symbols in programming such as LD, AND and OR.
Instruction name Function Reference
LD>
LD<
LD<>
LD<=
LD>=
Data Comparison Section 28.1
LDD>
LDD<
LDD<>
LDD<=
LDD>=
AND=
AND>
AND<
AND<>
AND<=
AND>=
Data Comparison Section 28.2
ANDD>
ANDD<
ANDD<>
ANDD<=
ANDD>=
OR=
OR>
OR<
OR<>
OR<=
OR>=
Data Comparison Section 28.3
ORD>
ORD<
OR<>
ORD<=
ORD>=


28.1 LD =, >, <, <>, <=, >= / Data Comparison
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
These instructions compare numeric values, and set a contact to ON when the condition agrees so that an operation started.

28 Applied Instructions (Data Comparison)
28.1 LD =, >, <, <>, <=, >= / Data Comparison

*1. Refer to "Cautions".


X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
z S1 S2 z
These data comparison instructions are connected to bus lines. The contents of the devices specified by are compared with the contents of the device specified by in the binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.


28 Applied Instructions (Data Comparison)
28.1 LD =, >, <, <>, <=, >= / Data Comparison
Applied Instructions (Real Time Clock Control)
Applied Instructions (Extension Function)
When the current value of the counter C10 is "200", Y010 is driven.
LD= EN s1 s2
K200
Applied Instructions (Block Data Operation)
When the contents of D200 are "-29" or more and X001 is ON, Y011 is set.
LD> EN s1 s2
Applied Instructions (Character String Control)
When the contents of the counter C200 are less than "K678,493" or when M3 turns ON, M50 is driven.
LDD> EN s1 s2
C200 K678493
M3
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others) · [Structured ladder/FBD]

28 Applied Instructions (Data Comparison)
28.2 AND=, >, <, < >, <=, >= / Data Comparison
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
These instructions compare numeric values, and set a contact to ON when the condition agrees.

*1. Refer to "Cautions".


28.2 AND=, >, <, < >, <=, >= / Data Comparison
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z
These data comparison instructions are connected to other contacts in series. The contents of the device specified by are compared with the contents of the device specified by in binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.

28 Applied Instructions (Data Comparison)
28.2 AND=, >, <, < >, <=, >= / Data Comparison
When X000 is ON and the current value of the counter C10 is "200" Y010 is driven.
AND= EN s1 s2
When X001 is OFF and the contents of the data register D0 are not "-10", Y011 is set.
AND EN s1 s2
K-10
M40 SET EN
Y11
When X002 is ON, and the contents of the data registers D11 and D10 are less than "K678,493", or when M3 turns ON, M50 is driven.
ANDD> EN s1 s2
K678493
M3
[Structured ladder/FBD]


28.3 OR=, >, <, < >, <=, >= / Data Comparison
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
These instructions compare numeric values, and set a contact to ON when the condition agrees.

28 Applied Instructions (Data Comparison)
28.3 OR=, >, <, < >, <=, >= / Data Comparison

*1. Refer to "Cautions".


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

28 Applied Instructions (Data Comparison)
28.3 OR=, >, <, < >, <=, >= / Data Comparison
Applied Instructions (Real Time Clock Control)
These data comparison instructions are connected to other contacts in parallel. The contents of the device specified by is compared with the contents of the device specified by in binary format, and a contact becomes conductive (ON) or non-conductive (OFF) depending on the comparison result.
16-bit instruction 32-bit instruction ON condition OFF condition
OR> ORD> > ≤
OR< ORD< < ≥
OR<> OR<> ≠ =
OR<= ORD<= ≤ >
Applied Instructions (Extension Function)
Cautions
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
When X001 turns ON or when the current value of the counter C10 is "200", Y000 is driven.
OR= EN s1 s2
Applied Instructions (Data Comparison)
When X002 and M30 turn ON or when the contents of the data registers D101 and D100 are more than "K100,000", M60 is driven.
Applied Instructions (Data Table Operation)
ORD= EN s1 s2
Applied Instructions (External Device Communication)
Applied Instructions (Others) · [Structured ladder/FBD]

29 Applied Instructions (Data Table Operation)
Instruction name Function Reference
Limit Control Section 29.1 LIMITP
DLIMITP
BAND
Dead Band Control Section 29.2 BANDP
DBANDP
ZONE
Zone Control Section 29.3 ZONEP
DZONEP
SCL
Scaling (Coordinate by Point Data) Section 29.4 SCLP
DSCLP
DABIN
Decimal ASCII to BIN Conversion Section 29.5 DABINP
DDABINP
BINDA
BIN to Decimal ASCII Conversion Section 29.6 BINDAP
DBINDAP
SCL2
Scaling 2 (Coordinate by X/Y Data) Section 29.7 SCL2P
DSCL2P


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction provides the upper limit value and lower limit value for an input numeric value, and control the output value using these limit values.
Input value controlled by the upper and lower limit values ANY16 ANY32
Head device storing the output value controlled by the upper and lower limit values ANY16 ANY32

29 Applied Instructions (Data Table Operation)
29.1 LIMIT / Limit Control

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
z
z
1. 16-bit operation (LIMIT/LIMITP)
Depending on how the input value (16-bit binary value) of the device specified by compares to the upper and lower limit range between the devices specified by and , the output value stored in the device specified by is controlled. The output value is controlled as shown below.
d s1 s2 s3 Input value controlled by the upper and lower limit values
Lower limit value Upper limit value
Head device storing the output value controlled by the upper and lower limit values
d s1 s1 1) In the case of " > " → lower limit
s2 s2 d 2) In the case of " < " → upper limit
value d 3) In the case of " ≤ ≤ " ... → input value input value
value s2 upper limit
Output value ( )
Input value ( )
When controlling the output value using only the upper limit value, set "-32768" to the lower limit value of the device specified by . s1 4)
When controlling the output value using only the lower limit value, set "32767" to the upper limit value of the device specified by . s2 5)

29 Applied Instructions (Data Table Operation)
29.1 LIMIT / Limit Control
Applied Instructions (Real Time Clock Control)
Depending on how the input value (32-bit binary value) of the device specified by compares to the range between the upper and lower limits specified by and , the output value to be stored in the device specified by is controlled.
Lower limit value Upper limit value Input value controlled by the upper and lower limit values
d s1 s2 s3
Head device storing the output value controlled by the upper and lower limit values
In the case of " > " →
Applied Instructions (Extension Function)
In the case of " < " →
In the case of " ≤ ≤ " →
Output value ( )
Applied Instructions (Block Data Operation)
When controlling the output value using only the upper limit value, set "-2,147,483,648" to the lower limit value specified in . s1
Applied Instructions (Character String Control)
s2 When controlling the output value using only the lower limit value, set "2,147,483,647" to the upper limit value specified in . 5)
An operation error is caused when the instruction is executed in the setting status shown below. The error flag M8067 turns ON, and the error code (K6706) is stored in D8067. "(Contents of the device specified by ) > (contents of the device specified by )
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

29 Applied Instructions (Data Table Operation)
29.1 LIMIT / Limit Control




29 Applied Instructions (Data Table Operation)
29.2 BAND / Dead Band Control
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction provides the upper limit value and lower limit value of the dead band for an input numeric value, and controls the output value using these limit values.
Expression in each language
Applied Instructions (Extension Function)
BAND 16 bits Continuous BAND(EN,s1,s2,s3,d);
d s1 s2 s3
BANDP 16 bits Pulse BANDP(EN,s1,s2,s3,d);
d s1 s2 s3
Applied Instructions (Block Data Operation)
DBAND 32 bits Continuous DBAND(EN,s1,s2,s3,d);
d s1 s2 s3
Applied Instructions (Character String Control)
DBANDP 32 bits Pulse DBANDP(EN,s1,s2,s3,d);
d s1 s2 s3
EN Execution condition Bit
Lower limit value of the dead band (no-output band) ANY16 ANY32
Upper limit value of the dead band (no-output band) ANY16 ANY32
Input value controlled by the dead band ANY16 ANY32
Applied Instructions (Data Comparison)
ENO Execution state Bit
Device storing the output value controlled by the dead band. ANY16 ANY32
Bit Devices Word Devices Others
Applied Instructions (Data Table Operation)
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
z
Applied Instructions (External Device Communication)
z

29 Applied Instructions (Data Table Operation)
29.2 BAND / Dead Band Control

Lower limit value of dead band Upper limit value of dead band Input value controlled by the dead band
Device storing the output value controlled by the dead band.
d s1 s1 1) In the case of " > " - → lower limit
s2 s2 d 2) In the case of " < " - → upper limit
value 3) In the case of " ≤ ≤ " 0 → input value d output

Lower limit value of the dead band Upper limit value of the dead band Input value controlled by the dead band
Device storing the output value controlled by the dead band.
In the case of " > " - →
In the case of " < " - →
In the case of " ≤ ≤ " 0 →

29 Applied Instructions (Data Table Operation)
29.2 BAND / Dead Band Control
Applied Instructions (Real Time Clock Control)
The output value is a 16-bit binary value with sign. Accordingly, if the operation result is outside the range from -32768 to 32767, it is handled as follows:
Lower limit value of dead band =10
b) In the 32-bit operation
The output value is a 32-bit binary value with sign. Accordingly, if the operation result is outside the range from -2,147,483,648 to 2,147,483,647, it is handled as follows:
Lower limit value of dead band =1000 s1
Applied Instructions (Extension Function)
Input value =-2,147,483,648 s3
An operation error is caused when the instruction is executed in the setting status shown below. The error flag M8067 turns ON, and the error code (K6706) is stored in D8067. (Contents of the device specified by ) > (contents of the device specified by )
Applied Instructions (Block Data Operation)
X000 BIN EN s
BAND(X000,K-1000,K1000,D0,D1);
Applied Instructions (Character String Control)
K-1000
d s1 s2 s3
Operation
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

29 Applied Instructions (Data Table Operation)
29.2 BAND / Dead Band Control
X000 DBIN EN s
K8X020 D0
DBAND EN ENO
K-10000
d s1 s2 s3
Operation


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Depending on whether the input value is positive or negative, the output value is controlled by the bias value specified.
Negative bias value to be added to the input value ANY16 ANY32
Positive bias value to be added to the input value ANY16 ANY32
Head device storing the output value controlled by the zone ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
z
z

29 Applied Instructions (Data Table Operation)
29.3 ZONE / Zone Control
1. 16-bit operation (ZONE/ZONEP)
The bias value specified by or is added to the input value specified by , and output to the device specified by . The bias value is added as shown below.

Negative bias value to be added to the input value
Head device storing the output value controlled by the zone
Positive bias value to be added to the input value
s1 1) In the case of " < 0 " + → negative bias value input value d output
s1 positive bias value 3) In the case of " > 0 " + → input value d output
The bias value specified by or is added to the input value of the device specified by , and output to the device specified by . The bias value is added as shown below:

Negative bias value to be added to the input value
Head device storing the output value controlled by the zone
Positive bias value to be added to the input value
In the case of " < 0 " + → 1) output value
In the case of " = 0 " 0 → input value
In the case of " > 0 " + → input value

29 Applied Instructions (Data Table Operation)
29.3 ZONE / Zone Control
Applied Instructions (Real Time Clock Control)
The output value is a 16-bit binary value with sign. Accordingly, if the operation result is outside the range from -32768 to 32767, it is handled as follows:
Negative bias value =-100 s1
Input value =-32,768 s3
b) In the 32-bit operation
The output value is a 32-bit binary value with sign. Accordingly, if the operation result is outside the range from -2,147,483,648 to 2,147,483,647, it is handled as follows:
Applied Instructions (Extension Function)
Negative bias value =-1000
Program example
Applied Instructions (Block Data Operation)
X000 BIN EN s
ZONEP(X000,K-1000,K1000,D0,D1);
ZONEP EN ENO
Applied Instructions (Character String Control)
d s1 s2 s3
Operation
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

29 Applied Instructions (Data Table Operation)
29.3 ZONE / Zone Control
X000 DBIN EN s
DZONEP(X000,K-10000,K10000,D0,D1);
K8X020 D0
DZONEP EN ENO
d s1 s2 s3
K10000
Operation
Output · Input 0


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes scaling of the input value using a specified data table, and outputs the result. SCL2 is also available with a different data table configuration for scaling.
Input value used in scaling or device storing the input value ANY16 ANY32
Head device storing the conversion table used in scaling ANY16 ANY32
Device storing the output value controlled by scaling ANY16 ANY32
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z

29 Applied Instructions (Data Table Operation)
29.4 SCL / Scaling (Coordinate by Point Data)
1. 16-bit operation (SCL/SCLP)
The input value of the device specified by is processed by scaling for the specified conversion characteristics, and stored to a device number specified by . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.
→ For the method to set the conversion table for scaling, refer to the next page.

Number of coordinate points ("5" in the case shown in the left figure)
*1. Input value used in scaling or device storing the input value
*2. Head device storing the conversion table used in scaling
*3. Device storing the output value controlled by scaling
The input value specified by is processed by scaling for the specified conversion table, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.

Number of coordinate points ("5" in the case shown in the left figure) [ +1, ]
*1. Input value used in scaling or device storing the input value
*2. Head device storing the conversion table used in scaling
*3. Device storing the output value controlled by scaling

29 Applied Instructions (Data Table Operation)
29.4 SCL / Scaling (Coordinate by Point Data)
Applied Instructions (Real Time Clock Control)
The conversion table for scaling is set based on the data table stored in a device specified in and later. The data table has the following configuration:
Device assignment in setting data table
16-bit operation 32-bit operation
Number of coordinate points [ +1, ]
X coordinate +1 [ +3, +2]
Y coordinate +2 [ +5, +4]
X coordinate +3 [ +7, +6]
Y coordinate +4 [ +9, +8]
Applied Instructions (Extension Function)
X coordinate +2n-1 [ +4n-1, +4n-2]
Y coordinate +2n [ +4n+1, +4n]
Point 7 (250,90) Point 8 (350,90)
Applied Instructions (Block Data Operation)
Point 9 (350,30) Point 10 (400,7)
Applied Instructions (Character String Control)
Setting device and setting contents
Remarks When R0 is specified in
Number of coordinate points R0 K10
X coordinate +1 R1 K5
Y coordinate +2 R2 K7
X coordinate +3 R3 K20
Y coordinate +4 R4 K30
X coordinate +5 R5 K50
Y coordinate +6 R6 K100
X coordinate +7 R7 K200
Applied Instructions (Data Comparison)
Y coordinate +8 R8 K25
When coordinates are specified using three points in this way, the output value can be set to an intermediate value. In this example, the output value (intermediate value) is specified by the Y coordinate of the point 5. If the x coordinate is the same at three points or more, the value at the second point is also output.
X coordinate +9 R9 K200
Y coordinate +10 R10 K70
X coordinate +11 R11 K200
Y coordinate +12 R12 K250
X coordinate +13 R13 K250
Applied Instructions (Data Table Operation)
Y coordinate +14 R14 K90
X coordinate +15 R15 K350
When coordinates are specified using two points in this way, the output value is the Y coordinate at the next point. In this example, the output value is specified by the Y coordinate of the point 9.
Y coordinate +16 R16 K90
X coordinate +17 R17 K350
Y coordinate +18 R18 K30
Applied Instructions (External Device Communication)
X coordinate +19 R19 K400
Y coordinate +20 R20 K7

29 Applied Instructions (Data Table Operation)
29.4 SCL / Scaling (Coordinate by Point Data)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
1) When the Xn data is not set in the ascending order in the data table (error code: K6706) The data table is searched from the low-order side of device numbers in the data table in the operation. Accordingly, even if only some Xn data is set in the ascending order in the data table, the instruction is executed without operation error up to the area of the data table in which the Xn data is set in the ascending order.
In the program example shown below, the value input to D0 is processed by scaling based on the conversion table for scaling set in R0 and later, and output to D10.
M8000 SCL EN s1
R0
Operation
Y
Conversion setting data table for scaling
Set item Device Setting contents
Number of coordinate points R0 K6
X coordinate R1 K0
Y coordinate R2 K0
X coordinate R3 K10
Y coordinate R4 K50
X coordinate R5 K30
Y coordinate R6 K100
X coordinate R7 K40
Y coordinate R8 K45
X coordinate R9 K50
Y coordinate R10 K30
X coordinate R11 K60
Y coordinate R12 K0


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts numeric data expressed in decimal ASCII codes (30H to 39H) into binary data.
Head device storing data (ASCII codes) to be converted into binary data String String
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z

29 Applied Instructions (Data Table Operation)
29.5 DABIN / Decimal ASCII to BIN Conversion
1. 16-bit operation (DABIN/DABINP)

d s Head device storing data (ASCII codes) to be converted into binary data
16-bit binary data(BIN) ASCII code for 1's digit ASCII code for 10's digit
For example, when the device specified by stores ASCII codes expressing "-25108", 16-bit binary data is stored in the device specified by as follows:

Head device storing data (ASCII codes) to be converted into binary data
ASCII code for 100,000's digit ASCII code for 1,000,000's digit
For example, when the device specified by stores ASCII codes expressing "-1,234,543,210", 32-bit binary data is stored in the device specified by as follows:

29 Applied Instructions (Data Table Operation)
29.5 DABIN / Decimal ASCII to BIN Conversion
Applied Instructions (Real Time Clock Control)
ASCI Converts hexadecimal codes into ASCII codes.
HEX Converts ASCII codes into hexadecimal codes.
Applied Instructions (Extension Function)
STR Converts binary data into a character string (ASCII codes).
VAL Converts a character string (ASCII codes) into binary data.
BINDA Converts binary data into decimal ASCII codes (30H to 39H).
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
16-bit operation -32768 to 32767
32-bit operation -2,147,483,648 to 2,147,483,647
In the program example below, the sign and decimal ASCII codes in five digits stored in D20 to D22 are converted into a binary value and stored in D0 when X000 turns ON.
DABINP(X000, D20, D0);
Applied Instructions (Data Comparison)
d s D20 D0
b15 b8 b7 b0
20H(space) 32H(2) 2DH(-) 20H(space) D22 (It is regarded as "-00276".) "- 276"
Binary value 36H(6) 37H(7)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Instruction Description · Applied Instructions (Others) · Setting range

29 Applied Instructions (Data Table Operation)
29.6 BINDA / BIN to Decimal ASCII Conversion
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction converts binary data into decimal ASCII codes (30H to 39H).


Device storing binary data to be converted into ASCII codes ANY16 ANY32

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

29 Applied Instructions (Data Table Operation)
29.6 BINDA / BIN to Decimal ASCII Conversion
Applied Instructions (Real Time Clock Control)
d s Device storing binary data to be converted into ASCII codes
Head device storing conversion result
ASCII code for 10000's digit
Sign data ASCII code for 1000's digit
Applied Instructions (Extension Function)
ASCII code for 100's digit
ASCII code for 1's digit ASCII code for 10's digit
16-bit binary data +3
0000H or source data M8091=OFF:0000H M8091=ON:Does not
change.
For example, when the device specified by stores "-12345", the conversion result is stored in the device specified by and later as follows:
35H(5) 34H(4)
0000H or source data +3 M8091=OFF:0000H M8091=ON:Does not change.
Applied Instructions (Block Data Operation)
a) As "sign data", "20H (space)" is set when the 16-bit binary data stored in the device specified by
Applied Instructions (Character String Control)
is positive, and "2DH (-)" is set when 16-bit binary data stored in the device specified by is negative. b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).
0 0 3 2 5
c) + 3 is set as follows depending on the ON/OFF status of M8091.
ON/OFF status Contents of processing
M8091=OFF +3 is set to "0000H (NULL)".
Applied Instructions (Data Comparison)
M8091=ON +3 does not change
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

29 Applied Instructions (Data Table Operation)
29.6 BINDA / BIN to Decimal ASCII Conversion

Device storing binary data to be converted into ASCII codes
ASCII code for 100,000's digit ASCII code for 1,000,000's digit
For example, when the device specified by stores "-12,345,678", the conversion result is stored in the device specified by and later as follows:
a) As "sign data", "20H (space)" is set when the 32-bit binary data stored in the device specified by
is positive, and "2DH (-)" is set when 32-bit binary data stored in the device specified by is negative. b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).

0 0 1 2 0 3 4 5 6 0
c) The high-order byte of + 5 is set as follows depending on the ON/OFF status of M8091.
M8091=OFF The high-order byte of + 5 is set to "00H (NULL)".
M8091=ON The high-order byte of + 5 is set to "20H (space)".

- When M8091 is OFF, + 3 is set to "0000H (NULL)".
- When M8091 is ON, + 3 does not change. • For 32-bit operation
- When M8091 is OFF, the high-order byte of + 5 is set to "00H (NULL)".
- When M8091 is ON, the high-order byte of + 5 is set to "20H (space)".

29 Applied Instructions (Data Table Operation)
29.6 BINDA / BIN to Decimal ASCII Conversion
Applied Instructions (Real Time Clock Control)
ASCI Converts hexadecimal codes into ASCII codes.
HEX Converts ASCII codes into hexadecimal codes.
DESTR Converts binary floating point data into a character string data (ASCII code) with the specified number of digits.
DEVAL Converts character string data (ASCII code) into binary floating point data.
DABIN Converts numeric value data expressed in decimal ASCII codes (30H to 39H) into binary data.
Applied Instructions (Extension Function)
16-bit operation M8091=ON 3
Error
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (Block Data Operation)
In the program example below, 16-bit binary data stored in D1000 is converted into decimal ASCII codes when X000 is set to ON, and the ASCII codes converted by PR (FNC77) instruction are output one by one in the time division method to Y040 to Y051. By setting to OFF the output character selector signal M8091 and setting to ON PR mode flag M8027, ASCII codes up to "00H" are output.
Applied Instructions (Character String Control)
→ For PR mode flag and PR instruction, refer to Section 14.8.
RST(X000,M8091);
SET(X000,M8027);
M8091
BINDA(X000,D1000,D0);
PR(X000,D0,Y040);
SET EN ENO
M8027
Applied Instructions (Data Comparison)
D1000 D0
Applied Instructions (Data Table Operation)
b15 b8 b7 b0
20H(space) 31H(1) 20H(space) 35H(5) D1 D2
Y040 to Y051 "__5126" is output.
Applied Instructions (External Device Communication)
(BIN)
M8091=OFF

29 Applied Instructions (Data Table Operation)
29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction executes scaling of the input value using a specified data table, and outputs the result. SCL instruction is also available with a different data table configuration for scaling.
→ For SCL instruction, refer to Section 29.4.


Input value used in scaling or device storing the input value ANY16 ANY32
Head device storing the conversion table used in scaling ANY16 ANY32
Device storing the output value controlled by scaling ANY16 ANY32

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

29 Applied Instructions (Data Table Operation)
29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)
Applied Instructions (Real Time Clock Control)
The input value specified in is processed by scaling for the specified conversion characteristics, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.
→ For the method to set the conversion table for scaling, refer to the next page.
SCL2 EN ENO
Set item Device assignment in
Number of coordinate points ("5" in the case shown in the left figure)
Applied Instructions (Extension Function)
Input value used in scaling or device storing the input value *1.
Head device storing the conversion table used in scaling *2.
Device storing the output value controlled by scaling *3.
Output value ( )
Applied Instructions (Block Data Operation)
Operation is enabled.
Applied Instructions (Character String Control)
The input value specified by is processed by scaling for the specified conversion table, and stored to a device number specified in . Conversion for scaling is executed based on the data table stored in a device specified in and later. If the output data is not an integer, however, the number in the first decimal place is rounded.
DSCL2 EN ENO
Set item Conversion setting data table for scaling
Number of coordinate points ("5" in the case shown in the left figure) [ +1, ]
Input value used in scaling or device storing the input value *1.
Point 1 [ +3, +2]
Applied Instructions (Data Comparison)
Head device storing the conversion table used in scaling *2.
Point 2 [ +5, +4]
Point 3 [ +7, +6]
Device storing the output value controlled by scaling *3.
Point 4 [ +9, +8]
Point 5 [ +11, +10]
Output value ( )
Point 1 [ +13, +12]
Applied Instructions (Data Table Operation)
Point 2 [ +15, +14]
Point 3 [ +17, +16]
Point 4 [ +19, +18]
Point 5 [ +21, +20]
Applied Instructions (External Device Communication)
Input value ( )
Operation is enabled.

29 Applied Instructions (Data Table Operation)
29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)
The conversion table for scaling is set based on the data table stored in a device specified in and later. The data table has the following configuration:
→ For a setting example, refer to the next page.
Device assignment in setting data table
16-bit operation 32-bit operation
Number of coordinate points [ +1, ]
Point 1 +1 [ +3, +2]
Point 2 +2 [ +5, +4]
Point n (last) +n [ +2n+1, +2n]
Point 1 +n+1 [ +2n+3, +2n+2]
Point 2 +n+2 [ +2n+5, +2n+4]
Point n (last) +2n [ +4n+1, +4n]
Set item · X coordinate · Y coordinate

29 Applied Instructions (Data Table Operation)
29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)
Setting example of the conversion table for scaling A setting example for the 16-bit operation is shown below. For the 32-bit operation, set each item using a 32-bit binary value. In the case of the conversion characteristics for scaling shown in the figure below, set the following data table.
Applied Instructions (Real Time Clock Control)
Point 7 (250,90) Point 8(350,90)
Point 9 (350,30) Point 10(400,7)
Applied Instructions (Extension Function)
Setting device and setting contents
Remarks When R0 is specified in
Number of coordinate points R0 K10
Point 1 +1 R1 K5
Point 2 +2 R2 K20
Point 3 +3 R3 K50
Point 4 +4 R4 K200
Refer to *1. Point 5 +5 R5 K200
Point 6 +6 R6 K200
Applied Instructions (Block Data Operation)
Point 7 +7 R7 K250
Point 8 +8 R8 K350
Refer to *2. Point 9 +9 R9 K350
Point 10 +10 R10 K400
Point 1 +11 R11 K7
Applied Instructions (Character String Control)
Point 2 +12 R12 K30
Point 3 +13 R13 K100
Point 4 +14 R14 K25
Refer to *1. Point 5 +15 R15 K70
Point 6 +16 R16 K250
Point 7 +17 R17 K90
Point 8 +18 R18 K90
Refer to *2. Point 9 +19 R19 K30
Point 10 +20 R20 K7
*1. When coordinates are specified using three points as shown in the points 4, 5 and 6, the output value can be set to an intermediate value. In this example, the output value (intermediate value) is specified by the Y coordinate of the point 5. If the X coordinate is same at three points or more, the value at the second point is output also.
Applied Instructions (Data Comparison)
*2. When coordinates are specified using two points as shown in the points 8 and 9, the output value is the Y coordinate at the next point. In this example, the output value is specified by the Y coordinate of the point 9.
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

29 Applied Instructions (Data Table Operation)
29.7 SCL2 / Scaling 2 (Coordinate by X/Y Data)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
1) When the Xn data is not set in the ascending order in the data table (error code: K6706) The data table is searched from the low-order side of device numbers in the data table in the operation. Accordingly, even if only some Xn data is set in the ascending order in the data table, the instruction is executed without operation error up to the area of the data table in which the Xn data is set in the ascending order.
In the program example shown below, the value input to D0 is processed by scaling based on the conversion table for scaling set in R0 and later, and output to D10.
SCL2(M8000,D0,R0,D10);
M8000 SCL2 EN s1
Operation
Y
Conversion setting data table for scaling
Set item Device Setting contents
Number of coordinate points R0 K6
Point 1 R1 K0
Point 2 R2 K10
Point 3 R3 K30
Point 4 R4 K40
Point 5 R5 K50
Point 6 R6 K60
Point 1 R7 K0
Point 2 R8 K50
Point 3 R9 K100
Point 4 R10 K45
Point 5 R11 K30
Point 6 R12 K0

30 Applied Instructions (External Device Communication)
Applied Instructions (Real Time Clock Control)
This chapter introduces the instructions for executing inverter communication and MODBUS communication.
Instruction name Function Reference
IVCK Inverter Status Check Section 30.1
IVDR Inverter Drive Section 30.2
IVRD Inverter Parameter Read Section 30.3
IVWR Inverter Parameter Write Section 30.4
IVBWR Inverter Parameter Block Write Section 30.5
Applied Instructions (Extension Function)
IVMC Inverter Multi Command Section 30.6
ADPRW MODBUS Read / Write Section 30.7
Applied Instructions (Block Data Operation)
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

30 Applied Instructions (External Device Communication)
30.1 IVCK / Inverter Status Check
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads the operation status of an inverter to a PLC using the computer link operation function of the inverter. Applicable inverters vary depending on the version. This instruction corresponds to the EXTR (K10) instruction in the FX2N and FX2NC series.
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.


*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z
S: Refer to "Cautions".

30 Applied Instructions (External Device Communication)
30.1 IVCK / Inverter Status Check
Applied Instructions (Real Time Clock Control)
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
The operation status corresponding to the instruction code*1 specified in the device specified by of an inverter connected to communication port n whose station number is specified in the device specified by is read and transferred to the device specified by .
Inverter station number Inverter instruction code
d s1 s2 n
Device storing the read value
Channel to be used
*1. Refer to the instruction code list. Refer to the pages in the inverter manual on which the computer link function is explained in detail.
Applied Instructions (Extension Function)
specified in Read contents
F700 A700 E700 D700 V500 F500 A500 E500 S500
H7B Operation mode 3
H6F Output frequency (number of rotations) 3*1 3
Applied Instructions (Block Data Operation)
H70 Output current 3
H71 Output voltage 3 -
H72 Special monitor 3 - -
H73 Special monitor selection number 3 - -
H74 Abnormal contents 3
H75 Abnormal contents 3
Applied Instructions (Character String Control)
H76 Abnormal contents 3 -
H77 Abnormal contents 3 -
H79 Inverter status monitor (extension) 3 -
H7A Inverter status monitor 3
H6E Set frequency (read from E2PROM) 3*1 3
H6D Set frequency (read from RAM) 3*1 3
H7F Link parameter extended setting These codes cannot be specified in of the IVCK instruction. They are automatically processed when a "second parameter specification code" is specified the IVRD instruction. H6C Second parameter changing
*1. Please write "0" to instruction code HFF (Link parameter expansion setting) just before the IVCK instruction when reading frequency. When "0" is not written, reading of the frequency may not be executed normally.
Applied Instructions (Data Comparison)
Number Description Number Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
Applied Instructions (Data Table Operation)
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2
M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence
M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
Applied Instructions (External Device Communication)
*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1

30 Applied Instructions (External Device Communication)
30.1 IVCK / Inverter Status Check
→ For other cautions, refer to the Data Communication Edition manual.
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
The table below shows PLC versions applicable to each inverter.
FX3S Ver.1.00 or later
FX3G Ver.1.10 or later
FX3GC Ver.1.40 or later
FX3U Ver.2.20 or later Ver.2.32 or later
FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

30 Applied Instructions (External Device Communication)
30.2 IVDR / Inverter Drive
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes a inverter operation required control value to the PLC using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K11) instruction in the FX2N and FX2NC series PLCs.
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
Applied Instructions (Extension Function)
Expression in each language
IVDR EN ENO s1 s2 s3 n
IVDR 16 bits Continuous IVDR(EN,s1,s2,s3,n);
Variable Description Data type
EN Execution condition Bit
Applied Instructions (Block Data Operation)
Inverter station number ANY16
Inverter instruction code ANY16
Set value to be written to the inverter parameter or device storing the data to be set. ANY16
Channel to be used (K1:ch1, K2:ch2*1) ANY16
Applied Instructions (Character String Control)
Output variable ENO Execution state Bit
*1. "ch2" is not available for use for FX3S and FX3G (14-point and 24-point type) PLCs.
Bit Devices Word Devices Others
System user Digit specification System user Special
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z
z S1 S2 z z z
Applied Instructions (Data Comparison)
S: Refer to "Cautions".
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

30 Applied Instructions (External Device Communication)
30.2 IVDR / Inverter Drive
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
The control value specified in the device specified by is written to the instruction code*1 in the device specified by of an inverter connected to a communication port n whose station number is specified in the device specified by .
IVDR EN ENO s1 s2 s3
Inverter station number Inverter instruction code Set value to be written to the inverter parameter
or device storing the data to be set.
Channel to be used
*1. Refer to the instruction code list. Refer to the pages in the inverter manual on which the computer link function is explained in detail.
F700 A700 E700 D700 V500 F500 A500 E500 S500
HFB Operation mode 3
HF3 Special monitor selection number 3 - -
HF9 Operation command (extension) 3 -
HFA Operation command 3
HEE Set frequency (written to EEPROM) 3*3
HED Set frequency (written to RAM) 3*3
HFD*1 Inverter reset*2 3
HF4 Abnormal contents all clear 3 - 3
HFC Parameter all clear 3
HFC User clear - 3 3 - -
HFF Link parameter extended setting 3
*1. The instruction code "HFD (inverter reset)" does not request a response from the inverter. Accordingly, even if inverter reset is executed to a station number at which an inverter is not connected, error does not occur. It takes about 2.2 seconds to complete execution of inverter reset. *2. When resetting the inverter, please specify H9696 as . Do not use H9966. *3. Please write "0" to instruction code HFF (Link parameter expansion setting) just before the IVDR instruction when writing frequency. When "0" is not written, writing of the frequency may not be executed normally.
Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2
M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence
M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1

30 Applied Instructions (External Device Communication)
30.2 IVDR / Inverter Drive
Applied Instructions (Real Time Clock Control)
→ For other cautions, refer to the Data Communication Edition manual.
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
Applied Instructions (Extension Function)
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
The table below shows PLC versions applicable to each inverter.
FX3S Ver.1.00 or later
FX3G Ver.1.10 or later
FX3GC Ver.1.40 or later
FX3U Ver.2.20 or later Ver.2.32 or later
Applied Instructions (Block Data Operation)
FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

30 Applied Instructions (External Device Communication)
30.3 IVRD / Inverter Parameter Read
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads an inverter parameter to the PLC using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K12) instruction in the FX2N and FX2NC series PLCs.
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.


*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

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

30 Applied Instructions (External Device Communication)
30.3 IVRD / Inverter Parameter Read
Applied Instructions (Real Time Clock Control)
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
Inverter station number Inverter parameter number
d s1 s2 n
Device storing the read value
Channel to be used
Applied Instructions (Extension Function)
Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*1
M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence
M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
Applied Instructions (Block Data Operation)
*1. Cleared when PLC power supply is turned from OFF to ON.
*2. Cleared when the PLC mode switches from STOP to RUN.
Applied Instructions (Character String Control)
→ For other cautions, refer to the Data Communication Edition manual.
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
Applied Instructions (Data Comparison)
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
Applied Instructions (Data Table Operation)
The table below shows PLC versions applicable to each inverter.
FX3S Ver.1.00 or later
FX3G Ver.1.10 or later
FX3GC Ver.1.40 or later
FX3U Ver.2.20 or later Ver.2.32 or later
Applied Instructions (External Device Communication)
FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later

30 Applied Instructions (External Device Communication)
30.4 IVWR / Inverter Parameter Write
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes a parameter of an inverter using the computer link operation function of the inverter. This instruction corresponds to the EXTR (K13) instruction in the FX2N and FX2NC series PLCs.
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.


Set value to be written to the inverter parameter or device storing the data to be set ANY16
*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.

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

30 Applied Instructions (External Device Communication)
30.4 IVWR / Inverter Parameter Write
Applied Instructions (Real Time Clock Control)
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
A value specified in the device specified by is written to a parameter in the device specified by in an inverter connected to a communication port n whose station number is in the device specified by .
IVWR EN ENO s1 s2
Inverter station number Inverter parameter number
Set value to be written to the inverter parameter
or device storing the data to be set
n Channel to be used
Applied Instructions (Extension Function)
*1. Mitsubishi Electric's FREQROL - F700, A700, E700, D700, V500, F500, A500, E500 and S500 series general purpose inverters
Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2
Applied Instructions (Block Data Operation)
M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence
M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
*1. Cleared when PLC power supply is turned from OFF to ON.
*2. Cleared when the PLC mode switches from STOP to RUN.
Applied Instructions (Character String Control)
→ For other cautions, refer to the Data Communication Edition manual.
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
Applied Instructions (Data Comparison)
When a communication error occurs in an inverter communication instruction, the FX PLC automatically retries communication up to 3 times*2. Accordingly, note that the number of times of password reset error displayed in accordance with the setting of Pr297 may not agree with the actual number of times of password input error as described below when a password reset error occurs in the D700 Series in which "display of the number of times of password reset error"*3 is made valid using Pr297. Do not execute automatic retry (re-driving of an inverter instruction) using a sequence program when writing data to Pr297.
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

30 Applied Instructions (External Device Communication)
30.4 IVWR / Inverter Parameter Write
Cases in which a password reset error occurs in an inverter communication instruction, and the actual number of times of reset error in such cases. - When a wrong password is written to Pr297 due to a password input error When the writing instruction is executed once, a password reset error occurs 3 times. - When the password cannot be written correctly to Pr297 due to noise, etc. A password reset error occurs up to 3 times. b) When registering the password
When registering the password in the D700 Series inverter using an inverter communication instruction, write the password to Pr297, read Pr297, and then confirm that registration of the password is completed normally*4. If writing of the password to Pr297 is not completed normally due to noise, etc., the FX PLC automatically retries writing, and the registered password may be reset by the retry.
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
*2. The FX PLC executes the first communication, and then retries communication twice (3 time in total).
*3. When "display of the number of times of password reset error" is made valid in the D700 Series using Pr297 and when a password reset error occurs 5 times, the "reading/writing restriction" cannot be reset even if the right password is input. For recovery from this status, it is necessary to all-clear all parameters in the D700 Series.
*4. When the value given as a result of reading Pr297 is "0" to "4", registration of the password is completed normally.
The table below shows PLC versions applicable to each inverter.
FX3S Ver.1.00 or later
FX3G Ver.1.10 or later
FX3GC Ver.1.40 or later
FX3U Ver.2.20 or later Ver.2.32 or later
FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes parameters of an inverter at one time using the computer link operation function of the inverter.
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual.
Number of parameters in an inverter to be written at one time. ANY16
Head device of a parameter table to be written to an inverter ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

30 Applied Instructions (External Device Communication)
30.5 IVBWR / Inverter Parameter Block Write
→ For detailed explanation of the instruction, refer to the Data Communication Edition manual. 1. 16-bit operation (IVBWR)
A data table*1 (parameter numbers and set values) specified in and is written to an inverter connected to a communication port n whose station number is in the device specified by all at once.

Number of parameters in an inverter to be written at one time. Head address of a parameter table to be written to an inverter
*1. The table below shows the data table format.

: Number of parameters to be written : Head device number of data table
Device Parameter numbers to be written and set values
Number Description Number Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2
M8153 M8158 Inverter communication error latch*2 D8153 D8158 Latch of inverter communication error occurrence
M8154 M8159 IVBWR instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
*1. Cleared when PLC power supply is turned from OFF to ON. *2. Cleared when the PLC mode switches from STOP to RUN. *3. Initial value: -1
→ For other cautions, refer to the Data Communication Edition manual.
The table below shows PLC versions applicable to each inverter.

FX3UC Ver.1.00 or later Ver.2.20 or later Ver.2.32 or later
step*2*3

30 Applied Instructions (External Device Communication)
30.6 IVMC / Inverter Multi Command
Applied Instructions (Real Time Clock Control)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes 2 types of settings (operation command and set frequency) to the inverter, and reads 2 types of data (inverter status monitor, output frequency, etc.) from the inverter at the same time. → For detailed explanation of the instruction, refer to the Data Communication Edition manual.
Expression in each language
Applied Instructions (Extension Function)
IVMC 16 bits Continuous IVMC(EN,s1,s2,s3,n,d);
d s1 s2 s3 n
Variable Description Data type
EN Execution condition Bit
Inverter station number (K0 to K31) ANY16
Applied Instructions (Block Data Operation)
Head device which stores data to be written to the inverter (Occupies 2 points.)
ENO Execution state Bit
Applied Instructions (Character String Control)
Head device which stores values to be read from the inverter (Occupies 2 points.)
*1. "ch2" is not available for use for the FX3S and FX3G (14-point and 24-point type) PLCs.
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z S1 S2 z z z
z S1 S2 z z z
z S1 S2 z
Applied Instructions (Data Comparison)
z S1 S2 z
S: Refer to "Cautions".
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)

30 Applied Instructions (External Device Communication)
30.6 IVMC / Inverter Multi Command
IVMC EN ENO s1 d s2 s3 n
Head device which stores values to be read from the inverter
Send/receive data type Head device which stores data to be written to the inverter
Channel to be used
Send data (Write contents to Inverter)
Recive data (Read contents from Inverter)
Data 1 ( ) Data 2 ( +1) Data 1 ( ) Data 2 ( +1)
H0010 Set frequency (RAM, EEPROM)
Description ch1 ch2 ch1 ch2
M8029 Instruction execution complete D8063 D8438 Error code of serial communication error*1
M8063 M8438 Serial communication error*1 D8150 D8155 Response wait time in inverter communication*1
M8151 M8156 Inverter communicating D8151 D8156 Step number in inverter communication*3
M8152 M8157 Inverter communication error*2 D8152 D8157 Error code of inverter communication error*2
Latch of inverter communication error occurrence
M8153 M8158 Inverter communication error latch*2 D8153 D8158
M8154 M8159 IVBWR inverter instruction error*2 D8154 D8159 IVBWR instruction error parameter number*2*3
*1. Cleared when PLC power supply is turned from OFF to ON.
*2. Cleared when the PLC mode switches from STOP to RUN.

30 Applied Instructions (External Device Communication)
30.6 IVMC / Inverter Multi Command
Applied Instructions (Real Time Clock Control)
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction.
Applied Instructions (Extension Function)
Applied Instructions (Block Data Operation)
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
This instruction is applicable to the following inverters:
- FREQROL-E700 (February 2009 and later) - FREQROL-D700 (Applicable in all)
Applied Instructions (Character String Control)
Applied Instructions (Data Comparison)
Applied Instructions (Data Table Operation)
Applied Instructions (External Device Communication)
Applied Instructions (Others)

30 Applied Instructions (External Device Communication)
30.7 ADPRW / MODBUS Read/Write
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction allows the MODBUS Master to communicate (read/write data) with its associated Slaves.

ADPRW 16 bits Continuous ADPRW (EN, s, s1, s2, s3, s4)

Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY16
Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY16
Command Parameter depending on the Command Code (See Subsection 30.7.1) ANY_SIMPLE

X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z z S1 z S1 S2 z z z
S : Refer to "Cautions".
1. 16-bit operation
Command Code is operated on Slave Node according to Parameters , and . Use 0 as the Slave Node Address for Broadcast commands.

Slave Node Address K0 to K32 (00H to 20H)
Command Parameters depending on the Command Code s3 s4

30 Applied Instructions (External Device Communication)
30.7 ADPRW / MODBUS Read/Write
Applied Instructions (Real Time Clock Control)
- "IVCK, IVDR, IVRD, IVWR, IVBWR*1, IVMC" instruction
- "FLCRT*1, FLDEL*1, FLWR*1, FLRD*1, FLCMD*1 or FLSTRD*1" instruction
*1. The instruction is not provided in the FX3S, FX3G and FX3GC PLCs.
Applied Instructions (Extension Function)
The following table shows the required command parameters for each command code.
PLC Destination Device (head address)
Applicable Devices D, R, M, Y, S
Block Length ( +15) ÷16*2
2H Read Discrete Inputs
PLC Destination Device (head address)
Applicable Devices D, R, M, Y, S
Block Length ( +15) ÷16*2
PLC Destination Device (head address)
Applied Instructions (Block Data Operation)
3H Read Holding Register
Applicable Devices D, R
PLC Destination Device (head address)
4H Read Input Register
Applicable Devices D, R
Applied Instructions (Character String Control)
PLC Sourse Device (head address)
D, R, K, H, X, Y, M, S (D, R, X, Y, M, S can be indexed.)
5H Write Single Coil
Block Length 1 Point
PLC Source Device (head address)
6H Write Single Register
Applicable Devices D, R, K, H (D, R can be indexed.)
Block Length 1 Point
7H Read Exception State (Available only in FX3U and FX3UC PLCs)
PLC Destination Device (head address)
0 (fixed) 0 (fixed)
Applicable Devices D, R
Block Length 1 Point
Applied Instructions (Data Comparison)
Applicable Devices D, R
Block Length 1 Point
8H Diagnosis (Available only in FX3U and FX3UC PLCs)
Applicable Devices D, R
Applied Instructions (Data Table Operation)
Block Length 1 Point
PLC Destination Device (head address)
Applicable Devices D, R
Block Length 1 Point *2. This calculation formula is applicable when the applicable device is D or R.
Applied Instructions (External Device Communication)

30 Applied Instructions (External Device Communication)
30.7 ADPRW / MODBUS Read/Write

Sub-function Data (ASCII Mode End of Message Character): 00H to FFH
8H Diagnosis (Available only in FX3U and FX3UC PLCs)
BH Get Comm. Event Counter (Available only in FX3U and FX3UC PLCs)
CH Get Comm. Event Log (Available only in FX3U and FX3UC PLCs)
D, R, K, H, M, X, Y, S (D, R, M, X, Y, S can be indexed.)
*1. This calculation formula is applicable when the applicable device is D or R.


Applicable Devices D, R, K, H (D, R can be indexed.)
11H Report Slave ID (Available only in FX3U and FX3UC PLCs)
16H Mask Write Register (Available only in FX3U and FX3UC PLCs)
Applicable Devices D, R, K, H (D, R can be indexed.)
17H Read/Write Multiple Registers (Available only in FX3U and FX3UC PLCs)

31 Applied Instructions (Data Transfer 3)
This chapter introduces the instructions for executing more complicated processing for fundamental applied instructions and for special processing.
Instruction name Function Reference
RBFM Divided BFM Read Section 31.1
WBFM Divided BFM Write Section 31.2

31 Applied Instructions (Data Transfer 3)
31.1 RBFM / Divided BFM Read
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
This instruction reads data from continuous buffer memories (BFM) in a special function block and unit over several operation cycles by the time division method. This instruction is convenient for reading received data, etc. stored in buffer memories in a special function block and unit for communication by the time division method. FROM instruction is also available to read the buffer memory (BFM) data.
→ For FROM instruction, refer to Section 14.8.
Applied Instructions (Extension File Register Control)
Expression in each language
RBFM EN ENO m1 m2 n1 n2
RBFM 16 bits Continuous BFM(EN,m1,m2,n1,n2,d);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
Interrupt Function and Pulse Catch Function
EN Execution condition Bit
Unit number [0 to 7] ANY16
Head buffer memory (BFM) number ANY16
Number of all buffer memories (BFM) to be read [1 to 32767] ANY16
Number of points transferred in one operation cycle [1 to 32767] ANY16
Relationships between devices and addresses
ENO Execution state Bit
Head device storing data to be read from buffer memory (BFM) ANY16
B
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
z
z
S1 z z
S: Refer to "Cautions".

31 Applied Instructions (Data Transfer 3)
31.1 RBFM / Divided BFM Read

Head device storing data to be read from buffer memory (BFM)
Number of all buffer memories (BFM) to be read Number of points transferred in one
"n2" buffer memories are read in each operation cycle. Reading is executed in "n1/n2" times. ("n1/n2" is rounded up if it is not an integer.)

M8029 Instruction execution complete Turns ON when an instruction is finished normally.
M8328 Instruction non-execution Turns ON when RBFM or WBFM instruction in another step is executed for the same unit number.
mally complete Turns ON when an instruction is finished abnormally.

An operation error is caused in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

31 Applied Instructions (Data Transfer 3)
31.1 RBFM / Divided BFM Read
Applied Instructions (Data Transfer 3)
Specification of unit number of special function block and unit and buffer memory → For the connection method of special extension units and blocks, number of connectable units and
blocks, and handling of I/O numbers, refer to the manual of the PLC used and special function block
and unit.
Applied Instructions (High Speed Processing 2)
Unit No.0 Built-in CC-Link/LT
Unit No.1
Unit No.2
Unit No.3
Applied Instructions (Extension File Register Control)
FX3UC-32MT-LT(-2) Main unit
A unit number is automatically assigned to each special extension unit and block connected to the PLC. The unit number is assigned in the way "No. 0 → No. 1 → No. 2 ..." starting from the equipment nearest to the main unit. Since the FX3UC-32MT-LT(-2) PLC has a built-in CC-Link/LT master, the unit number is given "No. 1 → No. 2 → No. 3 ..." from the equipment nearest to the main unit.
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
→ For the contents of buffer memories, refer to the manual of the special function block and unit
used.
Relationships between devices and addresses

31 Applied Instructions (Data Transfer 3)
31.1 RBFM / Divided BFM Read
By overwriting the contents of D8000 (watchdog timer time), the watchdog timer detection time is changed (initial value: K200). When the program shown below is input, the sequence program will be monitored with the new watchdog timer time.
WDT EN ENO
Watchdog timer refresh When WDT (FNC07) instruction is not programmed, the value of D8000 becomes valid during END processing.
b) Change the number of transferred points "n2" in each operation cycle.
Change the number of transferred points "n2" in each operation cycle to a smaller value.
M
M
RBFM EN ENO m1 m2
Unit number Head BFM number
Head device storing data to be read from buffer memory (BFM)
Number of all buffer memories
(BFM) to be read
Number of points transferred
in one operation cycle
RST EN ENO
M


In the program example shown below, data is read from and written to the buffer memories (BFM) in the unit No. 2 as follows:
The BFM write start flag is set to ON.
M0 WBFM EN ENO m1 m2 s n1 n2
D100 to D179 (80 points) are written to the buffer memories #1001 to #1080 in the unit No. 2 (in 5 operation cycles).
The BFM write start flag is set to OFF.
The BFM write start flag is set to OFF.

31 Applied Instructions (Data Transfer 3)
31.1 RBFM / Divided BFM Read
SET(LDP(TRUE,X001),M5);
SET EN ENO
RBFM(M5,K2,K2001,K80,K16,D200);
RST(M5 AND M8029,M5);
The BFM read start flag is set to ON.
RST(M5 AND M8329,M5);
M5 RBFM EN ENO m1 m2 n1 n2
K80 K16
The buffer memories #2001 to #2080 (80 points) in the unit No. 2 are read to D200 to D279 (in 5 operation cycles).
M8029
The BFM read start flag is set to OFF.
Execution of the RBFM instruction is waited.
RST EN ENO
Instruction execution abnormally complete
The BFM read start flag is set to OFF.

31 Applied Instructions (Data Transfer 3)
31.2 WBFM / Divided BFM Write
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
This instruction writes data to continuous buffer memories (BFM) in a special function block and unit over several operation cycles by the time division method. This instruction is convenient for writing send data, etc. to buffer memories in a special function block and unit for communication by the time division method. TO instruction is also available for writing data to the buffer memory (BFM).
→ For TO instruction, refer to Section 14.9.
Applied Instructions (Extension File Register Control)
Expression in each language
WBFM EN ENO m1 m2 s n1 n2
Applied Instructions (FX3U-CF-ADP)
WBFM 16 bits Continuous WBFM(EN,m1,m2,s,n1,n2);
Interrupt Function and Pulse Catch Function
Variable Description Data type
EN Execution condition Bit
Head buffer memory (BFM) number ANY16
Head device storing data to be written to buffer memory (BFM) ANY16
Relationships between devices and addresses
Number of all buffer memories (BFM) to be written ANY16
Number of points transferred in one operation cycle ANY16
Output variable ENO Execution state ANY16
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
S1 z z
z
z
S: Refer to "Cautions".

31 Applied Instructions (Data Transfer 3)
31.2 WBFM / Divided BFM Write
1. 16-bit operation (WBFM)
"n1" word units from the device specified by in the PLC are transferred (written) to buffer memory (BFM) location No. "m2" in special function unit and block No. "m1". While transferring, "n1" is divided by "n2" so n1/ n2 words (rounded up when there is a remainder) are transferred per scan time.
→ For the unit number, buffer memory (BFM) number, cautions and program example, refer to
Section 31.1.1.

Unit number Head BFM number Number of all buffer memories
"n2" points are written in each operation cycle. Writing is executed in "n1/n2" times. ("n1/n2" is rounded up if it is not an integer.)

M8029 Instruction execution complete Turns ON when an instruction is finished normally.
M8328 Instruction non-execution Turns ON when RBFM or WBFM instruction in another step is executed for the same unit number.
mally complete Turns ON when an instruction is finished abnormally.

An operation error is caused in the following case. The error flag M8067 turns ON, and the error code is stored in D8067.

32 Applied Instructions (High Speed Processing 2)
Applied Instructions (Data Transfer 3)
Instruction name Function Reference
DHSCT High Speed Counter Compare With Data Table Section 32.1
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
Applied Instruction List

32 Applied Instructions (High Speed Processing 2)
32.1 DHSCT / High Speed Counter Compare With Data Table
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction compares the current value of a high speed counter with a data table of comparison points, and then sets or resets up to 16 output devices.


Number of comparison points in data table (1 ≤ m ≤ 128) ANY32
Number of devices to which the operation status is output ANY32
Head device to which the operation status is output Bit

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

32 Applied Instructions (High Speed Processing 2)
32.1 DHSCT / High Speed Counter Compare With Data Table
Applied Instructions (Data Transfer 3)
The current value of a high speed counter specified in is compared with the data table shown below which has "m" points stored in the device specified by and later, and the operation output set value (ON or OFF) specified in the data table is output to the devices specified by .
Applied Instructions (High Speed Processing 2)
DHSCT EN ENO s1 m s2 n
Head device storing the data table Number of comparison points in data table
Head device to which the operation status is output
High speed counte (C235 to C255)
Number of devices to which the operation status is output
Applied Instructions (Extension File Register Control)
Comparison point number Comparison data Operation output set value
(SET [1] or RESET [0]) Operation output destination
Applied Instructions (FX3U-CF-ADP)
1 +4, +3 +5
2 +7, +6 +8
m-2 +3m-5, +3m-6 +3m-4
m-1 +3m-2, +3m-3 +3m-1
Interrupt Function and Pulse Catch Function
Operation output set value (SET [1] or RESET [0]) [Up to 16 points]
Operation output setting 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0
Operation output setting = HA716 When the current value of the high speed counter becomes equivalent to the comparison value, the operation output setting pattern is output. In the case of " = Y000, n = K10"
Relationships between devices and addresses
Y 0 1 1
Y 0 1 0
Y 0 0 7
Y 0 0 6
Y 0 0 5
Y 0 0 4
Y 0 0 3
Y 0 0 2
Y 0 0 1
Y 0 0 0
B
+ n-1 d d
2) When the current value of the high speed counter, specified in , becomes equivalent to the comparison value in the data table, the corresponding operation output specified in the data table is output to the device specified by . If an output (Y) is specified in , the output processing is executed immediately without waiting for the output refresh executed by the END instruction. When specifying and output (Y), make sure that the least significant digit of the device number is "0". Examples: Y000, Y010 and Y020

32 Applied Instructions (High Speed Processing 2)
32.1 DHSCT / High Speed Counter Compare With Data Table

4 D213, D212 K800 D214 H0003 4↓ (repeated from "0")

Because DHSCT instruction is not executed, the operation outputs are not changed by this instruction.
*1. If this instruction is not executed, no processing is executed for outputs. In the operation example shown above, the command contact is "OFF".

32 Applied Instructions (High Speed Processing 2)
32.1 DHSCT / High Speed Counter Compare With Data Table
Applied Instructions (Data Transfer 3)
M8138 DHSCT Instruction execution complete flag Turns ON when the operation for the final table No. "m-1" is completed.
D8138 DHSCT Table counter Stores the comparison point number handled as the comparison target.
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
6) For this instruction, only one comparison point (one line) is handled as the comparison target at one time. Processing will not move to the next comparison point until the current counter value becomes equivalent to the comparison point currently selected as the comparison target. If the current value of a high speed counter executes up counting using the comparison data table shown in the operation example on the previous page, be sure to execute the instruction while the current value of the high speed counter is smaller than the comparison value in comparison point No. 1.
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
B
An operation error occurs in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Device Name Description · Applied Instruction List

32 Applied Instructions (High Speed Processing 2)
32.1 DHSCT / High Speed Counter Compare With Data Table
In the program example shown below, the current value of C235 (counting X000) is compared with the comparison data table set in R0 and later, and a specified pattern is output to Y010 to Y013.


4 R13, R12 K300 R14 H0008 4 ↓ (repeated from "0")

33 Applied Instructions (Extension File Register Control)
Applied Instructions (Data Transfer 3)
Instruction name Function Reference
Applied Instructions (High Speed Processing 2)
Load From ER Section 33.1 LOADRP
SAVER Save to ER Section 33.2
Initialize R and ER Section 33.3 INITRP
Logging R and ER Section 33.4 LOGRP
Applied Instructions (Extension File Register Control)
Rewrite to ER Section 33.5 RWERP
Initialize ER Section 33.6 INITERP
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
Applied Instruction List

33 Applied Instructions (Extension File Register Control)
33.1 LOADR / Load From ER
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction reads the current values of extension file registers (ER) stored in a memory cassette (flash memory and EEPROM) or the file registers (ER) in the PLC's built-in EEPROM, and transfers them to extension registers (R) stored in the PLC's built-in RAM.


Device of extension register (transfer destination) to which data is to be transferred. (The extension file register having the same number is handled as the transfer source.)
Number of points to be read (transferred) (FX3G/FX3GC: 1 ≤ n ≤ 24000, FX3U/FX3UC: 0 ≤ n ≤ 32767) ANY16

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

33 Applied Instructions (Extension File Register Control)
33.1 LOADR / Load From ER
Applied Instructions (Data Transfer 3)
LOADRP EN ENO s n
Device of extension register to which data is to be transferred
Applied Instructions (High Speed Processing 2)
Number of points to be read (transferred)
Applied Instructions (Extension File Register Control)
Extension file registers (ER) inside memory cassette
Extension registers (R) inside built-in RAM
E +1
E +2
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
- Reading and transfer are executed in units of device. Up to 32768 devices can be read and transferred. - Different from SAVER, INITR and LOGR instructions, it is not necessary to execute this instruction in units of sector. - If "n" is set to "0", it is handled as "32768" when the instruction is executed.
The contents (current values) of extension file registers (ER) stored in a memory cassette (EEPROM) having the same numbers with the extension registers (R) specified by to +n-1 are read, and transferred to the extension registers specified by to +n-1 stored in the PLC's built-in RAM.
Relationships between devices and addresses
Extension file registers (ER) inside memory cassette
Extension registers (R) inside built-in RAM
E +1
E +2
E +3
- Reading and transfer are executed in units of device. Up to 24000 devices can be read and transferred.

33 Applied Instructions (Extension File Register Control)
33.1 LOADR / Load From ER
b) When not connecting to a memory cassette
The contents (current values) of extension file registers (ER) stored in PLC's built-in EEPROM having the same numbers with the extension registers specified by to +n-1 are read, and transferred to the extension registers (R) specified by to +n-1 stored in the PLC's built-in RAM.

- Reading and transfer are executed in units of device. Up to 24000 devices can be read and transferred.
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
*1. This does not cause an error with the FX3G PLCs because the PLCs read the contents of the extension file registers stored in the PLC's built-in EEPROM when a memory cassette is not connected.


In the program example shown below, the contents (current values) of 4000 extension file registers ER1 to ER4000 inside the memory cassette are read, and transferred to 4000 extension registers R1 to R4000 inside the built-in RAM.

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction writes the current values of extension registers (R) stored in the PLC's built-in RAM to extension file registers (ER) stored in a memory cassette (flash memory) in units of sector (2048 points). RWER instruction provided in FX3UC PLCs Ver. 1.30 or later and FX3U PLCs writes (transfers) only arbitrary number of points. It is not necessary to execute INITR or INITER instruction every time when RWER instruction is used.


Device of extension register to which data is to be written (Only the head device of a sector of extension registers can be specified.) ANY16
Number of points written (transferred) in one operation cycle. ANY16
Device storing the number of already written points ANY16

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

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER
Applied Instructions (Data Transfer 3)
The contents (current values) of 2,048 extension registers (R) starting from the device specified by are written (transferred) to extension file registers (ER) inside a memory cassette (flash memory) having the same device numbers in "2048/n" operation cycles ("2048/n +1" cycles if there is the remainder). When the instruction is being executed, the number of already written points is stored in .
Applied Instructions (High Speed Processing 2)
d Device of extension register to which data is to be transferred
Device storing the number of already written points
Number of points written
in one operation cycle
Applied Instructions (Extension File Register Control)
M M8029 Operation execution complete flag
SAVER instruction operation complete flag
Applied Instructions (FX3U-CF-ADP)
Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM
E +1
E +2
Interrupt Function and Pulse Catch Function
*1. "n" points are written (transferred) in each operation cycle.
(Number of points specified by ) n
Relationships between devices and addresses
Sector number Head device number Written device range Sector number Head device number Written device range
Sector 0 R0 ER0 to ER2047 Sector 8 R16384 ER16384 to ER18431
Sector 1 R2048 ER2048 to ER4095 Sector 9 R18432 ER18432 to ER20479
Sector 2 R4096 ER4096 to ER6143 Sector 10 R20480 ER20480 to ER22527
Sector 3 R6144 ER6144 to ER8191 Sector 11 R22528 ER22528 to ER24575
Sector 4 R8192 ER8192 to ER10239 Sector 12 R24576 ER24576 to ER26623
Sector 5 R10240 ER10240 to ER12287 Sector 13 R26624 ER26624 to ER28671
Sector 6 R12288 ER12288 to ER14335 Sector 14 R28672 ER28672 to ER30719
Sector 7 R14336 ER14336 to ER16383 Sector 15 R30720 ER30720 to ER32767
Device number Name Description
When execution of the target instruction is completed, the instruction execution complete flag M8028 turns ON. In a program, however, there may be two or more instructions which can use the flag M8029. To avoid confusion, be sure to use the NO (normally open) contact of this flag immediately under SAVER instruction so that this flag works only for SAVER instruction

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER
M
M
INITERP EN ENO s
The same extension register device number as the extension file register device to be initialized
The number of sectors for the extension register
to be initialized and the extension file register
Device of extension register to which data
Device storing the number of already written points
is to be transferred
Number of points written in one operation cycle
Operation execution complete flag
RST EN ENO
M
When the FX3U and FX3UC PLCs are Ver. 1.30 or later [1] When storing data of 2048 extension registers (R) in one sector to extension file register (ER).
a) Execute INITER instruction to extension file registers (ER) specified as targets in SAVER instruction. b) Execute SAVER instruction. [2] When storing the contents of an arbitrary number of extension registers (R) to extension file
registers (ER) Use RWER instruction.
→ For RWER instruction, refer to Section 33.5.
When the FX3UC PLCs are former than Ver. 1.30. [1] When storing data of 2048 extension registers (R) in one sector to extension file registers (ER)
If the extension registers (R) have data to be stored in extension file registers (ER), use the procedure [2]. a) Execute INITR instruction to extension registers (R) and extension file registers (ER) specified as
targets in SAVER instruction. b) Store data to extension registers (R) specified as targets. c) Execute SAVER instruction.

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER
[2] When storing data of 2048 extension registers (R) in one sector to extension file registers (ER)
Applied Instructions (Data Transfer 3)
a) Temporarily withdraw the data of extension registers (R) specified as targets in SAVER instruction to
data registers or unused 2048 extension registers (R) by using BMOV instruction. b) Execute INITR instruction to extension registers (R) and extension file registers (ER) specified as
targets in SAVER instruction. c) Return the data of 2048 points temporarily withdrawn in step a) to extension registers (R) specified as
targets by using BMOV instruction. d) Execute SAVER instruction.
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
Applied Instruction List

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER





33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER
SET EN ENO
M0
M0
BMOVP EN s n
R30720
INITRP EN s n
WDT EN ENO
BMOVP EN s n
K100
R0
K128
Operation execution complete flag
RST EN ENO
M0


Use unused devices as an area to which data is temporarily withdrawn.

33 Applied Instructions (Extension File Register Control)
33.2 SAVER / Save to ER


33 Applied Instructions (Extension File Register Control)
33.3 INITR / Initialize R and ER
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
This instruction initializes (to "HFFFF ") extension registers (R) in the RAM built in a PLC and extension file registers in a memory cassette (flash memory) before data logging by LOGR instruction. In FX3UC PLCs former than Ver. 1.30, use this instruction to initialize extension file registers (ER) before writing data to them using SAVER instruction. In FX3UC PLCs Ver. 1.30 or later, INITER instruction is also provided to initialize (to "HFFFF" ) only extension file registers (ER) in a memory cassette (flash memory) in units of sector.
→ For SAVER instruction, refer to Section 33.2.
Applied Instructions (Extension File Register Control)
→ For LOGR instruction, refer to Section 33.4. → For INITER instruction, refer to Section 33.6.
Expression in each language
Applied Instructions (FX3U-CF-ADP)
INITR EN s n
INITR 16 bits Continuous INITR(EN,s,n);
Interrupt Function and Pulse Catch Function
INITRP EN s n
INITRP 16 bits Pulse INITRP(EN,s,n);
Relationships between devices and addresses
Variable Description Data type
EN Execution condition Bit
Device of extension register and extension file register to be initialized It is possible to specify only the head device in a sector of extension registers.
Number of sectors of extension registers and extension file registers to be initialized. ANY16
Output variable ENO Execution state Bit

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

33 Applied Instructions (Extension File Register Control)
33.3 INITR / Initialize R and ER
1. 16-bit operation (INITR/INITRP)
"n" sectors of extension registers in the PLC's built-in RAM starting from the one specified by and "n" sectors of extension file registers in a memory cassette (flash memory) having the same device numbers are initialized (initial value "HFFFF" is written.). Initialization is executed in units of sector.
Extension registers to be initialized
and extension file register device Number of sectors of extension registers and
extension file registers to be initialized.
The table below shows the head device number in each sector.
Initialized device range Sector number
Sector 0 R0 R0 to R2047, ER0 to ER2047 Sector 8 R16384 R16384 to R18431, ER16384 to ER18431
Sector 1 R2048 R2048 to R4095, ER2048 to ER4095 Sector 9 R18432 R18432 to R20479, ER18432 to ER20479
Sector 2 R4096 R4096 to R6143, ER4096 to ER6143 Sector 10 R20480 R20480 to R22527, ER20480 to ER22527
Sector 3 R6144 R6144 to R8191, ER6144 to ER8191 Sector 11 R22528 R22528 to R24575, ER22528 to ER24575
Sector 4 R8192 R8192 to R10239, ER8192 to ER10239 Sector 12 R24576 R24576 to R26623, ER24576 to ER26623
Sector 5 R10240 R10240 to R12287, ER10240 to ER12287 Sector 13 R26624 R26624 to R28671, ER26624 to ER28671
Sector 6 R12288 R12288 to R14335, ER12288 to ER14335 Sector 14 R28672 R28672 to R30719, ER28672 to ER30719
Sector 7 R14336 R14336 to R16383, ER14336 to ER16383 Sector 15 R30720 R30720 to R32767, ER30720 to ER32767
+1 H0020 HFFFF +1 H5678 HFFFF
+2 H0011 HFFFF +2 H90AB HFFFF
+(2048×n)-1 HABCD HFFFF +(2048×n)-1 HCDEF HFFFF

33 Applied Instructions (Extension File Register Control)
33.3 INITR / Initialize R and ER
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
A value acquired by the following procedure can be regarded as the guideline of the watchdog timer set value. If an acquired value is 200 ms or less, however, it is not necessary to change the watchdog timer set value.
a) Write a program to be executed from GX Works2 to the PLC.
[Online] → [Write to PLC ...] b) Set the current value of D8000 (unit: ms) to "1000" using the modify value function in GX Works2.
Select [Online] → [Monitor] → [Monitor Mode] to switch the [PRG] MAIN screen. [Debug] → [Modify Value] c) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.) d) Monitor the maximum scan time D8012 (unit: 0.1 ms) using the device/buffer Memory Batch function
Applied Instructions (FX3U-CF-ADP)
in GX Works2. [Online] → [Device/Buffer Memory Batch] e) Set the watchdog timer to the maximum scan time (D8012) or more.
Interrupt Function and Pulse Catch Function
D8012 stores the maximum scan time in increments of 0.1 ms. Rough guide to the watchdog timer set value D8000 (unit: ms) is the "value stored in D8012 divided by 10" added by 50 to 100.
WDT EN ENO LDP EN ENO s
Relationships between devices and addresses
The watchdog timer is reset.
*1. Device of registers to be initialized
*2. Number of sectors of registers to be initialized
The watchdog timer is reset.
If the processing time of the INITR instruction exceeds 200 ms, set the value of D8000 (unit: ms) to the processing time or more.

33 Applied Instructions (Extension File Register Control)
33.3 INITR / Initialize R and ER
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
In the program example shown below, the extension registers R0 to R2047 in the sector 0 are initialized. Note that the extension file registers ER0 to ER2047 are also initialized if a memory cassette is attached.
WDT EN ENO LDP EN ENO s
INITR(LDP(TRUE,X000),R0,K1);
WDT(LDP(TRUE,X000));
ENO R0
K1
WDT EN ENO
R1 H5678 HFFFF
R2 H90AB HFFFF
R2047 HCDEF HFFFF


FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction logs specified devices, and stores the logged data to extension registers (R) and extension file registers (ER) in a memory cassette.
Number of devices to be logged (1≤ m ≤ 8000) ANY16
Number of sectors of devices used in logging (1 ≤ n ≤ 16) ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

33 Applied Instructions (Extension File Register Control)
33.4 LOGR / Logging R and ER
1. 16-bit operation (LOGR/LOGRP)
While the instruction is driven, "m" devices starting from the device specified by are logged until "n" sectors of extension registers (R) starting from the device specified by and extension file registers (ER) in a memory cassette are filled. The number of pieces of logged data is stored to the device specified by . If a memory cassette is not used, data is not written to extension file registers (ER).

Head device to be logged Number of devices to be logged Number of sectors of devices used in logging
Head device used in logging Number of pieces of logged data

Writing position control area (Every time one word is used in the data writing area, bits are set to OFF (0) from ON (1) in turn from bit 0 of [ + (1926 n) - 1]. After bit 15 of [ + (1926 n) - 1] is set to OFF (0), bit 0 of the next device [ + (1926 n)] is set to OFF (0) in the next logging.)
The table below shows the head device number in each sector.
Written device range Sector number
Sector 0 R0 R0 to R2047, ER0 to ER2047 Sector 8 R16384 R16384 to R18431, ER16384 to ER18431
Sector 1 R2048 R2048 to R4095, ER2048 to ER4095 Sector 9 R18432 R18432 to R20479, ER18432 to ER20479
Sector 2 R4096 R4096 to R6143, ER4096 to ER6143 Sector 10 R20480 R20480 to R22527, ER20480 to ER22527
Sector 3 R6144 R6144 to R8191, ER6144 to ER8191 Sector 11 R22528 R22528 to R24575, ER22528 to ER24575
Sector 4 R8192 R8192 to R10239, ER8192 to ER10239 Sector 12 R24576 R24576 to R26623, ER24576 to ER26623
Sector 5 R10240 R10240 to R12287, ER10240 to ER12287 Sector 13 R26624 R26624 to R28671, ER26624 to ER28671
Sector 6 R12288 R12288 to R14335, ER12288 to ER14335 Sector 14 R28672 R28672 to R30719, ER28672 to ER30719
Sector 7 R14336 R14336 to R16383, ER14336 to ER16383 Sector 15 R30720 R30720 to R32767, ER30720 to ER32767

33 Applied Instructions (Extension File Register Control)
33.4 LOGR / Logging R and ER
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Logging data storage area initialization command input
INITR EN s n
Applied Instructions (Extension File Register Control)
Device of registers to be initialized*1
Number of sectors of registers to be initialized*2
*1. Specify the same device as in LOGR instruction.
*2. Specify the same number as (n) in LOGR instruction.
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instruction List

33 Applied Instructions (Extension File Register Control)
33.4 LOGR / Logging R and ER
In the program example shown below, D1 and D2 are logged to the area from R2048 to R6143 every time X001 turns ON.

Because two words are used, low-order two bits are set to OFF (0).
Because two words are used, low-order two bits are set to OFF (0).

33 Applied Instructions (Extension File Register Control)
33.5 RWER / Rewrite to ER
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
This instruction writes the current values of an arbitrary number of extension registers (R) in the PLC's built-in RAM to extension file registers (ER) in a memory cassette (flash memory or EEPROM) or to the extension file registers (ER) in the PLC's built-in EEPROM. Because RWER instruction is not provided in the FX3UC PLC earlier than Ver. 1.30, use SAVER instruction instead.
Applied Instructions (Extension File Register Control)
Expression in each language
RWER EN ENO s n
RWER 16 bits Continuous RWER(EN,s,n);
Applied Instructions (FX3U-CF-ADP)
RWERP EN ENO s n
RWERP 16 bits Pulse RWERP(EN,s,n);
Interrupt Function and Pulse Catch Function
Variable Description Data type
EN Execution condition Bit
Device of extension register storing data ANY16
Number of written (transferred) devices [FX3G/FX3GC: 1 ≤ n ≤ 24000, FX3U/FX3UC: 0 ≤ n ≤ 32767] ANY16
Relationships between devices and addresses
Output variable ENO Execution state Bit
B
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

33 Applied Instructions (Extension File Register Control)
33.5 RWER / Rewrite to ER
1. 16-bit operation (RWER)
RWERP EN ENO s n
Device of extension register storing data
Number of written (transferred) devices

Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM
*1. All points specified by the instruction are written (transferred).
- When "n" is set to "0", it is handled as "32768" when the instruction is executed.
The contents (current values) of the "n" points of extension registers (R) starting from are written (transferred) to the extension file registers (ER) having the same numbers as the extension registers (R) in the memory cassette (EEPROM).

Extension file registers (ER) inside memory cassette Extension registers (R) inside built-in RAM
*1. All points specified by the instruction are written (transferred).
b) When not connecting a memory cassette
The contents (current values) of the "n" points of extension registers (R) starting from are written (transferred) to the extension file registers (ER) having the same numbers as the extension registers (R) in the PLC's built-in EEPROM.

Extension file registers (ER) inside PLC's built-in EEPROM Extension registers (R) inside built-in RAM
*1. All points specified by the instruction are written (transferred).
Command input

33 Applied Instructions (Extension File Register Control)
33.5 RWER / Rewrite to ER
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
ADD_E EN _IN _IN
Applied Instructions (FX3U-CF-ADP)
*1. Number of sectors to be written 47 ms
WDT EN ENO
Interrupt Function and Pulse Catch Function
RWER EN ENO s n
The contents of R1000 to R1099 in the sector 0 are written to ER1000 to ER1099.
K100
A
Relationships between devices and addresses
B
The table below shows the device range in each sector.
Sector number Device range Sector number Device range
Sector 0 ER0 to ER2047 Sector 8 ER16384 to ER18431
Sector 1 ER2048 to ER4095 Sector 9 ER18432 to ER20479
Sector 2 ER4096 to ER6143 Sector 10 ER20480 to ER22527
Sector 3 ER6144 to ER8191 Sector 11 ER22528 to ER24575
Sector 4 ER8192 to ER10239 Sector 12 ER24576 to ER26623
Sector 5 ER10240 to ER12287 Sector 13 ER26624 to ER28671
Sector 6 ER12288 to ER14335 Sector 14 ER28672 to ER30719
Sector 7 ER14336 to ER16383 Sector 15 ER30720 to ER32767
→ For the backup method, refer to the next page.

33 Applied Instructions (Extension File Register Control)
33.5 RWER / Rewrite to ER
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
*1. For the FX3G and FX3GC PLCs, the last device number is "23999".
*2. This does not cause an error with the FX3G PLCs because the PLCs read the contents of the extension file registers stored in the PLC's built-in EEPROM even if a memory cassette is not connected.


In the program example shown below, the changed contents of extension registers R10 to R19 (sector 0) used for setting data are reflected on extension file registers (ER) when X000 turns ON.

33 Applied Instructions (Extension File Register Control)
33.6 INITER / Initialize ER
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
This instruction initializes extension file registers (ER) to "HFFFF" () in a memory cassette (flash memory) before executing the SAVER instruction. Because INITER instruction is not provided in the FX3UC PLC earlier than Ver. 1.30, use INITR instruction instead.
→ For SAVER instruction, refer to Section 33.2.
→ For INITR instruction, refer to Section 33.3.


Device number of extension register sector with the same device number as the extension file register to be initialized. It is possible to specify only the head device in a sector of extension registers.
Number of sectors of extension registers and extension file registers to be initialized. ANY16

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

33 Applied Instructions (Extension File Register Control)
33.6 INITER / Initialize ER
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Extension register sector with the same device number
as the extension file register to be initialized. Number of sectors of extension registers and
extension file registers to be initialized.
The table below shows the head device number in each sector.
Applied Instructions (Extension File Register Control)
Sector number Head device
number Initialized device range Sector number Head device
number Initialized device range
Sector 0 R0 ER0 to ER2047 Sector 8 R16384 ER16384 to ER18431
Sector 1 R2048 ER2048 to ER4095 Sector 9 R18432 ER18432 to ER20479
Sector 2 R4096 ER4096 to ER6143 Sector 10 R20480 ER20480 to ER22527
Applied Instructions (FX3U-CF-ADP)
Sector 3 R6144 ER6144 to ER8191 Sector 11 R22528 ER22528 to ER24575
Sector 4 R8192 ER8192 to ER10239 Sector 12 R24576 ER24576 to ER26623
Sector 5 R10240 ER10240 to ER12287 Sector 13 R26624 ER26624 to ER28671
Sector 6 R12288 ER12288 to ER14335 Sector 14 R28672 ER28672 to ER30719
Sector 7 R14336 ER14336 to ER16383 Sector 15 R30720 ER30720 to ER32767
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
+1 H5678 HFFFF
+2 H90AB HFFFF
B
+(2048×n)-1 HCDEF HFFFF

33 Applied Instructions (Extension File Register Control)
33.6 INITER / Initialize ER
A value acquired by the following procedure can be regarded as the guideline of the watchdog timer set value. If an acquired value is 200 ms or less, however, it is not necessary to change the watchdog timer set value.
a) Write a program to be executed from GX Works2 to the PLC.
[Online] → [Write to PLC ...] b) Set the current value of D8000 (unit: ms) to "1000" using the modify value function in GX Works2.
Select [Online] → [Monitor] → [Monitor Mode] to switch the [PRG] MAIN screen. [Debug] → [Modify Value] c) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.) d) Monitor the maximum scan time D8012 (unit: 0.1 ms) using the device/buffer Memory Batch function
in GX Works2. [Online] → [Device/Buffer Memory Batch] e) Set the watchdog timer to the maximum scan time (D8012) or more.
D8012 stores the maximum scan time in increments of 0.1 ms. Rough guide to the watchdog timer set value D8000 (unit: ms) is the "value stored in D8012 divided by 10" added by 50 to 100.
WDT EN ENO LDP EN ENO s
The watchdog timer is reset.
*1. Device number of the extension registers to be initialized *2. Device number of the extension registers to be initialized WDT EN ENO
The watchdog timer is reset.
If the processing time of the INITR instruction exceeds 200 ms, set the value of D8000 (unit: ms) to the processing time or more.

33 Applied Instructions (Extension File Register Control)
33.6 INITER / Initialize ER
Applied Instructions (Data Transfer 3)
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is stored in D8067.
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
In the program example shown below, the extension file registers ER0 to ER2047 in sector 0 are initialized.
WDT EN ENO LDP EN ENO s
Applied Instructions (FX3U-CF-ADP)
The watchdog timer is reset.
K1
Interrupt Function and Pulse Catch Function
The watchdog timer is reset.
Relationships between devices and addresses
WDT(LDP(TRUE,X000));
INITER(LDP(TRUE,X000),R0,K1);
WDT(LDP(TRUE,X000));
B
ER1 H5678 HFFFF
ER2 H90AB HFFFF
ER2047 HCDEF HFFFF

34 Applied Instructions (FX3U-CF-ADP)
Instruction name Function Reference
FLCRT File create • check Section 34.1
FLDEL File delete • CF card format Section 34.2
FLWR Data write Section 34.3
FLRD Data read Section 34.4
FLCMD FX3U-CF-ADP command Section 34.5
FLSTRD FX3U-CF-ADP status read Section 34.6

34 Applied Instructions (FX3U-CF-ADP)
34.1 FLCRT / File create • check
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
The FLCRT instruction creates a file inside the CompactFlashTM card mounted in the FX3U-CF-ADP. When executed after creation of a new file, the FLCRT instruction checks the association with the file ID, and evaluates it.
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
Applied Instructions (Extension File Register Control)
Expression in each language
FLCRT EN ENO s1 s2 s3 n
FLCRT 16 bits Continuous FLCRT(EN,s1,s2,s3,n);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
Interrupt Function and Pulse Catch Function
EN Execution condition Bit
File ID (Refer to Detailed explanation of setting data) ANY16
File name (Refer to Detailed explanation of setting data) String
File creation parameter (Refer to Detailed explanation of setting data) ARRAY [0..3] OF ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
Relationships between devices and addresses
Output variable ENO Execution state Bit
B
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z

34 Applied Instructions (FX3U-CF-ADP)
34.1 FLCRT / File create • check
1. 16-bit operation (FLCRT)
FLCRT EN ENO s1 s2 s3 n
File ID File name File creation parameter
2) When the file ID is "K1" to "K63" When is "K1" to "K63", the FLCRT instruction creates a file having the specified file name. Sequence programs use the file ID for specifying a file. Accordingly, each file name saved in the CompactFlashTM card is associated with the file ID, and controlled by the file ID table. If a file having the specified file name already exists and is registered in the file ID table, the PLC finishes the FLCRT instruction without executing any processing. If a file having the specified name already exists but is not registered in the file ID table, the PLC only registers the existing file to the file ID table.
Command input · Used channel number

34 Applied Instructions (FX3U-CF-ADP)
34.1 FLCRT / File create • check
Applied Instructions (Data Transfer 3)
Details of the setting data in the FLCRT instruction are as shown below.
Setting items Description Data Type
File ID This ID number is associated with the file name. The FLCRT instruction creates a file, and associates the file name with the file ID at the same time. The user should use the file ID for specifying a file after that. Allowable setting range : K0 to K63 ("K0" indicates "FIFO file".)
Applied Instructions (High Speed Processing 2)
When is "K0 (FIFO file)" Not used (ignored) Use an unused device. (D or R)
When is "K1" to "K63" Specify the file name in up to 8 characters until "null" or "null + null". Half-width alphanumeric characters and half-width symbols permitted in the MS-DOS are available. Half-width symbols : !, #, $, %, &, ', (, ), +, -, @, ^, _, ', ~ The extension is fixed to "CSV"
Applied Instructions (Extension File Register Control)
Time stamp setting Set whether or not the time stamp is added to the file. Specify the format when adding the time stamp. K0 : None (NULL) K1 : yyyy/mm/dd hh:mm:ss K2 : yy/mm/dd hh:mm:ss K3 : dd/mm/yyyy hh:mm:ss K4 : dd/mm/yy hh:mm:ss K5 : mm/dd/yyyy hh:mm:ss K6 : mm/dd/yy hh:mm:ss K7 : hh:mm:ss
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Data type Set the data type to be saved. K0 : No data type specification (mixed type) K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type (32-bit) K7 : Character string
OF ANY16
Relationships between devices and addresses
Maximum number of lines Set the maximum number of lines.
When is "K0 (FIFO file)"
Set the CompactFlashTM card use ratio.
Specify the ratio (%) out of the whole CompactFlashTM card capacity to be used. Allowable setting range : 10 to 90 (%)
When is "K1" to "K63" File processing to be executed when the specified maximum number of lines is reached. Set the file processing method to be executed when the number of lines reaches the specified maximum value. K0 : Stops execution. (The line position remains the specified maximum line position.) K1 : Returns to the head (ring buffer file).
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
*1. Adjust the maximum number of lines to specify the file size available in the used application software used. For the file size calculation formula, refer to FX3U-CF-ADP User's Manual

34 Applied Instructions (FX3U-CF-ADP)
34.1 FLCRT / File create • check
a) The CF-ADP can create up to 1000 files (within the CompactFlashTM card capacity). b) The file name is set to "FILE0000.CSV" to "FILE0999.CSV".
a) The user can create up to 63 files (within the CompactFlashTM card capacity). b) The FLCRT instruction is completed abnormally if different file names are specified for the same file ID
or if the same file name is specified for different file IDs.


34.2 FLDEL / File delete • CF card format
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
The FLDEL instruction deletes files stored in the CompactFlashTM card, or formats the CompactFlashTM
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
File ID (Refer to Detailed explanation of setting data) ANY16
File delete method (Refer to Detailed explanation of setting data) ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P

34 Applied Instructions (FX3U-CF-ADP)
34.2 FLDEL / File delete • CF card format
1. 16-bit operation (FLDEL)
FLDEL EN ENO s1 s2 n
File ID File delete method Used channel number
The FLDEL instruction deletes files stored in the CompactFlashTM card, or formats the CompactFlashTM card in the following method.
a) When is "K-1 (H0FFFF)", the FLDEL instruction deletes all files whose ID is 0 to 63.
b) When is "K0" to "K63", the FLDEL instruction deletes the file associated with the specified file ID.
c) When is "K512 (H200)", the FLDEL instruction formats the CompactFlashTM card.
a) When is "K-1 (H0FFFF)" or "K0" to "K63", specify the deletion method K0: The FLDEL instruction deletes the specified file. K1: The FLDEL instruction deletes the association between the file name and the file ID (, but does
not delete the file itself). However, when the file ID specified in is "0", the FLDEL instruction deletes the file without regard to the setting of .
b) When is "K512 (H200)", specify the format type. k256(H100) : The FLDEL instruction formats the CompactFlashTM card in FAT16 format. For details, refer to Detailed explanation of setting data.
Details of the setting data in the FLDEL instruction are as shown below.
Setting items Description Data Type
File ID K-1(H0FFFF) : The FLDEL instruction deletes all files. K0 to K63 : The FLDEL instruction deletes a file associated with the specified file ID.
K512(H200) : The FLDEL instruction formats the CompactFlashTM card.
When is "K-1 (H0FFFF)" or "K0" to "K63" Specify the deletion method. K0 : The FLDEL instruction deletes the specified file. K1 : The FLDEL instruction deletes the association between the file name and the file ID
(but does not delete the file itself).
However, when the file ID specified in is "0", the FLDEL instruction deletes the file
itself without regard to the setting of .
When is "K512 (H200)" Specify the format type.
K256(H100) : The FLDEL instruction formats the CompactFlashTM card in the FAT16 format.
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
Cautions
Command input

34 Applied Instructions (FX3U-CF-ADP)
34.3 FLWR / Data write
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
The FLWR instruction writes data to the CompactFlashTM card or to the buffer inside the FX3U-CF-ADP.
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
Expression in each language
Applied Instructions (Extension File Register Control)
d s1 s2 s3 n
FLWR 16 bits Continuous FLWR(EN,s1,s2,s3,n,d);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
EN Execution condition Bit
File ID (Refer to Detailed explanation of setting data) ANY16
Interrupt Function and Pulse Catch Function
Head of devices which store data to be written (Refer to Detailed explanation of setting data) ANY_SIMPLE
Data write parameter (Refer to Detailed explanation of setting data) ARRAY [0..4] OF ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
ENO Execution state Bit
Relationships between devices and addresses
Position after data writing (Refer to Detailed explanation of setting data) ARRAY [0..1] OF ANY16
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z

34 Applied Instructions (FX3U-CF-ADP)
34.3 FLWR / Data write
1. 16-bit operation (FLWR)
File ID Position after data writing Head of devices which store data to be written
d s1 s2 s3 n
Data write parameter Used channel number
The FLWR instruction writes data specified by the device to a file stored in the CompactFlashTM card specified by the file ID or to the buffer inside the CF-ADP. The FLWR instruction can overwrite data in the line position specified by the device +1, and can write additional data (K-1). When the writing destination is the buffer inside the CF-ADP, the FLWR instruction can only execute additional writing. When writing is completed, the line position and column position after writing are as follows.
Both additional writing and overwriting are executed to the maximum number of lines specified during file creation. If data is written up to the final column position, the line position after writing varies depending on the file type and setting.
In either case, the column position after writing is "K1".
Command input

34 Applied Instructions (FX3U-CF-ADP)
34.3 FLWR / Data write
Applied Instructions (Data Transfer 3)
Details of the setting data in the FLWR instruction are as shown below.
Setting items Description Data Type
File ID K0 to K63 ANY16
Head of devices which store data to be written.
Specify the head of devices which store the data to be written to the CompactFlashTM
Applied Instructions (High Speed Processing 2)
card.
Specify the data writing type K0 : Mixed type K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type (32-bit) K7 : Character string (512 half-width/full-width characters maximum) K8 : Data name :Character string consisting of up to 32 half-width/full-width
Applied Instructions (Extension File Register Control)
characters. Index, DATE TIME are added automatically. ARRAY [0..4]
Specify the line position of the writing destination, or specify additional writing. Line position of the writing destination : K1 to specified maximum number of lines Additional writing : K-1
Applied Instructions (FX3U-CF-ADP)
Specify the data column position in the writing destination. Column position : K1 to K254 Additional writing : K-1
Number of written data points K1 to K254
Interrupt Function and Pulse Catch Function
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
Line position after writing K1 to specified maximum number of lines ARRAY [0..1]
Column position after writing K1 to K254
Relationships between devices and addresses

34 Applied Instructions (FX3U-CF-ADP)
34.3 FLWR / Data write

34 Applied Instructions (FX3U-CF-ADP)
34.4 FLRD / Data read
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
The FLRD instruction reads data from the CompactFlashTM card.
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
Expression in each language
Applied Instructions (Extension File Register Control)
FLRD EN ENO s1 s2 n
FLRD 16 bits Continuous FLRD(EN,s1,s2,n,d1,d2);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
EN Execution condition Bit
File ID (Refer to Detailed explanation of setting data) ANY16
Data read parameter (Refer to Detailed explanation of setting data) ARRAY [0..3] OF ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
Interrupt Function and Pulse Catch Function
ENO Execution state Bit
Device which stores the read data (Refer to Detailed explanation of setting data) ANY_SIMPLE
Number of data points existing in the specified line ANY16
Relationships between devices and addresses
Bit Devices Word Devices Others
System user Digit specification System
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
z
1. 16-bit operation (FLRD)
Device which stores the read data Number of data points existing in the specified line Used channel number
File ID Data read parameter
d1 d2 s1 s2 n
The FLRD instruction reads corresponding number of data from the position determined by the line position and column position in the file specified by the file ID, and stores the read data to a device specified in .
When reading data from a file in which only the same type of data exists in one line, refer to FX3U-CF-ADP User's Manual. When reading data from a file in which different types of data exist in one line, refer to FX3U-CF-ADP User's Manual.

34 Applied Instructions (FX3U-CF-ADP)
34.4 FLRD / Data read
Details of the setting data in the FLRD instruction are as shown below.
Setting items Description Data Type
File ID K0 to K63 ANY16
Specify the data reading type K0 : Mixed type K1 : Bit type K2 : Decimal type (16-bit) K3 : Decimal type (32-bit) K4 : Hexadecimal type (16-bit) K5 : Hexadecimal type (32-bit) K6 : Real numbers(Floating point data) Exponent expression type K7 : Character string (512 half-width/full-width characters maximum)
OF ANY16
Specify the line position from which data is read. Line position : K1 to specified maximum number of lines
Specify the column position from which data is read. Column position : K1 to K254
Read points K1 to K254
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
Device which stores the read data
Specify the head of devices which store the data read from the CompactFlashTM card. ANY_SIMPLE
Number of data points existing in the specified line K1 to K254 K0 : No data
Cautions

34 Applied Instructions (FX3U-CF-ADP)
34.5 FLCMD / FX3U-CF-ADP command
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
The FLCMD instruction gives instruction for operation to the FX3U-CF-ADP.
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
Expression in each language
Applied Instructions (Extension File Register Control)
FLCMD EN ENO s n
FLCMD 16 bits Continuous FLCMD(EN,s,n);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
EN Execution condition Bit
Instruction for operation (Refer to Detailed explanation of setting data) ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
Output variable ENO Execution state Bit
Interrupt Function and Pulse Catch Function
Bit Devices Word Devices Others
System user Digit specification System
Relationships between devices and addresses
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
1. 16-bit operation (FLCMD)
The FLCMD instruction gives instruction for operation to the CF-ADP. The contents of instruction are as follows.
For details, refer to Detailed explanation of setting data.

34 Applied Instructions (FX3U-CF-ADP)
34.5 FLCMD / FX3U-CF-ADP command
Details of the setting data in the FLCMD instruction are as shown below.
Setting items Description Data Type
Contents of instruction for operation
K-1 : Forcibly writes all buffered data to the CompactFlashTM card.
card.
K256(H100) : Sets the CompactFlashTM card to the mounted status*1.
K512(H200) : Sets the CompactFlashTM card to the unmounted status*2. K1280(H500) : Clears error codes stored in the CF-ADP.
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
*1. The CompactFlashTM card is available in the "mounted" status.
*2. The CompactFlashTM card is unavailable in the "unmounted" status.

34 Applied Instructions (FX3U-CF-ADP)
34.6 FLSTRD / FX3U-CF-ADP status read
Applied Instructions (Data Transfer 3)
FX3U(C) FX3G(C) FX3S FX2N(C) FX1N(C) FX1S FXU/FX2C FX0N FX0(S)
Applied Instructions (High Speed Processing 2)
The FLSTRD instruction reads the status (including the error information and file information) of the FX3U- CFADP.
→ As for explanation of the instruction, see the FX3U-CF-ADP User's Manual.
Expression in each language
Applied Instructions (Extension File Register Control)
FLSTRD 16 bits Continuous FLSTRD(EN,s,n,d);
Applied Instructions (FX3U-CF-ADP)
Variable Description Data type
EN Execution condition Bit
Contents of status to be read (Refer to Detailed explanation of setting data) ANY16
Used channel number [contents of setting : K1 = ch1, K2 = ch2] ANY16
ENO Execution state Bit
Interrupt Function and Pulse Catch Function
Head device to which the read status is written (Refer to Detailed explanation of setting data) ANY16
A
Bit Devices Word Devices Others
System user Digit specification System
Relationships between devices and addresses
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G V Z Modifier K H E " " P
z
1. 16-bit operation (FLSTRD)
Command input FLSTRD EN
Contents of status to be read Head device to which the read status is written Used channel number
The FLSTRD instruction reads the status information of the CF-ADP. The following contents can be read. The number of data stored in varies depending on the contents of the read status.

34 Applied Instructions (FX3U-CF-ADP)
34.6 FLSTRD / FX3U-CF-ADP status read
Details of the setting data in the FLSTRD instruction are as shown below.

Contents of status to be read K0 to K63 : Final line position of each file
K512(H200) : Capacity of the CompactFlashTM card K768(H300) : Version of the CF-ADP K1024(H400) : Error information (error flag) K1280(H500) : Error codes
Channel number used by the CF-ADP K1 : ch1 K2 : ch2
Head device to which the read status is written
The number of data points stored in varies depending on the contents of the read status.

Final line position K1 to the specified maximum line position

File ID correspondence table

items b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+1 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
+2 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
+3 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48

+1, Data capacity of the CompactFlashTM card (kB) Units, If the data capacity is less than 1 kB, "1" is stored.
+3, +2 Used space of the CompactFlashTM card (kB) Units, If the data size is less than 1 kB, "1" is stored.
+5, +4 Free space of the CompactFlashTM card (kB) Units, If the data size is less than 1 kB, "1" is stored.
Stores the version of CF-ADP. (Example) K100 = Ver.1.00
Setting items Description

34 Applied Instructions (FX3U-CF-ADP)
34.6 FLSTRD / FX3U-CF-ADP status read
Applied Instructions (Data Transfer 3)
b0 : The CompactFlashTM card is not mounted.
b1 : The CompactFlashTM card is full. b2 : An error has occurred in the CF-ADP. b3 : CF-ADP H/W error
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
+1 Error code details 1
+2 Error code 2
+3 Error code details 2
Applied Instructions (FX3U-CF-ADP)
+4 Error code 3
+5 Error code details 3
+6 Error code 4
+7 Error code details 4
+8 Error code 5
Interrupt Function and Pulse Catch Function
+9 Error code details 5
A
Relationships between devices and addresses

35 Interrupt Function and Pulse Catch Function
This chapter explains the built-in interrupt function and pulse catch function in FX PLCs. The input, special devices and timers in the explanations relate to the FX3U and FX3UC PLCs. Note that these differ from one model of PLC to another.
→ FX Structured Programming Manual [Device & Common]
This section explains the function to immediately execute an interrupt program (interrupt routine) without being affected by the operation cycle of the sequence program (main) while using an interrupt function as a trigger. The delay by operation cycle and machine operation affected by uneven time intervals in normal sequence program process can be improved.
→ For details, refer to Section 35.3.
→ For details, refer to Section 35.4.
→ For details, refer to Section 35.5.
→ For details, refer to Section 35.6.
5. Pulse catch function When the input signal from an input (X000 to X007) turns ON from OFF, a special auxiliary relay ;M8170 to M8177 is set in the interrupt processing. By a relay M8170 to M8177 in a normal sequence program, a signal that remains ON longer than the receivable range with regular input processing can be easily received. When processing such a signal that turns ON and OFF several times in one operation cycle, however, use the input interrupt function.
→ For details, refer to Section 35.7.
6. Pulse width/Pulse period measurement function When the input signal from an input (X000, X001, X003 or X004) turns from OFF to ON, the value of the 1/6 μs ring counter at the input signal rising edge is stored in special data registers. When the input signal turns OFF from ON, the value of the 1/6 μs ring counter at the input signal falling edge is stored in special data registers. At the same time, the difference in the counter value between the rising edge and the falling edge is divided by "60", and the pulse width in units of 10 μs is stored in special data registers. In the pulse period measurement mode, when the input signal turns from OFF to ON, the difference between the previous rising of the input signal and the current rising of the input signal is divided by "60", and then the pulse period in units of 10 μs is stored in special data registers.
→ For details, refer to Section 35.8.

35 Interrupt Function and Pulse Catch Function
35.2 Common items
Applied Instructions (Data Transfer 3)
Three types of interrupt, namely, input interrupt, timer interrupt and counter interrupt, are available. Observe the following in creating an interrupt program.
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Set an interrupt pointer
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
For the interrupt pointers set in the event box, refer to their respective explanations.
Relationships between devices and addresses
Applied Instruction List

35 Interrupt Function and Pulse Catch Function
This section describes how to disable the interrupt function and pulse catch function.
Interrupts are enabled.
EO
Interrupts are disabled.
excluded. This special auxiliary relay is not available for pulse catch function. b) When the disabled zone is long, interrupts are accepted, but the interrupt processing is started after
considerable time. When the interrupt disabling setting is not required, program only EI instruction. It is not always necessary to program DI instruction.
[Main program]

35 Interrupt Function and Pulse Catch Function
35.2 Common items
Applied Instructions (Data Transfer 3)
Input interrupt The input interrupts X000 to X005 correspond to M8050 to M8055*1 respectively. When a relay M8050 to M8055 turns ON, a corresponding input interrupt is disabled.
Applied Instructions (High Speed Processing 2)
Timer interrupt The timer interrupts 16 to 18 correspond to M8056 to M8058*1 respectively. When a relay M8056 to M8058 turns ON, a corresponding timer interrupt is disabled.
High speed counter interrupt When M8059*1 turns ON, all of the high speed counter interrupts 1010 to 1060 are disabled.
*1. Cleared when the PLC mode is changed from RUN to STOP.
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
M8053
Interrupts are enabled.
Command to disable an interrupt triggered by X003
Interrupt Function and Pulse Catch Function
When the rising edge of X003 is detected
Relationships between devices and addresses
B
[Main program] · Interrupt routine · Applied Instruction List

35 Interrupt Function and Pulse Catch Function
This section explains common cautions on using the interrupt function or pulse catch function. Specific cautions on each interrupt function are explained in the description of each interrupt function.
*1. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S or FX3G PLC does not support the timers for routine programs.
5. Operation of devices latched in the ON status [interrupt function] Devices which were set to ON in an interrupt routine are held in the ON status even after the interrupt routine is finished. When RST instruction for a timer or counter is executed, the reset status of the timer or counter is also held. To turn OFF a device held in the ON status or for canceling such a timer or counter held in the reset status, reset such a device or deactivate RST instruction respectively inside or outside routine.
Example in which outputs are latched In the program example shown below, the counter C0 is provided to count X001. When X000 turns ON from OFF, the interrupt program I001 is executed only in one scan, and then the counter C0 is reset and Y007 is output.
OUT_C EN ENO CCoil CValue
RST EN ENO
Y007
[Main program]


Current value of C0 1 2 3 Counter is reset.
Because the C0 reset instruction is valid, the current value of C0 remains unchanged even if pulses are input.
Program to deactivate the preceding C0 RST instruction inside the subroutine.

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

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
35 Interrupt Function and Pulse Catch Function
Interrupts are enabled.
Interrupt inputs are accepted after EI instruction. It is not necessary to program DI (disable interrupt) instruction if there is no zone where input interrupts should be disabled.
When the rising edge of X000 is detected
When X000 turns ON, its rising edge is detected, and the interrupt routine 1) is executed. The program execution returns to the main program after executing routine 1).
Interrupt routine 1) (Interrupt program)
When the falling edge of X001 is detected
When X001 turns OFF, its falling edge is detected, and the interrupt routine 2) is executed. The program execution returns to the main program after executing routine 2).
Interrupt routine 2) (Interrupt program)
0:Interrupt at falling edge 1:Interrupt at rising edge
0 to 5 according to the inputs X000 to X005
Input number*1 Pointer number
Interrupt disable command Interrupt at rising edge Interrupt at falling edge
X001 I101 I100 M8051 *2
X002 I201 I200 M8052 *2
X003 I301 I300 M8053 *2
X004 I401 I400 M8054 *2
X005 I501 I500 M8055 *2
*1. The input numbers differ from one type of PLC to another. FX0, FX0S and FX0N PLCs: supports X000 to X003 only.
*2. Cleared when the PLC mode is changed from RUN to STOP.
[Main program] · [Main program] · Main program

35 Interrupt Function and Pulse Catch Function
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
For the FX3S, FX3G, FX3GC, FX3U and FX3UC PLCs
PLC Input number Input filter value when "0" is set
FX3U, FX3UC X000 to X005 5μs*1
X000, X001, X003, X004 10μs
X002, X005 50μs
Interrupt Function and Pulse Catch Function
X000, X001 10μs
X002, X003, X004, X005 50μs
*1. When using the input filter at the filter value of 5 μs or when receiving a pulse whose response frequency is 50 k to 100 kHz using a high speed counter, perform the following. - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 Ω (1 W or more) to an input terminal, and make sure that the load current of the open collector transistor output in the counterpart equipment is 20 mA or more including the input current in the main unit.
Relationships between devices and addresses
For the FX1S, FX1N, FX1NC, FX2N and FX2NC PLCs
PLC Input number Pulse width
X000, X001 10μs
X002 to X005 50μs
X000, X001 20μs
X002 to X005 50μs
For the FX0S, FX0, FX0N, FXU and FX2C PLCs
PLC Input number Pulse width
FX0S, FX0, FX0N X000 to X003 100μs
FXU, FX2C X000 to X005 200μs
Applied Instruction List

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
35 Interrupt Function and Pulse Catch Function
Interrupts are enabled by EI instruction. The main program is described.
When the rising edge of X000 is detected
When an interrupt routine is executed by turning ON of X000, Y000 is reset unconditionally.
M8000
Y000
The outputs Y000 to Y007 are overwritten with the latest information by the output refresh instruction. If the output refresh instruction is not provided, Y000 turns ON after END instruction after the program execution returned to the main routine.
REF EN d n
K8 *1
If "SET Y000" is changed to "RST Y000", Y000 is immediately set to OFF by turning ON of X000.
*1. Be sure to specify a multiple of "8" for the number of inputs/outputs to be refreshed by REF instruction. If any value other than a multiple of "8" is specified, an operation error occurs and REF instruction is not executed.
Interrupts are enabled by EI instruction. The main program is described.
When the rising edge of X001 is detected
REF EN d n
When an interrupt routine is executed by turning X001 to ON, the input refresh is executed unconditionally, and the ON/OFF information of X010 to X017 at the current time is received.
ENO RUN monitor X010
Y001 is set to ON or OFF according to the ON/OFF status of X010.
Y001
RST EN ENO
Y001
*1. Be sure to specify a multiple of "8" for the number of inputs/outputs to be refreshed by REF instruction. If any value other than a multiple of "8" is specified, an operation error occurs and REF instruction is not executed.
[Main program] · RUN monitor · [Main program]

35 Interrupt Function and Pulse Catch Function
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
Applied Instructions (Data Transfer 3)
Interrupts are enabled by EI instruction. The main program is described.
Applied Instructions (High Speed Processing 2)
When the rising edge of X002 is detected
When X002 turns ON, "1" is added to the value of D0. INC instruction executes increment in every operation cycle, but the interrupt routine is executed only once by an input signal. Accordingly, it is not necessary to use INCP (pulse operation type) instruction.
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
TO TO
Interrupt Function and Pulse Catch Function
Interrupts are enabled by EI instruction.
Relationships between devices and addresses
The period of time to hold M0 is specified.
OUT_T EN ENO TCoil TValue
RST EN ENO
After the timer time, M0 is reset.
When the rising edge of X003 is detected
SET EN ENO
When X003 turns ON and the interrupt routine is executed, M0 is set to ON unconditionally.

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
35 Interrupt Function and Pulse Catch Function
By using a 1 ms retentive type timer or the special data register D8099 (high speed ring counter), the short pulse width can be measured in 1 ms or 0.1 ms units.

Interrupts are enabled by EI instruction. The main program is described.
When X000 turns ON, the 1 ms timer T246 is started up by the interrupt I001.
When X001 turns OFF, the current value of T246 is transferred to the data register D0 for storing the measured value by the interrupt I100, and M0 for the complete signal is set to ON.

35 Interrupt Function and Pulse Catch Function
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
Applied Instructions (Data Transfer 3)
Interrupts are enabled by EI instruction. The main program is described.
Applied Instructions (High Speed Processing 2)
The ring counter is set to ON.
Applied Instructions (Extension File Register Control)
When the rising edge of X000 is detected
Applied Instructions (FX3U-CF-ADP)
M0
When the rising edge of X001 is detected
Interrupt Function and Pulse Catch Function
When X001 turns OFF: The ring counter value is transferred to D0, and measurement is completed.
A
Relationships between devices and addresses
The special data register M8099 up-counts the 0.1 ms clock from the next operation cycle after being driven. When the count value exceeds "32,767", it is returned to "0".

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.4 Input Interrupt (Interrupt by External Signal) [With Delay function]
35 Interrupt Function and Pulse Catch Function
1. Outline An input interrupt has the function to delay execution of an interrupt routine in units of 1 ms. The delay time can be specified using the pattern program shown below. By using the delay function, the mounting position of a sensor used for input interrupts can be adjusted electrically without changing the actual position. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G or FX3GC PLC does not support this function.
Contact for setting delay time
M8393 MOV EN s
Delay time specification program Be sure to describe the delay time specification program shown on the left at the head of an interrupt routine program. Because this program is a pattern program, change only the delay time 1). Only a constant (K) or data register (D) is available for specifying the time here *.
Program to be executed as input interrupt
Because the previous interrupt processing is not completed, the interrupt processing is not executed here.
Interrupt input(X000 to X005)
Interrupt input is executed
Delay time (ms) IRET instruction
Valid

35 Interrupt Function and Pulse Catch Function
35.5 Timer Interrupt (Interrupt in Constant Cycle)
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Interrupts are enabled. EI EN ENO
Timer interrupts are enabled after EI instruction. It is not necessary to program DI (disable interrupt) if there is no zone where timer interrupts should be disabled.
Applied Instructions (FX3U-CF-ADP)
When interrupt is given at every 20 ms.
Interrupt Function and Pulse Catch Function
The interrupt routine is executed at every 20 ms. Create a program to be executed as interrupt. IRET instruction returns the program execution to the main program.
Relationships between devices and addresses
B
Timer time 10 to 99 (ms)
Timer interrupt pointer 6,7,8
An interrupt program is executed at every specified interrupt cycle time (10 to 99 ms). Use this type of interrupt in control requiring cyclic interrupt processing regardless of the operation cycle of a PLC.
Input number Interrupt cycle (ms) Interrupt disable flag
I7 M8057 *1
An integer in the range from 10 to 99 is put in " " in the pointer name. Example: "I610" indicates a timer interrupt at every 10 ms.
*1. Cleared when the PLC mode is changed from RUN to STOP.
If the timer interrupt time is set to 9 ms or less, the timer interrupt processing may not be executed in an accurate cycle in the following cases. Therefore, using a time that is over 10 ms is recommended.

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.5 Timer Interrupt (Interrupt in Constant Cycle)
35 Interrupt Function and Pulse Catch Function
Interrupts are enabled by EI instruction. The main program is described.
SET EN ENO
When M3 is set to ON, INC instruction becomes valid.
When interrupt is given at every 10 ms
"1" is added to the current value of D0 at every 10 ms.
When the current value of D0 reaches "1000", M3 is reset.
LD-EQ EN s1 s2
M3
The current value of D0 is ramp data which changes from "0" to "1000" in 10 seconds. In the program example using RAMP instruction shown later, the ramp data is made using a dedicated instruction.
RAMP, HKY, SEGL, ARWS and PR instructions execute a series of operations in synchronization with the scan time. Because the total time may be too long or time fluctuation may cause a problem in these instructions, it is recommended to execute these instructions at a constant time interval using the timer interrupt function. When not using the timer interrupt function, use the constant scan mode.
Interrupts are enabled by EI instruction. The main program is described.
REF EN d n
K8
Y000 D0 M0
REF EN d n
K8

35 Interrupt Function and Pulse Catch Function
35.5 Timer Interrupt (Interrupt in Constant Cycle)
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
While M8026 is ON
While M8026 is OFF 10 seconds
Applied Instructions (Extension File Register Control)
Interrupts are enabled by EI instruction. The main program is described.
Applied Instructions (FX3U-CF-ADP)
With M8026 turned ON, when the value of (D3) reaches the final value (D2), the value of Y is latched.
As soon as the start command is given, the initial value (D1) and target value (D2) are transferred.
Interrupt Function and Pulse Catch Function
PLS EN ENO
A
M0
Relationships between devices and addresses
M0
B
When interrupt is given at every 10 ms
RAMP EN s1 s2
While the instruction is executed 1000 times (in 10 seconds), the contents of D3 are changed from the value of D1 to the value of D2.
(Initial value)D1 D3 (Current value)
n (Number of times of transfer)K1000
When the instruction execution complete flag M8029 turns ON, RAMP instruction drive input is set to OFF. If RAMP instruction is continuously executed while M8026 is OFF, the value of D3 returns to the initial value (D1) immediately after it reaches the final value (D2), and then the same operation is repeated. This program is not necessary when M8026 is ON.
RST EN ENO
M1

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.5 Timer Interrupt (Interrupt in Constant Cycle)
35 Interrupt Function and Pulse Catch Function
IVCK EN ENO
K6 H6F
d s1 s2 n
When an interrupt occurs at this timing, whether the instruction is executed completely cannot be determined properly.
RST EN ENO
When interrupt is given at every 20 ms.
REF EN d n
K8
Y000 D0 M0
REF EN d n
K8



FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counter
35 Interrupt Function and Pulse Catch Function
35.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counter
Main program Interrupts are enabled by EI instruction. The main program is described.
M8000
OUT_C EN ENO CCoil CValue
The coil of a high speed counter is driven, and an interrupt pointer is specified in DHSCS_I instruction.
DHSCS EN ENO DHSCS_I EN s1
Interrupt point number is specified.
When counter interrupt is specified [Interrupt program] (Event: I010)
When the current value of C255 changes from "999" to "1000" or from "1001" to "1000", the PLC executes the interrupt routine. For use examples of interrupt program, refer to the above description of input interrupt pointers.
Interrupt subroutine (Interrupt program)
*1. When the comparison value specified by a data register, etc. is changed, the current value is actually changed to the specified value when END instruction is executed.
Counter interrupt pointer (1 to 6)
Pointer No. Interrupt disable flag
*1. Cleared when the PLC mode is changed from RUN to STOP.
RUN monitor · *1 · s2 i CN255

35 Interrupt Function and Pulse Catch Function
35.7 Pulse Catch Function[M8170 to M8177]
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
When the input relay X000 to X007 turns ON from OFF after the EI instruction is executed, the special auxiliary relay M8170 to M8177 is set for interrupt processing. The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC does not require the EI instruction.
Applied Instructions (FX3U-CF-ADP)
Pulse catch input*1 Pulse catch relay
(M8065*2 in the FX0S, FX0 and FX0N PLCs)
(M8057*2 in the FX0S, FX0 and FX0N PLCs)
Interrupt Function and Pulse Catch Function
(M8058*2 in the FX0S, FX0 and FX0N PLCs)
A
(M8059*2 in the FX0S, FX0 and FX0N PLCs)
Relationships between devices and addresses
X005 M8175 *2
X006 M8176 *2
B
X007 M8177 *2
*1. Differs from one PLC to another. FX1S, FX1N, FX1NC, FXU, FX2C, FX2N, FX2NC, FX3S, FX3G, FX3GC: Supports X000 to X005 only. FX0S, FX0, FX0N : Supports X000 to X003 only.
*2. Cleared when the PLC mode is changed from STOP to RUN.
Applied Instruction List

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.7 Pulse Catch Function[M8170 to M8177]
35 Interrupt Function and Pulse Catch Function
The FX0S, FX0, FX0N, FX1S, FX1N, FX1NC, FX3S, FX3G or FX3GC PLC does not require the EI instruction.
When the rising edge of X000 is detected, M8170 is set as interrupt. The pulse catch result is reset.
Input pulse width (shown below)
PLC Input number Pulse width
X000 to X005 5 μs or more*1
X006, X007 50 μs or more
X000, X001, X003, X004 10 μs or more
X002, X005 50 μs or more
X000, X001 10 μs or more
X002 to X005 50 μs or more
X000, X001 20 μs or more
X002, X005 50 μs or more
X000, X001 10 μs or more
X002, X005 50 μs or more
FX2, FX2C X000 to X005 50 μs or more
FX0S, FX0, FX0N X000 to X003 50 μs or more
*1. When using the pulse catch function at 5μs or when receiving a pulse whose response frequency is 50 kHz to 100 kHz using a high speed counter, perform the following: - Make sure that the wiring length is 5 m or less. - Connect a bleeder resistor of 1.5 Ω (1 W or more) to an input terminal, and make sure that the load current of the open collector transistor output in the counterpart equipment is 20 mA or more including the input current in the main unit.
Reset input · X000 (Input) · X002 (Reset)

35 Interrupt Function and Pulse Catch Function
35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
Applied Instructions (Data Transfer 3)
This function is supported only in FX3G PLC (Ver.1.10 or later) and FX3GC.
The pulse width/pulse period measurement function stores the values of 1/6 μs ring counters at the input signal rising edge and falling edge to special data registers. This function also divides by "60" the difference in the counter value (pulse width) between the rising edge and the falling edge or the difference in the counter value (pulse period) between the previous rising edge and the current rising edge, and stores the obtained pulse width or pulse period in units of 10 μs to special data registers.
Applied Instructions (High Speed Processing 2)
The pulse width/pulse period measurement function becomes valid when a program is described using M8075 as a contact. Specify the pulse width measurement flag in the subsequent OUT instruction, and set an input terminal to be used. When the pulse width/pulse period measurement function is valid, it always operates while the PLC mode is RUN.
Applied Instructions (Extension File Register Control)
Assignment of special auxiliary relays and special data registers
Pulse width/ Pulse period measurement
Applied Instructions (FX3U-CF-ADP)
for rising edge*1
for falling edge*1
X000 M8076 M8080 D8075, D8074 D8077, D8076 D8079, D8078
X001 M8077 M8081 D8081, D8080 D8083, D8082 D8085, D8084
X003 M8078 M8082 D8087, D8086 D8089, D8088 D8091, D8090
X004 M8079 M8083 D8093, D8092 D8095, D8094 D8097, D8096
Interrupt Function and Pulse Catch Function
*1. Cleared when the PLC mode switches from STOP to RUN.
*2. The measurable pulse width is 10 μs minimum and 100 s maximum. The measurable pulse period is 20 μs minimum and 100 s maximum.
A
Relationships between devices and addresses
OFF X000
B
This duration is measured.
EN ENO
M8075
M8076
X000 is used for the pulse width/pulse period measurement function.
Pulse width/Pulse period measurement setting flag
X000 Falling edge interrupt
DMOV
When the interrupt routine is executed at the falling edge of the input signal from X000, the pulse width of input signal from X000 stored in D8078 and D8079 is transferred to D1 and D0.
VAR_01 *1 VAR_02 *2
*1. VAR_01 is a global label and is defined as D8078. *2. VAR_02 is a global label and is defined as D0.
![Page 816 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-816.webp?w=400)
FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
35 Interrupt Function and Pulse Catch Function
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097] diagram (page 816)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-816-1.webp)
X000 is used for the pulse width/pulse period measurement function.
When X002 turns ON, the pulse period measurement mode is actuated.
When the interrupt routine is executed at the rising edge of the input signal from X000, the pulse period of input signal from X000 stored in D8078 and D8079 is transferred to D1 and D0.
*1. VAR_01 is a global label and is defined as D8078. *2. VAR_02 is a global label and is defined as D0.
- Timing chart The pulse period is not measured when the input signal rises for the first time after the PLC mode is changed from STOP to RUN, or when the input signal rises for the first time after the pulse period measurement mode (M8080) is set to ON from OFF. (Accordingly, D8078 and D8079 are not updated.) The pulse period is measured when the input signal rises at the next time. (As a result, D8078 and D8079 are updated.)
Make the pulse width/pulse period measurement setting flag (M8080) remain OFF for 1 operation cycle or more when discontinuing the pulse input. If M8080 does not remain OFF for 1 operation cycle or more, the "a" period shown below is stored as the pulse period.
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097] diagram (page 816)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-816-2.webp)
The pulse period is measured. (D8078 and D8079 are updated.)
The pulse period is measured. (D8078 and D8079 are updated.)

35 Interrupt Function and Pulse Catch Function
35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
Applied Instructions (Data Transfer 3)
OFF ON
Applied Instructions (High Speed Processing 2)
This duration is measured.
Applied Instructions (Extension File Register Control)
M8075
M8076 X000 is used for the pulse width/pulse period measurement function.
Pulse width/Pulse period measurement setting flag
M8077 X001 is used for the pulse width/pulse period measurement function.
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
[Main program] · Applied Instruction List

FXCPU Structured Programming Manual [Basic & Applied Instruction] 35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
35 Interrupt Function and Pulse Catch Function
The interrupt routine is executed at the rising edge of the input signal from X001. [Interrupt program] (Event: I101)
X001 Rising edge interrupt
EN ENO
The ring counter value at the rising edge of the input signal from X000 stored in D8074 and D8075 is transferred to D1 and D0.
DMOV
EN ENO
The ring counter value at the rising edge of the input signal from X001 stored in D8080 and D8081 is transferred to D3 and D2.
DSUB
EN ENO
The value "Ring counter value at the rising edge of the input signal from X001 - Ring counter value at the rising edge of the input signal from X000" is stored in D9 and D8.
When either one between the ring counter value at the rising edge of the input signal from X000 and the ring counter value at the rising edge of the input signal from X001 is located within the range from H80000000 to HFFFFFFFF, the following process is executed, and the value "Ring counter value at the rising edge of the input signal from X001 - Ring counter value at the rising edge of the input signal from X000" is stored in D9 and D8*1.
ANDD<
DSUB
EN ENO
EN ENO
H7FFFFFFF D4 EN ENO s1 d
X000 Rising edge ring counter value: H0 to H7FFFFFFF X001 Rising edge ring counter value: H80000000 to HFFFFFFFF
D2 D6 EN ENO s1 d
D4 D8 EN ENO s1 d
D8 EN ENO
LDD<
ANDD>=
DSUB
EN ENO
EN ENO
HFFFFFFFF D4 EN ENO s1 d
X000 Rising edge ring counter value: H80000000 to HFFFFFFFF X001 Rising edge ring counter value: H0 to H7FFFFFFF
D2 D8 EN ENO s1 d
D8 EN ENO
M8000 DDIV
EN ENO
The obtained value is converted into a value in units of 10 μs.
*1. The ring counter offers 32-bit data including the most significant bit. The DSUB instruction does not give a correct value because it handles the most significant bit as the sign bit. To obtain a correct value, add the processing inside the dotted frame.

35 Interrupt Function and Pulse Catch Function
35.8 Pulse width/Pulse period measurement function [M8075 to M8083, D8074 to D8097]
Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
→ FX Structured Programming Manual [Device & Common]
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
Applied Instruction List

The table below shows the relationships between devices and addresses.
Device and address Example of corresponding device and
Device Address Device Address
Input relay X Xn %IXn X367 %IX247
Output relay Y Yn %QXn Y367 %QX247
Auxiliary relay M Mn %MX0.n M499 %MX0.499
Contact TS Tn %MX3.n TS191 %MX3.191
Coil TC Tn %MX5.n TC191 %MX5.191
Current value TN Tn %MW3.n %MD3.n
%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
device G Ux\Gn %MW14.x.n %MD14.x.n U0\G09 %MW14.0.10 %MD14.0.9
Extension register R Rn %MW2.n %MD2.n
%MW2.32767 %MD2.32766
Extension file register ER ERn Not corresponding - -
Pointer P Pn " "(blank) P4095 Not corresponding
Interrupt pointer I In Not corresponding - -
Nesting N Nn Not corresponding - -
Z Zn %MW7.n %MD7.n
%MW7.7 %MD7.6
V Vn %MV6.n V7 %MW6.7
State S Sn %MX2.n S4095 %MX2.4095

Applied Instructions (Data Transfer 3)
Applied Instructions (High Speed Processing 2)
Applied Instructions (Extension File Register Control)
Applied Instructions (FX3U-CF-ADP)
Interrupt Function and Pulse Catch Function
Relationships between devices and addresses
Applied Instruction List

Appendix B-1 Applied instructions [by instruction type]
[by Instruction Type / in Alphabetic Order]
Appendix B-1 Applied instructions [by instruction type]
Applied instructions are classified into the following twenty-one types:
1 Data transfer instructions 11 Program flow control instructions
2 Data conversion instructions 12 I/O refresh instructions
3 Comparison instructions 13 Real time clock control instructions
4 Arithmetic operation instructions 14 Pulse output / positioning control instructions
5 Logical operation instructions 15 Serial communication instructions
6 Special function instructions 16 Special block / unit control instructions
7 Rotation instructions 17 Extension register / extension file register control instructions
8 Shift instructions 18 FX3U-CF-ADP instructions
9 Data operation instructions 19 Other handy instructions
10 Character string operation instructions 20 External Device
Mnemonic Function Ref. Page
Mnemonic Function Ref. Page
DEMOV
Floating Point Move 445 DEMOVP
DHCMOV High Speed Counter Move 596
2. Data conversion instructions
SMOV
Shift Move 143 SMOVP
Mnemonic Function Ref. Page
BCD
Conversion to Binary Coded Decimal 159 BCDP
DCMLP
DBCD
DBCDP
BMOV
Block Move 149 BMOVP
Conversion to Binary 163 BINP
DBIN
Fill Move 154 FMOVP
DFMOV
GRY
DFMOVP
Decimal to Gray Code Conversion 567 GRYP
DGRY
Parallel Run (Octal Mode) 393 PRUNP
DPRUN
GBIN
DPRUNP
Gray Code to Decimal Conversion 569 GBINP
DGBIN
DGBINP
DXCH
FLT
DXCHP
Conversion to Floating Point 250 FLTP
DFLT
Byte Swap 510 SWAPP
DSWAP
DSWAPP
![Page 823 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-823.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 823)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-823-1.webp)
DEBCD Floating Point to Scientific Notation Conversion 459 DEBCDP
DEBIN Scientific Notation to Floating Point Conversion 461 DEBINP
DRAD Floating Point Degree to Radian Conversion 492 DRADP
DDEG Floating Point Radian to Degree Conversion 494 DDEGP
High Speed Counter Set/ High Speed Interrupt Counter Set 267
DHSCT High Speed Counter Compare With Data Table 738

Appendix B-1 Applied instructions [by instruction type]





![Page 825 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-825.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 825)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-825-1.webp)

Appendix B-1 Applied instructions [by instruction type]

Mnemonic Function Ref. Page Mnemonic Function Ref. Page

Scaling 2 (Coordinate by X / Y Data) 702 SCL2P
RIGHT Extracting Character String Data From the Right 634 RIGHTP
LEFT Extracting Character String Data from the Left 637 LEFTP
10. Character string operation instructions


DESTR Floating Point to Character String Conversion 447 DESTRP
DEVAL Character String to Floating Point Conversion 454 DEVALP

![Page 827 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-827.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B: Applied Instruction List [by Instruction Type / in Alphabetic Order] diagram (page 827)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-827-1.webp)

Appendix B-1 Applied instructions [by instruction type]
20. External Device
Mnemonic Function Ref. Page
Mnemonic Function Ref. Page
MNET
Watchdog Timer Refresh 125 WDTP
F-16NP / NT communication 419 MNETP
ANRD
Alternate State 340 ALTP
Read from F2-6A 421 ANRDP
ANS Timed Annunciator Set 244
ANR
Write to F2-6A 423 ANWRP
Annunciator Reset 246 ANRP
RMST F2-32RM start 424
RMWR
Hour Meter 563 DHOUR
Write to F2-32RM 425 RMWRP
RAMP Ramp Variable Value 343
SPD
DRMWRP
Speed Detection 292 DSPD
PWM Pulse Width Modulation 303
Read from F2-32RM 427 RMRDP
DUTY Timing Pulse Generation 589
PID PID Control Loop 414
ZPUSH
RMMN
Batch Store of Index Register 434 ZPUSHP
F2-32RM monitor 429 RMMNP
BLK
Batch POP of Index Register 437 ZPOPP
Specify F2-30GM 430 BLKP
TTMR Teaching Timer 334
F2-30GM code 432 MCDEP
STMR Special Timer 337
Absolute Drum Sequencer 327 DABSD
Mnemonic Function Ref. Page
INCD Incremental Drum Sequencer 331
ROTC Rotary Table Control 346
IST Initial State 312
MTR Input Matrix 263
TKY
Ten Key Input 353 DTKY
HKY
Hexadecimal Input 357 DHKY
DSW Digital Switch (Thumbwheel Input) 361
Seven Segment Decoder 365 SEGDP
SEGL Seven Segment With Latch 367
ARWS Arrow Switch 372
ASC ASCII code data input 376
PR Print (ASCII Code) 378
Volume Read 406 VRRDP
Volume Scale 409 VRSCP
External ROM function
![Page 829 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-829.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 829)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-829-1.webp)
![Page 830 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-830.webp?w=400)
Appendix B-2 Applied instructions [in alphabetical order]
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 830)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-830-1.webp)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 830)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-830-2.webp)
DEBCD Floating Point to Scientific Notation Conversion 459 DEBCDP
DEBIN Scientific Notation to Floating Point Conversion 461 DEBINP
DESTR Floating Point to Character String Conversion 447 DESTRP
DEVAL Character String to Floating Point Conversion 454 DEVALP
![Page 831 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-831.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 831)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-831-1.webp)
High Speed Counter Set/ High Speed Interrupt Counter Set 267
DHSCT High Speed Counter Compare With Data Table 738
Scaling 2 (Coordinate by X / Y Data) 702 DSCL2P
![Page 832 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-832.webp?w=400)
Appendix B-2 Applied instructions [in alphabetical order]
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 832)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-832-1.webp)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 832)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-832-2.webp)
LEFT Extracting Character String Data from the Left 637 LEFTP
![Page 833 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-833.webp?w=400)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 833)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-833-1.webp)
RIGHT Extracting Character String Data From the Right 634 RIGHTP
Scaling 2 (Coordinate by X / Y Data) 702 SCL2P
![Page 834 of the Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) user manual — Appendix B-2 Applied instructions [in alphabetical order]](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/page-834.webp?w=400)
Appendix B-2 Applied instructions [in alphabetical order]
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 834)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-834-1.webp)
![Mitsubishi Electronics MELSEC-F Series PLC (FXCPU) — Appendix B-2 Applied instructions [in alphabetical order] diagram (page 834)](/cdn/reader/d5/d567f629c46b05cec7733a6a3e20c599955957e7ebb1fb7d674b669d3eef46e8/images/fig-834-2.webp)

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.
Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued. Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc.
Product supply (including repair parts) is not available after production is discontinued. 2)
Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA Center may differ. The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place. Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs. [Gratis Warranty Range]
4. Exclusion of loss in opportunity and secondary loss from warranty liability
Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user or third person by Failures of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks.
The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product.
Even within the gratis warranty term, repairs shall be charged for in the following cases. 2)
The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice.
Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design.
In using the Mitsubishi MELSEC programmable logic controller, the usage conditions shall be that the application will not lead to a major accident even if any problem or fault should occur in the programmable logic controller device, and that backup and fail-safe functions are systematically provided outside of the device for any problem or fault.
Failure caused by unapproved modifications, etc., to the product by the user. b)
When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided.
The Mitsubishi programmable logic controller has been designed and manufactured for applications in general industries, etc. Thus, applications in which the public could be affected such as in nuclear power plants and other power plants operated by respective power companies, and applications in which a special quality assurance system is required, such as for Railway companies or Public service purposes shall be excluded from the programmable logic controller applications. In addition, applications in which human life or property that could be greatly affected, such as in aircraft, medical applications, incineration and fuel devices, manned transportation, equipment for recreation and amusement, and safety devices, shall also be excluded from the programmable logic controller range of applications. However, in certain cases, some applications may be possible, providing the user consults their local Mitsubishi representative outlining the special requirements of the project, and providing that all parties concerned agree to the special circumstances, solely at the users discretion.
Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced.
Relay failure or output contact failure caused by usage beyond the specified Life of contact (cycles).
Failure caused by external irresistible forces such as fires or abnormal voltages, and failure caused by force majeure such as earthquakes, lightning, wind and water damage.
Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi.
Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user.

Revised History
1/2009 A First edition
2/2010 C • Manual name of a related manual was changed.
2/2012 H • FX3GC was added.
9/2013 L • FX3G-485-BD-RJ connection was added.



Structured Programming Manual
Basic & Applied Instruction
HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN
MODEL CODE 09R926
Effective Sep. 2013 Specifications are subject to change without notice.
What the fault codes shown on the display mean and how to clear them.
| Code | Meaning | Fix | |
|---|---|---|---|
| S1 | The FX3U and FX3UC PLCs only are applicable. | p.58 | |
| S2 | Only the FX3U and FX3UC PLCs are capable of indexing applicable devices. | p.58 | |
| S3 | Only the FX3U and FX3UC PLCs are capable of indexing applicable devices. | p.86 | |
| X007 | Every time X007 is set to ON, an operation | p.247 | |
| IS0 | (Error code: K6706) | p.476 | |
| TO00H | For example, in the case of n=5, data of lower byte (8 bits) of | p.506 | |
| K1 | The current value of the high speed counter is cleared when | p.601 | |
| K0 | The current value of the high speed counter is not cleared | p.601 | |
| K-1 | Forcibly writes all buffered data to the CompactFlashTM card. | p.790 | |
| B0 | The CompactFlashTM card is not mounted. | p.793 | |
| B1 | The CompactFlashTM card is full. | p.793 | |
| B2 | An error has occurred in the CF-ADP. | p.793 | |
| B3 | CF-ADP H/W error | p.793 |
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.