Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MELSEC FX Series
Programmable Logic Controllers
Programming Manual
(Basic & Applied Instructions)
FX3U, FX3UC
MITSUBISHI ELECTRIC
INDUSTRIAL AUTOMATION
Manual No.
JY997D16601
Revision
Date
11 / 2007
Foreword
This manual contains text, diagrams and explanations which will guide the reader through the safe and
correct installation, use, and operation of the FX3U/FX3UC Series programmable controller. 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.
Outline Precautions
This manual provides information for the use of the FX3U Series Programmable Controllers. The manual
has been written to be used by trained and competent personnel. The definition of such a person or
persons is as follows;
a) Any engineer who is responsible for the planning, design and construction of automatic equipment
using the product associated with this manual should be of a competent nature, trained and qualified
to the local and national standards required to fulfill that role. These engineers should be fully aware of
all aspects of safety with regards to automated equipment.
b) Any commissioning or service engineer must be of a competent nature, trained and qualified to the
local and national standards required to fulfill that job. These engineers should also be trained in the
use and maintenance of the completed product. This includes being completely familiar with all
associated documentation for the said product. All maintenance should be carried out in accordance
with established safety practices.
c) All operators of the completed equipment should be trained to use that product in a safe and
coordinated manner in compliance to established safety practices. The operators should also be
familiar with documentation which is connected with the actual operation of the completed equipment.
Note: the term 'completed equipment' refers to a third party constructed device which contains or uses
the product associated with this manual
This product has been manufactured as a general-purpose part for general industries, and has not been
designed or manufactured to be incorporated in a device or system used in purposes related to human life.
Before using the product for special purposes such as nuclear power, electric power, aerospace, medicine
or passenger movement vehicles, consult with Mitsubishi Electric.
This product has been manufactured under strict quality control. However when installing the product
where major accidents or losses could occur if the product fails, install appropriate backup or failsafe
functions in the system.
When combining this product with other products, please confirm the standard and the code, or regulations
with which the user should follow. Moreover, please confirm the compatibility of this product to the system,
machine, and apparatus with which a user is using.
If in doubt at any stage during the installation of the product, always consult a professional electrical
engineer who is qualified and trained to the local and national standards. If in doubt about the operation or
use, please consult the nearest Mitsubishi Electric distributor.
Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference,
please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will
accept no responsibility for actual use of the product based on these illustrative examples.
This manual content, specification etc. may be changed without a notice for improvement.
The information in this manual has been carefully checked and is believed to be accurate; however, you
have noticed a doubtful point, a doubtful error, etc., please contact the nearest Mitsubishi Electric
distributor.
Registration
Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
The company name and the product name to be described in this manual are the registered trademarks or
trademarks of each company.
Table of Contents
Table of Contents
Related manuals...................................................................................................................... 14
Generic Names and Abbreviations Used in Manuals .......................................................... 20
1. Introduction
22
24
Memory structure........................................................................................................................... 33
Memory operations and latched (battery backed) (power ON/OFF and RUN/STOP)................... 34
Types of backup methods against power failure ........................................................................... 36
Change between general devices and latched (battery backed) devices ..................................... 36
How to initialize devices (battery backed) ..................................................................................... 36
3. Instruction List
56
4. Devices in Detail
72
Table of Contents
4.9 Extension Register [R] and Extension File Register [ER] ........................................................... 114
4.9.1
4.9.2
4.9.3
4.9.4
4.9.5
4.9.6
4.9.7
4.9.8
Table of Contents
130
5.2 Specification of Constants K, H and E (Decimal, Hexadecimal and Real Number).................... 133
5.2.1 Constant K (decimal number)...................................................................................................... 133
5.2.2 Constant H (hexadecimal number).............................................................................................. 133
5.2.3 Constant E (real number) ............................................................................................................ 133
5.4
5.5
5.6
5.7
141
7. Basic Instruction
158
Table of Contents
198
224
252
276
Table of Contents
300
323
371
Table of Contents
405
15.6
15.7
15.8
15.9
15.9.1 Common items between FROM instruction and TO instruction (details)................................... 437
441
461
466
548
533
516
Table of Contents
568
573
Table of Contents
575
593
605
639
651
28.1 FNC224~230 LD =, >, <, <>, <=, >= / Data Comparison ....................................................... 653
28.2 FNC232~238 AND=, >, <, < >, <=, >= / Data Comparison .................................................... 656
28.3 FNC240~246 OR=, >, <, < >, <=, >= / Data Comparison ...................................................... 659
10
662
Table of Contents
690
702
710
32.1 FNC280 HSCT / High Speed Counter Compare With Data Table......................................... 711
716
743
11
Table of Contents
791
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function] .................... 796
35.3.1 Input interrupt (interrupt triggered by external signal) [without delay function] .......................... 796
35.3.2 Examples of practical programs (programs to measure short pulse width)............................... 800
35.4 Input interrupt (Interrupt by External Signal) [With Delay Function] .......................................... 802
35.5 Timer Interrupt (Interrupt in Constant Cycle)............................................................................. 803
35.5.1 Timer interrupt (interrupt in constant cycle) ............................................................................... 803
35.5.2 Examples of practical program (timer interrupt programs using applied instruction)................. 804
35.6 Counter Interrupt - Interrupt Triggered by Counting Up of High Speed Counter....................... 807
35.7 Pulse Catch Function [M8170 to M8177] .................................................................................. 808
810
854
12
Table of Contents
868
877
890
898
Warranty................................................................................................................................. 900
Revised History ..................................................................................................................... 901
13
Related manuals
Related manuals
For detailed explanation of programming (basic instructions, applied instructions and step ladder instructions)
in FX3U/FX3UC PLCs, refer to this manual.
For hardware information on the PLC main unit, special extension units, etc., refer to each associated
manual.
For acquiring manuals, contact the distributor you have purchased the product from.
~Essential manual
{Manual required depending on application
UManual with additional manual for detailed explanation
Manual name
Manual
number
Contents
Model
name code
Supplied
with
product
FX3U Series
Hardware Manual
Additional
Manual
09R516
Supplied
with
product
FX3UC(D, DSS)Series
Hardware Manual
Additional
Manual
09R519
FX3U/FX3UC Series
Items related to programming in PLCs
Programming Manual including explanation of basic instructions,
JY997D16601
Basic & Applied Instruction
applied instructions and various devices in
Edition (this manual)
FX3U/FX3UC PLCs.
09R517
Programming
~
Additional
Manual
Terminal block
{
Supplied
with
product
Additional
Manual
Additional
Manual
09R715
14
Supplied
with
product
FX3U-USB-BD
Users Manual
Related manuals
Supplied
with
product
FX3U-232-BD
Installation Manual
Manual
number
Contents
Model
name code
Supplied
with
product
FX3U-232ADP
Installation Manual
Supplied
with
product
FX3U-232ADP-MB
Installation Manual
Supplied
with
product
FX2N-232IF
Hardware Manual
Supplied
with
product
FX3U-422-BD
Installation Manual
Supplied
with
product
FX3U-485-BD
Installation Manual
Supplied
with
product
FX3U-485ADP
Installation Manual
Supplied
with
product
FX3U-485ADP-MB
Installation Manual
Supplied
with
product
FX-485PC-IF
Hardware Manual
Supplied
with
product
FX2N-16CCL-M
Hardware Manual
Additional
Manual
FX2N-16CCL-M
Users Manual
JY992D93101
09R710
15
Related manuals
Manual
number
Contents
Model
name code
Supplied
with
product
FX2N-32CCL
Users Manual
JY992D71801
Supplied
with
product
Supplied
with
product
FX2N-64CL-M
Users Manual
[Hardware Volume]
JY997D05401
Additional
Manual
FX2N-64CL-M
Users Manual
[Detailed Volume]
JY997D08501
Supplied
with
product
Remote device
Remote I/O
Power Adapter
Supplied
with
product
FX2N-16LNK-M
User's Manual
JY992D73701
Supplied
with
product
FX2N-32ASI-M
Users Manual
JY992D76901
09R711
09R709
Additional
Manual
FX3U/FX3UC
Users Manual
- Analog Control Edition
09R619
16
Supplied
with
product
FX2N-2AD
Users Guide
JY992D74701
Supplied
with
product
FX3U-4AD
Installation Manual
Supplied
with
product
FX3U-4AD-ADP
Installation Manual
Supplied
with
product
FX3UC-4AD
Installation Manual
Supplied
with
product
FX2N-4AD
Users Guide
JY992D65201
Supplied
with
product
FX2NC-4AD
Users Manual
JY997D07801
Supplied
with
product
FX2N-8AD
Users Manual
09R608
Supplied
with
product
FX3U-4AD-PT-ADP
Users Manual
Related manuals
Manual
number
Contents
Model
name code
Supplied
with
product
FX2N-4AD-PT
Users Guide
JY992D65601
Supplied
with
product
FX3U-4AD-TC-ADP
Users Manual
Supplied
with
product
FX2N-4AD-TC
Users Guide
JY992D65501
Supplied
with
product
FX2N-2LC
Users Guide
Additional
Manual
FX2N-2LC
Users Manual
JY992D85801
09R607
Supplied
with
product
FX2N-2DA
Users Guide
JY992D74901
Supplied
with
product
FX3U-4DA
Installation Manual
Supplied
with
product
FX3U-4DA-ADP
Users Manual
Supplied
with
product
FX2N-4DA
Users Guide
JY992D65901
Supplied
with
product
FX2NC-4DA
Users Manual
JY997D07601
Supplied
with
product
FX0N-3A
Users Guide
Supplied
with
product
FX2N-5A
Users Manual
09R616
Supplied
with
product
FX3U-4HSX-ADP
Installation Manual
JY997D16301
Supplied
with
product
FX2N-1HC
Users Guide
JY992D65401
17
Related manuals
Manual name
Contents
Model
name code
Additional
Manual
FX3U/FX3UC Series
Users Manual Positioning Edition
JY997D16801
09R620
Supplied
with
product
FX3U-2HSY-ADP
Installation Manual
Supplied
with
product
FX2N/FX-1PG-E
Users Manual
JY992D65301
Supplied
with
product
FX2N-10PG
Installation Manual
Additional
Manual
FX2N-10PG
Users Manual
JY992D93401
Supplied
with
product
FX2N-10GM
Users Guide
Supplied
with
product
FX2N-20GM
Users Guide
Additional
Manual
FX2N-10GM, FX2N-20GM
Hardware/Programming
Manual
JY992D77801
09R610
09R611
09R612
Supplied
with
product
FX2N-1RM-E-SET
Users Manual
JY992D71101
09R614
Supplied
with
product
FX3U-20SSC-H
Installation Manual
Separate
volume
FX3U-20SSC-H
User's Manual
JY997D21301
09R622
Supplied
with
product
FX Configurator-FP
Operation Manual
JY997D21801
09R916
Other manuals
When using each product, refer also to the Users Manual - Hardware Edition of the PLC main unit to which each
product is connected.
Connector conversion
U
Supplied
with
product
FX3U-CNV-BD
Installation Manual
18
Supplied
with
product
FX3U-32BL Battery
Hardware Manual
Related manuals
Manual
number
Contents
Model
name code
Display module
U
Supplied
with
product
FX3U-7DM
User's Manual
JY997D17101
JY997D15401
JY997D12801
Supplied
with
product
FX3U-7DM-HLD
User's Manual
Memorry cassette
U
Supplied
with
product
Memorry cassette
FX3U-FLROM-16/64/64L
Hardware Manual
Supplied
with
product
FX3U-1PSU-5V
Installation Manual
JY997D22501
Supplied
with
product
FX3UC-1PS-5V
Installation Manual
JY997D12201
19
Name
Programmable controllers
FX3U Series
FX3U PLC or main unit
FX3UC Series
FX3UC PLC or main unit
FX2N Series
FX2NC Series
FX1N Series
FX1NC Series
FX1S Series
Expansion boards
Expansion board
Special adapters
Special adapter
Generic name of special high speed I/O adapters, special communication adapters, and
special analog adapters
Connectable equipment may vary depending on the main unit. For connectable
equipment, refer to the Users Manual - Hardware Edition of the main unit.
Generic name of special high speed I/O adapters (The models shown below):
FX3U-2HSY-ADP and FX3U-4HSX-ADP
Special communication
adapter
Extension equipment
20
Extension equipment
Generic name of FX2N Series I/O extension units, FX2N Series I/O extension blocks,
FX2NC Series I/O extension blocks, and FX0N Series I/O extension blocks
Connectable equipment may vary depending on the main unit. For connectable
equipment, refer to the Users Manual - Hardware Edition of the main unit.
FX3UC-4AD
Abbreviation/generic name
Name
CC-Link/LT master
Generic name of built-in type CC-Link/LT master and (additional) CC-Link/LT master
(Additional) CC-Link/LT
master
Generic name of units connected to supply the power to the CC-Link/LT system
Generic name of power supplies connected to supply the power to the CC-Link/LT system
AS-i system
AS-i master
Generic name of AS-i system master station (having following model name):
FX2N-32ASI-M
Generic name of MELSEC I/O LINK master station (having following model name):
FX2N-16LNK-M
Options
Extension power supply unit
Memory cassette
Battery
FX3U-32BL
Peripheral equipment
Peripheral equipment
Generic name of programming software, handy programming panels, and display units
Programming tools
Programming tool
Programming software
GX Developer
FX-PCS/WIN(-E)
RS-232C/RS-422 converter
RS-232C/RS-485 converter
Display units
GOT1000 Series
GOT-900 Series
GOT-A900 Series
GOT-F900 Series
ET-940 Series
Manuals
FX3U Hardware Edition
Programming Manual
21
1 Introduction
1.
Introduction
This chapter explains basic items related to programming in FX3U and FX3UC programmable controllers
(PLCs).
1.1
1.1.1
1. List programming
This method is the basis of programs.
1) Features
In this method, sequence instructions are input in the form of instruction words such as "LD", "AND" and
"OUT".
This input method is the basis of sequence programs.
2) Example of list display
Instruction
Device number
LD
X000
0001
OR
Y005
0002
ANI
X002
0003
OUT
Y005
Step
0000
2. Circuit programming
In this method, ladder formats are drawn on the graphic screen.
1) Features
In a circuit program, a sequence circuit is drawn on the graphic screen by sequence formats and device
numbers. Because a sequence circuit is expressed with contact symbols and coil symbols, the contents
of a program can be understood easily.
In the circuit display status, the PLC operations can be monitored.
2) Example of circuit display
X000
X002
Y005
Y005
The above list program is expressed in
the circuit diagram.
22
2
Overview
List
Circuit
Introduction
1.1.2
1 Introduction
SFC
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
23
2.
2.1
2.1.1
If the number of high speed counters is insufficient, special extension equipment (high speed counter
blocks) can be connected.
By extending hardware counters in the high speed counter block, high speed pulses at up to 50 kHz can be
received (except 1 and 4 edge count).
FX2N-1HC high speed counter block
3. "Input filter adjustment" function for changing the time constant of input relays
Input relays in the PLC are equipped with a C-R filter of approximately 10 ms as countermeasures against
chattering and noise in input signals. Because a digital filter is adopted for the input relays X000 to X017*1,
however, the filter value can be changed in sequence programs.
Related instruction: Refresh and filter adjust instruction REFF (FNC 51)
*1.
24
Introduction
5. Three types of "interrupt" functions for receiving short-period pulses and priority
processing
1) Input interrupt
Signals from specific input relays are monitored. At the rising edge or falling edge of the monitored input,
a specified interrupt routine is executed with highest priority.
2
Overview
2) Timer interrupt
Specified interrupt routines are executed with highest priority at every specified time.
3) Counter interrupt
Depending on the present value of a high speed counter, a specified interrupt routine is executed with
highest priority.
Instruction
List
2.1.2
2.1.3
6
Before
Programming
5
Specified the
Device &
Constant
4
Devices
in Detail
The input terminal information of the PLC in the batch refresh method is input at one time by the input image
memory before operation in the step 0. The output information is output at one time when END instruction is
executed.
I/O refresh instruction can get the latest input information and immediately output the operation result during
sequence operation.
Related instruction: Refresh REF (FNC 50)
1. "Constant scan" mode for making the operation cycle of the PLC constant
2. "All outputs disable" mode for turning OFF all output signals
3. "Memory hold stop" function for holding the output status during the RUN mode even in the
STOP mode
9
FNC10-FNC19
Move & Compare
When the special auxiliary relay M8033 is driven, the PLC is stopped while the output status during the RUN
mode is held.
8
FNC00-FNC09
Program Flow
When the special auxiliary relay M8034 is driven, the output latch memory is cleared. Accordingly, all output
relays (Y) turn OFF while the PLC is continuing its operation.
However, the status of output relays (Y) in each device image memory is not cleared. As a result, when
devices are monitored using a programming tool, they may be regarded as the ON status.
Basic
Instruction
The operation cycle in the PLC adopting the cyclic operation method varies depending on the contents of the
program execution.
In the constant scan mode (M8039 and D8039), the operation cycle can be made constant. As a result,
instructions executed in synchronization with the operation can be processed in a constant cycle.
10
FNC20-FNC29
Arith. & Logic
Operation
25
2.2
2.2.1
1. Program flow
Conditional jump (CJ/FNC 00)
Call subroutine (CALL/FNC 01)
Enable interrupt (EI/FNC 04)
Disable interrupt (DI/FNC 05)
Start a FOR/NEXT loop (FOR/FNC 08)
Refer to Chapter 8.
26
Overview
Introduction
5. Data operation
Zone reset (ZRST/FNC 40)
Decode (DECO/FNC 41)
Sum of active bits (SUM/FNC 43)
Mean (MEAN/FNC 45)
Word to byte (WTOB/FNC141) and byte to
word (BTOW/FNC142)
8. Complicated control
Search a data stack (SER/FNC 61)
Sort tabulated data (FNC 69 and FNC149)
PID control loop (PID/FNC 88)
Refer to Chapter 14, Chapter 16 and
Chapter 19.
9. Positioning control
Dog search zero return (DSZR/FNC150)
Interrupt positioning (DVIT/FNC151)
Batch data positioning mode (TBL/FNC152)
Absolute present value read (ABS/FNC155)
Zero return (ZRN/FNC156)
Variable speed pulse output (PLSV/FNC157)
Drive to increment (DRVI/FNC158)
Drive to absolute (DRVA/FNC159)
Refer to Chapter 20.
Refer to the Positioning Control Manual.
27
10
FNC20-FNC29
Arith. & Logic
Operation
FNC10-FNC19
Move & Compare
FNC00-FNC09
Program Flow
Basic
Instruction
Before
Programming
5
Specified the
Device &
Constant
4
Devices
in Detail
3
Instruction
List
2.3
2. Positioning control
SSCNET - Positioning Block.
Pulse output block (controlled by sequence
program)
Positioning unit (controlled by instructions
dedicated to positioning)
Cam switch (resolver detection)
Refer to the respective product manual.
2.4
1. CC-Link
The CC-Link system can be constructed with an
FX3U /FX3UC PLC working as the master station.
Or an A or QnA PLC can work as the master
station, and FX PLCs can be connected as slave
stations (remote device stations).
The CC-Link is an open network allowing
connection of not only FX PLCs but also
inverters, AC servo systems, and sensors.
Refer to the included manual.
2. CC-Link/LT
The CC-Link/LT system can be constructed with
an FX3U/FX3UC PLC working as the master
station.
General X (input) and Y (output) devices are
assigned to remote I/O units, and operated by
programs for general-purpose I/O.
Refer to the FX3UC Hardware Edition for the
built-in type CC-Link/LT master.
Refer to the product manual for the FX2N64CL-M.
28
4. AS-i system
A network system at the actuator or sensor level
can be constructed with an FX3U/FX3UC PLC
working as the master station in the AS-i system.
Refer to the included manual.
5. Simple N : N link
Up to eight FX3U/FX3UC PLCs are connected,
and data are automatically transferred among
them.
Refer to the Data Communication Edition.
6. Parallel link
Two PLCs are connected, and data are
automatically transferred between them.
Refer to the Data Communication Edition.
7. Computer link
A computer such as personal computer works as
the master station, up to sixteen FX and A PLCs
are connected to the master station, the master
station directly specifies devices in the PLCs,
and then data are transferred.
Protocols in the computer link support the
formats 1 and 4.
By using MX Component and MX Sheet,
monitoring and logging for the PLC system can
be easily set by Microsoft Excel.
Refer to the Data Communication Edition.
For MX Component and MX Sheet, refer to
the respective product manual.
1
Introduction
8. No-protocol communication
No-protocol serial communication is available
between an FX PLC and interface equipment in
accordance with RS-232C/RS-485 such as bar
code reader, printer, personal computer and
measuring instrument.
Refer to the Data Communication Edition.
2
Overview
9. Inverter communication
An FX PLC can control up to eight inverters via
communication in accordance with RS-485.
Related instructions: IVCK (FNC270)
IVDR (FNC271)
IVRD (FNC272)
IVWR (FNC273)
IVBWR (FNC274)
Refer to the Data Communication Edition.
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
29
2.5
2.5.1
Input terminal or
input connector
Input relay: X
Input relays function as receiving ports when the PLC receives signals from external
input switches.
The assigned device mnemonic is "X".
The PLC has built-in input relays in accordance with its scale.
1234
Auxiliary relay: M
There are many
auxiliary relays
inside the PLC.
The assigned
device mnemonic
is "M".
State relay: S
There are many
state relays inside
the PLC.
The assigned
device mnemonic
is "S".
Output terminal
or output
connector
30
Timer: T
There are many
timers inside the
PLC.
The assigned
device mnemonic
is "T".
Counter: C
There are many
counters inside the
PLC.
The assigned
device mnemonic
is "C".
Output relay: Y
Output relays
function as ports
when the PLC
drives external
loads.
There are many
output relays inside
the PLC.
The assigned
device mnemonic
is "Y".
Device list
1. Input relays (X) and output relays (Y)
4. Timers (T)
8
FNC00-FNC09
Program Flow
Basic
Instruction
Before
Programming
5. Counters (C)
Specified the
Device &
Constant
Devices
in Detail
Instruction
List
Overview
Introduction
2.5.2
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
31
9. Pointers (P)(I)
Refer to Section 4.11.
Pointers are classified into branch pointers and
interrupt pointers.
A branch pointer (P) specifies the jump
destination of the conditional jump CJ (FNC
00) or the call subroutine CALL (FNC 01)
instruction.
An interrupt pointer (I) specifies the routine of
an input interrupt, timer interrupt or counter
interrupt.
10.Constants (K)(H)(E)
Refer to Chapter 5.
Constant numerical values used in the PLC, "K"
indicates a decimal integer value, "H" indicates a
hexadecimal value, and "E" indicates a real
number (floating point data).
Constants are used as set values or present
values of timers and counters, or operands for
applied instructions.
32
2.6.1
Memory structure
Introduction
2.6
2
Overview
System ROM
3
Instruction
List
4
Devices
in Detail
[Data memory]
Optional memory
(flash memory)
Sequence program
Specified the
Device &
Constant
Parameter
Not attached
Comment
File register (D)
6
Before
Programming
2. When using an attached optional memory (without using the built-in memory)
CPU
System ROM
Basic
Instruction
Optional memory
(flash memory)
Sequence program
Comment
File register (D)
10
FNC20-FNC29
Arith. & Logic
Operation
9
FNC10-FNC19
Move & Compare
Parameter
Not used
FNC00-FNC09
Program Flow
[Data memory]
33
2.6.2
Power
OFFON
Power OFF
STOPRUN
Parameter
Sequence program
Comment
Can be secured by
parameter setting.
File register
RUNSTOP
register (ER)*4
*2.
*3.
*4.
34
RUNSTOP
Cleared.
File type
Set to initial
values.*3
File type
For 100 ms
Cleared.
For 10 ms
Cleared.
Cleared.
Cleared.
General type
Counter present
value register (C)
STOPRUN
*1.
Cleared.
Extension file
Clock data
Power
OFFON
latched (battery
backed) type
Special type
Extension
(R)
Power OFF
Cleared.
latched (battery
backed) type
Present value
(battery backed)
Values become undefined when the battery voltage becomes lower than the holding voltage if not stored
in an attached memory cassette.
Values become undefined when the battery voltage becomes lower than the holding voltage.
Some devices are cleared when the PLC status switches from STOP to RUN.
For special data registers, refer to Chapter 36.
An optional memory cassette is required.
Item
Cleared.
Does not
change.
Does not
change.
Cleared.
Set to initial
values.*1
Does not
Annunciator (S)
Cleared.
Cleared.
Cleared.
Cleared.
Caution
35
10
FNC20-FNC29
Arith. & Logic
Operation
When the battery voltage becomes low due to expiration of life or other reasons, programs (not stored in a
memory cassette), latched (battery backed) type devices and clock values become undefined. When they
become undefined, clear latched type devices, download the program again (without using a memory
cassette), and then set the initial values and clock if necessary.
For a rough guide to the life and replacement of the battery, refer to the respective PLC Users
Manual [Hardware Edition].
For the latched type device initialization method, refer to Subsection 2.6.5.
9
FNC10-FNC19
Move & Compare
Some devices are cleared when the PLC status switches from STOP to RUN.
For special auxiliary relay names and definitions, refer to Chapter 36.
8
FNC00-FNC09
Program Flow
Cleared.
Cleared.
Basic
Instruction
Cleared.
Cleared.
Before
Programming
Cleared.
4
change.*1
Specified the
Device &
Constant
Cleared.
Does not
change.
Cleared.
General type
Cleared.
Timer contact
Time counting coil
For 10 ms
(T)
*1.
Cleared.
For 100 ms
Counter contact
Counting coil
Reset coil (C)
Does not
change.
Devices
in Detail
RUNSTOP
Cleared.
STOPRUN
Instruction
List
Contact image
memory
(X, Y, M, S)
Power
OFFON
Overview
Power OFF
Introduction
2.6.3
Description
Latched (battery
A lithium battery backs up the RAM memory, devices (battery backed) and clock data built in the PLC.
backed) contents
Maintenance
Rough guide of the life is 5 years (when the ambient temperature is 25C).
For rough guide of the replacement, refer to the Users Manual [Hardware Edition] of each PLC.
Cautions
1) When the battery life is expired, sequence programs and other latched (battery backed) contents
are lost.
2) When an optional memory cassette (flash memory) is mounted, it is not necessary to back up
sequence programs by the battery.
Description
Latched (battery 1) The flash memory built into the memory cassette backs up sequence programs.
backed) contents 2) A battery is required to back up latched (battery backed) devices and clock data from failure.
2.6.4
Maintenance
Cautions
2. When using non-latch type devices as latched (battery backed) type devices
In FX3U/FX3UC PLCs, non-latch type devices can be changed into latched (battery backed) type devices by
the parameter settings described later.
2.6.5
M8032
36
Timer
T246~T255
Counter
C100~C199,
C220~C255
Data register
D200~D7999
M500
M7679
FNC 40
ZRST
S500
S4095
FNC 40
ZRST
T246
T255
FNC 40
ZRST
C100
C199
FNC 40
ZRST
C220
C255
FNC 40
ZRST
D200
D7999
5
Specified the
Device &
Constant
For details on the ZRST (FNC 40) instruction, refer to Section 12.1.
For details on latched (battery backed) type devices, refer to Subsection 2.6.2 and Chapter 4.
3
Instruction
List
State
FNC 40
ZRST
Devices
in Detail
device range
Clear input
2
Overview
Introduction
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
37
2.7
2.7.1
Parameter list
The following items may be set in the parameter settings.
Classification
Item
Memory
capacity
Comment
area
File register
Other special
setting
capacity
1) This parameter sets whether or not the special block/unit initial value setting
function is used.
When this function is used, the program memory capacity is reduced because this
function requires 4000 steps (8 blocks) in the memory capacity.
2) This parameter sets whether or not the positioning setting (constants and setting
table) in TBL (FNC152) instruction is used. When this setting is used, the program
memory capacity is reduced because this setting requires 9000 steps (18 blocks) in
the memory capacity.
Latch range
setting
This parameter enables to change the latched (battery backed) device range and the
non-latch device range inside the PLC.
I/O
assignment
I/O assignment setting
setting
Special unit
setting
Memory
capacity
Device setting
PLC system
setting (1)
[PLC mode]
This parameter sets the initial values of the buffer memory (BFM) for each special block/
unit number.
It is necessary to set the memory capacity.
Batteryless
mode
Modem
initialization
RUN terminal
input setting
This parameter sets whether one input terminal in the PLC is used for RUN input.
RUN terminal
input number
PLC system
Serial port
setting (2)
operation
[Serial
setting
communication]
38
Description
This parameter specifies the maximum value for the number of steps to which a
sequence program can be input.
1) The upper limit is determined by the capacity of the built-in memory or optional
memory.
2) The program memory, file register, comment area, and other special setting
capacities are contained in this memory capacity.
This parameter specifies the input number of the RUN input described above within the
range from X000 to X017.*1
This parameter corresponds to the following settings by specifying each contents on the
PC screen:
Setting of communication format (D8120, D8400 and D8420)
Setting of station number (D8121 and D8421)
1) Setting of timeout check (D8129, D8409 and D8429)
Others
2.7.2
Constant
setting
Detailed
setting
Entry code
Program title
This parameter enables to set a character string to be used as the program title.
Instruction
List
*1.
Description
This parameter sets interrupt inputs for the maximum speed, bias speed, creep speed,
zero return speed, acceleration time, deceleration time, and DVIT instruction.
It is necessary to set the memory capacity.
Overview
Positioning
setting
Item
Introduction
Classification
Parameter initial values and available tools for changing parameter values
Program capacity
Memory
File register capacity
capacity (steps)
Special unit initial
value setting*5
0
0
Not used
2000
8000
8000
500 to 1023
500 to 999
0 to 999
500 to 999
100 to 199
0 to 199
100 to 199
220 to 255
200 to 255
220 to 255
200 to 511
0 to 511
200 to 511
OFF
Not set
Series*2
ET-940
Series*3
0 to 1023
Not registered
Not registered
Refer to
Subsection
2.7.1.
OFF
Not set
OFF
Not used
Not set
Not set
*1.
These programming tools are not applicable to FX3U/FX3UC PLCs. The initial values in FX2N PLCs are
shown above.
*2.
Parameter values can be changed only by the F940WGOT, F94GOT and F94 handy GOT.
*3.
*4.
*5.
FNC00-FNC09
Program Flow
WIN(-E)
500 to 1023
Entry code
Refer to
Subsection
2.7.3.
Not used
Not registered
FX-20P(-E)*1
*1
16000*4
Program title
Batteryless mode
FX-PCS/
Basic
Instruction
FX-10P(-E)*1
Before
Programming
Positioning setting*5
GOT-F900
Setting range
Specified the
Device &
Constant
Katakana character
comment capacity
GX
Developer
Initial value
Display unit
Devices
in Detail
Item
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
39
2.7.3
Comment capacity
setting
Unit: Block
0 to 3
0 to 3
value setting*1
Unit: Block
Positioning setting*1
Unit: Block
2000 steps
4000 steps
0 to 7
0 to 7
8000 steps
0 to 15
0 to 14
16000 steps
0 to 31
0 to 14
18
32000 steps
0 to 63
0 to 14
18
64000 steps
0 to 127
0 to 14
18
Comment
capacity setting
File register
capacity setting
Positioning
setting*1
1) With regard to the comment capacity, up to 50 device comments can be set in one block.
2) With regard to the file register capacity, up to 500 (16-bit) file registers can be set in one block.
3) In the special unit initial value setting*1, 8 blocks (4000 steps) are used.
4) In the positioning setting*1, 18 blocks (9000 steps) are used.
*1.
Caution
After changing the memory capacity setting, make sure to write both the programs and parameters to the
PLC.
If only the parameters are written to the PLC, program errors (such as parameter error, circuit error and
grammar error) may occur in the PLC.
2.7.4
FX3U-FLROM-16
FX3U-FLROM-64L*1
*1.
40
Maximum number
of steps
Memory type
Allowable number of
times of writing
64000
Flash memory
10000 times
16000
Flash memory
10000 times
10000 times
64000
Flash memory
Remarks
Write-protect switch is provided.
Entry code
2
Overview
By registering the entry code in a PLC, the functions of programming tools, display modules, and display units
to change programs, monitor devices, and current value changing function in the PLC can be restricted
(access restriction).
For the operations and restricted functions of display modules,
refer to the PLC main unit Hardware Edition.
For the operations and restricted functions of display units,
refer to the respective display unit manual.
Introduction
2.7.5
0 to 9 and
A to F
Not
applicable
Only reset of
entry code is
allowed
Not
applicable
Ver.2.00A or later support FX series PLC, however, Ver.8.13P or later is required for FX3UC series
PLCs and Ver.8.23Z or later is required for FX3U PLCs.
*2.
5
Specified the
Device &
Constant
*1.
4
Devices
in Detail
8 (16 characters
which combined
Second
0 to 9 and
Ver.2.20 or Ver.8.23Z
Not
keyword <entry
Applicable
entry code
A to F
later
or later
applicable
code> and 2nd
keyword)
Applicable
3
Instruction
List
Entry code
Available
characters
Number of
registered
characters
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
41
Program
Read
Write
Monitoring
Present value
change
Write prohibited
2) When a programming tool or GOT does not support the second entry code
All online operations are disabled. The entry code cannot be changed or reset, and the
PLC memory cannot be cleared.
1) When using handy programming panel FX-10P(-E)/FX-20P(-E)
The programming tool performs the following operations in accordance with the head
character of the entry code (in 8 characters):
Head
character of
entry code
When only the entry code is
set
Program
Monitoring
Present value
change
Read
Write
All operations
A,D to F,0 to 9
prohibited
Read/Incorrect
write
B
protection
Erroneous
C
write prohibited
2) When using any programming tool, data access unit or GOT other than the FX-10P(-E)/
FX-20P(-E)
Read/Incorrect write protection is set for all entry codes.
When neither the entry code
All operations are enabled.
nor second entry code are set
42
Introduction
2. Set the entry code, second entry code*1, and registration condition*1.
Overview
3
Instruction
List
4
Devices
in Detail
Set item
Contents of setting
Remarks
Keyword
2nd Keyword*1
Before setting the second entry code, set the entry code first.
Before setting the registration condition, set the 2ed entry code first.
The second entry code and registration condition can be set in FX3U and FX3UC PLCs Ver.2.20 or
later.
7
Basic
Instruction
The entry codes are provided to restrict access from peripheral equipment to programs created by the
users. Keep the entry codes carefully.
If a registered entry codes is forgotten, the online operations from a programming tool to the PLC are
disabled depending on the programming tool type and the contents of the registered entry code.
6
Before
Programming
*1.
Specified the
Device &
Constant
Protection level
*1
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
43
1. Select [Online]-[Read from PLC...]/[Write to PLC...] to open "Input current keyword." dialog
box.
2. Input the entry code and second entry code*1 currently registered in the PLC.
Set item
Keyword
2nd
*1.
Keyword*1
Contents of setting
Remarks
The second entry code can be set in FX3U and FX3UC PLCs Ver.2.20 or later.
3. Click [Execution] button to verify the entry codes you have input with the entry codes
currently registered in the PLC.
When the entry code inputs are verified, the PLC executes "Read from PC" or "Write to PC".
When the entry code inputs are not verified, the PLC does not execute "Read from PC" or "Write to PC".
Set item
Contents of setting
Keyword
2nd Keyword
Remarks
3. Click [Execution] button to verify the entry codes you have input with the entry codes
currently registered in the PLC.
When the entry code inputs are verified, the PLC executes "Keyword Cancel".
When the entry code inputs are not verified, the PLC does not execute "Keyword Cancel".
44
Introduction
Resetting the entry codes, and validating the reset entry codes (Keyword Protect)
Overview
3
Instruction
List
4
Devices
in Detail
Set item
Keyword Disable
*1.
2nd Keyword*1
The second entry code and entry code protect function can be set in FX3U/FX3UC PLCs Ver.2.20 or
later.
3. Click [Execution] button to reset the entry codes or validate the reset entry codes again.
Positioning setting [for TBL (FNC152) instruction] [GX Developer Ver.8.23Z or later]
7
Basic
Instruction
The initial values of the buffer memory (BFM) in special function blocks/units connected to an FX3U/FX3UC
PLC (Ver.2.20 or later) can be set as a parameter in GX Developer (Ver.8.23Z or later).
When this parameter is used, it is not necessary to execute initial setting in a user program for special
function blocks/units requiring initial setting. The special unit initial value setting uses 4000 steps (8 blocks) in
the memory capacity.
For the setting procedure, refer to Subsection 2.7.8.
2.7.7
6
Before
Programming
2.7.6
Specified the
Device &
Constant
Keyword
Protect*1
Contents of setting
Keyword
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
In the positioning setting in an FX3U/FX3UC PLC (Ver.2.20 or later), table and constants for added TBL
(FNC152) instruction can be set. Make sure to set this parameter when using TBL (FNC152) instruction.
The positioning setting for TBL (FNC152) instruction uses 9000 steps (18 blocks) in the memory capacity.
For details on TBL (FNC152) instruction, refer to the Positioning Control Manual.
For the setting procedure, refer to the Positioning Control Manual or Subsection 2.7.8.
10
FNC20-FNC29
Arith. & Logic
Operation
45
2.7.8
Set item
Contents of setting
Setting range
*1
Memory capacity
Comments capacity
Program capacity
Special Function
Memory capacity
Select whether the special unit initial value settings and positioning settings will be
used or not.
Selects the initial value setting function for special function block/unit. (When this
function is valid, the special unit setting is displayed on "I/O assignment" tab.)
Special Function
Block Settings
(8 Blocks)
Positioning
Validates the TBL (FNC152) instruction setting function.
Instruction Settings
(When this function is valid, the "Positioning" tab is displayed.)
(18 Blocks)
*1.
46
Refer to
Subsection
2.7.3.
1
Introduction
Setting devices
1. Click "Device" tab, and set devices.
2
Overview
3
Instruction
List
4
Devices
in Detail
Set item
Supplemental relay
Setting range
0 to 1023
State
Set the latched (battery backed) state relay range. Initial value: 500 to 999
0 to 999
Timer
Counter (16bit)
Set the latched (battery backed) 16-bit counter range. Initial value: 100 to 199
0 to 199
Counter (32bit)
Set the latched (battery backed) 32-bit counter range. Initial value: 220 to 255
220 to 255
Set the data register range (battery backed). Initial value: 200 to 511
Extended register
0 to 511
6
Before
Programming
Data register
5
Specified the
Device &
Constant
Contents of setting
Set the latched (battery backed) auxiliary relay range. Initial value: 500 to 1023
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
Title
Contents of setting
Input the program title in up to 32 half-width characters
(or 16 full-width characters).
Setting range
32 half-width characters
(or 16 full-width characters)
47
FNC20-FNC29
Arith. & Logic
Operation
Set item
Assigning I/Os and setting the initial values for special unit
1. Click "I/O assignment" tab, and then set the I/O assignment and special function blocks/
units.
When inputting "Special Unit" field, it is necessary to put a check mark to "Special Function
Block Settings" on "Memory capacity" tab.
Set item
I/O
Contents of setting
Setting range
0 to 377
Output relay
When the I/O range is set here according to the system configuration,
those inputs and outputs are checked in programming by GX Developer.
Unit No.
Input relay
Unit Name
Special Unit
(It is
Up
necessary
Down
to set the
memory
Set...
capacity.)
48
0 to 377
Set the name of each special function block/unit whose initial values are
to be set.
32 half-width
characters
(or 16 full-width
characters)
This button moves the cursor to the upper line (transposes the upper line).
This button moves the cursor to the lower line (transposes the lower line).
This button displays "Special Function Block Settings" dialog box of the
selected unit number.
Refer to the next page.
Delete
Delete All
This button reads "Special Unit" field from the connected PLC.
1
Introduction
2. On "Special Function Block Settings" dialog box, set the initial values of special function
blocks and units.
2
Overview
3
Instruction
List
4
Devices
in Detail
Set item
Contents of setting
Setting range
Unit Name
Set the name of a special function block/unit whose initial values are to
be set.
(The contents set on "I/O assignment" tab are displayed.)
32 half-width
characters
(or 16 full-width
characters)
No.
This column indicates the order of initial value setting in the selected unit
number.
Numbers 1 to 98 can be set.
Address
Set the buffer memory address (BFM number) in a decimal value whose
initial value is to be set.
*1
Comment
Value
Set a value to be set as the initial value of the buffer memory address
(BFM number).
Set the data length and type of the set value in "Size/Type" column.
*2
Size/Type
Select the size and type of a value set to the buffer memory among the
following:
16bit/DEC
32bit/DEC
16bit/HEX
32bit/HEX
Insert
Delete
Up
This button moves the cursor to the upper line (transposes the upper line).
Down
6
Before
Programming
7
Basic
Instruction
Identification code
*3
*1.
Input buffer memory addresses (BFM numbers) that in the connected special function block/unit hold.
*2.
To each buffer memory address (BFM number), set a value within the allowed range in the connected
special function block/unit.
*3.
49
10
FNC20-FNC29
Arith. & Logic
Operation
3. Click [End] button to finish the setting and close "Special Function Block Settings" dialog
box.
FNC10-FNC19
Move & Compare
FNC00-FNC09
Program Flow
This button moves the cursor to the lower line (transposes the lower line).
Check the identification code Put a check mark to check the model code of the special function block/
before initializing
unit before initialization.
Set the model code of the special function block/unit.
5
Specified the
Device &
Constant
Set item
Contents of setting
Setting range
MODEM initialized
Set this item to use an input terminal (X) to switch the PLC between
STOP and RUN.
*1.
50
None
X000 to X017*1
1
Introduction
2
Overview
2. Only when a latch (battery backed) area for a serial port exists through an extended PLC,
select a channel to be set and put a check mark to "Operate communication setting."
When not performing the communication setting for a serial port, do not put a check mark
to "Operate communication setting."
Channel selection
Instruction
List
4
Devices
in Detail
5
Contents of setting
Select a channel in which a serial port is set.
Operate communication
setting
Put a check mark when using the selected serial port in "computer link",
"no-protocol communication" or "inverter communication".
Do not put a check mark when transferring and monitoring sequence
programs in GX Developer or when using the selected serial port in
simple N : N link or parallel link.
CH1,CH2
Before
Programming
Channel selection
Setting range
Specified the
Device &
Constant
Set item
Protocol
Data length
Parity
Basic
Instruction
Stop bit
Transmission speed
Header
Terminator
Control line
H/W type
8
FNC00-FNC09
Program Flow
Control mode
Sum check
Transmission control
procedure
Station number setting
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
51
Setting positioning
The positioning setting function is available in FX3U/FX3UC PLCs Ver.2.20 or later.
1. Click "Positioning" tab.
"Positioning" tab is displayed when a check mark is put to "Positioning" on "Memory
capacity" tab.
2. Set the positioning constants in TBL (FNC152) instruction.
For TBL (FNC152) instruction, refer to the Positioning Control Manual.
52
1
Contents of setting
Set range
Set the creep speed in DSZR (FNC150) instruction for each output
number of pulse.
Initial value: 1000
Set the zero point return speed in DSZR (FNC150) instruction for each
output number of pulse.
Initial value: 50000
50 to 5000
50 to 5000
10 to 32767
*2
*1
4
Devices
in Detail
As shown on the
left
3
Instruction
List
*1
Overview
Set the interrupt input*3 for DVIT (FNC151) instruction for each output
number of pulse. Specify a user interrupt command device (M) for a
pulse output destination device not used in DVIT instruction.
Initial setting:
Setting range:
Pulse output destination Y000: X000
X000 to X007, M8460
Pulse output destination Y001: X001
X000 to X007, M8461
Pulse output destination Y002: X002
X000 to X007, M8462
Introduction
Set item
They are set items for the pulse output destination Y000.
Y1
They are set items for the pulse output destination Y001.
Y2
They are set items for the pulse output destination Y002.
Y3*4
They are set items for the pulse output destination Y003.
Individual setting
5
Specified the
Device &
Constant
Y0
*2.
The creep speed should satisfy the relationship "Bias speed Creep speed Maximum speed."
*3.
An interrupt input set here cannot be used jointly with a high speed counter, input interrupt, pulse
catch input, input in SPD (FNC 67) instruction, or interrupt input in DVIT (FNC151) instruction.
*4.
Y003 cannot be set in FX3U PLCs except when two FX3U-2HSY-ADP units are connected.
7
Basic
Instruction
Before
Programming
*1.
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
53
3. Click [Individual setting] button to display "Positioning instruction settings" dialog box.
In this dialog box, set the positioning table for each pulse output destination.
Set item
Contents of setting
Set the positioning table for the pulse output destination Y000.
Y1
Set the positioning table for the pulse output destination Y001.
Y2
Set the positioning table for the pulse output destination Y002.
Set the positioning table for the pulse output destination Y003.
Y3
*1
54
Setting range
Y0
Y000 to Y357
M0 to M7679
S0 to S4095
Head Address
Set the head number of devices storing the set data (pulse number and
frequency).
1600 devices are occupied starting from the head device number set
here without regard to the number of used axes.
Initial setting: R0
Refer to the Positioning Control Manual.
No.
Positioning Instruction
Pulse
Frequency [Hz]
Set the speed (pulse frequency) output by the operation (instruction) set
Refer to the
in "Positioning Instruction" column.
Positioning Control
Refer to the Positioning Control Manual.
Manual.
D0 to D6400
R0 to R31168
Up
Down
Insert
Delete
This button deletes the entire setting of the positioning table for the
selected pulse output destination.
1
Setting range
Write
This button writes from "Head Address" up to 1600 devices, the contents
of the positioning table created here
Read
This button reads the existing positioning table contents starting from
"Head Address" up to 1600 devices but does not read the device
numbers without "positioning instruction" set.
2
Overview
*1.
Y003 cannot be set in FX3UC PLCs except when two FX3U-2HSY-ADP units are connected to FX3U
PLCs.
3
Instruction
List
Contents of setting
A check mark here means not to transfer the positioning setting when
PLC turns ON.
Positioning table settings will
Put a check mark when changing the positioning setting from a display
not be initialized when the
unit, etc., and then using the changed contents even after restoring the
PLC is powered on
power. At this time, set a latched (battery backed) type device to "Head
Address".
Introduction
Set item
4
Devices
in Detail
FX3U(C)*1
5
Specified the
Device &
Constant
6
Before
Programming
*1.
Basic
Instruction
8
FNC00-FNC09
Program Flow
After changing the memory capacity setting, make sure to write both the programs and parameters to the
PLC.
If only the parameters are written to the PLC, program errors (such as parameter error, circuit error and
grammar error) may occur in the PLC.
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
55
3 Instruction List
3.
Instruction List
This chapter introduces a list of instructions available in programming.
Instructions added in FX3U and FX3UC PLCs are shaded in the list.
3.1
Basic Instructions
The basic instructions are provided in the following series. The table below shows differences in applicable
devices.
Applicable PLC
FX3U
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
Ver.2.30
or later
Ver.2.30
or later
Mnemonic
Name
Symbol
Function
Applicable devices
Reference
X,Y,M,S,D.b,T,C
Section 7.1
Contact Instruction
Applicable devices
LD
Load
LDI
Load Inverse
Applicable devices
X,Y,M,S,D.b,T,C
Section 7.1
LDP
Load Pulse
Applicable devices
Section 7.5
LDF
Applicable devices
Section 7.5
AND
AND
Applicable devices
Serial connection of NO
X,Y,M,S,D.b,T,C
(normally open) contacts
Section 7.3
ANI
AND Inverse
Applicable devices
Serial connection of NC
X,Y,M,S,D.b,T,C
(normally closed) contacts
Section 7.3
ANDP
AND Pulse
Applicable devices
Section 7.5
ANDF
Applicable devices
Serial connection of
Falling/trailing edge pulse
X,Y,M,S,D.b,T,C
Section 7.5
Applicable devices
Parallel connection of NO
X,Y,M,S,D.b,T,C
(normally open) contacts
Section 7.4
Applicable devices
Parallel connection of NC
X,Y,M,S,D.b,T,C
(normally closed) contacts
Section 7.4
Applicable devices
Parallel connection of
Rising edge pulse
X,Y,M,S,D.b,T,C
Section 7.5
Applicable devices
Parallel connection of
Falling/trailing edge pulse
X,Y,M,S,D.b,T,C
Section 7.5
56
OR
OR
ORI
OR Inverse
ORP
OR Pulse
ORF
OR Falling Pulse
3 Instruction List
1
Name
Symbol
Function
Applicable devices
Reference
Connection Instruction
AND Block
Serial connection of
multiple parallel circuits
Section 7.7
ORB
OR Block
Parallel connection of
multiple contact circuits
Section 7.6
MPS
Memory Point
Store
MPS
MPP
Memory POP
MPP
INV
Inverse
MEP
MEF
Section 7.8
Section 7.8
Section 7.10
MEP
Conversion of
operation result
to leading edge pulse
Section 7.11
MEF
Conversion of operation
result to trailing edge pulse
Section 7.11
INV
Out Instruction
5
Specified the
Device &
Constant
MRD
Devices
in Detail
Memory Read
Section 7.8
Instruction
List
MRD
2
Overview
ANB
Introduction
Mnemonic
Section 7.2
Y,M,S,D.b
Section 7.13
Reset
Y,M,S,D.b,T,C,
D,R,V,Z
Section 7.13
Before
Programming
PLS
Pulse
Y,M
Section 7.12
PLF
Pulse Falling
Y,M
Section 7.12
Basic
Instruction
Section 7.9
OUT
OUT
SET
SET
RST
Applicable devices
MC N Applicable devices
MCR
Master Control
Reset
MCR N
Section 7.9
Section 7.14
Section 7.15
Other Instruction
NOP
No Operation
End Instruction
END
END
END
9
FNC10-FNC19
Move & Compare
8
FNC00-FNC09
Program Flow
MC
10
FNC20-FNC29
Arith. & Logic
Operation
57
3 Instruction List
3.2
Mnemonic
Name
STL
Step Ladder
RET
Return
3.3
Symbol
Function
Applicable devices
Reference
Chapter 34
Chapter 34
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
CJ
Pn
Conditional Jump
Section
8.1
CALL
Pn
Call Subroutine
Section
8.2
SRET
Subroutine Return
Section
8.3
IRET
Interrupt Return
Section
8.4
EI
EI
Enable Interrupt
Section
8.5
05
DI
DI
Disable Interrupt
Section
8.6
06
FEND
FEND
Section
8.7
07
WDT
WDT
Section
8.8
08
FOR
Section
8.9
09
NEXT
Section
8.10
Compare
Section
9.1
Symbol
Function
Reference
Program Flow
00
CJ
01
CALL
02
SRET
03
IRET
04
FOR
NEXT
58
CMP
CMP
S1 S2 D
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
15
BMOV
ZCP
Section
9.2
Move
Section
9.3
Shift Move
Section
9.4
Complement
Section
9.5
Block Move
Section
9.6
Function
S1 S2 S D
MOV
S D
SMOV S m1 m2 D n
CML
S D
BMOV S D n
Reference
3
Instruction
List
CML
Zone Compare
Symbol
Overview
14
FX2NC
SMOV
FX1NC
13
FX2N
MOV
FX1N
12
FX1S
ZCP
FX3UC
11
FX3U
1
Introduction
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
59
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
Fill Move
Section
9.7
D1 D2
Exchange
Section
9.8
BCD
S D
Section
9.9
BIN
S D
Conversion to Binary
Section
9.10
Symbol
Function
Reference
FMOV
17
XCH
XCH
18
BCD
19
BIN
FMOV S D n
ADD
ADD
S1 S2 D
Addition
Section
10.1
21
SUB
SUB
S1 S2 D
Subtraction
Section
10.2
22
MUL
MUL
S1 S2 D
Multiplication
Section
10.3
23
DIV
DIV
S1 S2 D
Division
Section
10.4
24
INC
INC
Increment
Section
10.5
25
DEC
DEC
Decrement
Section
10.6
26
WAND
WAND S1 S2 D
Section
10.7
27
WOR
WOR S1 S2 D
Logical Word OR
Section
10.8
28
WXOR
WXOR S1 S2 D
Logical Exclusive OR
Section
10.9
29
NEG
Negation
Section
10.10
NEG
60
30
ROR
ROR
D n
Rotation Right
Section
11.1
31
ROL
ROL
D n
Rotation Left
Section
11.2
32
RCR
RCR
D n
Section
11.3
33
RCL
RCL
D n
Section
11.4
34
SFTR
Section
11.5
SFTR S D n1 n2
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
1
Introduction
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
Section
11.6
WSFR S D n1 n2
Section
11.7
WSFL
WSFL S D n1 n2
Section
11.8
Instruction
List
38
SFWR
SFWR S D n
Section
11.9
39
SFRD
SFRD S D n
Section
11.10
Zone Reset
Section
12.1
Section
12.2
Symbol
Function
Reference
35
SFTL
SFTL
36
WSFR
37
S D n1 n2
4
Devices
in Detail
Data Operation
Overview
40
ZRST
41
DECO
DECO S D n
Decode
42
ENCO
ENCO S D n
Encode
Section
12.3
43
SUM
Section
12.4
44
BON
Section
12.5
MEAN
MEAN S D n
Mean
Section
12.6
Before
Programming
45
46
ANS
ANS
Section
12.7
47
ANR
Annunciator Reset
Section
12.8
48
SQR
SQR
S D
Square Root
Section
12.9
49
FLT
FLT
S D
Section
12.10
REF
D n
Refresh
Section
13.1
Section
13.2
Input Matrix
Section
13.3
Section
13.4
ZRST D1 D2
BON
S D
S D n
ANR
REF
51
REFF
52
MTR
HSCS
MTR
S D1 D2 n
HSCS S1 S2 D
61
10
FNC20-FNC29
Arith. & Logic
Operation
53
REFF
9
FNC10-FNC19
Move & Compare
50
8
FNC00-FNC09
Program Flow
7
Basic
Instruction
S m D
Specified the
Device &
Constant
SUM
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
Section
13.5
Section
13.6
Speed Detection
Section
13.7
PLSY S1 S2 D
Pulse Y Output
Section
13.8
PWM
PWM S1 S2 D
Section
13.9
PLSR
PLSR S1 S2 S3 D
Acceleration/Deceleration
Setup
Section
13.10
Initial State
Section
14.1
Section
14.2
Symbol
Function
Reference
HSCR
55
HSZ
56
SPD
SPD
57
PLSY
58
59
HSCR S1 S2 D
HSZ
S1 S2 S D
S1 S2 D
Handy Instruction
60
IST
61
SER
62
ABSD
ABSD S1 S2 D n
Section
14.3
63
INCD
INCD S1 S2 D n
Section
14.4
64
TTMR
TTMR D n
Teaching Timer
Section
14.5
65
STMR
STMR S m D
Special Timer
Section
14.6
66
ALT
ALT
Alternate State
Section
14.7
67
RAMP
RAMP S1 S2 D n
Section
14.8
68
ROTC
ROTC S m1 m2 D
Section
14.9
69
SORT
SORT S m1 m2 D n
Section
14.10
Section
15.1
IST
SER
S D1 D2
S1 S2 D n
62
70
TKY
71
HKY
HKY
S D1 D2 D3
Hexadecimal Input
Section
15.2
72
DSW
DSW
S D1 D2 n
Digital Switch
(Thumbwheel Input)
Section
15.3
TKY
S D1 D2
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
FX3U
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
Section
15.4
Section
15.5
ARWS S D1 D2 n
Arrow Switch
Section
15.6
Instruction
List
ASC
Section
15.7
Section
15.8
FROM m1 m2 D n
Section
15.9
TO
m1 m2 S n
Section
15.10
RS
S m D n
Serial Communication
Section
16.1
Section
16.2
6
Before
Programming
Symbol
Function
Reference
SEGD
SEGD S D
74
SEGL
SEGL S D n
75
ARWS
76
ASC
77
PR
78
FROM
79
TO
PR
S D
RS
81
PRUN
82
ASCI
ASCI
S D n
Hexadecimal to ASCII
Conversion
Section
16.3
83
HEX
HEX
S D n
ASCII to Hexadecimal
Conversion
Section
16.4
84
CCD
S D n
Check Code
Section
16.5
85
VRRD
VRRD S D
Volume Read
86
VRSC
VRSC S D
Volume Scale
87
RS2
Serial Communication 2
Section
16.6
88
PID
Section
16.7
89 to 99
ZPUSH
Section
17.1
PRUN S D
CCD
PID
S m D n n1
S1 S2 S3 D
3 *5
10
63
FNC20-FNC29
Arith. & Logic
Operation
ZPUSH D
9
FNC10-FNC19
Move & Compare
Data Transfer 2
102
FNC00-FNC09
Program Flow
RS2
7
Basic
Instruction
80
5
Specified the
Device &
Constant
External FX Device
4
Devices
in Detail
73
2
Overview
100,
101
1
Introduction
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX1N
FX2N
FX1NC
FX2NC
Function
FX3UC
Symbol
FX3U
Reference
Data Transfer 2
103
ZPOP
104 to
109
ZPOP D
3 *5
Section
17.2
Floating Point
110
ECMP
ECMP S1 S2 D
111
EZCP
EZCP S1 S2 S D
112
EMOV
EMOV S D
113 to
115
116
ESTR
117
EVAL
EVAL
118
EBCD
119
EBIN
120
EADD
121
64
Section
18.1
Section
18.2
Section
18.3
Section
18.4
Section
18.5
EBCD S D
Section
18.6
EBIN
Section
18.7
EADD S1 S2 D
Section
18.8
ESUB
ESUB S1 S2 D
Section
18.9
122
EMUL
EMUL S1 S2 D
Section
18.10
123
EDIV
EDIV S1 S2 D
Section
18.11
124
EXP
Section
18.12
125
LOGE
LOGE S D
Section
18.13
126
LOG10
LOG10
Section
18.14
127
ESQR
ESQR S D
Section
18.15
128
ENEG
ENEG D
Section
18.16
129
INT
Section
18.17
ESTR S1 S2 D
EXP
INT
S D
S D
S D
S D
S D
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
1
Introduction
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
130
SIN
SIN
S D
Section
18.18
131
COS
COS
S D
Section
18.19
132
TAN
TAN
S D
Section
18.20
Instruction
List
133
ASIN
ASIN
S D
Section
18.21
134
ACOS
ACOS S D
Section
18.22
135
ATAN
ATAN S D
Section
18.23
136
RAD
RAD
S D
to
Section
18.24
137
DEG
DEG
S D
to
Section
18.25
Specified the
Device &
Constant
138,
139
Symbol
Function
Reference
3 *5
Section
19.1
141
WTOB
WTOB S D n
WORD to BYTE
3 *5
Section
19.2
142
BTOW
BTOW S D n
BYTE to WORD
3 *5
Section
19.3
143
UNI
UNI
S D n
3 *5
Section
19.4
144
DIS
DIS
S D n
3 *5
Section
19.5
145,
146
147
SWAP
148
149
SORT2
Byte Swap
Section
19.6
SORT2 S m1 m2 D n
3 *5
Section
19.7
9
FNC10-FNC19
Move & Compare
WSUM S D n
FNC00-FNC09
Program Flow
WSUM
Basic
Instruction
140
Before
Programming
Data Operation 2
SWAP S
4
Devices
in Detail
Overview
Floating Point
10
FNC20-FNC29
Arith. & Logic
Operation
65
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX2N
FX1NC
FX2NC
Reference
FX1S
Function
FX3UC
Symbol
FX3U
Section
20.1
*2,
Section
20.2
Section
20.3
Positioning Control
150
DSZR
DSZR S1 S2 D1 D2
3 *4
151
DVIT
DVIT
Interrupt Positioning
152
TBL
3 *5
153,
154
155
ABS
156
ZRN
157
PLSV
158
DRVI
159
DRVA
S1 S2 D1 D2
TBL
D n
Zero Return
3 *4 3
Section
20.5
Section
20.6
DRVI S1 S2 D1 D2
Drive to Increment
Section
20.7
DRVA S1 S2 D1 D2
Drive to Absolute
Section
20.8
Section
21.1
Section
21.2
ZRN
S D1 D2
S1 S2 S3 D
PLSV
S D1 D2
3 *1 3 *1
Section
20.4
ABS
66
160
TCMP
TCMP S1 S2 S3 S D
161
TZCP
TZCP S1 S2 S D
162
TADD
TADD S1 S2 D
Section
21.3
163
TSUB
TSUB S1 S2 D
Section
21.4
164
HTOS
HTOS S D
Section
21.5
165
STOH
STOH S D
Section
21.6
166
TRD
TRD
Section
21.7
167
TWR
TWR
Section
21.8
168
169
HOUR
HOUR S D1 D2
Hour Meter
3 *1 3 *1
Section
21.9
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
GRY
GRY
S D
Section
22.1
171
GBIN
GBIN
S D
Section
22.2
172 to
175
176
RD3A
177
WR3A
178,
179
Symbol
Function
Reference
External Device
3 *1 3 *1
Section
22.3
3 *1 3 *1
Section
22.4
Extension Function
EXTR
*1
*1
Specified the
Device &
Constant
180
Others
COMRD
183
184
RND
185
186
DUTY
187
188
CRC
189
HCMOV
COMRD S D
3 *5
Section
24.1
RND
Section
24.2
DUTY n1 n2 D
3 *5
Section
24.3
S D n
Section
24.4
FNC00-FNC09
Program Flow
182
Basic
Instruction
Before
Programming
181
4
Devices
in Detail
WR3A m1 m2 S
3
Instruction
List
RD3A m1 m2 D
2
Overview
FX3U
170
1
Introduction
HCMOV S D n
3 *4
Section
24.5
CRC
FNC10-FNC19
Move & Compare
192
BK+
BK+
S1 S2 D n
3 *5
Section
25.1
10
193
BK-
BK-
S1 S2 D n
3 *5
Section
25.2
FNC20-FNC29
Arith. & Logic
Operation
67
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX2N
FX1NC
FX2NC
Reference
FX1S
Function
FX3UC
Symbol
FX3U
3 *5
Section
25.3
3 *5
Section
25.3
3 *5
Section
25.3
3 *5
Section
25.3
3 *5
Section
25.3
3 *5
Section
25.3
BKCMP=
BKCMP= S1 S2 D n
195
BKCMP>
BKCMP> S1 S2 D n
196
BKCMP<
BKCMP< S1 S2 D n
197
BKCMP<>
BKCMP<> S1 S2 D n
198
BKCMP<=
BKCMP<= S1 S2 D n
199
BKCMP>=
BKCMP>= S1 S2 D n
STR
STR
S1 S2 D
3 *5
Section
26.1
201
VAL
VAL
S D1 D2
3 *5
Section
26.2
202
$+
$+
S1 S2 D
Section
26.3
203
LEN
Section
26.4
204
RIGHT
205
LEN
S D
RIGHT
S D n
Section
26.5
LEFT
LEFT
S D n
Section
26.6
206
MIDR
MIDR S1 D S2
Section
26.7
207
MIDW
MIDW S1 D S2
Random Replacement of
Character Strings
Section
26.8
208
INSTR
INSTR S1 S2 D n
3 *5
Section
26.9
209
$MOV
$MOV S D
Section
26.10
Data Operation 3
68
210
FDEL
FDEL
S D n
3 *5
Section
27.1
211
FINS
FINS
S D n
3 *5
Section
27.2
212
POP
POP
S D n
Section
27.3
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
SFR
SFR
D n
Section
27.4
214
SFL
SFL
D n
Section
27.5
215 to
219
Symbol
Function
Reference
Data Operation 3
2
Overview
FX3U
213
1
Introduction
Instruction
List
Data Comparison
224
LD=
LD=
S1 S2
Load Compare
S1 = S2
Section
28.1
225
LD>
LD>
S1 S2
Load Compare
S1 > S2
Section
28.1
226
LD<
LD<
S1 S2
Load Compare
S1 < S2
Section
28.1
227
228
LD<>
LD<> S1 S2
Load Compare
S1 S2
Section
28.1
229
LD<=
LD<= S1 S2
Load Compare
S1 S2
Section
28.1
LD>=
LD>= S1 S2
Load Compare
S1 S2
Section
28.1
Before
Programming
230
231
232
AND=
AND= S1 S2
AND Compare
S1 = S2
Section
28.2
233
AND>
AND> S1 S2
AND Compare
S1 > S2
Section
28.2
234
AND<
AND< S1 S2
AND Compare
S1 < S2
Section
28.2
FNC00-FNC09
Program Flow
235
236
AND<>
AND<> S1 S2
AND Compare
S1 S2
Section
28.2
237
AND<=
AND<= S1 S2
AND Compare
S1 S2
Section
28.2
238
AND>=
AND>= S1 S2
AND Compare
S1 S2
Section
28.2
239
10
FNC20-FNC29
Arith. & Logic
Operation
69
9
FNC10-FNC19
Move & Compare
7
Basic
Instruction
5
Specified the
Device &
Constant
Devices
in Detail
220 to
223
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
FX1S
FX1N
FX2N
FX1NC
FX2NC
Symbol
FX3U
OR Compare
S1 = S2
Section
28.3
OR Compare
S1 > S2
Section
28.3
OR Compare
S1 < S2
Section
28.3
Function
Reference
Data Comparison
240
OR=
241
OR>
242
OR<
243
244
OR<>
245
OR<=
246
OR>=
247 to
249
OR=
S1 S2
OR>
S1 S2
OR<
S1 S2
OR<> S1 S2
OR<= S1 S2
OR>= S1 S2
OR Compare
S1 S2
Section
28.3
OR Compare
S1 S2
Section
28.3
OR Compare
S1 S2
Section
28.3
256
LIMIT
LIMIT S1 S2 S3 D
Limit Control
Section
29.1
257
BAND
BAND S1 S2 S3 D
Section
29.2
258
ZONE
ZONE S1 S2 S3 D
Zone Control
Section
29.3
259
SCL
Scaling
(Coordinate by Point Data)
Section
29.4
260
DABIN
DABIN S D
3 *5
Section
29.5
261
BINDA
BINDA S D
3 *5
Section
29.6
262 to
268
269
SCL2
70
SCL
S1 S2 D
SCL2 S1 S2 D
Scaling 2
(Coordinate by X/Y Data)
3 *3
Section
29.7
3 Instruction List
3.3 Applied Instructions ... in Ascending Order of FNC Number
Applicable PLC
1
Introduction
FX3UC
FX1S
FX1N
FX2N
FX1NC
FX2NC
270
IVCK
IVCK S1 S2 D n
Section
30.1
271
IVDR
IVDR S1 S2 S3 n
Inverter Drive
Section
30.2
272
IVRD
IVRD S1 S2 D n
Section
30.3
Instruction
List
273
IVWR
IVWR S1 S2 S3 n
Section
30.4
274
IVBWR
Section
30.5
275 to
277
Symbol
Function
Reference
Data Transfer 3
RBFM
279
WBFM
3 *5
Section
31.1
WBFM m1 m2 S n1 n2
3 *5
Section
31.2
HSCT S1 m S2 D n
Section
32.1
HSCT
281 to
289
291
SAVER
292
INITR
293
LOGR
294
RWER
INITER
296 to
299
SAVER
S m D
INITR S n
LOGR S m D1 n D2
RWER S n
INITER
S n
Section
33.1
Save to ER
Section
33.2
Initialize R and ER
Section
33.3
Logging R and ER
Section
33.4
Rewrite to ER
3 *3
Section
33.5
Section
33.6
Initialize ER
3 *3
9
FNC10-FNC19
Move & Compare
295
LOADR S n
Load From ER
FNC00-FNC09
Program Flow
LOADR
Basic
Instruction
290
Before
Programming
RBFM m1 m2 D n1 n2
Specified the
Device &
Constant
278
4
Devices
in Detail
IVBWR S1 S2 S3 n
Overview
10
FNC20-FNC29
Arith. & Logic
Operation
71
4 Devices in Detail
4.
Devices in Detail
This chapter explains how numeric values are handled in the PLC as well as the roles and functions of
various built-in devices including I/O relays, auxiliary relays, state relays, counters and data registers.
The following content provides a basis for handling the PLC.
4.1
Description
Reference
I/O relay
Input relay
X000 to X367*1
248 points
Output relay
Y000 to Y367*1
248 points
M0 to M499
500 points
M500 to M1023
524 points
M1024 to M7679
6656 points
Special type*2
M8000 to M8511
512 points
S0 to S9
10 points
S10 to S499
490 points
S500 to S899
400 points
Annunciator
(latched (battery backed)
type [variable])
S900 to S999
100 points
S1000 to S4095
3096 points
T0 to T191
Section 4.2
Auxiliary relay
The setting can be changed between the
latched (battery backed) type and the nonlatched type using parameters.
Section 4.3
Chapter 36
State relay
Section 4.4
72
192 points
8 points
10 ms
T200 to T245
46 points
T246 to T249
4 points
6 points
1 ms
256 points
T256 to T511
Section 4.5
4 Devices in Detail
1
Description
Reference
100 points
C100 to C199
100 points
General type
bi-directional counter
(32 bits) [variable]
C200 to C219
20 points
C220 to C234
15 points
Counts 0 to 32,767
The setting can be changed between the
latched (battery backed) type and the nonlatched type using parameters.
2,147,483,648 to
+2,147,483,647 counts
The setting can be changed between the
latched (battery backed) type and the nonlatched type using parameters.
*1.
Available device numbers vary depending on the PLC. For details, refer to Section 4.2.
*2.
2
Section 4.6
3
Instruction
List
C0 to C99
C246 to C250
C251 to C255
Hardware counter*1
1 phase: 100 kHz 6 points, 10 kHz 2 points
2 phases: 50 kHz (1 edge count),
50 kHz (4 edge count)
Software counter
1 phase: 40 kHz
2 phases: 40 kHz (1 edge count),
10 kHz (4 edge count)
Section 4.7
200 points
D200 to D511
312 points
D512 to D7999
<D1000 to
D7999>
7488 points
<7000
points>
D8000 to D8511
512 points
V0 to V7, Z0 to Z7 16 points
Before
Programming
7
Basic
Instruction
ER0 to ER32767
32768
points
P0 to P4095
4096 points
Input interrupt
Input delay interrupt
I0 to I5
6 points
Timer interrupt
I6 to I8
3 points
Counter interrupt
I010 to I060
6 points
N0 to N7
8 points
For MC instruction
Section 4.9
Pointer
9
Section 4.11
FNC10-FNC19
Move & Compare
R0 to R32767
8
FNC00-FNC09
Program Flow
Extension register
(16 bits)
10
Nesting
FNC20-FNC29
Arith. & Logic
Operation
5
Specified the
Device &
Constant
Devices
in Detail
Overview
Introduction
Device name
Counter
73
4 Devices in Detail
Device name
Description
Reference
Constant
16 bits
32768 to +32767
32 bits
2,147,483,648 to +2,147,483,647
16 bits
0 to FFFF
32 bits
0 to FFFFFFFF
32 bits
Character string
Decimal (K)
Hexadecimal (H)
74
Chapter 5
*1.
When the FX3U-4HSX-ADP is connected to an FX3U PLC, the maximum input frequency is set as
follows:
1 phase: 200 kHz
2 phases: 100 kHz (1 edge count). 100 kHz (4 edge count)
*2.
4 Devices in Detail
When
extended
Input
X000 to X017
16 points
X000 to X357
240 points
Output
Y000 to Y017
16 points
Y000 to Y357
240 points
FX3UC-96M
When
extended
256
X000 to X007 X000 to X017 X000 to X037 X000 to X057 X000 to X367
Input
points
8 points
16 points
32 points
48 points
248 points
in total
Y000 to Y007 Y000 to Y017 Y000 to Y037 Y000 to Y057 Y000 to Y367
Output
8 points
16 points
32 points
48 points
248 points
4
256
points
in total
Model
name
FX3U-16M
FX3U-32M
FX3U-48M
FX3U-64M
FX3U-80M
FX3U-128M
Input
X000 to X007
8 points
X000 to X017
16 points
X000 to X027
24 points
X000 to X037
32 points
X000 to X047
40 points
X000 to X077
64 points
Output
Y000 to Y007
8 points
Y000 to Y017
16 points
Y000 to Y027
24 points
Y000 to Y037
32 points
Y000 to Y047
40 points
Y000 to Y077
64 points
Model
name
When
extended
Input
X000 to X367
248 points
Output
Y000 to Y367
248 points
6
Before
Programming
FX3U
PLC
FX3UC-32MT-LT
FX3UC-64M
Specified the
Device &
Constant
FX3U
PLC
Model
name
FX3UC-32M
Devices
in Detail
FX3UC-32MT-LT PLC
FX3UC-16M
Instruction
List
Model
name
2
Overview
4.2.1
Introduction
4.2
256
points
in total
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
75
4 Devices in Detail
4.2.2
External power
supply
COM1
24V
Input
signal
Program example
X000
X001
S/S
X000
Y000
X000
Input
terminal
Load
Y000
NO contact
X000
PLC
76
Y000
Y000
X000
Y000
Output terminal
NC contact
4 Devices in Detail
1) Read-in
Input processing
Before executing a program, the PLC reads the ON/
OFF status of all input terminals inside the PLC into
the input image memory.
Even if inputs change while the program is
executed, the contents of the input image memory
remain unchanged, but the changes in inputs are
read during the input processing in the next cycle.
Even if an input contact changes from ON to OFF or
from OFF to ON, its ON/OFF status is judged after
the response delay (approximately 10 ms) caused
by the input filter.
(When the input filter is a digital type input terminal ,
its value can be overwritten by a sequence
program.)
Input
Image
Memory
3
Instruction
List
Input terminal
X000
X001
X002
Overview
Input processing
Introduction
4.2.3
4
Devices
in Detail
3) Write
4) Readout
M0
5) Write
Auxiliary
relay
Device
Image
Memory
5
Specified the
Device &
Constant
Y000
Y000
Program processing
The PLC reads the ON/OFF status of each device
from the input image memory and other device
image memories according to the contents of
instructions in the program memory, executes
operations in sequence from step 0, and then writes
the operation result to the image memory.
Accordingly, the contents of the image memory for
each device change as the program is executed.
The operation of a contact inside an output relay is
determined by the contents of the output image
memory.
6
Before
Programming
Latch
Memory
Y000
Y001
Y002
Output processing
When execution of all instructions is finished, the
ON/OFF status of the image memory of outputs (Y)
is transferred to the output latch memory. This is
the actual output of the PLC.
External output contacts inside the PLC operate
after the response delay time of the output devices.
Basic
Instruction
Output
Output processing
Output terminal
8
FNC00-FNC09
Program Flow
Repeated operation
[The time required for a cyclic
operation is called operation cycle
(scan time).]
6) Output
The above method is called the batch I/O method (or refresh method).
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
77
4 Devices in Detail
4.3
4.3.1
FX3U/FX3UC PLC
General type
latched (battery
backed) type
M0 to M499
M500 to M1023
M1024 to M7679
500 points*1
524 points*2
6656 points*3
Special type
M8000 to M8511
512 points
*1.
This area is not latched (battery backed). It can be changed to a latched (battery backed) area by
setting the parameters.
*2.
This area is latched (battery backed). It can be changed to a non-latched (non-battery-backed) area
by setting the parameters.
*3.
When simple N : N link or parallel link is used, some auxiliary relays are occupied for the link.
Refer to the Data Communication Edition manual.
4.3.2
M100
NO contact
M100
NC contact
Auxiliary relay circuit
78
All of general type auxiliary relays turn OFF when the PLC turns OFF.
When the ON/OFF status of auxiliary relays just before power failure is
required in control, use latched (battery backed) type auxiliary relays.
4 Devices in Detail
M600
RST
M600
4
Devices
in Detail
SET
3
Instruction
List
X000
2
Overview
When the power is turned OFF while the PLC is operating, all of the output relays and general type auxiliary
relays turn OFF.
When restoring the power again, all of the output relays and general type auxiliary relays remain OFF except
those whose input condition is ON. In some output relays and auxiliary relays, however, the ON/OFF status
just before power failure should be stored and then replicated when restoring the power, depending on control
targets. In such a case, use latched (battery backed) type auxiliary relays.
Latch type devices are backed up by the battery built in to the PLC.
For details on backup method against power failure,
refer to Section 2.6.
The
figure
on
the
left
shows
an
operation
example of
X000
X001
M600
(latched
[battery
backed]
type
device)
in a selfM600
holding circuit.
M600
When X000 turns ON and M600 turns ON in this circuit,
M600 holds its operation by itself even if X000 is
PLC
opened.
Backup against power failure
Because M600 is a latched (battery backed) type
(self-holding circuit)
device, it remains activated when the operation is
restarted even after X000 has turned OFF due to power
failure. If an NC contact of X001 is opened when the
operation is restarted, however, M600 is deactivated.
Introduction
The figure on the left shows a circuit using the SET and
RST instructions.
X001
5
Specified the
Device &
Constant
PLC
Backup against power failure
(set/reset circuit)
6
Before
Programming
7
X000
X001
M600
M600
X000
M601
M601
Leftward drive
command
8
FNC00-FNC09
Program Flow
X001
Rightward
drive
command
Basic
Instruction
M8002
FNC 040
ZRST
M1024
10
M1999
FNC20-FNC29
Arith. & Logic
Operation
Initial pulse
FNC10-FNC19
Move & Compare
2) Method for using a fixed latched (battery backed) type auxiliary relay as a general type auxiliary relay
When using a fixed latched (battery backed) type auxiliary relay as a general type auxiliary relay, provide
a reset circuit shown in the figure below around the head step in the program.
79
4 Devices in Detail
4.4
4.4.1
FX3U/FX3UC PLC
General type
Latched (battery
backed) type
Annunciator type
S0 to S499
500 points
(S0 to S9 are provided
S500 to S899
S1000 to S4095
S900 to S999
400 points*2
3096 points*3
100 points*2
initially.)*1
4.4.2
*1.
This area is not latched (battery backed). It can be changed to a latched (battery backed) area by
setting the parameters.
*2.
This area is latched (battery backed). It can be changed to a non-latched (non-battery-backed) area
by setting the parameters.
*3.
Start
X000
Start
TRAN
Moving down
S 20
Y000
Lower limit
X001
Lower
limit
TRAN
Clamping
S 21
Y001
Clamping
X002
Clamping
TRAN
Moving up
S 22
Upper
limit
Y002
Upper limit
X003
TRAN
State relays have many NO contacts and NC contacts in the same way as
auxiliary relays, and such contacts can be used arbitrarily in sequence
programs.
When state relays (S) are not used for step ladder instructions, they can
be used in general sequences in the same way as auxiliary relays (M) (as
shown in the figure on the right).
80
X001
S10
S10
M30
Y005
4 Devices in Detail
Latched (battery backed) type state relays store their ON/OFF status even if the power is shut down while
the PLC is operating, so the operation can be restarted from the last point in the process.
Latched (battery backed) type state relays are backed up by the battery built into the PLC.
For details on each backup method, refer to Section 2.6.
0
M8002
Initial pulse
FNC 040
ZRST
S1000
S1200
2
Overview
Introduction
Annunciator type state relays can be used as outputs for external fault diagnosis.
M8000
M8049
RUN monitor
4
Devices
in Detail
For example, when an external fault diagnosis circuit shown in the figure below is created and the contents of
the special data register D8049 are monitored, the smallest number out of the active state relays S900 to
S999 is stored in D8049.
If two or more faults have occurred, the smallest state number having a fault is displayed at first. When the
fault is cleared, the next smallest state number having a fault is stored.
Instruction
List
3. Annunciator type
X001
X002
X004
FNC 46
ANS
T 0
K 10
S900
FNC 46
ANS
T 1
K 20
S901
FNC 46
ANS
T 2
K100
S902
Y010
7
Basic
Instruction
M8048
6
Before
Programming
X003
X000
Specified the
Device &
Constant
Y000
8
FNC 47
ANRP
FNC00-FNC09
Program Flow
X005
9
FNC10-FNC19
Move & Compare
While the special auxiliary relay M8049 is not driven, annunciator type state relays can be used as latched
(battery backed) type state relays in sequence programs in the same way as general type state relays.
In the SFC programming mode in the FX-PCS/WIN(-E), however, S900 to S999 cannot be programmed as a
processes flow in SFC diagrams.
10
FNC20-FNC29
Arith. & Logic
Operation
81
4 Devices in Detail
4.5
Timer [T]
Timers add and count clock pulses of 1 ms, 10 ms, 100 ms, etc. inside the PLC. When the counted value
reaches a specified set value, the output contact of the timer turns on.
A set value can be directly specified by a constant (K) in the program memory, or indirectly specified by the
contents of a data register (D).
4.5.1
Numbers of timers
The table below shows timer (T) numbers. (The numbers are assigned in decimal.)
For 100 ms pulses
0.1 to 3276.7 sec
For 10 ms pulses
0.01 to 327.67 sec
T 0 to T199
200 points
------------Routine program
type
T192 to T199
FX3U/
FX3UC
PLC
T200 to T245
46 points
ms pulses*1
0.001 to 32.767 sec
100 ms pulses*1
0.1 to 3276.7 sec
T246 to T249
4 points for
Interrupt execution
Latched (battery
T250 to T255
6 points
Latched (battery
backed) type*1
For 1 ms pulses
0.001 to 32.767 sec
T256 to T511
256 points
backed) type*1
Timer numbers not used for timers can be used as data registers for storing numeric values.
*1.
4.5.2
T200
K123
Set value
(constant)
A data register
can be
specified also.
1.23 sec
Y000
X000
When the drive input X000 of the timer coil T200 turns ON, the
current value counter for T200 adds and counts clock pulses of
10 ms. When the counted value becomes equivalent to the set
value K123, the output contact of the timer turns on.
In other words, the output contact turns on 1.23 seconds after the
coil is driven.
When the drive input X000 turns OFF or when the power is
turned off the timer is reset and the output contact returns.
Set value
Current
value
Y000
Retentive type
Set value
T250 K345 (constant)
A data register
can be
Y001
specified also.
X001
T250
X002
RST
t1
X001
Current
value
Y001
X002
82
t2
T250
Retentive time
t1 + t2 = 34.5 sec
Set value
When the drive input X001 of the timer coil T250 turns ON, the
current value counter for T250 adds and counts clock pulses of
100 ms. When the counted value becomes equivalent to the set
value K345, the output contact of the timer turns on.
Even if the drive input X001 turns OFF or the power is turned off
during counting, the timer continues counting when the operation
restarts. The retentive operating time is 34.5 seconds.
When the reset input X002 turns ON, the timer is reset and the
output contact is returned.
4 Devices in Detail
Introduction
4.5.3
K100
Overview
FNC 12
MOV
K100
T10
Cautions on routines
2) When a retentive timer for 1 ms pulses (T246 to T249) is used in a subroutine or interrupt routine, note
that its output contact turns on when the first coil instruction is executed after the retentive timer has
reached the set value.
A timer (except interrupt execution type) starts counting when a coil is driven, and its output contact turns on
when the first coil instruction is executed after the timer has reached timeout.
X010
T 0
K12
1.2 sec
timeout
Y010
1st cycle
2nd cycle
"n"th cycle
T 0
Contact is
activated
Y010
ON
"n+1"th cycle
As shown in the above operation diagram, the accuracy of operation of the timer contact after the coil is
driven until the contact turns on is shown in the following outline:
: 0.001 sec (timer for 1 ms), 0.01 sec (timer for 10 ms) or 0.1 sec (timer for 100 ms)
T : Timer set value (sec)
T0: Operation cycle (sec)
If the contact is programmed before the timer coil, "+2T0" is obtained in the worst case.
When the timer set value is "0", the output contact turns on when a coil instruction is executed in the next
cycle. An interrupt execution type timer for 1 ms pulses counts clock pulses of 1 ms as an interrupt
processing after a coil instruction has been executed.
9
FNC10-FNC19
Move & Compare
+T0
FNC00-FNC09
Program Flow
T 0
7
Basic
Instruction
6
Before
Programming
5
Specified the
Device &
Constant
1) Use timers T192 to T199 in subroutines and interrupt routines. These timers execute counting when a
coil instruction or END instruction is executed.
When such a timer reaches the set value, its output contact turns on when a coil instruction or END
instruction is executed.
Because general type timers execute counting only when a coil instruction is executed (Refer to "4.5.5
Details of timer operation and timer accuracy" below.), they do not execute counting and do not operate
normally if they are used in subroutines or interrupt routines in which a coil instruction is executed only in
a certain condition.
4.5.5
Devices
in Detail
4.5.4
D5
D5 = K100
10-second
timer
Instruction
List
X003
D 5
10
FNC20-FNC29
Arith. & Logic
Operation
83
4 Devices in Detail
4.5.6
Off-delay timer
X001
T5
X001
Y000
Y000
X001
T 5
T5
Y000
K200
(20 sec)
X001
T2
T 1
K20
T 2
K10
T 1
2
sec
T1
1
2
sec sec
T2 T1
Y000
T 2
(
Y000
One
operation
cycle
In addition, the flicker operation can be performed by the ALT (FNC 66) instruction.
FNC 65
STMR
T 10
K100
D
M0
X000
M0
10
sec
10
sec
M0 is an off-delay timer.
M1
10
sec
10
sec
10
sec
M2
M3
Flicker timer
X000
X000
M 3
FNC 65
STMR
T 10
K100
M0
M 2
M 1
In addition, the timer time can be set according to the switch input time by the teaching timer instruction
TTMR (FNC 64).
84
4 Devices in Detail
3
Instruction
List
*1
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
High
Low
16 bits
order
order
b15 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 b0
Sign
0: Positive
number
1: Negative
number
*1 The sign is valid only when a timer is handled as a substitute for data register.
4
Devices
in Detail
2) 32-bit
1,073,741,824
536,870,912
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
Low
High
32 bits
order
order
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
b31
b0
5
Specified the
Device &
Constant
Sign
0: Positive
number
1: Negative
number
2
Overview
In timers, the output contact operating in accordance with the set value is used in some cases, and the
present value is used as numeric data for control in other cases.
The figures below show the structure of the timer present value registers. When a timer number is specified
in an operand of an applied instruction, the timer is handled as a device storing 16-bit or 32-bit data in the
same way as data registers.
Introduction
4.5.7
For the full use of timers as numeric devices, refer to the explanation of applied instructions later.
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
85
4 Devices in Detail
4.6
Counter [C]
4.6.1
Numbers of counters
The table below shows counter (C) numbers. (Numbers are assigned in decimal.)
For high speed counters, refer to Section 4.7.
16-bit up counter
Counting range: 0 to 32767
FX3U/
FX3UC
PLC
General type
General type
C 0 to C 99
C100 to C199
C200 to C219
C220 to C234
100 points*1
100 points*2
20 points*1
15 points*2
*1.
This area is not latched (battery backed). It can be changed to a latched (battery backed) area by
setting the parameters.
*2.
This area is latched (battery backed). It can be changed to a non-latched (non-battery-backed) area
by setting the parameters.
Counter numbers not used as counters can be converted as data registers for storing numeric values.
4.6.2
Features of counters
The table below shows the features of 16-bit counters and 32-bit counters. They can be used in accordance
with the operating condition such as the counting direction switching and counting range, etc.
Item
4.6.3
16-bit counter
32-bit counter
Counting direction
Up-counting
Set value
1 to 32767
2,147,483,648 to +2,147,483,647
Output contact
Reset operation
When RST instruction is executed, current value of counter is reset to "0" and output contact
returns
16 bits
32 bits
86
Counter No.
Counting
direction
switching
relay
Counter No.
Counting
direction
switching
relay
Counter No.
Counting
direction
switching
relay
Counter No.
Counting
direction
switching
relay
C200
C201
M8200
C210
M8201
C211
M8210
C220
M8220
C230
M8230
M8211
C221
M8221
C231
C202
M8202
M8231
C212
M8212
C222
M8222
C232
M8232
C203
C204
M8203
C213
M8213
C223
M8223
C233
M8233
M8204
C214
M8214
C224
M8224
C234
M8234
C205
M8205
C215
M8215
C225
M8225
C206
M8206
C216
M8216
C226
M8226
C207
M8207
C217
M8217
C227
M8227
C208
M8208
C218
M8218
C228
M8228
C209
M8209
C219
M8219
C229
M8229
4 Devices in Detail
Introduction
4.6.4
X010
X011
C 0
X010
X011
C 0
Y000
K10
Set value (constant)
It can be specified
indirectly also.
Current
value
1
10
Y000
The counter set value can be set by a constant (K) as shown above, or indirectly specified by a data
register number. For example, when D10 is specified and the contents of D10 are "123", it is equivalent to
"K123".
In a latch type counter, the current value, output contact operation and reset status of the counter are
latched (battery backed) by the battery built in the PLC.
For details on backup methods against power failure, refer to Section 2.6.
The valid set range of 32-bit binary bi-directional counters is from 2,147,483,648 to +2,147,483,647 (decimal
constant). The counting direction (up or down) is specified by special auxiliary relays M8200 to M8234.
When M8UUU is driven for CUUU, a counter executes down-counting. When M8UUU is not driven, a
counter executes up-counting. (Refer to the previous page.)
8
FNC00-FNC09
Program Flow
The set value (positive or negative) can be specified by a constant (K) or the contents of data registers (D).
When data registers are used, 32-bit data composed of paired serial devices are treated as set values.
For example, when D0 is specified, D1 and D0 provide a 32-bit set value.
7
Basic
Instruction
2. General type and latched (battery backed) type 32-bit bi-directional counters
6
Before
Programming
If data beyond the set value is written to the current value register by MOV instruction, etc., the OUT coil
turns ON and the current value register becomes the set value when the next counting input is received.
Specified the
Device &
Constant
Devices
in Detail
C 0
RST
3
Instruction
List
Every time the coil C0 is driven by the counting input X011, the current value of the counter increases.
When a coil instruction is executed 10 times, the output contact turns on.
After that, the current value of the counter does not change even if the counting input X011 turns on after
that.
When the RST input X010 turns ON and then RST instruction is executed, the current value of the counter
is reset to "0" and the output contact returns.
2
Overview
In general type counters, the counter value is cleared when the PLC turns off. In latch type counters,
however, the counter value just before power failure is stored (backed up by the battery); The counter
value in the subsequent operations can be added to the last counter value.
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
87
4 Devices in Detail
When the coil C200 is driven by the counting input X014, a counter starts up-counting or down-counting.
When the current value of a counter increases from "6" to "5", the output contact is set. When the
current value decreases from "5" to "6", the output contact is reset.
X012
X012
M8200
Up counting
Down counting
X013
X013
RST
X014
C200
3
Current
2
value
1
0
X014
C200
Up counting
K-5
45 4
C200
Y001
Y001
0
2
34
5
6
7
43
5
6
7
The current value increases or decreases regardless of the operation of the output contact. When a
counter executes up-counting from "+2,147,483,647", the counter value becomes "2,147,483,648". In the
same way, when a counter executes down-counting from "2,147,483,648", the counter value becomes
"+2,147,483,647". (This type of counter is called ring counter.)
When the reset input X013 turns ON and then RST instruction is executed, the current value of the counter
is reset to "0" and the output contact returns.
In a latch type counter, the current value, output contact operation and reset status of the counter are
latched (battery backed) by the battery built in the PLC.
For details on backup methods against power failure, refer to Section 2.6.
A 32-bit counter can be used as a 32-bit data register. 32-bit counters cannot be handled as target devices
in 16-bit applied instructions.
If data beyond the set value is written to the current value register by DMOV instruction, etc., the counter
continues counting and the contact does not change when the next counting input is received.
4.6.5
K100
FNC 12
MOV
K100
D 5
X003
C0
D5
D5 = 100
100 counts
88
4 Devices in Detail
1
Introduction
2. 32-bit counter
1) Specification by constant (K)
X003
C200
K43,210
2
Overview
FNC 12
DMOV
K43210
D5(D6)
X003
4.6.6
D5(D6)
Instruction
List
C200
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
*1
Basic
Instruction
High
Low
16 bits
order
order
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
b15
b0
Sign
0: Positive
number
1: Negative
number
*1. The sign is valid only when a counter is handled as a substitute for data register.
8
FNC00-FNC09
Program Flow
2) 32-bit
High
Low
32 bits
order
order
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
b0
b31 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
1,073,741,824
536,870,912
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
9
FNC10-FNC19
Move & Compare
Sign
0: Positive
number
1: Negative
number
6
Before
Programming
Counters use output contacts operating in accordance with the set value or use the counter value (current
value) as numeric data for control.
The figure below shows the structure of the current value register of a counter. When a counter number is
specified in an operand of an applied instruction in execution, the counter is handled as a device storing 16-bit
or 32-bit data in the same way as data register.
A 32-bit counter is handled as 32-bit data.
5
Specified the
Device &
Constant
4.6.7
4
Devices
in Detail
Counters execute counting by cyclic operating for contact operations of internal signals X, Y, M, S, C, etc.
inside the PLC.
For example, when X011 is specified as counting input, its ON duration and OFF duration should be longer
than the cycle time of the PLC (which is tens of Hz or less usually).
On the other hand, high speed counters described later execute counting as an interrupt processing for
specific input, and can execute counting at 5 k to 6 kHz regardless of the cycle time.
For high speed counters, refer to Section 4.7.
10
FNC20-FNC29
Arith. & Logic
Operation
89
4 Devices in Detail
C 20
D 10
FNC 10
CMP
K100
C 30
FNC 18
BCD
C 10 K2Y000
FNC 22
MUL
C 5
FNC 12
DMOV
C200 D0(D1)
FNC 11
DZCP
K 2
M 0
D4(D5)
*1
M10
*1. Make sure to use 32-bit operation instructions for 32-bit counters.
90
4 Devices in Detail
4.7.1
Introduction
4.7
The main unit has built-in 32-bit high speed bi-directional counters (1-phase 1-count, 1-phase 2-count and 2phase 2-count). These high speed counters are classified into hardware type or software type according to
the counting method. Some high speed counters are capable of using an external reset input terminal and an
external start input terminal (for counting start).
Overview
4
Devices
in Detail
Software counters: These types of counters execute counting as CPU interrupt processing.
It is necessary to use each software counter within both limitations of maximum
response frequency and total frequency.
For the limitation of response frequency depending on the total frequency,
refer to Subsection 4.7.10.
Instruction
List
Hardware counters: These types of counters execute counting by hardware, but may be switched to
software counters depending on the operating condition.
For the condition handled as software counters,
refer to Subsection 4.7.9.
1-phase
1-count input
Counting direction
Down-count or up-count is specified
by turning on or off M8235 to
M8245.
ON: Down-counting
OFF: Up-counting
UP/DOWN
+1
+1
UP
1-phase
2-count input
DOWN
A phase
A phase
+1
+1
B phase
Down-counting
1 1 1 1 1
+1 +1 +1 +1 +1
A phase
A phase
B phase
B phase
+1 +1 +1 +1
Up-counting
1 1 1 1
Down-counting
*1.
A rotary encoder adopting the output method shown above may not operate correctly depending on
the electrical compatibility. Check the specifications before connecting an encoder.
91
10
FNC20-FNC29
Arith. & Logic
Operation
Output method of encoder which can be directly connected Open collector transistor output method compatible with 24V
to input terminal in main unit
DC
Output method of encoder which can be directly connected Differential line driver output method
(output voltage: 5V DC or less)
to input terminal in FX3U-4HSX-ADP
FNC10-FNC19
Move & Compare
General-purpose inputs X000 to X007 are used for high speed counter inputs. An encoder*1 adopting the
output method shown in the table below can be connected depending on the connected terminal.
Encoders adopting the voltage output method and absolute encoders cannot be connected to high speed
counter inputs.
For the wiring, refer to the Hardware Edition of the main unit.
FNC00-FNC09
Program Flow
4 edge
count
B phase
Up-counting
2-phase
2-count
input
Basic
Instruction
1 edge
count
6
Before
Programming
+1
Specified the
Device &
Constant
4 Devices in Detail
Counter No.
External reset
input terminal
External start
input terminal
Not provided
Not provided
Provided*5
Not provided
Provided*5
Provided
Not provided
Not provided
Provided*5
Not provided
Provided*5
Provided
Edge count
Data length
C235*2
C236*2
C237*2
Hardware
C238*2
counter*1
C239*2
1-phase
1-count
input
C240*2
*3
C244(OP)
Software counter
C245(OP)*3
C241
C242
C243
C244*3
C245*3
1-phase
2-count
input
Hardware
C246*2
counter*1
C248(OP)*2*3
C247
Software counter
Hardware
counter*1
2-phase
2-count
input
C248*3
C249
C250
C251*2
C253*2
C252
Software counter
C253(OP)*6
C254
C255
92
32-bit
bi-directional
counter
32-bit
bi-directional
counter
1*4
Not provided
4*4
Not provided
1*4
4*4
1*4
4*4
1*4
4*4
1*4
4*4
Provided*5
32-bit
bi-directional
counter
Provided*5
Not provided
Not provided
Provided*5
Provided
*1.
They are handled as software counters depending on the operating condition. When they are handled
as software counters, they have limitations on both maximum response frequency and total
frequency.
For the condition handled as software counters,
refer to Subsection 4.7.9.
For the total frequency, refer to Subsection 4.7.10.
*2.
*3.
C244, C245 and C248 are usually used as software counters, but can be used as hardware counters
C244 (OP), C245 (OP) and C248 (OP) by combining a special auxiliary relay (M8388, M8390 to
M8392).
For the method to switch the counter function, refer to Subsection 4.7.7.
*4.
2-phase 2-input counter is usually 1 edge count counter, but can be used as a 4 edge count counter by
combining a special auxiliary relay (M8388, M8198 or M8199).
For the method to use a 2-phase 2-input 4 edge count counter,
refer to Subsection 4.7.8.
*5.
The external reset input is usually reset by turning ON, but can be changed to be reset by turning OFF
by combining special auxiliary relays (M8388 and M8389).
For the method to change the logic of the external reset input, refer to Subsection 4.7.6.
*6.
The counter C253 is usually used as a hardware counter, but can be used as the counter C253 (OP)
not equipped with reset input by combining special auxiliary relays (M8388 and M8392).
In this case, C253 (OP) is handled as a software counter.
4 Devices in Detail
For some high speed counters in FX3U and FX3UC PLCs, the assignment of input terminals will switch when
special auxiliary relays are used.
Such high speed counter devices are classified below. Note that description as (OP) is not available in
programming.
Switched Device Numbers
Standard Device
Numbers
C244
C244(OP)
C248
C248(OP)
C245
C245(OP)
C253
C253(OP)
2
Overview
Standard Device
Numbers
Introduction
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
93
4 Devices in Detail
4.7.2
*2
C235
H/W
C236*1
H/W*2
*1
*2
C237
C239
H/W
C240*1
H/W*2
C241
S/W
C242
S/W
C243
S/W
C244
S/W
*3
X004
X005
U/D
U/D
U/D
U/D
U/D
R
U/D
R
U/D
U/D
S
U/D
H/W
U/D
S/W
C245(OP)*3
H/W*2
C246*1
H/W*2
C247
S/W
C248
S/W
C248(OP)*1*3
H/W*2
C249
S/W
C250
S/W
H/W
X007
U/D
*2
*2
X006
U/D
C245
C251
S
U/D
R
U
C253*1
H/W*2
C253(OP)*3
S/W
C254
S/W
C255
S/W
S/W
C252
94
X003
*2
*1
2-phase
2-count
input*4
X002
H/W
*1
1-phase
2-count
input
X001
*2
C238
C244(OP)
H/W
*1
1-phase
1-count
input
Classification
S
R
U: Up-counting input
D: Down-counting input
R: External reset input S: External start input
*1.
*2.
Hardware counters are switched to software counters when a comparison set/reset instruction for high
speed counter (DHSCS, DHSCR, DHSZ or DHSCT) is used.
The counter C253 is switched to a software counter when the logic of the external reset input signal is
reversed.
For the condition under which it is handled as a software counter, refer to Subsection 4.7.9.
*3.
When a special auxiliary relay is driven in a program, the input terminals and their associated
functions are switched.
For the method to use a software counter as a hardware counter, refer to Subsection 4.7.7.
*4.
In a 2-phase 2-count input counter, the edge count is usually 1. But the edge count can be set to 4 by
combining a special auxiliary relay.
For the method on how to use a 2-phase 2-count input counter with on edge count of 4,
refer to Subsection 4.7.8.
4 Devices in Detail
Since the FX3U-4HSX-ADP and FX3UC PLC main unit share the same assigned input terminal numbers,
only one of them may be used in operation. If both input terminals are used, intended operation is not
enabled because the inputs of the FX3U-4HSX-ADP and PLC main unit operate in an "OR" relationship.
Instruction
List
4.7.3
Down/up count
M8235
RST
Reset
C235
X012
K-5
C235
X010
X011
RST
Reset
C244
X012
D0(D1)
C244
Operation example
The counter C235 shown above operates as follows:
X010
Up counting
Reset input
X012
Start input
Basic
Instruction
X011
Up counting
Down counting
X000
3
C235
2
Current 1
value 0
0
1
0
2
6
7
4
5
FNC10-FNC19
Move & Compare
FNC00-FNC09
Program Flow
Counting
input
6
Before
Programming
5
Specified the
Device &
Constant
Down/up count
M8244
4
Devices
in Detail
X011
2
Overview
Inputs X000 to X007 are used for high speed counters, input interrupt, pulse catch, SPD/ZRN/DSZR/DVIT
instructions and general-purpose inputs. When assigning functions, there should be no overlap between
those input terminals.
For example, when C251 is used, X000 and X001 are occupied. As a result, "C235, C236, C241, C244,
C246, C247, C249, C252 and C254", "input interrupt pointers I000 and I101", "pulse catch contacts M8170
and M8171" and "SPD, ZRN, DSZR and DVIT instructions using X000 and/or X001" cannot be used.
Introduction
When counting with input X000, C235 executes up-count or down-count as an interrupt.
When the current value of a counter increases from "6" to "5", the output contact is set. When the
current value decreases from "5" to "6", the output contact is reset.
10
FNC20-FNC29
Arith. & Logic
Operation
95
4 Devices in Detail
4.7 High Speed Counter [C]
The current value increases or decreases without regard to the operation of the output contact. When a
counter executes up-count from "+2,147,483,647", the counter value becomes "2,147,483,648". In the
same way, when a counter executes down-count from "2,147,483,648", the counter value becomes
"+2,147,483,647". (This type of counter is called a ring counter.)
When the reset input X011 turns ON and RST instruction is executed, the current value of the counter is
reset to "0" and the output contact is restored.
In a latch type high speed counter, the current value, output contact operation and reset status of the
counter are latched (battery backed) by the backup battery built in the PLC.
C246
D2(D3)
Set value is (D3,D2)
X011
RST
X012
C249
C249
K1234
C251
K1234
Y002
Y003
C251
M8251
X011
RST
C254
X012
C254
C254
Y004
M8254
Y005
D0(D1)
96
4 Devices in Detail
A phase
A phase
+1
+1
B phase
Up-counting
Overview
B phase
Down-counting
+1 +1 +1 +1 +1
A phase
B phase
B phase
3
Instruction
List
A phase
+1 +1 +1 +1
Up-counting
1 1 1 1
Down-counting
The down/up-count operation of C251 to C255 can be checked with M8251 to M8255.
ON status: Down-counting
OFF status: Up-counting
Devices
in Detail
4.7.4
1
Introduction
A 2-phase encoder generates outputs for the A phase and B phase by a phase difference of 90. With
these outputs, a high speed counter automatically executes up-count and down-count as shown in the
figure below.
- When the counter is operating at the 1 edge count
Software counter
Instruction
HSCS
Can be used up to 32 times including HSCT instruction.
HSZ*1
HSCT*1
*1.
97
10
FNC20-FNC29
Arith. & Logic
Operation
When HSZ or HSCT instruction is used, the maximum response frequency and total frequency of
all software counters are affected.
For the maximum response frequency and total frequency of software counters,
refer to Subsection 4.7.10.
FNC10-FNC19
Move & Compare
HSCR
8
FNC00-FNC09
Program Flow
2) Using comparison instructions for high speed counters (HSCS, HSCR, HSZ or HSCT)
The comparison instructions for high speed counters (HSCS, HSCR, HSZ and HSCT) execute a
comparison and output the comparison result during high speed counting. The number of times these
instructions can be used is limited as shown in the table below.
When an output relay is specified for the comparison result, the comparison result is directly updated at
the ON/OFF status of the output regardless of the output refresh by END instruction.
Mechanical operation delay (about 10 ms) cannot be avoided in a relay output type PLC. Use a transistor
output type PLC.
7
Basic
Instruction
*1.
6
Before
Programming
The following two methods are available to compare and output the current value of a high speed counter.
5
Specified the
Device &
Constant
A high speed counter executes up-count or down-count when a pulse is input to its input terminal, but the
current value is updated at the timing shown in the table below. When using the current value of a hardware
counter in a MOV, CMP or applied instruction such as the comparison instruction, special care must be taken
since the current value update timing is affected by the ladder scans as shown in the table.
4 Devices in Detail
4.7.5
Related devices
1. Devices used to switch the counting direction of 1-phase 1-count input counters
Type
Counter No.
Specifying device
C235
M8235
C236
M8236
C237
M8237
C238
M8238
C239
M8239
C240
M8240
C241
M8241
C242
M8242
C243
M8243
C244
M8244
C245
M8245
1-phase
1-counting input
Up-counting
Down-counting
OFF
ON
2. Devices used to check the counting direction of 1-phase 2-count input counters and
2-phase 2-count input counters
Type
Counter No.
Monitoring device
C246
M8246
C247
M8247
C248
M8248
C249
M8249
C250
M8250
C251
M8251
C252
M8252
C253
M8253
C254
M8254
C255
M8255
1-phase
2-counting input
2-phase
2-counting input
OFF
ON
Up-counting
Down-counting
Name
Description
M8388
M8389
M8390
M8391
M8392
M8198
Switches the edge count (between 1 and 4) of C251, C252 and C254.
(For details, refer to Subsection 4.7.8.)
M8199
Switches the edge count (between 1 and 4) of C253, C255 and C253 (OP).
(For details, refer to Subsection 4.7.8.)
Description
M8380
Operation status of C235, C241, C244, C246, C247, C249, C251, C252 or C254
M8381*1
M8382*1
M8383*1
M8384*1
M8385*1
M8386*1
M8387*1
*1.
98
Name
ON
OFF
Software
counter
Hardware
4 Devices in Detail
M8388
M8389
C241 to C245
C247 to C250
C252 to C255
C2
K{{{
Description
The logic of the external reset input is
inverted so that the counters are reset
when the input turns OFF.
(The logic is inverted for all target
counters.)
The counter C253 is switched to a software counter when the logic of the external reset input signal is
inverted.
The assignment of the input terminal and the function of the software counters C244, C245, C248 and C253
are changed as shown below when combined with the following special auxiliary relays.
In a program, put a special auxiliary relay just before a target counter.
When using software counter as hardware counter
M8390
C244(OP)
C244
K{{{
M8388
C245(OP)
C245
K{{{
M8388
C248(OP)
Basic
Instruction
M8392
C248
K{{{
M8388
M8392
FNC00-FNC09
Program Flow
C253(OP)
6
Before
Programming
M8391
Specified the
Device &
Constant
M8388
Description
Devices
in Detail
Counter No.
3
Instruction
List
Caution
4.7.7
2
Overview
Counter No.
Introduction
4.7.6
C253
K{{{
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
99
4 Devices in Detail
4.7.8
Description
M8000
M8198
C251
C251
K{{{
M8000
M8198
C252
A phase
+1
Up-counting
C252
K{{{
M8000
M8199
C253
A phase
B phase
C253
K{{{
M8000
Down-counting
M8199
C253(OP)
+1
B phase
M8388
+1 +1 +1 +1 +1
A phase
M8392
B phase
+1 +1 +1 +1
Up-counting
C253
K{{{
1 1 1 1 1
M8000
M8198
C254
B phase
C254
K{{{
M8000
M8199
C255
C255
K{{{
100
A phase
1 1 1 1
Down-counting
4 Devices in Detail
Hardware
counter No.
K{{{
DHSCS K100
4
Devices
in Detail
C235
3
Instruction
List
Because hardware counters execute counting at the hardware level of the FX3U/FX3UC, they can
execute counting regardless of the total frequency.
However, when hardware counters are handled as software counters with the following conditions, their
maximum response frequency and total frequency are limited in the same way as the software counters.
Use M8380 to M8387 to check whether high speed counters are handled as hardware counters or
software counters.
When DHSCS (FNC 53), DHSCR (FNC 54), DHSZ (FNC 55) or DHSCT (FNC280) instruction is used
for a hardware counter number, the hardware counter is handled as a software counter.
Example: C235
C235 Y000
When an index register is used for a counter number specified in DHSCS (FNC 53), DHSCR
(FNC 54), DHSZ (FNC 55) or DHSCT (FNC280) instruction, all hardware counters are handled as
software counters.
Example: C235Z0
5
Specified the
Device &
Constant
C235
C236
C237
C238
C239
C240
C244(OP)
C245(OP)
C246
C248(OP)
C251
C253
2
Overview
Introduction
4.7.9
M8388
6
Before
Programming
C253 (hardware counter) is handled as a software counter by inverting the logic using the external
reset input signal logic changing function.
Example: The logic of the C253 external reset input signal is inverted.
For logic inversion of the external reset input signal, refer to Subsection 4.7.6.
M8389
7
Basic
Instruction
C253
K{{{
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
101
4 Devices in Detail
Counter No.
1 edge count
4 edge count
Main unit
100 kHz
C244(OP), C245(OP)
10 kHz
C246, C248(OP)
100 kHz
C251, C253
FX3U-4HSX-ADP
200 kHz
50 kHz
100 kHz
50 kHz
100 kHz
Software
counter
Counter type
C241,
C242,
C243,
1-phase
C244,
1-counting input
C245
Following
software
counter with
HSCS, HSCR,
HSZ or HSCT
instruction*1
Magnification for
calculating
total
frequency
Maximum
Maximum
Total
Total
response
response
frequency
frequency
frequency
frequency
(kHz)
(kHz)
(kHz)
(kHz)
C235, C236,
C237, C238,
C239, C240
40
30
C244(OP),
C245(OP)
10
10
C247,
C248,
1-phase
2-counting input C249,
C250
C246,
C248(OP)
40
30
40
30
10
7.5
1 edge
2phase count C252,
C253(OP),
2C251, C253
count- 4 edge C254,
ing
count C255
input
102
80
60
Total
frequency
(kHz)
40 - (Number of
80
instruc1.5(Num
tion)*2
ber of
instruction)
(40-Number of
instruction) 4
30-(Number
of instruction)*2
Total
frequency
(kHz)
60
1.5(Num
ber of
instruction)
(30-Number
of instruction)
4
*1.
When an index register is added to a counter number specified by a HSCS, HSCR, HSZ or HSCT
instruction, all hardware counters are switched to software counters.
*2.
The high speed counters C244 (OP) and C245 (OP) can count up to 10 kHz.
4 Devices in Detail
Counter type
Software
counter
Magnification for
calculating
total
frequency
Maximum
Maximum
Total
Total
response
response
frequency
frequency
frequency
frequency
(kHz)
(kHz)
(kHz)
(kHz)
C235, C236,
C237, C238,
C239, C240
30
25
C244(OP),
C245(OP)
10
10
C246,
C248(OP)
30
25
30
25
7.5
6.2
C247,
C248,
1-phase
2-counting input C249,
60
50
Total
frequency
(kHz)
30 - (Number of
50
instruc1.5(Num
tion)*2
ber of
instruction)
25-(Number
of instruction)*2
Total
frequency
(kHz)
3
50
1.5(Num
ber of
instruction)
Instruction
List
Following
software
counter with
HSCS, HSCR,
HSZ or HSCT
instruction*1
Overview
C241,
C242,
C243,
1-phase
C244,
1-counting input
C245
Introduction
2) When special analog adapters and FX3U/FX3UC Series special function blocks/units are used
C250
4
(30-Number of
instruction) 4
Devices
in Detail
1 edge
2phase count C252,
C253(OP),
2C251, C253
count- 4 edge C254,
ing
count C255
input
(25-Number
of instruction)
4
When an index register is added to a counter number specified by a HSCS, HSCR, HSZ or HSCT
instruction, all hardware counters are switched to software counters.
*2.
The high speed counters C244 (OP) and C245 (OP) can count up to 10 kHz.
C237
Operates as
software counter
C241
Software counter
40 6 (times) = 34 kHz
20 kHz
40 6(times) = 34 kHz
4 kHz
HSZ
instruction 6
times
8
FNC00-FNC09
Program Flow
C253(OP)
[4 edge count]
30 kHz
Used
instruction
Basic
Instruction
Magnification
for calculating
total frequency
6
Before
Programming
4. Calculation example
Input
Maximum response frequency
frequency
calculation
5
Specified the
Device &
Constant
*1.
1) The total frequency is calculated as follows because HSZ instruction is used 6 times:
Total frequency
= 80 1.5 6 = 71 kHz
2) The sum of the response frequencies of the high speed counters
being used is calculated as follows:
"30 kHz 1[C237]" + "20 kHz 1[C241]" + "4kHz 4[C253(OP)]" = 66 kHz 71 kHz
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
103
4 Devices in Detail
If the operation of a high speed counter is triggered by a device such as a switch, the counter may
malfunction due to extra noise from switch chattering or contact bounce.
The input filter of an input terminal for a high speed counter in the main unit is automatically set to 5 s
(X000 to X005) or 50 s (X006 and X007).
Accordingly, it is not necessary to use the REFF instruction or special data register D8020 (input filter
adjustment).
The input filter for input relays not being used for high speed counters remains at 10 ms (initial value).
The inputs X000 to X007 are used for high speed counters, input interrupt, pulse catch, SPD/DSZR/DVIT/
ZRN instructions and general-purpose inputs. There should be no overlap between each input number.
For example, when C251 is used, X000 and X001 are occupied. As a result, "C235, C236, C241, C244,
C246, C247, C249, C252 and C254", "input interrupt pointers I00* and I10*", "pulse catch contacts M8170
and M8171" and "SPD instruction using X000 and/or X001" cannot be used.
When a counting pulse is not provided, none of the high speed counter output contacts will turn ON, even
if the PLC executes an instruction where "present value = set value."
Counting may be started or stopped for a high speed counter when the output coil (OUT C***) is set to ON
or OFF. Program this output coil in the main routine. If the output coil is programmed in a step ladder
(SFC) circuit, subroutine or interrupt routine, counting cannot be started or stopped until the step ladder or
routine is executed.
Make sure that the signal speed for high speed counters does not exceed the response frequency
described above. If an input signal exceeds the response frequency, a WDT error or parallel link
malfunction may occur.
When a high speed counter is reset by the RST instruction, it cannot count until the RST instruction is set
to OFF.
1) Program example
X010
RST
C235
2) Timing chart
X000
Current
value of C235
X010
RST
C235
104
4 Devices in Detail
3) Program example
X010*
FNC 12
DMOV
K0
C235
1
Introduction
Write the following program to "reset only the current value of a high speed counter (and does not turn OFF
the contact)".
Overview
* When the driving contact is the continuous execution type, the current value of the counter is reset to "0"
at each scan while X010 remains ON.
4) Timing chart
X000
3
1
Instruction
List
Current
value of C235
X010
Devices
in Detail
Write the following program to "turn OFF the contact and reset the current value of a high speed counter".
X010*
M8001
RST
C235
----- A
RST
C235
----- B
Specified the
Device &
Constant
5) Program example
* When the driving contact is the continuous execution type, the current value of the counter is reset to "0"
and the counter reset status is cleared at each scan while X010 remains ON.
Before
Programming
RUN Monitor
(normally OFF)
6) Timing chart
X000
Basic
Instruction
Current
value of C235
X010
8
FNC00-FNC09
Program Flow
RST
C235
Counter reset instruction is
deactivated
(part B in above program).
9
FNC10-FNC19
Move & Compare
Counter is reset
(part A in above
program).
10
FNC20-FNC29
Arith. & Logic
Operation
105
4 Devices in Detail
4.8
4.8.1
FX3U/
FX3UC
PLC
General
type
D0 to D199
D200 to D511
D512 to D7999
200 points*1
312 points*2
7488 points*3*4
Special type
File registers
(latched (battery
backed) type)
D8000 to D8511
D1000*4 and later
512 points
7000 points maximum
*1.
This area is not latched (battery backed). It can be changed to the latched (battery backed) area by
setting parameters.
*2.
This area is latched (battery backed). It can be changed to the non-latched (non-battery-backed) area
by setting parameters.
*3.
*4.
Data registers D1000 and later can be used as file registers in units of 500 points by setting
parameters.
When computer link PCs or parallel link is used, some data registers are occupied for the link.
Refer to the Data Communication Edition.
106
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
Sign
0: Positive
number
1: Negative
number
4
Devices
in Detail
2) 32-bit type
Two serial data registers or file registers can express 32-bit data.
- A data register with a larger device number handles high-order bits, and a data register with a smaller
device number handles low-order bits.
- In the index type, V handles high-order bits, and Z handles low-order bits.
Two data registers or file registers can store a numeric value within the range from -2,147,483,648 to
+2,147,483,647.
Instruction
List
A numeric value can be read from or written to a data register by an applied instruction usually.
Or a numeric value can be directly read from or written to a data register from a display unit, display
module, or programming tool.
1,073,741,824
536,870,912
268,435,456
134,217,728
67,108,864
33,554,432
16,777,216
8,388,608
4,194,304
2,097,152
1,048,576
524,288
262,144
131,072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
Specified the
Device &
Constant
D1 (high-order 16 bits)
D0 (low-order 16 bits)
High
Low
order 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 order
b31
b0
Sign
0: Positive
number
1: Negative
number
2
Overview
D 0 (16 bits)
High
Low
order 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 order
b0
b15
Introduction
4.8.2
4 Devices in Detail
6
Before
Programming
In the case of 32-bit type, when a data register or file register on the low-order side (example: D0) is
specified, the subsequent number on the high-order side (example: D1) is automatically occupied.
Either an odd or even device number can be specified for the low-order side, but it is recommended to
specify an even device number for the low-order side under consideration of the monitoring function of
display units, display modules, and programming tools.
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
107
4 Devices in Detail
4.8.3
FNC 40
ZRST
D512
D999
FNC 12
MOV
FNC 07
WDT
K250
D8000
For the data backup characteristics of special data registers, refer to Section 2.6 and Chapter 36.
For the types and functions of special data registers, refer to Chapter 36.
108
4 Devices in Detail
T 2
D0
C 10
D 20
3
Instruction
List
C 2
Devices
in Detail
FNC 12
MOV
C 10
D 4
16-bit
K200
D 10
32-bit
K80000 D10(D11)
D 20
Basic
Instruction
FNC 12
MOV
K300
T 10
FNC 12
MOV
T 10
C 20
K300
As in the case of data registers, when 16-bit timers or counters are used as 32-bit devices, two timers or
two counters (example: C1 and C0) store 32-bit numeric data.
One 32-bit counter (example: C200) can store 32-bit numeric data.
FNC10-FNC19
Move & Compare
C 20
8
FNC00-FNC09
Program Flow
6
Before
Programming
FNC 12
DMOV
5
Specified the
Device &
Constant
2
Overview
Introduction
3. Operation examples
10
FNC20-FNC29
Arith. & Logic
Operation
109
4 Devices in Detail
4.8.4
Inside system
RAM
D0
Data
memory
When power
is turned ON
When PLC
Data register
mode is
changed D1000
from STOP
Data register Write
to RUN
[B]
D7999
Data register
Read
Remaining area can be used as latched (battery backed) type data registers
for general purpose.
Transferred contents
Remarks
BMOV
instruction
Applied
instructions
other than
BMOV
instruction
The data stored in data registers set as file registers are automatically copied from the file register area [A]
to the data register area [B] when restoring the power.
110
4 Devices in Detail
Program
memory
D1000
500 points
File register
14 blocks
[A]
maximum
(7000 points
maximum)
Data register
D1499 D1499
[B]
Data register
Inside system
RAM
D0
X001
X003
Data register
S
FNC 15
BMOVP
D1100
BMOV
direction
M8024
inverse:
ON
n
D
D1100
K400
BMOV
M8024 direction
inverse:
OFF
Basic
Instruction
[B]
D7999
Write
Data
register
D1499 D1499
K400
ON
Data
register
D1100
Data
memory
Write
D1100
Before
Programming
D1100 D1100
FNC 15
BMOVP
Specified the
Device &
Constant
D7999
Program/
comment
register
[A]
X002
Data register
Read
Program
memory
File
D1100 D1100
D1000
500 points
14 blocks
maximum
(7000 points
maximum)
Data
memory
BMOV
direction
M8024
inverse:
OFF
n
D
Devices
in Detail
Program/
comment
Read
OFF
3
Instruction
List
2
Overview
2. File register Data register <updating the same number registers by BMOV (FNC 15)
instruction>
1
Introduction
When a file register is monitored from peripheral equipment, the data register area [B] inside the data
memory is read.
When "file register device current value change", "file register device forced reset" or "PLC memory all
clear" is executed from peripheral equipment, the file register area [A] inside the program memory is
changed, and then the data is automatically transferred to the data register area [B].
Accordingly, when file register devices are overwritten, the program memory should be "built-in memory
(RAM)" or "memory cassette (flash memory) whose protect switch is set to OFF". (The memory cassette
(flash memory) cannot be overwritten from peripheral equipment if its protect switch is set to ON.)
When updating the contents of a file register in the same-number update mode, make sure that the file
register numbers at S
and D are equal to each other. Also make sure that the number of transfer
points specified by "n" does not exceed the file register area. If the number of transfer points exceeds the
file register area, an operation error occurs and the instruction is not executed.
9
FNC10-FNC19
Move & Compare
When S
and D
are indexed, the instruction is executed if the actual device number is within the
file register area and if the number of transfer points is within the file register area also.
8
FNC00-FNC09
Program Flow
10
FNC20-FNC29
Arith. & Logic
Operation
111
4 Devices in Detail
D0
Program
memory
D1000
500 points
14 blocks
maximum
(7000 points
maximum)
D200
X001
D599
Data register
D1100
File register
[A]
Data
memory
M8024
OFF
D1100
Write
Program/
comment
Write
Inside system
RAM
Data register
Write
[B]
D1499
D7999
D1499
Data register
FNC 15
BMOVP
D200
D1100
K400
BMOV
M8024 direction
inverse
n
D
S
X000
FNC 15
BMOVP
D1100
D200
K400
M8024(ON) :D1100
M8001
BMOV
M8024
direction
inverse: OFF
Cautions on reading
When a file register (D1000 or later) is specified for the source of BMOV (FNC 15) instruction and the same
number file register is not specified for the destination, the contents of the file register area [A] inside the
program memory are not read.
1) When a file register is specified for the source and a data register is specified for the destination
Inside built-in RAM
memory or
memory cassette
Inside system
RAM
D0
D200
Program
memory
D1000
500 points
14 blocks
maximum
(7000 points
maximum)
112
File register
[A]
Read
Program/
comment
Data
memory
[B]
Data register
FNC 15
BMOVP
D1100
D200
K400
4 Devices in Detail
Program/
comment
[A]
X001
FNC 15
BMOVP
D1100
D1400
K100
Data register
D1100
D1400
Data register
[B]
Data register
3
Instruction
List
D1499
D1499
D7999
D1199
D1400
Write
4.8.5
Data
memory
Write
File register
M8024
OFF
Overview
Program
memory
D1000
500 points
14 blocks
maximum
(7000 points
maximum)
Write
Inside system
RAM
D0
Introduction
2) When file registers of different device numbers are specified for the source and destination
When changing the contents of file registers stored in the flash memory inside the memory cassette, observe
the following condition:
Set to OFF the protect switch in the memory cassette.
2. Cautions on handling file registers in the same-number register update mode in BMOV (FNC
15) instruction
When updating the contents of the same number file register, make sure that the file register number at
S
and D are equal to each other.
If the number of transfer points specified by "n" exceeds the file register area, an operation error (M8067)
occurs and the instruction is not executed.
In the case of indexing
When S
and D are indexed, the instruction is executed if the actual device number is within the
file register area and the number of transfer points is within the file register area also.
7
Basic
Instruction
Make sure that the number of transfer points specified by "n" does not exceed the file register area.
6
Before
Programming
It takes 66 to 132 ms to write data to one serial block (500 points) in 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 insertion of WDT instruction in a user program.
5
Specified the
Device &
Constant
Devices
in Detail
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
113
4.9
4 Devices in Detail
4.9 Extension Register [R] and Extension File Register [ER]
4.9.1
R0 to R32767
32768 points
ER0 to ER32767
FX3U/FX3UC PLC
*1.
4.9.2
32768 points*1
Available only while a memory cassette is mounted (because they are stored in the flash memory
inside a memory cassette.)
Extension register
Reading in program
Writing in program
Display module
Access method
Data change
method
114
4 Devices in Detail
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
A numeric value is usually read from and written to an extension register by applied instructions.
However, a numeric value can also be directly read from and written to an extension register from a
display unit, display module, or programming tool.
5
Specified the
Device &
Constant
Sign
0: Positive
number
1: Negative
number
K0
R0
FNC00-FNC09
Program Flow
K200
FNC 292
INITRP
R0
K2
9
FNC10-FNC19
Move & Compare
When initializing extension registers and extension file registers in sector units
Example: When initializing R0 to R4095 and ER0 to ER4095 (initializing two sectors starting from R0 and
ER0)
Command
Basic
Instruction
The contents of extension registers are backed up by the built-in battery even when the power is turned OFF
or when the PLC mode switches from STOP to RUN.
When initializing the contents of extension registers, clear them using a sequence program or GX Developer.
Command
6
Before
Programming
In the case of 32 bit type, when an extension register on the low-order side (example: R0) is specified, the
subsequent serial number on the high-order side (example: R1) is automatically occupied.
Either an odd or even device number can be specified for the low-order side, but it is recommended to
specify an even device number for the convenience of the monitoring function for display units, display
modules, and programming tools.
4.9.4
4
Devices
in Detail
2) 32-bit type
Two serial extension registers (consisting of 32 bits) can express a 32-bit numeric value ranging from
2,147,483,648 to +2,147,483,647. (A larger number register handles high-order 16 bits, and a smaller
number register handles low-order 16 bits.)
Instruction
List
Sign
0: Positive
number
1: Negative
number
2
Overview
Introduction
4.9.3
10
115
FNC20-FNC29
Arith. & Logic
Operation
Select [Online] [Clear PLC memory...] in GX Developer, and clear [Data device].
This operation initializes the contents of timers, counters, data registers, file registers and extension registers.
4 Devices in Detail
4.9.5
R 0
C 10
R 20
R 5
C 2
C 10
R 4
16 bits
FNC 12
MOV
K200
R 10
32 bits
FNC 12
DMOV
K80000 R10(R11)
116
D 10
R 20
4 Devices in Detail
Instruction
Description
LOADR(FNC290)
This (transfer) instruction reads data of extension file registers (ER)*1 to extension registers (R).
SAVER(FNC291)
This (transfer) instruction writes data of extension registers (R) to extension file registers (ER)*1 in 2048
point (1 sector) units. Use this instruction to store newly created sectors (2048 points) of data to
This instruction initializes extension registers (R) and extension file registers (ER)*1 in 2048 point (1
INITR(FNC292)
sector) units. Use this instruction to initialize extension registers (R) and extension file registers (ER)*1
before starting to log data by the LOGR instruction.
This instruction logs specified data, and writes it to extension registers (R) and extension file registers
LOGR(FNC293)
(ER)*1.
RWER(FNC294)
4
Devices
in Detail
This (transfer) instruction writes specified extension registers (R) to extension file registers (ER)*1.This
instruction is supported in FX3UC PLCs Ver.1.30 or later.Use this instruction to store the contents of any
3
Instruction
List
2
Overview
Extension file registers (ER) are usually used as log data storage destinations and set data storage
destinations.
Extension file registers can be handled only with dedicated instructions shown in the table below. When
using data contents with other instructions, transfer them to an extension register of the same device number,
and then use the extension register.
However, note that extension file registers are available only while a memory cassette is mounted.
Introduction
4.9.6
5
Specified the
Device &
Constant
*1.
supported in FX3UC PLCs Ver.1.30 or later.Use this instruction to initialize extension file registers (ER)*1
before executing SAVER instruction.
Extension file registers are only accessible when a memory cassette is mounted.
R0
R2048
General
applied
instruction R4096
2048
points
LOGR
instruction
INITER
2048
points
LOADR instruction
(point units)
ER0
2048
points
ER2048
2048
points
ER4096
2048
points
R32767
ER32767
16
sectors
9
FNC10-FNC19
Move & Compare
FNC00-FNC09
Program Flow
INITR instruction
(initialization)
(sector units)
R30720
2048
points
1 sector
Basic
Instruction
General-purpose device
(sequence program)
2048
points
SAVER instruction
(sector units)
RWER instruction
(arbitrary number of
points)
6
Before
Programming
Nonvolatile
memory
Programming tool
GX Developer
10
FNC20-FNC29
Arith. & Logic
Operation
117
4 Devices in Detail
4.9.7
Head
device
No.
Device range
Sector
No.
Head
device
No.
Device range
Sector 0
R0
Sector 8
R16384
Sector 1
R2048
Sector 9
R18432
Sector 2
R4096
Sector 10 R20480
Sector 3
R6144
Sector 11 R22528
Sector 4
R8192
Sector 12 R24576
Sector 5
R10240
Sector 13 R26624
Sector 6
R12288
Sector 14 R28672
Sector 7
R14336
Sector 15 R30720
FNC 295
INITERP
R0
K2
FNC 292
INITRP
R0
K2
118
Overview
Introduction
4.9.8
4 Devices in Detail
PLC series
FXCPU
PLC Type
FX3U(C)*1
Instruction
List
4
Devices
in Detail
*1
5
Specified the
Device &
Constant
6
Before
Programming
*1.
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
119
4 Devices in Detail
4.9 Extension Register [R] and Extension File Register [ER]
FX3U(C)*1
*1.
120
4 Devices in Detail
4.9 Extension Register [R] and Extension File Register [ER]
6. Select the data type to be set in the two selection boxes to the right of the [Display] button.
Introduction
5. Input a device number to be set to "Device Label", and click the [Display] button.
2
Overview
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
121
4 Devices in Detail
FX3U(C)*1
*1.
2. Put a check mark next to "MAIN (prepared device memory name)" under "Device memory."
3. Click the "Device data" tab, and add "Ext. file register" to target devices.
By default, "Ext. file register" is not included for reading/writing.
To add it, click the blank space on the left side of "Ext. file register" to change it to "".
In GX Developer Ver.8.18U or later, the range of extension file registers to be written can be specified.
FX3U(C)*1
*1.
122
4 Devices in Detail
The table below shows numbers of index registers (V and Z). (Numbers are assigned in decimal.)
When only "V" or "Z" is specified, it is handled as "V0" or "Z0" respectively.
Index type
16 points
*1
The characteristics related to protection against power failure cannot be changed by parameters.
4
Devices
in Detail
1. 16-bit type
Index registers have the same structures as data registers.
16 bits
V
V0 to V7:
8 points
16 bits
Z
Z0 to Z7:
8 points
Make sure to use Z0 to Z7 when indexing a device in a 32-bit applied instruction or handling a numeric value
outside the 16-bit range.
32 bits
Z1 (low-order side)
V2 (high-order side)
Z2 (low-order side)
V3 (high-order side)
Z3 (low-order side)
V4 (high-order side)
Z4 (low-order side)
V5 (high-order side)
Z5 (low-order side)
V6 (high-order side)
Z6 (low-order side)
V7 (high-order side)
Z7 (low-order side)
FNC 12
DMOV
K300
Z2
7
Basic
Instruction
V1 (high-order side)
Before
Programming
Z0 (low-order side)
Specified the
Device &
Constant
2. 32-bit type
V0 (high-order side)
Instruction
List
*1.
FX3U/FX3UC PLC
2
Overview
Introduction
4.10
K300(V2,Z2)
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
123
4 Devices in Detail
4.10 Index Register [V and Z]
124
4 Devices in Detail
Pointer [P and I]
Introduction
4.11
For branch
P0 to P62
P64 to P4095
4095 points
For counter
interrupt
I00(X000) I30(X003)
I10(X001) I40(X004)
I20(X002) I50(X005)
6 points
I6
I7
I8
3 points
I010 I040
I020 I050
I030 I060
6 points
P63
1 point
P 0
Jump
FNC 01
CALL
P 1
Main program
FNC 02
SRET
Return
Subroutine
program
END
9
FNC10-FNC19
Move & Compare
Label
P63
P 63
FNC00-FNC09
Program Flow
7
Basic
Instruction
FNC 06
FEND
Jump
Before
Programming
Label
P0
Label
P1
Specified the
Device &
Constant
X001
4
Devices
in Detail
The roles and operations of pointers for branch are as described below.
Because all of these pointers are combined with applied instructions, refer to the explanation of each
instruction for the detailed method.
For details on interrupt function, refer to Chapter 35.
3
Instruction
List
FX3U/
FX3UC
PLC
For jump to
END step
2
Overview
The table below shows numbers of pointers (P and I). (Numbers are assigned in decimal.)
When using a pointer for input interrupt, an input number assigned to it cannot be used together with a "high
speed counter" or "speed detection (FNC 56)" which uses the same input range.
10
FNC20-FNC29
Arith. & Logic
Operation
125
4 Devices in Detail
*1.
Input
Interrupt at rising
edge
Interrupt at falling
edge
X000
I001
I000
M8050*1
X001
I101
I100
M8051*1
X002
I201
I200
M8052*1
X003
I301
I300
M8053*1
X004
I401
I400
M8054*1
X005
I501
I500
M8055*1
5 s or more
M8393
FNC 12
MOV
K{{{* D8393
126
4 Devices in Detail
1
FNC 04
EI
Interrupt enabled
range
Introduction
Operations
2
Overview
Pointer for
interrupt
FNC 06
FEND
Rising edge of X000 is detected
FNC 03
IRET
Rising edge of X001 is detected
I101
Devices
in Detail
END
I7
I8
*1.
6
Before
Programming
I6
Specified the
Device &
Constant
Input No.
3
Instruction
List
I001
M8056*1
M8057*1
M8058*1
It is recommended to set the timer interrupt time to 10 ms or more. When the timer interrupt time is set to 9
ms or less, the timer interrupt processing may not be executed at an accurate cycle in the following cases:
Basic
Instruction
Caution
When an instruction requiring long processing time is used in the main program
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
127
4 Devices in Detail
Operations
Step
0
Interrupt is
enabled
FNC 04
EI
Main
program
Main program
is finished
FNC 06
FEND
Pointer for
interrupt
Interrupt at every 20 ms
I620
Interrupt
routine
FNC 03
IRET
Interrupt return
END
Pointer No.
M8059*1
I050
I040
I010
I020
I030
*1.
128
I060
M8059*1
4 Devices in Detail
Step
0
C255
K2,147,483,647
FNC 53
DHSCS K1000 C255
FNC 06
FEND
I010
2
Overview
RUN
monitor
3
Instruction
List
Pointer for
interrupt
FNC 04
EI
M8000
Introduction
Operations
I010
Interrupt routine
(interrupt program)
4
Devices
in Detail
FNC 03
IRET
Interrupt return
END
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
129
5.
5.1
5.1.1
Example of decimal
number input
Input from
keyboard
(decimal) K 7 8 9
0: Positive value
1: Negative value
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
1
(binary)
0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 1
Automatic
conversion
1+4+16+256+512
= 789
(decimal) K 7 8 9
Monitoring in programming tool
130
FX3U and FX3UC PLCs have the floating point operation function to achieve high accuracy operation.
In floating point operations, binary floating points (real numbers) are used, and scientific notation (real
numbers) are used for monitoring them.
5.1.2
Overview
Hexadecimal number
(HEX)
00
0000
0000
0000
0000
01
0000
0001
0000
0001
02
0000
0010
0000
0010
03
0000
0011
0000
0011
04
0000
0100
0000
0100
05
0000
0101
0000
0101
06
0000
0110
0000
0110
07
0000
0111
0000
0111
10
08
0000
1000
0000
1000
11
09
0000
1001
0000
1001
10
12
0A
0000
1010
0001
0000
11
13
0B
0000
1011
0001
0001
12
14
0C
0000
1100
0001
0010
13
15
0D
0000
1101
0001
0011
14
16
0E
0000
1110
0001
0100
15
17
0F
0000
1111
0001
0101
16
20
10
0001
0000
0001
0110
99
143
Hexadecimal number
(HEX)
1001
1001
Major applications
Constants (H)
Processing inside
PLC
9
FNC10-FNC19
Move & Compare
FNC00-FNC09
Program Flow
5.1.3
Numbers of internal
I/O relays
BCD
Basic
Instruction
Before
Programming
0011
Specified the
Device &
Constant
0110
Devices
in Detail
63
BCD
Instruction
List
Decimal number
(DEC)
Numeric values handled in FX PLCs can be converted as shown in the table below:
Decimal number
(DEC)
Introduction
10
FNC20-FNC29
Arith. & Logic
Operation
131
5.1 Numeric Values Handled in PLCs (Octal, Decimal, Hexadecimal and Real Numbers)
D 10(b15 to b0)
-1
-2
-3
2-21
2-22
2-23
E7
E6
E5
E1
E0
A22
A21
A20
A2
A1
A0
b31
b30
b29
b28
b24
b23
b22
b21
b20
b2
b1
b0
8 bits in
exponent part
E0 to E7 = 0 or 1
23 bits in
mantissa part
A0 to A22 = 0 or 1
Binary floating point (real number) = (20 + A22 21 + A21 22 + ... + A0 223)
7
6
0
2 (E7 2 + E6 2 + ... + E0 2 )/2127
Example: A22=1 , A21=0, A20=1, A19 to A0=0, E7=1, E6 to E1=0, E0=1
Binary floating point (real number) = (20 + 1 21 + 0 22 + 1 23 + ... + 0 223)
7
6
0
2 (1 2 + 0 2 + ... + 1 2 )/2127
= 1.625 2129/2127 = 1.625 22
The sign bit b31 states whether data is positive or negative, but is not handled as a complement.
Handling of the zero (M8020), borrow (M8021) and carry (M8022) flags
These flags operate as follows in floating point operations.
- Zero flag
: 1 when the result is 0
- Borrow flag : 1 when the result does not reach the minimum unit but is not 0
- Carry flag : 1 when the absolute value of the result exceeds the available numeric value range.
Monitoring of binary floating point (real number)
A programming software supporting the display of floating point such as GX Developer can directly monitor
binary floating point (real number).
A programming tool not supporting the display of floating point can monitor binary floating point (real number)
when it is converted into scientific notation (real number).
132
6
Before
Programming
- When word data (16 bits) is used ... H0 to HFFFF (H0 to H9999 in the case of BCD data)
- When double data (32 bits) is used ... H0 to HFFFFFFFF (H0 to H99999999 in the case of BCD data)
Specified the
Device &
Constant
7
Basic
Instruction
5.2.3
Devices
in Detail
"K" indicates a decimal integer, and is mainly used to specify the set value of timers and counters and
numeric values as operands in applied instructions. (Example: K1234)
The decimal constant specification range is as follows:
5.2.2
3
Instruction
List
When handling constants in a sequence program, use constant K (decimal), H (hexadecimal) or E (floating
point).
In peripheral equipment for programming, add "K" to a decimal number, "H" to a hexadecimal number and "E"
to a floating point (real number) for operations associated with numeric values in instructions. (Examples:
K100 (decimal number), H64 (hexadecimal number) and E1.23 (or E1.23 + 10) (real number))
The roles and functions of constants are described below.
5.2.1
2
Overview
5.2
1
Introduction
8
FNC00-FNC09
Program Flow
"E" indicates a real number (floating point data), and is mainly used to specify numeric values as operands in
applied instructions. (Example: E1.234 or E1.234 + 3)
The real number setting range is from 1.0 2128 to 1.0 2126, 0 and 1.0 2126 to 1.0 2128.
In a sequence program, a real number can be specified in two methods, "normal expression" and "exponent
expression".
9
FNC10-FNC19
Move & Compare
- Exponent expression: .............. Specify a numeric value in the format "(numeric value) 10n".
For example, specify "1234" in the form "E1.234 + 3".
"+3" in "E1.234 + 3" indicates "103".
10
FNC20-FNC29
Arith. & Logic
Operation
133
5.3
Character Strings
Character strings are classified into character string constants which directly specify character strings in
operands in applied instructions and character string data.
5.3.1
5.3.2
b8 b7
b0
b15
1st character
3rd character
5th character
D100
D101
00H
21st character
D102
2nd character
4th character
6th character
b0
1st character
3rd character
5th character
D110
b8 b7
2nd character
4th character
6th character
"(n-1)"th character
00H
13th character
M211 to M196
M115 to M100
M131 to M116
M147 to M132
2nd character
4th character
6th character
1st character
3rd character
5th character
6th character
1st character
3rd character
5th character
16 bits
<Example 1>
M7679 to
M7664
<Example 2>
2nd character
4th character
M7655 to M7640 6th character
M7671 to M7656 8th character
M7623 to M7608
M7639 to M7624
M7679 to M7672
1st character
3rd character
5th character
7th character
00H
134
Introduction
5.4
M9
M8
M7
M6
M5
M4
M3
M2
M1
M0
D1
1
Low order
1
FNC 19
BIN
K 2X004
D 0
A series of data registers starting from D1 means "D1, D2, D3, D4 ....."
In the case of word devices with digit specification, when such word devices are handled as a series, they are
specified as shown below:
K1X004,
K1X010,
K2Y010,
K2Y020,
K2Y030 .....
K3M0,
K3M12,
M3M24,
K4S16,
K4S32,
K4S48 .....
K1X014 .....
FNC00-FNC09
Program Flow
K1X000,
7
Basic
Instruction
6
Before
Programming
A bit device number can be specified arbitrarily, but it is recommended to set the least significant digit to "0"
for X or Y. (In other words, it is recommended to specify "X000, X010, X020 ... Y000, Y010, Y020 ...")
For M and S, multiples of "8" are ideal, but it is recommended to specify "M0, M10, M20 ..." to prevent
confusion.
5
Specified the
Device &
Constant
When 16-bit data is transferred to K1M0 to K3M0, the highest-order bits are not transferred due to insufficient
data length.
32-bit data is transferred in the same way.
When the number of digits specified for bit devices is K1 to K3 (or K1 to K7) in a 16-bit (or 32-bit) operation,
the insufficient high-order bits are always regarded as "0". It means that such data is always positive.
M 0
Devices
in Detail
Low order
Transferred
K2M0
D0
Transferred
Do not change
Instruction
List
2
Overview
Devices which handle only the ON/OFF information such as X, Y, M and S are called bit devices.
On the other hand, devices handling numeric values such as T, C, D and R are called word devices.
Even bit devices can handle a numeric value when they are combined. In this case, the number of digits Kn
and the head device number are combined.
The number of digits is expressed in 4 bit units (digits); K1 to K4 are used for 16-bit data, and K1 to K8 are
used for 32-bit data.
For example, "K2M0" indicates two-digit data expressed by M0 to M7.
K3M36 .....
9
FNC10-FNC19
Move & Compare
Use the above devices in digit units so that devices are not skipped.
When "K4Y000" is used in a 32-bit operation, the high-order 16 bits register as "0".
It is necessary to use "K8Y000" when 32-bit data is required.
10
FNC20-FNC29
Arith. & Logic
Operation
135
5.5
D0.3
D0 F E D C B A 9 8 7 6 5 4 3 2 1 0
16 bits
5.6
Transfer Transfer
source destination
FNC 12
MOV
K10
U0\G10
Unit number
Example of indexing
BFM number
FNC 12
MOV
Transfer Transfer
source destination
K20
U0\G10Z0
Unit number
136
BFM #10
Indexing
The functions and structures of index registers are explained in detail in "4.10 Index Register [V and Z]".
Refer to Section 4.10 in advance.
5.7.1
Overview
Cautions
Y000
M0Z(0)
Y001
T0
D0V2
V2 = 0 : The set value of T0 is the
present value of D0.
V2 = 10 : The set value of T0 is the
present value of D10.
9
FNC10-FNC19
Move & Compare
X001
8
FNC00-FNC09
Program Flow
The set value of word devices used in OUT instruction of T and C(0~199) can be indexed with index registers.
The indexing operation is explained in an example in which the set
X030
value D0 of T0 used in the index register V2 indexes OUT
FNC 12
K0
V2
instruction(as shown in the right figure).
MOVP
Transfer K0 or K10 to the index register V2 in advance.
K0 V2
When X001 is set to ON, "D(0+0) = D0" if V2 is "0", and T0 operates
X030
FNC 12
with the set value D0.
K10
V2
MOVP
When X001 is set to ON, "D(0+10) = D10" if V2 is "10", and T0
K10 V2
operates with the set value D10.
7
Basic
Instruction
Before
Programming
3) When an octal device number of X or Y is indexed with an index register, the contents of the index
register are converted into octal, and then added to the device number.
For example, when the value of an index register added to the input X000 is changed in the order "K0
K8 K16", the device number converted into octal is added to the input X000 and the input number is
changed in the order "X(000+0) = X000 X(000+8) = X10 X(000+16) = X20".
Caution
5
Specified the
Device &
Constant
X000Z(0)
4
Devices
in Detail
3
Instruction
List
Bit devices [X, Y, M (except special auxiliary relays), T, and C (C0 to C199)] used in LD, LDI, AND, ANI, OR,
ORI, OUT, SET, RST, PLS, and PLF instructions can be indexed with index registers.
The figure shown on the right explains an indexing operation with
X030
the index register Z(0) for X000 and M0 in the LD instruction.
FNC 12
K5
Z(0)
MOVP
Transfer K5 or K10 to the index register Z(0) in advance.
K5 Z(0)
If Z(0) is "5", "X(0+5) = X005". When X005 turns ON, Y000 turns ON
and "M(0+5) = M5". When M5 turns ON, Y001 turns ON.
X030
FNC 12
K10
Z(0)
If Z(0) is "10", "X(0+10) = X012*1". When X012*1 turns ON, Y000
MOVP
turns ON and "M(0+10) = M10". When M10 turns ON, Y001 turns
K10 Z(0)
ON.
*1.
Introduction
5.7
5.7 Indexing
10
FNC20-FNC29
Arith. & Logic
Operation
137
5.7.2
5.7 Indexing
FNC 12
MOV
K100
D 10
X000
FNC 12
MOVP
K0
V1
K0 V1
X000
FNC 12
MOVP
K10
V1
K10 V1
X001
FNC 10
CMP
V1=0
D0>D1 M0=ON
D0=D1 M1=ON
D0<D1 M2=ON
D0
D1
M0V1
V1=10
M10=ON
M11=ON
M12=ON
X000
FNC 12
MOVP
K0
V3
K0 V3
X000
FNC 12
MOVP
K10
V3
K10 V3
X001
FNC 12
K500
D0V3
MOV
V3=0 : K500 D0 (D0+0)
V3=10 : K500 D10 (D0+10)
138
X002
FNC 12
DMOVP
K0
Z4
K0 V4,Z4
X002
FNC 12
DMOVP
K10
Z4
K10 V4,Z4
X003
5.7 Indexing
1) When even if a numeric value written to index registers does not exceed the 16-bit numeric value range
(0 to 32767), make sure to overwrite both V and Z using a 32-bit instruction. If only Z is overwritten and
another numeric value remains in V, the numeric value will be extremely large. Thus an operation error
occurs.
X031
X032
4
FNC 12
MOVP
K0
V3
K0V3
FNC 12
MOVP
K8
V3
K8V3
K 16
V3
K16 V 3
X033
RUN monitor
FNC 19
BIN
K1X000
Z0
(X003 to X000)BCD(Z0)BIN
T 0Z0
K4Y000
7
Basic
Instruction
FNC 18
BCD
6
Before
Programming
5
Specified the
Device &
Constant
FNC 12
MOVP
Devices
in Detail
X030
3
Instruction
List
2
Overview
Introduction
Cautions
PLC
(T0Z0)BIN(Y017 to Y000)BCD
"T0Z0 = T0 to T9" according to "Z0 = 0 to 9"
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
139
5.7 Indexing
X004
FNC 12
MOVP
V6
K0 V6
X004
FNC 12
MOVP
K20
V6
K20 V6
X005
5.7.3
K0
FNC 12
K6V6
D10
MOVP
V6=0 : K6 (K6+0) D10
V6=20 : K26(K6+20) D10
X010
X012
X013
140
FNC 12
MOVP
K0
V0
(K0) (V0)
FNC 12
MOVP
K0
V1
(K0) (V1)
FNC 12
MOVP
K0
V2
(K0) (V2)
FNC 12
MOVP
K16
V0
(K16) (V0)
FNC 12
MOVP
K2
V1
(K2) (V1)
FNC 12
MOVP
K20
V2
(K20) (V2)
M0V2
Head Device
Number of
Pressed Key
Information
1
Introduction
6.
6.1
3
Instruction
List
2
Overview
This chapter explains the I/O processing, relationship among instructions and programming method which
should be understood before creating sequence programs.
Applicable series
5
Specified the
Device &
Constant
Devices
in Detail
Indicates applicable
PLC versions.
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
The above is different from the actual page, as it is provided for explanation only.
10
FNC20-FNC29
Arith. & Logic
Operation
141
Outline
1. Instruction format
1) The applied instruction number (FNC No.) and instruction mnemonic are indicated. The table below
shows the meaning of simplified expression.
Mark
Description
Applicable
instruction
(example)
No.
FNC 12
Instruction
P
MOV name
Dotted lines on the upper left and lower left sides indicate an independent
WDT(FNC 07)
instruction not associated with the 16-bit or 32-bit type.
No.
FNC 12
Instruction
D MOV name
P
Continuous lines on the upper left side indicates that 16-bit type is available.
MOV(FNC 12)
"D" on the lower left side indicates that the 32-bit type is available.
No.
FNC 12
D Instruction
P
MOV name
Dotted lines on the lower left side indicate that the 32-bit type does not exist.
Continuous lines on the upper left side indicate that only the 16-bit type is CJ(FNC 00)
available.
No.
FNC 12
Instruction
P
MOV name
Dotted lines on the upper left side indicate that the 16-bit type does not exist.
HSCS(FNC 53)
"D" on the lower left side indicates that only the 32-bit type is available.
No.
FNC 12
DInstruction
MOV name P
Continuous lines on the upper right side indicate that the continuous operation
type is available. "P" on the lower right side indicates that the pulse operation CMP(FNC 10)
type is available.
No.
FNC 12
DInstruction
MOV name P
Dotted lines on the lower right side indicate that the pulse operation type does
not exist. Continuous line on the upper right side indicate that only the MTR(FNC 52)
continuous operation type is available.
"
No.
FNC 12
Instruction
DMOV name P
"on the upper right side indicates that the contents of the destination
change in every operation cycle when the continuous operation type is used.
INC(FNC 24)
When operation should be executed only during the driving of an instruction,
use the pulse operation type indicated by "P" on the lower right side.
2. Set data
The contents of devices that can be specified as operands in instructions and available data types are
described below:
1) Contents
The contents of operands in each instruction are described below.
2) Indexing of the source and destination
In operands to which " " is added such as S
and S1 , indexing is available.
Operands not allowing indexing are expressed as S and S1 .
3) Data types
- Bit
- 16-bit BIN
- 32-bit BIN
- 64-bit BIN
- 16/32-bit BIN
- 32/64-bit BIN
- 4-digit BCD
- 8-digit BCD
- 4/8-digit BCD
- Character string
- Character string (only ASCII)
- Real number (binary)
- Real number (decimal)
142
:
:
:
:
:
:
:
:
:
:
:
:
:
Bit device
16-bit binary code
32-bit binary code
64-bit binary code
16-bit or 32-bit binary code
32-bit or 64-bit binary code
4-digit (16-bit) BCD code
8-digit (32-bit) BCD code
4-digit (16-bit) or 8-digit (32-bit) BCD code
Character code such as ASCII code and shift JIS code
ASCII code
Binary floating point
Scientific notation
1
Introduction
Applicable devices
Devices which can be specified in operands of instructions are shown.
When a device supports an instruction, "3" is added to the device.
2) Word devices
K : Decimal integer
H : Hexadecimal integer
2
Overview
1) Bit devices
X : Input relay (X)
Y : Output relay (Y)
M : Auxiliary relay (M)
S : State relay (S)
etc.
Instruction
List
*1.
4
Devices
in Detail
Cautions
Cautions on using each instruction are described.
5
Specified the
Device &
Constant
Errors
Major errors that are possible to occur in each instruction are described.
For details on errors, refer to "Chapter 37. Errors and Error Code List".
Program examples
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
143
6.2
6.2.1
(1)LD
(2)AND
(5)OUT
(2)LD
(3)AND
(4)OUT
(3)OR
(4)ORB
(2)LD
(1)LD
(3)AND
(5)OUT
(4)OUT
(4)ANB
(3)OR
(2)OR
ANB instruction is not necessary
Executed
(1)
(5)
(3)
(2)
(7)
(9)
(10)
(6)
(4)
(8)
144
(11)
Introduction
6.2.2
Overview
First
X001
Y003
Y004
Y003
Y003
Second
X002
Devices
in Detail
B
Y000
Y000
C
.....
Before
Programming
Ignored
Specified the
Device &
Constant
Y000
D
B
M100
7
Basic
Instruction
.....
or
C
M101
.....
3
Instruction
List
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.
Accordingly, the actual output to the outside is "Y003 = OFF,
Y004 = ON".
Input processing
X001 = ON X002 = OFF
M100
Y000
9
FNC10-FNC19
Move & Compare
SET, RST or jump instruction can be used instead, or a same output coil can be programmed at each state by
step ladder instructions.
When step ladder instructions are used, if an output coil located in the main routine is also used in a state, it is
handled as a double coil. It is better to avoid such programming.
FNC00-FNC09
Program Flow
M101
10
FNC20-FNC29
Arith. & Logic
Operation
145
6.2.3
F
A
A
C
E
B
146
D
C
Introduction
6.3
(1)
and operation is
Scan time
(operation
cycle)
Image memory of
each device is
updated
(3)
Batch I/O method
(refresh method)
to program.
[Output processing]
Result is
transferred to
output latch
memory
Output
devices
are driven
OFF
Program
processing
Input processing
Output processing
Program
processing
Time)
Program
processing
Operation cycle
Before
Programming
5
Specified the
Device &
Constant
Devices
in Detail
The ON duration and OFF duration of inputs in PLCs require longer time than "PLC cycle time + Input filter
response delay".
When the response delay of the input filter "10 ms" is considered and the cycle time is supposed as "10 ms",
the ON duration and OFF duration should be at least 20 ms respectively.
Accordingly, PLCs cannot handle input pulses at 25 Hz (1000 / (20 + 20) = 25) or more. However, the
situation can be improved by PLC special functions and applied instructions.
3
Instruction
List
2
Overview
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
147
6.4
Instruction in
left line
Example 1: MC CJ P MCR
Top line
Left line
MC-MCR
CJ-P
MC-MCR
3
3
octet
Example 2: MC CJ MCR P
CJ-P
EI-DI
FOR-NEXT
STL-RET
3 Example
1
Example
2
3
3
3
3
EI-DI
3 quintet
FOR-NEXT
STL-RET
*2
inside
one
STL
3
3
P-SRET
3
3
I-IRET
3
FEND-END
*1
O-FEND
O-END
(no FEND)
148
3
*1
1
Introduction
2
Overview
FEND-END
Remarks
*1
Instruction
List
P-SRET
*2
FOR
NEXT
NEXT
Devices
in Detail
FOR
3
3
5
Specified the
Device &
Constant
*1
6
Before
Programming
*3
*3
*3
8
FNC00-FNC09
Program Flow
Basic
Instruction
9
FNC10-FNC19
Move & Compare
*3
*3
10
*3
FNC20-FNC29
Arith. & Logic
Operation
149
6.5
6.5.1
m, n
FNC 13
SMOV
m1
m2
- In applied instructions, the program step of the instruction part always occupies 1 step, but each
operand occupies 2 or 4 steps depending on whether the instruction is 16-bit type or 32-bit type.
150
Applied instructions are classified into "16-bit type" or "32-bit type" by the size of handled numeric values.
And by the operation type, applied instructions are classified into "continuous operation type" or "pulse
operation type".
Some applied instructions have every combination of this form and type, and others do not.
- Applied instructions handling numeric values are classified into the 16-bit type or the 32-bit type by the
bit length of the numeric value data.
Command 1
Command 2
FNC 12
MOV
D20
D12
D22
FNC 12
MOVP
D10
D12
6
X001
Before
Programming
FNC 12
MOV
D10
D12
In the continuous operation type of some instructions such as FNC 24 (INC) and FNC 25 (DEC), the
contents of the destination change in every operation cycle.
For applied instructions requiring attention in using the continuous operation type, the symbol "
added to the title of the explanation of such instructions as shown in the figure below.
Basic
Instruction
X000
Specified the
Device &
Constant
4
Devices
in Detail
3
Instruction
List
FNC 12
DMOV
D10
2
Overview
Introduction
" is
In any case, instructions are not executed while the drive input X000 or X001 is OFF. And the destinations
do not change except when instructions specify otherwise.
FNC00-FNC09
Program Flow
No.
FNC 12
Instruction
D MOV name P
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
151
6.5.2
152
When two or more instruction execution complete flags M8029 are programmed together for applied
instructions, it is difficult to determine which instruction executes which flag.
For using flags in any positions other than directly under applied instructions, refer to the next page.
M8000
FNC 72
DSW
M8029
D0
D0
K10
K1
D20
...
M8029 works as
a flag to indicate
that execution of
DSW is
completed.
FNC 22
MUL
Y10
Instruction
List
Execution is
completed
X10
Overview
...
Good example
1
Introduction
1. Program containing many flags (example of instruction execution complete flag M8029)
X000
M0
Y000
M8029
Execution is
completed
RST
M0
M8029
Execution is
completed
M8000
RST
FNC 72
DSW
X10
SET
M0
FNC 57
DPLSY
M0
Y10
D0
K1000
D20
Y000
FNC 22
MUL
D0
K10
D20
FNC 57
DPLSY
K1000
D22
Y001
Second DPLSY
instruction
K1
X000
M0
M8029
Execution is
completed
M1
7
Basic
Instruction
M8029 works as
a flag to indicate
that execution of
the first DPLSY
is completed.
4
D20
Before
Programming
M8029 works as
a flag to indicate
that execution of
DSW is
completed.
K1000
...
M8029 works as
a flag to indicate
that execution of
the second
DPLSY is
completed.
FNC 57
DPLSY
Specified the
Device &
Constant
Bad example
M0
Devices
in Detail
M8029 works as
a flag to indicate
that execution of
DPLSY is
completed.
SET
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
153
2. Introduction of method for using flags in any positions other than directly under applied
instructions
When two or more applied instructions are programmed, general flags turn ON or OFF when each applied
instruction turns ON.
Accordingly, when using a flag in any position other than directly under an applied instruction, set to ON or
OFF another device just under the applied instruction, and then use the contact of the device as the
command contact.
...
M8000
DSW execution
complete flag
M8029 is
changed to
M100.
FNC 72
DSW
Y10
D0
K1
M8029
M100
Execution is
completed
M0
DPLSY
execution
complete flag
M8029 is
changed to
M200.
X10
FNC 57
DPLSY
K1000
D20
Y000
M8029
RST
Execution is
completed
M0
M200
...
It works as DSW
execution
complete flag.
M100
FNC 22
MUL
D0
K10
D20
It works as
DPLSY execution
complete flag.
M200
Y030
154
1. Operation error
Device storing error code
M8067
D8067
D8315, D8314
D8069
Compatible with the FX0, FX0S, FX0N, FX1, FX2, FX2C, FX1S, FX1N, FX2N, FX1NC and FX2NC Series.
When the error occurrence step is up to the 32767th step, the error occurrence step can be checked in
D8069 (16 bits).
When the PLC mode switches from STOP to RUN, these devices are cleared instantaneously, and then
set to ON again if errors have not been cleared.
M8068
D8313, D8312
device*1
Compatible with the FX0, FX0S, FX0N, FX1, FX2, FX2C, FX1S, FX1N, FX2N, FX1NC and FX2NC Series.
Even if another error has occurred in another step, the stored data is not updated, and remains held until
these devices are forcibly reset or until the power turns OFF.
When the error occurrence step is up to the 32767th step, the error occurrence step can be checked in
D8068 (16 bits).
6
Before
Programming
When an operation error has occurred, M8068 is set, and D8313 and D8312 store the step number in
which the error has occurred.
5
Specified the
Device &
Constant
*1.
Error flag
4
Devices
in Detail
If another error occurs in another step, the stored data is updated in turn to the error code and step number
of the new error. (These devices are set to OFF when errors are cleared.)
3
Instruction
List
When an operation error has occurred, M8067 is set, D8067 stores the operation error code number, and
D8315 and D8314 (32 bits in total) store the step number in which the error has occurred.
2
Overview
*1.
Error flag
Introduction
6.5.3
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
155
6.5.4
X000
FNC 17
XCHP
X000
D10
D11
M8160
D10
D10
Same number
When using an instruction requiring the function extension flag in an interrupt program, program DI instruction
(for disabling interrupt) before driving the function extension flag, and program EI instruction (for enabling
interrupt) after turning OFF the function extension flag.
6.5.5
Allowable number
of times of use
Remarks
8
Pay attention so that this instruction does not overlap the input numbers of in
(1 instruction/1 input DVIT instruction, DOG inputs in ZRN instruction, zero point signal in DSZR
or less)
instruction, input interrupt numbers and high speed counter input numbers.
FNC 60(IST)
FNC 69(SORT)
FNC 70(TKY)
FNC 71(HKY)
FNC 75(ARWS)
FNC 77(PR)
FNC149(SORT2)
FNC186(DUTY)
5
(1 instruction/1 input
or less)
FNC280(HSCT)
When using above instructions beyond the allowable number of times of use
For instructions 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 not required, such instruction can be used as if
they were used beyond the allowable number of times.
Refer to "Subsection 5.7.3. Indexing example in instruction with limited number of use".
156
1. Positioning instructions
Do not drive FNC 57 (PLSY), FNC 58 (PWM), FNC 59 (PLSR), FNC150 (DSZR), FNC151 (DVIT), FNC156
(ZRN), FNC157 (PLSV), FNC158 (DRVI) and FNC159 (DRVA) instructions at the same time for the same
output number.
4
Devices
in Detail
In FNC 53 (HSCS), FNC 54 (HSCR) and FNC 55 (HSZ) instructions (including FNC280 (HSCT) instruction),
make sure that up to 32 instructions are driven at the same time. [FNC280 (HSCT) instruction can be used
only once.]
Note that "FNC280 (HSCT) instruction", "table high speed comparison mode of FNC 55 (HSZ) instruction)"
and "frequency control mode of FNC 55 (HSZ) instruction" can each only be used once.
3
Instruction
List
2
Overview
Some applied 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.
For combinations of instructions, refer to "6.4 Mutual relationship among program flow control instructions".
Introduction
In FNC 80 (RS) and FNC 87 (RS2) instructions, do not drive two or more instructions at the same time for
the same port.
In FNC270 (IVCK), FNC271 (IVDR), FNC272 (IVRD), FNC273 (IVWR) and FNC274 (IVBWR) instructions,
two or more instructions can be driven at the same time for the same port.
Specified the
Device &
Constant
It is impossible to combine and use FNC 80 (RS), FNC 87 (RS2), FNC270 (IVCK), FNC271 (IVDR),
FNC272 (IVRD), FNC273 (IVWR) and FNC274 (IVBWR) instructions for the same port.
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
157
7 Basic Instruction
7.
Basic Instruction
This chapter explains types and functions of basic sequence instructions.
For beginners to sequence control, we offer "Introduction Course" and "Relay Ladder Course" learning texts
for reference.
We can also offer the PLC learning software "Beginner Course".
Mnemonic
Name
Symbol
Function
Applicable devices
Reference
Contact Instruction
Initial logical operation
contact type NO (normally X,Y,M,S,D.b,T,C
open)
Section 7.1
Applicable devices
Section 7.1
Load Pulse
Applicable devices
X,Y,M,S,D.b,T,C
Section 7.5
LDF
Applicable devices
X,Y,M,S,D.b,T,C
Section 7.5
AND
AND
Applicable devices
Serial connection of NO
(normally open) contacts
X,Y,M,S,D.b,T,C
Section 7.3
ANI
AND Inverse
Applicable devices
Serial connection of NC
X,Y,M,S,D.b,T,C
(normally closed) contacts
Section 7.3
ANDP
AND Pulse
Applicable devices
X,Y,M,S,D.b,T,C
Section 7.5
ANDF
Applicable devices
Section 7.5
Applicable devices
Parallel connection of NO
(normally open) contacts
X,Y,M,S,D.b,T,C
Section 7.4
Applicable devices
Parallel connection of NC
X,Y,M,S,D.b,T,C
(normally closed) contacts
Section 7.4
Applicable devices
Parallel connection of
rising edge pulse
X,Y,M,S,D.b,T,C
Section 7.5
Applicable devices
Parallel connection of
falling/trailing edge pulse
X,Y,M,S,D.b,T,C
Section 7.5
LD
Load
LDI
Load Inverse
LDP
OR
OR
ORI
OR Inverse
ORP
OR Pulse
ORF
OR Falling Pulse
158
Applicable devices
7 Basic Instruction
1
Name
Symbol
Function
Applicable devices
Reference
Connection Instruction
AND Block
Serial connection of
multiple parallel circuits
Section 7.7
ORB
OR Block
Parallel connection of
multiple contact circuits
Section 7.6
MPS
Memory Point
Store
MPS
MRD
Memory Read
MRD
MPP
Memory POP
MPP
INV
Inverse
MEP
MEF
Section 7.8
3
Section 7.8
Section 7.8
Section 7.10
MEP
Conversion of
operation result
to leading edge pulse
Section 7.11
MEF
Conversion of
operation result
to trailing edge pulse
Section 7.11
Section 7.2
Y,M,S,D.b
Section 7.13
Reset
Y,M,S,D.b,T,C,
D,R,V,Z
Section 7.13
PLS
Pulse
Y,M
Section 7.12
PLF
Pulse Falling
Y,M
Section 7.12
Y,M
Section 7.9
SET
SET
RST
Applicable devices
Master Control
MCR
Master Control
Reset
MC N Applicable devices
MCR N
Section 7.9
Section 7.14
Other Instruction
NOP
No Operation
End Instruction
END
END
Section 7.15
FNC10-FNC19
Move & Compare
END
8
FNC00-FNC09
Program Flow
MC
7
Basic
Instruction
Before
Programming
OUT
5
Specified the
Device &
Constant
Out Instruction
OUT
4
Devices
in Detail
Instruction
List
INV
2
Overview
ANB
Introduction
Mnemonic
10
FNC20-FNC29
Arith. & Logic
Operation
159
7 Basic Instruction
7.1
LD, LDI
Outline
LD and LDI instructions are contacts connected to bus lines.
When combined with ANB instruction described later, LD and LDI instructions can be used for the start of
branches.
1. Instruction format
Basic Instruction
LD
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
LD
Load
Basic Instruction
LDI
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
LDI
Load
Inverse
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
LD
S S
S
3 3
3
S2
1 2
1
LDI
3 3
S
S S
3
S2
1
1 2
""
S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).
S2: State relays (S) and "D.b" cannot be indexed with index registers (V and Z).
List program
LD instruction
0000 LD X000
0001 OUT Y000
Y000
Bus line
Timing chart
160
X000
ON
ON
Y000
ON
ON
7 Basic Instruction
Circuit program
X000
Introduction
LDIinstruction
Y000
2
Overview
Bus line
Timing chart
ON
X000
ON
ON
Instruction
List
Y000
ON
3. Indexing
Devices used in LD and LDI instructions allow indexing with index registers (V and Z).
(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D.b" cannot be indexed.)
List program
X000V0
Y000
0000 LD X000V0
0003 OUT Y000
A bit in data register (D) can be specified as a device used in LD and LDI instructions.
List program
D0.3
Y000
0000 LD D0.3
0003 OUT Y000
7
Basic
Instruction
Before
Programming
Circuit program
5
Specified the
Device &
Constant
4
Devices
in Detail
Circuit program
Errors
When the device number of a device (M, T or C) other than I/O used in LD or LDI instruction does not exist
due to indexing, an operation error (error code: 6706) occurs.
FNC00-FNC09
Program Flow
When an I/O number used in LD or LDI instruction does not exist due to indexing, M8316 (Non-existing I/O
specification error) turns ON.
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
161
7 Basic Instruction
7.2
7.2 OUT
OUT
Outline
OUT instruction drives coils of output relays (Y), auxiliary relays (M), state relays (S), timers (T) and counters
(C).
1. Instruction format
Basic Instruction
OUT
Mnemonic
OUT
OUT
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S
S S
3
3
S2
1 2
1
""
Set
value
3 3
3 3
S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).
S2: State relays (S) and "D.b" cannot be indexed with index registers (V and Z).
List program
Drive contact of
OUT instruction
X000
OUT instruction
Y000
OUT instruction
X001
M100
0000
0001
0002
0003
0004
LD
OUT
LDI
OUT
OUT
X000
Y000
X001
M100
M101
OUT instruction
M101
162
7 Basic Instruction
7.2 OUT
1
Introduction
Timing chart
X000
OUT instruction
Y000
ON
ON
ON
ON
2
Overview
X001
ON
ON
M100
ON
OUT instruction
M101
ON
3
Instruction
List
OUT instruction
Circuit program
X000
X001
K30
T1
K30
C0
K50
0000 LD
0001 OUT
(SP)
0004 LDI
0005 OUT
(SP)
0008 OUT
(SP)
X000
T0
K30
X001
T1
K30
C0
K50
5
Specified the
Device &
Constant
T0
4
Devices
in Detail
1) Direct specification
2) Indirect specification
The set value of a timer or counter can be
set by a data register (D) or extension data
register (R). At this time, the current value
of the data register (D) or extension
register (R) is regarded as the set value of
the timer or counter.
It is necessary to write in advance the set
value to a data register (D) or extension
register (R) used for the set value by MOV
instruction, DSW instruction or display unit
before driving the timer or counter.
Before
Programming
List program
Circuit program
X000
X001
D10
T11
R15
C10
D20
0000 LD
0001 OUT
(SP)
0004 LDI
0005 OUT
(SP)
0008 OUT
(SP)
X000
T10
D10
X001
T11
R15
C10
D20
Setting range
(Value of K or current value of D or R)
Number of steps
1 ms timer
1 to 32767
10 ms timer
1 to 32767
16-bit counter
1 to 32767
Same as left
32-bit counter
2,147,483,648 to +2,147,483,647
Same as left
FNC10-FNC19
Move & Compare
100 ms timer
FNC00-FNC09
Program Flow
Timer/counter
7
Basic
Instruction
T10
10
FNC20-FNC29
Arith. & Logic
Operation
163
7 Basic Instruction
7.2 OUT
3. Indexing
Devices used in OUT instruction can be indexed with index registers (V and Z).
(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D.b" cannot be indexed.)
Circuit program
X000
List program
Y000Z0
0000 LD X000
0001 OUT Y000Z0
X000
List program
D0.3
0000 LD X000
0001 OUT D0.3
Caution
When a special internal relay (M), timer or counter is used, program steps increase as described in "Setting
range of timers and counters" on the previous page.
Errors
When an I/O number used in OUT instruction does not exist due to indexing, M8316 (Non-existing I/O
specification error) turns ON.
When the device number of a device (M, T or C) other than I/O used in OUT instruction does not exist due
to indexing, an operation error (error code: 6706) occurs.
164
7 Basic Instruction
AND, ANI
Introduction
7.3
Outline
1. Instruction format
Basic Instruction
Mnemonic
AND
AND
Basic Instruction
ANI
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ANI
4
Devices
in Detail
AND Inverse
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Instruction
List
AND
2
Overview
2. Applicable devices
Bit Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3
ANI
3 3
S
S S
3
S2
1
1 2
""
S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).
S2: State relays (S) and "D.b" cannot be indexed with index registers (V and Z).
Basic
Instruction
List program
AND instruction
X002
Y003
Contact connected
in series
FNC00-FNC09
Program Flow
0000 LD X002
0001 AND X000
0002 OUT Y003
X000
Timing chart
X002
AND instruction
X000
Y003
ON
ON
ON
9
FNC10-FNC19
Move & Compare
LD instruction
Before
Programming
AND
S S
S
3 3
3
S2
1 2
1
Specified the
Device &
Constant
Instruction
Word Devices
ON
ON
10
FNC20-FNC29
Arith. & Logic
Operation
165
7 Basic Instruction
List program
ANI instruction
X002
0000 LD X002
0001 ANI X000
0002 OUT Y003
X000
Y003
Contact connected
in series
Timing chart
LD instruction
X002
ANI instruction
X000
ON
ON
ON
ON
ON
Y003
ON
3. Indexing
Devices used in AND and ANI instruction can be indexed with index registers (V and Z).
(State relays (S), special auxiliary relays (M), 32-bit counters (C), and "D.b" cannot be indexed.)
Circuit program
List program
X002 X000V0
Y003
0000 LD X002
0001 AND X000V0
0004 OUT Y003
X002
List program
D0.3
Y003
0000 LD X002
0001 AND D0.3
0004 OUT Y003
Errors
When an I/O number used in AND or ANI instruction does not exist due to indexing, M8316 (Non-existing I/
O specification error) turns ON.
When the device number of a device (M, T or C) other than I/O used in AND or ANI instruction does not
exist due to indexing, an operation error (error code: 6706) occurs.
166
7 Basic Instruction
Circuit program
Introduction
Program examples
List program
AND instruction
Y003
ANI instruction
X002 X003
Y004
AND instruction
X004
K30
X000
X001
Y003
X002
X003
Y004
X004
T0
K30
X005
T0
Y005
Contact connected
in series
Contact connected
in series
Contact connected
in series
Contact connected
in series
3
Instruction
List
T0
LD
AND
OUT
LD
ANI
OUT
AND
OUT
(SP)
0010 LD
0011 ANI
0012 OUT
0000
0001
0002
0003
0004
0005
0006
0007
Overview
X000 X001
ANI instruction
X005
T0
Y005
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
167
7 Basic Instruction
7.4
OR, ORI
Outline
OR and ORI instructions are used to connect one contact in parallel.
If two or more contacts are connected in series, use ORB instruction described later to connect such a serial
circuit block to another circuit in parallel.
A step containing OR or ORI instruction is connected in parallel to a preceding step containing LD or LDI
instruction. There is no limitation in the number of times of parallel connection.
1. Instruction format
Basic Instruction
OR
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
OR
OR
Basic Instruction
ORI
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ORI
OR Inverse
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
OR
S S
S
3 3
3
S2
1 2
1
ORI
3 3
S
S S
3
S2
1
1 2
""
S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).
S2: State relays (S) and "D.b" cannot be indexed with index registers (V and Z).
List program
X000
0000 LD X000
0001 OR X001
0002 OUT Y000
Y000
X001
Timing chart
LD instruction
X000
OR instruction
X001
Y000
168
ON
ON
ON
ON
ON
ON
ON
7 Basic Instruction
Circuit program
Introduction
X000
0000 LD X000
0001 ORI X002
0002 OUT Y001
Y001
Overview
X002
Timing chart
X000
ORI instruction
X002
ON
ON
ON
ON
Y001
ON
ON
Instruction
List
LD instruction
ON
ON
ANB
LD
OR
OR
Before ANB
instruction
OR
6
Before
Programming
OR
After ANB instruction
4. Indexing
Devices used in OR and ORI instruction can be indexed with index registers (V and Z).
(State relays (S), special auxiliary relays (M), 32-bit counters, and "D.b" cannot be indexed.)
List program
X000
Y000
8
FNC00-FNC09
Program Flow
0000 LD X000
0001 OR X001V0
0004 OUT Y000
7
Basic
Instruction
Circuit program
X001V0
5
Specified the
Device &
Constant
LD
Devices
in Detail
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
169
7 Basic Instruction
List program
X000
Y000
D0.3
0000 LD X000
0001 OR D0.3
0004 OUT Y000
Errors
When an I/O number used in OR or ORI instruction does not exist due to indexing, M8316 (Non-existing I/
O specification error) turns ON.
When the device number of a device (M, T or C) other than I/O used in OR or ORI instruction does not
exist due to indexing, an operation error (error code: 6706) occurs.
170
7 Basic Instruction
Introduction
7.5
Outline
1. Instruction format
Basic Instruction
Mnemonic
Load Pulse
LDP
Basic Instruction
LDF
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
LDF
Basic Instruction
ANDP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
AND Pulse
ANDP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ANDF
Mnemonic
OR Pulse
ORP
Basic Instruction
ORF
Mnemonic
ORF
2. Applicable devices
Instruction
Word Devices
System User
Digit Specification
System User
Special
Unit
LDF
3 3 3 3 3 3
ANDP 3 3 3 3 3 3
ANDF 3 3 3 3 3 3
ORP
3 3 3 3 3 3
ORF
3 3 3 3 3 3
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
9
FNC10-FNC19
Move & Compare
LDP
Others
FNC00-FNC09
Program Flow
Bit Devices
Basic
Instruction
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
OR Falling Pulse
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Before
Programming
Basic Instruction
ORP
5
Specified the
Device &
Constant
Basic Instruction
ANDF
4
Devices
in Detail
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Instruction
List
LDP
2
Overview
LDP, ANDP, and ORP instructions for contacts 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).
10
FNC20-FNC29
Arith. & Logic
Operation
171
7 Basic Instruction
X000
List program
LDP instruction
0000
0002
0004
0005
0006
0008
M0
X001 ORP instruction
M8000
X002
ANDP instruction
LDP
ORP
OUT
LD
ANDP
OUT
X000
X001
M0
M8000
X002
M1
M1
RUN monitor
Timing chart
LDP instruction
X000
ORP instruction
X001
ON
ON
ON
ON during one
operation cycle
M0
ON
M8000
ANDP instruction
X002
M1
ON
ON
ON
ON
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 ON
from OFF.
172
7 Basic Instruction
Circuit program
List program
LDF instruction
0000
0002
0004
0005
0006
0008
M0
X001
M8000
ORF instruction
X002
ANDF instruction
X000
X001
M0
M8000
X002
M1
3
Instruction
List
M1
LDF
ORF
OUT
LD
ANDF
OUT
Overview
X000
RUN monitor
Timing chart
X000
ORF instruction
X001
ON
ON
ON
5
Specified the
Device &
Constant
ON
M8000
ON
ON
ON
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.
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
A bit in 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 "."
Circuit program
List program
after a data register (D) number, and then
input a bit number (0 to F) consecutively.
Only 16-bit data registers are available.
0000 LDP D0.3
D0.3
Specify a bit number as "0, 1, 2, ... 9, A, B, ...
0003 OUT Y000
Y000
F" from the least significant bit.
Example:In the example shown on the left,
LDP contact turns ON (becomes
conductive) or OFF (becomes nonconductive) when the bit 3 of D0
turns ON or OFF.
Before
Programming
M1
ON
ON during
one operation cycle
M0
X002
4
Devices
in Detail
LDF instruction
ANDF instruction
1
Introduction
2. LDF, ANDF, and ORF instructions (initial logical operation of falling/trailing edge pulse,
serial connection of falling/trailing edge pulse, and parallel connection of falling/trailing
edge pulse)
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
173
7 Basic Instruction
<Pulse instruction>
X010
X010
M6
PLS
M6
X010
M 6
Operation
cycle
Operation
cycle
In each circuit, M6 is ON during only one operation cycle when X010 turns ON from OFF.
<Rising edge detection>
X020
FNC 12
MOV
D0
X020
FNC 12
MOVP
K10
D0
In each circuit, MOV instruction is executed only once when X020 turns ON from OFF.
174
7 Basic Instruction
7.5 LDP, LDF, ANDP, ANDF, ORP, ORF
When an auxiliary relay (M) is specified as a device in LDP, LDF, ANDP, ANDF, ORP and ORF instructions,
the operation varies depending on the device number range as shown in the figure below.
<M0 to M2799, M3072 to M7679>
[1]
SET
M50
X000
M0
[3]
SET
M51
SET
M52
Instruction
List
[2] M0
2
Overview
M0
Introduction
M0
[4] M0
M53
M2800
M2800
M2800
M2800
M2800
M1
Block A
M2800
SET
M2
SET
M3
SET
M4
SET
M5
SET
M6
Block B
M2800
M7
Basic
Instruction
M2800
SET
Before
Programming
M2800
M0
Specified the
Device &
Constant
X000
SET
Devices
in Detail
<M2800 to M3071>
Block C
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
175
7 Basic Instruction
Cautions
1. Cautions when LDP, LDF, ANDP, ANDF, ORP, or ORF instruction programmed in a same
step is executed two or more times within one operation cycle
When LDP, LDF, ANDP, ANDF, ORP or ORF instruction programmed in a same step is executed two or
more times within one operation cycle, the following operation results:
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 label (P) in a smaller step number by CJ
instruction
Operation
X000
FNC 08
FOR
FNC 09
NEXT
OFF
Not executed
Not executed
ON
*1.
176
*1
Executed
Not executed
7 Basic Instruction
ORB
Introduction
7.6
7.6 ORB
Outline
A circuit in which two or more contacts are connected in series is called serial circuit block.
Basic Instruction
ORB
1 step
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ORB
OR Block
Overview
1. Instruction format
3
Instruction
List
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
""
X001
Y006
ORB instruction
X002
X003
X004
Inappropriate program
0000 LD
X000
0001 AND X001
0002 LD
X002
0003 AND X003
0004 LDI X004
0005 AND X005
0006 ORB
0007 ORB
0008 OUT Y006
7
Basic
Instruction
ORB instruction
Appropriate program
0000 LD
X000
0001 AND X001
0002 LD
X002
0003 AND X003
0004 ORB
0005 LDI X004
0006 AND X005
0007 ORB
0008 OUT Y006
Before
Programming
X000
List program
5
Specified the
Device &
Constant
When connecting serial circuit blocks in parallel, use LD or LDI instruction at the start of branch, and use
ORB instruction at the end of branch.
ORB instruction is an independent instruction not associated with any device number in the same way as
ANB instruction described later.
When there are many parallel circuits, ORB instruction can be used for each circuit block to connect them.
Circuit program
4
Devices
in Detail
ORB
ConReal
CharacPointer
stant Number ter String
X005
Caution
9
FNC10-FNC19
Move & Compare
There is no limitation in the number of parallel circuits which can be connected by ORB instructions (in the
case of appropriate program shown above).
Though ORB instructions can be used at one time, note that the repeated use of LD or LDI instruction is
limited to 8 or less (in the case of inappropriate program shown above).
FNC00-FNC09
Program Flow
10
FNC20-FNC29
Arith. & Logic
Operation
177
7 Basic Instruction
7.7
7.7 ANB
ANB
Outline
Use ANB instruction to connect a branch circuit (parallel circuit block) to the preceding circuit in series.
Use LD or LDI instruction at the start of branch. After completing a parallel circuit block, connect the parallel
circuit block to the preceding circuit in series by ANB instruction.
When there are many parallel circuits, ANB instruction can be used in each circuit block to connect them.
1. Instruction format
Basic Instruction
ANB
1 step
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ANB
AND Block
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
List program
LD
X002
X003
Y007
X001
X004
X005
X006
X003
ORB
Parallel block
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
LD
OR
LD
AND
LDI
AND
ORB
OR
ANB
OR
OUT
X000
X001
X002
X003
X004
X005
It is connected to the
preceding circuit in series.
Caution
There is no limitation in the number of ANB instruction.
Though ANB instructions can be used at one time, note that the repeated use of LD or LDI instruction is
limited to 8 or less in the same way as ORB instruction.
178
7 Basic Instruction
Introduction
7.8
Outline
FX3U and FX3UC PLCs have 11 memories called "Stack" which store the intermediate result (ON or OFF) of
operations.
Overview
1. Instruction format
Basic Instruction
MPS
1 step
Memory Point Store
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MRD
1 step
Memory POP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MPP
Devices
in Detail
Basic Instruction
3
Instruction
List
1 step
Memory Read
MPP
Mnemonic
MPS
Basic Instruction
MRD
2. Applicable devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
MPP
6
Before
Programming
MRD
Specified the
Device &
Constant
Bit Devices
Instruction
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
179
7 Basic Instruction
1. MPS, MRD, and MPP instructions (stores the current result of the internal PLC operations,
reads the current result of the internal PLC operations, and pops (recalls and removes) the
currently stored result)
18
MPS
X004 X005
X006
MRD
MRD
MPP
Y002
Y003
Y004
X007
Y005
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
LD
MPS
AND
OUT
MRD
AND
OUT
MRD
OUT
MPP
AND
OUT
END
X004
X005
Y002
1
2
3
[2]
[1]
X006
Y003
Y004
MPP
MRD
MPS
MPP
10
11
X007
Y005
Stack
Use MPS instruction to store the intermediate result of operation, and then drive the output Y002.
Use MRD instruction to read the stored data, and then drive the output Y003.
MRD instruction can be programmed as many times as necessary.
In the final output circuit, use MPP instruction instead of MRD instruction.
MPP instruction reads the stored data described above, and then resets it.
Error
MPS instruction can be used two or more times.
However, the difference between number of MPS instructions and the number of MPP instructions should be
11 or less, and should be 0 at the end.
180
7 Basic Instruction
1
Introduction
Program examples
1) Program example 1: One stack
Only one stack is used in this example.
Circuit program
List program
MPS
X001
X002
Y000
Y001
MPP
X003
X004
Y002
X005
Y003
MPS
X006
X007
Y004
X010
MRD
X011
MRD
X012
Y007
Y001
X003
X004
Y002
X005
Y003
X006
X007
Y004
X010
Y005
X011
Y006
X012
Y007
Before
Programming
MPP
Y006
X002
Y000
Specified the
Device &
Constant
Y005
X000
X001
Devices
in Detail
MPP
LD
AND
MPS
AND
OUT
MPP
OUT
LD
MPS
AND
OUT
MPP
AND
OUT
LD
MPS
AND
OUT
MRD
AND
OUT
MRD
AND
OUT
MPP
AND
OUT
Instruction
List
MPS
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
Overview
X000
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
181
7 Basic Instruction
List program
MPS
X000
X001
Y000
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
X002
X003
X004
Y001
MRD
X005
X006
X007
Y002
X010
MPP
Y003
X011
LD
MPS
LD
OR
ANB
OUT
MRD
LD
AND
LD
AND
ORB
ANB
OUT
MPP
AND
OUT
LD
OR
ANB
OUT
X000
X001
X002
Y000
X003
X004
X005
X006
Y001
X007
Y002
X010
X011
Y003
X001
List program
X002
Y000
MPS
MPS
X003
MPP
X004
X005
Y001
Y002
MPP
MPS
MPP
182
X006
Y003
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
LD
MPS
AND
MPS
AND
OUT
MPP
AND
OUT
MPP
AND
MPS
AND
OUT
MPP
AND
OUT
X000
X001
X002
Y000
X003
Y001
X004
X005
Y002
X006
Y003
7 Basic Instruction
Circuit program
MPS
List program
MPS
X001
MPS
X002
MPS
X003
X004
Y000
Y001
MPP
MPP
Y003
LD
MPS
AND
MPS
AND
MPS
AND
MPS
AND
X000
X001
X002
X003
X004
0009
0010
0011
0012
0013
0014
0015
0016
0017
OUT
MPP
OUT
MPP
OUT
MPP
OUT
MPP
OUT
Y000
Y001
Y002
Y003
Y004
Instruction
List
Y002
0000
0001
0002
0003
0004
0005
0006
0007
0008
Overview
X000
Introduction
MPP
Y004
MPP
4
Devices
in Detail
X000
Y004
X001
Y003
Y002
X003
Y001
X004
LD
OUT
AND
OUT
AND
OUT
AND
OUT
AND
OUT
X000
Y004
X001
Y003
X002
Y002
X003
Y001
X004
Y000
5
Specified the
Device &
Constant
X002
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
In programming a circuit on the upper side, it is necessary to 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.
Before
Programming
Y000
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
183
7 Basic Instruction
7.9
MC, MCR
Outline
When MC instruction is executed, the bus line (LD or LDI point) is moved to a position after MC contact.
The bus line can be returned to the original position by MCR instruction.
By changing a device (Y or M) number, MC instruction can be used as many times as necessary.
If a same device number is used twice, however, it results in the double coil operation in the same way as
OUT instruction.
1. Instruction format
Basic Instruction
MC
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MC
Master Control
Basic Instruction
MCR
2 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MCR
Master Control
Reset
2. Applicable devices
Bit Devices
Instruction
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3 S
MCR
184
7 Basic Instruction
1
List program
X000
MC
N0
Introduction
Circuit program
N 0
M100
M100
0000
0001
X001
Y000
X002
X000
N000
Three-step instruction
M100
X001
Y000
X002
Y001
N 0 Two-step instruction
2
Overview
0004
0005
0006
0007
0008
LD
MC
SP
LD
OUT
LD
OUT
MCR
Y001
Instruction
List
MCR
N 0
Program examples
Circuit program
List program
X000
MC
N 0
M100
M100
X001
Y000
X002
0000
0001
0004
0005
0006
0007
0008
LD
MC
SP
LD
OUT
LD
OUT
MCR
X000
N000
Three-step instruction
M100
X001
Y000
X002
Y001
N000 Two-step instruction
5
Specified the
Device &
Constant
N0
Devices
in Detail
MCR
N 0
7
MC
N 0
M150
M150
X004
Y002
Basic
Instruction
X003
N0
Before
Programming
Y001
8
FNC00-FNC09
Program Flow
X005
Y003
MCR
N 0
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
185
7 Basic Instruction
X000
MC
N 0
M100
N0
M100
X001
Level N0
The bus line B is active while X000 is ON.
Y000
[B]
While
X002 is
OFF
N1
X002
MC
N 1
M101
N1
M101
X003
[C]
While
X004
is OFF
X004
N2
M102
MC
N 2
X005
[D]
M102
N2
Level N2
The bus line D is active while all of X000,
X002 and X004 are ON.
Y002
MCR
X006
[C]
Level N1
The bus line C is active while both X000 and
X002 are ON.
Y001
N 2
N2
Level N1
The bus line returns to the status of the bus
line C by "MCR N2".
Y003
MCR
X007
N 1
N1
Level N0
The bus line returns to the status of the bus
line B by "MCR N1".
Y004
[B]
MCR
X010
[A]
186
N 0
Y005
N0
Initial status
The bus line returns to the initial status of the
bus line A by "MCR N0". Accordingly, Y005
turns ON or OFF by turning ON or OFF of
X010 without regard to X000, X002 and X004.
7 Basic Instruction
INV
Introduction
7.10
7.10 INV
Outline
1. Instruction Format
Basic Instruction
INV
1 step
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
INV
Inverse
3
Instruction
List
2. Applicable devices
Bit Devices
Instruction
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
List program
Timing chart
Y000
X000 OFF
0 LD
X000
1 INV
2 OUT Y000
Specified the
Device &
Constant
ON
X000
OFF
Y000 ON
ON
OFF
OFF
ON
ON
OFF
Inverted
LD
LD
LD
9
FNC10-FNC19
Move & Compare
LD
8
FNC00-FNC09
Program Flow
When INV instruction is used in a complicated circuit containing ORB and ANB instructions, the operation
range of INV instruction is as shown in the figure below:
7
Basic
Instruction
LD
6
Before
Programming
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.
LD
4
Devices
in Detail
INV
Overview
INV instruction inverts the operation result up to just before INV instruction, and does not require device
number specification.
187
10
FNC20-FNC29
Arith. & Logic
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.
7 Basic Instruction
7.11
MEP, MEF
Outline
MEP and MEF commands are instructions that change the operation results to pulses so that device numbers
do not have to be specified.
1) MEP
The operation results up to the MEP instruction become conductive when the driving contacts turn ON
from OFF.
The use of MEP instructions simplifies the process of changing driving contacts to pulses when multiple
contact points connect in a series.
2) MEF
The operation results up to the MEF instruction become conductive when the driving contacts turn OFF
from ON.
The use of MEF instructions simplifies the process of changing driving contacts to pulses when multiple
contact points connect in a series.
1. Instruction format
Basic Instruction
MEP
1 step
MEP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MEP
Basic Instruction
MEF
1 step
MEF
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
MEF
2. Applicable devices
Bit Devices
Instruction
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
MEF
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
List program
X000 X001
SET
M0
0
1
2
3
LD
X000
AND X001
MEP
SET M0
Timing chart
X000
OFF
X001
OFF
ON
M0
OFF
ON
ON
List program
X000 X001
SET
188
M0
0
1
2
3
X000
LD
AND X001
MEF
SET M0
Timing chart
X000
OFF
X001
OFF
M0
OFF
ON
OFF
ON
OFF
ON
7 Basic Instruction
1. MEP and MEF instructions may not operate normally if the indexed contact is modified and
changed to pulses by sub-routine programs, the FOR and NEXT instructions, etc.
3
Instruction
List
2
Overview
2. As the MEP and MEF instructions operate using the operation results immediately before
them, use at the list program as the AND instruction.
The MEP and MEF instructions cannot be used at the list program as LD or OR.
Introduction
Caution
MEP Instruction
OFF
OFF (non-conductive)
OFF (non-conductive)
ON
ON (conductive)
OFF (non-conductive)
MEF Instruction
Devices
in Detail
Error
There are no calculation errors in the MEP and MEF instructions.
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
189
7 Basic Instruction
7.12
PLS, PLF
Outline
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.
1. Instruction format
Basic Instruction
PLS
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Pulse
PLS
Basic Instruction
PLF
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Pulse Falling
PLF
2. Applicable devices
Bit Devices
Instruction
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
PLS
3 S
PLF
3 S
""
List program
X000
PLS
M0
Timing chart
0000 LD
X000
0001 PLS M 0
X000
PLS
instruction
M 0
ON
ON during
one operation
cycle
In the figure above, M0 is ON during only one operation cycle when X000 changes from OFF to ON.
List program
X000
PLF
M1
Timing chart
0000 LD X000
0001 PLF M 1
X000
PLF
instruction
ON
ON during
one operation
cycle
M 1
In the figure above, M1 is ON during only one operation cycle when X000 changes from ON to OFF.
190
7 Basic Instruction
1
Introduction
<PLS instruction>
M1
M0
PLS
M0
Overview
X000
X000
M1
ON
X000
M 0
Instruction
List
ON during
one operation
cycle
ON
M 1
In each case, M0 is ON during only one operation cycle when X000 changes from OFF to ON.
<PLS instruction>
X000
FNC12
MOV
PLS
M0
K10
D0
FNC12
MOVP
K10
Devices
in Detail
X000
M0
In each case, MOV instruction is executed only once when X000 changes from OFF to ON.
Specified the
Device &
Constant
Caution
1. Cautions on write during RUN
OFF
Not executed
Not executed
*1.
Executed
Not executed
FNC10-FNC19
Move & Compare
ON
*1
8
FNC00-FNC09
Program Flow
7
Basic
Instruction
6
Before
Programming
10
FNC20-FNC29
Arith. & Logic
Operation
191
7 Basic Instruction
7.13
SET, RST
Outline
1) Setting a bit device (SET instruction (set bit device latch ON))
When the command input turns ON, SET instruction sets to ON an output relay (Y), auxiliary relay (M),
state relay (S) and bit specification of word device.
Even if the command input turns OFF after that, the device which was set to ON by SET instruction
remains ON.
2) Resetting a bit device (RST instruction (reset bit device OFF))
RST instruction resets an output relay (Y), auxiliary relay (M), state relay (S), Timer (T), counter (C) or bit
specification of a word device.
Use the RST instruction to reset (set to OFF) a device which was set to ON by SET instruction.
3) Clearing the present value of a word device (RST instruction reset bit device OFF))
RST instruction clears the current value of a timer (T), counter (C), data register (D), extension register
(R) or index register (V)(Z).
RST instruction can be used to clear to "0" the contents of a data register (D) or 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
T246 to T255.
SET and RST instructions can be used for a same device as many times as necessary in an arbitrary
order.
1. Instruction format
Basic Instruction
SET
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SET
SET
Basic Instruction
RST
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
RST
Reset
2. Applicable devices
Bit Devices
Instruction
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
S
1
RST
S
S S
3
S2
1
1 2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S
S2
2
""
3
S S S S
2 2 2 2
S S
2 2
S1: Special auxiliary relays (M) and 32-bit counters (C) cannot be indexed with index registers (V and Z).
S2: State relays (S) and "D.b" cannot be indexed with index registers (V and Z).
192
7 Basic Instruction
SET instruction drives the coil for an output relay (Y), auxiliary relay (M), state relay (S) and bit specification of
data register (D).
List program
X000
SET
Y000
X001
RST
Y000
LD
SET
LD
RST
X000
Y000
X001
Y000
Timing chart
X000
ON
X001
Y000
ON
Instruction
List
0
1
2
3
Overview
SET instructions located in parallel can be used consecutively as many times as necessary.
In the program example shown below, "RST Y000" after "SET Y000" corresponds to this usage.
Circuit program
ON
SET
instruction
RST
instruction
K10
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
193
FNC00-FNC09
Program Flow
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.
Basic
Instruction
Before
Programming
Specified the
Device &
Constant
C 0
C 0
Devices
in Detail
Introduction
7 Basic Instruction
Cautions on using RST instruction for a jumped program, subroutine program or interrupt program
When RST instruction for a timer or counter is executed in a jumped program, subroutine program or
interrupt program, the timer or counter may be kept in the reset status and the timer or counter may be
disabled.
For details, refer to the following sections:
For a jumped program, refer to Subsection 8.1.1.
For a subroutine program, refer to Subsection 8.2.1.
For an interrupt program, refer to Subsection 35.2.3.
3. Indexing
Devices used in SET and RST instructions can be indexed with index registers (V)(Z).
(State relays (S), special auxiliary relays (M), 32-bit counters, "D.b", and word devices cannot be indexed.)
Circuit program
List program
X000
SET Y000Z0
X001
0000 LD
0001 SET
0004 LD
0005 RST
X000
Y000Z0
X001
Y000Z0
RST Y000Z0
List program
X000
SET
D0.3
RST
D0.3
X001
0000 LD
0001 SET
0004 LD
0005 RST
X000
D0.3
X001
D0.3
Caution
When SET and RST instructions are executed for an output relay (Y) in a same operation, the result of the
instruction located nearest the END instruction (which specifies the end of program) is output.
Errors
When an I/O number used in SET or RST instruction does not exist due to indexing, M8316 (Non-existing
I/O specification error) turns ON.
When the device number of a device (M, T or C) other than I/O used in SET or RST instruction does not
exist due to indexing, an operation error (error code: 6706) occurs.
194
7 Basic Instruction
NOP
Introduction
7.14
7.14 NOP
Outline
1. Instruction format
1 step
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
NOP
No Operation
Instruction
List
Basic Instruction
NOP
2. Applicable devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
ANI NOP
OR NOP
6
Before
Programming
Circuit is
disconnected.
Basic
Instruction
Contact becomes
short-circuit.
Specified the
Device &
Constant
AND NOP
Devices
in Detail
Bit Devices
Instruction
2
Overview
ORI NOP
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
195
7 Basic Instruction
7.15
7.15 END
END
Outline
END instruction specifies the end of a program.
(Do not write the END instruction in the middle of a program.)
1. Instruction format
END
Basic Instruction
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
1 step END
END
2. Applicable devices
Bit Devices
Instruction
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
LD
X000
OUT
END
NOP
NOP
Y000
NOP
Output processing
Caution
Do not write END instruction in the middle of a program.
When a program is transferred from a programming tool, all steps after END instruction are replaced with
NOP (no operation) instructions.
196
7 Basic Instruction
MC
S1024 to S4095
T0 to T191,
T200 to T245
T192 to T199,
T246 to T511
Devices
in Detail
SET
RST
X000 to X357
Y000 to Y357
M0 to M1535
M1536 to M3583
M3584 to M7679
S0 to S1023
C200 to C255
Y000 to Y357
M0 to M7679
T0 to T511
S0 to S4095
C200 to C255
D0 to D7999,
Special data registers
D8000 to D8511
Word devices
with index
Bit specification
in word device
D.b,
Special auxiliary relays
D.b
8
FNC00-FNC09
Program Flow
R0 to R32767
D0 to D7999,
Special data registers
D8000 to D8511,
R0 to R32767
7
Basic
Instruction
C0 to C199
6
Before
Programming
X000 to X357
5
Specified the
Device &
Constant
Word devices
C0 to C199
3
Instruction
List
OUT
Overview
Bit devices
with index
LDP, LDF,
ANDP,
ANDF,
ORP, ORF
LD, LDI,
AND, ANI,
OR, ORI
Device
Bit devices
Introduction
7.16
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
197
8.
198
FNC No.
Mnemonic
00
CJ
01
CALL
02
SRET
03
IRET
04
Symbol
Function
Reference
CJ
Pn
Conditional Jump
Section 8.1
CALL
Pn
Call Subroutine
Section 8.2
SRET
Subroutine Return
Section 8.3
IRET
Interrupt Return
Section 8.4
EI
EI
Enable Interrupt
Section 8.5
05
DI
DI
Disable Interrupt
Section 8.6
06
FEND
FEND
Section 8.7
07
WDT
WDT
Section 8.8
08
FOR
Section 8.9
09
NEXT
Section
8.10
FOR
NEXT
Introduction
8.1
Outline
1. Instruction format
FNC 00
CJ
16-bit Instruction
3 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
CJ
Instruction
List
CJP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Pn
Description
Data type
Pointer number (P) indicating the label number for the jump destination
(n = 0 to 4095) (P63 jumps to END instruction.)
Pointer number
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
P
3
Pn
User program
which is skipped and is not executed when the command turns ON
Label
Pn
Command ON
input
CJ
Basic
Instruction
CJ
8
FNC00-FNC09
Program Flow
User program
CJP
Pn
Pn
User program
which is skipped and is not executed in one operation cycle
when the command turns ON
Command
input
ON
CJP
Executed in one scan.
10
FNC20-FNC29
Arith. & Logic
Operation
User program
FNC10-FNC19
Move & Compare
Command
6
Before
Programming
While the command input is ON, CJ or CJP instruction executes a program with a specified label (pointer
number).
5
Specified the
Device &
Constant
Pn
Label
Pn
4
Devices
in Detail
3. Applicable devices
Operand
Type
2
Overview
CJ or CJP instruction jumps to a pointer (P); The sequence program steps between CJ or CJP instruction and
the pointer are not executed.
CJ and CJP instructions reduce the cycle time, and allow programs with double coils.
199
Cautions
1. Relationship between the label input position and the list program
The figure below shows programming of a label.
When creating a circuit program, move the cursor to the left side of the bus line in the ladder diagram, and
input a label (P) at the head of the circuit block.
X030
FNC 00
CJ
LD
CJ
P 20
X031
Pointer
Y010
X032
Label
P 20
Bus
line
Y011
X030
P 20
LD
X031
OUT Y010
P 20
LD
X032
OUT Y011
Label
X022
FNC 00
CJ
P 10
FNC 00
CJ
P 9
FNC 00
CJ
P 9
X021
Label
P 9
X030
Bad
Label
P9
User program
Label
P9
User program
FNC 00
CJ
P9
Good
FNC 00
CJ
P9
Good
END
200
1
Introduction
2
Overview
Label
P 63
P 63
END
3
Instruction
List
FNC 00
CJ
P15
Bad
4
X001
FNC 01
CALLP
C0
P15
RUN monitor
(normally ON)
Subroutine program
dedicated to CALL
instruction
User program
Specified the
Device &
Constant
M8000
Good
K10
FNC 06
FEND
Label
P15
Devices
in Detail
X000
FNC 02
SRET
Because M8000 is normally ON while a PLC is operating, unconditional jump is specified when M8000 is
used in the following example:
M8000
RUN monitor
FNC00
CJ
P5
Basic
Instruction
User program
(It is skipped, and is not executed.)
Label
P5
Before
Programming
User program
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
201
Program example
1. When jump is necessary after the OFF processing
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 label P7 turn
OFF.
X023
M0
PLS
M0
FNC00
CJ
P7
X023
Label
P7
202
User program
0
4
8
11
18
22
X002
X003
X004
X005
X006
X007
X010
29
Label
P 8
35
40
X000
X012
M1
S1
T0
K 10
RST
T246
T246 K1000
RST
C0
C 0
K 20
FNC 12
MOV
K 3
FNC 00
CJ
P 9
D 0
Y001
Label
P 9
42
X013
T246
RST
C 0
10 ms timer and
100 ms timer (T0)
X004 OFF
X004 ON
X005 OFF
X006 OFF
X005 OFF
X006 ON
X007 OFF
X010 OFF
X007 OFF
X010 ON
X011 ON
10
FNC20-FNC29
Arith. & Logic
Operation
X011 OFF
FNC10-FNC19
Move & Compare
Applied instruction
(MOV)
FNC00-FNC09
Program Flow
Counter
(C0)
Y, M, S
(Y001, M1, S1)
1 ms timer
(T246)
Basic
Instruction
RST
Before
Programming
11th
circuit
X011
Y001
Specified the
Device &
Constant
25
P 8
Devices
in Detail
15
X001
FNC 00
CJ
Instruction
List
X000
2
Overview
In the program example shown below, when X000 turns ON, the program execution jumps from CJ instruction
in the first circuit to the label P8.
While X000 is OFF, jump is not executed; The program is executed from the 1st step in turn, and then the
program execution jumps from CJ instruction in the 11th circuit to the label P9.
Instructions skipped by jump are not executed.
Introduction
8.1.1
203
2. Circuit example 2 for explaining operations (when only an RST instruction for a timer or
counter is jumped)
X012
C0
X011
K10
FNC 00
CJ
X010
P0
RST
C0
Label
P0
Timing chart
Jump operation by CJ
instruction driven by X011
X012
Because C0 remains
Current
value of C0
X010
ON
RST
C0
Remains reset.
Program example for activating a timer and counter even during a jump
X012
C0
X011
K10
FNC 00
CJ
X010
P0
RST
C0
RST
C0
Label
P0
M8000
Timing chart
Jump operation by CJ
instruction driven by X011
X012
Current
value of C0
Counter
is reset.
X010
ON
RST
C0
*1
204
CJ P 0
MC N 0 M 1
CJ P 4
MCR N 0
P 2
CJ P 3
P 4
MCR N 0
Specified the
Device &
Constant
MCR N 0
Master control
CJ P 2
Devices
in Detail
Master control
MC N 0 M 2
[3] Jump from inside MC to
inside MC
Jump is disabled while
M0 is OFF.
3
Instruction
List
P 1
Master control
MC N 0 M 0
Overview
CJ P 1
Introduction
8.1.2
P 3
6
Before
Programming
P 0
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
205
8.2
Outline
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 (FNC 06) and SRET (FNC 02) instructions are required.
1. Instruction format
FNC 01
CALL
16-bit Instruction
3 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
CALL
CALLP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
Pointer number (P) indicating the label number for the jump destination
(P0 to P62 and P64 to P4095)
Pn
Pointer number
For the pointer Pn in CALL instruction, P0 to P62 and P64 to P4095 can be specified.
Because P63 is dedicated to CJ (FNC 00) instruction (for jump to END step), it cannot be used as a pointer
for CALL (FNC 01) instruction.
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
Pn
P
3
FNC 01
CALL
User program
Label
Pn
Main program
Program area from the step 0 to FEND
instruction
FNC 06
FEND
M8000
RUN monitor
(normally ON)
User program
FNC 02
SRET
206
Pn
Pn
Subroutine program
Program area from a label Pn to SRET
instruction
1
Introduction
Caution
1. Using a label (P) number two or more times
In CALL instructions, a same number can be used two or more times in operands (P).
However, do not use a label (P) and number used in another instruction (CJ instruction).
FNC 00
CJ
P9
X030
FNC 01
CALLP
P9
2
Overview
X020
Bad
3
Instruction
List
Label
P9
User program
Program examples
Devices
in Detail
X000
P 10
Main program
While X000 is ON, the program execution jumps to a
step with the label P10.
FNC 06
FEND
Specified the
Device &
Constant
Label
P 10
Subroutine program
When SRET instruction is executed after the subroutine
program has executed, the program execution returns to
the original step +1.
FNC 02
SRET
6
Before
Programming
END
P 11
FNC 06
FEND
X002
Label
P 12
X003
FNC 01
CALL
FNC 02
SRET
Subroutine program 1
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
label P12.
Subroutine program 2
The subroutine program with P12 is executed, and then
the program execution returns to the subroutine program
with P11 by SRET instruction.
FNC10-FNC19
Move & Compare
FNC 02
SRET
P 12
Main program
When X001 turns ON from OFF, the program execution
jumps to the label P11 only once.
FNC00-FNC09
Program Flow
Label
P 11
Basic
Instruction
X001
END
10
FNC20-FNC29
Arith. & Logic
Operation
207
8.2.1
FNC 01
CALLP
X001
C0
P0
K10
FNC 06
FEND
P0
X000
RST
C0
Y007
FNC 02
SRET
2) Timing chart
Execution of
subroutine P0
triggered by X000
Subroutine is executed.
X001
Current
value of C0
Counter
is reset.
RST
C0
Remains reset.
Y007
208
1
Introduction
FNC 01
CALLP
X001
X002
K10
RST
Y007
Overview
C0
P0
FNC 06
FEND
X000
RST
C0
RST
C0
Instruction
List
P0
3
A
M8001
4
Devices
in Detail
RUN monitor
(normally OFF)
Y007
FNC 02
SRET
5
Specified the
Device &
Constant
2) Timing chart
Subroutine is
executed.
Execution of P0 is
triggered by X000
X001
RST
C0
Before
Programming
Current
value of C0
7
Basic
Instruction
Y007
X002
Y007 is reset.
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
209
8.3
Outline
This instruction returns the program execution from a subroutine to the main program.
1. Instruction format
FNC 02
SRET
Operation Condition
Continuous
Operation
1 step SRET
2. Set data
Operand type
Description
Data type
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
210
Introduction
8.4
Outline
This instruction returns the program execution from an interrupt routine to the main program.
FNC 03
IRET
Overview
1. Instruction format
Operation Condition
Continuous
Operation
1 step IRET
3
Instruction
List
2. Set data
Operand type
Description
Data type
3. Applicable devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
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 three types of jump to an interrupt routine.
Interrupt No.
Description
Reference
I00* to I50*
Timer interrupt
I6** to I8**
Section 35.5
Counter interrupt
I010 to I060
Section 35.6
7
Basic
Instruction
Input interrupt
Section 35.3
and
Section 35.4
6
Before
Programming
Specified the
Device &
Constant
Function
Devices
in Detail
Operand
Type
Bit Devices
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
211
Program example
FNC 04
EI
M8000
C255
Main program
Interrupt
pointer
I001
FNC 06
FEND
The rising edge of X000 is detected.
FNC 03
IRET
Interrupt
pointer
I620
Interrupt
pointer
I010
Input interrupt
routine
Interrupt every 20 ms
FNC 03
IRET
Timer interrupt
routine
FNC 03
IRET
212
Introduction
8.5
Outline
2
Overview
1. Instruction format
FNC 04
EI
Operation Condition
Continuous
Operation
1 step EI
Instruction
List
2. Set data
Operand type
Description
Data type
Devices
in Detail
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Z Modify K H
""
5
Specified the
Device &
Constant
Index
ConReal
CharacPointer
stant Number ter String
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
213
8.6
Outline
This instruction disables interrupts after interrupts were enabled by EI (FNC 04) instruction.
1. Instruction format
FNC 05
DI
Operation Condition
Continuous
Operation
1 step DI
2. Set data
Operand type
Description
Data type
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
Cautions
Interrupts (requests) generated after DI instruction are processed after EI (FNC 04) instruction is executed
214
Introduction
8.7
Outline
FNC 06
FEND
Overview
1. Instruction format
Operation Condition
Continuous
Operation
1 step FEND
3
Instruction
List
2. Set data
Operand type
Description
Data type
3. Applicable devices
Operand
Type
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
P 20
Main routine
program
Jump
FNC 00
CJ
Basic
Instruction
Main routine
program
X010
FNC 06
FEND
FNC 06
FEND
When X010 is ON
Main routine
program
8
FNC00-FNC09
Program Flow
P20
6
Before
Programming
Specified the
Device &
Constant
Devices
in Detail
Bit Devices
9
FNC10-FNC19
Move & Compare
END
10
FNC20-FNC29
Arith. & Logic
Operation
215
FNC 01
CALL
P 21
Main routine
program
When X011
is ON
FNC 06
FEND
P21
Subroutine
program
I100
Interrupt routine
program
END
Cautions
1. When FEND instruction is programmed two or more times
Put a subroutine program or interrupt routine program between last FEND instruction and END instruction.
216
Introduction
8.8
Outline
FNC 07
WDT
1 step
Overview
1. Instruction format
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WDT
WDTP
3
Instruction
List
2. Set data
Operand type
Description
Data type
3. Applicable devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
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.
FNC 07
WDTP
Command
contact
Basic
Instruction
Command
input
FNC 07
WDT
Each scan is
executed.
D8000
Name
Watchdog timer time
FNC00-FNC09
Program Flow
Related device
Device
6
Before
Programming
Command
contact
Specified the
Device &
Constant
Command
input
Devices
in Detail
Operand
Type
Bit Devices
Description
Up to 32767 ms can be set in units of ms (initial value: 200 ms).
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
217
Cautions
1. When a watchdog timer error occurs
A watchdog timer error may occur in the following cases. To avoid the error, input a program shown below
near the head step to extend the watchdog timer time, or shift FROM/TO instruction execution timing.
1) Caution when many special extension devices are connected
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.
2) 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
extension time may become longer, and a watchdog timer error may occur.
3) 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.
FNC 12
MOV
0
Initial pulse
K300
D8000
FNC 07
WDT
Program examples
1. When the operation cycle is long and causes an error
For example, by dividing a program whose operation cycle is 240 ms into two portions and inserting WDT
instruction between them, the operation cycle becomes less than 200 ms in both the former half portion and
the latter half portion.
Program whose
operation cycle
is 120 ms
Program
whose
operation cycle
is 240 ms
FNC07
WDT
Program whose
operation cycle
is 120 ms
END
END
2. When a label (P) of CJ instruction is located in a step number smaller than the step number
of CJ instruction
Put WDT instruction after the label (P).
M8000
Label
Pn RUN monitor
FNC 07
WDT
Program
Command
218
FNC00
CJ
Pn
1
Introduction
2
Overview
Program
FNC 07
WDT
FNC 09
NEXT
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
219
8.9
Outline
FOR instruction specifies the number of repetition of the loop between FOR and NEXT (FNC 09) instructions.
1. Instruction format
FNC 08
FOR
16-bit Instruction
3 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
Continuous
Operation
FOR
Operation Condition
2. Set data
Operand type
S
Description
Data type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
3 3
Related instruction
FOR instruction and NEXT (FNC 09) instruction are set as a pair in programming.
220
Introduction
8.10
Outline
FNC 09
NEXT
Overview
1. Instruction format
Operation Condition
Continuous
Operation
1 step NEXT
3
Instruction
List
2. Set data
Operand type
Description
Data type
3. Applicable devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
The loop between FOR and NEXT instructions is repeated "n" times (which is specified by the source data).
After the loop is repeated by the specified number of times, steps after NEXT instruction are executed.
S
Repeated " S "
times.
Before
Programming
FNC 09
NEXT
Specified the
Device &
Constant
FNC 08
FOR
Devices
in Detail
Operand
Type
Bit Devices
Related instruction
Basic
Instruction
NEXT instruction and FOR (FNC 08) instruction are set as a pair in programming.
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
221
Caution
1. Limitation in the number of nesting
FOR-NEXT loop can be nested up to 5 levels.
FOR
FOR
FOR
FOR
1st
level
FOR
NEXT
2nd
level
1st
2nd 3rd
level level level
NEXT
FOR
1st
level
NEXT
NEXT
NEXT
NEXT
Errors
1. Watchdog timer error
When FOR-NEXT loop is repeated many times, the operation cycle (D8010) is too long, and a watchdog
timer error may occur. In such a case, change the watchdog timer time or reset the watchdog timer.
For details on changing the watchdog timer time, refer to Subsection 36.2.2.
For resetting the watchdog timer, refer to WDT (FNC 07) instruction.
NEXT
FOR
FOR
NEXT
FOR
FOR
FOR
FEND
NEXT
NEXT
NEXT
Not programmed
END
NEXT
222
Not programmed
1
Introduction
Program example
1. Program with three FOR-NEXT loops
FNC 08
FOR
K 4
Overview
FNC 00
CJ
P 22
FNC 08
FOR
K1X000
FNC 09
NEXT
FNC 09
NEXT
[1]
7
times
6
times
4
times
[2]
[3]
X010 = ON
0 time
24 times
4 times
5
Specified the
Device &
Constant
1]
2]
3]
4
Devices
in Detail
FNC 09
NEXT
Instruction
List
P 22
D 0Z
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
223
9.
224
FNC No.
Mnemonic
Symbol
Function
10
CMP
CMP
11
ZCP
12
MOV
13
SMOV
14
CML
15
BMOV
16
FMOV
17
XCH
XCH
18
BCD
19
BIN
Reference
Compare
Section 9.1
Zone Compare
Section 9.2
Move
Section 9.3
Shift Move
Section 9.4
Complement
Section 9.5
BMOV S D n
Block Move
Section 9.6
FMOV S D n
Fill Move
Section 9.7
D1 D2
Exchange
Section 9.8
BCD
S D
Section 9.9
BIN
S D
Conversion to Binary
ZCP
S1 S2 D
S1 S2 S D
MOV
S D
SMOV S m1 m2 D n
CML
S D
Section
9.10
Introduction
9.1
Outline
2
Overview
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.
1. Instruction format
Mnemonic
16-bit Instruction
7 steps
Operation Condition
CMP
CMPP
Operation Condition
DCMP
13 steps
DCMPP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
3
Instruction
List
FNC 10
CMP
2. Set data
Operand Type
Description
Data Type
16- or 32-bit binary
S2
Bit
3. Applicable devices
Word Devices
System User
Digit Specification
System User
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3
""
6
Before
Programming
Others
The comparison value S1 and the comparison source S2 are compared with each other. According to
the result (smaller, equal or larger), either one among D , D +1 and D +2 turns ON.
S2
Command
input
S1
S2
FNC00-FNC09
Program Flow
Command
input
Basic
Instruction
Specified the
Device &
Constant
Operand
Type
Bit Devices
4
Devices
in Detail
S1
51
50
49
S2
D +2
D +1
S1
FNC10-FNC19
Move & Compare
D +1
48
Latched
Latched
D +2
10
D ,
D +1 and
D +2 latch
225
FNC20-FNC29
Arith. & Logic
Operation
Latched
Even if the command input turns OFF and CMP instruction is not executed,
the status just before the command input turns OFF from ON.
+1, S1
] [ S2
+1, S2
Command
input
FNC 10
DCMP
S1
S2
D +1
D +2
51
50
49
S2 +1, S2
48
S1 +1, S1
D
Latched
D +1,
Latched
D +2,
Even if the command input turns OFF and DCMP instruction is not executed,
the status just before the command input turns OFF from ON.
D ,
D +1 and
Latched
D +2 latch
Caution
1. Number of occupied devices
From the device specified as
, three devices are occupied. Make sure not to use those devices in another control.
Program examples
1. When comparing the current value of a counter
S1
S2
K100
C 20
M 0
X000
X000
FNC 10
CMP
M 0
M 1
M 2
101
100
C20
99
M0
M1
M2
Latched Latched Latched
in the
in the
in the
ON
ON
ON
status. status. status.
If it is necessary to clear the comparison result when the instruction is not executed, add the following
contents under the above program.
1) RST instruction
X000
RST
M0
RST
M1
RST
M2
2) ZRST instruction
X000
226
FNC 40
ZRST
M0
M2
M0 to M2 are reset.
Introduction
9.2
Outline
2
Overview
This instruction compares two values (zone) with the comparison source, 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.2.
1. Instruction format
16-bit Instruction
9 steps
Mnemonic
Operation Condition
ZCP
ZCPP
Operation Condition
DZCP
17 steps
DZCPP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
S2
Bit
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
3 3
3 3
""
6
Before
Programming
S1
Specified the
Device &
Constant
Bit Devices
Devices
in Detail
S1
3. Applicable devices
Operand
Type
3
Instruction
List
FNC 11
ZCP
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
227
FNC 11
ZCP
D
S1
S2
D +1
D +2
>
S2 ] ".
Even if the command input turns OFF and ZCP instruction is not executed,
the status just before the command input turns OFF from ON.
D , D +1 and
D +2 latch
FNC 11
DZCP
D
S1
S2
Even if the command input turns OFF and ZCP instruction is not executed,
the status just before the command input turns OFF from ON.
228
D ,
D +1 and
D +2 latch
, three devices are occupied. Make sure not to use devices used in
S2
K100
K120
C30
M3
M 4
C30
M 5
S1
S2
K120
K100
C30
M3
It is handled as
K120 S1 .
Turns ON in the case of
"K120 > C30 (Current value)" .
Turns ON in the case of
"K120 = C30 (Current value)" .
Turns ON in the case of
"K120 < C30 (Current value)" .
X000
C30
99
119
120
121
100
M3
Before
Programming
M 4
M3
Specified the
Device &
Constant
M 3
100
M5
X000
ZCP
121
M4
99
119
120
Devices
in Detail
M 5
X000
Instruction
List
M 3
X000
ZCP
Overview
Introduction
Cautions
M4
M5
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
229
9.3
Outline
This instruction transfers (copies) the contents of a device to another device.
1. Instruction format
FNC 12
MOV
16-bit Instruction
5 steps
Mnemonic
Operation Condition
MOV
MOVP
Operation Condition
DMOV
9 steps
DMOVP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
Index
S
D
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
FNC 12
MOV
D
S
Before
execution
After
execution
FNC 12
MOV
K1X000 K1Y000
S :K1X000
X3 X2 X1 X0
D :K1Y000
Y3 Y2 Y1 Y0
ON OFFOFF ON
ON ON ON OFF
X3 X2 X1 X0
Transfer
ON OFFOFF ON
Command contact
S
Y3 Y2 Y1 Y0
ON OFFOFF ON
X000
ON
X001
OFF
X002
OFF
X003
ON
Y000 OFF
ON
Y001 ON
OFF
Y002 ON
Y003
230
ON
OFF
ON
1
Introduction
FNC 12
MOV
D50
D :D50
:D10
K50
Command contact
Overview
Before
execution
D10
ON
K0
50
S
Transfer
After
execution
K50
K50
50
Instruction
List
+1,
S +1, S
][
+1,
D +1, D ]
Specified the
Device &
Constant
FNC 12
DMOV
D :K8Y000
Y37 to Y1 Y0
ON OFFOFF ON
ON ON ON OFF
Transfer
X37 to X1 X0
Y37 to Y1 Y0
ON OFFOFF ON
Command contact
ON OFFOFF ON
ON
X000
ON
X001
OFF
S :K8X000
X37 to X1 X0
OFF
X037
ON
Y000 OFF
ON
Y001 ON
OFF
ON
OFF
ON
FNC00-FNC09
Program Flow
Y037
7
Basic
Instruction
After
execution
K8X000 K8Y000
Before
Programming
Before
execution
FNC 12
DMOV
Command
input
D10
D50
:D11,D10
K500000
D :D51,D50
Command contact
ON
K4321
S
10
500000
Transfer
K500000
K500000
4321
FNC20-FNC29
Arith. & Logic
Operation
After
execution
FNC10-FNC19
Move & Compare
Before
execution
FNC 12
DMOV
Devices
in Detail
+1,
500000
231
Program examples
1. When reading the current value of a timer and counter
X001
FNC 12
MOV
T 0
D 20
FNC 12
MOV
K100
D 10
(K100) (D 10)
FNC 12
MOV
K 50
D 10
(K50) (D 10)
M 0
T 20
D 10
M8000
RUN monitor
FNC 12
MOV
K1X000 K1Y000
X002
Y002
X003
Y003
232
FNC 12
DMOV
FNC 12
DMOV
D0(D1) D10(D11)
C235
D20(D21)
Introduction
9.4
Outline
FNC 13
SMOV
16-bit Instruction
11 steps
Mnemonic
Operation Condition
SMOV
SMOVP
Overview
1. Instruction format
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
3
Instruction
List
2. Set data
Operand Type
Description
Data Type
m1
16-bit binary
m2
16-bit binary
16-bit binary
16-bit binary
16-bit binary
4
Devices
in Detail
3. Applicable devices
Bit Devices
System User
Word Devices
Digit Specification
System User
Special
Unit
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
3 3 3 3
3 3
""
6
Before
Programming
3 3
m2
3
m1
Others
Specified the
Device &
Constant
Operand
Type
3
3 3
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
233
When the command input turns ON, only the specified digits in the transfer destination D are changed.
The transfer source S
and unspecified digits in the transfer destination D do not change.
Command
input
FNC 13
SMOV
m1
m2
Data is automatically
converted. [1]
103
102
101
100
Command contact = ON
103
102
101
100
Data is automatically
Do not change.
converted. [3]
[1]
2. Extension function
When M8168 is set to ON first and then SMOV instruction is executed, conversion from binary to BCD is not
executed.
Data is moved in units of 4 bits.
M8168
X010
FNC 13 D 1
SMOV
M8168
X010
K 4
K 2
D 2
K 3
Program example
The data on three-digit digital switches are composed, and stored as binary data to D2.
102
101
100
X003 to X000
1
8
M8000
K2X020
D 2
FNC 19
BIN
K1X000
D 1
X027 to X020
PLC
234
FNC 19
BIN
FNC 13
SMOV
D 1
K 1
K 1
D 2
K 3
Introduction
9.5
Outline
This instruction inverts data in units of bit, and then transfers (copies) the inverted data.
FNC 14
CML
Mnemonic
16-bit Instruction
Operation Condition
CML
CMLP
5 steps
Operation Condition
DCML
9 steps
DCMLP
Continuous
Operation
Pulse (Single)
Operation
Overview
1. Instruction format
Continuous
Operation
Pulse (Single)
Operation
3
Instruction
List
2. Set data
Operand Type
Description
Data Type
4
Devices
in Detail
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
This operation is useful when a logically inverted output is required as an output from a PLC.
7
FNC 14
CML
b15 b14
1
0
b13
1
b12
0
b11
1
b11
0
Basic
Instruction
Command
input
b9
1
b8
0
b7
0
b6
0
n5
1
b4
1
b3
1
b2
0
b1
1
b0
0
8
FNC00-FNC09
Program Flow
Before
Programming
5
Specified the
Device &
Constant
ConReal
CharacPointer
stant Number ter String
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
235
+1,
+1,
This operation is useful when a logically inverted output is required as an output from a PLC.
Command
input
FNC 14
DCML
b31
1
b30
0
b29
1
S +1, S
b28
0
b27
1
b26
0
b25
1
to
+1, D
b7
0
b6
0
n5
1
b4
1
b3
1
b2
0
b1
1
b0
0
Program examples
1. When receiving an inverted input
The sequence program shown below can be written by CML instruction.
X000
X000
M0
M0
X001
X001
M1
M1
X002
X002
M2
M2
X003
X003
M3
M3
M8000
FNC 14
CML
RUN monitor
K1X000
K1M0
2. When four bits are specified for a device with digit specification
X000
S
D0
FNC 14
CML
Y015 b14
1
0
D 0
K1Y000
b13
1
b12
0
b11
1
(D 0) (K1Y000)
b11
0
b9
1
b8
0
b7
1
b6
0
n5
1
b4
0
b3
1
b2
0
b1
1
b0
0
X000 = ON
0
1
0
1
D
K1Y000 Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
Do not change.
236
Inverted data is
transferred.
Introduction
9.6
Outline
FNC 15
BMOV
16-bit Instruction
7 steps
Mnemonic
Operation Condition
BMOV
BMOVP
Overview
1. Instruction format
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
3
Instruction
List
2. Set data
Operand Type
Description
Data Type
16-bit binary
16-bit binary
16-bit binary
4
Devices
in Detail
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
S
D
Z Modify K H
3 3 3 3
3 3 3 3
""
3 3
to
Before
Programming
at one time.
If the device number range is exceeded, data is transferred within the possible range.
S +1
D +1
S +n
Basic
Instruction
FNC 15
BMOV
Command
input
"n" points
D +n
To prevent overwriting before transfer of source data, data is automatically transferred in the order "[1] [2]
[3]" according to the number overlap status.
FNC 15
BMOV
D 10
D 9
K 3
D 10
D 11
X002
FNC 15
BMOV
D 10
D 11
K 3
D 10
D 11
D 12
[2]
[3]
[3]
[2]
[1]
D 9
D 10
D 11
FNC10-FNC19
Move & Compare
D 12
[1]
FNC00-FNC09
Program Flow
X001
5
Specified the
Device &
Constant
ConReal
CharacPointer
stant Number ter String
Index
D 11
D 12
10
D 13
FNC20-FNC29
Arith. & Logic
Operation
237
*1
M8024
S
X000
FNC 15
BMOVP
D5
D
D10
M8001
K3
*1BMOV
M8024 direction
inverse flag:
OFF
Normally OFF
during operation
*1.
BMOV
direction
inverse flag
n
BMOV direction
inverse flag
Transfer
direction
D5 D10
D6 D11
D7 D12
M8024*1 : ON
D5 D10
D6 D11
D7 D12
Caution
When specifying digits of bit devices, specify a same number of digits for
FNC 15
BMOV
K1M0
K1Y000
238
and
n
K 2
M8024*1 : OFF
M8024 is cleared when the PLC mode is changed from RUN to STOP.
M8000
M 0
Y000
M 1
Y001
M 2
Y002
M 3
Y003
n=2
M 4
Y004
M 5
Y005
M 6
Y006
M 7
Y007
1) Outline of setting
File registers (D1000 to D7999) do not exist in the initial status. They are valid only when some number
of file registers are secured by parameter setting in a programming tool.
Other applied
instructions
When restoring the power, data registers set as file registers are automatically copied from the file
register area [A] to the data register area [B].
Data
When power
memory
is turned ON
When PLC
Data register
mode is
changed from
D1000
STOP to
Data register
RUN
[B]
D7999
7
Basic
Instruction
D1000
500 points
File register
14 blocks
[A]
maximum
(7000 points
maximum)
D0
Before
Programming
Program/
comment
Inside system
RAM
5
Specified the
Device &
Constant
Remarks
Program
memory
4
Devices
in Detail
Contents of transfer
BMOV
instruction
Instruction
List
Instruction
2
Overview
By parameter setting, D1000 to D7999 can be handled as file registers, and written to and read from the
program memory area.
Introduction
9.6.1
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
239
2. Cautions on use
1) When updating the contents of a file register with a same number (same-number update mode), make
sure that the file register number is equivalent between S
and D .
2) When using file registers in the same-number update mode, make sure that the number of transfer points
specified by "n" does not exceed the file register area.
3) If the file register area is exceeded while file registers are used in the same-number update mode, an
operation error (M8067) is caused and the instruction is not executed.
4) In the case of indexing (in the same-number update mode)
When S
and D are indexing with index, the instruction is executed if the actual device number is
within the file register area and the number of transfer points does not exceed the file register area.
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 memory cassette.
- 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, make 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 insertion of WDT instruction in a user program.
6) File register operation
File registers are secured inside the built-in memory or memory cassette.
Different from general data registers, file registers can be read and written only by peripheral equipment
or BMOV (FNC 15) instruction.
7) If a file register is not specified as the destination in BMOV (FNC 15) instruction, the file register is not
accessed.
a) Outline of memory operation
Inside built-in RAM or
optional cassette
Inside system
RAM
D0
D200
Program
memory
D1000
500 points
14 blocks
maximum
(7000 points
maximum)
File register
[A]
Program/
comment
Image
memory
b) Program example
When X000 is set to ON, the data register area [B] is read.
X000
FNC 15
BMOVP
D1100
D200
K400
240
Introduction
9.7
Outline
FNC 16
FMOV
16-bit Instruction
7 steps
Mnemonic
Overview
1. Instruction format
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DFMOV
13 steps
DFMOVP
Continuous
Operation
Pulse (Single)
Operation
FMOV
FMOVP
Instruction
List
2. Set data
Operand Type
Description
Data Type
Head word device number of transfer destination (Same data is transferred from
the transfer source at one time.)
4
Devices
in Detail
16-bit binary
3. Applicable devices
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
S
D
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
3 3
3 3
Before
Programming
While the command input is ON, the data of the transfer source
Basic
Instruction
If the number of points specified by "n" exceeds the device number range, data is transferred within the
possible range.
While the command input is OFF, the transfer destination
5
Specified the
Device &
Constant
Operand
Type
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
241
FNC 16
FMOV
D
D +1
D +2
D +3
D +4
+1,
+1,
].
The contents will be the same among all of "n" 32-bit devices.
If the number of points specified by "n" exceeds the device number range, data is transferred within the
possible range.
While the command input is OFF, the transfer destination [ D
+1,
While the command input is ON, the data of the transfer source [ S
When a constant (K) is specified as the transfer source [ S
binary.
X000
FNC 16
DFMOV
S +1, S
+1,
D +1, D
D +3, D +2
D +5, D +4
D +7, D +6
D +9, D +8
242
+1,
1
Introduction
Program example
1. When writing specified data to two or more devices
X000
K 0
D 0
K 5
S
K0
2
Before
execution
After
execution
K 3
K 0
K0
D1
K 5
K 0
K0
D2
K 65
K 0
K0
D3
K 7
K 0
D4
K100
K 0
4
Devices
in Detail
D0
Instruction
List
K0
K0
Overview
FNC 16
FMOV
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
243
9.8
Outline
This instruction exchanges data between two devices.
1. Instruction format
FNC 17
XCH
16-bit Instruction
5 steps
Mnemonic
Operation Condition
XCH
XCHP
Operation Condition
DXCH
9 steps
DXCHP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
D1
D2
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
Others
Special
Unit
System User
Index
Z Modify K H
D1
3 3 3 3
3 3
D2
3 3 3 3
3 3
FNC 17
XCHP
D1
and D2
D2
D1
Before
execution
D2
After
execution
D1
K10
K36
D1
D2
K10
K36
Exchange
D2
FNC 17
DXCHP
D1
D2
+1, D1
] and [ D2
D1 +1, D1
Before execution
244
ConReal
CharacPointer
stant Number ter String
+1, D2
D2 +1, D2
After execution
K1433600 =
D1 +1, D1
D2 +1, D2
D1 +1, D1
K10000
D2 +1, D2
K10000
K1433600
Exchange
].
""
X000
M8160
SWAP
FNC 17
DXCH
D 10
D 10
D 10
High-order 8 bits Low-order 8 bits
M8000
Instruction
List
D 11
M8160
2
Overview
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.
Because this instruction works in the same way as SWAP (FNC147) instruction, use SWAP instruction when
programming new exchange.
In a 32-bit operation, high-order 8 bits (byte) and low-order 8 bits (byte) of each word device are exchanged
for each other.
Introduction
Extension function (function compatible between the FX2 Series and the FX2C Series)
Error
Devices
in Detail
An operation error occurs in the following case. The error flag M8067 turns ON, and the error code is stored
in D8067.
and D2
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
245
9.9
Outline
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 sevensegment display unit equipped with BCD decoder.
1. Instruction format
FNC 18
BCD
16-bit Instruction
5 steps
Mnemonic
Operation Condition
BCD
BCDP
Operation Condition
DBCD
9 steps
DBCDP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
S
D
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
FNC 18
BCD
and
PLC
BCD (FNC 18)
BIN
BCD
246
Number of digits
Data range
K1Y000
0 to 9
K2Y000
00 to 99
K3Y000
000 to 999
K4Y000
0000 to 9999
+1,
FNC 18
DBCD
+1,
+1,
].
BIN
PLC
DBCD (FNC 18)
] and [ D
2
Overview
Command
input
Introduction
3
Instruction
List
BCD
4
+1, D
Number of digits
Devices
in Detail
[ D
Data range
K1Y000
0 to 9
K2Y000
00 to 99
K3Y000
000 to 999
K4Y000
0000 to 9999
K5Y000
00000 to 99999
K6Y000
000000 to 999999
K7Y000
0000000 to 9999999
K8Y000
00000000 to 99999999
5
Specified the
Device &
Constant
6
Before
Programming
Related instruction
Instruction
BIN (FNC 19)
Function
Converts binary-coded decimal (BCD) data into binary (BIN) data.
Cautions
Because conversion between binary-coded decimal data and binary data is automatically executed in SEGL
(FNC 74) and ARWS (FNC 75) instructions, BCD instruction is not required.
When receiving the digital switch information in the binary-coded decimal (BCD) format into a PLC, use
BIN (FNC 19) instruction for converting BCD data into binary data.
When outputting data to the seven-segment display unit handling binary-coded decimal (BCD) data, use
BCD (FNC 18) instruction for converting binary data into BCD data.
In BCD or BCDP (16-bit type) instructions, an operation error occurs when the S
range from 0 to 9999.
In DBCD or DBCDP (32-bit type) instructions, an operation error occurs when the S
range from 0 to 99,999,999.
9
FNC10-FNC19
Move & Compare
Errors
8
FNC00-FNC09
Program Flow
Binary data is used in all operations in PLCs including arithmetic operations (+, , and ), increment and
decrement instructions.
Basic
Instruction
10
FNC20-FNC29
Arith. & Logic
Operation
247
Program examples
1. When the seven-segment display unit has 1 digit
X000
FNC 18
BCD
D0
K1Y000
PLC
FNC 18
BCD
D0
PLC
K2Y000
Output
destination
K4
K3
K2
K1
FNC 18
DBCD
D0
PLC
K5Y000
D1,D0
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
Output
destination
K8
248
K7
K6
K5
K4
K3
K2
K1
Introduction
9.10
Outline
2
Overview
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.
1. Instruction format
16-bit Instruction
5 steps
Mnemonic
Operation Condition
BIN
BINP
Operation Condition
DBIN
9 steps
DBINP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
3
Instruction
List
FNC 19
BIN
Data Type
Word device number storing the conversion source (binary-coded decimal) data
Devices
in Detail
Description
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
S
D
ConReal
CharacPointer
stant Number ter String
Index
Others
Special
Unit
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
6
Before
Programming
FNC 19
BIN
and
Basic
Instruction
The data of
BCD
6
FNC00-FNC09
Program Flow
When "K4X000"
is specified
X014 X010 X004 X000
X017 X013 X007 X003
Number of digits
BIN
FNC10-FNC19
Move & Compare
Specified the
Device &
Constant
Operand
Type
Data range
0 to 9
K2X000
00 to 99
K3X000
000 to 999
K4X000
0000 to 9999
10
FNC20-FNC29
Arith. & Logic
Operation
K1X000
249
+1,
FNC 19
DBIN
+1,
+1,
] and [ D
+1,
].
BCD
When "K8X000"
is specified
X034 X030 X024 X020 X014 X010 X004 X000
X037 X033 X027 X023 X017 X013 X007 X003
DBIN (FNC 19)
PLC
[ S
+1, S
Number of digits
BIN
Data range
K1X000
0 to 9
K2X000
00 to 99
K3X000
000 to 999
K4X000
0000 to 9999
K5X000
00000 to 99999
K6X000
000000 to 999999
K7X000
0000000 to 9999999
K8X000
00000000 to 99999999
Related instruction
Instruction
BCD (FNC 18)
Function
Converts binary (BIN) data into binary-coded decimal (BCD) data.
Cautions
1. When using DSW (FNC 72) instruction
Because conversion between binary-coded decimal data and binary data is automatically executed in DSW
(FNC 72) instruction, BIN instruction is not required.
Error
M8067 (operation error) turns ON when the source data is not binary-coded decimal (BCD).
250
1
Introduction
Program examples
1. When the digital switch has 1 digit
X000
FNC 19
BIN
K1X000
D0
Overview
FNC 12
MOV
K1X000
D0
PLC
X000
FNC 19
BIN
K2X000
K3
K2
K1
D0
Output
destination
K4
Instruction
List
4
Devices
in Detail
Digital switch
input
PLC
K5X000
K8
K7
K6
K5
K4
K3
K2
K1
D0
Output
destination
Specified the
Device &
Constant
FNC 19
DBIN
Digital switch
input
6
Before
Programming
PLC
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
251
Mnemonic
Symbol
Function
20
ADD
ADD
S1 S2 D
Addition
Section
10.1
21
SUB
SUB
S1 S2 D
Subtraction
Section
10.2
22
MUL
MUL
S1 S2 D
Multiplication
Section
10.3
23
DIV
DIV
S1 S2 D
Division
Section
10.4
24
INC
INC
Increment
Section
10.5
25
DEC
DEC
Decrement
Section
10.6
26
WAND
WAND S1 S2 D
Section
10.7
27
WOR
WOR S1 S2 D
Logical Word OR
Section
10.8
28
WXOR
WXOR S1 S2 D
Logical Exclusive OR
Section
10.9
29
NEG
Negation
Section
10.10
NEG
Reference
Instruction mnemonic
Contents of processing
120
[D]EADD
121
[D]ESUB
122
[D]EMUL
123
[D]EDIV
252
Introduction
10.1
Outline
1. Instruction format
D
FNC 20
ADD
16-bit Instruction
7 steps
Mnemonic
Operation Condition
ADD
ADDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DADD
DADDP
3
Instruction
List
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
2
Overview
This instruction executes addition by two values to obtain the result (A + B = C).
For the floating point addition instruction EADD (FNC120), refer to Section 18.8.
Description
Data type
S2
4
Devices
in Detail
S1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
ConReal
CharacPointer
stant Number ter String
E
""
Specified the
Device &
Constant
Operand
Type
6
Before
Programming
are added to S1
S1
S2
S1 + S2 D
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are added
algebraically.
5 + (8) = 3
or S2
S1
S2
+1, S1
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are added
algebraically.
5500 + (8540) = 3040
+1, S1
] or [ S2
+1, S2
253
10
FNC20-FNC29
Arith. & Logic
Operation
FNC10-FNC19
Move & Compare
Command
input
] are added to [ S1
].
8
FNC00-FNC09
Program Flow
7
Basic
Instruction
Command
input
Related devices
1. Relationship between the flag operation and the sign (positive or negative) of a numeric
value
For the flag operations, refer to Subsection 6.5.2.
Device
Name
M8020
Description
ON : When the operation result is 0
OFF: When the operation result is not 0
Zero
M8021
M8022
Borrow
ON : When the operation result is less than 32768 (in 16-bit operation) or
2,147,483,648 (in 32-bit operation)
OFF: When the operation result is not less than 32768 (in 16-bit operation) or
2,147,483,648 (in 32-bit operation)
Carry
ON : When the operation result is more than 32767 (in 16-bit operation) or
2,147,483,647 (in 32-bit operation)
OFF: When the operation result is not more than 32767 (in 16-bit operation) or
2,147,483,647 (in 32-bit operation)
Zero flag
2,
1,
0,
32768
Borrow flag
Zero flag
2,
1,
0,
Zero flag
Zero flag
1,
0,
The most
significant bit of
data becomes
"1".
The most
significant bit
of data
becomes "0".
1,
2,147,483,648
Borrow flag
32767,
0,
1,
1,
Carry flag
Zero flag
2,147,483,647,
Zero flag
0,
0,
Carry flag
Cautions
1. When using a 32-bit operation instruction (DADD or DADDP)
When specifying word devices, a 16-bit word device on the low-order side is specified first, and a word device
with the subsequent device number is automatically set for the high-order 16 bits.
To prevent number overlap, it is recommended to always specify an even number, for example.
254
FNC 20
ADD
D 0
K 25
D 0
(D 0) + 25(D 0)
1. Difference between ADD instruction and INC instruction caused by a program for adding
"+1"
When ADD[P] is executed, "1" is added to the contents of D0 every time X001 turns ON from OFF.
ADD[P] instruction is similar to INCP instruction described later except the contents shown in the table below:
INC, INCP, DINC, DINCP instruction
Operates
16-bit
operation
+(+1)= D
+327670+1+2
+327673276832767
+(1)= D
21032768
32-bit
operation
+(+1)= D
+2,147,483,6470+1+2
+2,147,483,6472,147,483,6482,147,483,647
+(1)= D
2102,147,483,648
X001
FNC 20
ADDP
D 0
K 1
D 0
FNC 24
INCP
D 0
(D 0) + 1(D 0)
(D 0) + 1(D 0)
Specified the
Device &
Constant
S2
Devices
in Detail
X001
S1
3
Instruction
List
Operation result
2
Overview
Introduction
Program example
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
255
10.2
Outline
This instruction executes subtraction using two values to obtain the result (A B = C).
For the floating point subtraction instruction ESUB (FNC121), refer to Section 18.9.
1. Instruction format
D
FNC 21
SUB
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SUB
SUBP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DSUB
DSUBP
2. Set data
Operand type
Description
Data type
S1
S2
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
""
FNC 21
SUB
S1
S2
S1 S2 D
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are subtracted
algebraically.
5 (8) = 13
When a constant (K) is specified in S1
or S2
FNC 21
DSUB
S1
S2
+1,
S1
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are subtracted
algebraically.
5500 (8540) = 14040
When a constant (K) is specified in [ S1
the binary format.
256
+1, S1
] or [ S2
+1, S2
1. Relationship between the flag operation and the sign (positive or negative) of a numeric
value
For the flag operations, refer to Subsection 6.5.2.
Device
Name
Zero
M8021
Carry
ON : When the operation result is more than 32767 (in 16-bit operation) or
2,147,483,647 (in 32-bit operation)
OFF: When the operation result is not more than 32767 (in 16-bit operation) or
2,147,483,647 (in 32-bit operation)
Zero flag
1,
0,
32768
Borrow flag
Zero flag
1,
0,
0,
The most
significant bit of
data becomes
"1".
The most
significant bit
of data
becomes "0".
1,
2,147,483,648
Borrow flag
32767,
0,
1,
1,
Carry flag
Zero flag
2,147,483,647,
Zero flag
0,
0,
5
Specified the
Device &
Constant
2,
1,
Devices
in Detail
2,
Zero flag
Zero flag
Carry flag
Cautions
When specifying word devices, a 16-bit word device on the low-order side is specified first, and then a word
device with the subsequent device number is automatically set for the high-order 16 bits.
For preventing number overlap, it is recommended to always specify an even number, for example.
FNC 21
SUB
D 0
K 25
D 0
7
Basic
Instruction
The same device number can be specified for both the source and the destination.
In this case, note that the addition result changes in every operation cycle if a continuous operation type
instruction (SUB or DSUB) is used.
Before
Programming
X001
3
Instruction
List
M8022
Borrow
ON : When the operation result is less than 32768 (in 16-bit operation) or
2,147,483,648 (in 32-bit operation)
OFF: When the operation result is not less than 32768 (in 16-bit operation) or
2,147,483,648 (in 32-bit operation)
2
Overview
M8020
Description
ON : When the operation result is 0
OFF: When the operation result is other than 0
Introduction
Related devices
(D 0) 25(D 0)
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
257
Program example
1. Difference between SUB instruction and DEC instruction caused by a program for
subtracting "1"
"1" is subtracted from the contents of D0 every time X001 turns ON from OFF.
SUB[P] instruction is similar to DECP instruction described later except the contents shown in the table
below:
[D] SUB [P] instruction
Operates
Operation result
(+1)= D
21032768
32,768+32,767+32,766
(1)= D
+327670+1+2
32-bit
operation
(+1)= D
2102,147,483,648
2,147,483,648+2,147,483,647+2,147,483,646
(1)= D
+2,147,483,6470+1+2
X001
X001
258
S1
S2
FNC 21
SUBP
D 0
K 1
D 0
FNC 25
DECP
D 0
(D 0) 1(D 0)
(D 0) 1(D 0)
Introduction
10.3
Outline
1. Instruction format
D
FNC 22
MUL
16-bit Instruction
7 steps
Mnemonic
Operation Condition
MUL
MULP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DMUL
DMULP
2. Set data
Operand type
Description
3
Instruction
List
Continuous
Operation
Pulse (Single)
Operation
2
Overview
This instruction executes multiplication by two values to obtain the result (A x B = C).
For the floating point multiplication instruction EMUL (FNC122), refer to Section 18.10.
Data type
S2
4
Devices
in Detail
S1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
3 3 3 3
""
6
Before
Programming
Command
input
FNC 22
MUL
S1
S2
or S2
8
FNC00-FNC09
Program Flow
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are multiplied
algebraically.
5 (8) = 40
7
Basic
Instruction
5
Specified the
Device &
Constant
Operand
Type
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
259
FNC 22
MUL
S1
S2
K53
K15
K2Y000
S1
K53(H0035)
S2
K15(H000F)
Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
0
0
1
1
0
0
0
1
1
0
1
1
Not output
FNC 22
DMUL
S1
S2
BIN
BIN
BIN
[ S1 +1, S1 ] [ S2 +1, S2 ] [ D +3, D +2,
32 bits
32 bits
64 bits
D +1,
D ]
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are multiplied
algebraically.
5500 (8540) = 46,970,000
When a constant (K) is specified in [ S1
into the binary format.
+1, S1
] or [ S2
+1, S2
], it is automatically converted
260
FNC 22
DMUL
S1
S2
D50
K150
D100
FNC 12
DMOV
D100
K8Y000
FNC 12
DMOV
D102
K8Y040
(D51,D50)
(D103,D102,D101,D100)
K100 K150 K15000
1
Introduction
Related devices
1. Relationship between flag operation and numeric value
Devicee
Name
M8304*1
Zero
2
Overview
*1.
Description
Cautions
1. Devices specified in
D
D
Instruction
List
4
Devices
in Detail
Program examples
1. 16-bit operation
X000
S2
D 0
D 2
D 4
S1
S2
D 0
D 2
D 4
(D 0) (D 2) (D 5,D 4)
8
9
72
Specified the
Device &
Constant
FNC 22
MUL
S1
2. 32-bit operation
X001
Before
Programming
FNC 22
DMUL
Item
Function Summary
Zero Flag
Turns the special device M8304 ON when the operation result of MUL
command is 0.
Basic
Instruction
FX3U
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
261
10.4
Outline
This instruction executes division by two values to obtain the result (A B = C ... ).
For the floating point division instruction EDIV (FNC123), refer to Section 18.11.
1. Instruction format
D
FNC 23
DIV
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DIV
DIVP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DDIV
DDIVP
2. Set data
Operand type
Description
Data type
S1
S2
Head word device number storing the division result (quotient and remainder)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
3 3 3 3
""
Command
input
FNC 23
DIV
S1
S2
, and the
+1.
S2
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are divided
algebraically.
36 (5) = 7 (quotient) ... 1 (remainder)
Two devices in total starting from D are occupied to store the operation result (quotient and
remainder). Make sure that these two devices are not used for another control.
When a constant (K) is specified as S1
262
or S2
[ S1
[ D
+1, S1
+1, D
Command
input
] indicates the dividend, [ S2 +1, S2 ] indicates the divisor, the quotient is transferred to
]), and the remainder is transferred to [ D +3, D +2].
FNC 23
DDIV
S1
S2
Overview
Dividend
Divisor
Quotient
Remainder
BIN
BIN
BIN
BIN
[ S1 +1, S1 ] [ S2 +1, S2 ] [ D +1, D ] ... [ D +3, D +2]
32 bits
32 bits
32 bits
32 bits
The most significant bit of each data indicates the sign (positive: 0 or negative: 1), and data are divided
algebraically.
5500 (540) = 10 (quotient) ... 100 (remainder)
+1, S1
] or [ S2
+1, S2
Instruction
List
Four devices in total starting from D are occupied to store the operation result (quotient and
remainder). Make sure that these four devices are not used for another control.
Introduction
4
Devices
in Detail
Related devices
1. Relationship between flag operation and numeric value
Name
M8304*1
Zero
Carry
ON : Carry flag operates when the operation result is over 32,767 (16-bit operation) or2,147,483,647 (32-bit operation).
OFF : When the operation result is less than 32,767 (16-bit operation) or
2,147,483,647 (32-bit operation).
M8306*1
Cautions
1. Operation result
7
Basic
Instruction
The most significant bit of the quotient and remainder indicates the sign (positive: 0, negative: 1)
respectively.
The quotient is negative when either the dividend or divisor is negative.
The remainder is negative when the dividend is negative.
2. Device specified as
The remainder is not obtained when a bit device is specified with digit specification.
D
FNC00-FNC09
Program Flow
Error
When the divisor S2
6
Before
Programming
*1.
Description
Specified the
Device &
Constant
Devicee
9
FNC10-FNC19
Move & Compare
A operation error results when the operation result is over 32,767 (16-bit operation) or 2,147,483,647 (32bit operation). (Turns the carry flag ON.)
10
FNC20-FNC29
Arith. & Logic
Operation
263
Program examples
1. 16-bit operation
X000
FNC 23
DIV
S1
S2
D 0
D 2
D 4
S1
S2
D 0
D 2
D 4
Dividend
(D 0)
100
Divisor Quotient
Remainder
(D 2) (D 4) ... (D 5)
33
3
1
2. 32-bit operation
X001
FNC 23
DDIV
Dividend
Divisor
Quotient
Remainder
(D 1,D 0) (D 3,D 2) (D 5,D 4) ... (D 7,D 6)
100,000
3333
30
10
FX3UC
264
Item
Function Summary
Zero Flag
Carry Flag
Introduction
10.5
Outline
FNC 24
INC
16-bit Instruction
3 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
INC
INCP
Overview
1. Instruction format
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
5 steps DINC
DINCP
Instruction
List
2. Set data
Operand type
Description
Data type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
Specified the
Device &
Constant
FNC 24
INCP
6
Before
Programming
Command
input
D +1 D
Command
input
FNC 24
DINCP
+1,
[ D +1, D ] + 1 [ D + 1,
+1,
7
Basic
Instruction
The contents of [ D
D ].
Devices
in Detail
3. Applicable devices
Operand
Type
D ]
Cautions
FNC00-FNC09
Program Flow
1. Note that data is incremented in every operation cycle in a continuous operation type
instruction.
2. Flag operations
2) 32-bit operation
When "+2,147,483,647" is incremented by "1", the result is "2,147,483,648". Flags (zero, carry and
borrow) are not activated at this time.
9
FNC10-FNC19
Move & Compare
1) 16-bit operation
When "+32767" is incremented by "1", the result is "32768". Flags (zero, carry and borrow) are not
activated at this time.
10
FNC20-FNC29
Arith. & Logic
Operation
265
Program example
X010
FNC 12
MOVP
K 0
FNC 18
BCDP
C 0Z
K4Y000
FNC 24
INCP
FNC 10
CMPP
K 10
0 (Z)
(C 0Z) (K4Y000)
BIN
BCD
(Z) + 1 (Z)
M 1
X011
266
M 0
When Z is "10",
M1 turns ON.
Introduction
10.6
Outline
FNC 25
DEC
16-bit Instruction
3 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DEC
DECP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
5 steps DDEC
DDECP
Description
Data type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
Specified the
Device &
Constant
FNC 25
DECP
6
Before
Programming
Command
input
D 1 D
Command
input
FNC 25
DDECP
+1,
[ D +1, D ] 1 [ D + 1, D ]
7
Basic
Instruction
The contents of [ D
[ D +1, D ].
Devices
in Detail
3. Applicable devices
Operand
Type
3
Instruction
List
2. Set data
Operand type
Overview
1. Instruction format
Cautions
1) 16-bit operation
When "32768" is decremented by "1", the result is "+32767". Flags (zero, carry and borrow) are not
activated at this time.
9
FNC10-FNC19
Move & Compare
2) 32-bit operation
When "2,147,483,648" is decremented by "1", the result is "+2,147,483,647". Flags (zero, carry and
borrow) are not activated at this time.
FNC00-FNC09
Program Flow
1. Flag operations
10
FNC20-FNC29
Arith. & Logic
Operation
267
10.7
Outline
This instruction executes the logical product (AND) operation of two numeric values.
1. Instruction format
W FNC 26
D
AND
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WAND
WANDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DAND
DANDP
2. Set data
Operand type
Description
Data type
S1
Data used for logical product or word device number storing data
S2
Data used for logical product or word device number storing data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
""
FNC 26
WAND
S1
S2
S1
and S2
S2 D
While the command input is OFF, the data of the transfer destination
While the command input is ON, the data of the transfer sources S1
When a constant (K) is specified in the transfer sources S1
the binary format.
and S2
and S2
do not change.
The logical product operation is executed in units of bit as shown in the table below (1 1 = 1, 0 1 = 0, 1
0 = 0, 0 0 = 0).
1: ON, 0: OFF
Logical operation
(unit: bit)
268
S1
S2
FNC 26
DAND
S1
S2
S1 +1, S1
+1, S1
S2 +1,
While the command input is ON, the data of the transfer source [ S1
change.
+1, S1
] in
S2 D +1, D
+1,
+1, S1
] [ S2
+1, S2
] [ S2
+1, S2
], it is
] do not
The logical product operation is executed in units of bit as shown in the table below (1 1 = 1, 0 1 = 0, 1
0 = 0, 0 0 = 0).
1: ON, 0: OFF
S1
S2
+1, S2
+1,
4
Devices
in Detail
Logical operation
(unit: bit)
+1, S1
Instruction
List
+1, S2
Overview
While the command input is OFF, the data of the transfer destination [ D
] and [ S2
Introduction
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
269
10.8
Outline
This instruction executes the logical sum (OR) operation of two numeric values.
1. Instruction format
W FNC 27
D
OR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WOR
WORP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DOR
DORP
2. Set data
Operand type
Description
Data type
S1
Data used for logical sum or word device number storing data
S2
Data used for logical sum or word device number storing data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
""
FNC 27
WOR
S1
S2
S1
S2
and S2
While the command input is OFF, the data of the transfer destination
While the command input is ON, the data of the transfer sources S1
When a constant (K) is specified in the transfer sources S1
the binary format.
and S2
and S2
do not change.
The logical sum operation is executed in units of bit as shown in the table below (1 1 = 1, 0 1 = 1,
0 0 = 0, 1 0 = 1).
1: ON, 0: OFF
Logical operation
(unit: bit)
270
S1
S2
FNC 27
DOR
S1
S2
S1 +1, S1
+1, S1
+1, S2
] in units
S2 +1, S2 D +1, D
While the command input is ON, the data of the transfer source [ S1
change.
+1, S1
+1,
+1, S1
] [ S2
+1, S2
] [ S2
+1, S2
], it is
] do not
S2
+1, S2
+1,
4
Devices
in Detail
Logical operation
(unit: bit)
+1, S1
Instruction
List
The logical sum operation is executed in units of bit as shown in the table below (1 1 = 1, 0 1 = 1,
0 0 = 0, 1 0 = 1).
1: ON, 0: OFF
S1
Overview
While the command input is OFF, the data of the transfer destination [ D
] and [ S2
Introduction
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
271
10.9
Outline
This instruction executes the exclusive logical sum (XOR) operation of two numeric values.
1. Instruction format
W FNC 28
D
XOR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WXOR
WXORP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DXOR
DXORP
2. Set data
Operand type
Description
Data type
S1
Data used for exclusive logical sum or word device number storing data
S2
Data used for exclusive logical sum or word device number storing data
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
""
FNC 28
WXOR
S1
S2
S1
S2
While the command input is OFF, the data of the transfer destination
While the command input is ON, the data of the transfer sources S1
When a constant (K) is specified in the transfer sources S1
the binary format.
and S2
and S2
and S2
do not change.
The logical exclusive sum operation is executed in units of bit as shown in the table below (1 1 = 0,
0 0 = 0, 1 0 = 1, 0 1 = 1).
1: ON, 0: OFF
Logical operation
(unit: bit)
272
S1
S2
FNC 28
DXOR
S1
S2
S1 +1, S1
] and [ S2
+1,
S2 +1, S2 D +1, D
While the command input is ON, the data of the transfer source [ S1
change.
+1, S1
+1,
+1, S1
] [ S2
+1, S2
] [ S2
+1, S2
], it is
] do not
S2
+1, S2
+1,
By combining WXOR and CML (FNC 14) instructions, the exclusive logical sum not (XORNOT) operation can
be executed.
D 10
D 12
FNC 14
CML
D 14
D 14
D 14
Before
Programming
FNC 28
WXOR
Specified the
Device &
Constant
Program example
X000
4
Devices
in Detail
Logical operation
(unit: bit)
+1, S1
Instruction
List
The exclusive logical sum operation is executed in units of bit as shown in the table below (1 1 = 0,
0 0 = 0, 1 0 = 1, 0 1 = 1).
1: ON, 0: OFF
S1
Overview
While the command input is OFF, the data of the transfer destination [ D
+1, S1
Introduction
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
273
1. Instruction format
D
FNC 29
NEG
16-bit Instruction
3 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
NEG
NEGP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
5 steps DNEG
DNEGP
2. Set data
Operand type
Description
Data type
Word device number which stores data for obtaining complement and will store
the operation result (The operation result will be stored in the same word device
number.)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
is inverted (0 1, 1 0), "1" is added, and then the result is stored in the original device.
FNC 29
NEGP
( D )+1 D
+1,
FNC 29
DNEGP
] is inverted (0 1, 1 0), "1" is added, and then the result is stored in the
( D + 1, D ) +1 = ( D + 1, D )
Caution
Note that the complement is obtained in every operation cycle in a continuous operation type instruction.
274
1
Introduction
Program examples
The program examples below are provided to obtain the absolute value of a negative binary value.
M 0
D 10
M 0
FNC 29
NEGP
D 10
D10 D10
K 15
Instruction
List
Even if NEG instruction is not used, D30 always stores the absolute value of the difference.
X000
M 10
D 10
D 20
M 10
FNC 21
SUB
D 10
D 20
D 30
FNC 21
SUB
D 20
D 10
D 30
4
Devices
in Detail
FNC 10
CMP
M 11
M 12
2
Overview
RUN monitor
FNC 44
BON
6
Before
Programming
(D 10) = 2
Specified the
Device &
Constant
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
(D 10) = 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D 10) = 0
Basic
Instruction
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(D 10) = 1
(D 10) + 1 = 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
(D 10) = 2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D 10) + 1 = 2
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
......
......
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
(D 10) = 32768
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(D 10) + 1 = 32767
FNC10-FNC19
Move & Compare
(D 10) = 32767
FNC00-FNC09
Program Flow
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
(D 10) + 1 = 32768
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10
FNC20-FNC29
Arith. & Logic
Operation
275
276
FNC No.
Mnemonic
Symbol
Function
30
ROR
ROR
D n
Rotation Right
Section
11.1
31
ROL
ROL
D n
Rotation Left
Section
11.2
32
RCR
RCR
D n
Section
11.3
33
RCL
RCL
D n
Section
11.4
34
SFTR
SFTR S D n1 n2
Section
11.5
35
SFTL
SFTL
Section
11.6
36
WSFR
WSFR S D n1 n2
Section
11.7
37
WSFL
WSFL S D n1 n2
Section
11.8
38
SFWR
SFWR S D n
Section
11.9
39
SFRD
SFRD S D n
Section
11.10
S D n1 n2
Reference
11
FNC30-FNC39
Rotation and
Shift
11.1
Outline
This instruction shifts and rotates the bit information rightward by the specified number of bits without the
carry flag.
FNC 30
ROR
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ROR
RORP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DROR
DRORP
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
Z Modify K H
3 3
3 3
""
3
3 3
16
FNC80-FNC89
External FX
Device
Command
input
FNC 30
RORP
17
FNC100-FNC109
Data
Transfer 2
18
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
After the
instruction
is executed
once
19
"n1" bits
Rightward
rotation
High order
After
execution
Carry flag
FNC140-FNC149
Data
Operation 2
"n" bits
M8022
FNC110-FNC139
Floating Point
High order
Before
execution
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
Before shift
b15 to b4
20
Carry flag
M8022
FNC150-FNC159
Positioning
Control
Before shift
b3 to b0
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
14
FMC60-FNC69
Handy
Instruction
Description
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
FNC40-FNC49
Data Operation
1. Instruction format
12
The contents of
b3 are stored.
277
DRORP
+1,
High order
Before
execution
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Carry flag
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
M8022
After the
instruction is
executed once
"n" bits
b0 to b3 (n1)
are moved.
The status of the bit "n1" is
copied.
Rightward
rotation
High order
After
execution
The status of
the bit "n1" is
copied.
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
Before shift
b3 to b0
0
Carry flag
M8022
Before shift
b31 to b4
The contents of
b3 are stored.
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry
Description
Turns ON when the bit shifted last from the lowest position is "1".
Cautions
1. In the case of continuous operation type instructions (ROR and DROR)
Note that shift and rotation are executed in every scan time (operation cycle).
278
11
FNC30-FNC39
Rotation and
Shift
11.2
Outline
This instruction shifts and rotates the bit information leftward by the specified number of bits without the carry
flag.
FNC 31
ROL
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ROL
ROLP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DROL
DROLP
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
Index
3 3 3 3
Z Modify K H
3 3
3 3
""
3
3 3
16
FNC80-FNC89
External FX
Device
Command
input
FNC 31
ROLP
17
FNC100-FNC109
Data
Transfer 2
18
M8022
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
After the
instruction
is executed
once
High order
Leftward
rotation
19
b12 (16n) to
b15 are moved.
FNC140-FNC149
Data
Operation 2
The status of
the bit "16n" is
copied.
After
execution
FNC110-FNC139
Floating Point
High order
Before
execution
"n" bits
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
Carry flag
M8022
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Before shift
b11 to b0
20
Before shift
b15 to b12
FNC150-FNC159
Positioning
Control
The contents of
b12 are stored.
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
14
FMC60-FNC69
Handy
Instruction
Description
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
FNC40-FNC49
Data Operation
1. Instruction format
12
279
DROLP
+1,
Before
execution
High order
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
M8022
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
"16n" bits
The status of
the bit "32n"
is copied.
After the
instruction is
executed once
Leftward
rotation
"n" bits
High order
After
execution
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Carry
flag
M8022
Before shift
b27 to b0
Before shift
b31 to b28
The contents of
b28 are stored.
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry
Description
Turns ON when the bit shifted last from the highest position is "1".
Cautions
1. In the case of continuous operation type instructions (ROL and DROL)
Note that shift and rotation are executed in every scan time (operation cycle).
280
11
FNC30-FNC39
Rotation and
Shift
11.3
Outline
This instruction shifts and rotates the bit information rightward by the specified number of bits together with
the carry flag.
FNC 32
RCR
Mnemonic
16-bit Instruction
5 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
RCR
RCRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DRCR
DRCRP
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
Z Modify K H
3 3
""
3 3
3 3
16
FNC80-FNC89
External FX
Device
Command
input
FNC 32
RCRP
17
FNC100-FNC109
Data
Transfer 2
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
High order
19
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0
Before
shift
b2 to b0
FNC140-FNC149
Data
Operation 2
After
execution
18
b3 (n1)
to b0 are
moved.
Rightward
rotation
"n" bits
Carry flag
M8022
1
When M8022 is ON
FNC110-FNC139
Floating Point
After the
instruction
b3 (n1)
is
executed
once
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
14
FMC60-FNC69
Handy
Instruction
Description
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
FNC40-FNC49
Data Operation
1. Instruction format
12
Before shift b3
0
Carry flag
M8022
Before shift
Carry flag M8022
281
20
FNC150-FNC159
Positioning
Control
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.
DRCRP
+1,
n
"n" bits (in the case of K4)
High order
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before
execution
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 0 0
After the
instruction is
executed once
Rightward
rotation
High order
After
execution
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16 b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
Before
shift
b2 to b0 Before shift
Carry flag M8022
The status
of the final
bit b3 (bit
"n1") is
stored.
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry
Description
Turns ON when the bit shifted last from the lowest position is "1".
Cautions
1. In the case of continuous operation type instructions (RCR and DRCR)
Note that shift and rotation are executed in every scan time (operation cycle).
282
11
FNC30-FNC39
Rotation and
Shift
11.4
Outline
This instruction shifts and rotates the bit information leftward by the specified number of bits together with the
carry flag.
FNC 33
RCL
Mnemonic
16-bit Instruction
Operation Condition
RCL
5 steps
Continuous
Operation
Pulse (Single)
Operation
RCLP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DRCL
DRCLP
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
Z Modify K H
3 3
""
3 3
3 3
16
FNC80-FNC89
External FX
Device
D
D
RCLP
17
FNC100-FNC109
Data
Transfer 2
Command
input
FNC 33
18
1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0
1
After the
instruction is
executed once
Carry flag
When M8022
is ON
High order
Leftward
rotation
"n" bits
19
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
The status
of the final
bit b12 (bit
"16n") is
stored.
FNC140-FNC149
Data
Operation 2
After
execution
Low order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
FNC110-FNC139
Floating Point
b15 to b12
(16n) are
moved.
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Before shift b11 to b0
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
14
FMC60-FNC69
Handy
Instruction
Description
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
FNC40-FNC49
Data Operation
1. Instruction format
12
20
283
FNC150-FNC159
Positioning
Control
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.
+1,
DRCLP
b31 to b28
(b32n)
are
moved.
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1
After the
instruction is
executed once
Carry flag
When M8022
is ON
The status
After
of the final
execution bit b28 (bit
"32n") is
stored.
Leftward
rotation
High order
Low order
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
Before shift b27 to b0
Before shift
b31 to b29
Before shift
Carry flag M8022
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry
Description
Turns ON when the bit shifted last from the highest position is "1".
Cautions
1. In the case of continuous operation type instructions (RCL and DRCL)
Note that shift and rotation are executed in every scan time (operation cycle).
284
11
FNC30-FNC39
Rotation and
Shift
11.5
Outline
12
1. Instruction format
FNC 34
SFTR
16-bit Instruction
9 steps
Mnemonic
SFTR
SFTRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
Head bit device number to be stored to the shift data after rightward shift
Bit
Bit
n1
16-bit binary
n2
16-bit binary
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
3 3 3
3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
n1
16
3 3
3 3
15
FNC80-FNC89
External FX
Device
n2
Others
Special
Unit
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
This instruction shifts bit devices of the specified bit length rightward by the specified number of bits.
After shift, the bit device S
is transferred by "n2" bits from the most significant bit.
3 3
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
285
FNC 34
SFTRP
n1
n2
S +1
Before
execution
D +7
D +6
D +5
D +8
D +3
D +2
[2]
"n2" bits are
shifted rightward
(n2=3).
[3] Copy
After
execution
D +4
D +7
D +6
D +5
D +4
D +3
D +1
[1]
Overflow (data to
be deleted)
D +2
D +1
Caution
Note that "n2" bits are shifted every time the command input turns ON from OFF in SFTRP instruction, but
that "n2" bits are shifted in each scan time (operation cycle) in SFTR instruction.
Error
If the transfer source
K6710).
286
11
FNC30-FNC39
Rotation and
Shift
11.6
Outline
12
1. Instruction format
FNC 35
SFTL
16-bit Instruction
9 steps
Mnemonic
SFTL
SFTLP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
Head bit device number to be stored to the shift data after leftward shift
Bit
Bit
n1
16-bit binary
n2
16-bit binary
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
3 3 3
3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
n1
16
3 3
3 3
15
FNC80-FNC89
External FX
Device
n2
Others
Special
Unit
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
This instruction shifts bit devices of the specified bit length leftward by the specified number of bits.
After shift, the bit device S
is transferred by "n2" bits from the least significant bit.
3 3
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
287
SFTLP
n1
n2
Before
execution
S +1
D +2
D +1
D +7
D +6
D +5
D +8
D +4
D +3
[2]
"n2" bits are
shifted rightward
(n2=3).
[1]
Overflow (data to
be deleted)
After
execution
S +2
D +7
D +6
D +5
D +4
D +3
[3] Copy
D +2
D +1
Caution
Note that "n2" bits are shifted every time the command input turns ON from OFF in SFTLP instruction, but
that "n2" bits are shifted in each operation cycle in SFTL instruction.
Error
If the transfer source
K6710).
288
11
FNC30-FNC39
Rotation and
Shift
M8046
S 0
K 1
13
*1
FNC 35
SFTL
M 0
S 0
K 8
X001
X002
FNC50-FNC59
High Speed
Processing
S 1
X000
FNC40-FNC49
Data Operation
M8046
12
Head data
M 0
Data
input
*1 By using a state relay (S), the state under operation can be monitored
by the dynamic monitoring function of the state relay.
S 7
14
FNC 12
MOV
M8047
K2S 0
K2Y000
FMC60-FNC69
Handy
Instruction
M8000
X000
(S 7 to S 0) (Y007 to Y000)
15
END
FNC70-FNC79
External FX I/O
Device
X000
X001
16
X007
FNC80-FNC89
External FX
Device
Y000
Y001
Y007
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
289
1. F1 and F2 PLCs
M100: Input data
M101 to M117 (octal number): 15-step shift register
Circuit program
List program
0000
0001
0002
0003
0004
0005
M100
SFT
X002 reset input
RST
LD
OUT
LD
SFT
LD
RST
X000
M100
X001
M100
X002
M100
M117
FNC 35
SFTLP
Fixed value
M100
M101
FNC 40
ZRST
M101
Head
device
290
M115
K 15
K 1
Number Shift by
of steps 1 bit
Shift registers M101 to M115 are reset
at one time.
11
FNC30-FNC39
Rotation and
Shift
11.7
Outline
12
This instruction shifts word devices with "n1" data length rightward by "n2" words.
FNC 36
WSFR
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WSFR
WSFRP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
16-bit binary
16-bit binary
n1
16-bit binary
n2
16-bit binary
14
FMC60-FNC69
Handy
Instruction
Head device number to be stored to the shift data after rightward shift
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S
D
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
n1
""
3 3
n2
3 3
16
3 3
FNC80-FNC89
External FX
Device
WSFRP
n1
n2
18
Before
execution
D +7
D +6
D +5
D +3
D +2
D +7
D +6
D +4
D +3
19
[1]
Overflow (data to
be deleted)
D +2
D +1
20
FNC150-FNC159
Positioning
Control
D +5
D +1
FNC140-FNC149
Data
Operation 2
D +8
D +4
[2]
"n2" bits are
shifted rightward
(n2=3).
[3] Copy
After
execution
FNC110-FNC139
Floating Point
S +2
17
FNC100-FNC109
Data
Transfer 2
For "n1" word devices starting from D , "n2" words are shifted rightward ([1] and [2] shown below).
After shift, "n2" words starting from S
are shifted to "n2" words starting from [ D +n1-n2] ([3] shown
below).
Command
input
FNC 36
15
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
291
Caution
Note that "n2" words are shifted when the drive input turns ON in WSFRP instruction, but that "n2" words are
shifted in each operation cycle in WSFR instruction.
Error
If the transfer source
K6710).
Program example
1. Shifting devices with digit specification
S
X000
FNC 36
WSFRP
K1X000 K1Y000
n1
n2
K 4
K 2
[3]
Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001 Y000
[2]
292
[1]
11
FNC30-FNC39
Rotation and
Shift
11.8
Outline
12
This instruction shifts the word data information leftward by the specified number of words.
FNC 37
WSFL
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
WSFL
WSFLP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
16-bit binary
16-bit binary
n1
16-bit binary
n2
16-bit binary
14
FMC60-FNC69
Handy
Instruction
Head device number to be stored to the shift data after leftward shift
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S
D
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
n1
""
3 3
n2
3 3
16
3 3
FNC80-FNC89
External FX
Device
Command
input
FNC 37
WSFLP
, "n2" words are shifted leftward ([1] and [2] shown below).
are shifted to "n2" words starting from D ([3] shown below).
n1
n2
D +2
D +1
19
D +7
D +6
D +5
D +3
D +7
D +6
D +5
D +4
[3] Copy
D +2
D +1
20
293
FNC150-FNC159
Positioning
Control
D +3
FNC140-FNC149
Data
Operation 2
D +8
D +4
[2]
"n2" bits are
shifted leftward
(n2=3).
[1]
Overflow (data to
be deleted)
After
execution
18
S +2
FNC110-FNC139
Floating Point
Before
execution
17
FNC100-FNC109
Data
Transfer 2
15
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
Caution
Note that "n2" words are shifted every time the drive input turns ON from OFF in WSFLP instruction, but that
"n2" words are shifted in each operation cycle in WSFL instruction.
Error
If the transfer source
K6710).
Program example
1. Shifting devices with digit specification
S
X000
FNC 37
WSFLP
K1X000 K1Y000
n1
n2
K 4
K 2
Y017 Y016 Y015 Y014 Y013 Y012 Y011 Y010 Y007 Y006 Y005 Y004 Y003 Y002 Y001Y000
[1]
[2]
294
[3]
11
FNC30-FNC39
Rotation and
Shift
11.9
Outline
12
This instruction writes data for first-in first-out (FIFO) and last-in first-out (LIFO) control.
FNC 38
SFWR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SFWR
SFWRP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Data Type
16-bit binary
Head word device number storing data (The first word device works as the
pointer, and data is stored in D
+1 and later)
16-bit binary
16-bit binary
512
14
FMC60-FNC69
Handy
Instruction
*1.
Description
Word device number storing data to be put in first
3. Applicable devices
S
D
System User
Word Devices
Digit Specification
System User
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
15
Others
Special
Unit
Z Modify K H
3 3
""
3 3
16
3
3 3
FNC80-FNC89
External FX
Device
Bit Devices
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
295
FNC 38
SFWRP
S
Before
execution
D+n
... D+10 D+9 D+8 D+7 D+6 D+5 D+4 D+3 D+2 D+1 D
Pointer
D +1 D
(K0)
D+n
... D+10 D+9 D+8 D+7 D+6 D+5 D+4 D+3 D+2 S
After
execution
D
Pointer
D +1 D
(K1)
D+n
(K1)
(K2)
D
Pointer
are stored to
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
Description
M8022
Carry
Related instructions
Instruction
Description
POP (FNC212)
Caution
1. In the case of continuous operation type (SFWR) instruction
Note that data are stored (overwritten) in each scan time (operation cycle).
296
11
2) Program
X020
FNC 12
MOVP
K4X000
D256
FNC 38
SFWRP
D256
D257
K100
Pointer
D257: Data register for storing the product number
D258 to D356 (99 points)
K100
14
M8000
D257
D357
FNC 12
MOV
D357
K4Y000
Request to
put a
product into
warehouse
Request to
take a
product out
of warehouse
X20
16
X21
Command
FNC80-FNC89
External FX
Device
X017 to X000
Y017 to Y000
17
Command
FNC100-FNC109
Data
Transfer 2
MOV instruction
0
0
D355
5
0320
0232
0462
0539
0142
0
0
0
0
1
D357 0320
SFRDP instruction
is executed.
4
0232
0462
0539
0142
0
0
Shift
18
19
0
0
0
FNC140-FNC149
Data
Operation 2
99
100
D257
D258
D259
MOV instruction D260
D261
D262
D263
D256 1234
FNC110-FNC139
Floating Point
1
2
3
4
5
6
7
6
0320
0232
0462
0539
0142
1234
0
+1
15
FNC70-FNC79
External FX I/O
Device
RUN
monitor
FNC 39
SFRDP
FMC60-FNC69
Handy
Instruction
13
FNC50-FNC59
High Speed
Processing
12
FNC40-FNC49
Data Operation
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.
FNC30-FNC39
Rotation and
Shift
Program example
20
FNC150-FNC159
Positioning
Control
297
1. Instruction format
FNC 39
SFRD
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SFRD
SFRDP
Operation Condition
2. Set data
Operand Type
Data Type
S
D
16-bit binary
16-bit binary
*1.
Description
Head word device number storing data
(The first word device works as the pointer, and data is stored in
later.)
16-bit binary
+1 and
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3
3 3
3
3 3
+1 written in turn by SFWR (FNC 38) instruction is transferred (read) to D , and "n-1" words from
+1 are shifted rightward by 1 word. "1" is subtracted from the number of data, stored in S .
Command
input
FNC 39
SFRDP
298
11
FNC30-FNC39
Rotation and
Shift
Before
execution
S+n
... S+10 S+9 S+8 S+7 S+6 S+5 S+4 S+3 S+2 S+1 S
=n
1 S
12
Pointer
S+1
D
S+n S+n
S+2
D
S+n S+n S+n
13
Pointer
S
FNC50-FNC59
High Speed
Processing
After
execution
... S+10 S+9 S+8 S+7 S+6 S+5 S+4 S+3 S+2
FNC40-FNC49
Data Operation
1 S
14
Pointer
Name
M8020
Zero
Description
Data is always read from S
zero flag M8020 turns ON.
Instruction
Description
Shift write (for FIFO/FILO control)
POP (FNC212)
17
FNC100-FNC109
Data
Transfer 2
Caution
1. Data after reading was executed
The contents of
18
3. When pointer S
FNC110-FNC139
Floating Point
+n do not change.
is 0
16
FNC80-FNC89
External FX
Device
Related instructions
SFWR (FNC 38)
15
FNC70-FNC79
External FX I/O
Device
Related device
FMC60-FNC69
Handy
Instruction
do not change.
19
Refer to the program example provided for SFWR (FNC 38) instruction.
For the program example, refer to Section 11.9.
FNC140-FNC149
Data
Operation 2
Program example
20
FNC150-FNC159
Positioning
Control
299
300
FNC No.
Mnemonic
Symbol
Function
40
ZRST
41
DECO
42
ENCO
43
SUM
44
BON
45
MEAN
46
ANS
47
ANR
48
SQR
SQR
49
FLT
FLT
Reference
Zone Reset
Section
12.1
DECO S D n
Decode
Section
12.2
ENCO S D n
Encode
Section
12.3
Section
12.4
Section
12.5
MEAN S D n
Mean
Section
12.6
ANS
Section
12.7
Annunciator Reset
Section
12.8
S D
Square Root
Section
12.9
S D
Section
12.10
ZRST D1 D2
SUM
BON
S D
S D n
S m D
ANR
11
FNC30-FNC39
Rotation and
Shift
12.1
Outline
12
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.
FNC 40
ZRST
16-bit Instruction
5 steps
Mnemonic
Operation Condition
ZRST
ZRSTP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
D2
14
16-bit binary
D11 D2
S
Specify same type of
devices.
16-bit binary
Others
FMC60-FNC69
Handy
Instruction
D11
S
ConReal
CharacPointer
stant Number ter String
15
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Special
Unit
System User
Index
Z Modify K H
D11
S
3 3
3 3 3 3
D2
3 3
3 3 3 3
""
16
FNC80-FNC89
External FX
Device
and D21
to D21
Before
execution
FNC 40
ZRST
D2
D1
D2
to D21
17
at one time.
FNC100-FNC109
Data
Transfer 2
Command
input
FNC70-FNC79
External FX I/O
Device
FNC40-FNC49
Data Operation
1. Instruction format
D1 +9 D1 +8 D1 +7 D1 +6 D1 +5 D1 +4 D1 +3 D1 +2 D1 +1
D1
18
FNC110-FNC139
Floating Point
Executed
OFF
After
execution
19
OFF
OFF
OFF
OFF
OFF
OFF
OFF
OFF
OFF
OFF
FNC140-FNC149
Data
Operation 2
OFF
20
FNC150-FNC159
Positioning
Control
301
When D1
and D21
Before
execution
FNC 40
ZRST
D2
D1
D2
to D21
at one time.
D1 +9 D1 +8 D1 +7 D1 +6 D1 +5 D1 +4 D1 +3 D1 +2 D1 +1
D1
Executed
K0
After
execution
K0
K0
K0
K0
K0
K0
K0
K0
K0
K0
K0
Related instructions
1. RST instruction
As an independent reset instruction for devices, RST instruction can be used for bit devices (Y, M and S) and
word devices (T, C, D and R).
X001
RST
M0
M0 is reset.
RST
T0
RST
D0
D0 is reset.
FNC 16
FMOV
K0
D0
K100
By using this
Cautions
1. Caution on specifying devices
Specify same type of devices in D1
302
.
is larger than the device number of D21 , only one device specified in D1
is
11
ZRST instruction is handled as the 16-bit type, but 32-bit counters can be specified in D1
However, it is not possible to specify a 16-bit counter in D1
and D21
and D21 .
12
FNC 40
ZRST
C180
Command
input
C230
16-bit 32-bit
counter counter
FNC 40
ZRST
C180
C199
FNC 40
ZRST
C200
C230
FNC40-FNC49
Data Operation
Example
Command
input
13
FNC50-FNC59
High Speed
Processing
Program example
1. When using devices in the latch area as non-latch type devices
In the program shown below, when the power of the PLC is turned ON or when the PLC mode is changed to
RUN, the specified ranges of bit devices and word devices are reset at one time.
Initial pulse
FNC 40
ZRST
FNC 40
ZRST
D2
M500
M599
D1
D2
C235
C255
D1
D2
S500
S599
15
FNC70-FNC79
External FX I/O
Device
FNC 40
ZRST
D1
14
FMC60-FNC69
Handy
Instruction
M8002
FNC30-FNC39
Rotation and
Shift
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
303
12.2
Outline
This instruction converts numeric data into ON bit.
A bit number which is set to ON by this instruction indicates a numeric value.
1. Instruction format
FNC 41
DECO
16-bit Instruction
7 steps
Mnemonic
Operation Condition
DECO
DECOP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
SS1
16-bit binary
16-bit binary
16-bit binary
3. Applicable devices
Bit Devices
Operand
Type
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
Index
SS1
3 3 3
3 3 3 3
SD2
3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
3 3
3 3
value.
Command
input
FNC 41
DECO
is decoded to DD1 .
turns ON.
is a bit device, 2 = 256 bits (which is the maximum value) are occupied.
D
n
(1 n 8)
When it is Y, M or S
8 bits
Ignored
16
32
64
128
0 0 0 0 1 1 1 0 When S is D0
2n
K8 K7 K6 K5 K4 K3 K2 K1
n
Turns ON when all
bits of S are OFF.
Up to Up to Up to Up to
M255
M127
M63
M31
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 When D is M0
M15 M14 M13 M12 M11 M10 M9 M8 M7 M6 M5 M4 M3 M2 M1 M0
M255
Up to 256 bits (The number of occupied bits varies depending on the specified "n" value.)
304
11
is a word device (1 n 4)
FNC30-FNC39
Rotation and
Shift
2) When DD1
is decoded to DD1 .
turns ON.
12
Command
input
FNC 41
DECO
FNC40-FNC49
Data Operation
When it is T,C,D,R,U\G,V,Z,K or H
n
(1 n 4)
Ignored
4 bits
13
0 0 1 0 1 0 0 1 1 1 1
4
1 0 1 0 0
When S is D0
2n
K4 K3 K2 K1 n
Turns ON when all bits
of S are OFF.
When D is D2
Up to 16 bits
14
FMC60-FNC69
Handy
Instruction
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
FNC50-FNC59
High Speed
Processing
15
While the command input is OFF, the instruction is not executed. The activated decode output is held in
the previous ON/OFF status.
When "n" is "0", the instruction executes no processing.
FNC70-FNC79
External FX I/O
Device
Caution
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
305
Program example
1. When setting bit devices to ON according to the value of a data register
The value of D0 (whose current value is "14" in this example) is decoded to M0 to M15.
D
D 0
M 0
K 4
128
b15
32
4 bits
Ignored
(D0 b0 to b3)
(D0 b4 to b15)
7 6 5 4 3 2 1 b0
0 0 0 0 1 1 1 0
16
FNC 41
DECO
64
M8000
K8 K7 K6 K5 K4 K3 K2 K1
When the value of b0 to b3 of D0 is "14 (= 0 + 2 + 4 + 8)", M14 (which is the 15th from M0) becomes "1"
(turn ON).
When the value of D0 is "0", M0 becomes "1" (turns ON).
When "n" is set to "K4", either one point among M0 to M15 turns ON according to the value of D0 (0 to 15).
By changing "n" from K1 to K8, D0 can correspond to numeric values from 0 to 255.
However, because the device range of DD1
should not be used for another control.
2. Turning ON the bit out of word devices according to the contents of bit devices
The value expressed by X000 to X002 is decoded to D0 (X000 and X001 are ON, and X002 is OFF in this
example.).
n
X000
D0
K3
X2 X1 X0
0 1 1
1
FNC 41
DECO
M8000
S
2n
K3 K2 K1
n
Turns ON when all
bits of S are OFF.
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
D =D0
When the values expressed by X000 to X002 are "3 (= 1 + 2 + 0)", b3 (which is the 4th from b0) becomes
1 (turns ON).
When all of X000 to X002 are "0" (OFF), b0 becomes "1" (turns ON).
306
11
FNC30-FNC39
Rotation and
Shift
12.3
Outline
12
FNC 42
ENCO
16-bit Instruction
7 steps
Mnemonic
Operation Condition
ENCO
ENCOP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
16-bit binary
16-bit binary
16-bit binary
14
FMC60-FNC69
Handy
Instruction
SS1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
3 3 3
SS1
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
16
FNC80-FNC89
External FX
Device
17
is a bit device (1 n 8)
When it is Y, M or S
S
ENCO
n
(1 n 8)
M16
0
6
M15
0
5
M14
0
4
M13
1
(3)
M12
0
2
M11
0
1
M10
0
0
S = M10
20
FNC150-FNC159
Positioning
Control
b15
D10
4 (2) (1)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All of them are "0".
19
When "n" is 3
FNC140-FNC149
Data
Operation 2
M17
0
18
FNC110-FNC139
Floating Point
Command
input
FNC 42
FNC100-FNC109
Data
Transfer 2
1) When DS1
15
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
307
2) When DS1
is a word device (1 n 4)
is "0" (OFF) from the most significant bit to the low-order bit "n".
When it is T, C, D, R, U\G, V or Z
Command
input
FNC 42
ENCO
n
(1 n 4)
D0
2n = 8 (When "n" is 3)
b15
b0
0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0
6 5 4 (3) 2 1 0
7
Ignored
b15
4 (2) (1)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All of these bits are 0.
D2
Cautions
1. When two or more bits are ON in the DS1
data
The low-order side is ignored, and only the ON position on the high-order side is encoded.
308
FNC30-FNC39
Rotation and
Shift
12.4
11
Outline
12
This instruction counts the number of "1" (ON) bits in the data of a specified device.
FNC 43
SUM
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SUM
SUMP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DSUM
DSUMP
Operand type
Description
Data type
SS1
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SD2
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
16
FNC80-FNC89
External FX
Device
When all bits are OFF in DS1 , the zero flag M8020 turns ON.
Command
input
FNC 43
SUM
Before
execution
S
D
S
D
K0
K21847
K9
17
16-bit data
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
9 8 7 6 5 4 3 2 1 (Number of "1" (ON))
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
18
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
FNC110-FNC139
Floating Point
After
execution
K21847
FNC100-FNC109
Data
Transfer 2
Word data
15
FNC70-FNC79
External FX I/O
Device
SS1
ConReal
CharacPointer
stant Number ter String
Index
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
13
FNC50-FNC59
High Speed
Processing
2. Set data
FNC40-FNC49
Data Operation
1. Instruction format
32 16 8 4 2 1
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
309
FNC 43
DSUM
Number of bits in
D +1, D
the ON status in [ S +1, S ]
K0 is written
Word data
Before
execution
K0
0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
(Number of "1" (ON)) 9 8 7 6 5 4 3 2 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
K0
K0
b31
K21847
After
execution
b31
K21847
32-bit data
0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
32 16 8 4 2 1
0 0 0 0 0 00 00 00 00 0 0 0 01 00 00 01 0 1 0 0 1
K9
Bit device
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
Decimal
Hexadecimal
M8020
(zero
flag)
0000
ON
0001
OFF
0002
OFF
0003
OFF
0004
OFF
0005
OFF
0006
OFF
0007
OFF
0008
OFF
0009
OFF
10
000A
OFF
11
000B
OFF
OFF
310
Word device
FFFB
15
OFF
FFFC
14
OFF
FFFD
15
OFF
FFFE
15
OFF
FFFF
16
OFF
11
FNC30-FNC39
Rotation and
Shift
Caution
While the command input is OFF, the instruction is not executed.
The output of the number of bits in the ON status is latched in the previous status.
Program example
12
When X000 is ON, the number of bits in the ON status in D0 is counted, and stored to D2.
FNC 43
SUM
D 0
D 2
FNC40-FNC49
Data Operation
X000
13
D 2 = K0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
M8020=ON
D 0 = K21847
FNC50-FNC59
High Speed
Processing
D 0 = K0
Zero flag
D 2 = K9
14
32 16 8 4 2 1
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
M8020=OFF
FMC60-FNC69
Handy
Instruction
0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
Zero flag
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
311
12.5
Outline
This instruction checks whether a specified bit position in a specified device is ON or OFF.
1. Instruction format
FNC 44
BON
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
BON
BONP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DBON
DBONP
2. Set data
Operand type
Description
Data type
SS1
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Special
Unit
3
3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
SS1
SD2
System User
Others
Z Modify K H
3 3
""
3 3
3 3
3 3
is output to DD1 .
is set to OFF.]
When a constant (K) is specified as the transfer source DS1 , it is automatically converted into the binary
format.
Command
input
FNC 44
BON
(n = K0 to K15)
S
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
0
1
0
0
0
0
1
0
1
0
0
1
1
1
1
K15 K14 K13 K12 K11 K10 K9 K8 K7 K6 K5 K4 K3 K2 K1 K0
n
n=5
n=8
312
D bit device
0
1
(OFF)
(ON)
11
FNC30-FNC39
Rotation and
Shift
is set to OFF.]
When a constant (K) is specified as the transfer source [ DS1 +1, DS1 ], it is automatically converted into
the binary format.
S
DBON
[ S +1, S ]
(n = K0 to K31)
13
S +1, S
FNC50-FNC59
High Speed
Processing
b31 b30 b29 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
0
1 1
1
1
0
1
0
0
0
0
1
0
1
0
0
1
1
1
1
K31 K30 K29 K17 K16 K15 K14 K13 K12 K11 K10 K9 K8 K7 K6 K5 K4 K3 K2 K1 K0
n=5
D bit device
0
(OFF)
(ON)
14
FMC60-FNC69
Handy
Instruction
n = 29
Program example
When the bit 9 (n = 9) in D10 is "1" (ON), M0 is set to "1" (ON).
FNC 44
BON
D 10
M 0
K9
15
FNC70-FNC79
External FX I/O
Device
X000
12
FNC40-FNC49
Data Operation
Command
input
FNC 44
D 10
M 0 = ON
0 0 1 0 1 0 0 0 0 0 1 0 1 0 1 0
b15
b0
n=9
M 0 = OFF
16
FNC80-FNC89
External FX
Device
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
b15
b0
b8 b7
n=9
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
313
12.6
Outline
This instruction obtains the mean value of data.
1. Instruction format
FNC 45
MEAN
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DMEAN
DMEANP
Continuous
Operation
Pulse (Single)
Operation
MEAN
MEANP
2. Set data
Operand type
Description
Data type
SS1
64)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
SS1
SD2
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3 3
3 3
3
3 3
is stored to DD1 .
FNC 45
MEAN
+ S + 1 + + S + n 1
n
FNC 45
DMEAN
[ S + 1, S ] + [ S + 3, S + 2] + + [{ S + n 2 1}, { S + n 2 2}]
n
314
[ D + 1, D ]
11
FNC30-FNC39
Rotation and
Shift
Caution
When a device number is exceeded, "n" is handled as a smaller value in the possible range.
Error
When "n" is any value outside the range from "1" to "64", an operation error (M8067) is caused.
12
FNC40-FNC49
Data Operation
Program example
The data of D0, D1 and D2 are summed, divided by "3", and then stored to D10.
X000
FNC 45
MEAN
D 0
D 10
K 3
(D 0) + (D 1) + (D 2)
3
13
(D 10)
FNC50-FNC59
High Speed
Processing
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
315
12.7
Outline
This instruction sets a state relay as an annunciator (S900 to S999).
1. Instruction format
FNC 46
ANS
Mnemonic
16-bit Instruction
7 steps
Operation Condition
Continuous
Operation
ANS
Operation Condition
2. Set data
Operand type
Description
Data type
16-bit binary
16-bit binary
16-bit binary
SS1
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
S1
SS1
ConReal
CharacPointer
stant Number ter String
3 3
""
3 3
3
3
S1 : T0 to T199
S2 : S900 to S999
current value of the timer for evaluation DS1 is reset and DD1 is not set.
When the command input turns OFF, the timer for evaluation is reset.
Command
input
FNC 46
ANS
Command input
S
D
Equivalent to or
Less than
evaluation time longer than
evaluation time
(m 100 ms)
(m 100 ms)
Related devices
Device
316
Name
Description
M8049
Enable annunciator
M8048
Annunciator ON
When M8049 is ON and one of the state relays S900 to S999 is ON, M8048 turns ON.
D8049
11
M8000
M8049
RUN monitor
Y005
X000
Forward Forward
movement end
12
X001
Upper
limit
X003
Lower
limit
X004
Continuous Cycle
T 0
K 10
S900
FNC 46
ANS
T 1
K 20
S901
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.
FNC 46
ANS
T 2
K100 S902
X005
30
Y005
Y006
Annunciator ON
X007
34
36
Fault display
FNC 47
ANRP
END
16
FNC80-FNC89
External FX
Device
Reset
FNC70-FNC79
External FX I/O
Device
M8048
14
15
Forward
movement
32
13
FMC60-FNC69
Handy
Instruction
21
X002
FNC 46
ANS
FNC50-FNC59
High Speed
Processing
12
FNC40-FNC49
Data Operation
When the program for external fault diagnosis shown below is created and the content of D8049 (smallest
state relay number in the ON status) is monitored, the smallest state relay number in the ON status from S900
to S999 is displayed.
If two or more faults are present at the same time, the next smallest fault number is displayed after the fault of
the smallest fault number is cleared.
FNC30-FNC39
Rotation and
Shift
Program example
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
317
12.8
Outline
This instruction resets an annuciator (S900 to S999) in the ON status with the smallest number.
1. Instruction format
FNC 47
ANR
16-bit Instruction
Mnemonic
Operation Condition
1 step ANR
ANRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
FNC 47
ANRP
Related devices
Device
Name
Description
M8049
Enable annunciator
M8048
Annunciator ON
When M8049 is ON and either one among the state relays S900 to S999 is ON, M8048
turns ON.
D8049
Caution
1. Execution in each operation cycle
When ANR instruction is used, annunciators in the ON status are reset in turn in each operation cycle.
When ANRP instruction is used, an annunciator in the ON status is reset only in one operation cycle (only
once).
Program example
Refer to ANS (FNC 46) instruction.
318
11
FNC30-FNC39
Rotation and
Shift
12.9
Outline
1. Instruction format
FNC 48
SQR
16-bit Instruction
5 steps
Mnemonic
Operation Condition
SQR
SQRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DSQR
DSQRP
2. Set data
Operand type
Data type
SS1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
15
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
SS1
3 3
3 3
""
3 3
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
Command
input
S + 1, S
18
FNC110-FNC139
Floating Point
Command
input
FNC70-FNC79
External FX I/O
Device
Operand
Type
14
FMC60-FNC69
Handy
Instruction
DS1
Description
13
FNC50-FNC59
High Speed
Processing
Continuous
Operation
Pulse (Single)
Operation
12
FNC40-FNC49
Data Operation
D + 1, D
Caution
19
1. Operation result
FNC140-FNC149
Data
Operation 2
1) The obtained square root is an integer because the decimal point is ignored.
When the calculated value is ignored, M8021 (borrow flag) turns ON.
2) When the calculated value is true "0", M8020 (zero flag) turns ON.
20
FNC150-FNC159
Positioning
Control
319
Program example
The square root of D10 is stored to D12.
The value of D10 is "100".
X000
FNC 48
SQR
D 10
D 12
D 10 D 12
=
320
100 10
11
FNC30-FNC39
Rotation and
Shift
12
This instruction converts a binary integer into a binary floating point (real number).
FNC 49
FLT
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
FLT
FLTP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DFLT
DFLTP
Operand type
Description
Data type
SS1
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
16
is converted into binary floating point (real number), and stored to [ DD1 +1,
].
Command
input
FNC 49
FLT
17
( S + 1, S ) ( D
Binary integer
18
+1, D )
FNC110-FNC139
Floating Point
Command
input
Related instruction
Instruction
19
Description
It is inverse of FLT instruction, and converts binary floating point into binary integer.
FNC140-FNC149
Data
Operation 2
INT(FNC129)
FNC100-FNC109
Data
Transfer 2
Binary
integer
( D + 1, D )
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
SS1
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
13
FNC50-FNC59
High Speed
Processing
2. Set data
FNC40-FNC49
Data Operation
1. Instruction format
Caution
1. It is not necessary to convert a constant (K or H) into floating point value.
321
20
FNC150-FNC159
Positioning
Control
The value of a K or H specified in each instruction for binary floating point (real number) operation is
automatically converted into binary floating point (real number). It is not necessary to convert such a constant
using by FLT instruction.
(K and H cannot be specified in RAD, DEG, EXP and LOGE instructions.)
Related devices
For the method of the zero and borrow flags, refer to Subsection 6.5.2.
Device
Name
M8020
Zero flag
Description
M8021
Borrow flag
Program example
1. Arithmetic operations by binary floating point operations
The sequence program shown below is constructed as follows:
1) Calculation example
(D 0)
16-bit binary
K34.5
(X017 to X010)
2-digit BCD
(1)
(2)
(D 21, D 20)
Binary floating
point operation
(6)
(5)
(D 22)
BIN
(7)
(4)
(D 27, D 26)
Binary floating
point operation
(8)
(D 13, D 12)
Scientific notation operation
for monitoring
(D 15, D 14)
32-bit binary integer
(3)
(D 25, D 24)
Binary floating
point operation
(D 29, D 28)
Binary floating
point operation
2) Sequence program
M8000 (1)
322
FNC 49
FLT
D 0
D 20
(D 0) (D21, D20)
BIN
Binary floating point operation
(2)
FNC 19
BIN
K2X010
D 22
(3)
FNC 49
FLT
D 22
D 24
(4)
FNC 123
DEDIV
K345
K 10
D 26
(5)
FNC 123
DEDIV
D 20
D 24
D 28
(6)
FNC 122
DEMUL
D 28
D 26
D 10
(7)
FNC 118
DEBCD
D 10
D 12
(8)
FNC 129
DINT
D 10
D 14
(D11, D10)
(D13, D12)
Binary floating
Scientific notation operation
point operation
for monitoring
(D15, D14)
(D11, D10)
Binary floating
32-bit binary integer
point operation
11
FNC30-FNC39
Rotation and
Shift
50
REF
51
REFF
52
MTR
53
HSCS
54
HSCR
55
HSZ
Symbol
Function
Reference
Refresh
Section
13.1
Section
13.2
Input Matrix
Section
13.3
HSCS S1 S2 D
Section
13.4
14
HSCR S1 S2 D
Section
13.5
Section
13.6
FMC60-FNC69
Handy
Instruction
Mnemonic
FNC50-FNC59
High Speed
Processing
FNC No.
12
FNC40-FNC49
Data Operation
FNC 50 to FNC 59 provide 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.
Speed Detection
Section
13.7
REF
D n
REFF
MTR
HSZ
S D1 D2 n
S1 S2 S D
SPD
57
PLSY
PLSY S1 S2 D
Pulse Y Output
Section
13.8
58
PWM
PWM S1 S2 D
Section
13.9
59
PLSR
PLSR S1 S2 S3 D
Acceleration/deceleration setup
Section
13.10
S1 S2 D
16
FNC80-FNC89
External FX
Device
SPD
15
FNC70-FNC79
External FX I/O
Device
56
13
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
323
13.1
Outline
This instruction immediately outputs the latest input (X) information or the current output (Y) operation result
in the middle of a sequence program.
1. Instruction format
FNC 50
REF
16-bit Instruction
5 steps
Mnemonic
Operation Condition
REF
REFP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Bit
16-bit binary
3. Applicable devices
Operand
Type
D
Bit Devices
Word Devices
Others
System User
System
User
Real CharacPointer
Constant
Number ter String
Digit Specification
Special
Unit
Index
""
S 1 S2
S 3 S3
S1: X000, X010 or X020: Up to the final input number (whose least significant digit number is "0")
S2: Y000, Y010 or Y020: Up to the final output number (whose least significant digit number is "0")
S3: K8 (H8) or K16 (H10): Up to K256 (H100) (which is a multiple of 8)
324
11
FNC30-FNC39
Rotation and
Shift
FNC 50
REF
12
FNC40-FNC49
Data Operation
Command
input
Head Number
device of points
number
- When this instruction is executed, the output latch memory is refreshed to the output status in the
specified range.
14
FMC60-FNC69
Handy
Instruction
15
ON
ON
Improved response
delay time
FNC 50
REF
Improved response
delay time
16
FNC80-FNC89
External FX
Device
FNC70-FNC79
External FX I/O
Device
ON
Command
input
13
FNC50-FNC59
High Speed
Processing
17
K8 (H8) or K16 (H10): Up to K256 (H100) (which is a multiple of 8)
X000, X010 or X020: Up to the final input number
(whose least significant digit number is "0")
- 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.
18
FNC110-FNC139
Floating Point
- In X000 to X017*1, the response delay time of the input filter can be changed.
*1 X000 to X007 in the FX3U-16M, FX3UC-16M.
For details, refer to "13.1.1 What should be understood before using the REF instruction".
FNC100-FNC109
Data
Transfer 2
Head Number
device of points
number
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
325
5ms
20ms
ON
10ms
Filter time
10ms
10ms
ON
ON
Improved response
delay time
Cautions
1. Setting the number of refreshed points "n"
Set a multiple of 8 such as "K8 (H8), K16 (H10) K256 (H100)". Any other numeric value causes an error.
Program examples
1. When refreshing inputs
Only X010 to X017 (8 points in total) are refreshed.
X000
FNC 50
REF
X010
K 8
326
FNC 50
REF
Y000
K 24
11
FNC30-FNC39
Rotation and
Shift
12
13
FNC50-FNC59
High Speed
Processing
After the REF instruction is executed, the output (Y) sets the output signal to ON after the response time
shown below.
For details, refer to the respective PLC Hardware Edition manual.
FNC40-FNC49
Data Operation
Target range: X000 to X017 (In inputs X020 and later, the input filter value is fixed at 10 ms and cannot
be changed.)
(The target range is X000 to X007 in the FX3U-16M, FX3UC-16M.)
14
3. When using the REF instruction between FOR and NEXT instructions or between a pointer
(with a lower step number) and CJ instruction (with a higher step number)
15
FNC70-FNC79
External FX I/O
Device
Inputs and outputs can be refreshed even when the input information or immediate output is required in the
middle of a routine program during control.
FMC60-FNC69
Handy
Instruction
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
327
13.2
Outline
The digital input filter time of the inputs X000 to X017*1 can be changed using this instruction or D8020.
Using this instruction, the status of inputs X000 to X017*1 can be refreshed at an arbitrary step in the program
for the specified input filter time, and then transferred to the image memory.
1. Instruction format
FNC 51
REFF
16-bit Instruction
3 steps
Mnemonic
REFF
REFFP
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
n
Description
Data Type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
S S
FNC 51
REFF
n
K0 to K60 (Filter constant from 0 to 60 ms)
When the input turns ON "n 1 ms" before the instruction is executed, the image memory is set to ON.
When the input turns OFF "n 1 ms" before the instruction is executed, the image memory is set to OFF.
When the command input is ON, the REFF instruction is executed in each operation cycle.
When the command input is OFF, the REFF instruction is not executed, and the input filter of X000 to
X017*1 uses the set value of D8020 (which is the value used during input processing).
*1.
328
11
FNC30-FNC39
Rotation and
Shift
Cautions
1. Setting the filter time "n"
Set "n" within the range from K0 (H0) to K60 (H3C) [0 to 60 ms].
Input number
X000 to X005
5 s*2
X006, X007
50 s
200 s
X010 to X017
13
*3
*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 to 10 ms in X010 to X017 when the FX3U-16M, FX3UC-16M is used.
Program example
15
n
FNC 51
REFF
K 1
X000
When X010 is ON
The image memory of X000 to
X017*4 is refreshed with an input
filter of 1 ms.
FNC70-FNC79
External FX I/O
Device
Input
processing
REFF instruction
1 ms
FNC 51
REFF
K 20
*4
REFF instruction
X000
17
20ms
FNC100-FNC109
Data
Transfer 2
END
END
Output
processing
18
FNC110-FNC139
Floating Point
*4.
16
FNC80-FNC89
External FX
Device
Sequence
program
X001
M8000
14
FMC60-FNC69
Handy
Instruction
*1.
FNC50-FNC59
High Speed
Processing
*3
12
FNC40-FNC49
Data Operation
A digital filter is built into the inputs X000 to X017*1. The filter time can be changed in 1 ms units within the
range from 0 to 60 ms using applied instructions. When the filter time is set to "0", the input filter value is as
follows.
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
329
*2.
D8020
When the END
instruction is
executed
Digital filter
Initial value: 10 ms
C-R filter
Fixed to 10 ms
Input image
memory
330
11
FNC30-FNC39
Rotation and
Shift
13.3
Outline
This instruction reads matrix input as 8-point input "n"-point output (transistor) in the time division method.
FNC 52
MTR
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
MTR
FNC40-FNC49
Data Operation
1. Instruction format
12
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
Bit
D1
Bit
D2
Bit
15
16-bit binary
FNC70-FNC79
External FX I/O
Device
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Bit Devices
Word Devices
Others
System User
System
User
Real CharacConstant
Pointer
Number ter String
Digit Specification
Special
Unit
Index
""
D1
D2
3 3
17
FNC100-FNC109
Data
Transfer 2
Input
number
FNC 52
MTR
and "n"
Number
ON
of
output
Output
number destination columns
D1
D2
18
FNC110-FNC139
Floating Point
An input signal of 8 points "n" columns is controlled in the time division method using 8 inputs
transistor outputs D1 . Each column is read in turn, and then output to D2 .
Command
input
(normally ON)
16
FNC80-FNC89
External FX
Device
Operand
Type
19
FNC140-FNC149
Data
Operation 2
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.
20
FNC150-FNC159
Positioning
Control
331
D2 +17
D2 +16
D2 +15
D2 +14
D2 +13
D2 +12
D2 +10
Diode
0.1A(50V)
2nd
column
D2 +11
The figure below shows an example of the FX3U series main unit (sink input/sink output). For the wiring, refer
to the following manual of the used PLC.
FX3U Hardware Edition
Command
contact
1st column input is received.
D2 +7
D2 +6
D2 +5
D2 +4
D2 +3
D2 +2
D2
1st
column
D2 +1
D1
[1]
[5]
[3]
[2]
[4]
[6]
20ms
S
24V 0V S/S
S +1 S +2 S +3 S +4 S +5 S +6 S +7
PLC
COM
D1
M8029 (execution
complete)
D1 +1 D1 +2 D1 +3 D1 +4 D1 +5 D1 +6 D1 +7
"n" points
are
occupied.
Related device
Device
Name
M8029
Description
Turns ON after the first cycle operation.
Cautions
1. Number of occupied devices
1) Eight input points are occupied from the input device number specified in
2) "n" output points are occupied from the output device number specified in D1 .
When specifying the output in D2 , make sure that "n" output numbers specified in
overlap the output specified in D2 .
2. Wiring
One diode of 0.1 A/50 V is required for each switch.
3. Output format
Use the transistor output format.
332
D1
does not
11
X020
Y020
M 30
K 3
Input
number
Output
number
M 57
M 56
Number
ON
of
output
destination columns
M 55
M 54
M 53
D2
M 52
D1
M 47
M 46
M 45
M 44
M 43
M 42
M 41
Y021
[1]
[4]
2nd column input is received.
[2]
14
[5]
Y022
[3]
[6]
15
M 37
M 36
M 35
M 34
M 33
M 32
M 31
M 30
20ms
M8029 (execution
complete)
FNC70-FNC79
External FX I/O
Device
Diode
0.1A(50V)
1st
column
M0
FMC60-FNC69
Handy
Instruction
Diode
0.1A(50V)
2nd
column
M 40
13
FNC50-FNC59
High Speed
Processing
Diode
0.1A(50V)
3rd
column
M 50
FNC 52
MTR
M 51
M0
PLC
12
FNC40-FNC49
Data Operation
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
following manual of the used PLC.
FX3U Hardware Edition
FNC30-FNC39
Rotation and
Shift
Program example
Sink input
Sink output
16
FNC80-FNC89
External FX
Device
COM Y020Y021Y022Y023Y024Y025Y026Y027
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
333
FNC 52
MTR
X020
Y040
M 0
K 8
The figure below shows an example of the FX3U Series main unit (sink input/sink output).
Matrix
circuit
24V
S/S
0V
Refer to the
previous page.
FX3U-64MT-ES
Transistor output
COM5 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027
3.3k/0.5W
Pull-up resistor
80ms
334
80ms
160ms
*1.
*2.
160ms
11
FNC30-FNC39
Rotation and
Shift
13.4
Outline
1. Instruction format
FNC 53
HSCS
Mnemonic
16-bit Instruction
Operation Condition
13 steps
Operation Condition
13
Continuous
Operation
DHSCS
FNC50-FNC59
High Speed
Processing
2. Set data
Description
Data Type
S1
Data to be compared with the current data value of a high-speed counter or word
device number.
32-bit binary
S2
32-bit binary
Bit device number to be set to ON when the compared two values are equivalent
to each other
14
FMC60-FNC69
Handy
Instruction
Operand Type
Bit
15
3. Applicable devices
Bit Devices
Word Devices
System User
X
System
User
Digit Specification
Special
Unit
Index
Constant
S1
3 3 3 3
3 S1
3 3
Real CharacPointer
Number ter String
E
""
16
3
3
S2
Command
input
S2
K2,147,483,647
Comparison Comparison Output
value
source
destination
S1
S2
19
Set to ON.
FNC140-FNC149
Data
Operation 2
FNC 53
DHSCS
18
FNC110-FNC139
Floating Point
When the current value of a high speed counter (C235 to C255) specified in S2 becomes the comparison
value [ S1 +1, S1 ] (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 D is set to ON without regard to the operation cycle.
This instruction is executed after the counting processing in the high speed counter.
17
FNC100-FNC109
Data
Transfer 2
FNC80-FNC89
External FX
Device
S2
D
Others
FNC70-FNC79
External FX I/O
Device
Operand
Type
12
FNC40-FNC49
Data Operation
This instruction compares a value counted by a high speed counter with a specified value, and immediately
sets an external output (Y) if the two values are equivalent each other.
For the counter interrupt using HSCS instruction, refer to Section 35.6.
S1 = S2 D
20
FNC150-FNC159
Positioning
Control
335
Operation
When the current value of the high speed counter C255 changes from "99" to "100" or from "101" to "100",
Y010 is set to ON (output refresh).
M8000
K2,147,483,647
C255
RUN monitor
Comparison
value
FNC 53
DHSCS
Comparison Output
source
destination
K100
C255
Set to ON.
Y010
Related instructions
The following instructions can be combined with high speed counters:
Instruction
FNC No.
Instruction name
DHSCS
FNC 53
DHSCR
FNC 54
DHSZ
FNC 55
DHCMOV
FNC189
DHSCT
FNC280
Cautions
1. Selection of the count comparison method
When the DHSCS instruction is used with a hardware counter (C235, C236, C237, C238, C239, C240, C244
(OP), C245 (OP), C246, C248 (OP), C251, C253), the hardware counter is automatically switched to a
software counter, and the maximum frequency and total frequency are affected.
Refer to the counting operation described below, and select according to the contents of control whether to
use HSCS instruction or general-purpose comparison instruction.
1) Case to select DHSCS instruction
- When the output should be given when the counting result becomes equivalent to the comparison value
without regard to the scan time of the PLC
2) Cases to select a general-purpose comparison instruction
- When the required frequency is beyond the counting performance of the software counters
- When counting is regarded as important, but the effect of the scan time can be ignored in operations
according to the counting result
- When the number of an instruction is more than 32
M8000
FNC229
LDD<=
FNC189
DHCMOV
K100
C251
D100
FNC 50
REF
D100
K0
SET
Y010
Y010
K8
4. Priority order in operation among HSCS (FNC 53), HSCR (FNC 54), and HSZ (FNC 55)
instructions for a same high speed counter
For details, refer to "6. Priority order in operations among HSCS (FNC 53), HSCR (FNC 54), and HSZ
(FNC 55) instructions for the same high speed counter" in Subsection 13.4.1.
336
11
For details, refer to "5. Reset operation by an external terminal" in Subsection 13.4.1.
6. For other cautions on using HSCS instruction, refer to the description later.
For details, refer to the next page.
With regard to the current value of a counter, different outputs (Y) are arbitrary set to ON by two values.
M8000
C255
K2,147,483,647
RUN monitor
FNC 53
DHSCS
S2
K100
C255
Y010
S1
S2
K150
C255
Y011
13
C255 = K100 Y010 = ON
FNC50-FNC59
High Speed
Processing
FNC 53
DHSCS
S1
14
100
101
151
15
FNC70-FNC79
External FX I/O
Device
C255
99
150
FMC60-FNC69
Handy
Instruction
149
Y010
Y011
16
DHSCS (FNC 53), DHSCR (FNC 54), DHSZ (FNC 55) and DHSCT (FNC280) instructions are provided for
high speed counters.
This section explains common cautions for these instructions.
17
18
DHSCS
*1.
When DHSZ or DHSCT instruction is used, the maximum response frequency of every software
counter and the total frequency are limited.
When DHSZ or DHSCT instruction is used, the maximum response frequency of every software counter and
the total frequency are limited.
For the maximum response frequency of each software counter and the total frequency,
refer to Subsection 4.7.10.
19
FNC140-FNC149
Data
Operation 2
FNC110-FNC139
Floating Point
DHSZ*1
DHSCT*1
FNC100-FNC109
Data
Transfer 2
DHSCS, DHSCR and DHSZ instructions can be used as many times as necessary in the same way as
general instructions. However, the number of simultaneously driven instructions is limited. The DHSCT
instruction can be used only once in any program.
DHSCR
FNC80-FNC89
External FX
Device
Instruction
12
FNC40-FNC49
Data Operation
Program example
FNC30-FNC39
Rotation and
Shift
20
FNC150-FNC159
Positioning
Control
337
FNC 53
DHSCS
K100
C255
Y000
FNC 53
DHSCS
K100
C255
Y010
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.
*1.
K9,999
K 0
C241
Y000
M8025 is cleared when the PLC mode is changed from RUN to STOP.
2) Operation
When the external reset input X001 turns ON while the current value of C241 is "100", for example, the
current value of C241 is reset to "0". And Y000 is reset at this time even if a counting input is not given.
338
11
M8000
FNC 53
DHSCS
K500
C235
Y000
C235
Y001
(1)
(2)
FNC 54
DHSCR
K500
FNC 55
DHSZ
K250
K500
C235
Y003
FNC 11
DZCPP
K250
K500
C235
Y003
FNC 54
DHSCR
K500
C235
Y006
(5)
FNC 54
DHSCR
K500
C235
C235
(6)
Y002
(3)
FX3U/
FX3UC
FX2N/
FX2NC
FX1N/FX1S/
FX1NC
DHSCS (1)
DHSCR (6)
DHSCS (1) DHSCS (1)
(self-reset)
DHSCS (2)
DHSZ (4)
DHSCR (3)
DHSZ (4)
DHSCR (5)
DHSZ (4)
DHSCR (6)
(self-reset)
DHSCR (5)
(4)
16
Present value
FNC100-FNC109
Data
Transfer 2
500
250
250
0
Y000 to Y002 and Y006 do not change.*1
OFF
Y005
OFF
ON
ON
Y002
OFF
Y003
Y004
Y005
ON
18
Present value:1
ON
ON
19
*1
Present value:1
FNC140-FNC149
Data
Operation 2
Y000,Y001
FNC110-FNC139
Floating Point
Y004
*2.
17
Present value
500
*1.
FNC80-FNC89
External FX
Device
ON
14
15
Self-reset program
Y003
13
FNC70-FNC79
External FX I/O
Device
M8000
C235
Processing sequence
Program
sequence
FMC60-FNC69
Handy
Instruction
M8000
K500
K10000
FNC50-FNC59
High Speed
Processing
FNC 53
DHSCS
C235
12
FNC40-FNC49
Data Operation
When the same comparison value is used for the same high speed counter in HSCS (FNC 53), HSCR (FNC
54), and HSZ (FNC 55) instructions, high speed counter reset (self-reset) by HSCR (FNC 54) instruction is
executed with the highest priority (as shown in the table below).
In this case, the comparison results do not change in HSCS, HSCR, and HSZ instructions whose comparison
value is programmed to be the same as the comparison value for self-reset by HSCR (FNC 54) instruction.
To change the comparison results, set the comparison value to "K0".
FNC30-FNC39
Rotation and
Shift
6. Priority order in operations among HSCS (FNC 53), HSCR (FNC 54), and HSZ (FNC 55)
instructions for the same high speed counter
20
FNC150-FNC159
Positioning
Control
339
13.5
Outline
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.
1. Instruction format
FNC 54
HSCR
Mnemonic
16-bit Instruction
Operation Condition
13 steps
Operation Condition
Continuous
Operation
DHSCR
2. Set data
Operand Type
Description
Data Type
S1
Data to be compared with the current value of a high speed counter or word
device number storing the data to be compared
32-bit binary
S2
32-bit binary
Bit device number to be reset (set to OFF) when both values become equivalent
each other.
Bit
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
Others
System User
System
User
Real CharacPointer
Constant
Number ter String
Digit Specification
Index
S1
3 3 3 3
S2
D
Special
Unit
3 S1
3 3
S2
""
S2
K2,147,483,647
Comparison Comparison
value
source
FNC 54
DHSCR
340
S1
S2
Output
destination
Reset.
S1 = S2 D
M8000
C255
RUN
monitor
K2,147,483,647
Comparison Comparison
value
source
K100
C255
Y010
12
Reset.
K100 = C255 Y010
FNC40-FNC49
Data Operation
FNC 54
DHSCR
Output
destination
Related instructions
13
Instruction name
DHSCS
FNC 53
DHSCR
FNC 54
DHSZ
FNC 55
FNC189
DHSCT
FNC280
14
FMC60-FNC69
Handy
Instruction
DHCMOV
FNC50-FNC59
High Speed
Processing
Instruction
Cautions
1. Selection of the count comparison method
D100
FNC 50
REF
D100
K0
RST
Y010
Y010
K8
18
FNC110-FNC139
Floating Point
M8000
C251
17
FNC100-FNC109
Data
Transfer 2
FNC229
LDD<= K10000
FNC189
DHCMOV
16
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
When the DHSCR instruction is used with a hardware counter (C235, C236, C237, C238, C239, C240, C244
(OP), C245 (OP), C246, C248 (OP), C251, C253), the hardware counter is automatically switched to a
software counter, and the maximum frequency and total frequency are affected.
Refer to the counting operation described below, and select according to the contents of control whether to
use HSCR instruction or general-purpose comparison instruction.
M8000
11
FNC30-FNC39
Rotation and
Shift
Operation
When the present value of the high speed counter C255 changes (counts) from "99" to "100" or from "101" to
"100", Y010 is reset (output refresh).
For details, refer to "6. Priority order in operations among HSCS (FNC 53), HSCR (FNC 54), and HSZ
(FNC 55) instructions for the same high speed counter" in Subsection 13.4.1.
341
20
FNC150-FNC159
Positioning
Control
For details, refer to "5. Reset operation by an external terminal [M8025*1: HSC (external reset)
mode]" in Subsection 13.4.1.
FNC140-FNC149
Data
Operation 2
3. Priority order in operation among HSCS (FNC 53), HSCR (FNC 54), and HSZ (FNC 55)
instructions for the same high speed counter
19
Program example
1. Example of self-reset circuit
When the current value of C255 becomes "400", C255 is immediately reset. Its current value becomes "0",
and the output contact is set to OFF.
M8000
C255
K300
RUN monitor
FNC 54
DHSCR
K400
C255
C255
Current value
of C255
Output contact
of C255
342
11
FNC30-FNC39
Rotation and
Shift
13.6
Outline
1. Instruction format
Mnemonic
16-bit Instruction
Operation Condition
17 steps
13
Operation Condition
Continuous
Operation
DHSZ
FNC50-FNC59
High Speed
Processing
FNC 55
HSZ
12
FNC40-FNC49
Data Operation
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).
For the table high speed comparison mode, refer to Subsection 13.6.2.
For the frequency control mode, refer to Subsection 13.6.3.
2. Set data
Operand Type
Description
Data Type
14
S1
Data to be compared with the current value of a high speed counter or word
device number storing data to be compared (comparison value 1)
32-bit binary
S2
Data to be compared with the current value of a high speed counter or word
device number storing data to be compared (comparison value 2)
32-bit binary
32-bit binary
FMC60-FNC69
Handy
Instruction
Head bit device number to which the comparison result is output based on upper
and lower comparison values
15
Bit
Operand
Type
Bit Devices
Word Devices
System User
Y
System
User
Special
Unit
Index
Constant
S1
3 3 3 3
S2
3 3 3 3
S
D
3 3
Real CharacPointer
Number ter String
E
""
17
FNC100-FNC109
Data
Transfer 2
K2,147,483,647
Comparison
value 1
FNC 55
DHSZ
S1
Comparison
value 2
S2
Comparison
source
Output
destination
Set to ON.
S
S1
S2 D
+1
> S2 D
+2
20
FNC150-FNC159
Positioning
Control
S1 >
19
FNC140-FNC149
Data
Operation 2
18
FNC110-FNC139
Floating Point
16
FNC80-FNC89
External FX
Device
Digit Specification
Others
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
343
Comparison points
Make sure that the comparison value 1 and the comparison value 2 have the following relationship:
[ S1 +1, S1 ] [ S2 +1, S2 ]
Comparison point
Comparison value 1
S1
+1, S1
Comparison value 2
S2
+1, S2
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.
M8000
C251
RUN monitor
K2,147,483,647
Comparison
value 1
FNC 55
DHSZ
Comparison Comparison
Output
value 2
source
destination
K1000
K2000
C251
Y000
ON
K1000 > C251
Y000
Comparison pattern
1000 >
>
S1
S1
< S2
Y001
Y002
ON
OFF
OFF
OFF
999 1000
ON OFF
OFF ON
999 1000
OFF ON
ON OFF
OFF
999 1000
ON OFF
OFF ON
OFF
999 1000
OFF ON
ON OFF
OFF
OFF
ON
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
> 2000
OFF
OFF
ON
1000
S2
Y000
2000
Related instructions
The following instructions can be combined with high speed counters:
Instruction
FNC No.
DHSCS
FNC 53
Instruction name
DHSCR
FNC 54
DHSZ
FNC 55
DHCMOV
FNC189
DHSCT
FNC280
Cautions
1. Selection of the count comparison method
When the DHSZ instruction is used with a hardware counter (C235, C236, C237, C238, C239, C240, C244
(OP), C245 (OP), C246, C248 (OP), C251, C253), the hardware counter is automatically switched to a
software counter, and the maximum frequency and total frequency are affected.
Refer to the counting operation described below, and select according to the contents of control whether to
use DHSZ instruction or general-purpose comparison instruction.
1) Case to select DHSZ instruction
- When the output should be given when the counting result becomes equivalent to the comparison value
regardless of the scan time of the PLC
344
DHCMOV
D100
FNC229
LDD <= K10000
D100
FNC226
LDD < K20000
D100
D100
K0
Y010
FNC238
ANDD >= K20000
D100
13
Y011
FNC50-FNC59
High Speed
Processing
FNC225
LDD > K10000
C251
Y012
M8000
FNC 50
REF
Y010
K8
14
FMC60-FNC69
Handy
Instruction
6. Priority order in operation among HSCS (FNC 53), HSCR (FNC 54), and HSZ (FNC 55)
instructions for a same high speed counter
For details, refer to "6. Priority order in operation among HSCS (FNC 53), HSCR (FNC 54), and HSZ
(FNC 55) instructions for a same high speed counter" in Subsection 13.4.1.
For details, refer to "5. Reset operation by an external terminal [M8025*1: HSC (external reset)
mode]" in Subsection 13.4.1.
19
respectively.
FNC140-FNC149
Data
Operation 2
or S2
18
FNC110-FNC139
Floating Point
17
FNC100-FNC109
Data
Transfer 2
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 "13.6.1 Program in which comparison result is set to ON when power is turned
ON [ZCP (FNC 11) instruction]".
16
FNC80-FNC89
External FX
Device
1) DHSZ instruction executes comparison and outputs the result only when a counting pulse is input to a
high speed counter.
(When S1 is "1000" and S2 is "1999", the output D is set to ON as soon as the current value of
C235 changes from "999" to "1000" or from "1999" to "2000".)
15
FNC70-FNC79
External FX I/O
Device
12
FNC40-FNC49
Data Operation
M8000
11
FNC30-FNC39
Rotation and
Shift
20
FNC150-FNC159
Positioning
Control
345
Explanation of operation
The outputs Y010 to Y012 are as shown below:
Y010 = ON
0
Y011 = ON
1000
Y012 = ON
1200
Current value of C235
Program example
X010
RST
C235
FNC 40
ZRST
Y010
M8000
C235
Y012
RUN monitor
X010
Start
FNC 11
DZCPP
FNC 55
DHSZ
K1000
K1200
C235
Y010
S1
S2
K1000
K1200
C235
Y010
Timing chart
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.
1) For initializing Y010, the current value of C235 is compared with K1000 and K1200, and Y010 is driven
using the DZCPP instruction (for general zone comparison) as pulse operation only upon startup.
2) The comparison result in Y010 is latched until an input pulse is input and the comparison output is driven
by the DHSZ instruction.
3) According to the current value of the counter, the DHSZ instruction drives the output (A), (B) or (C).
346
11
FNC30-FNC39
Rotation and
Shift
X000
(input pulse for
C235)
12
FNC40-FNC49
Data Operation
X010
(Start)
Y010
[1]
13
Y011
FNC50-FNC59
High Speed
Processing
(smaller than
zone)
B
(inside zone)
Y012
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
347
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 HSCT instruction which can change up to
16 outputs.
1. Set data
Operand Type
Description
Data Type
S1
Head word device number storing the data table (only data register D)
32-bit binary
S2
32-bit binary
32-bit binary
M8130 (special auxiliary relay for declaring the table high speed comparison
mode)
Bit
K2,147,483,647
Head
device
FNC 55
DHSZ
Number Comparison
of lines
source
S1
S2
M8130
Table high speed comparison mode
Comparison table
Comparison data (32 bits)
S1
+ 1, S1
+ 9, S1
+8
S1
+ 5, S1
+3
S1
+6
S1
+7
+ 11
S1
+ 10
S1
+4
S1
+6
S1
S1
+4
+2
+ 5, S1
SET/RST
S1
S1
S1
+7
S2 1
.
4 devices are occupied from S1
348
11
FNC30-FNC39
Rotation and
Shift
12
Set (ON)
K1/H1
Reset (OFF)
K0/H0
FNC40-FNC49
Data Operation
Contents of setting
2. Operation
13
H10
D202
FNC 12
MOV
K1
D203
FNC 12
DMOV
K234
D204
Comparison data
FNC 12
MOV
H10
D206
FNC 12
MOV
K0
D207
FNC 12
DMOV
K345
D208
Comparison data
FNC 12
MOV
H11
D210
FNC 12
MOV
K1
D211
FNC 12
DMOV
K456
D212
Comparison data
FNC 12
MOV
H11
D214
FNC 12
MOV
K0
D215
FNC 12
DMOV
K567
D216
Comparison data
FNC 12
MOV
H11
D218
FNC 12
MOV
K1
D219
14
15
16
17
18
FNC110-FNC139
Floating Point
FNC 12
MOV
FNC100-FNC109
Data
Transfer 2
Comparison data
FNC80-FNC89
External FX
Device
19
K2,147,483,647
FNC 55
DHSZ
Head
device
D200
C251
RST
Y011
K5
C251
M8130
Table high speed comparison mode
20
FNC150-FNC159
Positioning
Control
RST
Number Comparison
of lines
source
FNC140-FNC149
Data
Operation 2
Reset
command
input
D200
FNC70-FNC79
External FX I/O
Device
C251
K123
FMC60-FNC69
Handy
Instruction
Command
input
FNC 12
DMOV
FNC50-FNC59
High Speed
Processing
M8002
349
Comparison table
Comparison Output (Y)
SET/RST
data
number
Present value
of C251
Table
counter
D201,D200
K123
D 202
H10
D 203
K1
D205,D204
K234
D 206
H10
D 207
K0
D209,D208
K345
D 210
H11
D 211
K1
D213,D212
K456
D 214
H11
D 215
K0
D217,D216
K567
D 218
H11
D 219
K1
Repeated
from "0".
567
A program to reset
the counter is
required.
456
345
234
123
Y010
Y011
A program to reset
the output is
required.
Cautions
1. Limitation in the number of DHSZ instruction
This instruction can be programmed only once in a program.
With regard to the DHSCS, DHSCR, DHSZ and DHSCT instructions used for other purposes, up to 32
instructions including the DHSZ instruction can be driven at one time.
350
11
FNC30-FNC39
Rotation and
Shift
13
FNC50-FNC59
High Speed
Processing
1. Control example
12
FNC40-FNC49
Data Operation
When the special auxiliary relay M8132 for declaring the frequency control mode is specified as D
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 S1 , and a constant K or H can be specified as
S2 . The available range is limited to "1 K, H 128".
A high speed counter C235 to C255 can be specified as S .
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.
D 301,D 300
K 20
D 302, D 303
K300
D 305,D 304
K600
D 306, D 307
K500
D 309,D 308
K700
D 310, D 311
K200
D 313,D 312
K800
D 314, D 315
K100
15
D 317,D 316
K 0
D 318, D 319
K 0
FNC70-FNC79
External FX I/O
Device
14
FMC60-FNC69
Handy
Instruction
Comparison data
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
351
Command
input
FNC 12
DMOVP
K20
D300
Comparison data
FNC 12
DMOVP
K300
D302
Frequency
FNC 12
DMOVP
K600
D304
Comparison data
FNC 12
DMOVP
K500
D306
Frequency
FNC 12
DMOVP
K700
D308
Comparison data
FNC 12
DMOVP
K200
D310
Frequency
FNC 12
DMOVP
K800
D312
Comparison data
FNC 12
DMOVP
K100
D314
Frequency
FNC 12
DMOVP
K0
D316
Comparison data
FNC 12
DMOVP
K0
D318
Frequency
Head
device
FNC 55
DHSZ
PLS
M10
352
S1
Number Comparison
source
of lines
S2
M10
Pulse quantity
(K0 specifies
continuous Pulse
Frequency
output
output.)
FNC 57
DPLSY
D8132
K0
Y000
Frequency
control
mode
M8132
11
FNC30-FNC39
Rotation and
Shift
12
FNC40-FNC49
Data Operation
300
200
13
20
FNC50-FNC59
High Speed
Processing
100
600 700 800
Current value of C251
1) Write prescribed data in advance to data registers constructing the table as shown in this program
example.
14
2) The output frequency of the PLSY instruction remains in the value (D303, D302) until the current value of
a high speed counter specified in S
becomes equivalent to (D301, D300). (D302 specifies low-order
16 bits. D303 specifies high-order 16 bits, but is always "0".)
FMC60-FNC69
Handy
Instruction
3) The operation in the 2nd line is started after that, and then the operation in each line is executed in turn.
5) For stopping the operation in the last line, set the frequency in the last table to K0.
6) When the command input is set to OFF, the pulse output turns OFF and the table counter D8131 is reset.
7) After DHSZ instruction is first executed, creation of the table is completed at the END instruction. The
DHSZ instruction becomes valid after that.
Data can be written to the table in a program as shown in this example or directly using keys in peripheral
equipment.
17
18
Cautions
1) DHSZ instruction can be used only once.
3) Because the table is created when the END instruction is executed, it is necessary to delay execution of
the PLSY (FNC 57) instruction until creation of the table is completed.
4) Do not change the data table while the DHSZ instruction is driven.
19
FNC140-FNC149
Data
Operation 2
2) With regard to the DHSCS (FNC 53), DHSCR (FNC 54), DHSZ (FNC 55) and DHSCT (FNC280)
instructions used for other purposes, up to 32 instructions including the DHSZ instruction can be driven at
one time.
FNC110-FNC139
Floating Point
2) D8132
In the frequency control mode, the frequency set in the table is received by D8132 sequentially according
to the table counter count D8131.
FNC100-FNC109
Data
Transfer 2
1) M8132
This is the special auxiliary relay for declaring the frequency control mode
16
FNC80-FNC89
External FX
Device
8) Accordingly, the contact of PLS M10 is used so that the PLSY instruction is executed from the second
scan after the command input has been set to ON.
15
FNC70-FNC79
External FX I/O
Device
4) When the operation in the last line is completed, the complete flag M8133 turns ON. The program
execution returns to the 1st line, and the operation is repeated.
20
5) In the frequency control mode, simultaneous output to Y000 to Y001 is not permitted.
FNC150-FNC159
Positioning
Control
353
13.7
Outline
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.
1. Instruction format
FNC 56
SPD
Mnemonic
16-bit Instruction
7 steps
Operation Condition
Continuous
Operation
SPD
13 steps
Operation Condition
Continuous
Operation
DSPD
2. Set data
Operand Type
Description
Data Type
S1
Bit
S2
3. Applicable devices
Operand
Type
S1
S2
Bit Devices
Word Devices
Others
System User
System
User
Real CharacConstant
Pointer
Number ter String
Digit Specification
Index
3
3
354
Special
Unit
3 3 3 3
3 3 3 3
3 3
3 3
""
11
Command
input
FNC 56
SPD
S1
S2
12
FNC40-FNC49
Data Operation
The input pulse S1 is counted only for S2 1 ms. The measured value is stored in D , the present
value is stored in D +1, and the remaining time is stored in D +2 (ms).
By repeating this operation, the measured value D
will store the pulse density (which is proportional to
the rotation speed).
FNC30-FNC39
Rotation and
Shift
13
Command
input
FNC50-FNC59
High Speed
Processing
1) Timing chart
The command contact is set to ON.
S1
14
D
Current value
Measured
value
S2 ms
Counting time
S2 ms
16
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
S2 ms
Counting time
started again.
FMC60-FNC69
Handy
Instruction
D +1
17
FNC100-FNC109
Data
Transfer 2
Input X000
N(rpm)
60 D
nt
18
3
10 (r/min)
t: Measurement time duration specified as S2
(ms)
Proximity switch
"n" pulses/rotation
FNC110-FNC139
Floating Point
N=
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
355
FNC 56
DSPD
S1
S2
1) Timing chart
Command
input
S1
[ D +1, D ]
Measured value
[ D +3, D +2]
Current value
[ S2 +1, S2 ] ms [ S2 +1, S2 ] ms
Counting time
Counting time
[ S2 +1, S2 ] ms
[ D +5, D +4]
Remaining time (ms)
+1,
Input X000
N(rpm)
N=
Proximity switch
"n" pulses/rotation
356
60 [
+1,
nt
103 (r/min)
+1,
] (ms)
11
12
FNC40-FNC49
Data Operation
13
FNC50-FNC59
High Speed
Processing
The maximum frequency of turning the inputs X000 to X007 ON and OFF is shown below:
Maximum input frequency
Used input number
X000 to X005
Main unit
100 kHz*1
10 kHz
10 kHz
FX3U-4HSX-ADP
14
200 kHz
2. Occupied devices
1) When using the 16-bit operation
Three devices are occupied from a device specified in
D
16
S2 .
If the word device value is changed while the instruction is being executed, the change affects the operation
in every measurement cycle.
The function of the FNC 56 instruction varies depending on the PLC version shown in the table below.
Applicable version
FX3U
FX3UC
Ver.2.20 or later
Ver.2.20 or later
Item
Addition of 32-bit instruction
17
FNC100-FNC109
Data
Transfer 2
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
When receiving pulses within the response frequency range of 50 k 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.
FMC60-FNC69
Handy
Instruction
100 kHz*1
X006,X007
*1.
FX3U PLC
FX3UC PLC
FNC30-FNC39
Rotation and
Shift
Cautions
Outline of function
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
357
13.8
Outline
This instruction generates a pulse signal.
1. Instruction format
FNC 57
PLSY
Mnemonic
16-bit Instruction
7 steps
Operation Condition
Continuous
Operation
PLSY
13 steps
Operation Condition
Continuous
Operation
DPLSY
2. Set data
Operand Type
Description
Data Type
S1
S2
Bit
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
Others
System User
System
User
Real CharacConstant
Pointer
Number ter String
Digit Specification
Special
Unit
Index
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
""
S: Specify a transistor output on the main unit or Y000 or Y001 on a special high speed output adapter*1.
*1. Special high speed output adapters cannot be connected to the FX3UC PLC.
S2 Pulse quantity
FNC 57
PLSY
S1
S2
D
S1 Frequency
Specify the output (Y) number from which pulses are to be output in
Allowable setting range: Y000, Y001
358
11
+1, S1
+1, S2
[ S2 + 1, S2 Pulse quantity ]
S1
S2
12
FNC40-FNC49
Data Operation
FNC 57
DPLSY
[ S1 + 1, S1 Frequency ]
13
].
Specify the output (Y) number from which pulses are output in D .
Allowable setting range: Y000, Y001
For the method to output pulses without any limitation,
refer to the program example later.
Device
M8029
Description
Instruction execution
complete
FNC 57
PLSY
Command
input 1
K1000
K0
Y000
Command
input 2
M8029
FNC 57
PLSY
K1000
K0
Y000
FNC 57
DPLSY
K1000
K0
Y001
17
Command
input 1 M8029
FNC 57
DPLSY
K1000
K0
Y000
Command
input 2 M8029
Changes by DPSLY
instruction corresponding to
the command input 2.
M8029
FNC100-FNC109
Data
Transfer 2
Command
input 2
16
FNC80-FNC89
External FX
Device
Command
input 1
Name
15
FNC70-FNC79
External FX I/O
Device
The instruction execution complete flag M8029 used for PLSY instruction can be used also for other
instructions. When using other instructions, setting the M8029 flag to ON or OFF, or using two or more PLSY
instructions, make sure to use each M8029 flag just after an instruction to be monitored.
For the instruction execution complete flag use method,
refer to Subsection 6.5.2.
14
FMC60-FNC69
Handy
Instruction
Related devices
FNC50-FNC59
High Speed
Processing
FNC30-FNC39
Rotation and
Shift
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
359
Contents of data
High
order
Low
order
D8141
D8140
D8143
D8142
D8137
The contents of each data register can be cleared using the following program:
Command
input
FNC 12
DMOV
K0
Description
M8349
M8359
To restart pulse output, set the device (M8349 or M8359) corresponding to the output signal to OFF, and then
drive the pulse output instruction again.
Cautions
1. When a word device is specified as
S1
or
S2
When the value of the word device is changed while the instruction is executed, the following operation
results:
When the data in S1
is changed, the change (new value) becomes valid the next time the instruction is
2. Frequency S1
When using transistor outputs in the main unit, set the output frequency S1 to "100,000 Hz" or less.
If the load is operated using pulses at a frequency higher than 100,000 Hz, the PLC may be damaged.
3. Pulse output
Only a transistor output on the main unit or Y000 or Y001 on a special high speed output adapter*1 can be
specified in D .
When using the PLSY (FNC 57) instruction with a relay output type FX3U PLC, a special high speed output
adapter is required.
*1. Special high speed output adapters cannot be connected to the FX3UC PLC.
The duration of the ON/OFF pulses is 50% (ON = 50%, OFF = 50%).
The pulse output is controlled by the dedicated hardware not affected by the sequence program (operation
cycle).
If the command input is set to OFF during continuous pulse output, the output from
360
turns OFF.
11
Description
External
power
supply
5 to 24V DC
10 to 100 mA
Output frequency
Equipment
load
resistor
PLC
(transistor output)
[sink output]
Dummy
resistor
13
Y000
Input circuit
COM1
14
1) Outputs of special high speed output adapters work as differential line drivers.
Operation
= 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.
Output number
1st unit
2nd unit
Forward rotation
pulse chain (FP)
Y000
Y001
Y002
Y003
Reverse rotation
pulse chain (RP)
Y004
Y005
Y006
Y007
Pulse chain
Y000
Y001
Y002
Y003
Direction
Y004
Y005
Y006
Y007
"PLSxDIR" side
Output operation
Operated.
Set the output frequency to "200kHz" or less.
Operated.
Set the output frequency to "100kHz" or less.
20
FNC150-FNC159
Positioning
Control
19
FNC140-FNC149
Data
Operation 2
Output operation
While instruction is activated, relevant output is ON. (LED is also ON.)
Use a special high speed adapter.
18
FNC110-FNC139
Floating Point
"FPxRP" side
Signal name
17
FNC100-FNC109
Data
Transfer 2
4) When special high speed output adapters are connected, the same output numbers in the main unit are
assigned as shown in the table below.
Only wire the appropriate output terminals.
Outputs in special high speed output adapters and the main unit operate as shown below.
16
FNC80-FNC89
External FX
Device
3) Set the pulse output type setting switch while the PLC is stopped or while the power is OFF.
Do not manipulate the pulse output form setting switch while pulses are being output.
15
FNC70-FNC79
External FX I/O
Device
Output affecting
operation
FMC60-FNC69
Handy
Instruction
2) Set the pulse output type setting switch in a special high speed output adapter to the "pulse chain +
direction" (PLSxDIR) side.
If the switch is set to the "forward rotation pulse chain reverse rotation pulse chain" (FPxRP) side, normal
operations are disabled. The pulse output destination changes depending on the PLC output status as
shown in the table below.
Pulse output
destination
12
FNC50-FNC59
High Speed
Processing
Item
Operating voltage range
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
4. Handling of pulse output terminals in the FX3U and FX3UC series main units
361
6. Others
1) Types of pulse output, positioning and other relevant instructions and their target output numbers
Classification
Pulse output
Positioning
High speed
processing
Instruction
Instruction name
PLSY(FNC 57)
Pulse Y output
Y000,Y001
PLSR(FNC 59)
Acceleration/deceleration setup
Y000,Y001
DSZR(FNC150)
Y000,Y001,Y002,Y003
DVIT(FNC151)
Interrupt positioning
Y000,Y001,Y002,Y003
ZRN(FNC156)
Zero return
Y000,Y001,Y002,Y003
PLSV(FNC157)
Y000,Y001,Y002,Y003
DRVI(FNC158)
Drive to increment
Y000,Y001,Y002,Y003
DRVA(FNC159)
Drive to absolute
Y000,Y001,Y002,Y003
PWM(FNC 58)
Y000,Y001,Y002,Y003
2) 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.
Pulse output destination device
Y000
M8340
Y001
M8350
3) "Frequency control mode" in which DHSZ (FNC 55) and PLSY (FNC 57) instructions are combined can
be used only once in a program.
K1000
K0
Y000
Y000
1000Hz
362
11
FNC30-FNC39
Rotation and
Shift
13.9
Outline
12
FNC 58
PWM
Mnemonic
16-bit Instruction
7 steps
Operation Condition
Continuous
Operation
PWM
FNC40-FNC49
Data Operation
1. Instruction format
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
16-bit binary
S2
Period (ms)
16-bit binary
14
Bit
3. Applicable devices
Operand
Type
Word Devices
Others
System User
System
User
Real CharacConstant
Pointer
Number ter String
Digit Specification
Special
Unit
Index
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
""
17
FNC 58
PWM
ms.
FNC100-FNC109
Data
Transfer 2
t
S1
16
FNC80-FNC89
External FX
Device
S: Specify transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002, or Y003 on a special
high speed output adapter*1.
*1. Special high speed output adapters cannot be connected to the FX3UC PLC.
15
FNC70-FNC79
External FX I/O
Device
Bit Devices
FMC60-FNC69
Handy
Instruction
S1
S2
18
T0
FNC110-FNC139
Floating Point
FNC140-FNC149
Data
Operation 2
Specify the output (Y) number from which pulses are to be output in
Allowable setting range: Y000, Y001, Y002, Y003
19
.
20
FNC150-FNC159
Positioning
Control
363
Cautions
1. Setting the pulse width and period
Make sure that the pulse width S1
and period S2
S2
".
2. Pulse output
Only the following outputs can be specified in
D
*1
- When using special high speed output adapters : Y000, Y001, Y002*2, or Y003*2
- When using transistor outputs on the main unit (that is, when not using special high speed output
adapters): Y000, Y001, or Y002
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
When using the PWM (FNC 58) instruction with a relay output type FX3U PLC, a special high speed
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.
The pulse output is controlled by interrupt processing not affected by the sequence program (operation
cycle).
If the command input is set to OFF, the output from
turns OFF.
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 drive 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.
Pulse output destination device
Y000
M8340
Y001
M8350
Y002
M8360
Y003
M8370
= Y000
= Y001
= Y002
= Y003
Output affecting
operation
Operation
Y004
While Y004 is ON, pulses are output from Y000 on the high speed output
adapter.
While Y004 is OFF, pulses are output from Y004 on the high speed output
adapter.
Y005
While Y005 is ON, pulses are output from Y001 on the high speed output
adapter.
While Y005 is OFF, pulses are output from Y005 on the high speed output
adapter.
Y006
While Y006 is ON, pulses are output from Y002 on the high speed output
adapter.
While Y006 is OFF, pulses are output from Y006 on the high speed output
adapter.
Y007
While Y007 is ON, pulses are output from Y003 on the high speed output
adapter.
While Y007 is OFF, pulses are output from Y007 on the high speed output
adapter.
3) Set the pulse output type setting switch while the PLC is stopped or while the power is OFF.
Do not adjust the pulse output type setting switch while pulses are being output.
364
12
Y000
Y001
Y002
Y003
Reverse rotation
pulse chain (RP)
Y004
Y005
Y006
Y007
13
Pulse chain
Y000
Y001
Y002
Y003
Direction
Y004
Y005
Y006
Y007
Signal name
"PLSxDIR" side
1st unit
2nd unit
Output operation
14
Output operation
Do not use the PWM (FNC 58) instruction with relay-output type main units.
(Considerable output response delay may be generated, chattering may occur
in contacts, or the contact life may be shortened.)
15
D10
D10
K50
Y000
Y000
17
50ms
FNC100-FNC109
Data
Transfer 2
0V
24V
510
R
(1k)
1k
PLC
5V
1k
12V
C
470F
1k
18
10V
+
V
FNC110-FNC139
Floating Point
P
22
16
FNC80-FNC89
External FX
Device
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%.
In this program example the FX3U series main unit (sink output) is used. For wiring details, refer to the
following manual.
FX3U Hardware Edition
FNC70-FNC79
External FX I/O
Device
Program example
FNC 58
PWM
FMC60-FNC69
Handy
Instruction
X0
FNC50-FNC59
High Speed
Processing
FNC40-FNC49
Data Operation
Output number
Forward rotation
pulse chain (FP)
"FPxRP" side
11
FNC30-FNC39
Rotation and
Shift
4) When special high speed output adapters are connected, the same output numbers in the main unit are
assigned as shown in the table below.
Only wire the appropriate output terminals.
Outputs in special high speed output adapters and the main unit operate as shown below.
1k
COM1 Y000 Y001 Y002 Y003
19
FNC140-FNC149
Data
Operation 2
R>P
= P(k) C(F) = 470ms >> T0
The time constant of the filter should be considerably larger than the pulse cycle T0.
The ripple value "e" in the mean output current "e" is approximately "e/e T0/"
20
FNC150-FNC159
Positioning
Control
365
1. Instruction format
FNC 59
PLSR
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
PLSR
17 steps
Operation Condition
Continuous
Operation
DPLSR
2. Set data
Operand Type
Description
Data Type
S1
S2
S3
Bit
3. Applicable devices
Operand
Type
Bit Devices
System User
X
Word Devices
System
User
Digit Specification
Others
Special
Unit
Index
Constant
K
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
S3
3 3 3 3
3 3
Real CharacPointer
Number ter String
E
""
S: Specify a transistor output on the main unit or Y000 or Y001 on a special high speed output adapter*1.
*1. Special high speed output adapters cannot be connected to the FX3UC PLC.
FNC 59
PLSR
Pulse frequency
(Hz)
Maximum frequency
S1
Maximum
frequency
(HZ)
S1
S2
S3
D
366
S2
S3
Total Acceleration/
number deceleration
of output
time
pulses
(ms)
(PLS)
D
Output
number
(Y000,
Y001)
S1
Total number of
output pulses
S2 (PLS)
Acceleration/
S3 deceleration time
Acceleration/
S3 deceleration time
11
S1
Maximum
frequency
(HZ)
+1, S1
[ S2
+1, S2
[ S3
+1, S3
S3
Total Acceleration/
number deceleration
of output
time
pulses
(ms)
(PLS)
12
D
Output
number
(Y000,
Y001)
13
FNC50-FNC59
High Speed
Processing
[ S1
S2
FNC40-FNC49
Data Operation
FNC 59
DPLSR
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
FNC30-FNC39
Rotation and
Shift
16
FNC80-FNC89
External FX
Device
17
S3
Acceleration/
deceleration time
50 to 5000ms
50 to 5000ms
FNC100-FNC109
Data
Transfer 2
S3
Acceleration/
deceleration time
18
FNC110-FNC139
Floating Point
Output processing
The pulse output is controlled by the dedicated hardware regardless of the operation cycle.
Data change while the instruction is executed
Even if operands are overwritten while the instruction is executed, such changes are not reflected
immediately. The changes become valid the next time the instruction is driven.
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
367
Related devices
1. Instruction execution complete flag
For the instruction execution complete flag use method,
refer to Subsection 6.5.2.
Device
Name
Description
Instruction execution
complete
M8029
OFF: The input command 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 S2
is completed.
Contents of data
High
order
Low
order
D8141
D8140
D8143
D8142
D8137
The contents of each data register can be cleared using the following program:
Command
input
FNC 12
DMOV
K0
Description
M8349
M8359
To restart pulse output pulses again, set the device (M8349 or M8359) corresponding to the output signal to
OFF, and then drive the pulse output instruction again.
Cautions
1. Frequency S1
When using transistor outputs on the main unit, set the output frequency S1 to "100,000 Hz" or less.
If the load is operated using pulses at a frequency higher than 100,000 Hz from transistor outputs in the main
unit, the PLC may be damaged.
2. Pulse output
Only a transistor output on the main unit or Y000 or Y001 on a special high speed output adapter*1 can be
specified in D .
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
When using the PLSR (FNC 59) instruction with a relay output type FX3U PLC, a special high speed
output adapter is required.
The duration of the ON/OFF pulses is 50% (ON = 50%, OFF = 50%).
The pulse output is controlled by the dedicated hardware not affected by the sequence program (operation
cycle).
If the command input is set to OFF during continuous pulse output, the output from
368
turns OFF.
11
The outputs Y000 and Y001 are the high speed response type.
When using a pulse output instruction or positioning instruction, adjust the load current of the open collector
transistor output to about 10 to 100 mA (5 to 24V DC).
Item
Description
12
5 to 24V DC
10 to 100 mA
Output frequency
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 above flows in the output
transistor.
PLC
(transistor output)
[sink output]
Dummy
resistor
Y000
Input circuit
14
FMC60-FNC69
Handy
Instruction
COM1
Operation
16
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.
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.
= Y000
= Y001
3) Set the pulse output type setting switch while the PLC is stopped or while the power is OFF.
Do not manipulate the pulse output type setting switch while pulses are being output.
"FPxRP" side
Output number
1st unit
2nd unit
Forward rotation
pulse chain (FP)
Y000
Y001
Y002
Y003
Reverse rotation
pulse chain (RP)
Y004
Y005
Y006
Y007
Pulse chain
Y000
Y001
Y002
Y003
Direction
Y004
Y005
Y006
Y007
369
19
20
FNC150-FNC159
Positioning
Control
"PLSxDIR" side
Signal name
FNC140-FNC149
Data
Operation 2
18
FNC110-FNC139
Floating Point
4) When special high speed output adapters are connected, the same output numbers in the main unit are
assigned as shown in the table below.
Only wire the appropriate output terminals.
Outputs in special high speed output adapters and the main unit operate as shown below.
17
FNC100-FNC109
Data
Transfer 2
Output affecting
operation
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
2) Set the pulse output type setting switch in a special high speed output adapter to the "pulse chain +
direction" (PLSxDIR) side.
If the switch is set to the "forward rotation pulse chain reverse rotation pulse chain" (FPxRP) side, normal
operations are disabled. The pulse output destination changes depending on the PLC output status as
shown in the table below.
Pulse output
destination
13
FNC50-FNC59
High Speed
Processing
External
power
supply
Equipment
load
resistor
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
3. Handling of pulse output terminals in the FX3U and FX3UC series main units
Output operation
Output operation
Relay output type main unit
5. Others
1) Types of pulse output, positioning and other relevant instructions and their target output numbers
Classification
Pulse output
Positioning
High speed
processing
Instruction
PLSY(FNC 57)
Instruction name
Pulse Y output
Y000,Y001
PLSR(FNC 59)
Acceleration/deceleration setup
Y000,Y001
DSZR(FNC150)
Y000,Y001,Y002,Y003
DVIT(FNC151)
Interrupt positioning
Y000,Y001,Y002,Y003
ZRN(FNC156)
Zero return
Y000,Y001,Y002,Y003
PLSV(FNC157)
Y000,Y001,Y002,Y003
DRVI(FNC158)
Drive to increment
Y000,Y001,Y002,Y003
DRVA(FNC159)
Drive to absolute
Y000,Y001,Y002,Y003
PWM(FNC 58)
Y000,Y001,Y002,Y003
2) 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 or 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 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.
370
Y000
M8340
Y001
M8350
11
FNC30-FNC39
Rotation and
Shift
FNC No.
Mnemonic
60
IST
Symbol
IST
Function
S D1 D2
Reference
Section
14.1
Section
14.2
ABSD
ABSD S1 S2 D n
Section
14.3
63
INCD
INCD S1 S2 D n
Section
14.4
64
TTMR
TTMR D n
Teaching Timer
Section
14.5
65
STMR
STMR S m D
Special Timer
Section
14.6
66
ALT
ALT
Alternate State
Section
14.7
67
RAMP
RAMP S1 S2 D n
Section
14.8
68
ROTC
ROTC S m1 m2 D
Section
14.9
69
SORT
SORT S m1 m2 D n
Section
14.10
S1 S2 D n
14
15
16
FNC80-FNC89
External FX
Device
62
SER
FNC70-FNC79
External FX I/O
Device
SER
FMC60-FNC69
Handy
Instruction
61
13
FNC50-FNC59
High Speed
Processing
Initial State
12
FNC40-FNC49
Data Operation
FNC 60 to FNC 69 provide handy instructions which achieve complicated control in a minimum sequence
program.
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
371
14.1
Outline
This instruction automatically controls the initial state and special auxiliary relays in a step ladder program.
For SFC programs and step ladder, refer to Chapter 34.
1. Instruction format
FNC 60
IST
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
IST
Operation Condition
2. Set data
Operand type
Description
Data type
SS1
Head bit device number of the selector switch in the operation mode
Bit
D1
Smallest state relay number of practical state relays in the automatic mode
( D1 < D2 )
Bit
D2
Largest state relay number of practical state relays in the automatic mode
( D1 < D2 )
Bit
3. Applicable devices
Operand
Type
SS1
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
S1
3 3 3
ConReal
CharacPointer
stant Number ter String
E
""
D21
S
S2
D2
S2
FNC 60
IST
D1
D2
Switch function
Individual operation
+1
X021
+2
X022
Stepping
+3
X023
Cycle operation
+4
X024
Continuous operation
+5
X025
+6
X026
Automatic start
+7
X027
Stop
372
11
While the command input is ON, the following devices are automatically switched and controlled. While
the command input is OFF, the devices are not switched.
Device number
M8040
M8042
*1
M8043
M8045
*2
M8047
Device number
Operation function
S0
Transfer start
S1
Start pulse
S2
12
FNC40-FNC49
Data Operation
M8041*1
Operation function
13
FNC50-FNC59
High Speed
Processing
S0 to S9
Cautions
16
DS1
FNC80-FNC89
External FX
Device
1. Device specified as
15
FNC70-FNC79
External FX I/O
Device
If the devices are switched among individual operation (X020), zero return (X021) and automatic
operation (X022, X023 and X024) while the zero return complete device (M8043) is OFF, all outputs are
set to OFF.
Automatic operation can be started again after zero return is completed.
For introducing IST instruction, refer to "14.1.2 Example of IST instruction introduction
(example of workpiece transfer mechanism)".
14
FMC60-FNC69
Handy
Instruction
Device number
S10 to S19
FNC30-FNC39
Rotation and
Shift
17
FNC100-FNC109
Data
Transfer 2
IST instruction should be programmed earlier than a series of STL circuit such as state relays S0 to S2.
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
373
1. Equivalent circuit
Continuous
operation
X024
M8041
X027
Stepping
X022 operation
Stop
Cycle
X023 operation
Continuous
X024 operation
Transfer
start
*1
X020
PLS M8042
Individual
operation
M8041
Start pulse
Zero
X021 return X027Stop
M8042
X022Stepping operation
Start pulse
STL transfer
disable
X023Cycle X027Stop
operation
Individual
X020 operation
M8044
S 0
*1
S 1
*1
Zero point
condition
X025
RST M8043
Zero return
start
Zero return
complete signal is
reset
M8041
S 2
Automatic
X022 to X024
Individual
operation
X020
Automatic
X022 to X024
S1
M8043
S2
Zero return
complete
S2
Switched
to X020
(individual
operation)
Switched
to X021
(zero
return
operation)
Zero return
X021
Even if the mode is switched from automatic operation to zero return operation while S2 is ON, state relays
(except initial state relays) and outputs are not reset.
*1.
374
in
1. Operation mode
Stepping
operation
Zero return
Zero return
operation mode
X021
Cycle
operation mode
X023
X025
Individual
operation mode
X020
Leftward
Moving up
Unclamping
travel
PB
PB
X005
PB
PB
X007
Start X026
Y002
PB
PB
PB
PB
X010
X011
X012
Stop X027
Moving Lower
up
limit X001
PB
Clamping Y001
Unclamping Y001
Workpiece
14
Point B
Contents of operation
Individual
operation
mode
Zero return
operation
mode
When the pushbutton switch for zero return is pressed, the machine automatically returns to the
zero point.
Stepping
operation
mode
Every time the start button is pressed, the machine performs one process.
When the start button is pressed while the machine is located at the zero point, the machine
starts continuous operation.
When the stop button is pressed, the machine finishes the current cycle until the zero point, and
then stops at the zero point.
17
FNC100-FNC109
Data
Transfer 2
Continuous
operation
mode
16
When the start button is pressed while the machine is located at the zero point, the machine
performs one cycle of automatic operation and stops at the zero point.
If the stop button is pressed in the middle of one cycle, the machine stops immediately. When
the start button is pressed after that, the machine performs the continuous operation from the
last position, and automatically stops at the zero point.
FNC80-FNC89
External FX
Device
Cycle
Automatic operation
mode
mode
15
FNC70-FNC79
External FX I/O
Device
Manual
mode
Point A
FMC60-FNC69
Handy
Instruction
Operation mode
13
Y000
Emergency stop
Clamping
12
FNC50-FNC59
High Speed
Processing
X006
Rightward
Moving down travel
Continuous
Power supply
operation mode
X024
PB
FNC40-FNC49
Data Operation
PB
X022
FNC30-FNC39
Rotation and
Shift
11
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
375
2. Transfer mechanism
Start
X026
(4) Rightward Y003
Zero point
(8) Leftward Y004
(1) Moving
down
Y000
Lower
limit
X001
Upper
limit
X002
Right limit
X003
(1) Moving down
Y000
Lower
limit
What is the zero point condition? X001
Upper limit X002 is ON, left limit
Clamping
X004 is ON and unclamping Y001
(2) Clamping is OFF.
Y001 ON
(7) Moving up
Y002
Unclamping
(6) Unclamping
Y001 OFF
The upper left position is regarded as the zero point. The machine transfers a workpiece from the left to the
right in the order "moving down clamping moving up rightward travel moving down unclamping
moving up leftward travel."
Double-solenoid type solenoid valves (with two inputs for driving and non-driving) are adopted for moving
down, moving up, leftward travel and rightward travel. Single type solenoid valves (which operate only while
the power is ON) are adopted for clamping.
376
11
Example:
X030:Zero return operation mode
X031:Continuous operation mode
X032:Automatic mode start zero
return start
X033:Stop
14
Example:
X030:Individual operation mode
X031:Continuous operation mode
X032:Automatic mode start
X033:Stop
FMC60-FNC69
Handy
Instruction
Example:
X030:Individual operation mode
X035:Zero return operation mode
X033:Stepping operation mode
X040:Cycle operation mode
X032:Continuous operation mode
X034:Zero return start
X026:Automatic mode start
X041:Stop
13
FNC50-FNC59
High Speed
Processing
12
FNC40-FNC49
Data Operation
For using IST instruction, it is necessary to assign inputs having consecutive device numbers as shown below
for mode inputs.
When using non-consecutive inputs or omitting some modes, change the layout by using an auxiliary relay as
the head input for mode specification as shown in the figure below.
- X020: Individual operation mode
- X021: Zero return operation mode
- X022: Stepping operation mode
- X023: Cycle operation mode
- X024: Continuous operation
- X025: Zero return start
- X026: Automatic mode start
- X027: Stop
FNC30-FNC39
Rotation and
Shift
15
FNC70-FNC79
External FX I/O
Device
X030
M 1
Zero return
operation mode
M 2
Stepping
operation mode
M 3
Cycle operation
mode
M 4
Continuous
operation
M 5
Zero return
start
X035
X033
X040
X032
X034
M 6
Automatic
mode start
M 7
Stop
X041
M 0
RUN monitor
X030
M 1
M8000
Does not
operate
Zero return
operation mode
X030
M 0
M8000
M 1
M 2
Does not
operate
M 2
M 3
Does not
operate
M 3
M 4
Continuous
operation
M 5
Zero return
start
X031
X032
M 6
Automatic
mode start
M 7
Stop
X033
16
Individual
operation mode
X031
M 4
17
Continuous
operation
M8000
M 5
X032
18
M 6
Automatic
mode start
M 7
Stop
FNC110-FNC139
Floating Point
X026
M8000
FNC100-FNC109
Data
Transfer 2
Individual
operation mode
FNC80-FNC89
External FX
Device
M 0
X033
19
RUN
monitor
FNC 60
IST
M 0
S 20
FNC140-FNC149
Data
Operation 2
M8000
S 29
20
FNC150-FNC159
Positioning
Control
377
378
11
X004
X002
Left limit
M8000
Y001
Upper
limit Unclamping
RUN
monitor
X020
S 20
S 27
14
Initial state
FMC60-FNC69
Handy
Instruction
FNC 60
IST
M8044
15
FNC70-FNC79
External FX I/O
Device
State number
Clamping
0
SET
Y001
RST
Y001
Moving-up
X005 command Y000
Moving-down
X010 command Y002
Leftward travel
X006 command X002 Y003
Upper limit
Moving
Y002 up
Y000 Moving
down
17
Y004 Leftward
travel
FNC100-FNC109
Data
Transfer 2
Rightward travel
X011 command X002 Y004
16
FNC80-FNC89
External FX
Device
Initial state
for individual
operation
13
FNC50-FNC59
High Speed
Processing
Ladder block
12
FNC40-FNC49
Data Operation
1) Circuit diagram
In the sequence circuit shown below, all areas except shaded areas are standard.
Program the shaded areas according to the contents of control.
a) Initial circuit
While the machine is operating, the operation mode can be switched arbitrarily (among stepping
operation, cycle operation and continuous operation) in the automatic mode.
When the operation mode is switched between the individual operation mode, zero return operation
mode and automatic mode while the machine is operating, all outputs are reset once to assure safety,
after which the following mode becomes valid.
(While M8045 (All output reset disable) is ON, outputs are not reset at all.)
FNC30-FNC39
Rotation and
Shift
5. Program example
Y003 Rightward
travel
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
379
State number
1 Initial state for zero return
X025
Zero return start
10
RST
Y001 Unclamping
RST
Y002
Moving up
X002
Upper limit
11
TRAN
RST
Y004
X004
TRAN
Y003
Rightward
travel reset
Leftward travel
TRAN
Left limit
12
SET
M8043
S 12 Reset
380
SFC block
State number
2 Initial state for
automatic mode
12
M8044
Y001 Clamping
T 0
K 10
Y003
15
TRAN
Right limit
Y000
Moving down
X001
Y001
T 1
K 10
Y002
X002
Unclamping
TRAN
17
Moving up
FNC100-FNC109
Data
Transfer 2
T1
FNC80-FNC89
External FX
Device
RST
TRAN
Upper limit
Y004
Leftward travel
X004
18
FNC110-FNC139
Floating Point
TRAN
Left limit
RET
16
TRAN
Down limit
27
Rightward
travel
FNC70-FNC79
External FX I/O
Device
X003
25
FMC60-FNC69
Handy
Instruction
Upper limit
23
TRAN
Moving up
X002
S2
14
TRAN
Y002
26
FNC50-FNC59
High Speed
Processing
SET
T0
24
13
TRAN
Down limit
22
TRAN
Moving down
Y000
21
FNC40-FNC49
Data Operation
M8041
11
FNC30-FNC39
Rotation and
Shift
d) Automatic mode (stepping operation mode, cycle operation mode or continuous operation mode)
END
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
381
6. List program
Individual
operation
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
LD X 004
AND X 002
ANI Y 001
OUT M8044
LD M8000
IST
60
(SP) X 020
(SP) S 20
(SP) S 27
STL S
0
LD X 012
SET Y 001
LD X 007
RST Y 001
LD X 005
ANI Y 000
OUT Y 002
LD X 010
ANI Y 002
OUT Y 000
LD X 006
AND X 002
ANI Y 003
OUT Y 004
LD X 011
AND X 002
ANI Y 004
OUT Y 003
(RET)
382
32
33
34
36
37
38
39
40
41
43
44
45
46
47
49
50
52
53
55
56
57
58
60
61
62
63
65
66
67
STL S
1
LD X 025
SET S 10
STL S 10
RST Y 001
RST Y 000
OUT Y 002
LD X 002
SET S 11
STL S 11
RST Y 003
OUT Y 004
LD X 004
SET S 12
STL S 12
SET M8043
LD M8043
RST S 12
(RET)
STL S
2
LD M8041
AND M8044
SET S 20
STL S 20
OUT Y 000
LD X001
SET S 21
STL S 21
SET Y 001
OUT T
0
(SP) K 10
Automatic mode
0
1
2
3
5
6
Initial circuit
The list program for the circuit diagram shown on the previous page is as shown below:
70
71
73
74
75
76
78
79
80
81
83
84
85
86
88
89
90
LD
SET
STL
OUT
LD
SET
STL
OUT
LD
SET
STL
OUT
LD
SET
STL
RST
OUT
(SP)
93 LD
94 SET
96 STL
97 OUT
98 LD
99 SET
101 STL
102 OUT
103 LD
104 OUT
106 RET
107 END
T
S
S
Y
X
S
S
Y
X
S
S
Y
X
S
S
Y
T
K
T
S
S
Y
X
S
S
Y
X
S
0
22
22
002
002
23
23
003
003
24
24
000
001
25
25
001
1
10
1
26
26
002
002
27
27
004
004
2
FNC30-FNC39
Rotation and
Shift
14.2
11
Outline
12
This instruction searches for the same data, maximum value and minimum value in a data table.
FNC 61
SER
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SER
SERP
FNC40-FNC49
Data Operation
1. Instruction format
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
17 steps DSER
DSERP
13
FNC50-FNC59
High Speed
Processing
2. Set data
Description
Data type
S1
S
Head device number in which same data, maximum value and minimum value
are searched
S2
Head device number storing number of same data, maximum value and minimum
value detected by search
Number of data in which same data, maximum value and minimum value are
searched
[16-bit instruction: 1 to 256, 32-bit instruction: 1 to 128]
15
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
3 3 3 3
S2
3 3 3 3
3 3 3 3
SD2
3 3
Z Modify K H
""
16
3
3 3
FNC80-FNC89
External FX
Device
S1
S
ConReal
CharacPointer
stant Number ter String
3 3
3
3 3
17
Command
input
S1
S2
to
18
19
FNC140-FNC149
Data
Operation 2
FNC110-FNC139
Floating Point
FNC 61
SER
, same data as S2
FNC100-FNC109
Data
Transfer 2
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
Operand
Type
14
FMC60-FNC69
Handy
Instruction
Operand type
20
FNC150-FNC159
Positioning
Control
383
2) Operation example
a) Example of search result table configuration and data
Searched device
Comparison
data
Searched data
S1
S1
value
(example)
S1
value
(example)
S2
Search result
Data
position
K100
S1
+1
K111
S1
+2
K100
S1
+3
K 98
S1
+4
K123
S1
+5
K 66
S1
+6
K100
S1
+7
K 95
S1
+8
K210
S1
+9
K 88
K100
Maximum
value D
+4
Same
D
Minimum value
D
+3
3 (first
position)
4
5
3
3 (last
position)
Contents
+1
+2
+3
+4
FNC 61
DSER
S1
S1 +1, S1
S2
+1, S2
n
D +1, D
S2 +1, S2
384
11
Searched device
Searched data
value
(example)
S1
+1
S1
Comparison
data
S2
Search result
Data
position
Maximum
value D
+4
Minimum
value D
+3
K100000
[ S1
+ 3, S1
+ 2]
K110100
[ S1
+ 5, S1
+ 4]
K100000
[ S1
+ 7, S1
+ 6]
K 98000
[ S1
+ 9, S1
+ 8]
K123000
[ S1
+ 11, S1
+ 10]
K 66000
[ S1
+ 13, S1
+ 12]
K100000
[ S1
+ 15, S1
+ 14]
K 95000
[ S1
+ 17, S1
+ 16]
K910000
[ S1
+ 19, S1
+ 18]
K910000
13
4
5
3
3 (last
position)
14
FMC60-FNC69
Handy
Instruction
Contents
15
+ 1,
[ D
+ 3,
+ 2]
[ D
+ 5,
+ 4]
[ D
+ 7,
+ 6]
[ D
+ 9,
+ 8]
FNC70-FNC79
External FX I/O
Device
[ D
FNC50-FNC59
High Speed
Processing
+ 1, S1
12
FNC40-FNC49
Data Operation
3 (first
position)
[ S1
K100000
Same
FNC30-FNC39
Rotation and
Shift
2) Operation example
a) Example of search result table configuration and data
16
FNC80-FNC89
External FX
Device
Cautions
1. Comparison of values
It is executed algebraically.
(example: 10 < 2)
17
When there are two or more maximum or minimum values in the searched data, the last position of the max/
min is stored respectively.
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
DD1 .
Make sure that such devices are not used in other controls for the machine.
19
FNC140-FNC149
Data
Operation 2
Ten devices, [ DD1 +1, DD1 ], [ DD1 +3, DD1 +2], [ DD1 +5, DD1 +4], [ DD1 +7, DD1 +6] and
20
FNC150-FNC159
Positioning
Control
385
14.3
Outline
This instruction creates many output patterns corresponding to the current value of a counter.
1. Instruction format
FNC 62
ABSD
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
ABSD
17 steps
Operation Condition
Continuous
Operation
DABSD
2. Set data
Operand type
Description
Data type
S1
S
Head device number storing the data table (with rising and faling point data)
S2
Counter number for monitoring the current value compared with the data table
Bit
Number of lines in the table and the number of output bit devices
[1 n 64]
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S1
S
3 3 3 3
3
S2
3 3
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
3
3 3
D1
of the counter is compared with the data table with "n" lines starting from S
(which occupies "n" lines 2 devices), and consecutive "n" outputs starting from DD1
OFF during one rotation.
Command
input
S2
FNC 62
ABSD
S1
S2
X001
RST
X001
S2
S2
K360
386
are controlled to ON or
11
D1 +2n+1 in advance by a transfer instruction:
to S
Rising point
Falling point
Target output
40
S1
+1
140
12
+3
200
+1
S1
+4
160
S1
+5
60
+2
S1
+6
240
S1
+7
280
+3
S1
+ 2n
S1
+ 2n + 1
+n1
S1
100
+2
FNC40-FNC49
Data Operation
S1
FNC30-FNC39
Rotation and
Shift
D1
1) Write the following data to S
2) Output pattern
When the command input is set to ON, "n" points starting from DD1
D
100
200
15
D +1
160
240
FNC70-FNC79
External FX I/O
Device
60
D +2
280
D +3
z
0
16
360
180
In this example, outputs are controlled to ON or OFF by one rotation (0 to 360 using the rotation angle signal
of 1/pulse).
of the counter is compared with the data table having "n" lines starting from
D21
S
Command
input
S1
S2
18
X001
RST
X001
S2
FNC110-FNC139
Floating Point
S2
FNC 62
DABSD
are
17
FNC100-FNC109
Data
Transfer 2
D1 +1, S
D1 ] (which occupies "n" lines 4 devices), and consecutive "n" outputs starting from DD1
[ S
controlled to ON or OFF during one rotation.
FNC80-FNC89
External FX
Device
14
FMC60-FNC69
Handy
Instruction
40
13
FNC50-FNC59
High Speed
Processing
For example, store the 16-bit rising point data to an even device number devices, and store the 16-bit
falling data to an odd device number devices.
S2
K360
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
387
D1 , S
D1 +1] to [ S
D1 +4n+2, S
D1 +4n+3] in advance using a transfer
1) Write the following data to [ S
instruction:
Rising point
Falling point
Data value
(example)
Data value
(example)
Target output
40
[ S1
+ 3, S1
+ 2]
140
[ S1
+ 5, S1
+ 4]
100
[ S1
+ 7, S1
+ 6]
200
+1
[ S1
+ 9, S1
+ 8]
160
[ S1
+ 11, S1
+ 10]
60
+2
[ S1
+ 13, S1
240
[ S1
+ 15, S1
+ 14]
280
+3
[ S1
+ 4n + 1, S1
[ S1
+ 4n + 3, S1
+n1
+ 12]
+ 4n]
+ 4n + 2]
+ 1, S1
[ S1
For example, store the 32-bit rising point data to devices having an even device number, and store the
32-bit falling data to devices having an odd device number.
When the command input is set to ON, "n" points starting from DD1
D1 +1, S
D1 ] to
Each rising point/falling point can be changed respectively by overwriting the data in [ S
D1 +(n2)+3, S
D1 +(n2)+2].
[ S
40
140
D
100
200
D +1
60
D +2
160
240
280
D +3
z
0
180
360
Cautions
1. Specifying a high speed counter (C235 to C255)
D21 .
In DABSD instruction, a high seed counter can be specified as S
In this case, however, the output pattern contains response delay caused by the scan cycle with regard to the
current value of a counter.
When high responsibility is required, use the table high speed comparison function offered by HSZ
instruction, or use HSCT instruction.
D1
2. When specifying digits of a bit device as S
1) Device number
Specify a multiple of 16 (0, 16, 32, 64 ...).
2) Number of digits
- In ABSD instruction (16-bit operation): Only K4 is available.
- In DABSD instruction (32-bit operation): Only K8 is available.
3. Other cautions
The value "n" determines the number of target outputs (1 n 64).
Even if the command input is set to OFF, the ON/OFF status of outputs does not change.
388
11
FNC30-FNC39
Rotation and
Shift
14.4
Outline
12
FNC 63
INCD
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
INCD
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
S1
S
16-bit binary
S2
16-bit binary
14
FMC60-FNC69
Handy
Instruction
Bit
16-bit binary
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S1
S
3 3 3 3
3
S2
3 3
SD2
Index
Z Modify K H
""
3
3
ConReal
CharacPointer
stant Number ter String
16
FNC80-FNC89
External FX
Device
3 3
17
Count signal
S2
S1
S2
18
FNC110-FNC139
Floating Point
FNC 63
INCD
FNC100-FNC109
Data
Transfer 2
D21
The current value S
15
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
K9999
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
389
Operation
S1
X000
FNC 63
INCD
M8013
D300
S2
C0
M0
K4
K9999
C0
1 sec clock
1) Timing chart
Suppose that the following data is written in advance by a transfer instruction:
Device storing data
Data value (example)
Output
Example
+1
D301 = 30
S1
+2
D302 = 10
S1
+3
D303 = 40
S1
+n1
+1
M1
+2
M2
+3
M3
+n1
S1
M0
D300 = 20
S1
X000
40
30
Current
value of
C0
Current
value of
C1
20
20
20
10
3
0
M 0
M 1
M 2
M 3
M8029 Complete flag
2) When the command contact turns ON, the output M0 turns ON.
3) When the current value of C0 reaches the comparison value D300, the output M0 is reset. "1" is added to
the count value of the process counter C1, and the current value of the counter C0 is reset.
4) The next output M1 turns ON.
5) When the current value of C0 reaches the comparison value D301, the output M1 is reset. "1" is added
to the count value of the process counter C1, and the current value of the counter C0 is reset.
6) The current value is compared for up to "n (K4)" outputs in the same way (1 n 64).
7) When the final process specified by "n" is finished, the execution complete flag M8029 turns ON and
remains ON for one operation cycle.
M8029 is used for many instructions as the instruction execution complete flag. Use M8029 as a contact
just after a corresponding instruction.
8) The program execution returns to the beginning, and outputs are repeated.
Caution
D11
1. When specifying digits of a bit device as S
390
11
FNC30-FNC39
Rotation and
Shift
14.5
Outline
12
This instruction measures the period of time in which TTMR instruction is ON.
Use this instruction to adjust the set value of a timer by a pushbutton switch.
FNC 64
TTMR
Mnemonic
16-bit Instruction
5 steps
Operation Condition
Continuous
Operation
TTMR
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
D
Description
Data type
16-bit binary
16-bit binary
14
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
3 3
3 3
Z Modify K H
""
3
3 3
16
The period of time to press and hold the command input (pushbutton switch) is measured in 1-second units,
multiplied by the magnification (10n), and then transferred to DD1 .
FNC 64
TTMR
Command
contact
17
FNC100-FNC109
Data
Transfer 2
D +1
D +1
D
D
Magnification
K0
0
100
K2
1000
DD1
D
D
D
19
FNC140-FNC149
Data
Operation 2
K1
FNC110-FNC139
Floating Point
18
FNC80-FNC89
External FX
Device
Command
input
15
FNC70-FNC79
External FX I/O
Device
SD2
ConReal
CharacPointer
stant Number ter String
FMC60-FNC69
Handy
Instruction
FNC40-FNC49
Data Operation
1. Instruction format
10
100
Related instruction
20
HOUR(FNC169)
Measures the input contact ON time in 1-hour units, and outputs alarm when the
measurement result reaches a specified value.
391
FNC150-FNC159
Positioning
Control
Instruction
Cautions
1. When the command contact turns OFF
The current value [ DD1 +1] of the pressing and holding time is reset, and the teaching time DD1
change any more.
will not
DD1
: Teaching time
DD1
Program example
1. Writing the teaching time to 10 types of data registers
Suppose that the set value is written to D400 to D409 in advance.
D 400
T 1
D 401
T 0
T 9
M8000
RUN
monitor
X010
Teaching
button
X010
M 0
392
10 timers to be set
Because the timers T0 to T9 are the 100 ms type, the actual
operating time (sec) is 1/10 of the teaching data.
D 409
FNC 19
BIN
K1X000
FNC 64
TTMR
D300
K 0
PLF
M 0
FNC 12
MOV
D300
D400Z
11
FNC30-FNC39
Rotation and
Shift
14.6
Outline
12
This instruction can easily make off-delay timers, one-shot timers and flicker timers.
FNC 65
STMR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
STMR
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
16-bit binary
16-bit binary
Head bit number to which the set value is output (Four devices are occupied.)
SS1
14
FMC60-FNC69
Handy
Instruction
Bit
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
m
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3 3
3 3
3 3
3
16
FNC80-FNC89
External FX
Device
FNC 65
STMR
18
FNC110-FNC139
Floating Point
FNC 65
STMR
T10
K100
17
FNC100-FNC109
Data
Transfer 2
15
FNC70-FNC79
External FX I/O
Device
SS1
FNC40-FNC49
Data Operation
1. Instruction format
M0
: Off-delay timer which turns OFF with delay of the timer set value after the command
contact turned OFF
M1 [ DD1 +1]
: One-shot timer which turns ON after the command contact turned OFF from ON, and
turns OFF after the timer set value
M2 [ DD1 +2]
M3 [ DD1 +3]
: Occupied.
19
FNC140-FNC149
Data
Operation 2
M0 [ DD1 ]
20
FNC150-FNC159
Positioning
Control
393
Command
input
M0
10s
10s
M1
D +1
10s
10s
M2
D +2
M3
D +3
10s
Flicker
In the program shown below which turns OFF STMR instruction at the NC contact of DD1 +3, flicker is output
to DD1 +1 and DD1 +2.
and DD1 +3 are occupied.
DD1
Command
M3
input
FNC 65
STMR
T10
K100
M0
M0 [ DD1 ]
: Occupied (, and can be used for off-delay timer). (Refer to the previous page.)
M1 [ DD1 +1]
: Flicker (NO contact) which turns ON and OFF repeatedly at the interval of timer set value
M2 [ DD1 +2]
: Flicker (NC contact) which turns ON and OFF repeatedly at the interval of timer set value
M3 [ DD1 +3]
: Occupied.
Command
input
M2
D +2
M1
D +1
10s
10s
10s
10s
10s
Cautions
1. Handling of a specified timer
The timer number specified in this instruction cannot be used in other general circuits (such as OUT
instruction).
If the timer number is used in other general circuits, the timer malfunctions.
Off-delay timer
One-shot timer
Flicker
Off-delay timer
Occupied
+1
One-shot timer
+2
Occupied
+3
Occupied
reset.
394
, DD1 +1 and DD1 +3 will turn OFF after the set time.
DD1
are immediately
11
FNC30-FNC39
Rotation and
Shift
14.7
Outline
12
This instruction alternates a bit device (from ON to OFF or from OFF to ON) when the input turns ON.
FNC 66
ALT
16-bit Instruction
3 steps
Mnemonic
Operation Condition
ALT
ALTP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
14
Bit
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Z Modify K H
""
16
FNC80-FNC89
External FX
Device
ON
17
ON
Command input
ON
ON
FNC100-FNC109
Data
Transfer 2
FNC 66
ALTP
ON
18
Command
input
FNC 66
ALTP
M0
M0
FNC 66
ALTP
M1
M0
ON
ON
ON
ON
ON
ON
19
FNC140-FNC149
Data
Operation 2
Command
input
FNC110-FNC139
Floating Point
1st step
D
15
FNC70-FNC79
External FX I/O
Device
3 3
SD2
ConReal
CharacPointer
stant Number ter String
Index
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
2nd step
M1
ON
20
FNC150-FNC159
Positioning
Control
395
Caution
1. When using (continuous operation type) ALT instruction
When ALT instruction is used, a specified bit device is alternated in every operation cycle.
To alternate a specified device by turning the command ON or OFF, use the (pulse operation type) ALTP
instruction, or use a pulse operation type command contact such as LDP.
Program examples
1. Start and stop by one input
1) When the pushbutton switch X000 is pressed, the start output Y001 is set to ON.
2) When the pushbutton switch X000 is pressed again, the stop output Y000 is set to ON.
X000
FNC 66
ALTP
M0
M0
Y000
Stop
Y001
Start
M0
2. Flicker operation
1) When the input X006 is set to ON, the contact of the timer T2 turns ON instantaneously every 5 seconds.
2) Every time the contact of T2 turns ON, the output Y007 is set to ON or OFF alternately.
X006
T2
T2
X006
T2
FNC 66
ALT
ON
X006
K50
5s
Y007
5s
5s
5s
5s
5s
5s
T2
Y007
ON
ON
ON
3. Alternating output operation using auxiliary relays (M) (operation equivalent to ALT
instruction)
The circuit below is provided as an example of alternating operation using basic instructions and auxiliary
relays (M) which is equivalent to ALT instruction.
1) When X000 is set to ON, M0 turns ON and remains ON for only one operation cycle.
2) When M0 turns ON for the first time, Y000 is latched. When M0 turns ON the second time, Y000
becomes unlatched.
X000
M1
M0
X000
M1
M0
Y000
Y000
M0
396
Y000
11
FNC30-FNC39
Rotation and
Shift
14.8
Outline
This instruction obtains the data which changes between the start value (initial value) and the end value
(target value) over the specified "n" times.
FNC 67
RAMP
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
RAMP
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
16-bit binary
S2
16-bit binary
16-bit binary
16-bit binary
14
FMC60-FNC69
Handy
Instruction
S1
S
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
15
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
S2
3 3
SD2
3 3
3 3
""
16
FNC80-FNC89
External FX
Device
S1
S
3 3
17
D1
ON, the value obtained by adding a value divided equally by "n" times to S
stored to DD1 .
By combining this instruction and an analog output, the cushion start/stop command can be output.
Command
input
S1
S2
18
FNC110-FNC139
Floating Point
FNC 67
RAMP
19
FNC140-FNC149
Data
Operation 2
S2
S1
D
"n" scans
Number of scans D +1
FNC100-FNC109
Data
Transfer 2
D1
When the start value S
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
12
"n" scans
Number of scans D +1
20
FNC150-FNC159
Positioning
Control
397
If the command input is set to OFF in the middle of operation, execution is paused. (The present data
value stored in DD1
is held, and the number of scans stored in DD1 +1 is cleared.) When the command
D1 .
is cleared, and the operation is started from S
After transfer is completed, the instruction execution complete flag M8029 turns ON, and the DD1
D1
returned to the S
value is
value.
Command
S2
S1
(M8029)
When acquiring the operation result at a constant time interval (constant scan mode)
Write a prescribed scan time (which is longer than the actual scan time) to D8039 and set M8039 to ON to
select the constant scan mode in the PLC.
For example, when "20 ms" is written to D8039 and "n" is set to 100, the DD1
D1
S
D21
to S
in 20 seconds.
2) When M8026 is ON
Command
Command
S2
S2
S1
S1
(M8029)
(M8029)
Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
M8029
M8026*1
*1.
Name
Description
Instruction
execution complete
Turns ON when
RAMP mode
becomes equivalent to S2
Caution
1. When specifying a latched (battery backed) type device as DD1
When setting PLC to the RUN mode while the command input is ON, clear DD1
398
in advance.
11
FNC30-FNC39
Rotation and
Shift
14.9
Outline
This instruction is suitable for efficient control of the rotary table for putting/taking a product into/out of the
rotary table.
FNC 68
ROTC
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
ROTC
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
16-bit binary
m1
Number of divisions
16-bit binary
m2
16-bit binary
16-bit binary
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
m2
3 3
3
""
16
FNC80-FNC89
External FX
Device
3 3
m1
SD2
15
Others
Special
Unit
FNC70-FNC79
External FX I/O
Device
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
12
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
399
FNC 68
ROTC
m1
m2
D200
K10
K2
M0
Calling
Number
condition
of
register divisions
(word device)
Port No. 0
Zero point Product
detection
8
X000(M0)
6
Forward rotation
Detection
switch
1
Port No. 1
Number
Calling
of lowcondition
speed
register
sections (bit device)
5
X001(M1)
4
3
Rotary table
S
S
+1
+2
400
A phase signal
+1
B phase signal
+2
+3
+4
+5
Stop
+6
+7
11
The conditions required to use this instruction are as shown in the example below.
2-phase switch
D
X000
M0
D +1
X001
X002
D +2
M2
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
Cautions
1. Operations caused by the command input ON/OFF status
When the command input is set to ON and this instruction is executed, the result will be automatically
17
FNC100-FNC109
Data
Transfer 2
to DD1
16
FNC80-FNC89
External FX
Device
13
FNC50-FNC59
High Speed
Processing
M1
A
phase
Up-counting signal during forward rotation
B
phase
12
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
Operation conditions
19
FNC140-FNC149
Data
Operation 2
18
FNC110-FNC139
Floating Point
For example, when the rotation detection signal ( DD1 to DD1 +2) is activated 10 times in one division, set a
value multiplied by "10" to each division, port No. to be called and product No. to be called.
As a result, an intermediate value of the division number can be set to a low-speed section.
20
FNC150-FNC159
Positioning
Control
401
1. Instruction format
FNC 69
SORT
16-bit Instruction
11 steps
Mnemonic
Operation Condition
Continuous
Operation
SORT
Operation Condition
2. Set data
Operand type
Description
Data type
SS1
Head device number storing the data table [which occupies m1 m2 points]
m1
m2
16-bit binary
Head device number storing the operation result [which occupies m1 m2 points]
Column number of the group data (column) used as the basis of sorting [1 to m2]
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3 3
SS1
m1
3 3
m2
3 3
SD2
3 3
3 3
3 3
FNC 69
SORT
m1
402
and 4 columns (m1 = K3, m2 = K4). For the sorting result data table, understand DS1
Number of groups (m2 = K4)
Column No.
Line No.
Control number
Height
Weight
Age
+3
+6
+9
+1
+4
+7
+10
+2
+5
+8
+11
12
FNC40-FNC49
Data Operation
Number of
data
(m1 = 3)
as DD1 .
2. Operation examples
When the instruction is executed with "n = K2 (column No. 2)" and "n = K3 (column No. 3) for the following
sorting source data, the operations shown below are acquired.
It is recommended to put a serial number such as a control number in the first column so that the original line
number can be estimated based on the contents.
Control number
Height
Weight
Age
2
3
4
5
150
+1
+2
2
S
+3
+8
+4
+9
+ 12
+ 13
+ 16
40
+ 17
70
100
20
50
S
160
4
S
+7
+ 11
+ 14
16
30
+ 18
20
150
15
+ 15
45
180
3
S
+6
+ 10
FNC80-FNC89
External FX
Device
Number of
data
(m1 = 5)
+5
FNC70-FNC79
External FX I/O
Device
8
+ 19
50
45
17
Column No.
Weight
Age
+5
100
+1
1
5
3
2
+7
+8
+9
180
+ 11
8
D
45
D
+ 12
20
D
50
D
160
+4
150
+3
+6
+ 10
20
150
+2
+ 13
70
D
+ 14
50
+ 17
45
+ 18
19
30
D
FNC140-FNC149
Data
Operation 2
18
2
Height
FNC110-FNC139
Floating Point
+ 16
1
Control number
1
2
+15
FNC100-FNC109
Data
Transfer 2
1) Sorting result when the instruction is executed with "n = K2 (column No. 2)"
Line No.
14
FMC60-FNC69
Handy
Instruction
Line No.
13
FNC50-FNC59
High Speed
Processing
When the command input turns ON, data sorting is started. Data sorting is completed after "m1" scans,
and the instruction execution complete flag M8029 is set to ON.
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Column No.
11
FNC30-FNC39
Rotation and
Shift
The data table configuration is explained in an example in which the sorting source data table has 3 lines
+ 19
40
20
FNC150-FNC159
Positioning
Control
403
2) Sorting result when the instruction is executed with "n = K3 (column No. 3)"
Column No.
Line No.
Control number
Height
Weight
Age
1
2
5
3
+7
+8
+9
160
+ 11
+ 12
+ 17
40
+ 13
50
D
+ 16
20
50
D
+ 15
45
150
+4
+6
+ 10
20
180
+3
150
+2
100
+1
+5
+ 18
45
+ 14
70
+ 19
30
Related device
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
M8029
Name
Instruction
execution complete
Description
Turns ON when sorting is completed.
Cautions
Do not change the contents of operands and data while the instruction is executed.
Before executing the instruction again, set the command input to OFF.
Limitation in the number of instructions
Only one instruction can be used in a program.
When the same device is specified in DS1 and DD1
The source data is overwritten by the data acquired by sorting.
Take special care so that the contents of DS1
404
11
FNC30-FNC39
Rotation and
Shift
Function
70
TKY
TKY
71
HKY
HKY
72
DSW
DSW
73
SEGD
74
SEGL
SEGL S D n
75
ARWS
76
ASC
77
PR
78
FROM
79
TO
Reference
Section
15.1
S D1 D2 D3
Hexadecimal Input
Section
15.2
S D1 D2 n
Section
15.3
Section
15.4
Section
15.5
ARWS S D1 D2 n
Arrow Switch
Section
15.6
ASC
Section
15.7
16
Section
15.8
FROM m1 m2 D n
Section
15.9
FNC80-FNC89
External FX
Device
Symbol
FNC70-FNC79
External FX I/O
Device
Mnemonic
13
FNC50-FNC59
High Speed
Processing
FNC No.
12
FNC40-FNC49
Data Operation
FNC 70 to FNC 79 provide instructions to receive data from and send data to external devices mainly using
inputs and outputs in PLCs.
Because these instructions easily achieve complicated controls with a minimum required sequence program
and external wiring, they are similar to handy instructions described in the preceding chapter.
FROM and TO instructions essential for controlling special units and special blocks are included in this group.
(In FX3U and FX3UC PLCs, transfer can be executed also by MOV instruction.)
TO
Section
15.10
S D1 D2
S
PR
D
S D
15
17
FNC100-FNC109
Data
Transfer 2
m1 m2 S n
FMC60-FNC69
Handy
Instruction
SEGD S D
14
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
405
15.1
Outline
This instruction sets data to timers and counters through inputs of the ten keys from "0" to "9".
1. Instruction format
FNC 70
TKY
16-bit Instruction
7 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
TKY
13 steps
Mnemonic
Operation Condition
Continuous
Operation
DTKY
2. Set data
Operand Type
Description
Data Type
Head bit device number from which one of the ten keys is input [10 devices are
occupied]
Bit
D1
D2
Head bit device number storing the key pressing information [11 devices are
occupied]
3. Applicable devices
Operand
Type
S
Bit Devices
Word Devices
System User
Digit Specification
Z Modify K H
""
3
3
3 3
ConReal
CharacPointer
stant Number ter String
Index
D1
D2
System User
Others
Special
Unit
3 3 3 3
3 3
3
3
406
11
to D2
TKY
D1
D2
[4]
S +1
S +2
[2]
[1]
S +3
[3]
13
FNC50-FNC59
High Speed
Processing
S +9
S S S S S S S S S
+1 +2 +3 +4 +5 +6 +7 +8 +9
14
D2 +1
FMC60-FNC69
Handy
Instruction
PLC
D2
24V 0V S/S S
D2 +2
D2 +3
15
D2 +10 [1]
[2]
[3]
[4]
DTKY
D1
+10]
to D2 +9 turn ON or OFF according to the pressed keys.
18
D2
For the ten-key connection example and key pressing information, refer to the 16-bit operation (TKY) shown
above.
19
Cautions
FNC140-FNC149
Data
Operation 2
FNC110-FNC139
Floating Point
Command
input
FNC 70
17
FNC100-FNC109
Data
Transfer 2
to D2
16
FNC80-FNC89
External FX
Device
FNC70-FNC79
External FX I/O
Device
D2 +9
12
FNC40-FNC49
Data Operation
+10]
FNC30-FNC39
Rotation and
Shift
20
FNC150-FNC159
Positioning
Control
407
D2
D2
to D2
+9: Turn ON or OFF according to input of the ten keys "0" to "9".
+10: Is ON while either one among "0" to "9" keys is pressed (key sensing output).
Program example
In the program example shown below, the input X000 is set as the head bit device, and the ten keys "0" to "9"
are connected.
1. Program
X030
FNC 70
TKY
D1
D2
X000
D0
M10
2. Connection diagram
This connection diagram shows an example of FX3U PLC (sink input).
For wiring details, refer to the following manual.
Ten keys 0
24V
0V
S/S X000 X001 X002 X003 X004 X005 X006 X007 X010 X011
PLC
408
[4]
[2]
X001
X002
12
[1]
[3]
X003
X011
13
M 10
M 12
FNC50-FNC59
High Speed
Processing
X000
FNC40-FNC49
Data Operation
1) When the ten keys are pressed in the order "[1] [2]
[3] [4]" shown in the figure, "2130" is stored in (D0).
When an input value is larger than "9999", it overflows
from the most significant digit.
(An input numeric value is stored in the binary format in
D0).
11
FNC30-FNC39
Rotation and
Shift
3. Timing chart
M 13
14
M 11
FMC60-FNC69
Handy
Instruction
M 19
M 20
[1]
[2]
[3]
15
[4]
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
409
15.2
Outline
This instruction multiplexes four X-devices and four Y-devices to allow for 16 key (0 to F) 4-digit (byte) input.
Keys 0 to 9 stores numerical values, and keys A to F represent function keys.
When the extension function is set to ON, hexadecimal keys 0 to F all store their corresponding numerical
values.
1. Instruction format
FNC 71
HKY
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
HKY
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DHKY
2. Set data
Operand Type
Description
Data Type
Bit
D1
Bit
D2
D3
Bit
3. Applicable devices
Operand
Type
S
D1
Bit Devices
Word Devices
System User
Digit Specification
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
3
3 3 3 3
D2
D3
System User
Others
Special
Unit
3 3
3 3
3
3
410
FNC 71
HKY
D1
D2
D3
11
FNC30-FNC39
Rotation and
Shift
12
FNC40-FNC49
Data Operation
Key
D3
D3
+3
D3
+1
D3
+4
D3
+2
D3
+5
13
Command
input
FNC 71
DHKY
D1
D2
D3
15
FNC70-FNC79
External FX I/O
Device
+1, D2
] in binary.
16
FNC80-FNC89
External FX
Device
Extension function
18
FNC110-FNC139
Floating Point
19
M8167
S
D1
D2
FNC140-FNC149
Data
Operation 2
FNC 71
HKY
17
FNC100-FNC109
Data
Transfer 2
When M8167 is set to ON making the extension function valid, the numerical values for keys 0 to F are stored
in binary.
When the extension function is valid, the function and opearation are the same except for the following.
Command
input
14
FMC60-FNC69
Handy
Instruction
Signals [ S
to S +3] and [ D1 to D1 +3] connected to the 16 key input (0 to F) are scanned.
When a key 0 to 9 is pressed, the corresponding numeric value is shifted into [ D2 +1, D2 ] from the least
significant byte, and D3 +7 turns ON.
When a key A to F is pressed, the corresponding key press information bit [ D3 to D3 +5] turns ON. and
D3 +6 turns ON.
FNC50-FNC59
High Speed
Processing
D3
20
FNC150-FNC159
Positioning
Control
411
+1,
D2
M8167
FNC 71
DHKY
D1
D2
D3
Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
M8167
M8029
Name
Description
Turns ON/OFF the hexadecimal data handling function of HKY (FNC 71) instruction.
Extension function flag OFF: Ten-keys and function keys
ON: Hexadecimal keys
Instruction execution
complete flag
to D1
to D1
Cautions
1. Limitation in the number of instructions
HKY or DHKY instruction can be used only once in a program.
When TKY and/or DTKY instruction should be used two or more times, use the indexing (V, Z) function.
do not change,
D3
to D3 +7 turn OFF.
3) Eight devices are occupied from the head device D3 for outputting the key pressing information.
Make sure that these devices are not used by other machine controls.
-
D3
D3
to D3
D3
6. Output format
Use a transistor output type PLC.
412
11
X004
FNC 71
HKY
D1
D2
D3
X000
Y000
D 0
M 0
FNC30-FNC39
Rotation and
Shift
Program example
External
wiring
12
FNC40-FNC49
Data Operation
The figure below shows an example of the FX3U series main unit (sink input/sink output).
For wiring details, refer to the following manual.
FX3U Hardware Edition
13
FMC60-FNC69
Handy
Instruction
0V
FNC50-FNC59
High Speed
Processing
24V
14
15
Transistor output
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
413
15.3
Outline
This instruction reads the set value of digital switches.
This instruction can read a set of 4 digits (n = K1) or two sets of 4 digits (n = K2).
1. Instruction format
FNC 72
DSW
Mnemonic
16-bit Instruction
9 steps
Operation Condition
32-bit Instruction
Continuous
Operation
DSW
Mnemonic
Operation Condition
2. Set data
Operand Type
Description
Data Type
Bit
D1
Bit
D2
16-bit binary
16-bit binary
3. Applicable devices
Operand
Type
S
D1
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
3
3 3 3 3
D2
3 3
3 3
Strobe
signal
FNC 72
DSW
D1
D2
1) Data D1
- A numeric value from 0 to 9999 (up to 4 digits) can be read.
- A numeric value is stored in the binary format.
- The first set is stored to D2
414
+1.
Device
Name
Description
M8029
Instruction execution
complete flag
to D1
to D1
14
FMC60-FNC69
Handy
Instruction
Cautions
1. When the command contact turns OFF
Though the contents of D2
to D1 +3 turn OFF.
15
16
5. Digital switches
Use BCD output type digital switches.
Program example
1. Program
D2
X010
Y010
D 0
K 1
19
FNC140-FNC149
Data
Operation 2
FNC 72
DSW
D1
18
FNC110-FNC139
Floating Point
In the program example shown below, digital switches are connected to inputs starting from X010 and outputs
from Y010.
17
FNC100-FNC109
Data
Transfer 2
For continuously receiving digital switch values, make sure to use a transistor output type PLC.
For a relay type PLC, refer to "How to use this instruction in a relay output type PLC" later.
FNC80-FNC89
External FX
Device
It is not necessary to wire the strobe signal (output for digit specification) D1 to unused digits. Because
unused digits are occupied also by this instruction, however, they cannot be used for any other purpose.
Make sure to leave unused outputs vacant.
FNC70-FNC79
External FX I/O
Device
1) When two sets of 4 digits (n = K2) are used, two devices are occupied starting from D2 .
X000
13
FNC50-FNC59
High Speed
Processing
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
12
FNC40-FNC49
Data Operation
Related devices
11
FNC30-FNC39
Rotation and
Shift
20
FNC150-FNC159
Positioning
Control
415
2. Connection diagram
The figure below shows an example of the FX3U series main unit (sink input/sink output).
For wiring details, refer to the following manual.
FX3U Hardware Edition
100 To
101 second
102 set
103
100
BCD type
digital
switch
101
102
103
BCD type
digital
switch
Diode of
0.1 A, 50 V
is required.
24V
1
2
4
8
S/S X010 X011 X012 X013
Inputs of first set
0V
1
2
3
4
To
second
set
3. Timing chart
X000
Y010
Y011
Repeated
operation
0.1 sec
0.1 sec
0.1 sec
0.1 sec
Y012
Pause
0.1 sec
Y013
0.1 sec
While X000 is ON, Y010 to Y013 turn ON in turn at every 100 ms. After one cycle is finished, the execution
complete flag M8029 turns ON.
SET
M 0
FNC 72
DSW
X010
RST
M 0
Y010
D 0
K 1
M8029
1) While M0 (digital switch read input) is ON, DSW (FNC 72) is driven.
2) DSW (FNC 72) completes one cycle of operation, and remains driven until the execution complete flag
(M8029) turns ON.
416
FNC30-FNC39
Rotation and
Shift
15.4
11
Outline
12
This instruction decodes data, and turns the seven-segment display unit (1 digit) ON.
FNC 73
SEGD
16-bit Instruction
Mnemonic
Operation Condition
SEGD
5 steps
Continuous
Operation
Pulse (Single)
Operation
SEGDP
FNC40-FNC49
Data Operation
1. Instruction format
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
16-bit binary
16-bit binary
14
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
16
Command
input
FNC 73
SEGD
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
FMC60-FNC69
Handy
Instruction
3. Applicable devices
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
417
Hexadecimal num- b3
ber
b2
b1
b0
Seven-segment
configuration
B15
...
B8 B7 B6 B5 B4 B3 B2 B1 B0
Display
data
Caution
1. Number of occupied devices
Low-order 8 bits of
418
11
FNC30-FNC39
Rotation and
Shift
15.5
Outline
12
This instruction controls one or two sets of 4-digit seven-segment display units having the latch function.
FNC 74
SEGL
16-bit Instruction
7 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
SEGL
Mnemonic
FNC40-FNC49
Data Operation
1. Instruction format
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
Description
Data Type
16-bit binary
Bit
14
16-bit binary
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Special
Unit
3 3 3 3
Z Modify K H
3 3
""
3 3
3 3
16
17
2) For
18
FNC110-FNC139
Floating Point
FNC100-FNC109
Data
Transfer 2
FNC 74
SEGL
FNC80-FNC89
External FX
Device
Command
input
15
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
Index
S
D
System User
Others
FMC60-FNC69
Handy
Instruction
3. Applicable devices
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
419
D D +1 D +2 D +3
1
4
8
2
102
103
101
D +4 D +5 D +6 D +7
100 101 102 103
100
V+
1
2
4
8
1st set
and
PLC
(transistor output type)
COM
D D +1 D +2 D +3
1
4
8
2
103
102
101
1
2
4
8
1st set
420
D +4 D +5 D +6 D +7
100 101 102 103
100
V+
COM
103
102
101
1
2
4
8
2nd set
100
V+
11
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
Name
M8029
Instruction execution
complete flag
Description
Turns ON when output of 4 digits is finished.
FNC30-FNC39
Rotation and
Shift
Related devices
12
FNC40-FNC49
Data Operation
Cautions
13
SEGL instruction is executed in synchronization with the scan time (operation cycle) of the PLC.
For achieving a series of display, the scan time of the PLC should be 10 ms or more.
If the scan time is less than 10 ms, use the constant scan mode so that the scan time exceeds 10 ms.
15
FNC70-FNC79
External FX I/O
Device
14
FMC60-FNC69
Handy
Instruction
FNC50-FNC59
High Speed
Processing
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
421
Negative logic
Positive logic
Pull-up
resistor
Output circuit
+V0
Y000
LOW
COM1
Description
Check
422
Logic 1
PLC
ON
HIGH
Y000
ON
V+
Pulldown
resistor
Logic 1
PLC
11
FNC30-FNC39
Rotation and
Shift
Negative logic
D +3
D +1
D +2
D +3
12
L
H
H
Seven-segment
display
Seven-segment
display
Description
1
2
4
8
FNC40-FNC49
Data Operation
D +2
Timing chart
1
2
4
8
D +1
Positive logic
13
Check
FNC50-FNC59
High Speed
Processing
2) Strobe signal
Negative logic
D
D +3
...
D +3
D +4 to D +7
Change in
strobe display
Nothing
Nothing
14
D +4 to D
Change in
strobe display
+7
L
Nothing
Nothing
Latch
Latch
Description
15
Positive logic
Negative logic (mismatch)
Parameter "n"
4 digits 1 set
4 digits 2 sets
17
19
Parameter "n"
4 digits 1 set
4 digits 2 sets
20
FNC150-FNC159
Positioning
Control
Negative logic
Strobe signal
FNC140-FNC149
Data
Operation 2
18
FNC110-FNC139
Floating Point
When the following seven-segment display unit is selected, "n" should be "1" when one display unit is
connected (4 digits 1 set) or "5" when two display units are connected (4 digits 2 sets).
16
FNC100-FNC109
Data
Transfer 2
Strobe signal
FNC80-FNC89
External FX
Device
Data input
FNC70-FNC79
External FX I/O
Device
Check
FMC60-FNC69
Handy
Instruction
Timing chart
...
...
Positive logic
...
Logic
423
15.6
Outline
This instruction inputs data through arrow switches used for shifting the digit and incrementing/decrementing
the numeric value in each digit.
1. Instruction format
FNC 75
ARWS
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
Continuous
Operation
ARWS
Operation Condition
2. Set data
Operand Type
Description
Data Type
D1
D2
3. Applicable devices
Operand
Type
S
Bit Devices
System User
Digit Specification
System User
3 3 3
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3
3 3 3 3
424
Others
D1
D2
Word Devices
3 3
3
3
3 3
""
11
Command
input
FNC 75
ARWS
D1
D2
13
FNC50-FNC59
High Speed
Processing
103
102
100
D2 +6
D2 +5
D2 +4
14
To outputs in
PLC
FMC60-FNC69
Handy
Instruction
101
D2 +7
Strobe output
Display/operation panel
Display for
selected digit
Higher
digit
S +3
Lower
digit
S +2
S
D2 +1
D2
S +3
S +2
S +1
To outputs in
PLC
To inputs in
PLC
16
17
FNC100-FNC109
Data
Transfer 2
Decrement
D2 +2
FNC80-FNC89
External FX
Device
S +1
D2 +3
Numeric value
output
15
FNC70-FNC79
External FX I/O
Device
Switches
Increment
12
FNC40-FNC49
Data Operation
actually stores a 16-bit binary value in the range from 0 to 9999, but the value is expressed in the BCD
format in the explanation below for convenience.
When the command input is set to ON, ARWS instruction executes the following operation.
D1
FNC30-FNC39
Rotation and
Shift
Arrow switches
Provided to select a digit and increment or
decrement the numeric value in the selected digit.
1) Specifying the number of digits of the seven-segment display unit having the BCD decoder n
In the explanation below, "n" is set to "4" (up to the 103 digit).
18
19
FNC140-FNC149
Data
Operation 2
FNC110-FNC139
Floating Point
20
FNC150-FNC159
Positioning
Control
425
Cautions
1. Setting of the parameter "n"
Refer to the explanation of parameter setting in SEGL (FNC 74) instruction. The setting range is from 0 to 3
for ARWS instruction.
For the parameter setting, refer to Subsection 15.5.2.
.
.
426
11
FNC30-FNC39
Rotation and
Shift
Program example
1. When changing the timer number and displaying the current value
1) Specifying the timer number using a 3-digit digital switch
12
FNC40-FNC49
Data Operation
X010
X011
X012
X013
8 4 2 1
8 4 2 1
101
Y011
FNC50-FNC59
High Speed
Processing
102
Y012
13
8 4 2 1
100
Y010
Y015
Write
FMC60-FNC69
Handy
Instruction
1
Y000
2
Y001
4
Y002
8
Y003
Read
Y014
Read
14
15
FNC70-FNC79
External FX I/O
Device
Set
Write
X004 X003 X002 X000 X001
Explanation of operation
Every time the read/write key is pressed, the read/write LED lights alternately.
16
In writing
Set a numeric value using the arrow switches while looking at the seven-segment display unit, and then
press the switch X003.
FNC80-FNC89
External FX
Device
In reading
Set the timer number using the digital switch, and then press the set switch (X003).
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
427
Program
T0
D300
T1
D301
T99
D399
M0
Decrement
M1
Increment
M2
Higher digit
M3
RUN monitor
Lower digit
X000
X001
X002
M8000
X004
FNC 66
ALTP
Read/write
M100
M100
Read indication
Y015
Write indication
Read Set
Y014
Read
Y015
Write
Y015 X003
428
M100
Y014
Y014 X003
Write Set
Practical
timer circuit
K1
4 digits 1 set
4 digits 1 set
FNC 74
T0Z
Y000
K 1
Negative logic
SEGL
T0Z Seven-segment display unit
FNC 12
MOVP
D300Z
D511
FNC 75
M0
D511 Y000
K1
ARWS
(M 0 to M 3) (D511) (Y000 to Y007)
Seven-segment display unit
4 digits 1 set
FNC 12 D511 D300Z
MOVP
11
FNC30-FNC39
Rotation and
Shift
15.7
Outline
1. Instruction format
FNC 76
ASC
16-bit Instruction
11 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
Continuous
Operation
ASC
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand Type
S
Data Type
Character string
(only ASCII codes)
3. Applicable devices
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3
3 3 3 3
*1.
""
*1
It is not necessary to attach quotes (" ") to the character string specified in
16
FNC80-FNC89
External FX
Device
S can handle half-width characters A to Z, 0 to 9 and symbols (, but cannot handle regular-width
characters).
A character string is entered when a program is created with a programming tool.
D
stores converted ASCII codes in the order of low-order 8 bits and high-order 8 bits by 2 characters/
byte at one time.
D
Example: ABCDEFGH
Low-order 8
bits
42 (B)
41 (A)
D +1
44 (D)
43 (C)
D +2
46 (F)
45 (E)
D +3
48 (H)
47 (G)
19
FNC140-FNC149
Data
Operation 2
High-order 8
bits
18
FNC110-FNC139
Floating Point
FNC 76
ASC
17
FNC100-FNC109
Data
Transfer 2
Command
input
15
FNC70-FNC79
External FX I/O
Device
Operand
Type
14
FMC60-FNC69
Handy
Instruction
Description
12
FNC40-FNC49
Data Operation
This instruction converts a half-width alphanumeric character string into ASCII codes.
Use this instruction for selecting one among two or more messages and displaying it on an external display
unit.
20
FNC150-FNC159
Positioning
Control
429
Extension function
When M8161 is set to ON for making the extension function valid, a half-width alphanumeric character string
specified in S is converted into ASCII codes, and transferred in turn only to low-order 8 bits (1 byte) of
D .
Command
input
M8161
FNC 76
ASC
D
Example: ABCDEFGH
M8000
M8161
High-order 8 bits
Low-order 8 bits
Character string
00
41
D
D
+1
00
42
+2
00
43
+3
00
44
+4
00
45
+5
00
46
+6
00
47
+7
00
48
Related devices
Device
M8161
Name
Description
8-bit processing mode for ASC (FNC 76), RS (FNC 80), ASCI (FNC 82), HEX (FNC
83) and CCD (FNC 84) instructions
Extension function flag OFF: Two characters are stored to low-order 8 bits and high-order 8 bits in this order
at one time (2 characters/word).
ON: One character is stored to low-order 8 bits at one time (1 character/word).
Caution
1. Number of occupied devices
1) While the extension function is OFF
-
D
occupies as many devices as the number of characters divided by "2". (The decimal point is
rounded up.)
2. When using RS (FNC 80), ASCI (FNC 82), HEX (FNC 83) and/or CCD (FNC 84) instructions
The extension function flag M8161 is also used for other instructions.
When using an instruction described above and the ASC instruction in the same program, make sure to set
M8161 to ON or OFF just before the ASC instruction so that M8161 does not apply to another instruction.
430
11
FNC30-FNC39
Rotation and
Shift
15.8
Outline
12
FNC 77
PR
16-bit Instruction
5 steps
Mnemonic
Operation Condition
32-bit Instruction
Mnemonic
Continuous
Operation
PR
FNC40-FNC49
Data Operation
1. Instruction format
Operation Condition
13
Operand Type
Description
Data Type
Character string
(only ASCII codes)
14
Bit
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
""
16
to
+7 are output to
to
17
+1
B (H42)
+2
C (H43)
+3
D (H44)
+4
E (H45)
+5
F (H46)
to
+6
G (H47)
+7.
+7
H (H48)
FNC100-FNC109
Data
Transfer 2
+7 in turn by
The timing chart below shows a case in which the following ASCII codes are stored in
Eight bytes are sent from S
= "A" at first to " S +7 = "H" at the end.
A (H41)
FNC80-FNC89
External FX
Device
Command
input
15
FNC70-FNC79
External FX I/O
Device
3 3 3 3
ConReal
CharacPointer
stant Number ter String
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Operand
Type
FNC50-FNC59
High Speed
Processing
2. Set data
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
431
2. Timing chart
Command input
D to D +7 Data
S1
S1 +1
S1 +2
S1 +3
T0
T0
S1 +7
T0
D +8 Strobe
D +9 Execution flag
to
+8:
Strobe signal
+9:
Extension function
1. 16-byte serial output
Depending on the ON/OFF status of the special auxiliary relay M8027, the number of characters output by
one-time execution of the instruction varies.
While M8027 is OFF, 8-byte serial output (fixed to 8 characters) is executed. While M8027 is ON, 16-byte
serial output (1 to 16 characters) is executed.
In the example shown below, up to 16 characters (1 character/byte) are output to the display unit (external
display unit A6FD, for example).
It is supposed that data to be displayed is stored in hexadecimal codes in D300 to D307.
1) Connection example of the external display unit A6FD*1
The PLC shown in the example below is the FX2N-16EYT (sink input/sink output) connected to the
FX3U-32M.
PLC
COM1 Y020 Y021 Y022 Y023 Y024 Y025 Y026 Y027 COM2 Y030 Y031 Y032 Y033
NC
12V
24V
AC100/200V
COM D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7
External display unit A6FD*1
*1.
432
STR
AC
AC
LG
A6FD was distributed only inside Japan, however, production of the external display unit A6FD was
terminated in November 2002.
11
FNC30-FNC39
Rotation and
Shift
Head
character
12
FNC40-FNC49
Data Operation
Last
character*
T: Operation cycle
or interrupt time
Strobe Y010
Execution flag Y011
13
FNC50-FNC59
High Speed
Processing
14
Related devices
Name
M8027*1
PR mode
*1.
FMC60-FNC69
Handy
Instruction
Device
Description
OFF: 8-byte serial output (fixed to 8 characters)
ON: 16-byte serial output (1 to 16 characters)
15
17
FNC100-FNC109
Data
Transfer 2
16
FNC80-FNC89
External FX
Device
FNC70-FNC79
External FX I/O
Device
Cautions
4. When "00H (NUL code)" is contained in the data (while M8027 is ON)
The instruction is executed completely, and the data after "00H" is not output.
M8029 remains ON during one operation cycle.
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
433
15.9
Outline
This instruction reads the contents of buffer memories (BMF) in a special extension unit/block attached to a
PLC.
When a large capacity of buffer memory (BFM) data is read by this instruction, a watchdog timer error may
occur. When bad effect is not given to the control even if data to be read is divided, use RBFM (FNC278)
instruction.
For RBFM (FNC278) instruction, refer to Section 31.1.
1. Instruction format
FNC 78
FROM
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
FROM
FROMP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
17 steps DFROM
DFROMP
2. Set data
Operand Type
Description
Data Type
m1
m2
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
m1
3 3
3 3
m2
3 3
3 3
3 3 3 3
3 3
3 3
""
3
3 3
FNC 78
FROM
m1
m2
n
Number of transfer points
n = 1 to 32767
Transfer destination (PLC)
Transfer source BFM #
(Special extension unit/block)
m2 = 0 to 32766
Unit No.
m1 = 0 to 7
434
11
m1
m2
n
Number of transfer points
n = 1 to 16383
Transfer destination (PLC)
Transfer source BFM #
(Special extension unit/block)
m2 = 0 to 32765
13
FNC50-FNC59
High Speed
Processing
Unit No.
m1 = 0 to 7
Related devices
Device
14
Name
Description
For the 16-bit operation instruction, specify K1 to K4. For the 32-bit operation instruction, specify K1 to K8.
15
FNC70-FNC79
External FX I/O
Device
Cautions
FMC60-FNC69
Handy
Instruction
M8028
12
FNC40-FNC49
Data Operation
Command
input
FNC30-FNC39
Rotation and
Shift
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
435
Program examples
In programs, the contents of buffer memories (BFMs) in special extension unit/blocks are read (transferred) to
data registers (D), extension registers (R) or auxiliary relays (M) with digit specification using an applied
instruction such as FROM, MOV and BMOV.
Example: When the BFM #4 (abnormal station information) in the CC-Link/LT master unit (whose unit number
is fixed to "0") built in the FX3UC-32MT-LT is read to D0
- In case of FROM instruction
M8000
FNC 78
FROM
K0
K4
Unit
No. 0
BFM #4
D0
K1
Transfer Number of
destination transfer
points
FNC 78
FROMP
K0
K0
Unit
No. 0
BFM #0
D10
K4
Transfer Number of
destination transfer
points
Example: When the BFMs #0 to 3 (remote station connection information) in the CC-Link/LT master unit
(whose unit number is fixed to "0") built in the FX3UC-32MT-LT are read to D10 to D13
- In case of FROM instruction
M0
FNC 78
FROMP
K0
K0
Unit
No. 0
BFM #0
D10
Transfer Number of
destination transfer
points
FNC 15
BMOVP
U0\G0
D10
K4
Unit No. 0
Transfer Number of
BFM #0 destination transfer
points
436
K4
11
FNC30-FNC39
Rotation and
Shift
12
Unit
No. 0
Built-in
CC-Link/LT
I/O
extension
block
Unit
No.2
Special
extension
block
Special
extension
block
Unit
No.3
I/O
extension
block
13
Special
extension
block
When BFMs are handled in a 32-bit instruction, a specified BFM stores low-order 16 bits, and a
consecutive BFM stores high-order 16-bits.
High-order
16 bits
Low-order
16 bits
BFM #10
BFM #9
16
FNC80-FNC89
External FX
Device
BFM #5
#6
#7
#8
#9
Specified devices
D100
D101
D102
D103
17
Specified BFMs
BFM #5
#6
#7
#8
18
FNC110-FNC139
Floating Point
D100
D101
D102
D103
D104
Specified BFMs
FNC100-FNC109
Data
Transfer 2
Specified devices
15
FNC70-FNC79
External FX I/O
Device
Up to 32767 16-bit RAM memories are built into a special extension unit/block, and they are called buffer
memories.
Buffer memory numbers range from "0" to "32766" and their contents vary depending on the function of the
extension equipment.
Setting range: K0 to K32766
14
FMC60-FNC69
Handy
Instruction
A unit number is automatically assigned to each special extension unit/block connected to a PLC.
The unit number is assigned in the way "No. 0 No. 1 No. 2 ..." starting from the equipment nearest to the
main unit.
FNC50-FNC59
High Speed
Processing
FX3UC32MTLT main
unit
Unit
No.1
FNC40-FNC49
Data Operation
Use the unit number to specify which equipment FROM/TO instruction works for.
Setting range: K0 to K7
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
437
2. While M8028 is ON
When an interrupt is generated during the execution of a FROM/TO instruction, the FROM/TO operation is
momentarily paused while the interrupt program executes. FROM/TO instructions cannot be used in interrupt
programs.
2. Countermeasures
1) Using RBFM (FNC278) or WBFM (FNC279) instruction [Ver.2.20 or later]
For divided BFM read [RBFM (FNC278) instruction], refer to Section 31.1.
For divided BFM write [WBFM (FNC279) instruction], refer to Section 31.2.
2) Changing the watchdog timer time
By overwriting the contents of D8000 (watchdog timer time), the watchdog timer detection time can be
changed.
When the program shown below is input, the sequence program after the input will be monitored with the
new watchdog timer time.
M8002
0
Initial pulse
FNC 12
MOV
FNC 07
WDT
K300
D8000
438
11
FNC30-FNC39
Rotation and
Shift
1. Instruction format
D
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
TO
TOP
13
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
17 steps DTO
DTOP
FNC50-FNC59
High Speed
Processing
FNC 79
TO
2. Set data
Operand Type
Description
14
Data Type
16- or 32-bit binary
m2
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
Index
m1
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
3 3
3
3 3 3 3
3 3
""
3 3
3 3
3
3 3
17
FNC 79
TO
m1
m2
n
Number of transfer points
n = 1 to 32767
Transfer source (PLC)
Transfer destination (Special
extension unit/block) BFM #
m2 = 0 to 32766
Unit No.
m1 = 0 to 7
18
FNC110-FNC139
Floating Point
FNC100-FNC109
Data
Transfer 2
Command
input
16
FNC80-FNC89
External FX
Device
m2
3 3
15
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
FMC60-FNC69
Handy
Instruction
m1
12
FNC40-FNC49
Data Operation
This instruction writes data from a PLC to buffer memories (BFM) in a special extension unit/block.
When a large capacity of data is written to buffer memories (BFM) by this instruction, a watchdog timer error
may occur. When splitting the data to be written does not affect the control, use WBFM (FNC279) instruction.
For WBFM (FNC279) instruction, refer to Section 31.2.
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
439
FNC 79
DTO
m1
m2
n
Number of transfer points
n = 1 to 16383
Transfer source (PLC)
Transfer destination (Special
extension unit/block) BFM #
m2 = 0 to 32765
Unit No.
m1 = 0 to 7
Related devices
Device
M8028
Name
Description
Cautions
1. Digit specification in bit device
For the 16-bit operation instruction, specify K1 to K4. For the 32-bit operation instruction, specify K1 to K8.
Program examples
In programs, the contents of data registers (D), extension registers (R), auxiliary relays (M) with digit
specification, or constants (K, H) are written (transferred) to buffer memories in a special extension unit/block
using an applied instruction such as TO, MOV and BMOV.
Example: When writing "H0" to the BFM #27 (command) in the CC-Link/LT master unit (whose unit number is
fixed to "0") built in the FX3UC-32MT-LT
- In case of TO instruction
M1
FNC 79
TOP
K0
K27
Unit
No. 0
BFM #27
FNC 12
MOVP
H0
U0\G27
440
H0
K1
Transfer Number of
Transfer
source
points
data
11
FNC30-FNC39
Rotation and
Shift
12
FNC No.
Mnemonic
80
RS
Format
RS
Function
S m D n
Reference
Section
16.1
Section
16.2
ASCI
ASCI
S D n
Section
16.3
83
HEX
HEX
S D n
Section
16.4
84
CCD
CCD
S D n
Check Code
Section
16.5
85
86
87
RS2
88
PID
89
RS2
PID
S m D n n1
S1 S2 S3 D
Serial Communication 2
Section
16.6
Section
16.7
14
15
16
FNC80-FNC89
External FX
Device
82
PRUN S D
FNC70-FNC79
External FX I/O
Device
PRUN
FMC60-FNC69
Handy
Instruction
81
13
FNC50-FNC59
High Speed
Processing
Serial Communication
FNC40-FNC49
Data Operation
FNC 80 to FNC 89 provide control instructions for special adapters mainly connected to serial ports.
PID control loop instruction is included in this group.
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
441
16.1
Outline
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.
1. Instruction format
FNC 80
RS
Mnemonic
16-bit Instruction
9 steps
Operation Condition
Continuous
Operation
RS
Operation Condition
2. Set data
Operand type
SS1
Data type
16-bit binary or
character string
Head device of data registers storing received data when receiving is completed
*1.
Description
16-bit binary
16-bit binary or
character string
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
3 3
3 3
SD2
3 3
3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3 3
3
3 3
442
FNC 80
RS
11
For detailed explanation, refer to the Data Communication Edition manual.
Device
Name
M8063
Device
D8120*2
*1
*3
M8121
D8122
*3
M8122
Sending request
M8123*1
D8124
Header
D8125
Terminator
M8124
M8129
D8123
*2
*3
D8129
M8161
12
FNC40-FNC49
Data Operation
*1
Name
D8405
D8419
*1.
*2.
*3.
13
FNC50-FNC59
High Speed
Processing
D8063
14
FMC60-FNC69
Handy
Instruction
System configuration
Option
RS-232C communication
RS-485 communication
16
RS2 instruction
RS instruction
Header size
1 to 4 characters (bytes)
Up to 1 character
(byte)
Terminator size
1 to 4 characters (bytes)
Up to 1 character
(byte)
Remarks
For the RS2 instruction, up to 4 characters
(bytes) can be specified as a header or
terminator.
17
FNC100-FNC109
Data
Transfer 2
FNC80-FNC89
External FX
Device
Differences between RS (FNC 80) instruction and RS2 (FNC 87) instruction
Item
15
FNC70-FNC79
External FX I/O
Device
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.
Communication type
FNC30-FNC39
Rotation and
Shift
Related devices
18
RS (FNC 80) instruction can be used for ch1 only (cannot be used for ch2).
FNC110-FNC139
Floating Point
Do not drive two or more RS (FNC 80) and/or RS2 (FNC 87) instructions for the same port at the same
time.
19
Cautions
For other cautions, refer to the Data Communication Edition manual.
FNC140-FNC149
Data
Operation 2
It is not permitted to use an RS (FNC 80)/RS2 (FNC 87) instruction and an IVCK (FNC270)/IVDR
(FNC271)/IVRD (FNC272)/IVWR (FNC273)/IVBWR (FNC274) instruction for the same port.
20
FNC150-FNC159
Positioning
Control
443
16.2
Outline
This instruction handles the device number of
as octal numbers, and transfers data.
1. Instruction format
FNC 81
PRUN
Mnemonic
16-bit Instruction
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DPRUN
DPRUNP
Continuous
Operation
Pulse (Single)
Operation
PRUN
5 steps
PRUNP
2. Set data
Operand type
SS1
D
*1.
Description
Data type
*1
Digit specification
*1
Make sure that the least significant digit of a specified device number is "0".
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
FNC 81
PRUN
K4X000
K4M0
444
M8
X7
X6
X5
X4
X3
X2
X1
X0
M7
M6
M5
M4
M3
M2
M1
M0
11
Command
input
FNC 81
PRUN
K4M0
K4Y000
FNC30-FNC39
Rotation and
Shift
12
Not transferred
M8
M7
M6
M5
M4
M3
M2
M1
M0
Y7
Y6
Y5
Y4
Y3
Y2
Y1
Y0
FNC40-FNC49
Data Operation
13
FNC50-FNC59
High Speed
Processing
K6X000
K6M0
14
FMC60-FNC69
Handy
Instruction
FNC 81
DPRUN
X10
X7
X6
X5
X4
X3
X2
X1
X0
M10 M9
M8
M7
M6
M5
M4
M3
M2
M1
M0
X20 X17
15
FNC70-FNC79
External FX I/O
Device
M27
16
Command
input
FNC 81
DPRUN
K6M0
K6Y000
Y27
17
Not transferred
M10 M9
M8
M7
M6
M5
M4
M3
M2
M1
M0
Y10
Y7
Y6
Y5
Y4
Y3
Y2
Y1
Y0
Y20 Y17
FNC100-FNC109
Data
Transfer 2
M27
FNC80-FNC89
External FX
Device
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
445
16.3
Outline
This instruction converts hexadecimal code into ASCII code.
On the other hand, BINDA (FNC261) instruction converts binary data into ASCII code, and ESTR (FNC116)
instruction converts binary floating point data into ASCII code.
For BINDA (FNC261) instruction, refer to Section 29.6.
For ESTR (FNC116) instruction, refer to Section 18.4.
1. Instruction format
FNC 82
ASCI
Mnemonic
16-bit Instruction
7 steps
Operation Condition
ASCIP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
ASCI
2. Set data
Operand type
Description
Data type
SS1
16-bit binary
Character string
(only ASCII code)
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
SS1
SD2
3 3 3 3
3 3 3 3
3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
3 3
3
3 3
446
FNC 82
ASCI
M8000
M8161 16-bit mode
Command
input
13
FNC50-FNC59
High Speed
Processing
FNC 82
ASCI
Operation
In the following program, conversion is executed as follows:
14
M8000
M8161
FNC 82
ASCI
D100
D200
16-bit mode
FMC60-FNC69
Handy
Instruction
X010
K4
15
FNC70-FNC79
External FX I/O
Device
Devices after S
D100 = 0ABCH
D101 = 1234H
D102 = 5678H
Number of specified digits (characters) and conversion result
n
K1
K2
K3
K4
K5
K6
K7
K8
K9
[C]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
[8]
[C]
[A]
[0]
[4]
[3]
[2]
[1]
[B]
[A]
[0]
[4]
[3]
[2]
[B]
[A]
[0]
[4]
[3]
[C]
[B]
[A]
[0]
[4]
[C]
[B]
[A]
[0]
[C]
[C]
[B]
[A]
[C]
[B]
17
FNC100-FNC109
Data
Transfer 2
[B]
[C]
16
FNC80-FNC89
External FX
Device
[C]
18
D 200
0 1
A
0
[C] 43H
C
1
[0] 30H
1
ASCII code
[0] = 30H [1] = 31H
[A] = 41H [2] = 32H
[B] = 42H [3] = 33H
[C] = 43H [4] = 34H
[5] = 35H
[6] = 36H
[7] = 37H
[8] = 38H
19
FNC140-FNC149
Data
Operation 2
[A] 41H
D 201
0 1
1
B
FNC110-FNC139
Floating Point
D 100 = 0ABCH
0 0 0 0 1
0
12
FNC40-FNC49
Data Operation
11
FNC30-FNC39
Rotation and
Shift
2. 16-bit conversion mode (while M8161 is OFF) (M8161 is also used for the RS, HEX, CCD and
CRC instructions.)
[B] 42H
When outputting data in the BCD format for a printer, for example, it is necessary to convert binary data
into BCD data before executing this instruction.
20
FNC150-FNC159
Positioning
Control
447
M8000
M8161 8-bit mode
Command
input
FNC 82
ASCI
Low-order 8 bits
Destination
Operation
In the following program, conversion is executed as follows:
M8000
M8161
X010
FNC 82
ASCI
D100
D200
8-bit mode
K4
Devices after S
D100 = 0ABCH
D101 = 1234H
D102 = 5678H
Number of specified digits (characters) and conversion result
n
K1
D 200
[C]
D 201
K2
K3
[B]
[C]
D 202
K4
K5
K6
K7
K8
K9
[A]
[0]
[4]
[3]
[2]
[1]
[8]
[B]
[A]
[0]
[4]
[3]
[2]
[1]
[C]
D 203
[B]
[A]
[0]
[4]
[3]
[2]
[C]
[B]
[A]
[0]
[4]
[3]
[C]
[B]
[A]
[0]
[4]
[B]
[A]
[0]
[C]
[B]
[A]
D 204
D 205
[C]
D 206
D 207
[C]
D 208
[B]
[C]
ASCII codes
[0] = 30H [1] = 31H
[A] = 41H [2] = 32H
[B] = 42H [3] = 33H
[C] = 43H [4] = 34H
[5] = 35H
[6] = 36H
[7] = 37H
[8] = 38H
0
4
0
3
When outputting data in the BCD format for a printer, for example, it is necessary to convert binary data
into BCD data before executing this instruction.
448
11
FNC30-FNC39
Rotation and
Shift
16.4
Outline
1. Instruction format
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
HEX
HEXP
Operation Condition
14
2. Set data
Data type
Character string
15
16-bit binary
Make sure to use only ASCII codes "0" to "9" and "A" to "F".
FNC70-FNC79
External FX I/O
Device
*1.
Description
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SD2
3 3 3 3
3 3 3 3
3 3
Z Modify K H
3
3 3
""
3 3
3
3 3
17
FNC 83
HEX
18
FNC110-FNC139
Floating Point
FNC100-FNC109
Data
Transfer 2
Command
input
16
FNC80-FNC89
External FX
Device
SS1
ConReal
CharacPointer
stant Number ter String
Index
FMC60-FNC69
Handy
Instruction
Operand type
SS1
13
FNC50-FNC59
High Speed
Processing
FNC 83
HEX
12
FNC40-FNC49
Data Operation
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
449
FNC 83
HEX
Operation
In the following program, conversion is executed as follows:
M8000
M8161
X010
FNC 83
HEX
D200
D100
16-bit mode
K4
ASCII code
Hexadecimal code
30H
41H
42H
43H
31H
32H
33H
34H
35H
D 102
D 101
D 100
D 200
0H
0AH
0ABH
0H
ABC1H
0AH
BC12H
0ABH
C123H
0ABCH
1234H
ABC1H
2345H
0H
41H [A]
D 201
D 100
0
0
30H [0]
43H [C]
0ABCH
42H [B]
1
A
1
B
1
C
When the input data is in BCD format, it is necessary to convert BCD data into binary data after executing
this instruction.
If ASCII code is not stored in S
in the HEX instruction, an operation error occurs and conversion into
hexadecimal code is disabled. Especially, note that ASCII code should be stored in high-order 8 bits of
S
also when M8161 is OFF.
450
11
M8000
M8161 8-bit mode
Command
input
FNC 83
HEX
16 bits
Ignored
Low-order 8 bits
13
Source data
FNC50-FNC59
High Speed
Processing
Operation
In the following program, conversion is executed as follows:
M8000
M8161
FNC 83
HEX
D200
D100
8-bit mode
14
FMC60-FNC69
Handy
Instruction
X010
K4
D 200
30H
D 201
41H
D 202
42H
D 203
43H
D 204
31H
D 205
32H
D 206
33H
D 207
34H
D 208
35H
15
FNC70-FNC79
External FX I/O
Device
ASCII code
16
FNC80-FNC89
External FX
Device
D 102
D 101
D 100
D 200
0H
0AH
0ABH
0H
ABC1H
0AH
BC12H
0ABH
C123H
8
0H
0ABCH
1234H
ABC1H
2345H
18
30H [0]
0
D 201
41H [A]
0ABCH
D 100
0
0
0
A
FNC110-FNC139
Floating Point
17
FNC100-FNC109
Data
Transfer 2
12
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
19
FNC140-FNC149
Data
Operation 2
When the input data is in BCD format, it is necessary to convert BCD data into binary data after executing
this instruction.
20
FNC150-FNC159
Positioning
Control
451
16.5
Outline
This instruction calculates the horizontal parity value and sum check value in the error check methods used in
communication. There is another check method, CRC (cyclic redundancy check) also. For obtaining CRC
value, use CRC instruction.
For CRC instruction, refer to Section 24.4.
For complement [NEG (FNC 29) instruction], refer to Section 10.10.
1. Instruction format
FNC 84
CCD
Mnemonic
16-bit Instruction
7 steps
Operation Condition
CCDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
CCD
2. Set data
Operand type
Description
Data type
SS1
16-bit binary or
character string
16-bit binary or
character string
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
SD2
3 3 3 3
3 3 3 3
3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
3 3
452
FNC 84
CCD
11
With regard to "n" data starting from S , the addition data and horizontal parity data of high-order 8 bits
and low-order 8 bits are stored to D
and D +1 respectively.
M8161 is used also for the RS, ASCI, HEX and CRC instructions. When using the 16-bit mode, set M8161 to
normally OFF. M8161 is cleared when the PLC mode is changed from RUN to STOP.
M8161 16-bit mode
FNC 84
CCD
13
FNC50-FNC59
High Speed
Processing
D100
D0
16-bit mode
14
K10
FMC60-FNC69
Handy
Instruction
FNC 84
CCD
K100
= 01100100
= 0110111 (1)
K100
= 01100100
K 98
= 01100010
K123
= 0111101 (1)
K 66
= 01000010
K100
= 01100100
K 95
= 0101111 (1)
K210
= 11010010
K 88
= 01011000
Total
K1091
Horizontal parity
15
16
"1091" in BCD
D1
Horizontal parity
18
FNC110-FNC139
Floating Point
D0
17
FNC100-FNC109
Data
Transfer 2
1000010 (1)
FNC80-FNC89
External FX
Device
K111
FNC70-FNC79
External FX I/O
Device
12
FNC40-FNC49
Data Operation
M8000
Command
input
FNC30-FNC39
Rotation and
Shift
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
453
16 bits
Ignored
FNC 84
CCD
Low-order 8 bits
Source data
FNC 84
CCD
D100
K10
D 100
K100
= 01100100
D 101
K111
= 0110111 (1)
D 102
K100
= 01100100
D 103
K 98
= 01100010
D 104
K123
= 0111101 (1)
D 105
K 66
= 01000010
D 106
K100
= 01100100
D 107
K 95
= 0101111 (1)
D 108
K210
= 11010010
D 109
K 88
= 01011000
Total
K1091
Horizontal parity
454
D0
8-bit mode
1000010 (1)
D0
"1091" in BCD
D1
Horizontal parity
11
FNC30-FNC39
Rotation and
Shift
16.6
Outline
This instruction sends and receives data in no-protocol communication by way of serial ports in accordance
with RS-232C or RS-485 provided in the main unit.
FNC 87
RS2
16-bit Instruction
11 steps
Mnemonic
Operation Condition
Continuous
Operation
RS2
Operation Condition
13
Data type
FNC50-FNC59
High Speed
Processing
16-bit binary or
character string
14
16-bit binary
FMC60-FNC69
Handy
Instruction
2. Set data
Operand type
SS1
Description
Head device of data registers storing data to be sent
Head device of data registers storing received data when receiving is completed
16-bit binary or
character string
16-bit binary
n1
16-bit binary
15
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
3 3
SD2
3 3
3 3
n1
Index
Z Modify K H
""
3
3 3
3
3 3
3 3
17
18
FNC110-FNC139
Floating Point
FNC 87
RS2
FNC100-FNC109
Data
Transfer 2
Command
input
16
FNC80-FNC89
External FX
Device
SS1
3 3
ConReal
CharacPointer
stant Number ter String
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
Operand
Type
FNC40-FNC49
Data Operation
1. Instruction format
12
n1
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
455
Related devices
Device
Device
Name
ch1
ch2
M8401
M8421
M8402
M8422
Sending
request*1
M8403
M8423
M8404
Name
ch1
ch2
D8400
D8420
D8402
D8422
M8424
D8403
D8423
M8405
M8425
D8405
D8425
D8409
D8429
M8409
M8429
D8410
D8430
Header 1, 2
D8411
D8431
Header 3, 4
D8412
D8432
Terminator 1, 2
D8413
D8433
Terminator 3, 4
D8414
D8434
M8063
*1.
M8438
D8415
D8435
D8416
D8436
Sending sum
D8419
D8439
D8063
D8438
Cleared when the PLC mode is changed from RUN to STOP. *2 Available in Ver. 2.30 or later.
System configuration
For using 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.
Communication type
Option
RS-232C communication
FX3U-232-BD or FX3U-232ADP(-MB)
RS-485 communication
FX3U-485-BD or FX3U-485ADP(-MB)
Differences between RS (FNC 80) instruction and RS2 (FNC 87) instruction
Item
RS2 instruction
Header size
RS instruction
Remarks
For the RS2 instruction, up to 4 characters (bytes)
can be specified as a header or terminator.
Cautions
456
FX3UC
Ver. 2.30 or later
Item
Function Summary
ch1
Data Set Ready (DSR) Flag
ch2
Data Set Ready (DSR) Flag
11
FNC30-FNC39
Rotation and
Shift
16.7
Outline
1. Instruction format
FNC 88
PID
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
PID
Operation Condition
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
16-bit binary
SS12
16-bit binary
16-bit binary
16-bit binary
SD
1
14
FMC60-FNC69
Handy
Instruction
SS11
S3
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
15
Others
Special
Unit
3 3
SS12
3 3
SS23
3 3
SD1
3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
16
FNC80-FNC89
External FX
Device
SS11
Index
17
S1
S2
S3
18
FNC110-FNC139
Floating Point
FNC 88
PID
FNC100-FNC109
Data
Transfer 2
When the target value S1 , measured value S2 , and parameters S3 to S3 +6 are set and a
program is executed, the operation result (MV) is stored to the output value D at every sampling time
S3 .
Command
input
FNC70-FNC79
External FX I/O
Device
Operand
Type
12
FNC40-FNC49
Data Operation
This instruction executes PID control which changes the output value according to the input variation.
For details, refer to the Analog Control Edition.
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
457
2. Set items
Set item
Number of
occupied
points
Description
S1
Target value
(SV)
S2
Measured
value (PV)
S3
Parameter*1
S3 .
Output value
(MV)
*1.
S3
to
Set item
S3 +1
S3 .
25
20
When auto tuning is not used, the number of points is the same as the number in the step
response method are occupied.
3. List of parameters
S3
S3 .
29
S3
+28
Setting Value
Remarks
1 to 32767 (ms)
bit0
0: Forward operation,
1: Backward operation
Operation direction
bit1
bit2
0: Output variation alarm is invalid. Do not set to ON bit 2 and bit 5 at the same
1: Output variation alarm is valid.
time.
bit3
Operation
setting (ACT) bit4
Not available
0: Auto tuning is not executed.
1: Auto tuning is executed.
bit5
bit6
458
S3 +2
0 to 99 (%)
S3 +3
1 to 32767 (%)
S3 +4
S3 +5
0 to 100 (%)
S3 +6
0 to 32767 ( 10 ms)
11
Setting Value
Remarks
FNC30-FNC39
Rotation and
Shift
Set item
S3 +7
These devices are occupied for internal processing in PID control loop. Do not change the data.
S3 +19
Input variation
S3 +20*1 (incremental) alarm set
S3 +1
0 to 32767
S3 +1
Input variation
S3 +21*1 (decremental) alarm set
value
Output variation
(decremental) alarm set
value
bit2
bit3
to "1" in
(ACT).
16
17
S3 +26
S3 +27
S3 +28
*1.
S3 +1 for operation
18
FNC110-FNC139
Floating Point
PV value threshold
(hysteresis) width (SHPV)
FNC100-FNC109
Data
Transfer 2
The setting below is required when the limit cycle method is used (when bit 6 is set to "ON" in the operation setting (ACT)).
S3 +25
15
FNC80-FNC89
External FX
Device
bit1
14
FNC70-FNC79
External FX I/O
Device
bit0
13
FMC60-FNC69
Handy
Instruction
S3 +23*1
FNC50-FNC59
High Speed
Processing
S3
+22*1
Output variation
(incremental) alarm set
value
12
FNC40-FNC49
Data Operation
0 to 32767
value
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
459
Cautions
1. When using two or more PID instructions
Two or more PID instructions can be executed at the same time. (There is no limitation in the number of
loops.) However, make sure that S3 , D and other operands specified in each instruction are different
to each other.
S3
S3 .
D***
Initial pulse
Data register number in the latch area specified in
Error
When an operation error occurs, the special auxiliary relay M8067 turns ON, and the error code is stored in
the special data register D8067.
For the error code, refer to Section 37.4.
460
11
FNC30-FNC39
Rotation and
Shift
FNC No.
Mnemonic
100
101
102
ZPUSH
103
ZPOP
104
15
105
FNC70-FNC79
External FX I/O
Device
160
16
107
FNC80-FNC89
External FX
Device
Symbol
Function
Reference
12
FNC40-FNC49
Data Operation
FNC100 to FNC109 provide an instruction for executing complicated processing for fundamental applied
instructions and for executing special processing.
108
109
13
FNC50-FNC59
High Speed
Processing
ZPUSH D
Section
17.1
14
ZPOP D
Section
17.2
FMC60-FNC69
Handy
Instruction
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
461
17.1
Outline
This instruction temporarily batch-stores the present value of the index registers V0 to V7 and Z0 to Z7.
For restoring the present value of temporarily batch-stored index registers, use ZPOP (FNC103) instruction.
For ZPOP (FNC103) instruction, refer to Section 17.2.
1. Instruction format
FNC 102
ZPUSH P
Mnemonic
Operation Condition
3 steps ZPUSH
ZPUSHP
Continuous
Operation
Pulse (Single)
Operation
16-bit Instruction
32-bit Instruction
Mnemonic
Operation Condition
2. Set data
Operand Type
Description
Data Type
Head device number batch-storing the present value of the index registers V0 to
V7 and Z0 to Z7
D : Number of times of batch-storage
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3 3
FNC102
ZPUSH
1) The contents of the index registers V0 to V7 and Z0 to Z7 are batch-stored temporarily to D and later.
When the contents of index registers are batch-stored, the number of times of batch-storage D is
incremented by "1".
2) For restoring the batch-stored data, use ZPOP (FNC103) instruction.
Use ZPUSH (FNC102) and ZPOP (FNC103) instruction as a pair.
3) By specifying a same device to D , ZPUSH (FNC102) and ZPOP (FNC103) instructions can be used
in the nest structure.
In this case, the occupied points are added by "16" after D every time ZPUSH (FNC102) instruction is
executed. Secure in advance sufficient area for the number of the next structure.
462
11
D
and later.
Z7
V7
Z0
V0
Z1
V1
12
16 points
for 1
nesting
13
FNC50-FNC59
High Speed
Processing
+15
+16
+17
+18
+19
+20
...
batchstorage
D =1
*1
Z0
V0
Z1
V1
Z2
...
Z7
V7
+1
+2
+3
+4
+5
...
Z7
V7
[4] ZPOP
instruction
Number of times
of batch-storage
D :0
D +0
14
Instruction
Description
ZPOP(FNC103)
Restores the index registers V0 to V7 and Z0 to Z7 which were batch-stored temporarily by the
ZPUSH (FNC102) instruction.
FMC60-FNC69
Handy
Instruction
Related instruction
15
When not using the nest structure, clear the number of batch-storage times
ZPUSH (FNC102) instruction.
When using the nest structure, clear the number of batch-storage times
(FNC102) instruction the first time.
before executing
16
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
in ZPUSH (FNC102) instruction exceeds the corresponding
stores a negative value while the ZPUSH (FNC102)
17
FNC100-FNC109
Data
Transfer 2
FNC80-FNC89
External FX
Device
Errors
FNC70-FNC79
External FX I/O
Device
Cautions
FNC40-FNC49
Data Operation
Z2
...
...
[2] ZPOP
instruction
Number of times of
batch-storage
+15
D is
+16
decremented by
"1".
V1
Z2
V2
Batchstored data
...
...
Z7
V7
+4
+5
+6
...
Z2
V2
FNC30-FNC39
Rotation and
Shift
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
463
Program example
In the program shown below, the contents of the index registers Z0 to Z7 and V0 to V7 before execution of
subroutine program are batch-stored in D0 and later when index registers are used in the subroutine after the
pointer P0.
M8002
RST
D0
X005
FNC 12
MOVP
K5
V0
X005
FNC 12
MOVP
K10
V0
X000 V0
Y000
X000
Label
P0
FNC 01
CALL
P0
FNC 06
FEND
M8000
FNC102
ZPUSH
RUN monitor
D0
X006
FNC 12
MOVP
K5
V0
X006
FNC 12
MOVP
K10
V0
X030
T0
D100V0
M8000
FNC103
ZPOP
V0
FNC 02
SRET
END
464
11
FNC30-FNC39
Rotation and
Shift
17.2
Outline
1. Instruction format
FNC 103
ZPOP P
16-bit Instruction
Mnemonic
Operation Condition
32-bit Instruction
Operation Condition
13
FNC50-FNC59
High Speed
Processing
3 steps ZPOP
ZPOPP
Mnemonic
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Description
Data Type
Head device number temporarily batch-storing the contents of the index registers
V0 to V7 and Z0 to Z7
D : Number of times of batch-storage
16-bit binary
14
FMC60-FNC69
Handy
Instruction
Operand Type
3. Applicable devices
Word Devices
System User
Digit Specification
System User
15
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3 3
16
17
1) The contents of the index registers V0 to V7 and Z0 to Z7 which were batch-stored temporarily to D
and later are restored to the original index registers. When the contents of the index registers are
restored, the number of times of batch-storage D is decremented by "1".
18
FNC110-FNC139
Floating Point
Related instruction
Instruction
ZPUSH(FNC102)
FNC100-FNC109
Data
Transfer 2
FNC103
ZPOP
FNC80-FNC89
External FX
Device
Command
input
FNC70-FNC79
External FX I/O
Device
Operand
Type
Bit Devices
12
FNC40-FNC49
Data Operation
This instruction restores the contents of the index registers V0 to V7 and Z0 to Z8 which were batch-stored
temporarily by ZPUSH (FNC102) instruction.
For ZPUSH (FNC102) instruction, refer to Section 17.1
Description
Temporarily batch-stores the present value of the index registers V0 to V7 and Z0 to Z7.
19
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the number of times of batch-storage (D) stores "0" or a negative value while ZPOP (FNC103)
instruction is executed (error code: K6706)
465
20
FNC150-FNC159
Positioning
Control
Program example
FNC140-FNC149
Data
Operation 2
Errors
466
FNC No.
Mnemonic
Symbol
Function
Reference
110
ECMP
ECMP S1 S2 D
111
EZCP
EZCP S1 S2 S D
112
EMOV
EMOV S D
113
114
115
116
ESTR
117
EVAL
EVAL
118
EBCD
119
EBIN
120
EADD
121
Section
18.1
Section
18.2
Section
18.3
Section
18.4
Section
18.5
EBCD S D
Section
18.6
EBIN
Section
18.7
EADD S1 S2 D
Section
18.8
ESUB
ESUB S1 S2 D
Section
18.9
122
EMUL
EMUL S1 S2 D
Section
18.10
123
EDIV
EDIV S1 S2 D
Section
18.11
124
EXP
Section
18.12
125
LOGE
LOGE S D
Section
18.13
126
LOG10
LOG10
Section
18.14
127
ESQR
ESQR S D
Section
18.15
128
ENEG
ENEG D
Section
18.16
ESTR S1 S2 D
EXP
S D
S D
S D
S D
11
Symbol
Function
Reference
S D
Section
18.17
130
SIN
SIN
S D
Section
18.18
131
COS
COS
S D
Section
18.19
132
TAN
TAN
S D
Section
18.20
133
ASIN
ASIN
S D
Section
18.21
134
ACOS
ACOS S D
Section
18.22
135
ATAN
ATAN S D
Section
18.23
136
RAD
RAD
S D
Section
18.24
137
DEG
DEG
S D
Section
18.25
138
139
12
13
14
15
FNC70-FNC79
External FX I/O
Device
INT
FMC60-FNC69
Handy
Instruction
INT
FNC50-FNC59
High Speed
Processing
129
FNC40-FNC49
Data Operation
Mnemonic
FNC30-FNC39
Rotation and
Shift
FNC No.
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
467
18.1
Outline
This instruction compares two data (binary floating point), and outputs the result (larger, same or smaller) to
three single bit devices.
For handling of floating point, refer to Subsection 5.1.3.
1. Instruction format
FNC 110
ECMP P
Operation Condition
Operation Condition
13 steps DECMP
DECMPP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
*1.
Description
Data Type
S1
Real number
S2
(binary)*1
Head bit device number to which the comparison result is output (Three devices
are occupied.)
Bit
When a constant (K or H) is specified, it is automatically converted from binary into binary floating
point (real number) when the instruction is executed.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3
3 3
S2
3 3
3 3
3 3
""
468
11
Command
input
FNC110
DECMP
S1
S2
FNC30-FNC39
Rotation and
Shift
D +1
D +2
12
FNC40-FNC49
Data Operation
13
D to
14
Caution
FMC60-FNC69
Handy
Instruction
FNC50-FNC59
High Speed
Processing
Even if the command input turns OFF and DECMP instruction is not executed,
before the please rewrite this command input turned OFF.
+2).
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
469
18.2
Outline
This instruction compares data (binary floating point) with two values (one zone), and outputs the comparison
result to three single bit devices.
For handling of floating point, refer to Subsection 5.1.3.
1. Instruction format
FNC 111
EZCP P
Operation Condition
Operation Condition
17 steps DEZCP
DEZCPP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
*1.
Description
Data Type
S1
S2
Head bit device number to which the comparison result is output (Three devices
are occupied.)
Real number
(binary)*1
Bit
When a constant (K or H) is specified, it is automatically converted from binary into binary floating
point (real number) when the instruction is executed.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3
3 3
S2
3 3
3 3
3 3
3 3
3 3
470
Others
Special
Unit
""
11
Command
input
FNC 111
EDZCP
S2
], it is
13
D +1
FNC50-FNC59
High Speed
Processing
S1
+1,
12
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
D +2
14
D to
FMC60-FNC69
Handy
Instruction
Even if the command input turns OFF and DEZCP instruction is not executed,
before the command input turned OFF.
15
FNC70-FNC79
External FX I/O
Device
Cautions
1. Number of occupied devices
Three devices are occupied from D
( D , D +1 and D
Make sure that these devices are not used for any other purpose.
+1, S1
] and [ S2
+1, S2
16
Make sure that two comparison values have the following relationship:
[( S1 +1, S1 ] [ S2 +1, S2 ]
In the case of "[ S1 +1, S1 ] > [ S2 +1, S2 ]", the value [ S2 +1, S2
S1 ] value during comparison.
] is regarded as [ S1
+1,
FNC80-FNC89
External FX
Device
2. Comparison values [ S1
+2).
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
471
18.3
Outline
This instruction transfers binary floating point data.
For handling of floating point, refer to Subsection 5.1.3.
1. Instruction format
FNC 112
EMOV P
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DEMOV
DEMOVP
2. Set data
Operand Type
Description
Data Type
Binary floating point data (transfer source) or device number storing data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC112
DEMOV
S +1
+1,
] are transferred to [ D
D +1
+1,
Transfer
4.23542
4.23542
Program examples
1. In the program example shown below, a real number stored in D11 and D10 is transferred to
D1 and D0 when X007 turns ON
X007
FNC112
DEMOVP
D10
D0
D11
D10
D1
36.475
D0
36.475
END
2. In the program shown below, a real number "-1.23" is transferred to D11 and D10 when X007
turns ON
X007
FNC112
DEMOVP
E1.23
D10
END
472
D11
1.23
D10
1.23
11
FNC30-FNC39
Rotation and
Shift
18.4
Outline
13
1. Instruction format
16-bit Instruction Mnemonic
Operation Condition
Operation Condition
13 steps DESTR
DESTRP
Continuous
Operation
Pulse (Single)
Operation
14
Operand Type
Description
Data Type
S1
S2
16-bit binary
Character string
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S2
Index
Z Modify K H
3 3
3 3 3 3
3 3 3 3
""
17
S2
The data after conversion varies depending on the display specification stored in S2
S2 +1
S2 +2
0: Decimal point
format
1: Exponent
format
Total number of
digits
Number of digits
of decimal part
19
FNC140-FNC149
Data
Operation 2
S2
18
FNC110-FNC139
Floating Point
FNC116
DESTR
FNC100-FNC109
Data
Transfer 2
Command
input
16
FNC80-FNC89
External FX
Device
S1
ConReal
CharacPointer
stant Number ter String
15
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
FMC60-FNC69
Handy
Instruction
2. Set data
Operand
Type
FNC50-FNC59
High Speed
Processing
FNC 116
D ESTR P
12
FNC40-FNC49
Data Operation
This instruction converts binary floating point data into a character string (ASCII codes) having a specified
number of digits.
On the other hand, STR (FNC200) instruction converts binary data into a character string (ASCII codes).
For a character string, refer to Section 5.3.
For handling of floating point, refer to Subsection 5.1.3.
For STR (FNC200) instruction, refer to Section 26.1.
20
FNC150-FNC159
Positioning
Control
473
S2
S2 +1
S2 +2
b15
S1
b0
D +1
D +2
D +3
Sign
S1 +1
b8 b7
0000H
D +4
Binary floating point
(real number)
The total number of digits which can be specified by S2 +1 is as follows (24 digits maximum):
When the number of digits of the decimal part is "0", Total number of digits 2
When the number of digits of the decimal part is any value other than "0", Total number of digits (Number
of digits of decimal part + 3)
The number of digits of the decimal part which can be specified by S2 +2 is from 0 to 7.
However, the following must be satisfied, "Number of digits of decimal part (Total number of digits - 3)"
For example, when the total number of digits is "8", the number of digits of the decimal part is "3", and
"-1.23456" is specified, data is stored in D and later as shown below:
S2
S2 +1
S2 +2
Total
number
of digits
Number of
digits of
decimal part
b15
2 3 5
Sign
S1 +1
2DH(-)
D +1
31H(1)
20H(space)
D +2
32H(2)
2EH(.)
D +3
35H(5)
33H(3)
0000H
D +4
S1
b0
20H(space)
D
1
b8 b7
1.23456
0000H is automatically stored at the end of the
character string.
S2
S2 +1
8 (Total number of
digits)
S2 +2
2 (Number of digits
of decimal part)
S1 +1
S1
1.23456
474
Total
number of
digits
2 3 4 5 6
Low-order
digits of
decimal part
Rounded.
11
0: Decimal point
format
S2
8 (Total number of
digits)
S2 +2
2 (Number of digits
of decimal part)
S1 +1
Total
number of
digits
12
FNC40-FNC49
Data Operation
S2 +1
FNC30-FNC39
Rotation and
Shift
- When the number of digits of the decimal part is set to any value other than "0", "2EH (.)" is
automatically stored in "specified number of digits of decimal part + 1"th digit.
When the number of digits of the decimal part is "0", "2EH (.)" is not stored.
2 3
Low-order digits of decimal
part
S1
Automatically added.
1.23456
S2 +1
S2 +2
S1 +1
Total
number of
digits
14
2 3
FMC60-FNC69
Handy
Instruction
S2
S1
1.23456
15
- "00H" or "0000H" is automatically stored at the end of the converted character string.
b8 b7
b15
b0
S2 +1
Total number of
digits
Number of digits
of decimal part
D +1
D +2
D +3
D +4
45H(E)
D +5
E
Sign (integer part)
S1 +1
S1
Automatically
added.
D +6
0000H
16
17
FNC100-FNC109
Data
Transfer 2
Exponent format
FNC80-FNC89
External FX
Device
S2
FNC70-FNC79
External FX I/O
Device
S2 +2
13
FNC50-FNC59
High Speed
Processing
- When the total number of digits subtracted by the digits for sign, decimal point and decimal part is larger
than the integer part of the binary floating point data, "20H (space)" is stored between the sign and the
integer part.
18
19
FNC140-FNC149
Data
Operation 2
The total number of digits which can be specified by S2 +1 is as follows (24 digits maximum):
When the number of digits of the decimal part is "0" Total number of digits 6
When the number of digits of the decimal part is any value other than "0" Total number of digits (Number
of digits of decimal part + 7)
FNC110-FNC139
Floating Point
20
FNC150-FNC159
Positioning
Control
475
The number of digits of the decimal part which can be specified by S2 +2 is from 0 to 7.
However, the following must be satisfied, "Number of digits of decimal part (Total number of digits - 7)"
For example, when the total number of digits is "12", the number of digits of the decimal part is "4", and
"-12.34567" is specified, data is stored in D
and later as shown below:
S2
S2 +1
12
S2 +2
Total number
of digits
b15
2 3 4 6E+ 0 1
Fixed to 2 digits
S1 +1
S1
2DH(-)
D +1
2EH(.)
31H(1)
D +2
33H(3)
32H(2)
D +3
36H(6)
34H(4)
D +4
2BH(+)
45H(E)
D +5
31H(1)
30H(0)
0000H
D +6
12.34567
b0
20H space
Number of
digits of
decimal
part
b8 b7
S2
S2 +1
12
Fixed to 1 digit
S2 +2
S1 +1
2 3 4 6E+ 0 1
"20H (space)" is stored.
S1
12.34567
- If the decimal part of the binary floating point data cannot be accommodated in the number of digits of
the decimal part, low-order digits of the decimal part are rounded.
S2
S2 +1
12
S2 +2
S1 +1
S1
2 3 4 6 6 7E+ 0 1
Number of digits of
decimal part (4)
Cut by rounding.
12.34567
- When the number of digits of the decimal part is set to any value other than "0", "2EH (.)" is
automatically stored in "specified number of digits of decimal part + 1"th digit.
When the number of digits of the decimal part is "0", "2EH (.)" is not stored.
S2
S2 +1
12
S2 +2
S1 +1
S1
12.34567
2 3 4 6E+ 0 1
Number of digits of
decimal part (4)
Automatically added.
- For the sign of the exponent part, "2BH (+)" is stored when the exponent is positive, and "2DH (-)" is
stored when the exponent is negative.
476
11
S2
S2 +1
12
S2 +2
Fixed to 2 digits.
1
12
2 3 4 6E+ 0 1
FNC40-FNC49
Data Operation
S1 +1
FNC30-FNC39
Rotation and
Shift
S1
12.34567
- "00H" or "0000H" is automatically stored at the end of the converted character string.
13
Instruction
EVAL (FNC117)
FNC50-FNC59
High Speed
Processing
Related instructions
Description
Converts a character string (ASCII codes) into binary floating point data.
STR (FNC200)
VAL (FNC201)
14
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
15
18
FNC110-FNC139
Floating Point
17
FNC100-FNC109
Data
Transfer 2
When the number of digits of the decimal part specified by S2 +2 is not located within the following
range (error code: K6706)
In the case of decimal point format: Number of digits of decimal part (Total number of digits - 3)
In the case of exponent format: Number of digits of decimal part (Total number of digits - 7)
16
FNC80-FNC89
External FX
Device
When the total number of digits specified by S2 +1 is not located within the following range (error code:
K6706)
In the case of decimal point format:
When the number of digits of the decimal part is "0", Total number of digits 2
When the number of digits of the decimal part is any value other than "0", Total number of digits
(Number of digits of decimal part + 3)
In the case of exponent format:
When the number of digits of the decimal part is "0", Total number of digits 6
When the number of digits of the decimal part is any value other than "0", Total number of digits
(Number of digits of decimal part + 7)
FNC70-FNC79
External FX I/O
Device
When S1 is not located within the following range (error code: K6706)
0, 2126 S1 < 2128
When the format specified by S2
FMC60-FNC69
Handy
Instruction
Errors
When the conversion result exceeds the specified total number of digits (error code: K6706)
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
477
Program examples
1) In the program example shown below, the contents (binary floating point data) of R0 and R1 are
converted according to the contents specified by R10 to R12, and then stored to D0 and later when X000
turns ON
X000
FNC116
DESTRP
R0
R10
D0
END
R10
R11
R12
Conversion
format
Total number
of digits
Number of digits
of decimal part
b15
Total number
of digits
0
Space
R0
R1
0.0327457
0 3 3
Number of
digits of
decimal part
b8 b7
b0
D0
20H(space)
20H(space)
D1
2EH(.)
30H(0)
D2
33H(3)
30H(0)
D3
00H
33H(3)
2) In the program shown below, the contents (binary floating point data) of R0 and R1 are converted
according to the contents specified by R10 to R12, and then stored to D10 and later when X000 turns ON
X000
FNC116
DESTRP
R0
R10
D10
END
R10
1 (exponent
format)
R11
12
R12
Conversion
format
Total number
of digits
Number of digits
of decimal part
R1
R0
0.0327457
Total number
of digits
3
Space
2 7 4 6E
0 2
Number of digits
of decimal part
b15
b8 b7
b0
D10
20H(space)
20H(space)
D11
2EH(.)
33H(3)
D12
37H(7)
32H(2)
D13
36H(6)
34H(4)
D14
2DH(-)
45H(E)
D15
32H(2)
30H(0)
D16
0000H
0000H is automatically stored at the
end of the character string.
478
11
FNC30-FNC39
Rotation and
Shift
18.5
Outline
1. Instruction format
16-bit Instruction Mnemonic
Operation Condition
13
Operation Condition
9 steps DEVAL
DEVALP
Continuous
Operation
Pulse (Single)
Operation
FNC50-FNC59
High Speed
Processing
FNC 117
D EVAL
P
14
2. Set data
Description
Data Type
Head device number storing character string data to be converted into binary
floating point data
Character string
15
3. Applicable devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
""
16
FNC80-FNC89
External FX
Device
3 3 3 3
FNC117
DEVAL
+1,
b8 b7
b0
S +1
S +2
S +4
19
FNC140-FNC149
Data
Operation 2
S +3
D +1
18
FNC110-FNC139
Floating Point
A specified character string may be in the decimal point format or exponent format. A character string in
either format can be converted into binary floating point data.
b15
17
FNC100-FNC109
Data
Transfer 2
FNC70-FNC79
External FX I/O
Device
Bit Devices
Command
input
FMC60-FNC69
Handy
Instruction
Operand Type
Operand
Type
12
FNC40-FNC49
Data Operation
This instruction converts a character string (ASCII codes) into binary floating point data.
On the other hand, the VAL (FNC201) instruction converts a character string (ASCII codes) into binary data.
For a character string, refer to Section 5.3.
For handling of floating point, refer to Subsection 5.1.3.
For VAL (FNC201) instruction, refer to Subsection 26.2.
00H
20
FNC150-FNC159
Positioning
Control
479
b8 b7
b0
31H(1)
2DH(-)
S +1
30H(0)
2EH(.)
S +2
38H(8)
37H(7)
S +3
32H(2)
31H(1)
S +4
D +1
1.07812
Binary floating point
(real number)
00H
1
0 7 8 1 2
b8 b7
b0
20H(space)
2DH(-)
S +1
2EH(.)
31H(1)
S +2
32H(2)
33H(3)
S +3
31H(1)
30H(0)
S +4
2BH(+)
45H(E)
S +5
30H(0)
31H(1)
S +6
D +1
1.3201E+10
Binary floating point
(real number)
00H
1
3 2 0 1E+ 1 0
b8 b7
b0
20H(space)
2DH(-)
S +1
31H(1)
20H(space)
S +2
33H(3)
2EH(.)
S +3
31H(1)
30H(0)
S +4
36H(6)
35H(5)
S +5
31H(1)
38H(8)
S +6
00H
32H(2)
3 0 1 5 6 8 1 2
Rounded.
480
D +1
1.30156
Up to 6 digits are securely
equivalent.
Binary floating point
(real number)
11
b15
b8 b7
b0
S +1
2EH(.)
31H(1)
S +2
35H(5)
33H(3)
S +3
33H(3)
30H(0)
S +4
31H(1)
34H(4)
S +5
45H(E)
32H(2)
S +6
30H(0)
2DH(-)
00H
32H(2)
3 5 0 3 4 1 2E
D +1
12
1.35034E2
Up to 6 digits are
securely equivalent.
Binary floating point
(real number)
13
FNC50-FNC59
High Speed
Processing
2DH(-)
FNC40-FNC49
Data Operation
20H(.)
FNC30-FNC39
Rotation and
Shift
0 2
Rounded.
b15
b8 b7
b0
2DH(-)
S +1
31H(1)
30H(0)
S +2
32H(2)
2EH(.)
S +3
31H(1)
33H(3)
00H
S +4
0 1
D +1
15
FNC70-FNC79
External FX I/O
Device
20H(space)
1.231
Binary floating point
(real number)
16
2 3 1
When "30H (0)" exists between a number and "E" in a character string in the exponent format, "30H" is
ignored during conversion.
b8 b7
17
b0
2EH(.)
31H(1)
34H(4)
30H(0)
33H(3)
35H(5)
2BH(+)
45H(E)
33H(3)
30H(0)
D +1
1.0453E+3
18
FNC110-FNC139
Floating Point
2DH(-)
FNC100-FNC109
Data
Transfer 2
20H(space)
00H
1
FNC80-FNC89
External FX
Device
Ignored.
b15
14
FMC60-FNC69
Handy
Instruction
When "20H (space)" or "30H (0)" exists between numbers except the first "0" in a character string specified
by S , "20H" or "30H" is ignored during conversion.
0 4 5 3E+ 0 3
19
FNC140-FNC149
Data
Operation 2
Ignored.
20
FNC150-FNC159
Positioning
Control
481
Related devices
For the use methods of the zero, borrow and carry flags, refer to Subsection 6.5.2.
Description
Device
Name
M8020
Zero flag
M8021
Borrow flag
M8022
Carry flag
Condition
Operation
Related instructions
Instruction
Description
ESTR (FNC116)
Converts binary floating point data into a character string (ASCII codes).
STR (FNC200)
VAL (FNC201)
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When any character other than "30H (0)" to "39H (9)" exists in the integer part or decimal part (error code:
K6706)
When "2EH (.)" exists in two or more positions in a character string specified by
When any character other than "45H (E)", "2BH (+)" or "2DH (-)" exists in the exponent part, or when two or
more exponent parts exist (error code: K6706)
When "00H" does not exist in the corresponding device range starting from
When the number of characters after
Program examples
1) In the program example shown below, a character string stored in R0 and later is converted into binary
floating point, and stored to D0 and D1 when X000 turns ON
X000
FNC117
DEVALP
R0
D0
END
b15
b8 b7
R0
20H(space)
2DH(-)
R1
31H(1)
30H(0)
R2
32H(2)
2EH(.)
R3
34H(4)
33H(3)
R4
32H(2)
35H(5)
R5
00H
31H(1)
0 1
Ignored.
482
b0
2 3 4 5 2 1
Rounded.
D0
D1
1.23452
X000
FNC117
DEVALP
D10
D100
END
12
b8 b7
FNC40-FNC49
Data Operation
b15
b0
20H(space)
20H(space)
D11
2EH(.)
31H(1)
D12
33H(3)
32H(2)
D13
35H(5)
34H(4)
D14
2DH(-)
45H(E)
D15
32H(2)
30H(0)
13
D100
D101
1.2345E2
FNC50-FNC59
High Speed
Processing
D10
14
00H
D16
2 3 4 5E
Ignored.
FMC60-FNC69
Handy
Instruction
0 2
Rounded.
"2
126
".
128
".
The value of D
is the minimum value (2126) of 32-bit real numbers and the borrow
flag M8021 turns ON.
The value of D
is the maximum value (2128) of 32-bit real numbers and the carry
flag M8022 turns ON.
16
FNC80-FNC89
External FX
Device
15
Operation
FNC70-FNC79
External FX I/O
Device
Condition
The absolute value of the
conversion result is less than
11
FNC30-FNC39
Rotation and
Shift
2) In the program shown below, a character string stored in D10 and later is converted into binary floating
point, and stored to D100 and D101 when X000 turns ON
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
483
18.6
Outline
This instruction converts binary floating point into scientific notation.
For handling of floating point, refer to Subsection 5.1.3.
1. Instruction format
FNC 118
D EBCD P
Operation Condition
Operation Condition
9 steps DEBCD
DEBCDP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Real number
(decimal)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC118
DEBCD
+1,
[ S +1,
S ] [ D +1,
D ]
Scientific notation
High order
Before
execution
Low order
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
S +1
S
After execution
High order
After
execution
Low order
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Exponent part
Mantissa part
D +1
484
10
D +1
11
12
FNC40-FNC49
Data Operation
FNC30-FNC39
Rotation and
Shift
Caution
13
FNC50-FNC59
High Speed
Processing
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
485
18.7
Outline
This instruction converts scientific notation stored in devices into binary floating point.
For handling of floating point, refer to Subsection 5.1.3.
1. Instruction format
FNC 119
P
EBIN
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DEBIN
DEBINP
2. Set data
Operand Type
Description
Data Type
Real number
(decimal)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC119
DEBIN
+1,
[ S +1,
S ] [ D +1,
Scientific notation
D ]
High order
Before
execution
Low order
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Exponent part
Mantissa part
S +1
10
S +1
After execution
High order
After
execution
Low order
b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Sign (1 bit)
D +1
486
11
By DEBIN instruction, a numeric value containing the decimal point can be directly converted into binary
floating point.
Example: Converting "3.14" into binary floating point
3.14 = 314 102 (scientific notation)
K314
D0
K314 D0
FNC 12
MOVP
K -2
D1
K -2 D1
FNC119
DEBIN
D0
D 10
[D1]
314 102
[D0]
13
(D1,D0) (D11,D10)
314 102 Binary floating point
FNC50-FNC59
High Speed
Processing
FNC 12
MOVP
12
FNC40-FNC49
Data Operation
X002
FNC30-FNC39
Rotation and
Shift
Program example
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
487
18.8
Outline
This instruction executes addition of two binary floating point data.
For program examples of floating point operations, refer to Section 12.10.
For handling of floating point, refer to Subsection 5.1.3.
For flag operations, refer to Subsection 6.5.2.
1. Instruction format
FNC 120
EADD P
Operation Condition
Operation Condition
13 steps DEADD
DEADDP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
*1.
Description
Data Type
S1
Word device number storing binary floating point data used in addition
S2
Word device number storing binary floating point data used in addition
Real number
(binary)*1
When a constant (K or H) is specified, it is automatically converted into binary floating point (real
number) when the instruction is executed.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3
3 3
S2
3 3
3 3
3 3
""
FNC120
DEADD
S1
S2
Command
input
FNC120
DEADD
S1
S2
], and the
+1, S1
+1, S1
] or [ S2
+1, S2
[ S1 +1, S1 ] + [
Binary floating point
], it is automatically converted
K2346
] [ D +1, D ]
Automatically
converted into binary
floating point
Caution
1. When a same device is specified
The same device number can be specified in [ S1 +1, S1 ],[ S2 +1, S2 ] and [ D +1, D ].
In this case, note that the addition result changes in every operation cycle when the continuous operation
type instruction (DEADD) is used.
488
11
FNC30-FNC39
Rotation and
Shift
18.9
Outline
1. Instruction format
16-bit Instruction Mnemonic
Operation Condition
Operation Condition
13 steps DESUB
DESUBP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
14
Data Type
S1
Word device number storing binary floating point data used in subtraction
S2
Word device number storing binary floating point data used in subtraction
FMC60-FNC69
Handy
Instruction
*1.
Description
Real number
(binary)*1
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
3 3
17
S2
Command
input
S1
S2
+1, S1
] or [ S2
+1, S2
[ S1 +1, S1 ] [
Binary floating point
], it is automatically converted
K2346
] [ D +1, D ]
Automatically
converted into binary
floating point
Caution
19
FNC140-FNC149
Data
Operation 2
FNC121
DESUB
18
], and
FNC110-FNC139
Floating Point
FNC121
DESUB
+1, S1
FNC100-FNC109
Data
Transfer 2
Command
input
16
FNC80-FNC89
External FX
Device
S1
""
15
FNC70-FNC79
External FX I/O
Device
When a constant (K or H) is specified, it is automatically converted into binary floating point (real
number) when the instruction is executed.
3. Applicable devices
Operand
Type
13
FNC50-FNC59
High Speed
Processing
FNC 121
ESUB P
12
FNC40-FNC49
Data Operation
20
489
FNC150-FNC159
Positioning
Control
A same device number can be specified in [ S1 +1, S1 ],[ S2 +1, S2 ] and [ D +1, D ].
In this case, note that the subtraction result changes in every operation cycle when the continuous operation
type instruction (DESUB) is used.
1. Instruction format
FNC 122
EMUL P
Operation Condition
Operation Condition
13 steps DEMUL
DEMULP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
*1.
Description
Data Type
S1
Word device number storing binary floating point data used in multiplication
S2
Word device number storing binary floating point data used in multiplication
Real number
(binary)*1
When a constant (K or H) is specified, it is automatically converted into binary floating point (real
number) when the instruction is executed.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3
3 3
S2
3 3
3 3
3 3
""
FNC122
DEMUL
S1
S2
Command
input
490
FNC122
DEMUL
S2
], and
+1, S1
] or [ S2
+1, S2
[ S1 +1, S1 ] [
Binary floating point
], it is automatically converted
K100
] [ D +1, D ]
Automatically
converted into binary
floating point
11
FNC30-FNC39
Rotation and
Shift
1. Instruction format
16-bit Instruction Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DEDIV
DEDIVP
2. Set data
Operand Type
14
Data Type
S1
Word device number storing binary floating point data used in division
S2
Word device number storing binary floating point data used in division
FMC60-FNC69
Handy
Instruction
*1.
Description
Real number
(binary)*1
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
3 3
17
S2
Divisor
+1, S1
] or [ S2
+1, S2
Dividend
S1
K100
], it is automatically converted
19
Divisor
[ S1 +1, S1 ] [
Binary floating point
K100
Automatically
converted into binary
floating point
18
] [ D +1, D ]
Binary floating point
FNC140-FNC149
Data
Operation 2
Command
input
], and the
FNC110-FNC139
Floating Point
DEDIV
Dividend
+1, S2
FNC100-FNC109
Data
Transfer 2
Command
input
FNC123
16
FNC80-FNC89
External FX
Device
S1
""
15
FNC70-FNC79
External FX I/O
Device
When a constant (K or H) is specified, it is automatically converted into binary floating point (real
number) when the instruction is executed.
3. Applicable devices
Operand
Type
13
FNC50-FNC59
High Speed
Processing
FNC 123
P
EDIV
12
FNC40-FNC49
Data Operation
20
FNC150-FNC159
Positioning
Control
491
1. Instruction format
FNC 124
P
EXP
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DEXP
DEXPP
2. Set data
Operand Type
S
D
Description
Data Type
Head device number storing binary floating point data used in exponential
operation.
Real number (binary)
Head device number storing the operation result.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC124
DEXP
+1,
].
D +1
Error
An operation error occurs in the following case; The error flag M8067 turns ON, and the error code is stored in
D8067.
When the operation result is outside the following range (error code: K6706)
2126 | Operation result | < 2128
492
11
In the program example shown below, the exponential operation is executed for a value set in the 2-digit BCD
format in X020 to X027, and the operation result is stored in the binary floating point format to D0 and D1
when X000 turns ON.
X000
FNC224
LD >
D20
M0
K2X20
K88
D20
M0
D20
D10
FNC124
DEXP
D10
D0
END
14
1 3
BCD value
BIN
FLT
D11
D10
[3]
Exponential
operation
13
Binary floating point
(real number) value
EXP
D1
D0
442413.4
Binary floating point
(real number) value
1) The operation result becomes less than "2128" when the BCD value set in X020 to X027 is "88" or less
because of "loge2128 = 88.7".
If a value "89" or more is set, an operation error occurs. To prevent this operation error, when a value
more than "89" is set, M0 is set to ON so that the exponential operation is not executed.
17
X
0.4342945
FNC100-FNC109
Data
Transfer 2
10X=
16
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
Points
FMC60-FNC69
Handy
Instruction
13
FNC50-FNC59
High Speed
Processing
FNC 49
FLT
12
FNC40-FNC49
Data Operation
FNC 19
BIN
FNC30-FNC39
Rotation and
Shift
Program example
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
493
1. Instruction format
FNC 125
LOGE P
Operation Condition
Operation Condition
9 steps DLOGE
DLOGEP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
S
D
Description
Data Type
Head device number storing binary floating point data used in the natural
logarithm operation
Real number (binary)
Head device number storing the operation result
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC125
DLOGE
S +1
D +1
loge
Binary floating point
(real number)
+1,
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a negative value is specified in
When "0" is specified in
494
11
In the program example shown below, natural logarithm of "10" set in D50 is calculated, and stored to D30
and D31 when X000 turns ON.
X000
K10
D50
FNC 49
FLT
D50
D40
FNC125
DLOGE
D40
D30
13
END
10
MOV
FLT
D41
D40
[3] Logarithm
operation
10
Binary floating point
(real number) value
LOGE
FNC50-FNC59
High Speed
Processing
[1]
12
FNC40-FNC49
Data Operation
FNC 12
MOV
FNC30-FNC39
Rotation and
Shift
Program example
D31
D30
2.302585
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
495
1. Instruction format
FNC 126
LOG10 P
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DLOG10
DLOG10P
2. Set data
Operand Type
S
D
Description
Data Type
Head device number storing binary floating point data used in the common
logarithm operation
Real number (binary)
Head device number storing the operation result
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC126
DLOG10
S +1
D +1
log10
Binary floating point
(real number)
+1,
Errors
An operation error occurs in the following cases; The error flag M8067 turns ON, and the error code is stored
in D8067.
When a negative value is specified in
When "0" is specified in
496
11
In the program example shown below, common logarithm of "15" set in D50 is calculated, and stored to D30
and D31 when X000 turns ON.
X000
K15
D50
FNC 49
FLT
D50
D40
FNC126
DLOG10
D40
D30
13
END
10
MOV
FLT
D41
D40
[3] Logarithm
operation
15
Binary floating point
(real number) value
DLOG10
FNC50-FNC59
High Speed
Processing
[1]
12
FNC40-FNC49
Data Operation
FNC 12
MOV
FNC30-FNC39
Rotation and
Shift
Program example
D31
D30
1.176091
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
497
1. Instruction format
FNC 127
ESQR P
Operation Condition
Operation Condition
9 steps DESQR
DESQRP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
*1.
Description
Data Type
Word device number storing binary floating point data whose square root is
calculated
Real number
Data register number storing the square root of binary floating point data
(binary)*1
When a constant (K or H) is specified, it is automatically converted into binary floating point (real
number) when the instruction is executed.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
3 3
""
DESQR
] is calculated (in the binary floating point operation), and the result is
[ S +1, S ] [ D +1, D ]
Binary floating point
Related device
For the zero flag use method, refer to Subsection 6.5.2.
Device
Name
M8020
Zero flag
Description
Turns ON when the operation result is true "0".
Error
The contents of [ S1 +1, S1 ] are valid only when a positive value is set. When a negative value is set,
the operation error flag M8067 turns ON, and the instruction is not executed.
498
11
FNC30-FNC39
Rotation and
Shift
1. Instruction format
FNC 128
ENEG P
Operation Condition
Operation Condition
5 steps DENEG
DENEGP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Head device number storing binary floating data whose sign is to be inverted
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
""
Command
input
FNC128
DENEG
+1,
17
In the program example shown below, the sign of floating point data stored in D100 and D101 is inverted, and
the negation result is stored to D100 and D101 when X000 turns ON.
FNC128
DENEGP
D100
18
D100
1.2345
D101
FNC110-FNC139
Floating Point
END
D101
FNC100-FNC109
Data
Transfer 2
Program example
X000
16
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
3 3
ConReal
CharacPointer
stant Number ter String
14
FMC60-FNC69
Handy
Instruction
3. Applicable devices
13
FNC50-FNC59
High Speed
Processing
12
FNC40-FNC49
Data Operation
This instruction inverts the sign of binary floating point (real number) data.
For handling of floating point, refer to Subsection 5.1.3.
D100
1.2345
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
499
1. Instruction format
FNC 129
P
INT
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
INT
INTP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DINT
DINTP
2. Set data
Operand Type
Description
Data Type
Data register number storing binary floating point data to be converted into a
Real number (binary)
binary integer
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC129
INT
+1,
D
16-bit binary integer
The decimal part is cut.
FNC129
DINT
+1,
S +1, S
Binary floating
point
D +1, D
32-bit binary integer
The decimal part is cut.
500
11
For the methods of zero, borrow and carry flags, refer to Subsection 6.5.2.
Device
Name
M8020
Zero flag
M8021
Borrow flag
Carry flag
Caution
12
FNC40-FNC49
Data Operation
M8022
Description
Turns ON when the operation result is 0
FNC30-FNC39
Rotation and
Shift
Related devices
13
FNC50-FNC59
High Speed
Processing
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
501
1. Instruction format
FNC 130
P
SIN
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DSIN
DSINP
2. Set data
Operand Type
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
502
FNC130
DSIN
+1,
S +1
D +1
Sine value
Binary floating point
11
X001
X002
RUN
monitor
K 45
D 0
(K45) (D 0)
FNC 12
MOVP
K 90
D 0
(K90) (D 0)
FNC 49
FLTP
D0
D 4
FNC123
DEDIV
FNC130
DSIN
D 4
D 20
D 30
D100
D 30
D 20
12
13
FNC50-FNC59
High Speed
Processing
FNC122
DEMUL
K31415926 K1800000000
FNC40-FNC49
Data Operation
M8000
FNC 12
MOVP
FNC30-FNC39
Rotation and
Shift
Program example
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
503
1. Instruction format
FNC 131
P
COS
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DCOS
DCOSP
2. Set data
Operand Type
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
DCOS
504
+1,
S +1
D +1
Cosine value
Binary floating point
11
FNC30-FNC39
Rotation and
Shift
1. Instruction format
FNC 132
P
TAN
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DTAN
DTANP
FNC50-FNC59
High Speed
Processing
14
Description
Device number storing an angle (in radians) in binary floating point
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
16
17
S +1
D +1
Tangent value
Binary floating point
18
FNC110-FNC139
Floating Point
FNC100-FNC109
Data
Transfer 2
FNC132
DTAN
+1,
FNC80-FNC89
External FX
Device
Command
input
15
FNC70-FNC79
External FX I/O
Device
13
Data Type
2. Set data
Operand Type
12
FNC40-FNC49
Data Operation
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
505
1. Instruction format
FNC 133
D
P
ASIN
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DASIN
DASINP
2. Set data
Operand Type
Description
Data Type
Head device number storing a sine value used in the SIN1 (arc sine) operation.
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC133
DASIN
S +1
+1,
], and stored to [ D
+1,
].
D
D +1
SIN1
Binary floating point
(real number)
+1,
The angle (operation result) stored in [ D +1, D ] is expressed in radians (from /2 to /2).
For conversion between radians and degrees, refer to RAD (FNC136) and DEG (FNC137) instructions.
For RAD (FNC136) instruction, refer to Section 18.24.
For DEG (FNC137) instruction, refer to Section 18.25.
Error
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a value specified in
506
11
In the program example shown below, the SIN1 value of data (binary floating point) stored in D0 and D1 is
calculated, and the angle is output in 4-digit BCD to Y040 to Y057 when X000 turns ON.
X000
FNC133
DASIN
D0
D10
FNC137
DDEG
D10
D20
FNC129
INT
D20
D30
FNC 18
BCD
D30
K4Y40
12
30
Binary floating point
(real number) value
INT
D11
D10
0.5235988
Binary floating point
(real number) value
[2] Conversion into degrees
DDEG
D30
b15
b0
30
Binary
value
[4] BCD
operation
BCD
15
FNC70-FNC79
External FX I/O
Device
D20
[3]
Conversion
into binary
FMC60-FNC69
Handy
Instruction
D21
DASIN
FNC50-FNC59
High Speed
Processing
D0
0.5
Binary floating point
(real number) value
13
14
D1
FNC40-FNC49
Data Operation
END
[1]
Conversion
by SIN1
operation
FNC30-FNC39
Rotation and
Shift
Program example
Y057 Y040
0 0 3 0
BCD
value
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
507
1. Instruction format
FNC 134
D ACOS P
Operation Condition
Operation Condition
9 steps DACOS
DACOSP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Head device number storing a cosine value used in the COS1 (arc cosine)
operation
Real number (binary)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC134
DACOS
S +1
+1,
], and stored to [ D
+1,
].
D
D +1
COS
+1,
Error
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a value specified in
508
11
In the program example shown below, the COS1 value of data (binary floating point) stored in D0 and D1 is
calculated, and the angle is output in 4-digit BCD to Y040 to Y057 when X000 turns ON.
X000
FNC134
DACOS
D0
D10
FNC137
DDEG
D10
D20
FNC129
INT
D20
D30
FNC 18
BCD
D30
K4Y40
12
60
Binary floating point
(real number) value
INT
D11
D10
1.047198
Binary floating point
(real number) value
[2] Conversion into degrees
DDEG
D30
b15
b0
60
Binary
value
[4] BCD
operation
BCD
15
FNC70-FNC79
External FX I/O
Device
D20
[3]
Conversion
into binary
FMC60-FNC69
Handy
Instruction
D21
DACOS
FNC50-FNC59
High Speed
Processing
D0
0.5
Binary floating point
(real number) value
13
14
D1
FNC40-FNC49
Data Operation
END
[1]
Conversion
by COS1
operation
FNC30-FNC39
Rotation and
Shift
Program example
Y057 Y040
0 0 6 0
BCD
value
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
509
1. Instruction format
FNC 135
D ATAN P
Operation Condition
Operation Condition
9 steps DATAN
DATANP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Head device number storing a tangent value used in the TAN1 (arc tangent)
operation
Real number (binary)
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
FNC135
DATAN
S +1
TAN
S
S
+1,
], and stored to [ D
+1,
].
D
D +1
The angle (operation result) stored in [ D +1, D ] is expressed in radians (from /2 to +/2).
For conversion between radians and degrees, refer to RAD (FNC136) and DEG (FNC137) instructions.
For RAD (FNC136) instruction, refer to Section 18.24.
For DEG (FNC137) instruction, refer to Section 18.25.
510
11
In the program example shown below, the TAN1 value of data (binary floating point) stored in D0 and D1 is
calculated, and the angle is output in 4-digit BCD to Y040 to Y057 when X000 turns ON.
X000
FNC135
DATAN
D0
D10
FNC137
DDEG
D10
D20
FNC129
INT
D20
D30
FNC 18
BCD
D30
K4Y40
12
45
Binary floating point
(real number) value
INT
D11
D10
0.785398
Binary floating point
(real number) value
[2] Conversion into degrees
DDEG
D30
b15
b0
45
Binary
value
[4] BCD
operation
BCD
15
FNC70-FNC79
External FX I/O
Device
D20
[3]
Conversion
into binary
FMC60-FNC69
Handy
Instruction
D21
DATAN
FNC50-FNC59
High Speed
Processing
D0
1
Binary floating point
(real number) value
13
14
D1
FNC40-FNC49
Data Operation
END
[1]
Conversion
by TAN1
operation
FNC30-FNC39
Rotation and
Shift
Program example
Y057 Y040
0 0 4 5
BCD
value
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
511
1. Instruction format
FNC 136
P
RAD
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DRAD
DRADP
2. Set data
Operand Type
S
D
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
DRAD
S +1
D
D +1
rad
Binary floating point
(real number)
512
180
11
In the program example shown below, a 4-digit BCD value set in degrees in X020 to X037 is converted into a
binary floating point value in radians, and stored to D20 and D21 when X000 turns ON.
X000
FNC 19
BIN
K4X20
D0
FNC 49
FLT
D0
D10
FNC136
DRAD
D10
D20
12
FNC50-FNC59
High Speed
Processing
D11
D10
[3]
Conversion
into radians
120
FLT
D21
D20
2.094395 ...
DRAD
14
FMC60-FNC69
Handy
Instruction
b15
120
Binary
value
FNC40-FNC49
Data Operation
13
END
[1]
Conversion
X037 X020 into binary
0 1 2 0
BCD
BIN
value
FNC30-FNC39
Rotation and
Shift
Program example
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
513
1. Instruction format
FNC 137
P
DEG
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DDEG
DDEGP
2. Set data
Operand Type
S
D
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
""
] is converted from radians into degrees, and the operation result is stored to
S +1
FNC137
DDEG
D +1
D
Binary floating point
(real number)
514
180
rad
Binary floating point
(real number)
11
In the program example shown below, a binary floating point value set in radians in D20 and D21 is converted
into a BCD value in degrees, and stored to Y040 and Y057 when X000 turns ON.
X000
FNC137
DDEG
D20
D10
FNC129
INT
D10
D0
FNC 18
BCD
D0
K4Y40
12
FNC50-FNC59
High Speed
Processing
DDEG
D11
D10
82.26482
Binary floating point
value (real number)
[2]
Conversion
into binary
value
INT
D0
b15
[3]
Conversion
b0 into BCD
82
Binary
value
BCD
Y057 Y040
0 0 8 2
BCD
value
14
FMC60-FNC69
Handy
Instruction
D21
D20
1.435792
Binary floating point
value (real number)
FNC40-FNC49
Data Operation
13
END
[1]
Conversion
into degrees
FNC30-FNC39
Rotation and
Shift
Program example
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
515
516
FNC No.
Mnemonic
Symbol
Function
140
WSUM
WSUM S D n
Section
19.1
141
WTOB
WTOB S D n
WORD to BYTE
Section
19.2
142
BTOW
BTOW S D n
BYTE to WORD
Section
19.3
143
UNI
UNI
S D n
Section
19.4
144
DIS
DIS
S D n
Section
19.5
145
146
147
SWAP
Byte Swap
Section
19.6
148
149
SORT2
Section
19.7
SWAP S
SORT2 S m1 m2 D n
Reference
FNC30-FNC39
Rotation and
Shift
19.1
11
Outline
1. Instruction format
FNC 140
WSUM P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
WSUM
WSUMP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DWSUM
DWSUMP
2. Set data
Operand type
S
Data type
16- or 32-bit binary
3. Applicable devices
Bit Devices
System User
Word Devices
Digit Specification
System User
15
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
16
FNC80-FNC89
External FX
Device
3 3
K4444
K3333
K1234
K-5426
K326
K10000
"n"
points
(n = 6)
+1,
17
].
Sum of
"n" data
18
[ +1, D ]
D
FNC110-FNC139
Floating Point
+1
+2
+3
+4
+5
FNC100-FNC109
Data
Transfer 2
Command
input
FNC70-FNC79
External FX I/O
Device
Operand
Type
14
FMC60-FNC69
Handy
Instruction
Description
Head device number storing data whose sum is calculated
13
FNC50-FNC59
High Speed
Processing
Continuous
Operation
Pulse (Single)
Operation
12
FNC40-FNC49
Data Operation
K13911
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
517
FNC140
DWSUM
[ S +1, S ]
S +3, S +2]
S +5, S +4]
S +7, S +6]
S +9, S +8]
[
[
[
[
K32767000
K6000
K35392000
K-11870000
K12345000
"n"
points
(n = 5)
+1,
+3,
+2,
Sum of
"n" data
Related instruction
Instruction
CCD (FNC 84)
Description
Check code
Calculates the sum of 16-bit data in units of byte (8 bits) and the horizontal parity.
Caution
In the 32-bit operation, the acquired sum is 64-bit data. FX3U and FX3UC PLCs cannot handle 64-bit data.
When the sum is within the numeric range of 32-bit data (K-2,147,483,648 to K2,147,483,647), however,
FX3U and FX3UC PLCs can handle the low-order 32 bits of 32-bit data as the sum while ignoring the highorder 32 bits.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When "n" points starting from
Program example
In the program shown below, the sum of 16-bit data stored in D10 to D14 is stored in [D101, D100].
X010
FNC140
WSUMP
D10
D100
K5
END
518
D10
D11
D12
D13
D14
K4500
K2500
K-3276
K6780
K4444
WSUMP
instruction [D101,D100]
K14948
11
FNC30-FNC39
Rotation and
Shift
19.2
Outline
12
FNC 141
WTOB P
16-bit Instruction
Mnemonic
WTOB
7 steps
WTOBP
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
14
16-bit binary
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
16
b15
FNC141
WTOBP
b8 b7
S +0 High-order byte
+1 High-order byte
17
b0
Low-order byte
Low-order byte
...
...
b15
D +0
+1
+2
+3
b8 b7
00H
00H
00H
00H
+n-2
+n-1
18
"n" bytes
...
...
b0
Low-order byte
High-order byte
Low-order byte
High-order byte
00H
00H
Low-order byte
High-order byte
"00H" is stored.
19
FNC140-FNC149
Data
Operation 2
FNC110-FNC139
Floating Point
*
+n/2 High-order byte Low-order byte
FNC100-FNC109
Data
Transfer 2
Command
input
and later is separated into "n" bytes, and stored in "n" devices starting
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
FNC40-FNC49
Data Operation
1. Instruction format
20
FNC150-FNC159
Positioning
Control
519
3) When "n" is an odd number, only the low-order byte (8 bits) of the final separation source device is
regarded as the target data as shown in the figure below.
For example, when "n" is "5", the data from S
to the low-order byte (8 bits) of S +2 is stored in
D
to D +4.
b15
S +0
b8 b7
12H
56H
FEH
+1
+2
b0
b15
39H
78H
DCH
D +0
+1
+2
+3
+4
It is ignored when
"n" is "5".
b8 b7
b0
00H
00H
00H
00H
00H
39H
12H
78H
56H
DCH
When "n"
is "5"
"00H" is stored.
Related instruction
Instruction
Description
BTOW (FNC142)
Caution
Devices storing the separation source data can overlap devices storing the separated data.
When "n" is an odd number, however, the high-order byte (8 bits) of the final separation source device is
overwritten and erased.
b15
S =D12
D13
D14
b8 b7
32H
34H
36H
b15
b0
31H
33H
35H
D =D12
D13
D14
D15
D16
b8 b7
00H
00H
00H
00H
00H
b0
31H
32H
33H
34H
35H
When "n"
is "5"
"00H" is stored.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the separation source devices S
to S +n/2 are outside the specified device range (error
code: K6706)
When "n" is an odd number, the number of a rounded up value decides the number of devices. (error
code: K6706)
When the separated data destination devices
(error code: K6706)
to
Program example
In the program shown below, the data stored in D10 to D12 is separated in byte units, and stored in D20 to
D25.
X000
FNC141
WTOBP
D10
D20
K6
END
b15
D10
D11
D12
b8 b7
FDH
57H
34H
b0
58H
E2H
44H
b15
D20
D21
D22
D23
D24
D25
b8 b7
00H
00H
00H
00H
00H
00H
"00H" is stored.
520
b0
58H
FDH
E2H
57H
44H
34H
6 bytes
11
FNC30-FNC39
Rotation and
Shift
19.3
Outline
12
This instruction combines the low-order 8 bits (low-order byte) of consecutive 16-bit data.
FNC 142
BTOW P
16-bit Instruction
Mnemonic
Operation Condition
BTOW
7 steps
BTOWP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13
FNC50-FNC59
High Speed
Processing
2. Set data
Operand type
Description
Data type
14
16-bit binary
FMC60-FNC69
Handy
Instruction
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
16
FNC142
BTOWP
b15
S +0
b8 b7
n
b0
+1
b8 b7
2nd byte
4th byte
+n/2
b0
1st byte
3rd byte
18
"n"th byte
"n-1"th byte
FNC110-FNC139
Floating Point
b15
D +0
...
+n-1
...
+1
+2
...
"n"
bytes
17
FNC100-FNC109
Data
Transfer 2
Command
input
FNC80-FNC89
External FX
Device
15
FNC70-FNC79
External FX I/O
Device
FNC40-FNC49
Data Operation
1. Instruction format
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
521
3) When "n" is an odd number, "00H" is stored in the high-order byte (8 bits) of the final one among the
combination result destination devices as shown below.
For example, when "n" is "5", the low-order byte (8 bits) of S
to S +4 is stored in D
to
D +2, and "00H" is stored in the high-order byte (8 bits) of D +2.
b15
S +0
When
"n" is
"5"
b8 b7
ABH
CDH
EFH
ABH
CDH
+1
+2
+3
+4
b0
b15
12H
34H
56H
78H
9AH
D +0
b8 b7
34H
78H
00H
+1
+2
b0
12H
56H
9AH
Related instruction
Instruction
Description
WTOB (FNC141)
Caution
Devices storing the combination source data may be equivalent to devices storing the combined data.
After combination, however, the high-order byte (8 bits) of the combination source data stored in the devices
used for the combination destination data is erased and overwritten with the data acquired by combining the
high-order byte (8 bits).
b15
S =D11
When
"n" is
"6"
D12
D13
D14
D15
D16
b8 b7
ABH
CDH
EFH
ABH
CDH
EFH
b0
b15
12H
34H
56H
78H
9AH
BCH
D =D10
D11
D12
D13
D14
D15
D16
b8 b7
34H
78H
BCH
EFH
ABH
CDH
EFH
b0
12H
56H
9AH
56H
78H
9AH
BCH
It is not changed.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the combination source devices
code: K6706)
to
When the combined data destination devices D to D +n/2 are outside the specified device range
(error code: K6706)
When "n" is an odd number, the number of a rounded up value decides the numer of devices. (error code:
K6706)
522
11
In the program shown below, the low-order byte (8 bits) data stored in D20 to D25 is combined, and stored in
D10 to D12.
X000
FNC142
BTOWP
D20
D10
K6
12
FNC40-FNC49
Data Operation
END
b15
b8 b7
00H
31H
36H
44H
48H
49H
b0
78H
12H
49H
55H
67H
31H
b15
D10
D11
D12
b8 b7
12H
55H
31H
b0
78H
49H
67H
13
FNC50-FNC59
High Speed
Processing
D20
D21
6 bytes D22
D23
D24
D25
FNC30-FNC39
Rotation and
Shift
Program example
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
523
19.4
Outline
This instruction combines the low-order 4 bits of consecutive 16-bit data.
1. Instruction format
FNC 143
P
UNI
16-bit Instruction
7 steps
Mnemonic
Operation Condition
UNI
UNIP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
FNC143
UNIP
b15
1
2
3
Ignored
Combined data
524
as shown
b4 b3
b0
Low-order 4 bits
Low-order 4 bits
Low-order 4 bits
Low-order 4 bits
S +0
"n"
points
b15
D
b12b11
b8 b7
b4 b3
b0
11
b15
Ignored
b15
b12b11
b8 b7
b4 b3
b0
FNC40-FNC49
Data Operation
+1
+2
to
12
b4 b3
b0
Low-order 4 bits
Low-order 4 bits
Low-order 4 bits
S +0
0 0 0 0
Combined data
13
Instruction
FNC50-FNC59
High Speed
Processing
Related instruction
Description
DIS (FNC144)
FNC30-FNC39
Rotation and
Shift
14
Errors
When
to
When "n" is outside the range from "0 to 4" (error code: K6706)
15
K3
FNC70-FNC79
External FX I/O
Device
Program example
END
16
In the program below, the low-order 4 bits of D0 to D2 are combined and stored in D10 when X000 turns ON.
X000
FNC143
UNIP
D0
D10
FMC60-FNC69
Handy
Instruction
An operation error occurs in the following cases; The error flag M8067 turns ON, and the error code is stored
in D8067.
FNC80-FNC89
External FX
Device
b15
b4 b3
b0
D0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
b15
b12b11
b4 b3
b0
D10 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1
D1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
17
D2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
FNC100-FNC109
Data
Transfer 2
Combined data
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
525
19.5
Outline
This instruction separates 16-bit data into 4 bit units.
1. Instruction format
FNC 144
P
DIS
Mnemonic
16-bit Instruction
Operation Condition
DIS
7 steps
DISP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
16-bit binary
3. Applicable devices
Bit Devices
Operand
Type
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
b15
FNC144
DISP
b12b11
b4 b3
b0
b15
D +0
+1
+2
+3
as shown below.
b4 b3
b0
Low-order 4 bits
Low-order 4 bits "n"
Low-order 4 bits points
Low-order 4 bits
Related instruction
Instruction
UNI (FNC143)
526
Description
Combines low-order 4 bits of 16-bit data.
11
An operation error occurs in the following cases; The error flag M8067 turns ON, and the error code is stored
in D8067.
When
to
12
When "n" is outside the range from "0 to 4" (error code: K6706)
FNC40-FNC49
Data Operation
Program example
In the program below, D0 is separated into 4 bit units and stored in D10 to D13 when X000 turns ON.
X000
FNC144
DISP
D0
D10
K4
13
FNC50-FNC59
High Speed
Processing
END
b15
b12b11
b8 b7
b4 b3
b0
D10 1 1 0 0 1 0 0 1 0 1 0 1 0 0 0 1
FNC30-FNC39
Rotation and
Shift
Errors
b15
b4 b3 b2 b1 b0
D10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
14
D12 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
D13 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
They are set to "0".
Data storage
area
FMC60-FNC69
Handy
Instruction
D11 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
527
19.6
Outline
This instruction swaps the high-order 8 bits and low-order 8 bits of a word device.
1. Instruction format
D
FNC 147
SWAP P
16-bit Instruction
3 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
SWAP
SWAPP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
5 steps DSWAP
DSWAPP
2. Set data
Operand type
Description
Data type
SS1
Word device whose high-order 8 bits and low-order 8 bits are swapped for each
other
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
""
S
FNC147
SWAPP
High-order 8 bits
Low-order 8 bits
S +1
FNC147
DSWAPP
S
, High-order 8 bits Low-order 8 bits
Caution
When the continuous operation type instruction is used, swapping is executed in each operation cycle.
This instruction works in the same way as the extension function of the XCH (FNC 17) instruction.
528
11
FNC30-FNC39
Rotation and
Shift
19.7
Outline
13
1. Instruction format
16-bit Instruction
11 steps
Mnemonic
Operation Condition
Continuous
Operation
SORT
21 steps
Operation Condition
Continuous
Operation
DSORT2
14
Operand type
Description
FMC60-FNC69
Handy
Instruction
2. Set data
Data type
Head device number storing the data table [which occupies m1 m2 points]
m1
m2
Head device number storing the operation result [which occupies m1 m2 points]
Column number of group data (column) used as the basis of sorting [1 to m2]
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
3 3
m1
3 3
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
3 3
m2
17
3 3
3 3
3 3
FNC100-FNC109
Data
Transfer 2
3 3
m1
m2
19
FNC140-FNC149
Data
Operation 2
FNC149
SORT2
18
FNC110-FNC139
Floating Point
In the data table (sorting source) having (m1 x m2) points from S , data lines are sorted in the ascending
or descending order based on the group data in column No. "n", and the result is stored in the data table
(occupying m1 x m2 points) from D .
For operation examples, refer to Page 523.
Command
input
16
FNC80-FNC89
External FX
Device
Special
Unit
15
FNC70-FNC79
External FX I/O
Device
3. Applicable devices
Operand
Type
FNC50-FNC59
High Speed
Processing
FNC 149
D SORT2
12
FNC40-FNC49
Data Operation
This instruction sorts a data table consisting of data (lines) and group data (columns) based on a specified
group data (column) sorted by line in either ascending or descending order. This instruction stores the data
(lines) in serial devices facilitating the addition of data (lines).
On the other hand, the SORT (FNC 69) instruction stores the group data (columns) in serial devices, and
sorts a table in ascending order only.
For SORT (FNC 69) instruction, refer to Section 14.10.
20
FNC150-FNC159
Positioning
Control
529
The data table configuration is explained in an example in which the sorting source data table has 3 lines and
4 columns (m1 = K3, m2 = K4). For the sorting result data table, understand S as D .
Number of groups (m2 = K4)
Column No.
Line No.
Number
of data
(m1 = 3)
Control number
Height
Weight
Age
+1
+2
+3
+6
+7
+4
+5
+8
+9
+10
+11
Descending order
M8165=OFF
Ascending order
When the command input turns ON, data sorting is started. Data sorting is completed after "m1" scans,
and the instruction execution complete flag M8029 is set to ON.
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
FNC149
DSORT2
m1
m2
The data table configuration is explained in an example in which the sorting source data table has 3 lines and
4 columns (m1 = K3, m2 = K4). For the sorting result data table, understand S as D .
Number of groups (m2 = K4)
Column No.
Line No.
Number
of data
(m1 = 3)
Control number
Height
Weight
Age
2
3
[
[
S
S
+1,
+3,
+2]
+5,
+4]
+7,
+6]
+9,
+8]
+11,
+10]
+13,
+12]
+15,
+14]
+17,
+16]
+19,
+18]
+21,
+20]
+23,
+22]
Descending order
M8165=OFF
Ascending order
When a data register D or extension register (R) is used for "m1", the data length is 32 bits.
For example, when "m1" is specified in D0, "m1" is 32-bit data stored in [D1, D0].
When the command input turns ON, data sorting is started. Data sorting is completed after "m1" scans,
and the instruction execution complete flag M8029 is set to ON.
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
530
11
Control number
Height
Weight
Age
2
3
4
5
150
+4
2
S
+8
+9
160
+12
+13
100
+16
+5
180
3
S
+17
150
+2
45
20
+6
50
70
+15
20
+18
14
+11
30
+14
+7
40
+10
13
+3
FMC60-FNC69
Handy
Instruction
Number
of data
(m1 = 5)
FNC50-FNC59
High Speed
Processing
+1
50
+19
45
15
Line No.
Control number
Height
Weight
Age
100
+4
1
D
+8
+9
150
+12
+13
160
+16
+5
150
5
D
+17
180
+2
45
50
70
17
+15
30
+18
+11
45
+14
+7
20
+10
16
8
+6
+3
20
FNC100-FNC109
Data
Transfer 2
FNC80-FNC89
External FX
Device
+1
FNC70-FNC79
External FX I/O
Device
1) Sorting result when the instruction is executed with "n = K2 (column No. 2)"
(in the case of ascending order)
Column No.
50
+19
40
2) Sorting result when the instruction is executed with "n = K3 (column No. 3)"
(in the case of descending order)
1
Control number
Height
Weight
Age
3
4
160
+4
2
D
+8
+12
+9
+13
150
+16
150
1
D
+5
180
5
D
+17
100
+2
70
30
+6
50
D
+10
50
D
+14
45
D
+18
20
+3
19
+7
40
+11
45
+15
20
20
+19
FNC150-FNC159
Positioning
Control
FNC140-FNC149
Data
Operation 2
+1
18
FNC110-FNC139
Floating Point
Column No.
Line No.
12
FNC40-FNC49
Data Operation
When the instruction is executed with "n = K2 (column No. 2)" and "n = K3 (column No. 3)" for the following
sorting source data, the operations shown below result.
The operation examples below indicate 16-bit operations. In the case of 32-bit operation, construct the data
table with 32-bit binary data.
It is recommended to put a serial number such as a control number in the first column so that the original line
number can be estimated based on the contents.
FNC30-FNC39
Rotation and
Shift
3. Operation examples
531
Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
Name
M8029
Description
M8165
Descending order
Related instruction
Instruction
Description
Cautions
Do not change the contents of operands and data during operation.
To execute SORT2 instruction again, set the command input to OFF once, then ON again.
Limitation in number of SORT2 instructions
Up to two SORT2 instructions can be simultaneously driven in a program.
Writing during RUN is disabled for a circuit block including SORT2 instruction.
When the same device is specified in S and D
The source data is overwritten with the data acquired by sorting.
Pay close attention not to change the contents of S until execution of SORT2 instruction is completed.
Ensure that the sorted data does not overlap with the source data.
D10
D2
D30
D10
D30
Source Data
Source Data
D22
D20
Sorted Data
Sorted Data
D30
D10
D30
D10
Source Data
Source Data
D10
D30
D35
Sorted Data
D70
Source Data
D40
Sorted Data
532
D55
Sorted Data
D50
D20
D40
11
FNC30-FNC39
Rotation and
Shift
FNC No.
Mnemonic
150
DSZR
DSZR S1 S2 D1 D2
Section
20.1
151
DVIT
DVIT
Interrupt Positioning
Section
20.2
152
TBL
Section
20.3
FNC50-FNC59
High Speed
Processing
153
14
154
FMC60-FNC69
Handy
Instruction
Symbol
Function
155
ABS
S1 S2 D1 D2
TBL
ABS
D n
S D1 D2
Reference
12
FNC40-FNC49
Data Operation
FNC150 to FNC159 provide positioning instructions using the built-in pulse output function of the PLC.
For details, refer to the Positioning Control Edition manual.
Section
20.4
Zero Return
Section
20.5
Section
20.6
ZRN
157
PLSV
158
DRVI
DRVI S1 S2 D1 D2
Drive to Increment
Section
20.7
159
DRVA
DRVA S1 S2 D1 D2
Drive to Absolute
Section
20.8
ZRN
S1 S2 S3 D
PLSV
S D1 D2
Target instruction
DSZR (FNC150)
DVIT (FNC151)
TBL (FNC152)
ZRN (FNC156)
PLSV (FNC157)
acceleration/deceleration*1
DRVI (FNC158)
DRVA (FNC159)
*1.
19
FNC140-FNC149
Data
Operation 2
18
FNC110-FNC139
Floating Point
17
FNC100-FNC109
Data
Transfer 2
During RUN, avoid writing while any positioning control instruction (FNC150, FNC151, or FNC156 to
FNC159) is executed (that is, while pulses are output).
If program write is executed during RUN to a circuit block including a target instruction below while pulses are
being output, the PLC executes the operation shown below.
16
FNC80-FNC89
External FX
Device
156
15
FNC70-FNC79
External FX I/O
Device
13
20
FNC150-FNC159
Positioning
Control
533
20.1
Outline
This instruction executes a zero return, and aligns the mechanical position with a present value register inside
the PLC.
In addition, this instruction enables the following functions not supported by the ZRN (FNC156) instruction:
DOG search function
Zero return by the near-point (dog) signal and zero-phase signal
It is not possible, however, to count the zero-phase signal and then determine the zero point.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
FNC 150
DSZR
16-bit Instruction
9 steps
Mnemonic
Operation Condition
Continuous
Operation
DSZR
Operation Condition
2. Set data
Operand type
Description
Data type
S1
S2
D1
D2
Bit
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S1
3 3 3 3
S2
S
2
S1
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3
D1
S
3
D2
S
3 3
4
3
S1
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, a second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
534
Pulse output
D1
=Y000
D2
=Y004
D1
=Y001
D2
=Y005
D1
=Y002
D2
=Y006
D1
=Y003
D2
=Y007
12
FNC40-FNC49
Data Operation
13
FNC150
DSZR
S1
S2
D1
FNC50-FNC59
High Speed
Processing
D2
14
FX3UC
Ver.2.20 or
later
Ver.2.20 or
later
Item
Outline of function
16
FNC80-FNC89
External FX
Device
FX3U
15
FNC70-FNC79
External FX I/O
Device
The function of FNC150 instruction is changed depending on the version as shown in the table below.
For explanation of the instruction and the contents of function change,
refer to the Positioning Control Edition.
FMC60-FNC69
Handy
Instruction
During RUN, avoid writing while the DSZR (FNC150) instruction is executed (that is, while a pulse is output).
Note that if writing is executed during RUN to a circuit block including the FNC150 instruction while pulses are
output, the PLC decelerates and stops pulse output.
Applicable version
11
FNC30-FNC39
Rotation and
Shift
S4 : When using a special high speed output adapter for the pulse output destination in an FX3U PLC, the
rotation direction signal must be used by the following table output.
When using a built-in transistor output for the pulse output destination in an FX3U/FX3UC PLC, the
rotation direction signal must use transistor output.
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
535
20.2
Outline
This instruction executes one-speed interrupt constant quantity feed.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
D
FNC 151
DVIT
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
DVIT
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DDVIT
2. Set data
Operand type
Description
Data type
*1
S1
S2
D1
D2
Bit
*1.
*2.
Setting range
FX3U PLC
10 to 200,000 (Hz)
FX3U/FX3UC PLC
10 to 100,000 (Hz)
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
S1
S2
D1
S
1
D2
S
3
2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3
3 S3
S1 : Specify a transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002*2, or Y003*2 on
a special high speed output adapter*1.
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, a second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
536
Pulse output
D1
=Y000
D2
=Y004
D1
=Y001
D2
=Y005
D1
=Y002
D2
=Y006
D1
=Y003
D2
=Y007
12
FNC40-FNC49
Data Operation
13
FNC50-FNC59
High Speed
Processing
FNC151
DVIT
S1
S2
D1
D2
14
During RUN, avoid writing while the DVIT (FNC151) instruction is executed (that is, while a pulse is output).
Note that if writing is executed during RUN to a circuit block including the FNC151 instruction while pulses are
output, the PLC decelerates and stops pulse output.
The functions of FNC151 instruction are changed depending on the version as shown in the table below.
For explanation of the instruction and the contents of function change,
refer to the Positioning Control Edition.
Applicable version
16
Outline of function
Ver.1.30 or
later
17
Ver.2.20 or
later
FNC100-FNC109
Data
Transfer 2
Ver.2.20 or
later
Item
FNC80-FNC89
External FX
Device
Ver.2.20 or
later
FX3UC
15
FNC70-FNC79
External FX I/O
Device
FMC60-FNC69
Handy
Instruction
FX3U
11
FNC30-FNC39
Rotation and
Shift
S2 : When using a special high speed output adapter for the pulse output destination in an FX3U PLC, the
rotation direction signal must be used by the following table output.
When using a built-in transistor output for the pulse output destination in an FX3U/FX3UC PLC, the
rotation direction signal must use transistor output.
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
537
20.3
Outline
This instruction executes one specified table operation from the data table set in GX Developer (Ver.8.23Z or
later).
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
Instruction
DVIT (FNC151)
Description
Interrupt positioning
PLSV (FNC157)
DRVI (FNC158)
Drive to increment
DRVA (FNC159)
Drive to absolute
1. Instruction format
FNC 152
D
TBL
Mnemonic
16-bit Instruction
Operation Condition
32-bit Instruction
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DTBL
2. Set data
Operand type
Description
Data type
Bit
32-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
S
1
3 3
S1 : Specify a transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002*2, or Y003*2 on
a special high speed output adapter*1.
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, a second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
FNC152
DTBL
538
11
FNC30-FNC39
Rotation and
Shift
20.4
Outline
1. Instruction format
FNC 155
ABS
16-bit Instruction
Mnemonic
Operation Condition
32-bit Instruction
13 steps
Mnemonic
Operation Condition
Continuous
Operation
DABS
2. Set data
Operand type
Description
14
Data type
Bit
Head device number outputting absolute (ABS) data control signal to servo
amplifier
D1
15
Others
FNC70-FNC79
External FX I/O
Device
ConReal
CharacPointer
stant Number ter String
16
D2
FMC60-FNC69
Handy
Instruction
Head device number inputting absolute (ABS) data output signal sent from servo
amplifier
32-bit binary
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Special
Unit
Index
Z Modify K H
3 3 3
3 S2
S
3
1
3 S2
D1
D2
3 3 3 3
3 3
""
17
FNC100-FNC109
Data
Transfer 2
18
S
D1
D2
FNC110-FNC139
Floating Point
Command
input
FNC80-FNC89
External FX
Device
Operand
Type
13
FNC50-FNC59
High Speed
Processing
12
FNC40-FNC49
Data Operation
This instruction reads the absolute position (ABS) data when the Mitsubishi servo amplifier (equipped with the
absolute position detection function) MR-H, MR-J2(S), or MR-J3 is connected. The data is converted into a
pulse when being read.
For explanation of the instruction, refer to the Positioning Control Edition.
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
539
20.5
Outline
This instruction executes a zero return, and aligns the mechanical position with a present value register inside
the PLC.
When the dog search function is required, use DSZR (FNC150) instruction.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
FNC 156
D
ZRN
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
ZRN
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DZRN
2. Set data
Operand type
*1.
Description
Data type
S1
S2
S3
Bit
Setting range
FX3U PLC
10 to 200,000 (Hz)
FX3U/FX3UC PLC
10 to 100,000 (Hz)
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
S3
3 3 3
S
2
3 S1
""
3
3
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, the second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
540
11
Command
input
FNC156
ZRN
S1
S2
S3
FNC30-FNC39
Rotation and
Shift
12
During RUN, avoid writing while the ZRN (FNC156) instruction is executed (that is, while pulses are output).
Note that if writing is executed during RUN to a circuit block including the FNC156 instruction while pulses are
output, the PLC decelerates and stops pulse output.
13
Applicable version
Ver.2.20 or
later
Item
Outline of function
14
FMC60-FNC69
Handy
Instruction
Ver.2.20 or
later
FX3UC
FNC50-FNC59
High Speed
Processing
The function of FNC156 instruction is changed depending on the version as shown in the table below.
For explanation of the instruction and the contents of function change,
refer to the Positioning Control Edition.
FX3U
FNC40-FNC49
Data Operation
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
541
20.6
Outline
This instruction outputs variable speed pulses with an assigned rotation direction.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
FNC 157
D PLSV
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
PLSV
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DPLSV
2. Set data
Operand type
*1.
Description
Data type
*1
S1
D1
D2
Bit
Setting range
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
S1
D1
S
1
D2
S
3
2
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3
""
3 3
3
3 S3
S1 : Specify a transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002*2, or Y003*2 on
a special high speed output adapter*1.
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, a second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
542
Pulse output
=Y000
D2
=Y004
D1
=Y001
D2
=Y005
D1
=Y002
D2
=Y006
D1
=Y003
D2
=Y007
FNC40-FNC49
Data Operation
12
D1
13
FNC50-FNC59
High Speed
Processing
FNC157
PLSV
S1
D1
D2
14
During RUN, avoid writing while PLSV (FNC157) instruction is executed (that is, while pulses are output).
Note that if writing is executed during RUN to a circuit block including FNC157 instruction while pulses are
output, the PLC executes the operation shown below.
*1.
16
The function of the FNC157 instruction is changed depending on the version as shown in the table below.
For explanation of the instruction and the contents of function change,
refer to the Positioning Control Edition.
FX3UC
Ver.2.20 or
later
Ver.2.20 or
later
Item
Acceleration/
deceleration
operation function
Outline of function
When M8338 is set to ON, the PLC accelerates or decelerates up to
S1
D1
changes.
17
FNC100-FNC109
Data
Transfer 2
FX3U
FNC80-FNC89
External FX
Device
Applicable version
15
FNC70-FNC79
External FX I/O
Device
FMC60-FNC69
Handy
Instruction
11
FNC30-FNC39
Rotation and
Shift
S2 : When using a special high speed output adapter for the pulse output destination in an FX3U PLC, the
rotation direction signal must be used by the following table output.
When using a built-in transistor output for the pulse output destination in an FX3U/FX3UC PLC, the
rotation direction signal must use transistor output.
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
543
20.7
Outline
This instruction executes one-speed positioning by incremental drive. The movement distance from the
present position can be specified with a positive or negative sign.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
D
FNC 158
DRVI
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
DRVI
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DDRVI
2. Set data
Operand type
Description
Data type
S1
S2
D1
D2
Bit
*1.
*2.
Setting range
FX3U PLC
10 to 200,000 (Hz)
FX3U/FX3UC PLC
10 to 100,000 (Hz)
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
D1
S
1
D2
S
3
2
""
3
3 S3
S1 : Specify a transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002*2, or Y003*2 on
a special high speed output adapter*1.
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 in a special high speed output adapter, the second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
544
12
D1
=Y000
D2
=Y004
D1
=Y001
D2
=Y005
D1
=Y002
D2
=Y006
D1
=Y003
D2
=Y007
FNC40-FNC49
Data Operation
Pulse output
13
FNC50-FNC59
High Speed
Processing
FNC158
DRVI
S1
S2
D1
11
FNC30-FNC39
Rotation and
Shift
S2 :When using a special high speed output adapter for the pulse output destination in an FX3U PLC, the
rotation direction signal must be used by the following table output.
When using a built-in transistor output for the pulse output destination in an FX3U/FX3UC PLC, the
rotation direction signal must use transistor output.
D2
14
During RUN, avoid writing while DRVI (FNC158) instruction is executed (that is, while pulses are output).
Note that if writing is executed during RUN to a circuit block including FNC158 instruction while pulses are
output, the PLC decelerates and stops pulse output.
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
545
20.8
Outline
This instruction executes one-speed positioning by absolute drive. The movement distance from the zero
point can be specified.
For explanation of the instruction, refer to the Positioning Control Edition manual.
For cautions on using special high speed output adapters,
refer to the Positioning Control Edition manual.
1. Instruction format
D
FNC 159
DRVA
16-bit Instruction
9 steps
Mnemonic
Operation Condition
32-bit Instruction
Continuous
Operation
DRVA
17 steps
Mnemonic
Operation Condition
Continuous
Operation
DDRVA
2. Set data
Operand type
Description
Data type
S1
S2
D1
D2
*1.
*2.
Bit
Setting range
10 to 200,000 (Hz)
10 to 100,000 (Hz)
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
D1
S
1
D2
S
3
2
""
3
3 S3
S1 : Specify a transistor output Y000, Y001, or Y002 on the main unit or Y000, Y001, Y002*2, or Y003*2 on
a special high speed output adapter*1.
*1.
Special high speed output adapters cannot be connected to the FX3UC PLC.
*2.
When specifying Y002 or Y003 on a special high speed output adapter, a second special high
speed output adapter is required.
Points
When using a relay output type FX3U PLC, a special high speed output adapter is required.
Outputs of special high speed output adapters work as differential line drivers.
546
12
D1
=Y000
D2
=Y004
D1
=Y001
D2
=Y005
D1
=Y002
D2
=Y006
D1
=Y003
D2
=Y007
FNC40-FNC49
Data Operation
Pulse output
13
FNC50-FNC59
High Speed
Processing
FNC159
DRVA
S1
S2
D1
11
FNC30-FNC39
Rotation and
Shift
S2 : When using a special high speed output adapter for the pulse output destination in an FX3U PLC, the
rotation direction signal must be used by the following table output.
When using a built-in transistor output for the pulse output destination in an FX3U/FX3UC PLC, the
rotation direction signal must use transistor output.
D2
14
During RUN, avoid writing while DRVA (FNC159) instruction is executed (that is, while pulses are output).
Note that if writing is executed during RUN to a circuit block including FNC159 instruction while pulses are
output, the PLC decelerates and stops pulse output.
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
547
548
FNC No.
Mnemonic
Symbol
Function
160
TCMP
TCMP S1 S2 S3 S D
161
TZCP
TZCP S1 S2 S D
162
TADD
163
Reference
Section
21.1
Section
21.2
TADD S1 S2 D
Section
21.3
TSUB
TSUB S1 S2 D
Section
21.4
164
HTOS
HTOS S D
Section
21.5
165
STOH
STOH S D
Section
21.6
166
TRD
TRD
Section
21.7
167
TWR
TWR
Section
21.8
168
169
HOUR
HOUR S D1 D2
Hour Meter
Section
21.9
21
FNC160-FNC169
Real Time Clock
Control
21.1
Outline
This instruction compares the comparison time with the time data, and turns ON or OFF bit devices according
to the comparison result.
FNC 160
TCMP P
16-bit Instruction
11 steps
Mnemonic
Operation Condition
TCMP
TCMPP
Operation Condition
23
FNC180
Alternate
Instructions
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
16-bit binary
S2
16-bit binary
S3
16-bit binary
16-bit binary
24
FNC181-FNC189
Others
S1
S
25
Bit
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
S3
3 3 3 3
3 3
3 3
3 3 3 3
SD2
3 3
""
26
FNC200-FNC209
Character String
Control
S1
S
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
FNC170-FNC179
External Device
1. Instruction format
22
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
549
FNC160
TCMP
S1
S2
S3
S1
(hour)
D +1
>
S3 (second)
+2(second)
S1
(hour)
(hour)
S +1(minute) "
S3 (second)
S1
D +2
(hour)
<
+2(second)
(hour)
S +1(minute) "
S3 (second)
(hour)
S +1(minute) "
+2(second)
Even if the command contact turns OFF from ON and TCMP instruction is not
executed, D , D +1 and D +2 hold the status before the command
contact turned OFF.
Cautions
1) Number of occupied devices
Three devices are occupied respectively by S
and D .
Make sure that these devices are not used in other controls for the machine.
2) When utilizing the time (hour, minute, and second) of the real time clock built in a PLC
Read the values of special data registers by TRD (FNC166) instruction, and then specify those word
devices as the operands.
Program example
X000
FNC160
TCMP
S1
S2
S3
K10
K30
K50
D0
M0
10:30:50
M0
D0 (hour)
Turns ON in the case of "10:30:50 > D1 (minute)
M1
"
D2 (second)
S1
D0 (hour)
S2
"
D2 (second)
M2
D0 (hour)
Turns ON in the case of "10:30:50 < D1 (minute)
D2 (second)
550
"
S3
21
FNC160-FNC169
Real Time Clock
Control
21.2
Outline
This instruction compares two comparison time (comparison time zone) with the time data, and turns ON or
OFF the specified bit devices according to the comparison results.
FNC 161
TZCP P
16-bit Instruction
9 steps
Mnemonic
TZCP
TZCPP
Operation Condition
Operation Condition
23
FNC180
Alternate
Instructions
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Description
Data type
S1
S
Specifies "hour" of the lower limit comparison time (hour, minute, and second).
(Three devices are occupied.)
16-bit binary
S2
Specifies "hour" of the upper limit comparison time (hour, minute, and second).
(Three devices are occupied.)
16-bit binary
16-bit binary
24
FNC181-FNC189
Others
Operand type
25
Bit
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
S2
3 3 3 3
3 3 3 3
SD2
3 3
""
26
FNC200-FNC209
Character String
Control
S1
S
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
FNC170-FNC179
External Device
1. Instruction format
22
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
551
FNC161
TZCP
S1
S2
S1
D +1
S1 +1(minute)
>
(hour)
+1(minute)
S1 +2(second)
S +2(second)
S1
(hour)
+1(minute)
(hour)
S1 +1(minute)
S1 +2(second)
D +2
".
S2
(hour)
S2 +1(minute) ".
S +2(second)
S2 +2(second)
(hour)
S2
+1(minute)
Even if the command contact turns OFF from ON and TZCP instruction is not executed,
S +2(second)
>
(hour)
S2 +1(minute) ".
S2 +2(second)
D ,
D +1 and D +2 hold the status before the command contact turned OFF.
Cautions
1) Number of occupied devices
Three devices are occupied respectively by S1 , S2 , S3 , and D .
Make sure that these devices are not used in other controls for the machine.
2) When utilizing the time (hour, minute, and second) of the real time clock built in a PLC
Read the values of special data registers by TRD (FNC166) instruction, and then specify those word
devices as the operands.
552
21
X000
FNC161
TZCP
M4
S2
D 20
D 30
D0
M3
22
D20 (hour)
D0 (hour)
>
D2 (second)
D20 (hour)
D0 (hour)
D1 (minute)
D 31 (minute) ".
D 32 (second)
D0 (hour)
D 30 (hour)
D2 (second)
>
23
D 30 (hour)
D2 (second)
D 31 (minute) ".
24
D 32 (second)
S1 ,
S1 +1 and S1 +2 : Specify the lower limit of the comparison time zone in "hour", "minute" and "second.
25
S2 ,
S2 +1 and S2 +2 : Specify the upper limit of the comparison time zone in "hour", "minute" and "second.
S ,
S +1 and
D ,
D +1 and
FNC190-FNC199
Block Data
Operation
FNC181-FNC189
Others
".
FNC180
Alternate
Instructions
D22 (second)
M5
D1 (minute)
D22 (second)
FNC170-FNC179
External Device
M3
S1
FNC160-FNC169
Real Time Clock
Control
Program example
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
553
21.3
Outline
This instruction executes addition of two time data, and stores the addition result to word devices.
1. Instruction format
FNC 162
TADD P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
TADD
TADDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
S1
S
Specifies "hour" of the time data (hour, minute, and second) used in addition.
(Three devices are occupied.)
16-bit binary
S2
Specifies "hour" of the time data (hour, minute, and second) used in addition.
(Three devices are occupied.)
16-bit binary
Stores the addition result (hour, minute, and second) of two time data. (Three
devices are occupied.)
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
S
3 3 3 3
S2
3 3 3 3
SD2
3 3 3 3
""
S1
FNC162
TADD
(hour)
S1 +1(minute)
S1 +2(second)
S1
S2
S2
(hour)
S2 +1(minute)
S2 +2(second)
( D , D +1, D +2)
When the operation result exceeds 24 hours, the carry flag turns ON, and the value simply acquired by
addition subtracted by 24 hours is stored as the operation result.
When the operation result becomes "0" (0:0:0), the zero flag turns ON.
554
21
FNC160-FNC169
Real Time Clock
Control
Cautions
1) Number of occupied devices
Three devices are occupied by S1 , S2 and D respectively.
Make sure that these devices are not used in other controls for the machine.
Program example
X000
10 (hour)
S1 +1 30 (minute)
S1 +2 10 (second)
S2
D 10
D 20
D 30
3 (hour)
S2 +1 10 (minute)
S2 +2 5 (second)
3:10:5
13 (hour)
D +1 40 (minute)
24
D +2 15 (second)
FNC181-FNC189
Others
10:30:10
S2
23
FNC180
Alternate
Instructions
S1
FNC162
TADD
S1
13:40:15
S2
18 (hour)
10 (hour)
18:10:30
20 (minute)
5 (second)
10:20:5
25
18+10=28(24)
30 (minute)
FNC190-FNC199
Block Data
Operation
10 (minute)
30 (second)
D
4 (hour)
22
FNC170-FNC179
External Device
2) When utilizing the time (hour, minute, and second) of the real time clock built in a PLC
Read the values of special data registers using the TRD (FNC166) instruction, and then specify those
word devices as the operands.
35 (second)
4:30:35
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
555
21.4
Outline
This instruction executes subtraction of two time data, and stores the subtraction result to word devices.
1. Instruction format
FNC 163
TSUB P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
TSUB
TSUBP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand type
Description
Data type
S1
S
Specifies "hour" of the time data (hour, minute, and second) used in subtraction.
(Three devices are occupied.)
16-bit binary
S2
Specifies "hour" of the time data (hour, minute, and second) used in subtraction.
(Three devices are occupied.)
16-bit binary
Stores the subtraction result (hour, minute, and second) of two time data. (Three
devices are occupied.)
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
S
3 3 3 3
S2
3 3 3 3
SD2
3 3 3 3
""
FNC163
TSUB
S1
(hour)
S1
+1 (minute)
S1 +2 (second)
S1
S2
S2
(hour)
S2 +1 (minute)
S2 +2 (second)
( D , D +1, D +2)
When the operation result is smaller than 0 hour, the borrow flag turns ON, and the value simply acquired by
subtraction added by 24 hours is stored as the operation result.
When the operation result becomes "0" (0:0:0), the zero flag turns ON.
556
21
FNC160-FNC169
Real Time Clock
Control
Cautions
1) Number of occupied devices
Three devices are occupied by S1 , S2 and D respectively.
Make sure that these devices are not used in other controls for the machine.
Program example
X000
D 10 10 (hour)
D 11 30 (minute)
D 12 10 (second)
D 10
D 20
D 30
D 20 3 (hour)
D 21 10 (minute)
D 22 5 (second)
3:10:5
23
D 30 7 (hour)
D 31 20 (minute)
24
D 32 5 (second)
FNC181-FNC189
Others
10:30:10
S2
FNC180
Alternate
Instructions
FNC163
TSUB
S1
7:20:5
S2
5 (hour)
18 (hour)
11 (hour)
40 (second)
5:20:40
10 (minute)
5 (second)
18:10:5
25
518=13 (<0)
FNC190-FNC199
Block Data
Operation
20 (minute)
22
FNC170-FNC179
External Device
2) When utilizing the time (hour, minute, and second) of the real time clock built in a PLC
Read the values of special data registers using TRD (FNC166) instruction, and then specify those word
devices as the operands.
10 (minute)
35 (second)
11:10:35
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
557
21.5
Outline
This instruction converts the time data in units of "hour, minute, and second" into data in units of "second".
1. Instruction format
D
FNC 164
HTOS P
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DHTOS
DHTOSP
Continuous
Operation
Pulse (Single)
Operation
HTOS
HTOSP
2. Set data
Operand type
Description
Data type
SS1
Head device number storing the time data (hour, minute and second) before
conversion
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
""
FNC164
HTOS
hour
(0 to 9)
S +1
minute
(0 to 59)
S +2
second
(0 to 59)
+1, and
D
second
For example, when "4 hours 29 minutes 31 seconds" is specified, the operation is as follows:
558
S +1
29
S +2
31
D
16171
21
hour
+1, and
22
D +1
(0 to 32767)
S +1
minute
(0 to 59)
S +2
second
(0 to 59)
FNC170-FNC179
External Device
FNC164
DHTOS
second
23
FNC180
Alternate
Instructions
For example, when "35 hours 10 minutes 58 seconds" is specified, the operation is as follows:
35
S +1
10
S +2
58
D +1
126658
24
Error
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
S
+ 1 or
Program example
In the program shown below, the time data read from the real time clock built in a PLC is converted into data
in units of "second", and stored to D100 and D101 when X020 turns ON.
X020
FNC164
DHTOS
D13
D10
D100
27
END
FNC210-FNC219
Data
Operation 3
Operation
Clock data reading operation by TRD (FNC166) instruction
Real time
clock
D11
Month
D12
31
Day
D13
20
Hour
D14
21
Minute
D15
23
Second
D16
Day of week
28
Year
Clock data
Time data
29
FNC250-FNC269
Data Table
Operation
2004
FNC220-FNC249
Data
Comparison
D10
D101,D100
D14
21
73283
D15
23
30
FNC270-FNC274
Ex-Device
Inverter Comms
D13
26
FNC200-FNC209
Character String
Control
FNC166
TRD
25
FNC190-FNC199
Block Data
Operation
FNC181-FNC189
Others
FNC160-FNC169
Real Time Clock
Control
559
21.6
Outline
This instruction converts the time data in units of "second" into data in units of "hour, minute, and second".
1. Instruction format
D
FNC 165
STOH P
Mnemonic
16-bit Instruction
5 steps
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
9 steps DSTOH
DSTOHP
Continuous
Operation
Pulse (Single)
Operation
STOH
STOHP
2. Set data
Operand type
Description
Data type
SS1
Head device number storing the time data (hour, minute and second) after
conversion
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
SS1
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
""
FNC165
STOH
Second (0 to 32767)
Hour
(0 to 9)
D +1
Minute
(0 to 59)
D +2
Second
(0 to 59)
560
D +1
D +2
31
21
FNC165
DSTOH
22
Second
(0 to 117964799)
Hour
FNC170-FNC179
External Device
S +1
(0 to 32767)
D +1
Minute
(0 to 59)
D +2
Second
(0 to 59)
23
45325
12
D +1
35
D +2
25
FNC180
Alternate
Instructions
24
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is store
in D8067.
S
25
In the program shown below, the time data in units of "second" stored in D0 and D1 is converted into data in
units of "hour, minute, and second", and stored to D100, D101, and D102 when X020 turns ON.
FNC165
DSTOH
D0
26
D100
FNC200-FNC209
Character String
Control
END
Operation
27
40000
D100
11
D101
FNC210-FNC219
Data
Operation 3
Converting the data in second into the data in hour, minute and second using STOHP instruction
(when "40,000 seconds" is specified by D1 and D0)
D1,D0
FNC190-FNC199
Block Data
Operation
Program example
X020
FNC181-FNC189
Others
Error
FNC160-FNC169
Real Time Clock
Control
D102
40
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
561
21.7
Outline
This instruction reads the clock data of the real time clock built in a PLC.
1. Instruction format
FNC 166
P
TRD
Mnemonic
16-bit Instruction
3 steps
TRD
TRDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand type
D
Description
Data type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3 3 3
SD2
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
TRD
This instruction reads the real time clock data in a PLC, and transfers it to
seven data registers.
Device
Item
Clock data
D8018
Year
0 to 99
(lower two digits)
D8017
Month
1 to 12
D8016
Day
1 to 31
D8015
Hour
0 to 23
D8014
Minute
0 to 59
D8013
Second
0 to 59
D8019
Day of week
0 (Sunday) to
6 (Saturday)
Caution
1. Number of occupied devices
Seven devices are occupied by D .
Make sure that these devices are not used in other controls for the machine.
562
Device
Item
D0
Year
D1
Month
D2
Day
D3
Hour
D4
Minute
D5
Second
D6
Day of week
21
FNC160-FNC169
Real Time Clock
Control
21.8
Outline
22
This instruction writes the clock data to the real time clock built in a PLC.
FNC 167
P
TWR
16-bit Instruction
3 steps
Mnemonic
TWR
TWRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand type
D
Description
Data type
Specifies the head device number to which the clock data is written.
(Seven devices are occupied.)
16-bit binary
24
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3 3 3
Z Modify K H
""
to
+6 is written to D8013 to D8019 for the real time clock built in a PLC.
26
FNC200-FNC209
Character String
Control
TWRP
25
FNC190-FNC199
Block Data
Operation
SD2
ConReal
CharacPointer
stant Number ter String
Index
FNC181-FNC189
Others
3. Applicable devices
Operand
Type
FNC170-FNC179
External Device
1. Instruction format
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
563
Device
Item
Clock data
D 10
Year
0 to 99
(lower two digits)
D 11
Month
1 to 12
D 12
Day
1 to 31
D 13
Hour
0 to 23
D 14
Minute
0 to 59
D 15
Second
o to 59
D 16
Day of week
0 (Sunday) to
6 (Saturday)
Device
Item
D8018
Year
D8017
Month
D8016
Day
D8015
Hour
D8014
Minute
D8013
Second
D8019
Day of week
- D8018 (year data) can be converted into the 4-digit mode. (Refer to the program example shown later.)
- When TWR (FNC167) instruction is executed, the clock data of the real time clock is immediately
changed. Accordingly, transfer the clock data several minutes ahead to S
to S +6 in advance,
and then execute FNC167 instruction when the accurate time has come.
- When setting the clock data (time) using this instruction, it is not necessary to control the special
auxiliary relay M8015 (time stop and time setting).
- If a numeric value indicating impossible date/time is set, the clock data is not changed.
Set the correct clock data, and then write it.
Caution
1. Number of occupied devices
Seven devices are occupied by S .
Make sure that these devices are not used in other controls for the machine.
564
21
FNC 12
MOV
K4
D1
Month
FNC 12
MOV
K25
D2
Day
FNC 12
MOV
K15
D3
Hour
FNC 12
MOV
K20
D4
Minute
FNC 12
MOV
K30
D5
Second
FNC 12
MOV
K2
D6
Day of week
FNC167
TWR
D0
22
23
24
FNC181-FNC189
Others
D0
FNC180
Alternate
Instructions
K1
FNC170-FNC179
External Device
FNC 12
MOV
X001
M8017
25
FNC190-FNC199
Block Data
Operation
Every time X001 is set to ON, the current time can be corrected by 30 seconds.
When handling the year in the 4-digit mode, add the following program.
D8018 will specify the 4-digit year mode in the second scan and later after the PLC mode is changed to
RUN.
K2000
D8018
29
FNC250-FNC269
Data Table
Operation
When the data access unit FX-10DU-E/20DU-E/25DU-E is connected, select the 2-digit year mode. If the
4-digit year mode is selected, the year is not correctly displayed in the current version of the FX-10DU-E/
20DU-E/25DU-E.
Note that the clock is changed to the 2-digit year mode when the clock is set from the FX-10DU-E/20DU-E/
25DU-E while the PLC is operating in the 4-digit year mode.
28
FNC220-FNC249
Data
Comparison
- A PLC is normally operating in the 2-digit year mode. When the above instruction is executed and
"K2000 (fixed value)" is transferred to D8018 (year) in only one operation cycle after the PLC mode was
changed to RUN, the year mode is switched to the 4-digit mode.
- Execute this program every time the PLC mode is changed to RUN. Even if "K2000" is transferred, only
the display format is changed to the 4-digit year mode. The current date and time are not affected.
- In the 4-digit year mode, the set values "80 to 99" correspond to "1980 to 1999", and "00 to 79"
correspond to "2000 to 2079".
Examples:
"80" indicates 1980. "99" indicates 1999. "00" indicates 2000. "79" indicates 2079.
27
FNC210-FNC219
Data
Operation 3
Initial pulse
FNC 12
MOV
26
FNC200-FNC209
Character String
Control
When setting the time, it is recommended to set the time to several minutes ahead in advance, and then
set X000 to ON when the accurate time is reached. The set time is then immediately written to the real
time clock, and the clock data is updated.
M8002
FNC160-FNC169
Real Time Clock
Control
Program example
30
FNC270-FNC274
Ex-Device
Inverter Comms
565
21.9
Outline
This instruction measures the ON time of the input contact in units of hour.
1. Instruction format
FNC 169
D HOUR
Mnemonic
16-bit Instruction
7 steps
Operation Condition
Continuous
Operation
HOUR
13 steps
Operation Condition
Continuous
Operation
DHOUR
2. Set data
Operand type
Description
Data type
16- or 32-bit binary
SS1
D11
S
Current value (unit: hour) (latched (battery backed) type data register latched
(battery backed))
D2
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
3 3 3 3
3 3
D11
S
3 3
ConReal
CharacPointer
stant Number ter String
Index
SS1
D22
S
System User
Others
Special
Unit
Z Modify K H
3 3
""
3 3
3
3
D1
D1
D2
FNC169
HOUR
D1
D2
Specify a latched (battery backed) type data register as D1 so that the current value data can be
continuously used even after the PLC turns OFF.
If a general type data register is used, the current value data is cleared when the power of the PLC is
turned OFF or when the PLC mode switches from STOP to RUN.
Even after the alarm output D2
When the current value D1 reaches the maximum value of 16-bit data, the measurement is stopped.
For continuing the measurement, clear the current value stored in D1 and D1 +1.
566
21
Command
input
FNC169
DHOUR
+1,
[ D1
+1, D1
D1
+2
D2
D1
D2
22
FNC170-FNC179
External Device
[ S
FNC160-FNC169
Real Time Clock
Control
2. 32-bit operation
24
Caution
25
FNC190-FNC199
Block Data
Operation
Program example
X000
D1
+1
D1
D2
K300
D 200
Y005
27
FNC210-FNC219
Data
Operation 3
FNC169
HOUR
26
FNC200-FNC209
Character String
Control
In the program example shown below, when the accumulated X000 ON time exceeds 300 hours, Y005 turns
ON.
The current value less than one hour is stored in D201 in units of second.
D2
FNC181-FNC189
Others
When the current value [ D1 +1, D1 ] reaches the maximum value of 32-bit data, the measurement is
stopped.
For continuing the measurement, clear the current value stored in D1 to D1 +2.
D1
FNC180
Alternate
Instructions
Specify a latched (battery backed) type data register as D1 so that the current value data can be
continuously used even after the PLC turns OFF.
If a general data type register is used, the current value data is cleared when the power of the PLC is
turned OFF or when the PLC mode switches from STOP to RUN.
23
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
567
568
FNC No.
Mnemonic
Symbol
Function
Reference
170
GRY
GRY
S D
Section
22.1
171
GBIN
GBIN
S D
Section
22.2
172
173
174
175
176
RD3A
RD3A m1 m2 D
177
WR3A
WR3A m1 m2 S
178
179
Section
22.3
Section
22.4
21
FNC160-FNC169
Real Time Clock
Control
22.1
Outline
22
This instruction converts a binary value into a gray code, and transfers it.
FNC 170
P
GRY
16-bit Instruction
5 steps
Mnemonic
Operation Condition
GRY
GRYP
Operation Condition
DGRY
9 steps
DGRYP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
Description
Data Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
26
When S
FNC170
GRY
FNC200-FNC209
Character String
Control
Command
input
27
Y23
Y20 Y17
Y10
0 1 1 0 1 0 1 1 1 0 1 1
28
FNC220-FNC249
Data
Comparison
FNC210-FNC219
Data
Operation 3
b0
b15
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
GRY 1234
25
FNC190-FNC199
Block Data
Operation
ConReal
CharacPointer
stant Number ter String
Index
24
FNC181-FNC189
Others
3. Applicable devices
Operand
Type
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
FNC170-FNC179
External Device
1. Instruction format
29
The data conversion speed depends on the scan time of the PLC.
FNC250-FNC269
Data Table
Operation
Caution
30
FNC270-FNC274
Ex-Device
Inverter Comms
569
22.2
Outline
This instruction converts a gray code into a binary value, and transfers it.
1. Instruction format
FNC 171
P
GBIN
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DGBIN
9 steps
DGBINP
Continuous
Operation
Pulse (Single)
Operation
GBIN
GBINP
2. Set data
Operand Type
Description
Data Type
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S
D
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
3 3
When S
FNC171
GBIN
GRY 1234
D10
X10 X7
X0
X13
0 1 1 0 1 0 1 1 1 0 1 1
b0
b15
BIN 1234 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
- This instruction can be used for detecting an absolute position by a gray code type encoder.
-
Caution
When an input relay (X) is specified as S , the response relay will be Scan time of PLC + Input filter
constant.
The filter constant can be changed in X000 to X017 using REFF (FNC 51) instruction or D8020 (filter
adjustment) so that the filter constant delay is eliminated.
570
21
FNC160-FNC169
Real Time Clock
Control
22.3
Outline
22
This instruction reads an analog input value from the analog block FX0N-3A or FX2N-2AD.
FNC 176
RD3A P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
RD3A
RD3AP
Continuous
Operation
Pulse (Single)
Operation
FNC170-FNC179
External Device
1. Instruction format
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
Description
Data Type
16-bit binary
m2
16-bit binary
16-bit binary
24
FNC181-FNC189
Others
m1
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
m1
3 3 3 3
3 3
3 3
m2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
""
26
FNC200-FNC209
Character String
Control
m2
m2
27
28
FNC220-FNC249
Data
Comparison
m1
FNC210-FNC219
Data
Operation 3
m1
FNC176
RD3A
25
FNC190-FNC199
Block Data
Operation
Operand
Type
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
571
22.4
Outline
This instruction writes a digital value to the analog block FX0N-3A or FX2N-2DA.
1. Instruction format
FNC 177
WR3A P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
WR3A
WR3AP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
m1
m2
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
m1
3 3 3 3
3 3
3 3
m2
3 3 3 3
3 3
3 3
3 3 3 3
3 3
m1
m2
572
FNC177
WR3A
m1
m2
""
21
FNC160-FNC169
Real Time Clock
Control
22
FNC170-FNC179
External Device
23.1
Outline
FX3U/FX3UC
Description
FNC270
IVCK
EXTR K11
FNC271
IVDR
Inverter drive
EXTR K12
FNC272
IVRD
EXTR K13
FNC273
IVWR
FNC274
IVBWR
24
FNC181-FNC189
Others
EXTR K10
23
FNC180
Alternate
Instructions
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
573
MEMO
574
21
FNC160-FNC169
Real Time Clock
Control
182
COMRD
183
184
RND
185
186
DUTY
187
188
CRC
189
HCMOV
Function
Reference
COMRD S D
RND
Section
24.1
Section
24.2
24
DUTY n1 n2 D
Section
24.3
Section
24.4
HCMOV S D n
Section
24.5
25
26
FNC200-FNC209
Character String
Control
S D n
CRC
23
FNC190-FNC199
Block Data
Operation
181
Symbol
FNC181-FNC189
Others
Mnemonic
FNC180
Alternate
Instructions
FNC No.
22
FNC170-FNC179
External Device
FNC181 to FNC189 provide instructions for generating random numbers, executing CRC data operations,
and processing data in high speed counter operations.
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
575
24.1
Outline
This instruction reads the comment data for registered devices written to the PLC by programming software
such as GX Developer.
1. Instruction format
FNC 182
COMRD P
16-bit Instruction
5 steps
Mnemonic
Operation Condition
COMRD
COMRDP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Device name
Character string
3. Applicable devices
Operand
Type
S
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3 3 3
3 3 3 3
""
FNC182
COMRDP
and later.
D
b15
D +0
b8 b7
b0
.......
576
16
characters
can be
stored.
21
is "LineNo.1Start", it is stored in
b15
D +0
b8 b7
b0
4CH(L)
6EH(n)
4EH(N)
2EH(.)
53H(S)
61H(a)
74H(t)
20H(space)
22
FNC170-FNC179
External Device
69H(i)
65H(e)
6FH(o)
31H(1)
74H(t)
72H(r)
20H(space)
20H(space)
+1
+2
+3
+4
+5
+6
+7
+8
Comment of S
LineNo.1Start
23
0000H
FNC180
Alternate
Instructions
- When M8091 is OFF, "0000H" is written to the next device following the final character.
- When M8091 is ON, the device following the final character does not change.
ON/OFF status
Contents of processing
When M8091 is OFF, "0000H" is written to in the device following the final character.
M8091 = ON
When M8091 is ON, the device following the final character does not change.
24
FNC181-FNC189
Others
M8091 = OFF
Related device
Device
Name
M8091
Description
25
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
27
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
Errors
FNC190-FNC199
Block Data
Operation
Caution
FNC160-FNC169
Real Time Clock
Control
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
577
Program example
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. And since M8091 is OFF "0000H" is written to the device following the last
character.
X010
FNC182
COMRDP
RST
M8091
D100
D0
END
b15
Comment of D100
Target Line A
578
D0
D1
D2
D3
D4
D5
D6
D7
D8
b8 b7
61H(a)
67H(g)
74H(f)
4CH(L)
6EH(n)
20H(space)
20H(space)
20H(space)
b0
54H(T)
72H(r)
65H(e)
20H(space)
69H(i)
65H(e)
41H(A)
20H(space)
0000H
21
FNC160-FNC169
Real Time Clock
Control
24.2
Outline
22
FNC 184
P
RND
16-bit Instruction
3 steps
Mnemonic
Operation Condition
RND
RNDP
Continuous
Operation
Pulse (Single)
Operation
FNC170-FNC179
External Device
1. Instruction format
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
D
Description
Data Type
16-bit binary
24
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
25
FNC 184
RND
27
28
FNC220-FNC249
Data
Comparison
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.]
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
This instruction generates a pseudo-random number within the range from 0 to 32767, and stores it as a
random number to D .
In the pseudo-random number sequence, the source value of a random number is calculated at every time,
and this instruction calculates a pseudo-random number using the source value.
FNC190-FNC199
Block Data
Operation
Command
input
FNC181-FNC189
Others
Operand
Type
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
579
Program example
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.
M8002
FNC166
TRD
FNC164
DHTOS
X010
D0
D3
D14
FNC 20
ADD
D0
D1
D10
FNC 23
MUL
D10
D2
D12
FNC 20
DADD
D14
D12
D8310
FNC184
RNDP
D100
END
580
21
FNC160-FNC169
Real Time Clock
Control
24.3
Outline
This instruction generates the timing signal whose one cycle corresponds to the specified number of
operation cycles.
FNC170-FNC179
External Device
1. Instruction format
FNC 186
DUTY
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
DUTY
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
Description
Data Type
n2
24
16-bit binary
FNC181-FNC189
Others
n1
Bit
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
n1
3 3 3 3
3 3
n2
3 3 3 3
3 3
""
26
FNC200-FNC209
Character String
Control
Command
input
FNC186
DUTY
n1
is set to ON and OFF with the ON duration for "n1" scans and
n2
28
FNC220-FNC249
Data
Comparison
27
FNC210-FNC219
Data
Operation 3
25
FNC190-FNC199
Block Data
Operation
Operand
Type
22
0
"n1+n2" scans
2) Specify either one among M8330 to M8334 as the timing clock output destination device
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
581
3) The counted number of scans is stored in either one among D8330 to D8334 in accordance with the
timing clock output destination device D .
The counted number of scans stored in either one among D8330 to D8334 is reset when the counted
value reaches "n1+n2" or when the command input (instruction) is set to ON.
Timing clock output destination device
M8330
D8330
M8331
D8331
M8332
D8332
M8333
D8333
M8334
D8334
4) When the command input is set to ON, the operation is started. The timing clock output destination
device D is set to ON or OFF by END instruction.
Even if the command input is set to OFF, the operation is not stopped.
In the STOP mode, the operation is suspended. When the power of the PLC is turned OFF, the operation
is stopped.
5) When "n1" and "n2" are set to "0", the device
n1/n2 status
ON/OFF status
n1 = 0, n2 0
Fixed to OFF
n1 > 0, n2 = 0
Fixed to ON
Related devices
Device
Name
Description
M8330
M8331
M8332
M8333
M8334
D8330
D8331
D8332
D8333
D8334
Caution
DUTY (FNC186) instruction can be used up to 5 times (points).
It is not permitted, however, to use the same timing clock output destination device
DUTY (FNC186) instructions.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When "n1" and/or "n2" is less than "0" (error code: K6706)
When any device other than M8330 to M834 is set to
582
21
In the program shown below, when X000 is set to ON, M8330 is set to ON for 1 scan and OFF for 3 scans.
X000
FNC186
DUTY
K1
K3
M8330
22
FNC170-FNC179
External Device
END
X000
OFF ON
M8330 OFF ON
1 scan
23
FNC180
Alternate
Instructions
3 scans
3
2
D8330
current value
1
0
FNC160-FNC169
Real Time Clock
Control
Program example
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
583
24.4
Outline
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 (FNC 84) instruction is available.
CRC instruction uses X16 + X15 + X2 + 1 as a polynomial for generating the CRC value (CRC-16).
For CCD instruction (check code), refer to Section 16.5.
1. Instruction format
FNC 188
P
CRC
16-bit Instruction
7 steps
Mnemonic
Operation Condition
CRC
CRCP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
Head device number storing data for which the CRC value is generated
16-bit binary
Number of 8-bit (1-byte) data for which the CRC value is generated or the device
number storing the number of data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S
D
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
S: Make sure to specify four digits (K4{{{) when specifying the digits of a bit device.
584
FNC188
CRC
22
M8000
M8161 16-bit conversion mode
FNC188
CRC
FNC170-FNC179
External Device
Command
input
Example:
= D100
= D0
6
Contents of target data
Device
+1
+2
01H
High-order byte
03H
Low-order byte
03H
High-order byte
02H
Low-order byte
00H
High-order byte
14H
16 bits
0301H
0203H
1400H
25
Low-order byte
High-order byte
24
Low-order byte
Low-order bits of D0
E4H
High-order byte
High-order bits of D0
41H
41E4H
FNC190-FNC199
Block Data
Operation
+n/2-1
Low-order byte
...
...
S
8 bits
FNC181-FNC189
Others
23
FNC180
Alternate
Instructions
n=
21
FNC160-FNC169
Real Time Clock
Control
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
585
FNC188
CRC
Example:
= D100
= D0
6
n=
Device
Low-order byte
01H
+1
Low-order byte
03H
+2
Low-order byte
03H
+3
Low-order byte
02H
+4
Low-order byte
00H
+5
Low-order byte
14H
...
+n-1
+1
Low-order byte
Low-order byte
Low-order bits of D0
E4H
Low-order byte
Low-order bits of D1
41H
2. Related device
Related device
Description
M8161*1
*1.
ON
OFF
Caution
In this instruction, X16 + X15 + X2 + 1 is used as a polynomial for generating the CRC value (CRC-16).
There are many other standard polynomials for generating the CRC value. Note that the CRC value
completely differs if an adopted polynomial is different.
Reference: Major polynomials for generating the CRC value
Name
586
Polynomial
12
11
CRC-12
CRC-16
X16
CRC-32
CRC-CCITT
X16 + X12 + X5 + 1
+x
+
X15
+X +X +X+1
+ X2 + 1
21
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When any digits other than 4 digits are specified as
code: K6706)
or
22
+n-1 or
Program example
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.
M8000
M8161
D100
D0
24
K7
FNC181-FNC189
Others
FNC188
CRC
Contents of data
Target data
D100
3130H
D101
3332H
D102
3534H
D0
3736H
2ACFH
30H
High-order byte
31H
Low-order byte
32H
High-order byte
33H
Low-order byte
34H
High-order byte
35H
Low-order byte
36H
Low-order byte
CFH
High-order byte
2AH
25
26
FNC200-FNC209
Character String
Control
D103
Low-order byte
FNC190-FNC199
Block Data
Operation
27
M8161
FNC188
CRC
D100
D0
FNC210-FNC219
Data
Operation 3
M8000
M0
23
FNC180
Alternate
Instructions
M0
FNC170-FNC179
External Device
FNC160-FNC169
Real Time Clock
Control
Errors
K7
28
Low-order byte
30H
D101
Low-order byte
31H
D102
Low-order byte
32H
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
D1
Low-order byte
2AH
29
FNC250-FNC269
Data Table
Operation
D100
FNC220-FNC249
Data
Comparison
30
FNC270-FNC274
Ex-Device
Inverter Comms
587
24.5
Outline
This instruction updates the current value of a specified high speed counter or ring counter.
The function of this instruction varies depending on the PLC version.
1. Instruction format
FNC 189
D HCMOV
16-bit Instruction
Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
13 steps DHCMOV
2. Set data
Operand Type
Description
Data Type
counter*1
handled as transfer
Specification to clear the current value of high speed counter or ring counter*1
(transfer source) after transfer [clear (K1), no clear (K0)]
32-bit binary
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
ConReal
CharacPointer
stant Number ter String
Z Modify K H
""
S S
3 3
3 3
S: Only high speed counters (C235 to C255) and ring counters (D8099 and D8398)*1 can be specified.
FNC189
DHCMOV
Ring counter
*1
C235 to C255
D8099
D8398
+1,
is transferred to [
+1,
+1,
+1,
"0" is stored in
+1.
After transfer, the current value of the high speed counter or ring counter is processed as shown in the
table below depending on the set value of "n":
"n" set value
*1.
588
Operation
K0 (H0)
K1 (H1)
Ring counters (D8099 and D8398) cannot be specified in FX3UC PLCs before Ver.2.20.
21
Software counter
By using DHCMOV instruction, the current value can be updated and transferred when it is executed.
By using both input interrupt and DHCMOV instruction, the current value of a high speed counter can
be received at the rising edge or falling edge of an external input (at reception of input interrupt).
Refer to the Program example 2.
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
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.The following points
must be kept in mind when using the DHCMOV command.
- When the current value of a high speed 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.
For the condition in which a hardware counter is handled as a software counter,
refer to Subsection 4.7.9.
- When the number of high speed software counter comparison instructions is reduced, the total
frequency limitation is decreased.
For the limitation in software counters by the total frequency,
refer to Subsection 4.7.10.
- 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 desighnated high speed counter comparison
instruction (HSCS, HSCR or HSZ).
- DHCMOV instruction can be used as many times as necessary.
23
FNC180
Alternate
Instructions
22
FNC170-FNC179
External Device
FNC160-FNC169
Real Time Clock
Control
2. High speed counter current value update timing and the effect of DHCMOV instruction
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
589
Cautions
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.
1) Program EI (FNC 04) and FEND (FNC 06) instructions in the main program. They are necessary to
execute an input interrupt program.
For EI (FNC 04) and FEND (FNC 06) instructions, refer to Section 8.5 and Section 8.6.
2) When programming DHCMOV instruction in the 1st line in an input interrupt program, make sure to use
the pattern program shown below.
Make sure to use the command contact M8394.
I
M8394
FNC189
DHCMOV
FNC 03
IRET
3) If two or more DHCMOV instructions are used in one input interrupt program, only the first instruction (just
after the interrupt pointer) is executed when the interrupt is generated.
The rest of the interrupt, including additional DHCMOV instructions, is executed according to normal
interrupt processing.
Do not use M8394 as the command contact for the DHCMOV instructions following the first.
I301
M8394
M8000
FNC189
DHCMOV
FNC189
DHCMOV
D
'
'
n'
FNC 03
IRET
4) It is not permitted to use DHCMOV instruction for the same counter in two or more input interrupt
programs.
I000 M8394
FNC189
DHCMOV
C236
D0
FNC03
IRET
Same counter
I200
M8394
FNC189
DHCMOV
C236
K0
D2
K1
FNC03
IRET
590
M8050*1
I000,I001
X000
M8051*1
I100,I101
X001
M8052*1
I200,I201
X002
M8053*1
I300,I301
X003
M8054*1
I400,I401
X004
M8055*1
I500,I501
X005
22
FNC170-FNC179
External Device
*1.
23
24
FNC181-FNC189
Others
The function of FNC189 instruction changes depending on the version as shown in the table below.
Applicable version
Item
FX3UC
Ver.2.20 or
later
Ver.2.20 or
later
Outline of function
Target device
25
An operation error occurs in the following case; The error flag M8067 turns ON, and the error code is stored in
D8067.
S
or [ D
+1,
1. Program example 1
In the program example below, the current value of the high speed counter C235 is compared in each
operation cycle, and then the output Y000 is set to ON if the current value is "K500" or more (when the current
value of C235 is not cleared).
FNC189
DHCMOV
FNC238
DAND>=
D0
C235
K500
D0
K0*
Y000
28
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.
FNC220-FNC249
Data
Comparison
END
*1.
27
FNC210-FNC219
Data
Operation 3
M8000
26
FNC200-FNC209
Character String
Control
Program examples
FNC190-FNC199
Block Data
Operation
Error
FNC180
Alternate
Instructions
6) 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 interrupts are enabled.
FX3U
21
FNC160-FNC169
Real Time Clock
Control
5) While input interrupts are disabled by the interrupt disable flags (shown in the table below), DHCMOV
instructions are not executed when they are placed inside a corresponding interrupt.
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
591
2. Program example 2
In the program example shown below, the current value of C235 is transferred to D201 and D200, and the
current value of C235 is cleared when X001 turns from OFF to ON.
0
EI
FEND
M8394
I101
FNC189
DHCMOV
C235
D200
K1*1
IRET
*1.
592
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.
21
FNC160-FNC169
Real Time Clock
Control
22
FNC190 to FNC199 provide instructions for adding, subtracting and comparing block data.
Symbol
Function
Reference
191
192
BK+
BK+
S1 S2 D n
Section
25.1
193
BK
BK-
S1 S2 D n
Section
25.2
194
BKCMP=
BKCMP= S1 S2 D n
S1 = S2
Section
25.3
195
BKCMP>
BKCMP> S1 S2 D n
S1 > S2
Section
25.3
196
BKCMP<
BKCMP< S1 S2 D n
S1 < S2
Section
25.3
BKCMP<> S1 S2 D n
S1 S2
198
BKCMP<=
BKCMP<= S1 S2 D n
S1 S2
Section
25.3
S1 S2
Section
25.3
199
BKCMP>=
BKCMP>= S1 S2 D n
25
26
27
FNC210-FNC219
Data
Operation 3
BKCMP<>
24
FNC200-FNC209
Character String
Control
197
Section
25.3
23
FNC190-FNC199
Block Data
Operation
FNC181-FNC189
Others
190
FNC180
Alternate
Instructions
Mnemonic
FNC170-FNC179
External Device
FNC No.
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
593
25.1
Outline
This instruction adds binary block data.
1. Instruction format
FNC 192
D
P
BK+
16-bit Instruction
9 steps
Mnemonic
BK+
BK+P
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DBK+
DBK+P
17 steps
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
S1
S2
Number of data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
S2
3 3 3 3
3 3 3 3
3 3
""
3 3
3 3
FNC192
BK+
S1
S2
1) "n" 16-bit binary data starting from S2 are added to "n" 16-bit binary data starting from S1
operation result is stored in "n" points starting from D .
b15
b0
K1234
+1
K4567
+2
K-2000
S1 +0
+(n-2)
+(n-1)
b15
b0
K4000
+1
K1234
+2
K-1234
S2 +0
"n"
points
+(n-2)
+(n-1)
K-1234
K4000
K5000
K4321
b15
b0
K5234
+1
K5801
+2
K-3234
D +0
"n"
points
+(n-2)
+(n-1)
594
K-1234
K4000
"n"
points
K3766
K8321
b15
b0
K5555
+1
K8888
+2
K2321
D +0
"n"
points
S2
K4321
+(n-2)
+(n-1)
K3087
K8321
"n"
points
, and the
21
Command
input
FNC192
DBK+P
S1
S2
FNC160-FNC169
Real Time Clock
Control
[ S1 +1, S1 ]
[ S1 +3, S1 +2]
[ S1 +5, S1 +4]
b31
b0
K1234
K40000
K-2000
"n"
points +
b31
b0
K4000
K1234
K-1234
[ S2 +2n-3, S2 +2n-4]
[ S2 +2n-1, S2 +2n-2]
K-1234
K4000
23
"n"
points
K5000
K4321
[ D +1, D ]
[ D +3, D +2]
[ D +5, D +4]
b31
b0
K5234
K41234
K-3234
K3766
K8321
"n"
points
[ S2 +1, S2 ]
].
K4321
[ D +1, D ]
[ D +3, D +2]
[ D +5, D +4]
b31
b0
K5555
K44321
K2321
[ D +2n-3, D +2n-4]
[ D +2n-1, D +2n-2]
26
"n"
points
K3087
K8321
27
FNC210-FNC219
Data
Operation 3
Related instruction
Instruction
BK- (FNC193)
Description
Subtracts binary block data.
28
1) When underflow or overflow occurs in the operation result, the following processing is executed. At this
time, the carry flag does not turn ON.
- In the case of 16-bit operation
+
K2(H0002)
K-32767(H8001)
K-2(HFFFE)
K32766(H7FFE)
K2(H00000002)
K-2,147,483,647(H80000001)
K-2,147,483,648(H80000000)
K-2(HFFFFFFFE)
K2,147,483,646(H7FFFFFFE)
29
FNC250-FNC269
Data Table
Operation
K32767(H7FFF)
FNC220-FNC249
Data
Comparison
Caution
K-32768(H8000)
25
FNC200-FNC209
Character String
Control
K-1234
K4000
[ S1 +2n-3, S1 +2n-4]
[ S1 +2n-1, S1 +2n-2]
+1, S2
24
FNC190-FNC199
Block Data
Operation
b31
b0
K1234
K40000
K-2000
"n"
points
FNC181-FNC189
Others
[ D +2n-3, D +2n-4]
[ D +2n-1, D +2n-2]
[ S1 +1, S1 ]
[ S1 +3, S1 +2]
[ S1 +5, S1 +4]
FNC180
Alternate
Instructions
[ S1 +2n-3, S1 +2n-4]
[ S1 +2n-1, S1 +2n-2]
[ S2 +1, S2 ]
[ S2 +3, S2 +2]
[ S2 +5, S2 +4]
22
FNC170-FNC179
External Device
1) "2n" 32-bit binary data starting from [ S2 +1, S2 ] are added to "2n" 32-bit binary data starting from
[ S1 +1, S1 ], and the operation result is stored in "2n" points starting from [ D +1, D ].
30
FNC270-FNC274
Ex-Device
Inverter Comms
595
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When "n" ("2n" in 32-bit operation) devices starting from S1
corresponding device range (error code: K6706)
, S2
, and/or
exceed the
Program example
In the program shown below, the specified number of data stored in D150 to D0 are added to the specified
number of data stored in D100 to D0 when X020 is set to ON, and the operation result is stored in D200 and
later.
X020
FNC192
BK+
D100
D150
D200
D0
When D0 is "4"
END
b15
D100
D101
D102
D103
D0
596
b15
b0
6789
7821
5432
3520
+
4
D150
D151
D152
D153
b15
b0
1234
2032
-3252
-1000
D200
D201
D202
D203
b0
8023
9853
2180
2520
21
FNC160-FNC169
Real Time Clock
Control
25.2
Outline
22
FNC 193
D
P
BK
Mnemonic
16-bit Instruction
9 steps
BK
BKP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
17 steps
FNC170-FNC179
External Device
1. Instruction format
Operation Condition
DBK
DBKP
Continuous
Operation
Pulse (Single)
Operation
23
Data Type
FNC180
Alternate
Instructions
24
2. Set data
Operand Type
Description
Head device number storing subtraction data
S2
FNC181-FNC189
Others
S1
Number of data
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
25
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
S2
3 3 3 3
3 3 3 3
3 3
""
FNC190-FNC199
Block Data
Operation
Operand
Type
3 3
26
FNC200-FNC209
Character String
Control
3 3
S1
S2
27
D
1) "n" 16-bit binary data starting from S2 are subtracted from "n" 16-bit binary data starting from S1
and the operation result is stored in "n" points starting from D .
+(n-2)
+(n-1)
b15
b0
K1234
+1
K5678
+2
K9876
S2 +0
"n"
points
K5000
K4352
+(n-2)
+(n-1)
K4321
K4000
b15
b0
K7531
+1
K3210
+2
K-551
D +0
"n"
points
b15
b0
K8765
+1
K8888
+2
K9325
K5000
K4352
D +0
"n"
points
S2
K8880
b0
+1
+2
K-115
K8
K445
+(n-2)
+(n-1)
K-3880
K-4528
30
"n"
points
FNC270-FNC274
Ex-Device
Inverter Comms
+(n-2)
+(n-1)
.
b15
S1 +0
29
FNC250-FNC269
Data Table
Operation
"n"
points
K679
K352
+(n-2)
+(n-1)
28
FNC220-FNC249
Data
Comparison
b15
b0
K8765
+1
K8888
+2
K9325
S1 +0
FNC210-FNC219
Data
Operation 3
Command
input
597
FNC193
DBK-P
S1
S2
1) "2n" 32-bit binary data starting from [ S2 +1, S2 ] are subtracted from "2n" 32-bit binary data starting
from [ S1 +1, S1 ], and the operation result is stored in "2n" points starting from [ D +1, D ].
b31
b31
b0
[ S1 +1, S1 ]
[ S1 +3, S1 +2]
[ S1 +5, S1 +4]
K8765
K8888
K9325
[ S1 +2n-3, S1 +2n-4]
[ S1 +2n-1, S1 +2n-2]
K50000
K4352
"n"
points
b0
[ S2 +1, S2 ]
[ S2 +3, S2 +2]
[ S2 +5, S2 +4]
K1234
K5678
K9876
[ S2 +2n-3, S2 +2n-4]
[ S2 +2n-1, S2 +2n-2]
K4321
K4000
"n"
points
b31
b0
[ D +1, D ]
[ D +3, D +2]
[ D +5, D +4]
K7531
K3210
K-551
[ D +2n-3, D +2n-4]
[ D +2n-1, D +2n-2]
K45679
K352
b31
b0
K8765
K8888
K9325
[ S1 +2n-3, S1 +2n-4]
[ S1 +2n-1, S1 +2n-2]
"n"
points
[ S2 +1, S2 ]
"n"
points
+1, S2
].
K8880
K50000
K4352
b31
[ D +1, D ]
[ D +3, D +2]
[ D +5, D +4]
[ D +2n-3, D +2n-4]
[ D +2n-1, D +2n-2]
b0
K-115
K8
K445
"n"
points
K41120
K-4528
Related instruction
Instruction
BK+ (FNC192)
Description
Adds binary block data.
Caution
1) When underflow or overflow occurs in the operation result, the following processing is executed. At this
time, the carry flag does not turn ON.
- In the case of 16-bit operation
K-32768(H8000)
K2(H0002)
K32766(H7FFE)
K32767(H7FFF)
K-2(HFFFE)
K-32767(H8001)
598
K-2,147,483,648(H80000000)
K2(H00000002)
K2,147,483,646(H7FFFFFFE)
K2,147,483,647(H7FFFFFFF)
K-2(HFFFFFFFE)
K-2,147,483,647(H80000001)
21
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
, S2
, and/or
exceed the
22
FNC170-FNC179
External Device
23
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.
FNC193
BK-P
D100
K8765
D200
K3
24
FNC181-FNC189
Others
END
b15
b0
K12345
K8701
K3502
b15
b0
K8765
D200
D201
D202
b15
b0
K3580
K-64
K-5263
25
FNC190-FNC199
Block Data
Operation
D100
D101
D102
FNC180
Alternate
Instructions
Program example
X010
FNC160-FNC169
Real Time Clock
Control
Errors
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
599
25.3
FNC194~199 BKCMP=, >, <, < >, <=, >= / Block Data Compare
Outline
These instructions compare block data in the comparison condition set in each instruction.
1. Instruction format
FNC 194
D BKCMP= P
16-bit Instruction
FNC 195
D BKCMP> P
16-bit Instruction
FNC 196
D BKCMP< P
16-bit Instruction
FNC 197
D BKCMP<> P
16-bit Instruction
FNC 198
D BKCMP<= P
16-bit Instruction
FNC 199
D BKCMP>= P
16-bit Instruction
9 steps
9 steps
9 steps
9 steps
Mnemonic
BKCMP=
BKCMP=P
Mnemonic
BKCMP>
BKCMP>P
Mnemonic
BKCMP<
BKCMP<P
Mnemonic
BKCMP<>
BKCMP<>P
Mnemonic
BKCMP<=
9 steps
BKCMP<=P
Mnemonic
BKCMP>=
9 steps
BKCMP>=P
Operation Condition
Operation Condition
Operation Condition
DBKCMP=
17 steps
DBKCMP=P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DBKCMP>
17 steps
DBKCMP>P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
17 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DBKCMP<>
DBKCMP<>P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DBKCMP<=
17 steps
DBKCMP<=P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DBKCMP<
17 steps
DBKCMP<P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DBKCMP>=
17 steps
DBKCMP>=P
Continuous
Operation
Pulse (Single)
Operation
Description
Data Type
S1
S2
Bit
Bit Devices
Word Devices
System User
Digit Specification
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
S2
3 3 3 3
3 3
3 3
3
3 3
600
Others
Special
Unit
3 3
""
21
1. 16-bit operation (BKCMP=, >, <, <>, <=, >= / BKCMP=P, >P, <P, <>P, <=P, and >=P)
1) "n" 16-bit binary data starting from S1 are compared with "n" 16-bit binary data starting from S2
and the comparison result is stored in "n" points starting from D .
S1 +0
+n-2
+n-1
K7777
K4321
S2
S2 +0
"n"
points
+1
+2
K5321
K3399
K5678
+n-2
+n-1
K6543
K1200
*3
>
Comparison result
OFF(0)
ON(1)
+1
OFF(0)
+2
"n"
points
D +0
"n"
points
23
ON(1)
ON(1)
+n-2
+n-1
S2 +0
+1
+2
*4
S1
K32000
K32000
K4321
K32000
Comparison result
ON(1)
OFF(0)
+1
+2
ON(1)
"n"
points
D +0
"n"
points
K1234
K5678
25
OFF(0)
OFF(0)
+n-2
+n-1
FNC190-FNC199
Block Data
Operation
24
FNC181-FNC189
Others
22
FNC180
Alternate
Instructions
+1
+2
K1234
K5678
K5000
S1
FNC170-FNC179
External Device
Command
input
FNCOOO*1
BKCMP*2
FNC160-FNC169
Real Time Clock
Control
S1
= S2
S1
<> S2
BKCMP>(FNC195)
S1
> S2
S1
<= S2
BKCMP<(FNC196)
S1
< S2
S1
>= S2
S1
<> S2
S1
= S2
BKCMP<=(FNC198)
S1
<= S2
S1
> S2
BKCMP>=(FNC199)
S1
>= S2
S1
< S2
4) When the comparison result is ON (1) in all of "n" points starting from
signal) turns ON.
27
FNC210-FNC219
Data
Operation 3
BKCMP<>(FNC197)
26
FNC200-FNC209
Character String
Control
BKCMP=(FNC194)
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
601
2. 32-bit operation (DBKCMP=, >, <, <>, <=, >= / DBKCMP=P, >P, <P, <>P, <=P, and >=P)
1) "n" 32-bit binary data starting from [ S1 +1, S1 ] are compared with "n" 32-bit binary data starting
from [ S2 +1, S2 ], and the comparison result is stored in "n" points starting from [ D +1, D ].
Command
input
FNCOOO*1
S1
DBKCMP*2
S2
[ S1 +1, S1 ]
[ S1 +3, S1 +2]
[ S1 +5, S1 +4]
K1234
K5678
K5000
[ S1 +2n-3, S1 +2n-4]
[ S1 +2n-1, S1 +2n-2]
K40000
K4321
*3
"n"
points
>
[ S2 +1, S2 ]
[ S2 +3, S2 +2]
[ S2 +5, S2 +4]
K5321
K3399
K5678
[ S2 +2n-3, S2 +2n-4]
[ S2 +2n-1, S2 +2n-2]
K6543
K1200
"n"
points
Comparison result
OFF(0)
+1
ON(1)
OFF(0)
+2
"n"
points
D +0
+n-2
+n-1
K32000
K4321
K32000
[ S2 +2n-3, S2 +2n-4]
[ S2 +2n-1, S2 +2n-2]
K1234
K5678
K32000
].
[ S2 +1, S2 ]
[ S2 +3, S2 +2]
[ S2 +5, S2 +4]
*4
[ S1 +1, S1 ]
+1, S1
ON(1)
ON(1)
"n"
points
Comparison result
ON(1)
D +0
+1
OFF(0)
+2
ON(1)
"n"
points
+n-2
+n-1
OFF(0)
OFF(0)
3) The table below shows the comparison result for each instruction:
Instruction
DBKCMP=(FNC194)
[ S1
+1, S1
] = [ S2
+1, S2
[ S1
+1, S1
] [ S2
+1, S2
DBKCMP>(FNC195)
[ S1
+1, S1
] > [ S2
+1, S2
[ S1
+1, S1
] <= [ S2
+1, S2
DBKCMP<(FNC196)
[ S1
+1, S1
]< [ S2
+1, S2
[ S1
+1, S1
] >= [ S2
+1, S2
DBKCMP<>(FNC197)
[ S1
+1, S1
] [ S2
+1, S2
[ S1
+1, S1
] = [ S2
+1, S2
DBKCMP<=(FNC198)
[ S1
+1, S1
] <= [ S2
+1, S2
[ S1
+1, S1
] > [ S2
+1, S2
DBKCMP>=(FNC199)
[ S1
+1, S1
] >= [ S2
+1, S2
[ S1
+1, S1
] < [ S2
+1, S2
4) When the comparison result is ON (1) in all of "n" points starting from [ D
comparison signal) turns ON.
+1,
Related device
For the block comparison signal use method, refer to Subsection 6.5.2.
Device
M8090
602
Name
Description
Turns ON when all comparison results are "ON (1)" in a block data instruction.
Block comparison signal DBKCMP= (FNC194), DBKCMP> (FNC195), DBKCMP< (FNC196), DBKCMP<>
(FNC197), DBKCMP<= (FNC198), and DBKCMP>= (FNC199)
21
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
and/or S2
exceeds the
25
FNC190-FNC199
Block Data
Operation
When a 32-bit counter (C200 to C255) is specified in S1 and/or S2 in 16-bit operation (error code:
K6705)
For comparing 32-bit counters, make sure to use an instruction for 32-bit operation (DBKCMP=,
DBKCMP>, DBKCMP<, DBKCMP<>, DBKCMP<=, or DBKCMP>=).
24
FNC181-FNC189
Others
23
FNC180
Alternate
Instructions
When the range of "n" ("2n" in 32-bit operation) points starting from S1
corresponding device range (error code: K6706)
22
FNC170-FNC179
External Device
FNC160-FNC169
Real Time Clock
Control
Caution
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
603
Program example
1) In the program shown below, four 16-bit binary data starting from D100 are compared with four 16-bit
binary data starting from D200 by BKCMP= (FNC194) instruction when X020 is set to ON, and the
comparison result is stored in four points starting from M10.
When the comparison result is "ON (1)" in all of the four points starting from M10, Y000 is set to ON.
X020
FNC194
BKCMP=
D100
D200
M10
K4
M8090
Y000
END
D100
D101
D102
D103
K1000
K2000
K3000
K4000
D200
D201
D202
D203
K1000
K2000
K5000
K4000
M10
M11
M12
M13
Comparison
result
ON
ON
OFF
ON
Y000
OFF
2) In the program shown below, the constant K1000 is compared with four data starting from D10 when
X010 is set to ON, and the comparison result is stored in b4 to b7 of D0.
X010
FNC197
BKCMP<>
K1000
D10
D0.4
K4
END
K1000
604
<>
D10
D11
D12
D13
K2000
K1000
K1000
K2222
b15
b7
b4
b0
D0 before
operation 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0
D0 after
operation
b15
b7
b4
b0
0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0
21
FNC160-FNC169
Real Time Clock
Control
Symbol
Function
200
STR
STR
S1 S2 D
Section
26.1
201
VAL
VAL
S D1 D2
Section
26.2
202
$+
$+
S1 S2 D
Section
26.3
203
LEN
Section
26.4
204
RIGHT
205
LEFT
LEN
S D
Reference
RIGHT
S D n
Section
26.5
LEFT
S D n
Section
26.6
MIDR S1 D S2
207
MIDW
MIDW S1 D S2
Section
26.8
208
INSTR
INSTR S1 S2 D n
Section
26.9
209
$MOV
$MOV S D
Section
26.10
25
26
FNC200-FNC209
Character String
Control
MIDR
24
FNC190-FNC199
Block Data
Operation
206
Section
26.7
23
FNC181-FNC189
Others
Mnemonic
FNC180
Alternate
Instructions
FNC No.
22
FNC170-FNC179
External Device
FNC200 to FNC209 provide instructions for controlling character strings such as linking character string data,
replacing some characters and extracting character string data.
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
605
26.1
Outline
This instruction converts binary data into character strings (ASCII codes).
On the other hand, the ESTR (FNC116) instruction converts floating point data into character strings.
For character strings, refer to Section 5.3.
For ESTR (FNC116) instruction, refer to Section 18.4.
1. Instruction format
FNC 200
P
STR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
STR
STRP
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DSTR
DSTRP
2. Set data
Operand Type
Description
Data Type
S1
16-bit binary
S2
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
606
Special
Unit
Z Modify K H
3 3 3 3
3
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
S1
S2
System User
Others
3
3
3 3
3
3
3 3
""
21
S1 +0
S1
S2
D
b15
Number of all
digits
D +0
of decimal part
+1
+2
+3
Sign
S1 +0
+1
b15
- 1 2
b8 b7
31H(1)
2DH(-)
+1
2EH(.)
32H(2)
+2
00H
33H(3)
For number of
all digits
S1 =5
-123
3) Set the number of digits of the decimal part S1 +1 in the range from 0 to 5.
Make sure to satisfy "Number of digits of decimal part <= (Number of all digits -3)".
4) 16-bit binary data to be converted stored in S2
25
26
FNC200-FNC209
Character String
Control
b0
D +0
FNC190-FNC199
Block Data
Operation
S2
24
5
1
16-bit binary
data
For number of
all digits
For value
stored in S1
0000H
+4
16-bit binary
data
23
FNC181-FNC189
Others
S2
b0
FNC180
Alternate
Instructions
+1 Number of digits
b8 b7
22
FNC170-FNC179
External Device
Command
input
FNC200
STR
FNC160-FNC169
Real Time Clock
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
- As the sign, "space" (20H) is stored when the 16-bit binary data stored in S2 is positive, and "-"
(2DH) is stored when the 16-bit binary data stored in S2 is negative.
- When the number of digits of the
Number of
6
all digits
decimal part S1 +1 is set to any
Number
of
2
value other than "0", the decimal point
digits of
1 2 3 4
decimal part
"." (2EH) is automatically added in
Number of digits of
16-bit
"number of digits of decimal part + 1"th
1234
decimal part
binary data
digit.
It is automatically
When the number of digits of the
added.
decimal part S1 +1 is set to "0", the
decimal point is not added.
- When the number of digits of the
Number of
6
all digits
decimal part S1 +1 is larger than the
Number
of
3
number of digits of 16-bit binary data
digits of
0 0 1 2
decimal part
stored in S2 , "0" (30H) is
16-bit
It is automatically
12
automatically added, and the data is
binary data
added.
shifted to the right end during
conversion.
30
FNC270-FNC274
Ex-Device
Inverter Comms
607
S1
S2
D
b15
Number of all
digits
D +0
Number of digits
+1 of decimal part
+1
+2
+3
Sign
S2 +1
b31
S2
b16 b15
+4
b0
00H
+5
b8 b7
b15
- 6 5 4
S2 +1
ASCII code
indicating sign
ASCII code in "(Value
specifying number of all
digits - 2)"th digit
ASCII code in "(Value
specifying number of all
digits - 4)"th digit
ASCII code in "(Value
specifying number of all
digits - 6)"th digit
ASCII code in "(Value
specifying number of all
digits - 8)"th digit
ASCII code in "(Value
specifying number of all
digits - 10)"th digit
For number of
all digits
For value
stored in S1
S1 +0
32-bit
binary data
b0
3 2 1
S2
-654321
b8 b7
b0
D +0
36H(6)
2DH(-)
+1
34H(4)
35H(5)
+2
33H(3)
2EH(.)
+3
31H(1)
32H(2)
For number of
all digits
S1 =8
0000H
+4
3) Set the number of digits of the decimal part S1 +1 in the range from 0 to 10.
Make sure to satisfy "Number of digits of decimal part <= (Number of all digits -3)".
4) 32-bit binary data to be converted stored in [ S2
2,147,483,648 to +2,147,483,647.
608
+1,
S2
21
D
Converts a character string (ASCII codes) into binary floating point data.
Converts a character string (ASCII codes) into binary data.
28
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
is outside the following range (error code: K6706)
29
Setting range
30
Setting range
0 to 5
32-bit operation
0 to 10
FNC270-FNC274
Ex-Device
Inverter Comms
16-bit operation
FNC250-FNC269
Data Table
Operation
FNC220-FNC249
Data
Comparison
Errors
2 to 13
FNC210-FNC219
Data
Operation 3
EVAL(FNC117)
32-bit operation
26
FNC200-FNC209
Character String
Control
Converts binary floating point data into a character string (ASCII codes) with a specified number
of digits.
2 to 8
25
FNC190-FNC199
Block Data
Operation
ESTR(FNC116)
16-bit operation
FNC181-FNC189
Others
Description
24
27
Instruction
VAL(FNC201)
23
FNC180
Alternate
Instructions
Related instructions
22
FNC170-FNC179
External Device
- For the sign, "space" (20H) is stored when the 32-bit binary data stored in S2 is positive, and "(2DH)" is stored when the 32-bit binary data stored in S2 is negative.
- When the number of digits of the
Number of
10
decimal part S1 +1 is set to any all digits
Number
of
3
value other than "0", the decimal
digits of
1 2 3 4 5 6 7 8
decimal part
point "." (2EH) is automatically
Number of digits of
32-bit
added in "number of digits of
12345678
decimal part
binary data
decimal part + 1"th digit.
It is automatically added.
When the number of digits of the
decimal part S1 +1 is set to "0",
the decimal point is not added.
- When the number of digits of the
Number of
13
all digits
decimal part S1 +1 is larger than the
Number
of
10
number of digits of 32-bit binary data
digits of
0 0 0 0 0 0 5 4 3 2 1
decimal
part
stored in [ S2 +1, S2 ], "0" (30H) is
16-bit
54321
automatically added, and the data is
binary data
shifted to the right end during
It is automatically added.
conversion.
- When the number of all digits stored in
Number of
13
all digits
S1 excluding the sign and decimal
Number
of
2
point is larger than the number of digits
digits of
5 4 3 2 1 0
of 32-bit binary data stored in [ S2 +1, decimal part
"20H"
(space)
is stored in
32-bit
-543210
S2 ], "space" (20H) is stored in each
each digit.
binary data
digit between the sign and the numeric
value.
When the number of all digits stored in S1 excluding the sign and decimal point is smaller than the
number of digits of 32-bit binary data stored in [ S2 +1, S2 ], an error is caused.
- "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 final character.
FNC160-FNC169
Real Time Clock
Control
609
When the relationship between the number of all digits stored in S1 and the number of digits of the
decimal part stored in S1 +1 does not satisfy the following (error code: K6706)
(Number of all digits -3) Number of digits of decimal part
When the number of all digits stored in S1 including the digit for sign and the digit for decimal point is
smaller than the number of digits of the binary data stored in [ S2 +1, S2 ] (error code: K6706)
When the devices D
(error code: K6706)
and later storing a character string exceeds the corresponding device range
Program example
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.
X000
FNC200
STRP
FNC 12
MOVP
K12672
D10
FNC 12
MOVP
K6
D0
FNC 12
MOVP
K0
D1
D10
D20
D0
END
b15
610
D10
12672
D0
D1
6
0
"
12672"
D20
D21
D22
D23
31H(1)
36H(6)
32H(2)
b8 b7
b0
20H(space)
32H(2)
37H(7)
0000H
21
FNC160-FNC169
Real Time Clock
Control
26.2
Outline
1. Instruction format
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
VAL
VALP
23
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
13 steps DVAL
DVALP
24
2. Set data
Description
Data Type
Head device number storing a character string to be converted into binary data
Character string
D1
Head device number storing the number of all digits of the binary data acquired
by conversion
D2
16-bit binary
16- or 32-bit binary
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
D1
3 3 3 3
D2
3 3 3 3
""
26
FNC200-FNC209
Character String
Control
25
FNC190-FNC199
Block Data
Operation
3. Applicable devices
FNC181-FNC189
Others
Operand Type
Operand
Type
FNC180
Alternate
Instructions
FNC 201
D
P
VAL
22
FNC170-FNC179
External Device
This instruction converts a character string (ASCII codes) into binary data.
On the other hand, EVAL (FNC117) instruction converts a character string (ASCII codes) into floating point
data.
For character strings, refer to Section 5.3.
For EVAL (FNC117) instruction, refer to Section 18.5.
27
FNC210-FNC219
Data
Operation 3
Command
input
FNC201
VAL
b15
D1
D2
b8 b7
+1
+2
+3
00H
of decimal part
30
FNC270-FNC274
Ex-Device
Inverter Comms
D2
Integer value in
which decimal
point is ignored
29
FNC250-FNC269
Data Table
Operation
7th character
2nd character
1st character
Sign
S +0
+4
Number of all
digits
D1 +0
+1 Number of digits
b0
28
FNC220-FNC249
Data
Comparison
611
b8 b7
b0
S +0
31H(1)
2DH(-)
+1
33H(3)
32H(2)
+2
34H(4)
2EH( )
+3
00H
35H(5)
D1 +0
+1
- 1 2 3
4 5
D2
7
2
-12345
2 to 8
32768 to +32767
Example: 123.45 12345
Sign
Decimal point
"." (2EH)
Number
3)
D1
stores the number of all digits. The number of all digits indicates the number of all characters
(including the number, sign and decimal point).
4)
D1 +1 stores the number of digits of the decimal part. The number of digits of the decimal part indicates
the number of all characters after the decimal point "." (2EH).
5)
D2 stores 16-bit data (bin) converted from a character string with the decimalpoint ignored.
In the character string located in S
and later, "space" (20H) and "0" (30H) characters between the
sign and the first number other than "0" are ignored in the conversion to 16-bit binary data.
1 2 3
Ignored
612
"Space" (20H)
4 5
Number of all
digits
Number of digits
of decimal part
16-bit binary
data
8
2
-12345
0
Sign
0 0 1 2
Ignored
Number of all
digits
Number of digits
of decimal part
16-bit binary
data
7
4
12
21
Command
input
FNC201
DVAL
b15
D1
b8 b7
D2
+1
+2
+4
+5
D2 +1
D2
Integer value in
which decimal
point is ignored
24
32-bit binary
data
b0
2DH(-)
+1
33H(3)
32H(2)
+2
35H(5)
34H(4)
+3
36H(6)
2EH(.)
+4
38H(8)
37H(7)
D1 +0
+1
- 1 2 3 4 5
6 7 8
10
3
-12345678
D2 +1
D2
00H
+5
2,147,483,648 to +2,147,483,647
Example: 12345.678 "12345678"
28
Sign
FNC220-FNC249
Data
Comparison
Character type
Positive numeric value
"Space" (20H)
Decimal point
"." (2EH)
Number
27
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
S +0
31H(1)
25
FNC190-FNC199
Block Data
Operation
b15
23
FNC181-FNC189
Others
00H
12th character
2nd character
1st character
Sign
+3
of decimal part
FNC180
Alternate
Instructions
S +0
+6
Number of all
digits
D1 +0
+1 Number of digits
b0
22
FNC170-FNC179
External Device
FNC160-FNC169
Real Time Clock
Control
29
stores the number of all digits. The number of all digits indicates the number of all characters
D1
(including the number, sign and decimal point).
4)
D1 +1 stores the number of digits of the decimal part. The number of digits of the decimal part
indicates the number of all characters after the decimal point "." (2EH).
FNC250-FNC269
Data Table
Operation
3)
30
FNC270-FNC274
Ex-Device
Inverter Comms
613
5) [ D2 +1, D2 ] stores 16-bit data (bin) converted from a character string with the decimal point ignored.
For the character string located in S
and later, the "space" (20H) and "0" (30H) characters between
the sign and the first number other than "0" are ignored in the conversion to 32-bit binary data.
6 5 4 3
2 1
Ignored
0 0 0 5 4 3 2 1
Sign
Ignored
12
2
-654321
11
54321
Related instructions
Instruction
Description
ESTR(FNC116)
Converts binary floating point data into a character string (ASCII code) with a specified number
of digits.
EVAL(FNC117)
Converts a character string (ASCII code) into binary floating point data.
STR(FNC200)
Caution
Store sign data, "space (20H)" or "- (2DH)", must be stored in the 1st byte (lower order 8 bits of the head
device set in S ).
Only the ASCII code data "0 (30H)" to "9 (39H)", "space (20H)" and "decimal point (2EH)" can be stored from
the 2nd byte to the "00H" at the end of the character string in S .
If "- (2DH)" is stored in the 2nd byte or later, an operation error (error code: K6706) occurs.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the number of characters of the character string to be converted ( S
following ranges (error code: K6706)
Setting range
16-bit operation
2 to 8
32-bit operation
2 to 13
When the number of characters after the decimal point of the character string to be converted ( S
later) is outside the following ranges (error code: K6706)
and
Setting range
16-bit operation
0 to 5
32-bit operation
0 to 10
When the relationship between the number of all characters in the character string to be converted ( S
and later) and the number of characters after the decimal point does not satisfy the following (error code:
K6706)
(Number of all characters -3) Number of characters after the decimal point
When the sign is set to any ASCII code other than "space" (20H) and "-" (2DH) (error code: K6706)
When a digit of a number is set to any ASCII code other than "0" (30H) to "9" (39H) or a decimal point "."
(2EH) (error code: K6706)
When the decimal point "." (2EH) is set two or more times in the character string to be converted ( S
and later) (error code: K6706)
614
21
FNC160-FNC169
Real Time Clock
Control
When the binary data acquired by conversion is outside the following range (error code: K6706)
Setting range
16-bit operation
32768 to 32767
32-bit operation
2,147,483,648 to 2,147,483,647
22
1) In the program below, the character string data stored in D20 to D22 is regarded as an integer value,
converted into a binary value, and stored in D0 when X000 is set to ON.
X000
D20
D10
23
D0
FNC180
Alternate
Instructions
FNC201
VALP
END
b15
b8 b7
31H(1)
2EH(.)
34H(4)
b0
2DH(-)
36H(6)
35H(5)
00H
D0
-1654
D10
D11
6
2
24
FNC181-FNC189
Others
D20
D21
D22
D23
FNC201
DVALP
D20
D10
D0
END
D20
D21
D22
D23
D24
D25
37H(7)
31H(1)
30H(0)
36H(6)
31H(1)
D0
D10
D11
D1
7910
10
3
26
D0
0611
Number of all digits
Number of digits of decimal part
27
FNC210-FNC219
Data
Operation 3
b8 b7
b0
20H(space)
39H(9)
30H(0)
2EH(.)
31H(1)
00H
FNC200-FNC209
Character String
Control
b15
25
FNC190-FNC199
Block Data
Operation
2) In the program below, the character string data stored in D20 to D24 is regarded as an integer value,
converted into a binary value, and stored in D0 when X000 is set to ON.
X000
FNC170-FNC179
External Device
Program example
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
615
26.3
Outline
This instruction links a character string to another character string.
For handling of character strings, refer to Section 5.3.
1. Instruction format
FNC 202
P
$+
16-bit Instruction
7 steps
Mnemonic
Operation Condition
$+
$+P
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
S1
Head device number storing the link source data (character string) or directly
specified character string
Data Type
S2
Head device number storing the link data (character string) or directly specified
character string
Character string
3. Applicable devices
Operand
Type
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
S1
3 3 3 3
S2
3 3 3 3
3 3 3 3
616
Bit Devices
21
Command
input
S1
b15---b8 b7----b0
46H(F) 48H(H)
S1 +1 2DH(-) 41H(A)
00H
S1 +2
S2
23
+
S2
b15---b8 b7----b0
35H(5) 31H(1)
S2 +1 39H(9) 33H(3)
41H(A)
S2 +2 00H
b15---b8 b7---b0
46H(F) 48H(H)
FNC180
Alternate
Instructions
S1
FNC202
$+
22
FNC170-FNC179
External Device
The character string data stored in S2 and later is linked to the end of the character string data stored in
S1 and later, and the linked data is stored to devices starting from D .
A character string stored in S1 or S2 or later indicates the data from the specified device to the first
"00H" in units of byte.
FNC160-FNC169
Real Time Clock
Control
S1
S1 +1
S2
D +3 39H(9) 33H(3)
D +4 00H 41H(A)
S2 +1
24
S2 +2
00H is automatically
stored.
start from "00H" (that is, when the number of characters is 0),
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
, S2
and
29
FNC250-FNC269
Data Table
Operation
When 00H is not set within the corresponding device range after the device specified by S1
(error code: K6706)
28
FNC220-FNC249
Data
Comparison
When the number of devices after a device number specified by D is smaller than the number of
devices required to store all linked character strings (that is, when 00H cannot be stored after all
character strings and the last character) (error code: K6706)
27
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
Cautions
25
FNC190-FNC199
Block Data
Operation
In linking, 00H indicating the end of a character string specified in S1 is ignored, and a character string
specified in S2 is linked to the last character specified in S1 .
When a character string is linked, 00H is automatically added at the end.
- When the number of characters after linking is odd, 00H is stored in the high-order byte of the device
storing the last character.
- When the number of characters after linking is even, 0000H is stored in the device after the last
character.
FNC181-FNC189
Others
D +1 2DH(-) 41H(A)
D +2 35H(5) 31H(1)
30
FNC270-FNC274
Ex-Device
Inverter Comms
617
Program example
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.
X000
FNC202
$+
D10
ABCD
D100
END
b15---b8 b7----b0
D10 62H(b) 61H(a)
D11 64H(d) 63H(c)
D12
00H
65H(e)
D100
ABCD
D101
64H(d) 63H(c)
D102
41H(A) 65H(e)
D103
43H(C) 42H(B)
D104
00H is automatically stored.
618
b15---b8 b7----b0
62H(b) 61H(a)
00H
44H(D)
21
FNC160-FNC169
Real Time Clock
Control
26.4
Outline
1. Instruction format
FNC 203
P
LEN
Mnemonic
16-bit Instruction
Operation Condition
LEN
LENP
5 steps
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
Description
Data Type
Character string
Device number storing the detected character string length (number of bytes)
16-bit binary
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S
D
Z Modify K H
3 3 3 3
3 3 3 3
""
25
FNC190-FNC199
Block Data
Operation
ConReal
CharacPointer
stant Number ter String
Index
24
FNC181-FNC189
Others
Operand
Type
22
FNC170-FNC179
External Device
This instruction detects the number of characters (bytes) of a specified character string.
For handling of character strings, refer to Section 5.3.
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
FNC203
LEN
b15----------b8 b7-------------b0
S
00H
FNC220-FNC249
Data
Comparison
S +n
28
b15---------------b0
D Character string
length
nth character
29
FNC250-FNC269
Data Table
Operation
b15----------b8 b7-------------b0
42H(B)
41H(A)
44H(D)
43H(C)
S +2
46H(F)
45H(E)
S +3
48H(H)
47H(G)
S +4
00H
49H(I)
ABCDEFGHI
D
b15---------------b0
9
30
FNC270-FNC274
Ex-Device
Inverter Comms
S +1
619
Caution
This instruction can handle character codes other than ASCII codes, but the character string length is
handled in byte units (8 bits). Accordingly, in the case of character codes in which 2 bytes express 1
character such as shift JIS codes, the length of 1 character is detected as 2.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When 00H is not set within the corresponding device range after a device specified by
K6706)
(error code:
When the detected number of characters is 32768 or more (error code: K6706)
Program example
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.
X000
FNC203
LEN
D0
D10
FNC 18
BCD
D10
K4Y40
END
D0
b15---b8 b7----b0
49H(I) 4DH(M)
D10
10
D1 53H(S) 54H(T)
D2 42H(B) 55H(U)
D3 53H(S)
D4
49H(I)
49H(I) 48H(H)
D5 41H(A)
00H
D6 43H(C) 42H(B)
620
MITSUBISHI
(Characters
ABC.......
after 00H are
ignored.)
Conversion
into BCD
Y057 to Y040
0 0 1 0
BCD
BCD value
26.5 FNC204 RIGHT / Extracting Character String Data from the Right
21
FNC160-FNC169
Real Time Clock
Control
26.5
Outline
1. Instruction format
FNC 204
RIGHT P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
RIGHT
RIGHTP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
Description
Data Type
Character string
16-bit binary
3. Applicable devices
S
D
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
25
FNC190-FNC199
Block Data
Operation
Operand
Type
24
FNC181-FNC189
Others
22
FNC170-FNC179
External Device
This instruction extracts a specified number of characters from the right end of a specified character string.
For handling of character strings, refer to Section 5.3.
26
3 3
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
621
26.5 FNC204 RIGHT / Extracting Character String Data from the Right
FNC204
RIGHT
b15----------------------b8b7-----------------------b0
ASCII code for 2nd
ASCII code for 1st
S
character
character
ASCII code for 4th
ASCII code for 3rd
S +1
character
character
b15----------------------b8b7-----------------------b0
D
D +1
00H
00H
In the case of n = 5
b15----------------------b8b7-----------------------b0
S
42H(B)
41H(A)
b15----------------------b8b7-----------------------b0
32H(2)
31H(1)
S +1
44H(D)
43H(C)
D +1
34H(4)
S +2
46H(F)
45H(E)
D +2
00H
S +3
32H(2)
31H(1)
S +4
34H(4)
33H(3)
S +5
00H
35H(5)
ABCDEF12345
33H(3)
35H(5)
12345
Cautions
When handling character codes other than ASCII codes, note the following contents:
The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in
which 2 bytes express 1 character such as shift JIS codes, the length of 1 character is detected as 2.
When extracting characters from a character string including character codes in which 2 bytes express 1
character such as shift JIS codes, consider the number of characters to be extracted in units of character
codes for 1 character.
Note that the expected character code is not given if only 1 byte is executed out of a 2-byte character code.
622
26.5 FNC204 RIGHT / Extracting Character String Data from the Right
21
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When 00H is not set within the corresponding device range after a device specified by S
K6706)
S
22
When the number of devices after a device number specified by D is smaller than the number of
devices required to store extracted n characters (that is, when 00H cannot be stored after all character
strings and the last character) (error code: K6706)
When n is a negative value (error code: K6706)
23
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.
FNC204
RIGHTP
R0
D0
24
K4
FNC181-FNC189
Others
END
b15----------------------b8b7-----------------------b0
41H(A)
42H(B)
R0
b15----------------------b8b7-----------------------b0
45H(E)
30H(0)
D0
31H(1)
32H(2)
D1
R2
45H(E)
30H(0)
D2
R3
41H(A)
46H(F)
00H
BA210EFA
41H(A)
25
46H(F)
FNC190-FNC199
Block Data
Operation
R1
R4
FNC180
Alternate
Instructions
Program example
X000
FNC170-FNC179
External Device
(error code:
FNC160-FNC169
Real Time Clock
Control
Errors
0000H
0EFA
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
623
26.6
26.6 FNC205 LEFT / Extracting Character String Data from the Left
Outline
This instruction extracts a specified number of characters from the left end of a specified character string.
For handling of character strings, refer to Section 5.3.
1. Instruction format
FNC 205
P
LEFT
16-bit Instruction
7 steps
Mnemonic
Operation Condition
LEFT
LEFTP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
Character string
16-bit binary
3. Applicable devices
Operand
Type
S
D
624
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
3 3
""
26.6 FNC205 LEFT / Extracting Character String Data from the Left
21
FNC205
LEFT
00H
24
25
FNC190-FNC199
Block Data
Operation
b15----------------------b8b7-----------------------b0
ASCII code for 2nd
ASCII code for 1st
character
character
D +1 ASCII code for 4th
ASCII code for 3rd
character
character
D
FNC181-FNC189
Others
b15----------------------b8b7-----------------------b0
ASCII code for 1st
ASCII code for 2nd
S
character
character
ASCII code for 3rd
ASCII code for 4th
S +1
character
character
ASCII code for n-1
character
ASCII code for n+1
character
23
FNC180
Alternate
Instructions
Command
input
22
FNC170-FNC179
External Device
n characters are extracted from the left end (that is, from the head) of the character string data stored in
S
and later and stored to D and later.
If the number of characters specified by n is 0, the NULL code (0000H) is stored to D .
When characters are extracted from a character string, "00H is automatically added at the end of the
extracted characters.
- When the number of extracted characters is odd, 00H is stored in the high-order byte of a device
storing the last character.
- When the number of extracted characters is even, 0000H is stored in the device after the last
character.
FNC160-FNC169
Real Time Clock
Control
S +1
44H(D)
43H(C)
D +1
44H(D)
43H(C)
S +2
46H(F)
45H(E)
D +2
46H(F)
45H(E)
S +3
32H(2)
31H(1)
D +3
00H
S +4
34H(4)
33H(3)
S +5
00H
27
31H(1)
"ABCDEF1"
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
35H(5)
"ABCDEF12345"
When handling character codes other than ASCII codes, note the following contents:
The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in
which 2 bytes express 1 character such as shift JIS codes, the length of 1 character is detected as 2.
29
FNC250-FNC269
Data Table
Operation
When extracting characters from a character string including character codes in which 2 bytes express 1
character such as shift JIS codes, consider the number of characters to be extracted in units of character
codes for 1 character.
Note that the expected character code is not given if only 1 byte is executed out of a 2-byte character code.
FNC220-FNC249
Data
Comparison
Cautions
28
30
FNC270-FNC274
Ex-Device
Inverter Comms
625
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When 00H is not set within the corresponding device range after a device specified by S
K6706)
When n exceeds the number of characters specified by
(error code:
When the number of devices after a device number specified by D is smaller than the number of
devices required to store extracted n characters (that is, when 00H cannot be stored after all character
strings and the last character) (error code: K6706)
When n is a negative value (error code: K6706)
Program example
In the program example shown below, the number of characters which is equivalent to the number stored in
D0 are 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.
X010
FNC205
LEFTP
D100
R10
D0
END
ASCII code for 1st character
D100
D101
4EH(N)
4FH(O)
D102
44H(D)
D103
42H(B)
D104
SQONHDAB
ASCII code for 6th character
626
b15----------------------b8b7-----------------------b0
51H(Q)
53H(S)
R10
b15----------------------b8b7-----------------------b0
51H(Q)
53H(S)
R11
4EH(N)
48H(H)
R12
44H(D)
41H(A)
R13
00H
D0
4FH(O)
48H(H)
0000H
SQONHD
21
FNC160-FNC169
Real Time Clock
Control
26.7
Outline
1. Instruction format
FNC 206
P
MIDR
16-bit Instruction
7 steps
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
23
FNC180
Alternate
Instructions
MIDR
MIDRP
2. Set data
Operand Type
Description
Data Type
Character string
Head device number specifying the head position and number of characters to be
extracted
S2
S2
16-bit binary
S2
24
25
+1 : Number of characters
System User
Word Devices
Digit Specification
D
S2
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3 3 3
""
26
FNC200-FNC209
Character String
Control
S1
Bit Devices
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
FNC181-FNC189
Others
S1
22
FNC170-FNC179
External Device
This instruction extracts a specified number of characters from arbitrary positions of a specified character
string.
For handling of character strings, refer to Section 5.3.
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
627
Command
input
FNC206
MIDR
S1
S2
S1
1st character
b15------------------b8b7-------------------b0
46H(F)
45H(E)
S1 +1
44H(D)
43H(C)
D +1
48H(H)
S1 +2
46H(F)
45H(E)
D +2
00H
S1 +3
48H(H)
47H(G)
S1 +4
4AH(J)
49H(I)
S1 +5
00H
4BH(K)
"ABCDEFGHIJK"
S2
S2 +1
47H(G)
49H(I)
"EFGHI"
5th character
S2
A character string stored in S1 and later indicates data stored in devices from the specified device until
00H is first detected in units of byte.
When the number of characters to be extracted specified by S2
not executed.
S1
628
b15-----------------b8 b7-------------------b0
42H(B)
41H(A)
b15-----------------b8b7-------------------b0
46H(F)
45H(E)
S1 +1
44H(D)
43H(C)
D +1
48H(H)
47H(G)
S1 +2
46H(F)
45H(E)
D +2
4AH(J)
49H(I)
S1 +3
48H(H)
47H(G)
D +3
00H
S1 +4
4AH(J)
49H(I)
S1 +5
00H
S2
S2 +1
-1
4BH(K)
ABCDEFGHIJK
4BH(K)
FEGHIJK
5th character
S2
21
When handling character codes other than ASCII codes, note the following contents:
The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in
which 2 bytes express 1 character such as shift JIS code, the length of 1 character is regarded as 2
characters.
Errors
When 00H is not set within the corresponding device range after a device specified by S1
K6706)
When the value specified by S2
K6706)
(error code:
exceeds the
When the number of devices after a device number specified by D is smaller than the number of
devices required to store extracted characters as many as the number specified by S2 +1 (that is, when
00H cannot be stored after all character strings and the last character) (error code: K6706)
specifies a negative value (error code: K6706)
When S2
26
In the program example shown below, four characters are extracted from the 3rd 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.
FNC206
MIDRP
D10
D0
27
R0
FNC210-FNC219
Data
Operation 3
END
3rd character
b15----------------------b8b7-----------------------b0
31H(1)
32H(2)
D0
D11
31H(1)
32H(2)
D1
D12
46H(E)
33H(3)
D2
D13
00H
45H(D)
46H(E)
28
FNC220-FNC249
Data
Comparison
b15---------------------b8 b7-----------------------b0
41H(A)
42H(B)
D10
33H(3)
0000H
213E
BA213ED
Four characters
starting from 3rd character
3
R1
29
Extracted characters
FNC250-FNC269
Data Table
Operation
R0
FNC200-FNC209
Character String
Control
Program example
X000
25
FNC190-FNC199
Block Data
Operation
When S2
24
FNC181-FNC189
Others
(error code:
23
FNC180
Alternate
Instructions
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
22
FNC170-FNC179
External Device
When extracting characters from a character string including character codes in which 2 bytes express 1
character such as shift JIS codes, consider the number of characters to be extracted in units of character
codes for 1 character.
Note that the expected character code is not given if only 1 byte is executed out of a 2-byte character code.
FNC160-FNC169
Real Time Clock
Control
Cautions
30
FNC270-FNC274
Ex-Device
Inverter Comms
629
26.8
Outline
This instruction replaces the characters in arbitrary positions inside designated character string with a
specified character string.
For handling of character strings, refer to Section 5.3.
1. Instruction format
FNC 207
MIDW P
16-bit Instruction
7 steps
Mnemonic
Operation Condition
MIDW
MIDWP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
S1
Character string
Head device number specifying the head position and number of characters to be
overwritten
S2
S2
16-bit binary
S2
3. Applicable devices
Operand
Type
S1
Bit Devices
System User
Word Devices
Digit Specification
D
S2
630
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3 3 3
""
21
+1 characters are extracted from the left end (that is, the head) of the character string data stored in
and later, and stored to the position specified by S2 and later of the character string data stored in
and later.
FNC207
MIDW
S1
S2
b15---------------b8b7-----------------b0
31H(1)
30H(0)
S1
S1 +1
33H(3)
32H(2)
D +1
44H(D)
43H(C)
S1 +2
35H(5)
34H(4)
D +2
46H(F)
45H(E)
S1 +3
37H(7)
36H(6)
D +3
48H(H)
47H(G)
S1 +4
00H
38H(8)
012345678
D +4
S2
S2 +1
00H
49H(I)
ABCDEFGHI
24
After execution
b15---------------b8b7-----------------b0
42H(B)
41H(A)
31H(1)
30H(0)
D +2
33H(3)
32H(2)
D +3
35H(5)
34H(4)
D +4
00H
3rd
character
25
FNC190-FNC199
Block Data
Operation
D +1
49H(I)
AB012345I
Six characters starting from 3rd
character (overwritten character string)
When the number of characters to be overwritten specified by S2 +1 exceeds the last character of the
character string stored in D
and later, data is stored up to the last character.
b15---------------b8b7-----------------b0
31H(1)
30H(0)
S1
S1 +1
33H(3)
32H(2)
1st
character
43H(C)
46H(F)
45H(E)
48H(H)
47H(G)
S1 +2
35H(5)
34H(4)
S1 +3
37H(7)
36H(6)
D +3
S1 +4
00H
38H(8)
012345678
D +4
S2
S2 +1
00H
49H(I)
ABCDEFGHI
After execution
b15---------------b8b7-----------------b0
42H(B)
41H(A)
D +1
44H(D)
43H(C)
D +2
31H(1)
30H(0)
D +3
33H(3)
32H(2)
D +4
28
29
5th
character
631
30
FNC270-FNC274
Ex-Device
Inverter Comms
00H
34H(4)
ABCD01234
Characters from the 5th character to the last
character are overwritten. Excessive
characters, 35H (5) to 37H (7) , are not
stored.
FNC250-FNC269
Data Table
Operation
5th
character
FNC220-FNC249
Data
Comparison
44H(D)
D +2
8th character
b15---------------b8b7-----------------b0
42H(B)
41H(A)
D +1
27
FNC210-FNC219
Data
Operation 3
Before execution
26
FNC200-FNC209
Character String
Control
The character string stored in S1 and later or D and later indicates data stored in devices from the
specified device until 00H is first detected in byte units.
When the number of characters to be overwritten specified by S2
not executed.
23
FNC181-FNC189
Others
6th character
1st
character
3rd
character
FNC180
Alternate
Instructions
1st
character
Before execution
b15---------------b8b7-----------------b0
42H(B)
41H(A)
22
FNC170-FNC179
External Device
Command
input
FNC160-FNC169
Real Time Clock
Control
When S2 +1 (the number of characters to be extracted) is -1, the entire character string stored in
and later.
S1 and later is stored to D
S1
b15---------------b8b7-----------------b0
31H(1)
30H(0)
S1 +1
S1 +2
D +1
44H(D)
43H(C)
33H(3)
32H(2)
D +2
46H(F)
45H(E)
35H(5)
34H(4)
D +3
48H(H)
47H(G)
00H
D +4
4AH(J)
49H(I)
D +5
00H
4BH(K)
S1 +3
Last character
S2
S2 +1
-1
1st
character
2nd
Before execution
character
b15---------------b8b7-----------------b0
42H(B)
41H(A)
012345
1st
character
ABCDEFGHIJK
2nd
After execution
character
b15---------------b8b7-----------------b0
41H(A)
30H(0)
32H(2)
31H(1)
D +2
34H(4)
33H(3)
D +3
48H(H)
35H(5)
D +4
4AH(J)
49H(I)
D +5
00H
4BH(K)
D +1
A012345HIJK
Six characters from the 2nd
character are overwritten.
Cautions
This instruction can handle character codes other than ASCII codes, but please note the following:
The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in
which 2 bytes express 1 character such as shift JIS code, the length of 1 character is regarded as 2
characters.
When overwriting a character string including character codes in which 2 bytes express 1 character such
as shift JIS codes, consider the number of characters to be extracted in units of character codes for 1
character.
Note that the expected character code is not given if only 1 byte is overwritten out of a 2-byte character
code.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When 00H is not set within the corresponding device range after a device specified by S1
(error code: K6706)
or
When the value specified by S2 exceeds the number of characters of the character string stored in
D
and later (error code: K6706)
When the number of characters specified by S2
S1 (error code: K6706)
632
When S2
When S2
21
In the program example shown below, 4 characters are extracted from the character string data stored in D0
and later, and stored to the 3rd character (from the left end) and later for the character string data stored in
D100 and later when X010 turns ON.
X010
D0
D100
22
R0
FNC170-FNC179
External Device
FNC207
MIDWP
END
D1
45H(E)
46H(F)
D2
33H(3)
30H(0)
00H
D3
21FE03
3
R1
1st
character
D100
b15---------------b8b7-----------------b0
53H(S)
55H(U)
59H(Y)
43H(C)
D102
31H(1)
5AH(Z)
D103
42H(B)
30H(0)
D101
D104
23
1st
character
3rd
character
24
0000H
USCYZ10B
FNC181-FNC189
Others
R0
Before execution
FNC180
Alternate
Instructions
4th
character
b15---------------b8b7-----------------b0
31H(1)
32H(2)
D0
After execution
b15---------------b8b7-----------------b0
D100
53H(S)
55H(U)
31H(1)
32H(2)
D102
45H(E)
46H(F)
D103
42H(B)
30H(0)
25
3rd
character
FNC190-FNC199
Block Data
Operation
D101
D104
FNC160-FNC169
Real Time Clock
Control
Program example
0000H
US21FE0B
The 1st to 4th characters are stored.
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
633
26.9
Outline
This instruction searches a specified character string within another character string.
1. Instruction format
FNC 208
INSTR P
16-bit Instruction
9 steps
Mnemonic
Operation Condition
INSTR
INSTRP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
S1
Character string
S2
Character string
16-bit binary
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
S2
3 3 3 3
3 3 3 3
3 3
""
3 3
S1
S2
3) When the search start position "n" is a negative number or "0", search processing is not executed.
634
21
Character string S1
"AB"
D100
22
FNC170-FNC179
External Device
FNC160-FNC169
Real Time Clock
Control
"1234AB56AB"
23
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the search start position "n" exceeds the number of characters stored in S2
24
FNC181-FNC189
Others
When "00H (NULL)" is not located within the corresponding device range starting from S1
(error code: K6706)
When "00H (NULL)" is not located within the corresponding device range starting from S2
(error code: K6706)
Program example
FNC208
INSTR
D0
R0
D100
K5
26
FNC200-FNC209
Character String
Control
END
Character string D0
b15
b8 b7
b0
D0
49H(I)
43H(C)
D1
33H(3)
32H(2)
D2
00H
27
FNC210-FNC219
Data
Operation 3
25
FNC190-FNC199
Block Data
Operation
1) In the program example below, the character string "CI23" (D0 and later) is searched from the 5th
character from the left end (head character) of the character string "CI2312CIM" (R0 and later) when
X000 is set to ON. The search result is stored in D100
X000
FNC180
Alternate
Instructions
Errors
"CI23"
"CI2312CIM"
D100
0
Because the searched
character string is not
detected, "0" is stored.
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
635
1. Instruction format
FNC 209
$MOV P
16-bit Instruction
5 steps
Mnemonic
Operation Condition
$MOV
$MOVP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
Character string
3. Applicable devices
Bit Devices
Operand
Type
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
S
D
ConReal
CharacPointer
stant Number ter String
Z Modify K H
3 3 3 3
3 3 3 3
""
FNC209
$MOV
b15
b8 b7
b0
b8 b7
2nd character
1st character
2nd character
1st character
S +1
4th character
3rd character
D +1
4th character
3rd character
S +2
6th character
5th character
D +2
6th character
5th character
00H
nth character
00H
nth character
636
b15
b0
21
Command
input
b15
D10
22
D11
b8 b7
b0
b15
b8 b7
32H(2)
31H(1)
D10
32H(2)
31H(1)
D11
34H(4)
33H(3)
D11
32H(2)
31H(1)
D12
36H(6)
35H(5)
D12
34H(4)
33H(3)
00H
D13
36H(6)
35H(5)
D13
D14
character string
before transfer.
0000H
D14
24
25
FNC209
$MOV
b15
FNC190-FNC199
Block Data
Operation
Command
input
FNC181-FNC189
Others
Caution
When 00H is stored in the low-order byte of
order byte of D +n.
23
FNC180
Alternate
Instructions
D10
b0
... It is same as the
FNC170-FNC179
External Device
FNC209
$MOV
FNC160-FNC169
Real Time Clock
Control
b8 b7
b0
b15
b8 b7
b0
42H(B)
41H(A)
42H(B)
41H(A)
26
S +1
44H(D)
43H(C)
D +1
44H(D)
43H(C)
S +2
45H(E)
00H
D +2
00H
00H
FNC200-FNC209
Character String
Control
00H is automatically
stored in the high-order
byte.
27
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When 00H does not exist in the range specified from device
to the
28
FNC220-FNC249
Data
Comparison
When the specified character string cannot be stored in devices from the device specified by
last device (error code: K6706)
FNC210-FNC219
Data
Operation 3
Errors
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
637
Program example
In the program example shown below, character string data stored in D10 to D12 is transferred to D20
through D22.
X000
FNC209
$MOV
D10
D20
END
b15
b15
b0
b8 b7
b0
4DH(M)
2AH(*)
D20
4DH(M)
2AH(*)
D11
45H(E)
45H(E)
D21
45H(E)
45H(E)
00H
D22
D12
638
b8 b7
D10
0000H
21
FNC160-FNC169
Real Time Clock
Control
Function
Reference
FDEL
FDEL
S D n
Section
27.1
211
FINS
FINS
S D n
Section
27.2
212
POP
POP
S D n
Section
27.3
213
SFR
SFR
D n
16-bit data n
Bit Shift Right with Carry
Section
27.4
214
SFL
SFL
D n
16-bit data n
Bit Shift Left with Carry
Section
27.5
215
216
217
218
219
23
24
25
26
FNC200-FNC209
Character String
Control
210
FNC190-FNC199
Block Data
Operation
Symbol
FNC181-FNC189
Others
Mnemonic
FNC180
Alternate
Instructions
FNC No.
22
FNC170-FNC179
External Device
FNC210 to FNC219 provide instructions for reading last-in data and controlling leftward/rightward shift
instructions with carry.
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
639
27.1
Outline
This instruction deletes an arbitrary data from a data table.
1. Instruction format
FNC 210
P
FDEL
16-bit Instruction
7 steps
Mnemonic
Operation Condition
FDEL
FDELP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
Data table
(having D
data starting
from D +1)
D +0
+1
+2
+3
+4
+5
Data table
5
5432
3333
4444
1234
5678
-1
D +0
+1
When "n" is "2"
+2
+3
+4
+5
0
S
Data table
4
5432
4444
1234
5678
0
Number of
stored data
Data table
range
"0" is stored.
...
Number of
stored data
...
...
...
Command
input
FNC210
FDELP
Deleted data
3333
Caution
The device range used in a data table should be controlled by the user.
The data table has D data starting from the next device ( D +1) after D indicating the number of
stored data.
Refer to the program example.
640
21
Instruction
FNC160-FNC169
Real Time Clock
Control
Related instruction
Description
FINS(FNC211)
Errors
When the table position "n" of the data to be deleted exceeds the amount of data stored (error code:
K6706)
When the value "n" exceeds the device range of the data table
23
FNC180
Alternate
Instructions
When the FNC210 instruction is executed under the condition "n 0" (error code: K6706)
When the amount of data stored specified in
When the data table range exceeds the corresponding device range (error code: K6706)
Program example
FNC234
AND<
K0
D100
FNC237
AND<=
D100
K7
FNC210
FDELP
D0
D100
25
K2
FNC190-FNC199
Block Data
Operation
END
X010:ON
Data
table
range
Data table
5
-123
4444
3210
1234
5432
0
0
-1
D100
D101
D102
D103
D104
D105
D106
D107
D0
Data table
4
-123
3210
1234
5432
0
0
0
4444
26
Amount of
data stored
Data table
range
27
FNC210-FNC219
Data
Operation 3
D100
D101
D102
D103
D104
D105
D106
D107
FNC200-FNC209
Character String
Control
Amount of
data stored
24
FNC181-FNC189
Others
In the program shown below, the 2nd data entry is deleted from the data table stored in D100 to D105, and
the deleted data is stored in D0.
When the amount of data stored is "0", however, the FDEL (FNC210) instruction is not executed. (The device
range used in the data table is D100 to D107).
X010
22
FNC170-FNC179
External Device
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
Deleted data
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
641
27.2
Outline
This instruction inserts data into an arbitrary position in a data table.
1. Instruction format
FNC 211
P
FINS
16-bit Instruction
7 steps
Mnemonic
Operation Condition
FINS
FINSP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3 3 3
3 3
""
3 3
3 3
+1
D +0
+1
+2
+3
+4
+5
Data table
4
5432
4444
1234
-123
0
0
S
4444
Data table
range
...
Number of
D +0
stored data
+1
Data table
+2
range
+3
+4
+5
...
...
...
Command
input
FNC211
FINSP
0
When "n" is "2"
Caution
The device range used in a data table should be controlled by the user.
The data table has D data starting from the next device ( D +1) after D indicating the number of
stored data.
Refer to the program example.
642
21
Instruction
FNC160-FNC169
Real Time Clock
Control
Related instruction
Description
FDEL(FNC210)
Errors
When the table position "n" for data insertion exceeds the amount of stored data plus 1(error code: K6706)
When the value "n" exceeds the device range of the data table
23
When FNC211 instruction is executed under the condition "n 0" (error code: K6706)
FNC180
Alternate
Instructions
When the data table range exceeds the corresponding device range (error code: K6706)
Program example
FNC237
AND<=
K0
FNC234
AND<
D0
D0
FNC211
FINSP
K7
D100
D0
K3
25
END
FNC190-FNC199
Block Data
Operation
X010:ON
Amount of
data stored
-3210
+1
D0
D1
D2
D3
D4
D5
D6
D7
Data table
5
1234
4444
-3210
-123
5000
0
0
Amount of
data stored
26
Data table
range
27
FNC210-FNC219
Data
Operation 3
D100
Data table
4
1234
4444
-123
5000
0
0
0
FNC200-FNC209
Character String
Control
Data
table
range
D0
D1
D2
D3
D4
D5
D6
D7
24
FNC181-FNC189
Others
In the program shown below, data stored in D100 is inserted into the 3rd position of the data table stored in
D0 to D4.
When the amount of data stored exceeds "7", however, the FINS (FNC211) instruction is not executed. (The
device range used in the data table is D0 to D7).
X010
22
FNC170-FNC179
External Device
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
643
27.3
Outline
This instruction reads the last data written by shift write (SFWR) instruction for FILO control.
For SFWR (FNC 38) instruction, refer to Section 11.9.
1. Instruction format
FNC 212
P
POP
16-bit Instruction
7 steps
Mnemonic
Operation Condition
POP
POPP
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3 3
3
3 3
FNC212
POPP
+1
+2
+3
+n-3
+n-2
+n-1
...
Data area
(First-in data written by shift write (SFWR) instruction)
644
21
.
Data area
S +n-1
S +n-2
S +6
S +5
FNC160-FNC169
Real Time Clock
Control
Pointer
S +4
S +3
S +2
S +1
22
In the case of K4
S +n-1
S +n-2
S +6
S +5
Pointer
S +4
S +3
S +2
S +1
K4K3
23
M8020
Zero flag
FNC180
Alternate
Instructions
Related device
Device
FNC170-FNC179
External Device
No data area
Description
Turns ON when the instruction is executed while the pointer
24
is 0.
FNC181-FNC189
Others
Related instructions
Instruction
Description
SFWR(FNC 38)
SFRD(FNC 39)
25
When this instruction is programmed in the continuous operation type, the instruction is executed in every
operation cycle. As a result, an expected operation may not be achieved.
Usually, program this instruction in the pulse operation type, or let this instruction be executed by a
pulsed command contact.
is 1, 0 is written to
Error
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
S
When
28
FNC220-FNC249
Data
Comparison
When
27
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
FNC190-FNC199
Block Data
Operation
Cautions
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
645
Program example
Among values 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.
First-in command
Last-in read command
X000
FNC 38
SFWR
D20
D100
K7
FNC212
POP
D100
D10
K7
END
Data
D100
K3
D101
H1234
D102
H5678
D103
HABCD
D104
H0000
D105
H0000
D106
H0000
D20
First-in command
D100:
D100:
D100:
K2K3 K1K2 K0K1
D106
D105
D104
D103
D102
D101
D100
H0000
H0000
H0000
HABCD
H5678
H1234
K3
Last-in read command
X000: OFFON
D106
D105
D104
D103
D102
D101
D100
D10
H0000
H0000
H0000
HABCD
H5678
H1234
K3K2
HABCD
Do not change
646
21
FNC160-FNC169
Real Time Clock
Control
27.4
Outline
22
FNC 213
P
SFR
16-bit Instruction
5 steps
Mnemonic
Operation Condition
SFR
SFRP
Continuous
Operation
Pulse (Single)
Operation
FNC170-FNC179
External Device
1. Instruction format
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
D
Description
Data Type
16-bit binary
24
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
25
FNC190-FNC199
Block Data
Operation
ConReal
CharacPointer
stant Number ter String
FNC181-FNC189
Others
3. Applicable devices
26
FNC213
SFRP
FNC200-FNC209
Character String
Control
Command
input
3 3
27
2) The ON (1)/OFF (0) status of the nth bit (bit n-1) in the word device
flag M8022.
28
In the case of n = 6
b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 0 0 1 1 1 0 1 1 1 0 1 1
29
Carry flag
M8022
FNC250-FNC269
Data Table
Operation
FNC220-FNC249
Data
Comparison
FNC210-FNC219
Data
Operation 3
Become 0.
30
FNC270-FNC274
Ex-Device
Inverter Comms
647
M11
1 0
M11
0 0
FNC213
SFRP
M8 M7
0 1
M8 M7
0 1
K3M0
K4
M4 M3
0 1
M4 M3
0 1
M0
0
M0
0
Carry flag
M8022
1
Become 0.
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry flag
Description
Shifts the ON/OFF status of bit n-1.
Error
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a negative value is set to n (error code: K6706)
Program example
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
FNC213
SFRP
K3Y010
D0
END
Y23
1 0
D0
Y20 Y17
0 1 0
Y14 Y13
0 1 0
Y10
0
4
Y23
0 0
Y20 Y17
0 0 1 0
Become 0.
648
Y14 Y13
1 0 1 0
Y10
1 0
Carry flag
M8022
1
21
FNC160-FNC169
Real Time Clock
Control
27.5
Outline
22
FNC 214
P
SFL
16-bit Instruction
5 steps
Mnemonic
Operation Condition
SFL
SFLP
Continuous
Operation
Pulse (Single)
Operation
FNC170-FNC179
External Device
1. Instruction format
Operation Condition
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
Description
Data Type
16-bit binary
24
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
3 3 3 3
3 3
3 3 3 3
3 3
""
25
FNC190-FNC199
Block Data
Operation
ConReal
CharacPointer
stant Number ter String
FNC181-FNC189
Others
3. Applicable devices
26
FNC214
SFLP
FNC200-FNC209
Character String
Control
Command
input
3 3
28
29
In the case of n = 8
FNC250-FNC269
Data Table
Operation
FNC220-FNC249
Data
Comparison
Carry flag
M8022
FNC210-FNC219
Data
Operation 3
2) The ON (1)/OFF (0) status of the n+1th bit (bit n) in the word device
flag M8022.
27
Become 0.
30
FNC270-FNC274
Ex-Device
Inverter Comms
649
FNC214
SFL
Carry flag
M8022
1
K2M10
K3
M17
0 0
M14M13
1 0 0
M10
1
M17
1 0
M14M13 M12
M10
1 1 0 0 0
Become 0.
Related device
For the carry flag use method, refer to Subsection 6.5.2.
Device
Name
M8022
Carry flag
Description
Shifts the ON/OFF status of bit n.
Error
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When a negative value is set to n (error code: K6706)
Program example
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.
X020
FNC214
SFLP
K2Y10
D0
END
Y17
0 0
Y14 Y13
1 0 0
Y10
1
3
Carry flag
M8022
1
Y17
1 0
650
D0
21
FNC160-FNC169
Real Time Clock
Control
FNC No.
Mnemonic
220
221
222
FNC180
Alternate
Instructions
Symbol
Function
Reference
22
FNC170-FNC179
External Device
FNC220 to FNC249 provide data comparison instructions which can be handled as contact symbols in
programming such as LD, AND and OR.
223
24
224
LD=
LD=
S1 S2
Load Compare
S1 = S2
Section
28.1
225
LD>
LD>
S1 S2
Load Compare
S1 > S2
Section
28.1
S1 < S2
Section
28.1
23
LD<>
LD<> S1 S2
Load Compare
S1 S2
Section
28.1
229
LD<=
LD<= S1 S2
Load Compare
S1 <= S2
Section
28.1
230
LD>=
LD>= S1 S2
Load Compare
S1 >= S2
Section
28.1
231
232
AND=
AND= S1 S2
AND Compare
S1 = S2
Section
28.2
233
AND>
AND> S1 S2
AND Compare
S1 > S2
Section
28.2
234
AND<
AND< S1 S2
AND Compare
S1 < S2
Section
28.2
235
236
AND<>
AND<> S1 S2
AND Compare
237
AND<=
AND<= S1 S2
238
AND>=
AND>= S1 S2
26
27
28
FNC220-FNC249
Data
Comparison
228
Load Compare
FNC210-FNC219
Data
Operation 3
S1 S2
FNC200-FNC209
Character String
Control
227
LD<
FNC190-FNC199
Block Data
Operation
LD<
FNC181-FNC189
Others
226
25
29
S1 S2
Section
28.2
AND Compare
S1 <= S2
Section
28.2
FNC250-FNC269
Data Table
Operation
AND Compare
S1 >= S2
Section
28.2
FNC270-FNC274
Ex-Device
Inverter Comms
651
30
652
FNC No.
Mnemonic
Symbol
Function
Reference
239
240
OR=
241
OR>
242
OR<
243
244
OR<>
245
OR<=
246
OR>=
247
248
249
OR=
S1 S2
OR>
S1 S2
OR<
S1 S2
OR Compare
S1 = S2
Section
28.3
OR Compare
S1 > S2
Section
28.3
OR Compare
S1 < S2
Section
28.3
OR<> S1 S2
OR<= S1 S2
OR>= S1 S2
OR Compare
S1 S2
Section
28.3
OR Compare
S1 <= S2
Section
28.3
OR Compare
S1 >= S2
Section
28.3
21
FNC160-FNC169
Real Time Clock
Control
28.1
Outline
These instructions compare numeric values, and set a contact to ON when the condition agrees so that an
operation is started.
FNC170-FNC179
External Device
1. Instruction format
16-bit Instruction
FNC 225
D
LD>
16-bit Instruction
5 steps
5 steps
Mnemonic
Operation Condition
Continuous
Operation
LD=
Mnemonic
Continuous
Operation
9 steps LDD=
Operation Condition
Continuous
Operation
LD>
Operation Condition
23
FNC180
Alternate
Instructions
FNC 224
D
LD=
Operation Condition
Continuous
Operation
9 steps LDD>
22
24
16-bit Instruction
FNC 229
D
LD<=
16-bit Instruction
FNC 230
D
LD>=
16-bit Instruction
5 steps
5 steps
5 steps
Operation Condition
Continuous
Operation
LD<
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
LD>=
Continuous
Operation
Operation Condition
26
Continuous
Operation
9 steps LDD<=
Operation Condition
25
Operation Condition
9 steps LDD<>
Operation Condition
LD<=
Continuous
Operation
9 steps LDD<
Operation Condition
LD<>
Operation Condition
FNC200-FNC209
Character String
Control
FNC 228
D
LD<>
5 steps
Mnemonic
FNC190-FNC199
Block Data
Operation
16-bit Instruction
FNC181-FNC189
Others
FNC 226
D
LD<
Operation Condition
Continuous
Operation
9 steps LDD>=
27
FNC210-FNC219
Data
Operation 3
Description
Data Type
16- or 32-bit binary
S2
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
""
29
FNC250-FNC269
Data Table
Operation
28
FNC220-FNC249
Data
Comparison
S1
30
FNC270-FNC274
Ex-Device
Inverter Comms
653
16-bit instruction
32-bit instruction
ON condition
OFF condition
224
LD=
LDD=
S1
= S2
225
LD>
LDD>
S1
> S2
S1
<= S2
226
LD<
LDD<
S1
< S2
S1
>= S2
228
LD<>
LDD<>
S1
S2
S1
= S2
229
LD<=
LDD<=
S1
<= S2
S1
> S2
230
LD>=
LDD>=
S1
>= S2
S1
< S2
S1
S2
Cautions
1. Negative value
When the most significant bit is "1" in the data stored in S1
comparison.
or S2
654
21
S2
FNC224
LD=
K200
C10
FNC225
LD>
D200
K-30
FNC225
LDD>
K678493
C200
Y10
Y11
M50
X001
SET
22
FNC170-FNC179
External Device
S1
FNC160-FNC169
Real Time Clock
Control
Program example
23
M3
FNC180
Alternate
Instructions
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
655
28.2
28.2 FNC232~238 AND=, >, <, < >, <=, >= / Data Comparison
FNC232~238 AND=, >, <, < >, <=, >= / Data Comparison
Outline
These instructions compare numeric values, and set a contact to ON when the condition agrees.
1. Instruction format
FNC 232
D AND=
16-bit Instruction
FNC 233
AND>
16-bit Instruction
FNC 234
D AND<
16-bit Instruction
FNC 236
D AND<>
16-bit Instruction
FNC 237
D AND<=
16-bit Instruction
FNC 238
D AND>=
16-bit Instruction
5 steps
5 steps
5 steps
5 steps
5 steps
5 steps
Mnemonic
Operation Condition
Continuous
Operation
AND=
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
Mnemonic
Continuous
Operation
Operation Condition
Continuous
Operation
Operation Condition
Continuous
Operation
9 steps ANDD<=
Operation Condition
Continuous
Operation
AND>=
Operation Condition
9 steps ANDD<>
Operation Condition
AND<=
Continuous
Operation
9 steps ANDD<
Operation Condition
AND<>
Operation Condition
9 steps ANDD>
Operation Condition
AND<
Continuous
Operation
9 steps ANDD=
Operation Condition
AND>
Operation Condition
Operation Condition
Continuous
Operation
9 steps ANDD>=
Description
Data Type
S1
S2
656
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
""
21
FNC232 to FNC237 are data comparison instructions connected to other contacts in series.
The contents of S1 are compared with the contents of S2 in binary format, and a contact becomes
conductive (ON) or non-conductive (OFF) depending on the comparison result.
32-bit instruction
ON condition
OFF condition
232
AND=
ANDD=
S1
= S2
233
AND>
ANDD>
S1
> S2
S1
<= S2
234
AND<
ANDD<
S1
< S2
S1
>= S2
236
AND<>
ANDD<>
S1
S2
S1
= S2
237
AND<=
ANDD<=
S1
<= S2
S1
< S2
238
AND>=
ANDD>=
S1
>= S2
S1
> S2
S1
S2
22
23
FNC180
Alternate
Instructions
16-bit instruction
FNC170-FNC179
External Device
FNC No.
FNC160-FNC169
Real Time Clock
Control
Cautions
24
1. Negative value
or S2
FNC181-FNC189
Others
25
Make sure to execute the 32-bit operation (such as "ANDD=", "ANDD>" and "ANDD<") when comparing 32bit counters (C200 to C255).
If a 32-bit counter is specified in the 16-bit operation (such as "AND=", "AND>" and "AND<"), a program error
or operation error will occur.
FNC190-FNC199
Block Data
Operation
26
27
FNC210-FNC219
Data
Operation 3
Operating procedure
a) Display the circuit program edit window, and put the cursor in a position where a data comparison
instruction is to be used.
b) Input "Instruction" "space" "value or device" "space" "value or device".
For an input example, refer to "Instruction input window in GX Developer" shown below.
c) Click the [OK] button.
d) Input other contacts and coil drive units consecutively.
FNC200-FNC209
Character String
Control
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
657
Program example
X000
X001
X002
M3
658
S1
S2
FNC232
AND=
K200
C10
FNC236
AND<>
K-10
D0
FNC233 K678493
ANDD>
D10
SET
Y10
Y11
M50
21
FNC240~246 OR=, >, <, < >, <=, >= / Data Comparison
FNC160-FNC169
Real Time Clock
Control
28.3
28.3 FNC240~246 OR=, >, <, < >, <=, >= / Data Comparison
Outline
22
These instructions compare numeric values, and set a contact to ON when the condition agrees.
FNC 240
OR=
16-bit Instruction
5 steps
Mnemonic
Operation Condition
Continuous
Operation
OR=
Operation Condition
Continuous
Operation
9 steps ORD=
FNC170-FNC179
External Device
1. Instruction format
23
FNC 244
D OR<>
16-bit Instruction
FNC 245
OR<=
16-bit Instruction
FNC 246
OR>=
16-bit Instruction
5 steps
5 steps
5 steps
5 steps
Continuous
Operation
OR>
Mnemonic
Continuous
Operation
Mnemonic
Operation Condition
Continuous
Operation
9 steps ORD<=
Operation Condition
Continuous
Operation
OR>=
Continuous
Operation
Continuous
Operation
Mnemonic
Operation Condition
9 steps ORD<>
Operation Condition
OR<=
Continuous
Operation
Continuous
Operation
Mnemonic
Operation Condition
9 steps ORD<
Operation Condition
OR<>
Continuous
Operation
9 steps ORD>
Operation Condition
OR<
Operation Condition
25
26
Operation Condition
Continuous
Operation
9 steps ORD>=
24
FNC200-FNC209
Character String
Control
16-bit Instruction
Operation Condition
FNC190-FNC199
Block Data
Operation
FNC 242
D
OR<
5 steps
Mnemonic
FNC181-FNC189
Others
16-bit Instruction
FNC180
Alternate
Instructions
FNC 241
D
OR>
27
Operand Type
Description
Data Type
S1
S2
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
3 3
S2
3 3 3 3
3 3
3 3
""
29
FNC250-FNC269
Data Table
Operation
S1
28
FNC220-FNC249
Data
Comparison
FNC210-FNC219
Data
Operation 3
30
FNC270-FNC274
Ex-Device
Inverter Comms
659
16-bit instruction
32-bit instruction
ON condition
OFF condition
240
OR=
ORD=
S1
= S2
241
OR>
ORD>
S1
> S2
S1
<= S2
242
OR<
ORD<
S1
< S2
S1
>= S2
244
OR<>
ORD<>
S1
S2
S1
= S2
245
OR<=
ORD<=
S1
<= S2
S1
> S2
246
OR>=
ORD>=
S1
>= S2
S1
< S2
S1
S2
Cautions
1. Negative value
When the most significant bit is "1" in the data stored in S1
comparison.
or S2
660
21
S1
S2
FNC160-FNC169
Real Time Clock
Control
Program example
K200
C10
22
X001
Y000
X002
M30
M60
FNC246
ORD>=
D100
FNC170-FNC179
External Device
FNC240
OR=
23
K100000
FNC180
Alternate
Instructions
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
661
662
FNC No.
Mnemonic
Symbol
250
251
252
253
254
255
256
LIMIT
LIMIT S1 S2 S3 D
Limit Control
Section
29.1
257
BAND
BAND S1 S2 S3 D
Section
29.2
258
ZONE
ZONE S1 S2 S3 D
Zone Control
Section
29.3
259
SCL
Section
29.4
260
DABIN
DABIN S D
Section
29.5
261
BINDA
BINDA S D
Section
29.6
262
263
264
265
266
267
268
269
SCL2
SCL
Function
S1 S2 D
SCL2 S1 S2 D
Reference
Section
29.7
21
FNC160FNC169
Real Time Clock
29.1
Outline
This instruction provides the upper limit value and lower limit value for an input numeric value, and controls
the output value using these limit values.
FNC 256
P
LIMIT
16-bit Instruction
9 steps
Mnemonic
Continuous
Operation
Pulse (Single)
Operation
DLIMIT
DLIMITP
17 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
24
S2
S3
Head device number storing the output value controlled by the upper and lower
limit values
25
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
S2
3 3 3 3
3 3
S3
3 3 3 3
3 3 3 3
""
26
FNC200FNC209
Character String
S1
FNC190FNC199
Block Data
Bit Devices
System User
FNC181FNC189
Others
S1
3. Applicable devices
Operand
Type
23
FNC180
Alternate
Instructions
Operation Condition
LIMIT
LIMITP
FNC170FNC179
External Device
1. Instruction format
22
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
663
FNC256
LIMIT
S1
S2
S3
D Output value
D Output value
In the case of S1 Lower limit value S3 Input value S2 Upper limit value .... S3 Input value D
Output
value
Output ( D )
value
Input
value
Output value
S2 Specified
Input ( S3 )
value
S1 Specified
When controlling the output value using only the upper limit value, set -32768 to the lower limit value
specified in S1 .
When controlling the output value using only the lower limit value, set 32767 to the upper limit value
specified in S2 .
664
21
Depending on how the input value (32-bit binary value) specified by [ S3 +1, S3 ] compares to the range
between [ S1 +1, S1 ] and [ S2 +1, S2 ], the output value [ D +1, D ] is controlled.
Command
input
S1
S1 +1, S1
S3
S2
22
S3 +1, S3
S1 +1, S1
FNC170FNC179
External Device
FNC256
DLIMIT
D +1, D
In the case of Lower limit value > Input value .................................... Lower limit value Output value
S2 +1, S2
S2 +1, S2
S3 +1, S3
23
D +1, D
S3 +1, S3
S2 +1, S2
S3 +1, S3
In the case of Lower limit value Input value Upper limit value .... Input value
Output
value
FNC180
Alternate
Instructions
In the case of Upper limit value < Input value .................................... Upper limit value Output value
S1 +1, S1
D +1, D
Output value
24
Output
( D +1, D )
value
FNC181FNC189
Others
S2 +1, S2
Specified
Input
value
Input value
( S3 +1, S3 )
When controlling the output value using only the upper limit value, set -2,147,483,648 to the lower limit
value specified in [ S1 +1, S1 ].
Error
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.
Relationship
[ S1
S2
+1, S1
] [ S2
+1, S2
27
FNC210FNC219
Data
S1
32-bit operation
26
FNC200FNC209
Character String
When controlling the output value using only the lower limit value, set 2,147,483,647 to the upper limit
value specified in [ S2 +1, S2 ].
25
FNC190FNC199
Block Data
S1 +1, S1
Specified
16-bit operation
FNC160FNC169
Real Time Clock
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
665
Program examples
1. Program example 1
In the program example shown below, the BCD data set in X020 to X037 is controlled by the limit values 500
to 5000, and the controlled value is output to D1 when X000 turns ON.
X000
FNC256
LIMIT
K500
FNC 19 K4X020
BIN
D0
K5000
D1
D0
END
Operation
In the case of D0 < 500, 500 is output to D1.
Output (D1)
5000
500
500
5000
Input (D0)
2. Program example 2
In the program example shown below, the BCD data set in X020 to X057 is controlled by the limit values
10000 and 1,000,000, and the controlled value is output to D11 and D10 when X000 turns ON.
X000
FNC 19 K8X020
DBIN
FNC256 K10000 K1000000
DLIMIT
D0
D0
D10
END
Operation
In the case of (D1, D0) < 10000, 10000 is output to (D11,
D10).
In the case of 10000 (D1, D0) 1,000,000, the value of
(D1, D0) is output to (D11, D10).
In the case of (D1, D0) > 1,000,000, 1,000,000 is output
to (D11, D10).
666
Output (D11,D10)
1,000,000
10000
10000 1,000,000
Input (D1,D0)
21
FNC160FNC169
Real Time Clock
29.2
Outline
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.
FNC 257
BAND P
16-bit Instruction
Mnemonic
Operation Condition
BAND
BANDP
9 steps
17 steps
Operation Condition
DBAND
DBANDP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
24
S2
S3
Device number storing the output value controlled by the dead band
3. Applicable devices
System User
Digit Specification
System User
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3 3 3
3 3
S2
3 3 3 3
3 3
S3
3 3 3 3
3 3 3 3
""
26
FNC200FNC209
Character String
S1
25
Others
27
S1
S2
S3
28
D
S3 Input value S1 Lower limit value D
Input
value
Output value( D )
Lower limit value of
dead band
( S1 )
Output
Input value ( S3 )
Output
30
FNC270FNC274
Ex-Device
Output value = 0
29
FNC250FNC269
Data Table
Output value
Output value
FNC220FNC249
Data
FNC210FNC219
Data
Command
input
FNC190FNC199
Block Data
Operand
Type
Word Devices
FNC181FNC189
Others
S1
Bit Devices
23
FNC180
Alternate
Instructions
Continuous
Operation
Pulse (Single)
Operation
FNC170FNC179
External Device
1. Instruction format
22
667
FNC257
DBAND
S1
S3
S2
S1 +1, S1
S3 +1, S3
S3 +1, S3
In the case of Lower limit value > Input value ...............Input value
S2 +1, S2
S3 +1, S3
S3 +1, S3
In the case of Upper limit value < Input value ..............Input value
S1 +1, S1
S3 +1, S3
S1 +1, S1
D +1, D
Lower limit value Output value
S2 +1, S2
D +1, D
S2 +1, S2
D +1, D
In the case of Lower limit value Input value Upper limit value ................................ 0 Output value
Output
[ D +1, D ]
value
Output value
Input
value
Output
Input value
[ S3 +1, S3 ]
Output
Output value = 0
Caution
When the output value overflows, it is handled as follows:
- In the 16-bit operation
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 S1 = 10
+1, S3
+1, S1
] = 1000
] = -2,147,483,648
Error
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.
Relationship
668
16-bit operation
S1
32-bit operation
[ S1
> S2
+1, S1
] > [ S2
+1, S2
21
1. Program example 1
In the program example shown below, the BCD data set in X020 to X037 is controlled by the dead band from
-1000 to +1000, and a controlled value is output to D1 when X000 turns ON.
X000
D0
K1000
D1
D0
Input
22
FNC170FNC179
External Device
FNC257 K-1000
BAND
Output
FNC 19 K4X020
BIN
FNC160FNC169
Real Time Clock
Program examples
23
END
FNC180
Alternate
Instructions
Operation
In the case of D0 < -1000, D0 - (-1000) is output to D1.
Output
24
Input
FNC181FNC189
Others
-1000
25
In the program example shown below, the BCD data set in X020 to X057 is controlled by the dead band from
-10000 to +10000, and a controlled value is output to D11 and D10 when X000 turns ON.
X000
Output
D0
26
D0
D10
Input
END
27
FNC210FNC219
Data
Operation
In the case of (D1, D0) < -10000, (D1, D0) - (-10000) is
output to (D11, D10).
Output
28
-10000 0
+10000
Input
FNC220FNC249
Data
In the case of (D1, D0) > +10000, (D1, D0) - 10000 is output
to (D11, D10).
FNC200FNC209
Character String
FNC 19 K8X020
DBIN
FNC190FNC199
Block Data
2. Program example 2
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
669
29.3
Outline
Depending on how the input value compares to positive or negative, the output value is controlled by the bias
value specified.
1. Instruction format
FNC 258
D ZONE P
16-bit Instruction
Mnemonic
Operation Condition
ZONE
ZONEP
9 steps
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
DZONE
DZONEP
17 steps
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
S1
S2
S3
Head device number storing the output value controlled by the zone
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
S1
3 3 3 3
3 3
S2
3 3 3 3
3 3
S3
3 3 3 3
3 3 3 3
""
FNC258
ZONE
S1
S2
S3
In the case of S3 Input value < 0 ..... S3 Input value + S1 Negative bias value D Output value
In the case of S3 Input value = 0 ...........................................................................0 D Output value
In the case of S3 Input value > 0 ..... S3 Input value + S2 Positive bias value D Output value
Output
value
Output ( D )
value
Positive bias value
( S2 )
Input
value
Input ( S3 )
value
Negative bias value
( S1 )
670
21
The bias value specified by [ S1 +1, S1 ] or [ S2 +1, S2 ] is added to the input value specified by
[ S3 +1, S3 ], and output to the device specified by [ D +1, D ].
The bias value is added as shown below:
Command
input
22
S1
S2
S3
S3 +1, S3
S3 +1, S3
S1 +1, S1
FNC170FNC179
External Device
FNC258
DZONE
D +1, D
23
FNC180
Alternate
Instructions
D +1, D
S3 +1, S3
S3 +1, S3
S2 +1, S2
D +1, D
24
FNC181FNC189
Others
Input
value
Input value
[ S3 +1, S3 ]
Caution
27
] = -1000
] = -2,147,483,648
28
FNC220FNC249
Data
+1, S3
+1, S1
FNC210FNC219
Data
26
FNC200FNC209
Character String
25
FNC190FNC199
Block Data
Input value [ S3
FNC160FNC169
Real Time Clock
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
671
Program examples
1. Program example 1
In the program example shown below, the BCD data set in X020 to X037 is controlled by the zone from
-1000 to +1000, and the controlled value is output to D1 when X000 turns ON.
X000
FNC258 K-1000
ZONEP
FNC 19 K4X020
BIN
D0
K1000
D1
D0
END
Operation
In the case of D0 < 0, D0 + (-1000) is output to D1.
Output
0
1000
Input
-1000
2. Program example 2
In the program example shown below, the BCD data set in X020 to X057 is controlled by the zone from 10000 to +10000, and the controlled value is output to D11 and D10 when X000 turns ON.
X000
FNC 19 K8X020
DBIN
FNC258 K-10000 K10000
DZONEP
D0
D0
D10
END
Operation
In the case of (D1, D0) < 0, (D1, D0) + (-10000) is output to
(D11, D10).
Output
10000
-10000 0
10000
-10000
672
Input
21
FNC160FNC169
Real Time Clock
29.4
Outline
1. Instruction format
FNC 259
P
SCL
16-bit Instruction
Mnemonic
Operation Condition
7 steps
Continuous
Operation
Pulse (Single)
Operation
13 steps
Operation Condition
DSCL
DSCLP
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
S2
24
3. Applicable devices
S1
Bit Devices
System User
Word Devices
Digit Specification
Special
Unit
3 3 3 3
3 3
S2
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3
""
3 3
26
3
3
FNC200FNC209
Character String
System User
25
Others
FNC190FNC199
Block Data
Operand
Type
FNC181FNC189
Others
S1
Input value used in scaling or device number storing the input value
23
FNC180
Alternate
Instructions
SCL
SCLP
22
FNC170FNC179
External Device
This instruction executes scaling of the input value using a specified data table, and outputs the result.
SCL2 (FNC269) is also available with a different data table configuration for scaling.
For SCL2 (FNC269) instruction, refer to Section 29.7.
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
673
Command
input
FNC259
SCL
Y
S1
S2
Set item
Point 2
Output
value
( D )
S2
X coordinate
S2
+1
Y coordinate
S2
+2
X coordinate
S2
+3
Y coordinate
S2
+4
X coordinate
S2
+5
Y coordinate
S2
+6
X coordinate
S2
+7
Y coordinate
S2
+8
X coordinate
S2
+9
Y coordinate
S2
+10
Point 5
Point 1
Point 3
Point 4
Point 1
Operation
error
Point 2
Input value ( S1 )
Operation
error
Operation is enabled.
Device assignment in
setting data table
Point 3
Point 4
Point 5
Command
input
FNC259
DSCL
Y
S2
Set item
Point 2
Point 5
Output
value
( D )
[ S2
+1, S2
X coordinate
[ S2
+3, S2
+2]
Y coordinate
[ S2
+5, S2
+4]
X coordinate
[ S2
+7, S2
+6]
Y coordinate
[ S2
+9, S2
+8]
X coordinate
[ S2
+11, S2
+10]
Y coordinate
[ S2
+13, S2
+12]
X coordinate
[ S2
+15, S2
+14]
Y coordinate
[ S2
+17, S2
+16]
X coordinate
[ S2
+19, S2
+18]
Y coordinate
[ S2
+21, S2
+20]
Point 1
Point 2
Point 4
Input value ( S1 )
Operation is enabled.
X
Operation
error
Point 3
Point 4
Point 5
674
Device assignment in
setting data table
Point 3
Point 1
Operation
error
S1
21
The conversion table for scaling is set based on the data table stored in a device specified in [ S2 +1,
S2 ] 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
+1, S2
+1
[ S2
+3, S2
+2]
S2
+2
[ S2
+5, S2
+4]
X coordinate
S2
+3
[ S2
+7, S2
+6]
Y coordinate
S2
+4
[ S2
+9, S2
+8]
X coordinate
S2
+2n-1
[ S2
+4n-1, S2
+4n-2]
Y coordinate
S2
+2n
[ S2
+4n+1, S2
+4n]
S2
Y coordinate
...
...
...
...
Point n (last)
23
FNC180
Alternate
Instructions
Point 2
32-bit operation
[ S2
S2
X coordinate
24
Point 4(200,25)
Point 8(350,90)
Point 9
(350,30)
26
Point 10(400,7)
FNC200FNC209
Character String
Point 1(5,7)
Point 7
(250,90)
25
FNC190FNC199
Block Data
Point 2
(20,30)
Point 6(200,250)
Point 5
(200,70)
FNC181FNC189
Others
22
FNC170FNC179
External Device
Set item
FNC160FNC169
Real Time Clock
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
675
When R0 is specified
in S2
S2
X coordinate
S2
Y coordinate
Point 1
Point 2
Point 3
Point 4
Point 5
Point 6
Point 7
Point 8
Point 9
Point 10
Setting
contents
R0
K10
+1
R1
K5
S2
+2
R2
K7
X coordinate
S2
+3
R3
K20
Y coordinate
S2
+4
R4
K30
X coordinate
S2
+5
R5
K50
Y coordinate
S2
+6
R6
K100
X coordinate
S2
+7
R7
K200
Y coordinate
S2
+8
R8
K25
X coordinate
S2
+9
R9
K200
Y coordinate
S2
+10
R10
K70
X coordinate
S2
+11
R11
K200
Y coordinate
S2
+12
R12
K250
X coordinate
S2
+13
R13
K250
Y coordinate
S2
+14
R14
K90
X coordinate
S2
+15
R15
K350
Y coordinate
S2
+16
R16
K90
X coordinate
S2
+17
R17
K350
Y coordinate
S2
+18
R18
K30
X coordinate
S2
+19
R19
K400
Y coordinate
S2
+20
R20
K7
Remarks
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
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.
When S1
When the value exceeds the 32-bit data range in the middle of operation (error code: K6706)
In this case, check whether the distance between points is not 65535 or more.
If the distance is 65535 or more, reduce the distance between points.
676
21
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.
Program
M8000
FNC160FNC169
Real Time Clock
Program example
22
R0
D0
D10
FNC170FNC179
External Device
FNC259
SCL
END
23
Conversion setting data table for scaling
Point 2
(10,50)
R0
K6
Point 4
(40,45)
X coordinate
R1
K0
Point 1
Point 5
(50,30)
Y coordinate
R2
K0
Point 6
(60,0)
Point 2
X coordinate
R3
K10
Y coordinate
R4
K50
Point 3
X coordinate
R5
K30
Y coordinate
R6
K100
X coordinate
R7
K40
Point 4
Y coordinate
R8
K45
X coordinate
R9
Point 5
K50
Y coordinate
R10
K30
Point 6
X coordinate
R11
K60
Y coordinate
R12
K0
24
25
FNC190FNC199
Block Data
Setting
contents
Number of coordinate
points
Point 1
(0,0)
Input value(D0)=7
Device
Set item
FNC181FNC189
Others
Output value
(D10)=35
Point 3
(30,100)
FNC180
Alternate
Instructions
Operation
26
FNC200FNC209
Character String
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
677
29.5
Outline
This instruction converts numeric data expressed in decimal ASCII codes (30H to 39H) into binary data.
1. Instruction format
FNC 260
D DABIN P
16-bit Instruction
Mnemonic
Operation Condition
DABIN
DABINP
5 steps
Operation Condition
DDABIN
9 steps
DDABINP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
2. Set data
Operand Type
Description
Data Type
Head device number storing data (ASCII codes) to be converted into binary data
Character string
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
E
""
3
3
3 3
b15
b8 b7
b0
Sign data
b15
+1 ASCII code for 100's digit ASCII code for 1000's digit
ASCII code for 10's digit
+2 ASCII code for 1's digit
b0
+1
+2
to
b8 b7
32H(2)
31H(1)
38H(8)
b0
2DH(-)
35H(5)
30H(0)
b0
b15
D
to
-25108
3) As "sign data" (low-order byte of S ), "20H (space)" is set when the data to be converted is positive,
and "2DH (-)" is set when the data to be converted is negative.
4) An ASCII code for each digit is within the range from 30H to 39H.
5) When an ASCII code for each digit is "20H (space)" or "00H (null)", it is handled as "30H".
678
21
1) Data stored in S
to S +5 expressed in decimal ASCII codes (30H to 39H) is converted into 32-bit
binary data, and stored in [ D +1, D ].
S
22
b15
b8 b7
b0
Sign data
+1
+2
+3
+4
+5
D +1
b31
b16 b15
High-order 16 bits
b0
Low-order 16 bits
32-bit data
b8 b7
+1
+2
+3
+4
+5
24
b0
31H(1)
33H(3)
35H(5)
33H(3)
31H(1)
(Ignored)
2DH(-)
32H(2)
34H(4)
34H(4)
32H(2)
30H(0)
D +1
FNC181FNC189
Others
S +0
-1234543210
25
S
3) As "sign data" (low-order byte of S ), "20H (space)" is set when the data to be converted is positive,
and "2DH (-)" is set when the data to be converted is negative.
4) An ASCII code for each digit is within the range from 30H to 39H.
Related instructions
Instruction
Description
Converts hexadecimal codes into ASCII codes.
HEX(FNC 83)
STR(FNC200)
VAL(FNC201)
27
FNC210FNC219
Data
ASCI(FNC 82)
26
FNC200FNC209
Character String
5) When an ASCII code for each digit is "20H (space)" or "00H (NULL)", it is handled as "30H".
FNC190FNC199
Block Data
BINDA(FNC261)
23
FNC180
Alternate
Instructions
S +0
FNC170FNC179
External Device
Command
input
FNC260
DDABINP
FNC160FNC169
Real Time Clock
28
Errors
is any value other than "20H (space)" or "2DH (-)" (error code: K6706)
to
Setting range
16-bit operation
32768 to 32767
32-bit operation
2,147,483,648 to 2,147,483,647
to
30
FNC270FNC274
Ex-Device
When
29
FNC250FNC269
Data Table
FNC220FNC249
Data
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
679
Program example
In the program 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 is set to ON.
X000
FNC260
DABINP
D20
D0
END
D20
D21
D22
b15
b8 b7
b0
20H(space)
2DH(-)
32H(2)
20H(space)
36H(6)
37H(7)
"-
680
276"
D0
-276
(It is regarded as
"-00276".)
Binary
value
21
FNC160FNC169
Real Time Clock
29.6
Outline
22
This instruction converts binary data into decimal ASCII codes (30H to 39H).
FNC 261
D BINDA P
16-bit Instruction
Mnemonic
Operation Condition
BINDA
BINDAP
5 steps
Operation Condition
DBINDA
9 steps
DBINDAP
Continuous
Operation
Pulse (Single)
Operation
Continuous
Operation
Pulse (Single)
Operation
Description
Data Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
3 3 3 3
Z Modify K H
3 3
3 3 3 3
""
3 3
26
Command
input
FNC261
BINDAP
27
D
b15
b8 b7
b0
Sign data
D +0 ASCII code for 10000's digit
+1 ASCII code for 100's digit ASCII code for 1000's digit
+2 ASCII code for 1's digit
ASCII code for 10's digit
+3
0000H or source data
b0
S
16-bit binary data
b15
b0
b8 b7
31H(1)
2DH(-)
33H(3)
32H(2)
35H(5)
34H(4)
0000H or source data
28
b0
29
M8091=OFF:0000H
M8091=ON:Does not change.
FNC250FNC269
Data Table
-12345
D +0
+1
+2
+3
M8091=OFF:0000H
M8091=ON:Does
not change.
FNC220FNC249
Data
FNC210FNC219
Data
b15
FNC200FNC209
Character String
25
FNC190FNC199
Block Data
ConReal
CharacPointer
stant Number ter String
Index
24
FNC181FNC189
Others
3. Applicable devices
Operand
Type
23
FNC180
Alternate
Instructions
2. Set data
Operand Type
FNC170FNC179
External Device
1. Instruction format
30
is as follows:
681
FNC270FNC274
Ex-Device
a) As "sign data" (low-order byte of D ), "20H (space)" is set when the 16-bit binary data stored in
S
is positive, and "2DH (-)" is set when 16-bit binary data stored in S
is negative.
b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).
00 325
Effective digits
20H
c)
ON/OFF status
Contents of processing
M8091=OFF
M8091=ON
+1,
D
b15
S +1
High-order 16 bits
Low-order 16 bits
D +0
+1
+2
+3
+4
+5
b8 b7
b0
Sign data
M8091=OFF:00H
M8091=ON:20H
+1,
b15
S +1
D +0
+1
+2
+3
+4
+5
-12345678
b8 b7
20H (space)
31H(1)
33H(3)
35H(5)
37H(7)
00H or 20H
and
b0
2DH(-)
20H (space)
32H(2)
34H(4)
36H(6)
38H(8)
M8091=OFF:00H
M8091=ON:20H
+1,
] is from -2,147,483,648 to
is as follows:
a) "sign data" (low-order byte of D ) "20H (space)" is set when the 32-bit binary data stored in
[ S +1, S ] is positive, and "2DH (-)" is set when 32-bit binary data stored in [ S +1, S ] is
negative.
b) "20H (space)" is stored for "0" on the left side of the effective digits (zero suppression).
00 1 2 0 3 4 5 6 0
Effective digits
20H
ON/OFF status
682
Contents of processing
M8091=OFF
M8091=ON
21
Device
Name
Description
M8091
FNC160FNC169
Real Time Clock
Related devices
Output character
quantity selector signal
22
D
D
Related instructions
Instruction
23
Description
Converts hexadecimal values into ASCII code.
HEX(FNC 83)
STR(FNC200)
VAL(FNC201)
DABIN(FNC260)
FNC180
Alternate
Instructions
ASCI(FNC 82)
FNC170FNC179
External Device
24
Converts numeric data expressed in decimal ASCII code (30H to 39H) into binary data.
FNC181FNC189
Others
Cautions
1. Occupied device points
The table below shows the occupied device points of D
M8091 is ON/OFF and 32-bit operation (DBINDA/DBINDAP).
16-bit operation
M8091=ON
M8091=OFF
32-bit operation
25
FNC190FNC199
Block Data
Occupied Points of
26
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the occupied device point of D storing the ASCII code character string exceeds the
corresponding device rang (error code: K6706).
FNC200FNC209
Character String
Errors
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
683
Program example
In the program 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 (FNC 77) 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.
For PR mode flag and PR (FNC 77) instruction, refer to Section 15.8.
X000
RST
M8091
SET
M8027
FNC261
BINDAP
D1000
D0
FNC 77
PR
D0
Y040
END
D1000
5126
16-bit binary
data
D0
D1
D2
D3
b15
b8 b7
b0
20H (space)
20H (space)
31H(1)
35H(5)
36H(6)
32H(2)
0000H
M8091=OFF
684
PR (FNC 77)
instruction
Y040 to Y051
"
5126" is
output.
21
FNC160FNC169
Real Time Clock
29.7
Outline
1. Instruction format
16-bit Instruction
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
DSCL2
DSCL2P
SCL2
SCL2P
7 steps
13 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operand Type
Data Type
24
FNC181FNC189
Others
2. Set data
Description
S1
Input value used in scaling or device number storing the input value
S2
25
3. Applicable devices
S1
Bit Devices
System User
Word Devices
Digit Specification
3 3 3 3
3 3 3 3
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3
""
3 3
26
3
3
FNC200FNC209
Character String
3 3
S2
System User
Others
Special
Unit
FNC190FNC199
Block Data
Operand
Type
23
FNC180
Alternate
Instructions
FNC 269
P
SCL2
22
FNC170FNC179
External Device
This instruction executes scaling of the input value using a specified data table, and outputs the result.
SCL (FNC259) is also available with a different data table configuration for scaling.
SCL2 instruction is supported in the FX3UC Series Ver. 1.30 or later.
For SCL (FNC259) instruction, refer to Section 29.4.
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
685
Command
input
FNC 269
SCL2
Y
S1
S2
Point 2
Output
value
( D )
Point 5
Point 3
X coordinate
Point 4
Point 1
Input value ( S1 )
Operation
error
Device assignment in
setting data table
Set item
Operation
error
Operation is enabled.
Y coordinate
S2
Point 1
S2
+1
Point 2
S2
+2
Point 3
S2
+3
Point 4
S2
+4
Point 5
S2
+5
Point 1
S2
+6
Point 2
S2
+7
Point 3
S2
+8
Point 4
S2
+9
Point 5
S2
+10
Command
input
FNC 269
DSCL2
Y
S2
+3, S2
+2]
Point 2
[ S2
+5, S2
+4]
Point 3
[ S2
+7, S2
+6]
Point 4
[ S2
+9, S2
+8]
Point 5
[ S2
+11, S2
+10]
Operation
error
Point 1
[ S2
+13, S2
+12]
Point 2
[ S2
+15, S2
+14]
Point 3
[ S2
+17, S2
+16]
Point 4
[ S2
+19, S2
+18]
Point 5
[ S2
+21, S2
+20]
X coordinate
Point 4
Operation is enabled.
Y coordinate
686
[ S2
Point 3
Input value ( S1 )
+1, S2
Point 1
Point 5
Point 1
Device assignment in
setting data table
Set item
Point 2
Output
value
( D )
Operation
error
S1
21
The conversion table for scaling is set based on the data table stored in a device specified in [ S2 +1,
S2 ] 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
X coordinate
+1, S2
+1
[ S2
+3, S2
+2]
S2
+2
[ S2
+5, S2
+4]
Point n (last)
S2
+n
[ S2
+2n+1, S2
+2n]
Point 1
S2
+n+1
[ S2
+2n+3, S2
+2n+2]
Point 2
S2
+n+2
[ S2
+2n+5, S2
+2n+4]
S2
+2n
[ S2
+4n+1, S2
S2
Point 2
FNC180
Alternate
Instructions
24
...
...
...
+4n]
FNC181FNC189
Others
Point n (last)
23
...
...
...
Y coordinate
32-bit operation
[ S2
S2
Point 1
22
FNC170FNC179
External Device
Set item
FNC160FNC169
Real Time Clock
25
FNC190FNC199
Block Data
26
FNC200FNC209
Character String
27
FNC210FNC219
Data
28
FNC220FNC249
Data
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
687
Point 6(200,250)
Point 7
(250,90)
Point 5
(200,70)
Point 9
(350,30)
Point 4(200,25)
Point 1(5,7)
Point 8(350,90)
Point 10(400,7)
X
When R0 is specified in
S2
X coordinate
Y coordinate
688
S2
Remarks
Setting
contents
R0
K10
Point 1
S2
+1
R1
K5
Point 2
S2
+2
R2
K20
Point 3
S2
+3
R3
K50
Point 4
S2
+4
R4
K200
Point 5
S2
+5
R5
K200
Point 6
S2
+6
R6
K200
Point 7
S2
+7
R7
K250
Point 8
S2
+8
R8
K350
Point 9
S2
+9
R9
K350
Point 10
S2
+10
R10
K400
Point 1
S2
+11
R11
K7
Point 2
S2
+12
R12
K30
Point 3
S2
+13
R13
K100
Point 4
S2
+14
R14
K25
Point 5
S2
+15
R15
K70
Point 6
S2
+16
R16
K250
Point 7
S2
+17
R17
K90
Point 8
S2
+18
R18
K90
Point 9
S2
+19
R19
K30
Point 10
S2
+20
R20
K7
Refer to *1.
Refer to *2.
Refer to *1.
Refer to *2.
*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.
*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.
21
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When S1
When the value exceeds the 32-bit data range in the middle of operation (error code: K6706)
In this case, check whether the distance between points is not 65535 or more.
If the distance is 65535 or more, reduce the distance between points.
23
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.
Program
R0
D0
D10
END
25
Conversion setting data table for scaling
Point 3
(30,100)
K6
Output value
(D10)=35
Point 2
(10,50)
Point 4
(40,45)
Point 1
R1
K0
Point 5
(50,30)
Point 2
R2
K10
Point 3
R3
Point 1
(0,0)
Input value(D0)=7
Point 6
(60,0)
X coordinate
K30
Point 4
R4
K40
Point 5
R5
K50
Point 6
R6
K60
Point 1
R7
K0
Point 2
R8
K50
Y coordinate
Point 3
R9
K100
Point 4
R10
K45
Point 5
R11
K30
Point 6
R12
K0
26
27
28
FNC220FNC249
Data
R0
Number of coordinate
points
FNC210FNC219
Data
Setting
contents
FNC200FNC209
Character String
Device
Set item
FNC190FNC199
Block Data
Operation
Y
24
FNC181FNC189
Others
FNC 269
SCL2
FNC180
Alternate
Instructions
Program example
M8000
22
FNC170FNC179
External Device
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 the 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.
FNC160FNC169
Real Time Clock
Errors
29
FNC250FNC269
Data Table
30
FNC270FNC274
Ex-Device
689
690
FNC No.
Mnemonic
Symbol
Function
Reference
270
IVCK
IVCK S1 S2 D n
Section
30.1
271
IVDR
IVDR S1 S2 S3 n
Inverter Drive
Section
30.2
272
IVRD
IVRD S1 S2 D n
Section
30.3
273
IVWR
IVWR S1 S2 S3 n
Section
30.4
274
IVBWR
IVBWR S1 S2 S3 n
Section
30.5
21
FNC160-FNC169
Real Time Clock
Control
30.1
Outline
1. Instruction format
16-bit Instruction
9 steps
Mnemonic
Operation Condition
IVCK
Continuous
Operation
23
Operation Condition
FNC180
Alternate
Instructions
FNC 270
IVCK
2. Set data
Operand Type
Description
S2
FNC181-FNC189
Others
24
Data Type
S1
16-bit binary
25
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
3 3
3 3
""
3 3
27
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
S1
S2
28
FNC220-FNC249
Data
Comparison
FNC270
IVCK
FNC210-FNC219
Data
Operation 3
Command
input
26
FNC200-FNC209
Character String
Control
S1
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
22
FNC170-FNC179
External Device
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/FX2NC Series.
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
*1.
Mitsubishi FREQROL-F700*3/A700*3/E700*4/V500/F500/A500/E500/S500
Series general-purpose inverters
*2.
*3.
*4.
Mitsubishi FREQROL-E700 Series general-purpose inverters are supported in Ver.2.32 and later.
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
691
Corresponding inverter
Read contents
S2
F700
A700
E700
V500
F500
A500
E500
S500
H7B
Operation mode
H6F
Output frequency
(number of rotations)
H70
Output current
H71
Output voltage
H72
Special monitor
H73
H74
Abnormal contents
H75
Abnormal contents
H76
Abnormal contents
H77
Abnormal contents
H79
H7A
H6E
Set frequency
(read from EEPROM)
H6D
3. Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Number
ch1
M8029
M8063
Number
Description
ch2
ch1
Description
ch2
D8063
D8150
M8151
D8151
M8152
D8152
M8153
M8158
D8153
D8158
M8154
D8154
*1.
*2.
Initial value: -1
Cautions
For other cautions, refer to the Data Communication Edition manual.
It is not permitted to use the RS (FNC 80)/RS2 (FNC 87) instruction and an inverter communication
instruction (FNC270 to FNC274) for the same port.
Two or more inverter communication instructions (FNC270 to FNC274) can be driven for the same port at
the same time.
Item
Outline of function
Addition of applicable
models
Addition of applicable
models
FX3U
692
FX3UC
21
FNC160-FNC169
Real Time Clock
Control
30.2
Outline
1. Instruction format
16-bit Instruction
9 steps
Mnemonic
Operation Condition
IVDR
Continuous
Operation
23
Operation Condition
FNC180
Alternate
Instructions
FNC 271
IVDR
2. Set data
Operand Type
Description
24
Data Type
S2
S3
Set value to be written to the inverter parameter or device number storing the
data to be set
FNC181-FNC189
Others
S1
16-bit binary
25
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
3 3
S3
""
3 3
27
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
FNC271
IVDR
S1
S2
S3
of an inverter*1
28
FNC220-FNC249
Data
Comparison
Command
input
S2
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
S1
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
22
FNC170-FNC179
External Device
This instruction writes a inverter operation required control value to an inverter using the computer link
operation function of the inverter.
This instruction corresponds to the EXTR (K11) instruction in the FX2N/FX2NC Series.
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
29
Mitsubishi FREQROL-F700*3/A700*3/E700*4/V500/F500/A500/E500/S500
Series general-purpose inverters
*2.
*3.
*4.
Mitsubishi FREQROL-E700 Series general-purpose inverters are supported in Ver.2.32 and later.
FNC250-FNC269
Data Table
Operation
*1.
30
FNC270-FNC274
Ex-Device
Inverter Comms
693
Corresponding inverter
Written contents
F700
A700
E700
V500
F500
A500
E500
S500
S2
HFB
Operation mode
HF3
HF9
Operation command
(extension)
HFA
Operation command
HEE
Set frequency
(written to EEPROM)
HED
Set frequency
(written to RAM)
HFD
Inverter reset
HF4
HFC
HFC
User clear
3. Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Number
ch1
ch2
M8029
Number
Description
ch1
Description
ch2
D8063
M8063
D8150
M8151
D8151
M8152
D8152
D8157
M8153
M8158
D8153
D8158
M8154
D8154
*1.
*2.
Initial value: -1
Cautions
For other cautions, refer to the Data Communication Edition manual.
It is not permitted to use the RS (FNC 80)/RS2 (FNC 87) instruction and an inverter communication
instruction (FNC270 to FNC274) for the same port.
Two or more inverter communication instructions (FNC270 to FNC274) can be driven for the same port at
the same time.
Item
Outline of function
Addition of applicable
models
Addition of applicable
models
FX3U
694
FX3UC
21
FNC160-FNC169
Real Time Clock
Control
30.3
Outline
1. Instruction format
16-bit Instruction
9 steps
Mnemonic
Operation Condition
IVRD
Continuous
Operation
23
Operation Condition
FNC180
Alternate
Instructions
FNC 272
IVRD
2. Set data
Operand Type
Description
Inverter station number (K0 to K31)
S2
24
Data Type
FNC181-FNC189
Others
S1
16-bit binary
25
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
3 3
""
3 3
27
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
S1
S2
28
FNC220-FNC249
Data
Comparison
FNC272
IVRD
FNC210-FNC219
Data
Operation 3
Command
input
26
FNC200-FNC209
Character String
Control
S1
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
22
FNC170-FNC179
External Device
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/FX2NC Series.
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
*1.
Mitsubishi FREQROL-F700*2/A700*2/E700*3/V500/F500/A500/E500/S500
Series general-purpose inverters
*2.
*3.
Mitsubishi FREQROL-E700 Series general-purpose inverters are supported in Ver.2.32 and later.
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
695
2. Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Number
ch1
ch2
M8029
Number
Description
ch1
Description
ch2
D8063
M8063
D8150
M8151
D8151
M8152
D8152
D8157
M8153
M8158
D8153
D8158
M8154
D8154
latch
*1.
*2.
Initial value: -1
Cautions
For other cautions, refer to the Data Communication Edition manual.
It is not permitted to use the RS (FNC 80)/RS2 (FNC 87) instruction and an inverter communication
instruction (FNC270 to FNC274) for the same port.
Two or more inverter communication instructions (FNC270 to FNC274) can be driven for the same port at
the same time.
Item
Outline of function
Addition of applicable
models
Addition of applicable
models
FX3U
696
FX3UC
21
FNC160-FNC169
Real Time Clock
Control
30.4
Outline
1. Instruction format
16-bit Instruction
9 steps
Mnemonic
Operation Condition
IVWR
Continuous
Operation
23
Operation Condition
FNC180
Alternate
Instructions
FNC 273
IVWR
2. Set data
Operand Type
Description
S2
S3
Set value to be written to the inverter parameter or device number storing the
data to be set
FNC181-FNC189
Others
24
Data Type
S1
16-bit binary
25
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
S3
3 3
3 3
""
3 3
27
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
FNC273
IVWR
S1
S2
S3
28
FNC220-FNC249
Data
Comparison
Command
input
FNC210-FNC219
Data
Operation 3
26
FNC200-FNC209
Character String
Control
S1
FNC190-FNC199
Block Data
Operation
3. Applicable devices
Operand
Type
22
FNC170-FNC179
External Device
This instruction writes an inverter parameter of an inverter using the computer link operation function of the
inverter.
This instruction corresponds to the EXTR (K13) instruction in the FX2N/FX2NC Series.
For detailed explanation of the instruction, refer to the Data Communication Edition manual.
29
Mitsubishi FREQROL-F700*2/A700*2/E700*3/V500/F500/A500/E500/S500
Series general-purpose inverters
*2.
*3.
Mitsubishi FREQROL-E700 Series general-purpose inverters are supported in Ver.2.32 and later.
FNC250-FNC269
Data Table
Operation
*1.
30
FNC270-FNC274
Ex-Device
Inverter Comms
697
2. Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Number
ch1
ch2
M8029
Number
Description
ch1
Description
ch2
D8063
M8063
D8150
M8151
D8151
M8152
D8152
D8157
M8153
M8158
D8153
D8158
M8154
D8154
latch
*1.
*2.
Initial value: -1
Cautions
For other cautions, refer to the Data Communication Edition manual.
It is not permitted to use the RS (FNC 80)/RS2 (FNC 87) instruction and an inverter communication
instruction (FNC270 to FNC274) for the same port.
Two or more inverter communication instructions (FNC270 to FNC274) can be driven for the same port at
the same time.
Item
Outline of function
Addition of applicable
models
Addition of applicable
models
FX3U
698
FX3UC
21
FNC160-FNC169
Real Time Clock
Control
30.5
Outline
1. Instruction format
FNC 274
IVBWR
16-bit Instruction
9 steps
Mnemonic
Operation Condition
IVBWR
Operation Condition
23
FNC180
Alternate
Instructions
Continuous
Operation
2. Set data
Operand Type
Description
Data Type
S2
S3
24
FNC181-FNC189
Others
S1
25
3. Applicable devices
Bit Devices
System User
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
S2
3 3
3 3
S3
3 3
""
26
FNC200-FNC209
Character String
Control
S1
FNC190-FNC199
Block Data
Operation
Operand
Type
22
FNC170-FNC179
External Device
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.
3 3
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
699
FNC274
IVBWR
S1
S3
S2
*1.
Mitsubishi FREQROL-F700*3/A700*3/E700*4/V500/F500/A500/E500/S500
Series general-purpose inverters
*2.
is written to an inverter*1
S3
1st parameter
+1
S3
+2
S3
+3
S3
+2 S2
-4
S3
+2 S2
-3
S3
+2 S2
-2
S3
+2 S2
-1
2nd parameter
Set value
Parameter number
Set value
...
...
...
S3
Parameter number
Parameter number
S2
-1th parameter
Set value
Parameter number
S2
th parameter
Set value
*3.
*4.
Mitsubishi FREQROL-E700 Series general-purpose inverters are supported in Ver.2.32 and later.
2. Related devices
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Number
ch1
M8029
700
Description
ch2
Number
ch1
Description
ch2
D8063
M8063
D8150
M8151
D8151
M8152
D8152
D8157
M8153
M8158
D8153
D8158
M8154
D8154
*1.
*2.
Initial value: -1
21
For other cautions, refer to the Data Communication Edition manual.
It is not permitted to use the RS (FNC 80)/RS2 (FNC 87) instruction and an inverter communication
instruction (FNC270 to FNC274) for the same port.
Outline of function
23
Addition of applicable
models
Addition of applicable
models
FNC180
Alternate
Instructions
Applicable version
22
FNC170-FNC179
External Device
Two or more inverter communication instructions (FNC270 to FNC274) can be driven for the same port at
the same time.
FNC160-FNC169
Real Time Clock
Control
Cautions
FX3U
FX3UC
24
FNC181-FNC189
Others
25
FNC190-FNC199
Block Data
Operation
26
FNC200-FNC209
Character String
Control
27
FNC210-FNC219
Data
Operation 3
28
FNC220-FNC249
Data
Comparison
29
FNC250-FNC269
Data Table
Operation
30
FNC270-FNC274
Ex-Device
Inverter Comms
701
702
FNC No.
Mnemonic
Symbol
Function
Reference
275
276
277
278
RBFM
RBFM m1 m2 D n1 n2
Section
31.1
279
WBFM
WBFM m1 m2 S n1 n2
Section
31.2
31
FNC275-FNC279
Data
Transfer 3
31.1
Outline
1. Instruction format
16-bit Instruction
Mnemonic
11 steps RBFM
Operation Condition
Continuous
Operation
Operation Condition
2. Set data
Description
34
Data Type
m1
Unit number [0 to 7]
m2
Head device number storing data to be read from buffer memory (BFM)
n1
n2
35
Interrupt
Function
3. Applicable devices
Operand
Type
Bit Devices
System User
SFCSTL
Programming
Operand Type
33
FNC290-FNC299
Extension File
Register
FNC 278
RBFM
32
FNC280-FNC289
High Speed
Processing 2
This instruction reads data from continuous buffer memories (BFM) in a special function block/unit over
several operation cycles by the time division method. This instruction is convenient for reading receive data,
etc. stored in buffer memories in a special function block/unit for communication by the time division method.
FROM (FNC 78) instruction is also available to read the buffer memory (BFM) data.
For FROM (FNC 78) instruction, refer to Section 15.9.
Word Devices
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
3 3
3 3
m2
3 3
3 3
S 3
n1
3 3
3 3
n2
3 3
3 3
""
36
Special Device
m1
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
703
FNC278
RBFM
M8029
m1
m2
n1
n2
M{{
Instruction execution
complete
Instruction
non-execution
MUU
Instruction execution
abnormally complete
M8328
M8329
*1
Read
BFM#(m2+n1-1)
PLC
D
D +n1-1
When the instruction is finished normally, the instruction execution complete flag M8029 turns ON. When
the instruction is finished abnormally, the instruction execution abnormally complete flag M8329 turns ON.
When RBFM (FNC278) or WBFM (FNC279) instruction is executed in another step for the same unit
number, the instruction non-execution flag M8328 is set to ON, and execution of such an instruction is
paused.
When execution of the other target instruction is complete, the paused instruction resumes.
Related devices
For the flag use methods for instruction execution complete and instruction execution
abnormally complete, refer to Subsection 6.5.2.
Device
Name
Description
M8029
M8328
Instruction non-execution
M8329
Related instructions
Instruction
FROM(FNC 78)
TO(FNC 79)
WBFM(FNC279)
Description
Read from a special function block
Write to a special function block
Divided BFM write
Errors
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the unit number "m1" does not exist (error code: K6708)
704
31
FNC275-FNC279
Data
Transfer 3
31.1.1 Common items between RBFM (FNC278) instruction and WBFM (FNC279)
instruction
Specification of unit number of special function block/unit and buffer memory
FX3UC32MT-LT
main unit
I/O
extension
block
Unit
No. 1
Unit
No. 2
Special
extension
block
Special
extension
block
33
FNC290-FNC299
Extension File
Register
Unit No. 0
Built-in
CC-Link/LT
Unit
No. 3
I/O
extension
block
Special
extension
block
34
M8002
Initial pulse
FNC 12
MOV
D8000
Version Up
Information
FNC 07
WDT
K300
37
Error Code
A watchdog timer error may occur when many numbers of points are transferred in one operation cycle. In
such a case, take either of the following countermeasures:
- Change the watchdog timer time
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.
36
Special Device
Cautions
35
Interrupt
Function
Up to 32767 16-bit RAM memories are built in a special extension unit/block, and they are called buffer
memories.
The buffer memory number is from "0" to "32766", and the contents are determined according to each special
function unit/block.
Setting range: K0 to K32766
For the contents of buffer memories, refer to the manual of the special function block/unit used.
SFCSTL
Programming
A unit number is automatically assigned to each special extension unit/block connected to the PLC.
The unit number is assigned in the way "No. 0 No. 1 No. 2 ... starting from the equipment nearest the
main unit.
32
FNC280-FNC289
High Speed
Processing 2
B
Execution Times
C
Applicable
Instruction List
705
Do not stop the driving of the instruction while it is being executed. If driving is stopped, the buffer memory
(BFM) reading/writing processing is suspended, but the data acquired in the middle of reading/writing
processing is stored in D and later and buffer memories (BFM).
Command
input
M{{
FNC278
RBFM
M8029
m1
m2
SET
M{{
n1
n2
RST
M{{
When indexing is executed, the contents of index registers at the begining of execution are used.
Even if the contents of index registers are changed after the instruction, such changes do not affect the
process of the instruction.
The contents of "n1" devices starting from D
change while RBFM (FNC278) instruction is executed.
After execution of the instruction is completed, execute another instruction for "n1" devices starting from
D .
Do not update (change) the contents of "n1" devices starting from S
while WBFM (FNC279) instruction
is executed. If the contents are updated, the intended data may not be written to the buffer memories
(BFM).
Do not update (change) the contents of "n1" buffer memories (BFM) starting from the buffer memory No.
"m2" while RBFM (FNC278) instruction is executed. If the contents are updated, the intended data may
not be read.
706
31
In the example shown below, data is read from and written to the buffer memories (BFM) in the unit No. 2 as
follows:
When X000 is set to ON, data stored in D100 to D179 (80 points) are written to the buffer memories (BFM)
#1001 to 1080 in the special function block/unit whose unit number is No. 2 by 16 points in each operation
cycle.
X000
K80
K16
RST
M0
Y000
M0
BFM write
start
M0
BFM write
start
FNC279
WBFM
K2
K1001
D100
M8029
33
FNC290-FNC299
Extension File
Register
M0
SET
M8329
RST
34
SFCSTL
Programming
Instruction non-execution
Instruction execution
abnormally complete
35
SET
M5
K80
K16
RST
M5
Interrupt
Function
X001
BFM read
start
M5
BFM read
start
FNC278
RBFM
K2
K2001
M8029
D200
36
Special Device
32
FNC280-FNC289
High Speed
Processing 2
When X001 is set to ON, the buffer memories (BFM) #2001 to 2080 (80 points) in the special function
block/unit whose unit number is No. 2 are written to D200 to D279 by 16 points in each operation cycle.
FNC275-FNC279
Data
Transfer 3
Program example
RST
M5
37
Error Code
Instruction execution
abnormally complete
END
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
707
31.2
Outline
This instruction writes data to continuous buffer memories (BFM) in a special function block/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/unit for communication by the time division method.
TO (FNC 79) instruction is also available for writing data to the buffer memory (BFM).
For TO (FNC 79) instruction, refer to Section 15.10.
1. Instruction format
FNC 279
WBFM
16-bit Instruction
Mnemonic
11 steps WBFM
Operation Condition
Continuous
Operation
Operation Condition
2. Set data
Operand Type
Description
Data Type
m1
Unit number [0 to 7]
m2
n1
n2
3. Applicable devices
Operand
Type
Bit Devices
System User
Word Devices
Digit Specification
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
m1
3 3
3 3
m2
3 3
3 3
S 3
n1
3 3
3 3
n2
3 3
3 3
708
System User
Others
Special
Unit
""
31
Command
input
FNC278
WBFM
M8029
m1
m2
n1
PLC
n2
Instruction
non-execution
MUU
Instruction execution
abnormally complete
M8328
M8329
S +n1-1
33
BFM#(m2+n1-1)
Related devices
For the flag use methods for instruction execution complete and instruction execution
abnormally complete, refer to Subsection 6.5.2.
Device
Name
Description
M8328
Instruction non-execution
M8329
37
Related instructions
TO(FNC 79)
RBFM(FNC278)
Error Code
Instruction
FROM(FNC 78)
36
Special Device
M8029
35
Interrupt
Function
When the RBFM (FNC278) or WBFM (FNC279) instruction is executed in another step for the same unit
number, the instruction non-execution flag M8328 is set to ON, and execution of such an instruction is
paused.
When execution of the first target instruction is complete, the paused instruction resumes.
34
SFCSTL
Programming
When the instruction is finished normally, the instruction execution complete flag M8029 turns ON. When
the instruction is finished abnormally, the instruction execution abnormally complete flag M8329 turns ON.
FNC290-FNC299
Extension File
Register
M{{
Instruction execution
complete
*1
Write
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
Description
Read from a special function block
Write to a special function block
Divided BFM read
An operation error is caused in the following case; The error flag M8067 turns ON, and the error code is
stored in D8067.
Version Up
Information
Errors
When the unit number "m1" does not exist (error code: K6708)
B
Execution Times
C
Applicable
Instruction List
709
710
FNC No.
Mnemonic
Symbol
280
HSCT
281
282
283
284
285
286
287
288
289
HSCT S1 m S2 D n
Function
High Speed Counter Compare With
Data Table
Reference
Section
32.1
32.1 FNC280 HSCT / High Speed Counter Compare With Data Table
31
FNC275-FNC279
Data
Transfer 3
32.1
Outline
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.
FNC280-FNC289
High Speed
Processing 2
1. Instruction format
FNC 280
HSCT
16-bit Instruction
Mnemonic
Operation Condition
21 steps
Operation Condition
DHSCT
Continuous
Operation
33
FNC290-FNC299
Extension File
Register
2. Set data
Operand Type
Description
Data Type
S1
S2
32-bit binary
Bit
16-bit binary
35
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
S1
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
36
m
S
3 3
Special Device
3 3
S2
D
3 3
37
Error Code
FNC280
DHSCT
S1
S2
A
Version Up
Information
The current value of a high speed counter specified in S2 is compared with the data table shown below
which has (3m) points stored in S1 and later, and the operation output set value (ON or OFF) specified
in the data table is output to D to D +n-1.
Command
input
Interrupt
Function
Operand
Type
34
SFCSTL
Programming
32
B
Execution Times
C
Applicable
Instruction List
711
Comparison value
S1
+4, S1
+3
S1
+7 S1
+6
m-2
S1
+3m-5, S1
m-1
S1
+3m-2, S1
S1
+2
S1
+5
S1
+8
+3m-6
S1
+3m-4
+3m-3
S1
+3m-1
to
+n-1
...
+1, S1
...
S1
...
Operation output
destination
1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0
D =
Y
0
1
1
Y
0
1
0
Y
0
0
7
Y
0
0
6
D +n-1
Y
0
0
5
Y
0
0
4
1) When this instruction is executed, the data table is set as the comparison target.
2) When the current value of the high speed counter, specified in S2 , becomes equivalent to the
comparison value in the data table, the corresponding operation output specified in the data table is
output to D to D +n-1.
If an output (Y) is specified in D , the output processing is executed immediately without waiting for
the output refresh executed by the END instruction.
When specifying an output (Y), make sure that the least significant digit of the device number is 0.
Examples: Y000, Y010 and Y020
3) Immediately after step 2), 1 is added to the current table counter value D8138.
4) The next comparison point is set as the comparison target data.
5) Steps 2) and 3) are repeated until the current value of the table counter D8138 becomes "m".
When the current value becomes "m", the instruction execution complete flag M8138 turns ON, and the
execution returns to step 1). At this time, the table counter D8138 is reset to "0".
6) When the command contact is set to OFF, execution of the instruction is stopped and the table counter
D8138 is reset to 0.
712
31
X010
FNC280
DHSCT
D200
M8000
K5
FNC 54
DHSCR
C235
Y010
K3
K900
C235
C235
32
FNC280-FNC289
High Speed
Processing 2
Comparison data
FNC275-FNC279
Data
Transfer 3
Operation example
SET/RESET pattern
Comparison
point number
Device
Comparison
value
Device
Operation
output set
value
D201,D200
K321
D202
H0001
D204,D203
K432
D205
H0007
D207,D206
K543
D208
H0002
D210,D209
K764
D211
H0000
D213,D212
K800
D214
H0003
4 (Repeated from 0)
33
FNC290-FNC299
Extension File
Register
34
900
900
900
800
800
675
764
764
543
432
432
321
321
225
OFF*1
ON
Y011
OFF*1
ON
Y012
*1
ON
0 1
Because DHSCT
instruction is not
executed, the
operation outputs are
not changed by this
instruction.
*1.
3
0
A
Version Up
Information
HSCT
instruction
execution
complete flag
OFF
M8138
37
Error Code
Y010
HSCT table
counter
D8138
36
Time
Special Device
0
Command
contact
ON
X010 OFF
OFF
35
543
Interrupt
Function
450
SFCSTL
Programming
Current value
of C235
ON
M8138
HSCT(FNC280) instruction
execution complete flag
Turns ON when the operation for the final table No. "m-1" is completed.
Execution Times
D8138
2. Related device
Device
Name
Description
Applicable
Instruction List
713
Cautions
This instruction can be executed only once in a program.
If this instruction is programmed two or more times, an operation error is caused by the second instruction
and later, and the instruction will not be executed. (error code: K6765)
This instruction constructs the data table at the END instruction of the first execution of the instruction.
Accordingly, the operation output works after the second scan and later.
With regard to DHSCT (FNC280), DHSCS (FNC 53), DHSCR (FNC 54) and DHSZ (FNC 55) instructions,
up to 32 instructions can be executed in one operation cycle. An operation error is caused by the 33rd
instruction and later, and the instruction will not be executed. (error code: K6705)
If an output (Y) is specified in D , the output processing is executed immediately without waiting for the
output refresh executed by END instruction.
When specifying an output (Y), make sure that the least significant digit of the device number is 0.
Examples: Y000, Y010 and Y020
When a high speed counter specified in S2
as software counters.
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, make 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.
When the DHSCT instruction is used with a hardware counter (C235, C236, C237, C238, C239, C240,
C244 (OP), C245 (OP), C246, C248 (OP), C251, C253), the hardware counter is automatically switched to
a software counter, and the maximum frequency and total frequency are affected.
Errors
An operation error occurs in the following cases; The error flag M8067 turns ON, and the error code is stored
in D8067.
When any devices other than high speed counters C235 to C255 are specified in S2
When the 3m-1th device from a device specified in S1
code: K6706)
When the nth device from a device specified in
K6706)
When this instruction is used two or more times in a program (error code: K6765)
With regard to DHSCT (FNC280), DHSCS (FNC 53), DHSCR (FNC 54) and DHSZ (FNC 55) instructions,
up to 32 instructions can be executed in one operation cycle. An operation error is caused by the 33rd
instruction and later, and the instruction will not be executed. (error code: K6705)
714
31
In the program 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.
M8000
M8235
32
H0008
K1Y010
K400
C235
C235
R0
C235
Y010
K4
K5
Initial output
33
FNC290-FNC299
Extension File
Register
FNC280
DHSCT
K0
FNC 12
MOVP
FNC 54
DHSCR
FNC280-FNC289
High Speed
Processing 2
M8000
C235
END
34
SFCSTL
Programming
Operation example
Comparison data
SET/RESET pattern
Device
Comparison
value
Device
Operation
output set
value
R1,R0
K100
R2
H0007
R4,R3
K150
R5
H0004
35
Interrupt
Function
Comparison
point
R7,R6
K200
R8
H0003
R10,R9
K250
R11
H0006
R13,R12
K300
R14
H0008
4 (Repeated from 0)
36
Special Device
400
300
37
250
Error Code
200
150
100
0
Time
Y011
OFF ON
Y012
OFF ON
Y013
ON OFF
4
0
Execution Times
0 1
Version Up
Information
Y010 OFF ON
Table
counter
D8138
FNC275-FNC279
Data
Transfer 3
Program example
C
Applicable
Instruction List
715
716
FNC No.
Mnemonic
Symbol
Function
290
LOADR
291
SAVER
292
INITR
293
LOGR
294
RWER
295
INITER
296
297
298
299
LOADR S n
SAVER
S m D
INITR S n
LOGR S m D1 n D2
RWER S n
INITER
S n
Reference
Load From ER
Section
33.1
Save to ER
Section
33.2
Initialize R and ER
Section
33.3
Logging R and ER
Section
33.4
Rewrite to ER
Section
33.5
Initialize ER
Section
33.6
31
FNC275-FNC279
Data
Transfer 3
33.1
Outline
This instruction reads the current values of extension file registers (ER) stored in a memory cassette (flash
memory), and transfers them to extension registers (R) stored in the PLC's built-in RAM.
FNC280-FNC289
High Speed
Processing 2
1. Instruction format
FNC 290
LOADR
16-bit Instruction
5 steps
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
33
FNC290-FNC299
Extension File
Register
Mnemonic
LOADR
LOADRP
2. Set data
Operand Type
Description
Data Type
34
16-bit binary
SFCSTL
Programming
3. Applicable devices
Bit Devices
Word Devices
System User
Digit Specification
System User
35
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3 3
36
FNC290
LOADRP
S +1
S +1
S +2
S +2
S +3
S +3
S +n-2
S +n-2
S +n-1
S +n-1
B
Execution Times
A
Version Up
Information
Read
(transfer)
37
Error Code
The contents (current values) of extension file registers (ER) stored in a memory cassette (flash memory)
having the same numbers with the extension registers specified by S
to S +n-1 are read, and
transferred to the extension registers specified by S
to S +n-1 stored in the PLC's built-in RAM.
Special Device
Command
input
Interrupt
Function
Operand
Type
32
Reading and transfer are executed in units of device. Up to 32768 devices can be read and transferred.
717
C
Applicable
Instruction List
Different from SAVER (FNC291), INITR (FNC292) and LOGR (FNC293) instructions, it is not necessary to
execute this instruction in units of sector.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the last device number to be transferred exceeds 32767 (error code: K6706)
At this time, devices up to the last one (R32767) are read and transferred.
When a memory cassette is not connected (error code: K6771)
Program example
In the program example shown below, the contents (current value) 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.
M0
FNC290
LOADR
R1
718
ER1
K100
ER2
K4000
Read
(transfer)
K100
K50
R2
K50
ER3
H0003
R3
H0003
ER4
H0101
R4
H0101
ER3999
K55
R3999
K55
ER4000
K59
R4000
K59
31
FNC275-FNC279
Data
Transfer 3
33.2
Outline
33
1. Instruction format
16-bit Instruction
7 steps
Mnemonic
Operation Condition
SAVER
Continuous
Operation
FNC290-FNC299
Extension File
Register
FNC 291
SAVER
Operation Condition
34
Operand Type
Data Type
16-bit binary
35
Interrupt
Function
Description
SFCSTL
Programming
2. Set data
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3 3
3
37
Error Code
Execution Times
M{{
A
Version Up
Information
36
Special Device
Command
input
32
FNC280-FNC289
High Speed
Processing 2
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 (FNC294) 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 (FNC292) or INITER (FNC295) instruction
every time when RWER instruction is used.
For RWER instruction, refer to Section 33.5.
C
Applicable
Instruction List
719
Write *1
(transfer)
S +1
E S +1
S +2
E S +2
S +2047
E S +2047
Head device
number
Sector
number
Head device
number
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
2. Related device
For the instruction execution complete flag use method, refer to Subsection 6.5.2.
Device
number
M8029
Name
Description
Cautions
1. Cautions on writing data to a memory cassette
Memory cassettes adopt flash memory. Note the following contents when writing data to extension file
registers in a memory cassette with the FNC291 instruction.
It takes about 340ms to write 2048 points. If n is set to K0 or K2048, the operation cycle for executing this
instruction becomes longer than about 340ms.
If the operation cycle is severely affected, write data in two or more operation cycles.
When writing data in two or more operation cycles, set n in the range from K1 to K1024.
720
Write
command
FNC295
INTERP
FNC291
SAVER
M{{
33
M{{
A
Version Up
Information
B
Execution Times
[2] When storing data of 2048 extension registers (R) in one sector to extension file registers (ER)
1) 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 (FNC 15) instruction.
2) Execute INITR (FNC292) instruction to extension registers (R) and extension file registers (ER)
specified as targets in SAVER instruction.
3) Return the data of 1024 points temporarily withdrawn in step 1) to extension registers (R) specified
as targets by using BMOV (FNC 15) instruction.
4) Execute SAVER instruction.
37
Error Code
[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].
1) Execute INITR (FNC292) instruction to extension registers (R) and extension file registers (ER)
specified as targets in SAVER instruction.
2) Store data to extension registers (R) specified as targets.
3) Execute SAVER instruction.
36
Special Device
[2] When storing the contents of an arbitrary number of extension registers (R) to extension file
registers (ER)
Use RWER instruction.
For RWER (FNC294) instruction, refer to Section 33.5.
35
Interrupt
Function
[1] When storing data of 2048 extension registers (R) in one sector to
extension file registers (ER)
1) Execute INITER (FNC295) instruction to extension file registers (ER) specified as targets in
SAVER instruction.
2) Execute SAVER instruction.
34
SFCSTL
Programming
Execute INITER (FNC295) or INITR (FNC292) instruction to target extension file registers (ER) before
executing SAVER instruction. If SAVER instruction is driven before INITER (FNC295) or INITR (FNC292)
instruction is executed, an operation error (error code: K6770) may be caused.
To avoid such an operation error, make a program for executing SAVER instruction in the following
sequence:
FNC290-FNC299
Extension File
Register
32
FNC280-FNC289
High Speed
Processing 2
M{{
SET
31
FNC275-FNC279
Data
Transfer 3
Do not abort execution of this instruction in the middle of operation. If execution is aborted, unexpected
data may be written to extension file registers.
If execution of this instruction is aborted by turning OFF the power, execute the instruction again using step
2 described below after turning ON the power again.
C
Applicable
Instruction List
721
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When any device number other than the head device number of a sector of extension file registers is set to
(error code: K6706)
S
When a memory cassette is not connected (error code: K6771)
When the protect switch of the memory cassette is set to ON (error code: K6770)
When the collation result after data writing is "mismatch" due to omission of initialization or for another
reason (error code: K6770)
When this error occurs, the current values (data) of extension registers (R) may be lost. To avoid the data
loss, back up the data of extension registers (R) in advance using the following procedure:
1)Set the PLC mode to STOP.
2)Create a new project in GX Developer.
This step is not necessary if it is alright to overwrite the current project.
3)Read the contents of extension registers (R) to GX Developer.
[1]Select Online Read from PLC..." to
display the Read from PLC window.
[2]Click PLC parameter and Device data
to put a check mark to each of them.
[3]Click [Execute] button to execute reading.
[4]When reading is completed, save the
project.
FX3U(C)*1
FX3U(C)*2
722
31
FNC275-FNC279
Data
Transfer 3
Program examples
1) In the case of FX3UC PLCs Ver. 1.30 or later and FX3U PLCs Ver. 2.20 or later
Program
X000
M0
R0
K1
FNC295
INITERP
33
FNC290-FNC299
Extension File
Register
M0
SET
(1)
FNC 07
WDTP
R0
K128
D0
34
(2)
M0
SFCSTL
Programming
FNC291
SAVER
END
35
Interrupt
Function
Operation
Setting data
R0
K100
ER0
K100
ER0
HFFFF
R1
K105
ER1
K105
ER1
HFFFF
.
.
.
.
.
.
.
.
ER10
HFFFF
ER11
HFFFF
ER12
HFFFF
K200
ER10
K300
R11
K215
ER11
K330
R12
K400
ER12
K350
.
.
K350
.
.
ER19
.
.
K400
R99
K1000
ER99
R100
HFFFF
.
.
.
.
HFFFF
.
.
.
.
INITER
instruction
.
.
ER19
.
.
HFFFF
K1000
.
.
ER99
.
.
HFFFF
ER100
HFFFF
ER100
HFFFF
.
.
.
.
.
.
.
.
ER2047
HFFFF
ER2047
37
(2)
SAVER
instruction
HFFFF
To the next page
Execution Times
R2047
.
.
(1)
.
.
Version Up
Information
.
.
R19
.
.
36
Error Code
Changed data
R10
.
.
Unused
Special Device
32
FNC280-FNC289
High Speed
Processing 2
In the example shown below, only extension registers R10 to R19 (in sector 0) need to be updated in the
extension file registers (ER). When X000 is set to ON, sector 0 (head device R0) is written to the
extension file registers 128 points at a time. (128 points are written in one operation cycle)
C
Applicable
Instruction List
723
Setting data
Current
value
Device number
Current
value
R0
K100
ER0
K100
R1
K105
ER1
K105
.
.
R10
.
.
K200
.
.
.
.
R11
K215
SAVER
instruction
Changed data
(2)
Setting data
R12
K400
.
.
.
.
ER10
K200
ER11
K215
ER12
K400
.
.
ER19
.
.
K350
.
.
.
.
K350
.
.
R99
.
.
K1000
ER99
K1000
R100
HFFFF
ER100
HFFFF
.
.
.
.
.
.
ER127
.
.
HFFFF
ER128
HFFFF
.
.
ER255
.
.
HFFFF
ER256
HFFFF
.
.
ER1919
.
.
HFFFF
ER1920
HFFFF
.
.
ER2047
.
.
HFFFF
HFFFF
R128
HFFFF
.
.
R255
.
.
HFFFF
R256
HFFFF
.
.
.
.
R1919
2nd operation
cycle
3rd to 15th
operation
cycle
HFFFF
R1920
HFFFF
.
.
R2047
.
.
HFFFF
R127
.
Unused
1st operation
cycle
R19
724
16th
operation
cycle
already written
points (D0)
K128
K256
K1920
K2048
31
In the program example shown below, the changed content settings of the extension registers R10 to
R19 (sector 0) are reflected on extension file registers (ER) when X000 is set to ON. (128 points are
written in one operation cycle.)
X000
R0
FNC292
INITRP
SET
M0
R30720
K100
(1)
R0
K1
(2)
33
FNC290-FNC299
Extension File
Register
FNC 15
BMOVP
FNC 07
WDTP
34
R30720
R0
K100
(3)
FNC291
SAVER
R0
K128
D0
(4)
SFCSTL
Programming
FNC 15
BMOVP
35
M0
Interrupt
Function
END
36
Operation
data*1
Temporarily withdrawn
Unused extension
registers
K100
ER0
K100
R30720
K100
R1
K105
ER1
K105
R30721
K105
.
.
.
.
R10
K200
ER10
K300
R30730
K200
R11
K215
ER11
K330
R30731
K215
R12
K400
ER12
K350
R30732
K400
R19
K350
ER19
Changed data
.
.
.
.
.
.
.
.
.
.
K400
.
.
K350
R30819
K1000
.
.
ER99
.
.
K1000
R100
HFFFF
ER100
HFFFF
.
.
ER2047
.
.
HFFFF
.
.
(2)
INITR
instruction
.
.
B
Execution Times
.
.
K1000
.
.
HFFFF
BMOV
instruction
.
.
R30739
.
.
R99
.
.
R2047
(1)
Version Up
Information
.
.
.
.
37
Error Code
Unused
R0
.
.
Special Device
Setting data
32
FNC280-FNC289
High Speed
Processing 2
Program
M0
FNC275-FNC279
Data
Transfer 3
C
Applicable
Instruction List
725
Setting data
Setting data
HFFFF
ER0
HFFFF
R0
K100
R1
HFFFF
ER1
HFFFF
R1
K105
R10
HFFFF
ER10
HFFFF
R10
K200
R11
HFFFF
ER11
HFFFF
R11
K215
R12
HFFFF
ER12
HFFFF
R12
K400
R19
K350
.
.
.
.
.
.
.
.
R19
.
.
HFFFF
.
.
ER19
(3)
BMOV
.
.
instruction
HFFFF
.
.
.
.
.
.
.
.
.
.
HFFFF
.
.
ER99
.
.
HFFFF
R99
K1000
R100
HFFFF
ER100
HFFFF
R100
HFFFF
.
.
HFFFF
.
.
ER2047
Setting data
R0
K100
ER0
K100
R1
K105
ER1
K105
.
.
.
.
.
.
ER10
.
.
K200
ER11
K215
Changed data
R10
K200
R11
K215
1st operation
cycle
R12
K400
ER12
K400
.
.
R19
.
.
K350
.
.
ER19
.
.
K350
.
.
R99
.
.
K1000
.
.
ER99
.
.
K1000
R100
HFFFF
ER100
HFFFF
.
.
R127
.
.
HFFFF
.
.
.
.
HFFFF
.
.
R255
.
.
HFFFF
R256
.
.
.
R1919
HFFFF
.
.
.
HFFFF
R1920
HFFFF
.
.
.
.
R2047
HFFFF
R128
.
Unused
.
.
HFFFF
Setting data
.
.
R2047
.
.
HFFFF
(4)
SAVER
instruction
.
.
.
.
R99
.
.
R2047
726
.
.
INITR
instruction
R0
.
.
(2)
2nd operation
cycle
3rd to 15th
operation
cycle
16th
operation
cycle
ER127
HFFFF
ER128
HFFFF
.
.
ER255
.
.
HFFFF
ER256
HFFFF
.
.
ER1919
.
.
HFFFF
ER1920
HFFFF
.
.
ER2047
.
.
HFFFF
K128
K256
K1920
K2048
31
FNC275-FNC279
Data
Transfer 3
33.3
Outline
FNC 292
INITR P
16-bit Instruction
5 steps
Mnemonic
INITR
Continuous
Operation
Pulse (Single)
Operation
Operation Condition
34
SFCSTL
Programming
INITRP
Operation Condition
2. Set data
Operand Type
Description
Data Type
35
*1
Interrupt
Function
*1.
16-bit binary
When a memory cassette is not used, extension file registers (ER) are not initialized.
36
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Index
Z Modify K H
""
3
3 3
Execution Times
FNC292
INITRP
A
Version Up
Information
n sectors of extension registers in the PLCs built-in RAM starting from the one specified by S
and n
sectors of extension file registers in a memory cassette (flash memory) having the same device numbers are
initialized (to HFFFF <K-1>).
Initialization is executed in units of sector.
Command
input
37
Error Code
ConReal
CharacPointer
stant Number ter String
Special Device
3. Applicable devices
Operand
Type
33
FNC290-FNC299
Extension File
Register
1. Instruction format
32
FNC280-FNC289
High Speed
Processing 2
This instruction initializes (to HFFFF <K-1>) 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 (FNC293) 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 (FNC291) instruction.
In FX3UC PLCs Ver.1.30 or later and FX3U PLCs, INITER (FNC295) instruction is also provided to initialize (to
"HFFFF" <K-1>) only extension file registers (ER) in a memory cassette (flash memory) in units of sector.
For SAVER (FNC291) instruction, refer to Section 33.2.
For LOGR (FNC293) instruction, refer to Section 33.4.
For INITER (FNC295) instruction, refer to Section 33.6.
C
Applicable
Instruction List
727
The table below shows the head device number in each sector:
Sector
number
Head device
number
Sector
number
Head device
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
Current value
Device number
Before execution
After execution
H0010
HFFFF
Current value
Before execution
After execution
H1234
HFFFF
H5678
HFFFF
+2
H0011
HFFFF
+2
H90AB
HFFFF
+(2048n)-1
+(2048n)-1
HABCD
HFFFF
...
+1
...
...
HFFFF
...
H0020
...
+1
...
HCDEF
HFFFF
Caution
When a memory cassette is attached, 18 ms is required to initialize one sector.
(When a memory cassette is not attached, only 1 ms or less is required to initialize one sector.)
When initializing two or more sectors, take either measures shown below.
Set a large value to the watchdog timer D8000 using the following program
Initial pulse
M8002
728
FNC 12
MOV
K{{{
D8000
31
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.
32
3) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.)
4) Monitor the maximum scan time D8012 (unit: 0.1ms) using the device batch monitoring function in GX
Developer.
Setting WDT (FNC 07) instruction just before and after INITR instruction as shown below:
FNC292
INITR
34
SFCSTL
Programming
FNC 07
WDT
35
If the processing time of the INITR command exceeds 200ms, set the watchdog timer value D8000 (unit: ms)
to the proceessing time or more.
Interrupt
Function
FNC 07
WDT
33
FNC290-FNC299
Extension File
Register
5) 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.
FNC280-FNC289
High Speed
Processing 2
2) Set the current value of D8000 (unit: ms) to "1000" using the device test function in GX Developer.
[Online][Debug][Device test...] "Word device/buffer memory" in Device test dialogbox
Command
input
FNC275-FNC279
Data
Transfer 3
36
Errors
When any device number other than the head device number of a sector of extension file registers is set to
S
(error code: K6706)
Special Device
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
37
Error Code
When the protect switch of the memory cassette is set to ON (error code: K6770)
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
729
Program example
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.
X000
FNC 07
WDT
FNC292
INITR
R0
K1
FNC 07
WDT
END
Before execution
After execution
R0
H1234
HFFFF
R1
H5678
HFFFF
R2
H90AB
HFFFF
...
...
...
R2047
730
Current value
HCDEF
HFFFF
31
FNC275-FNC279
Data
Transfer 3
33.4
Outline
This instruction logs specified devices, and stores the logged data to extension registers (R) in the RAM and
extension file registers (ER) in a memory cassette.
FNC280-FNC289
High Speed
Processing 2
1. Instruction format
FNC 293
LOGR P
16-bit Instruction
11 steps
Mnemonic
Operation Condition
LOGR
Continuous
Operation
Pulse (Single)
Operation
LOGRP
Operation Condition
33
FNC290-FNC299
Extension File
Register
2. Set data
Operand Type
Data Type
34
D1
SFCSTL
Programming
*1.
Description
logged*1
D2
16-bit binary
35
Interrupt
Function
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
Others
Special
Unit
System User
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3 3
3
D1
3 3
3
D2
37
Error Code
D1
D2
A
Version Up
Information
36
Special Device
3 3 3
Command
input
32
B
Execution Times
C
Applicable
Instruction List
731
+m-1
D1
+m
to
D1
+2m-1
D1
+2m
to
D1
Number of
stored data
D1
=m
D1
= 2m
D1
= 3m
+3m-1
...
D1 +(1926 n)-1
D1 +(2048 n)-1
Logging data
storage area
2048 n
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Data writing
area
1926 n
Data writing
position control
area
122 n
The table below shows the head device number in each sector:
Sector
number
732
Head device
number
Sector
number
Head device
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
31
LOGR instruction executes logging in each operation in the continuous operation type.
When logging should be executed only once by one input, use the pulse operation type.
FNC292
INITR
D1
*1
*2
33
FNC290-FNC299
Extension File
Register
Errors
When any device number other than the head device number of a sector of extension file registers is set to
S
(error code: K6706)
While data is written, the remaining area and the data quantity to be written are compared with each other.
If the remaining storage area is insufficient, only a limited amount of data is written. (error code: K6706)
When the collation result after data writing is "mismatch" due to omission of initialization or for another
reason (error code: K6770)
When this error occurs, the current values (data) of extension registers (R) may be lost. To avoid the data
loss, back up the data of extension registers (R) in advance using the following procedure:
1)Set the PLC mode to STOP.
35
Interrupt
Function
When the protect switch of the memory cassette is set to ON (error code: K6770)
34
SFCSTL
Programming
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
36
Special Device
37
FX3U(C)*1
Error Code
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
Cautions
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
733
4)Change the current program inside the PLC to the program shown in Cautions on using a memory
cassette in Cautions on the previous page.
5)To the PLC, write the data which was temporarily withdrawn to GX Developer.
[1]Select Online Write to PLC... to
display the Write to PLC window.
[2]Click PLC parameter and MAIN to put
a check mark to each of them.
[3]Click [Execute] button to execute writing.
FX3U(C)*2
734
31
In the program example shown below, D1 and D2 are logged to the area from R2048 to R6143 every time
X001 turns ON.
X001
FNC293
LOGRP
D1
K2
R2048
K2
D100
R2048 HFFFF
H1234
H1234
R2049 HFFFF
H5678
H5678
R2050 HFFFF
HFFFF
H9ABC
R2051 HFFFF
HFFFF
H1122
R2052 HFFFF
HFFFF
HFFFF
33
FNC290-FNC299
Extension File
Register
X001
OFFON
2nd time
32
FNC280-FNC289
High Speed
Processing 2
X001
OFFON
1st time
Initial value
FNC275-FNC279
Data
Transfer 3
Program example
Data writing
area
34
HFFFC
HFFF0
R5900 HFFFF
HFFFF
HFFFF
R5901 HFFFF
HFFFF
HFFFF
R6143 HFFFF
HFFFF
HFFFF
35
Writing position
control area
Interrupt
Function
R5899 HFFFF
SFCSTL
Programming
36
H1234
D1
H9ABC
D2
H5678
D2
H1122
H0000
H0002
Special Device
D100
D1
H0004
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
735
33.5
Outline
This instruction writes the current values of an arbitrary number of extension registers (R) in the PLCs built-in
RAM to extension file registers (ER) in a memory cassette (flash memory).
Because RWER (FNC294) instruction is not supported in FX3UC PLCs former than Ver.1.30, use SAVER
(FNC291) instruction instead.
For SAVER (FNC291) instruction, refer to Section 33.2.
1. Instruction format
FNC 294
RWER P
16-bit Instruction
5 steps
Mnemonic
Operation Condition
RWER
Continuous
Operation
Pulse (Single)
Operation
RWERP
Operation Condition
2. Set data
Operand Type
Description
Data Type
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
ConReal
CharacPointer
stant Number ter String
Index
Z Modify K H
""
3
3 3
FNC294
RWERP
Write
(transfer)
*1
S +1
S +1
S +2
S +2
S +n-1
+n-1
736
31
FNC 20
ADD
M100
FNC 12
MOV
D8000
D200
D8000
K47 *1
D8000
33
FNC290-FNC299
Extension File
Register
M100
PLS
34
R1000
K100
MOV
D200
D8000
SFCSTL
Programming
FNC 07
WDT
FNC294
RWER
32
FNC280-FNC289
High Speed
Processing 2
Though extension file registers to be written can be specified arbitrarily, writing is executed in units of
sector.
It takes about 47 ms to write one sector. If the extension file registers to be written are located in two
sectors, the instruction execution time will be about 94 ms.
Make sure to change the set value of the watchdog timer D8000 before executing this instruction.
FNC275-FNC279
Data
Transfer 3
Cautions
35
Interrupt
Function
FNC 07
WDT
The table below shows the head device number in each sector:
Sector number
Sector 0
Device range
ER0 to ER2047
Sector number
Sector 8
Device range
36
ER16384 to ER18431
ER2048 to ER4095
Sector 9
ER18432 to ER20479
Sector 2
ER4096 to ER6143
Sector 10
ER20480 to ER22527
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
37
Do not turn OFF the power while this instruction is being executed. If the power is turned OFF, execution
of this instruction may be aborted. If execution is aborted, the data may be lost. Make sure to back up the
data before executing this instruction.
For the backup method, refer to the next page.
Error Code
Sector 3
Special Device
Sector 1
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
737
FX3U(C)*2
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When the last device number to be transferred exceeds 32767 (error code: K6706)
When a memory cassette is not connected (error code: K6771)
When the protect switch of the memory cassette is set to ON (error code: K6770)
738
31
In the program example shown below, the contents of extension registers R10 to R19 (sector 0) used for
setting data are reflected on extension file registers (ER) when X000 turns ON.
Program
32
X000
M0
MOV
D8000
D200
D8000
K47
D8000
33
FNC 07
WDT
FNC280-FNC289
High Speed
Processing 2
PLS
M0
ADD
FNC294
RWER
R10
K10
FNC290-FNC299
Extension File
Register
MOV
D200
D8000
34
SFCSTL
Programming
FNC 07
WDT
END
35
Interrupt
Function
Operation
Extension registers (R)
Setting data
K100
ER0
K100
R1
K105
ER1
K105
.
.
.
.
.
.
.
.
K200
ER10
K200
R11
K215
ER11
K215
R12
K400
ER12
K400
R19
K350
ER19
K350
R99
K1000
ER99
K1000
R100
HFFFF
ER100
HFFFF
R2047
HFFFF
ER2047
HFFFF
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Version Up
Information
.
.
.
.
Write
(when X000
turns ON)
37
Error Code
Changed data
R10
.
.
Unused
36
Special Device
R0
.
FNC275-FNC279
Data
Transfer 3
Program example
.
.
B
Execution Times
C
Applicable
Instruction List
739
33.6
Outline
This instruction initializes extension file registers (ER) to HFFFF (<K-1>) in a memory cassette (flash
memory) before executing the SAVER (FNC291) instruction.
Because the INITER (FNC295) instruction is not supported in FX3UC PLCs earlier than Ver.1.30, use INITR
(FNC292) instruction instead.
For SAVER (FNC291) instruction, refer to Section 33.2.
For INITR (FNC292) instruction, refer to Section 33.3.
1. Instruction format
FNC 295
INITER P
16-bit Instruction
5 steps
Mnemonic
Operation Condition
INITER
Continuous
Operation
Pulse (Single)
Operation
INITERP
Operation Condition
2. Set data
Operand Type
S
Description
Data Type
Head device number of extension register sector with the same device number
as the extension file register to be initialized
16-bit binary
3. Applicable devices
Operand
Type
Bit Devices
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Z Modify K H
ConReal
CharacPointer
stant Number ter String
Index
""
3 3
FNC295
INITERP
The table below shows the head device number in each sector:
Sector
number
Sector 0
740
Head device
number
R0
Sector
number
Sector 8
Head device
number
R16384
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
31
FNC275-FNC279
Data
Transfer 3
Operation
Extension file registers (ER) [inside the memory cassette]
Device number
Current value
Before execution
After execution
H1234
HFFFF
+2
H90AB
HFFFF
+(2048n)-1
HCDEF
HFFFF
FNC280-FNC289
High Speed
Processing 2
HFFFF
...
H5678
...
+1
...
32
33
FNC290-FNC299
Extension File
Register
Caution
About 25 ms is required to initialize one sector.
When initializing two or more sectors, take either measure shown below.
Set a large value to the watchdog timer D8000 using the following program
34
FNC 12
MOV
K{{{
SFCSTL
Programming
Initial pulse
M8002
D8000
36
4) Monitor the maximum scan time D8012 (unit: 0.1ms) using the device batch monitoring function in GX
Developer.
Setting WDT (FNC 07) instruction just before and after INITER instruction as shown below:
FNC 07
WDT
S
Version Up
Information
FNC295
INITER
n
FNC 07
WDT
37
Error Code
5) 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.
Special Device
3) Set the PLC mode to RUN, and execute the program. (Execute this instruction also.)
Command
input
35
Interrupt
Function
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.
B
Execution Times
If the processing time of the INITER command exceeds 200ms, set the watchdog timer value D8000 (unit:
ms) to the processing time or more.
C
Applicable
Instruction List
741
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
When any device number other than the head device number of a sector of extension file registers (ER) is
set to S
(error code: K6706)
When a device number to be initialized exceeds 32767 (error code: K6706)
In this case, devices up to R32767 (ER32767) are initialized.
When the protect switch of the memory cassette is set to ON (error code: K6770)
When a memory cassette is not connected (error code: K6771)
Program example
In the program example shown below, the extension file registers ER0 to ER2047 in sector 0 are initialized.
X000
FNC 07
WDT
FNC295
INITER
R0
K1
FNC 07
WDT
END
After execution
H1234
HFFFF
ER1
H5678
HFFFF
ER2
H90AB
HFFFF
ER0
...
...
...
ER2047
742
Current value
Before execution
HCDEF
HFFFF
31
FNC275-FNC279
Data
Transfer 3
34.1
SFC Program
32
FNC280-FNC289
High Speed
Processing 2
This chapter explains the programming procedures and sequence operations for the SFC and step ladder
programming methods in GX Developer.
33
34
SFCSTL
Programming
Sequence control using the SFC (sequential function chart) is available in FX PLCs.
In SFC programs, the role of each process and the overall control flow can be expressed easily based on
machine operations, so sequence design is easy. Accordingly, machine operations can be easily transmitted
to any person, and created programs are efficient in maintenance, specifications changes and actions against
problems.
When SFC programs and step ladder instructions are programmed conforming to the same rules, they are
compatible with each other.
As a result, the same contents can be handled in relay ladder charts which are familiar and easy to
understand.
FNC290-FNC299
Extension File
Register
34.1.1 Outline
35
Interrupt
Function
In SFC programs, a state relay State S is regarded as one control process, and the input conditions and
output control sequence are programmed in each process.
Because the preceding process is stopped when the program execution proceeds to the next process, a
machine can be controlled using simple sequences for each process.
36
Special Device
A
Version Up
Information
37
Error Code
When a condition (transfer condition) provided between state relays is satisfied, the next state relay turns
ON, and the state relay which has been ON so far turns OFF (transfer operation).
In the state relay ON status transfer process, both state relays are ON only momentarily (for one operation
cycle).
In the next operation cycle after the ON status is transferred to the next state relay, the former state is reset
to OFF.
When the transfer state relay S is used in a contact instruction, however, the contact image is executed in
the OFF status immediately after the transfer condition is satisfied.
B
Execution Times
C
Applicable
Instruction List
743
When X001
turns ON
*1
Y030
31
Activated
SET
X001
2
Y030
31
Y31
SET
X001
TRAN
Y31 programmed
in SET instruction
remains ON even
TRAN
if S31 turns OFF.
Y31
Transfer
condition
Y032
X002
3
Activated
*1
Y030
32
TRAN
Y030
32
Y032
S32 is activated,
and S31 is
automatically
reset.
X002
TRAN
Transfer condition
number
*1.
1. Operation example
Start
LS2
Motor
Forward:
MC1
Backward:
MC2
Start
pushbutton
switch
Moving
forward
1st time
Moving
backward
Stop
for
5 sec
LS2
LS1
Moving
forward
LS3
2nd time
Moving
backward
1) When the start pushbutton switch is pressed, the truck moves forward. When the limit switch LS1 turns
ON, the truck immediately starts to move backward.
(The limit switch LS1 is normally OFF, and turns ON when the truck reaches the forward limit. Other limit
switches function in the same way.)
2) When the truck moves backward and the limit switch LS2 turns ON, the truck stops for 5 seconds, and
then starts to move forward again. When the limit switch LS3 turns ON, the truck immediately starts to
move backward.
3) When LS2 turns ON after that, the truck driving motor stops.
4) When the start pushbutton switch is pressed again after a series of operations finish, the above operation
is repeated.
744
31
Initial
process
LS1
2nd
process
LS2
Stop
process
Stop timer
LS3
35
Interrupt
Function
LS2
4th
process
33
34
Timer
3rd
process
32
SFCSTL
Programming
1st
process
FNC290-FNC299
Extension File
Register
Start switch
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
745
3. Assigning devices
Assign devices of a PLC in the created process drawing.
1) Assign a state relay S
to a rectangle indicating a
process.
At this time, assign a state relay (S0 to S9) to the initial
process.
After the first process, arbitrarily assign state relay numbers
(S20 to S899) except the initial state relays.
(There is no relationship between state relay numbers and
order of processes.)
There are latched (battery backed) type state relays whose
ON/OFF status is stored against power failure.
The state relays S10 to S19 are used for special purposes
when the IST (FNC 60) instruction is used.
2) Assign a device (input terminal number connected to a
pushbutton switch or limit switch, timer number, etc.) to
each transfer condition.
NO contact and NC contact are available for a transfer
condition.
If there are two or more transfer conditions, AND circuit or
OR circuit is available.
3) Assign a device (output terminal number connected to
external equipment, timer number, etc.) used for an
operation performed in each process.
Many devices such as timers, counters and auxiliary relays
are provided in a PLC, and can be used arbitrarily.
The timer T0 is used here. Because T0 works by the 0.1
sec clock, the output contact turns ON five seconds after a
coil is driven when the set value is K50.
If there are two or more loads such as timers and counters
which are driven at the same time, two or more circuits can
be assigned to one state relay.
S0
Start switch
X000
Y023
S20
X001
Y021
S21
X002
S22
S24
X002
Y023
Backward
K50
Stop timer
Y023
S23
X003
Forward
T0
Timer
T0
Y021
Y021
Forward
Y023
Backward
S0
746
SET
S0
31
Input a circuit for setting the initial state relay to ON using the relay ladder.
In this example, the initial state relay S0 is set to ON in a ladder block using the special auxiliary relay
M8002 which turns ON momentarily when the PLC mode is changed from STOP to RUN.
FNC275-FNC279
Data
Transfer 3
When inputting a program using GX Developer, write a relay ladder program to a ladder block, and write an
SFC program to an SFC block.
32
Programs expressing operations in state relays and transfer conditions are handled as internal circuits of
the state relays and transfer conditions.
Create each one using a relay ladder.
FNC280-FNC289
High Speed
Processing 2
Ladder block
M8002
SET
S0
33
0
0
Y023
20
X001
1
21
X002
2
22
TRAN
Y021
TRAN
Y023
TRAN
T0
Y023
23
X003
4
24
X002
Input them as
internal circuits.
TRAN
Y021
37
TRAN
Y023
TRAN
S0
END
A
Version Up
Information
RET
36
Error Code
Y021
K50
Special Device
T0
35
Interrupt
Function
Y021
34
SFCSTL
Programming
X000
FNC290-FNC299
Extension File
Register
B
Execution Times
C
Applicable
Instruction List
747
Ladder block
Initial pulse
M8002
SET
S0
0
X000
Y023
20
X001
X003
Y021
24
X002
TRAN
Y021
TRAN
TRAN
Y023
TRAN
S0
RET
END
748
31
In the latched (battery backed) type state relays S , the ON/OFF status is backed up by the battery
against power failure.
Use this type of state relays if the operation should be restarted from the last point at power recovery after
power failure occurred in the middle of machine operations.
34
SFCSTL
Programming
ANB/ORB/MPS/MRD/
MPP
MC/MCR
Available
Available*1
Not available
Drive processing
Available
*1
Not available
Transfer processing
Available
State relay
Branch/
recombination
relay
state
Available
Not available
35
Not available
When using SFC programs (STL instruction), do not drive state relays S using SET or OUT instructions in
an interrupt program.
It is not prohibited to use jump instructions in state relays. However, it is not recommended to use jump
instructions because complicated movements will result.
The MPS instruction cannot be used immediately after a state relay (STL instruction), even in a drive
processing circuit.
37
Error Code
*1.
36
Special Device
Interrupt
Function
33
FNC290-FNC299
Extension File
Register
In a PLC, two or more SFC blocks can be put between step 0 and the END instruction.
When there are ladder blocks and SFC blocks, put RET instruction at the end of each SFC program.
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
749
Name
M8000
RUN monitor
M8002
Initial pulse
This relay turns ON and remains ON only instantaneously 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.
M8040
STL transfer
disable
When this relay is set to ON, transfer to 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.
M8047*1
*1.
Enable STL
monitoring
This relay automatically turns ON when any of state the relays S0 to S899 or S1000 to S4095
turn ON.
Use this relay to prevent simultaneous start up of another float or as process ON/OFF flag.
When this relay is driven, the device number of a state relay in the ON status having the
smallest device number among S0 to S899 and S1000 to S4095 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 up to D8047.
In the FX-PCS/WIN(-E), FX-20P(-E), and FX-10P(-E), when this relay is driven, the state
relays in the ON status are automatically read and displayed.
For details, refer to the manual of each peripheral equipment.
In the SFC monitor in GX Developer, the automatic scroll monitoring function is valid even if
this relay is not driven.
20
Y001
21
Y002
When S21 or
S22 is ON,
Y002 is output.
22
Y002
Interlock of outputs
In the state relay ON status transfer process, both
states turn ON only instantaneously (during one
operation cycle) at the same time.
Accordingly, between a pair of outputs which should not
be set to ON at the same time, provide an interlock
outside the PLC in conformance to the handy manual of
the PLC so that simultaneous ON can be prevented.
In addition, provide interlock in the program as shown in
the right figure.
750
20
Y002
Y001
Forward
rotation
21
Y001
Y002
Backward rotation
31
40
T1
41
T1
42
T1
K10
32
Not
allowed
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
K20
33
It is not permitted to write program an instruction not requiring a contact after LD or LDI instruction from a
bus line in a state relay.
Change such a circuit as shown below.
FNC290-FNC299
Extension File
Register
34
10
X005
SFCSTL
Programming
Y001
Y002
Y003
Change
10
Y001
X005
Y001
X005
Y003
or
M8000
Y002
RUN
monitor
Y002
Y003
Insert "Always ON"
contact.
36
Special Device
Move the
position.
Interrupt
Function
10
35
Change
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
751
Operations of and V
Use to express transfer to a state relay in an upper position (repeat), transfer to a state relay in a lower
position (jump), or transfer to a state relay in another separate flow.
Use V to express reset of a state relay.
1) Transfer source program
Repeat
Jump
0
70
80
Jump to S80
19
0
Return to S0
20
3) Reset circuit program
In the program example shown below, S65 is reset from S65 by way of X007.
Reset of another state relay (S70, for example) from S65 is executed in the same way, but in this case
S65 is not reset because this is not transfer.
In GX Developer, z is automatically displayed in a state relay to be reset.
State relay to be reset
65
X006
X007
65
752
Y003
TRAN
31
For output disability corresponding to emergency stop, follow Cautions on safety described in the PLC
manual.
1) Resetting many state relays at one time by specifying a range
Fifty-one state relays from S0 to S50 are reset at one time.
Reset
SFC block
FNC 40
ZRST
S0
32
FNC280-FNC289
High Speed
Processing 2
Ladder block
S50
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
SET
SFC block
M10
Y001
10
35
Interrupt
Function
M10
Y005
M30
T4
36
Output disable
37
M8034
Error Code
Even while the special auxiliary relay M8034 is ON, the sequence
program is executed continuously, but all output relays (Y) turn OFF.
MPS
X004
MRD
X005
Y001
Y002
Execution Times
10
X003
Version Up
Information
MPS, MRD or MPP instruction cannot be used directly from a bus line in a state relay inside the STL.
Program MPS, MRD or MPP instruction after LD or LDI instruction as shown below.
LD
X001
Special Device
FNC275-FNC279
Data
Transfer 3
Y003
MPP
STL bus line
C
Applicable
Instruction List
753
1
30
X004
Y000
X000 X001
30
Change
X004
Y000
X000 X001
TRAN
M0
X002 X003
X002 X003
M0
31
TRAN
3
31
3
754
Y030
2
X030
31
M100 M101
PLS
M100
PLS
M101
TRAN
31
In some cases, it is necessary to transfer the state relay ON status by the ON/OFF operation of one
pushbutton switch.
To achieve such a transfer, it is necessary to convert the transfer signal into pulses in programming.
The following two methods are available to convert the transfer condition into pulses:
Immediately after M0 turns ON and then S50 turns ON, the
transfer condition M1 (NC contact) is open. As a result, it
is not possible to transfer the ON status to S51 at the same
time when S50 turns ON.
When M0 turns ON again, the ON status is transferred to
S51.
Pulse signal
M0
1
50
M1 M0
TRAN
33
PLS
M2 M0
FNC290-FNC299
Extension File
Register
51
M1
TRAN
PLS
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
M2
TRAN
34
X001 (Transfer input)
M2800
M2800
M2800
0
SFC block
M2800
TRAN
50
M2800
TRAN
M2800
TRAN
37
Error Code
It is alright to program a device number used in LD, LDI, OR or ORI instructions after a corresponding
coil in the ladder block. However, if a same device number is programmed in LDP, LDF, ANDP,
ANDF, ORP or ORF instruction, the priority is given to such an instruction and the transfer condition is
not effective.
36
Special Device
51
3
*1.
35
*1
Interrupt
Function
Ladder block
SFCSTL
Programming
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
755
X013
M6
X013
X014
SET
M7
S70
X014
S3
Change
M6
SET
S70
M7
When the ON status is transferred to S70 at the falling edge of X013 and then X014 turns OFF after that, the
falling edge of X014 is not detected at this point because S3 is OFF. When S3 turns ON the next time, the
falling edge of X014 is detected.
Accordingly, when S3 turns ON the next time, the ON status is immediately transferred to S70.
756
31
This section shows operation patterns of single flows and operation patterns when selective branches and
parallel branches are combined in SFC programs.
20
21
22
42
40
30
40
21
31
41
31
41
22
22
32
42
32
42
23
23
33
34
SFCSTL
Programming
30
FNC290-FNC299
Extension File
Register
20
32
FNC280-FNC289
High Speed
Processing 2
1) Jump
Direct transfer to a state relay in a lower position or transfer to a state relay in a different flow is called
jump, and the transfer destination state relay is indicated by .
FNC275-FNC279
Data
Transfer 3
60
60
50
50
61
61
51
51
62
62
36
Special Device
35
Interrupt
Function
2) Repeat
Transfer to a state relay in an upper position is called repeat, and the transfer destination state relay is
indicated by in the same way as jump.
37
59
63
Error Code
63
60
59
S0
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
757
Separation of flow
When creating an SFC program having two or more initial state relays, separate the blocks for each initial
state relay.
The ON status can be transferred among SFC programs created by block separation (jump to a different flow).
A state relay in a program created in a different block can be used as a contact for the internal circuit or transfer
condition of another state relay.
1. Separation of flow
SFC block 1
SFC block 3
20
40
21
41
22
42
SFC block 3
20
40
21
41
41
22
42
SFC block 3
4
S40
TRAN
20
40
21
S41
41
Y000
2
2
22
42
3
3
3
758
S20
S21
TRAN
Y010
31
The single flow format is the fundamental style in process transfer control. Only single flow is sufficient in
sequence control for simple operations. When various input conditions and operator manipulations intervene,
however, complicated conditions can be easily handled by using selective branches and parallel branches.
A branch for selectively processing many processes depending on a condition is called selective branch. A
branch for processing many processes at the same time is called translational branch.
FNC275-FNC279
Data
Transfer 3
32
FNC280-FNC289
High Speed
Processing 2
1. Selective branch
Either one among many flows is selected and executed.
Branch state
relay
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
Recombination
state relay
35
Interrupt
Function
2. Parallel branch
All of many flows are executed at the same time.
Branch state
relay
36
Special Device
37
Error Code
Recombination
state relay
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
759
TRAN
11
21
X001
TRAN
21
31
X002
TRAN
41
Selective recombination
After creating a transfer condition, recombine.
29
39
X010
10
TRAN
49
X011
20
TRAN
X012
30
50
Parallel branch
After creating a transfer condition, make a branch.
20
X000
TRAN
21
31
41
Parallel recombination
After recombining, create a transfer condition.
39
29
10
50
760
X010
TRAN
49
TRAN
31
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
(Note)
35
2
......
Interrupt
Function
16
36
Special Device
It is not permitted to execute transfer or reset from a recombination line or state relay before recombination to
a branch state relay.
Make sure to provide a dummy state, then execute transfer or reset from a branch line to a separate state
relay.
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
761
20
30
50
60
40
20
30
50
60
40
20
30
20
30
40
50
40
50
20
30
20
30
Deform it
as follows.
20
762
30
40
20
30
40
state
100 Dummy
relay
state
101 Dummy
relay
Dummy
102 state
relay
state
103 Dummy
relay
50
50
40
40
60
60
50
50
31
FNC275-FNC279
Data
Transfer 3
2. When there are selective branches continuously, reduce the number of branches.
20
X000
X001
TRAN
X004
21
TRAN
X007
TRAN
12
13
TRAN
33
15
28
26
X006
TRAN
X013
X017
TRAN
16
X016
TRAN
34
TRAN
SFCSTL
Programming
TRAN
X014
27
11
24
X003
TRAN
14
FNC290-FNC299
Extension File
Register
22
X011
32
TRAN
25
10
23
X010
TRAN
FNC280-FNC289
High Speed
Processing 2
29
35
Interrupt
Function
Transform
as follows.
20
X000 X001
TRAN
21
TRAN
X006 X007
X010 X014
36
TRAN
11
X013 X017
37
28
26
TRAN
10
27
8
24
TRAN
TRAN
TRAN
12
X016 X017
TRAN
24
Error Code
22
X010 X011
25
X003 X007
23
X000 X004
Special Device
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
763
<*>
<*>
<*>
<*>
4. In the flow shown below, it is not determined whether a selective or parallel branch is
provided. Change it as shown below.
764
X000 X001
X000 X001
TRAN
TRAN
X000
X000 X001
TRAN
TRAN
31
Flow B is alright. In flow A, however, note that an operation is paused at a point where parallel branches are
recombined.
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
33
FNC290-FNC299
Extension File
Register
34
Change a flow on the left to a flow on the right. This change enables inverse conversion from a program on
the instruction word basis into an SFC program. (The flow on the left cannot be converted into an SFC
program.)
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
Change
37
Error Code
Cross is not
allowed.
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
765
M8002
SFC block
Y000
S3
Y000
T0
T0
Y001
1
1.5
second seconds
20
K10
TRAN
Y001
T1
1
3
766
SET
Initial pulse
T1
TRAN
K15
31
M8047
Enable
STL
monitoring
M8040
STL
transfer
disable
RUN monitor
X002 X000
Stepping Start
M8002
Initial pulse
SET
S3
SFC
block
Start button
X000
TRAN
0
20
Initial state
relay
Y001
Center lamp
T1
21
TRAN
Center
fountain
Y002
T2
T2
K20
Loop line
lamp
Y003
T3
T3
3
27
TRAN
20
RET
END
Loop line
fountain
K2
0
T7 X001
5
TRAN
3
Cyclic/stepping
36
Special Device
T7
Continuous
K20
TRAN
Y007
T7 X001
35
TRAN
Interrupt
Function
22
34
K20
SFCSTL
Programming
T1
33
Wait
indication
Y000
FNC290-FNC299
Extension File
Register
Ladder
block
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
767
X000
Start
Small backward
rotation
Small forward
rotation
X011
X010
Large backward
rotation
X013
X012
Origin
Large forward
rotation
Y023
Backward
rotation
Y021
Forward
rotation
M8000
M8047
RUN monitor
M8002
X000
Initial pulse
Start
M8040
Enable STL
monitoring
M8040
Y020
M8002
M8046
Initial pulse
STL
state
ON
M8034
SFC
block
521
Start
Y023
X011
Small forward
rotation
S6
522
Y020
X000
STL
transfer
disable
Y021
X010
Origin
indication
TRAN
Y021
Forward
rotation
TRAN
Y023
Backward
rotation
TRAN
Small backward
rotation
523
Y023
X013
Y021
Forward
rotation
TRAN
Large forward
rotation
524
4
6
RET
Y021
X012
Y023
Backward
rotation
TRAN
Large backward
rotation
END
768
31
FNC275-FNC279
Data
Transfer 3
Ladder block
M1
M8002
M3
Start
M3
4 seconds
M4
X001
4 seconds
3 seconds
M2
M1
X000
Start
20
TRAN
Motor M1 is
SET Y000 started.
T0
T0 X001
T1 X001
T2 X001
X001
Stop
T4
T6
X001
Stop
TRAN
26
11
X001
Y000
35
TRAN
36
25
TRAN
37
TRAN
TRAN
TRAN
Execution Times
27
0
RET
10
Motor
RST Y001 M2 is
stopped.
T6
K20
26
27
34
Version Up
Information
T5
Stop
TRAN
Motor
RST Y002 M3 is
stopped.
T5 K30
25
X001
Motor
RST Y003 M4 is
stopped.
T4 K40
24
TRAN
Motor
SET Y003 M4 is
started.
23
4
TRAN
Motor
SET Y002 M3 is
started.
T2 K40
22
TRAN
Motor
SET Y001 M2 is
started.
T1 K30
21
K20
Error Code
2 seconds
33
Special Device
Stop
M3
SFC block
Interrupt
Function
M4
Initial pulse
SFCSTL
Programming
Stop
32
S0
FNC290-FNC299
Extension File
Register
3 seconds
SET
FNC280-FNC289
High Speed
Processing 2
2 seconds
In the case of stop in the middle of operation, the motors are stopped also in turn in the reverse order.
X000
Motor M1
RST Y000 is
stopped.
TRAN
END
769
Applicable
Instruction List
This SFC program shows an example in which a part of the flow is skipped according to a condition, and the
execution is transferred to a state in a lower position.
The execution can be transferred to a state in an upper position.
The partial skip flow shown on the previous page can be expressed in a flow of selective branches and
recombination as shown below.
Make sure that a flow proceeds from top to bottom, and that a flow does not cross except branch lines and
recombination lines.
Ladder block
M8002
SET
S0
Initial pulse
SFC block
0
X000
TRAN
Start
20
SET Y000
T0
T0 X001
1
21
T1 X001
22
T2 X001
23
24
T4
25
26
TRAN
X001
Stop
TRAN
30*
31*
32*
K40
10
S30
TRAN
K30
12
S31
TRAN
RST Y001
T6
27
K20
Y000
END
14
TRAN
RST Y000
770
TRAN
TRAN
T6
RET
Stop
RST Y002
T5
X001
K40
TRAN
T5
11
TRAN
RST Y003
T4
TRAN
TRAN
Stop
Stop
K30
SET Y003
X001
X001
SET Y002
T2
13
TRAN
SET Y001
T1
K20
TRAN
S32
TRAN
31
FNC275-FNC279
Data
Transfer 3
X000
TRAN
21
31
X002
8
32
TRAN
TRAN
41
5
22
X020
42
X012
TRAN
X022
33
TRAN
50
10
34
X005
LS5
36
X003
LS3 Upper
limit switch
Origin
indication
Y007
X004
LS4
CY1
37
Error Code
Moving up:
Y002
Moving down:
Y000
Special Device
Moving
rightward:
Y003
Moving
leftward:
Y004
X001
LS1 Left limit switch
X002
LS2 Lower limit switch
A
Version Up
Information
Electromagnet
Y001
Proximity
switch
PS0
X000
35
Interrupt
Function
The figure below shows a mechanism which selects and carries large and small balls using conveyors.
The upper left position is regarded as the origin, and the mechanism performs in the order moving down
suction moving up moving rightward moving down release moving up moving leftward.
When the arm moves down and the electromagnet pushes a large ball, the lower limit switch LS2 turns OFF.
When the electromagnet pushes a small ball, LS2 turns ON.
X026
Start
32
SFCSTL
Programming
TRAN
FNC290-FNC299
Extension File
Register
X010
FNC280-FNC289
High Speed
Processing 2
20
Small
Large
B
Execution Times
C
Applicable
Instruction List
771
In an SFC program for selecting large and small products or judging products as accepted or rejected,
selective branches and recombination are adopted as shown in the figure below.
Ladder block
M8002
SET
S0
Initial pulse
X001 X003 Y001
Y007
Origin
indication
SFC block
When a ball is small (when X002
0
X026
Start
Y007
TRAN
Origin
21
Y000
T0
T0
X002
Moving
down
K20
T0
TRAN
Moving
X004
Y004
Y003 Moving
X002
Lower limit switch
31
TRAN
X001
Y003
X001
0
RET
END
X005
TRAN
Y003
Moving
rightward
TRAN
K10
Y002 Moving
up
X003
33
X003
Moving
up
TRAN
32
7
TRAN
Y002
X005
K10
Y000 Moving
down
30
772
12
TRAN
27
rightward
X004
T1
26
11
TRAN
10
Y002 up
X003
25
K10
TRAN
23
TRAN
Lower limit
switch: OFF (large ball)
Lower limit
switch: ON (small ball)
22
X002
TRAN
Y004
TRAN
Moving
leftward
31
FNC275-FNC279
Data
Transfer 3
When the operation is finished in each flow and X007 turns ON, the
recombination state relay S30 turns ON. S23, S26 and S29 turn
OFF.
X000
21
2
24
4
22
3
X007
27
6
25
5
23
32
TRAN
28
7
26
29
TRAN
33
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
In the example shown on the left, when X000 turns ON while S20 is
ON, S21, S24 and S27 turn ON at the same time and the operation is
started in each flow.
20
34
30
A pushbutton type crosswalk shown in the figure below can be expressed in flows having parallel branches
and recombination.
Y003: Green Y002: Yellow Y001: Red
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
37
Error Code
When the PLC mode is changed from STOP to RUN, the initial state relay S0 turns ON. Normally, the
green lamp is ON for the road and the red lamp is ON for the sidewalk.
When the crossing button X000 or X001 is pressed, the state relay S21 specifies road: green and the
state relay S30 specifies sidewalk: red. The signal lamp status is not changed.
When the timer T2 (5 seconds) reaches timeout after that, the green lamp turns ON for the sidewalk.
15 seconds later, the green lamp starts to blink for the sidewalk. (S32 turns OFF the green lamp, and S33
turns ON the green lamp.)
Even if the crossing button X000 or X001 is pressed in the middle of operation, the pressing is ignored.
773
C
Applicable
Instruction List
While the green lamp is blinking, S32 and S33 turn ON and OFF repeatedly. When the counter C0 (set
value: 5) turns ON, S34 turns ON. 5 seconds after the red lamp turns ON for the sidewalk, the signal
lamps return to the initial state.
B
Execution Times
30 seconds later, the yellow lamp turns ON for the road. 10 seconds later after that, the red lamp turns ON
for the road.
A
Version Up
Information
The SFC program for a pushbutton type crosswalk is as shown below. In this example, a partial flow (jump to
a state relay located in an upper position) is repeated for blinking the green lamp on the crosswalk.
Ladder block
M8002
SET
S0
Initial pulse
SFC block
0
TRAN
X001
Crossing button
21
Y003
T0
T0
30
K300
T1
T1
23
Y001
T2
4
Road:
Red
K50
TRAN
31
K100
TRAN
TRAN
Road:
Y002
Yellow
22
Road:
Green
TRAN
32
T4
T4
Y006
C0
T5
C0
T5
34
0
RET
774
END
TRAN
K5
7
32
TRAN
C0
T6
T6
K5
K5
TRAN
33
K150
K50
T5
TRAN
31
Step Ladder
FNC275-FNC279
Data
Transfer 3
34.2
34.2.1 Outline
34
35
Interrupt
Function
SET
S32
STL
S32
Y030
Y032
*1.
SET
S33
X001
SET
Y31
SET
S32
STL
S32
*1
Y31 programmed in
SET instruction remains
ON even if S31 is reset.
Y030
Process of
S32
Activated
Y032
X002
SET
S33
Applicable
Instruction List
X002
Process of
S31
When X001 turns ON,
S32 turns ON and S31
is automatically reset.
Y030
Execution Times
Y31
*1
S31
Version Up
Information
X001
SET
STL
37
Error Code
When a condition (transfer condition) provided between state relays is satisfied, the next state relay turns
ON, and the state relay which has been ON so far turns OFF (transfer operation).
In the state relay ON status transfer process, the both state relays are ON only instantaneously (during one
operation cycle).
In the next operation cycle after the ON status was transferred, the former state is reset to OFF.
When the transfer state relay S is used in a contact instruction, however, the contact image is executed in
the OFF status immediately after the transfer condition is satisfied.
36
Special Device
When a state relay turns ON, a connected circuit (internal circuit) is activated by way of an STL contact.
When a state relay turns OFF, a connected internal circuit is deactivated by way of an STL contact.
After one operation cycle, non-driving of an instruction (jump status) is not available.
Y030
SFCSTL
Programming
In a step ladder program, a state relay 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.
STL
33
FNC290-FNC299
Extension File
Register
This section explains the expressions and cautions of step ladder programs in comparison with SFC
programs, and the input order in the list format.
32
FNC280-FNC289
High Speed
Processing 2
In programs using step ladder instructions, a state relay State S is assigned to each process based on
machine operations, and sequences of input condition and output control are programmed as circuits
connected to contacts (STL contacts) of state relays in the same way as SFC programs.
The concept of program creation and the types and operations of state relays are the same as for SFC
programs. However, because the contents can be expressed in the ladder format, step ladder programs can
be handled as familiar relay ladder charts even though the actual contents are the same as those of SFC
programs.
In step ladder programs, the list format is also available.
SFC programs and step ladder programs can be converted each other if they are programmed in the same
rules respectively.
775
<Step ladder>
M8002
X000
Start
Y023
X001
Y021
X002
T0
Y023
X003
Y021
X002
<SFC program>
SET
S0
STL
S0
Ladder block
M8002
SET
Process of S0
SET
S20
STL
S20
Y021
Moving
Process of S20
forward
SET
S21
STL
S21
SFC block
State number and transfer condition
number are indicated.
S22
STL
S22
T0
K50
SET
S23
STL
S23
Y021
Moving
Process of S23
forward
SET
S24
STL
S24
20
Process of S22
X001
Y021
21
X002
2
22
TRAN
Moving
Y021 forward
TRAN
Y023
T0
Y023
23
Moving
backward
TRAN
T0
K50
Internal
circuit
TRAN
Y021 Moving
forward
X003
Y021
24
RET
776
Start
Y023
X000
Can be converted
each other
SET
END
Moving
Y023 backward Process of S21
S0
S0
TRAN
Y023 Moving
backward
X002
TRAN
S0
RET
END
31
STL
20
<Step ladder>
Y010
X010
STL
Y011
X000 X001
X010
TRAN
X011
X000 X001
SET
34
Y011
SFCSTL
Programming
S20
Y010
X011
21
SET
S21
35
Interrupt
Function
<List program>
*1.
STL
OUT
LD
OR
OUT
LD
ANI
SET
S20
Y010
X010
X011
Y011
X000
X001
S21 *1
36
Special Device
0
1
2
3
4
5
6
7
33
FNC290-FNC299
Extension File
Register
<SFC program>
32
FNC280-FNC289
High Speed
Processing 2
The figure on the left shows one state relay extracted as an example from an SFC program.
Each state relay has three functions, driving a load, specifying a transfer destination and specifying a transfer
condition.
The step ladder shown on the right expresses this SFC program as a relay sequence.
In this program, a load is driven, and then the ON status is transferred.
In a state relay without any load, the drive processing is not required.
For the program creation procedure, refer to the description on SFC programs.
For the program creation procedure, refer to Subsection 34.1.3.
For the handling and role of initial state relays, refer to Subsection 34.1.4.
For latched (battery backed) type state relays, refer to Subsection 34.1.5.
For RET instruction, refer to Subsection 34.1.6.
FNC275-FNC279
Data
Transfer 3
37
SET and RST instructions for a state relay are two-step instructions.
Program a step ladder program starting from the initial state relay in the order of state relay ON status
transfer.
Make sure to put the RET instruction at the end of a step ladder program.
Error Code
When every state relay used in an SFC program is defined, programming is complete.
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
777
<SFC program>
40
X001
<Step ladder>
Y001
STL
X001
X002
X003
TRAN
SET
X003
41
2
52
STL
LD
OUT
LD
SET
LD
OUT
S40
Y001
X002
TRAN
<List program>
S41
S52
S40
X001
Y001
X002
S41
X003
S52
Jump/repeated part
<SFC program>
52
<Step ladder>
X004
Y002
STL
X004
X005
TRAN
X005
53
<List program>
STL
LD
OUT
LD
SET
S52
Y002
SET
S53
S52
X004
Y002
X005
S53
List of sequence instructions available between STL instruction and RET instruction
Instruction
LD/LDI/LDP/LDF,
AND/ANI/ANDP/ANDF,
OR/ORI/ORP/ORF,
INV,MEP/MEF,
OUT,SET/RST,
PLS/PLF
ANB/ORB/MPS/MRD/
MPP
MC/MCR
Available
Available*1
Not available
Branch/
recombination state
relay
Drive processing
Available
*1
Not available
Transfer processing
Available
State relay
Available
Not available
Not available
778
MPS instruction cannot be used immediately after an STL instruction, even in a drive processing
circuit.
31
For efficiently creating step ladder programs, it is necessary to use some special auxiliary relays. The table
below shows major ones.
The special auxiliary relays shown below are the same as those available in SFC programs.
Device
number
Name
32
M8002
Initial pulse
This relay turns ON and remains ON only instantaneously 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.
M8040
STL transfer
disable
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.
Block
M8002
Initial pulse
SET
S0
SET
S1
STL
S0
Relay ladder
Y000
X000
SET
Y001
X001
S1
Y002
SET
S30
STL
S30
Step ladder is
started by STL
instruction.
Step ladder
S1
END
Relay ladder
779
C
Applicable
Instruction List
RET
Step ladder is
finished by RET
instruction.
B
Execution Times
Y003
X003
A
Version Up
Information
Step ladder is
finished by RET
instruction.
RET
X002
Step ladder
It can be
omitted.
S0
STL
37
S20
S20
36
Error Code
STL
Step ladder is
started by STL
instruction.
35
Special Device
34
Interrupt
Function
*1.
Enable STL
monitoring
When this relay is driven, the device number of a state relay in the ON status having the
smallest device number among S0 to S899 and S1000 to S4095 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 up to D8047.
In the FX-PCS/WIN(-E), FX-20P(-E) and FX-10P(-E), when this relay is driven, the state
relays in the ON status are automatically read and displayed.
For details, refer to the manual of each peripheral equipment.
In the SFC monitor in GX Developer, the automatic scroll monitoring function is valid even if
this relay is not driven.
SFCSTL
Programming
M8047*1
This relay automatically turns ON when any of the state relays S0 to S899 or S1000 to S4095
turn ON.
Use this relay to prevent simultaneous start up of another float or as a process ON/OFF flag.
33
FNC290-FNC299
Extension File
Register
RUN monitor
FNC280-FNC289
High Speed
Processing 2
M8000
FNC275-FNC279
Data
Transfer 3
S20
Y001
X005
Y002
Y003
Change
Change
STL
S20
STL
Y001
Y001
or
X005
Y003
X005
S20
Y002
M8000
Y002
Y003
Insert "Always ON"
contact.
RUN
monitor
Move the
position.
Transfer
condition
STL
S41
SET
S42
S50
Replacing and V
Replace the symbol used in SFC programs to express repeat, jump or transfer to a state relay in another
separate flow with the OUT instruction.
Replace the symbol V (used to express reset of a state relay) with the RST instruction.
<SFC program>
40
X001
<Step ladder>
Y001
STL
X001
X002
TRAN
X003
X003
41
2
41
780
TRAN
X002
X004
TRAN
52
X004
S40
Y001
SET
S41
S52
STL
S41
RST
S41
Replacement of
in the part 52
Replacement of
in the part 41
31
<SFC program>
20
33
TRAN
21
X001
2
31
STL
34
41
S20
SET
S21
SET
S31
SET
S41
Drive
processing
Transfer
processing
STL
OUT
LD
SET
LD
SET
LD
SET
S20
Y000
X000
S21
X001
S31
X002
S41
35
Interrupt
Function
X002
TRAN
<List program>
Y000
X001
X002
SFCSTL
Programming
<Step ladder>
X000
TRAN
FNC290-FNC299
Extension File
Register
Y000
X000
32
FNC280-FNC289
High Speed
Processing 2
Do not use MPS, MRD, MPP, ANB and ORB instructions in a transfer processing program with branches and
recombination.
Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions.
In the same way as programs for general state relays, program the drive processing first, and then program
the transfer processing.
Continuously program all transfer processing.
FNC275-FNC279
Data
Transfer 3
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
781
<SFC program>
29
X010
39
Y010
TRAN
49
Y011
X011
TRAN
Y012
X012
TRAN
50
<Step ladder>
STL
<List program>
S29
Y010
STL
S39
Y011
STL
Drive
processing
S49
Y012
X010
X011
X012
STL
S29
SET
S50
STL
S39
SET
S50
STL
S49
SET
S50
STL
OUT
STL
OUT
STL
OUT
STL
LD
SET
STL
LD
SET
STL
LD
SET
S29
Y010
S39
Y011
S49
Y012
S29
X010
S50
S39
X011
S50
S49
X012
S50
Transfer
processing
782
31
Do not use MPS, MRD, MPP, ANB and ORB instructions in a program with branches and recombination.
Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions.
In the same way as programs for general state relays, program the drive processing first, and then program
the transfer processing.
Continuously program all transfer processing.
<Step ladder>
20
Y000
X000
STL
Drive
processing
Y001
TRAN
X000
31
41
SET
S21
SET
S31
SET
S41
Transfer
processing
<SFC program>
29
39
Y010
49
35
Y012
TRAN
50
36
Special Device
<Step ladder>
<List program>
STL
S29
Y010
S39
Y011
STL
Drive
processing
S49
Y012
S29
STL
S39
STL
S49
SET
S50
S29
Y010
S39
Y011
S49
Y012
S29
S39
S49
X010
X011
X012
S50
37
A
Version Up
Information
STL
STL
OUT
STL
OUT
STL
OUT
STL
STL
STL
LD
AND
AND
SET
Error Code
STL
34
Interrupt
Function
Y011
33
SFCSTL
Programming
Do not use MPS, MRD, MPP, ANB and ORB instructions in a program with branches and recombination.
Even in a load driving circuit, MPS instructions cannot be used immediately after STL instructions.
Pay attention to the programming order so that a branch line does not cross a recombination line.
32
FNC290-FNC299
Extension File
Register
21
S20
<List program>
STL S20
OUT Y000
LD X000
SET S21
SET S31
SET S41
FNC280-FNC289
High Speed
Processing 2
<SFC program>
FNC275-FNC279
Data
Transfer 3
Transfer
processing
B
Execution Times
C
Applicable
Instruction List
783
<SFC program>
<Step ladder>
20
1
X000
30
TRAN
X001
X000
TRAN
X001
X003
TRAN
X004
TRAN
X004
60
50
X003
<List program>
STL
S20
SET
S100
STL
S30
SET
S100
STL
S100
SET
S50
SET
S60
STL
LD
SET
STL
LD
SET
STL
LD
SET
LD
SET
S20
X000
S100
S30
X001
S100
S100
X003
S50
X004
S60
<SFC program>
<Step ladder>
20
X000
30
X000
TRAN
S101
S101
TRAN
<List program>
STL
S20
STL
S30
SET
S101
STL
S101
SET
S50
SET
S60
STL
STL
LD
SET
STL
LD
SET
SET
S20
S30
X000
S101
S101
S101
S50
S60
60
50
<SFC program>
<Step ladder>
20
1
S102
30
TRAN
X001
X102
TRAN
X001
X000
TRAN
S102
40
784
50
<List program>
STL
S20
SET
S102
STL
S30
SET
S102
STL
S102
SET
S40
SET
S50
STL
LD
SET
STL
LD
SET
STL
LD
SET
SET
S20
X000
S102
S30
X001
S102
S102
S102
S40
S50
31
<SFC program>
<Step ladder>
20
X000
X000
TRAN
X001
TRAN
X002
X001
TRAN
X002
S20
STL
S30
SET
S103
STL
S103
SET
S40
SET
S50
STL
STL
LD
SET
STL
LD
SET
LD
SET
S20
S30
X000
S103
S103
X001
S40
X002
S50
32
33
50
FNC290-FNC299
Extension File
Register
40
STL
FNC280-FNC289
High Speed
Processing 2
30
<List program>
34
SFCSTL
Programming
35
Interrupt
Function
The state relay S3 outputs Y000. 1 second later, the ON status transfers to the state relay S20.
The state relay S20 outputs Y001. 1.5 seconds later, the ON status returns to the state relay S3.
<Step ladder>
Step
number
M8002
SET
S3
STL
S3
Y000
Y001
<List program>
T0
8
T0
11
SET
S20
STL
S20
Y001
12
T1
T1
K15
LD
SET
STL
OUT
OUT
LD
SET
STL
OUT
OUT
LD
OUT
RET
END
M8002
S3
S3
Y000
T0 K10
T0
S20
S20
Y001
T1 K15
T1
S3
RET
20
END
37
S3
19
36
Version Up
Information
16
K10
0
1
3
4
5
8
9
11
12
13
16
17
19
20
Error Code
1
1.5
second seconds
Step
number
Special Device
Initial pulse
Y000
FNC275-FNC279
Data
Transfer 3
B
Execution Times
C
Applicable
Instruction List
785
<Step ladder>
0
3
7
M8000
M8047
RUN monitor
X002 X000
M8040
Stepping Start
M8002
Initial pulse
10
SET
S3
STL
S3
12
Wait
indication
Y000
11
X000
Start button
15
SET
S20
STL
S20
Y001
16
Enable
STL
monitoring
STL
transfer
disable
Initial state
relay
Center lamp
T1
20
K20
T1
23
SET
S21
STL
S21
Center
fountain
Y002
24
T2
28
K20
T2
31
SET
S22
STL
S22
Loop line
lamp
Y003
32
T3
36
K20
T3
39
SET
S27
STL
S27
Loop line
fountain
Y007
40
T7
44
48
786
T7
X001
T7
X001
K20
S20
Continuous
S3
Cyclic/stepping
52
RET
53
END
<List program>
0
1
3
4
5
7
8
10
11
12
13
15
16
17
20
21
23
24
25
28
29
31
32
33
36
37
39
40
41
44
45
46
48
49
50
52
53
LD
OUT
LD
ANI
OUT
LD
SET
STL
OUT
LD
SET
STL
OUT
OUT
LD
SET
STL
OUT
OUT
LD
SET
STL
OUT
OUT
LD
SET
STL
OUT
OUT
LD
AND
OUT
LD
ANI
OUT
RET
END
M8000
M8047
X002
X000
M8040
M8002
S3
S3
Y000
X000
S20
S20
Y001
T1 K20
T1
S21
S21
Y002
T2 K20
T2
S22
S22
Y003
T3 K20
T3
S27
S27
Y007
T7 K20
T7
X001
S20
T7
X001
S3
31
X026
Start
X005
LS5
33
X003
LS3 Upper
limit
Origin
indication
Y007
X004
LS4
CY1
34
SFCSTL
Programming
Moving up:
Y002
Moving down:
Y000
FNC290-FNC299
Extension File
Register
Moving
rightward:
Y003
Moving
leftward:
Y004
X001
LS1 Left limit
X002
LS2 Lower limit
35
Interrupt
Function
Electromagnet
Y001
Proximity
switch
PS0
X000
32
FNC280-FNC289
High Speed
Processing 2
The figure below shows a mechanism which selects and carries large and small balls using conveyors.
The upper left position is regarded as the origin, and the mechanism performs in the order moving down
suction moving up moving rightward moving down release moving up moving leftward.
When the arm moves down and the electromagnet pushes a large ball, the lower limit switch LS2 turns OFF.
When the electromagnet pushes a small ball, LS2 turns ON.
FNC275-FNC279
Data
Transfer 3
Small
Large
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
787
The figure below shows a step ladder program for selecting the ball size and judging balls as accepted or
rejected.
<Step ladder>
0
3
7
8
M8002
Initial pulse
SET
Start Origin
12
S0
Origin
indication
Y007
S0
SET
S21
STL
S21
Moving
down
Y000
13
T0
17
21
T0
X002
T0
X002
25
K20
SET
S25
STL
S22
Y001
T1
72
STL
S31
73
RST
Y001
77
K10
T2
SET
S32
STL
S32
Y002
X003
85
86
89
K10
X001 Y003
SET
S33
STL
S33
Y004
X001
S23
92
RET
33
STL
S25
93
END
34
SET
Y001
T1
38
T1
41
K10
SET
S26
STL
S23
Y002
42
43
T3
46
SET
S24
STL
S26
Y002
47
48
X003
51
52
788
S24
Y003
STL
X004
63
64
STL
X005 Y004
59
60
S27
X004 Y004
55
56
SET
X005
Moving
up
Moving
up
Moving
rightward
S27
Y003
STL
S24
SET
S30
STL
S27
SET
S30
Moving
rightward
Moving
up
Moving
leftward
S0
SET
Suction
Release
T2
82
T1
30
S31
80
Suction
Moving
down
SET
81
SET
26
X002
S22
SET
S30
Y000
68
69
STL
STL
67
34
35
38
39
41
42
43
44
46
47
48
49
51
52
53
54
55
56
57
58
59
60
61
63
64
SET
OUT
LD
SET
STL
OUT
LD
SET
STL
OUT
LD
SET
STL
LDI
ANI
OUT
STL
LDI
ANI
OUT
STL
LD
SET
STL
LD
Y001
T1 K10
T1
S26
S233
Y002
T3
S24
S26
Y002
X003
S27
S24
X004
Y004
Y003
S27
X005
Y004
Y003
S24
X004
S30
S27
X005
65
67
68
69
70
72
73
74
77
78
80
81
82
83
85
86
87
88
89
90
92
93
SET
STL
OUT
LD
SET
STL
RST
OUT
LD
SET
STL
OUT
LD
SET
STL
LDI
ANI
OUT
LD
OUT
RET
END
S30
S30
Y000
X002
S31
S31
Y001
T2 K10
T2
S32
S32
Y002
X003
S33
S33
X001
Y003
Y004
X001
S0
31
When the parts A, B and C are processed in parallel and then assembled, flows having parallel branches and
recombination are used.
32
FNC280-FNC289
High Speed
Processing 2
A pushbutton type crosswalk shown in the figure below can be expressed in flows having parallel branches
and recombination.
Y003: Green Y002: Yellow Y001: Red
FNC275-FNC279
Data
Transfer 3
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
35
Interrupt
Function
The SFC program for a pushbutton type crosswalk is as shown below. In this example, a partial flow (jump to
a state relay located in an upper position) is repeated for blinking the green lamp on the crosswalk.
When the crossing button X000 or X001 is pressed, the state relay S21 specifies road: green and the
state relay S30 specifies sidewalk: red. The signal lamp status is not changed.
Thirty seconds later, the yellow lamp turns ON for the road. Ten seconds later after that, the red lamp
turns ON for the road.
When the timer T2 (5 seconds) reaches timeout after that, the green lamp turns ON for the sidewalk.
While the green lamp is blinking, S32 and S33 turn ON and OFF repeatedly. When the counter C0 (set
value: 5) turns ON, S34 turns ON. Five seconds after the red lamp turns ON for the sidewalk, the signal
lamps return to the initial state.
Even if the crossing button X000 or X001 is pressed in the middle of operation, the pressing is ignored.
37
Error Code
Fifteen seconds later, the green lamp starts to blink for the sidewalk. (S32 turns OFF the green lamp, and
S33 turns ON the green lamp.)
36
Special Device
When the PLC mode is changed from STOP to RUN, the initial state relay S0 turns ON. Normally, the
green lamp is ON for the road and the red lamp is ON for the sidewalk.
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
789
<Step ladder>
0
M8002
Initial pulse
SET
STL
S0
S0
Y005
6
X000
X001
Crossing button
12
65
Road:
Green
Sidewalk:
Red
Y003
61
SET
S21
SET
S30
STL
S21
13
20
25
30
T1
33
34
38
T3
41
42
53
54
S34
Sidewalk:
Red
Y005
70
C0
77
78
T6
STL
S23
STL
S34
S0
RET
STL
S30
82
END
Sidewalk:
Red
SET
S31
STL
S22
<List program>
0 LD M8002
1 SET S0
T1
3 STL S0
K100
4 OUT Y003
SET S23
5 OUT Y005
6 LD X000
STL
S31
7 OR X001
Sidewalk:
8 SET S21
Y006
Green
10 SET S30
T3
12 STL S21
K150
13 OUT Y003
14 OUT T0 K300
SET S32
17 LD T0
18 SET S22
STL
S23
20 STL S30
Road:
Y001
21 OUT Y005
Red
22 LD T2
T2
23 SET S31
K50
25 STL S22
Road:
Yellow
26
27
30
31
33
34
35
38
39
41
42
43
46
47
50
51
53
54
55
OUT
OUT
LD
SET
STL
OUT
OUT
LD
SET
STL
OUT
OUT
STL
OUT
LD
SET
STL
OUT
OUT
Y002
T1 K100
T1
S23
S31
Y006
T3 K150
T3
S32
S23
Y001
T2 K50
S32
T4 K5
T4
S33
S33
Y006
C0 K5
S32
T4
T4
K5
SET
S33
STL
S33
Y006
C0
K5
T5
K5
790
STL
69
81
47
50
S32
S22
STL
46
S34
SET
Y002
26
SET
76
Road:
Green
Y005
T2
T5
T6
K300
21
22
C0
RST
T0
17
T5
K50
Y003
T0
C0
58
61
62
63
65
66
67
69
70
71
73
76
77
78
79
81
82
OUT
LD
AND
SET
LDI
AND
OUT
STL
OUT
RST
OUT
STL
STL
LD
OUT
RET
END
T5 K5
C0
T5
S34
C0
T5
S32
S34
Y005
C0
T6 K50
S23
S34
T6
S0
35.1 Outline
31
FNC275-FNC279
Data
Transfer 3
32
This chapter explains the built-in interrupt function and pulse catch function in FX PLCs.
Outline
35
Interrupt
Function
By the input signal from an input (X000 to X005), the main sequence program is paused, and an interrupt
routine program is executed with priority after the delay time (set in units of 1 ms).
The input interrupt execution timing can be specified on the rising edge or falling edge of the signal by the
pointer number.
For details, refer to Section 35.4.
34
SFCSTL
Programming
By the input signal from an input (X000 to X005), the main sequence program is paused, and an interrupt
routine program is executed with priority.
The input interrupt execution timing can be specified on the rising edge or falling edge of the signal by the
pointer number.
For details, refer to Section 35.3.
33
FNC290-FNC299
Extension File
Register
This section explains the function to immediately execute an interrupt program (interrupt routine) without
affecting the operation cycle of the sequence program (main) while using a 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.
FNC280-FNC289
High Speed
Processing 2
35.1
4. High speed counter interrupt function (interrupt function given at counting up)
When the current value of a high speed counter reaches a specified value, the main sequence program is
paused and an interrupt routine program is executed with priority.
For details, refer to Section 35.6.
A
Version Up
Information
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.
37
Error Code
36
Special Device
The main sequence program is paused in a constant cycle of 10 to 99 ms, and an interrupt routine program is
executed with priority.
For details, refer to Section 35.5.
B
Execution Times
C
Applicable
Instruction List
791
35.2
Common Items
1. Limiting the program interrupt range [interrupt function and pulse catch function]
1) Programming method
Program the FNC 05 (DI) instruction to set the interrupt disabled zone.
Even if an interrupt is generated between the DI instruction and EI instruction (interrupt disabled zone),
the interrupt is executed after the EI instruction.
2) Program example
FNC 04
EI
Interrupts are
enabled
FNC 05
DI
Interrupts are
disabled
FNC 06
FEND
3) Cautions
a) The interrupt inputs with special auxiliary relay for interrupt disable (M8050 to M8059) turned ON are
excluded.
These special auxiliary relays are not valid for the 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.
792
31
1) Programming method
The special auxiliary relays M8050 to M8059 for disabling interrupt are provided.
While an interrupt disable flag (M8050 to M8059) is ON, a corresponding interrupt program is not
executed even if the interrupt disable flag is set to OFF after a corresponding interrupt is generated.
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.
Timer interrupt
When M8059*1 turns ON, all of the high speed counter interrupts I010 to I060 are disabled.
2) Program example
In the program example shown below, when M8053 is set to ON by M20, the interrupt input I301 triggered
by X003 is disabled.
34
SFCSTL
Programming
FNC 04
EI
M20
M8053
Command to disable
an interrupt triggered
by X003
Interrupts are
enabled
35
Interrupt
Function
FNC 06
FEND
Interrupt
pointer
I301
33
FNC290-FNC299
Extension File
Register
32
FNC280-FNC289
High Speed
Processing 2
*1.
Input interrupt
FNC275-FNC279
Data
Transfer 3
36
Special Device
FNC 03
IRET
Interrupt
routine
END
37
Error Code
793
C
Applicable
Instruction List
2) While M8028 is ON
When an interrupt is generated while a FROM/TO instruction is being executed, execution of the FROM/
TO instruction is paused and the interrupt is immediately executed.
FROM/TO instructions cannot be used in an interrupt routine program when M8028 is ON.
B
Execution Times
A
Version Up
Information
When controlling an input relay or output relay in an interrupt program, the I/O refresh instruction REF (FNC
50) can be used to acquire the latest input information and immediately output the operation result. As a
result, high speed control is achieved without being affected by the operation cycle of the PLC.
2. When double interrupt (interrupt during another interrupt) is required [interrupt function]
Usually, interrupts are disabled in an interrupt routine (program).
When EI (FNC 04) and DI (FNC 05) instructions are programmed in an interrupt routine, up to two interrupts
can be accepted.
4. Non-overlap of input [input interrupt (with/without delay function) and pulse catch function]
The inputs X000 to X007 can be used for high speed counters, input interrupts, pulse catch, SPD, ZRN,
DSZR and DVIT instructions and for general-purpose inputs.
Make sure inputs do not overlap with each other.
When using SFC program (STL instruction), do not drive state relays S in SET or OUT instruction in an
interrupt program.
Step 0
X001
C0
K10
FNC 06
FEND
I001
M8000
RST
Y007
FNC 05
IRET
794
C0
31
FNC275-FNC279
Data
Transfer 3
2) Timing chart
Interrupt program
Execution of interrupt
program I001 triggered
by X000
32
X001
FNC280-FNC289
High Speed
Processing 2
Current
value of C0
Counter is
reset
C0 remains reset
Y007
33
FNC290-FNC299
Extension File
Register
RST
C0
34
SFCSTL
Programming
1) Program example
FNC 04
EI
Step 0
X001
C0
RST
35
Y007
Interrupt
Function
X002
K10
FNC 06
FEND
M8001
36
RST
C0
RST
C0
RUN monitor
(normally OFF)
Special Device
I001
M8000
B
Program to deactivate the preceding
C0 reset instruction inside the
subroutine.
37
Error Code
Y007
FNC 05
IRET
2) Timing chart
Version Up
Information
Interrupt program
Execution of interrupt
program I001 triggered
by X000
X001
Execution Times
Current
2
value of C0
1
Counter is reset
RST (part A in above
program).
C0
Y007
Applicable
Instruction List
X002
Y007 is reset
795
35.3
35.3.1 Input interrupt (interrupt triggered by external signal) [without delay function]
1. Outline
An interrupt routine is executed by the input signal from an input X000 to X005.
2. Application
Because the external input signal can be processed without being affected by the operation cycle of the PLC,
this interrupt is suitable to high speed control and receiving of short pulses.
FNC 04
EI
Interrupts are
enabled
Main program
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.
Main
program
FNC 06
FEND
Interrupt
pointer
I001
END
Interrupt return
FNC 03
IRET
796
FNC 03
IRET
Interrupt
pointer
I100
End of main
program
Interrupt return
"END" indicates the end of program.
31
FNC275-FNC279
Data
Transfer 3
X000
I001
I000
M8050*1
X001
I101
I100
M8051*1
X002
I201
I200
M8052*1
X003
I301
I300
M8053*1
X004
I401
I400
M8054*1
X005
I501
I500
M8055*1
33
FNC290-FNC299
Extension File
Register
*1.
32
Pointer number
34
6. Cautions
Input number
X000 to X005
5s*1
B
Execution Times
A
Version Up
Information
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 k (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.
37
Error Code
36
Special Device
35
Interrupt
Function
SFCSTL
Programming
When either one among M8050 to M8055 is set to ON in a program, interrupts from the corresponding input
number are disabled.
(Refer to the above table for the correspondence.)
*1.
FNC280-FNC289
High Speed
Processing 2
Input number
C
Applicable
Instruction List
797
7. Program examples
1) When using both an external input interrupt at the rising edge and the output refresh (REF instruction)
In the program example shown below, the output Y000 immediately turns ON when the rising edge of the
external input X000 is detected.
Step
0
Interrupt
pointer
I001
FNC 50
REF
FNC 04
EI
FNC 06
FEND
SET
Y000
Y000
K8*1
FNC 03
IRET
END
*1.
Make sure to specify a multiple of "8" for the number of inputs/outputs to be refreshed by REF (FNC
50) instruction.
If any value other than a multiple of "8" is specified, an operation error occurs and REF (FNC 50)
instruction is not executed.
2) When using both an input interrupt and the input refresh (REF instruction)
In the program example shown below, an interrupt is processed using the latest input information.
Step
0
Interrupt
pointer
I101
REF
FNC 04
EI
FNC 06
FEND
X010
K8*1
SET
Y001
RST
Y001
FNC 03
IRET
END
*1.
798
Make sure to specify a multiple of "8" as the number of inputs/outputs to be refreshed by REF (FNC
50) instruction.
If any value other than a multiple of "8" is specified, an operation error occurs and REF (FNC 50)
instruction is not executed.
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
Step
0
FNC 04
EI
31
FNC275-FNC279
Data
Transfer 3
3) When counting the number of times of input generation (in the same way as 1-phase high speed counter)
In the program example shown below, external inputs are counted.
32
M8000
RUN monitor
FNC 24
INC
D0
END
Pulse input
X003
ON
ON
TO
TO
35
Interrupt
Function
M0
Step
0
FNC 04
EI
M0
T0
36
K10
M0
37
Error Code
FNC 06
FEND
Interrupt
pointer
I301
Special Device
M0
34
SFCSTL
Programming
33
FNC290-FNC299
Extension File
Register
FNC 03
IRET
FNC280-FNC289
High Speed
Processing 2
Interrupt
pointer
I201
FNC 06
FEND
When the rising edge of X002 is detected
A
Version Up
Information
FNC 03
IRET
END
B
Execution Times
C
Applicable
Instruction List
799
SW
SW(X000,X001)
24V
0V
S/S
X000 X001
Step
0
Interrupt
pointer
I001
FNC 06
FEND
T246
RST
M0
RST
D0
FNC 03
IRET
When the falling edge of
X001 is detected
X010
M0
FNC 12
M0V
M8000
T246
Measurement data
T246
M0
D0
Measurement
is completed
K1 Timer is stopped
RST
FNC 03
IRET
END
The reset
status is
cleared
SET
800
RST
T246
Interrupt
pointer
I100
FNC 04
EI
T246
Timer is
reset
35.3 Input Interrupt (Interrupt Triggered by External Signal) [Without Delay Function]
31
FNC275-FNC279
Data
Transfer 3
-Timing chart
X010: Preparation
for measurement
I001(Interrupt processing)
I100(Interrupt processing)
32
SW(X000,X001)
FNC280-FNC289
High Speed
Processing 2
RST
T246
Part A in the previous page
33
FNC290-FNC299
Extension File
Register
Current
value of T246
M0
2. Example of program to measure the short pulse width using a high speed ring counter
SFCSTL
Programming
Step
0
FNC 04
EI
34
35
FNC 06
FEND
When X000 turns ON: The ring counter is reset
to OFF, and
measurement is started.
D8099
M0
FNC 03
IRET
M0V
SET
37
Measurement data
D8099
M0
D0
Measurement
is completed
END
B
Execution Times
A
Version Up
Information
FNC 03
IRET
Error Code
Interrupt
pointer
I100
36
Special Device
Interrupt
pointer
I001
Interrupt
Function
X010
C
Applicable
Instruction List
801
35.4
2. Programming procedure
Contact for setting delay time
I
M8393
FNC 12
MOV
K{{{*
D8393
3. Timing chart
Because the previous interrupt processing
is not completed, the interrupt processing
is not executed here.
Interrupt input
(X000 to X005)
Valid
Interrupt program is
executed
Delay time
(msec)
802
IRET
instruction
31
FNC275-FNC279
Data
Transfer 3
35.5
32
An interrupt routine is executed at every 1 to 99 ms without being affected by the operation cycle of a PLC.
2. Application
This type of interrupt is suitable when a certain program should be executed at high speed while the main
program operation time is long or when a program should be executed at a constant time interval in sequence
operations.
Main program
Step
0
FNC 04
EI
Interrupts are
enabled
When interrupt is
given at every 20 ms
Interrupt return
37
Error Code
I6
An integer in the range from 1 to 99 is put in "" in the pointer name.
Example: "I610" indicates a timer interrupt at every 10 ms.
M8057*1
M8058*1
Caution
If the timer interrupt time is set to 9ms 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.
C
Applicable
Instruction List
Execution Times
I8
*1.
Version Up
Information
An interrupt routine program is executed at every specified interrupt cycle time (1 to 99 ms). Use the type of
interrupt in control requiring cyclic interrupt processing regardless of the operating cycle of a PLC.
I7
36
Special Device
END
Input number
35
Interrupt subroutine
Interrupt
routine
FNC 03
IRET
Interrupt
Function
Interrupt
pointer
I620
End of
main program
34
SFCSTL
Programming
Main
program
FNC 06
FEND
33
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
1. Outline
When the main program contains an applied instruction which processing time is long
803
5. Cautions
Each pointer number (I6, I7 or I8) can be used only once.
When M8056 to M8058 is set to ON in a program, a corresponding timer interrupt is disabled.
6. Program example
For program examples in which RAMP (FNC 67) or HKY (FNC 71) instructions are combined, refer
to Subsection 35.5.2.
In the program example shown below, data is added and the addition result is compared with the set value
every 10 ms.
1) Program example
Step
0
X001
Interrupt
pointer
I610
FNC 04
EI
SET
When interrupt is
given at every 10 ms
M3
FNC 24
INC
FNC224
LD=
K1000
M3
FNC 06
FEND
D0
D0
FNC 03
IRET
END
RST
M3
35.5.2 Examples of practical program (timer interrupt programs using applied instruction)
RAMP (FNC 67), HKY (FNC 71), SEGL (FNC 74), ARWS (FNC 75) and PR (FNC 77) 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.
804
31
FNC 04
EI
FNC275-FNC279
Data
Transfer 3
32
Y000
K8
33
M0
FNC290-FNC299
Extension File
Register
Interrupt
pointer
I620
FNC280-FNC289
High Speed
Processing 2
FNC 06
FEND
34
SFCSTL
Programming
FNC 03
IRET
END
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
805
(D 3)
(D 1) = 1
X000 = ON
M8029
Execution is completed
2) Program
Step
0
X000
Start
M 0
FNC 04
EI
M8026
FNC 12
MOV
K 1
D 1
FNC 12 K255
MOV
D 2
PLS
M 0
SET
M 1
FNC 06
FEND
When interrupt is given every 10 ms
Interrupt
pointer
I610
M 1
FNC 67
RAMP
D 1
RST
FNC 03
IRET
806
D 3 K1000
M8029
END
D 2
M 1
32
This type of interrupt utilizes the current value of a high speed counter.
This type of interrupt is used together with the comparison set instruction DHSCS (FNC 53). When the
current value of a high speed counter reaches the specified value, an interrupt routine is executed.
C255
K2,147,483,647
FNC 53
DHSCS K1000 C255 I010
*1
Interrupt pointer
number is
FNC 06
FEND
specified
35
Interrupt return
END
*1.
36
Special Device
FNC 03
IRET
Interrupt
Function
Interrupt
pointer
I010
34
SFCSTL
Programming
RUN
monitor
FNC290-FNC299
Extension File
Register
M8000
33
Main program
Interrupts are enabled after EI (FNC 04)
instruction.
The main program is described.
FNC 04
EI
FNC280-FNC289
High Speed
Processing 2
2. Application
Step
0
31
FNC275-FNC279
Data
Transfer 3
35.6
37
Error Code
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.
Version Up
Information
I010
I020
I030
I040
M8059*1
I050
*1.
807
C
Applicable
Instruction List
When only controlling the ON/OFF status of an output relay (Y) or auxiliary relay (M) according to the current
value of a high speed counter, a required program can be easily created using DHSCS (FNC 53), DHSCR
(FNC 54) or DHSZ (FNC 55) instruction.
Execution Times
I060
6. Cautions
1) Pointer number
Pointer numbers cannot overlap with each other.
2) Disabling interrupts
When the special auxiliary relay M8059 is set to ON in a program, all counter interrupts are disabled.
35.7
*1.
X000
M8170*1
X001
M8171*1
X002
M8172*1
X003
M8173*1
X004
M8174*1
X005
M8175*1
X006
M8176*1
X007
M8177*1
2. Program example
Step
0
FNC 04
EI
M8170
Y000
X002
RST
M8170
Reset input
EI
X000(Input)
M8170
X002(Reset)
[X000 to X005]: 5 s or more*1
[X006 and X007]: 50 s or more
*1.
808
When using the pulse catch function at 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 k (1 W or more) to the 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.
31
1) When receiving an input again, it is necessary to reset the device which was once set using a program.
Accordingly, until a device is reset, a new input cannot be received.
2) When it is necessary to receive continuous short pulses (input signals), use the external input interrupt
function or high speed counter function.
4) The pulse catch function is executed regardless of the operations of the special auxiliary relays M8050 to
M8055 for respectively disabling interrupts.
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
3. Cautions on use
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
809
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
PLC Status
[M]8000
RUN monitor
NO contact
RUN
input
D8004
D8005
D8006
D8007
D8008
D8008
D8009
M8061
Error occurrence
[M]8001
RUN monitor
NC contact
M8000
[M]8002
Initial pulse
NO contact
M8001
[M]8003
Initial pulse
NC contact
M8003
M8002
1 scan time
Refer to Subsection 36.2.1.
FX3U, FX3UC
ON when either M8060, M8061, M8064, M8065,
M8066, or M8067 is ON.
FX1S,FX1N,FX2N,FX1NC,FX2NC
ON when either M8060, M8061, M8063, M8064,
M8065, M8066, or M8067 is ON.
ON when battery voltage is below the value set in
D8006.
Refer to Subsection 36.2.3.
It is set when battery voltage low is detected.
Refer to Subsection 36.2.3.
ON for 1 scan, when momentary power failure is
detected
Even if M8007 turns ON, PLC continues to RUN as
long as the duration of power loss is within the time
period specified in D8008.
Refer to Subsection 36.2.4.
Set when momentary power failure is detected.
If power loss time is longer than the time period
specified in D8008, M8008 is reset and PLC is
switched to STOP mode.(M8000=OFF).
Refer to Subsection 36.2.4.
ON when 24V DC power fails in either powered
[M]8004
Error occurrence
[M]8005
Battery voltage low
[M]8006
Battery error latch
[M]8007
Momentary power
failure
[M]8008
Power failure
detected
[M]8009
24V DC down
*1.
810
31
[M]8018
Flag
[M]8020
Zero
32
33
3*3
3*3
3*3
35
*2.
36
37
B
Execution Times
*3
Error Code
*1.
The FX2NC PLC requires the optional memory board (with the real time clock).
Applicable
Instruction List
*3.
3 (Always ON)*3
34
Special Device
Interrupt
Function
M 8019
SFCSTL
Programming
M 8017
Version Up
Information
M 8016
FNC290-FNC299
Extension File
Register
M 8015
Not used
ON and OFF in 10 ms cycles (ON: 5 ms, OFF: 5 ms)
Refer to Subsection 36.2.6.
ON and OFF in 100 ms cycles (ON: 50 ms, OFF: 50 ms)
Refer to Subsection 36.2.6.
ON and OFF in 1 sec cycles (ON: 500 ms, OFF: 500 ms)
Refer to Subsection 36.2.6.
ON and OFF in 1 min cycles (ON: 30 sec, OFF: 30 sec)
Refer to Subsection 36.2.6.
Clock stop and preset
For real time clock
Refer to Subsection 36.2.7.
Time read display is stopped
For real time clock
Refer to Subsection 36.2.7.
30 seconds correction
For real time clock
Refer to Subsection 36.2.7.
Installation detection (Always ON)
For real time clock
Refer to Subsection 36.2.7.
Real time clock (RTC) error
For real time clock
Refer to Subsection 36.2.7.
FNC280-FNC289
High Speed
Processing 2
Clock
[M]8010
[M]8011
10 ms clock pulse
[M]8012
100 ms clock pulse
[M]8013
1 sec clock pulse
[M]8014
1 min clock pulse
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
811
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
PLC Mode
M 8030*1
Battery LED
OFF
M 8031*1
Non-latch memory
all clear
M 8032*1
Latch memory
all clear
M 8033
Memory hold
STOP
D8176 to
D8180
3*4
D8039
812
*1.
*2.
*3.
*4.
31
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Step Ladder and Annunciator (Refer to ANS (FNC 46), ANR (FNC 47), IST (FNC 60), and Chapter 34 for details.)
While M8040 is turned ON, transfer between states is
M 8040
3
3
3
3
3
3
3
Transfer disable
disabled.
FNC275-FNC279
Data
Transfer 3
[M]8041*1
Transfer start
[M]8042
Start pulse
FNC280-FNC289
High Speed
Processing 2
M8047
D8040 to
D8047
M 8049*1
Annunciator enable
D8049
M8048
M 8043*1
Set this in the last state of zero return mode.
Zero return complete
8044*1
M
Zero point condition
M 8045
All output reset
disable
[M]8046*2
STL state ON
M 8047*2
STL monitoring
enable
*1.
*2.
*3.
I00 disable*4
M8051 (input interrupt)
I10 disable*4
I30 disable*4
M8054 (input interrupt)
I40 disable*4
M8055 (input interrupt)
I6 disable*4
M8057
(Timer interrupt)
I8 disable*4
M8059
Counter interrupt
37
disable*4
C
Applicable
Instruction List
*4.
Execution Times
I7 disable*4
M8058
(Timer interrupt)
36
Version Up
Information
I50 disable*4
M8056
(Timer interrupt)
35
Error Code
I20 disable*4
M8053 (input interrupt)
34
Special Device
33
Interrupt
Function
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
32
813
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
3
3
3
3
D8060
D8061
D8062
3
3
3
3
3
3
[M]8063*1*2
[M]8064
D8063
Parameter error
[M]8065
Syntax error
[M]8066
Ladder error
[M]8067*3
Operation error
M 8068
D8064
D8065
D8069
D8314*5
D8315*5
D8066
D8069
D8314*5
D8315*5
D8067
D8069
D8314*5
D8315*5
D8068
D8312*5
D8313*5
M 8069*4
*1.
*2.
Serial communication error 2 [ch2] in FX3U and FX3UC PLCs is detected by M8438.
*3.
*4.
When M8069 is ON, I/O bus check is executed. <Refer to Subsection 37.3.1 for details.>
*5.
Parallel Link
M 8070*6
*6
M 8071
[M]8072
[M]8073
*6.
Sampling Trace
[M]8074
[M]8075
[M]8076
[M]8077
[M]8078
[M]8079
[M]8080
[M]8081
[M]8082
[M]8083
[M]8084
[M]8085
[M]8086
[M]8087
[M]8088
[M]8089
814
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
Not used
D8075 to
D8098
31
Operation and function
Flag
M 8091
3*1
D8099
*1.
*2.
For FX2N/FX2NC, 0.1ms high speed ring counter D8099 will operate after END instruction is executed
with after M8099 is driven.
For FX3U/FX3UC, 0.1ms high speed ring counter D8099 will operate after M8099 is driven.
[M]8104
[M]8105
[M]8106
[M]8107
[M]8108
*3.
D8104
D8105
D8107
3*3
3*3
35
36
37
D8109
D8112
D8113
D8114
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
B
Execution Times
Version Up
Information
Error Code
34
Special Device
Not used
33
Interrupt
Function
Memory Information
[M]8101
[M]8102
[M]8103
32
SFCSTL
Programming
3*1
FNC290-FNC299
Extension File
Register
[M]8092
[M]8093
[M]8094
[M]8095
Not used
[M]8096
[M]8097
[M]8098
High Speed Ring Counter
High speed ring counter operation (in units of 0.1ms,
M 8099*2
16 bits)
[M]8100
Not used
FNC280-FNC289
High Speed
Processing 2
[M]8090
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
C
Applicable
Instruction List
815
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
RS (FNC 80) and Computer Link [ch1] (Refer to Data Communication Edition for details.)
[M]8120
Not used
[M]8121*1
M 8122
D8122
M 8123*1
[M]8124
[M]8125
[M]8126
[M]8127
M 8128
D8123
3
3
3
3
3
3
3
3
3
3
3
3
*1
M 8129
*1.
D8127
D8128
D8129
High Speed Counter Comparison, High Speed Table, and Positioning [Positioning is supported in FX1S, FX1N, and FX1NC PLCs.]
3
3
M 8130
HSZ (FNC 55)instruction: Table comparison mode
D8130
HSZ (FNC 55)instruction:
3
3
[M]8131
Table comparison mode completion flag
HSZ (FNC 55) and PLSY (FNC 57) instructions:
M 8132
3
3
[M]8133
Speed pattern mode completion flag
[M]8134
[M]8135
Not used
[M]8136
[M]8137
HSCT (FNC280) instruction:
3
3
D8138
[M]8138
Instruction execution complete flag
HSCS(FNC 53), HSCR(FNC 54), HS2(FNC 55),
[M]8139
HSCT(FNC280) instructions:
3
3
D8139
3
3
3
CLR signal output function enable
[M]8141
[M]8142
Not used
[M]8143
[M]8144
3
3
3
M 8145
[Y000] Pulse output stop command
3
3
3
M 8146
[Y001] Pulse output stop command
3
3
3
[M]8147
[Y000] Pulse output monitor (BUSY/READY)
3
3
3
[M]8148
[Y001] Pulse output monitor (BUSY/READY)
[M]8149
Not used
816
3
3
3
3
31
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Inverter Communication Function (Refer to Data Communication Edition for details.)
[M]8150
Not used
3
D8151
[M]8152*1
D8152
[M]8153*1
D8153
[M]8154*1
D8154
[M]8154
3*2
3*2
3*2
3*2
3*2
3*2
34
[M]8155
D8155
[M]8156*1
D8156
D8156
D8157
D8157
3*2
3*2
[M]8158*1
D8158
*1
D8159
[M]8157*1
[M]8159
*1.
*2.
35
*3*4
M 8161
M 8162
[M]8163
M 8165*3
[M]8166
M 8167*3
[M]8169
D8164
3*5
3*6
*4.
Applicable to ASC (FNC 76), RS (FNC 80), ASCI (FNC 82), HEX (FNC 83), CCD (FNC 84), and CRC
(FNC188) instructions*7.
*5.
*6.
*7.
37
A
Version Up
Information
*3.
36
Error Code
M 8168*3
Special Device
M 8164*3
Interrupt
Function
Advanced Function
M 8160*3
33
SFCSTL
Programming
[M]8156
FNC280-FNC289
High Speed
Processing 2
FNC290-FNC299
Extension File
Register
32
[M]8151*1
B
Execution Times
C
Applicable
Instruction List
817
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
8171*1
M 8172*1
*1
*1
*1
*1
*1
FX2N, FX2NC, FX3U, or FX3UC Series PLC: EI (FNC 04) instruction is necessary.
FX1S, FX1N, or FX1NC Series PLC: EI (FNC 04) instruction is unnecessary.
Communication Port Channel Setting (Refer to Data Communication Edition for details.)
3
3
M 8178
Parallel link channel switch (OFF: ch1/ON: ch2)
M 8173
M 8174
M 8175
M 8176
M 8177
*1.
M 8179
*2.
*3
[M]8184
The channel is specified by either setting or not setting M8179 in the setting program.
For setting program, Refer to Data Communication Edition
ch1: M8179 is not set in program
ch2: M8179 is set in program
N:N Network (Refer to FX Series Users Manual - Data Communication Edition for details.)
[M]8180
[M]8181
Not used
[M]8182
[M]8183*3
(M504)
3*4
(M505)
*4
*4
*3
[M]8185
(M506)
[M]8186*3
(M507)
3*4
3*4
*4
*4
*4
[M]8187*3
*3
[M]8188
*3
[M]8189
*3
D8201 to
(M508)
D8218
(M509)
(M510)
[M]8190
(M511)
[M]8191*3
[M]8192
[M]8193
[M]8194
[M]8195
[M]8196
[M]8197
(M503)
Not used
3*4
*3.
*4.
High Speed Counter Edge Count Specification (Refer to Subsection 4.7.8 for details.)
M 8198*5*6
*5*6
M 8199
818
*5.
*6.
31
FNC275-FNC279
Data
Transfer 3
32
FNC280-FNC289
High Speed
Processing 2
33
FNC290-FNC299
Extension File
Register
34
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
37
Error Code
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Counter Up/down Counter Counting Direction (Refer to Section 4.6 for details.)
3
3
3
3
3
3
M 8200
C200
3
3
3
3
3
3
M 8201
C201
3
3
3
3
3
3
M 8202
C202
3
3
3
3
3
3
M 8203
C203
3
3
3
3
3
3
M 8204
C204
3
3
3
3
3
3
M 8205
C205
3
3
3
3
3
3
M 8206
C206
3
3
3
3
3
3
M 8207
C207
3
3
3
3
3
3
M 8208
C208
3
3
3
3
3
3
M 8209
C209
3
3
3
3
3
3
M 8210
C210
3
3
3
3
3
3
M 8211
C211
3
3
3
3
3
3
M 8212
C212
3
3
3
3
3
3
M 8213
C213
3
3
3
3
3
3
M 8214
C214
3
3
3
3
3
3
M 8215
C215
3
3
3
3
3
M 8216
C216 When M8 is ON, the corresponding 3
C is changed to down mode.
3
3
3
3
3
3
M 8217
C217
ON: Down count operation
3
3
3
3
3
3
M 8218
C218 OFF: Up count operation
3
3
3
3
3
3
M 8219
C219
3
3
3
3
3
3
M 8220
C220
3
3
3
3
3
3
M 8221
C221
3
3
3
3
3
3
M 8222
C222
3
3
3
3
3
3
M 8223
C223
3
3
3
3
3
3
M 8224
C224
3
3
3
3
3
3
M 8225
C225
3
3
3
3
3
3
M 8226
C226
3
3
3
3
3
3
M 8227
C227
3
3
3
3
3
3
M 8228
C228
3
3
3
3
3
3
M 8229
C229
3
3
3
3
3
3
M 8230
C230
3
3
3
3
3
3
M 8231
C231
3
3
3
3
3
3
M 8232
C232
3
3
3
3
3
3
M 8233
C233
3
3
3
3
3
3
M 8234
C234
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
819
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
High Speed Counter Up/down Counter Counting Direction (Refer to Section 4.7 for details.)
3
3
3
3
3
3
3
M 8235
C235
3
3
3
3
3
3
3
M 8236
C236
3
3
3
3
3
3
3
M 8237
C237
3
3
3
3
3
3
3
M 8238
C238
3
3
3
3
3
3
M 8239
C239 When M8 is ON, the corresponding 3
C is changed to down mode.
3
3
3
3
3
3
3
M 8240
C240
ON: Down count operation
3
3
3
3
3
3
3
M 8241
C241 OFF: Up count operation
3
3
3
3
3
3
3
M 8242
C242
3
3
3
3
3
3
3
M 8243
C243
3
3
3
3
3
3
3
M 8244
C244
3
3
3
3
3
3
3
M 8245
C245
High Speed Counter Up/down Counter Monitoring (Refer to Section 4.7 for details.)
3
3
3
3
3
3
3
[M]8246
C246
3
3
3
3
3
3
3
[M]8247
C247
3
3
3
3
3
3
3
[M]8248
C248
3
3
3
3
3
3
3
[M]8249
C249 When C of 1-phase 2-input or 2-phase
2-input counter is in down mode, the
3
3
3
3
3
3
3
[M]8250
C250
corresponding M8 turns ON.
3
3
3
3
3
3
3
[M]8251
C251
ON: Down count operation
3
3
3
3
3
3
3
[M]8252
C252 OFF: Up count operation
3
3
3
3
3
3
3
[M]8253
C253
3
3
3
3
3
3
3
[M]8254
C254
3
3
3
3
3
3
3
[M]8255
C255
3*2
2nd special
adapter*1
3*2
3rd special
adapter*1
3*2
*2
3*3
3*3
3*3
3*3
*1
[M]8305
Not used
ON when the multiplication and division calculated
result is 0
Not used
[M]8306 Carry
[M]8307 to [M]8315
Not used
[M]8304 Zero
820
*1.
Count the number of connected FX3U-4AD-ADP, FX3U-4DA-ADP, FX3U-4AD-TC-ADP, and FX3U4AD-PT-ADP units from the main unit.
*2.
*3.
31
[M]8329
3*5
3
If the I/O device numbers are unavailable, M8316 turns ON when its directly designated to device
numbers including LD, AND, OR, and OUT instructions or indirectly designated by index.
*5.
Timing Clock (Refer to Section 24.3 for details.) and Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
[M]8330
3*1
D8330
D8331
[M]8332
*1
D8332
[M]8333
3*1
D8333
*1
3*3
D8336
3*1
[M]8339
[M]8340
8341*2
8342*2
M
M 8343
M 8344
3
3
3
3
M 8345*2
M 8346
M 8347*2
[M]8348
M 8349
[M]8350
*2
*2
M 8352
M 8353
M 8354
3
3
3
3
M 8355*2
M 8336*2
[M]8337
M 8338
*2
*2
M 8351
8356*2
M 8359*2
821
37
C
Applicable
Instruction List
M 8357*2
[M]8358
36
Execution Times
D8334
Version Up
Information
Not used
DVIT (FNC151) instruction:
Interrupt input specification function enabled
Not used
PLSV (FNC157) instruction:
Acceleration/deceleration operation
Not used
Error Code
[M]8335
Special Device
[M]8334
35
Interrupt
Function
[M]8331
3*1
34
SFCSTL
Programming
*4.
33
FNC290-FNC299
Extension File
Register
Instruction non-execution
32
FNC280-FNC289
High Speed
Processing 2
[M]8328
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Unconnected I/O Designation Error (Refer to Chapter 37 for details.) and flag
D8316
Unconnected I/O designation error
3
3
[M]8316*4
D8317
[M]8317
Not used
BFM initialization failure
ON when a FROM/TO error has occurred in a special
function block/unit as specified in the BFM
D8318
initialization function at changing PLC from STOP to
3
[M]8318
3*5
D8319
RUN.
When M8318 turns ON, the unit number in which the
error has occurred is stored in D8318, and the BFM
number is stored in D8319.
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Timing Clock (Refer to Section 24.3 for details.) and Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
[Y002] Pulse output monitor (ON: BUSY/ OFF: READY)
M 8361
M 8362*2
M 8363
M 8364
3
3
3
3
M 8365*2
[M]8360
*2
*2
M 8366
*2
M 8367
[M]8368
*2
M 8369
*1.
*2.
*3.
3*2
M 8371*1
3*2
*2
*1
M 8372
M 8373
3*2
*2
M 8374
*2
8376*1
3*2
8377*1
3*2
*2
*2
*1
M 8375
[M]8378
*1
M 8379
3
3
*1.
*2.
Available only when two FX3U-2HSY-ADP units are connected to an FX3U PLC.
[M]8381*3
[M]8382*3
[M]8383*3
[M]8384*3
[M]8385*3
[M]8386*3
[M]8387*3
[M]8388
M 8389
M 8390
M 8391
M 8392
3
3
3
3
3
3
3
3
3
3
*3.
822
31
D8393
32
Not used
FNC280-FNC289
High Speed
Processing 2
Interrupt Program
[M]8393
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
M 8398
[M]8399
Not used
[M]8394
[M]8395
[M]8396
[M]8397
Ring Counter
1ms ring counter (D8399, D8398) will operate after M8398 turns ON.
[M]8405
*1.
3
3
3
3
D8402
D8403
3*1
3*1
[M]8426
[M]8427
M 8428
M 8429
3*2
3
3
3
3*2
3
3
3
D8427
D8428
D8429
37
Error Code
36
Special Device
[M]8425
D8438
[M]8449
D8449
[M]8450 to [M]8459
Not used
3*3
Version Up
Information
B
Execution Times
*3.
35
RS2 (FNC 87) [ch2] and Computer Link [ch2] (Refer to Data Communication Edition for details.)
[M]8421
RS2 (FNC 87) [ch2] Send wait flag
3
3
D8422
M 8422
RS2 (FNC 87) [ch2] Send request
3
3
D8423
M 8423
RS2 (FNC 87) [ch2] Receive complete flag
3
3
[M]8424
RS2 (FNC 87) [ch2] Carrier detection flag
*2.
34
Interrupt
Function
[M]8406
[M]8407
[M]8408
M 8409
3
3
3
3
SFCSTL
Programming
RS2 (FNC 87) [ch1] (Refer to Data Communication Edition for details.)
[M]8400
Not used
[M]8401
RS2 (FNC 87) [ch1] Send wait flag
M 8402
RS2 (FNC 87) [ch1] Send request
M 8403
RS2 (FNC 87) [ch1] Receive complete flag
[M]8404
RS2 (FNC 87) [ch1] Carrier detection flag
33
FNC290-FNC299
Extension File
Register
*4.
D8398,
D8399
C
Applicable
Instruction List
823
Applicable model
CorrespondNumber and name
Operation and function
FX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
DVIT (FNC151) instruction [Y000]
3
D8336
M 8460
3*4
User interrupt input command
DVIT (FNC151) instruction [Y001]
3
D8336
M 8461
3*4
User interrupt input command
DVIT (FNC151) instruction [Y002]
3
D8336
M 8462
3*4
User interrupt input command
DVIT (FNC151) instruction [Y003]
M 8463
D8336
3*5
User interrupt input command
DSZR (FNC150), ZRN (FNC156) instructions [Y000]
M 8464
3
D8464
3*4
Clear signal device specification function enabled
DSZR (FNC150), ZRN (FNC156) instructions [Y001]
M 8465
3
D8465
3*4
Clear signal device specification function enabled
DSZR (FNC150), ZRN (FNC156) instructions [Y002]
3
D8466
M 8466
3*4
Clear signal device specification function enabled
DSZR (FNC150), ZRN (FNC156) instructions [Y003]
M 8467
D8467
3*5
Clear signal device specification function enabled
824
*4.
*5.
Available only when two FX3U-2HSY-ADP adapters are connected to an FX3U PLC.
31
Applicable model
Content of register
D 8000
Watchdog
timer
2 4 1 0 0
[D]8002
Memory capacity
2...2K steps
4...4K steps
8...8K steps
If 16K steps or more
"8" is written to D8002 and "16" or "64" is written
to D8102.
200
200
200
200
24
24
D8101*1
22
26
24
26
24
3
8
3
8
D8102
3
2
3
8
3
4
8
3
8
3
4
8
01H
02H
EEPROM memory
cassette or flash memory
cassette
OFF
0AH
EEPROM memory
cassette or flash memory
cassette
ON
10H
36
Special Device
8 0 6 0
M8004
M8005
[D]8005
Battery voltage
*1.
Default:
FX2N and FX2NC PLCs: 3.0V (in 0.1-V units)
FX3U and FX3UC PLCs: 2.7V (in 0.1-V units)
(Writes from system ROM at power ON)
A
3
M8006
The corresponding special device D8101 is available only in FX3U and FX3UC PLCs.
No corresponding device is available in FX1S, FX1N, FX2N, FX1NC, and FX2NC PLCs.
Version Up
Information
[D]8006
Low battery voltage
detection level
37
Error Code
[D]8004
Error number M
35
Protect
switch
Interrupt
Function
[D]8003
Memory type
Type of memory
34
SFCSTL
Programming
200
33
Version 1.00
Indicated on the right
FNC290-FNC299
Extension File
Register
[D]8001
PLC type and
system version
200
32
FNC280-FNC289
High Speed
Processing 2
PLC Status
FNC275-FNC279
Data
Transfer 3
B
Execution Times
C
Applicable
Instruction List
825
Applicable model
Number and name
Content of register
PLC Status
[D]8007
Momentary power
failure count
M8007
D 8008
Power failure
detection
Default:*1
FX3U, FX2N PLCs: 10 ms (AC power supply type)
FX2NC, FX3UC PLCs: 5 ms
(DC power supply type)
M8008
M8009
[D]8009
Minimum input device number of extension units and
24V DC failed device extension power units in which 24V DC has failed.
*1.
The power failure detection time in FX2N and FX2NC PLCs is as follows.
- 10ms for FX2N PLCs used with a 100V AC power supply system. D8008 is set to 10ms by default.
- 100ms maximum for FX2N PLCs used with a 200V AC power supply system. D8008 can be set in
the range from 10 to 100ms.
- 5ms for FX2N PLCs used with a DC power supply type. Write "K-1" to D8008 for correction.
- 5ms for FX2NC PLCs used with a DC power supply type. System writes "K-1" to D8008 for
correction. Do not make any change in a sequence program.
- For FX3U and FX3UC PLCs, refer to Subsection 36.2.4.
Clock
Accumulated instruction-execution time from step 0
(in 0.1-ms units)
Refer to Subsection 36.2.5
[D]8010
Present scan time
[D]8011
Minimum scan time
[D]8012
Maximum scan time
3
3
Same
Minimum value of scan time
Same
as on
(in 0.1-ms units)
as on
Refer to Subsection 36.2.5. the
the right
right
Maximum value of scan time
3
Indicated value includes waiting
time of constant scan operation
(when M8039 is activated).
D 8013
Second data
3*2
3*2
3*2
3*2
3*2
D 8014
Minute data
D 8015
Hour data
D 8016
Day data
D 8017
Month data
D 8018
Year data
3*2
D 8019
Day-of-the-week
data
0 (Sunday) to 6 (Saturday)
(for real time clock)
Refer to Subsection 36.2.7.
3*2
*2.
826
A memory board having the real time clock function is required in FX2NC PLCs.
31
Number and name
Content of register
Input Filter
32
3
[D]8021
[D]8022
[D]8023
[D]8025
[D]8026
[D]8027
Not used
[D]8024
[D]8029
*2
*1.
In FX1N, FX1NC PLCs the input filter can be adjusted in X000 to X007.
In FX3U, FX3UC, FX2N, FX2NC PLCs (16 points type) the input filter can be adjusted X000 to X007.
*2.
34
SFCSTL
Programming
[D]8028
33
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
D 8020
Input filter
adjustment
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
35
[D]8030
[D]8031
[D]8032
[D]8033
[D]8036
[D]8037
[D]8038
M8039
Interrupt
Function
Constant Scan
[D]8035
37
Error Code
D 8039
Constant scan
duration
Not used
Special Device
[D]8034
36
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
827
Applicable model
Number and name
Content of register
[D]8041*1
ON state number 2
[D]8042*1
ON state number 3
[D]8043*1
ON state number 4
[D]8044*1
ON state number 5
M8047
3
[D]8046*1
ON state number 7
[D]8047*1
ON state number 8
Not used
[D]8049
On state minimum
number
M8049
[D]8050 to [D]8059
Not used
M8060
[D]8045*1
ON state number 6
[D]8048
*1
*1.
*2.
[D]8060
1 0 2 0
[D]8061
M8061
[D]8062
M8062
[D]8063
M8063
[D]8064
M8064
[D]8065
M8065
[D]8066
M8066
[D]8067
M8067
3*4
3*4
M8068
3*5
3*5
M8065 to
M8067
8068*3
[D]8069*3
828
*3.
*4.
*5.
31
Number and name
Content of register
[D]8072
Not used
[D]8073
*1
Sampling Trace
[D]8076
[D]8077
[D]8078
[D]8079
[D]8080
[D]8081
[D]8082
[D]8083
[D]8084
[D]8085
[D]8086
M8075 to
M8079
[D]8089
[D]8090
[D]8091
[D]8092
[D]8093
[D]8094
[D]8095
[D]8096
[D]8097
[D]8098
*1.
[D]8100
Not used
*2.
*2
M8099
For FX2N/FX2NC, 0.1ms high speed ring counter D8099 will operate after END instruction is executed
while M8099 is ON.
For FX3U/FX3UC, 0.1ms high speed ring counter D8099 will operate after M8099 turns ON.
36
37
A
Version Up
Information
D 8099
35
Error Code
34
Special Device
[D]8088
[D]8087
33
Interrupt
Function
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
[D]8074
[D]8075
32
FNC280-FNC289
High Speed
Processing 2
[D]8071
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
B
Execution Times
C
Applicable
Instruction List
829
Applicable model
Number and name
Content of register
Memory Information
[D]8101
PLC type and
system version
1 6 1 0 0
FX3U/
FX3UC
[D]8102
2 ...... 2K steps
4 ...... 4K steps
8 ...... 8K steps
16 .... 16K steps
64 .... 64K steps
[D]8103
Not used
3
8
3
4
8
16
3
8
3
4
8
16
3*2
3*2
3*2
3*2
Version 1.00
16
64
16
64
3
2
*1
*1
[D]8104
[D]8105
[D]8106
Not used
[D]8107
M8107
[D]8108
M8109
*1.
*2.
M8104
[D]8110
Not used
[D]8111
M8112
[D]8113
M8113
D 8114
M8114
[D]8115 to [D]8119
Not used
RS (FNC 80) and Computer Link [ch1] (Refer to Data Communication Edition for details.)
D 8120*2
D 8121*2
[D]8122*3
M8122
[D]8123*3
M8123
D 8124
D 8125
[D]8126
Not used
D 8127
D 8128
D 8129*2
830
*3.
*4.
M8126 to
M8129
31
Number and name
Content of register
High Speed Counter Comparison, High Speed Table, and Positioning [Positioning is supported in FX1S, FX1N, and FX1NC PLCs.]
3
M8130
[D]8131
M8132
M8132
M8132
D 8137
[D]8138
M8138
[D]8139
M8139
[D]8144
Not used
D 8145
3*1
D 8148
[D]8149
Not used
[D]8132
[D]8133
[D]8134
[D]8135
D 8136
D 8140
D 8141
D 8143
and
35
DRVA
Lower
D 8147
DRVA
37
A
Version Up
Information
36
Error Code
*1.
and
34
Special Device
D 8146
(FNC158),
33
Interrupt
Function
D 8142
57)
32
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
[D]8130
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
B
Execution Times
C
Applicable
Instruction List
831
Applicable model
Number and name
Content of register
[D]8151
Step number of
communication [ch1]
Default: -1
M8151
[D]8152*1
M8152
[D]8153
M8153
M8154
3*2
3*2
D 8155
[D]8155
M8155
3*2
3*2
M8156
[D]8154
Step number of
communication [ch2]
Default: -1
[D]8156
instruction
instruction
during
during
inverter
inverter
M8156
3*2
3*2
[D]8157*1
M8157
[D]8157
M8157
3*2
3*2
[D]8158
M8158
[D]8159
M8159
*1.
*2.
D 8159
832
31
Number and name
Content of register
Advanced Function
M8164
3*1
Not used
[D]8162
[D]8163
D 8164
[D]8165
[D]8166
Not used
[D]8167
[D]8168
H0000
2nd keyword is
not set.
34
Program
Present
Monitorvalue
ing
Read Write
change
3*2
3*2
3*2
Read / write
H0011
protection
All online
H0012 operation
protection
3*3
36
*2.
*3.
Special Device
*1.
Not used
[D]8173
Station number
[D]8174
[D]8175
Refresh range
3*4
*4
*4
3
3
3
3
3
3
D 8177
3*4
3*4
D 8178
M8038
D 8179
*4
D 8180
*4
[D]8181
Not used
B
Execution Times
*4.
A
Version Up
Information
D 8176
3*4
37
Error Code
[D]8172
35
Interrupt
Function
3*2
33
SFCSTL
Programming
[D]8169
Present
value
32
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
[D]8160
[D]8161
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
C
Applicable
Instruction List
833
Applicable model
Number and name
Content of register
Value of Z1 register
[D]8183
Value of V1 register
[D]8184
Value of Z2 register
[D]8185
Value of V2 register
[D]8186
Value of Z3 register
[D]8187
Value of V3 register
[D]8188
Value of Z4 register
[D]8189
Value of V4 register
[D]8190
Value of Z5 register
[D]8191
Value of V5 register
[D]8192
Value of Z6 register
[D]8193
Value of V6 register
[D]8194
Value of Z7 register
[D]8195
Value of V7 register
Not used
(D201)
3*2
*2
3*2
*2
*2
3*2
*2
3*2
*2
*2
[D]8196
[D]8197
Not used
[D]8198
[D]8199
*1
[D]8203*1
[D]8204
*1
[D]8205
*1
[D]8206*1
[D]8207
*1
[D]8208*1
[D]8209
*1
[D]8210
*1
3
3
3
3
3
3
3
3
(D202)
(D203)
(D204)
(D205)
(D206)
(D207)
(D208)
(D209)
M8183 to (D210)
M8191 (D211)
[D]8211*1
3*2
[D]8212*1
(D212)
3*2
[D]8213*1
(D213)
3*2
[D]8214*1
(D214)
3*2
[D]8215*1
(D215)
3*2
[D]8216*1
(D216)
3*2
[D]8217*1
(D217)
3*2
(D218)
*2
[D]8218
*1
[D]8219 to [D]8259
834
Not used
*1.
*2.
31
Number and name
Content of register
Analog Special Adapter (Refer to Subsection 36.2.17 for applicability of each analog special adapter.)
1st special adapter*1
3*2
D 8270 to D 8279
3*2
D 8280 to D 8289
3*2
D 8290 to D 8299
3*2
Count the number of connected FX3U-4AD-ADP, FX3U-4DA-ADP, FX3U-4AD-TC-ADP, and FX3U4AD-PT-ADP units from the main unit.
*2.
Display Module Function FX3U-7DM (Refer to Hardware Edition Manual of PLC main unit used for details.)
3
D 8301
[D]8302*3
[D]8303
[D]8304
[D]8305
[D]8308
[D]8309
Not used
[D]8307
*3.
RND (FNC184)
[D]8310
[D]8311
Syntax, Circuit, Operation, or Unconnected I/O Designation Error Step Number (Refer to Chapter 37 for details.)
D 8312
M8068
M8065 to
M8067
[D]8317
M8316
[D]8318
3*5
M8318
*5
M8318
[D]8314*4
[D]8315*4
[D]8316
[D]8319
[D]8320 to [D]8328
Not used
*4.
*5.
37
B
Execution Times
D 8313
36
Version Up
Information
35
Error Code
34
Special Device
Interrupt
Function
SFCSTL
Programming
D 8300
[D]8306
33
FNC290-FNC299
Extension File
Register
*1.
32
FNC280-FNC289
High Speed
Processing 2
D 8260 to D 8269
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
C
Applicable
Instruction List
835
Applicable model
Number and name
Content of register
Timing Clock (Refer to Section 24.3 for details.) and Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
[D]8329
Not used
[D]8330
3*1
[D]8331
3*1
[D]8332
3*1
[D]8333
3*1
[D]8334
3*1
D 8336
3*2
M8336
[D]8337 to [D]8339
Not used
D 8340
D 8341
D 8342
D 8343
Lower
D 8344
Upper
Default: 0
Default: 100000
D 8345
D 8346
Lower
D 8347
Upper
Default: 50000
D 8348
D 8349
D 8350
Lower
D 8351
Upper
D 8352
D 8353
Lower
D 8354
Upper
Default: 0
Default: 100000
D 8355
D 8356
Lower
D 8357
Upper
Default: 50000
D 8358
D 8359
836
*1.
*2.
31
Number and name
Content of register
Timing Clock (Refer to Section 24.3 for details.) and Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
Lower [Y002] Current value register
Upper Default: 0
D 8362
D 8363
D 8365
D 8366
D 8367
D 8368
D 8369
D 8370
3*1
D 8371
D 8372
3*1
D 8373
3*1
*1
33
D 8376
D 8377
3*1
D 8378
3*1
D 8379
3*1
[D]8380 to [D]8392
Not used
*1.
36
Available only when two FX3U-2HSY-ADP adapters are connected to an FX3U PLC.
Delay time
M8393
[D]8394
[D]8395
M8398
Not used
[D]8396
[D]8397
Ring Counter
D 8398
Lower Up-operation
D 8399
counter
of
to
1ms ring counter (D8399, D8398) will operate after M8398 turns ON.
A
Version Up
Information
*2.
ring
37
Error Code
Special Device
35
Interrupt
Function
D 8375
34
SFCSTL
Programming
D 8374
FNC280-FNC289
High Speed
Processing 2
D 8364
32
FNC290-FNC299
Extension File
Register
D 8360
D 8361
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
B
Execution Times
C
Applicable
Instruction List
837
Applicable model
Number and name
Content of register
RS2 (FNC 87) [ch1] (Refer to Data Communication Edition for details.)
D 8400
[D]8401
Not used
[D]8402*1
M8402
[D]8403*1
M8403
[D]8404
Not used
[D]8405
[D]8406
[D]8407
Not used
[D]8408
D 8409
D 8410
D 8411
D 8412
D 8413
[D]8414
[D]8415
[D]8416
[D]8417
Not used
[D]8418
[D]8419
RS2 (FNC 87) [ch2] and Computer Link [ch2] (Refer to Data Communication Edition for details.)
D 8420
D 8421
[D]8422*1
M8422
[D]8423*1
M8423
[D]8424
Not used
[D]8425
[D]8426
Not used
D 8427
D 8428
D 8429
D 8430
D 8431
D 8432
D 8433
[D]8434
[D]8435
[D]8436
[D]8437
Not used
*1.
838
M8426 to
M8429
31
Number and name
Content of register
M8438
[D]8439
[D]8450 to [D]8459
Not used
*1.
M8449
*1
Positioning [FX3U and FX3UC PLCs] (Refer to Positioning Control Edition for details.)
3
D 8464
3*2
M8464
D 8465
3*2
M8465
D 8466
3*2
M8466
D 8467
3*3
M8467
[D]8468 to [D]8511
Not used
*2.
*3.
Available only when two FX3U-2HSY-ADP adapters are connected to an FX3U PLC.
34
35
Interrupt
Function
Not used
SFCSTL
Programming
[D]8460 to [D]8463
33
FNC290-FNC299
Extension File
Register
[D]8440 to [D]8448
[D]8449
32
FNC280-FNC289
High Speed
Processing 2
RS2 (FNC 87) [ch2] and Computer Link [ch2] (Refer to Data Communication Edition for details.)
FNC275-FNC279
Data
Transfer 3
Applicable model
CorrespondFX3U FX3UC ing special FX1S FX1N FX2N FX1NC FX2NC
device
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
839
36.2
"Normal operation"
RUN
M8000
RUN monitor (NO contact)
STOP
ON
ON
M8001
RUN monitor (NC contact)
M8002
Initial pulse (NO contact)
RUN
ON
ON
1 scan time
M8003
Initial pulse (NC contact)
ON
ON
ON
FNC40 D200
ZRST
D299
M8003 turns OFF momentarily (for only 1 scan time) when the PLC enters the RUN mode.
2) Flag operation timing
RUN input
RUN
M8000
RUN monitor (NO contact)
STOP
ON
ON
M8001
RUN monitor (NC contact)
M8002
Initial pulse (NO contact)
M8003
Initial pulse (NC contact)
840
RUN
ON
ON
1 scan time
ON
ON
ON
31
The watchdog timer monitors the operation (scan) time of the PLC. When the operation is not completed
within the specified time, ERROR (ERR) LED light turns on and all outputs are turned OFF.
When the power is initially turned ON, "200 ms" is transferred from the system to D8000 as the default value.
For executing a program beyond 200 ms, the contents of D8000 must be changed by the user program.
M8002
0
Initial pulse
K300
FNC 07
WDT
D8000
33
37
Error Code
The watchdog timer time can be set to a maximum of 32767 ms. However, CPU error detection is delayed
when the watchdog timer time is extended.
It is recommended to use the default value (200 ms) when no problems are to be expected in operation.
36
Special Device
The watchdog timer can be reset in the middle of a sequence program using WDT (FNC 07) instruction.
It is recommended to reset the watchdog timer by WDT (FNC 07) instruction when the scan time of a
particular sequence program is extended or when many special function units/blocks are connected.
For WDT (FNC 07) instruction, refer to Section 8.8.
35
Interrupt
Function
34
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
FNC 12
MOV
32
FNC280-FNC289
High Speed
Processing 2
1. Example program
FNC275-FNC279
Data
Transfer 3
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
841
0
Battery
voltage low
Supply voltage
100V AC system
200V AC system
AC power supply
Approx. 5 ms
10 ms
Setting range: 10 to 100 ms
Set a value to D8008.
Default: 10 ms
1 scan time
Approx. 2 ms
M8007:Momentary
power failure
detection
M8008:Power failure
detected
1 scan time
D8008
5ms
842
31
The PLC has the following four types of internal clocks which are always oscillating while the PLC power is
ON.
10ms
M8012
(100ms)
100ms
10Hz
1s
32
Caution:
Even while the PLC is in the STOP mode, these clocks are always
oscillating. Therefore, the rising edge of the RUN monitor (M8000)
does not synchronize with the clock start timing.
FNC280-FNC289
High Speed
Processing 2
M8011
(10ms)
100Hz
1Hz
M8013
(1 sec)
33
1min
FNC290-FNC299
Extension File
Register
M8014
(60 sec)
34
Name
M8016
Time read
stopped
M8017
30 seconds correction
At the edge from OFF to ON, the RTC is set to the nearest minute.
(When the second data is from 0 to 29, it is set to 0. When the second data is from
30 to 59, it is set to 0 and the minute data is incriminated by "1".)
M8018
Installation detection
M8019
When the data stored in special data registers is outside the allowable time, setting
range this device turns ON.
display
is
When M8016 turns ON, the time display is stopped (but RTC is continued).
Name
D8013
Second data
0 to 59
D8014
Minute data
0 to 59
D8015
Hour data
0 to 23
D8016
Day data
1 to 31
D8017
Month data
1 to 12
D8018
Year data
00 to 99
(last two digits of year)
Day-of-the-week data
Use these devices for writing the initial value in time setting
or read the present time.
0 to 6
(which corresponds to
Sunday to Saturday)
For the real time clock setting method, refer to Subsection 36.2.8.
37
A
Version Up
Information
D8019
36
Error Code
Number
35
Special Device
Interrupt
Function
M8015
SFCSTL
Programming
1. Assignment of special auxiliary relays (M8015 to M8019) and special data registers (D8013
to D8019)
Number
FNC275-FNC279
Data
Transfer 3
B
Execution Times
C
Applicable
Instruction List
843
FNC 12
MOV
K2000
D8018
844
31
FNC275-FNC279
Data
Transfer 3
ESC
OK
Cl ock
se t t i ng
34
se t t i ng
19 .
8 . 1993 *
7 : 11 : 19 [ Thu ]
Cl ock
35
se t t i ng
31 .
1 . 2004 *
23 : 59 : 59 [ Sa t ]
37
A
Cu r r e n t
Cl ock
t i me
se t t i ng
Version Up
Information
36
Error Code
Contents of operation
Cl ock
33
t i me
Special Device
Operation
key
Cu r r e n t
Interrupt
Function
4) Change the flickering value by pressing the [+] or [-] key, and press the
[OK] key to set the value. The items are set in the order "year month
day hour minute second."
When the last "second" value is decided by pressing the [OK] key, the
message "Current time is set" appears, and setting of the present time
is completed.
se t t i ng
SFCSTL
Programming
3) Press the [OK] key, and the "Clock setting" screen on the right is
displayed.
Press the [ESC] key to cancel the operation and return to the "selection
screen."
Cl ock
32
t i me
FNC290-FNC299
Extension File
Register
Cu r r e n t
FNC280-FNC289
High Speed
Processing 2
B
Execution Times
C
Applicable
Instruction List
845
2. Method by program
1) Method using TWR (FNC167) instruction dedicated to time setting.
M 0
X001
M8015
PLF
M0
FNC 12
MOV
K 30
D8013
Second data
FNC 12
MOV
K 20
D8014
Minute data
FNC 12
MOV
K 10
D8015
Hour data
FNC 12
MOV
K 25
D8016
Day data
FNC 12
MOV
K 4
D8017
Month data
FNC 12
MOV
K 0
D8018
Year data
FNC 12
MOV
K 2
D8019
Day-of-the-week data
M8017
Point
a) While M8015 is OFF, the registers for date and time cannot be changed.
Make sure to set M8015 to ON, and then input date and time.
b) When inputting the time, set the time several minutes ahead of the current time.
When the actual time reaches the set time, set M8015 to OFF from ON to make the new time valid
and to begin the real time clock again.
c) If values indicating infeasible date and time are input (Example: February 30, 2006), the time cannot
be set. Input the correct date and time.
846
31
The inputs X000 to X017*1 have a digital filter circuit with a setting range of 0 to 60 ms. The digital filter setting
value is set between 0 to 60 ms (in 1 ms steps) in special data register D8020. After the PLC powers ON,
D8020 is automatically set to K10 (10 ms).
Filter
0ms
1ms
0
1
Determined by the contents of D8020 (initial value: 10)
10
Input refresh
60
Image
memory
X017*1
60ms
*1.
33
FNC290-FNC299
Extension File
Register
10ms
34
When the program shown below is executed, the filter constant is changed to 0 ms.
Because the C-R filter is provided in the hardware, however, the filter constant is shown in the table below
when "0" is specified.
RUN monitor
K 0
35
D8020
Interrupt
Function
FNC 12
MOV
Input number
X000 to X005
5s*1
X006, X007
When setting the input filter to "5 s" or when receiving pulses whose response frequency is 50 k to
100 kHz using high speed counters, perform the following actions:
- Input wiring length should be 5 m (16' 4") or less.
- Connect a bleeder resistor (1.5 k, 1/2 W) to the input terminal. The load current of the open
collector transistor output in the device on the other end should be 20 mA or more including the
input current of the PLC.
X000 to X007 in the FX3U-16M, FX3UC-16M
The input filter constant can be changed as many times as need in the user program.
This input filter adjustment described here is not required when using high speed counter, input interrupt,
or pulse catch (M8170 to M8175) functions.
37
Error Code
*2.
200s
Special Device
X010 to X017
*1.
36
50s
*2
SFCSTL
Programming
M8000
32
FNC280-FNC289
High Speed
Processing 2
Input
terminal
X000
FNC275-FNC279
Data
Transfer 3
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
847
*1.
848
Auxiliary relay
FNC 40 S500*1
ZRST
S4095
State relay
FNC 40
ZRST
T255
Timer
T246
M8000
RUN monitor
M8002
Initial pulse
16 bit counter
32 bit counter
FNC 40 D200*1
ZRST
D7999
Data register
FNC 40
ZRST
R32767
R0
or
The device number is the default number of the latch (battery backed) device range limits in the
parameter settings.
If the latch (battery backed) device numbers in the parameter settings are changed to other values,
change the device numbers here in accordance with the changed latch ranges.
31
Device number
Contact image of output relay (Y), general type auxiliary relay (M), and general type state relay (S)
Contact and coil of timer (T)
Contact, counting coil, and reset coil of general type counter (C)
Present value of general type data register (D)
Present value register of timer (T)
Present value register of general type counter (C)
Contact image of latch (battery backed) type auxiliary relay (M) and latch (battery backed) type
state relay (S)
Contact and coil of retentive type timer (T)
Contact, counting coil, and reset coil of latch (battery backed) type counter and high speed
counter
Present value of latch (battery backed) type data register (D)
Present value register of retentive type timer (T) and 1-ms timer (T)
Present value register of latch (battery backed) type counter and high speed counter
1. Example program
37
Error Code
For example, when a heater is driven by the PLC, the PLC can be stopped while the heater and other
equipment are kept driven, and then the PLC can be started again after program changes.
When M8034 is turned ON, the output memory is cleared. As a result, all actual output relay contacts are
turned OFF and the PLC is operated in the image memory.
1. Program example
B
Execution Times
M8034
A
Version Up
Information
Command
input
Special Device
When the special auxiliary relay M8033 is turned ON, the output status in the RUN mode is retained even if
the PLC status switches from RUN to STOP.
M8033
35
36
Command
input
34
Interrupt
Function
M8032
(latch memory all
clear)
SFCSTL
Programming
M8031
(non-latch memory
all clear)
Cleared devices
33
FNC290-FNC299
Extension File
Register
For all devices (image memory) in the PLC, the latch (battery backed) areas and non-latch areas can be
cleared.
M8031 (non-latch memory all clear), M8032 (latch memory all clear)
32
FNC280-FNC289
High Speed
Processing 2
The special data register D8120 (communication format setting), D8121 (station number setting), and D8129
(time-out check time) are backed up by the battery.
When using the batteryless function, reset these special data registers once, and then transfer proper set
values to them by program.
The communication conditions can be set in the parameter settings.
When the communication conditions are set in the parameter settings, the PLC transfers the parameter
values to the above special data registers before operation. Thus it is recommended to set the
communication conditions via the parameter settings.
FNC275-FNC279
Data
Transfer 3
C
Applicable
Instruction List
849
1. Program example
The figure on the left shows an example
for the FX3U PLC (sink input).
RUN
24V
0V
S/S
M8000
X000
STOP
X001
PLC
X001
2. Setting method
1) Turn the built-in RUN/STOP switch to STOP.
2) Set up the RUN input switch, (X) (X000 is specified in the circuit diagram example above.)
Make the external RUN/STOP input valid by specifying an input between X000 and X017*1 for the RUN
input signal.
*1. X000 to X007 in the FX3U-16M, FX3UC-16M
a) Display the parameter setting in the programming tool
In GX Developer, double-click [Parameter] - [PC parameter] in the project tree to display the dialog
box.
Go to the "PLC system (1)" tab, and set "RUN terminal input."
b) Specify the input (X) number to switch from STOP mode to RUN mode.
3) Set up the STOP switch input (X)
Specify an arbitrary input terminal (actual I/O on the PLC) within the sequence program.
Refer to the program above.
4) Transfer the program and parameters to the PLC.
5) For the parameter settings to become valid, the PLC power must be turned from OFF to ON.
3. Cautions
1) When both RUN and STOP switches are pressed at the same time, priority is given to the STOP switch.
2) When the built-in RUN/STOP switch is turned to RUN, the PLC can be set to RUN mode.
However, when the STOP switch assigned to an arbitrary input is activated, the PLC will enter STOP
mode. (Even if the built-in switch is turned to RUN, priority is given to the STOP command.)
850
31
3) Even when the built-in RUN/STOP switch is on the RUN side of the PLC.
The remote STOP command via the programming tool or M8037 (forced STOP signal) are valid.
33
When the special auxiliary relay M8039 is set to ON and a setting value for the constant scan time (in 1-ms
units) is stored in special data register D8039, the scan time in the PLC does not become shorter than the
value stored in D8039.
The PLC pauses for the remaining time when the operation ends earlier, and then returns to step 0.
M8000
M8039 Constant scan mode
K 20
D8039
34
SFCSTL
Programming
1. Example program
FNC 12
MOVP
FNC290-FNC299
Extension File
Register
RUN
monitor
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
35
Interrupt
Function
2. Cautions
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
851
FX3U-4DA-ADP
FX3U-4AD-PT-ADP
FX3U-4AD-TC-ADP
Ver.1.20 or later*1
Ver.1.20 or later*1
Ver.1.30 or later*1
Ver.1.30 or later*1
M 8261
Not used
Type-K/-J switching
M 8262
Not used
Not used
M 8263
Not used
Not used
M 8264
Not used
Not used
M 8265
Not used
Not used
M 8266
Not used
Not used
M 8267
Not used
Not used
M 8268
Not used
Not used
Not used
Not used
M 8269
Not used
Not used
Not used
Not used
M 8271
Not used
Type-K/-J switching
M 8272
Not used
Not used
M 8273
Not used
Not used
M 8274
Not used
Not used
M 8275
Not used
Not used
M 8276
Not used
Not used
M 8277
Not used
Not used
M 8278
Not used
Not used
Not used
Not used
M 8279
Not used
Not used
Not used
Not used
M 8281
Not used
Type-K/-J switching
M 8282
Not used
Not used
M 8283
Not used
Not used
M 8284
Not used
Not used
M 8285
Not used
Not used
M 8286
Not used
Not used
M 8287
Not used
Not used
M 8288
Not used
Not used
Not used
Not used
M 8289
Not used
Not used
Not used
Not used
M 8291
Not used
Type-K/-J switching
M 8292
Not used
Not used
M 8293
Not used
Not used
M 8294
Not used
Not used
M 8295
Not used
Not used
M 8296
Not used
Not used
M 8297
Not used
Not used
M 8298
Not used
Not used
Not used
Not used
M 8299
Not used
Not used
Not used
Not used
*1.
852
31
Number
FX3U-4AD-ADP
FX3U-4AD-TC-ADP
D 8264
D 8265
D 8266
D 8267
Ver.1.30 or later*1
Ver.1.30 or later*1
D 8268
Error status
D 8269
Model code: K1
2nd analog special adapter
D 8270
Input data Ch1
Error status
Model code: K2
Error status
Model code: K20
Error status
Model code: K10
D 8271
D 8272
D 8273
D 8274
D 8275
D 8276
D 8277
D 8278
D 8279
Error status
Model code: K1
Error status
Model code: K2
Error status
Model code: K20
Error status
Model code: K10
D 8283
D 8284
D 8285
D 8286
D 8287
D 8288
Error status
Error status
Error status
Error status
Model code: K2
33
34
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
Model code: K1
D 8289
4th analog special adapter
D 8290
Input data Ch1
D 8291
Input data Ch2
D 8292
Input data Ch3
D 8293
Input data Ch4
32
FNC290-FNC299
Extension File
Register
D 8262
D 8263
Ver.1.20 or later*1
FNC280-FNC289
High Speed
Processing 2
Applicable
Ver.1.20 or later*1
version
1st analog special adapter
D 8260
Input data Ch1
D 8261
Input data Ch2
FNC275-FNC279
Data
Transfer 3
D 8295
D 8296
Execution Times
D 8294
D 8297
D 8298
D 8299
Error status
Model code: K1
Error status
Model code: K20
Error status
Model code: K10
Applicable
Instruction List
*1.
Error status
Model code: K2
853
37.1
FX3U PLC
POWER(Green)
RUN(Green)
BATT(Red)
ERROR(Red)
POWER(Green)
RUN(Green)
BATT(Red)
ERROR(Red)
FX3UC-32MT-LT PLC
POWER
(Green)
RUN(Green)
BATT(Red)
ERROR(Red)
L.RUN(Green)
L.ERR
(Red)
Flickering
Unlit
854
PLC status
Action
31
LED status
Lit
Unlit
PLC status
Sequence program is executing.
Sequence program is stopped.
Action
The PLC operation status is indicated.
This LED is not lit depending on the ERROR (ERR) LED
status. (Refer to Subsection 37.1.4.)
Lit
Action
Replace the battery as soon as possible.
(Refer to FX3U/FX3UC Hardware edition.)
33
FNC290-FNC299
Extension File
Register
Unlit
PLC status
by
B
Execution Times
check
37
Version Up
Information
36
Error Code
35
Special Device
Unlit
Interrupt
Function
Flickering
34
Action
SFCSTL
Programming
Lit
PLC status
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
C
Applicable
Instruction List
855
LED status
Lit
Unlit
Lit
Unlit
Lit
TEST
Unlit
PLC status
Action
Unit disconnected
Outside-control-range
station error
LED status
PLC status
Lit
ONLINE
Flickering
Unlit
Lit
CONFIG
Flickering
Unlit
Lit
TEST
Unlit
Action
For details, refer to the Hardware Edition of the PLC main unit.
856
31
FNC275-FNC279
Data
Transfer 3
37.2
Contrast
ClockMenu
EntryCode
PLC status
34
SFCSTL
Programming
ClearAllDev
ScanTime
Cassette
35
2) Pressing [OK] key executes the error check and displays the
result on "error display screen" (shown in the right figure).
Press [ESC] key to cancel the operation and return to "Top
screen".
Interrupt
Function
OK
FNC290-FNC299
Extension File
Register
ESC
33
LANGUAGE
Operation
key
36
No errors
ESC
-
OK
ErrorCheck
Is invalid.
Is invalid.
Displays the
When two or more errors
display screen.
next
[1]
37
M8 0 6 6
[2]
Ladder error
[3]
Error code
Error Code
Contents of operation
Special Device
6612
error
Error flag
[2]
Error name
[3]
Error code
[4]
[2]
I/O error
[3]
Error code
ErrorCheck
[1]
1020
+
2 / 2
[4]
M8 0 6 3
[2]
Link error1
[3]
Error code
6301
B
Execution Times
[1]
[4]
M8 0 6 0
Version Up
Information
Displayed contents
1 / 2
ErrorCheck
[1]
Displayed contents
32
FNC280-FNC289
High Speed
Processing 2
The error code can be checked by programming tool and FX3U-7DM (hereinafter called display module).
For the check method by programming tool, refer to the program check or PLC diagnostics described in the
programming tool manual.
C
Applicable
Instruction List
857
1
2
Example: No error
858
31
FNC275-FNC279
Data
Transfer 3
Display modules
Display in English
I/O error
Comms.error
Link error
Link error1
Link error2
Link error2
Parameter error
Param error
Parameter error
Syntax error
Syntax error
Grammar error
Circuit error
Ladder error
Ladder error
Operation error
Operation err
32
33
FNC290-FNC299
Extension File
Register
FNC280-FNC289
High Speed
Processing 2
Runtime error
SFB error
34
SFCSTL
Programming
37.3
GX Developer
English version
1) M8060,M8061,M8064 to M8067 are cleared when the PLC mode switches from STOP to RUN.
Note that M8068 and D8068 do not clear.
3) If the unit or block corresponding to a programmed I/O number is not actually loaded, M8060 is set to ON
and the first device number of the erroneous block is written to D8060.
37
Error Code
36
Special Device
2) When turning M8069 ON in advance, PLC will enter STOP mode (as M8061 PLC hardware error occurs)
if a failure occurs in an I/O extension unit, an extension power supply module, or an extension unit/block.
When turning M8069 ON, PLC executes I/O bus check. If an error is found, error code 6103 or 6104 is
stored to D8061, and M8061 turns ON.
When error code 6104 is stored, M8009 turns ON, and the PLC stores the I/O numbers following the
extension power supply module or the powered extension unit with DC 24V output failure to D8009.
35
Interrupt
Function
When the M8060, M8061, M8064 to M8067 turn ON, the smallest ON device number is stored in D8004, and
M8004 turns ON.
Version Up
Information
4) When a device number is specified directly or indirectly with an index by the LD, AND, OR or OUT
instruction, and if the device numbers specified in those instructions are not actually loaded, M8316 will
turn ON and the error step number in the instruction will be written to D8317 (high-order bits) and D8316
(low-order bits).
B
Execution Times
C
Applicable
Instruction List
859
M8069
I/O
bus check
D8009
D8060
D8061
D8004
D8063
D8438
D8064
D8065
D8066
D8067
Special M number
(smallest device
number) of error
occurrence
M8004
ON when an error
occurs
After clearing errors, forcibly clear M8068 using the device monitor function in a programming tool.
M8316
D8449
M8318
Unconnected I/O
designation error
BFM initialization failure
M8449
D8319
PLC
status
When power
is turned from
OFF to ON
Other timing
Unlit
RUN
Check
Check
Lit
STOP
Check
Always
Unlit
RUN
Unlit
RUN
Flickering
STOP
Flickering
STOP
Flickering
STOP
Error item
Unlit
RUN
Unlit
RUN
Check
Check
RUN mode
Unlit
RUN
Always
Unlit
RUN
RUN mode
Unlit
RUN
Check
Unlit
RUN
860
Always
31
Contents of error
Action
33
34
SFCSTL
Programming
No error
Parity, overrun or framing error
3802
3803
3804
3805
3806
3807
Command error
Continues
operation
3812
3813
3814
3820
No error
Operation circuit error
6103
6104
6105
B
Execution Times
Version Up
Information
Stops
operation
Error Code
RAM error
6102
6107
36
37
6101
6106
35
Special Device
3808
Interrupt
Function
3801
FNC290-FNC299
Extension File
Register
Example:
1020
32
FNC280-FNC289
High Speed
Processing 2
Error
code
FNC275-FNC279
Data
Transfer 3
37.4
C
Applicable
Instruction List
861
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
Error
code
PLC operation at
error occurrence
Contents of error
Action
6201
6202
6203
6204
No error
Parity, overrun or framing error
Continues
operation
6205
No error
6301
6302
6303
6304
6305
Command error
6306
6307
Continues
operation
6308
6312
6313
6314
6320
No error
6401
6402
6403
6404
6405
6406
6407
6409
No error
Incorrect combination of instruction, device symbol
and device number
6501
6502
6503
6504
Stops
operation
6505
6506
Invalid instruction
6507
6508
6509
Other error
6510
862
Error
code
PLC operation at
error occurrence
Contents of error
Action
No error
LD, LDI is continuously used 9 times or more.
6611
6612
6615
No MPP instruction
6616
6617
6618
6619
6620
6621
Stops
operation
6624
No MCR instruction
6625
6626
6627
No STL instruction
6628
6629
No P or I (interrupt pointer)
6630
6631
6632
35
36
37
Error Code
No MC instruction
Special Device
No NEXT instruction
6623
34
Interrupt
Function
6622
33
SFCSTL
Programming
6614
FNC290-FNC299
Extension File
Register
6613
32
FNC280-FNC289
High Speed
Processing 2
6610
31
FNC275-FNC279
Data
Transfer 3
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
863
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
Error
code
PLC operation at
error occurrence
Contents of error
Action
No error
6701
6702
6703
6704
6705
6706
6707
6709
6710
6708
Continues
operation
6730
6732
6733
6734
6735
6736
6740
864
Error
code
PLC operation at
error occurrence
Contents of error
Action
6743
6744
32
6745
6747
6748
6749
6751
6752
6754
6755
B
Execution Times
6753
37
Version Up
Information
36
Error Code
Continues
operation
35
Special Device
34
Interrupt
Function
6750
33
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
6746
FNC280-FNC289
High Speed
Processing 2
6742
31
FNC275-FNC279
Data
Transfer 3
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
C
Applicable
Instruction List
865
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
Error
code
PLC operation at
error occurrence
Contents of error
Action
6757
6758
6759
6760
6762
6756
Continues
operation
6763
6764
6765
6770
6771
6772
6773
866
Error
code
PLC operation at
error occurrence
Contents of error
Action
*1
021
090*1
FROM/TO error
FNC290-FNC299
Extension File
Register
Continues
operation
*1.
32
FNC280-FNC289
High Speed
Processing 2
080*1
31
FNC275-FNC279
Data
Transfer 3
Error codes in shaded columns are added in FX3U and FX3UC PLCs.
33
34
SFCSTL
Programming
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
867
*1.
Model name
(Media model name is
shown below.)
Applicable GX Developer
version
Remarks
Ver.8.23Z or later
GX Developer
SWD5C(F)-GPPW-J
SWD5C(F)-GPPW-E
Ver.8.29F or later
2) FX3UC PLCs
FX3UC PLC
version
Model name
(Media model name is
shown below.)
Applicable GX Developer
version
Ver.1.00 or later
Ver.1.30 or later
Ver. 2.20 or later
Ver.8.13P or later
Ver.8.18U or later
GX Developer
SWD5C(F)-GPPW-J
SWD5C(F)-GPPW-E
Ver.8.23Z or later
*2.
Remarks
Ver.8.29F or later
2. In the case of programming tool (version) not applicable to FX3U and FX3UC PLCs (using an
alternative model)
Even using a programming tool not applicable to the FX3U and FX3UC PLCs, programming is enabled when
an alternative model is set.
In this case, however, programming is enabled only in the function ranges such as instructions, device ranges
and program sizes available in a PLC selected as the alternative model. In addition, use a programming tool
that can select either FX3U(C) or FX3UC to change parameters, i.e. memory capacity, file register capacity,
etc.
Model to be
programmed
FX3U PLC
FX3UC PLC
*3.
868
Model to be set
FX3U(C)*3
FX3UC
FX2N
FX2
*3
FX3UC
FX2N
FX2
FX3U(C)
31
When any of the following interfaces are used for GX Developer (Ver.8.13P or later), reading and writing of
programs and monitoring of devices can be executed at high speed (115.2 kbps) in the FX3U and FX3UC
PLCs.
Ver.7.00A or later
Writing in the instruction and device ranges during RUN is supported in FX2N
PLCs Ver.3.00 or later.
Ver.8.13P or later
Writing in the instruction and device ranges during RUN is supported in FX3UC
PLCs Ver.1.00 or later.
Ver.8.18U or later
Writing in the instruction and device ranges during RUN is supported in FX3UC
PLCs Ver.1.30 or later.
Ver.8.23Z or later
Writing in the instruction and device ranges during RUN is supported in FX3U
and FX3UC PLCs Ver.2.20 or later.
Writing in the instruction and device ranges during RUN is supported in FX3U
and FX3UC PLCs Ver. 2.30 or later
Ver.1.00 or later
Writing in the instruction and device ranges during RUN is supported in FX2
PLCs Ver.3.30 or later.
Ver.2.00 or later
Writing in the instruction and device ranges during RUN is supported in FX2N
PLCs Ver.1.00 or later.
Ver.4.20 or later
Writing in the instruction and device ranges during RUN is supported in FX2N
PLCs Ver.3.00 or later.
GX Developer
FX-PCS/WIN(-E)
37
Caution
Built-in RAM and optional memory cassette (whose write protect switch is set
to OFF)
36
B
Execution Times
Version Up
Information
35
Error Code
Ver.2.00A or later
Special Device
Remarks
Writing in the instruction and device ranges during RUN is supported in FX2N
PLCs Ver.1.00 or later.
Interrupt
Function
Version
34
SFCSTL
Programming
In the FX3U and FX3UC PLCs, writing is enabled during RUN (program changes during RUN mode) using the
following programming tools.
For the operating procedure of and cautions on writing during RUN,
refer to the respective programming tool manual.
33
FNC290-FNC299
Extension File
Register
32
FNC280-FNC289
High Speed
Processing 2
FNC275-FNC279
Data
Transfer 3
C
Applicable
Instruction List
869
Item
Caution
Circuit blocks in which labels P and I are added, deleted or changed in edited
circuits
Circuit blocks in which 1-ms timers (T246 to T249 and T255 to T511) are
added in edited circuits
Circuit blocks in which the following instructions are included in edited circuits
Instruction to output high speed counters C235 to C255 (OUT instruction)
SORT2 (FNC149), TBL (FNC152), RBFM (FNC278) and/or WBFM
(FNC279) instruction
During RUN ,avoid writing to a circuit block including the following instructions
under execution. If writing is executed during RUN to such a circuit block, the
PLC decelerates and stops pulse output.
DSZR (FNC150), DVIT (FNC151), ZRN (FNC156), PLSV (FNC157)
instruction [with acceleration/deceleration operation], DRVI (FNC158) and/
or DRVA (FNC159) instruction
During RUN ,avoid writing to a circuit block including the following instruction
under execution. If writing is executed during RUN to such a circuit block, the
PLC immediately stops pulse output.
PLSV (FNC157) instruction [without acceleration/deceleration operation]
During RUN ,avoid writing to a circuit block including the following instructions
under execution of communication. If write during RUN is executed to such a
circuit block, the PLC may stop communication after that.
If the PLC stops communication, set the PLC to the STOP mode once, and
then set it to the RUN mode again.
IVCK (FNC270), IVDR (FNC271), IVRD (FNC272), IVWR (FNC273) and/or
IVBWR (FNC274) instruction
When writing is completed during RUN 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 writing is completed during RUN 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 to execute the instruction for falling edge pulse.
When writing is completed during RUN for a circuit including an instruction
for rising edge pulse, the instruction for rising edge pulse is executed if a
target device of the instruction for rising edge pulse or the operation
condition device is ON.
Target instructions for rising edge pulse: LDP, ANDP, ORP, and pulse
operation type applied instructions (such as MOVP)
While write during RUN is
executed
Instruction for
rising edge
pulse
OFF
Not executed
ON
*1.
870
*1
Executed
Instruction for
falling edge
pulse
Not executed
Not executed
31
When writing to a circuit block during RUN, which includes the following instructions, the
following results.
Pulse instruction during rising edge of operation results (MEP instruction)
After writing to the circuit with MEP instructions during RUN, the MEP instruction result
turns ON (conductive) while the operation results leading up to the MEP instruction are
ON.
Pulse instruction during falling edge of operation results (MEF instruction)
After writing to the circuit with MEF instructions during RUN, the MEF instruction result
turns OFF (non-conductive), regardless of the operation results up to the MEF instruction.
The operation results of the MEF instruction turns ON (conductive) when the operation
results leading up to the MEF instruction are turned OFF.
MEF instruction
OFF
OFF
(non-conductive)
OFF
(non-conductive)
ON
ON
(conductive)
OFF
(non-conductive)
When GX Developer Ver. 8.13 or later is used to write during RUN, the following results.
If the number of program steps is reduced by deleting contact or coil application
instructions, etc., the program becomes shorter by the number of reduced steps.
34
SFCSTL
Programming
Other
MEP instruction
33
FNC290-FNC299
Extension File
Register
32
FNC280-FNC289
High Speed
Processing 2
Caution Description
FNC275-FNC279
Data
Transfer 3
Item
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
871
Appendix A-1-3 Cautions on using transparent function by way of USB in GOT1000 Series
When monitoring circuits, device registration, etc. or reading/writing programs in an FX3U or FX3UC PLC from
GX Developer Ver.8.22Y or later using the transparent function by way of USB in the GOT1000 Series, make
sure to execute the following settings.
If the following setting is not provided, a communication error occurs.
When using transparent function by way of
USB in GOT1000 Series
Double-click it.
872
31
GX Developer
When using
transparent function in
GOT-F900 Series
*1.
GX Developer
Ver.8.13P or later
33
FNC290-FNC299
Extension File
Register
When directly
connecting GX
Developer to PLC
Ver.8.12N or earlier*1
32
FNC280-FNC289
High Speed
Processing 2
When monitoring circuits, device registration, etc. in an FX3U or FX3UC PLC from GX Developer Ver. 8.13P or
later using the transparent (2-port) function in the GOT-F900 Series, make sure to execute the following
settings.
If the following setting is not provided, monitoring cannot be normally executed .
FNC275-FNC279
Data
Transfer 3
34
2. Double-click [PLC module] in [PLC side I/F] to open [PLC side I/F Detailed setting of PLC
module] dialog box.
SFCSTL
Programming
35
3. Put a check mark in the check box [via GOT-F900 transparent mode] as shown below.
Interrupt
Function
Double-click it.
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
873
Applicable Versions
GOT1000 Series
ALL versions
Cautions
This product is compatible with the FX3U/FX3UC device range, however confirm with the GOT manual
regarding other compatible items.
Applicability
Remarks
Applicable
The GOT1000 Series is applicable to the device ranges in the FX3U/FX3UC PLCs.
(From first product) Check the applicability of other items in the GOT manual.
F940WGOT
Not applicable
F940GOT,
F940 Handy GOT
Not applicable
F930GOT (-K)
Not applicable
F920GOT (-K)
Not applicable
Contents of restrictions
Programming is enabled only in the function ranges such as instructions, device
ranges and program sizes available in the FX2N and FX2NC PLCs.
For applicable models, refer to the GOT manual.
ET-940
Not applicable
FX-10DM (-SET0)
Not applicable
Contents of restrictions
Programming is enabled only in the function ranges such as instructions, device
ranges and program sizes available in the FX2N and FX2NC PLCs.
For supported models and device ranges, refer to the FX-10DM
USERS MANUAL (Manual No. JY992D86401).
The following restriction applies when connected.
FX-10DU
*1.
874
Not applicable
Contents of restrictions
It is limited to the device range and function range supported by the highest class
model (FX2N or FX2) applicable in the product version.
For supported models and device ranges, refer to the FX-10DU
Operation Manual (Manual No. JY992D34701).
The F940GOT and ET-940 whose version is former than Ver.1.10 do not support the transparent (2port) function of the GX Developer.
31
FNC275-FNC279
Data
Transfer 3
D8001
33
FNC290-FNC299
Extension File
Register
Right side
MODEL
PROGRAMMABLE
CONTROLLER
FX3U-48MR/ES
35
Interrupt
Function
570001
SERIAL
34
SFCSTL
Programming
MITSUBISHI
32
FNC280-FNC289
High Speed
Processing 2
Special data register D8001 (decimal) contains information for determining the PLC version. Or for the FX3U
and FX3UC PLCs, the PLC version can be verified in "PLC Status" within the display module.
For the operating procedure of the display module,
refer to the Hardware Edition Manual of the PLC to be checked.
36
Special Device
Control number
Month (Example: July):(1 to 9 = January to September,
X = October, Y = November, Z = December)
Year (Example: 2005): Last digit of year
37
Version
Ver.2.20
Manufacturers
serial number
55****
(May, 2005)
First product (supporting the functions described as "Ver.2.20 or later" in this manual)
Corresponds to FX3UC PLC Ver. 2.20.
A
Version Up
Information
Ver. 2.30
Error Code
For the method to look at the manufacturers serial number, refer to Appendix A-3-2.
B
Execution Times
C
Applicable
Instruction List
875
Manufacturers
serial number
Ver.1.00
41****
(January, 2004)
Ver.1.20
44****
(April, 2004)
Ver.1.30
48****
(August, 2004)
Ver.2.20
Ver. 2.30
Ver. 2.41
79*****1
FX3UC-MT/D, DSS (First product)
(September, 2007)
*1.
876
55****
(May, 2005)
The FX3UC-32MT-LT supports Ver.2.41 from the manufacturers serial number "7X****" (October
2007).
For the method to look at the manufacturers serial number, refer to Appendix A-3-2
31
FNC275-FNC279
Data
Transfer 3
32
The instruction execution time in FX3U and FX3UC PLCs is as shown below:
FNC280-FNC289
High Speed
Processing 2
Measurement condition
High speed counters and interrupt instructions (I) are not used together.
In operands, data registers are used as target devices.
33
FNC290-FNC299
Extension File
Register
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
34
LD
0.065
LDI
0.065
7.8
LDF
7.8
AND
0.065
ANI
0.065
7.5
ANF
7.5
0.065
ORI
0.065
ORP
7.4
ORF
7.4
37
Error Code
36
Special Device
ANP
OR
35
Interrupt
Function
LDP
SFCSTL
Programming
Contact instructions
Connection instructions
ANB
0.065
ORB
0.065
0.065
MRD
0.065
0.065
INV
0.065
MEP
3.4
MEF
3.4
Output instructions
OUT Y,M
0.065
4.8
4.8
OUT T K
0.71
0.71
877
C
Applicable
Instruction List
OUT S
Execution Times
MPP
Version Up
Information
MPS
Instruction
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
Output instructions
OUT T D
0.71
0.71
OUT C K
0.71
6.1
0.71
6.1
C235 to C255
9.5 s in execution in ON status
9.0 s in execution in OFF status
OUT C D
0.71
6.1
0.71
6.1
C235 to C255
9.5 s in execution in ON status
9.0 s in execution in OFF status
SET Y,M
0.065
SET S
n: Number of recombination
4.7 s when there is no
recombination
0.13
RST Y,M
0.065
RST S
4.6
RST T
0.13
0.45
0.45
RST C
0.45
5.8
0.45
4.8
RST D
5.4
0.195
PLS Y,M
0.257
PLF Y,M
0.257
4.3
4.7
MCR
3.9
Other instruction
NOP
0.065
End instruction
END
*1.
*2.
*3.
M3584 to M7679
32-bit instruction
32-bit instruction
STL
5.1 + 1.6n
RET
2.9
878
Remarks
n: Number of recombination
n = 0: When there is no
recombination
31
Instruction
32-bit instruction
16-bit instruction
0.065
I***
0.065
Remarks
32-bit instruction
32
FNC280-FNC289
High Speed
Processing 2
P***
FNC275-FNC279
Data
Transfer 3
32-bit instruction
16-bit instruction
32-bit instruction
33
Remarks
FNC290-FNC299
Extension File
Register
FNC
Instruction
No.
Program flow
0.195
0.195
SRET
03
IRET
4.4
04
EI
3.8
05
DI
3.7
CJ
CALL
02
113.9 + 2.13X +
3.25Y
FEND
07
WDT
5.4
08
FOR
09
NEXT
11.6
(FOR + NEXT)
0.065
16.0
0.455
0.845
11
ZCP
18.9
19.7
0.585
1.105
12
MOV
0.64
1.48
0.32
1.48
13
SMOV
22.9
0.715
14
CML
10.6
10.2
0.325
0.585
15
BMOV
13.9 + 0.44n
0.455
16
FMOV
14.2 + 0.19n
14.0 + 0.38n
0.455
0.845
17
XCH
10.7
11.4
0.325
0.585
18
BCD
11.0
15.5
0.325
0.585
19
BIN
7.5
8.4
0.325
0.585
36
For details, refer to
Appendix B-6-2.
37
Error Code
CMP
Special Device
10
8.5
0.455
0.845
SUB
8.1
8.5
0.455
0.845
22
MUL
7.0
7.3
0.455
0.845
23
DIV
8.2
8.6
0.455
0.845
24
INC
6.2
6.4
0.195
0.325
25
DEC
6.2
6.4
0.195
0.325
26
WAND
7.0
7.3
0.455
0.845
27
WOR
7.0
7.3
0.455
0.845
28
WXOR
7.0
7.3
0.455
0.845
29
NEG
7.6
8.0
0.195
0.325
B
Execution Times
ADD
21
Version Up
Information
20
35
Interrupt
Function
06
34
SFCSTL
Programming
8.0
13.5
(CALL+SRET)
00
01
C
Applicable
Instruction List
879
FNC
Instruction
No.
16-bit instruction
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
ROR
10.5
11.5
0.325
0.585
31
ROL
10.5
11.5
0.325
0.585
32
RCR
10.9
11.8
0.325
0.585
33
RCL
10.9
11.8
0.325
0.585
34
SFTR
23.2 + 0.08n
0.585
35
SFTL
23.2 + 0.08n
0.585
36
WSFR
7.5 + 0.44n
0.585
37
WSFL
7.5 + 0.44n
0.585
38
SFWR
8.1
0.455
39
SFRD
7.7
0.455
11.1 + 0.19n
0.325
ZRST(T)
17.1 + 0.23n
0.325
ZRST(M)
20.7 + 0.02n
0.325
0.455
Data operation
ZRST(D)
40
41
DECO
13.5
42
ENCO
18.0
0.455
43
SUM
12.7
16.9
0.325
0.585
44
BON
14.4
15.1
0.455
0.845
45
MEAN
11.8 + 0.41n
17.8 + 2.13n
0.455
0.845
46
ANS
20.4
19.7
47
ANR
7.0
0.065
48
SQR
9.7
12.1
0.325
0.585
49
FLT
9.8
9.5
0.325
0.585
REF
4.5 + 1.39n
0.325
51
REFF
14.4 + 0.24n
0.195
52
MTR
5.9
5.5
53
HSCS
20.0
0.845
54
HSCR
20.0
0.845
55
HSZ
22.0
1.105
56
SPD
16.0
16.0
12.6
12.6
57
PLSY
20.0
13.6
6.9
6.9
58
PWM
10.6
6.2
59
PLSR
11.2
11.2
7.0
7.0
0.455
Handy instructions
60
IST
28.5
61
SER
16.4 + 1.4n
18.5 + 2.13n
0.585
1.105
62
ABSD
19 + 0.85n
20.0 + 1.23n
0.585
1.105
63
INCD
23.7
6.5
64
TTMR
10.4
9.2
65
STMR
19.0
21.0
66
ALT
11.6
0.2
67
RAMP
15.0
7.5
68
ROTC
25.8
24.8
69
SORT
18.4
6.6
880
31
Execution time in ON status (s)
16-bit instruction
32-bit instruction
32-bit instruction
FNC275-FNC279
Data
Transfer 3
FNC
Instruction
No.
Remarks
21.5
21.8
5.2
5.2
71
HKY
32.0
32.3
5.7
5.7
72
DSW
26.8
22.1
73
SEGD
10.8
0.325
74
SEGL
22.3
7.5
75
ARWS
28.8
5.2
76
ASC
19.8
0.715
77
PR
79
33
13.6
FROM
141 + 419n
119 + 841n
0.585
1.105
FROM*2
107 + 903n
119 + 1791n
0.585
1.105
FROM*3
27.9 + 108n
17.6 + 187.4n
0.585
1.105
TO*1
87 + 483n
73 + 967n
0.585
1.105
TO*2
73 + 967n
67 + 1923n
0.585
1.105
TO*3
96.7 + 119.2n
17.3 + 297.7n
0.585
1.105
When the instruction is executed to BFM #0 to BFM #31 in a special function block/unit for the FX0N/
FX2N/FX2NC Series or in the CC-Link/LT built in the FX3UC-32MT-LT
*2.
When the instruction is executed to BFM #32 or later in a special function block/unit for the FX0N/
FX2N/FX2NC Series or in the CC-Link/LT built in the FX3UC-32MT-LT
*3.
When the instruction is executed to a BFM in a special function block/unit for the FX3U/FX3UC Series
External FX device
5.7
PRUN
17.1 + 1.67n
18.2 + 2.9n
0.325
0.585
ASCI
13.5 + 1.45n
0.455
HEX
13.6 + 1.89n
0.455
84
CCD
13.6 + 1.63n
0.455
85
VRRD
86
VRSC
87
RS2
18.1
5.3
88
PID
20.0
8.9
81
82
83
89
36
37
Error Code
RS
Special Device
15.6
80
Data move 2
100
101
16.0
0.195
103 ZPOP
16.0
0.195
105
106
107
108
109
B
Execution Times
104
A
Version Up
Information
102 ZPUSH
35
Interrupt
Function
*1.
34
SFCSTL
Programming
24.0
*1
FNC290-FNC299
Extension File
Register
78
32
FNC280-FNC289
High Speed
Processing 2
70
C
Applicable
Instruction List
881
FNC
Instruction
No.
16-bit instruction
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
Floating point
110 ECMP
18.2
0.845
111 EZCP
21.6
1.105
112 EMOV
10.0
0.585
113
114
115
116 ESTR
27 + 1.7n + 1.26m
0.845
117 EVAL
26 + 3.8n
0.585
118 EBCD
10.0
0.585
119 EBIN
11.9
0.585
120 EADD
14.2
0.845
121 ESUB
14.2
0.845
122 EMUL
14.1
0.845
123 EDIV
17.7
0.845
124 EXP
11.9
0.585
125 LOGE
24.0
0.585
126 LOG10
24.3
0.585
127 ESQR
10.6
0.585
8.9
0.325
129 INT
13.2
13.0
0.325
0.585
130 SIN
12.0
0.585
128 ENEG
131 COS
23.2
0.585
132 TAN
12.0
0.585
133 ASIN
13.5
0.585
134 ACOS
13.5
0.585
135 ATAN
12.0
0.585
136 RAD
14.9
0.585
137 DEG
14.9
0.585
138
139
140 WSUM
11.7 + 0.38n
14.1 + 1.94n
0.455
0.845
141 WTOB
12.6 + 1.43n
0.455
142 BTOW
12.6 + 0.92n
0.455
Data operation 2
143 UNI
11.6 + 0.4n
0.455
144 DIS
10.6 + 0.2n
0.455
145
146
7.7
8.0
0.195
0.325
147 SWAP
148
149 SORT2
882
13.2
15.2
6.5
7.7
n: Number of character
digits
m: Number of digits in
decimal part
31
Execution time in ON status (s)
16-bit instruction
32-bit instruction
16-bit instruction
FNC275-FNC279
Data
Transfer 3
FNC
Instruction
No.
Remarks
32-bit instruction
Positioning control
170.0
7.0
178.0
178.0
7.1
7.1
152 TBL
*1
7.1
153
154
155 ABS
25.4
22.2
156 ZRN
58.0
62.0
7.1
7.1
144.0
144.0
7.1
7.1
158 DRVI
178.0
178.0
7.1
7.1
159 DRVA
178.0
178.0
7.1
7.1
*1.
33
The instruction execution time is as shown below depending on the executed positioning type
(instruction)
Positioning type
178.0 s
DPLSV instruction
144.0 s
DDRVI instruction
178.0 s
DRRVA instruction
178.0 s
35
0.715
161 TZCP
22.6
0.585
162 TADD
13.4
0.455
13.4
0.455
10.8
11.0
0.325
0.585
165 STOH
11.4
11.6
0.325
0.585
166 TRD
10.0
0.195
167 TWR
344.4
0.195
15.5
16.1
15.2
15.9
170 GRY
10.2
10.7
0.325
0.585
171 GBIN
15.4
16.0
0.325
0.585
169 HOUR
36
Special Device
163 TSUB
164 HTOS
Interrupt
Function
160 TCMP
168
37
External device
177
1404
0.455
FX0N-3A
1828
0.455
FX2N-2AD
WR3A(3A)
1466
0.455
FX0N-3A
WR3A(2DA)
2919
0.455
FX2N-2DA
33.7
0.325
8.5
0.195
A
Version Up
Information
RD3A(3A)
RD3A(2AD)
Error Code
176
Extension function
180
Other instructions
181
182 COMRD
184 RND
185
186 DUTY
187
188 CRC
6.0
12.6 + 0.82n
0.455
14.8
0.845
C
Applicable
Instruction List
189 HCMOV
6.0
B
Execution Times
183
34
SFCSTL
Programming
FNC290-FNC299
Extension File
Register
157 PLSV
32
FNC280-FNC289
High Speed
Processing 2
150 DSZR
151 DVIT
883
FNC
Instruction
No.
16-bit instruction
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
191
192 BK+
13.1 + 0.66n
13.9 + 1.23n
0.585
1.105
193 BK-
13.1 + 0.66n
13.9 + 1.23n
0.585
1.105
194 BKCMP=
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
195 BKCMP>
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
196 BKCMP<
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
197 BKCMP<>
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
198 BKCMP<=
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
199 BKCMP>=
19.6 + 1.88n
20.3 + 2.26n
0.585
1.105
200 STR
34.6
47.0
0.455
0.845
201 VAL
20.7
29.2
0.455
0.845
202 $+
24.8 + 1.5m
0.455
m: Number of character
strings
203 LEN
12 + 0.44m
0.325
m: Number of character
strings
204 RIGHT
18.1 + 1.06n +
0.47m
0.455
n: Number of character
strings
m: Number of character data
205 LEFT
18.1 + 0.74n +
0.44m
0.455
n: Number of character
strings
m: Number of character data
206 MIDR
25 + 0.59n + 0.68m
0.455
n: Character position
m: Number of characters
207 MIDW
0.455
n: Character position
m: Number of stored
characters
208 INSTR
20.6 + 2.98m
0.585
209 $MOV
16 + 1.52n
0.325
*1.
m: Number of searched
characters*1
Number of characters from the head of the searched character string to detected character
Data operation 3
210 FDEL
43 + 0.95m
211 FINS
63 + 0.98m
212 POP
7.8
0.455
213 SFR
9.3
0.325
214 SFL
9.3
0.325
215
216
217
218
219
884
*2.
*3.
31
Execution time in ON status (s)
16-bit instruction
32-bit instruction
16-bit instruction
32-bit instruction
FNC275-FNC279
Data
Transfer 3
FNC
Instruction
No.
Remarks
Data comparison
220
221
222
223
224 LD=
1.22
1.48
1.22
1.48
225 LD>
1.22
1.48
1.22
1.48
226 LD<
1.22
1.48
1.22
1.48
228 LD<>
1.22
1.48
1.22
1.48
FNC290-FNC299
Extension File
Register
229 LD<=
1.22
1.48
1.22
1.48
34
230 LD>=
1.22
1.48
1.22
1.48
232 AND=
1.22
1.48
1.22
1.48
233 ADN>
1.22
1.48
1.22
1.48
234 AND<
1.22
1.48
1.22
1.48
1.22
1.48
1.22
1.48
236 AND<>
1.48
1.22
1.48
238 AND>=
1.22
1.48
1.22
1.48
240 OR=
1.22
1.48
1.22
1.48
241 OR>
1.22
1.48
1.22
1.48
242 OR<
1.22
1.48
1.22
1.48
239
243
1.22
1.48
1.22
1.48
245 OR<=
1.22
1.48
1.22
1.48
246 OR>=
1.22
1.48
1.22
1.48
248
249
B
Execution Times
247
A
Version Up
Information
244 OR<>
37
Error Code
1.22
36
Special Device
237 AND<=
35
Interrupt
Function
235
33
SFCSTL
Programming
231
FNC280-FNC289
High Speed
Processing 2
227
32
C
Applicable
Instruction List
885
FNC
Instruction
No.
32-bit instruction
16-bit instruction
32-bit instruction
Remarks
251
252
253
254
255
256 LIMIT
8.1
8.6
0.585
1.105
257 BAND
8.1
8.6
0.585
1.105
258 ZONE
7.9
8.5
0.585
1.105
259 SCL
15.9
16.8
0.455
0.845
260 DABIN
13.7
19.5
0.325
0.585
261 BINDA
16.7
23.1
0.325
0.585
262
263
264
265
266
267
268
269 SCL2
2.79 + 5.21n
29.06 + 7.94n
0.455
0.845
n: Number of data
14.1
6.5
271 IVDR
14.1
6.5
272 IVRD
16.2
6.5
273 IVWR
16.2
6.5
274 IVBWR
20.0
6.5
Data move 3
275
276
277
278
279
50+900n
0.715
*2
244 + 103n
0.715
*1
50+900n
0.715
292 + 116n
0.715
RBFM*1
RBFM
WBFM
WBFM*2
*1.
When the instruction is executed to a BFM in a special function block/unit for the FX0N/FX2N/FX2NC
Series or in the CC-Link/LT built in the FX3UC-32MT-LT
*2.
When the instruction is executed to a BFM in a special function block/unit for the FX3U/FX3UC Series
30.0
1.365
281
282
283
284
285
286
287
288
289
280 HSCT
886
31
Execution time in ON status (s)
16-bit instruction
32-bit instruction
16-bit instruction
32-bit instruction
FNC275-FNC279
Data
Transfer 3
FNC
Instruction
No.
Remarks
0.325
166n
6.4
292 INITR
17600n
0.325
293 LOGR
244 + 17.9n
0.715
294 RWER
46700n
0.325
295 INITER
17300n
0.325
296
to
299
32
n: Number of write target
sectors
33
FNC290-FNC299
Extension File
Register
13.2 + 0.44n
Execution time
Execution time at rising edge of input: Execution time in ON status
34
Remarks
1.22 s in MOVP instruction
SFCSTL
Programming
Applied instruction
FNC280-FNC289
High Speed
Processing 2
290 LOADR
291 SAVER
35
Interrupt
Function
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
887
Condition
Without indexing
With indexing
Bit specification
Bit device
Word device
Command
contact
ON
S (source)
KnY,KnM,KnS
T,C,D
KnY,KnM,KnS
T,C,D
R
16.9
U\G*2
214.7
KnX,KnY,KnM,KnS
15.5
12.1
13.8
U\G
212.9
18.6
16.6
T,C,D
12.1
10.4
209.7
16.6
14.5
14.8
212.8
13.8
0.64*1
10.4
12.1
211.3
16.9
14.8
15.1
213.1
U\G*2
131.8
128.5
130.2
377.9
133.1
129.9
131.5
379.4
10.8
210.1
15.4
13.3
13.6
211.6
K,H
*1
12.5
0.64
KnX,KnY,KnM,KnS
0.32*1
T,C,D
R
OFF
0.325
U\G*2
0.32*1
K,H
*1.
These combinations are handled as exceptions because high speed processing is adopted in the
technique.
*2.
When the instruction is executed for a BFM in a special extension block/unit for FX3U/FX3UC Series.
Command
contact
KnX,KnY,KnM,KnS
15.5
12.4
13.8
311.1
18.7
17.0
17.1
U\G*2
313.0
T,C,D
12.4
10.7
307.4
17.0
15.2
15.3
310.5
ON
13.8
1.48*1
10.7
12.2
308.9
17.1
15.3
15.4
310.6
199.8
195.9
197.4
542.6
201.2
197.3
198.8
544.0
13.0
1.48*1
11.4
308.0
16.2
14.4
14.5
309.7
OFF
U\G*2
K,H
KnX,KnY,KnM,KnS
T,C,D
R
KnY,KnM,KnS
U\G*2
K,H
888
S (source)
T,C,D
U\G*2
KnY,KnM,KnS
T,C,D
1.48*1
0.585
1.48*1
*1.
These combinations are handled as exceptions because high speed processing is adopted in the
technique.
*2.
When the instruction is executed for a BFM in a special extension block/unit for FX3U/FX3UC Series.
31
FNC275-FNC279
Data
Transfer 3
S (source)
T,C,D
13.0
T,C,D
U\G*2
13.0
14.7
133.1
KnY,KnM,
KnS
19.4
11.3
129.9
17.4
*1
T,C,D
U\G*2
17.4
17.6
134.7
15.4
15.7
132.8
14.7
1.22
11.3
12.9
131.4
17.6
15.7
16.0
133.1
U\G*2
133.0
129.3
131.4
298.2
134.3
131.0
138.9
299.4
K,H
13.4
1.22*1
11.7
130.2
16.3
14.2
14.5
131.6
These combinations are handled as exceptions because high speed processing is adopted in the
technique.
*2.
When the instruction is executed for a BFM in a special extension block/unit for FX3U/FX3UC Series.
34
D (destination)
KnX,KnY,KnM,KnS
T,C,D
U\G*2
13.2
14.7
201.1
*1
KnY,KnM,
KnS
19.6
T,C,D
U\G*2
17.9
18.0
202.7
13.2
1.48
11.6
11.6
197.1
17.9
16.1
16.2
200.3
14.7
13.0
198.6
18.0
16.2
16.3
200.4
U\G*2
201.0
197.1
198.6
432.4
202.4
198.5
200.0
433.8
13.9
1.48*1
12.3
197.8
17.1
15.3
15.4
199.4
K,H
*1.
These combinations are handled as exceptions because high speed processing is adopted in the
technique.
*2.
When the instruction is executed for a BFM in a special extension block/unit for FX3U/FX3UC Series.
35
Interrupt
Function
T,C,D
R
SFCSTL
Programming
S (source)
33
FNC290-FNC299
Extension File
Register
*1.
32
FNC280-FNC289
High Speed
Processing 2
KnY,KnM,
KnS
KnX,KnY,KnM,KnS
16.2
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
889
10
11
Comparison instructions
12
13
14
15
Rotation instructions
16
Shift instructions
17
18
FNC
No.
Function
Ref.
Page
MOV
FNC 12
Move
228
SMOV
FNC 13
Shift Move
231
CML
FNC 14
Complement
233
BMOV
FNC 15
Block Move
235
FMOV
FNC 16
Fill Move
239
PRUN
FNC 81
442
XCH
FNC 17
Exchange
242
Mnemonic
DEG
FNC
No.
FNC137
Mnemonic
FNC
No.
FNC224
LD>
FNC225
LD<
FNC226
Ref.
Page
LD<>
FNC228
LD<=
FNC229
LD>=
FNC230
AND=
FNC232
AND>
FNC233
526
EMOV
470
HCMOV
586
Function
BCD
FNC 18
Conversion to
Binary Coded Decimal
244
BIN
FNC 19
Conversion to Binary
247
GRY
Decimal to
FNC170
Gray Code Conversion
GBIN
Gray Code to
FNC171
Decimal Conversion
FLT
FNC 49
Conversion to
Floating Point
319
INT
FNC129
Floating Point to
Integer Conversion
498
AND<
FNC234
EBCD
FNC118
482
AND<>
FNC236
EBIN
FNC119
Scientific Notation to
Floating Point Conversion
484
AND<=
FNC237
510
AND>=
FNC238
RAD
890
FNC
No.
FNC136
Ref.
Page
512
3. Comparison instructions
LD=
SWAP
Function
567
568
Function
Load Compare
S1
S2
Load Compare
S1
>
S2
Load Compare
S1
<
S2
Load Compare
S1
S2
Load Compare
S1
S2
Load Compare
S1
S2
AND Compare
S1
S2
AND Compare
S1
>
S2
AND Compare
S1
<
S2
AND Compare
S1
S2
AND Compare
S1
S2
AND Compare
S1
S2
Ref.
Page
651
651
651
651
651
651
654
654
654
654
654
654
Mnemonic
FNC
No.
FNC240
OR>
FNC241
FNC242
OR<>
FNC244
OR<=
FNC245
S1
S2
OR Compare
S1
>
S2
OR Compare
S1
<
S2
OR Compare
S1
S2
OR Compare
S1
S2
OR Compare
657
657
Mnemonic
DEC
657
657
FNC 25 Decrement
Ref.
Page
265
FNC
No.
32
Function
Ref.
Page
WAND
WOR
268
WXOR
270
266
FNC
No.
Function
Ref.
Page
SQR
317
CMP
FNC 10
Compare
223
ESQR
496
ZCP
FNC 11
Zone Compare
225
EXP
490
ECMP
466
LOGE
FNC125
468
Floating Point
Natural Logarithm
492
EZCP
HSCS
FNC 53
333
LOG10
FNC126
Floating Point
Common Logarithm
494
HSCR
FNC 54
338
SIN
500
HSZ
FNC 55
341
COS
502
TAN
503
HSCT
ASIN
504
ACOS
506
ATAN
508
RND
Random Number
FNC184
Generation
577
BKCMP=
FNC194
FNC195
BKCMP<
FNC196
BKCMP<= FNC198
BKCMP>= FNC199
S2
>
S2
<
S2
S2
S2
S2
709
598
598
7. Rotation instructions
598
598
598
598
Function
Ref.
Page
Function
FNC 30
Rotation Right
275
ROL
FNC 31
Rotation Left
277
RCR
FNC 32
279
RCL
FNC 33
281
Ref.
Page
37
8. Shift instructions
FNC
No.
Function
SFTL
285
SFR
645
SFL
647
WSFR
289
WSFL
291
Addition
251
SUB
FNC 21
Subtraction
254
MUL
FNC 22
Multiplication
257
DIV
FNC 23
Division
260
EADD
486
ESUB
487
SFWR
FNC 38
EMUL
FNC122
Floating Point M
Multiplication
488
SFRD
EDIV
489
POP
FNC212
BK+
592
BK-
595
INC
FNC 24
263
Shift Write
[FIFO/FILO Control]
Shift Last Data Read
[FILO Control]
293
296
642
C
Applicable
Instruction List
FNC 20
283
Execution Times
SFTR
ADD
Increment
Ref.
Page
36
Version Up
Information
FNC
No.
FNC
No.
35
ROR
Mnemonic
Mnemonic
34
Error Code
BKCMP<> FNC197
S2
Special Device
BKCMP>
Interrupt
Function
FNC246
33
SFCSTL
Programming
OR>=
S1
657
Function
657
FNC
No.
FNC290-FNC299
Extension File
Register
OR<
OR Compare
Ref.
Page
FNC280-FNC289
High Speed
Processing 2
OR=
Function
31
FNC275-FNC279
Data
Transfer 3
3. Comparison instructions
891
FNC
No.
Function
Ref.
Page
Function
Ref.
Page
RIGHT
FNC204
619
LEFT
FNC205
622
MIDR
FNC206
Random Selection of
Character Strings
625
MIDW
FNC207
Random Replacement of
Character Strings
628
INSTR
632
COMRD
574
ZRST
FNC 40
Zone Reset
299
DECO
FNC 41
Decode
302
ENCO
FNC 42
Encode
305
MEAN
FNC 45
Mean
312
WSUM
515
SUM
FNC 43
307
BON
FNC 44
310
NEG
FNC 29
Negation
272
ENEG
497
WTOB
517
BTOW
519
UNI
522
DIS
4-bit Grouping of
FNC144
Word Data
524
CJ
197
CCD
FNC 84
450
CALL
204
CRC
582
SRET
208
LIMIT
661
IRET
209
BAND
665
EI
211
ZONE
668
DI
212
SCL
FNC259
Scaling
(Coordinate by Point Data)
671
FEND
213
SCL2
FNC269
Scaling 2
(Coordinate by X/Y Data)
683
SORT
FNC 69
SORT2
527
SER
FNC 61
381
Check Code
400
FNC
No.
Function
Ref.
Page
FOR
218
NEXT
219
FNC
No.
Function
Ref.
Page
FDEL
638
REF
FNC 50 Refresh
322
FINS
640
REFF
326
Function
Ref.
Page
ESTR
FNC116
471
EVAL
FNC117
Character String to
Floating Point Conversion
477
STR
FNC200
604
Mnemonic
892
FNC
No.
Mnemonic
Mnemonic
FNC
No.
Function
Ref.
Page
TCMP
547
TZCP
549
TADD
552
TSUB
554
TRD
560
TWR
561
HTOS
FNC164
Hour to Second
Conversion
556
STOH
FNC165
Second to Hour
Conversion
558
VAL
FNC201
DABIN
Decimal ASCII to
FNC260
BIN Conversion
676
BINDA
679
ASCI
FNC 82
Hexadecimal to ASCII
Conversion
444
HEX
FNC 83
ASCII to
Conversion
447
Mnemonic
ABS
FNC155
DSZR
532
ZRN
538
Hexadecimal
609
$MOV
634
$+
614
LEN
FNC203
617
Function
Absolute Current Value
Read
Ref.
Page
537
Mnemonic
FNC
No.
Function
Ref.
Page
314
TBL
536
ANR
316
DVIT
534
HOUR
564
DRVI
542
DRVA
544
PLSV
540
PLSY
FNC 57
Pulse Y Output
356
FNC 59
Acceleration/Deceleration
Setup
PLSR
364
FNC
No.
Function
RAMP
395
SPD
352
PWM
361
DUTY
579
PID
455
33
ZPUSH
460
ZPOP
FNC103
463
TTMR
389
STMR
391
ABSD
384
INCD
FNC 63
FNC 80
Serial Communication
440
RS2
FNC 87
Serial Communication 2
453
IVCK
689
IVDR
691
ROTC
397
370
Incremental Drum
Sequencer
387
693
IVWR
695
MTR
329
TKY
404
HKY
408
DSW
Digital Switch
FNC 72
(Thumbwheel Input)
412
Ref.
Page
SEGD
415
SEGL
417
432
ARWS
422
ASC
427
PR
429
FNC274
Inverter Parameter
Block Write
697
FROM
FNC
No.
FNC 78
Function
FNC 79
Write To a Special
Function Block
437
RD3A
FNC176
569
WR3A
FNC177
Write to Dedicated
Analog Block
570
RBFM
701
WBFM
706
37
Function
A
Version Up
Information
Mnemonic
Ref.
Page
715
SAVER
FNC291 Save to ER
717
RWER
FNC294 Rewrite to ER
734
INITR
725
INITER
FNC295 Initialize ER
738
LOGR
729
B
Execution Times
LOADR
Function
Ref.
Page
WDT
FNC 07
215
ALT
FNC 66
Alternate State
393
Applicable
Instruction List
FNC
No.
36
Error Code
TO
35
Special Device
Interrupt
Function
IVRD
IST
34
SFCSTL
Programming
Ref.
Page
RS
IVBWR
32
FNC290-FNC299
Extension File
Register
ANS
Function
FNC280-FNC289
High Speed
Processing 2
Ref.
Page
Mnemonic
FNC
No.
31
FNC275-FNC279
Data
Transfer 3
893
FNC
No.
Function
Ref.
Page
Symbol
FNC
No.
BKCMP>= FNC199
$+
614
$MOV
634
Function
Block Data Compare
S1
S2
Ref.
Page
598
BMOV
235
BON
310
BTOW
519
204
ABS
FNC155
537
ABSD
FNC 62
384
CALL
506
CCD
450
197
ACOS
ADD
FNC 20
Addition
251
CJ
ALT
FNC 66
Alternate State
393
CML
FNC 14 Complement
233
CMP
FNC 10 Compare
223
COMRD
FNC182
AND<
AND<>
FNC234
FNC236
AND=
FNC232
AND>
FNC233
AND Compare
S1
<
S2
AND Compare
S1
S2
AND Compare
S1
S2
AND Compare
S1
>
S2
AND Compare
654
654
654
654
574
COS
502
CRC
582
D
Decimal ASCII to BIN
Conversion
DABIN
FNC260
676
DEC
FNC 25 Decrement
265
DECO
FNC 41 Decode
302
DEG
FNC137
DI
212
DIS
FNC144
4-bit Grouping of
Word Data
524
FNC237
AND>=
FNC238
ANR
FNC 47
Annunciator Reset
316
ANS
FNC 46
314
ARWS
FNC 75
Arrow Switch
422
DIV
FNC 23 Division
260
DRVA
544
DRVI
542
DSW
Digital Switch
FNC 72
(Thumbwheel Input)
412
DSZR
532
DUTY
579
DVIT
534
S1
S2
AND Compare
S1
S2
654
AND<=
ASC
654
FNC 76
427
ASCI
FNC 82
Hexadecimal to ASCII
Conversion
444
ASIN
504
ATAN
508
B
BAND
BCD
FNC 18
Conversion to Binary
Coded Decimal
244
BIN
FNC 19
Conversion to Binary
247
BINDA
FNC261
679
BK-
595
BK+
592
BKCMP<
FNC196
BKCMP<= FNC198
BKCMP<> FNC197
894
Mnemonic
BKCMP=
FNC194
BKCMP>
FNC195
<
S2
S2
S2
S2
>
S2
665
598
598
598
598
598
512
31
FNC
No.
Ref.
Page
Function
Mnemonic
FNC
No.
Function
Ref.
Page
I
FNC 24 Increment
263
INCD
Incremental Drum
FNC 63
Sequencer
387
32
INITER
FNC295 Initialize ER
738
ECMP
466
INITR
725
INSTR
EDIV
489
632
EI
FNC 04
211
INT
FNC129
498
EMOV
IRET
209
EMUL
FNC122
Floating Point
Multiplication
488
IST
370
IVBWR
ENCO
FNC 42
Encode
305
697
ENEG
497
IVCK
689
ESQR
ESTR
496
IVDR
691
IVRD
693
471
ESUB
487
IVWR
695
EVAL
Character String to
FNC117
Floating Point Conversion
477
EXP
490
EZCP
FNC111
470
468
F
FDEL
638
FEND
FNC 06
213
FINS
FLT
FNC 49
FMOV
FNC 16
Fill Move
239
FOR
FNC 08
218
FROM
FNC 78
432
319
FNC226
LD<>
FNC228
LD=
FNC224
LD>
FNC225
LD<=
FNC229
LD>=
FNC230
LEFT
FNC205
622
LEN
FNC203
617
568
LIMIT
661
LOADR
715
LOG10
494
492
S1
<
S2
Load Compare
S1
S2
Load Compare
S1
S2
Load Compare
S1
>
S2
Load Compare
S1
S2
Load Compare
S1
S2
651
651
651
651
651
651
FNC171
GRY
567
HCMOV
586
LOGE
HEX
FNC 83
ASCII to Hexadecimal
Conversion
447
LOGR
729
HKY
FNC 71
Hexadecimal Input
408
HOUR
564
MEAN
FNC 45 Mean
312
MIDR
Random Selection of
FNC206
Character Strings
625
MIDW
FNC207
MOV
FNC 12 Move
HSCR
FNC 54
338
HSCS
FNC 53
333
HSCT
FNC280
709
HSZ
FNC 55
341
HTOS
FNC164
556
628
228
MTR
329
MUL
FNC 22 Multiplication
257
NEG
FNC 29 Negation
272
NEXT
219
895
37
C
Applicable
Instruction List
Hour to Second
Conversion
Random Replacement of
Character Strings
36
Execution Times
GBIN
35
Error Code
G
Gray Code to Decimal
Conversion
LD<
640
Conversion
Point
Load Compare
34
Special Device
to
33
Version Up
Information
484
Interrupt
Function
EBIN
Scientific Notation to
FNC119
Floating Point Conversion
482
SFCSTL
Programming
EBCD
486
FNC290-FNC299
Extension File
Register
Enable Interrupt
INC
FNC280-FNC289
High Speed
Processing 2
EADD
FNC275-FNC279
Data
Transfer 3
Mnemonic
Mnemonic
FNC
No.
Function
Ref.
Page
O
OR<
OR<>
Mnemonic
FNC
No.
Function
Ref.
Page
S
FNC242
FNC244
OR=
FNC240
OR>
FNC241
OR<=
FNC245
OR>=
FNC246
OR Compare
S1
<
S2
OR Compare
S1
S2
OR Compare
S1
S2
OR Compare
S1
>
S2
OR Compare
S1
S2
OR Compare
S1
S2
657
657
657
657
657
657
SAVER
FNC291 Save to ER
717
SCL
Scaling
FNC259
(Coordinate by Point Data)
671
SCL2
FNC269
Scaling 2
(Coordinate by X/Y Data)
683
SEGD
415
SEGL
417
SER
381
SFL
647
SFR
645
SFRD
296
SFTL
285
SFTR
283
Shift Write
[FIFO/FILO Control]
FNC 88
455
SFWR
FNC 38
PLSR
FNC 59
Acceleration/Deceleration
Setup
364
SIN
500
231
FNC157
SMOV
PLSV
540
SORT
400
PLSY
FNC 57
Pulse Y Output
356
SORT2
527
SPD
352
SQR
317
PID
293
FNC212
642
PR
FNC 77
429
SRET
208
PRUN
FNC 81
442
STMR
391
PWM
FNC 58
361
STOH
FNC165
Second to Hour
Conversion
558
RAD
FNC136
510
STR
FNC200
604
RAMP
FNC 67
395
SUB
FNC 21 Subtraction
RBFM
701
SUM
307
526
TADD
552
TAN
503
TBL
FNC152
536
POP
RCL
FNC 33
281
SWAP
RCR
FNC 32
279
RD3A
FNC176
569
REF
FNC 50
Refresh
322
REFF
FNC 51
326
RIGHT
FNC204
619
RND
Random Number
FNC184
Generation
ROL
FNC 31
ROR
ROTC
254
TCMP
547
TKY
404
577
TO
FNC 79
Rotation Left
277
TRD
FNC 30
Rotation Right
275
TSUB
554
FNC 68
397
TTMR
389
RS
FNC 80
Serial Communication
440
TWR
561
RS2
FNC 87
Serial Communication 2
453
TZCP
549
RWER
FNC294 Rewrite to ER
734
U
FNC143 4-bit Linking of Word Data
522
UNI
Write To a Special
Function Block
437
560
V
VAL
896
FNC201
609
31
FNC
No.
Function
Ref.
Page
FNC275-FNC279
Data
Transfer 3
Mnemonic
W
FNC 26
266
WBFM
706
WDT
FNC 07
215
WOR
FNC 27
Logical Word OR
268
WR3A
FNC177
570
WSFL
FNC 37
291
WSFR
FNC 36
289
WSUM
WTOB
517
WXOR
FNC 28
Logical Exclusive OR
270
FNC 17
Exchange
242
ZCP
FNC 11
Zone Compare
225
ZONE
668
ZPOP
463
ZPUSH
FNC102
460
ZRN
538
ZRST
FNC 40
299
32
FNC280-FNC289
High Speed
Processing 2
WAND
33
FNC290-FNC299
Extension File
Register
515
X
XCH
34
SFCSTL
Programming
Interrupt
Function
Zone Reset
35
36
Special Device
37
Error Code
A
Version Up
Information
B
Execution Times
C
Applicable
Instruction List
897
D Discontinued models
898
FX-232AW
FX-232AWC
FX-25DU-E
D Discontinued models
D
Discontinued
models
MEMO
899
Warranty
Warranty
Please confirm the following product warranty details before using this product.
2)
900
2)
3. Overseas service
Overseas, repairs shall be accepted by Mitsubishi's local
overseas FA Center. Note that the repair conditions at
each FA Center may differ.
6. Product application
1)
2)
Revised History
Revised History
Date Created
Revision
Description
7/2005
First Edition
2/2006
Revision B
7.11 MEP, MEF
7.13 NOP
7.14 END
7.14 NOP
7.15 END
The FX3U-4AD, FX3U-4DA and FX3U-20SSC-H are added in the related manual
introduction paragraph.
Note on battery voltage drop is added [Subsection 2.6.2].
The expression of battery maintenance is modified [Subsection 2.6.3].
The contents of latched type device initialization methods are modified and added
[Subsection 2.6.5].
Caution on using header and terminator in RS2 instruction is added [Section 16.6].
Note on setting the clock data from the FX-10DU-E/20DU-E/25DU-E is added
[Section 21.8 and Subsection 36.2.7].
901
902
Revised History
Date Created
Revision
Description
3/2007
11/2007
MITSUBISHI ELECTRIC
HEADQUARTERS
MITSUBISHI ELECTRIC EUROPE B.V.
German Branch
Gothaer Strae 8
Phone: +49 (0)2102 / 486-0
Fax: +49 (0)2102 / 486-1120
MITSUBISHI ELECTRIC EUROPE B.V.
Czech Branch
Radlicka 714/113 a
Phone: +420 251 551 470
Fax: +420-251-551-471
MITSUBISHI ELECTRIC EUROPE B.V.
French Branch
25, Boulevard des Bouvets
Phone: +7 7212 / 50 11 50
Fax: +7 7212 / 50 11 50
CONSYS
Promyshlennaya st. 42
Tokyo 104-6212
Phone: +81 3 622 160 60
Fax: +81 3 622 160 75
MITSUBISHI ELECTRIC AUTOMATION
MITSUBISHI
ELECTRIC
FACTORY AUTOMATION
EURASIAN REPRESENTATIVES
KAZPROMAUTOMATICS Ltd.
Mustafina Str. 7/2
EUROPEAN REPRESENTATIVES
INTEHSIS srl
bld. Traian 23/1
EUROPEAN REPRESENTATIVES
GEVA
Wiener Strae 89
MIDDLE EAST
REPRESENTATIVE
TEXEL ELECTRONICS LTD.
2 Haumanut, P.O.B. 6272
Phone: +972 (0)9 / 863 08 91
Fax: +972 (0)9 / 885 24 30
AFRICAN REPRESENTATIVE
CBI Ltd.
Private Bag 2016
Phone: + 27 (0)11 / 928 2000
Fax: + 27 (0)11 / 392 2354
Mitsubishi Electric Europe B.V. /// FA - European Business Group /// Gothaer Strae 8 /// D-40880 Ratingen /// Germany
Tel.: +49(0)2102-4860 /// Fax: +49(0)2102-4861120 /// info@mitsubishi-automation.com /// www.mitsubishi-automation.com
Specifications subject to change /// 11.2007